diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index e732cbda994afe..3674084f38e9e3 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -10,6 +10,7 @@ - `PaletteEdit` and `CircularOptionPicker`: improve unit tests ([#57809](https://github.com/WordPress/gutenberg/pull/57809)). - `Tooltip`: no-op when nested inside other `Tooltip` components ([#57202](https://github.com/WordPress/gutenberg/pull/57202)). - `Tooltip` and `Button`: tidy up unit tests ([#57975](https://github.com/WordPress/gutenberg/pull/57975)). +- `BorderControl`, `BorderBoxControl`: Replace style picker with ToggleGroupControl ([#57562](https://github.com/WordPress/gutenberg/pull/57562)). - `SlotFill`: fix typo in use-slot-fills return docs ([#57654](https://github.com/WordPress/gutenberg/pull/57654)) ### Bug Fix diff --git a/packages/components/src/border-control/border-control-dropdown/component.tsx b/packages/components/src/border-control/border-control-dropdown/component.tsx index 3ee01bcda8f3b3..0a56edd946308b 100644 --- a/packages/components/src/border-control/border-control-dropdown/component.tsx +++ b/packages/components/src/border-control/border-control-dropdown/component.tsx @@ -142,6 +142,7 @@ const BorderControlDropdown = ( enableStyle, indicatorClassName, indicatorWrapperClassName, + isStyleSettable, onReset, onColorChange, onStyleChange, @@ -218,7 +219,7 @@ const BorderControlDropdown = ( clearable={ false } enableAlpha={ enableAlpha } /> - { enableStyle && ( + { enableStyle && isStyleSettable && ( { - const { label, hideLabelFromVision } = props; - - if ( ! label ) { - return null; - } - - return hideLabelFromVision ? ( - { label } - ) : ( - { label } - ); -}; - -const BorderControlStylePicker = ( - props: WordPressComponentProps< StylePickerProps, 'div' >, +function UnconnectedBorderControlStylePicker( + { onChange, ...restProps }: StylePickerProps, forwardedRef: React.ForwardedRef< any > -) => { - const { - buttonClassName, - hideLabelFromVision, - label, - onChange, - value, - ...otherProps - } = useBorderControlStylePicker( props ); - +) { return ( - -