import { default as React } from 'react'; import { ThemeTypes } from '@viasat/beam-shared/utils'; import { Placement } from '@floating-ui/utils'; import { AutoPlacementOptions, FlipOptions, FloatingPortalProps, HideOptions, ShiftOptions, UseFloatingOptions, UseRoleProps } from '@floating-ui/react'; import { MiddlewareModifier } from '@viasat/beam-shared/components/floatingui'; import { TooltipTriggerSize } from '@viasat/beam-shared/components/tooltip'; import { FloatingUIProps } from '../FloatingUI/FloatingUI.context'; export interface TooltipProps extends Omit { /** * Specify the theme of the Tooltip. By default it inherits the theme from the parent */ theme?: ThemeTypes; /** * The content of Tooltip */ text: React.ReactNode; /** * Specify millisecond delay before showing Tooltip * * @default 0 */ showDelay?: number; /** * Specify the placement of Tooltip relative to the anchor * * @default 'top' * */ placement?: Placement; /** * Specify if Tooltip should automatically choose the placement that has the most space. * * AutoPlacementOptions * * */ autoPlacement?: boolean | AutoPlacementOptions; /** * Specify if Tooltip should flip to the opposite side if there is not enough space. * Cannot be used with `autoPlacement`. * * FlipOptions * * * @default true */ flip?: boolean | FlipOptions; /** * Specify if Tooltip should shift to keep itself in view. * * ShiftOptions * * * @default true */ shift?: boolean | ShiftOptions; /** * Specify if Tooltip should hide when the anchor is not in view. * * HideOptions * * * @default true */ autoHiding?: boolean | HideOptions; /** * Pass an array to override the floating-ui middleware * or a function to modify the Beam-default middleware array. * * Middleware * */ middleware?: MiddlewareModifier; /** * Control the visibility of Tooltip */ open?: boolean; /** * Control the default visibility of Tooltip */ defaultOpen?: boolean; /** * Specify if the floating element should be portalled. * * FloatingPortalProps * */ portalled?: boolean | FloatingPortalProps; /** * Callback when the Tooltip requests to change the `open` value * * * onOpenChange * * */ onOpenChange?: UseFloatingOptions['onOpenChange']; /** * Prevent Tooltip from appearing */ disabled?: boolean; /** * Adds base screen reader props to the reference and floating elements for a given `role` */ role?: UseRoleProps; /** * Specify content and sub-components of the Popover * */ children: React.ReactNode; } export declare function Tooltip({ children, portalled, text, disabled, showDelay, role: _role, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element; interface TooltipIconTriggerProps extends React.ComponentPropsWithoutRef<'button'> { /** * Specify the size of default TooltipTrigger. `none` to leave uncontrolled * * @default 'md' */ size?: TooltipTriggerSize; } export declare const TooltipIconTrigger: React.ForwardRefExoticComponent>; export default Tooltip;