import { default as React, ReactElement, ReactNode } from 'react'; import { BorderColor, ElementElevation, ElementFont, ElementOutline, ElementShape, ElementSize, SurfaceColor } from '../../utils'; import { DialogIconSlot, DialogType, ElementAnimation } from '../../types'; /** * Props for the DialogBase component. * * Supports backdrop and portal rendering, transitions, Escape and backdrop * dismiss, and optional modal focus trap and scroll locking. * * @category Base components */ export interface DialogBaseProps { /** Semantic UUI element class for the dialog panel. */ elementClass?: string; /** Whether the dialog is open. */ open: boolean; /** Handler invoked when the dialog should close. */ onClose?: () => void; /** Layout mode. Default: basic */ type?: DialogType; /** Surface background token. */ color?: SurfaceColor; /** Elevation level. Default: 3 for non-fullscreen layouts. */ elevation?: ElementElevation; /** Predefined panel size. Default: small for horizontal docks, medium otherwise. */ size?: ElementSize; /** Shape of the dialog panel. */ shape?: ElementShape; /** Outline thickness when outlined. */ border?: ElementOutline; /** Outline color when outlined. */ borderColor?: BorderColor; /** Expands panel to full width. */ fullWidth?: boolean; /** Expands panel to full height. */ fullHeight?: boolean; /** Fits content to the panel. */ fit?: boolean; /** Renders the panel in detached layout style. */ detached?: boolean; /** Motion value (`MotionAnimation` or full motion config). */ animation?: ElementAnimation; /** Whether the dialog closes when the backdrop is clicked. Default: true */ closeOnBackdrop?: boolean; /** Whether the dialog closes when Escape is pressed. Default: true */ closeOnEsc?: boolean; /** Dialog content. */ children?: ReactNode; /** Visual title text. Referenced via aria-labelledby on the dialog element. */ label?: string; /** Accessible label for dialogs without a visible title. */ 'aria-label'?: string; /** Icon rendered in the dialog. Position controlled by iconSlot. */ icon?: ReactElement; showIcon?: boolean; iconColor?: SurfaceColor; /** Where the icon is placed. Default: leading */ iconSlot?: DialogIconSlot; /** Alignment of the title text. Default: start */ titleAlign?: 'start' | 'center' | 'end'; /** Full leading slot content for the title area. */ leading?: ReactNode; /** Trailing slot content for the title area. */ trailing?: ReactNode; /** Action buttons rendered in the dialog. */ actions?: ReactNode; /** Where actions are placed. Default: inline for fullscreen, bottom otherwise (MD3) */ actionsPlacement?: 'top' | 'subtitle' | 'bottom' | 'inline'; /** Alignment of action buttons. Default: end (MD3) */ actionsAlign?: 'start' | 'center' | 'end'; /** Stack actions vertically instead of horizontally. Default: false (MD3) */ actionsStack?: boolean; /** Maximum number of visible actions before the rest collapse into an overflow menu. Only applies when actionsPosition is inline. */ maxActions?: number; /** Accessible label for the overflow actions button. Default: "More actions" */ moreLabel?: string; /** Custom icon for the overflow actions button. */ moreIcon?: ReactElement; /** Renders a close button in the trailing slot. */ showClose?: boolean; /** Custom icon for the close button. */ closeIcon?: ReactElement; /** Renders a back button in the leading slot. */ showBack?: boolean; /** Custom icon for the back button. */ backIcon?: ReactElement; /** Handler for the back button. Defaults to onClose. */ onBack?: () => void; /** Additional class names for the dialog panel. */ className?: string; /** Enables modal behaviour, focus trap, aria-modal, and body scroll lock when applicable. */ modal?: boolean; /** Focuses the dialog when opened (with modal focus trap). */ autoFocus?: boolean; /** Removes default panel padding. */ flush?: boolean; /** Renders inline without a portal (e.g. docked regions). */ docked?: boolean; /** Skips portaling and modal body scroll lock; for anchored overlays. */ anchored?: boolean; font?: ElementFont; titleFont?: ElementFont; } /** * Low-level base component for modal and docked dialogs. * * Renders a backdrop and panel (via BoxBase), portaled to `#dialog-root` (created if * missing; see {@link renderPortal}) unless `docked` or `anchored`. * * * @param props Component properties. * @function * * @example * setOpen(false)} modal> * {children} * * * @example * * {children} * * * @category Base components */ export declare const DialogBase: React.ForwardRefExoticComponent>;