/** * External dependencies */ import { colord } from 'colord'; /** * WordPress dependencies */ import { Button, ColorIndicator, ColorPicker, Dropdown, privateApis, __experimentalInputControlPrefixWrapper as InputControlPrefixWrapper, __experimentalDropdownContentWrapper as DropdownContentWrapper, } from '@wordpress/components'; import { useCallback } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import type { DataFormControlProps } from '../../types'; import { unlock } from '../../lock-unlock'; import getCustomValidity from './utils/get-custom-validity'; const { ValidatedInputControl } = unlock( privateApis ); const ColorPickerDropdown = ( { color, onColorChange, }: { color: string; onColorChange: ( newColor: string ) => void; } ) => { const validColor = color && colord( color ).isValid() ? color : '#ffffff'; return ( (