liber-salti
Version:
Saltí - Liber Design System
83 lines (82 loc) • 2.88 kB
TypeScript
/// <reference types="react-addons-linked-state-mixin" />
import { TooltipClassKey } from '@mui/material/Tooltip';
import { SyntheticEvent } from 'react';
import { StandardProps } from 'types';
export interface TooltipProps extends StandardProps<React.HTMLAttributes<HTMLDivElement>, TooltipClassKey, 'title'> {
/**
* If `true`, adds an arrow to the tooltip.
*/
arrow?: boolean;
/**
* Tooltip reference element.
*/
children: React.ReactElement<any, any>;
/**
* Do not respond to focus events.
*/
disableFocusListener?: boolean;
/**
* Do not respond to hover events.
*/
disableHoverListener?: boolean;
/**
* Do not respond to long press touch events.
*/
disableTouchListener?: boolean;
/**
* The number of milliseconds to wait before showing the tooltip.
* This prop won't impact the enter touch delay (`enterTouchDelay`).
*/
enterDelay?: number;
/**
* The number of milliseconds to wait before showing the tooltip when one was already recently opened.
*/
enterNextDelay?: number;
/**
* The number of milliseconds a user must touch the element before showing the tooltip.
*/
enterTouchDelay?: number;
/**
* This prop is used to help implement the accessibility logic.
* If you don't provide this prop. It falls back to a randomly generated id.
*/
id?: string;
/**
* Makes a tooltip interactive, i.e. will not close when the user
* hovers over the tooltip before the `leaveDelay` is expired.
*/
interactive?: boolean;
/**
* The number of milliseconds to wait before hiding the tooltip.
* This prop won't impact the leave touch delay (`leaveTouchDelay`).
*/
leaveDelay?: number;
/**
* The number of milliseconds after the user stops touching an element before hiding the tooltip.
*/
leaveTouchDelay?: number;
/**
* Callback fired when the component requests to be closed.
*
* @param {object} event The event source of the callback.
*/
onClose?: (event: Event | SyntheticEvent<Element, Event>) => void;
/**
* Callback fired when the component requests to be open.
*
* @param {object} event The event source of the callback.
*/
onOpen?: (event: Event | SyntheticEvent<Element, Event>) => void;
/**
* If `true`, the tooltip is shown.
*/
open?: boolean;
/**
* Tooltip placement.
*/
placement?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
/**
* Tooltip title. Zero-length titles string are never displayed.
*/
title: NonNullable<React.ReactNode>;
}