diff --git a/packages/components/src/tools-panel/stories/index.story.tsx b/packages/components/src/tools-panel/stories/index.story.tsx index cd6f61c6e921b..7a0b8f774eea2 100644 --- a/packages/components/src/tools-panel/stories/index.story.tsx +++ b/packages/components/src/tools-panel/stories/index.story.tsx @@ -53,7 +53,7 @@ export const Default: StoryFn< typeof ToolsPanel > = ( { const [ height, setHeight ] = useState< string | undefined >(); const [ minHeight, setMinHeight ] = useState< string | undefined >(); const [ width, setWidth ] = useState< string | undefined >(); - const [ scale, setScale ] = useState< React.ReactText | undefined >(); + const [ scale, setScale ] = useState< number | string | undefined >(); const resetAll: typeof resetAllProp = ( filters ) => { setHeight( undefined ); @@ -402,7 +402,7 @@ export const WithConditionalDefaultControl: StoryFn< typeof ToolsPanel > = ( { } ) => { const [ attributes, setAttributes ] = useState< { height?: string; - scale?: React.ReactText; + scale?: number | string; } >( {} ); const { height, scale } = attributes; @@ -498,7 +498,7 @@ export const WithConditionallyRenderedControl: StoryFn< > = ( { resetAll: resetAllProp, panelId, ...props } ) => { const [ attributes, setAttributes ] = useState< { height?: string; - scale?: React.ReactText; + scale?: number | string; } >( {} ); const { height, scale } = attributes; diff --git a/packages/components/src/utils/font-size.ts b/packages/components/src/utils/font-size.ts index c9a3b044b55a2..c21b50f7452dd 100644 --- a/packages/components/src/utils/font-size.ts +++ b/packages/components/src/utils/font-size.ts @@ -1,7 +1,7 @@ /** * External dependencies */ -import type { CSSProperties, ReactText } from 'react'; +import type { CSSProperties } from 'react'; /** * Internal dependencies @@ -61,7 +61,7 @@ export function getFontSize( return `calc(${ ratio } * ${ CONFIG.fontSize })`; } -export function getHeadingFontSize( size: ReactText = 3 ): string { +export function getHeadingFontSize( size: number | string = 3 ): string { if ( ! HEADING_FONT_SIZES.includes( size as HeadingSize ) ) { return getFontSize( size ); }