-
Notifications
You must be signed in to change notification settings - Fork 86
feat: Upgrade components 6️⃣ [UFO-1987] [UFO-1988] [UFO-1989] [UFO-1992] #3186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: fix/eslint_setup_UFO-2005
Are you sure you want to change the base?
feat: Upgrade components 6️⃣ [UFO-1987] [UFO-1988] [UFO-1989] [UFO-1992] #3186
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
88690c4
to
4038ab6
Compare
f7c9817
to
d157100
Compare
4038ab6
to
d4b0e0c
Compare
d4b0e0c
to
0e26a0b
Compare
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
08465e1
to
f9e8493
Compare
0e26a0b
to
ed0b5a2
Compare
376fe92
to
6d86360
Compare
* feat: revive tooltip * feat: refactor using floatingUI * docs: update migration guidelines for tooltip, popover and menu * feat: update tooltip in pill component * fix: fix auto position of arrow and offset * test: disable class name tests until emotion/jest is avilable for jest 30 * fix: merge refs and add props in correct order * feat: re-enable tooltip on IconButton * feat: re-enable tooltip for clear-all icon * feat: re-enable menu for card actions * feat: re-implement tooltip for copy button * feat: simplify implementation using IconButton * feat: re-implement tooltip for inline entry card * feat: implement fallback for rendering tooltip trigger * feat: re-implement tooltip in UsageCardHeader * docs: improve story with tooltip * feat: re-add exports to react-components package * feat: re-enable entity list and entitylistitem * feat: export entity-list from react-components package * feat: re-enable Avatar component * feat: export Avatar from components package * docs: update Avatar storybook stories * fix: fix ability to set individual test-id for Icon with as property * feat: re-enable card for UsageCard component * feat: update emotion imports * feat: rerfactor BaseCard styles * feat: update emotion imports * feat: re-enable navbar
…3194) * feat: update modal component package to use react 19 * feat: update notification to use react 19
ff02d91
to
102def6
Compare
f9e8493
to
dc55cf8
Compare
|
||
if ( | ||
sanitizedPlacement.startsWith('right') || | ||
sanitizedPlacement.toString().startsWith('left') || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanitizedPlacement.toString().startsWith('left') || | |
sanitizedPlacement.startsWith('left') || |
const [isOpen, setIsOpen] = React.useState(isVisible); | ||
|
||
let sanitizedPlacement: Placement = 'top'; | ||
const middleware = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be wrapped in useMemo
to prevent constant rerendering due to the newly created array.
const context = data.context; | ||
|
||
const hover = useHover(context, { | ||
delay: { open: showDelay, close: hideDelay }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s make a lot of friends and use the safe polygon while we’re at it.
handleClose: safePolygon({ requireIntent: false }),
Note: requireIntent
should be false
to not punish people who are (sometimes) slow with the mouse.
const baseRef = useMergeRefs([propRef, context.refs.setReference]); | ||
const ref = useMergeRefs([childRef, baseRef]); | ||
|
||
if (React.isValidElement(children)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we log an error at least in dev mode rather than silently hiding the element?
).toBe('left'), | ||
); | ||
}); | ||
// Enable again once emotion/jest is compatible again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s mark this as an explicit TODO to make sure we find it again.
</MenuItem>, | ||
<li>Copy</li>, | ||
<li>Delete</li>, | ||
// <MenuItem key="copy" onClick={() => alert('copy')}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s add an explicit TODO to fix this.
<MenuItem key="copy">Copy</MenuItem>, | ||
<MenuItem key="delete">Delete</MenuItem>, | ||
]} | ||
actions={[<li key="copy">Copy</li>, <li key="delete">Delete</li>]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
<MenuItem key="copy">Copy</MenuItem>, | ||
<MenuItem key="delete">Delete</MenuItem>, | ||
]} | ||
actions={[<li key="copy">Copy</li>, <li key="delete">Delete</li>]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
<InlineEntryCard | ||
actions={[ | ||
<MenuItem key="edit" onClick={handleEditAction}> | ||
<li key="edit" onClick={handleEditAction}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO
Summary
This PR replaces the deprecated
react-popper
package with its actively maintained successor,@floating-ui/react
.floating-ui
provides improved flexibility, performance, and more robust positioning behavior for UI elements.Also contains react 19 upgrades for the following other components
Affected Components
The following components previously relied directly on
react-popper
and have been refactored to usefloating-ui
:Additionally, several components that indirectly depend on these were updated or tested to ensure compatibility:
Changes
react-popper
dependency.@floating-ui/react
.floating-ui
.Breaking Changes
Menu
Menu.Submenu
has been deprecated.Menu
component.Placement Property
placement
prop for Popover, Menu, and Tooltip has changed to match thefloating-ui
API."auto-start"
,"auto-end"
) need to be updated.