UNPKG

@vela-ui/react

Version:

Vela UI React components

3 lines (2 loc) 1.63 kB
"use client" import{a as n}from"./chunk-VAPI52L2.mjs";import{Dialog as m,DialogTrigger as g,Popover as c,composeRenderProps as s,OverlayArrow as u,PopoverContext as f,useSlottedContext as v}from"react-aria-components";import{tv as P}from"tailwind-variants";import{Fragment as h,jsx as o,jsxs as A}from"react/jsx-runtime";var b=P({base:"bg-popover text-popover-foreground z-50 rounded-md border shadow-md outline-hidden transition duration-200",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","data-[placement=left]:slide-out-to-right-2 data-[placement=right]:slide-out-to-left-2 data-[placement=top]:slide-out-to-bottom-2 data-[placement=bottom]:slide-out-to-top-2"]}}}),N=g,T=({className:r,showArrow:t,...p})=>{let a=v(f),l=(a==null?void 0:a.trigger)==="SubmenuTrigger",e=t?12:8;return e=l?e-6:e,o(c,{"data-slot":"popover",offset:e,className:s(r,(i,d)=>b({...d,className:i})),...p,children:s(p.children,i=>A(h,{children:[t&&o(u,{className:"group",children:o("svg",{width:12,height:12,viewBox:"0 0 12 12",className:"fill-popover stroke-border block stroke-1 group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90",children:o("path",{d:"M0 0 L6 6 L12 0"})})}),i]}))})};function V({className:r,...t}){return o(m,{"data-slot":"popover-content",className:n("p-4 outline-hidden",r),...t})}export{N as a,T as b,V as c};