UNPKG

@vela-ui/react

Version:

Vela UI React components

3 lines (2 loc) 1.15 kB
"use client" import{Tooltip as n,TooltipTrigger as s,composeRenderProps as e,OverlayArrow as m}from"react-aria-components";import{tv as d}from"tailwind-variants";import{Fragment as g,jsx as t,jsxs as c}from"react/jsx-runtime";var f=d({base:"bg-primary text-primary-foreground z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",variants:{isEntering:{true:["animate-in fade-in-0 zoom-in-95","data-[placement=left]:slide-in-from-right-2 data-[placement=right]:slide-in-from-left-2 data-[placement=top]:slide-in-from-bottom-2 data-[placement=bottom]:slide-in-from-top-2"]},isExiting:{true:"animate-out fade-out-0 zoom-out-95"}}}),y=s;function b({className:a,showArrow:i,offset:p=10,...r}){return t(n,{"data-slot":"tooltip",offset:p,className:e(a,(o,l)=>f({...l,className:o})),...r,children:e(r.children,o=>c(g,{children:[i&&t(m,{className:"group",children:t("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"fill-primary stroke-border block stroke-1 group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90",children:t("path",{d:"M0 0 L6 6 L12 0"})})}),o]}))})}export{y as a,b};