{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "aurora-alert-dialog",
  "title": "Aurora Alert Dialog",
  "author": "jmagar <https://github.com/jmagar>",
  "description": "Confirmation dialog built on the Aurora modal surface for destructive or high-friction decisions.",
  "dependencies": [
    "@radix-ui/react-alert-dialog@^1.1.19",
    "lucide-react@^0.487.0"
  ],
  "registryDependencies": [
    "@aurora/aurora-tokens",
    "@aurora/aurora-button",
    "@aurora/aurora-components"
  ],
  "files": [
    {
      "path": "registry/aurora/ui/alert-dialog.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\"\nimport { Info, TriangleAlert } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/aurora/ui/button\"\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger\nconst AlertDialogPortal = AlertDialogPrimitive.Portal\nconst AlertDialogAction = AlertDialogPrimitive.Action\nconst AlertDialogCancel = AlertDialogPrimitive.Cancel\n\nfunction AlertDialogOverlay({\n  ref,\n  className,\n  style,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay> & {\n  ref?: React.Ref<React.ComponentRef<typeof AlertDialogPrimitive.Overlay>>\n}) {\n  return (\n    <AlertDialogPrimitive.Overlay\n      ref={ref}\n      data-slot=\"alert-dialog-overlay\"\n      className={cn(\n        \"fixed inset-0 z-50 backdrop-blur-[2px]\",\n        \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n        className\n      )}\n      style={{ backgroundColor: \"var(--aurora-overlay)\", ...style }}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogContent({\n  ref,\n  className,\n  children,\n  size = \"default\",\n  style,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {\n  size?: \"default\" | \"sm\"\n  ref?: React.Ref<React.ComponentRef<typeof AlertDialogPrimitive.Content>>\n}) {\n  return (\n    <AlertDialogPortal>\n      <AlertDialogOverlay />\n      <AlertDialogPrimitive.Content\n        ref={ref}\n        data-slot=\"alert-dialog-content\"\n        data-size={size}\n        className={cn(\n          \"fixed left-1/2 top-1/2 z-50 grid w-full max-w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-[var(--aurora-radius-3)] border p-6 outline-none\",\n          \"data-[size=sm]:max-w-sm data-[size=default]:sm:max-w-lg\",\n          \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n          \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n          className\n        )}\n        style={{\n          background:\n            \"linear-gradient(180deg, var(--aurora-panel-strong-top), var(--aurora-panel-strong))\",\n          borderColor:\n            \"color-mix(in srgb, var(--aurora-border-default) 55%, var(--aurora-page-bg))\",\n          boxShadow: \"var(--aurora-shadow-strong), var(--aurora-highlight-strong)\",\n          color: \"var(--aurora-text-primary)\",\n          ...style,\n        }}\n        {...props}\n      >\n        {children}\n      </AlertDialogPrimitive.Content>\n    </AlertDialogPortal>\n  )\n}\n\nfunction AlertDialogHeader({\n  className,\n  ...props\n}: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"alert-dialog-header\"\n      className={cn(\"flex flex-col gap-1.5 text-center sm:text-left\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogFooter({\n  className,\n  ...props\n}: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"alert-dialog-footer\"\n      className={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogBody({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"alert-dialog-body\"\n      className={cn(\"grid gap-2\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogTitle({\n  ref,\n  className,\n  style,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title> & {\n  ref?: React.Ref<React.ComponentRef<typeof AlertDialogPrimitive.Title>>\n}) {\n  return (\n    <AlertDialogPrimitive.Title\n      ref={ref}\n      data-slot=\"alert-dialog-title\"\n      className={cn(\"aurora-text-section\", className)}\n      style={{ color: \"var(--aurora-text-primary)\", ...style }}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogDescription({\n  ref,\n  className,\n  style,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description> & {\n  ref?: React.Ref<React.ComponentRef<typeof AlertDialogPrimitive.Description>>\n}) {\n  return (\n    <AlertDialogPrimitive.Description\n      ref={ref}\n      data-slot=\"alert-dialog-description\"\n      className={cn(\"aurora-text-body-sm\", className)}\n      style={{ color: \"var(--aurora-text-muted)\", ...style }}\n      {...props}\n    />\n  )\n}\n\nexport interface AlertDialogCardProps\n  extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n  title?: React.ReactNode\n  description?: React.ReactNode\n  destructive?: boolean\n  confirmLabel?: React.ReactNode\n  cancelLabel?: React.ReactNode\n  onConfirm?: () => void\n  onCancel?: () => void\n}\n\nfunction AlertDialogCard({\n  ref,\n  className,\n  title,\n  description,\n  destructive = true,\n  confirmLabel = \"Confirm\",\n  cancelLabel = \"Cancel\",\n  onConfirm,\n  onCancel,\n  ...props\n}: AlertDialogCardProps & { ref?: React.Ref<HTMLDivElement> }) {\n  const Icon = destructive ? TriangleAlert : Info\n  const titleId = React.useId()\n  const descriptionId = React.useId()\n\n  return (\n    <div\n      ref={ref}\n      role=\"group\"\n      aria-labelledby={title ? titleId : undefined}\n      aria-describedby={description ? descriptionId : undefined}\n      className={cn(\"aurora-alert\", !destructive && \"aurora-alert--info\", className)}\n      {...props}\n    >\n      <span className=\"aurora-alert__icon\" aria-hidden>\n        <Icon className=\"size-5\" />\n      </span>\n      <div className=\"aurora-alert__main\">\n        {title ? (\n          <h2 id={titleId} className=\"aurora-alert__title\">\n            {title}\n          </h2>\n        ) : null}\n        {description ? (\n          <p id={descriptionId} className=\"aurora-alert__desc\">\n            {description}\n          </p>\n        ) : null}\n        <div className=\"aurora-alert__footer\">\n          <Button variant=\"neutral\" onClick={onCancel}>\n            {cancelLabel}\n          </Button>\n          <Button variant={destructive ? \"rose\" : \"aurora\"} onClick={onConfirm}>\n            {confirmLabel}\n          </Button>\n        </div>\n      </div>\n    </div>\n  )\n}\n\ntype InlineAlertDialogProps = AlertDialogCardProps & { children?: never }\ntype PrimitiveAlertDialogProps = React.ComponentPropsWithoutRef<\n  typeof AlertDialogPrimitive.Root\n>\n\nexport type AlertDialogProps = InlineAlertDialogProps | PrimitiveAlertDialogProps\n\nfunction AlertDialog(props: AlertDialogProps) {\n  if (!(\"children\" in props) && (\"title\" in props || \"description\" in props)) {\n    return <AlertDialogCard {...(props as InlineAlertDialogProps)} />\n  }\n\n  return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...(props as PrimitiveAlertDialogProps)} />\n}\n\nAlertDialog.displayName = \"AlertDialog\"\n\nexport {\n  AlertDialog,\n  AlertDialogAction,\n  AlertDialogBody,\n  AlertDialogCancel,\n  AlertDialogCard,\n  AlertDialogContent,\n  AlertDialogDescription,\n  AlertDialogFooter,\n  AlertDialogHeader,\n  AlertDialogOverlay,\n  AlertDialogPortal,\n  AlertDialogTitle,\n  AlertDialogTrigger,\n}\n\nexport default AlertDialog\n",
      "type": "registry:ui",
      "target": "@ui/aurora/alert-dialog.tsx"
    }
  ],
  "meta": {
    "namespace": "@aurora",
    "style": "aurora",
    "family": "ui",
    "requiresTokens": true,
    "sourcePath": "registry/aurora/ui/alert-dialog.tsx",
    "installTarget": "@ui/aurora/alert-dialog.tsx"
  },
  "docs": "Aurora UI component that installs Aurora Alert Dialog.\n\nInstall `aurora-tokens`, `aurora-button`, and `aurora-components` first; the shadcn CLI resolves these automatically through the @aurora registry namespace.\n\nDefault install target: `@ui/aurora/alert-dialog.tsx`.\n\nRegistry dependencies: `aurora-tokens`, `aurora-button`, `aurora-components`.",
  "categories": [
    "aurora",
    "ui",
    "overlay"
  ],
  "type": "registry:ui"
}