import { ComponentPropsWithoutRef, MouseEvent } from 'react'; import { DataTrackingId, LayoutUtilProps } from '../../types'; /** * Props for the OverflowText component * @extends ComponentPropsWithoutRef<"div"> * @extends LayoutUtilProps */ export type OverflowTextProps = ComponentPropsWithoutRef<"div"> & LayoutUtilProps & { /** * Number of rows to display before truncation * @default 1 */ rows?: number | "unlimited"; } & ({ /** * Whether the text is expandable * @default false */ expandable?: false; /** * Text for expand button (not used when expandable is false) */ expandText?: never; /** * Text for collapse button (not used when expandable is false) */ collapseText?: never; /** * Callback for expand event (not used when expandable is false) */ onExpand?: never; /** * Callback for collapse event (not used when expandable is false) */ onCollapse?: never; } | { /** * Whether the text is expandable */ expandable: true; /** * Text to display on the expand button * @default "Show more..." */ expandText?: string; /** * Text to display on the collapse button * @default "Show less..." */ collapseText?: string; /** * Callback fired when content is expanded */ onExpand?: (e: MouseEvent) => void; /** * Callback fired when content is collapsed */ onCollapse?: (e: MouseEvent) => void; }) & DataTrackingId; /** * OverflowText component for text content with line truncation and expansion. * * Features: * - Configurable line limit with row-based truncation * - Expandable content with custom expand/collapse text * - Automatic height calculation and overflow detection * - Keyboard navigation support for focusable elements * - Resize observer for dynamic content changes * - Accessibility features with proper focus management * - Support for unlimited rows or specific row limits * - Callback support for expand/collapse events * - Layout utility props support * * @example * * * This is a long text that will be truncated to 3 rows * and can be expanded to show the full content. * * */ export declare const OverflowText: import('react').ForwardRefExoticComponent>;