UNPKG

@cimpress/react-components

Version:
67 lines 2.25 kB
import React, { Component, CSSProperties, ReactNode } from 'react'; import { Direction } from './common'; import { PublicComponentProps } from './types'; type ContraintsTo = string | 'window' | 'scrollParent' | HTMLElement; type Constraints = { to?: ContraintsTo; attachment?: string | 'together'; outOfBoundsClass?: string; pinnedClass?: string; pin?: boolean | string[]; }; export interface TooltipProps extends PublicComponentProps { /** * DOM node for the tooltip to appear anchored to. */ children: ReactNode; /** * Allows the user to completely override the Tether constraints array for uniquely positioned tooltips. See the Tether.io documenation here. */ constraints?: Constraints[]; /** * Can be used to add class names to the tooltip target container. */ containerClassName?: string; /** * Contents for the tooltip. */ contents?: ReactNode; /** * One of top, right, bottom, or left, tells the tooltip which direction to default to. */ direction?: Direction; /** * Delay (in milliseconds) after which the tooltip will be shown. */ delay?: number; /** * If provided, a function to be called when a click occurs outside of this component. */ onClickOutside?: () => void; /** * Can be used to customize when the tooltip displays. If this prop is used, the default mouseover behavior will be disabled. */ show?: boolean; /** * Can be used to add styles to the tooltip component. */ tooltipStyle?: CSSProperties; /** * Can be used to add styles to the tooltip component. */ tooltipInnerStyle?: CSSProperties; /** * Controls the appearance. One of tooltip or popover. (Deprecated. Use `variant` instead.) */ variety?: string; variant?: 'tooltip' | 'popover'; } declare class TooltipHOC extends Component<TooltipProps> { private el; handleClickOutside: (e: any) => void; setElement: (el: React.RefObject<HTMLDivElement>) => void; render(): JSX.Element; } export declare const Tooltip: import("react-onclickoutside").WrapperClass<TooltipProps, typeof TooltipHOC>; export {}; //# sourceMappingURL=Tooltip.d.ts.map