From 7b1188ce542dfb7053fa0f8f90b594bf55c9cfd3 Mon Sep 17 00:00:00 2001 From: PARTHVATALIYA Date: Mon, 11 Nov 2024 11:48:12 +0530 Subject: [PATCH 1/3] Add the console warning for 36px size variation --- packages/components/src/combobox-control/README.md | 1 + packages/components/src/combobox-control/index.tsx | 7 +++++++ .../src/combobox-control/stories/index.story.tsx | 1 + packages/components/src/combobox-control/test/index.tsx | 8 +++++++- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/components/src/combobox-control/README.md b/packages/components/src/combobox-control/README.md index 5831c5ec2832c2..4089cf9c56e9b5 100644 --- a/packages/components/src/combobox-control/README.md +++ b/packages/components/src/combobox-control/README.md @@ -34,6 +34,7 @@ function MyComboboxControl() { const [ filteredOptions, setFilteredOptions ] = useState( options ); return ( {}; @@ -313,6 +314,12 @@ function ComboboxControl( props: ComboboxControlProps ) { } }, [ matchingSuggestions, isExpanded ] ); + maybeWarnDeprecated36pxSize( { + componentName: 'ComboboxControl', + __next40pxDefaultSize, + size: undefined, + } ); + // Disable reason: There is no appropriate role which describes the // input container intended accessible usability. // TODO: Refactor click detection to use blur to stop propagation. diff --git a/packages/components/src/combobox-control/stories/index.story.tsx b/packages/components/src/combobox-control/stories/index.story.tsx index 516cd262fd5aa6..712ca7fa813a17 100644 --- a/packages/components/src/combobox-control/stories/index.story.tsx +++ b/packages/components/src/combobox-control/stories/index.story.tsx @@ -76,6 +76,7 @@ const Template: StoryFn< typeof ComboboxControl > = ( { }; export const Default = Template.bind( {} ); Default.args = { + __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, allowReset: false, label: 'Select a country', diff --git a/packages/components/src/combobox-control/test/index.tsx b/packages/components/src/combobox-control/test/index.tsx index 639407ac998ed2..8f569ed381a844 100644 --- a/packages/components/src/combobox-control/test/index.tsx +++ b/packages/components/src/combobox-control/test/index.tsx @@ -58,7 +58,13 @@ const getOptionSearchString = ( option: ComboboxControlOption ) => option.label.substring( 0, 11 ); const ComboboxControl = ( props: ComboboxControlProps ) => { - return <_ComboboxControl { ...props } __nextHasNoMarginBottom />; + return ( + <_ComboboxControl + { ...props } + __next40pxDefaultSize + __nextHasNoMarginBottom + /> + ); }; const ControlledComboboxControl = ( { From 3d9efb6550e7c9cad08c691a1985e8909e9dd1cd Mon Sep 17 00:00:00 2001 From: PARTHVATALIYA Date: Mon, 11 Nov 2024 11:52:25 +0530 Subject: [PATCH 2/3] Add the changelog for the deprecation --- packages/components/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 93b191bff269d6..89a4d97a8c3ae9 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -24,6 +24,7 @@ - `BorderBoxControl`: Deprecate 36px default size ([#65752](https://github.com/WordPress/gutenberg/pull/65752)). - `BorderControl`: Deprecate 36px default size ([#65755](https://github.com/WordPress/gutenberg/pull/65755)). +- `ComboboxControl`: Deprecate 36px default size ([#66900](https://github.com/WordPress/gutenberg/pull/66900)). ### Bug Fixes From 16bafabedb6de0b6f64e94050c1ad34444e7303a Mon Sep 17 00:00:00 2001 From: parthVataliya16 Date: Tue, 19 Nov 2024 10:59:55 +0530 Subject: [PATCH 3/3] Update: changelog and JSDoc --- packages/components/CHANGELOG.md | 2 +- packages/components/src/combobox-control/index.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 89a4d97a8c3ae9..e1c75dcb84f666 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -5,6 +5,7 @@ ### Deprecations - `Radio`: Deprecate 36px default size ([#66572](https://github.com/WordPress/gutenberg/pull/66572)). +- `ComboboxControl`: Deprecate 36px default size ([#66900](https://github.com/WordPress/gutenberg/pull/66900)). ### Enhancements @@ -24,7 +25,6 @@ - `BorderBoxControl`: Deprecate 36px default size ([#65752](https://github.com/WordPress/gutenberg/pull/65752)). - `BorderControl`: Deprecate 36px default size ([#65755](https://github.com/WordPress/gutenberg/pull/65755)). -- `ComboboxControl`: Deprecate 36px default size ([#66900](https://github.com/WordPress/gutenberg/pull/66900)). ### Bug Fixes diff --git a/packages/components/src/combobox-control/index.tsx b/packages/components/src/combobox-control/index.tsx index 84c540d4b0e87d..86fa4f4467318c 100644 --- a/packages/components/src/combobox-control/index.tsx +++ b/packages/components/src/combobox-control/index.tsx @@ -93,6 +93,7 @@ const getIndexOfMatchingSuggestion = ( * const [ filteredOptions, setFilteredOptions ] = useState( options ); * return ( *