{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "alert-dialog",
  "title": "Alert Dialog",
  "description": "A shadcn-style alert dialog component built with Ark UI primitives.",
  "dependencies": ["@ark-ui/react", "class-variance-authority"],
  "registryDependencies": ["button"],
  "files": [
    {
      "path": "src/components/ui/alert-dialog.tsx",
      "content": "\"use client\";\n\nimport { Dialog } from \"@ark-ui/react/dialog\";\nimport { ark } from \"@ark-ui/react/factory\";\nimport { Portal } from \"@ark-ui/react/portal\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { type ComponentProps, forwardRef } from \"react\";\nimport { buttonVariants } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\nexport const AlertDialog = ({\n  closeOnInteractOutside = false,\n  role = \"alertdialog\",\n  ...props\n}: Dialog.RootProps) => (\n  <Dialog.Root\n    role={role}\n    closeOnInteractOutside={closeOnInteractOutside}\n    {...props}\n  />\n);\n\nexport const AlertDialogTrigger = ({\n  className,\n  ...props\n}: Dialog.TriggerProps) => (\n  <Dialog.Trigger className={cn(className)} {...props} />\n);\n\nexport const AlertDialogPortal = ({\n  ...props\n}: ComponentProps<typeof Portal>) => <Portal {...props} />;\n\nexport const AlertDialogBackdrop = ({\n  className,\n  ...props\n}: Dialog.BackdropProps) => (\n  <Dialog.Backdrop\n    className={cn(\n      \"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm transition-opacity duration-200 dark:bg-black/50 dark:backdrop-blur-md data-[state=closed]:opacity-0 data-[state=open]:opacity-100 supports-backdrop-filter:bg-black/25 supports-backdrop-filter:dark:bg-black/35\",\n      className,\n    )}\n    {...props}\n  />\n);\n\nexport const AlertDialogOverlay = AlertDialogBackdrop;\n\nconst positionerVariants = cva(\"fixed inset-0 z-50 flex overscroll-y-none \", {\n  defaultVariants: {\n    bottomStick: true,\n  },\n  variants: {\n    bottomStick: {\n      false: \"items-center justify-center p-4\",\n      true: \"items-end justify-center sm:items-center\",\n    },\n  },\n});\n\nconst contentVariants = cva(\n  \"relative z-50 grid min-h-0 max-h-[min(calc(100dvh-2rem),var(--alert-dialog-max-h,32rem))] w-full shrink-0 gap-4 overflow-x-hidden overflow-y-auto rounded-xl border border-border bg-popover px-6 pt-6 pb-0 text-card-foreground shadow-lg outline-none transition-[opacity,transform] duration-150 data-[state=closed]:scale-[0.98] data-[state=closed]:opacity-0 data-[state=open]:scale-100 data-[state=open]:opacity-100\",\n  {\n    defaultVariants: {\n      size: \"default\",\n    },\n    variants: {\n      size: {\n        default: \"max-w-lg\",\n        sm: \"max-w-sm gap-3 px-5 pt-5 pb-0 text-sm **:data-[slot=alert-dialog-title]:text-base\",\n      },\n    },\n  },\n);\n\nexport type AlertDialogPopupProps = Dialog.ContentProps & {\n  backdropClassName?: string;\n  bottomStickOnMobile?: boolean;\n  positionerClassName?: string;\n  size?: VariantProps<typeof contentVariants>[\"size\"];\n};\n\nconst AlertDialogPopupInner = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n  (\n    {\n      backdropClassName,\n      bottomStickOnMobile = true,\n      children,\n      className,\n      positionerClassName,\n      size = \"default\",\n      ...contentProps\n    },\n    ref,\n  ) => (\n    <Portal>\n      <AlertDialogBackdrop className={backdropClassName} />\n      <Dialog.Positioner\n        className={cn(\n          positionerVariants({ bottomStick: bottomStickOnMobile }),\n          positionerClassName,\n        )}\n      >\n        <Dialog.Content\n          ref={ref}\n          className={cn(contentVariants({ size }), className)}\n          {...contentProps}\n        >\n          {children}\n        </Dialog.Content>\n      </Dialog.Positioner>\n    </Portal>\n  ),\n);\n\nexport const AlertDialogPopup = AlertDialogPopupInner;\n\nexport const AlertDialogContent = AlertDialogPopup;\n\nexport const AlertDialogHeader = ({\n  className,\n  ...props\n}: ComponentProps<typeof ark.div>) => (\n  <ark.div\n    className={cn(\"flex flex-col gap-2 text-center sm:text-start\", className)}\n    {...props}\n  />\n);\n\nconst footerVariants = cva(\n  \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-2\",\n  {\n    defaultVariants: {\n      variant: \"default\",\n    },\n    variants: {\n      variant: {\n        bare: \"pb-6\",\n        default:\n          \"-mx-6 mt-2 border-border border-t bg-muted/40 px-6 pt-4 pb-6 sm:rounded-b-xl\",\n      },\n    },\n  },\n);\n\nexport const AlertDialogFooter = ({\n  className,\n  variant,\n  ...props\n}: ComponentProps<\"div\"> & VariantProps<typeof footerVariants>) => (\n  <ark.div className={cn(footerVariants({ variant }), className)} {...props} />\n);\n\nexport const AlertDialogTitle = ({\n  className,\n  ...props\n}: Dialog.TitleProps) => (\n  <Dialog.Title\n    className={cn(\"font-semibold text-lg leading-none\", className)}\n    {...props}\n  />\n);\n\nexport const AlertDialogDescription = ({\n  className,\n  ...props\n}: Dialog.DescriptionProps) => (\n  <Dialog.Description\n    className={cn(\"text-muted-foreground text-sm\", className)}\n    {...props}\n  />\n);\n\nexport const AlertDialogMedia = ({\n  className,\n  ...props\n}: ComponentProps<typeof ark.div>) => (\n  <ark.div\n    className={cn(\n      \"mx-auto flex size-12 shrink-0 items-center justify-center rounded-full bg-muted sm:mx-0 [&_svg]:size-6 [&_svg]:text-muted-foreground\",\n      className,\n    )}\n    {...props}\n  />\n);\n\nexport const AlertDialogPanel = ({\n  className,\n  ...props\n}: ComponentProps<typeof ark.div>) => (\n  <ark.div className={cn(\"flex w-full flex-col gap-3\", className)} {...props} />\n);\n\nexport const AlertDialogClose = ({\n  className,\n  ...props\n}: Dialog.CloseTriggerProps) => (\n  <Dialog.CloseTrigger\n    className={cn(\n      \"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n      className,\n    )}\n    {...props}\n  />\n);\n\nexport const AlertDialogCancel = ({\n  className,\n  variant = \"ghost\",\n  ...props\n}: Dialog.CloseTriggerProps & {\n  variant?: VariantProps<typeof buttonVariants>[\"variant\"];\n}) => (\n  <Dialog.CloseTrigger\n    className={cn(buttonVariants({ size: \"default\", variant }), className)}\n    {...props}\n  />\n);\n\nexport const AlertDialogAction = ({\n  className,\n  variant = \"default\",\n  ...props\n}: Dialog.CloseTriggerProps & {\n  variant?: VariantProps<typeof buttonVariants>[\"variant\"];\n}) => (\n  <Dialog.CloseTrigger\n    className={cn(buttonVariants({ size: \"default\", variant }), className)}\n    {...props}\n  />\n);\n\nexport const AlertDialogRootProvider = ({\n  ...props\n}: Dialog.RootProviderProps) => <Dialog.RootProvider {...props} />;\n\nexport {\n  useDialog as useAlertDialog,\n  useDialog,\n  useDialogContext as useAlertDialogContext,\n} from \"@ark-ui/react/dialog\";\n",
      "type": "registry:ui",
      "target": "src/components/ui/alert-dialog.tsx"
    }
  ],
  "type": "registry:ui"
}
