Skip to content

Commit

Permalink
ColorPicker: Use minimal variant for SelectControl (#63676)
Browse files Browse the repository at this point in the history
* ColorPicker: Use `minimal` variant for SelectControl

* Add changelog

Co-authored-by: mirka <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
4 people authored Jul 18, 2024
1 parent 58f62cf commit c380af5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
34 changes: 12 additions & 22 deletions packages/components/src/color-picker/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ import { __ } from '@wordpress/i18n';
/**
* Internal dependencies
*/
import {
useContextSystem,
contextConnect,
ContextSystemProvider,
} from '../context';
import { useContextSystem, contextConnect } from '../context';
import {
ColorfulWrapper,
SelectControl,
Expand All @@ -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 >
Expand Down Expand Up @@ -92,20 +85,17 @@ const UnconnectedColorPicker = (
/>
<AuxiliaryColorArtefactWrapper>
<AuxiliaryColorArtefactHStackHeader justify="space-between">
<ContextSystemProvider
value={ BORDERLESS_SELECT_CONTROL_CONTEXT }
>
<SelectControl
__nextHasNoMarginBottom
options={ options }
value={ colorType }
onChange={ ( nextColorType ) =>
setColorType( nextColorType as ColorType )
}
label={ __( 'Color format' ) }
hideLabelFromVision
/>
</ContextSystemProvider>
<SelectControl
__nextHasNoMarginBottom
options={ options }
value={ colorType }
onChange={ ( nextColorType ) =>
setColorType( nextColorType as ColorType )
}
label={ __( 'Color format' ) }
hideLabelFromVision
variant="minimal"
/>
<ColorCopyButton
color={ safeColordColor }
colorType={ copyFormat || colorType }
Expand Down

0 comments on commit c380af5

Please sign in to comment.