/** * Overlay animation tokens (XC-11). * * Single JS source of truth that mirrors the CSS custom properties in * `style/interaction.css`. Svelte transitions need numeric inputs at the * call site, so we expose the same values as constants here and as * runtime getters that read the live CSS custom property — useful when * a consumer overrides a token via `BlocksProvider` or a theme. * * Components should call `getOverlayMotion()` (returns the resolved * numeric values for the current document) over hard-coding numbers. * The optional `override` argument carries per-instance values from a * component's `transitionDuration` / `transitionEasing` props. * * Reduced motion: `getOverlayMotion()` reads the live CSS — so the * `@media (prefers-reduced-motion: reduce)` branch in `interaction.css` * automatically collapses durations and distances to zero. Components * never need to consult the media query themselves. */ export type EasingFn = (t: number) => number; export interface OverlayMotion { /** Enter duration in ms (panel + backdrop). */ enterDuration: number; /** Exit duration in ms (panel + backdrop). */ exitDuration: number; /** Backdrop enter duration in ms — usually = enterDuration. */ backdropEnterDuration: number; /** Backdrop exit duration in ms — usually = exitDuration. */ backdropExitDuration: number; /** Easing for panel and backdrop transitions. */ easing: EasingFn; /** Panel scale-in start value (0..1). 1 disables the scale effect. */ panelScaleStart: number; /** Panel fly-in distance in px (translated along the placement axis). */ panelFlyDistance: number; } export interface OverlayMotionOverride { enterDuration?: number; exitDuration?: number; backdropEnterDuration?: number; backdropExitDuration?: number; easing?: EasingFn; panelScaleStart?: number; panelFlyDistance?: number; } /** Defaults mirror the CSS custom properties in `interaction.css`. */ export declare const OVERLAY_MOTION_DEFAULTS: OverlayMotion; /** * Longest `transition-duration` currently applying to an element, in ms. * * Used by Popover's exit-motion lag: the panel's CSS transition (token-driven, * per-instance-overridable, collapsed by reduced motion) is the single source * of truth for how long closed content must stay mounted, so the lag is read * from the live computed style instead of duplicating the token resolution in * JS. Returns `0` when the element is missing, has no transition, or the * environment has no CSS engine (SSR, jsdom) — callers then tear down * synchronously, which keeps unstyled consumers and node tests on the * pre-motion behaviour. * * `transition-duration` computes to a comma list (one entry per transition * property); the max governs because the exit isn't over until the slowest * property lands. */ export declare function maxTransitionDurationMs(el: Element | null | undefined): number; /** * Read the current overlay motion settings. * * SSR-safe: when `window` is unavailable, returns the static defaults. * Easing is not read from CSS (no portable cross-browser parse of * `cubic-bezier()` arguments) — it stays at the JS default and can be * overridden per-instance via the `override` argument. */ export declare function getOverlayMotion(override?: OverlayMotionOverride): OverlayMotion;