From 48add63981db58212411a8a338ec327abecf41f3 Mon Sep 17 00:00:00 2001 From: Damiano Plebani Date: Mon, 4 Nov 2024 17:51:12 +0100 Subject: [PATCH] Add granular support for `allowFontScaling` in all the typographic styles --- src/components/typography/IOText.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/components/typography/IOText.tsx b/src/components/typography/IOText.tsx index a8e01ce4..965d8668 100644 --- a/src/components/typography/IOText.tsx +++ b/src/components/typography/IOText.tsx @@ -47,10 +47,7 @@ type IOTextBaseProps = { style?: IOTextStyle; }; -type IOTextExcludedProps = Omit< - ComponentProps, - "allowFontScaling" | "maxFontSizeMultiplier" | "style" ->; +type IOTextExcludedProps = Omit, "style">; export type IOTextProps = IOTextBaseProps & IOTextExcludedProps; @@ -98,6 +95,8 @@ export const IOText = forwardRef( textStyle, style, children, + allowFontScaling, + maxFontSizeMultiplier, ...props }, ref @@ -144,8 +143,8 @@ export const IOText = forwardRef( /* Accessible typography based on the `fontScale` parameter */ const accessibleFontSizeProps: ComponentProps = { - allowFontScaling: isExperimental, - maxFontSizeMultiplier: 1.25 + allowFontScaling: allowFontScaling ?? isExperimental, + maxFontSizeMultiplier: maxFontSizeMultiplier ?? 1.25 }; return (