@thlmenezes/ui-react
Version:
Devopness Design System React Components - Painless essential DevOps to everyone
42 lines (41 loc) • 1.31 kB
TypeScript
import { TooltipProps } from '@mui/material/Tooltip';
type Nullable<T extends object> = {
[K in keyof T]: T[K] | null | undefined;
};
type TooltipComponentProps = {
/**
* 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 { Tooltip };