import * as React from "react"; /** * A tab you cannot see is a tab you cannot use. The fix observes the strip (size changes) and its * triggers (`data-state` changes) and scrolls the element that must stay reachable back into view. */ /** Minimal rect shape — only the edges the visibility test needs. */ export type TabsScrollBox = { left: number; right: number; top: number; bottom: number; }; /** * True when `trigger` sits entirely inside the `scrollport` box. Pure geometry — physical viewport * coordinates, so it is direction- and orientation-agnostic (LTR, RTL, vertical rail alike). */ export declare function isTabFullyVisible(scrollport: TabsScrollBox, trigger: TabsScrollBox): boolean; /** * The trigger the strip must keep reachable: the focused trigger when the roving focus is inside * this list (manual activation can park focus off the selected tab), otherwise the active one. */ export declare function resolveTabScrollTarget(list: HTMLElement): HTMLElement | null; /** `true` when the user has asked for reduced motion (falsy/unsupported environments say no). */ export declare function prefersReducedMotion(): boolean; /** * Scrolls the list's keep-visible target back into the scrollport when — and only when — it is not * already fully inside it. Returns the element it scrolled, or `null` when nothing needed doing * (which is the common case, and what keeps this from fighting a deliberate user scroll). */ export declare function syncActiveTabIntoView(list: HTMLElement | null, behavior?: ScrollBehavior): HTMLElement | null; /** * Resize corrections are instant; a selection change animates unless reduced motion is requested. * Both observers are optional: without them (SSR, ancient runtimes) the component degrades to the * pre-fix behaviour instead of throwing. */ export declare function useKeepActiveTabVisible(listRef: React.RefObject): void; /** * The values of the triggers that are NOT fully inside the strip's scrollport, in document order. * * Pure apart from the two rect reads — `values` is the `items` array's own order, and the triggers * are matched to it by INDEX rather than by DOM id: `TabsTrigger` hands its `value` to React Aria * as the collection KEY, and the rendered `id` attribute is RAC-generated, so the element carries * no readable handle back to the item it came from. * * This is the measurement behind `overflow="menu"`. It is separated from the hook below so it can * be exercised on plain numbers — jsdom lays nothing out, so the only honest unit assertions about * it are the ones that hand it real geometry. */ export declare function resolveHiddenTabValues(list: HTMLElement, values: readonly string[]): string[]; /** * The LOGICAL scroll offset of a strip: how far it has moved from its own start edge, growing * towards `end` on whichever axis the strip is on and in whichever direction it is written. * * `scrollLeft` cannot be read raw. Per CSSOM-View an RTL scroller reports `0` at its START edge * (the right one) and goes NEGATIVE towards the end, so "scrollLeft went up" means opposite things * in the two directions — exactly the bug `start`/`end` exist to prevent, and it would have been * invisible in an LTR test suite. */ export declare function readTabsScrollOffset(list: HTMLElement, vertical: boolean): number; /** * Ant Design `onTabScroll`'s one piece of logic: which edge a movement of the scroll offset went * towards. `null` when the offset did not move, so a scroll event that reports the same position * (momentum settling, a programmatic re-pin that was already in place) reports nothing. */ export declare function resolveTabsScrollDirection(previous: number, next: number): "start" | "end" | null; /** * Reports every real movement of the strip's own scrollport to `onScroll` — Ant Design * `onTabScroll`. The handler is held in a ref so a consumer's inline arrow function does not * re-arm the listener on every render (same contract as `useTabsOverflowValues` above). * * It reports a `scrollIntoView` re-pin too, and deliberately: antd's does the same, and "the strip * moved" is the fact a consumer is subscribing to — not "the user moved it". */ export declare function useTabsScrollReporter(listRef: React.RefObject, vertical: boolean, onScroll: ((info: { direction: "start" | "end"; }) => void) | undefined): void; /** * Keeps `onChange` fed with the values currently out of the scrollport, recomputing on the two * things that can move them: the strip resizing (a viewport change, a font swap, a tab added or * removed) and the strip scrolling (the user swiping, or `useKeepActiveTabVisible` re-pinning a * trigger). * * `values` is joined into the effect key rather than passed as a dependency, so a consumer that * rebuilds its `items` array on every render does not re-arm the observers on every render. * * The first measurement ALWAYS reports, even when nothing is hidden. Suppressing it looks harmless * and is not: on a remount the local `last` resets while the caller's state does not, so a strip * that had overflowed and then stopped would keep a stale menu forever. */ export declare function useTabsOverflowValues(listRef: React.RefObject, values: readonly string[] | undefined, onChange: (hidden: string[]) => void): void;