@dloizides/ui-layout 1.21.0 → 1.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.22.0
4
+
5
+ **Two shared modal primitives: a themed centered `Modal` dialog and a `ConfirmDialog` popup.**
6
+
7
+ Until now the kit had no shared centered dialog — only `ModalShell` (a full-screen slide-up sheet)
8
+ and `ModalDropdown` (a selector). Each portal hand-rolled its own edit dialog (e.g. kefi-web's
9
+ `PromoterActionModal`) and confirmed destructive actions with an ugly inline table row. These two
10
+ primitives replace both, so all 7 portals share one accessible, themed implementation.
11
+
12
+ - **New component `Modal`** — a centered dialog overlay for RN + RN-web: a scrim, a rounded themed
13
+ surface, an optional header (`title` + a top-right **✕ close** — a 44dp `IconButton` with a web
14
+ `tooltip`/aria-label "Close"), a scrollable body (`children`), and an optional `footer`. Dismissal
15
+ funnels to `onClose` from four routes: the ✕, a **backdrop** press, **Escape** on web
16
+ (`useEscapeKey`), and the hardware back button on native (RN `Modal`'s `onRequestClose`). It is
17
+ `role="dialog"` + `aria-modal` (`accessibilityViewIsModal`), **focus-trapped** on web
18
+ (`useFocusTrap`, restoring focus to the opener on close) and **scroll-locked** (`useScrollLock`).
19
+ Props: `visible`, `onClose`, `title?`, `children?`, `footer?`, `size?` (`sm`/`md`/`lg`, default
20
+ `md`), `showClose?` (default `true`), `testID?` (default `modal`), `accessibilityLabel?`. testIDs:
21
+ `${testID}-close`, `${testID}-backdrop`. All colours read from `useUi()` — no raw literals.
22
+ - **New component `ConfirmDialog`** — built ON `Modal`, for confirmations. Renders the `message`
23
+ plus a Cancel + Confirm button row (from `@dloizides/ui-buttons`). `destructive` paints the
24
+ Confirm with the `danger` (red) variant for irreversible actions. **Cancel is first in the DOM so
25
+ the focus trap lands on the SAFE action**; the ✕ is hidden (Cancel is the explicit dismiss). While
26
+ `busy`, Confirm shows a spinner and Cancel is disabled. Cancel / backdrop / Escape → `onCancel`.
27
+ Props: `visible`, `title`, `message`, `confirmLabel?`, `cancelLabel?`, `destructive?`, `onConfirm`,
28
+ `onCancel`, `busy?`, `testID?` (default `confirm-dialog`). testIDs: `${testID}-confirm`,
29
+ `${testID}-cancel`, `${testID}-message`.
30
+ - **New exported type `ModalSize`** (`'sm' | 'md' | 'lg'`) — a plain string union (matching the
31
+ kit's `ButtonSize` convention; no `const enum` crosses the package boundary).
32
+ - **New i18n keys** the host must provide: `common.close` (✕ label), plus for `ConfirmDialog`
33
+ defaults `common.confirm` / `common.confirmHint` / `common.cancel` / `common.cancelHint`. Reuses the
34
+ existing `common.closeDialogHint`, `common.dialog`, `common.dismissDropdown(Hint)` keys.
35
+ - **New peer dependency `@dloizides/ui-buttons` (`>=1.8.0`)** — `ConfirmDialog` reuses its `Button`,
36
+ `Modal` reuses its `IconButton` for the ✕, rather than reinventing button chrome.
37
+
38
+ Additive: `ModalShell`, `ModalDropdown` and every existing export/selector are untouched. Covered by
39
+ `Modal.test.tsx`, `ConfirmDialog.test.tsx`, `useEscapeKey.test.ts`, `useScrollLock.test.ts`.
40
+
41
+ > Note: `@dloizides/ui-feedback` also exports a lighter `ConfirmDialog` (no ✕ / Escape / focus-trap,
42
+ > own buttons). This ui-layout one is the richer, `Modal`-based dialog the portals should adopt.
43
+
3
44
  ## 1.21.0
4
45
 
5
46
  **The collapsed `Tabs` menu can now present as a HAMBURGER (☰) — the universal mobile-nav affordance.**
package/README.md CHANGED
@@ -15,9 +15,44 @@ Read theme + translations from the shared `@dloizides/ui-feedback` context (`use
15
15
  | `TabsCollapsedTrigger` | Enum (`Caret` / `Hamburger`) selecting how the collapsed `Tabs` menu trigger presents. Defaults to `Caret`. |
16
16
  | `ModalDropdown` | Generic dropdown selector. **Responsive by default**: an inline anchored menu on wide/desktop web, a modal on narrow/mobile — override per screen with `variant`. Opt into a menu affordance on the default trigger with `showCaret` (trailing ▾) or `showHamburger` (leading ☰, wins over `showCaret`). |
17
17
  | `DropdownVariant` | Enum (`Menu` / `Modal`) to force a `ModalDropdown` rendering variant. |
18
+ | `ModalShell` | Full-screen **slide-up sheet** with a themed header (title + close). For a page-covering editor. Dismiss via `onCancel`. |
19
+ | `Modal` | Themed **centered dialog overlay**: scrim + rounded card, optional header with a top-right ✕ close, scrollable body, optional footer. Dismiss via ✕ / backdrop / Escape (web) / hardware back (native); focus-trapped + scroll-locked. `size` = `sm`/`md`/`lg`. |
20
+ | `ConfirmDialog` | Confirm/cancel popup built on `Modal`. Cancel + Confirm buttons (from `@dloizides/ui-buttons`); `destructive` paints the Confirm red. Cancel is focus-default (safe), and is disabled while `busy` (Confirm shows a spinner). Cancel / backdrop / Escape → `onCancel`. |
18
21
  | `Accordion` / `AccordionItem` | Themed expand/collapse disclosure group (replaces hand-rolled `<details>`/expanders). Controlled or uncontrolled, single- or multi-open, animated, keyboard + screen-reader accessible. |
19
22
  | `useFocusTrap` | Web keyboard focus-trap hook (no-op on native). |
20
23
 
24
+ ### `Modal` & `ConfirmDialog`
25
+
26
+ ```tsx
27
+ import { Modal, ConfirmDialog } from '@dloizides/ui-layout';
28
+
29
+ // A centered edit dialog with a top-right ✕:
30
+ <Modal visible={editing} title="Edit details" onClose={() => setEditing(false)} footer={<SaveRow />}>
31
+ <AttendeeForm />
32
+ </Modal>
33
+
34
+ // A destructive confirmation popup:
35
+ <ConfirmDialog
36
+ visible={confirming}
37
+ destructive
38
+ title="Remove attendee?"
39
+ message="This can't be undone."
40
+ busy={isDeleting}
41
+ onConfirm={remove}
42
+ onCancel={() => setConfirming(false)}
43
+ />
44
+ ```
45
+
46
+ - **Dismissal** — `Modal`: ✕ button, backdrop press, Escape (web), hardware back (native), all → `onClose`.
47
+ `ConfirmDialog`: Cancel, backdrop, Escape → `onCancel`; it hides the ✕ so the focus trap lands on the safe Cancel action.
48
+ - **testIDs** — `Modal` (default `modal`): `${testID}-close`, `${testID}-backdrop`.
49
+ `ConfirmDialog` (default `confirm-dialog`): `${testID}-confirm`, `${testID}-cancel`, `${testID}-message`.
50
+ - **i18n keys** the host must provide: `common.close` (✕ label), `common.closeDialogHint`, `common.dialog`
51
+ (fallback dialog name), and for `ConfirmDialog` defaults `common.confirm` / `common.confirmHint` /
52
+ `common.cancel` / `common.cancelHint`. Pass `confirmLabel`/`cancelLabel` (already-localized) to override.
53
+ - **a11y** — `role="dialog"` + `aria-modal`; focus trapped on web and restored to the opener on close.
54
+ Note (RN-web): `accessibilityHint` does not reach the DOM, so the ✕'s hover `tooltip` carries the visible helper text.
55
+
21
56
  ### `Accordion`
22
57
 
23
58
  A compound component: an `Accordion` container that owns the open state + `AccordionItem`
package/dist/index.d.mts CHANGED
@@ -338,6 +338,106 @@ interface ModalShellProps {
338
338
  }
339
339
  declare const ModalShell: ({ visible, onCancel, title, children, contentStyle, showClose, }: ModalShellProps) => React.ReactElement;
340
340
 
341
+ /**
342
+ * Max-width preset for {@link Modal}.
343
+ *
344
+ * A plain string union (NOT a const enum), matching the kit's convention — see
345
+ * `@dloizides/ui-buttons`' `ButtonSize`. Call sites stay ergonomic (`size="md"`) and no
346
+ * const enum crosses the package boundary, where tsup/esbuild inline them unreliably.
347
+ *
348
+ * - `sm` — compact confirmations / short forms.
349
+ * - `md` (default) — the general dialog.
350
+ * - `lg` — wide editors.
351
+ */
352
+ type ModalSize = 'sm' | 'md' | 'lg';
353
+
354
+ /**
355
+ * Modal — a themed, CENTERED dialog overlay for RN + RN-web.
356
+ *
357
+ * Distinct from this package's {@link import('../ModalShell/ModalShell').ModalShell}, which is a
358
+ * full-screen slide-up sheet. `Modal` is the floating card an app opens over the current screen:
359
+ * a scrim, a rounded surface, an optional header (title + a top-right ✕ close), a scrollable body,
360
+ * and an optional footer (action buttons). It is the shared shell {@link ConfirmDialog} is built on,
361
+ * and the replacement for per-app dialogs like kefi-web's `PromoterActionModal`.
362
+ *
363
+ * DISMISSAL — four routes, all funnel to `onClose`:
364
+ * - the top-right ✕ button (web tooltip + aria-label "Close"; a 44dp `IconButton` target),
365
+ * - a press on the backdrop scrim (a SIBLING of the dialog, so option/action buttons are never
366
+ * nested inside a button — invalid DOM),
367
+ * - Escape on web (via {@link useEscapeKey}),
368
+ * - the hardware back button on native (RN `Modal`'s `onRequestClose`).
369
+ *
370
+ * ACCESSIBILITY: the dialog carries `role="dialog"` + `aria-modal` (via `accessibilityViewIsModal`)
371
+ * and an accessible name (`accessibilityLabel` → `title` → the neutral "dialog" key). Focus is
372
+ * trapped within the dialog on web ({@link useFocusTrap}) and restored to the opener on close, and
373
+ * page scroll behind the dialog is locked ({@link useScrollLock}).
374
+ *
375
+ * Every colour is read from the app's theme via `useUi()` — no raw literals.
376
+ */
377
+
378
+ interface ModalProps {
379
+ /** Whether the dialog is mounted + shown. */
380
+ visible: boolean;
381
+ /** Called by every dismissal route: ✕, backdrop, Escape (web), hardware back (native). */
382
+ onClose: () => void;
383
+ /** Header title. Omit for a chromeless dialog (the ✕ still shows unless `showClose` is false). */
384
+ title?: string;
385
+ /** Dialog body. Rendered inside a scroll view so long content scrolls within the dialog. */
386
+ children?: React.ReactNode;
387
+ /** Optional footer, typically an action-button row (see {@link ConfirmDialog}). */
388
+ footer?: React.ReactNode;
389
+ /** Max-width preset. Default `md`. */
390
+ size?: ModalSize;
391
+ /**
392
+ * Show the top-right ✕ close button. Default `true`. `ConfirmDialog` sets it `false` — it offers
393
+ * an explicit Cancel, and hiding the ✕ lets the web focus trap land on the SAFE Cancel action.
394
+ */
395
+ showClose?: boolean;
396
+ /** Base testID. Default `modal`. The ✕ is `${testID}-close`, the backdrop `${testID}-backdrop`. */
397
+ testID?: string;
398
+ /** Accessible name of the dialog. Falls back to `title`, then the neutral "dialog" key. */
399
+ accessibilityLabel?: string;
400
+ }
401
+ declare const Modal: ({ visible, onClose, title, children, footer, size, showClose, testID, accessibilityLabel, }: ModalProps) => React.ReactElement;
402
+
403
+ /**
404
+ * ConfirmDialog — a confirm/cancel popup built ON {@link Modal}, for the "are you sure?" moment.
405
+ *
406
+ * Replaces per-app inline confirms (e.g. kefi-web's inline attendee-delete row) with one shared,
407
+ * themed dialog reused across every portal. Renders the `message` in the body and a Cancel + Confirm
408
+ * button row (from `@dloizides/ui-buttons`) in the footer. When `destructive` is set the Confirm
409
+ * button uses the `danger` variant — the red, irreversible-action treatment.
410
+ *
411
+ * SAFE BY DEFAULT: Cancel is FIRST in the DOM, so the web focus trap lands on it — a keyboard user
412
+ * never has a destructive Confirm pre-focused. Cancel, the backdrop, and Escape all call `onCancel`;
413
+ * the ✕ is hidden (the explicit Cancel is the dismiss affordance). While `busy`, Confirm shows its
414
+ * spinner and Cancel is disabled, so a slow delete cannot be fired twice or cancelled mid-flight.
415
+ */
416
+
417
+ interface ConfirmDialogProps {
418
+ /** Whether the dialog is shown. */
419
+ visible: boolean;
420
+ /** Header title, e.g. "Remove attendee?". */
421
+ title: string;
422
+ /** Body copy, e.g. "This can't be undone." */
423
+ message: string;
424
+ /** Confirm button label. Defaults to the host's `common.confirm` translation. */
425
+ confirmLabel?: string;
426
+ /** Cancel button label. Defaults to the host's `common.cancel` translation. */
427
+ cancelLabel?: string;
428
+ /** Red `danger` Confirm for an irreversible action. Default `false` (blue `primary`). */
429
+ destructive?: boolean;
430
+ /** Called when the user presses Confirm. */
431
+ onConfirm: () => void;
432
+ /** Called by Cancel, the backdrop, and Escape. */
433
+ onCancel: () => void;
434
+ /** In-flight: Confirm shows a spinner and Cancel is disabled. Default `false`. */
435
+ busy?: boolean;
436
+ /** Base testID. Default `confirm-dialog`. Confirm is `${testID}-confirm`, Cancel `${testID}-cancel`. */
437
+ testID?: string;
438
+ }
439
+ declare const ConfirmDialog: ({ visible, title, message, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, busy, testID, }: ConfirmDialogProps) => React.ReactElement;
440
+
341
441
  /**
342
442
  * AccordionVariant — the two visual treatments for an {@link Accordion}.
343
443
  *
@@ -617,6 +717,10 @@ declare const LAYOUT_TEST_IDS: {
617
717
  readonly upgradePromptDismiss: "upgrade-prompt-dismiss";
618
718
  readonly modalShell: "template-modal";
619
719
  readonly modalShellClose: "cancel-button";
720
+ /** Default base testID for the centered `Modal`; ✕ is `modal-close`, backdrop `modal-backdrop`. */
721
+ readonly modal: "modal";
722
+ /** Default base testID for `ConfirmDialog`; Confirm/Cancel are `confirm-dialog-{confirm,cancel}`. */
723
+ readonly confirmDialog: "confirm-dialog";
620
724
  readonly accordion: "accordion";
621
725
  };
622
726
  /** Route the UpgradePrompt CTA navigates to by default (the apps' billing settings path). */
@@ -660,6 +764,14 @@ declare const LAYOUT_I18N: {
660
764
  readonly close: "quizTemplates.cancel";
661
765
  /** `ModalShell`: heading fallback when no title is supplied. */
662
766
  readonly closeHeading: "close";
767
+ /** `Modal`: accessible name + web tooltip of the top-right ✕ close button. */
768
+ readonly dialogClose: "common.close";
769
+ /** `ConfirmDialog`: default Confirm button label (overridable via `confirmLabel`) + its hint. */
770
+ readonly confirm: "common.confirm";
771
+ readonly confirmHint: "common.confirmHint";
772
+ /** `ConfirmDialog`: default Cancel button label (overridable via `cancelLabel`) + its hint. */
773
+ readonly cancel: "common.cancel";
774
+ readonly cancelHint: "common.cancelHint";
663
775
  readonly upgradePromptTitle: "settings.billing.upgradePrompt.title";
664
776
  /** Body copy, parameterised: "…requires {{p1}}, you are on {{p2}}." */
665
777
  readonly upgradePromptMessage: "settings.billing.upgradePrompt.message";
@@ -681,4 +793,4 @@ declare const LAYOUT_I18N: {
681
793
  readonly copyableIdHint: "common.copyableIdHint";
682
794
  };
683
795
 
684
- export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, COPY_FEEDBACK_MS, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_I18N, LAYOUT_TEST_IDS, ModalDropdown, type ModalDropdownProps, ModalShell, type ModalShellProps, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, copyText, formatUrlForDisplay, truncateMiddle, useCopyToClipboard, useFocusTrap };
796
+ export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_I18N, LAYOUT_TEST_IDS, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, copyText, formatUrlForDisplay, truncateMiddle, useCopyToClipboard, useFocusTrap };
package/dist/index.d.ts CHANGED
@@ -338,6 +338,106 @@ interface ModalShellProps {
338
338
  }
339
339
  declare const ModalShell: ({ visible, onCancel, title, children, contentStyle, showClose, }: ModalShellProps) => React.ReactElement;
340
340
 
341
+ /**
342
+ * Max-width preset for {@link Modal}.
343
+ *
344
+ * A plain string union (NOT a const enum), matching the kit's convention — see
345
+ * `@dloizides/ui-buttons`' `ButtonSize`. Call sites stay ergonomic (`size="md"`) and no
346
+ * const enum crosses the package boundary, where tsup/esbuild inline them unreliably.
347
+ *
348
+ * - `sm` — compact confirmations / short forms.
349
+ * - `md` (default) — the general dialog.
350
+ * - `lg` — wide editors.
351
+ */
352
+ type ModalSize = 'sm' | 'md' | 'lg';
353
+
354
+ /**
355
+ * Modal — a themed, CENTERED dialog overlay for RN + RN-web.
356
+ *
357
+ * Distinct from this package's {@link import('../ModalShell/ModalShell').ModalShell}, which is a
358
+ * full-screen slide-up sheet. `Modal` is the floating card an app opens over the current screen:
359
+ * a scrim, a rounded surface, an optional header (title + a top-right ✕ close), a scrollable body,
360
+ * and an optional footer (action buttons). It is the shared shell {@link ConfirmDialog} is built on,
361
+ * and the replacement for per-app dialogs like kefi-web's `PromoterActionModal`.
362
+ *
363
+ * DISMISSAL — four routes, all funnel to `onClose`:
364
+ * - the top-right ✕ button (web tooltip + aria-label "Close"; a 44dp `IconButton` target),
365
+ * - a press on the backdrop scrim (a SIBLING of the dialog, so option/action buttons are never
366
+ * nested inside a button — invalid DOM),
367
+ * - Escape on web (via {@link useEscapeKey}),
368
+ * - the hardware back button on native (RN `Modal`'s `onRequestClose`).
369
+ *
370
+ * ACCESSIBILITY: the dialog carries `role="dialog"` + `aria-modal` (via `accessibilityViewIsModal`)
371
+ * and an accessible name (`accessibilityLabel` → `title` → the neutral "dialog" key). Focus is
372
+ * trapped within the dialog on web ({@link useFocusTrap}) and restored to the opener on close, and
373
+ * page scroll behind the dialog is locked ({@link useScrollLock}).
374
+ *
375
+ * Every colour is read from the app's theme via `useUi()` — no raw literals.
376
+ */
377
+
378
+ interface ModalProps {
379
+ /** Whether the dialog is mounted + shown. */
380
+ visible: boolean;
381
+ /** Called by every dismissal route: ✕, backdrop, Escape (web), hardware back (native). */
382
+ onClose: () => void;
383
+ /** Header title. Omit for a chromeless dialog (the ✕ still shows unless `showClose` is false). */
384
+ title?: string;
385
+ /** Dialog body. Rendered inside a scroll view so long content scrolls within the dialog. */
386
+ children?: React.ReactNode;
387
+ /** Optional footer, typically an action-button row (see {@link ConfirmDialog}). */
388
+ footer?: React.ReactNode;
389
+ /** Max-width preset. Default `md`. */
390
+ size?: ModalSize;
391
+ /**
392
+ * Show the top-right ✕ close button. Default `true`. `ConfirmDialog` sets it `false` — it offers
393
+ * an explicit Cancel, and hiding the ✕ lets the web focus trap land on the SAFE Cancel action.
394
+ */
395
+ showClose?: boolean;
396
+ /** Base testID. Default `modal`. The ✕ is `${testID}-close`, the backdrop `${testID}-backdrop`. */
397
+ testID?: string;
398
+ /** Accessible name of the dialog. Falls back to `title`, then the neutral "dialog" key. */
399
+ accessibilityLabel?: string;
400
+ }
401
+ declare const Modal: ({ visible, onClose, title, children, footer, size, showClose, testID, accessibilityLabel, }: ModalProps) => React.ReactElement;
402
+
403
+ /**
404
+ * ConfirmDialog — a confirm/cancel popup built ON {@link Modal}, for the "are you sure?" moment.
405
+ *
406
+ * Replaces per-app inline confirms (e.g. kefi-web's inline attendee-delete row) with one shared,
407
+ * themed dialog reused across every portal. Renders the `message` in the body and a Cancel + Confirm
408
+ * button row (from `@dloizides/ui-buttons`) in the footer. When `destructive` is set the Confirm
409
+ * button uses the `danger` variant — the red, irreversible-action treatment.
410
+ *
411
+ * SAFE BY DEFAULT: Cancel is FIRST in the DOM, so the web focus trap lands on it — a keyboard user
412
+ * never has a destructive Confirm pre-focused. Cancel, the backdrop, and Escape all call `onCancel`;
413
+ * the ✕ is hidden (the explicit Cancel is the dismiss affordance). While `busy`, Confirm shows its
414
+ * spinner and Cancel is disabled, so a slow delete cannot be fired twice or cancelled mid-flight.
415
+ */
416
+
417
+ interface ConfirmDialogProps {
418
+ /** Whether the dialog is shown. */
419
+ visible: boolean;
420
+ /** Header title, e.g. "Remove attendee?". */
421
+ title: string;
422
+ /** Body copy, e.g. "This can't be undone." */
423
+ message: string;
424
+ /** Confirm button label. Defaults to the host's `common.confirm` translation. */
425
+ confirmLabel?: string;
426
+ /** Cancel button label. Defaults to the host's `common.cancel` translation. */
427
+ cancelLabel?: string;
428
+ /** Red `danger` Confirm for an irreversible action. Default `false` (blue `primary`). */
429
+ destructive?: boolean;
430
+ /** Called when the user presses Confirm. */
431
+ onConfirm: () => void;
432
+ /** Called by Cancel, the backdrop, and Escape. */
433
+ onCancel: () => void;
434
+ /** In-flight: Confirm shows a spinner and Cancel is disabled. Default `false`. */
435
+ busy?: boolean;
436
+ /** Base testID. Default `confirm-dialog`. Confirm is `${testID}-confirm`, Cancel `${testID}-cancel`. */
437
+ testID?: string;
438
+ }
439
+ declare const ConfirmDialog: ({ visible, title, message, confirmLabel, cancelLabel, destructive, onConfirm, onCancel, busy, testID, }: ConfirmDialogProps) => React.ReactElement;
440
+
341
441
  /**
342
442
  * AccordionVariant — the two visual treatments for an {@link Accordion}.
343
443
  *
@@ -617,6 +717,10 @@ declare const LAYOUT_TEST_IDS: {
617
717
  readonly upgradePromptDismiss: "upgrade-prompt-dismiss";
618
718
  readonly modalShell: "template-modal";
619
719
  readonly modalShellClose: "cancel-button";
720
+ /** Default base testID for the centered `Modal`; ✕ is `modal-close`, backdrop `modal-backdrop`. */
721
+ readonly modal: "modal";
722
+ /** Default base testID for `ConfirmDialog`; Confirm/Cancel are `confirm-dialog-{confirm,cancel}`. */
723
+ readonly confirmDialog: "confirm-dialog";
620
724
  readonly accordion: "accordion";
621
725
  };
622
726
  /** Route the UpgradePrompt CTA navigates to by default (the apps' billing settings path). */
@@ -660,6 +764,14 @@ declare const LAYOUT_I18N: {
660
764
  readonly close: "quizTemplates.cancel";
661
765
  /** `ModalShell`: heading fallback when no title is supplied. */
662
766
  readonly closeHeading: "close";
767
+ /** `Modal`: accessible name + web tooltip of the top-right ✕ close button. */
768
+ readonly dialogClose: "common.close";
769
+ /** `ConfirmDialog`: default Confirm button label (overridable via `confirmLabel`) + its hint. */
770
+ readonly confirm: "common.confirm";
771
+ readonly confirmHint: "common.confirmHint";
772
+ /** `ConfirmDialog`: default Cancel button label (overridable via `cancelLabel`) + its hint. */
773
+ readonly cancel: "common.cancel";
774
+ readonly cancelHint: "common.cancelHint";
663
775
  readonly upgradePromptTitle: "settings.billing.upgradePrompt.title";
664
776
  /** Body copy, parameterised: "…requires {{p1}}, you are on {{p2}}." */
665
777
  readonly upgradePromptMessage: "settings.billing.upgradePrompt.message";
@@ -681,4 +793,4 @@ declare const LAYOUT_I18N: {
681
793
  readonly copyableIdHint: "common.copyableIdHint";
682
794
  };
683
795
 
684
- export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, COPY_FEEDBACK_MS, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_I18N, LAYOUT_TEST_IDS, ModalDropdown, type ModalDropdownProps, ModalShell, type ModalShellProps, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, copyText, formatUrlForDisplay, truncateMiddle, useCopyToClipboard, useFocusTrap };
796
+ export { Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, COPY_FEEDBACK_MS, ConfirmDialog, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, DEFAULT_BILLING_ROUTE, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, Heading, type HeadingLevel, type HeadingProps, LAYOUT_I18N, LAYOUT_TEST_IDS, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, StatusBadge, type StatusBadgeProps, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, copyText, formatUrlForDisplay, truncateMiddle, useCopyToClipboard, useFocusTrap };