{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "offer-card", "title": "Offer Card", "description": "A tinted glass card carrying a provider and two or more peer terms. Five tints, column and row layouts.", "dependencies": [ "class-variance-authority" ], "registryDependencies": [ "http://localhost:5173/r/liquid-theme.json", "http://localhost:5173/r/glass-surface.json", "http://localhost:5173/r/icon-ring.json" ], "files": [ { "path": "src/components/ui/offer-card.tsx", "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { GlassSurface, type Corner } from \"@/components/ui/glass-surface\"\nimport { IconRing } from \"@/components/ui/icon-ring\"\n\n/**\n * The Credit Offers rail: a tinted glass card carrying a provider and two or\n * three terms. Unlike MetricCard there is no single headline number — the\n * terms are peers, and the layout has to say so.\n */\nconst TINTS = {\n slate: \"radial-gradient(120% 100% at 20% 0%, #5b6f86 0%, #2f3a47 70%)\",\n moss: \"radial-gradient(120% 100% at 20% 0%, #6d7a3a 0%, #333a1c 72%)\",\n clay: \"radial-gradient(120% 100% at 20% 0%, #8a5f4a 0%, #3d2a22 72%)\",\n plum: \"radial-gradient(120% 100% at 20% 0%, #6d4a63 0%, #2f2030 72%)\",\n ash: \"radial-gradient(120% 100% at 20% 0%, #6e7076 0%, #303236 72%)\",\n} as const\n\nexport type OfferTint = keyof typeof TINTS\n\nconst offer = cva(\"flex flex-col text-white\", {\n variants: {\n density: {\n compact: \"gap-4 p-4\",\n normal: \"gap-6 p-5\",\n roomy: \"gap-8 p-6\",\n },\n /** How the terms sit relative to each other. */\n layout: {\n /** Side-by-side columns — the reference. */\n columns: \"\",\n /** One term per row, label left and value right. */\n rows: \"\",\n },\n },\n defaultVariants: { density: \"normal\", layout: \"columns\" },\n})\n\nexport interface OfferTerm {\n label: React.ReactNode\n value: React.ReactNode\n unit?: React.ReactNode\n}\n\nexport interface OfferCardProps\n extends React.ComponentProps<\"div\">,\n VariantProps {\n provider: React.ReactNode\n /** Second line under the provider — a product name or a qualifier. */\n detail?: React.ReactNode\n icon?: React.ReactNode\n terms: OfferTerm[]\n tint?: OfferTint | (string & {})\n corner?: Corner | (string & {})\n action?: React.ReactNode\n interactive?: boolean\n}\n\nexport function OfferCard({\n provider,\n detail,\n icon,\n terms,\n tint = \"slate\",\n corner = \"lg\",\n action,\n interactive = true,\n layout,\n density,\n className,\n ...props\n}: OfferCardProps) {\n return (\n \n
\n
\n {icon ? (\n \n {icon}\n \n ) : null}\n \n {provider}\n {detail ? {detail} : null}\n \n
\n {action}\n
\n\n \n {terms.map((term, i) => (\n \n
\n {term.label}\n
\n \n {term.value}\n {term.unit ? (\n {term.unit}\n ) : null}\n \n \n ))}\n \n \n )\n}\n\nexport { TINTS as OFFER_TINTS }\n", "type": "registry:ui" } ], "type": "registry:ui" }