import "./dialog.css"; import React from "react"; import { Dialog as Base } from "@base-ui/react/dialog"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "@lotics/ui/style_props"; /** Provided by both Dialog and MasterDetailDialog. */ interface DialogNavigationContextValue { goBack: () => void; showBackButton: boolean; } export declare function useDialogNavigation(): DialogNavigationContextValue; /** Exported for MasterDetailDialog. */ export declare const DialogNavigationProvider: React.Provider; /** Merges DialogContext with ScreenRouterContext. */ export declare function useDialog(): { currentPath: string; navigate: (path: string, options?: { replace?: boolean | undefined; } | undefined) => void; goBack: () => void; canGoBack: boolean; params: Record; open: boolean; onOpenChange: (open: boolean) => void; }; export type DialogLength = number | `${number}%`; /** * `card`: centred over a scrim, sized by the five measurements. `takeover`: full-bleed with no * scrim, ignoring them. Never for a two-field form: a takeover leaves nowhere to look back at. */ export type DialogSurface = "card" | "takeover"; export interface DialogProps extends StyleProps { testID?: string; open?: boolean; onOpenChange?: (open: boolean) => void; defaultOpen?: boolean; children: React.ReactNode; surface?: DialogSurface; offsetTop?: number; /** * Default `90%`. A numeric width raises the {@link DIALOG_MAX_WIDTH} ceiling rather than being * clamped; an explicit `maxWidth` still wins. */ width?: DialogLength; height?: DialogLength; maxHeight?: DialogLength; /** {@link DIALOG_MAX_WIDTH} unless a numeric `width` asks for more. */ maxWidth?: DialogLength; /** Defaults to the default screen. */ initialRoute?: string; /** The nearest `PortalHost screen` by default (else `document.body`), so it covers and is sized by the * screen it opened on; name one only for a particular stacking context. */ container?: HTMLElement | null; /** Absent, the first focusable: the close control. */ initialFocus?: Base.Popup.Props["initialFocus"]; /** Absent, whatever had it — which a press that removed its own control no longer is. */ finalFocus?: Base.Popup.Props["finalFocus"]; ref?: React.Ref; render?: Base.Popup.Props["render"]; } /** * The reading measure. A default, not a clamp: a wider numeric `width` says the surface is not * prose. */ export declare const DIALOG_MAX_WIDTH = 786; /** * Dismissed by its close control or Escape, never the backdrop (`docs/frontend_design.md` § Dialogs * & Overlays), via Base UI's `disablePointerDismissal`. Always rendered with `open` toggled, so its * state survives a close and open order settles paint order between overlays. */ export declare function Dialog(props: DialogProps): React.JSX.Element; export interface DialogHeaderProps extends StyleProps { children: React.ReactNode; ref?: React.Ref; render?: useRender.RenderProp; } /** The back button appears with navigation history. */ export declare function DialogHeader(props: DialogHeaderProps): React.ReactElement>; export interface DialogHeaderTitleProps extends StyleProps { children: React.ReactNode; ref?: React.Ref; render?: useRender.RenderProp; } /** * Also the accessible name: `Dialog.Title` writes `aria-labelledby`. Inside a caller's own overlay * it is the text alone. */ export declare function DialogHeaderTitle(props: DialogHeaderTitleProps): React.ReactElement>; export interface DialogHeaderActionsProps extends StyleProps { children: React.ReactNode; ref?: React.Ref; render?: useRender.RenderProp; } export declare function DialogHeaderActions(props: DialogHeaderActionsProps): React.ReactElement>; export interface DialogScrollAreaProps extends StyleProps { children: React.ReactNode; /** * For a pane that swaps its body in place (see `DrawerScrollArea`); navigated `Screen`s keep * their own. */ scrollKey?: string; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } export declare function DialogScrollArea(props: DialogScrollAreaProps): React.JSX.Element; export interface DialogFooterProps extends StyleProps { children: React.ReactNode; /** * `end` (default): commit last, Reset or Cancel before it. `start` for a footer that reports. * `space-between` is `composition.md`'s two-group bar. */ align?: "start" | "end" | "space-between"; ref?: React.Ref; render?: useRender.RenderProp; } /** * The pinned action row outside {@link DialogScrollArea}: a commit in the body is a Save below the * fold (`composition.md` § Commit & feedback surfaces). */ export declare function DialogFooter(props: DialogFooterProps): React.ReactElement>; export {};