{"version":3,"file":"font-size-preview.cjs","names":["useStyle","getComputedFluidTypographyValue","__"],"sources":["../../src/font-sizes/font-size-preview.tsx"],"sourcesContent":["import { getComputedFluidTypographyValue } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport type { FontSize } from '@wordpress/global-styles-engine';\nimport { useStyle } from '../hooks';\n\ninterface FontSizePreviewProps {\n\tfontSize: FontSize;\n}\n\nfunction FontSizePreview( { fontSize }: FontSizePreviewProps ) {\n\tconst [ font ] = useStyle< { fontFamily?: string } >( 'typography' );\n\n\tconst input =\n\t\ttypeof fontSize?.fluid === 'object' &&\n\t\tfontSize?.fluid?.min &&\n\t\tfontSize?.fluid?.max\n\t\t\t? {\n\t\t\t\t\tminimumFontSize: fontSize.fluid.min,\n\t\t\t\t\tmaximumFontSize: fontSize.fluid.max,\n\t\t\t\t}\n\t\t\t: {\n\t\t\t\t\tfontSize: fontSize.size,\n\t\t\t\t};\n\n\tconst computedFontSize = getComputedFluidTypographyValue( input );\n\treturn (\n\t\t<div\n\t\t\tclassName=\"global-styles-ui-typography-preview\"\n\t\t\tstyle={ {\n\t\t\t\t// React skips a null style value.\n\t\t\t\tfontSize: computedFontSize as string,\n\t\t\t\tfontFamily: font?.fontFamily ?? 'serif',\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Aa' ) }\n\t\t</div>\n\t);\n}\n\nexport default FontSizePreview;\n"],"mappings":";;;;;;;;;;AASA,SAAS,gBAAiB,EAAE,YAAmC;CAC9D,MAAM,CAAE,SAAA,GAASA,YAAAA,SAAAA,CAAqC,YAAa;CAEnE,MAAM,QACL,OAAO,UAAU,UAAU,YAC3B,UAAU,OAAO,OACjB,UAAU,OAAO,MACd;EACA,iBAAiB,SAAS,MAAM;EAChC,iBAAiB,SAAS,MAAM;CACjC,IACC,EACA,UAAU,SAAS,KACpB;CAEH,MAAM,oBAAA,GAAmBC,wBAAAA,gCAAAA,CAAiC,KAAM;CAChE,OACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACC,WAAU;EACV,OAAQ;GAEP,UAAU;GACV,YAAY,MAAM,cAAc;EACjC;EAEEC,WAAAA,GAAAA,gBAAAA,GAAAA,CAAI,IAAK;CACP,CAAA;AAEP"}