{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert-dialog",
  "title": "Alert Dialog",
  "description": "Modal that asks to confirm or cancel an action, with a status-tinted icon.",
  "dependencies": [
    "radix-ui"
  ],
  "registryDependencies": [
    "@ikas/button",
    "@ikas/utils"
  ],
  "files": [
    {
      "path": "registry/ui/alert-dialog.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { AlertDialog as AlertDialogPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\n\nfunction AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n  return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />\n}\n\nfunction AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n  return <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />\n}\n\nfunction AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n  return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />\n}\n\nfunction AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n  return (\n    <AlertDialogPrimitive.Overlay\n      data-slot=\"alert-dialog-overlay\"\n      className={cn(\n        \"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\ntype AlertDialogContentProps = React.ComponentProps<typeof AlertDialogPrimitive.Content> & {\n  /** sm stacks a centered title over two equal buttons; default is left aligned. */\n  size?: \"default\" | \"sm\"\n}\n\n/** Modal that asks to confirm or cancel. It closes only through its buttons, never on outside click. */\nfunction AlertDialogContent({ className, size = \"default\", ...props }: AlertDialogContentProps) {\n  return (\n    <AlertDialogPortal>\n      <AlertDialogOverlay />\n      <AlertDialogPrimitive.Content\n        data-slot=\"alert-dialog-content\"\n        data-size={size}\n        className={cn(\n          \"group/alert-dialog-content 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-xl bg-popover p-5 text-sm text-popover-foreground shadow-overlay duration-100 outline-none data-[size=default]:sm:max-w-md data-[size=sm]:max-w-xs data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-open:duration-300 data-closed:duration-200 ease-(--ease-reveal) data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n          className\n        )}\n        {...props}\n      />\n    </AlertDialogPortal>\n  )\n}\n\nfunction AlertDialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"alert-dialog-header\"\n      className={cn(\n        \"grid grid-cols-1 gap-1.5 has-data-[slot=alert-dialog-media]:grid-cols-[auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-3.5\",\n        \"group-data-[size=sm]/alert-dialog-content:grid-cols-1! group-data-[size=sm]/alert-dialog-content:place-items-center group-data-[size=sm]/alert-dialog-content:text-center\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"alert-dialog-footer\"\n      className={cn(\n        \"-mx-5 -mb-5 mt-1 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 px-5 py-4 sm:flex-row sm:justify-end\",\n        \"group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nconst tones = {\n  danger: \"bg-danger-subtle text-danger-subtle-foreground\",\n  warning: \"bg-warning-subtle text-warning-subtle-foreground\",\n  info: \"bg-info-subtle text-info-subtle-foreground\",\n  success: \"bg-success-subtle text-success-subtle-foreground\",\n  neutral: \"bg-muted text-icon\",\n} as const\n\ntype AlertDialogMediaProps = React.ComponentProps<\"div\"> & {\n  /** Status color of the icon tile. */\n  tone?: keyof typeof tones\n}\n\n/** Icon tile beside the title, tinted by status. */\nfunction AlertDialogMedia({ className, tone = \"neutral\", ...props }: AlertDialogMediaProps) {\n  return (\n    <div\n      data-slot=\"alert-dialog-media\"\n      data-tone={tone}\n      className={cn(\n        \"row-span-2 flex size-10 items-center justify-center rounded-full group-data-[size=sm]/alert-dialog-content:row-span-1 group-data-[size=sm]/alert-dialog-content:mb-1 [&_svg:not([class*='size-'])]:size-5\",\n        tones[tone],\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n  return (\n    <AlertDialogPrimitive.Title\n      data-slot=\"alert-dialog-title\"\n      className={cn(\"font-heading self-center text-base leading-snug font-medium\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n  return (\n    <AlertDialogPrimitive.Description\n      data-slot=\"alert-dialog-description\"\n      className={cn(\n        \"text-sm text-pretty text-muted-foreground group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2 group-data-[size=sm]/alert-dialog-content:col-start-1! *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\ntype AlertDialogButtonProps = Pick<React.ComponentProps<typeof Button>, \"variant\" | \"size\" | \"color\">\n\n/** Confirms and closes. Use color=\"red\" for destructive actions. */\nfunction AlertDialogAction({\n  className,\n  variant = \"solid\",\n  size = \"default\",\n  color,\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action> & AlertDialogButtonProps) {\n  return (\n    <Button variant={variant} size={size} color={color} asChild>\n      <AlertDialogPrimitive.Action data-slot=\"alert-dialog-action\" className={cn(className)} {...props} />\n    </Button>\n  )\n}\n\nfunction AlertDialogCancel({\n  className,\n  variant = \"outline\",\n  size = \"default\",\n  color,\n  children = \"Vazgeç\",\n  ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & AlertDialogButtonProps) {\n  return (\n    <Button variant={variant} size={size} color={color} asChild>\n      <AlertDialogPrimitive.Cancel data-slot=\"alert-dialog-cancel\" className={cn(className)} {...props}>\n        {children}\n      </AlertDialogPrimitive.Cancel>\n    </Button>\n  )\n}\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  type AlertDialogContentProps,\n  type AlertDialogMediaProps,\n}\n",
      "type": "registry:ui"
    }
  ],
  "docs": "https://builders.ikas.com/tr/docs/app-development/ui-kit/components/alert-dialog",
  "categories": [
    "primitives",
    "overlays"
  ],
  "type": "registry:ui"
}