From 9f0e2d3c1a55f5f6af8962bb8cc63f4db7a6d70c Mon Sep 17 00:00:00 2001 From: VATALIYA PARTH <88878890+PARTHVATALIYA@users.noreply.github.com> Date: Wed, 20 Nov 2024 06:32:41 +0530 Subject: [PATCH] FontSizePicker : Deprecate 36px default size (#66920) * Add the console warning for 36px size variation * Add the changelog for the deprecation * Update: changelog and test for all tests need to pass --------- Co-authored-by: PARTHVATALIYA Co-authored-by: mirka <0mirka00@git.wordpress.org> --- packages/components/CHANGELOG.md | 3 ++- packages/components/src/font-size-picker/README.md | 1 + packages/components/src/font-size-picker/index.tsx | 7 +++++++ .../src/font-size-picker/stories/index.story.tsx | 1 + packages/components/src/font-size-picker/test/index.tsx | 6 +++++- 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 927b1a12cee4c3..b23d024a724dd1 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -6,6 +6,8 @@ - `DimensionControl`: Deprecate 36px default size ([#66705](https://github.com/WordPress/gutenberg/pull/66705)). - `TextControl`: Deprecate 36px default size ([#66745](https://github.com/WordPress/gutenberg/pull/66745). +- `FontSizePicker`: Deprecate 36px default size ([#66920](https://github.com/WordPress/gutenberg/pull/66920)). +- `ComboboxControl`: Deprecate 36px default size ([#66900](https://github.com/WordPress/gutenberg/pull/66900)). ### Bug Fixes @@ -30,7 +32,6 @@ ### 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)). ### Bug Fixes diff --git a/packages/components/src/font-size-picker/README.md b/packages/components/src/font-size-picker/README.md index 5d7fe2b39a7373..39d916c0c7b212 100644 --- a/packages/components/src/font-size-picker/README.md +++ b/packages/components/src/font-size-picker/README.md @@ -29,6 +29,7 @@ const MyFontSizePicker = () => { return ( { __( 'Font size' ) } diff --git a/packages/components/src/font-size-picker/stories/index.story.tsx b/packages/components/src/font-size-picker/stories/index.story.tsx index eec8f5173d9655..a0d83756ca1ec9 100644 --- a/packages/components/src/font-size-picker/stories/index.story.tsx +++ b/packages/components/src/font-size-picker/stories/index.story.tsx @@ -66,6 +66,7 @@ const TwoFontSizePickersWithState: StoryFn< typeof FontSizePicker > = ( { export const Default: StoryFn< typeof FontSizePicker > = FontSizePickerWithState.bind( {} ); Default.args = { + __next40pxDefaultSize: true, disableCustomFontSizes: false, fontSizes: [ { diff --git a/packages/components/src/font-size-picker/test/index.tsx b/packages/components/src/font-size-picker/test/index.tsx index e7205e57eefaa6..34e8ce17c67fa6 100644 --- a/packages/components/src/font-size-picker/test/index.tsx +++ b/packages/components/src/font-size-picker/test/index.tsx @@ -8,13 +8,17 @@ import { render } from '@ariakit/test/react'; /** * Internal dependencies */ -import FontSizePicker from '../'; +import _FontSizePicker from '../'; import type { FontSize } from '../types'; /** * WordPress dependencies */ import { useState } from '@wordpress/element'; +const FontSizePicker = ( + props: React.ComponentProps< typeof _FontSizePicker > +) => <_FontSizePicker __next40pxDefaultSize { ...props } />; + const ControlledFontSizePicker = ( { onChange, ...props