Mats Bosson 3388dbd371 AlertDialog component
Implements AlertDialog with compound component pattern (Root, Content, Title, Description, Trigger, Cancel, Action, Portal, Overlay). Content uses role=alertdialog, aria-modal, aria-labelledby/describedby, focus trap, and scroll lock. Does not dismiss on Escape key. 8 tests passing.
2026-03-29 08:19:02 +07:00

34 lines
1.6 KiB
TypeScript

import { AlertDialogAction } from "./alert-dialog-action";
import { AlertDialogCancel } from "./alert-dialog-cancel";
import { AlertDialogContent } from "./alert-dialog-content";
import { useAlertDialogContext } from "./alert-dialog-context";
import { AlertDialogDescription } from "./alert-dialog-description";
import { AlertDialogOverlay } from "./alert-dialog-overlay";
import { AlertDialogPortal } from "./alert-dialog-portal";
import { AlertDialogRoot } from "./alert-dialog-root";
import { AlertDialogTitle } from "./alert-dialog-title";
import { AlertDialogTrigger } from "./alert-dialog-trigger";
export const AlertDialog = Object.assign(AlertDialogRoot, {
Content: AlertDialogContent,
Title: AlertDialogTitle,
Description: AlertDialogDescription,
Trigger: AlertDialogTrigger,
Cancel: AlertDialogCancel,
Action: AlertDialogAction,
Portal: AlertDialogPortal,
Overlay: AlertDialogOverlay,
useContext: useAlertDialogContext,
});
export type { AlertDialogRootProps } from "./alert-dialog-root";
export type { AlertDialogContentProps } from "./alert-dialog-content";
export type { AlertDialogTitleProps } from "./alert-dialog-title";
export type { AlertDialogDescriptionProps } from "./alert-dialog-description";
export type { AlertDialogTriggerProps } from "./alert-dialog-trigger";
export type { AlertDialogCancelProps } from "./alert-dialog-cancel";
export type { AlertDialogActionProps } from "./alert-dialog-action";
export type { AlertDialogPortalProps } from "./alert-dialog-portal";
export type { AlertDialogOverlayProps } from "./alert-dialog-overlay";
export type { AlertDialogContextValue } from "./alert-dialog-context";