import * as React from 'react'; /** * Lets the shell's rails glide open and closed instead of snapping. * * `react-resizable-panels` stores a layout as `flex-grow` per panel and writes * it inline, so mounting or unmounting a rail lands the new widths in a single * frame. Nothing about that is animatable from the rail's side — the panel * appears already at its final size — but the row's other panels do change an * animatable property, and interpolating theirs is enough: while main's * `flex-grow` travels, the rail's share of the row grows with it, which reads as * the rail sliding open. * * The transition is armed by an attribute that is present from first render, * because a transition can only animate a change to a property that already had * a value. Arming it later from an effect is too late: panels register in a * layout effect that runs before any parent effect, so the widths are already * written by the time a parent could add a class. * * Two situations must disarm it, and this hook owns both: * * - **A separator drag.** The pointer is the animation. Interpolating on top of * it adds 200ms of lag to every pixel and re-lays out the hub on frames the * user did not ask for. * - **A window resize burst.** Every resize event nudges each panel's grow, so * an armed transition turns a window drag into a rubber-band that trails the * frame behind the cursor. * * Interpolating width does cost a layout per frame — measured at roughly 22fps * on a hub carrying a full `HubTable`, against a single layout for a snap. That * is the deliberate trade: the shell reads as connected motion, and the cost is * bounded to the 200ms the rail is moving. * * @see globals.css — the `[data-rail-transition]` rule this arms */ /** Matches the sidebar's own width transition, so the shell moves as one. */ declare const RAIL_TRANSITION_MS = 200; type RailLayoutTransitionProps = { elementRef: React.RefObject; "data-rail-transition": "armed"; }; /** Spread the result onto the `ResizablePanelGroup` holding the rails. */ declare function useRailLayoutTransition(): RailLayoutTransitionProps; export { RAIL_TRANSITION_MS, type RailLayoutTransitionProps, useRailLayoutTransition };