1
1
import type { ChipGroupProps } from './ChipGroup' ;
2
- import type { Theme } from '~components/BladeProvider ' ;
3
- import type { DotNotationColorStringToken , DotNotationSpacingStringToken } from '~utils/types' ;
2
+ import type { ChipBorderColors , ChipBackgroundColors } from './types ' ;
3
+ import type { DotNotationSpacingStringToken } from '~utils/types' ;
4
4
import type { SelectorInputHoverTokens } from '~components/Form/Selector/types' ;
5
5
import { size } from '~tokens/global' ;
6
6
import type { IconProps } from '~components/Icons' ;
@@ -74,45 +74,13 @@ const chipHorizontalPaddingTokens: ChipHorizontalPaddingTokens = {
74
74
} ,
75
75
} ;
76
76
77
- type InteractiveBackgroundColors <
78
- T extends 'positive' | 'negative' | 'primary'
79
- > = `interactive.background.${T } .${DotNotationColorStringToken <
80
- Theme [ 'colors' ] [ 'interactive' ] [ 'background' ] [ T ]
81
- > } `;
82
-
83
- type InteractiveBorderColors <
84
- T extends 'positive' | 'negative' | 'primary'
85
- > = `interactive.border.${T } .${DotNotationColorStringToken <
86
- Theme [ 'colors' ] [ 'interactive' ] [ 'background' ] [ T ]
87
- > } `;
88
-
89
77
type TextColorTokens = BaseTextProps [ 'color' ] ;
90
78
type IconColorTokens = IconProps [ 'color' ] ;
91
79
type ChipColorTokens = {
92
80
text : Record < string , TextColorTokens > ;
93
- icon : Record < string , IconColorTokens | 'surface.background.primary.intense' > ;
94
- background : Record <
95
- string ,
96
- Record <
97
- string ,
98
- | InteractiveBackgroundColors < 'positive' >
99
- | InteractiveBackgroundColors < 'negative' >
100
- | InteractiveBackgroundColors < 'primary' >
101
- | 'transparent'
102
- | 'interactive.background.gray.faded'
103
- >
104
- > ;
105
- border : Record <
106
- string ,
107
- Record <
108
- string ,
109
- | InteractiveBorderColors < 'positive' >
110
- | InteractiveBorderColors < 'negative' >
111
- | InteractiveBorderColors < 'primary' >
112
- | 'interactive.border.gray.default'
113
- | 'interactive.border.gray.disabled'
114
- >
115
- > ;
81
+ icon : Record < string , IconColorTokens > ;
82
+ background : Record < string , Record < string , ChipBackgroundColors > > ;
83
+ border : Record < string , Record < string , ChipBorderColors > > ;
116
84
} ;
117
85
118
86
const chipColorTokens : ChipColorTokens = {
@@ -124,8 +92,8 @@ const chipColorTokens: ChipColorTokens = {
124
92
negative : 'interactive.text.negative.subtle' ,
125
93
} ,
126
94
icon : {
127
- unchecked : 'interactive.text .gray.subtle' ,
128
- disabled : 'interactive.text .gray.disabled' ,
95
+ unchecked : 'interactive.icon .gray.subtle' ,
96
+ disabled : 'interactive.icon .gray.disabled' ,
129
97
primary : 'interactive.icon.primary.normal' ,
130
98
positive : 'feedback.icon.positive.intense' ,
131
99
negative : 'feedback.icon.negative.intense' ,
@@ -179,8 +147,8 @@ const getChipInputHoverTokens = (color: ChipGroupProps['color']): SelectorInputH
179
147
return {
180
148
default : {
181
149
background : {
182
- checked : 'transparent ' ,
183
- unchecked : 'transparent ' ,
150
+ checked : 'colors.surface.background.gray.intense ' ,
151
+ unchecked : 'colors.surface.background.gray.intense ' ,
184
152
} ,
185
153
border : {
186
154
checked : `colors.${ chipColorTokens . border [ color || 'default' ] . hover } ` as never ,
@@ -216,7 +184,10 @@ const chipTextSizes = {
216
184
} ,
217
185
} as const ;
218
186
219
- const chipMotionTokens = {
187
+ const chipMotionTokens : Record <
188
+ 'duration' | 'easing' ,
189
+ 'motion.duration.xquick' | 'motion.easing.standard.effective'
190
+ > = {
220
191
duration : 'motion.duration.xquick' ,
221
192
easing : 'motion.easing.standard.effective' ,
222
193
} ;
0 commit comments