'use client'; import * as React from 'react'; import * as TooltipPrimitive from 'radix-ui/tooltip'; import { cn } from '@/lib/utils'; export type TooltipProps = React.ComponentProps; export interface TooltipContentProps extends React.ComponentProps { /** * Draw the arrow pointing back at the trigger. CBAR makes this a switch on * its Tooltip, and it is worth having: an arrow is noise when the tooltip is * already visually attached to a small target. */ showArrow?: boolean; } /** * Short hint shown on hover or keyboard focus. * * Never put essential information or interactive content in a tooltip — it is * unreachable on touch devices. Icon-only buttons still need their own * `aria-label`; the tooltip is not a substitute for one. */ function TooltipProvider({ delayDuration = 0, ...props }: React.ComponentProps) { return ( ); } function Tooltip(props: TooltipProps) { return ; } function TooltipTrigger(props: React.ComponentProps) { return ; } function TooltipContent({ className, sideOffset = 4, showArrow = true, children, ...props }: TooltipContentProps) { return ( {children} {/* A real triangle at CBAR's 12×8 rather than a rotated square — the square had to be nudged half its height back under the bubble to hide its far corners, and it cannot be 12 wide by 8 tall. */} {showArrow ? ( ) : null} ); } export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };