diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 054877bef45044..93b3f52d6e4915 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -13,6 +13,7 @@ - `FormTokenField`: Update styling for consistency and increased visibility ([#54402](https://github.com/WordPress/gutenberg/pull/54402)). - `CircularOptionPicker`: Add option to use previous non-listbox behaviour, for contexts where buttons are more appropriate than a list of options ([#54290](https://github.com/WordPress/gutenberg/pull/54290)). - `DuotonePicker/ColorListPicker`: Adds appropriate labels to 'Duotone Filter' color pickers ([#54468](https://github.com/WordPress/gutenberg/pull/54468)). +- `SearchControl`: support new `40px` and `32px` sizes ([#54548](https://github.com/WordPress/gutenberg/pull/54548)). - `FormTokenField`: Add `tokenizeOnBlur` prop to add any incompleteTokenValue as a new token when field loses focus ([#54445](https://github.com/WordPress/gutenberg/pull/54445)). ### Bug Fix diff --git a/packages/components/src/search-control/README.md b/packages/components/src/search-control/README.md index 6f79d6cd9efd9a..31c6c21e5222a6 100644 --- a/packages/components/src/search-control/README.md +++ b/packages/components/src/search-control/README.md @@ -90,6 +90,13 @@ If true, the label will not be visible, but will be read by screen readers. Defa - Type: `Boolean` - Required: No +#### `size`: `'default'` | `'compact'` + +The size of the component. + +- Required: No +- Default: `'default'` + ## Related components - To offer users more constrained options for input, use TextControl, SelectControl, RadioControl, CheckboxControl, or RangeControl. diff --git a/packages/components/src/search-control/index.tsx b/packages/components/src/search-control/index.tsx index 528ae52b26bbc8..723d754ba78ea1 100644 --- a/packages/components/src/search-control/index.tsx +++ b/packages/components/src/search-control/index.tsx @@ -23,6 +23,7 @@ import type { ForwardedRef } from 'react'; function UnforwardedSearchControl( { __nextHasNoMarginBottom, + __next40pxDefaultSize = false, className, onChange, onKeyDown, @@ -32,6 +33,7 @@ function UnforwardedSearchControl( hideLabelFromVision = true, help, onClose, + size = 'default', ...restProps }: WordPressComponentProps< SearchControlProps, 'input', false >, forwardedRef: ForwardedRef< HTMLInputElement > @@ -44,9 +46,11 @@ function UnforwardedSearchControl( if ( onClose ) { return (