{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"typography","title":"Typography","type":"registry:ui","description":"Standard typography component.","dependencies":["class-variance-authority"],"registryDependencies":["utils"],"files":[{"path":"fysk/typography.tsx","type":"registry:ui","content":"\"use client\"\r\nimport * as React from \"react\"\r\nimport { cva, type VariantProps } from \"class-variance-authority\"\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nconst typographyVariants = cva(\"text-foreground transition-colors duration-300\", {\r\n    variants: {\r\n        variant: {\r\n            h1: \"scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl \",\r\n            h2: \"scroll-m-20 pb-2 text-3xl font-semibold tracking-tight mt-6\",\r\n            h3: \"scroll-m-20 text-2xl font-medium tracking-tight mt-4\",\r\n            h4: \"scroll-m-20 text-xl font-normal tracking-tight mt-2\",\r\n            p: \"leading-7 text-foreground/75 not-first:mt-2 tracking-wide\",\r\n            blockquote: \"mt-6 border-l-2 pl-6 italic text-foreground/75\",\r\n            list: \"my-6 ml-6 list-disc [&>li]:mt-2 text-foreground/75\",\r\n            inlineCode: \"relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold text-foreground/75\",\r\n            lead: \"text-xl text-muted-foreground\",\r\n            large: \"text-lg font-semibold text-foreground\",\r\n            small: \"text-sm font-medium leading-none text-foreground/75\",\r\n            muted: \"text-sm text-muted-foreground\",\r\n            strong: \"font-semibold text-foreground/75\",\r\n        },\r\n    },\r\n    defaultVariants: {\r\n        variant: \"p\",\r\n    },\r\n})\r\n\r\n// --- Context ---\r\ninterface TypographyContextValue {\r\n    variant?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"p\" | \"blockquote\" | \"list\" | \"inlineCode\" | \"lead\" | \"large\" | \"small\" | \"muted\" | \"strong\"\r\n}\r\n\r\nconst TypographyContext = React.createContext<TypographyContextValue>({})\r\n\r\nexport const TypographyProvider = ({\r\n    children,\r\n    variant,\r\n}: {\r\n    children: React.ReactNode\r\n    variant?: TypographyContextValue[\"variant\"]\r\n}) => (\r\n    <TypographyContext.Provider value={{ variant }}>\r\n        {children}\r\n    </TypographyContext.Provider>\r\n)\r\n\r\nexport interface TypographyProps\r\n    extends React.HTMLAttributes<HTMLElement>,\r\n    VariantProps<typeof typographyVariants> {\r\n    as?: React.ElementType\r\n    data?: React.ReactNode[] // For list type\r\n}\r\n\r\nconst Typography = React.forwardRef<HTMLElement, TypographyProps>(\r\n    ({ className, variant: propsVariant, as, data, children, ...props }, ref) => {\r\n        const context = React.useContext(TypographyContext)\r\n        const variant = propsVariant || context.variant || \"p\"\r\n\r\n        const Comp = as || (variant?.startsWith(\"h\") ? variant : variant === \"inlineCode\" ? \"code\" : variant === \"blockquote\" ? \"blockquote\" : variant === \"list\" ? \"ul\" : variant === \"strong\" ? \"strong\" : \"p\") as React.ElementType\r\n\r\n        const baseId = React.useId()\r\n\r\n        if (variant === \"list\" && data) {\r\n            return (\r\n                <Comp\r\n                    className={cn(typographyVariants({ variant }), className)}\r\n                    ref={ref as any}\r\n                    {...props}\r\n                >\r\n                    {data.map((item, index) => {\r\n                        const key = `${baseId}-${index}`\r\n                        console.log(key);\r\n                        return <li className=\"text-foreground/75\" key={key}>{item}</li>\r\n                    })}\r\n                </Comp>\r\n            )\r\n        }\r\n\r\n        return (\r\n            <Comp\r\n                className={cn(typographyVariants({ variant }), className)}\r\n                ref={ref as any}\r\n                {...props}\r\n            >\r\n                {children}\r\n            </Comp>\r\n        )\r\n    }\r\n)\r\nTypography.displayName = \"Typography\"\r\n\r\nexport { Typography, typographyVariants }\r\n\r\n"}]}