From c380af558d215f5a6b5c2400a66c0a29c35960c4 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 18 Jul 2024 18:28:07 +0900 Subject: [PATCH] ColorPicker: Use `minimal` variant for SelectControl (#63676) * ColorPicker: Use `minimal` variant for SelectControl * Add changelog Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: ciampo Co-authored-by: tyxla --- packages/components/CHANGELOG.md | 1 + .../components/src/color-picker/component.tsx | 34 +++++++------------ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 326d2876e65c6..46e357a008b3f 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -26,6 +26,7 @@ - `CustomSelectControlV2`: do not flip popover if legacy adapter. ([#63357](https://github.com/WordPress/gutenberg/pull/63357)). - `DropdownMenuV2`: invert animation direction. ([#63443](https://github.com/WordPress/gutenberg/pull/63443)). - `Tabs`: Vertical Tabs should be 40px min height. ([#63446](https://github.com/WordPress/gutenberg/pull/63446)). +- `ColorPicker`: Use `minimal` variant for `SelectControl` ([#63676](https://github.com/WordPress/gutenberg/pull/63676)). ## 28.3.0 (2024-07-10) diff --git a/packages/components/src/color-picker/component.tsx b/packages/components/src/color-picker/component.tsx index 8154a0a41331a..a1112d2e1ecd2 100644 --- a/packages/components/src/color-picker/component.tsx +++ b/packages/components/src/color-picker/component.tsx @@ -16,11 +16,7 @@ import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ -import { - useContextSystem, - contextConnect, - ContextSystemProvider, -} from '../context'; +import { useContextSystem, contextConnect } from '../context'; import { ColorfulWrapper, SelectControl, @@ -43,9 +39,6 @@ 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 > @@ -92,20 +85,17 @@ const UnconnectedColorPicker = ( /> - - - setColorType( nextColorType as ColorType ) - } - label={ __( 'Color format' ) } - hideLabelFromVision - /> - + + setColorType( nextColorType as ColorType ) + } + label={ __( 'Color format' ) } + hideLabelFromVision + variant="minimal" + />