import React from 'react'; export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right'; export interface TooltipProps extends Omit, 'title' | 'children' | 'className'> { /** * The hint. A tooltip is text only — anything interactive or focusable * belongs in a popover, because a tooltip cannot be focused, cannot be * scrolled, and closes the moment the pointer leaves. */ label: React.ReactNode; /** Optional heading above the label. */ title?: React.ReactNode; /** * Matches the Figma `Placement` variant, and names where the TOOLTIP sits — * not where the arrow points. `top` is above the trigger, with the arrow on * the tooltip's bottom edge. * * Treated as a preference, not a guarantee: it flips to the opposite side * when there is no room, which is the behaviour Figma cannot draw. */ placement?: TooltipPlacement; /** Milliseconds before it opens on hover. Focus always opens immediately. */ delay?: number; /** Disable the tooltip without unmounting the trigger. */ isDisabled?: boolean; /** * Whether the tooltip is the trigger's accessible description. Default * true. Set false only when the label repeats text the trigger already * contains — the full text of a truncated line — so a screen reader, which * reads the whole text anyway, does not hear it twice. */ describesTrigger?: boolean; /** The element the tooltip describes. Must accept a ref and DOM props. */ children: React.ReactElement; className?: string; /** * Passed to the trigger with any other props, merged with the tooltip's * own — so a Tooltip can itself be the child of a Popover or MenuTrigger, * which clones its child with a ref and trigger props. */ ref?: React.Ref; } /** * Tooltip — Figma `Tooltip` (801:1568). * * Wraps its trigger rather than taking a ref, so the common case is one * element deep: `