diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index eb7ab187b8eeaf..1abf30ff318a72 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -6,6 +6,7 @@ - `InputControl`: Add `__next36pxDefaultSize` flag for larger default size ([#40622](https://github.com/WordPress/gutenberg/pull/40622)). - `UnitControl`: Add `__next36pxDefaultSize` flag for larger default size ([#40627](https://github.com/WordPress/gutenberg/pull/40627)). +- `SelectControl`: Improved TypeScript support ([#40737](https://github.com/WordPress/gutenberg/pull/40737)). - `ToggleControlGroup`: Switch to internal `Icon` component for dashicon support ([40717](https://github.com/WordPress/gutenberg/pull/40717)). ### Internal diff --git a/packages/components/src/dimension-control/test/__snapshots__/index.test.js.snap b/packages/components/src/dimension-control/test/__snapshots__/index.test.js.snap index f25202bad70eaa..8d4f0ad50e03d9 100644 --- a/packages/components/src/dimension-control/test/__snapshots__/index.test.js.snap +++ b/packages/components/src/dimension-control/test/__snapshots__/index.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`DimensionControl rendering renders with custom sizes 1`] = ` - { - help?: string; - hideLabelFromVision?: boolean; - multiple?: boolean; - onBlur?: ( event: FocusEvent< HTMLSelectElement > ) => void; - onFocus?: ( event: FocusEvent< HTMLSelectElement > ) => void; - onChange?: ( - value: string | string[], - extra?: { event?: ChangeEvent< HTMLSelectElement > } - ) => void; - options?: { - label: string; - value: string; - id?: string; - disabled?: boolean; - }[]; - size?: Size; - value?: string | string[]; - labelPosition?: LabelPosition; - children?: ReactNode; -} - -function SelectControl( +function UnforwardedSelectControl( { className, disabled = false, @@ -165,6 +141,31 @@ function SelectControl( /* eslint-enable jsx-a11y/no-onchange */ } -const ForwardedComponent = forwardRef( SelectControl ); +/** + * `SelectControl` allows users to select from a single or multiple option menu. + * It functions as a wrapper around the browser's native `