import type { ChangeEvent } from 'react'; import type { FormContextType, RJSFSchema, StrictRJSFSchema, WidgetProps } from '@rjsf/utils'; import { ariaDescribedByIds, getInputProps } from '@rjsf/utils'; import { ColorPicker } from 'primereact/colorpicker'; /** The `ColorWidget` component renders a color picker. * * @param props - The `WidgetProps` for this component */ export default function ColorWidget( props: WidgetProps, ) { const { id, placeholder, value, required, readonly, disabled, onChange, onChangeOverride, onBlur, onFocus, autofocus, options, schema, type, } = props; const inputProps = getInputProps(schema, type, options); const { inline } = options; const primeProps = (options.prime || {}) as object; const handleChange = ({ target: { value: newValue } }: ChangeEvent) => onChange(newValue === '' ? options.emptyValue : newValue); const handleBlur = () => onBlur && onBlur(id, value); const handleFocus = () => onFocus && onFocus(id, value); return ( ); }