- e1955dd36: Fixes broken patch build
- Updated dependencies [e1955dd36]
- @leafygreen-ui/[email protected]
- 53c67fba6: LG-4650: migrates from
yarn
topnpm
- Updated dependencies [53c67fba6]
- @leafygreen-ui/[email protected]
- Updated dependencies [274d7e1a7]
- @leafygreen-ui/[email protected]
- 7a83cd4c6: Adds
useMergeRefs
intouseMergeRef
directory
- 04bb887c0: Add
useMergeRefs
hook for merging array of refs into a single memoized callback ref ornull
- Updated dependencies [117a463f8]
- @leafygreen-ui/[email protected]
-
84028dc5d: Removes
useMemo
fromuseAvailableSpace
, which was preventing the hook from returning the correct value.On first render, the
triggerRef
is not available butuseViewportSize
is. When the menu is opened, thetriggerRef
is available but the viewport size remains the same so the memo callback is not triggered since refs do not trigger a re-render.Previously,
useViewportSize
returned null and then re-rendered with the correct dimensions, which would trigger the memo callback.These changes should affect the following components:
Select
Combobox
Menu
SearchInput
-
9776f5f42: Adds
useSsrCheck
and adds it to viewport check inuseViewportSize
.When server side rendering is used,
window
is not defined. This is causing build issues on the server where we accesswindow
inuseViewportSize
. To fix this, this change adds a hook,useSsrCheck
, that checks the rendering environment and can be used before attempting to accesswindow
. It adds a check of this touseViewportSize
to fix the current build issue.
- c1b8b633b: Fixes re-render after initial render of
useViewportSize
hook - fe2483937: Makes prefix argument optional for
useDynamicRefs
- 356a53fd: Update TS builds to use
[email protected]
- Updated dependencies [15185af0]
- Updated dependencies [356a53fd]
- Updated dependencies [66df9ab8]
- @leafygreen-ui/[email protected]
- e487fb24: Renames story files from
.story.tsx
to.stories.tsx
- 2bceccb1: Fixes
lodash
imports to use default exports of specific functions to reduce component's bundle size. - Updated dependencies [2bceccb1]
- @leafygreen-ui/[email protected]
- ffd11f24: - Extends
useControlledValue
to accept any type.- Adds
updateValue
function in return value. This method triggers a synthetic event to update the value of a controlled or uncontrolled component. - Adds
initialValue
argument. Used for setting the initial value for uncontrolled components. Without this we may encounter a React error for switching between controlled/uncontrolled inputs - The value of
isControlled
is now immutable after the first render
- Adds
- 7f38e78a: Updates test to import
renderHook
from@leafygreen-ui/testing-lib
- Updated dependencies [ffd11f24]
- Updated dependencies [ffd11f24]
- Updated dependencies [ffd11f24]
- @leafygreen-ui/[email protected]
- 89f439e8: - Makes
useDynamicRefs
prefix
argument optional- Adds tests to
useDynamicRefs
- Adds tests to
- fd907503: Updates
useControlledValue
hook to remove the controlled value from internal state. Instead the controlled value is consumed directly.
- c11bbc29: Fixes problem with ts-docs not being available in bundle.
- c15ee2ac: Fixes missing documentation file
- 215268ff: Updates build tooling. No functional changes
- 735342e9: Adds
useForceRerender
hook.
- d2ce54e2f: Updates story files for Storybook 7.x
- a3a52e131: Removes call to use React 18's useId hook if found
- 32b3d3146: Rewrites
useIdAllocator
hook so that it performs properly across client-side and server-side renders
- 8c0c2bdf9: Updates build script to include a transpiled copy of the story file in the bundle
- d351c02bc: Creates
useStateRef
- a combination of useState and useRef, that returns the current state, asetState
function, and agetState
function that will return the current walue of the state. This is useful to avoid referencing stale state inside callbacks
- c2c5601f4: Adds missing dependencies. Removes unused dependencies
- ec2a3d66d: Creates
useAutoScroll
to automatically scroll a container
- ffb99f417: Creates
useControlledValue
hook
- 405636249: Adds
useBackdropClick
hook. Fires a callback when any element except the provided foreground element(s) are clicked
- 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: Updates
tsdoc.json
file
- 8d7534e9: Adds
tsdoc.json
to published package files
- 6792bc44: Adds
useAvailableSpace
to calculate the available vertical space between an element and the viewport
- 63ddf39: - Adds useForwardedRef hook
- Adds useDynamicRefs hook
- 70f3c2c: Removes error message in useValidation when no prop is passed in
- d661688: Adds a useValidation hook, used in TextArea and TextInput
- 047c1930: Adds
useIdAllocator
hook
- 1ed17f68: Updates lodash to 4.17.21, as there's a vulnerability in 4.17.20 that's been resolved in 4.17.21
-
c18f16e6: The
useElementNode
hook has been removed. It's recommended to useuseState
directly instead.const [node, setNode] = useElementNode<HTMLDivElement>();
const [node, setNode] = useState<HTMLDivElement | null>(null);
- dac3f38b: Fixes a publishing error that prevented UMD modules from being distributed
- 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.
- d5d40791: Pin lodash version to latest to include fix for prototype pollution attack vulnerability.
- 8c867bb: Adds new useIsomorphicLayoutEffect hook
- e599707: Changes import pattern for Lodash method.
- 2c09c48: Added usePrevious hook
- add8745: Add
useObjectDependency
hook
- 691eb05: Better support for UMD
- fa55b3d: Make some hooks and MongoNav support server-side rendering
- d739511: The
once
option touseEventListener
has been merged together with theenabled
option.
- 1b298cc: Create usePoller hook.
- ac5c473: Adds lodash as dependency
- 464c09d: Introduces SSR compatibility though a change to our build process and files
- 3a24668: Adds useEscapeKey hook
- 7825641: Patches a bug in useEventListeners hook, to now ensure that
eventListener
is set or unset when enabled changes values