feet(Badge): add semantic variants and default#244
Merged
Conversation
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.
Deploying hyphen-components with
|
| 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 |
Contributor
There was a problem hiding this comment.
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
BadgeVariantoptions (default,secondary,danger,outline) and madedefaultthe 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. |
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.
Introduce theme-aware semantic badge variants and make the semantic "default" the component's default variant. Changes include:
These changes add semantic, theme-aware badge options and update docs/tests/stories accordingly.