{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "confirm-action",
  "title": "Confirm action",
  "description": "An alert dialog's confirm button that shows a loader and stays focusable while its action runs.",
  "registryDependencies": [
    "@khaeli/fancy-button"
  ],
  "files": [
    {
      "path": "registry/khaeli/ui/confirm-action.tsx",
      "content": "\"use client\"\n\nimport type * as React from \"react\"\n\nimport { FancyButton } from \"@/components/ui/fancy-button\"\n\n/**\n * The confirm button of an `AlertDialogFooter` while its action runs: a\n * FancyButton that shows the Loader and stays focusable (`aria-disabled`)\n * while `pending`, where `<AlertDialogAction disabled>` drops focus to\n * <body>. It does not close the dialog; close it on success as before.\n * `variant` follows AlertDialogAction's: \"default\" is the primary button.\n * It keeps FancyButton's data-slot and 30px size, so it sits level with\n * AlertDialogCancel and foundation.css's phone footer capsules still find it.\n */\nfunction AlertDialogPendingAction({\n  pending,\n  variant = \"destructive\",\n  onClick,\n  children,\n  className,\n}: {\n  pending: boolean\n  variant?: \"default\" | \"destructive\"\n  onClick: (event: React.MouseEvent<HTMLButtonElement>) => void\n  children: React.ReactNode\n  className?: string\n}) {\n  return (\n    <FancyButton\n      variant={variant === \"default\" ? \"primary\" : \"destructive\"}\n      pending={pending}\n      onClick={onClick}\n      className={className}\n    >\n      {children}\n    </FancyButton>\n  )\n}\n\nexport { AlertDialogPendingAction }\n",
      "type": "registry:ui"
    }
  ],
  "docs": "Install @khaeli/foundation first: this item's styling lives in its tokens and [data-slot] rules.",
  "type": "registry:ui"
}