import { CommonProps, Refable, type Styleable } from "@trackunit/react-components"; import { MouseEventHandler, ReactElement, ReactNode } from "react"; type MultiValueTextCellBaseProps = CommonProps & Refable & Styleable & { /** * Icon rendered to the left of the text. * Provides visual context for the primary value. */ icon?: ReactElement; /** * Tooltip text for the icon. * If omitted, the icon tooltip is disabled. * When `unifiedTooltip` is true and the unified cell tooltip is active, `iconTooltip` is * suppressed so only the unified tooltip is shown (including over the icon). */ iconTooltip?: string; /** * The first (primary) value displayed as plain text in the cell. * The text is truncated to fit the cell and, when clipped, is shown in a tooltip. */ content?: string; /** * Total number of values. * - The component renders only when count > 0. * - If count > 1, a +N badge is shown where N = count - 1. */ count?: number | null; }; type MultiValueTextCellDefaultProps = MultiValueTextCellBaseProps & { /** * Tooltip content for the +N badge. * Accepts strings, React elements, or any ReactNode. * If omitted, the badge tooltip is disabled. * Recommended: use the `ListTooltip` component to render a list of the remaining items. */ countTooltip?: ReactNode; /** * Mouse enter handler for lazy-loading tooltip content (e.g., fetching the remaining items). * Runs on the +N badge by default; when `unifiedTooltip` is true, runs on the cell wrapper instead * (fires once when the cell is first entered). */ onMouseEnter?: MouseEventHandler; /** * When true, primary text, the optional icon, and the +N badge share one tooltip over the * whole cell. When false, separate tooltips are shown on the truncated content, icon, and +N badge. * When true, `iconTooltip` is not shown while the unified tooltip is active. * Defaults to false. */ unifiedTooltip?: false; }; type MultiValueTextCellUnifiedProps = MultiValueTextCellBaseProps & { /** * Tooltip content for the unified cell tooltip and the +N badge (when `unifiedTooltip` is false). * Required when `unifiedTooltip` is true and `count` > 1 (unless lazy-loading via `onMouseEnter`). * When `count` is 1 and the primary text is truncated, `content` is used if `countTooltip` is omitted. */ countTooltip?: ReactNode; /** * Mouse enter handler for lazy-loading tooltip content (e.g., fetching the remaining items). * Runs on the cell wrapper (fires once when the cell is first entered). */ onMouseEnter?: MouseEventHandler; /** * When true, primary text, the optional icon, and the +N badge share one tooltip over the * whole cell. `iconTooltip` is not shown while the unified tooltip is active. */ unifiedTooltip: true; } & ({ count: 1; } | { countTooltip: ReactNode; } | { onMouseEnter: MouseEventHandler; }); /** * When `unifiedTooltip` is true and `count` is not the literal `1`, provide `countTooltip` or `onMouseEnter`. */ export type MultiValueTextCellProps = MultiValueTextCellDefaultProps | MultiValueTextCellUnifiedProps; /** * The `` component is used for displaying the text values with multiple values in a table cell. First element is displayed as a text, the rest of the values are displayed as a number. Icon can be passed as an optional prop. * The text content is not editable and will be truncated if the cell is too narrow. * * @param {MultiValueTextCellProps} props - The props for the MultiValueTextCell component * @returns {ReactElement} MultiValueTextCell component */ export declare const MultiValueTextCell: ({ content, count, countTooltip, icon, iconTooltip, "data-testid": dataTestId, className, onMouseEnter, ref, style, unifiedTooltip, }: MultiValueTextCellProps) => import("react/jsx-runtime").JSX.Element | null; export {};