diff --git a/src/ui/__fixtures__/tooltip.tsx b/src/ui/__fixtures__/tooltip.tsx index 5654c76..00b65d1 100644 --- a/src/ui/__fixtures__/tooltip.tsx +++ b/src/ui/__fixtures__/tooltip.tsx @@ -14,8 +14,8 @@ const tooltipFixtures = { - -

Add to library

+ +

Tooltip

diff --git a/src/ui/tooltip.tsx b/src/ui/tooltip.tsx index 2470d0f..739bbd9 100644 --- a/src/ui/tooltip.tsx +++ b/src/ui/tooltip.tsx @@ -1,25 +1,59 @@ -import * as TooltipPrimitive from '@radix-ui/react-tooltip' -import * as React from 'react' +"use client"; -const TooltipProvider = TooltipPrimitive.Provider +import * as React from "react"; +import * as TooltipPrimitive from "@radix-ui/react-tooltip"; -const Tooltip = TooltipPrimitive.Root +import clsx from "clsx"; -const TooltipTrigger = TooltipPrimitive.Trigger +const TooltipProvider = TooltipPrimitive.Provider; + +const Tooltip = TooltipPrimitive.Root; + +const TooltipTrigger = TooltipPrimitive.Trigger; const TooltipContent = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({className, sideOffset = 6, ...props}, ref) => ( +>(({ className, sideOffset = 4, ...props }, ref) => ( -)) -TooltipContent.displayName = TooltipPrimitive.Content.displayName + > +
+ + {props.children} + + + Tooltip Triangle + + +
+
+)); +TooltipContent.displayName = TooltipPrimitive.Content.displayName; -export {Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} +export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };