import React from 'react'; import { type TooltipPlacement } from './Tooltip.js'; export type TruncatedTextOverflow = 'tooltip' | 'expand'; export interface TruncatedTextProps { /** * The whole text. Plain text only: it is what the tooltip shows, and a * link or a button inside a cut line would be cut with it. */ children: string; /** Lines shown before the text is cut. Default 1. */ lines?: number; /** * How the rest is reached once the text is cut. * * `tooltip` — the cut text becomes a tab stop and shows the whole text on * hover and on focus. For short text in a narrow place: a table cell, a * card's subtitle. * * `expand` — a Show more button below it opens the text in place. For a * paragraph, which a tooltip is too small to hold. */ overflow?: TruncatedTextOverflow; /** `expand` only. Default "Show more". */ showMoreLabel?: string; /** `expand` only. Default "Show less". */ showLessLabel?: string; /** `tooltip` only: where the tooltip sits. Default `top`. */ placement?: TooltipPlacement; className?: string; } /** * TruncatedText — long text cut to its space, with the whole of it still * reachable. * * NOT HOVER ONLY. A `title` attribute, or a tooltip on hover, leaves the rest * of the text to mouse users. Here a cut line is also a tab stop that opens * the same tooltip on focus, and a cut paragraph has a real Show more button. * * ONLY WHEN IT IS CUT. It measures itself, and while the text fits it is * plain text: no tab stop, no tooltip, no button. A narrower window can cut * it later; it measures again when its size changes. * * THE WHOLE TEXT IS ALWAYS THERE. It is cut by CSS, not by dropping * characters, so a screen reader reads all of it, find-in-page finds it, and * a copy copies it. The tooltip repeats text already read, so it is kept out * of the accessible description rather than read twice. * * IT INHERITS THE FONT. It sits inside whatever sets the type — a caption, a * table cell — and takes its size, weight and colour. */ export declare const TruncatedText: React.ForwardRefExoticComponent>; //# sourceMappingURL=TruncatedText.d.ts.map