@telegraph/modal 0.0.69 → 0.0.73
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 +28 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +167 -156
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @telegraph/modal
|
|
2
2
|
|
|
3
|
+
## 0.0.73
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#384](https://github.com/knocklabs/telegraph/pull/384) [`552fb82`](https://github.com/knocklabs/telegraph/commit/552fb82a33203c87e58715b4a52ea0c360999636) Thanks [@dependabot](https://github.com/apps/dependabot)! - upgrade typescript dep
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`552fb82`](https://github.com/knocklabs/telegraph/commit/552fb82a33203c87e58715b4a52ea0c360999636)]:
|
|
10
|
+
- @telegraph/style-engine@0.1.8
|
|
11
|
+
- @telegraph/helpers@0.0.11
|
|
12
|
+
- @telegraph/button@0.0.72
|
|
13
|
+
- @telegraph/layout@0.1.12
|
|
14
|
+
- @telegraph/icon@0.0.46
|
|
15
|
+
|
|
16
|
+
## 0.0.72
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#408](https://github.com/knocklabs/telegraph/pull/408) [`916d37c`](https://github.com/knocklabs/telegraph/commit/916d37cc78433eeb70a93e041b18f951d2d25bcd) Thanks [@MikeCarbone](https://github.com/MikeCarbone)! - chore: minor upgrades to react, fixes peer dependency issues
|
|
21
|
+
|
|
22
|
+
- [#409](https://github.com/knocklabs/telegraph/pull/409) [`734b5c5`](https://github.com/knocklabs/telegraph/commit/734b5c5ee2ac0484a09f534148a4ca1cf23fb3d0) Thanks [@MikeCarbone](https://github.com/MikeCarbone)! - chore: adds React 19 as a peer dependency
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [[`916d37c`](https://github.com/knocklabs/telegraph/commit/916d37cc78433eeb70a93e041b18f951d2d25bcd), [`734b5c5`](https://github.com/knocklabs/telegraph/commit/734b5c5ee2ac0484a09f534148a4ca1cf23fb3d0)]:
|
|
25
|
+
- @telegraph/button@0.0.71
|
|
26
|
+
- @telegraph/helpers@0.0.10
|
|
27
|
+
- @telegraph/icon@0.0.45
|
|
28
|
+
- @telegraph/layout@0.1.11
|
|
29
|
+
- @telegraph/style-engine@0.1.7
|
|
30
|
+
|
|
3
31
|
## 0.0.69
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),Z=require("@radix-ui/react-dialog"),g=require("react"),G=require("react-dom"),J=require("@radix-ui/react-focus-scope"),Q=require("@radix-ui/react-portal"),ee=require("@radix-ui/react-visually-hidden"),te=require("@telegraph/button"),ne=require("@telegraph/helpers"),re=require("@telegraph/icon"),m=require("@telegraph/layout"),w=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 r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const b=C(Z),i=C(g),se=C(G),oe=C(Q),ie=C(ee);function T(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function ae(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function A(...e){return t=>e.forEach(n=>ae(n,t))}function q(...e){return i.useCallback(A(...e),e)}var I=i.forwardRef((e,t)=>{const{children:n,...r}=e,s=i.Children.toArray(n),o=s.find(le);if(o){const a=o.props.children,c=s.map(p=>p===o?i.Children.count(a)>1?i.Children.only(null):i.isValidElement(a)?a.props.children:null:p);return d.jsx(k,{...r,ref:t,children:i.isValidElement(a)?i.cloneElement(a,void 0,c):null})}return d.jsx(k,{...r,ref:t,children:n})});I.displayName="Slot";var k=i.forwardRef((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const s=de(n);return i.cloneElement(n,{...ue(r,n.props),ref:t?A(t,s):s})}return i.Children.count(n)>1?i.Children.only(null):null});k.displayName="SlotClone";var ce=({children:e})=>d.jsx(d.Fragment,{children:e});function le(e){return i.isValidElement(e)&&e.type===ce}function ue(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...c)=>{o(...c),s(...c)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function de(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.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((r,s)=>{const{asChild:o,...a}=r,c=o?I:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...a,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function pe(e,t){e&&se.flushSync(()=>e.dispatchEvent(t))}function P(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ye(e,t=globalThis==null?void 0:globalThis.document){const n=P(e);i.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var he="DismissableLayer",B="dismissableLayer.update",ve="dismissableLayer.pointerDownOutside",me="dismissableLayer.focusOutside",M,U=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),V=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...p}=e,l=i.useContext(U),[u,y]=i.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,R]=i.useState({}),E=q(t,f=>y(f)),x=Array.from(l.layers),[L]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=x.indexOf(L),S=u?x.indexOf(u):-1,O=l.layersWithOutsidePointerEventsDisabled.size>0,N=S>=v,Y=Ee(f=>{const j=f.target,_=[...l.branches].some(D=>D.contains(j));!N||_||(s==null||s(f),a==null||a(f),f.defaultPrevented||c==null||c())},h),W=xe(f=>{const j=f.target;[...l.branches].some(D=>D.contains(j))||(o==null||o(f),a==null||a(f),f.defaultPrevented||c==null||c())},h);return ye(f=>{S===l.layers.size-1&&(r==null||r(f),!f.defaultPrevented&&c&&(f.preventDefault(),c()))},h),i.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(M=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),F(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=M)}},[u,h,n,l]),i.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),F())},[u,l]),i.useEffect(()=>{const f=()=>R({});return document.addEventListener(B,f),()=>document.removeEventListener(B,f)},[]),d.jsx(z.div,{...p,ref:E,style:{pointerEvents:O?N?"auto":"none":void 0,...e.style},onFocusCapture:T(e.onFocusCapture,W.onFocusCapture),onBlurCapture:T(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:T(e.onPointerDownCapture,Y.onPointerDownCapture)})});V.displayName=he;var ge="DismissableLayerBranch",be=i.forwardRef((e,t)=>{const n=i.useContext(U),r=i.useRef(null),s=q(t,r);return i.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(z.div,{...e,ref:s})});be.displayName=ge;function Ee(e,t=globalThis==null?void 0:globalThis.document){const n=P(e),r=i.useRef(!1),s=i.useRef(()=>{});return i.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let p=function(){$(ve,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=p,t.addEventListener("click",s.current,{once:!0})):p()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function xe(e,t=globalThis==null?void 0:globalThis.document){const n=P(e),r=i.useRef(!1);return i.useEffect(()=>{const s=o=>{o.target&&!r.current&&$(me,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function F(){const e=new CustomEvent(B);document.dispatchEvent(e)}function $(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?pe(s,o):s.dispatchEvent(o)}function Ce({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=Pe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:r,c=P(n),p=i.useCallback(l=>{if(o){const y=typeof l=="function"?l(e):l;y!==e&&c(y)}else s(l)},[o,e,s,c]);return[a,p]}function Pe({defaultProp:e,onChange:t}){const n=i.useState(e),[r]=n,s=i.useRef(r),o=P(t);return i.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}const K=g.createContext({layers:[],setLayers:()=>{},addLayer:()=>{},removeLayer:()=>{},removeTopLayer:()=>{}}),Le=({children:e})=>{const[t,n]=g.useState([]),r=a=>{n(c=>[...c,a])},s=a=>{n(t.filter(c=>c!==a))},o=()=>{const a=t[t.length-1];a&&s(a)};return d.jsx(K.Provider,{value:{layers:t,setLayers:n,addLayer:r,removeLayer:s,removeTopLayer:o},children:e})},H=()=>g.useContext(K),Oe=({defaultOpen:e,open:t,onOpenChange:n,...r})=>{const[s,o]=Ce({prop:t,onChange:n,defaultProp:e}),a=H(),c=r.a11yTitle;if(g.useEffect(()=>{!s&&a.layers.includes(c)&&a.removeLayer(c)},[c,a,s]),!!s)return d.jsx(je,{open:s,onOpenChange:o,...r})},je=({open:e,onOpenChange:t,a11yTitle:n,a11yDescription:r,children:s,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:c,...p})=>{var x,L;const l=n,u=H();g.useEffect(()=>{!u||!e||u.layers.includes(l)||u.addLayer(l)},[l,u,e]);const y=((x=u.layers)==null?void 0:x.indexOf(l))||0,h=((L=u.layers)==null?void 0:L.length)||0,R=y!==0,E=l===u.layers[u.layers.length-1];return d.jsx(V,{onEscapeKeyDown:v=>{E&&(v.preventDefault(),u.removeTopLayer(),t(!1))},onPointerDownOutside:v=>{E&&(v.preventDefault(),u.removeTopLayer(),t(!1))},children:d.jsxs(b.Root,{open:e,onOpenChange:v=>{var O;if(((O=u==null?void 0:u.layers)==null?void 0:O.length)>0)return v===!1&&l===u.layers[u.layers.length-1]?(u.removeLayer(l),t(!1)):void 0;t(v)},children:[d.jsxs(ie.Root,{children:[d.jsx(b.Title,{children:n}),r&&d.jsx(b.Description,{children:r})]}),d.jsx(w.AnimatePresence,{children:e&&d.jsx(oe.Root,{className:"tgph",children:d.jsx(we,{layer:y,children:d.jsx(J.FocusScope,{trapped:typeof o=="boolean"?o:E,onMountAutoFocus:a,onUnmountAutoFocus:c,asChild:!0,children:d.jsx(ne.RefToTgphRef,{children:d.jsx(m.Stack,{as:w.motion.div,initial:{top:`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${h-1})`},animate:{top:R?`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:w.motion.div,animate:{scale:1.02-Math.abs(h-y)*.02,transformOrigin:"center center"},transition:{duration:.2,bounce:0,type:"spring"},maxW:p.maxW??"160",w:p.w??"full",bg:"surface-1",border:"px",rounded:"4",shadow:"3",...p,children:s},`content-${l}`)},`container-${l}`)})})})})})]},l)})},we=({layer:e,children:t})=>e>0?t:d.jsxs(b.Overlay,{children:[d.jsx(m.Box,{as:w.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]}),Re=g.forwardRef(({children:e,...t},n)=>d.jsx(b.Content,{ref:n,asChild:!0,...t,children:d.jsx(m.Stack,{direction:"column",h:"full",...t,children:e})})),Se=({size:e="1",variant:t="ghost",...n})=>d.jsx(b.Close,{asChild:!0,children:d.jsx(te.Button,{icon:{icon:re.Lucide.X,alt:"Close Modal"},variant:t,size:e,...n})}),De=({style:e,children:t,...n})=>d.jsx(m.Stack,{direction:"column",px:"6",py:"4",style:{overflowY:"auto",...e},...n,children:t}),Te=({children:e,...t})=>d.jsx(m.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...t,children:e}),ke=({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}),X={};Object.assign(X,{Root:Oe,Content:Re,Close:Se,Body:De,Header:Te,Footer:ke});exports.Modal=X;exports.ModalStackingProvider=Le;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=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"),w=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 b=C(G),i=C(g),oe=C(J),ie=C(ee),ae=C(te);function T(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 q(...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 I(...e){return i.useCallback(q(...e),e)}var z=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,c=r.map(p=>p===o?i.Children.count(a)>1?i.Children.only(null):i.isValidElement(a)?a.props.children:null:p);return d.jsx(k,{...s,ref:t,children:i.isValidElement(a)?i.cloneElement(a,void 0,c):null})}return d.jsx(k,{...s,ref:t,children:n})});z.displayName="Slot";var k=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?q(t,r):r),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null});k.displayName="SlotClone";var ce=({children:e})=>d.jsx(d.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]=(...c)=>{o(...c),r(...c)}: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"],U=fe.reduce((e,t)=>{const n=i.forwardRef((s,r)=>{const{asChild:o,...a}=s,c=o?z:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(c,{...a,ref:r})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function pe(e,t){e&&oe.flushSync(()=>e.dispatchEvent(t))}function P(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=P(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",B="dismissableLayer.update",ve="dismissableLayer.pointerDownOutside",me="dismissableLayer.focusOutside",F,V=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...p}=e,l=i.useContext(V),[u,y]=i.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,R]=i.useState({}),E=I(t,f=>y(f)),x=Array.from(l.layers),[L]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=x.indexOf(L),S=u?x.indexOf(u):-1,O=l.layersWithOutsidePointerEventsDisabled.size>0,N=S>=v,Z=Ee(f=>{const j=f.target,_=[...l.branches].some(D=>D.contains(j));!N||_||(r==null||r(f),a==null||a(f),f.defaultPrevented||c==null||c())},h),W=xe(f=>{const j=f.target;[...l.branches].some(D=>D.contains(j))||(o==null||o(f),a==null||a(f),f.defaultPrevented||c==null||c())},h);return ye(f=>{S===l.layers.size-1&&(s==null||s(f),!f.defaultPrevented&&c&&(f.preventDefault(),c()))},h),i.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(F=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),A(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=F)}},[u,h,n,l]),i.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),A())},[u,l]),i.useEffect(()=>{const f=()=>R({});return document.addEventListener(B,f),()=>document.removeEventListener(B,f)},[]),d.jsx(U.div,{...p,ref:E,style:{pointerEvents:O?N?"auto":"none":void 0,...e.style},onFocusCapture:T(e.onFocusCapture,W.onFocusCapture),onBlurCapture:T(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:T(e.onPointerDownCapture,Z.onPointerDownCapture)})});$.displayName=he;var ge="DismissableLayerBranch",be=i.forwardRef((e,t)=>{const n=i.useContext(V),s=i.useRef(null),r=I(t,s);return i.useEffect(()=>{const o=s.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(U.div,{...e,ref:r})});be.displayName=ge;function Ee(e,t=globalThis==null?void 0:globalThis.document){const n=P(e),s=i.useRef(!1),r=i.useRef(()=>{});return i.useEffect(()=>{const o=c=>{if(c.target&&!s.current){let p=function(){K(ve,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=p,t.addEventListener("click",r.current,{once:!0})):p()}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=P(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(B);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)}function Ce({prop:e,defaultProp:t,onChange:n=()=>{}}){const[s,r]=Pe({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:s,c=P(n),p=i.useCallback(l=>{if(o){const y=typeof l=="function"?l(e):l;y!==e&&c(y)}else r(l)},[o,e,r,c]);return[a,p]}function Pe({defaultProp:e,onChange:t}){const n=i.useState(e),[s]=n,r=i.useRef(s),o=P(t);return i.useEffect(()=>{r.current!==s&&(o(s),r.current=s)},[s,r,o]),n}const H=g.createContext({layers:[],setLayers:()=>{},addLayer:()=>{},removeLayer:()=>{},removeTopLayer:()=>{}}),Le=({children:e})=>{const[t,n]=g.useState([]),s=a=>{n(c=>[...c,a])},r=a=>{n(t.filter(c=>c!==a))},o=()=>{const a=t[t.length-1];a&&r(a)};return d.jsx(H.Provider,{value:{layers:t,setLayers:n,addLayer:s,removeLayer:r,removeTopLayer:o},children:e})},X=()=>g.useContext(H),Oe=({defaultOpen:e,open:t,onOpenChange:n,...s})=>{const[r,o]=Ce({prop:t,onChange:n,defaultProp:e}),a=X(),c=s.a11yTitle;if(g.useEffect(()=>{!r&&a.layers.includes(c)&&a.removeLayer(c)},[c,a,r]),!!r)return d.jsx(je,{open:r,onOpenChange:o,...s})},je=({open:e,onOpenChange:t,a11yTitle:n,a11yDescription:s,children:r,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:c,...p})=>{var x,L;const l=n,u=X();g.useEffect(()=>{!u||!e||u.layers.includes(l)||u.addLayer(l)},[l,u,e]);const y=((x=u.layers)==null?void 0:x.indexOf(l))||0,h=((L=u.layers)==null?void 0:L.length)||0,R=y!==0,E=l===u.layers[u.layers.length-1];return d.jsx($,{onEscapeKeyDown:v=>{E&&(v.preventDefault(),u.removeTopLayer(),t(!1))},onPointerDownOutside:v=>{E&&(v.preventDefault(),u.removeTopLayer(),t(!1))},children:d.jsxs(b.Root,{open:e,onOpenChange:v=>{var O;if(((O=u==null?void 0:u.layers)==null?void 0:O.length)>0)return v===!1&&l===u.layers[u.layers.length-1]?(u.removeLayer(l),t(!1)):void 0;t(v)},children:[d.jsxs(ae.Root,{children:[d.jsx(b.Title,{children:n}),s&&d.jsx(b.Description,{children:s})]}),d.jsx(w.AnimatePresence,{children:e&&d.jsx(ie.Root,{className:"tgph",children:d.jsx(we,{layer:y,children:d.jsx(Q.FocusScope,{trapped:typeof o=="boolean"?o:E,onMountAutoFocus:a,onUnmountAutoFocus:c,asChild:!0,children:d.jsx(re.RefToTgphRef,{children:d.jsx(m.Stack,{as:w.motion.div,initial:{top:`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${h-1})`},animate:{top:R?`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:w.motion.div,animate:{scale:1.02-Math.abs(h-y)*.02,transformOrigin:"center center"},transition:{duration:.2,bounce:0,type:"spring"},maxW:p.maxW??"160",w:p.w??"full",bg:"surface-1",border:"px",rounded:"4",shadow:"3",...p,children:r},`content-${l}`)},`container-${l}`)})})})})})]},l)})},we=({layer:e,children:t})=>e>0?t:d.jsxs(b.Overlay,{children:[d.jsx(m.Box,{as:w.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]}),Re=g.forwardRef(({children:e,...t},n)=>d.jsx(b.Content,{ref:n,asChild:!0,...t,children:d.jsx(m.Stack,{direction:"column",h:"full",...t,children:e})})),Se=({size:e="1",variant:t="ghost",...n})=>d.jsx(b.Close,{asChild:!0,children:d.jsx(ne.Button,{icon:{icon:se.Lucide.X,alt:"Close Modal"},variant:t,size:e,...n})}),De=({style:e,children:t,...n})=>d.jsx(m.Stack,{direction:"column",px:"6",py:"4",style:{overflowY:"auto",...e},...n,children:t}),Te=({children:e,...t})=>d.jsx(m.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...t,children:e}),ke=({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}),Y={};Object.assign(Y,{Root:Oe,Content:Re,Close:Se,Body:De,Header:Te,Footer:ke});exports.Modal=Y;exports.ModalStackingProvider=Le;
|
|
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/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-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 ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => refs.forEach((ref) => setRef(ref, node));\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, 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 return React.cloneElement(children, {\n ...mergeProps(slotProps, children.props),\n // @ts-ignore\n ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef\n });\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\nSlotClone.displayName = \"SlotClone\";\nvar Slottable = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment, { 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/DismissableLayer.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-controllable-state/src/useControllableState.tsx\nimport * as React from \"react\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n }\n}) {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useCallbackRef(onChange);\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue;\n const value2 = typeof nextValue === \"function\" ? setter(prop) : nextValue;\n if (value2 !== prop) handleChange(value2);\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const uncontrolledState = React.useState(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = React.useRef(value);\n const handleChange = useCallbackRef(onChange);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n return uncontrolledState;\n}\nexport {\n useControllableState\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","useComposedRefs","React","Slot","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","SlotClone","childrenRef","getElementRef","mergeProps","Slottable","Fragment","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","useControllableState","prop","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","useUncontrolledState","isControlled","handleChange","setValue","nextValue","value2","uncontrolledState","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":"ixBACA,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,GAAOC,EAAKC,EAAO,CACtB,OAAOD,GAAQ,WACjBA,EAAIC,CAAK,EACAD,GAAQ,OACjBA,EAAI,QAAUC,EAElB,CACA,SAASC,KAAeC,EAAM,CAC5B,OAAQC,GAASD,EAAK,QAASH,GAAQD,GAAOC,EAAKI,CAAI,CAAC,CAC1D,CACA,SAASC,KAAmBF,EAAM,CAChC,OAAOG,EAAM,YAAYJ,EAAY,GAAGC,CAAI,EAAGA,CAAI,CACrD,CCVA,IAAII,EAAOD,EAAM,WAAW,CAACE,EAAOC,IAAiB,CACnD,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAS,EAAKH,EAC7BI,EAAgBN,EAAM,SAAS,QAAQI,CAAQ,EAC/CG,EAAYD,EAAc,KAAKE,EAAW,EAChD,GAAID,EA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ACF,CAGN,EAIMiJ,GAAQ,CAAwB,CACpC,KAAAC,EAAO,IACP,QAAAC,EAAU,QACV,GAAGrJ,CACL,IAEKU,EAAAA,IAAA8H,EAAO,MAAP,CAAa,QAAO,GACnB,SAAA9H,EAAA,IAAC4I,GAAA,OAAA,CACC,KAAM,CAAE,KAAMC,GAAAA,OAAO,EAAG,IAAK,aAAc,EAC3C,QAAAF,EACA,KAAAD,EACC,GAAGpJ,CAAA,CAAA,EAER,EAOEwJ,GAAO,CAAwB,CACnC,MAAAC,EACA,SAAAvJ,EACA,GAAGF,CACL,IAEIU,EAAA,IAACqI,EAAA,MAAA,CACC,UAAU,SACV,GAAG,IACH,GAAG,IACH,MAAO,CACL,UAAW,OACX,GAAGU,CACL,EACC,GAAGzJ,EAEH,SAAAE,CAAA,CACH,EAOEwJ,GAAS,CAAwB,CACrC,SAAAxJ,EACA,GAAGF,CACL,IAEIU,EAAA,IAACqI,EAAA,MAAA,CACC,UAAU,MACV,QAAQ,gBACR,MAAM,SACN,GAAG,IACH,GAAG,IACH,aAAa,KACZ,GAAG/I,EAEH,SAAAE,CAAA,CACH,EAOEyJ,GAAS,CAAwB,CACrC,SAAAzJ,EACA,GAAGF,CACL,IAEIU,EAAA,IAACqI,EAAA,MAAA,CACC,UAAU,MACV,MAAM,SACN,QAAQ,WACR,IAAI,IACJ,GAAG,IACH,GAAG,IACH,UAAU,KACT,GAAG/I,EAEH,SAAAE,CAAA,CACH,EAIE0J,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]}
|
|
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-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-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-controllable-state/src/useControllableState.tsx\nimport * as React from \"react\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n }\n}) {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useCallbackRef(onChange);\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue;\n const value2 = typeof nextValue === \"function\" ? setter(prop) : nextValue;\n if (value2 !== prop) handleChange(value2);\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const uncontrolledState = React.useState(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = React.useRef(value);\n const handleChange = useCallbackRef(onChange);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n return uncontrolledState;\n}\nexport {\n useControllableState\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","useControllableState","prop","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","useUncontrolledState","isControlled","handleChange","setValue","nextValue","value2","uncontrolledState","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,CACf,IAAIC,EAAa,GACjB,MAAMC,EAAWH,EAAK,IAAKH,GAAQ,CACjC,MAAMO,EAAUR,EAAOC,EAAKI,CAAI,EAChC,MAAI,CAACC,GAAc,OAAOE,GAAW,aACnCF,EAAa,IAERE,CACb,CAAK,E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J,GAAS,CAAwB,CACrC,SAAA1J,EACA,GAAGF,CACL,IAEIU,EAAA,IAACsI,EAAA,MAAA,CACC,UAAU,MACV,MAAM,SACN,QAAQ,WACR,IAAI,IACJ,GAAG,IACH,GAAG,IACH,UAAU,KACT,GAAGhJ,EAEH,SAAAE,CAAA,CACH,EAIE2J,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]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,71 +1,82 @@
|
|
|
1
|
-
import { jsx as d, Fragment as
|
|
1
|
+
import { jsx as d, Fragment as q, jsxs as T } from "react/jsx-runtime";
|
|
2
2
|
import * as v from "@radix-ui/react-dialog";
|
|
3
3
|
import * as i from "react";
|
|
4
4
|
import E from "react";
|
|
5
|
-
import * as
|
|
6
|
-
import { FocusScope as
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { RefToTgphRef as
|
|
11
|
-
import { Lucide as
|
|
12
|
-
import { Stack as g, Box as
|
|
13
|
-
import { AnimatePresence as
|
|
14
|
-
function S(
|
|
5
|
+
import * as G from "react-dom";
|
|
6
|
+
import { FocusScope as J } from "@radix-ui/react-focus-scope";
|
|
7
|
+
import * as Q from "@radix-ui/react-portal";
|
|
8
|
+
import * as ee from "@radix-ui/react-visually-hidden";
|
|
9
|
+
import { Button as te } from "@telegraph/button";
|
|
10
|
+
import { RefToTgphRef as ne } from "@telegraph/helpers";
|
|
11
|
+
import { Lucide as re } from "@telegraph/icon";
|
|
12
|
+
import { Stack as g, Box as se } from "@telegraph/layout";
|
|
13
|
+
import { AnimatePresence as oe, motion as B } from "framer-motion";
|
|
14
|
+
function S(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
15
15
|
return function(r) {
|
|
16
|
-
if (
|
|
17
|
-
return
|
|
16
|
+
if (e == null || e(r), n === !1 || !r.defaultPrevented)
|
|
17
|
+
return t == null ? void 0 : t(r);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
typeof
|
|
20
|
+
function I(e, t) {
|
|
21
|
+
if (typeof e == "function")
|
|
22
|
+
return e(t);
|
|
23
|
+
e != null && (e.current = t);
|
|
22
24
|
}
|
|
23
|
-
function
|
|
24
|
-
return (
|
|
25
|
+
function _(...e) {
|
|
26
|
+
return (t) => {
|
|
27
|
+
let n = !1;
|
|
28
|
+
const s = e.map((r) => {
|
|
29
|
+
const o = I(r, t);
|
|
30
|
+
return !n && typeof o == "function" && (n = !0), o;
|
|
31
|
+
});
|
|
32
|
+
if (n)
|
|
33
|
+
return () => {
|
|
34
|
+
for (let r = 0; r < s.length; r++) {
|
|
35
|
+
const o = s[r];
|
|
36
|
+
typeof o == "function" ? o() : I(e[r], null);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
};
|
|
25
40
|
}
|
|
26
|
-
function
|
|
27
|
-
return i.useCallback(
|
|
41
|
+
function U(...e) {
|
|
42
|
+
return i.useCallback(_(...e), e);
|
|
28
43
|
}
|
|
29
|
-
var
|
|
30
|
-
const { children: n, ...s } =
|
|
44
|
+
var z = i.forwardRef((e, t) => {
|
|
45
|
+
const { children: n, ...s } = e, r = i.Children.toArray(n), o = r.find(ae);
|
|
31
46
|
if (o) {
|
|
32
47
|
const a = o.props.children, c = r.map((p) => p === o ? i.Children.count(a) > 1 ? i.Children.only(null) : i.isValidElement(a) ? a.props.children : null : p);
|
|
33
|
-
return /* @__PURE__ */ d(W, { ...s, ref:
|
|
48
|
+
return /* @__PURE__ */ d(W, { ...s, ref: t, children: i.isValidElement(a) ? i.cloneElement(a, void 0, c) : null });
|
|
34
49
|
}
|
|
35
|
-
return /* @__PURE__ */ d(W, { ...s, ref:
|
|
50
|
+
return /* @__PURE__ */ d(W, { ...s, ref: t, children: n });
|
|
36
51
|
});
|
|
37
|
-
|
|
38
|
-
var W = i.forwardRef((
|
|
39
|
-
const { children: n, ...s } =
|
|
52
|
+
z.displayName = "Slot";
|
|
53
|
+
var W = i.forwardRef((e, t) => {
|
|
54
|
+
const { children: n, ...s } = e;
|
|
40
55
|
if (i.isValidElement(n)) {
|
|
41
|
-
const r = le(n);
|
|
42
|
-
return i.cloneElement(n,
|
|
43
|
-
...ce(s, n.props),
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
ref: e ? j(e, r) : r
|
|
46
|
-
});
|
|
56
|
+
const r = le(n), o = ce(s, n.props);
|
|
57
|
+
return n.type !== i.Fragment && (o.ref = t ? _(t, r) : r), i.cloneElement(n, o);
|
|
47
58
|
}
|
|
48
59
|
return i.Children.count(n) > 1 ? i.Children.only(null) : null;
|
|
49
60
|
});
|
|
50
61
|
W.displayName = "SlotClone";
|
|
51
|
-
var ie = ({ children:
|
|
52
|
-
function ae(
|
|
53
|
-
return i.isValidElement(
|
|
62
|
+
var ie = ({ children: e }) => /* @__PURE__ */ d(q, { children: e });
|
|
63
|
+
function ae(e) {
|
|
64
|
+
return i.isValidElement(e) && e.type === ie;
|
|
54
65
|
}
|
|
55
|
-
function ce(
|
|
56
|
-
const n = { ...
|
|
57
|
-
for (const s in
|
|
58
|
-
const r =
|
|
66
|
+
function ce(e, t) {
|
|
67
|
+
const n = { ...t };
|
|
68
|
+
for (const s in t) {
|
|
69
|
+
const r = e[s], o = t[s];
|
|
59
70
|
/^on[A-Z]/.test(s) ? r && o ? n[s] = (...c) => {
|
|
60
71
|
o(...c), r(...c);
|
|
61
72
|
} : r && (n[s] = r) : s === "style" ? n[s] = { ...r, ...o } : s === "className" && (n[s] = [r, o].filter(Boolean).join(" "));
|
|
62
73
|
}
|
|
63
|
-
return { ...
|
|
74
|
+
return { ...e, ...n };
|
|
64
75
|
}
|
|
65
|
-
function le(
|
|
76
|
+
function le(e) {
|
|
66
77
|
var s, r;
|
|
67
|
-
let
|
|
68
|
-
return n ?
|
|
78
|
+
let t = (s = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : s.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
79
|
+
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);
|
|
69
80
|
}
|
|
70
81
|
var ue = [
|
|
71
82
|
"a",
|
|
@@ -84,40 +95,40 @@ var ue = [
|
|
|
84
95
|
"span",
|
|
85
96
|
"svg",
|
|
86
97
|
"ul"
|
|
87
|
-
],
|
|
98
|
+
], V = ue.reduce((e, t) => {
|
|
88
99
|
const n = i.forwardRef((s, r) => {
|
|
89
|
-
const { asChild: o, ...a } = s, c = o ?
|
|
100
|
+
const { asChild: o, ...a } = s, c = o ? z : t;
|
|
90
101
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ d(c, { ...a, ref: r });
|
|
91
102
|
});
|
|
92
|
-
return n.displayName = `Primitive.${
|
|
103
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
93
104
|
}, {});
|
|
94
|
-
function de(
|
|
95
|
-
|
|
105
|
+
function de(e, t) {
|
|
106
|
+
e && G.flushSync(() => e.dispatchEvent(t));
|
|
96
107
|
}
|
|
97
|
-
function L(
|
|
98
|
-
const
|
|
108
|
+
function L(e) {
|
|
109
|
+
const t = i.useRef(e);
|
|
99
110
|
return i.useEffect(() => {
|
|
100
|
-
|
|
111
|
+
t.current = e;
|
|
101
112
|
}), i.useMemo(() => (...n) => {
|
|
102
113
|
var s;
|
|
103
|
-
return (s =
|
|
114
|
+
return (s = t.current) == null ? void 0 : s.call(t, ...n);
|
|
104
115
|
}, []);
|
|
105
116
|
}
|
|
106
|
-
function fe(
|
|
107
|
-
const n = L(
|
|
117
|
+
function fe(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
118
|
+
const n = L(e);
|
|
108
119
|
i.useEffect(() => {
|
|
109
120
|
const s = (r) => {
|
|
110
121
|
r.key === "Escape" && n(r);
|
|
111
122
|
};
|
|
112
|
-
return
|
|
113
|
-
}, [n,
|
|
123
|
+
return t.addEventListener("keydown", s, { capture: !0 }), () => t.removeEventListener("keydown", s, { capture: !0 });
|
|
124
|
+
}, [n, t]);
|
|
114
125
|
}
|
|
115
|
-
var pe = "DismissableLayer", N = "dismissableLayer.update", ye = "dismissableLayer.pointerDownOutside", he = "dismissableLayer.focusOutside",
|
|
126
|
+
var pe = "DismissableLayer", N = "dismissableLayer.update", ye = "dismissableLayer.pointerDownOutside", he = "dismissableLayer.focusOutside", M, $ = i.createContext({
|
|
116
127
|
layers: /* @__PURE__ */ new Set(),
|
|
117
128
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
118
129
|
branches: /* @__PURE__ */ new Set()
|
|
119
|
-
}),
|
|
120
|
-
(
|
|
130
|
+
}), K = i.forwardRef(
|
|
131
|
+
(e, t) => {
|
|
121
132
|
const {
|
|
122
133
|
disableOutsidePointerEvents: n = !1,
|
|
123
134
|
onEscapeKeyDown: s,
|
|
@@ -126,10 +137,10 @@ var pe = "DismissableLayer", N = "dismissableLayer.update", ye = "dismissableLay
|
|
|
126
137
|
onInteractOutside: a,
|
|
127
138
|
onDismiss: c,
|
|
128
139
|
...p
|
|
129
|
-
} =
|
|
130
|
-
const R = f.target,
|
|
131
|
-
!k ||
|
|
132
|
-
}, h),
|
|
140
|
+
} = e, l = i.useContext($), [u, y] = i.useState(null), h = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, D] = i.useState({}), b = U(t, (f) => y(f)), C = Array.from(l.layers), [P] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), m = C.indexOf(P), O = u ? C.indexOf(u) : -1, w = l.layersWithOutsidePointerEventsDisabled.size > 0, k = O >= m, Z = ge((f) => {
|
|
141
|
+
const R = f.target, A = [...l.branches].some((x) => x.contains(R));
|
|
142
|
+
!k || A || (r == null || r(f), a == null || a(f), f.defaultPrevented || c == null || c());
|
|
143
|
+
}, h), F = Ee((f) => {
|
|
133
144
|
const R = f.target;
|
|
134
145
|
[...l.branches].some((x) => x.contains(R)) || (o == null || o(f), a == null || a(f), f.defaultPrevented || c == null || c());
|
|
135
146
|
}, h);
|
|
@@ -137,53 +148,53 @@ var pe = "DismissableLayer", N = "dismissableLayer.update", ye = "dismissableLay
|
|
|
137
148
|
O === l.layers.size - 1 && (s == null || s(f), !f.defaultPrevented && c && (f.preventDefault(), c()));
|
|
138
149
|
}, h), i.useEffect(() => {
|
|
139
150
|
if (u)
|
|
140
|
-
return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (
|
|
141
|
-
n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents =
|
|
151
|
+
return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (M = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(u)), l.layers.add(u), j(), () => {
|
|
152
|
+
n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = M);
|
|
142
153
|
};
|
|
143
154
|
}, [u, h, n, l]), i.useEffect(() => () => {
|
|
144
|
-
u && (l.layers.delete(u), l.layersWithOutsidePointerEventsDisabled.delete(u),
|
|
155
|
+
u && (l.layers.delete(u), l.layersWithOutsidePointerEventsDisabled.delete(u), j());
|
|
145
156
|
}, [u, l]), i.useEffect(() => {
|
|
146
157
|
const f = () => D({});
|
|
147
158
|
return document.addEventListener(N, f), () => document.removeEventListener(N, f);
|
|
148
159
|
}, []), /* @__PURE__ */ d(
|
|
149
|
-
|
|
160
|
+
V.div,
|
|
150
161
|
{
|
|
151
162
|
...p,
|
|
152
163
|
ref: b,
|
|
153
164
|
style: {
|
|
154
165
|
pointerEvents: w ? k ? "auto" : "none" : void 0,
|
|
155
|
-
...
|
|
166
|
+
...e.style
|
|
156
167
|
},
|
|
157
|
-
onFocusCapture: S(
|
|
158
|
-
onBlurCapture: S(
|
|
168
|
+
onFocusCapture: S(e.onFocusCapture, F.onFocusCapture),
|
|
169
|
+
onBlurCapture: S(e.onBlurCapture, F.onBlurCapture),
|
|
159
170
|
onPointerDownCapture: S(
|
|
160
|
-
|
|
161
|
-
|
|
171
|
+
e.onPointerDownCapture,
|
|
172
|
+
Z.onPointerDownCapture
|
|
162
173
|
)
|
|
163
174
|
}
|
|
164
175
|
);
|
|
165
176
|
}
|
|
166
177
|
);
|
|
167
|
-
|
|
168
|
-
var me = "DismissableLayerBranch", ve = i.forwardRef((
|
|
169
|
-
const n = i.useContext(
|
|
178
|
+
K.displayName = pe;
|
|
179
|
+
var me = "DismissableLayerBranch", ve = i.forwardRef((e, t) => {
|
|
180
|
+
const n = i.useContext($), s = i.useRef(null), r = U(t, s);
|
|
170
181
|
return i.useEffect(() => {
|
|
171
182
|
const o = s.current;
|
|
172
183
|
if (o)
|
|
173
184
|
return n.branches.add(o), () => {
|
|
174
185
|
n.branches.delete(o);
|
|
175
186
|
};
|
|
176
|
-
}, [n.branches]), /* @__PURE__ */ d(
|
|
187
|
+
}, [n.branches]), /* @__PURE__ */ d(V.div, { ...e, ref: r });
|
|
177
188
|
});
|
|
178
189
|
ve.displayName = me;
|
|
179
|
-
function ge(
|
|
180
|
-
const n = L(
|
|
190
|
+
function ge(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
191
|
+
const n = L(e), s = i.useRef(!1), r = i.useRef(() => {
|
|
181
192
|
});
|
|
182
193
|
return i.useEffect(() => {
|
|
183
194
|
const o = (c) => {
|
|
184
195
|
if (c.target && !s.current) {
|
|
185
196
|
let p = function() {
|
|
186
|
-
|
|
197
|
+
X(
|
|
187
198
|
ye,
|
|
188
199
|
n,
|
|
189
200
|
l,
|
|
@@ -191,71 +202,71 @@ function ge(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
|
191
202
|
);
|
|
192
203
|
};
|
|
193
204
|
const l = { originalEvent: c };
|
|
194
|
-
c.pointerType === "touch" ? (
|
|
205
|
+
c.pointerType === "touch" ? (t.removeEventListener("click", r.current), r.current = p, t.addEventListener("click", r.current, { once: !0 })) : p();
|
|
195
206
|
} else
|
|
196
|
-
|
|
207
|
+
t.removeEventListener("click", r.current);
|
|
197
208
|
s.current = !1;
|
|
198
209
|
}, a = window.setTimeout(() => {
|
|
199
|
-
|
|
210
|
+
t.addEventListener("pointerdown", o);
|
|
200
211
|
}, 0);
|
|
201
212
|
return () => {
|
|
202
|
-
window.clearTimeout(a),
|
|
213
|
+
window.clearTimeout(a), t.removeEventListener("pointerdown", o), t.removeEventListener("click", r.current);
|
|
203
214
|
};
|
|
204
|
-
}, [
|
|
215
|
+
}, [t, n]), {
|
|
205
216
|
// ensures we check React component tree (not just DOM tree)
|
|
206
217
|
onPointerDownCapture: () => s.current = !0
|
|
207
218
|
};
|
|
208
219
|
}
|
|
209
|
-
function Ee(
|
|
210
|
-
const n = L(
|
|
220
|
+
function Ee(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
221
|
+
const n = L(e), s = i.useRef(!1);
|
|
211
222
|
return i.useEffect(() => {
|
|
212
223
|
const r = (o) => {
|
|
213
|
-
o.target && !s.current &&
|
|
224
|
+
o.target && !s.current && X(he, n, { originalEvent: o }, {
|
|
214
225
|
discrete: !1
|
|
215
226
|
});
|
|
216
227
|
};
|
|
217
|
-
return
|
|
218
|
-
}, [
|
|
228
|
+
return t.addEventListener("focusin", r), () => t.removeEventListener("focusin", r);
|
|
229
|
+
}, [t, n]), {
|
|
219
230
|
onFocusCapture: () => s.current = !0,
|
|
220
231
|
onBlurCapture: () => s.current = !1
|
|
221
232
|
};
|
|
222
233
|
}
|
|
223
|
-
function
|
|
224
|
-
const
|
|
225
|
-
document.dispatchEvent(
|
|
234
|
+
function j() {
|
|
235
|
+
const e = new CustomEvent(N);
|
|
236
|
+
document.dispatchEvent(e);
|
|
226
237
|
}
|
|
227
|
-
function
|
|
228
|
-
const r = n.originalEvent.target, o = new CustomEvent(
|
|
229
|
-
|
|
238
|
+
function X(e, t, n, { discrete: s }) {
|
|
239
|
+
const r = n.originalEvent.target, o = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
240
|
+
t && r.addEventListener(e, t, { once: !0 }), s ? de(r, o) : r.dispatchEvent(o);
|
|
230
241
|
}
|
|
231
242
|
function be({
|
|
232
|
-
prop:
|
|
233
|
-
defaultProp:
|
|
243
|
+
prop: e,
|
|
244
|
+
defaultProp: t,
|
|
234
245
|
onChange: n = () => {
|
|
235
246
|
}
|
|
236
247
|
}) {
|
|
237
|
-
const [s, r] = Ce({ defaultProp:
|
|
248
|
+
const [s, r] = Ce({ defaultProp: t, onChange: n }), o = e !== void 0, a = o ? e : s, c = L(n), p = i.useCallback(
|
|
238
249
|
(l) => {
|
|
239
250
|
if (o) {
|
|
240
|
-
const y = typeof l == "function" ? l(
|
|
241
|
-
y !==
|
|
251
|
+
const y = typeof l == "function" ? l(e) : l;
|
|
252
|
+
y !== e && c(y);
|
|
242
253
|
} else
|
|
243
254
|
r(l);
|
|
244
255
|
},
|
|
245
|
-
[o,
|
|
256
|
+
[o, e, r, c]
|
|
246
257
|
);
|
|
247
258
|
return [a, p];
|
|
248
259
|
}
|
|
249
260
|
function Ce({
|
|
250
|
-
defaultProp:
|
|
251
|
-
onChange:
|
|
261
|
+
defaultProp: e,
|
|
262
|
+
onChange: t
|
|
252
263
|
}) {
|
|
253
|
-
const n = i.useState(
|
|
264
|
+
const n = i.useState(e), [s] = n, r = i.useRef(s), o = L(t);
|
|
254
265
|
return i.useEffect(() => {
|
|
255
266
|
r.current !== s && (o(s), r.current = s);
|
|
256
267
|
}, [s, r, o]), n;
|
|
257
268
|
}
|
|
258
|
-
const
|
|
269
|
+
const Y = E.createContext({
|
|
259
270
|
layers: [],
|
|
260
271
|
setLayers: () => {
|
|
261
272
|
},
|
|
@@ -265,40 +276,40 @@ const X = E.createContext({
|
|
|
265
276
|
},
|
|
266
277
|
removeTopLayer: () => {
|
|
267
278
|
}
|
|
268
|
-
}), je = ({ children:
|
|
269
|
-
const [
|
|
279
|
+
}), je = ({ children: e }) => {
|
|
280
|
+
const [t, n] = E.useState([]), s = (a) => {
|
|
270
281
|
n((c) => [...c, a]);
|
|
271
282
|
}, r = (a) => {
|
|
272
|
-
n(
|
|
283
|
+
n(t.filter((c) => c !== a));
|
|
273
284
|
}, o = () => {
|
|
274
|
-
const a =
|
|
285
|
+
const a = t[t.length - 1];
|
|
275
286
|
a && r(a);
|
|
276
287
|
};
|
|
277
288
|
return /* @__PURE__ */ d(
|
|
278
|
-
|
|
289
|
+
Y.Provider,
|
|
279
290
|
{
|
|
280
|
-
value: { layers:
|
|
281
|
-
children:
|
|
291
|
+
value: { layers: t, setLayers: n, addLayer: s, removeLayer: r, removeTopLayer: o },
|
|
292
|
+
children: e
|
|
282
293
|
}
|
|
283
294
|
);
|
|
284
|
-
},
|
|
285
|
-
defaultOpen:
|
|
286
|
-
open:
|
|
295
|
+
}, H = () => E.useContext(Y), Le = ({
|
|
296
|
+
defaultOpen: e,
|
|
297
|
+
open: t,
|
|
287
298
|
onOpenChange: n,
|
|
288
299
|
...s
|
|
289
300
|
}) => {
|
|
290
301
|
const [r, o] = be({
|
|
291
|
-
prop:
|
|
302
|
+
prop: t,
|
|
292
303
|
onChange: n,
|
|
293
|
-
defaultProp:
|
|
294
|
-
}), a =
|
|
304
|
+
defaultProp: e
|
|
305
|
+
}), a = H(), c = s.a11yTitle;
|
|
295
306
|
if (E.useEffect(() => {
|
|
296
307
|
!r && a.layers.includes(c) && a.removeLayer(c);
|
|
297
308
|
}, [c, a, r]), !!r)
|
|
298
309
|
return /* @__PURE__ */ d(Pe, { open: r, onOpenChange: o, ...s });
|
|
299
310
|
}, Pe = ({
|
|
300
|
-
open:
|
|
301
|
-
onOpenChange:
|
|
311
|
+
open: e,
|
|
312
|
+
onOpenChange: t,
|
|
302
313
|
a11yTitle: n,
|
|
303
314
|
a11yDescription: s,
|
|
304
315
|
children: r,
|
|
@@ -309,45 +320,45 @@ const X = E.createContext({
|
|
|
309
320
|
...p
|
|
310
321
|
}) => {
|
|
311
322
|
var C, P;
|
|
312
|
-
const l = n, u =
|
|
323
|
+
const l = n, u = H();
|
|
313
324
|
E.useEffect(() => {
|
|
314
|
-
!u || !
|
|
315
|
-
}, [l, u,
|
|
325
|
+
!u || !e || u.layers.includes(l) || u.addLayer(l);
|
|
326
|
+
}, [l, u, e]);
|
|
316
327
|
const y = ((C = u.layers) == null ? void 0 : C.indexOf(l)) || 0, h = ((P = u.layers) == null ? void 0 : P.length) || 0, D = y !== 0, b = l === u.layers[u.layers.length - 1];
|
|
317
328
|
return /* @__PURE__ */ d(
|
|
318
|
-
|
|
329
|
+
K,
|
|
319
330
|
{
|
|
320
331
|
onEscapeKeyDown: (m) => {
|
|
321
|
-
b && (m.preventDefault(), u.removeTopLayer(),
|
|
332
|
+
b && (m.preventDefault(), u.removeTopLayer(), t(!1));
|
|
322
333
|
},
|
|
323
334
|
onPointerDownOutside: (m) => {
|
|
324
|
-
b && (m.preventDefault(), u.removeTopLayer(),
|
|
335
|
+
b && (m.preventDefault(), u.removeTopLayer(), t(!1));
|
|
325
336
|
},
|
|
326
337
|
children: /* @__PURE__ */ T(
|
|
327
338
|
v.Root,
|
|
328
339
|
{
|
|
329
|
-
open:
|
|
340
|
+
open: e,
|
|
330
341
|
onOpenChange: (m) => {
|
|
331
342
|
var w;
|
|
332
343
|
if (((w = u == null ? void 0 : u.layers) == null ? void 0 : w.length) > 0)
|
|
333
|
-
return m === !1 && l === u.layers[u.layers.length - 1] ? (u.removeLayer(l),
|
|
334
|
-
|
|
344
|
+
return m === !1 && l === u.layers[u.layers.length - 1] ? (u.removeLayer(l), t(!1)) : void 0;
|
|
345
|
+
t(m);
|
|
335
346
|
},
|
|
336
347
|
children: [
|
|
337
|
-
/* @__PURE__ */ T(
|
|
348
|
+
/* @__PURE__ */ T(ee.Root, { children: [
|
|
338
349
|
/* @__PURE__ */ d(v.Title, { children: n }),
|
|
339
350
|
s && /* @__PURE__ */ d(v.Description, { children: s })
|
|
340
351
|
] }),
|
|
341
|
-
/* @__PURE__ */ d(
|
|
352
|
+
/* @__PURE__ */ d(oe, { children: e && // We add the className "tgph" here so that styles within
|
|
342
353
|
// the portal get scoped properly to telegraph
|
|
343
|
-
/* @__PURE__ */ d(
|
|
344
|
-
|
|
354
|
+
/* @__PURE__ */ d(Q.Root, { className: "tgph", children: /* @__PURE__ */ d(we, { layer: y, children: /* @__PURE__ */ d(
|
|
355
|
+
J,
|
|
345
356
|
{
|
|
346
357
|
trapped: typeof o == "boolean" ? o : b,
|
|
347
358
|
onMountAutoFocus: a,
|
|
348
359
|
onUnmountAutoFocus: c,
|
|
349
360
|
asChild: !0,
|
|
350
|
-
children: /* @__PURE__ */ d(
|
|
361
|
+
children: /* @__PURE__ */ d(ne, { children: /* @__PURE__ */ d(
|
|
351
362
|
g,
|
|
352
363
|
{
|
|
353
364
|
as: B.div,
|
|
@@ -404,9 +415,9 @@ const X = E.createContext({
|
|
|
404
415
|
)
|
|
405
416
|
}
|
|
406
417
|
);
|
|
407
|
-
}, we = ({ layer:
|
|
418
|
+
}, we = ({ layer: e, children: t }) => e > 0 ? t : /* @__PURE__ */ T(v.Overlay, { children: [
|
|
408
419
|
/* @__PURE__ */ d(
|
|
409
|
-
|
|
420
|
+
se,
|
|
410
421
|
{
|
|
411
422
|
as: B.div,
|
|
412
423
|
initial: { opacity: 0 },
|
|
@@ -424,24 +435,24 @@ const X = E.createContext({
|
|
|
424
435
|
}
|
|
425
436
|
}
|
|
426
437
|
),
|
|
427
|
-
|
|
438
|
+
t
|
|
428
439
|
] }), Re = E.forwardRef(
|
|
429
|
-
({ children:
|
|
440
|
+
({ children: e, ...t }, n) => /* @__PURE__ */ d(v.Content, { ref: n, asChild: !0, ...t, children: /* @__PURE__ */ d(g, { direction: "column", h: "full", ...t, children: e }) })
|
|
430
441
|
), De = ({
|
|
431
|
-
size:
|
|
432
|
-
variant:
|
|
442
|
+
size: e = "1",
|
|
443
|
+
variant: t = "ghost",
|
|
433
444
|
...n
|
|
434
445
|
}) => /* @__PURE__ */ d(v.Close, { asChild: !0, children: /* @__PURE__ */ d(
|
|
435
|
-
|
|
446
|
+
te,
|
|
436
447
|
{
|
|
437
|
-
icon: { icon:
|
|
438
|
-
variant:
|
|
439
|
-
size:
|
|
448
|
+
icon: { icon: re.X, alt: "Close Modal" },
|
|
449
|
+
variant: t,
|
|
450
|
+
size: e,
|
|
440
451
|
...n
|
|
441
452
|
}
|
|
442
453
|
) }), Oe = ({
|
|
443
|
-
style:
|
|
444
|
-
children:
|
|
454
|
+
style: e,
|
|
455
|
+
children: t,
|
|
445
456
|
...n
|
|
446
457
|
}) => /* @__PURE__ */ d(
|
|
447
458
|
g,
|
|
@@ -451,14 +462,14 @@ const X = E.createContext({
|
|
|
451
462
|
py: "4",
|
|
452
463
|
style: {
|
|
453
464
|
overflowY: "auto",
|
|
454
|
-
...
|
|
465
|
+
...e
|
|
455
466
|
},
|
|
456
467
|
...n,
|
|
457
|
-
children:
|
|
468
|
+
children: t
|
|
458
469
|
}
|
|
459
470
|
), xe = ({
|
|
460
|
-
children:
|
|
461
|
-
...
|
|
471
|
+
children: e,
|
|
472
|
+
...t
|
|
462
473
|
}) => /* @__PURE__ */ d(
|
|
463
474
|
g,
|
|
464
475
|
{
|
|
@@ -468,12 +479,12 @@ const X = E.createContext({
|
|
|
468
479
|
px: "6",
|
|
469
480
|
py: "4",
|
|
470
481
|
borderBottom: "px",
|
|
471
|
-
...
|
|
472
|
-
children:
|
|
482
|
+
...t,
|
|
483
|
+
children: e
|
|
473
484
|
}
|
|
474
485
|
), Se = ({
|
|
475
|
-
children:
|
|
476
|
-
...
|
|
486
|
+
children: e,
|
|
487
|
+
...t
|
|
477
488
|
}) => /* @__PURE__ */ d(
|
|
478
489
|
g,
|
|
479
490
|
{
|
|
@@ -484,8 +495,8 @@ const X = E.createContext({
|
|
|
484
495
|
px: "6",
|
|
485
496
|
py: "4",
|
|
486
497
|
borderTop: "px",
|
|
487
|
-
...
|
|
488
|
-
children:
|
|
498
|
+
...t,
|
|
499
|
+
children: e
|
|
489
500
|
}
|
|
490
501
|
), Te = {};
|
|
491
502
|
Object.assign(Te, {
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","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-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 ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => refs.forEach((ref) => setRef(ref, node));\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, 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 return React.cloneElement(children, {\n ...mergeProps(slotProps, children.props),\n // @ts-ignore\n ref: forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef\n });\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n});\nSlotClone.displayName = \"SlotClone\";\nvar Slottable = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment, { 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/DismissableLayer.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-controllable-state/src/useControllableState.tsx\nimport * as React from \"react\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n }\n}) {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useCallbackRef(onChange);\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue;\n const value2 = typeof nextValue === \"function\" ? setter(prop) : nextValue;\n if (value2 !== prop) handleChange(value2);\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const uncontrolledState = React.useState(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = React.useRef(value);\n const handleChange = useCallbackRef(onChange);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n return uncontrolledState;\n}\nexport {\n useControllableState\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","useComposedRefs","React","Slot","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","SlotClone","childrenRef","getElementRef","mergeProps","Slottable","Fragment","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","useControllableState","prop","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","useUncontrolledState","isControlled","handleChange","setValue","nextValue","value2","uncontrolledState","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":";;;;;;;;;;;;;AACA,SAASA,EAAqBC,GAAsBC,GAAiB,EAAE,0BAAAC,IAA2B,GAAM,IAAG,IAAI;AAC7G,SAAO,SAAqBC,GAAO;AAEjC,QADAH,KAAA,QAAAA,EAAuBG,IACnBD,MAA6B,MAAS,CAACC,EAAM;AAC/C,aAAOF,KAAA,gBAAAA,EAAkBE;AAAA,EAE5B;AACH;ACNA,SAASC,GAAOC,GAAKC,GAAO;AAC1B,EAAI,OAAOD,KAAQ,aACjBA,EAAIC,CAAK,IACAD,KAAQ,SACjBA,EAAI,UAAUC;AAElB;AACA,SAASC,KAAeC,GAAM;AAC5B,SAAO,CAACC,MAASD,EAAK,QAAQ,CAACH,MAAQD,GAAOC,GAAKI,CAAI,CAAC;AAC1D;AACA,SAASC,KAAmBF,GAAM;AAChC,SAAOG,EAAM,YAAYJ,EAAY,GAAGC,CAAI,GAAGA,C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AAA,EAACqI;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,IAAG;AAAA,IACH,IAAG;AAAA,IACH,OAAO;AAAA,MACL,WAAW;AAAA,MACX,GAAGU;AAAA,IACL;AAAA,IACC,GAAGzJ;AAAA,IAEH,UAAAE;AAAA,EAAA;AACH,GAOEwJ,KAAS,CAAwB;AAAA,EACrC,UAAAxJ;AAAA,EACA,GAAGF;AACL,MAEI,gBAAAU;AAAA,EAACqI;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,SAAQ;AAAA,IACR,OAAM;AAAA,IACN,IAAG;AAAA,IACH,IAAG;AAAA,IACH,cAAa;AAAA,IACZ,GAAG/I;AAAA,IAEH,UAAAE;AAAA,EAAA;AACH,GAOEyJ,KAAS,CAAwB;AAAA,EACrC,UAAAzJ;AAAA,EACA,GAAGF;AACL,MAEI,gBAAAU;AAAA,EAACqI;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,OAAM;AAAA,IACN,SAAQ;AAAA,IACR,KAAI;AAAA,IACJ,IAAG;AAAA,IACH,IAAG;AAAA,IACH,WAAU;AAAA,IACT,GAAG/I;AAAA,IAEH,UAAAE;AAAA,EAAA;AACH,GAIE0J,KAAQ,CAAA;AASd,OAAO,OAAOA,IAAO;AAAA,EACnB,MAAArC;AAAA,EACA,SAAA2B;AAAA,EACA,OAAAC;AAAA,EACA,MAAAK;AAAA,EACA,QAAAE;AAAA,EACA,QAAAC;AACF,CAAC;","x_google_ignoreList":[0,1,2,3,4,5,6,7]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/primitive/dist/index.mjs","../../../../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-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-controllable-state/src/useControllableState.tsx\nimport * as React from \"react\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n }\n}) {\n const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n const handleChange = useCallbackRef(onChange);\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const setter = nextValue;\n const value2 = typeof nextValue === \"function\" ? setter(prop) : nextValue;\n if (value2 !== prop) handleChange(value2);\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, handleChange]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const uncontrolledState = React.useState(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = React.useRef(value);\n const handleChange = useCallbackRef(onChange);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n handleChange(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef, handleChange]);\n return uncontrolledState;\n}\nexport {\n useControllableState\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","useControllableState","prop","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","useUncontrolledState","isControlled","handleChange","setValue","nextValue","value2","uncontrolledState","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":";;;;;;;;;;;;;AACA,SAASA,EAAqBC,GAAsBC,GAAiB,EAAE,0BAAAC,IAA2B,GAAM,IAAG,IAAI;AAC7G,SAAO,SAAqBC,GAAO;AAEjC,QADAH,KAAA,QAAAA,EAAuBG,IACnBD,MAA6B,MAAS,CAACC,EAAM;AAC/C,aAAOF,KAAA,gBAAAA,EAAkBE;AAAA,EAE5B;AACH;ACNA,SAASC,EAAOC,GAAKC,GAAO;AAC1B,MAAI,OAAOD,KAAQ;AACjB,WAAOA,EAAIC,CAAK;AACX,EAAID,KAAQ,SACjBA,EAAI,UAAUC;AAElB;AACA,SAASC,KAAeC,GAAM;AAC5B,SAAO,CAACC,MAAS;AACf,QAAIC,IAAa;AACjB,UAAMC,IAAWH,EAAK,IAAI,CAACH,MAAQ;AACjC,YAAMO,IAAUR,EAAOC,GAAKI,CAAI;AAChC,aAAI,CAACC,KAAc,OAAOE,KAAW,eACnCF,IAAa,KAERE;AAAA,IACb,CAAK;AACD,QAAIF;AACF,aAAO,MAAM;AACX,iBAASG,IAAI,GAAGA,IAAIF,EAAS,QAAQE,KAA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6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegraph/modal",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
4
4
|
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/modal",
|
|
5
5
|
"author": "@knocklabs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,28 +33,28 @@
|
|
|
33
33
|
"@radix-ui/react-focus-scope": "^1.1.0",
|
|
34
34
|
"@radix-ui/react-portal": "^1.1.3",
|
|
35
35
|
"@radix-ui/react-visually-hidden": "^1.1.0",
|
|
36
|
-
"@telegraph/button": "^0.0.
|
|
37
|
-
"@telegraph/helpers": "^0.0.
|
|
38
|
-
"@telegraph/icon": "^0.0.
|
|
39
|
-
"@telegraph/layout": "^0.1.
|
|
40
|
-
"@telegraph/style-engine": "^0.1.
|
|
36
|
+
"@telegraph/button": "^0.0.72",
|
|
37
|
+
"@telegraph/helpers": "^0.0.11",
|
|
38
|
+
"@telegraph/icon": "^0.0.46",
|
|
39
|
+
"@telegraph/layout": "^0.1.12",
|
|
40
|
+
"@telegraph/style-engine": "^0.1.8",
|
|
41
41
|
"framer-motion": "^11.1.9"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@knocklabs/eslint-config": "^0.0.3",
|
|
45
45
|
"@knocklabs/prettier-config": "^0.0.1",
|
|
46
46
|
"@knocklabs/typescript-config": "^0.0.2",
|
|
47
|
-
"@telegraph/postcss-config": "^0.0.
|
|
48
|
-
"@telegraph/vite-config": "^0.0.
|
|
49
|
-
"@types/react": "^18.
|
|
47
|
+
"@telegraph/postcss-config": "^0.0.23",
|
|
48
|
+
"@telegraph/vite-config": "^0.0.14",
|
|
49
|
+
"@types/react": "^18.3.18",
|
|
50
50
|
"eslint": "^8.56.0",
|
|
51
|
-
"react": "^18.
|
|
51
|
+
"react": "^18.3.1",
|
|
52
52
|
"react-dom": "^18.3.1",
|
|
53
|
-
"typescript": "^5.
|
|
53
|
+
"typescript": "^5.7.3",
|
|
54
54
|
"vite": "^6.0.11"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"react": "^18.
|
|
58
|
-
"react-dom": "^18.
|
|
57
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
58
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
59
59
|
}
|
|
60
60
|
}
|