-
Notifications
You must be signed in to change notification settings - Fork 64
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
LG-4121: consolidate changesets for popover refactor #2517
base: LG-4121-popover-refactor
Are you sure you want to change the base?
Conversation
* OverlayContext, useOverlayContext, and OverlayProvider * useOverlay to register, remove, and track isTopMostOverlay * Export overlay context related components and hooks and include provider in LG provider * README and changeset * Fix type and lint * Update registerOverlay logic and use more explicit generic type names
* PopoverContext supports additional props and marks isPopoverOpen and setIsPopoverOpen deprecated * Replace PortalContext with newly extended PopoverContext * Changesets * Add todo in select spec and update todos with jira tix
…ClassName prop (#2457) * Refactor popover styles * Remove redundant contentClassName prop * Clean up Popover positioning logic * Changesets * Reorg code * useIsomorphicLayoutEffect instead of useMemo * Update changesets * Revert changes
* Add @floating-ui/react dependency * Clean up Popover stories * Replace position utils and usePopoverPositioning with useFloating * Remove replaced positioning hook and utils * Fix adjustOnMutation and stories * Changeset * Add useMergeRefs hook * Address feedback
* Update Popover default spacing from 10 to 4 * Changeset * Update README and stories
…2474) * Remove justify fit from @leafygreen-ui/popover * Remove justify fit usage in packages using Popover * Changeset
* Fix usePortal={false} transition and className order * Replace usePortal with renderMode and add top layer render mode in Popover * Replace usePortal with renderMode and add top layer render mode in LG Provider * Refactor types in Popover-consuming packages * README * Address feedback
* Replace usePortal with renderMode and refactor Popover-consuming components * Fix tooltip hover delays * Initial feedback * Additional feedback * Fix transition * Fix stories
🦋 Changeset detectedLatest commit: e64e3cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 66 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
* Props passed to the Popover that renders the suggested promps. | ||
*/ | ||
dropdownProps?: Omit<PopoverRenderModeProps, 'renderMode'>; | ||
* Props passed to the Popover that renders the suggested prompts. | ||
*/ | ||
dropdownProps?: Omit< | ||
PopoverRenderModeProps, | ||
| 'dismissMode' | ||
| 'onToggle' | ||
| 'portalClassName' | ||
| 'portalContainer' | ||
| 'portalRef' | ||
| 'renderMode' | ||
| 'scrollContainer' | ||
>; |
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.
noticed from changesets that this component was missing from the refactor PR
.changeset/combobox.md
Outdated
'@leafygreen-ui/combobox': major | ||
--- | ||
|
||
[LG-4121](https://jira.mongodb.org/browse/LG-4121): Replaces `usePortal` prop with `renderMode` prop. `renderMode="inline"` and `renderMode="portal"` are deprecated, and all popover elements should migrate to using the top layer. The old default was `usePortal = true`, and the new default is `renderMode = 'top-layer'`. |
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.
renderMode="inline"
andrenderMode="portal"
are deprecated
Aren't we adding these?
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.
Oh, I see, were inline
and portal
already available?
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.
Those replace the old usePortal
boolean prop, but they're marked deprecated to discourage further use
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.
Is it common to mark a new prop value as deprecated?
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.
I don't think I know enough to comment on how common or not it is
It's the approach that was detailed in this doc: https://docs.google.com/document/d/1RAzYwh2qB9jUNR-ARtM0Oox6J3jmInCK6Awabdl-uNI/edit?tab=t.0#heading=h.5qidc127buw7
--- | ||
|
||
[LG-4445](https://jira.mongodb.org/browse/LG-4445): Replaces `usePortal` prop with `renderMode` prop with values of `'inline'`, `'portal'`, and `'top-layer'`. `renderMode="inline"` and `renderMode="portal"` are deprecated, and all popover elements should migrate to using the top layer. The old default was `usePortal = true`, and the new default is `renderMode = 'top-layer'`. | ||
- When `renderMode="top-layer"` or `renderMode` is `undefined`, the popover element will render in the top layer using the [popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) |
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.
With the top layer, the popover is still a child of the trigger and can inherit styles. Is that correct? If so, do we mention that anywhere?
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.
It will inherit styles of its parent, but it won't always be the trigger (e.g. if refEl
prop is used). I'm not sure this warrants documenting in our docs since it's a browser behavior
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.
I think It's at least worth mentioning that usePortal
added the popover to the end of the DOM, but the top layer does not.
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.
There is this bullet:
- When
renderMode="portal"
, the popover element will portal into a new div appended to the body. Alternatively, it can be portaled into a providedportalContainer
element
Where do you think additional context would best be added?
|
||
Additional changes include: | ||
- Adds and exports `getPopoverRenderModeProps` util to pick popover props based on given `renderMode` value | ||
- Deprecates and removes `justify="fit"`. Instead, use `justify="middle"` |
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.
does the codemod also update the justify prop?
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.
It does not. I only found 3 usages of it. Do you think it should also be included?
7fa15ab
to
e02fa10
Compare
✍️ Proposed changes
Consolidates changesets for changes in PR #2520
🎟 Jira ticket: LG-4121