Skip to content

feet(Badge): add semantic variants and default#244

Merged
nathanyoung merged 2 commits into
mainfrom
feat/badge-themeable
Apr 6, 2026
Merged

feet(Badge): add semantic variants and default#244
nathanyoung merged 2 commits into
mainfrom
feat/badge-themeable

Conversation

@nathanyoung

Copy link
Copy Markdown
Collaborator

Introduce theme-aware semantic badge variants and make the semantic "default" the component's default variant. Changes include:

  • Badge.tsx: add new BadgeVariant options ('default', 'secondary', 'danger', 'outline') and change default variant from 'light-grey' to 'default'.
  • Badge.module.scss: adjust font-weight and add styling for the new semantic variants (default, secondary, danger, outline).
  • Badge.mdx / Badge.stories.tsx: update docs and stories to separate semantic vs fixed-color variants, add theme preview, and configure chromatic modes; adjust default story args.
  • Badge.test.tsx: include new semantic variants in tests and assert that the default variant class is applied when none is provided.
  • package.json & package-lock.json: bump @hyphen/hyphen-design-tokens from 7.2.0 to 7.5.1 to pick up token changes used by the new semantic styles.

These changes add semantic, theme-aware badge options and update docs/tests/stories accordingly.

Introduce theme-aware semantic badge variants and make the semantic "default" the component's default variant. Changes include:

- Badge.tsx: add new BadgeVariant options ('default', 'secondary', 'danger', 'outline') and change default variant from 'light-grey' to 'default'.
- Badge.module.scss: adjust font-weight and add styling for the new semantic variants (default, secondary, danger, outline).
- Badge.mdx / Badge.stories.tsx: update docs and stories to separate semantic vs fixed-color variants, add theme preview, and configure chromatic modes; adjust default story args.
- Badge.test.tsx: include new semantic variants in tests and assert that the default variant class is applied when none is provided.
- package.json & package-lock.json: bump @hyphen/hyphen-design-tokens from 7.2.0 to 7.5.1 to pick up token changes used by the new semantic styles.

These changes add semantic, theme-aware badge options and update docs/tests/stories accordingly.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 6, 2026

Copy link
Copy Markdown

Deploying hyphen-components with  Cloudflare Pages  Cloudflare Pages

Latest commit: 460b1e0
Status: ✅  Deploy successful!
Preview URL: https://71abb1df.hyphen-components.pages.dev
Branch Preview URL: https://feat-badge-themeable.hyphen-components.pages.dev

View logs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds theme-aware “semantic” badge variants and switches the Badge component’s default styling from a fixed color (light-grey) to a semantic default variant, with corresponding style, docs/story, test, and design-token updates.

Changes:

  • Added new BadgeVariant options (default, secondary, danger, outline) and made default the component’s default.
  • Added SCSS styling for the new semantic variants and adjusted badge font-weight.
  • Updated Storybook stories/docs and expanded tests to cover the new default/variants; bumped design tokens to @hyphen/hyphen-design-tokens@7.5.1.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/components/Badge/Badge.tsx Extends variant union and changes default variant to default.
src/components/Badge/Badge.module.scss Adds theme-token-based styles for semantic variants; adjusts font-weight.
src/components/Badge/Badge.stories.tsx Splits semantic vs fixed-color stories and adds chromatic light/dark modes.
src/components/Badge/Badge.mdx Updates docs to explain semantic default and show semantic vs fixed-color variants.
src/components/Badge/Badge.test.tsx Adds semantic variants to the variant list and asserts default variant behavior.
package.json Bumps design tokens dependency to support new semantic variables.
package-lock.json Locks updated design tokens version/resolution/integrity.

Comment thread src/components/Badge/Badge.mdx Outdated
Comment thread src/components/Badge/Badge.test.tsx Outdated
@nathanyoung nathanyoung merged commit 1bc2d61 into main Apr 6, 2026
9 checks passed
@nathanyoung nathanyoung deleted the feat/badge-themeable branch April 6, 2026 20:12
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.

2 participants