{"version":3,"file":"Typography.cjs","names":[],"sources":["../../../src/components/Typography/Typography.tsx"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd.\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nSPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial\nPlease see LICENSE files in the repository root for full details.\n*/\n\nimport React, { type PropsWithChildren } from \"react\";\nimport classNames from \"classnames\";\n\nimport styles from \"./Typography.module.css\";\nimport type { Size } from \"../../utils/size\";\n\ntype TypographyProps<C extends React.ElementType> = {\n  /**\n   * The HTML tag.\n   * @default \"p\"\n   */\n  as?: C;\n  /**\n   * The type of content.\n   */\n  type?: \"body\" | \"heading\";\n  /**\n   * The font weight.\n   */\n  weight?: \"regular\" | \"semibold\" | \"medium\" | \"bold\";\n  /**\n   * The t-shirt size of the content.\n   */\n  size?: Size;\n  /**\n   * The CSS class name.\n   */\n  className?: string;\n} & React.ComponentPropsWithoutRef<C>;\n\nexport const Typography = <C extends React.ElementType = \"p\">({\n  as,\n  children,\n  type = \"body\",\n  weight = \"regular\",\n  size = \"md\",\n  className,\n  ...restProps\n}: PropsWithChildren<TypographyProps<C>>): React.ReactElement => {\n  const Component = as || \"p\";\n\n  return (\n    <Component\n      {...restProps}\n      className={classNames(\n        styles.typography,\n        styles[`font-${type}-${size}-${weight}`],\n        className,\n      )}\n    >\n      {children}\n    </Component>\n  );\n};\n"],"mappings":";;;;;;;;AAsCA,IAAa,cAAiD,EAC5D,IACA,UACA,OAAO,QACP,SAAS,WACT,OAAO,MACP,WACA,GAAG,gBAC4D;AAG/D,QACE,iBAAA,GAAA,kBAAA,KAHgB,MAAM,KAGtB;EACE,GAAI;EACJ,YAAA,GAAA,WAAA,SACE,0BAAA,QAAO,YACP,0BAAA,QAAO,QAAQ,KAAK,GAAG,KAAK,GAAG,WAC/B,UACD;EAEA;EACS,CAAA"}