{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert-dialog",
  "type": "registry:ui",
  "dependencies": [
    "@radix-ui/react-alert-dialog",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://ui.getlyse.com/r/lyse-tokens.json",
    "https://ui.getlyse.com/r/button.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/alert-dialog/alert-dialog.tsx",
      "content": "import * as React from \"react\"\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/new-york/ui/button/button\"\nimport \"./alert-dialog.css\"\n\n/* ------------------------------------------------------------------ */\n/*  CVA                                                                */\n/* ------------------------------------------------------------------ */\n\nconst alertDialogIconVariants = cva(\n  \"alert-dialog-icon flex items-center justify-center shrink-0 size-[var(--layout-size-lg)] rounded-[var(--layout-radius-full)] [&_svg]:size-[var(--layout-size-xs)]\",\n  {\n    variants: {\n      variant: {\n        brand: \"alert-dialog-icon-brand\",\n        destructive: \"alert-dialog-icon-destructive\",\n        success: \"alert-dialog-icon-success\",\n        warning: \"alert-dialog-icon-warning\",\n      },\n    },\n    defaultVariants: {\n      variant: \"destructive\",\n    },\n  }\n)\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialog                                                        */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialog({\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n  return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogTrigger                                                 */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialogTrigger({\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n  return (\n    <AlertDialogPrimitive.Trigger\n      data-slot=\"alert-dialog-trigger\"\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogPortal                                                  */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialogPortal({\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n  return <AlertDialogPrimitive.Portal {...props} />\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogOverlay                                                 */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialogOverlay({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n  return (\n    <AlertDialogPrimitive.Overlay\n      data-slot=\"alert-dialog-overlay\"\n      className={cn(\n        \"alert-dialog-overlay fixed inset-0 z-50 animate-in fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogContent                                                 */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialogContent({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {\n  const cancelRef = React.useRef<HTMLButtonElement>(null)\n\n  return (\n    <AlertDialogPortal>\n      <AlertDialogOverlay onClick={() => cancelRef.current?.click()} />\n      <AlertDialogPrimitive.Content\n        data-slot=\"alert-dialog-content\"\n        className={cn(\n          \"alert-dialog-content fixed left-1/2 top-1/2 z-50 w-[22rem] -translate-x-1/2 -translate-y-1/2 flex flex-col items-start animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n          className\n        )}\n        onOpenAutoFocus={(e) => {\n          e.preventDefault()\n          cancelRef.current?.focus()\n        }}\n        {...props}\n      >\n        <AlertDialogCancelFocusContext.Provider value={cancelRef}>\n          {children}\n        </AlertDialogCancelFocusContext.Provider>\n      </AlertDialogPrimitive.Content>\n    </AlertDialogPortal>\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  Focus context (internal)                                           */\n/* ------------------------------------------------------------------ */\n\nconst AlertDialogCancelFocusContext =\n  React.createContext<React.RefObject<HTMLButtonElement | null> | null>(null)\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogHeader                                                  */\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(\n        \"alert-dialog-header flex w-full flex-col gap-[var(--layout-gap-xs)] p-[var(--layout-padding-xl)]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogIcon                                                    */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialogIcon({\n  variant,\n  className,\n  ...props\n}: React.ComponentProps<\"div\"> &\n  VariantProps<typeof alertDialogIconVariants>) {\n  return (\n    <div\n      data-slot=\"alert-dialog-icon\"\n      className={cn(alertDialogIconVariants({ variant, className }))}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogTitle                                                   */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialogTitle({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n  return (\n    <AlertDialogPrimitive.Title\n      data-slot=\"alert-dialog-title\"\n      className={cn(\"alert-dialog-title text-content-body font-accent\", className)}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogDescription                                             */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialogDescription({\n  className,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n  return (\n    <AlertDialogPrimitive.Description\n      data-slot=\"alert-dialog-description\"\n      className={cn(\"alert-dialog-description text-content-note\", className)}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogFooter                                                  */\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(\n        \"alert-dialog-footer flex w-full items-end justify-end gap-[var(--layout-gap-md)] p-[var(--layout-padding-lg)]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogAction                                                  */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialogAction({\n  className,\n  variant = \"destructive\",\n  children,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action> & {\n  variant?: \"destructive\" | \"primary\"\n}) {\n  return (\n    <AlertDialogPrimitive.Action\n      data-slot=\"alert-dialog-action\"\n      asChild\n      {...props}\n    >\n      <Button variant={variant} size=\"sm\" className={className}>\n        {children}\n      </Button>\n    </AlertDialogPrimitive.Action>\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  AlertDialogCancel                                                  */\n/* ------------------------------------------------------------------ */\n\nfunction AlertDialogCancel({\n  className,\n  children,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {\n  const focusRef = React.useContext(AlertDialogCancelFocusContext)\n\n  return (\n    <AlertDialogPrimitive.Cancel\n      data-slot=\"alert-dialog-cancel\"\n      asChild\n      {...props}\n    >\n      <Button\n        variant=\"secondary\"\n        size=\"sm\"\n        className={cn(\"alert-dialog-cancel-btn\", className)}\n        ref={focusRef}\n      >\n        {children}\n      </Button>\n    </AlertDialogPrimitive.Cancel>\n  )\n}\n\nexport {\n  AlertDialog,\n  AlertDialogTrigger,\n  AlertDialogPortal,\n  AlertDialogOverlay,\n  AlertDialogContent,\n  AlertDialogHeader,\n  AlertDialogIcon,\n  AlertDialogTitle,\n  AlertDialogDescription,\n  AlertDialogFooter,\n  AlertDialogAction,\n  AlertDialogCancel,\n  alertDialogIconVariants,\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/new-york/ui/alert-dialog/alert-dialog.css",
      "content": "/* ================================================================\n * ALERT DIALOG — Styles\n * Structure (flex, gap, padding, radius) lives in alert-dialog.tsx.\n * Theming (colors, borders, shadow) lives here via tokens.\n * Mirrors Modal styling exactly.\n * ================================================================ */\n\n/* --------------------------------\n * Overlay (backdrop)\n * -------------------------------- */\n.alert-dialog-overlay {\n  background: var(--overlay-default);\n}\n\n/* --------------------------------\n * Content (surface)\n * -------------------------------- */\n.alert-dialog-content {\n  background: var(--background-neutral-faint-default);\n  border: var(--layout-border-thin) solid var(--border-default);\n  border-radius: var(--layout-radius-xl);\n  box-shadow: var(--shadow-elevation-md);\n}\n\n/* --------------------------------\n * Header\n * -------------------------------- */\n.alert-dialog-header:has([data-slot=\"alert-dialog-icon\"]) {\n  align-items: center;\n  text-align: center;\n}\n\n/* --------------------------------\n * Title\n * -------------------------------- */\n.alert-dialog-title {\n  color: var(--text-base-bolder);\n}\n\n/* --------------------------------\n * Description\n * -------------------------------- */\n.alert-dialog-description {\n  color: var(--text-base-moderate);\n}\n\n/* --------------------------------\n * Footer (with top border)\n * -------------------------------- */\n.alert-dialog-footer {\n  border-top: var(--layout-border-thin) solid var(--border-default);\n}\n\n/* --------------------------------\n * Cancel — focus ring\n * Uses :focus-visible so the ring appears only\n * when the dialog is opened via keyboard, not mouse.\n * -------------------------------- */\n.alert-dialog-cancel-btn:focus-visible {\n  outline: 2px solid var(--border-selected);\n  outline-offset: 2px;\n}\n\n/* --------------------------------\n * Icon — variant colors\n * Own classes (not shared with Modal)\n * -------------------------------- */\n.alert-dialog-icon-brand {\n  background: var(--overlay-brand-default);\n  color: var(--icon-brand-moderate);\n}\n\n.alert-dialog-icon-destructive {\n  background: var(--overlay-danger-default);\n  color: var(--icon-danger-moderate);\n}\n\n.alert-dialog-icon-success {\n  background: var(--overlay-success-default);\n  color: var(--icon-success-moderate);\n}\n\n.alert-dialog-icon-warning {\n  background: var(--overlay-warning-default);\n  color: var(--icon-warning-moderate);\n}\n",
      "type": "registry:ui"
    }
  ]
}