({children, ...props}: SwitchProps)
| 57 | }); |
| 58 | |
| 59 | export function Switch({children, ...props}: SwitchProps) { |
| 60 | return ( |
| 61 | <SwitchField {...props} className="flex flex-col gap-1 group"> |
| 62 | <SwitchButton |
| 63 | className={composeTailwindRenderProps( |
| 64 | props.className, |
| 65 | 'group relative flex gap-2 items-center text-neutral-800 disabled:text-neutral-300 dark:text-neutral-200 dark:disabled:text-neutral-600 forced-colors:disabled:text-[GrayText] text-sm transition [-webkit-tap-highlight-color:transparent]' |
| 66 | )}> |
| 67 | {renderProps => ( |
| 68 | <> |
| 69 | <div className={track(renderProps)}> |
| 70 | <span className={handle(renderProps)} /> |
| 71 | </div> |
| 72 | {children} |
| 73 | </> |
| 74 | )} |
| 75 | </SwitchButton> |
| 76 | {props.description && <Description>{props.description}</Description>} |
| 77 | <FieldError>{props.errorMessage}</FieldError> |
| 78 | </SwitchField> |
| 79 | ); |
| 80 | } |
nothing calls this directly
no test coverage detected