- ba855c702: Relints files according to ESLint migration
- 117a463f8: Exports
Deep*
types from package root
-
fbd0a7310: Adds multiple
Deep
TS utility types, andConcat
type.Concatenates two string literals with a separator.
type A = 'apple'; type B = 'banana'; Concat<A, B, '.'>; // 'apple.banana' string literal
Given some deep interface,
DeepKeys
returns all possible deep keys as a union of dot-separated string literals.interface MyInterface { a: { b: { c: any; d: any; }; e: any; }; f: any; } DeepKeys<MyInterface>; // 'a' | 'a.b' | 'a.b.c' | 'a.b.d' | 'a.e' | 'f'
Given some deep interface,
DeepPartial
returns a recursive partial of the given interface.interface MyInterface { a: { b: { c: any; d: any; }; e: any; }; f: any; } const x = { a: { b: { d: 'foo', }, }, } satisfies DeepPartial<MyInterface>;
Given some deep interface,
DeepPathValues
maps the deep keys of an object to their path values.interface MyInterface { a: { b: { c: any; d: any; }; e: any; }; f: any; } const x = { a: { b: { c: 'a.b.c', d: 'a.b.d', }, e: 'a.e', }, f: 'f', } satisfies DeepPathValues<MyInterface>;
Given some deep interface,
DeepPick
deeply picks the specified dot-separated keys from the objectinterface MyInterface { a: { b: { c: any; d: any; }; e: any; }; f: any; } DeepPick<MyInterface, 'a.b'>; // { a: { b: any } }
Given some deep constant,
DeepUnion
returns a recursive union the values for a given type.const MyObj = { a: { b: { c: 'carrot' }, d: 'dragon' } e: 'eggplant' } as const DeepUnion<typeof MyObj> // 'carrot' | 'dragon' | 'eggplant'
- 4c04aa0ee: Creates utility types
Only
,ExclusiveUnion
andValuesOf
- cfa830701: Fixes
RecursiveRecord
type
- 7a901b954: Adds
PartialRequired
andOptional
types
- 7bc4fcde: Adds
RecursiveRecord
type
- c3906f78: Adds
LgIdProps
which exports an interface to support['data-lgid']?: string;
, which can be extended inside components props.
- 66df9ab8: Creates
Mutable
utility type
- 15185af0: Imports Storybook utilities from
@lg-tools/storybook-utils
(previously imported from@leafygreen-ui/lib
) - 356a53fd: Update TS builds to use
[email protected]
- 2bceccb1: Fixes
lodash
imports to use default exports of specific functions to reduce component's bundle size.
- ffd11f24: Updates Typescript signature of
createSyntheticEvent
- ffd11f24: - Creates new utility functions
rollover
truncateStart
cloneReverse
isDefined
isZeroLike
&isNotZeroLike
- ffd11f24: Updates
target
type increateSyntheticEvent
to extendEventTarget
- 99848a0f: Adds
pickAndOnit
helper function
- dd4f3da8: Update mapped value of
Space
inkeyMap
object fromspace
to' '
.
- 3a9b274d: Updates
keyMap
object to map keys to eventkey
properties rather thankeyCode
properties, which are deprecated.
- 4fcf2e94: Modified the React peerDependency to ensure compatibility with either version 17 or 18.
- 4fcf2e94: Updates helper function,
isComponentType
and updatesExtendedComponentProps
type. - 4fcf2e94: Updates types with
React.PropsWithChildren
- c11bbc29: Fixes problem with ts-docs not being available in bundle.
- c15ee2ac: Fixes missing documentation file
- 215268ff: Updates build tooling. No functional changes
- 76161cf0: Adds types for GeneratedStory decorator
- 76161cf0: Exports ExtendedComponentProps & InstanceDecorator types. Adds
XP
(extra props) to StoryMetaType generic signature
- 76161cf0: Ensures
XP
is passed to theStoryFn
props inStoryType
. ExportsPlayFn
type
- d2ce54e2f: Updates story files for Storybook 7.x
- d2ce54e2f: Exports primary component props
- 0cd471676: Updates
isComponentType
to also check for a displayName inside render
- 55d33e435: Update to BaseFontSize prop control for .design live example
- cf00160ec: Updates TSDocs
- 111b680c5: Marks type of
storybookArgTypes
asconst
. Removes some default props fromStoryMeta
.StoryMeta
no longer excludeschildren
controls by default.
- 8c0c2bdf9: Updates build script to include a transpiled copy of the story file in the bundle
- c2c5601f4: Adds missing dependencies. Removes unused dependencies
- c727d8295: Adds
prop-types
as an explicit dependency of package
- 26e341a0b: Minor type fixes to
StoryMeta
function
- 2e8a572db: Improves array handling on StoryMeta factory function. Adds tests for factory function
- 4ccc353e7: Adds 'allEqual
util function
. Also removes circular dependency ingetTheme
. - 4ccc353e7: Excludes a few more storybook controls
- 0541bd776: Exports
StoryMeta
interface and factory function for generating Storybook default exports that are compatible with the new mongodb.design architecture - ec2a3d66d: Adds
createSyntheticEvent
to create a React SyntheticEvent
- 64eee134d: Adds additional storybook exports from
lib
- f2d63a60: Removes leafygreen data attributes (prefixed with
data-leafygreen-ui-
), and replaces them with deterministic classNames (prefixed withlg-ui-
)
- ab2fd6b3: Resolves broken builds, by removing erroneously included
package.tsconfig.json
- 24683433: - Remove an implicit dependency on
@emotion/react
fixing an issue where LG packages would not build if@leafygreen/[email protected]
or greater was installed.
- 3690df49: Exports storybook config objects, and package.tsconfig
- 3690df49: Updates Storybook configs
- 3690df49: Updates
tsdoc.json
file
- 8d7534e9: Adds
tsdoc.json
to published package files - Updated dependencies [8d7534e9]
- @leafygreen-ui/[email protected]
- 95f1e63a: Fixes a bad build where
getTheme
was not properly exported
- 99e20bb9: Reusable DarkModeProps and darkMode prop for LeafygreenProvider
- 85d46871: Adds
lodash
as an explicit dependency oflib
. Importslodash
utility in a tree-shakable way
- 422dbfcd: Adds
Backspace
andDelete
tokeyMap
- 2cf1bc4a: Adding prefix functionality to createUniqueClassName
- acd6919: Publish createUniqueClassName so className values can be shared across components without conflicts
- acd6919: Exports
getNodeTextContent
fromlib
- d661688: Adds basic console functions (error, warn, and log) wrapped in lodash.once
- cec710ad: Upgrades Polished to v4.1
- b8f03aa1: Bumps
react
peer dependency to v17
- Updated dependencies [f6e5655a]
- @leafygreen-ui/[email protected]
- 047c1930: Removes
IdAllocator
class from package. Moving forward, use theuseIdAllocator
hook from the hooks package instead. This was done to better support server-side rendering.
- 90321b36: Removes
validateAriaLabelProps
function from package. This can now be found in@leafygreen-ui/a11y
- 2f0775ec: Adds value for the left bracket key to enable easier handling of keyboard events for that key.
-
7df69248: Refactors the Toggle component to resolve bugs, improve maintainability, and improve accessibility for sighted and non-sighted users.
- Refactors the internal DOM structure of the component to be as accessible as possible, and uses the appropriate role.
- Restructures how the styles are structured in the component to improve maintainability.
- Slightly increases contrast of the "ON" and "OFF" labels in the default size to meet WCAG AA contrast guidelines.
- Hides the "ON" and "OFF" labels for screen readers so that only the current state of the Toggle is read.
- Enforces use of
aria-label
andaria-labelledby
so that Toggles always have screen reader accessible text associated with them. - Fixes a bug with the rendering of the focus state on Windows machines.
- Uses the LeafyGreen Provider to conditionally show the focus state based on how the user is interacting with the page.
Please read our upgrade guide for more information on these changes.
- ee7923d3: Updates
HTMLElementProps
type, now accepting a generic for describing a RefType
- 9ee1d5fc: The "prop-types" package has moved from being a peer dependency to an explicit dependency
- 5cf0c95c: Added
enforceExhaustive
helper
- dac3f38b: Fixes a publishing error that prevented UMD modules from being distributed
- Updated dependencies [dac3f38b]
- @leafygreen-ui/[email protected]
- 0267bfd2: The underlying structure of distributed module definition files have changed and now have official support for ES modules. Module definition files are now generated using Rollup instead of Webpack. This should not affect functionality, but some thorough testing and caution should be exercised when upgrading.
- Updated dependencies [0267bfd2]
- @leafygreen-ui/[email protected]
- 691eb05: Better support for UMD
- Updated dependencies [691eb05]
- @leafygreen-ui/[email protected]
- 6aadc0b: Make id generation deterministic using IdAllocator.create class. This improves the SSR compatibility of these components.
- 1aa26ee: Remove unnecessary testHelpers types
- a571361: Adds typeIs.array type guard method
- 2eba736: Remove testing library dependency
- 083eec3: Restore TS <3.8 compatibility that was broken from using the
import type
syntax.
- 1c797b3: Adds
OneOf
type helper
- 5aafd72: Adds Either utility type to lib
- da540d3: Adds RecursivePartial utility type to lib
- 704e25c: Adds missing testing library dependency
- 6eb9d26: Adds shared test helpers
- fabc1c9:
isComponentType
function now types the returned element more specifically, rather than just asReact.ReactElement
- 11b2217: Adds enumerated
aria-current
values to lib for general use
- Updated dependencies [bd3bcd9]
- @leafygreen-ui/[email protected]
- 464c09d: Introduces SSR compatibility though a change to our build process and files
- Updated dependencies [464c09d]
- @leafygreen-ui/[email protected]
- 2f9a300: Add
keyMap
to lib
- 9c45cb4: Add
isComponentType
function