{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "alert-dialog", "title": "Alert Dialog", "description": "Modal confirmation dialog for destructive or irreversible actions requiring user acknowledgement.", "dependencies": [ "@base-ui/react" ], "registryDependencies": [ "button" ], "files": [ { "path": "packages/ui/src/alert-dialog.tsx", "content": "\"use client\";\n\nimport { AlertDialog as AlertDialogPrimitive } from \"@base-ui/react/alert-dialog\";\nimport type * as React from \"react\";\nimport { Button } from \"./button\";\nimport { cn } from \"./utils\";\n\n// =============================================================================\n// AlertDialog (Root)\n// =============================================================================\nfunction AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {\n return ;\n}\n\n// =============================================================================\n// AlertDialogTrigger\n// =============================================================================\nexport interface AlertDialogTriggerProps\n extends AlertDialogPrimitive.Trigger.Props {}\n\nfunction AlertDialogTrigger({ ...props }: AlertDialogTriggerProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// AlertDialogPortal\n// =============================================================================\nexport interface AlertDialogPortalProps\n extends AlertDialogPrimitive.Portal.Props {}\n\nfunction AlertDialogPortal({ ...props }: AlertDialogPortalProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// AlertDialogOverlay\n// =============================================================================\nexport interface AlertDialogOverlayProps\n extends AlertDialogPrimitive.Backdrop.Props {}\n\nfunction AlertDialogOverlay({ className, ...props }: AlertDialogOverlayProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// AlertDialogContent\n// =============================================================================\nexport interface AlertDialogContentProps\n extends AlertDialogPrimitive.Popup.Props {\n /**\n * The size of the alert dialog.\n * - `\"default\"` — standard width (max-w-xs on mobile, sm:max-w-sm on desktop)\n * - `\"sm\"` — compact width (max-w-xs at all breakpoints)\n * @default \"default\"\n */\n size?: \"default\" | \"sm\";\n}\n\nfunction AlertDialogContent({\n className,\n size = \"default\",\n ...props\n}: AlertDialogContentProps) {\n return (\n \n \n \n \n );\n}\n\n// =============================================================================\n// AlertDialogHeader\n// =============================================================================\nexport interface AlertDialogHeaderProps extends React.ComponentProps<\"div\"> {}\n\nfunction AlertDialogHeader({ className, ...props }: AlertDialogHeaderProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// AlertDialogFooter\n// =============================================================================\nexport interface AlertDialogFooterProps extends React.ComponentProps<\"div\"> {}\n\nfunction AlertDialogFooter({ className, ...props }: AlertDialogFooterProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// AlertDialogMedia\n// =============================================================================\nexport interface AlertDialogMediaProps extends React.ComponentProps<\"div\"> {}\n\nfunction AlertDialogMedia({ className, ...props }: AlertDialogMediaProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// AlertDialogTitle\n// =============================================================================\nexport interface AlertDialogTitleProps\n extends React.ComponentProps {}\n\nfunction AlertDialogTitle({ className, ...props }: AlertDialogTitleProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// AlertDialogDescription\n// =============================================================================\nexport interface AlertDialogDescriptionProps\n extends React.ComponentProps {}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: AlertDialogDescriptionProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// AlertDialogAction\n// =============================================================================\nexport interface AlertDialogActionProps\n extends React.ComponentProps {}\n\nfunction AlertDialogAction({ className, ...props }: AlertDialogActionProps) {\n return (\n \n );\n}\n\n// =============================================================================\n// AlertDialogCancel\n// =============================================================================\nexport interface AlertDialogCancelProps\n extends AlertDialogPrimitive.Close.Props,\n Pick, \"variant\" | \"size\"> {}\n\nfunction AlertDialogCancel({\n className,\n variant = \"outline\",\n size = \"default\",\n ...props\n}: AlertDialogCancelProps) {\n return (\n }\n {...props}\n />\n );\n}\n\n// =============================================================================\n// Exports\n// =============================================================================\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogMedia,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n};\n", "type": "registry:ui" } ], "type": "registry:ui" }