import { CSSProperties, ReactNode, RefObject, SyntheticEvent } from 'react'; import { UiCoreLocale } from '../../../helpers/uiCoreLocale'; export type DialogCloseReason = 'escapeKeyDown' | 'backdropClick'; export type DialogMaxWidth = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | false; interface DialogPaperProps { className?: string; style?: CSSProperties; sx?: unknown; ref?: React.Ref; } /** * @figmaNode wXrXt5uKNNzV2DnQCgyYZH#15820-18954 * Figma "Dialog": white paper radius 8 with the Dialogue-popup shadow (#22213366, 0 4 40) over a * bg/modal #626e7eb2 overlay. Header = actions row (optional label, Helper delta-700, one line, + close button) * over the full-width title; without a label the title sits in that row, left of the close button * (ASMA-8737: 24/32 SemiBold, 20/28 SemiBold below 744 px, delta-800, never truncated). `fullScreen`/mobile * drops the radius and fills the viewport. */ export interface IStyledDialogProps { open: boolean; /** * ✕, Escape and (ASMA-8471) native Back all funnel through this. Returning a Promise (a dirty or * async confirmation) latches the dialog against Back while it is pending (`requestCloseTopOverlayBack`); * returning nothing leaves it unlatched, so a repeated Back repeats the same dismissal attempt. */ onClose?: (event: SyntheticEvent | Event, reason: DialogCloseReason) => void | Promise; children?: ReactNode; dataTest: string; maxWidth?: DialogMaxWidth; fullWidth?: boolean; /** Defaults to `true` on mobile (≤743px); pass `false` to keep the windowed paper there too. */ fullScreen?: boolean; scroll?: 'paper' | 'body'; disableEscapeKeyDown?: boolean; /** * Accepted for MUI `Dialog` parity (DEC-003). Focus is trapped by the native `` * `showModal()`, so this MUI `Modal` prop is a typed no-op. */ disableEnforceFocus?: boolean; className?: string; style?: CSSProperties; sx?: unknown; /** * MUI `Dialog` `classes` parity (DEC-003). The native `` is the paper, so `classes.paper` * is merged onto it; `classes.root` is accepted as a typed no-op (no separate root element). */ classes?: { paper?: string; root?: string; }; PaperProps?: DialogPaperProps; slotProps?: { paper?: DialogPaperProps; backdrop?: Record; transition?: { onExited?: () => void; }; }; /** Why close and Cancel wait while an action runs; defaults to "Wait until saved" in `locale`. */ busyReason?: ReactNode; /** Language of the default busy reason; defaults to English. */ locale?: UiCoreLocale; onCloseText?: ReactNode; /** @figmaProp none — behavioral */ showCloseIcon?: boolean; /** Close button size: `small` 32px (default) or `medium` 40px with a 16px label and 24px icon. */ closeButtonSize?: 'small' | 'medium'; /** On a phone, Close shows only its icon; the `onCloseText` label stays its accessible name. */ hideCloseLabelOnMobile?: boolean; /** @figmaProp header Label (Helper 14/20, delta-700, one line with an ellipsis) */ dialogLabel?: ReactNode; /** @figmaProp header Title (24/32 SemiBold, 20/28 SemiBold on mobile, delta-800), on its own full-width row */ dialogTitle?: ReactNode; dialogHeaderNode?: ReactNode; /** * @figmaProp none — accessibility * The dialog's accessible name when it shows no visible title: neither `dialogTitle`, a * `` child nor `dialogLabel`. A visible title or label always wins: the dialog * is `aria-labelledby` it. Without any of these, the dialog is named by the first heading * (`h1`–`h6` or `role="heading"`) in its content; with no heading either it stays unnamed and a * development-only warning names its `dataTest`. `dataTest` is never used as a name — it is a * test hook, not text. */ ariaLabel?: string; /** * @figmaProp none — accessibility * Where focus starts when the dialog opens. Without it the dialog itself takes focus. A * confirmation passes its safe button, so Enter never runs the destructive action (ASMA-8895). */ initialFocusRef?: RefObject; } /** * Modal dialog built on the native `` element (replaces MUI `Dialog`) — backdrop, focus * trap and ESC handling come from `showModal()` for free. The `` element is the "paper", * so `PaperProps`/`slotProps.paper` and `className` style it directly; `::backdrop` is the overlay. * Public props preserved (DEC-003). TASK-205. * * ponytail: open/close is instant (no MUI fade) and body-scroll behind the modal isn't locked — * both known ceilings; Chromatic in CI is the visual gate. Upgrade path: add `@starting-style` * transitions and a scroll-lock effect if a diff calls for it. */ export declare const StyledDialog: React.FC; export {};