{"version":3,"file":"index.cjs","sources":["../../../src/components/Typography/index.tsx"],"sourcesContent":["import { cn } from \"@/components/utils\";\nimport {\n    PolymorphicComponentPropsWithRef,\n    PolymorphicRef,\n} from \"@/components/utils/types\";\nimport { VariantProps, cva } from \"class-variance-authority\";\nimport { forwardRef } from \"react\";\n\nconst textStyles = cva(\"w-full\", {\n  variants: {\n    emphasis: {\n      low: \"text-subline font-normal\",\n    },\n    size: {\n      xs: \"text-xs\",\n      sm: \"text-sm font-medium\",\n      base: \"text-base font-medium\",\n      lg: \"text-lg font-medium\",\n      xl: \"text-xl font-medium\",\n      \"2xl\": \"text-2xl font-medium\",\n      \"3xl\": \"text-3xl\",\n      \"4xl\": \"text-4xl\",\n      \"5xl\": \"text-5xl\",\n      \"6xl\": \"text-6xl\"\n    },\n    weight: {\n      thin: \"font-thin\",\n      normal: \"font-normal\",\n      medium: \"font-medium\",\n      semibold: \"font-semibold\",\n      bold: \"font-bold\",\n      black: \"font-black\",\n    },\n    align: {\n      left: \"text-left\",\n      center: \"text-center\",\n      right: \"text-right\",\n    },\n    italic: {\n      true: \"italic\",\n    },\n    underline: {\n      true: \"underline underline-offset-2\",\n    },\n  },\n  defaultVariants: {\n    size: \"base\",\n    align: \"left\",\n  },\n});\n\ntype TextProps<C extends React.ElementType> = PolymorphicComponentPropsWithRef<\n  C,\n  VariantProps<typeof textStyles>\n>;\n\ntype TextComponent = <C extends React.ElementType = \"span\">(\n  props: TextProps<C>\n) => React.ReactElement | null;\n\n// @ts-expect-error - unexpected typing errors\nexport const Typography: TextComponent = forwardRef(\n  <C extends React.ElementType = \"span\">(\n    {\n      as,\n      align,\n      size,\n      emphasis,\n      italic,\n      underline,\n      weight,\n      className,\n      ...props\n    }: TextProps<C>,\n    ref?: PolymorphicRef<C>\n  ) => {\n    const Component = as || \"span\";\n\n    return (\n      <Component\n        ref={ref}\n        className={cn(\n          textStyles({\n            size,\n            weight,\n            emphasis,\n            italic,\n            underline,\n            align,\n            className,\n          })\n        )}\n        {...props}\n      />\n    );\n  }\n);\n"],"names":["textStyles","cva","variants","emphasis","low","size","xs","sm","base","lg","xl","weight","thin","normal","medium","semibold","bold","black","align","left","center","right","italic","true","underline","defaultVariants","Typography","forwardRef","as","className","props","ref","Component","jsxRuntimeExports","jsx","cn"],"mappings":"iQAQMA,EAAaC,MAAI,SAAU,CAC/BC,SAAU,CACRC,SAAU,CACRC,IAAK,4BAEPC,KAAM,CACJC,GAAI,UACJC,GAAI,sBACJC,KAAM,wBACNC,GAAI,sBACJC,GAAI,sBACJ,MAAO,uBACP,MAAO,WACP,MAAO,WACP,MAAO,WACP,MAAO,YAETC,OAAQ,CACNC,KAAM,YACNC,OAAQ,cACRC,OAAQ,cACRC,SAAU,gBACVC,KAAM,YACNC,MAAO,cAETC,MAAO,CACLC,KAAM,YACNC,OAAQ,cACRC,MAAO,cAETC,OAAQ,CACNC,KAAM,UAERC,UAAW,CACTD,KAAM,iCAGVE,gBAAiB,CACfpB,KAAM,OACNa,MAAO,UAcEQ,EAA4BC,EAAAA,YACvC,EAEIC,KACAV,QACAb,OACAF,WACAmB,SACAE,YACAb,SACAkB,eACGC,GAELC,KAEA,MAAMC,EAAYJ,GAAM,OAGtB,SAAAK,kBAAAC,IAACF,EAAA,CACCD,MACAF,UAAWM,EAAAA,GACTnC,EAAW,CACTK,OACAM,SACAR,WACAmB,SACAE,YACAN,QACAW,kBAGAC,GAAA"}