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

[ButtonGroup][joy] Add ButtonGroup component #37407

Merged
merged 23 commits into from
Jun 9, 2023

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented May 26, 2023

Sorry, something went wrong.

@siriwatknp siriwatknp added component: ButtonGroup The React component. package: joy-ui Specific to @mui/joy labels May 26, 2023
@mui-bot
Copy link

mui-bot commented May 26, 2023

Netlify deploy preview

@mui/joy: parsed: +1.15% , gzip: +0.84%

Bundle size report

Details of bundle changes

Generated by 🚫 dangerJS against 53f6922

@zannager zannager requested a review from mnajdova May 26, 2023 10:50
@danilo-leal danilo-leal requested a review from zanivan May 26, 2023 11:46
@zanivan
Copy link
Contributor

zanivan commented May 29, 2023

Hey @siriwatknp and @danilo-leal, I started iterating this component with some styles from the default theme, and it'd be cool to have your inputs on the Figma file. What do you think?

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While reviewing I noticed that the disabled solid buttons don't have enough contrast:

Navigating with keyboard and pressing enter is not opening the options:

Not related specifically for this PR, but should we make the focus indicator follow the color of the element it wraps? For e.g. using green color in this use-case:

Comment on lines +34 to +37
/** Class name applied to the root element if `orientation="horizontal"`. */
horizontal: string;
/** Class name applied to the root element if `orientation="vertical"`. */
vertical: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have some kind of concensus on when we use the prop name as a prefix before the value? For e.g. why using sizeLg, but not orientationHorizontal?

Copy link
Member Author

@siriwatknp siriwatknp Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only argument is that orientationHorizontal is too long. It bloats the class name in the devtool, harder to debug.

However, no strong objection if we want to make it consistent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can decide on it regardless of this PR. I would vote for consistency, so that they are predictable.

@zanivan
Copy link
Contributor

zanivan commented May 31, 2023

While reviewing I noticed that the disabled solid buttons don't have enough contrast

@mnajdova I made a few changes to this component, but is still on Figma, please tell me what you think 😊

Not related specifically for this PR, but should we make the focus indicator follow the color of the element it wraps? For e.g. using green color in this use-case

In WCAG 2.2 there are many instructions on how to improve the focus accessibility, so I believe we definitely have room for improvement. However, I don't think changing the color would help. I'm afraid this would be confusing during the keyboard navigation in a page with many components of different colors, making it slightly harder to follow.

@mnajdova
Copy link
Member

In WCAG 2.2 there are many instructions on how to improve the focus accessibility, so I believe we definitely have room for improvement. However, I don't think changing the color would help. I'm afraid this would be confusing during the keyboard navigation in a page with many components of different colors, making it slightly harder to follow.

Makes sense 👍 maybe we can consider using a grey color that would work nicely with all colors. It's just a thought, not tight to this PR in any way :)

@mnajdova
Copy link
Member

@mnajdova I made a few changes to this component, but is still on Figma, please tell me what you think 😊

Looks great 👍

@siriwatknp
Copy link
Member Author

While reviewing I noticed that the disabled solid buttons don't have enough contrast:

I think this should be fixed in another PR. It is related directly to the global variants, not specific to components.

@siriwatknp
Copy link
Member Author

siriwatknp commented Jun 2, 2023

@zanivan just pushed the updated version according to the figma file. I notice that the divider of the plain variant is too bright, do you think it should have the same value as the soft variant?

image

@zanivan
Copy link
Contributor

zanivan commented Jun 2, 2023

@zanivan just pushed the updated version according to the figma file. I notice that the divider of the plain variant is too bright, do you think it should have the same value as the soft variant?

image

Yep, definitely. I'll update it on the Figma file

Copy link
Contributor

@zanivan zanivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good, definitely improved the contrast!
I think It'll be even better when we finish polishing out the default theme 👀

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Let's tackle the rest of the comments in a follow ups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ButtonGroup The React component. package: joy-ui Specific to @mui/joy
Projects
Status: Recently completed
Development

Successfully merging this pull request may close these issues.

None yet

5 participants