MCPcopy Create free account
hub / github.com/adobe/react-spectrum / HexColorField

Function HexColorField

packages/react-aria-components/src/ColorField.tsx:203–233  ·  view source on GitHub ↗
(props: HexColorFieldProps)

Source from the content-addressed store, hash-verified

201}
202
203function HexColorField(props: HexColorFieldProps) {
204 let state = useColorFieldState({
205 ...props,
206 validationBehavior: props.validationBehavior ?? 'native'
207 });
208
209 let inputRef = useRef<HTMLInputElement>(null);
210 let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);
211 let {labelProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useColorField(
212 {
213 ...removeDataAttributes(props),
214 label,
215 validationBehavior: props.validationBehavior ?? 'native'
216 },
217 state,
218 inputRef
219 );
220
221 return useChildren(
222 props,
223 state,
224 props.forwardedRef,
225 inputProps,
226 inputRef,
227 labelProps,
228 labelRef,
229 descriptionProps,
230 errorMessageProps,
231 validation
232 );
233}
234
235function useChildren(
236 props: ColorFieldProps,

Callers

nothing calls this directly

Calls 5

useColorFieldStateFunction · 0.90
useSlotFunction · 0.90
useColorFieldFunction · 0.90
removeDataAttributesFunction · 0.90
useChildrenFunction · 0.85

Tested by

no test coverage detected