{"version":3,"file":"Heading.cjs","names":[],"sources":["../../../src/components/Typography/Heading.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 from \"react\";\nimport { Typography } from \"./Typography\";\nimport { Text } from \"./Text\";\nimport type { Size } from \"../../utils/size\";\n\ntype TypographyProps = React.ComponentProps<typeof Typography>;\n\n/**\n * A heading component.\n */\nexport const Heading: React.FC<\n  Omit<TypographyProps, \"type\"> & {\n    // xs is not a valid heading size\n    size?: Exclude<Size, \"xs\">;\n  }\n> = ({ as = \"h1\", children, ...props }) => {\n  return (\n    <Typography as={as} type=\"heading\" {...props}>\n      {children}\n    </Typography>\n  );\n};\n\ntype HeadingProps = Omit<\n  React.ComponentProps<typeof Heading>,\n  \"as\" | \"weight\" | \"size\"\n>;\n\n/**\n * A Heading level-1 styled component. Underlying HTML element can be changed\n * usign the `as` property.\n */\nexport const H1: React.FC<HeadingProps> = ({ children, ...props }) => {\n  return (\n    <Heading as=\"h1\" weight=\"semibold\" size=\"xl\" {...props}>\n      {children}\n    </Heading>\n  );\n};\n\n/**\n * A Heading level-2 styled component. Underlying HTML element can be changed\n * usign the `as` property.\n */\nexport const H2: React.FC<HeadingProps> = ({ children, ...props }) => {\n  return (\n    <Heading as=\"h2\" weight=\"semibold\" size=\"lg\" {...props}>\n      {children}\n    </Heading>\n  );\n};\n\n/**\n * A Heading level-3 styled component. Underlying HTML element can be changed\n * usign the `as` property.\n */\nexport const H3: React.FC<HeadingProps> = ({ children, ...props }) => {\n  return (\n    <Heading as=\"h3\" weight=\"semibold\" size=\"md\" {...props}>\n      {children}\n    </Heading>\n  );\n};\n\n/**\n * A Heading level-4 styled component. Underlying HTML element can be changed\n * usign the `as` property.\n */\nexport const H4: React.FC<HeadingProps> = ({ children, ...props }) => {\n  return (\n    <Heading as=\"h4\" weight=\"semibold\" size=\"sm\" {...props}>\n      {children}\n    </Heading>\n  );\n};\n\n/**\n * A Heading level-5 styled component. Underlying HTML element can be changed\n * usign the `as` property.\n */\nexport const H5: React.FC<HeadingProps> = ({ children, ...props }) => {\n  return (\n    <Text as=\"h5\" weight=\"semibold\" size=\"lg\" {...props}>\n      {children}\n    </Text>\n  );\n};\n\n/**\n * A Heading level-6 styled component. Underlying HTML element can be changed\n * usign the `as` property.\n */\nexport const H6: React.FC<HeadingProps> = ({ children, ...props }) => {\n  return (\n    <Text as=\"h6\" weight=\"semibold\" size=\"md\" {...props}>\n      {children}\n    </Text>\n  );\n};\n"],"mappings":";;;;;;;;;;AAkBA,IAAa,WAKR,EAAE,KAAK,MAAM,UAAU,GAAG,YAAY;AACzC,QACE,iBAAA,GAAA,kBAAA,KAAC,mBAAA,YAAD;EAAgB;EAAI,MAAK;EAAU,GAAI;EACpC;EACU,CAAA;;;;;;AAajB,IAAa,MAA8B,EAAE,UAAU,GAAG,YAAY;AACpE,QACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;EAAS,IAAG;EAAK,QAAO;EAAW,MAAK;EAAK,GAAI;EAC9C;EACO,CAAA;;;;;;AAQd,IAAa,MAA8B,EAAE,UAAU,GAAG,YAAY;AACpE,QACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;EAAS,IAAG;EAAK,QAAO;EAAW,MAAK;EAAK,GAAI;EAC9C;EACO,CAAA;;;;;;AAQd,IAAa,MAA8B,EAAE,UAAU,GAAG,YAAY;AACpE,QACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;EAAS,IAAG;EAAK,QAAO;EAAW,MAAK;EAAK,GAAI;EAC9C;EACO,CAAA;;;;;;AAQd,IAAa,MAA8B,EAAE,UAAU,GAAG,YAAY;AACpE,QACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;EAAS,IAAG;EAAK,QAAO;EAAW,MAAK;EAAK,GAAI;EAC9C;EACO,CAAA;;;;;;AAQd,IAAa,MAA8B,EAAE,UAAU,GAAG,YAAY;AACpE,QACE,iBAAA,GAAA,kBAAA,KAAC,aAAA,MAAD;EAAM,IAAG;EAAK,QAAO;EAAW,MAAK;EAAK,GAAI;EAC3C;EACI,CAAA;;;;;;AAQX,IAAa,MAA8B,EAAE,UAAU,GAAG,YAAY;AACpE,QACE,iBAAA,GAAA,kBAAA,KAAC,aAAA,MAAD;EAAM,IAAG;EAAK,QAAO;EAAW,MAAK;EAAK,GAAI;EAC3C;EACI,CAAA"}