{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert-dialog",
  "title": "Alert Dialog",
  "description": "Modal that asks the user to confirm or cancel before an action, with action and cancel buttons.",
  "dependencies": [
    "@radix-ui/react-alert-dialog"
  ],
  "registryDependencies": [
    "@corsair-ui/utils",
    "@corsair-ui/button"
  ],
  "files": [
    {
      "path": "registry/default/ui/alert-dialog.tsx",
      "content": "\"use client\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport type { ComponentProps } from \"react\";\nimport { buttonVariants } from \"@/registry/default/ui/button\";\nimport { cn } from \"@/registry/default/lib/utils\";\n\n/**\n * A modal that asks the user to confirm or cancel before something happens,\n * such as deleting data. Unlike a dialog, a click on the overlay does not\n * close it: the user has to pick an answer or press Escape, which cancels.\n * Focus starts on the cancel button, stays trapped inside and returns to the\n * trigger afterwards. Screen readers announce it as an alert dialog named by\n * `AlertDialogTitle` and described by `AlertDialogDescription`. With reduced\n * motion it appears without fading or zooming.\n *\n * @example\n * <AlertDialog>\n *   <AlertDialogTrigger asChild>\n *     <Button variant=\"destructive\">Delete</Button>\n *   </AlertDialogTrigger>\n *   <AlertDialogContent>\n *     <AlertDialogHeader>\n *       <AlertDialogTitle>Delete this file?</AlertDialogTitle>\n *       <AlertDialogDescription>This cannot be undone.</AlertDialogDescription>\n *     </AlertDialogHeader>\n *     <AlertDialogFooter>\n *       <AlertDialogCancel>Cancel</AlertDialogCancel>\n *       <AlertDialogAction onClick={remove}>Delete</AlertDialogAction>\n *     </AlertDialogFooter>\n *   </AlertDialogContent>\n * </AlertDialog>\n */\nfunction AlertDialog(props: ComponentProps<typeof AlertDialogPrimitive.Root>) {\n  return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />;\n}\n\nfunction AlertDialogTrigger(props: ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n  return <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />;\n}\n\nfunction AlertDialogPortal(props: ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n  return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />;\n}\n\nfunction AlertDialogOverlay({\n  className,\n  ...props\n}: ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n  return (\n    <AlertDialogPrimitive.Overlay\n      data-slot=\"alert-dialog-overlay\"\n      className={cn(\n        \"fixed inset-0 z-50 bg-black/50\",\n        // animate-in/out sit behind motion-safe: so reduced motion really turns them off.\n        \"motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n        \"motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0\",\n        className\n      )}\n      {...props}\n    />\n  );\n}\n\ninterface AlertDialogContentProps extends ComponentProps<typeof AlertDialogPrimitive.Content> {\n  /**\n   * Classes for the overlay behind the window: opacity, blur, z-index. The\n   * overlay is also `data-slot=\"alert-dialog-overlay\"` for styling from outside.\n   */\n  overlayClassName?: string;\n}\n\n/** The window itself, rendered in a portal above an overlay. It needs an `AlertDialogTitle`. */\nfunction AlertDialogContent({ className, overlayClassName, ...props }: AlertDialogContentProps) {\n  return (\n    <AlertDialogPortal>\n      <AlertDialogOverlay className={overlayClassName} />\n      <AlertDialogPrimitive.Content\n        data-slot=\"alert-dialog-content\"\n        className={cn(\n          \"bg-background fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg outline-none sm:max-w-lg\",\n          \"motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n          \"motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n          className\n        )}\n        {...props}\n      />\n    </AlertDialogPortal>\n  );\n}\n\nfunction AlertDialogHeader({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"alert-dialog-header\"\n      className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n      {...props}\n    />\n  );\n}\n\nfunction AlertDialogFooter({ className, ...props }: 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\n/** Names the alert dialog for screen readers. */\nfunction AlertDialogTitle({\n  className,\n  ...props\n}: ComponentProps<typeof AlertDialogPrimitive.Title>) {\n  return (\n    <AlertDialogPrimitive.Title\n      data-slot=\"alert-dialog-title\"\n      className={cn(\"text-lg leading-none font-semibold\", className)}\n      {...props}\n    />\n  );\n}\n\n/** Read out after the title: say what will happen if the user confirms. */\nfunction AlertDialogDescription({\n  className,\n  ...props\n}: ComponentProps<typeof AlertDialogPrimitive.Description>) {\n  return (\n    <AlertDialogPrimitive.Description\n      data-slot=\"alert-dialog-description\"\n      className={cn(\"text-muted-foreground text-sm\", className)}\n      {...props}\n    />\n  );\n}\n\n/** Confirms and closes. Styled as a primary button; pass `className` to restyle it. */\nfunction AlertDialogAction({\n  className,\n  ...props\n}: ComponentProps<typeof AlertDialogPrimitive.Action>) {\n  return (\n    <AlertDialogPrimitive.Action\n      data-slot=\"alert-dialog-action\"\n      className={cn(buttonVariants(), className)}\n      {...props}\n    />\n  );\n}\n\n/** Cancels and closes. Escape does the same. */\nfunction AlertDialogCancel({\n  className,\n  ...props\n}: ComponentProps<typeof AlertDialogPrimitive.Cancel>) {\n  return (\n    <AlertDialogPrimitive.Cancel\n      data-slot=\"alert-dialog-cancel\"\n      // \"outline\" is the button variant name, not the Tailwind utility.\n      // tailwind-compat-ignore-next-line\n      className={cn(buttonVariants({ variant: \"outline\" }), className)}\n      {...props}\n    />\n  );\n}\n\nexport {\n  AlertDialog,\n  AlertDialogAction,\n  AlertDialogCancel,\n  AlertDialogContent,\n  AlertDialogDescription,\n  AlertDialogFooter,\n  AlertDialogHeader,\n  AlertDialogOverlay,\n  AlertDialogPortal,\n  AlertDialogTitle,\n  AlertDialogTrigger,\n  type AlertDialogContentProps,\n};\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}