-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
React18_integration_FINAL_v3 (#1926)
* adding back everything * update mdx-js package, update storybook peerDep react version * React.PropsWithChildren changeset * add transition changeset * formfooter changeset * guidecue changeset * lib changeset * modal changeset * numberInput changeset * remove position utils exports * portal changeset * revert search-input change * segmented-control changeset * side-nav changeset * guide-cue and side-nav changeset tweaks * side nav cs updates * add ticket to fail table skeleton test * table changeset * tooltip changeset * typo * changeset changes and modal changes * portal patch to major * fix some combobox tests * remove PropsWithChildren from Icon * missed some PropsWithChildren in Icon * remove PropsWithChildren from Logo * rm disabled from menu story * add back focus-visible to menu * missed one * remove PropsWithChildren from passeordInput and pipepline * tooltip changeset * tooltip changeset again * changeset for tools/build * number input changeset * test that first menu item is focused * menu, return single value instead of object * update polymorphic error comment * poly and guideCcue comments * guideCue comments * transition types updates * var for index * tooltip tests * updates submenu types, builds in react17/18 * React18 select internal props (#1927) * update select to accept internal props * fix * update changeset * updates changesets * react transition group changeset * code changeset * combobox changeset * icon changeset * lib changetset * update lib changeset * select changeset * testing-lib changeset * tooltip changeset * storybook tools changeset * update storybook changeset * fix lint * fix checks? * add internal prop to skipProps * testing * test changesets * update changesets * remove number-input CustomSelectMenuButton * update __INTERNAL__menuButtonSlotProps__ type * add focusTrapOptions type * revert menu changes * fix TS error * remoe table todo * fix validate errors * fix syntax * remove disabled from headerRow story * remove table README changeset
- Loading branch information
Showing
117 changed files
with
2,918 additions
and
5,522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/form-footer': patch | ||
--- | ||
|
||
Updates `PrimaryButton` type from `React.ReactChild` to `React.ReactElement`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/testing-lib': patch | ||
--- | ||
|
||
Fixes `isPromiseLike` TS errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/portal': major | ||
--- | ||
|
||
Modified the ReactDOM peerDependency to ensure compatibility with either version 17 or 18. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/icon': patch | ||
--- | ||
|
||
Updates internal function, `isComponentGlyph` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/lib': patch | ||
--- | ||
|
||
Updates helper function, `isComponentType` and updates `ExtendedComponentProps` type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lg-tools/build': patch | ||
--- | ||
|
||
adds `@babel/core` as a peerDependency. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/segmented-control': patch | ||
--- | ||
|
||
Refactor internal function `childrenIdList`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/combobox': patch | ||
--- | ||
|
||
Type assert children as `Array<React.ReactNode>` inside the internal function `renderedMenuContents` and add explicit return type to internal function `renderCombobox`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@leafygreen-ui/guide-cue': major | ||
--- | ||
|
||
Downgrades `focus-trap-react` package to `^9.0.2` so that tests still pass without requiring the use of the `fallbackFocus` option on the `<FocusTrap>` component. | ||
|
||
Refactors multi-step guideCue so that the tooltip no longer uses a portal, as React 18 displays the tooltip in the wrong position when the viewport changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@leafygreen-ui/tooltip': patch | ||
--- | ||
|
||
Adds the `setOpen()` state update inside `onMouseEnter` inside the [flushSync](https://react.dev/reference/react-dom/flushSync) callback to prevent batch updates in React 18. This addresses an issue where the tooltip would occasionally appear without a transition, particularly when hovering. This should have no impact on behavior in React 17. | ||
|
||
Adds an additional check, `isValidElement(trigger)` when checking if the trigger is a LeafyGreenUI Icon or Glyph component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/menu': patch | ||
--- | ||
|
||
Internally refactored how we deal with refs to a Menu component's children to better handle keyboard navigation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lg-tools/storybook-decorators': minor | ||
--- | ||
|
||
Move `@leafygreen-ui/leafygreen-provider` inside `peerDependencies`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/select': patch | ||
--- | ||
|
||
Bumps `@types/react-is` and `react-is` to latest major version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@leafygreen-ui/expandable-card': patch | ||
'@leafygreen-ui/checkbox': patch | ||
'@leafygreen-ui/side-nav': patch | ||
'@leafygreen-ui/table': patch | ||
--- | ||
|
||
Adds a `nodeRef` to <Transition> to get rid of StrictMode warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lg-tools/test': minor | ||
--- | ||
|
||
Upgrade `jest` and `testing-library` packages to support React 18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@leafygreen-ui/side-nav': major | ||
--- | ||
|
||
Refactors the `CollapseToggle` tooltip so that it no longer uses a portal, as React 18 displays the tooltip in the wrong position when the side nav is toggled. | ||
|
||
Refactor the internal function, `renderedChildren`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/select': patch | ||
--- | ||
|
||
Adds new internal prop, `__INTERNAL__menuButtonSlotProps__`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@leafygreen-ui/guide-cue': patch | ||
'@leafygreen-ui/modal': patch | ||
--- | ||
|
||
Add `focusTrapOptions` type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@lg-tools/storybook': minor | ||
--- | ||
|
||
Bump `@mdx-js/react` to the latest major version, `2.3.0`. This version will not work with React 17. | ||
|
||
Modified the ReactDOM peerDependency to ensure compatibility with either version 17 or 18. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/lib': major | ||
--- | ||
|
||
Modified the React peerDependency to ensure compatibility with either version 17 or 18. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@lg-tools/storybook': patch | ||
--- | ||
|
||
Modified the React peerDependency to ensure compatibility with either version 17 or 18. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@leafygreen-ui/number-input': patch | ||
'@leafygreen-ui/code': patch | ||
--- | ||
|
||
Move custom select menu button into separate components and passes custom select menu button props to new internal select prop, `__INTERNAL__menuButtonSlotProps__`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/modal': major | ||
--- | ||
|
||
Upgrades `focus-trap-react` package to `^9.0.2` to maintain uniformity across other LG components using this package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
'@leafygreen-ui/polymorphic': patch | ||
'@leafygreen-ui/callout': patch | ||
'@leafygreen-ui/banner': patch | ||
'@leafygreen-ui/table': patch | ||
'@leafygreen-ui/toast': patch | ||
'@leafygreen-ui/logo': patch | ||
'@leafygreen-ui/menu': patch | ||
'@leafygreen-ui/box': patch | ||
'@leafygreen-ui/lib': patch | ||
--- | ||
|
||
Updates types with `React.PropsWithChildren` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@leafygreen-ui/code': patch | ||
--- | ||
|
||
Updates LanguageSwitcher hover styles specificity to `&:hover[aria-disabled='false']`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@leafygreen-ui/tooltip': patch | ||
--- | ||
|
||
Updates `PopoverFunctionParameters` interface to use `PopoverAlign` alias. | ||
|
||
Omit `children` from `PopoverProps` since it was overriding `Tooltip` children. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
'@leafygreen-ui/expandable-card': patch | ||
'@leafygreen-ui/checkbox': patch | ||
'@leafygreen-ui/popover': patch | ||
'@leafygreen-ui/modal': patch | ||
'@leafygreen-ui/table': patch | ||
'@leafygreen-ui/toast': patch | ||
'@leafygreen-ui/menu': patch | ||
--- | ||
|
||
Bumps `react-transition-group` to `^4.4.5`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@leafygreen-ui/number-input': patch | ||
--- | ||
|
||
Adds the `setOpen()` state update inside the [flushSync](https://react.dev/reference/react-dom/flushSync) callback to prevent batch updates in React 18. This addresses an issue where the unit tooltip would occasionally appear without a transition, particularly when hovering. This should have no impact on behavior in React 17. | ||
|
||
Updates `README` code snippet. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// https://github.com/focus-trap/tabbable#testing-in-jsdom | ||
const lib = jest.requireActual('tabbable'); | ||
|
||
const tabbable = { | ||
...lib, | ||
tabbable: (node, options) => | ||
lib.tabbable(node, { ...options, displayCheck: 'none' }), | ||
focusable: (node, options) => | ||
lib.focusable(node, { ...options, displayCheck: 'none' }), | ||
isFocusable: (node, options) => | ||
lib.isFocusable(node, { ...options, displayCheck: 'none' }), | ||
isTabbable: (node, options) => | ||
lib.isTabbable(node, { ...options, displayCheck: 'none' }), | ||
}; | ||
|
||
module.exports = tabbable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/code/src/CustomSelectMenuButton/CustomSelectMenuButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
|
||
import Button, { ButtonProps } from '@leafygreen-ui/button'; | ||
|
||
/** | ||
* Custom language switcher button. | ||
* | ||
* Passing down just the function which will be instantiated inside `Select` | ||
* @internal | ||
*/ | ||
export const CustomSelectMenuButton = React.forwardRef( | ||
({ children, ...props }: ButtonProps, ref) => ( | ||
<Button {...props} ref={ref}> | ||
{children} | ||
</Button> | ||
), | ||
); | ||
|
||
CustomSelectMenuButton.displayName = 'CustomSelectMenuButton'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { CustomSelectMenuButton } from './CustomSelectMenuButton'; |
Oops, something went wrong.