({children, description, errorMessage, ...props}: CheckboxProps)
| 16 | } |
| 17 | |
| 18 | export function Checkbox({children, description, errorMessage, ...props}: CheckboxProps) { |
| 19 | return ( |
| 20 | <CheckboxField {...props}> |
| 21 | <CheckboxButton> |
| 22 | {({isIndeterminate}) => ( |
| 23 | <> |
| 24 | <div className="indicator"> |
| 25 | <svg |
| 26 | viewBox="0 0 18 18" |
| 27 | aria-hidden="true" |
| 28 | key={isIndeterminate ? 'indeterminate' : 'check'}> |
| 29 | {isIndeterminate ? ( |
| 30 | <rect x={1} y={7.5} width={16} height={3} /> |
| 31 | ) : ( |
| 32 | <polyline points="2 9 7 14 16 4" /> |
| 33 | )} |
| 34 | </svg> |
| 35 | </div> |
| 36 | {children} |
| 37 | </> |
| 38 | )} |
| 39 | </CheckboxButton> |
| 40 | {description && <Description>{description}</Description>} |
| 41 | <FieldError>{errorMessage}</FieldError> |
| 42 | </CheckboxField> |
| 43 | ); |
| 44 | } |
nothing calls this directly
no outgoing calls
no test coverage detected