{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "card", "title": "Integrated Card", "description": "", "registryDependencies": [ "card" ], "files": [ { "path": "registry/ui/card.tsx", "content": "import type React from \"react\";\nimport type { ReactNode } from \"react\";\nimport {\n CardAction,\n Card as CardBase,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from \"@/components/ui/card\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface CardProps extends Omit, \"title\"> {\n action?: ReactNode;\n actionClassName?: string;\n contentClassName?: string;\n description?: ReactNode;\n descriptionClassName?: string;\n dividers?: boolean | { header?: boolean; footer?: boolean };\n footer?: ReactNode;\n footerClassName?: string;\n headerClassName?: string;\n size?: \"default\" | \"sm\";\n title?: ReactNode;\n titleClassName?: string;\n}\n\n// Mirrors React's own rendering rules: null/undefined/boolean render nothing,\n// but valid falsy nodes like 0 and \"\" must not be swallowed.\nconst hasNode = (node: ReactNode): boolean =>\n node !== null && node !== undefined && typeof node !== \"boolean\";\n\nexport const Card: React.FC = ({\n title,\n titleClassName,\n description,\n descriptionClassName,\n action,\n actionClassName,\n contentClassName,\n footer,\n footerClassName,\n headerClassName,\n children,\n className,\n dividers,\n size,\n ...restProps\n}) => {\n const { header: showHeaderDivider, footer: showFooterDivider } =\n typeof dividers === \"boolean\"\n ? { header: dividers, footer: dividers }\n : {\n header: dividers?.header ?? false,\n footer: dividers?.footer ?? false,\n };\n\n return (\n \n {(hasNode(title) || hasNode(description) || hasNode(action)) && (\n \n {hasNode(title) && (\n {title}\n )}\n {hasNode(description) && (\n \n {description}\n \n )}\n {hasNode(action) && (\n {action}\n )}\n \n )}\n {hasNode(children) && (\n {children}\n )}\n {hasNode(footer) && (\n \n {footer}\n \n )}\n \n );\n};\n\nexport default Card;\n", "type": "registry:component", "target": "components/easy/card.tsx" } ], "type": "registry:component" }