Skip to content

Commit 09e3435

Browse files
committed
pass control props to select and hard-code text color for solid danger button
1 parent a683540 commit 09e3435

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

toolkit/chakra/select.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,21 +260,35 @@ export interface SelectProps extends SelectRootProps {
260260
loading?: boolean;
261261
errorText?: string;
262262
contentProps?: SelectContentProps;
263+
controlProps?: SelectControlProps;
263264
contentHeader?: React.ReactNode;
264265
multipleConfig?: SelectValueTextProps['multipleConfig'];
265266
itemFilter?: (item: SelectOption) => boolean;
266267
mode?: ViewMode;
267268
}
268269

269270
export const Select = React.forwardRef<HTMLDivElement, SelectProps>((props, ref) => {
270-
const { collection, placeholder, portalled = true, loading, errorText, contentProps, contentHeader, itemFilter, mode, multipleConfig, ...rest } = props;
271+
const {
272+
collection,
273+
placeholder,
274+
portalled = true,
275+
loading,
276+
errorText,
277+
contentProps,
278+
controlProps,
279+
contentHeader,
280+
itemFilter,
281+
mode,
282+
multipleConfig,
283+
...rest
284+
} = props;
271285
return (
272286
<SelectRoot
273287
ref={ ref }
274288
collection={ collection }
275289
{ ...rest }
276290
>
277-
<SelectControl loading={ loading }>
291+
<SelectControl loading={ loading } { ...controlProps }>
278292
<SelectValueText
279293
placeholder={ placeholder }
280294
size={ props.size }

toolkit/theme/recipes/button.recipe.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ export const recipe = defineRecipe({
3333
},
3434
solid_danger: {
3535
bg: 'red.600',
36-
color: 'button.solid.text',
36+
color: 'white',
3737
_hover: {
3838
bg: 'red.500',
3939
},
4040
_loading: {
4141
opacity: 1,
4242
'& .chakra-spinner': {
43-
borderColor: 'button.solid.text',
43+
borderColor: 'white',
4444
borderBottomColor: 'spinner.track',
4545
borderInlineStartColor: 'spinner.track',
4646
},

0 commit comments

Comments
 (0)