UNPKG

@funkit/connect

Version:

Funkit Connect SDK elevates DeFi apps via web2 sign-ins and one-click checkouts.

38 lines (37 loc) 1.88 kB
import React, { type ReactNode } from 'react'; import { type BoxProps } from '../Box/Box'; export interface FunTooltipProps { content: ReactNode; children?: ReactNode; wrapperElementRef?: React.RefObject<HTMLDivElement>; /** Renders the open tooltip based on available horizontal space, ie. ignoring the `tooltipPosition` prop, * if the tooltip were to overflow beyond the boundaries of the provided `wrapperElementRef` element * it renders either to the left or right side based on available horizontal space */ enableDynamicPositioning?: boolean; /** * To be expanded as needed, currently supports these positions: * center: above children,center * left: left of children, center * right: above children, right */ tooltipPosition?: 'center' | 'left' | 'right'; /** * Bottom offset of the tooltip from the children element, by default it is 6px * This is used to adjust the tooltip position when it is rendered in the center */ bottomOffset?: boolean; maxWidth?: number; /** Whether to display the tooltip on hover or after clicking */ displayType?: 'hover' | 'click'; /** * Delay after which the tooltip is hidden. Defaults to 150ms * Based on display type the countdown starts immediately ('click') or after no longer hovering ('hover') */ hideDelay?: number; /** * Delay before the tooltip is shown. Defaults to 0ms. Primarily used when displayType is set to hover and we want to prevent multiple tooltips from being visible due to rapid mouse movements. */ startDelay?: number; width?: BoxProps['width']; } export declare const FunTooltip: ({ content, children, wrapperElementRef, tooltipPosition, enableDynamicPositioning, bottomOffset, maxWidth, displayType, hideDelay, startDelay, width, }: FunTooltipProps) => React.JSX.Element;