diff --git a/packages/react/components/Tooltip.tsx b/packages/react/components/Tooltip.tsx index 51eb488..eb7c974 100644 --- a/packages/react/components/Tooltip.tsx +++ b/packages/react/components/Tooltip.tsx @@ -5,13 +5,13 @@ interface TooltipContextBody { position: "top" | "bottom" | "left" | "right"; } -const Tooltip$Context$InitialState: TooltipContextBody = { +const tooltipContextInitial: TooltipContextBody = { position: "top", }; -const Tooltip$Context = React.createContext< +const TooltipContext = React.createContext< [TooltipContextBody, React.Dispatch>] >([ - Tooltip$Context$InitialState, + tooltipContextInitial, () => { if (process.env.NODE_ENV && process.env.NODE_ENV === "development") { console.warn( @@ -21,7 +21,7 @@ const Tooltip$Context = React.createContext< }, ]); -const [Tooltip$Variant, Tooltip$resolveVariantProps] = vcn({ +const [tooltipVariant, resolveTooltipVariantProps] = vcn({ base: "w-fit h-fit relative group/tooltip", variants: { position: { @@ -38,23 +38,23 @@ const [Tooltip$Variant, Tooltip$resolveVariantProps] = vcn({ interface TooltipProps extends React.HTMLAttributes, - VariantProps {} + VariantProps {} const Tooltip = React.forwardRef((props, ref) => { - const [variantProps, rest] = Tooltip$resolveVariantProps(props); + const [variantProps, rest] = resolveTooltipVariantProps(props); const contextState = useState({ - ...Tooltip$Context$InitialState, + ...tooltipContextInitial, ...variantProps, }); return ( - -
- + +
+ ); }); -const [TooltipContent$Variant, TooltipContent$resolveVariantProps] = vcn({ +const [tooltipContentVariant, resolveTooltipContentVariantProps] = vcn({ base: "absolute py-1 px-3 bg-white dark:bg-black border border-black/10 dark:border-white/20 [--tooltip-offset:2px] opacity-0 group-hover/tooltip:opacity-100 pointer-events-none group-hover/tooltip:pointer-events-auto transition-all rounded-md", variants: { position: { @@ -79,17 +79,17 @@ const [TooltipContent$Variant, TooltipContent$resolveVariantProps] = vcn({ interface TooltipContentProps extends React.HTMLAttributes, - Omit, "position"> {} + Omit, "position"> {} const TooltipContent = React.forwardRef( (props, ref) => { - const [variantProps, rest] = TooltipContent$resolveVariantProps(props); - const [contextState] = React.useContext(Tooltip$Context); + const [variantProps, rest] = resolveTooltipContentVariantProps(props); + const [contextState] = React.useContext(TooltipContext); return (