@loke/design-system
Version:
A design system with individually importable components
45 lines (44 loc) • 2.22 kB
text/typescript
import * as TooltipPrimitive from "@loke/ui/tooltip";
import { type ComponentPropsWithoutRef } from "react";
/**
* TooltipProvider component for configuring tooltip behavior.
*
* Wraps a group of tooltips to share configuration like delay duration
* and skip delay between triggers.
*
* @param delayDuration - The duration from when the pointer enters the trigger until the tooltip opens. @default 0
*/
declare function TooltipProvider({ delayDuration, ...props }: ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
/**
* Tooltip component for displaying additional information on hover.
*
* Manages the state and positioning of tooltip content shown when a user
* hovers over or focuses a trigger element.
*
* Key features:
* - Customizable delay for showing and hiding
* - Accessible, using appropriate ARIA attributes
* - Flexible positioning
* - Controlled or uncontrolled state management
*/
declare function Tooltip({ ...props }: ComponentPropsWithoutRef<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
/**
* TooltipTrigger component for wrapping the element that triggers the tooltip.
*
* Handles mouse and focus events for showing and hiding the tooltip.
* Can be used with `asChild` to avoid adding an extra DOM node.
*/
declare const TooltipTrigger: import("react").ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
/**
* TooltipContent component with default styling.
*
* Renders the tooltip content inside a portal with animations and theme-consistent design.
* Includes a directional arrow pointing to the trigger element.
*
* Key features:
* - Customizable positioning (side, alignment)
* - Animated entrance and exit
* - Automatically adjusts position based on available space
*/
declare const TooltipContent: import("react").ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };