UNPKG

@devopness/ui-react

Version:

Devopness Design System React Components - Painless essential DevOps to everyone

44 lines (43 loc) 1.41 kB
import { TooltipProps } from '@mui/material/Tooltip'; import { Unwrap } from '../../types'; type Nullable<T extends object> = { [K in keyof T]: T[K] | null | undefined; }; type TooltipComponentProps = Unwrap<{ /** * Tooltip reference element. */ children: React.ReactNode; /** * Define component styles */ styles?: { /** * Tooltip background color. * (Does not work with JSX children) */ backgroundColor?: string; /** * font color */ color?: string; }; /** * If `true`, hover in the tooltip is disabled. */ disableHover?: boolean; /** * If `true`, hover in the tooltip is disabled and enabled only when the * element reaches the limit of the width of the contained element. */ enableOnlyWithEllipsisPoints?: boolean; /** * It should be defined when the component is going to be used * in the controlled way */ open?: boolean; } & Omit<TooltipProps, 'title' | 'children'> & Nullable<Pick<TooltipProps, 'title'>>>; /** Display informative text when users hover over a child element */ declare const Tooltip: ({ disableHover, enableOnlyWithEllipsisPoints, title, children, ...props }: TooltipComponentProps) => import("react/jsx-runtime").JSX.Element; export type { TooltipComponentProps as TooltipProps }; export { Tooltip };