Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### New Features

- Add `SearchableSelectControl` component ([#80979](https://github.com/WordPress/gutenberg/pull/80979)).

## 0.23.0 (2026-09-23)

### Breaking Changes
Expand Down Expand Up @@ -42,7 +46,7 @@
- Remove the obsolete Jest console test dependency and matcher types ([#82843](https://github.com/WordPress/gutenberg/pull/82843)).
- Update `@base-ui/react` from 1.7.0 to 1.8.0 ([#82835](https://github.com/WordPress/gutenberg/pull/82835)).
- Run UI interaction tests in Vitest Browser Mode ([#80995](https://github.com/WordPress/gutenberg/pull/80995)).
- `VisuallyHidden`: Replace deprecated `word-wrap` with `overflow-wrap` and remove related Stylelint suppression ([#82970](https://github.com/WordPress/gutenberg/pull/82970)).
- `VisuallyHidden`: Replace deprecated `word-wrap` with `overflow-wrap` and remove related Stylelint suppression ([#82970](https://github.com/WordPress/gutenberg/pull/82970)).

## 0.22.0 (2026-09-10)

Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/form/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export * from './input-control';
export * from './radio-group-control';
export * from './select-control';
export { SearchableChipSelectControl } from './searchable-chip-select-control';
export { SearchableSelectControl } from './searchable-select-control';
export * from './switch-control';
export * from './textarea-control';
export * from './with-validation';
2 changes: 2 additions & 0 deletions packages/ui/src/form/primitives/searchable-select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ GroupLabel.displayName = 'SearchableSelect.GroupLabel';
/**
* A searchable single-selection component, with support for
* a creatable footer action.
*
* Prefer `SearchableSelectControl` when using with a standard label and description.
*/
export const SearchableSelect = Object.assign( _SearchableSelect, {
Item,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ function warnSearchableSelectProps(
/**
* A searchable single-selection component, with support for
* a creatable footer action.
*
* Prefer `SearchableSelectControl` when using with a standard label and description.
*/
export const SearchableSelect = forwardRef<
HTMLButtonElement,
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/form/primitives/searchable-select/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export type ItemGroup = {
};

export type SearchableSelectItemProps = Omit< ComboboxItemProps, 'value' > & {
/**
* The option item this list item represents.
*/
value: Item;
};

Expand Down
20 changes: 20 additions & 0 deletions packages/ui/src/form/searchable-select-control/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { SearchableSelectControl as _SearchableSelectControl } from './searchable-select-control';
import { Group } from '../primitives/combobox/group';
import { GroupLabel } from '../primitives/combobox/group-label';
import { Item } from '../primitives/searchable-select/item';
import { Collection } from '../primitives/combobox/collection';
import { useFilteredItems } from '../primitives/combobox/use-filtered-items';

/**
* A complete searchable select field with integrated label and description.
*/
export const SearchableSelectControl = Object.assign(
_SearchableSelectControl,
{
Group,
GroupLabel,
Item,
Collection,
useFilteredItems,
}
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { forwardRef } from '@wordpress/element';
import { Field, SearchableSelect } from '../primitives';
import type { SearchableSelectControlProps } from './types';

/**
* A complete searchable select field with integrated label and description.
*/
export const SearchableSelectControl = forwardRef<
HTMLButtonElement,
SearchableSelectControlProps
>( function SearchableSelectControl(
{
className,
label,
description,
details,
hideLabelFromVision,
...restProps
},
ref
) {
return (
<Field.Root className={ className }>
<Field.Label hideFromVision={ hideLabelFromVision }>
{ label }
</Field.Label>
<SearchableSelect
ref={ ref }
aria-label={ label }
{ ...restProps }
/>
{ description && (
<Field.Description>{ description }</Field.Description>
) }
{ details && <Field.Details>{ details }</Field.Details> }
</Field.Root>
);
} );
Loading
Loading