Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(ui): Popover #1696
feat(ui): Popover #1696
Changes from 5 commits
dbb9e3f
e42ff84
d4ec7d5
e33e6f5
a3106d8
f8fa2c6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
thought: This is prob fine, but for what it's worth, I'm a little wary of giving consumers too much control.
I feel like it's generally better to reduce the number of props we expose, and try to restrict usage to the designs Sam gives us. That said, I can see how users might need the side/alignment to be different for layout reasons, so this is fine.
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.
In this case, I couldn't figure out how to control the position on our side. Sam wrote in Figma that it should open "on the left side if above the trigger" and "on the right side if below the trigger". Radix doesn't allow to set it dynamically - we can choose only one option. So that's why I decided to give this level of control
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.
Could we have the content grow out of its origin, like I'm doing with the tooltip here?
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.
Also, could we use theme spacing values, rather than hard-coding the
4
? You can do that either of two ways:useTheme()
, then passtheme.spacing(1)
here, instead of4
..attrs()
method to setsideOffset
toprops.theme.spacing(1)
, like I'm doing here.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.
Thanks, updated to use
useTheme
. And agree that we should use the same animation in similar components. It would be beneficial if you move thescaleIn
in a shared file to reuse it between Tooltip, Popover, and other components