MCPcopy Index your code
hub / github.com/adobe/react-spectrum / HexColorField

Function HexColorField

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

Source from the content-addressed store, hash-verified

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