{
  "name": "destructive-confirmation",
  "type": "registry:component",
  "title": "Destructive Confirmation",
  "description": "A destructive account action with explicit cancellation, confirmation and result status.",
  "registryDependencies": [
    "@siteplane/base",
    "@siteplane/alert-dialog",
    "@siteplane/button"
  ],
  "dependencies": [],
  "files": [
    {
      "path": "src/components/patterns/destructive-confirmation.tsx",
      "type": "registry:component",
      "target": "components/patterns/destructive-confirmation.tsx",
      "content": "\"use client\";\n\nimport { useState } from \"react\";\n\nimport {\n  AlertDialog,\n  AlertDialogClose,\n  AlertDialogDescription,\n  AlertDialogFooter,\n  AlertDialogHeader,\n  AlertDialogPopup,\n  AlertDialogTitle,\n  AlertDialogTrigger,\n} from \"@/components/ui/alert-dialog\";\nimport { Button } from \"@/components/ui/button\";\n\nexport function DestructiveConfirmation() {\n  const [status, setStatus] = useState(\"Account: active\");\n\n  return (\n    <div className=\"grid gap-3\" data-recipe=\"destructive-confirmation\">\n      <AlertDialog>\n        <AlertDialogTrigger render={<Button variant=\"destructive-outline\" />}>\n          Delete Account\n        </AlertDialogTrigger>\n        <AlertDialogPopup>\n          <AlertDialogHeader>\n            <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>\n            <AlertDialogDescription>\n              This action cannot be undone. This will permanently delete your account\n              and remove your data from our servers.\n            </AlertDialogDescription>\n          </AlertDialogHeader>\n          <AlertDialogFooter>\n            <AlertDialogClose render={<Button variant=\"ghost\" />}>\n              Cancel\n            </AlertDialogClose>\n            <AlertDialogClose\n              onClick={() => setStatus(\"Account: deleted\")}\n              render={<Button variant=\"destructive\" />}\n            >\n              Delete Account\n            </AlertDialogClose>\n          </AlertDialogFooter>\n        </AlertDialogPopup>\n      </AlertDialog>\n      <span\n        className=\"text-muted-foreground text-xs\"\n        data-recipe-status=\"destructive-confirmation\"\n        role=\"status\"\n      >\n        {status}\n      </span>\n    </div>\n  );\n}\n"
    }
  ],
  "categories": [
    "patterns"
  ],
  "docs": "# Destructive Confirmation\n\n> Siteplane UI release `0.1.1`.\n\n## Public Purpose\n\nDestructive Confirmation is a `registry:component` for an irreversible account action with explicit cancellation, confirmation and a visible result status.\n\n## Import\n\n```tsx\nimport { DestructiveConfirmation } from \"@/components/patterns/destructive-confirmation\";\n```\n\n## Public API\n\n- Render `DestructiveConfirmation` for the included delete-account example.\n- Replace the account copy and confirmation handler after installation while keeping separate Cancel and destructive confirmation actions.\n- Use AlertDialog for the decision boundary; use Dialog or an inline Alert when the user is not confirming an irreversible action.\n\n## Public Motion\n\n- The recipe adds no motion and retains the native AlertDialog transition.\n- Reduced motion behavior is inherited from AlertDialog and the global motion provider.\n\n## Public Accessibility\n\n- AlertDialog traps focus, names the decision and restores focus to the trigger when it closes.\n- Keep the consequence in the description and keep Cancel available before the destructive action.\n\n## Public Agent Guidance\n\n- Install with `pnpm dlx shadcn@4.16.1 add @siteplane/destructive-confirmation`.\n- Adapt only the resource name, consequence text and confirmed action.\n- Use this ready-made recipe only when the request explicitly asks for the complete pattern and its built-in result state. Compose product-specific deletion actions such as deleting a workspace directly from Alert Dialog and Button.\n- Do not use a destructive confirmation for a reversible or informational event.\n\n## Public Links\n\n- [Documentation and preview](https://ui.siteplane.io/docs/patterns/destructive-confirmation)\n\n- [Registry source](https://ui.siteplane.io/r/destructive-confirmation.json)\n",
  "meta": {
    "siteplane:agentContractVersion": 1,
    "siteplane:docs": "https://ui.siteplane.io/docs/patterns/destructive-confirmation",
    "siteplane:releaseVersion": "0.1.1",
    "siteplane:sourceOwned": true
  },
  "devDependencies": []
}
