import * as React from 'react'; import { FloatingWindowRect, FloatingWindowViewport } from '../../lib/floating-window.js'; export { FLOATING_WINDOW_CORNERS, FLOATING_WINDOW_DEFAULT_HEIGHT, FLOATING_WINDOW_DEFAULT_WIDTH, FLOATING_WINDOW_INSET, FLOATING_WINDOW_MIN_HEIGHT, FLOATING_WINDOW_MIN_WIDTH, FLOATING_WINDOW_NUDGE, FLOATING_WINDOW_NUDGE_COARSE, FloatingWindowCorner, FloatingWindowResizeHandle, clampFloatingWindowRect, defaultFloatingWindowRect, moveFloatingWindowRect, nudgeFloatingWindowSize, readFloatingWindowViewport, resizeFloatingWindowRect, snapFloatingWindowRect, snapFloatingWindowToNextCorner } from '../../lib/floating-window.js'; /** * FloatingWindow — non-modal, movable, resizable tool window. * * Deliberately **not** a `` / `showModal()`: the page behind stays live * (work-alongside), and Radix overlays at z-50 must paint above this chrome * (tooltips, menus). Portal to `document.body` at z-40. * * Chrome matches the DS floating-sheet contract (`FLOATING_SHEET_CHROME_CLASS`) * with freer `rounded-2xl` corners (all four visible when floating). * * Keyboard parity (P6): grip is focusable — arrows move, Alt+arrows resize, * Shift takes coarse steps; click / activate snaps to the next corner. * * @see lib/floating-window.ts — rect clamping shared by drag, resize, and keys */ type FloatingWindowProps = { /** When false, nothing is portaled. Default true. */ open?: boolean; /** Keeps the tree mounted but hides + unfocuses (e.g. minimize). */ hidden?: boolean; /** * Stored rect, or `null` to use `defaultRect`. Clamped against the live * viewport on every render so a laptop never inherits a 32" position. */ rect: FloatingWindowRect | null; onRectChange: (rect: FloatingWindowRect) => void; /** Factory when `rect` is null. Defaults to bottom-right. */ defaultRect?: (viewport: FloatingWindowViewport) => FloatingWindowRect; minWidth?: number; minHeight?: number; inset?: number; /** Leading identity / title block (next to the grip). */ title: React.ReactNode; /** * Double-click on the title region. A pointer shortcut only: whatever it * opens MUST also be reachable from a menu or button, or keyboard users lose * the action entirely (P6). */ onTitleDoubleClick?: React.MouseEventHandler; /** Trailing header actions (before optional built-in chrome). */ toolbar?: React.ReactNode; children: React.ReactNode; "aria-label": string; dataSlot?: string; className?: string; style?: React.CSSProperties; /** Esc when focus is inside. Non-modal — does not steal page Esc. */ onEscape?: () => void; gripAriaLabel?: string; gripTooltip?: string; /** * When true (default), a grip click (without drag) cycles corner snap. * Set false for free-move windows that only clamp to the viewport. */ cornerSnap?: boolean; /** Portal target; defaults to `document.body`. */ container?: Element | DocumentFragment | null; }; declare function FloatingWindow({ open, hidden, rect: storedRect, onRectChange, defaultRect, minWidth, minHeight, inset, title, onTitleDoubleClick, toolbar, children, "aria-label": ariaLabel, dataSlot, className, style, onEscape, gripAriaLabel, gripTooltip, cornerSnap, container, }: FloatingWindowProps): React.ReactPortal | null; export { FloatingWindow, type FloatingWindowProps, FloatingWindowRect, FloatingWindowViewport };