File tree Expand file tree Collapse file tree 3 files changed +40
-13
lines changed Expand file tree Collapse file tree 3 files changed +40
-13
lines changed Original file line number Diff line number Diff line change 1
1
import { Chip } from '@material-ui/core' ;
2
2
import { PropsLink } from '@superdispatch/ui-docs' ;
3
- import { Inline } from '..' ;
3
+ import { Inline , Stack } from '..' ;
4
4
5
5
export default {
6
6
title : 'Data Display/Chip' ,
@@ -11,16 +11,23 @@ export default {
11
11
} ,
12
12
} ;
13
13
14
+ const colors = [ 'default' , 'primary' , 'secondary' ] as const ;
15
+
14
16
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 >
26
33
) ;
Original file line number Diff line number Diff line change 1
1
import { SvgIcon } from '@material-ui/core' ;
2
- import { ColorDynamic } from '../theme/Color' ;
2
+ import { Color , ColorDynamic } from '../theme/Color' ;
3
3
import { SuperDispatchTheme } from '../theme/SuperDispatchTheme' ;
4
4
5
5
export function overrideChip ( theme : SuperDispatchTheme ) : void {
@@ -65,6 +65,18 @@ export function overrideChip(theme: SuperDispatchTheme): void {
65
65
} ,
66
66
} ,
67
67
68
+ colorPrimary : {
69
+ '& $deleteIcon svg' : {
70
+ color : Color . White ,
71
+ } ,
72
+ } ,
73
+
74
+ colorSecondary : {
75
+ '& $deleteIcon svg' : {
76
+ color : Color . White ,
77
+ } ,
78
+ } ,
79
+
68
80
deleteIcon : {
69
81
width : undefined ,
70
82
height : undefined ,
Original file line number Diff line number Diff line change @@ -89,11 +89,19 @@ it('checks component css', () => {
89
89
background-color: Color.Blue300;
90
90
}
91
91
92
+ .MuiChip-colorPrimary .MuiChip-deleteIcon svg {
93
+ color: Color.White;
94
+ }
95
+
92
96
.MuiChip-colorSecondary {
93
97
color: Color.White;
94
98
background-color: #f50057;
95
99
}
96
100
101
+ .MuiChip-colorSecondary .MuiChip-deleteIcon svg {
102
+ color: Color.White;
103
+ }
104
+
97
105
.MuiChip-clickable {
98
106
cursor: pointer;
99
107
user-select: none;
You can’t perform that action at this time.
0 commit comments