"use client"; import {Tooltip as BaseTooltip} from "@base-ui/react/tooltip"; import * as React from "react"; import {cn} from "@/lib/utilities"; import styles from "./tooltip.module.css"; interface TooltipProviderProps { /** Tooltip content and triggers managed by the provider. @default undefined */ children: React.ReactNode; /** Delay in milliseconds before tooltip content becomes visible. @default undefined */ delayDuration?: number; } interface TooltipProps extends Omit, "delay"> { /** Delay in milliseconds before tooltip content becomes visible. @default undefined */ delayDuration?: number; } interface TooltipTriggerProps extends Omit, "className"> { /** Additional CSS classes merged with the tooltip trigger styles. @default undefined */ className?: string; /** Backward-compatible child-slot API that maps the child element to `render`. @default false @deprecated Prefer Base UI's `render` prop. */ asChild?: boolean; } interface TooltipContentProps extends Omit, "className"> { /** Additional CSS classes merged with the tooltip popup styles. @default undefined */ className?: string; /** The offset in pixels between the trigger and the tooltip popup. @default 4 */ sideOffset?: number; /** Preferred side on which the tooltip should appear. @default "top" */ side?: "top" | "right" | "bottom" | "left"; } /** * Provides a compatibility wrapper for grouping tooltip triggers and content. * * @remarks * - Renders no DOM element by default and returns its children directly * - Built on {@link https://base-ui.com/react/components/tooltip | Base UI Tooltip} * - Does not expose a `render` prop because it is a pass-through provider shim * - Styling via CSS Modules with `--ac-*` custom properties through descendant components * * @example Basic usage * ```tsx * * * Hover * Details * * * ``` * * @see {@link https://base-ui.com/react/components/tooltip | Base UI Documentation} */ const TooltipProvider = ({children}: Readonly): React.ReactNode => children; TooltipProvider.displayName = "TooltipProvider"; /** * Coordinates tooltip timing, open state, and accessibility semantics. * * @remarks * - Renders no DOM element by default and coordinates descendant tooltip parts * - Built on {@link https://base-ui.com/react/components/tooltip | Base UI Tooltip} * - Supports composition through descendant `render` props * - Styling via CSS Modules with `--ac-*` custom properties * * @example Basic usage * ```tsx * * Hover * Details * * ``` * * @see {@link https://base-ui.com/react/components/tooltip | Base UI Documentation} */ function Tooltip(props: Readonly): React.ReactElement { const {delayDuration, ...otherProps} = props; const tooltipProps = delayDuration === undefined ? otherProps : {...otherProps, delay: delayDuration}; return ; } Tooltip.displayName = "Tooltip"; /** * Anchors tooltip behavior to an interactive trigger element. * * @remarks * - Renders a `