import { SpaceProp, SpacingTokens } from "@marigold/system"; import { ReactNode } from "react"; import { AriaRegionProps } from "@marigold/types"; export interface OverflowRegionState { /** Total number of items in the region. */ count: number; /** Number of items that currently fit. */ visibleCount: number; /** Number of items that are currently hidden. */ hiddenCount: number; } export interface OverflowRegionProps extends AriaRegionProps { /** * Space between the items. Defaults to the spacing of a parent layout * component (e.g. ``), inherited through the `--space` * custom property, and falls back to the `related` token when the region * has no such parent. Set it explicitly to override. */ space?: SpaceProp['space']; /** * The items, in priority order: the trailing items are hidden first when * the region runs out of horizontal space. Hidden items are made inert * and removed from the accessibility tree, so every item must stay * reachable through another surface — a panel, menu, or the `indicator`. */ children: ReactNode; /** * Rendered after the last visible item while at least one item is * hidden. Use it to keep hidden items discoverable, e.g. a "More" menu * or a trigger for the surface that holds the full set. */ indicator?: ReactNode | ((state: OverflowRegionState) => ReactNode); /** * Called whenever the number of visible items changes. Use this when the * recovery surface lives outside the region, e.g. to badge a pinned * trigger with the hidden count. */ onOverflowChange?: (state: OverflowRegionState) => void; } /** * A single-row region that hides its trailing items instead of wrapping * when horizontal space runs out, and restores them as space returns. * * Place it inside any non-wrapping flex row (e.g. ``): it * takes up the remaining space between its pinned siblings and clips its * content. Items stay mounted when hidden — they keep their state and are * hidden from paint, tab order, and assistive technology. * * Hiding is not a recovery strategy by itself: pair the region with an * `indicator` or an external surface (via `onOverflowChange`) so hidden * items remain reachable. */ export declare const OverflowRegion: ({ space, children, indicator, onOverflowChange, ...props }: OverflowRegionProps) => import("react").JSX.Element;