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

Update the RadioControl header design #63734

Open
jarekmorawski opened this issue Jul 19, 2024 · 4 comments
Open

Update the RadioControl header design #63734

jarekmorawski opened this issue Jul 19, 2024 · 4 comments
Labels
Design System Issues related to the system of combining components according to best practices. Needs Accessibility Feedback Need input from accessibility Needs Decision Needs a decision to be actionable or relevant Needs Dev Ready for, and needs developer efforts [Package] Components /packages/components

Comments

@jarekmorawski
Copy link
Contributor

jarekmorawski commented Jul 19, 2024

There's a new design for displaying help text for the itemGroup component introduced as part of #63490, which repositions the help text to align with the item labels. This makes the itemGroup's help text look off because it stands out from other help texts. This dissonance is particularly visible when the last item in the group has a help text.

I propose moving the itemGroup's help text to the top, similar to the form section heading. This will clean up the UI and make referring to the help text easier while scanning longer item lists.

image

The new layout doesn't work with the current heading style, so we can take this opportunity to update that, too. Ideally, these changes would apply to all UI control groups: radio, checkboxes, toggles, etc.

image
@jarekmorawski jarekmorawski added Needs Dev Ready for, and needs developer efforts Needs Decision Needs a decision to be actionable or relevant labels Jul 19, 2024
@jameskoster
Copy link
Contributor

jameskoster commented Jul 19, 2024

Moving the help text associated with a radio group above the set of options seems reasonable to me, especially if we enable the addition of per-radio help text. I'd appreciate a11y feedback on this though.

I reckon we should use existing type styles for now. Most of the mockup is fine, but the 14/24 heading isn't a style I've seen used elsewhere. The 13px, 500 weight style we use in panel headings is probably fine?

I removed the Needs Dev label until we get some feedback on the a11y impact.

@jameskoster jameskoster added the Needs Accessibility Feedback Need input from accessibility label Jul 19, 2024
@jameskoster jameskoster removed the Needs Dev Ready for, and needs developer efforts label Jul 19, 2024
@jarekmorawski
Copy link
Contributor Author

I reckon we should use existing type styles for now. Most of the mockup is fine, but the 14/24 heading isn't a style I've seen used elsewhere. The 13px, 500 weight style we use in panel headings is probably fine?

Good catch! I used the new wp-admin styles, but we should definitely use an existing style. The one we use for the panel headings looks good. I updated the OG post.

@mirka mirka changed the title Update the itemGroup header design Update the RadioControl header design Jul 22, 2024
@mirka mirka added the [Package] Components /packages/components label Jul 22, 2024
@joedolson
Copy link
Contributor

The position of the help text is probably improved slightly by being at the top of the panel. However, the lack of any semantic connection between the help text, heading, and the fields isn't great. Properly speaking, groups of radio buttons should be joined inside a fieldset with legend, or a container with role="group" and an aria-labelledby attribute pointing to the heading.

The aria-labelledby target could probably contain both the heading and the help text.

@jameskoster jameskoster added Needs Dev Ready for, and needs developer efforts Design System Issues related to the system of combining components according to best practices. labels Oct 3, 2024
@jameskoster jameskoster moved this from Now to Needs Dev in Design priorities Oct 3, 2024
@jameskoster
Copy link
Contributor

We should use the new type tokens for the text styling but otherwise I think this is good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design System Issues related to the system of combining components according to best practices. Needs Accessibility Feedback Need input from accessibility Needs Decision Needs a decision to be actionable or relevant Needs Dev Ready for, and needs developer efforts [Package] Components /packages/components
Projects
Status: Needs Dev
Status: 🔦 Needs triage
Status: No status
Development

No branches or pull requests

4 participants