Skip to content

Commit

Permalink
fix: add warning in badge
Browse files Browse the repository at this point in the history
  • Loading branch information
edsonsnunes committed Nov 28, 2024
1 parent 3158219 commit 5a73729
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions projects/ion/src/lib/badge/_badge.theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ $default: (
background-color: ion-theme(negative-6),
text-color: ion-theme(positive-1),
),
warning: (
background-color: ion-theme(warning-6),
text-color: ion-theme(neutral-1),
),
);

@include register-component(
Expand Down
2 changes: 1 addition & 1 deletion projects/ion/src/lib/badge/badge.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
}

@each $variant in primary, secondary, neutral, negative {
@each $variant in primary, secondary, neutral, negative, warning {
.badge-#{$variant} {
background-color: ion-theme(badge-#{$variant}-background-color);
color: ion-theme(badge-#{$variant}-text-color);
Expand Down
2 changes: 1 addition & 1 deletion projects/ion/src/lib/badge/badge.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('BadgeComponent', () => {
}
);

it.each(['primary', 'secondary', 'neutral', 'negative'])(
it.each(['primary', 'secondary', 'neutral', 'negative', 'warning'])(
'should render 99+ when value is %i (bigger than 100)',
async (type: BadgeType) => {
await sut({ type, label: type });
Expand Down
7 changes: 6 additions & 1 deletion projects/ion/src/lib/core/types/badge.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { IconType } from './icon';

export type BadgeType = 'primary' | 'secondary' | 'neutral' | 'negative';
export type BadgeType =
| 'primary'
| 'secondary'
| 'neutral'
| 'negative'
| 'warning';

export interface BadgeProps {
label?: string;
Expand Down

0 comments on commit 5a73729

Please sign in to comment.