Skip to content

Commit 87b7b06

Browse files
committed
fix: Chip colors
1 parent 5b37087 commit 87b7b06

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed
Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Chip } from '@material-ui/core';
22
import { PropsLink } from '@superdispatch/ui-docs';
3-
import { Inline } from '..';
3+
import { Inline, Stack } from '..';
44

55
export default {
66
title: 'Data Display/Chip',
@@ -11,16 +11,23 @@ export default {
1111
},
1212
};
1313

14+
const colors = ['default', 'primary', 'secondary'] as const;
15+
1416
export const examples = () => (
15-
<Inline>
16-
<Chip label="Basic" />
17-
<Chip label="Disabled" disabled={true} />
18-
<Chip label="Clickable" clickable={true} />
19-
<Chip
20-
label="Deletable"
21-
onDelete={() => {
22-
alert('Delete!');
23-
}}
24-
/>
25-
</Inline>
17+
<Stack>
18+
{colors.map((color) => (
19+
<Inline key={color}>
20+
<Chip label="Basic" color={color} />
21+
<Chip label="Disabled" disabled={true} color={color} />
22+
<Chip label="Clickable" clickable={true} color={color} />
23+
<Chip
24+
color={color}
25+
label="Deletable"
26+
onDelete={() => {
27+
alert('Delete!');
28+
}}
29+
/>
30+
</Inline>
31+
))}
32+
</Stack>
2633
);

packages/ui/src/chip/ChipOverrides.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SvgIcon } from '@material-ui/core';
2-
import { ColorDynamic } from '../theme/Color';
2+
import { Color, ColorDynamic } from '../theme/Color';
33
import { SuperDispatchTheme } from '../theme/SuperDispatchTheme';
44

55
export function overrideChip(theme: SuperDispatchTheme): void {
@@ -65,6 +65,18 @@ export function overrideChip(theme: SuperDispatchTheme): void {
6565
},
6666
},
6767

68+
colorPrimary: {
69+
'& $deleteIcon svg': {
70+
color: Color.White,
71+
},
72+
},
73+
74+
colorSecondary: {
75+
'& $deleteIcon svg': {
76+
color: Color.White,
77+
},
78+
},
79+
6880
deleteIcon: {
6981
width: undefined,
7082
height: undefined,

0 commit comments

Comments
 (0)