-
Notifications
You must be signed in to change notification settings - Fork 144
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
fix(ui): rebuild tabs with radix primitives #4789
Conversation
src/app/components/tabs.tsx
Outdated
|
||
interface Tabs { | ||
interface RouteTabs { |
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 was confused by the name and placement of this at first. Maybe we can move it to ui/components/tabs
?
As per discussion here this would be a valid case of having another story under Tabs
for RouteTabs
Then under the Tabs
section we would have
Tabs
(generic tabs)RoutableTabs
(routable tabs)
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.
Yeah wasn't sure what to do here and wonder if we should remove this entirely. This tabs component does a few things extra that the radix component doesn't:
- Accepts an
activeTab
prop - Has an onClick handler
- Sets a
data-testid
I'd probably err on the side of this completely, and composing the tabs directly from the styled tabs in each case.
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.
Will try this because as it stands reckon RouteTabs is an abstraction too far. The gist of Radix is composing the components, and describing things as JSX, not creating some abstraction like the Tab
interface
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.
@pete-watters @fbwoolf see my second commit merged into a single commit, but see how I removed the old tabs component entirely. Hope you agree this is a big improvement. IMO this is the way we should try and use the radix primitives. The old tabs component created some wrapper around it which makes it clunky, less composable, and masks the Radix api for our own more restrictive one. Here, I've removed it and I compose the tabs the way Radix intended. This means the API of our tabs is identical to Radix.
Our tabs are now Radix tabs + Leather styles and nothing more.
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 is a great improvement, thanks for re-working it. It's much cleaner and a good pattern for us to use for our other components 🙇
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.
Nice work, LGTM just added some minor suggestions
dd6af09
to
3cf2f09
Compare
3cf2f09
to
dc97b48
Compare
Ref #4309
Improves tabs according to design spec.. Replaces themes for primitives. Taking approach of re-exporting same primitives attached with Panda styles.
Also update a loads of outdated packages.