import { FloatingContext, FloatingFocusManager, OffsetOptions, Placement, ReferenceType, Strategy, UseRoleProps } from '@floating-ui/react'; import { default as React } from 'react'; export type TooltipOpenWith = 'click' | 'hover'; export declare const ARROW_HEIGHT = 7; export declare const ARROW_WIDTH = 14; export declare const GAP = 3; export declare const DEFAULT_TOOLTIP_OFFSET: number; export interface TooltipProviderProps { /** * TooltipTrigger and Tooltip components */ children: React.ReactNode | React.ReactNode[]; /** * Placement of tooltip * @default bottom */ placement?: Placement; /** * Adds correct event listeners that change the open state * @default hover */ openWith?: TooltipOpenWith; /** * Props passed to FloatingFocusManager */ focusManager?: Omit, 'context' | 'children'>; /** * Should Tooltip be initially shown. Won't work with open and onToggle. * @default false */ defaultOpen?: boolean; /** * Should the Tooltip be open or closed. * Use to handle state outside of component, should use with onToggle prop. */ open?: boolean; /** * Callback when Tooltip is toggled. * Use to handle state outside of component, should use with open prop. */ onToggle?: (open: boolean) => void; /** * Changes aria attributes on trigger and tooltip based on the components role * @default tooltip */ role?: UseRoleProps['role']; /** * Allows to overwrite offSet options. * Used to align HeaderDropdown with bottom of the Header. * @default GAP + ARROW_HEIGHT (3px + 7px) */ offset?: OffsetOptions; } export interface ITooltipContext { open: boolean; isMounted: boolean; openWith: TooltipOpenWith; focusManager?: TooltipProviderProps['focusManager']; reference: (node: ReferenceType | null) => void; floating: (node: HTMLElement | null) => void; arrowRef: React.MutableRefObject; x: number | null; y: number | null; strategy: Strategy; getReferenceProps: (userProps?: React.HTMLProps | undefined) => Record; getFloatingProps: (userProps?: React.HTMLProps | undefined) => Record; arrow?: { x?: number | undefined; y?: number | undefined; centerOffset?: number | undefined; }; placement: Placement; context: FloatingContext; } export declare const TooltipContext: React.Context; export declare const TooltipProvider: (props: TooltipProviderProps) => JSX.Element; export default TooltipProvider;