diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 9edf124bbdf73c..85be50e8f7642c 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -6,6 +6,10 @@ - `CustomSelectControl`: Remove deprecated `__nextUnconstrainedWidth` prop and promote to default behavior ([#58974](https://github.com/WordPress/gutenberg/pull/58974)). +### Internal + +- `ColorPicker`: Style without accessing internal `InputControl` classes ([#59069](https://github.com/WordPress/gutenberg/pull/59069)). + ## 26.0.1 (2024-02-13) ### Bug Fix diff --git a/packages/components/src/color-picker/component.tsx b/packages/components/src/color-picker/component.tsx index 5f6d0754c93ccc..98e37df9783c55 100644 --- a/packages/components/src/color-picker/component.tsx +++ b/packages/components/src/color-picker/component.tsx @@ -16,7 +16,11 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { useContextSystem, contextConnect } from '../context'; +import { + useContextSystem, + contextConnect, + ContextSystemProvider, +} from '../context'; import { ColorfulWrapper, SelectControl, @@ -39,6 +43,9 @@ const options = [ { label: 'Hex', value: 'hex' as const }, ]; +// `isBorderless` is still experimental and not a public prop for InputControl yet. +const BORDERLESS_SELECT_CONTROL_CONTEXT = { InputBase: { isBorderless: true } }; + const UnconnectedColorPicker = ( props: ColorPickerProps, forwardedRef: ForwardedRef< any > @@ -107,16 +114,20 @@ const UnconnectedColorPicker = ( /> - - setColorType( nextColorType as ColorType ) - } - label={ __( 'Color format' ) } - hideLabelFromVision - /> + + + setColorType( nextColorType as ColorType ) + } + label={ __( 'Color format' ) } + hideLabelFromVision + /> +