import type { CSSProperties, HTMLAttributes, ReactNode, Ref } from 'react';
import type { TooltipPlacement } from './types';
export type TooltipRenderProps = Pick, 'onBlur' | 'onFocus' | 'onKeyDown' | 'onMouseLeave' | 'onMouseMove' | 'onPointerDown' | 'onPointerEnter' | 'aria-describedby' | 'aria-labelledby'> & {
ref?: Ref;
};
export type TooltipProps = {
/**
* id of the tooltip element
*/
id?: string;
/**
* The trigger element of the tooltip. If a function is provided, it receives
* the props (including `aria-describedby`, event handlers and `ref`) to spread
* on the trigger element.
*/
children: ReactNode | ((renderProps: TooltipRenderProps) => ReactNode);
/**
* max-width of the tooltip element
*/
maxWidth?: number | string;
/**
* Content of the tooltip, preferably text inside. When omitted, no tooltip is rendered.
*/
text?: ReactNode;
/**
* Preferred placement for the Tooltip.
* If there is not enough space, the direction will be flipped so that the Tooltip stays visible.
* @default 'top'
*/
placement?: TooltipPlacement;
/**
* Force the tooltip to be visible. When set, the tooltip is controlled and won't react to hover/focus.
*/
visible?: boolean;
/**
* className added on the tooltip element
*/
className?: string;
/**
* @deprecated use relation instead
*/
role?: string;
/**
* Role of the tooltip in relation to its reference element
* - use "description" only if the reference element already has an accessible label
* - use "label" if the tooltip text should be the label of the reference element
* @default 'description'
*/
relation?: 'description' | 'label';
'data-testid'?: string;
/**
* It will add `width: 100%` to the tooltip trigger container.
*/
containerFullWidth?: boolean;
/**
* It will add `height: 100%` to the tooltip trigger container.
*/
containerFullHeight?: boolean;
/**
* Render the tooltip in a portal target if you need it to overflow from a scroll container, at the cost of a small lag of the tooltip behind its reference element when scrolling.
* @default document.body
*/
portalTarget?: HTMLElement | null;
/**
* tabindex attribute for the tooltip trigger container
*/
tabIndex?: number;
/**
* Delay (in ms) before the tooltip opens and closes.
* @deprecated Use `delay` instead to have more control over opening and closing delays.
*/
debounceDelay?: number;
/**
* Open and close delay (in ms) for the tooltip.
*/
delay?: {
open?: number;
close?: number;
};
/**
* @deprecated The animation cannot be disabled
*/
disableAnimation?: boolean;
/**
* style added on the tooltip element
*/
style?: CSSProperties;
/**
* Called when the tooltip visibility changes (open/close, including Escape dismiss).
*/
onOpenChange?: (open: boolean) => void;
};
export declare const DEFAULT_DELAY: {
close: number;
open: number;
};
export declare function Tooltip({ children, text, placement, id, className, containerFullWidth, containerFullHeight, maxWidth, visible, 'data-testid': dataTestId, portalTarget, relation, debounceDelay, delay, tabIndex, style, onOpenChange, }: TooltipProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable | Promise | import("react").ReactElement> | import("react").ReactPortal | null | undefined> | null | undefined;
export declare namespace Tooltip {
var displayName: string;
}
//# sourceMappingURL=index.d.ts.map