{"version":3,"file":"Text.cjs","sources":["../../../../src/components/typography/Text.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport React, { forwardRef } from \"react\";\nimport type { PolymorphicRef } from \"../../utilities/index.js\";\nimport type { TextElement, TextProps } from \"./types.js\";\n\ntype TextComponent = <As extends TextElement = \"p\">(\n    props: TextProps<As>,\n) => React.ReactElement | null;\n\nexport const Text: TextComponent = forwardRef(function Text<\n    As extends TextElement = \"p\",\n>(\n    {\n        as,\n        className,\n        size = \"m\",\n        bold,\n        short,\n        srOnly,\n        center,\n        subdued,\n        ...rest\n    }: TextProps<As>,\n    ref?: PolymorphicRef<As>,\n) {\n    const Component = (as || \"p\") as React.ElementType;\n    return (\n        <Component\n            className={clsx(\"jkl-text\", srOnly && \"jkl-sr-only\", className)}\n            data-text-size={size}\n            data-bold={bold || undefined}\n            data-short={short || undefined}\n            data-center={center || undefined}\n            data-subdued={subdued || undefined}\n            ref={ref}\n            {...rest}\n        />\n    );\n}) as TextComponent;\n"],"names":["Text","forwardRef","as","className","size","bold","short","srOnly","center","subdued","rest","ref","Component","jsx","clsx"],"mappings":"6JASaA,mBAAsBC,WAAW,UAItCC,GAAAA,EACAC,UAAAA,EACAC,KAAAA,EAAO,IACPC,KAAAA,EACAC,MAAAA,EACAC,OAAAA,EACAC,OAAAA,EACAC,QAAAA,KACGC,GAEPC,GAEA,MAAMC,EAAaV,GAAM,IACzB,OACIW,EAAAA,IAACD,EAAA,CACGT,UAAWW,EAAAA,KAAK,WAAYP,GAAU,cAAeJ,GACrD,iBAAgBC,EAChB,YAAWC,QAAQ,EACnB,aAAYC,QAAS,EACrB,cAAaE,QAAU,EACvB,eAAcC,QAAW,EACzBE,IAAAA,KACID,GAGhB"}