{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "alert", "title": "Integrated Alert", "description": "Flat-props Alert built on shadcn's Alert primitive: optional icon, title, description, and caller-owned action slots with primitive variants and per-slot class overrides.", "registryDependencies": [ "alert" ], "files": [ { "path": "registry/ui/alert.tsx", "content": "import type { ClassValue } from \"clsx\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport {\n AlertAction,\n AlertDescription,\n Alert as AlertRoot,\n AlertTitle,\n} from \"@/components/ui/alert\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface AlertProps\n extends Omit<\n ComponentProps,\n \"children\" | \"dangerouslySetInnerHTML\" | \"title\"\n > {\n action?: ReactNode;\n actionClassName?: ClassValue;\n description?: ReactNode;\n descriptionClassName?: ClassValue;\n icon?: ReactNode;\n title?: ReactNode;\n titleClassName?: ClassValue;\n}\n\nconst hasNode = (node: ReactNode): boolean =>\n node !== null && node !== undefined && typeof node !== \"boolean\";\n\nexport const Alert = ({\n icon,\n title,\n titleClassName,\n description,\n descriptionClassName,\n action,\n actionClassName,\n ...rootProps\n}: AlertProps) => (\n \n {hasNode(icon) ? icon : null}\n {hasNode(title) ? (\n {title}\n ) : null}\n {hasNode(description) ? (\n \n {description}\n \n ) : null}\n {hasNode(action) ? (\n {action}\n ) : null}\n \n);\n\nexport default Alert;\n", "type": "registry:component", "target": "components/easy/alert.tsx" } ], "type": "registry:component" }