PageSourceSearch

https://voilacreators.com/assets/popover-BTTaK69J.js

js voilacreators.com collected 2026-09-24 13:16:56 UTC 5,426 bytes, 1 lines download raw bytes

1import{j as s}from"./jsx-runtime-D_zvdyIk.js";import{a as p}from"./chunk-EPOLDU6W-coJUVswn.js";import{u as $,c as L,b as G,P as A,a as P,e as H}from"./index-Df9dkKbm.js";import{u as O}from"./index-_E5mnKb2.js";import{P as K,h as z,R as U,u as V,F as W,D as Z}from"./index-CB3PVYz6.js";import{c as _,R as q,A as j,C as B,a as J}from"./index-9DvlhEER.js";import{P as w}from"./index-Cxg7NxIu.js";import{c as Q}from"./typography-DcS16Ag2.js";var m="Popover",[E]=L(m,[_]),g=_(),[X,d]=E(m),b=e=>{const{__scopePopover:n,children:o,open:a,defaultOpen:r,onOpenChange:t,modal:c=!1}=e,i=g(n),u=p.useRef(null),[l,h]=p.useState(!1),[x,f]=$({prop:a,defaultProp:r??!1,onChange:t,caller:m});return s.jsx(q,{...i,children:s.jsx(X,{scope:n,contentId:G(),triggerRef:u,open:x,onOpenChange:f,onOpenToggle:p.useCallback(()=>f(C=>!C),[f]),hasCustomAnchor:l,onCustomAnchorAdd:p.useCallback(()=>h(!0),[]),onCustomAnchorRemove:p.useCallback(()=>h(!1),[]),modal:c,children:o})})};b.displayName=m;var F="PopoverAnchor",N=p.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,r=d(F,o),t=g(o),{onCustomAnchorAdd:c,onCustomAnchorRemove:i}=r;return p.useEffect(()=>(c(),()=>i()),[c,i]),s.jsx(j,{...t,...a,ref:n})});N.displayName=F;var S="PopoverTrigger",y=p.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,r=d(S,o),t=g(o),c=O(n,r.triggerRef),i=s.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":I(r.open),...a,ref:c,onClick:P(e.onClick,r.onOpenToggle)});return r.hasCustomAnchor?i:s.jsx(j,{asChild:!0,...t,children:i})});y.displayName=S;var R="PopoverPortal",[Y,ee]=E(R,{forceMount:void 0}),D=e=>{const{__scopePopover:n,forceMount:o,children:a,container:r}=e,t=d(R,n);return s.jsx(Y,{scope:n,forceMount:o,children:s.jsx(w,{present:o||t.open,children:s.jsx(K,{asChild:!0,container:r,children:a})})})};D.displayName=R;var v="PopoverContent",M=p.forwardRef((e,n)=>{const o=ee(v,e.__scopePopover),{forceMount:a=o.forceMount,...r}=e,t=d(v,e.__scopePopover);return s.jsx(w,{present:a||t.open,children:t.modal?s.jsx(re,{...r,ref:n}):s.jsx(te,{...r,ref:n})})});M.displayName=v;var oe=H("PopoverContent.RemoveScroll"),re=p.forwardRef((e,n)=>{const o=d(v,e.__scopePopover),a=p.useRef(null),r=O(n,a),t=p.useRef(!1);return p.useEffect(()=>{const c=a.current;if(c)return z(c)},[]),s.jsx(U,{as:oe,allowPinchZoom:!0,children:s.jsx(T,{...e,ref:r,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,c=>{var i;c.preventDefault(),t.current||(i=o.triggerRef.current)==null||i.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,c=>{const i=c.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0,l=i.button===2||u;t.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),te=p.forwardRef((e,n)=>{const o=d(v,e.__scopePopover),a=p.useRef(!1),r=p.useRef(!1);return s.jsx(T,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var c,i;(c=e.onCloseAutoFocus)==null||c.call(e,t),t.defaultPrevented||(a.current||(i=o.triggerRef.current)==null||i.focus(),t.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:t=>{var u,l;(u=e.onInteractOutside)==null||u.call(e,t),t.defaultPrevented||(a.current=!0,t.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const c=t.target;((l=o.triggerRef.current)==null?void 0:l.contains(c))&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&r.current&&t.preventDefault()}})}),T=p.forwardRef((e,n)=>{const{__scopePopover:o,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:t,disableOutsidePointerEvents:c,onEscapeKeyDown:i,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:h,...x}=e,f=d(v,o),C=g(o);return V(),s.jsx(W,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:t,children:s.jsx(Z,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:h,onEscapeKeyDown:i,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:s.jsx(B,{"data-state":I(f.open),role:"dialog",id:f.contentId,...C,...x,ref:n,style:{...x.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}
1),k="PopoverClose",ne=p.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,r=d(k,o);return s.jsx(A.button,{type:"button",...a,ref:n,onClick:P(e.onClick,()=>r.onOpenChange(!1))})});ne.displayName=k;var ae="PopoverArrow",se=p.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,r=g(o);return s.jsx(J,{...r,...a,ref:n})});se.displayName=ae;function I(e){return e?"open":"closed"}var ce=b,ie=N,pe=y,ue=D,le=M;function Ce({...e}){return s.jsx(ce,{"data-slot":"popover",...e})}function Re({...e}){return s.jsx(pe,{"data-slot":"popover-trigger",...e})}function Ae({className:e,align:n="center",sideOffset:o=4,...a}){return s.jsx(ue,{children:s.jsx(le,{"data-slot":"popover-content",align:n,sideOffset:o,className:Q("origin-(--radix-popover-content-transform-origin) outline-hidden z-50 w-72 rounded-md border bg-white p-4 text-slate-200 shadow-md",e),...a})})}function Oe({...e}){return s.jsx(ie,{"data-slot":"popover-anchor",...e})}export{Ce as P,Re as a,Ae as b,Oe as c};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.