diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index c9f63514c8a608..5c8643dc08cf6c 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +### Deprecations + +- `SelectControl`: Deprecate 36px default size ([#66898](https://github.com/WordPress/gutenberg/pull/66898)). +- `InputControl`: Deprecate 36px default size ([#66897](https://github.com/WordPress/gutenberg/pull/66897)). + ## 29.0.0 (2024-12-11) ### Breaking Changes diff --git a/packages/components/src/dimension-control/index.tsx b/packages/components/src/dimension-control/index.tsx index 2cc39379ebde0c..ffdfaeb84ee51d 100644 --- a/packages/components/src/dimension-control/index.tsx +++ b/packages/components/src/dimension-control/index.tsx @@ -113,6 +113,7 @@ export function DimensionControl( props: DimensionControlProps ) { { /> {} } options={ [ diff --git a/packages/components/src/input-control/README.md b/packages/components/src/input-control/README.md index 58a3b4a3b1a094..ff5c70decebeb7 100644 --- a/packages/components/src/input-control/README.md +++ b/packages/components/src/input-control/README.md @@ -17,6 +17,7 @@ const Example = () => { return ( setValue( nextValue ?? '' ) } /> diff --git a/packages/components/src/input-control/index.tsx b/packages/components/src/input-control/index.tsx index fd0fc0a5c45536..d346d1b31b1118 100644 --- a/packages/components/src/input-control/index.tsx +++ b/packages/components/src/input-control/index.tsx @@ -20,6 +20,7 @@ import { space } from '../utils/space'; import { useDraft } from './utils'; import BaseControl from '../base-control'; import { useDeprecated36pxDefaultSizeProp } from '../utils/use-deprecated-props'; +import { maybeWarnDeprecated36pxSize } from '../utils/deprecated-36px-size'; const noop = () => {}; @@ -36,6 +37,7 @@ export function UnforwardedInputControl( ) { const { __next40pxDefaultSize, + __shouldNotWarnDeprecated36pxSize, __unstableStateReducer: stateReducer = ( state ) => state, __unstableInputWidth, className, @@ -68,6 +70,13 @@ export function UnforwardedInputControl( const helpProp = !! help ? { 'aria-describedby': `${ id }__help` } : {}; + maybeWarnDeprecated36pxSize( { + componentName: 'InputControl', + __next40pxDefaultSize, + size, + __shouldNotWarnDeprecated36pxSize, + } ); + return ( setValue( nextValue ?? '' ) } * /> diff --git a/packages/components/src/input-control/stories/index.story.tsx b/packages/components/src/input-control/stories/index.story.tsx index 136301c42e7d09..40630938dbb370 100644 --- a/packages/components/src/input-control/stories/index.story.tsx +++ b/packages/components/src/input-control/stories/index.story.tsx @@ -46,6 +46,7 @@ export const Default = Template.bind( {} ); Default.args = { label: 'Value', placeholder: 'Placeholder', + __next40pxDefaultSize: true, }; export const WithHelpText = Template.bind( {} ); @@ -117,7 +118,6 @@ export const ShowPassword: StoryFn< typeof InputControl > = ( args ) => { return (