{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "card", "title": "Card", "description": "Polaris-styled Card component.", "dependencies": [], "devDependencies": [ "@shopify/polaris-types" ], "registryDependencies": [ "@polaris-shadcn/theme", "@polaris-shadcn/utils" ], "files": [ { "path": "registry/templates/components/ui/card.tsx", "content": "import * as React from \"react\";\nimport { cn } from \"../../lib/utils\";\n\nexport type CardBackground = \"base\" | \"subdued\" | \"transparent\";\nexport type CardPadding = \"base\" | \"none\";\n\ntype DivProps = React.ComponentPropsWithoutRef<\"div\">;\ntype DivRef = React.ElementRef<\"div\">;\n\ntype HeadingProps = React.ComponentPropsWithoutRef<\"h3\">;\ntype HeadingRef = React.ElementRef<\"h3\">;\n\ntype ParagraphProps = React.ComponentPropsWithoutRef<\"p\">;\ntype ParagraphRef = React.ElementRef<\"p\">;\n\nexport interface CardProps extends DivProps {\n background?: CardBackground;\n padding?: CardPadding;\n}\n\nconst cardPaddingClassNames: Record = {\n base: \"p-4\",\n none: \"p-0\",\n};\n\nconst cardBackgroundClassNames: Record = {\n base: \"bg-card\",\n subdued: \"bg-surface-subdued\",\n transparent: \"bg-transparent\",\n};\n\nconst Card = React.forwardRef(\n (\n { className, style, background = \"base\", padding = \"base\", ...props },\n ref,\n ) => (\n \n ),\n);\nCard.displayName = \"Card\";\n\nconst CardHeader = React.forwardRef(\n ({ className, ...props }, ref) => (\n
\n ),\n);\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = React.forwardRef(\n ({ className, children, ...props }, ref) => (\n

\n {children}\n

\n ),\n);\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = React.forwardRef(\n ({ className, ...props }, ref) => (\n

\n ),\n);\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = React.forwardRef(\n ({ className, ...props }, ref) => (\n

\n ),\n);\nCardContent.displayName = \"CardContent\";\n\nconst CardFooter = React.forwardRef(\n ({ className, ...props }, ref) => (\n
\n ),\n);\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter };\n", "type": "registry:ui" } ], "type": "registry:ui" }