{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "typography", "type": "registry:ui", "dependencies": [ "@radix-ui/react-slot", "class-variance-authority" ], "files": [ { "path": "registry/new-york/ui/typography.tsx", "content": "import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils\";\nimport { JSX } from \"react\";\n\nconst typographyVariants = cva(\"text-foreground\", {\n variants: {\n variant: {\n h1: \"font-heading text-6xl font-bold tracking-tighter md:text-7xl lg:text-8xl\",\n h2: \"font-heading text-3xl lg:text-4xl font-semibold tracking-tight first:mt-0\",\n h3: \"font-heading text-2xl font-semibold tracking-tight\",\n h4: \"font-heading text-xl font-semibold tracking-tight\",\n p: \"leading-7 [&:not(:first-child)]:mt-6\",\n blockquote: \"mt-6 border-l-2 pl-6 italic\",\n ul: \"my-6 ml-6 list-disc [&>li]:mt-2\",\n ol: \"my-6 ml-6 list-decimal [&>li]:mt-2\",\n lead: \"text-xl text-muted-foreground\",\n large: \"text-lg font-semibold\",\n small: \"text-sm font-medium leading-none\",\n muted: \"text-sm text-muted-foreground\",\n inlineCode:\n \"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold\",\n },\n },\n defaultVariants: {\n variant: \"p\",\n },\n});\n\ntype VariantPropType = VariantProps[\"variant\"];\n\nconst variantElementMap: Record<\n NonNullable,\n React.ElementType\n> = {\n h1: \"h1\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n p: \"p\",\n blockquote: \"blockquote\",\n ul: \"ul\",\n ol: \"ol\",\n lead: \"p\",\n large: \"div\",\n small: \"small\",\n muted: \"p\",\n inlineCode: \"code\",\n};\n\nexport interface TypographyProps\n extends\n React.HTMLAttributes,\n VariantProps {\n asChild?: boolean;\n as?: keyof JSX.IntrinsicElements;\n}\n\nconst Typography = React.forwardRef(\n ({ className, variant, as, asChild = false, ...props }, ref) => {\n const Comp = asChild\n ? Slot\n : (as ?? ((variant ? variantElementMap[variant] : \"p\") || \"p\"));\n\n return (\n \n );\n },\n);\nTypography.displayName = \"Typography\";\n\nexport { Typography, typographyVariants };\n", "type": "registry:ui" } ], "cssVars": { "theme": { "font-heading": "Poppins, sans-serif" } } }