"use client" /** * AlertDialog — blocking confirm dialog backed by Radix `AlertDialog`. * * Use for **short, blocking** confirms where the user MUST acknowledge before * the surface behind can be interacted with again — destructive deletes, * irreversible status changes, legal acknowledgements, etc. (See * `.cursor/rules/exxat-drawer-vs-dialog.mdc` for the drawer-vs-dialog rule.) * * Differences from the regular `Dialog` primitive: * - Radix sets `role="alertdialog"` automatically — screen readers * announce the title + description immediately. * - Cannot be dismissed by overlay click or `Esc` (only the explicit * `AlertDialogCancel` / `AlertDialogAction` buttons close it). * - Ships an `Action` (primary destructive / commit) + `Cancel` * (secondary dismiss) pair that map to `Button` variants without * additional wiring. * * Accessibility: * - WCAG 4.1.2 — `AlertDialogTitle` is REQUIRED. Hide it visually with * `sr-only` if the design omits the heading, but never omit the element. * - WCAG 2.1.2 — focus is trapped inside the dialog while open (Radix). * - WCAG 3.3.4 — pair destructive actions with explicit, named verbs * ("Delete site" rather than "OK"). */ import * as React from "react" import { AlertDialog as AlertDialogPrimitive } from "radix-ui" import { Button, buttonVariants } from "./button" import { ShortcutScopeProvider } from "../../lib/shortcut-scope" import { cn } from "../../lib/utils" function AlertDialog({ ...props }: React.ComponentProps) { return } function AlertDialogTrigger({ ...props }: React.ComponentProps) { return ( ) } function AlertDialogPortal({ ...props }: React.ComponentProps) { return ( ) } function AlertDialogOverlay({ className, ...props }: React.ComponentProps) { return ( ) } function AlertDialogContent({ className, overlayClassName, children, ...props }: React.ComponentProps & { /** Merged onto `AlertDialogOverlay` (e.g. `bg-transparent` for an undimmed backdrop). */ overlayClassName?: string }) { return ( {children} ) } function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">) { return (
) } function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">) { return (
) } function AlertDialogTitle({ className, ...props }: React.ComponentProps) { return ( ) } function AlertDialogDescription({ className, ...props }: React.ComponentProps) { return ( ) } /** * Primary commit button. Defaults to `Button` `default` variant; pass * `variant="destructive"` when the action is irreversible (delete, archive * with cascade, etc.). * * Radix marks this as the **submit** button — pressing `Enter` while the * dialog has focus invokes it. */ function AlertDialogAction({ className, variant, ...props }: React.ComponentProps & React.ComponentProps) { return (