Skip to content
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

Merged
merged 1 commit into from
Jan 11, 2024
Merged

fix(ui): rebuild tabs with radix primitives #4789

merged 1 commit into from
Jan 11, 2024

Conversation

kyranjamie
Copy link
Collaborator

@kyranjamie kyranjamie commented Jan 9, 2024

Try out this version of Leather — Extension build, Test report

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.


interface Tabs {
interface RouteTabs {
Copy link
Contributor

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)

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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

Copy link
Collaborator Author

@kyranjamie kyranjamie Jan 11, 2024

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.

Copy link
Contributor

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 🙇

Copy link
Contributor

@pete-watters pete-watters left a 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

@kyranjamie kyranjamie force-pushed the fix/tab-styles branch 4 times, most recently from dd6af09 to 3cf2f09 Compare January 11, 2024 14:12
@kyranjamie kyranjamie added this pull request to the merge queue Jan 11, 2024
Merged via the queue into dev with commit 3b0488e Jan 11, 2024
29 checks passed
@kyranjamie kyranjamie deleted the fix/tab-styles branch January 11, 2024 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants