[WEB-8149] fix(badge): support icon-only badges with proper accessibility#225
Open
codingwolf-at wants to merge 4 commits into
Open
[WEB-8149] fix(badge): support icon-only badges with proper accessibility#225codingwolf-at wants to merge 4 commits into
codingwolf-at wants to merge 4 commits into
Conversation
…ries - Updated `Badge` component to support icon-only rendering by conditionally omitting the label. - Introduced new `IconOnly` and `IconOnlyInteraction` stories to demonstrate the icon-only badge behavior and ensure proper rendering. - Refactored existing badge stories to utilize a shared row layout for improved presentation. - Removed the `info` tone from badge variants to align with design specifications. - Enhanced documentation to clarify the behavior of icon-only badges and their layout.
…tency - Changed the text color for the `success` variant from `text-success-primary` to `text-success-secondary` to align with design specifications. - Updated the text color for the `warning` variant from `text-warning-primary` to `text-warning-secondary` for improved consistency across badge variants.
- Updated the `Badge` component to require an `aria-label` when using icon-only rendering, ensuring proper accessibility. - Enhanced documentation to clarify the need for an accessible name in icon-only badges. - Adjusted stories to reflect the new accessibility requirements and validate the presence of `aria-label` in tests.
- Enhanced the `Badge` component to ensure icon-only badges have a valid `role="img"` and require an `aria-label` for accessibility. - Updated documentation to clarify the accessibility requirements for icon-only badges. - Adjusted the `success` and `warning` variant text colors for consistency with design specifications, changing `text-success-secondary` to `text-success-primary` and `text-warning-secondary` to `text-warning-primary`.
|
📚 Storybook preview: https://pr-225-propel-storybook.vamsi-906.workers.dev |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
labelomitted): the ready-madeBadgeskips the labelslot entirely (an empty flex child would eat the pill's gap and render it lopsided) and
defaults to
role="img"so an author-suppliedaria-labelis valid ARIA — a bare<span>'sgenericrole doesn't otherwise support naming.infotone (not in the Figma spec) frombadgeVariantsand both story files.IconOnly/IconOnlyInteractionstories (components + elements tier) covering the newaccessible-name contract, and dedupe the repeated row-layout wrapper
<div>across stories intoone shared
rowLayoutdecorator.elements/badge/variants.tsleft over from a prior refactor.Type of Change
Screenshots and Media (if applicable)
NA
Test plan
vp check— clean (format/lint/typecheck)vp test— 116/116 story files, 796/796 tests passing (Storybook + a11y checks)vp pack/vp run -r build— library build + attw/publint cleanReferences
NA