import { FloatingFocusManager } from '@floating-ui/react'; import { ComponentProps, ReactNode } from 'react'; import { BreakpointSupport } from '../../../../helpers'; export type ModalWidthPreset = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; export type ModalWidth = ModalWidthPreset | (string & Record); export type ModalSize = 'default' | 'small'; export type ModalPosition = 'center' | 'top' | 'right' | 'left' | 'bottom'; export type ModalScrollBehavior = 'content' | 'page'; export type ModalFullscreen = boolean | 'edge'; type ModalContentBreakpointProps = { /** * Modal width — a Figma-aligned preset (`xs`–`xl`) or any CSS length. * Use `maxWidth` when you only need to cap the width instead of set it. * @default md */ width?: ModalWidth; /** * Hard cap on width. Lightweight alternative to a custom `width`. * @default calc(100vw - 16px * 2) */ maxWidth?: string; /** * Placement on the viewport. * @default center */ position?: ModalPosition; /** * Fullscreen behaviour: * - `false` — content-sized modal inside the 16px backdrop padding. * - `true` — modal fills the overlay; 16px backdrop stays visible. * - `'edge'` — edge-to-edge; overlay padding removed, no border/radius. * @default false */ fullscreen?: ModalFullscreen; }; export interface ModalContentProps extends BreakpointSupport { /** * ``, ``, `` and any other content. */ children: ReactNode; /** * Size density — controls header/body/footer padding. * @default default */ size?: ModalSize; /** * Where overflow scrolls. `'content'` keeps the modal frame fixed and scrolls the body; * `'page'` lets the modal grow with content and scrolls the overlay around it. * @default content */ scrollBehavior?: ModalScrollBehavior; /** * Trap focus inside the modal while open. * @default true */ trapFocus?: boolean; /** * Restore focus to the trigger after closing. * @default true */ returnFocus?: boolean; /** * Render the dimmed backdrop. `false` keeps portal + focus management but no overlay. * @default true */ showOverlay?: boolean; /** * Lock background scroll while open. * @default true */ lockScroll?: boolean; /** * Render visually-hidden dismiss buttons at the start and end of the dialog * so touch screen-readers can escape without an Escape key. * @default false */ visuallyHiddenDismiss?: boolean; /** * Override the dialog's labelling element. Only needed when the label lives * outside `` — the header wires this automatically. */ 'aria-labelledby'?: string; /** * Override the dialog's describing element. Only needed when the description * lives outside `` — the header wires this automatically. */ 'aria-describedby'?: string; /** * Plain-text accessible name. Use when there's no visible title (icon-only * confirmation, etc.). Ignored when `aria-labelledby` is set. */ 'aria-label'?: string; /** * Element to focus on open. Tabbable index (`0` = first tabbable, `-1` = dialog * container) or a ref. Override the default to focus a "Cancel" button on * destructive prompts, or the first input on form-heavy modals. */ initialFocus?: ComponentProps['initialFocus']; /** * Additional class name on the modal container. */ className?: string; } export declare const ModalContent: { (props: ModalContentProps): JSX.Element | null; displayName: string; }; export default ModalContent;