(props: ColorFieldProps)
| 12 | } |
| 13 | |
| 14 | export function ColorField(props: ColorFieldProps) { |
| 15 | let state = useColorFieldState(props); |
| 16 | let inputRef = useRef<HTMLInputElement>(null); |
| 17 | /*- begin highlight -*/ |
| 18 | let {labelProps, inputProps} = useColorField(props, state, inputRef); |
| 19 | /*- end highlight -*/ |
| 20 | let [isFocused, setFocused] = useState(false); |
| 21 | let {focusProps} = useFocus({onFocusChange: setFocused}); |
| 22 | |
| 23 | return ( |
| 24 | <div className="react-aria-ColorField"> |
| 25 | {props.label && ( |
| 26 | <label className="react-aria-Label" {...labelProps}> |
| 27 | {props.label} |
| 28 | </label> |
| 29 | )} |
| 30 | <input |
| 31 | {...mergeProps(inputProps, focusProps)} |
| 32 | ref={inputRef} |
| 33 | className="react-aria-Input inset" |
| 34 | data-focused={isFocused || undefined} |
| 35 | /> |
| 36 | </div> |
| 37 | ); |
| 38 | } |
nothing calls this directly
no test coverage detected