import * as React from "react"; import { Slot } from "@radix-ui/react-slot"; import { typographyVariants, type TypographyVariant, } from "@/lib/typography"; import { cn } from "@/lib/utils"; const defaultElement: Record = { display: "h1", h1: "h1", h2: "h2", h3: "h3", h4: "h4", "body-lg": "p", body: "p", "body-sm": "p", caption: "span", eyebrow: "p", label: "span", nav: "span", "nav-mobile": "span", "card-title": "h3", "card-desc": "p", chat: "p", code: "code", stat: "span", link: "span", "section-intro": "p", emphasis: "p", "list-title": "span", "cta-title": "h2", "display-mono": "span", }; export type TypographyProps = { variant: TypographyVariant; as?: React.ElementType; asChild?: boolean; className?: string; children?: React.ReactNode; } & React.HTMLAttributes; export function Typography({ variant, as, asChild = false, className, children, ...props }: TypographyProps) { const Comp = asChild ? Slot : (as ?? defaultElement[variant] ?? "p"); return ( {children} ); } export { Display, PageTitle, SectionTitle, SubsectionTitle, SmallHeading, BodyLarge, BodyText, BodySmall, Caption, Eyebrow, CardTitleText, CardDescText, }; function Display(props: Omit) { return ; } function PageTitle(props: Omit) { return ; } function SectionTitle(props: Omit) { return ; } function SubsectionTitle(props: Omit) { return ; } function SmallHeading(props: Omit) { return ; } function BodyLarge(props: Omit) { return ; } function BodyText(props: Omit) { return ; } function BodySmall(props: Omit) { return ; } function Caption(props: Omit) { return ; } function Eyebrow(props: Omit) { return ; } function CardTitleText(props: Omit) { return ; } function CardDescText(props: Omit) { return ; }