3 lines
2.7 KiB
JavaScript
3 lines
2.7 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Crbd1Tvi.js","assets/features-animation-BkV7kg8P.js","assets/gestures-BHfQC-M8.js","assets/react-vendor-jWT2yUdV.js","assets/qface-BZLvZXJ8.js","assets/index-DiaaLdUu.js","assets/react-hot-toast-cGcFZPSt.js","assets/react-router-dom-C6k78GT4.js","assets/index-CBRelCj8.css"])))=>i.map(i=>d[i]);
|
|
import{ar as B,aA as S,aB as h,aC as j,aD as U,aE as C,aF as b,n as _,aG as w,b as F,E as L,A as V,aH as z}from"./index-DiaaLdUu.js";import{r as n,j as e}from"./react-vendor-jWT2yUdV.js";import{g as G}from"./chunk-WQVQ7P2I-BJd1EiqP.js";import{p as q}from"./chunk-FGM523TA-CgSvUh2a.js";import{j as J}from"./chunk-KVDW62ZT-CGYYmJoP.js";var[K,A]=B({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),y=()=>U(()=>import("./index-Crbd1Tvi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(s=>s.default),$=s=>{const{as:i,children:a,className:p,...o}=s,{Component:l,placement:r,backdrop:t,motionProps:m,disableAnimation:c,getPopoverProps:f,getDialogProps:d,getBackdropProps:v,getContentProps:u,isNonModal:N,onClose:x}=A(),g=n.useRef(null),{dialogProps:T,titleProps:D}=S({},g),E=d({ref:g,...T,...o}),M=i||l||"div",P=e.jsxs(e.Fragment,{children:[!N&&e.jsx(h,{onDismiss:x}),e.jsx(M,{...E,children:e.jsx("div",{...u({className:p}),children:typeof a=="function"?a(D):a})}),e.jsx(h,{onDismiss:x})]}),O=n.useMemo(()=>t==="transparent"?null:c?e.jsx("div",{...v()}):e.jsx(j,{features:y,children:e.jsx(C.div,{animate:"enter",exit:"exit",initial:"exit",variants:b.fade,...v()})}),[t,c,v]),H=r?G(r==="center"?"top":r):void 0,k=e.jsx(e.Fragment,{children:c?P:e.jsx(j,{features:y,children:e.jsx(C.div,{animate:"enter",exit:"exit",initial:"initial",style:H,variants:b.scaleSpringOpacity,...m,children:P})})});return e.jsxs("div",{...f(),children:[O,k]})};$.displayName="HeroUI.PopoverContent";var ee=$,R=s=>{var i;const{triggerRef:a,getTriggerProps:p}=A(),{children:o,...l}=s,r=n.useMemo(()=>typeof o=="string"?e.jsx("p",{children:o}):n.Children.only(o),[o]),t=(i=r.props.ref)!=null?i:r.ref,{onPress:m,isDisabled:c,...f}=n.useMemo(()=>p(_(l,r.props),t),[p,r.props,l,t]),[,d]=q(o,F),{buttonProps:v}=w({onPress:m,isDisabled:c},a),u=n.useMemo(()=>(d==null?void 0:d[0])!==void 0,[d]);return n.cloneElement(r,_(f,u?{onPress:m,isDisabled:c}:v))};R.displayName="HeroUI.PopoverTrigger";var oe=R,I=L((s,i)=>{const{children:a,...p}=s,o=J({...p,ref:i}),[l,r]=n.Children.toArray(a),t=e.jsx(z,{portalContainer:o.portalContainer,children:r});return e.jsxs(K,{value:o,children:[l,o.disableAnimation&&o.isOpen?t:e.jsx(V,{children:o.isOpen?t:null})]})});I.displayName="HeroUI.Popover";var re=I;export{oe as a,ee as b,re as p};
|