({
inputId = 'react-select',
...props
})
| 31 | }; |
| 32 | |
| 33 | const Template: ComponentStory<typeof Select> = ({ |
| 34 | inputId = 'react-select', |
| 35 | ...props |
| 36 | }) => { |
| 37 | return ( |
| 38 | <EmotionCacheProvider> |
| 39 | <Field htmlFor={inputId} label="ClassNames With Tailwind"> |
| 40 | <Select |
| 41 | inputId={inputId} |
| 42 | {...props} |
| 43 | classNames={{ |
| 44 | control: ({ isDisabled, isFocused }) => |
| 45 | classNames( |
| 46 | !isDisabled && isFocused && 'border-purple-800', |
| 47 | isFocused && 'shadow-[0_0_0_1px] shadow-purple-800', |
| 48 | isFocused && 'hover:border-purple-800' |
| 49 | ), |
| 50 | option: ({ isDisabled, isFocused, isSelected }) => |
| 51 | classNames( |
| 52 | isSelected && 'bg-purple-800', |
| 53 | !isSelected && isFocused && 'bg-purple-300', |
| 54 | !isDisabled && isSelected && 'active:bg-purple-800', |
| 55 | !isDisabled && !isSelected && 'active:bg-purple-500' |
| 56 | ), |
| 57 | }} |
| 58 | /> |
| 59 | </Field> |
| 60 | </EmotionCacheProvider> |
| 61 | ); |
| 62 | }; |
| 63 | |
| 64 | export const ClassNamesWithTailwind = Template.bind({}); |
| 65 | ClassNamesWithTailwind.args = { |
nothing calls this directly
no test coverage detected
searching dependent graphs…