import type { ReactElement, ReactNode, RefObject } from 'react'; import type { AsChildProps } from '../utils/AsChildProps'; import type { SetVisibilitiesReturn } from './Truncator.helpers'; import { setVisuallyHidden } from './Truncator.helpers'; /** * Sets the visibility of items in a vertical truncator based on height overflow. * Hides items from bottom-up when content exceeds container height. * * @param containerRef - Reference to the container element * @param moreIndicatorRef - Reference to the "more" indicator element * @param itemSelector - CSS selector for items to consider for truncation * @param protectedItemSelector - CSS selector for items that should never be hidden * @param expandable - Whether the truncator can be expanded to show all items * @param isExpanded - Current expanded state * @param showMoreIndicatorTooltip - Whether to show the "more" indicator tooltip * @param setHiddenCount - Callback to update the count of hidden items * @returns Object containing hidden count, hidden elements, and any errors */ declare const setVisibilitiesVertical: ({ containerRef, moreIndicatorRef, itemSelector, protectedItemSelector, expandable, isExpanded, setHiddenCount, }: { containerRef: RefObject | undefined; itemSelector?: string; protectedItemSelector?: string; moreIndicatorRef: RefObject | undefined; expandable: boolean; isExpanded: boolean; setHiddenCount: (num: number) => void; }) => SetVisibilitiesReturn; /** * Base component for vertical truncation. Use `TruncatorBlockV` instead for automatic context setup. * * @param className - Additional CSS classes for the container * @param moreIndicator - React element to show when items are hidden (should include TruncatorMoreCount) * @param showMoreIndicatorTooltip - Whether to show a tooltip when hovering over the more indicator * @param expandable - Whether clicking the more indicator expands to show all items * @param items - Array of items to display, each with an element and label * @param asChild - Whether to render as child element instead of default div * @param children - Child element to render when asChild is true */ declare const TruncatorBlockVBase: import("react").ForwardRefExoticComponent<({ /** Additional CSS classes for the container */ className?: string; /** React element to show when items are hidden (should include TruncatorMoreCount) */ moreIndicator: ReactElement; /** Whether to show a tooltip when hovering over the more indicator */ showMoreIndicatorTooltip?: boolean; /** Whether clicking the more indicator expands to show all items */ expandable?: boolean; /** Array of items to display, each with an element and label */ items: { element: ReactElement; label: ReactNode; }[]; } & AsChildProps, HTMLUListElement>, "ref">>) & import("react").RefAttributes>; /** * A vertical truncator component that intelligently hides overflowing items when content * exceeds the container's height. Displays a "more" indicator showing the count of hidden items. * * **Key Features:** * - Height-based overflow detection (`clientHeight < scrollHeight`) * - Bottom-up truncation (always hides items from bottom first) * - Optional expandable behavior to show all items * - Tooltip showing hidden items (non-expandable) or "Show more" (expandable) * - Full flex-col layout support for vertical stacking * * **Container Requirements:** * - Must have a defined height constraint (e.g., `h-[200px]`, `max-h-96`) * - Should use `flex flex-col` layout for proper vertical stacking * - Consider adding `overflow-hidden` to parent container * * @example * Basic usage with height constraint * ```tsx * Item 1 }, * { label: 'Item 2', element:
Item 2
} * ]} * moreIndicator={} * expandable={true} * className="h-[200px]" * /> * ``` * * @example * Vertical tag list * ```tsx *
* ({ * label: tag, * element: {tag} * }))} * moreIndicator={+ more} * /> *
* ``` * * @example * Expandable navigation menu * ```tsx *
* ({ * label: item, * element: * }))} * moreIndicator={} * expandable={true} * /> *
* ``` */ declare const TruncatorBlockV: import("react").ForwardRefExoticComponent