Skip to content

Commit

Permalink
feat!: rename theme prop positive -> success (#1093)
Browse files Browse the repository at this point in the history
  • Loading branch information
amje committed Feb 1, 2024
1 parent 8edc1d3 commit d3f76d5
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 33 deletions.
2 changes: 1 addition & 1 deletion src/components/Alert/Alert.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Alert', () => {
expect(container).toMatchSnapshot();
});

test.each<AlertTheme>(['danger', 'info', 'positive', 'success', 'warning', 'utility'])(
test.each<AlertTheme>(['danger', 'info', 'success', 'warning', 'utility'])(
'render correct icon if not normal theme',
async (theme) => {
const {container} = render(
Expand Down
4 changes: 0 additions & 4 deletions src/components/Alert/AlertIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ const typeToIcon: Record<
filled: CircleInfoFill,
outlined: CircleInfo,
},
positive: {
filled: CircleCheckFill,
outlined: CircleCheck,
},
success: {
filled: CircleCheckFill,
outlined: CircleCheck,
Expand Down
4 changes: 2 additions & 2 deletions src/components/Alert/__stories__/Alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const stories: AlertProps[] = [
{
title,
message,
theme: 'positive',
theme: 'success',
view: 'outlined',
actions: (
<Alert.Actions>
Expand All @@ -74,7 +74,7 @@ const stories: AlertProps[] = [
{
title,
message,
theme: 'positive',
theme: 'success',
view: 'filled',

actions: [{text: right, handler: console.log}],
Expand Down
9 changes: 1 addition & 8 deletions src/components/Alert/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@ import type React from 'react';
import type {ButtonProps} from '../Button';
import type {QAProps} from '../types';

export type AlertTheme =
| 'normal'
| 'info'
| 'success'
| /** @deprecated */ 'positive'
| 'warning'
| 'danger'
| 'utility';
export type AlertTheme = 'normal' | 'info' | 'success' | 'warning' | 'danger' | 'utility';
export type AlertView = 'filled' | 'outlined';
export type AlertLayout = 'vertical' | 'horizontal';
export type AlertCorners = 'rounded' | 'square';
Expand Down
1 change: 0 additions & 1 deletion src/components/Card/Card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ $block: '.#{variables.$ns}card';
}
}

&#{$block}_theme_positive,
&#{$block}_theme_success {
&#{$block}_view_outlined {
border: 1px solid var(--g-color-line-positive);
Expand Down
9 changes: 1 addition & 8 deletions src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@ type SelectionCardView = 'outlined' | 'clear';
type ContainerCardView = 'outlined' | 'filled' | 'raised';

export type CardType = 'selection' | 'action' | 'container';
export type CardTheme =
| 'normal'
| 'info'
| 'success'
| /** @deprecated */ 'positive'
| 'warning'
| 'danger'
| 'utility';
export type CardTheme = 'normal' | 'info' | 'success' | 'warning' | 'danger' | 'utility';
export type CardView = SelectionCardView | ContainerCardView;
export type CardSize = 'm' | 'l';

Expand Down
10 changes: 1 addition & 9 deletions src/components/Card/__tests__/Card.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,7 @@ const cardText = 'Some text';

const cardSizes: CardSize[] = ['l', 'm'];

const cardThemes: CardTheme[] = [
'danger',
'info',
'normal',
'success',
'positive',
'warning',
'utility',
];
const cardThemes: CardTheme[] = ['danger', 'info', 'normal', 'success', 'warning', 'utility'];

const cardTypes: CardType[] = ['action', 'container', 'selection'];

Expand Down

0 comments on commit d3f76d5

Please sign in to comment.