-
Notifications
You must be signed in to change notification settings - Fork 982
New component: Toolbar #412
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
Conversation
* Add ToolbarGroup * Add ToolbarLabel * Add ToolbarSeparator * Add ToolbarItem * Use Orientation for styling Group and Separator * Create a story with ToggleButton, Group, DropDownMenu, and anchor link
This is awesome @nazeh! Thanks so much for this |
Used |
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.
Please don't be discouraged by the amount of comments I've left here 😅 This PR is really great!! Thank you!!
Most of the stuff below is just little niggles but I love how well you've followed the overall architecture of our components 😍 It was a joy to review.
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.
@jjenzz's already outlined most of the feedback, I've added a couple more tidbits for consistency.
I just wanted to also say amazing work on that one following the current project structure, etc
* Use patch instead of prerelease * Update package.json scripts and version * Used *Class naming for css() * Remove ToolbarLabel * Add uniqueInputID * Remove pointerEvents: 'none' to better test onClick() * Use 'div' instead of 'button' to test 'disabled' * Update ToolbarItem onClick() to preventDefault() and skip itemProps.onClick for disabled itmes * Refactor onKeyDown() for the link in Toolbar.stories.tsx * Add onClick() instead of onKeyDown() for 'button' * Add onClick() for disabled ToolbarItem to make sure it does not trigger * Use Separator from react-separator in ToolbarSeparator * Use RavingFocuseGroupProps properly * Add defaults for 'dir' and 'loop' to match type defenition * Remove children if it is already spreaded * Inline React.uesMemo() * Use correct order of spreading props * Remove all use of any
@jjenzz @benoitgrelard Thank you so much for the review and encouragement. I should be able to work on those in the morning, have a good afternoon! |
This is looking great. Thanks for the updates @nazeh. I've left a few comments in response to bits and pieces above and a small change here #412 (comment) Would be good to get @benoitgrelard's input on some of it. Super close now I think 👍 |
This is really close! |
Thanks @benoitgrelard,and @jjenzz for the feedback, I guess there are two more issues: 1- should I worry about adding 2- I notice a significant offset between the |
@nazeh , noooo, thank you for all your effort and patience with this 🙂
Since you won't have access to our Github Secrets, I will change the base branch here to
Interesting, I'll take a look into this now quickly for you! |
Regarding that gap in the dropdown menu, we're aware of this, it will happen in very specific circumstances when margins collapse on body. There are easy workarounds and we will looks at potentially replacing some dependency with our own to avoid it alltogether. Thanks so much for your work on this @nazeh! |
* New component: Toolbar (#412) * Add `ToolbarLink`, `ToolbarRadioGroup` & rename `ToolbarItem` * PR feedback * Forward `as` prop in `ToolbarRadioItem` * Replace inline component in `ToolbarRadioItem` with `Slot` * Update yarn.lock * Add chromatic stories * Add prominent toggle button toggled styles Co-authored-by: Ar Nazeh <[email protected]> Co-authored-by: Benoît Grélard <[email protected]>
Disclaimer: I did not communicate my intention to work on this so I will understand if you decided not to spend any time reviewing it, but I will appreciate it if you did!
I saw that
Toolbar
was not assigned to anyone in the Roadmap and I liked the documentation and example in WAI-ARIAThe reason I opened a draft PR is to make sure I am not going in the wrong direction, and ask what further requirements do you expect from this component before it is ready?
Thanks for your time.
Note: the
Menu
will not behave as shown in the screenshot above because #411yarn test
).yarn dev
).This pull request: