import type { ReactNode } from 'react'; import { Tooltip as AriaTooltip, TooltipProps as AriaTooltipProps, OverlayArrow, composeRenderProps, } from 'react-aria-components'; import { tv } from 'tailwind-variants'; import { OverlayArrowIcon } from '../icons'; const style = tv({ base: 'group/tooltip px-2 py-1.5 max-w-[200px] drop-shadow-modal rounded text-sm', variants: { bgColor: { white: 'bg-white [&_svg]:fill-white', tertiary: 'bg-primary-tertiary [&_svg]:fill-primary-tertiary', }, }, }); export interface TooltipProps extends Omit { bgColor?: 'white' | 'tertiary'; children: ReactNode; } export function Tooltip({ children, ...props }: TooltipProps) { const { className, bgColor = 'white', offset = 10, ...restProps } = props; return ( style({ ...renderProps, className, bgColor }) )} > {children} ); }