@telegraph/modal 0.0.83 → 0.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +246 -238
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @telegraph/modal
|
|
2
2
|
|
|
3
|
+
## 0.0.84
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#494](https://github.com/knocklabs/telegraph/pull/494) [`e769470`](https://github.com/knocklabs/telegraph/commit/e7694701fb63ebc65d9fe77d9a89c8f0bf557b67) Thanks [@kylemcd](https://github.com/kylemcd)! - update package exports to be in the correct order
|
|
8
|
+
|
|
9
|
+
- [#495](https://github.com/knocklabs/telegraph/pull/495) [`f5d6a69`](https://github.com/knocklabs/telegraph/commit/f5d6a693e078dbfa1c99a78dc7b8ec6a9c34218a) Thanks [@kylemcd](https://github.com/kylemcd)! - fix typescript build issues
|
|
10
|
+
|
|
11
|
+
- [#493](https://github.com/knocklabs/telegraph/pull/493) [`5209f6d`](https://github.com/knocklabs/telegraph/commit/5209f6d6c8ed9d71d61c76c089541b14d3369a35) Thanks [@kylemcd](https://github.com/kylemcd)! - update radix deps to latest
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`e769470`](https://github.com/knocklabs/telegraph/commit/e7694701fb63ebc65d9fe77d9a89c8f0bf557b67)]:
|
|
14
|
+
- @telegraph/style-engine@0.1.13
|
|
15
|
+
- @telegraph/helpers@0.0.13
|
|
16
|
+
- @telegraph/button@0.0.82
|
|
17
|
+
- @telegraph/layout@0.1.20
|
|
18
|
+
- @telegraph/icon@0.0.55
|
|
19
|
+
|
|
3
20
|
## 0.0.83
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),G=require("@radix-ui/react-dialog"),g=require("react"),J=require("react-dom"),Q=require("@radix-ui/react-focus-scope"),ee=require("@radix-ui/react-portal"),te=require("@radix-ui/react-visually-hidden"),ne=require("@telegraph/button"),re=require("@telegraph/helpers"),se=require("@telegraph/icon"),m=require("@telegraph/layout"),R=require("framer-motion");function C(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=C(G),i=C(g),oe=C(J),ie=C(ee),ae=C(te);function D(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function M(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function I(...e){return t=>{let n=!1;const s=e.map(r=>{const o=M(r,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<s.length;r++){const o=s[r];typeof o=="function"?o():M(e[r],null)}}}}function q(...e){return i.useCallback(I(...e),e)}var $=i.forwardRef((e,t)=>{const{children:n,...s}=e,r=i.Children.toArray(n),o=r.find(le);if(o){const a=o.props.children,l=r.map(y=>y===o?i.Children.count(a)>1?i.Children.only(null):i.isValidElement(a)?a.props.children:null:y);return u.jsx(T,{...s,ref:t,children:i.isValidElement(a)?i.cloneElement(a,void 0,l):null})}return u.jsx(T,{...s,ref:t,children:n})});$.displayName="Slot";var T=i.forwardRef((e,t)=>{const{children:n,...s}=e;if(i.isValidElement(n)){const r=de(n),o=ue(s,n.props);return n.type!==i.Fragment&&(o.ref=t?I(t,r):r),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null});T.displayName="SlotClone";var ce=({children:e})=>u.jsx(u.Fragment,{children:e});function le(e){return i.isValidElement(e)&&e.type===ce}function ue(e,t){const n={...t};for(const s in t){const r=e[s],o=t[s];/^on[A-Z]/.test(s)?r&&o?n[s]=(...l)=>{o(...l),r(...l)}:r&&(n[s]=r):s==="style"?n[s]={...r,...o}:s==="className"&&(n[s]=[r,o].filter(Boolean).join(" "))}return{...e,...n}}function de(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],z=fe.reduce((e,t)=>{const n=i.forwardRef((s,r)=>{const{asChild:o,...a}=s,l=o?$:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...a,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function pe(e,t){e&&oe.flushSync(()=>e.dispatchEvent(t))}function B(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function ye(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);i.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var he="DismissableLayer",k="dismissableLayer.update",ve="dismissableLayer.pointerDownOutside",me="dismissableLayer.focusOutside",F,U=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),V=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...y}=e,d=i.useContext(U),[c,h]=i.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=i.useState({}),b=q(t,f=>h(f)),x=Array.from(d.layers),[L]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),v=x.indexOf(L),j=c?x.indexOf(c):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,N=j>=v,Z=be(f=>{const O=f.target,_=[...d.branches].some(S=>S.contains(O));!N||_||(r==null||r(f),a==null||a(f),f.defaultPrevented||l==null||l())},p),W=xe(f=>{const O=f.target;[...d.branches].some(S=>S.contains(O))||(o==null||o(f),a==null||a(f),f.defaultPrevented||l==null||l())},p);return ye(f=>{j===d.layers.size-1&&(s==null||s(f),!f.defaultPrevented&&l&&(f.preventDefault(),l()))},p),i.useEffect(()=>{if(c)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(F=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(c)),d.layers.add(c),A(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=F)}},[c,p,n,d]),i.useEffect(()=>()=>{c&&(d.layers.delete(c),d.layersWithOutsidePointerEventsDisabled.delete(c),A())},[c,d]),i.useEffect(()=>{const f=()=>P({});return document.addEventListener(k,f),()=>document.removeEventListener(k,f)},[]),u.jsx(z.div,{...y,ref:b,style:{pointerEvents:w?N?"auto":"none":void 0,...e.style},onFocusCapture:D(e.onFocusCapture,W.onFocusCapture),onBlurCapture:D(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:D(e.onPointerDownCapture,Z.onPointerDownCapture)})});V.displayName=he;var ge="DismissableLayerBranch",Ee=i.forwardRef((e,t)=>{const n=i.useContext(U),s=i.useRef(null),r=q(t,s);return i.useEffect(()=>{const o=s.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(z.div,{...e,ref:r})});Ee.displayName=ge;function be(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),s=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const o=l=>{if(l.target&&!s.current){let y=function(){K(ve,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=y,t.addEventListener("click",r.current,{once:!0})):y()}else t.removeEventListener("click",r.current);s.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function xe(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),s=i.useRef(!1);return i.useEffect(()=>{const r=o=>{o.target&&!s.current&&K(me,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function A(){const e=new CustomEvent(k);document.dispatchEvent(e)}function K(e,t,n,{discrete:s}){const r=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?pe(r,o):r.dispatchEvent(o)}var Ce=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},Pe=i[" useInsertionEffect ".trim().toString()]||Ce;function Le({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[r,o,a]=we({defaultProp:t,onChange:n}),l=e!==void 0,y=l?e:r;{const c=i.useRef(e!==void 0);i.useEffect(()=>{const h=c.current;h!==l&&console.warn(`${s} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=l},[l,s])}const d=i.useCallback(c=>{var h;if(l){const p=Oe(c)?c(e):c;p!==e&&((h=a.current)==null||h.call(a,p))}else o(c)},[l,e,o,a]);return[y,d]}function we({defaultProp:e,onChange:t}){const[n,s]=i.useState(e),r=i.useRef(n),o=i.useRef(t);return Pe(()=>{o.current=t},[t]),i.useEffect(()=>{var a;r.current!==n&&((a=o.current)==null||a.call(o,n),r.current=n)},[n,r]),[n,s,o]}function Oe(e){return typeof e=="function"}const H=g.createContext({layers:[],setLayers:()=>{},addLayer:()=>{},removeLayer:()=>{},removeTopLayer:()=>{}}),Re=({children:e})=>{const[t,n]=g.useState([]),s=a=>{n(l=>[...l,a])},r=a=>{n(t.filter(l=>l!==a))},o=()=>{const a=t[t.length-1];a&&r(a)};return u.jsx(H.Provider,{value:{layers:t,setLayers:n,addLayer:s,removeLayer:r,removeTopLayer:o},children:e})},X=()=>g.useContext(H),je=({defaultOpen:e,open:t,onOpenChange:n,...s})=>{const[r,o]=Le({prop:t,onChange:n,defaultProp:e}),a=X(),l=s.a11yTitle;if(g.useEffect(()=>{!r&&a.layers.includes(l)&&a.removeLayer(l)},[l,a,r]),!!r)return u.jsx(Se,{open:r,onOpenChange:o,...s})},Se=({open:e,onOpenChange:t,a11yTitle:n,a11yDescription:s,children:r,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:l,...y})=>{var x,L;const d=n,c=X();g.useEffect(()=>{!c||!e||c.layers.includes(d)||c.addLayer(d)},[d,c,e]);const h=((x=c.layers)==null?void 0:x.indexOf(d))||0,p=((L=c.layers)==null?void 0:L.length)||0,P=h!==0,b=d===c.layers[c.layers.length-1];return u.jsx(V,{onEscapeKeyDown:v=>{b&&(v.preventDefault(),c.removeTopLayer(),t(!1))},onPointerDownOutside:v=>{b&&(v.preventDefault(),c.removeTopLayer(),t(!1))},children:u.jsxs(E.Root,{open:e,onOpenChange:v=>{var w;if(((w=c==null?void 0:c.layers)==null?void 0:w.length)>0)return v===!1&&d===c.layers[c.layers.length-1]?(c.removeLayer(d),t(!1)):void 0;t(v)},children:[u.jsxs(ae.Root,{children:[u.jsx(E.Title,{children:n}),s&&u.jsx(E.Description,{children:s})]}),u.jsx(R.AnimatePresence,{children:e&&u.jsx(ie.Root,{className:"tgph",children:u.jsx(De,{layer:h,children:u.jsx(Q.FocusScope,{trapped:typeof o=="boolean"?o:b,onMountAutoFocus:a,onUnmountAutoFocus:l,asChild:!0,children:u.jsx(re.RefToTgphRef,{children:u.jsx(m.Stack,{as:R.motion.div,initial:{top:`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${p-1})`},animate:{top:P?`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${h} )`:"var(--tgph-spacing-16)"},exit:{top:0},transition:{type:"spring",duration:.3,bounce:0},w:"full",justify:"center",style:{position:"fixed",left:0,maxHeight:"calc(100vh - var(--tgph-spacing-32))",maxWidth:"calc(100vw - var(--tgph-spacing-8))",zIndex:`calc(var(--tgph-zIndex-modal) + ${h})`},children:u.jsx(m.Stack,{direction:"column",as:R.motion.div,animate:{scale:1.02-Math.abs(p-h)*.02,transformOrigin:"center center"},transition:{duration:.2,bounce:0,type:"spring"},maxW:y.maxW??"160",w:y.w??"full",bg:"surface-1",border:"px",rounded:"4",shadow:"3",...y,children:r},`content-${d}`)},`container-${d}`)})})})})})]},d)})},De=({layer:e,children:t})=>e>0?t:u.jsxs(E.Overlay,{children:[u.jsx(m.Box,{as:R.motion.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,bounce:0,type:"spring"},bg:"alpha-black-6",w:"full",h:"full",zIndex:"overlay",style:{position:"fixed",cursor:"pointer",inset:"0px"}}),t]}),Te=g.forwardRef(({children:e,...t},n)=>u.jsx(E.Content,{ref:n,asChild:!0,...t,children:u.jsx(m.Stack,{direction:"column",h:"full",...t,children:e})})),ke=({size:e="1",variant:t="ghost",...n})=>u.jsx(E.Close,{asChild:!0,children:u.jsx(ne.Button,{icon:{icon:se.Lucide.X,alt:"Close Modal"},variant:t,size:e,...n})}),Be=({style:e,children:t,...n})=>u.jsx(m.Stack,{direction:"column",px:"6",py:"4",style:{overflowY:"auto",...e},...n,children:t}),Ne=({children:e,...t})=>u.jsx(m.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...t,children:e}),We=({children:e,...t})=>u.jsx(m.Stack,{direction:"row",align:"center",justify:"flex-end",gap:"2",px:"6",py:"4",borderTop:"px",...t,children:e}),Y={};Object.assign(Y,{Root:je,Content:Te,Close:ke,Body:Be,Header:Ne,Footer:We});exports.Modal=Y;exports.ModalStackingProvider=Re;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),Y=require("@radix-ui/react-dialog"),g=require("react"),Z=require("react-dom"),G=require("@radix-ui/react-focus-scope"),J=require("@radix-ui/react-portal"),Q=require("@radix-ui/react-visually-hidden"),ee=require("@telegraph/button"),te=require("@telegraph/helpers"),ne=require("@telegraph/icon"),m=require("@telegraph/layout"),O=require("framer-motion");function C(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=C(Y),i=C(g),re=C(Z),se=C(J),oe=C(Q);function j(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function N(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function F(...e){return t=>{let n=!1;const s=e.map(r=>{const o=N(r,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let r=0;r<s.length;r++){const o=s[r];typeof o=="function"?o():N(e[r],null)}}}}function A(...e){return i.useCallback(F(...e),e)}function ie(e){const t=ce(e),n=i.forwardRef((s,r)=>{const{children:o,...l}=s,c=i.Children.toArray(o),f=c.find(le);if(f){const u=f.props.children,a=c.map(y=>y===f?i.Children.count(u)>1?i.Children.only(null):i.isValidElement(u)?u.props.children:null:y);return d.jsx(t,{...l,ref:r,children:i.isValidElement(u)?i.cloneElement(u,void 0,a):null})}return d.jsx(t,{...l,ref:r,children:o})});return n.displayName=`${e}.Slot`,n}function ce(e){const t=i.forwardRef((n,s)=>{const{children:r,...o}=n;if(i.isValidElement(r)){const l=de(r),c=ue(o,r.props);return r.type!==i.Fragment&&(c.ref=s?F(s,l):l),i.cloneElement(r,c)}return i.Children.count(r)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ae=Symbol("radix.slottable");function le(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ae}function ue(e,t){const n={...t};for(const s in t){const r=e[s],o=t[s];/^on[A-Z]/.test(s)?r&&o?n[s]=(...c)=>{const f=o(...c);return r(...c),f}:r&&(n[s]=r):s==="style"?n[s]={...r,...o}:s==="className"&&(n[s]=[r,o].filter(Boolean).join(" "))}return{...e,...n}}function de(e){var s,r;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],q=fe.reduce((e,t)=>{const n=ie(`Primitive.${t}`),s=i.forwardRef((r,o)=>{const{asChild:l,...c}=r,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(f,{...c,ref:o})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function pe(e,t){e&&re.flushSync(()=>e.dispatchEvent(t))}function _(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function ye(e,t=globalThis==null?void 0:globalThis.document){const n=_(e);i.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var he="DismissableLayer",T="dismissableLayer.update",ve="dismissableLayer.pointerDownOutside",me="dismissableLayer.focusOutside",W,$=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),z=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:o,onInteractOutside:l,onDismiss:c,...f}=e,u=i.useContext($),[a,y]=i.useState(null),h=(a==null?void 0:a.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=i.useState({}),b=A(t,p=>y(p)),x=Array.from(u.layers),[L]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=x.indexOf(L),R=a?x.indexOf(a):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,k=R>=v,X=be(p=>{const w=p.target,I=[...u.branches].some(D=>D.contains(w));!k||I||(r==null||r(p),l==null||l(p),p.defaultPrevented||c==null||c())},h),B=xe(p=>{const w=p.target;[...u.branches].some(D=>D.contains(w))||(o==null||o(p),l==null||l(p),p.defaultPrevented||c==null||c())},h);return ye(p=>{R===u.layers.size-1&&(s==null||s(p),!p.defaultPrevented&&c&&(p.preventDefault(),c()))},h),i.useEffect(()=>{if(a)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(W=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(a)),u.layers.add(a),M(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=W)}},[a,h,n,u]),i.useEffect(()=>()=>{a&&(u.layers.delete(a),u.layersWithOutsidePointerEventsDisabled.delete(a),M())},[a,u]),i.useEffect(()=>{const p=()=>P({});return document.addEventListener(T,p),()=>document.removeEventListener(T,p)},[]),d.jsx(q.div,{...f,ref:b,style:{pointerEvents:S?k?"auto":"none":void 0,...e.style},onFocusCapture:j(e.onFocusCapture,B.onFocusCapture),onBlurCapture:j(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:j(e.onPointerDownCapture,X.onPointerDownCapture)})});z.displayName=he;var ge="DismissableLayerBranch",Ee=i.forwardRef((e,t)=>{const n=i.useContext($),s=i.useRef(null),r=A(t,s);return i.useEffect(()=>{const o=s.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(q.div,{...e,ref:r})});Ee.displayName=ge;function be(e,t=globalThis==null?void 0:globalThis.document){const n=_(e),s=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const o=c=>{if(c.target&&!s.current){let f=function(){U(ve,n,u,{discrete:!0})};const u={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=f,t.addEventListener("click",r.current,{once:!0})):f()}else t.removeEventListener("click",r.current);s.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function xe(e,t=globalThis==null?void 0:globalThis.document){const n=_(e),s=i.useRef(!1);return i.useEffect(()=>{const r=o=>{o.target&&!s.current&&U(me,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function M(){const e=new CustomEvent(T);document.dispatchEvent(e)}function U(e,t,n,{discrete:s}){const r=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),s?pe(r,o):r.dispatchEvent(o)}var Ce=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},Pe=i[" useInsertionEffect ".trim().toString()]||Ce;function Le({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[r,o,l]=Se({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:r;{const a=i.useRef(e!==void 0);i.useEffect(()=>{const y=a.current;y!==c&&console.warn(`${s} is changing from ${y?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),a.current=c},[c,s])}const u=i.useCallback(a=>{var y;if(c){const h=we(a)?a(e):a;h!==e&&((y=l.current)==null||y.call(l,h))}else o(a)},[c,e,o,l]);return[f,u]}function Se({defaultProp:e,onChange:t}){const[n,s]=i.useState(e),r=i.useRef(n),o=i.useRef(t);return Pe(()=>{o.current=t},[t]),i.useEffect(()=>{var l;r.current!==n&&((l=o.current)==null||l.call(o,n),r.current=n)},[n,r]),[n,s,o]}function we(e){return typeof e=="function"}const V=g.createContext({layers:[],setLayers:()=>{},addLayer:()=>{},removeLayer:()=>{},removeTopLayer:()=>{}}),Oe=({children:e})=>{const[t,n]=g.useState([]),s=l=>{n(c=>[...c,l])},r=l=>{n(t.filter(c=>c!==l))},o=()=>{const l=t[t.length-1];l&&r(l)};return d.jsx(V.Provider,{value:{layers:t,setLayers:n,addLayer:s,removeLayer:r,removeTopLayer:o},children:e})},K=()=>g.useContext(V),Re=({defaultOpen:e,open:t,onOpenChange:n,...s})=>{const[r,o]=Le({prop:t,onChange:n,defaultProp:e??!1}),l=K(),c=s.a11yTitle;if(g.useEffect(()=>{!r&&l.layers.includes(c)&&l.removeLayer(c)},[c,l,r]),!!r)return d.jsx(De,{open:r,onOpenChange:o,...s})},De=({open:e,onOpenChange:t,a11yTitle:n,a11yDescription:s,children:r,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:c,...f})=>{var x,L;const u=n,a=K();g.useEffect(()=>{!a||!e||a.layers.includes(u)||a.addLayer(u)},[u,a,e]);const y=((x=a.layers)==null?void 0:x.indexOf(u))||0,h=((L=a.layers)==null?void 0:L.length)||0,P=y!==0,b=u===a.layers[a.layers.length-1];return d.jsx(z,{onEscapeKeyDown:v=>{b&&(v.preventDefault(),a.removeTopLayer(),t(!1))},onPointerDownOutside:v=>{b&&(v.preventDefault(),a.removeTopLayer(),t(!1))},children:d.jsxs(E.Root,{open:e,onOpenChange:v=>{var S;if(((S=a==null?void 0:a.layers)==null?void 0:S.length)>0)return v===!1&&u===a.layers[a.layers.length-1]?(a.removeLayer(u),t(!1)):void 0;t(v)},children:[d.jsxs(oe.Root,{children:[d.jsx(E.Title,{children:n}),s&&d.jsx(E.Description,{children:s})]}),d.jsx(O.AnimatePresence,{children:e&&d.jsx(se.Root,{className:"tgph",children:d.jsx(je,{layer:y,children:d.jsx(G.FocusScope,{trapped:typeof o=="boolean"?o:b,onMountAutoFocus:l,onUnmountAutoFocus:c,asChild:!0,children:d.jsx(te.RefToTgphRef,{children:d.jsx(m.Stack,{as:O.motion.div,initial:{top:`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${h-1})`},animate:{top:P?`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${y} )`:"var(--tgph-spacing-16)"},exit:{top:0},transition:{type:"spring",duration:.3,bounce:0},w:"full",justify:"center",style:{position:"fixed",left:0,maxHeight:"calc(100vh - var(--tgph-spacing-32))",maxWidth:"calc(100vw - var(--tgph-spacing-8))",zIndex:`calc(var(--tgph-zIndex-modal) + ${y})`},children:d.jsx(m.Stack,{direction:"column",as:O.motion.div,animate:{scale:1.02-Math.abs(h-y)*.02,transformOrigin:"center center"},transition:{duration:.2,bounce:0,type:"spring"},maxW:f.maxW??"160",w:f.w??"full",bg:"surface-1",border:"px",rounded:"4",shadow:"3",...f,children:r},`content-${u}`)},`container-${u}`)})})})})})]},u)})},je=({layer:e,children:t})=>e>0?t:d.jsxs(E.Overlay,{children:[d.jsx(m.Box,{as:O.motion.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,bounce:0,type:"spring"},bg:"alpha-black-6",w:"full",h:"full",zIndex:"overlay",style:{position:"fixed",cursor:"pointer",inset:"0px"}}),t]}),Te=g.forwardRef(({children:e,...t},n)=>d.jsx(E.Content,{ref:n,asChild:!0,...t,children:d.jsx(m.Stack,{direction:"column",h:"full",...t,children:e})})),_e=({size:e="1",variant:t="ghost",...n})=>d.jsx(E.Close,{asChild:!0,children:d.jsx(ee.Button,{icon:{icon:ne.Lucide.X,alt:"Close Modal"},variant:t,size:e,...n})}),ke=({style:e,children:t,...n})=>d.jsx(m.Stack,{direction:"column",px:"6",py:"4",style:{overflowY:"auto",...e},...n,children:t}),Be=({children:e,...t})=>d.jsx(m.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...t,children:e}),Ie=({children:e,...t})=>d.jsx(m.Stack,{direction:"row",align:"center",justify:"flex-end",gap:"2",px:"6",py:"4",borderTop:"px",...t,children:e}),H={};Object.assign(H,{Root:Re,Content:Te,Close:_e,Body:ke,Header:Be,Footer:Ie});exports.Modal=H;exports.ModalStackingProvider=Oe;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/primitive/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-slot/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs","../../src/Modal/ModalStacking.tsx","../../src/Modal/Modal.tsx"],"sourcesContent":["// packages/core/primitive/src/primitive.tsx\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nexport {\n composeEventHandlers\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/compose-refs/src/composeRefs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/slot/src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar Slot = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n});\nSlot.displayName = \"Slot\";\nvar SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\nSlotClone.displayName = \"SlotClone\";\nvar Slottable = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n};\nfunction isSlottable(child) {\n return React.isValidElement(child) && child.type === Slottable;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n childPropValue(...args);\n slotPropValue(...args);\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Slot;\nexport {\n Root,\n Slot,\n Slottable\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/primitive/src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-callback-ref/src/useCallbackRef.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-escape-keydown/src/useEscapeKeydown.tsx\nimport * as React from \"react\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nfunction useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n React.useEffect(() => {\n const handleKeyDown = (event) => {\n if (event.key === \"Escape\") {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\nexport {\n useEscapeKeydown\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// packages/react/dismissable-layer/src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-layout-effect/src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n","import React from \"react\";\n\nconst ModalStackingContext = React.createContext<{\n layers: Array<string>;\n setLayers: React.Dispatch<React.SetStateAction<Array<string>>>;\n addLayer: (id: string) => void;\n removeLayer: (id: string) => void;\n removeTopLayer: () => void;\n}>({\n layers: [],\n setLayers: () => {},\n addLayer: () => {},\n removeLayer: () => {},\n removeTopLayer: () => {},\n});\n\ntype ModalStackingProviderProps = {\n children: React.ReactNode;\n};\n\nconst ModalStackingProvider = ({ children }: ModalStackingProviderProps) => {\n const [layers, setLayers] = React.useState<Array<string>>([]);\n\n const addLayer = (id: string) => {\n setLayers((current) => [...current, id]);\n };\n\n const removeLayer = (id: string) => {\n setLayers(layers.filter((layer) => layer !== id));\n };\n\n const removeTopLayer = () => {\n const id = layers[layers.length - 1];\n if (!id) return;\n removeLayer(id);\n };\n\n return (\n <ModalStackingContext.Provider\n value={{ layers, setLayers, addLayer, removeLayer, removeTopLayer }}\n >\n {children}\n </ModalStackingContext.Provider>\n );\n};\n\nconst useModalStacking = () => {\n return React.useContext(ModalStackingContext);\n};\n\nexport { ModalStackingProvider, useModalStacking };\n","import * as Dialog from \"@radix-ui/react-dialog\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport * as Portal from \"@radix-ui/react-portal\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as VisuallyHidden from \"@radix-ui/react-visually-hidden\";\nimport { Button } from \"@telegraph/button\";\nimport { RefToTgphRef } from \"@telegraph/helpers\";\nimport type {\n PolymorphicProps,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Lucide } from \"@telegraph/icon\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport React from \"react\";\n\nimport { useModalStacking } from \"./ModalStacking\";\n\ntype RootProps = Omit<\n React.ComponentPropsWithoutRef<typeof Dialog.Root>,\n \"modal\"\n> &\n React.ComponentPropsWithoutRef<typeof FocusScope> &\n TgphComponentProps<typeof Stack> & {\n a11yTitle: string;\n a11yDescription?: string;\n layer?: number;\n };\n\nconst Root = ({\n defaultOpen: defaultOpenProp,\n open: openProp,\n onOpenChange: onOpenChangeProp,\n ...props\n}: RootProps) => {\n const [open, onOpenChange] = useControllableState({\n prop: openProp,\n onChange: onOpenChangeProp,\n defaultProp: defaultOpenProp,\n });\n\n const stacking = useModalStacking();\n const id = props.a11yTitle;\n\n React.useEffect(() => {\n if (!open && stacking.layers.includes(id)) {\n stacking.removeLayer(id);\n }\n }, [id, stacking, open]);\n\n // Prevent rendering anything within the modal if it is not open\n if (!open) return;\n\n return <RootComponent open={open} onOpenChange={onOpenChange} {...props} />;\n};\n\ntype RootComponentProps = RootProps & {\n open: boolean;\n onOpenChange: (value: boolean) => void;\n};\n\nconst RootComponent = ({\n open,\n onOpenChange,\n a11yTitle,\n a11yDescription,\n children,\n // Focus scope props\n trapped,\n onMountAutoFocus,\n onUnmountAutoFocus,\n ...props\n}: RootComponentProps) => {\n // We use the a11yTitle as the id for the modal as it is unique\n // and can be used to identify the modal in the stacking context.\n // Without the need to generate a random id and manage between\n // different modal rendering patterns.\n const id = a11yTitle;\n const stacking = useModalStacking();\n React.useEffect(() => {\n if (!stacking || !open || stacking.layers.includes(id)) return;\n stacking.addLayer(id);\n }, [id, stacking, open]);\n\n const layer = stacking.layers?.indexOf(id) || 0;\n const layersLength = stacking.layers?.length || 0;\n const isStacked = layer !== 0;\n const isTopLayer = id === stacking.layers[stacking.layers.length - 1];\n\n return (\n <DismissableLayer\n onEscapeKeyDown={(event) => {\n if (!isTopLayer) return;\n event.preventDefault();\n stacking.removeTopLayer();\n onOpenChange(false);\n }}\n onPointerDownOutside={(event) => {\n if (!isTopLayer) return;\n event.preventDefault();\n stacking.removeTopLayer();\n onOpenChange(false);\n }}\n >\n <Dialog.Root\n open={open}\n onOpenChange={(value) => {\n const hasLayers = stacking?.layers?.length > 0;\n\n if (hasLayers) {\n if (\n value === false &&\n id === stacking.layers[stacking.layers.length - 1]\n ) {\n stacking.removeLayer(id);\n return onOpenChange(false);\n }\n // If the modal is not the top layer, do not call onOpenChange\n // when we are stacking the modals\n return;\n }\n\n onOpenChange(value);\n }}\n key={id}\n >\n <VisuallyHidden.Root>\n <Dialog.Title>{a11yTitle}</Dialog.Title>\n {a11yDescription && (\n <Dialog.Description>{a11yDescription}</Dialog.Description>\n )}\n </VisuallyHidden.Root>\n <AnimatePresence>\n {open && (\n // We add the className \"tgph\" here so that styles within\n // the portal get scoped properly to telegraph\n <Portal.Root className=\"tgph\">\n <Overlay layer={layer}>\n <FocusScope\n trapped={typeof trapped === \"boolean\" ? trapped : isTopLayer}\n onMountAutoFocus={onMountAutoFocus}\n onUnmountAutoFocus={onUnmountAutoFocus}\n asChild\n >\n <RefToTgphRef>\n <Stack\n as={motion.div}\n initial={{\n top: `calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${layersLength - 1})`,\n }}\n animate={{\n top: isStacked\n ? `calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${layer} )`\n : \"var(--tgph-spacing-16)\",\n }}\n exit={{ top: 0 }}\n transition={{ type: \"spring\", duration: 0.3, bounce: 0 }}\n w=\"full\"\n justify=\"center\"\n style={{\n position: \"fixed\",\n left: 0,\n maxHeight: \"calc(100vh - var(--tgph-spacing-32))\",\n maxWidth: \"calc(100vw - var(--tgph-spacing-8))\",\n zIndex: `calc(var(--tgph-zIndex-modal) + ${layer})`,\n }}\n key={`container-${id}`}\n >\n <Stack\n direction=\"column\"\n as={motion.div}\n animate={{\n scale: 1.02 - Math.abs(layersLength - layer) * 0.02,\n transformOrigin: \"center center\",\n }}\n transition={{\n duration: 0.2,\n bounce: 0,\n type: \"spring\",\n }}\n maxW={props.maxW ?? \"160\"}\n w={props.w ?? \"full\"}\n bg=\"surface-1\"\n border=\"px\"\n rounded=\"4\"\n shadow=\"3\"\n key={`content-${id}`}\n {...props}\n >\n {children}\n </Stack>\n </Stack>\n </RefToTgphRef>\n </FocusScope>\n </Overlay>\n </Portal.Root>\n )}\n </AnimatePresence>\n </Dialog.Root>\n </DismissableLayer>\n );\n};\n\ntype OverlayProps = TgphComponentProps<typeof Box> & {\n layer: number;\n};\n\nconst Overlay = ({ layer, children }: OverlayProps) => {\n // If the layer is greater than 0, we don't want to show this\n // overlay as to not stack the overlays on top of each other.\n if (layer > 0) return children;\n return (\n <Dialog.Overlay>\n <Box\n as={motion.div}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.3, bounce: 0, type: \"spring\" }}\n bg=\"alpha-black-6\"\n w=\"full\"\n h=\"full\"\n zIndex=\"overlay\"\n style={{\n position: \"fixed\",\n cursor: \"pointer\",\n inset: \"0px\",\n }}\n />\n {children}\n </Dialog.Overlay>\n );\n};\n\ntype ContentProps = React.ComponentPropsWithoutRef<typeof Dialog.Content> &\n TgphComponentProps<typeof Stack>;\ntype ContentRef = React.ElementRef<typeof Dialog.Content>;\n\nconst Content = React.forwardRef<ContentRef, ContentProps>(\n ({ children, ...props }, forwardedRef) => {\n return (\n <Dialog.Content ref={forwardedRef} asChild {...props}>\n <Stack direction=\"column\" h=\"full\" {...props}>\n {children}\n </Stack>\n </Dialog.Content>\n );\n },\n);\n\ntype CloseProps<T extends TgphElement> = TgphComponentProps<typeof Button<T>> &\n Omit<React.ComponentPropsWithoutRef<typeof Dialog.Close>, \"color\">;\nconst Close = <T extends TgphElement>({\n size = \"1\",\n variant = \"ghost\",\n ...props\n}: CloseProps<T>) => {\n return (\n <Dialog.Close asChild>\n <Button\n icon={{ icon: Lucide.X, alt: \"Close Modal\" }}\n variant={variant}\n size={size}\n {...props}\n />\n </Dialog.Close>\n );\n};\n\ntype BodyProps<T extends TgphElement> = PolymorphicProps<T> &\n TgphComponentProps<typeof Stack>;\n\nconst Body = <T extends TgphElement>({\n style,\n children,\n ...props\n}: BodyProps<T>) => {\n return (\n <Stack\n direction=\"column\"\n px=\"6\"\n py=\"4\"\n style={{\n overflowY: \"auto\",\n ...style,\n }}\n {...props}\n >\n {children}\n </Stack>\n );\n};\n\ntype HeaderProps<T extends TgphElement> = PolymorphicProps<T> &\n TgphComponentProps<typeof Stack>;\n\nconst Header = <T extends TgphElement>({\n children,\n ...props\n}: HeaderProps<T>) => {\n return (\n <Stack\n direction=\"row\"\n justify=\"space-between\"\n align=\"center\"\n px=\"6\"\n py=\"4\"\n borderBottom=\"px\"\n {...props}\n >\n {children}\n </Stack>\n );\n};\n\ntype FooterProps<T extends TgphElement> = PolymorphicProps<T> &\n TgphComponentProps<typeof Stack>;\n\nconst Footer = <T extends TgphElement>({\n children,\n ...props\n}: FooterProps<T>) => {\n return (\n <Stack\n direction=\"row\"\n align=\"center\"\n justify=\"flex-end\"\n gap=\"2\"\n px=\"6\"\n py=\"4\"\n borderTop=\"px\"\n {...props}\n >\n {children}\n </Stack>\n );\n};\n\nconst Modal = {} as {\n Root: typeof Root;\n Content: typeof Content;\n Close: typeof Close;\n Body: typeof Body;\n Header: typeof Header;\n Footer: typeof Footer;\n};\n\nObject.assign(Modal, {\n Root,\n Content,\n Close,\n Body,\n Header,\n Footer,\n});\n\nexport { Modal };\n"],"names":["composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","useComposedRefs","React","Slot","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","SlotClone","childrenRef","getElementRef","props2","mergeProps","Slottable","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","element","getter","_a","mayWarn","_b","NODES","Primitive","primitive","Node","asChild","primitiveProps","Comp","dispatchDiscreteCustomEvent","target","ReactDOM","useCallbackRef","callback","callbackRef","useEscapeKeydown","onEscapeKeyDownProp","ownerDocument","onEscapeKeyDown","handleKeyDown","DISMISSABLE_LAYER_NAME","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","DismissableLayer","disableOutsidePointerEvents","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","setNode","force","composedRefs","node2","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","pointerDownOutside","usePointerDownOutside","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","dispatchUpdate","handleUpdate","BRANCH_NAME","DismissableLayerBranch","handlePointerDownOutside","isPointerInsideReactTreeRef","handleClickRef","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","handleAndDispatchCustomEvent","eventDetail","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","useLayoutEffect2","useInsertionEffect","useLayoutEffect","useControllableState","prop","defaultProp","onChange","caller","uncontrolledProp","setUncontrolledProp","onChangeRef","useUncontrolledState","isControlled","isControlledRef","wasControlled","setValue","nextValue","value2","isFunction","prevValueRef","ModalStackingContext","ModalStackingProvider","setLayers","addLayer","id","current","removeLayer","layer","removeTopLayer","useModalStacking","Root","defaultOpenProp","openProp","onOpenChangeProp","open","onOpenChange","stacking","RootComponent","a11yTitle","a11yDescription","trapped","onMountAutoFocus","onUnmountAutoFocus","layersLength","isStacked","isTopLayer","jsxs","Dialog","VisuallyHidden","AnimatePresence","Portal","Overlay","FocusScope","RefToTgphRef","Stack","motion","Box","Content","Close","size","variant","Button","Lucide","Body","style","Header","Footer","Modal"],"mappings":"mxBACA,SAASA,EAAqBC,EAAsBC,EAAiB,CAAE,yBAAAC,EAA2B,EAAM,EAAG,GAAI,CAC7G,OAAO,SAAqBC,EAAO,CAEjC,GADAH,GAAA,MAAAA,EAAuBG,GACnBD,IAA6B,IAAS,CAACC,EAAM,iBAC/C,OAAOF,GAAA,YAAAA,EAAkBE,EAE5B,CACH,CCNA,SAASC,EAAOC,EAAKC,EAAO,CAC1B,GAAI,OAAOD,GAAQ,WACjB,OAAOA,EAAIC,CAAK,EACPD,GAAQ,OACjBA,EAAI,QAAUC,EAElB,CACA,SAASC,KAAeC,EAAM,CAC5B,OAAQC,GAAS,C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AO,GAAE,GAAGD,EAC7C,SAACU,EAAAA,IAAA4I,EAAA,MAAA,CAAM,UAAU,SAAS,EAAE,OAAQ,GAAGtJ,EACpC,SAAAE,CACH,CAAA,EACF,CAGN,EAIMwJ,GAAQ,CAAwB,CACpC,KAAAC,EAAO,IACP,QAAAC,EAAU,QACV,GAAG5J,CACL,IAEKU,EAAAA,IAAAqI,EAAO,MAAP,CAAa,QAAO,GACnB,SAAArI,EAAA,IAACmJ,GAAA,OAAA,CACC,KAAM,CAAE,KAAMC,GAAAA,OAAO,EAAG,IAAK,aAAc,EAC3C,QAAAF,EACA,KAAAD,EACC,GAAG3J,CAAA,CAAA,EAER,EAOE+J,GAAO,CAAwB,CACnC,MAAAC,EACA,SAAA9J,EACA,GAAGF,CACL,IAEIU,EAAA,IAAC4I,EAAA,MAAA,CACC,UAAU,SACV,GAAG,IACH,GAAG,IACH,MAAO,CACL,UAAW,OACX,GAAGU,CACL,EACC,GAAGhK,EAEH,SAAAE,CAAA,CACH,EAOE+J,GAAS,CAAwB,CACrC,SAAA/J,EACA,GAAGF,CACL,IAEIU,EAAA,IAAC4I,EAAA,MAAA,CACC,UAAU,MACV,QAAQ,gBACR,MAAM,SACN,GAAG,IACH,GAAG,IACH,aAAa,KACZ,GAAGtJ,EAEH,SAAAE,CAAA,CACH,EAOEgK,GAAS,CAAwB,CACrC,SAAAhK,EACA,GAAGF,CACL,IAEIU,EAAA,IAAC4I,EAAA,MAAA,CACC,UAAU,MACV,MAAM,SACN,QAAQ,WACR,IAAI,IACJ,GAAG,IACH,GAAG,IACH,UAAU,KACT,GAAGtJ,EAEH,SAAAE,CAAA,CACH,EAIEiK,EAAQ,CAAA,EASd,OAAO,OAAOA,EAAO,CACnB,KAAArC,GACA,QAAA2B,GACA,MAAAC,GACA,KAAAK,GACA,OAAAE,GACA,OAAAC,EACF,CAAC","x_google_ignoreList":[0,1,2,3,4,5,6,7,8]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../node_modules/@radix-ui/primitive/dist/index.mjs","../../../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../node_modules/@radix-ui/react-slot/dist/index.mjs","../../../../node_modules/@radix-ui/react-primitive/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs","../../src/Modal/ModalStacking.tsx","../../src/Modal/Modal.tsx"],"sourcesContent":["// packages/core/primitive/src/primitive.tsx\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nexport {\n composeEventHandlers\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-callback-ref/src/use-callback-ref.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-escape-keydown/src/use-escape-keydown.tsx\nimport * as React from \"react\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nfunction useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {\n const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);\n React.useEffect(() => {\n const handleKeyDown = (event) => {\n if (event.key === \"Escape\") {\n onEscapeKeyDown(event);\n }\n };\n ownerDocument.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n }, [onEscapeKeyDown, ownerDocument]);\n}\nexport {\n useEscapeKeydown\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-layout-effect/src/use-layout-effect.tsx\nimport * as React from \"react\";\nvar useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {\n};\nexport {\n useLayoutEffect2 as useLayoutEffect\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n","import React from \"react\";\n\nconst ModalStackingContext = React.createContext<{\n layers: Array<string>;\n setLayers: React.Dispatch<React.SetStateAction<Array<string>>>;\n addLayer: (id: string) => void;\n removeLayer: (id: string) => void;\n removeTopLayer: () => void;\n}>({\n layers: [],\n setLayers: () => {},\n addLayer: () => {},\n removeLayer: () => {},\n removeTopLayer: () => {},\n});\n\ntype ModalStackingProviderProps = {\n children: React.ReactNode;\n};\n\nconst ModalStackingProvider = ({ children }: ModalStackingProviderProps) => {\n const [layers, setLayers] = React.useState<Array<string>>([]);\n\n const addLayer = (id: string) => {\n setLayers((current) => [...current, id]);\n };\n\n const removeLayer = (id: string) => {\n setLayers(layers.filter((layer) => layer !== id));\n };\n\n const removeTopLayer = () => {\n const id = layers[layers.length - 1];\n if (!id) return;\n removeLayer(id);\n };\n\n return (\n <ModalStackingContext.Provider\n value={{ layers, setLayers, addLayer, removeLayer, removeTopLayer }}\n >\n {children}\n </ModalStackingContext.Provider>\n );\n};\n\nconst useModalStacking = () => {\n return React.useContext(ModalStackingContext);\n};\n\nexport { ModalStackingProvider, useModalStacking };\n","import * as Dialog from \"@radix-ui/react-dialog\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport * as Portal from \"@radix-ui/react-portal\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as VisuallyHidden from \"@radix-ui/react-visually-hidden\";\nimport { Button } from \"@telegraph/button\";\nimport { RefToTgphRef } from \"@telegraph/helpers\";\nimport type {\n PolymorphicProps,\n TgphComponentProps,\n TgphElement,\n} from \"@telegraph/helpers\";\nimport { Lucide } from \"@telegraph/icon\";\nimport { Box, Stack } from \"@telegraph/layout\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport React from \"react\";\n\nimport { useModalStacking } from \"./ModalStacking\";\n\ntype RootProps = Omit<\n React.ComponentPropsWithoutRef<typeof Dialog.Root>,\n \"modal\"\n> &\n React.ComponentPropsWithoutRef<typeof FocusScope> &\n TgphComponentProps<typeof Stack> & {\n a11yTitle: string;\n a11yDescription?: string;\n layer?: number;\n };\n\nconst Root = ({\n defaultOpen: defaultOpenProp,\n open: openProp,\n onOpenChange: onOpenChangeProp,\n ...props\n}: RootProps) => {\n const [open, onOpenChange] = useControllableState({\n prop: openProp,\n onChange: onOpenChangeProp,\n defaultProp: defaultOpenProp ?? false,\n });\n\n const stacking = useModalStacking();\n const id = props.a11yTitle;\n\n React.useEffect(() => {\n if (!open && stacking.layers.includes(id)) {\n stacking.removeLayer(id);\n }\n }, [id, stacking, open]);\n\n // Prevent rendering anything within the modal if it is not open\n if (!open) return;\n\n return <RootComponent open={open} onOpenChange={onOpenChange} {...props} />;\n};\n\ntype RootComponentProps = RootProps & {\n open: boolean;\n onOpenChange: (value: boolean) => void;\n};\n\nconst RootComponent = ({\n open,\n onOpenChange,\n a11yTitle,\n a11yDescription,\n children,\n // Focus scope props\n trapped,\n onMountAutoFocus,\n onUnmountAutoFocus,\n ...props\n}: RootComponentProps) => {\n // We use the a11yTitle as the id for the modal as it is unique\n // and can be used to identify the modal in the stacking context.\n // Without the need to generate a random id and manage between\n // different modal rendering patterns.\n const id = a11yTitle;\n const stacking = useModalStacking();\n React.useEffect(() => {\n if (!stacking || !open || stacking.layers.includes(id)) return;\n stacking.addLayer(id);\n }, [id, stacking, open]);\n\n const layer = stacking.layers?.indexOf(id) || 0;\n const layersLength = stacking.layers?.length || 0;\n const isStacked = layer !== 0;\n const isTopLayer = id === stacking.layers[stacking.layers.length - 1];\n\n return (\n <DismissableLayer\n onEscapeKeyDown={(event) => {\n if (!isTopLayer) return;\n event.preventDefault();\n stacking.removeTopLayer();\n onOpenChange(false);\n }}\n onPointerDownOutside={(event) => {\n if (!isTopLayer) return;\n event.preventDefault();\n stacking.removeTopLayer();\n onOpenChange(false);\n }}\n >\n <Dialog.Root\n open={open}\n onOpenChange={(value) => {\n const hasLayers = stacking?.layers?.length > 0;\n\n if (hasLayers) {\n if (\n value === false &&\n id === stacking.layers[stacking.layers.length - 1]\n ) {\n stacking.removeLayer(id);\n return onOpenChange(false);\n }\n // If the modal is not the top layer, do not call onOpenChange\n // when we are stacking the modals\n return;\n }\n\n onOpenChange(value);\n }}\n key={id}\n >\n <VisuallyHidden.Root>\n <Dialog.Title>{a11yTitle}</Dialog.Title>\n {a11yDescription && (\n <Dialog.Description>{a11yDescription}</Dialog.Description>\n )}\n </VisuallyHidden.Root>\n <AnimatePresence>\n {open && (\n // We add the className \"tgph\" here so that styles within\n // the portal get scoped properly to telegraph\n <Portal.Root className=\"tgph\">\n <Overlay layer={layer}>\n <FocusScope\n trapped={typeof trapped === \"boolean\" ? trapped : isTopLayer}\n onMountAutoFocus={onMountAutoFocus}\n onUnmountAutoFocus={onUnmountAutoFocus}\n asChild\n >\n <RefToTgphRef>\n <Stack\n as={motion.div}\n initial={{\n top: `calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${layersLength - 1})`,\n }}\n animate={{\n top: isStacked\n ? `calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${layer} )`\n : \"var(--tgph-spacing-16)\",\n }}\n exit={{ top: 0 }}\n transition={{ type: \"spring\", duration: 0.3, bounce: 0 }}\n w=\"full\"\n justify=\"center\"\n style={{\n position: \"fixed\",\n left: 0,\n maxHeight: \"calc(100vh - var(--tgph-spacing-32))\",\n maxWidth: \"calc(100vw - var(--tgph-spacing-8))\",\n zIndex: `calc(var(--tgph-zIndex-modal) + ${layer})`,\n }}\n key={`container-${id}`}\n >\n <Stack\n direction=\"column\"\n as={motion.div}\n animate={{\n scale: 1.02 - Math.abs(layersLength - layer) * 0.02,\n transformOrigin: \"center center\",\n }}\n transition={{\n duration: 0.2,\n bounce: 0,\n type: \"spring\",\n }}\n maxW={props.maxW ?? \"160\"}\n w={props.w ?? \"full\"}\n bg=\"surface-1\"\n border=\"px\"\n rounded=\"4\"\n shadow=\"3\"\n key={`content-${id}`}\n {...props}\n >\n {children}\n </Stack>\n </Stack>\n </RefToTgphRef>\n </FocusScope>\n </Overlay>\n </Portal.Root>\n )}\n </AnimatePresence>\n </Dialog.Root>\n </DismissableLayer>\n );\n};\n\ntype OverlayProps = TgphComponentProps<typeof Box> & {\n layer: number;\n};\n\nconst Overlay = ({ layer, children }: OverlayProps) => {\n // If the layer is greater than 0, we don't want to show this\n // overlay as to not stack the overlays on top of each other.\n if (layer > 0) return children;\n return (\n <Dialog.Overlay>\n <Box\n as={motion.div}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n transition={{ duration: 0.3, bounce: 0, type: \"spring\" }}\n bg=\"alpha-black-6\"\n w=\"full\"\n h=\"full\"\n zIndex=\"overlay\"\n style={{\n position: \"fixed\",\n cursor: \"pointer\",\n inset: \"0px\",\n }}\n />\n {children}\n </Dialog.Overlay>\n );\n};\n\ntype ContentProps = React.ComponentPropsWithoutRef<typeof Dialog.Content> &\n TgphComponentProps<typeof Stack>;\ntype ContentRef = React.ElementRef<typeof Dialog.Content>;\n\nconst Content = React.forwardRef<ContentRef, ContentProps>(\n ({ children, ...props }, forwardedRef) => {\n return (\n <Dialog.Content ref={forwardedRef} asChild {...props}>\n <Stack direction=\"column\" h=\"full\" {...props}>\n {children}\n </Stack>\n </Dialog.Content>\n );\n },\n);\n\ntype CloseProps<T extends TgphElement> = TgphComponentProps<typeof Button<T>> &\n Omit<React.ComponentPropsWithoutRef<typeof Dialog.Close>, \"color\">;\nconst Close = <T extends TgphElement>({\n size = \"1\",\n variant = \"ghost\",\n ...props\n}: CloseProps<T>) => {\n return (\n <Dialog.Close asChild>\n <Button\n icon={{ icon: Lucide.X, alt: \"Close Modal\" }}\n variant={variant}\n size={size}\n {...props}\n />\n </Dialog.Close>\n );\n};\n\ntype BodyProps<T extends TgphElement> = PolymorphicProps<T> &\n TgphComponentProps<typeof Stack>;\n\nconst Body = <T extends TgphElement>({\n style,\n children,\n ...props\n}: BodyProps<T>) => {\n return (\n <Stack\n direction=\"column\"\n px=\"6\"\n py=\"4\"\n style={{\n overflowY: \"auto\",\n ...style,\n }}\n {...props}\n >\n {children}\n </Stack>\n );\n};\n\ntype HeaderProps<T extends TgphElement> = PolymorphicProps<T> &\n TgphComponentProps<typeof Stack>;\n\nconst Header = <T extends TgphElement>({\n children,\n ...props\n}: HeaderProps<T>) => {\n return (\n <Stack\n direction=\"row\"\n justify=\"space-between\"\n align=\"center\"\n px=\"6\"\n py=\"4\"\n borderBottom=\"px\"\n {...props}\n >\n {children}\n </Stack>\n );\n};\n\ntype FooterProps<T extends TgphElement> = PolymorphicProps<T> &\n TgphComponentProps<typeof Stack>;\n\nconst Footer = <T extends TgphElement>({\n children,\n ...props\n}: FooterProps<T>) => {\n return (\n <Stack\n direction=\"row\"\n align=\"center\"\n justify=\"flex-end\"\n gap=\"2\"\n px=\"6\"\n py=\"4\"\n borderTop=\"px\"\n {...props}\n >\n {children}\n </Stack>\n );\n};\n\nconst Modal = {} as {\n Root: typeof Root;\n Content: typeof Content;\n Close: typeof Close;\n Body: typeof Body;\n Header: typeof Header;\n Footer: typeof Footer;\n};\n\nObject.assign(Modal, {\n Root,\n Content,\n Close,\n Body,\n Header,\n Footer,\n});\n\nexport { Modal };\n"],"names":["composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","useComposedRefs","React","createSlot","ownerName","SlotClone","createSlotClone","Slot2","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","childrenRef","getElementRef","props2","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","element","getter","_a","mayWarn","_b","NODES","Primitive","primitive","Slot","Node","asChild","primitiveProps","Comp","dispatchDiscreteCustomEvent","target","ReactDOM","useCallbackRef","callback","callbackRef","useEscapeKeydown","onEscapeKeyDownProp","ownerDocument","onEscapeKeyDown","handleKeyDown","DISMISSABLE_LAYER_NAME","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","DismissableLayer","disableOutsidePointerEvents","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","setNode","force","composedRefs","node2","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","pointerDownOutside","usePointerDownOutside","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","dispatchUpdate","handleUpdate","BRANCH_NAME","DismissableLayerBranch","handlePointerDownOutside","isPointerInsideReactTreeRef","handleClickRef","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","handleAndDispatchCustomEvent","eventDetail","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","useLayoutEffect2","useInsertionEffect","useLayoutEffect","useControllableState","prop","defaultProp","onChange","caller","uncontrolledProp","setUncontrolledProp","onChangeRef","useUncontrolledState","isControlled","isControlledRef","wasControlled","setValue","nextValue","value2","isFunction","prevValueRef","ModalStackingContext","ModalStackingProvider","setLayers","addLayer","id","current","removeLayer","layer","removeTopLayer","useModalStacking","Root","defaultOpenProp","openProp","onOpenChangeProp","open","onOpenChange","stacking","RootComponent","a11yTitle","a11yDescription","trapped","onMountAutoFocus","onUnmountAutoFocus","layersLength","isStacked","isTopLayer","jsxs","Dialog","VisuallyHidden","AnimatePresence","Portal","Overlay","FocusScope","RefToTgphRef","Stack","motion","Box","Content","Close","size","variant","Button","Lucide","Body","style","Header","Footer","Modal"],"mappings":"+wBACA,SAASA,EAAqBC,EAAsBC,EAAiB,CAAE,yBAAAC,EAA2B,EAAM,EAAG,GAAI,CAC7G,OAAO,SAAqBC,EAAO,CAEjC,GADAH,GAAA,MAAAA,EAAuBG,GACnBD,IAA6B,IAAS,CAACC,EAAM,iBAC/C,OAAOF,GAAA,YAAAA,EAAkBE,EAE5B,CACH,CCNA,SAASC,EAAOC,EAAKC,EAAO,CAC1B,GAAI,OAAOD,GAAQ,WACjB,OAAOA,EAAIC,CAAK,EACPD,GAAQ,OACjBA,EAAI,QAAUC,EAElB,CACA,SAASC,KAAeC,EAAM,CAC5B,OAAQC,GAAS,CACf,IAAIC,EAAa,GACjB,MAAMC,EAAWH,EAAK,IAAKH,GAAQ,CACjC,MAAMO,EAAUR,EAAOC,EAAKI,CAAI,EAChC,MAAI,CAACC,GAAc,OAAOE,GAAW,aACnCF,EAAa,IAERE,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