import { Info } from 'lucide-react'; import type { ReactNode } from 'react'; import { cn } from '@/lib/cn'; /** * Pure-CSS tooltip (server-safe): an info glyph (or any trigger) that reveals a definition bubble on hover / focus. * Used by `DataStrip` for "How counted" definitions. The bubble is also readable by screen readers through `aria-describedby`. */ export function Hint({ text, children, className, align = 'left', id }: { text: ReactNode; children?: ReactNode; className?: string; align?: 'left' | 'right'; id?: string }) { const bubbleId = id ?? `hint-${hash(String(typeof text === 'string' ? text : 'hint'))}`; return ( {text} ); } function hash(s: string): string { let h = 0; for (let i = 0; i < s.length; i++) h = (h * 31 + s.charCodeAt(i)) | 0; return Math.abs(h).toString(36); }