import "./tooltip.css"; import type * as React from "react"; import { Tooltip as Base } from "@base-ui/react/tooltip"; import { type StyleProps } from "./style_props"; export type TooltipSide = "top" | "bottom" | "left" | "right"; /** The kit's tooltip timing at the app root. Every tooltip portals itself, so forgetting it changes * nothing for kit tooltips; it lets a raw Base UI tooltip without a `delay` share the kit's timing. */ export declare function TooltipProvider({ children }: { children: React.ReactNode; }): React.JSX.Element; export interface UseTooltipOptions { text?: string; side?: TooltipSide; offset?: number; } /** A string is the text, an object may also place it, and empty is no tooltip — one answer for every * control's `tooltip`. */ export declare function tooltipHint(tooltip: string | UseTooltipOptions | undefined): { text: string; side?: TooltipSide; offset?: number; } | undefined; interface TooltipBaseProps { open?: boolean; onOpenChange?: (open: boolean) => void; defaultOpen?: boolean; side?: TooltipSide; /** In px. */ offset?: number; } /** `label` collapses the common case into one element and makes `children` the trigger; one component, * since a hint is a mode of a tooltip. */ export type TooltipProps = TooltipBaseProps & ({ label: string; children: React.ReactElement; } | { label?: undefined; children: React.ReactNode; }); /** * A hint on hover or keyboard focus. * * ```tsx * {button} * * * {button} * Longer hint * * ``` * * Supplementary only: suppressed on touch, so it never carries what a touch or screen-reader user needs. * A trigger whose purpose is opening the popup is an `InfoPopover`. */ export declare function Tooltip(props: TooltipProps): React.JSX.Element; export interface TooltipTriggerProps { children: React.ReactElement; } /** Rendered as the trigger, adding no box, so the child must forward the props it is handed. */ export declare function TooltipTrigger({ children }: TooltipTriggerProps): React.JSX.Element; export interface TooltipContentProps extends StyleProps { children: React.ReactNode; ref?: React.Ref; render?: Base.Popup.Props["render"]; testID?: string; } /** The popup; the positioner carrying the overlay rung is `lotics-tooltip__positioner`. `role="tooltip"` * is the kit's — Base UI writes none, leaving an unannounced, unauditable div. No `aria-describedby` on * the trigger: the `tooltip` prop already names icon-only controls (`IconButton`), so it would announce * twice, and the unmounted popup would leave it dangling. */ export declare function TooltipContent({ children, ref, render, testID, ...props }: TooltipContentProps): React.JSX.Element; export {};