fix(locker): match tooltip arrow color to dark popover background
- Add arrowClassName prop to TooltipContent component - Pass bg-popover fill-popover to wardrobe tooltip arrow - Arrow now matches the dark tooltip body instead of being white
This commit is contained in:
parent
775b61e1f4
commit
58b70fc154
2 changed files with 4 additions and 2 deletions
|
|
@ -114,6 +114,7 @@ export function Wardrobe({
|
||||||
side="right"
|
side="right"
|
||||||
sideOffset={8}
|
sideOffset={8}
|
||||||
className="bg-popover text-popover-foreground border border-border text-sm px-3.5 py-2"
|
className="bg-popover text-popover-foreground border border-border text-sm px-3.5 py-2"
|
||||||
|
arrowClassName="bg-popover fill-popover"
|
||||||
>
|
>
|
||||||
<div className="flex flex-col gap-0.5">
|
<div className="flex flex-col gap-0.5">
|
||||||
<span className="font-semibold">{layout.label}</span>
|
<span className="font-semibold">{layout.label}</span>
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,11 @@ function TooltipTrigger({
|
||||||
|
|
||||||
function TooltipContent({
|
function TooltipContent({
|
||||||
className,
|
className,
|
||||||
|
arrowClassName,
|
||||||
sideOffset = 0,
|
sideOffset = 0,
|
||||||
children,
|
children,
|
||||||
...props
|
...props
|
||||||
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
|
}: React.ComponentProps<typeof TooltipPrimitive.Content> & { arrowClassName?: string }) {
|
||||||
return (
|
return (
|
||||||
<TooltipPrimitive.Portal>
|
<TooltipPrimitive.Portal>
|
||||||
<TooltipPrimitive.Content
|
<TooltipPrimitive.Content
|
||||||
|
|
@ -52,7 +53,7 @@ function TooltipContent({
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
<TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
|
<TooltipPrimitive.Arrow className={cn("bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]", arrowClassName)} />
|
||||||
</TooltipPrimitive.Content>
|
</TooltipPrimitive.Content>
|
||||||
</TooltipPrimitive.Portal>
|
</TooltipPrimitive.Portal>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue