(props: AriaCheckboxGroupItemProps)
| 53 | } |
| 54 | |
| 55 | export function Checkbox(props: AriaCheckboxGroupItemProps) { |
| 56 | let state = React.useContext(CheckboxGroupContext)!; |
| 57 | let ref = useRef<HTMLInputElement>(null); |
| 58 | /*- begin highlight -*/ |
| 59 | let {inputProps, isSelected, isPressed, isDisabled, isReadOnly, isInvalid} = useCheckboxGroupItem( |
| 60 | props, |
| 61 | state, |
| 62 | ref |
| 63 | ); |
| 64 | /*- end highlight -*/ |
| 65 | let {hoverProps, isHovered} = useHover({isDisabled: isDisabled || isReadOnly}); |
| 66 | let {isFocused, isFocusVisible, focusProps} = useFocusRing(); |
| 67 | |
| 68 | return ( |
| 69 | <div className="react-aria-CheckboxField" data-disabled={isDisabled || undefined}> |
| 70 | <label |
| 71 | {...hoverProps} |
| 72 | className="react-aria-CheckboxButton" |
| 73 | data-selected={isSelected || undefined} |
| 74 | data-pressed={isPressed || undefined} |
| 75 | data-hovered={isHovered || undefined} |
| 76 | data-focused={isFocused || undefined} |
| 77 | data-focus-visible={isFocusVisible || undefined} |
| 78 | data-disabled={isDisabled || undefined} |
| 79 | data-readonly={isReadOnly || undefined} |
| 80 | data-invalid={isInvalid || undefined}> |
| 81 | <VisuallyHidden elementType="span"> |
| 82 | <input {...mergeProps(inputProps, focusProps)} ref={ref} /> |
| 83 | </VisuallyHidden> |
| 84 | <div className="indicator"> |
| 85 | <svg viewBox="0 0 18 18" aria-hidden="true"> |
| 86 | <polyline points="2 9 7 14 16 4" /> |
| 87 | </svg> |
| 88 | </div> |
| 89 | {props.children} |
| 90 | </label> |
| 91 | </div> |
| 92 | ); |
| 93 | } |
nothing calls this directly
no test coverage detected