From f80c3339b54c9ab692229ff7ff96eb53dcfde0e3 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Fri, 10 Jan 2025 15:34:59 +0100 Subject: [PATCH] Fix usage of tooltip in the Circular option picker. --- .../src/circular-option-picker/README.md | 3 +-- .../circular-option-picker-option.tsx | 27 ++++++++++++------- .../circular-option-picker.tsx | 1 - .../stories/index.story.tsx | 1 - .../components/src/color-palette/index.tsx | 7 ----- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/packages/components/src/circular-option-picker/README.md b/packages/components/src/circular-option-picker/README.md index 1dc230686cae17..b6db6f06daf456 100644 --- a/packages/components/src/circular-option-picker/README.md +++ b/packages/components/src/circular-option-picker/README.md @@ -29,7 +29,6 @@ const Example = () => { style={ { backgroundColor: color, color } } isSelected={ index === currentColor } onClick={ () => setCurrentColor( index ) } - aria-label={ name } /> ); } ) } @@ -150,6 +149,6 @@ Inherits all of the [`Dropdown` props](/packages/components/src/dropdown/README. Props for the underlying `Button` component. -Inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href`, `target`, and `children`. +Inherits all of the [`Button` props](/packages/components/src/button/README.md#props), except for `href`, `target`, and `children`. - Required: No diff --git a/packages/components/src/circular-option-picker/circular-option-picker-option.tsx b/packages/components/src/circular-option-picker/circular-option-picker-option.tsx index c5b2edb260d159..8b01bae9173e64 100644 --- a/packages/components/src/circular-option-picker/circular-option-picker-option.tsx +++ b/packages/components/src/circular-option-picker/circular-option-picker-option.tsx @@ -17,7 +17,6 @@ import { Icon, check } from '@wordpress/icons'; import { CircularOptionPickerContext } from './circular-option-picker-context'; import Button from '../button'; import { Composite } from '../composite'; -import Tooltip from '../tooltip'; import type { OptionProps } from './types'; function UnforwardedOptionAsButton( @@ -25,15 +24,17 @@ function UnforwardedOptionAsButton( id?: string; className?: string; isPressed?: boolean; + label?: string; }, forwardedRef: ForwardedRef< any > ) { - const { isPressed, ...additionalProps } = props; + const { isPressed, label, ...additionalProps } = props; return (