Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds icon color support to the Badge component and deprecates the Tag component in favor of Badge. The changes introduce icon-specific color tokens and update Badge styling to support icons with proper color theming.
Key Changes:
- Added icon color tokens for all badge variants (primary, neutral, information, success, warning, negative) in both standard and contrast modes
- Enhanced Badge component to support leading icons with proper text wrapping and icon sizing
- Deprecated Tag component with migration guidance to use Badge with
variant="neutral"
Reviewed Changes
Copilot reviewed 9 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/tokens/src/component.json | Adds icon color tokens for all badge variants in both light and dark themes |
| packages/layout/src/componentColors.scss | Defines CSS custom properties for badge icon colors |
| packages/layout/src/Tag.tsx | Adds deprecation notices and migration guide for Tag component |
| packages/layout/src/Tag.scss | Updates Tag styles to align with Badge neutral variant styling |
| packages/layout/src/Badge/badge-tokens.scss | New file defining badge size and spacing tokens |
| packages/layout/src/Badge/Badge.tsx | Adds size prop, leading icon detection, and Text component wrapping |
| packages/layout/src/Badge/Badge.scss | Updates styling for icon support and size variants |
| packages/icons/src/svgs/UI/Required*.svg | Adds new Required icon variants (Small, Filled, FilledSmall) |
| apps/documentation/src/pages/komponenter/layout-og-flater/tag.mdx | Adds deprecation warning banner |
| apps/documentation/src/data/props/feedback-props.tsx | Adds size and showZero props to badge documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/layout/src/Badge/Badge.scss
Outdated
| width: 0.41631rem; | ||
| height: 0.46881rem; | ||
| margin: 0.17rem 0.17rem 0.14rem 0.17rem; |
There was a problem hiding this comment.
Magic numbers are used for icon dimensions and margins. These should be defined as CSS custom properties in badge-tokens.scss for consistency with the rest of the design system (e.g., --layout-badge-status-icon-small already exists at line 71 but isn't being used here).
packages/layout/src/Badge/Badge.scss
Outdated
| width: 0.55506rem; | ||
| height: 0.62506rem; | ||
| margin: 0.22rem 0.22rem 0.19rem 0.22rem; |
There was a problem hiding this comment.
Magic numbers are used for icon dimensions and margins. These should be defined as CSS custom properties in badge-tokens.scss for consistency with the rest of the design system.
packages/layout/src/Badge/Badge.scss
Outdated
| margin: 0.22247rem 0.22247rem 0.18747rem 0.22247rem; | ||
| width: 0.69381rem; | ||
| height: 0.78131rem; |
There was a problem hiding this comment.
Magic numbers are used for icon dimensions and margins. These should be defined as CSS custom properties in badge-tokens.scss for consistency with the rest of the design system.
53148a1 to
b9a7db3
Compare
|
Preview for this PR in prd is available at https://entur-design-system--preview-182-etu-63197-oppdatere-b-9fgkct6v.web.app (Expires in 7d) |
d500731 to
316c140
Compare
|
Preview for this PR in prd is available at https://entur-design-system--preview-182-etu-63197-oppdatere-b-t6ge0ths.web.app (Expires in 7d) |
| } | ||
|
|
||
| /* Standard */ | ||
| [view-mode='standard'] { |
There was a problem hiding this comment.
Endre disse til å være data-view-mode
| @@ -0,0 +1,258 @@ | |||
| @use '@entur/utils/dist/breakpoints.scss' as *; | |||
|
|
|||
| :root { | |||
There was a problem hiding this comment.
Legg ved en kommentar om at disse på sikt skal hentes fra @entur/tokens
packages/layout/src/Badge/Badge.tsx
Outdated
| displayValue = children > max ? `${max}+` : children; | ||
| const displayValue = children > max ? `${max}+` : children; | ||
| content = ( | ||
| <Text as="span" variant="caption" spacing="none"> |
There was a problem hiding this comment.
Usikker på hvor lurt det er av oss å bruke beta-typografien vår i en ikke-beta-komponent
packages/layout/src/Tag.tsx
Outdated
| * <Tag compact>Content</Tag> | ||
| * | ||
| * // New | ||
| * <Badge variant="neutral" type="status">Content</Badge> |
There was a problem hiding this comment.
Burde vi muligens sette neutral som en default? Per nå er det ingen default variant
316c140 to
4d6f088
Compare
|
Preview for this PR in prd is available at https://entur-design-system--preview-182-etu-63197-oppdatere-b-m871toki.web.app (Expires in 7d) |
a106c56 to
cf1c73d
Compare
|
Preview for this PR in prd is available at https://entur-design-system--preview-182-etu-63197-oppdatere-b-m871toki.web.app (Expires in 7d) |
28d25b2 to
9f8fc08
Compare
TODO investigate where breakpoint values come from
TODO investigate where breakpoint values come from
cf1c73d to
b7d72cd
Compare
|
Preview for this PR in https://entur-design-system--preview-182-etu-63197-oppdatere-b-p3aydjtf.web.app |
💡 Hvorfor?
Badge-forbedringer:
Tag deprecation:
variant="neutral"kan dekke samme bruksområdeNytt ikon:
🔧 Hvordan?
Badge-forbedringer:
sizeprop - Støtte forsmall,medium(default),large<Text>fra@entur/typography/betafor riktig tekststylingbadge-tokens.scss:.eds-contrastcontextTag deprecation:
@deprecatedtags med migrasjonsguide🧩 Type endring
sizeprop, leading icon support)🖼️ Skjermbilder
Tag før:

Tag etter:

💬 Tilleggsnotater
✅ Sjekkliste
🧪 Testing