@@ -39,7 +39,19 @@ type OnChange = ({
39
39
} ) => void ;
40
40
41
41
const _Chip : React . ForwardRefRenderFunction < BladeElementRef , ChipProps > = (
42
- { isDisabled, value, children, icon : Icon , color, testID, _motionMeta, ...rest } ,
42
+ {
43
+ isDisabled,
44
+ value,
45
+ children,
46
+ icon : Icon ,
47
+ color,
48
+ testID,
49
+ _motionMeta,
50
+ width,
51
+ maxWidth,
52
+ minWidth,
53
+ ...rest
54
+ } ,
43
55
ref ,
44
56
) => {
45
57
const { theme } = useTheme ( ) ;
@@ -72,7 +84,6 @@ const _Chip: React.ForwardRefRenderFunction<BladeElementRef, ChipProps> = (
72
84
const useChip = groupProps ?. selectionType === 'single' ? useRadio : useCheckbox ;
73
85
const _size = groupProps ?. size || 'small' ;
74
86
const chipColor = color ?? groupProps ?. color ?? 'primary' ;
75
-
76
87
const handleChange : OnChange = ( { isChecked, value } ) => {
77
88
if ( isChecked ) {
78
89
groupProps ?. state ?. addValue ( value ! ) ;
@@ -147,6 +158,9 @@ const _Chip: React.ForwardRefRenderFunction<BladeElementRef, ChipProps> = (
147
158
{ ...makeAnalyticsAttribute ( rest ) }
148
159
display = { ( isReactNative ( ) ? 'flex' : 'inline-flex' ) as never }
149
160
ref = { getOuterMotionRef ( { _motionMeta, ref } ) }
161
+ width = { width }
162
+ maxWidth = { maxWidth }
163
+ minWidth = { minWidth }
150
164
>
151
165
< SelectorLabel
152
166
componentName = { MetaConstants . ChipLabel }
@@ -158,9 +172,12 @@ const _Chip: React.ForwardRefRenderFunction<BladeElementRef, ChipProps> = (
158
172
onKeyDown = { handleKeyboardPressedIn }
159
173
onKeyUp = { handleKeyboardPressedOut }
160
174
inputProps = { isReactNative ( ) ? inputProps : { } }
161
- style = { { cursor : _isDisabled ? 'not-allowed' : 'pointer' } }
175
+ style = { {
176
+ cursor : _isDisabled ? 'not-allowed' : 'pointer' ,
177
+ width : '100%' ,
178
+ } }
162
179
>
163
- < BaseBox display = "flex" flexDirection = "column" >
180
+ < BaseBox display = "flex" flexDirection = "column" width = "100%" >
164
181
< BaseBox display = "flex" alignItems = "center" flexDirection = "row" >
165
182
< SelectorInput
166
183
hoverTokens = { getChipInputHoverTokens ( chipColor ) }
@@ -201,6 +218,7 @@ const _Chip: React.ForwardRefRenderFunction<BladeElementRef, ChipProps> = (
201
218
}
202
219
height = { makeSize ( chipHeightTokens [ _size ] ) }
203
220
gap = "spacing.3"
221
+ width = "100%"
204
222
>
205
223
{ Icon ? (
206
224
< BaseBox display = "flex" >
0 commit comments