Skip to content

[WEB-8149] fix(badge): support icon-only badges with proper accessibility#225

Open
codingwolf-at wants to merge 4 commits into
mainfrom
fix/badge-design-docs
Open

[WEB-8149] fix(badge): support icon-only badges with proper accessibility#225
codingwolf-at wants to merge 4 commits into
mainfrom
fix/badge-design-docs

Conversation

@codingwolf-at

@codingwolf-at codingwolf-at commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

  • Add icon-only badge support (label omitted): the ready-made Badge skips the label
    slot entirely (an empty flex child would eat the pill's gap and render it lopsided) and
    defaults to role="img" so an author-supplied aria-label is valid ARIA — a bare <span>'s
    generic role doesn't otherwise support naming.
  • Drop the unsupported info tone (not in the Figma spec) from badgeVariants and both story files.
  • Add IconOnly/IconOnlyInteraction stories (components + elements tier) covering the new
    accessible-name contract, and dedupe the repeated row-layout wrapper <div> across stories into
    one shared rowLayout decorator.
  • Remove a stale/orphaned comment in elements/badge/variants.ts left over from a prior refactor.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

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 clean

References

NA

…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`.
@codingwolf-at codingwolf-at changed the title Fix/badge design docs Fix/badge design docs [WIP] Jul 10, 2026
@codingwolf-at codingwolf-at changed the title Fix/badge design docs [WIP] fix(badge): support icon-only badges with proper accessibility Jul 13, 2026
@github-actions

Copy link
Copy Markdown

📚 Storybook preview: https://pr-225-propel-storybook.vamsi-906.workers.dev

@codingwolf-at codingwolf-at changed the title fix(badge): support icon-only badges with proper accessibility [WEB-8149] fix(badge): support icon-only badges with proper accessibility Jul 13, 2026
@makeplane

makeplane Bot commented Jul 13, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

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.

1 participant