@telegraph/modal 0.0.58 → 0.0.60
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 +20 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +168 -159
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @telegraph/modal
|
|
2
2
|
|
|
3
|
+
## 0.0.60
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`648fbc6`](https://github.com/knocklabs/telegraph/commit/648fbc6182350be7734a9524d4cbee549d9372af)]:
|
|
8
|
+
- @telegraph/style-engine@0.1.3
|
|
9
|
+
- @telegraph/button@0.0.59
|
|
10
|
+
- @telegraph/layout@0.1.5
|
|
11
|
+
- @telegraph/icon@0.0.39
|
|
12
|
+
|
|
13
|
+
## 0.0.59
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [[`094cb1c`](https://github.com/knocklabs/telegraph/commit/094cb1cb32ab65f5c985cf5497997ec955ff3b89)]:
|
|
18
|
+
- @telegraph/style-engine@0.1.2
|
|
19
|
+
- @telegraph/button@0.0.58
|
|
20
|
+
- @telegraph/layout@0.1.4
|
|
21
|
+
- @telegraph/icon@0.0.38
|
|
22
|
+
|
|
3
23
|
## 0.0.58
|
|
4
24
|
|
|
5
25
|
### 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"),O=require("framer-motion");function C(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const 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 E=C(Z),o=C(g),se=C(G),oe=C(Q),ie=C(ee);function D(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 ce(...e){return t=>e.forEach(n=>ae(n,t))}var A=o.forwardRef((e,t)=>{const{children:n,...r}=e,s=o.Children.toArray(n),i=s.find(ue);if(i){const a=i.props.children,c=s.map(p=>p===i?o.Children.count(a)>1?o.Children.only(null):o.isValidElement(a)?a.props.children:null:p);return d.jsx(T,{...r,ref:t,children:o.isValidElement(a)?o.cloneElement(a,void 0,c):null})}return d.jsx(T,{...r,ref:t,children:n})});A.displayName="Slot";var T=o.forwardRef((e,t)=>{const{children:n,...r}=e;if(o.isValidElement(n)){const s=fe(n);return o.cloneElement(n,{...de(r,n.props),ref:t?ce(t,s):s})}return o.Children.count(n)>1?o.Children.only(null):null});T.displayName="SlotClone";var le=({children:e})=>d.jsx(d.Fragment,{children:e});function ue(e){return o.isValidElement(e)&&e.type===le}function de(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{i(...c),s(...c)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function fe(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 pe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],q=pe.reduce((e,t)=>{const n=o.forwardRef((r,s)=>{const{asChild:i,...a}=r,c=i?A: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 ye(e,t){e&&se.flushSync(()=>e.dispatchEvent(t))}function he(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ve(...e){return t=>e.forEach(n=>he(n,t))}function I(...e){return o.useCallback(ve(...e),e)}function B(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function me(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);o.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 ge="DismissableLayer",k="dismissableLayer.update",Ee="dismissableLayer.pointerDownOutside",be="dismissableLayer.focusOutside",_,$=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),z=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:c,...p}=e,l=o.useContext($),[u,y]=o.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=o.useState({}),b=I(t,f=>y(f)),x=Array.from(l.layers),[P]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=x.indexOf(P),w=u?x.indexOf(u):-1,L=l.layersWithOutsidePointerEventsDisabled.size>0,M=w>=v,Y=Pe(f=>{const R=f.target,W=[...l.branches].some(S=>S.contains(R));!M||W||(s==null||s(f),a==null||a(f),f.defaultPrevented||c==null||c())},h),N=Le(f=>{const R=f.target;[...l.branches].some(S=>S.contains(R))||(i==null||i(f),a==null||a(f),f.defaultPrevented||c==null||c())},h);return me(f=>{w===l.layers.size-1&&(r==null||r(f),!f.defaultPrevented&&c&&(f.preventDefault(),c()))},h),o.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(_=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=_)}},[u,h,n,l]),o.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),F())},[u,l]),o.useEffect(()=>{const f=()=>j({});return document.addEventListener(k,f),()=>document.removeEventListener(k,f)},[]),d.jsx(q.div,{...p,ref:b,style:{pointerEvents:L?M?"auto":"none":void 0,...e.style},onFocusCapture:D(e.onFocusCapture,N.onFocusCapture),onBlurCapture:D(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:D(e.onPointerDownCapture,Y.onPointerDownCapture)})});z.displayName=ge;var xe="DismissableLayerBranch",Ce=o.forwardRef((e,t)=>{const n=o.useContext($),r=o.useRef(null),s=I(t,r);return o.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),d.jsx(q.div,{...e,ref:s})});Ce.displayName=xe;function Pe(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=o.useRef(!1),s=o.useRef(()=>{});return o.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let p=function(){U(Ee,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",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Le(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=o.useRef(!1);return o.useEffect(()=>{const s=i=>{i.target&&!r.current&&U(be,n,{originalEvent:i},{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(k);document.dispatchEvent(e)}function U(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ye(s,i):s.dispatchEvent(i)}function V(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Re({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=Oe({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,c=V(n),p=o.useCallback(l=>{if(i){const y=typeof l=="function"?l(e):l;y!==e&&c(y)}else s(l)},[i,e,s,c]);return[a,p]}function Oe({defaultProp:e,onChange:t}){const n=o.useState(e),[r]=n,s=o.useRef(r),i=V(t);return o.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}const K=g.createContext({layers:[],setLayers:()=>{},addLayer:()=>{},removeLayer:()=>{},removeTopLayer:()=>{}}),je=({children:e})=>{const[t,n]=g.useState([]),r=a=>{n(c=>[...c,a])},s=a=>{n(t.filter(c=>c!==a))},i=()=>{const a=t[t.length-1];a&&s(a)};return d.jsx(K.Provider,{value:{layers:t,setLayers:n,addLayer:r,removeLayer:s,removeTopLayer:i},children:e})},H=()=>g.useContext(K),we=({defaultOpen:e,open:t,onOpenChange:n,...r})=>{const[s,i]=Re({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(Se,{open:s,onOpenChange:i,...r})},Se=({open:e,onOpenChange:t,a11yTitle:n,a11yDescription:r,children:s,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:c,...p})=>{var x,P;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=((P=u.layers)==null?void 0:P.length)||0,j=y!==0,b=l===u.layers[u.layers.length-1];return d.jsx(z,{onEscapeKeyDown:v=>{b&&(v.preventDefault(),u.removeTopLayer(),t(!1))},onPointerDownOutside:v=>{b&&(v.preventDefault(),u.removeTopLayer(),t(!1))},children:d.jsxs(E.Root,{open:e,onOpenChange:v=>{var L;if(((L=u==null?void 0:u.layers)==null?void 0:L.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(E.Title,{children:n}),r&&d.jsx(E.Description,{children:r})]}),d.jsx(O.AnimatePresence,{children:e&&d.jsx(oe.Root,{className:"tgph",children:d.jsx(De,{layer:y,children:d.jsx(J.FocusScope,{trapped:typeof i=="boolean"?i:b,onMountAutoFocus:a,onUnmountAutoFocus:c,asChild:!0,children:d.jsx(ne.RefToTgphRef,{children:d.jsx(m.Stack,{as:O.motion.div,initial:{top:`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${h-1})`},animate:{top:j?`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${y} )`:"var(--tgph-spacing-16)"},exit:{top:0},transition:{type:"spring",duration:.3,bounce:0},w:"full",justify:"center",style:{position:"fixed",left:0,maxHeight:"calc(100vh - var(--tgph-spacing-32))",maxWidth:"calc(100vw - var(--tgph-spacing-8))",zIndex:`calc(var(--tgph-zIndex-modal) + ${y})`},children:d.jsx(m.Stack,{direction:"column",as:O.motion.div,animate:{scale:1.02-Math.abs(h-y)*.02,transformOrigin:"center center"},transition:{duration:.2,bounce:0,type:"spring"},maxW:p.maxW??"160",w:p.w??"full",bg:"surface-1",border:"px",rounded:"4",shadow:"3",...p,children:s},`content-${l}`)},`container-${l}`)})})})})})]},l)})},De=({layer:e,children:t})=>e>0?t:d.jsxs(E.Overlay,{children:[d.jsx(m.Box,{as:O.motion.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,bounce:0,type:"spring"},bg:"alpha-black-6",w:"full",h:"full",zIndex:"overlay",style:{position:"fixed",cursor:"pointer",inset:"0px"}}),t]}),Te=g.forwardRef(({children:e,...t},n)=>d.jsx(E.Content,{ref:n,asChild:!0,...t,children:d.jsx(m.Stack,{direction:"column",h:"full",...t,children:e})})),ke=({size:e="1",variant:t="ghost",...n})=>d.jsx(E.Close,{asChild:!0,children:d.jsx(te.Button,{icon:{icon:re.Lucide.X,alt:"Close Modal"},variant:t,size:e,...n})}),Be=({style:e,children:t,...n})=>d.jsx(m.Stack,{direction:"column",px:"6",py:"4",style:{overflowY:"auto",...e},...n,children:t}),Me=({children:e,...t})=>d.jsx(m.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...t,children:e}),Ne=({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:we,Content:Te,Close:ke,Body:Be,Header:Me,Footer:Ne});exports.Modal=X;exports.ModalStackingProvider=je;
|
|
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"),O=require("framer-motion");function C(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const 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 E=C(Z),o=C(g),se=C(G),oe=C(Q),ie=C(ee);function D(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 ce(...e){return t=>e.forEach(n=>ae(n,t))}var F=o.forwardRef((e,t)=>{const{children:n,...r}=e,s=o.Children.toArray(n),i=s.find(le);if(i){const a=i.props.children,c=s.map(p=>p===i?o.Children.count(a)>1?o.Children.only(null):o.isValidElement(a)?a.props.children:null:p);return d.jsx(T,{...r,ref:t,children:o.isValidElement(a)?o.cloneElement(a,void 0,c):null})}return d.jsx(T,{...r,ref:t,children:n})});F.displayName="Slot";var T=o.forwardRef((e,t)=>{const{children:n,...r}=e;if(o.isValidElement(n)){const s=fe(n);return o.cloneElement(n,{...de(r,n.props),ref:t?ce(t,s):s})}return o.Children.count(n)>1?o.Children.only(null):null});T.displayName="SlotClone";var ue=({children:e})=>d.jsx(d.Fragment,{children:e});function le(e){return o.isValidElement(e)&&e.type===ue}function de(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...c)=>{i(...c),s(...c)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function fe(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 pe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],A=pe.reduce((e,t)=>{const n=o.forwardRef((r,s)=>{const{asChild:i,...a}=r,c=i?F: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 ye(e,t){e&&se.flushSync(()=>e.dispatchEvent(t))}function he(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ve(...e){return t=>e.forEach(n=>he(n,t))}function q(...e){return o.useCallback(ve(...e),e)}function I(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function me(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ge(e,t=globalThis==null?void 0:globalThis.document){const n=me(e);o.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 Ee="DismissableLayer",k="dismissableLayer.update",be="dismissableLayer.pointerDownOutside",xe="dismissableLayer.focusOutside",W,$=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),z=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:c,...p}=e,u=o.useContext($),[l,y]=o.useState(null),h=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=o.useState({}),b=q(t,f=>y(f)),x=Array.from(u.layers),[P]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=x.indexOf(P),w=l?x.indexOf(l):-1,R=u.layersWithOutsidePointerEventsDisabled.size>0,M=w>=v,Y=Re(f=>{const L=f.target,N=[...u.branches].some(S=>S.contains(L));!M||N||(s==null||s(f),a==null||a(f),f.defaultPrevented||c==null||c())},h),B=Le(f=>{const L=f.target;[...u.branches].some(S=>S.contains(L))||(i==null||i(f),a==null||a(f),f.defaultPrevented||c==null||c())},h);return ge(f=>{w===u.layers.size-1&&(r==null||r(f),!f.defaultPrevented&&c&&(f.preventDefault(),c()))},h),o.useEffect(()=>{if(l)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(W=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(l)),u.layers.add(l),_(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=W)}},[l,h,n,u]),o.useEffect(()=>()=>{l&&(u.layers.delete(l),u.layersWithOutsidePointerEventsDisabled.delete(l),_())},[l,u]),o.useEffect(()=>{const f=()=>j({});return document.addEventListener(k,f),()=>document.removeEventListener(k,f)},[]),d.jsx(A.div,{...p,ref:b,style:{pointerEvents:R?M?"auto":"none":void 0,...e.style},onFocusCapture:D(e.onFocusCapture,B.onFocusCapture),onBlurCapture:D(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:D(e.onPointerDownCapture,Y.onPointerDownCapture)})});z.displayName=Ee;var Ce="DismissableLayerBranch",Pe=o.forwardRef((e,t)=>{const n=o.useContext($),r=o.useRef(null),s=q(t,r);return o.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),d.jsx(A.div,{...e,ref:s})});Pe.displayName=Ce;function Re(e,t=globalThis==null?void 0:globalThis.document){const n=I(e),r=o.useRef(!1),s=o.useRef(()=>{});return o.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let p=function(){U(be,n,u,{discrete:!0})};const u={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",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Le(e,t=globalThis==null?void 0:globalThis.document){const n=I(e),r=o.useRef(!1);return o.useEffect(()=>{const s=i=>{i.target&&!r.current&&U(xe,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _(){const e=new CustomEvent(k);document.dispatchEvent(e)}function U(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ye(s,i):s.dispatchEvent(i)}function V(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Oe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=je({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,c=V(n),p=o.useCallback(u=>{if(i){const y=typeof u=="function"?u(e):u;y!==e&&c(y)}else s(u)},[i,e,s,c]);return[a,p]}function je({defaultProp:e,onChange:t}){const n=o.useState(e),[r]=n,s=o.useRef(r),i=V(t);return o.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}const K=g.createContext({layers:[],setLayers:()=>{},addLayer:()=>{},removeLayer:()=>{},removeTopLayer:()=>{}}),we=({children:e})=>{const[t,n]=g.useState([]),r=a=>{n(c=>[...c,a])},s=a=>{n(t.filter(c=>c!==a))},i=()=>{const a=t[t.length-1];a&&s(a)};return d.jsx(K.Provider,{value:{layers:t,setLayers:n,addLayer:r,removeLayer:s,removeTopLayer:i},children:e})},H=()=>g.useContext(K),Se=({defaultOpen:e,open:t,onOpenChange:n,...r})=>{const[s,i]=Oe({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(De,{open:s,onOpenChange:i,...r})},De=({open:e,onOpenChange:t,a11yTitle:n,a11yDescription:r,children:s,trapped:i,onMountAutoFocus:a,onUnmountAutoFocus:c,...p})=>{var x,P;const u=n,l=H();g.useEffect(()=>{!l||!e||l.layers.includes(u)||l.addLayer(u)},[u,l,e]);const y=((x=l.layers)==null?void 0:x.indexOf(u))||0,h=((P=l.layers)==null?void 0:P.length)||0,j=y!==0,b=u===l.layers[l.layers.length-1];return d.jsx(z,{onEscapeKeyDown:v=>{b&&(v.preventDefault(),l.removeTopLayer(),t(!1))},onPointerDownOutside:v=>{b&&(v.preventDefault(),l.removeTopLayer(),t(!1))},children:d.jsxs(E.Root,{open:e,onOpenChange:v=>{var R;if(((R=l==null?void 0:l.layers)==null?void 0:R.length)>0)return v===!1&&u===l.layers[l.layers.length-1]?(l.removeLayer(u),t(!1)):void 0;t(v)},children:[d.jsxs(ie.Root,{children:[d.jsx(E.Title,{children:n}),r&&d.jsx(E.Description,{children:r})]}),d.jsx(O.AnimatePresence,{children:e&&d.jsx(oe.Root,{className:"tgph",children:d.jsx(Te,{layer:y,children:d.jsx(J.FocusScope,{trapped:typeof i=="boolean"?i:b,onMountAutoFocus:a,onUnmountAutoFocus:c,asChild:!0,children:d.jsx(ne.RefToTgphRef,{children:d.jsx(m.Stack,{as:O.motion.div,initial:{top:`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${h-1})`},animate:{top:j?`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${y} )`:"var(--tgph-spacing-16)"},exit:{top:0},transition:{type:"spring",duration:.3,bounce:0},w:"full",justify:"center",style:{position:"fixed",left:0,maxHeight:"calc(100vh - var(--tgph-spacing-32))",maxWidth:"calc(100vw - var(--tgph-spacing-8))",zIndex:`calc(var(--tgph-zIndex-modal) + ${y})`},children:d.jsx(m.Stack,{direction:"column",as:O.motion.div,animate:{scale:1.02-Math.abs(h-y)*.02,transformOrigin:"center center"},transition:{duration:.2,bounce:0,type:"spring"},maxW:p.maxW??"160",w:p.w??"full",bg:"surface-1",border:"px",rounded:"4",shadow:"3",...p,children:s},`content-${u}`)},`container-${u}`)})})})})})]},u)})},Te=({layer:e,children:t})=>e>0?t:d.jsxs(E.Overlay,{children:[d.jsx(m.Box,{as:O.motion.div,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,bounce:0,type:"spring"},bg:"alpha-black-6",w:"full",h:"full",zIndex:"overlay",style:{position:"fixed",cursor:"pointer",inset:"0px"}}),t]}),ke=g.forwardRef(({children:e,...t},n)=>d.jsx(E.Content,{ref:n,asChild:!0,...t,children:d.jsx(m.Stack,{direction:"column",h:"full",...t,children:e})})),Me=({size:e="1",variant:t="ghost",...n})=>d.jsx(E.Close,{asChild:!0,children:d.jsx(te.Button,{icon:{icon:re.Lucide.X,alt:"Close Modal"},variant:t,size:e,...n})}),Be=({style:e,children:t,...n})=>d.jsx(m.Stack,{direction:"column",px:"6",py:"4",style:{overflowY:"auto",...e},...n,children:t}),Ne=({children:e,...t})=>d.jsx(m.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...t,children:e}),We=({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:Se,Content:ke,Close:Me,Body:Be,Header:Ne,Footer:We});exports.Modal=X;exports.ModalStackingProvider=we;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/primitive/dist/index.mjs","../../../../node_modules/@radix-ui/react-slot/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../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-dismissable-layer/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/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/node_modules/@radix-ui/react-use-callback-ref/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/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/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-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-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","Slot","React","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","useComposedRefs","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,EAE/B,CACA,CCNA,SAASC,GAAOC,EAAKC,EAAO,CACtB,OAAOD,GAAQ,WACjBA,EAAIC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ER,CAAA,CAAA,EAOEyJ,GAAO,CAAwB,CACnC,MAAAC,EACA,SAAAxJ,EACA,GAAGF,CACL,IAEIU,EAAA,IAACsI,EAAA,MAAA,CACC,UAAU,SACV,GAAG,IACH,GAAG,IACH,MAAO,CACL,UAAW,OACX,GAAGU,CACL,EACC,GAAG1J,EAEH,SAAAE,CAAA,CAAA,EAQDyJ,GAAS,CAAwB,CACrC,SAAAzJ,EACA,GAAGF,CACL,IAEIU,EAAA,IAACsI,EAAA,MAAA,CACC,UAAU,MACV,QAAQ,gBACR,MAAM,SACN,GAAG,IACH,GAAG,IACH,aAAa,KACZ,GAAGhJ,EAEH,SAAAE,CAAA,CAAA,EAQD0J,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,CAAA,EAKD2J,EAAQ,CAAC,EASf,OAAO,OAAOA,EAAO,CACnB,KAAArC,GACA,QAAA2B,GACA,MAAAC,GACA,KAAAK,GACA,OAAAE,GACA,OAAAC,EACF,CAAC","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
|
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-slot/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../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-dismissable-layer/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-escape-keydown/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/node_modules/@radix-ui/react-use-callback-ref/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/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/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-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-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-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","Slot","React","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","useComposedRefs","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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,EAAA,MAAA,CAAM,UAAU,SAAS,EAAE,OAAQ,GAAGhJ,EACpC,SAAAE,CACH,CAAA,EACF,CAGN,EAIMkJ,GAAQ,CAAwB,CACpC,KAAAC,EAAO,IACP,QAAAC,EAAU,QACV,GAAGtJ,CACL,IAEKU,EAAAA,IAAA+H,EAAO,MAAP,CAAa,QAAO,GACnB,SAAA/H,EAAA,IAAC6I,GAAA,OAAA,CACC,KAAM,CAAE,KAAMC,GAAAA,OAAO,EAAG,IAAK,aAAc,EAC3C,QAAAF,EACA,KAAAD,EACC,GAAGrJ,CAAA,CAAA,EAER,EAOEyJ,GAAO,CAAwB,CACnC,MAAAC,EACA,SAAAxJ,EACA,GAAGF,CACL,IAEIU,EAAA,IAACsI,EAAA,MAAA,CACC,UAAU,SACV,GAAG,IACH,GAAG,IACH,MAAO,CACL,UAAW,OACX,GAAGU,CACL,EACC,GAAG1J,EAEH,SAAAE,CAAA,CACH,EAOEyJ,GAAS,CAAwB,CACrC,SAAAzJ,EACA,GAAGF,CACL,IAEIU,EAAA,IAACsI,EAAA,MAAA,CACC,UAAU,MACV,QAAQ,gBACR,MAAM,SACN,GAAG,IACH,GAAG,IACH,aAAa,KACZ,GAAGhJ,EAEH,SAAAE,CAAA,CACH,EAOE0J,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,8,9,10]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -11,58 +11,58 @@ import { RefToTgphRef as te } from "@telegraph/helpers";
|
|
|
11
11
|
import { Lucide as ne } from "@telegraph/icon";
|
|
12
12
|
import { Stack as E, Box as re } from "@telegraph/layout";
|
|
13
13
|
import { AnimatePresence as se, motion as T } from "framer-motion";
|
|
14
|
-
function x(
|
|
14
|
+
function x(t, e, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
15
15
|
return function(s) {
|
|
16
|
-
if (
|
|
17
|
-
return
|
|
16
|
+
if (t == null || t(s), n === !1 || !s.defaultPrevented)
|
|
17
|
+
return e == null ? void 0 : e(s);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
function oe(
|
|
21
|
-
typeof
|
|
20
|
+
function oe(t, e) {
|
|
21
|
+
typeof t == "function" ? t(e) : t != null && (t.current = e);
|
|
22
22
|
}
|
|
23
|
-
function ie(...
|
|
24
|
-
return (
|
|
23
|
+
function ie(...t) {
|
|
24
|
+
return (e) => t.forEach((n) => oe(n, e));
|
|
25
25
|
}
|
|
26
|
-
var
|
|
27
|
-
const { children: n, ...r } =
|
|
26
|
+
var I = o.forwardRef((t, e) => {
|
|
27
|
+
const { children: n, ...r } = t, s = o.Children.toArray(n), i = s.find(ce);
|
|
28
28
|
if (i) {
|
|
29
29
|
const a = i.props.children, c = s.map((p) => p === i ? o.Children.count(a) > 1 ? o.Children.only(null) : o.isValidElement(a) ? a.props.children : null : p);
|
|
30
|
-
return /* @__PURE__ */ d(B, { ...r, ref:
|
|
30
|
+
return /* @__PURE__ */ d(B, { ...r, ref: e, children: o.isValidElement(a) ? o.cloneElement(a, void 0, c) : null });
|
|
31
31
|
}
|
|
32
|
-
return /* @__PURE__ */ d(B, { ...r, ref:
|
|
32
|
+
return /* @__PURE__ */ d(B, { ...r, ref: e, children: n });
|
|
33
33
|
});
|
|
34
|
-
|
|
35
|
-
var B = o.forwardRef((
|
|
36
|
-
const { children: n, ...r } =
|
|
34
|
+
I.displayName = "Slot";
|
|
35
|
+
var B = o.forwardRef((t, e) => {
|
|
36
|
+
const { children: n, ...r } = t;
|
|
37
37
|
if (o.isValidElement(n)) {
|
|
38
38
|
const s = ue(n);
|
|
39
39
|
return o.cloneElement(n, {
|
|
40
40
|
...le(r, n.props),
|
|
41
41
|
// @ts-ignore
|
|
42
|
-
ref:
|
|
42
|
+
ref: e ? ie(e, s) : s
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
return o.Children.count(n) > 1 ? o.Children.only(null) : null;
|
|
46
46
|
});
|
|
47
47
|
B.displayName = "SlotClone";
|
|
48
|
-
var ae = ({ children:
|
|
49
|
-
function ce(
|
|
50
|
-
return o.isValidElement(
|
|
48
|
+
var ae = ({ children: t }) => /* @__PURE__ */ d(Z, { children: t });
|
|
49
|
+
function ce(t) {
|
|
50
|
+
return o.isValidElement(t) && t.type === ae;
|
|
51
51
|
}
|
|
52
|
-
function le(
|
|
53
|
-
const n = { ...
|
|
54
|
-
for (const r in
|
|
55
|
-
const s =
|
|
52
|
+
function le(t, e) {
|
|
53
|
+
const n = { ...e };
|
|
54
|
+
for (const r in e) {
|
|
55
|
+
const s = t[r], i = e[r];
|
|
56
56
|
/^on[A-Z]/.test(r) ? s && i ? n[r] = (...c) => {
|
|
57
57
|
i(...c), s(...c);
|
|
58
58
|
} : s && (n[r] = s) : r === "style" ? n[r] = { ...s, ...i } : r === "className" && (n[r] = [s, i].filter(Boolean).join(" "));
|
|
59
59
|
}
|
|
60
|
-
return { ...
|
|
60
|
+
return { ...t, ...n };
|
|
61
61
|
}
|
|
62
|
-
function ue(
|
|
62
|
+
function ue(t) {
|
|
63
63
|
var r, s;
|
|
64
|
-
let
|
|
65
|
-
return n ?
|
|
64
|
+
let e = (r = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : r.get, n = e && "isReactWarning" in e && e.isReactWarning;
|
|
65
|
+
return n ? t.ref : (e = (s = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : s.get, n = e && "isReactWarning" in e && e.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
|
|
66
66
|
}
|
|
67
67
|
var de = [
|
|
68
68
|
"a",
|
|
@@ -81,49 +81,58 @@ var de = [
|
|
|
81
81
|
"span",
|
|
82
82
|
"svg",
|
|
83
83
|
"ul"
|
|
84
|
-
],
|
|
84
|
+
], $ = de.reduce((t, e) => {
|
|
85
85
|
const n = o.forwardRef((r, s) => {
|
|
86
|
-
const { asChild: i, ...a } = r, c = i ?
|
|
86
|
+
const { asChild: i, ...a } = r, c = i ? I : e;
|
|
87
87
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ d(c, { ...a, ref: s });
|
|
88
88
|
});
|
|
89
|
-
return n.displayName = `Primitive.${
|
|
89
|
+
return n.displayName = `Primitive.${e}`, { ...t, [e]: n };
|
|
90
90
|
}, {});
|
|
91
|
-
function fe(
|
|
92
|
-
|
|
91
|
+
function fe(t, e) {
|
|
92
|
+
t && q.flushSync(() => t.dispatchEvent(e));
|
|
93
93
|
}
|
|
94
|
-
function pe(
|
|
95
|
-
typeof
|
|
94
|
+
function pe(t, e) {
|
|
95
|
+
typeof t == "function" ? t(e) : t != null && (t.current = e);
|
|
96
96
|
}
|
|
97
|
-
function ye(...
|
|
98
|
-
return (
|
|
97
|
+
function ye(...t) {
|
|
98
|
+
return (e) => t.forEach((n) => pe(n, e));
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
return o.useCallback(ye(...
|
|
100
|
+
function j(...t) {
|
|
101
|
+
return o.useCallback(ye(...t), t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const
|
|
103
|
+
function _(t) {
|
|
104
|
+
const e = o.useRef(t);
|
|
105
105
|
return o.useEffect(() => {
|
|
106
|
-
|
|
106
|
+
e.current = t;
|
|
107
107
|
}), o.useMemo(() => (...n) => {
|
|
108
108
|
var r;
|
|
109
|
-
return (r =
|
|
109
|
+
return (r = e.current) == null ? void 0 : r.call(e, ...n);
|
|
110
110
|
}, []);
|
|
111
111
|
}
|
|
112
|
-
function he(
|
|
113
|
-
const
|
|
112
|
+
function he(t) {
|
|
113
|
+
const e = o.useRef(t);
|
|
114
|
+
return o.useEffect(() => {
|
|
115
|
+
e.current = t;
|
|
116
|
+
}), o.useMemo(() => (...n) => {
|
|
117
|
+
var r;
|
|
118
|
+
return (r = e.current) == null ? void 0 : r.call(e, ...n);
|
|
119
|
+
}, []);
|
|
120
|
+
}
|
|
121
|
+
function me(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
122
|
+
const n = he(t);
|
|
114
123
|
o.useEffect(() => {
|
|
115
124
|
const r = (s) => {
|
|
116
125
|
s.key === "Escape" && n(s);
|
|
117
126
|
};
|
|
118
|
-
return
|
|
119
|
-
}, [n,
|
|
127
|
+
return e.addEventListener("keydown", r, { capture: !0 }), () => e.removeEventListener("keydown", r, { capture: !0 });
|
|
128
|
+
}, [n, e]);
|
|
120
129
|
}
|
|
121
|
-
var
|
|
130
|
+
var ve = "DismissableLayer", W = "dismissableLayer.update", Ee = "dismissableLayer.pointerDownOutside", ge = "dismissableLayer.focusOutside", F, U = o.createContext({
|
|
122
131
|
layers: /* @__PURE__ */ new Set(),
|
|
123
132
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
124
133
|
branches: /* @__PURE__ */ new Set()
|
|
125
134
|
}), z = o.forwardRef(
|
|
126
|
-
(
|
|
135
|
+
(t, e) => {
|
|
127
136
|
const {
|
|
128
137
|
disableOutsidePointerEvents: n = !1,
|
|
129
138
|
onEscapeKeyDown: r,
|
|
@@ -132,140 +141,140 @@ var me = "DismissableLayer", W = "dismissableLayer.update", ve = "dismissableLay
|
|
|
132
141
|
onInteractOutside: a,
|
|
133
142
|
onDismiss: c,
|
|
134
143
|
...p
|
|
135
|
-
} =
|
|
136
|
-
const R = f.target,
|
|
137
|
-
!
|
|
138
|
-
}, h),
|
|
144
|
+
} = t, l = o.useContext(U), [u, y] = o.useState(null), h = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, w] = o.useState({}), b = j(e, (f) => y(f)), C = Array.from(l.layers), [L] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), m = C.indexOf(L), D = u ? C.indexOf(u) : -1, P = l.layersWithOutsidePointerEventsDisabled.size > 0, N = D >= m, H = Le((f) => {
|
|
145
|
+
const R = f.target, A = [...l.branches].some((O) => O.contains(R));
|
|
146
|
+
!N || A || (s == null || s(f), a == null || a(f), f.defaultPrevented || c == null || c());
|
|
147
|
+
}, h), k = Pe((f) => {
|
|
139
148
|
const R = f.target;
|
|
140
149
|
[...l.branches].some((O) => O.contains(R)) || (i == null || i(f), a == null || a(f), f.defaultPrevented || c == null || c());
|
|
141
150
|
}, h);
|
|
142
|
-
return
|
|
151
|
+
return me((f) => {
|
|
143
152
|
D === l.layers.size - 1 && (r == null || r(f), !f.defaultPrevented && c && (f.preventDefault(), c()));
|
|
144
153
|
}, h), o.useEffect(() => {
|
|
145
154
|
if (u)
|
|
146
|
-
return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (
|
|
147
|
-
n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents =
|
|
155
|
+
return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (F = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(u)), l.layers.add(u), M(), () => {
|
|
156
|
+
n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = F);
|
|
148
157
|
};
|
|
149
158
|
}, [u, h, n, l]), o.useEffect(() => () => {
|
|
150
|
-
u && (l.layers.delete(u), l.layersWithOutsidePointerEventsDisabled.delete(u),
|
|
159
|
+
u && (l.layers.delete(u), l.layersWithOutsidePointerEventsDisabled.delete(u), M());
|
|
151
160
|
}, [u, l]), o.useEffect(() => {
|
|
152
161
|
const f = () => w({});
|
|
153
162
|
return document.addEventListener(W, f), () => document.removeEventListener(W, f);
|
|
154
163
|
}, []), /* @__PURE__ */ d(
|
|
155
|
-
|
|
164
|
+
$.div,
|
|
156
165
|
{
|
|
157
166
|
...p,
|
|
158
167
|
ref: b,
|
|
159
168
|
style: {
|
|
160
|
-
pointerEvents: P ?
|
|
161
|
-
...
|
|
169
|
+
pointerEvents: P ? N ? "auto" : "none" : void 0,
|
|
170
|
+
...t.style
|
|
162
171
|
},
|
|
163
|
-
onFocusCapture: x(
|
|
164
|
-
onBlurCapture: x(
|
|
172
|
+
onFocusCapture: x(t.onFocusCapture, k.onFocusCapture),
|
|
173
|
+
onBlurCapture: x(t.onBlurCapture, k.onBlurCapture),
|
|
165
174
|
onPointerDownCapture: x(
|
|
166
|
-
|
|
175
|
+
t.onPointerDownCapture,
|
|
167
176
|
H.onPointerDownCapture
|
|
168
177
|
)
|
|
169
178
|
}
|
|
170
179
|
);
|
|
171
180
|
}
|
|
172
181
|
);
|
|
173
|
-
z.displayName =
|
|
174
|
-
var
|
|
175
|
-
const n = o.useContext(U), r = o.useRef(null), s =
|
|
182
|
+
z.displayName = ve;
|
|
183
|
+
var be = "DismissableLayerBranch", Ce = o.forwardRef((t, e) => {
|
|
184
|
+
const n = o.useContext(U), r = o.useRef(null), s = j(e, r);
|
|
176
185
|
return o.useEffect(() => {
|
|
177
186
|
const i = r.current;
|
|
178
187
|
if (i)
|
|
179
188
|
return n.branches.add(i), () => {
|
|
180
189
|
n.branches.delete(i);
|
|
181
190
|
};
|
|
182
|
-
}, [n.branches]), /* @__PURE__ */ d(
|
|
191
|
+
}, [n.branches]), /* @__PURE__ */ d($.div, { ...t, ref: s });
|
|
183
192
|
});
|
|
184
|
-
|
|
185
|
-
function
|
|
186
|
-
const n =
|
|
193
|
+
Ce.displayName = be;
|
|
194
|
+
function Le(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
195
|
+
const n = _(t), r = o.useRef(!1), s = o.useRef(() => {
|
|
187
196
|
});
|
|
188
197
|
return o.useEffect(() => {
|
|
189
198
|
const i = (c) => {
|
|
190
199
|
if (c.target && !r.current) {
|
|
191
200
|
let p = function() {
|
|
192
201
|
V(
|
|
193
|
-
|
|
202
|
+
Ee,
|
|
194
203
|
n,
|
|
195
204
|
l,
|
|
196
205
|
{ discrete: !0 }
|
|
197
206
|
);
|
|
198
207
|
};
|
|
199
208
|
const l = { originalEvent: c };
|
|
200
|
-
c.pointerType === "touch" ? (
|
|
209
|
+
c.pointerType === "touch" ? (e.removeEventListener("click", s.current), s.current = p, e.addEventListener("click", s.current, { once: !0 })) : p();
|
|
201
210
|
} else
|
|
202
|
-
|
|
211
|
+
e.removeEventListener("click", s.current);
|
|
203
212
|
r.current = !1;
|
|
204
213
|
}, a = window.setTimeout(() => {
|
|
205
|
-
|
|
214
|
+
e.addEventListener("pointerdown", i);
|
|
206
215
|
}, 0);
|
|
207
216
|
return () => {
|
|
208
|
-
window.clearTimeout(a),
|
|
217
|
+
window.clearTimeout(a), e.removeEventListener("pointerdown", i), e.removeEventListener("click", s.current);
|
|
209
218
|
};
|
|
210
|
-
}, [
|
|
219
|
+
}, [e, n]), {
|
|
211
220
|
// ensures we check React component tree (not just DOM tree)
|
|
212
221
|
onPointerDownCapture: () => r.current = !0
|
|
213
222
|
};
|
|
214
223
|
}
|
|
215
|
-
function
|
|
216
|
-
const n =
|
|
224
|
+
function Pe(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
225
|
+
const n = _(t), r = o.useRef(!1);
|
|
217
226
|
return o.useEffect(() => {
|
|
218
227
|
const s = (i) => {
|
|
219
|
-
i.target && !r.current && V(
|
|
228
|
+
i.target && !r.current && V(ge, n, { originalEvent: i }, {
|
|
220
229
|
discrete: !1
|
|
221
230
|
});
|
|
222
231
|
};
|
|
223
|
-
return
|
|
224
|
-
}, [
|
|
232
|
+
return e.addEventListener("focusin", s), () => e.removeEventListener("focusin", s);
|
|
233
|
+
}, [e, n]), {
|
|
225
234
|
onFocusCapture: () => r.current = !0,
|
|
226
235
|
onBlurCapture: () => r.current = !1
|
|
227
236
|
};
|
|
228
237
|
}
|
|
229
|
-
function
|
|
230
|
-
const
|
|
231
|
-
document.dispatchEvent(
|
|
238
|
+
function M() {
|
|
239
|
+
const t = new CustomEvent(W);
|
|
240
|
+
document.dispatchEvent(t);
|
|
232
241
|
}
|
|
233
|
-
function V(
|
|
234
|
-
const s = n.originalEvent.target, i = new CustomEvent(
|
|
235
|
-
|
|
242
|
+
function V(t, e, n, { discrete: r }) {
|
|
243
|
+
const s = n.originalEvent.target, i = new CustomEvent(t, { bubbles: !1, cancelable: !0, detail: n });
|
|
244
|
+
e && s.addEventListener(t, e, { once: !0 }), r ? fe(s, i) : s.dispatchEvent(i);
|
|
236
245
|
}
|
|
237
|
-
function K(
|
|
238
|
-
const
|
|
246
|
+
function K(t) {
|
|
247
|
+
const e = o.useRef(t);
|
|
239
248
|
return o.useEffect(() => {
|
|
240
|
-
|
|
249
|
+
e.current = t;
|
|
241
250
|
}), o.useMemo(() => (...n) => {
|
|
242
251
|
var r;
|
|
243
|
-
return (r =
|
|
252
|
+
return (r = e.current) == null ? void 0 : r.call(e, ...n);
|
|
244
253
|
}, []);
|
|
245
254
|
}
|
|
246
|
-
function
|
|
247
|
-
prop:
|
|
248
|
-
defaultProp:
|
|
255
|
+
function Re({
|
|
256
|
+
prop: t,
|
|
257
|
+
defaultProp: e,
|
|
249
258
|
onChange: n = () => {
|
|
250
259
|
}
|
|
251
260
|
}) {
|
|
252
|
-
const [r, s] =
|
|
261
|
+
const [r, s] = we({ defaultProp: e, onChange: n }), i = t !== void 0, a = i ? t : r, c = K(n), p = o.useCallback(
|
|
253
262
|
(l) => {
|
|
254
263
|
if (i) {
|
|
255
|
-
const y = typeof l == "function" ? l(
|
|
256
|
-
y !==
|
|
264
|
+
const y = typeof l == "function" ? l(t) : l;
|
|
265
|
+
y !== t && c(y);
|
|
257
266
|
} else
|
|
258
267
|
s(l);
|
|
259
268
|
},
|
|
260
|
-
[i,
|
|
269
|
+
[i, t, s, c]
|
|
261
270
|
);
|
|
262
271
|
return [a, p];
|
|
263
272
|
}
|
|
264
|
-
function
|
|
265
|
-
defaultProp:
|
|
266
|
-
onChange:
|
|
273
|
+
function we({
|
|
274
|
+
defaultProp: t,
|
|
275
|
+
onChange: e
|
|
267
276
|
}) {
|
|
268
|
-
const n = o.useState(
|
|
277
|
+
const n = o.useState(t), [r] = n, s = o.useRef(r), i = K(e);
|
|
269
278
|
return o.useEffect(() => {
|
|
270
279
|
s.current !== r && (i(r), s.current = r);
|
|
271
280
|
}, [r, s, i]), n;
|
|
@@ -280,40 +289,40 @@ const X = g.createContext({
|
|
|
280
289
|
},
|
|
281
290
|
removeTopLayer: () => {
|
|
282
291
|
}
|
|
283
|
-
}),
|
|
284
|
-
const [
|
|
292
|
+
}), ze = ({ children: t }) => {
|
|
293
|
+
const [e, n] = g.useState([]), r = (a) => {
|
|
285
294
|
n((c) => [...c, a]);
|
|
286
295
|
}, s = (a) => {
|
|
287
|
-
n(
|
|
296
|
+
n(e.filter((c) => c !== a));
|
|
288
297
|
}, i = () => {
|
|
289
|
-
const a =
|
|
298
|
+
const a = e[e.length - 1];
|
|
290
299
|
a && s(a);
|
|
291
300
|
};
|
|
292
301
|
return /* @__PURE__ */ d(
|
|
293
302
|
X.Provider,
|
|
294
303
|
{
|
|
295
|
-
value: { layers:
|
|
296
|
-
children:
|
|
304
|
+
value: { layers: e, setLayers: n, addLayer: r, removeLayer: s, removeTopLayer: i },
|
|
305
|
+
children: t
|
|
297
306
|
}
|
|
298
307
|
);
|
|
299
|
-
}, Y = () => g.useContext(X),
|
|
300
|
-
defaultOpen:
|
|
301
|
-
open:
|
|
308
|
+
}, Y = () => g.useContext(X), De = ({
|
|
309
|
+
defaultOpen: t,
|
|
310
|
+
open: e,
|
|
302
311
|
onOpenChange: n,
|
|
303
312
|
...r
|
|
304
313
|
}) => {
|
|
305
|
-
const [s, i] =
|
|
306
|
-
prop:
|
|
314
|
+
const [s, i] = Re({
|
|
315
|
+
prop: e,
|
|
307
316
|
onChange: n,
|
|
308
|
-
defaultProp:
|
|
317
|
+
defaultProp: t
|
|
309
318
|
}), a = Y(), c = r.a11yTitle;
|
|
310
319
|
if (g.useEffect(() => {
|
|
311
320
|
!s && a.layers.includes(c) && a.removeLayer(c);
|
|
312
321
|
}, [c, a, s]), !!s)
|
|
313
|
-
return /* @__PURE__ */ d(
|
|
314
|
-
},
|
|
315
|
-
open:
|
|
316
|
-
onOpenChange:
|
|
322
|
+
return /* @__PURE__ */ d(Oe, { open: s, onOpenChange: i, ...r });
|
|
323
|
+
}, Oe = ({
|
|
324
|
+
open: t,
|
|
325
|
+
onOpenChange: e,
|
|
317
326
|
a11yTitle: n,
|
|
318
327
|
a11yDescription: r,
|
|
319
328
|
children: s,
|
|
@@ -326,36 +335,36 @@ const X = g.createContext({
|
|
|
326
335
|
var C, L;
|
|
327
336
|
const l = n, u = Y();
|
|
328
337
|
g.useEffect(() => {
|
|
329
|
-
!u || !
|
|
330
|
-
}, [l, u,
|
|
338
|
+
!u || !t || u.layers.includes(l) || u.addLayer(l);
|
|
339
|
+
}, [l, u, t]);
|
|
331
340
|
const y = ((C = u.layers) == null ? void 0 : C.indexOf(l)) || 0, h = ((L = u.layers) == null ? void 0 : L.length) || 0, w = y !== 0, b = l === u.layers[u.layers.length - 1];
|
|
332
341
|
return /* @__PURE__ */ d(
|
|
333
342
|
z,
|
|
334
343
|
{
|
|
335
344
|
onEscapeKeyDown: (m) => {
|
|
336
|
-
b && (m.preventDefault(), u.removeTopLayer(),
|
|
345
|
+
b && (m.preventDefault(), u.removeTopLayer(), e(!1));
|
|
337
346
|
},
|
|
338
347
|
onPointerDownOutside: (m) => {
|
|
339
|
-
b && (m.preventDefault(), u.removeTopLayer(),
|
|
348
|
+
b && (m.preventDefault(), u.removeTopLayer(), e(!1));
|
|
340
349
|
},
|
|
341
350
|
children: /* @__PURE__ */ S(
|
|
342
351
|
v.Root,
|
|
343
352
|
{
|
|
344
|
-
open:
|
|
353
|
+
open: t,
|
|
345
354
|
onOpenChange: (m) => {
|
|
346
355
|
var P;
|
|
347
356
|
if (((P = u == null ? void 0 : u.layers) == null ? void 0 : P.length) > 0)
|
|
348
|
-
return m === !1 && l === u.layers[u.layers.length - 1] ? (u.removeLayer(l),
|
|
349
|
-
|
|
357
|
+
return m === !1 && l === u.layers[u.layers.length - 1] ? (u.removeLayer(l), e(!1)) : void 0;
|
|
358
|
+
e(m);
|
|
350
359
|
},
|
|
351
360
|
children: [
|
|
352
361
|
/* @__PURE__ */ S(Q.Root, { children: [
|
|
353
362
|
/* @__PURE__ */ d(v.Title, { children: n }),
|
|
354
363
|
r && /* @__PURE__ */ d(v.Description, { children: r })
|
|
355
364
|
] }),
|
|
356
|
-
/* @__PURE__ */ d(se, { children:
|
|
365
|
+
/* @__PURE__ */ d(se, { children: t && // We add the className "tgph" here so that styles within
|
|
357
366
|
// the portal get scoped properly to telegraph
|
|
358
|
-
/* @__PURE__ */ d(J.Root, { className: "tgph", children: /* @__PURE__ */ d(
|
|
367
|
+
/* @__PURE__ */ d(J.Root, { className: "tgph", children: /* @__PURE__ */ d(xe, { layer: y, children: /* @__PURE__ */ d(
|
|
359
368
|
G,
|
|
360
369
|
{
|
|
361
370
|
trapped: typeof i == "boolean" ? i : b,
|
|
@@ -419,7 +428,7 @@ const X = g.createContext({
|
|
|
419
428
|
)
|
|
420
429
|
}
|
|
421
430
|
);
|
|
422
|
-
},
|
|
431
|
+
}, xe = ({ layer: t, children: e }) => t > 0 ? e : /* @__PURE__ */ S(v.Overlay, { children: [
|
|
423
432
|
/* @__PURE__ */ d(
|
|
424
433
|
re,
|
|
425
434
|
{
|
|
@@ -439,24 +448,24 @@ const X = g.createContext({
|
|
|
439
448
|
}
|
|
440
449
|
}
|
|
441
450
|
),
|
|
442
|
-
|
|
443
|
-
] }),
|
|
444
|
-
({ children:
|
|
445
|
-
),
|
|
446
|
-
size:
|
|
447
|
-
variant:
|
|
451
|
+
e
|
|
452
|
+
] }), Se = g.forwardRef(
|
|
453
|
+
({ children: t, ...e }, n) => /* @__PURE__ */ d(v.Content, { ref: n, asChild: !0, ...e, children: /* @__PURE__ */ d(E, { direction: "column", h: "full", ...e, children: t }) })
|
|
454
|
+
), Te = ({
|
|
455
|
+
size: t = "1",
|
|
456
|
+
variant: e = "ghost",
|
|
448
457
|
...n
|
|
449
458
|
}) => /* @__PURE__ */ d(v.Close, { asChild: !0, children: /* @__PURE__ */ d(
|
|
450
459
|
ee,
|
|
451
460
|
{
|
|
452
461
|
icon: { icon: ne.X, alt: "Close Modal" },
|
|
453
|
-
variant:
|
|
454
|
-
size:
|
|
462
|
+
variant: e,
|
|
463
|
+
size: t,
|
|
455
464
|
...n
|
|
456
465
|
}
|
|
457
|
-
) }),
|
|
458
|
-
style:
|
|
459
|
-
children:
|
|
466
|
+
) }), Be = ({
|
|
467
|
+
style: t,
|
|
468
|
+
children: e,
|
|
460
469
|
...n
|
|
461
470
|
}) => /* @__PURE__ */ d(
|
|
462
471
|
E,
|
|
@@ -466,14 +475,14 @@ const X = g.createContext({
|
|
|
466
475
|
py: "4",
|
|
467
476
|
style: {
|
|
468
477
|
overflowY: "auto",
|
|
469
|
-
...
|
|
478
|
+
...t
|
|
470
479
|
},
|
|
471
480
|
...n,
|
|
472
|
-
children:
|
|
481
|
+
children: e
|
|
473
482
|
}
|
|
474
|
-
),
|
|
475
|
-
children:
|
|
476
|
-
...
|
|
483
|
+
), We = ({
|
|
484
|
+
children: t,
|
|
485
|
+
...e
|
|
477
486
|
}) => /* @__PURE__ */ d(
|
|
478
487
|
E,
|
|
479
488
|
{
|
|
@@ -483,12 +492,12 @@ const X = g.createContext({
|
|
|
483
492
|
px: "6",
|
|
484
493
|
py: "4",
|
|
485
494
|
borderBottom: "px",
|
|
486
|
-
...
|
|
487
|
-
children:
|
|
495
|
+
...e,
|
|
496
|
+
children: t
|
|
488
497
|
}
|
|
489
|
-
),
|
|
490
|
-
children:
|
|
491
|
-
...
|
|
498
|
+
), Ne = ({
|
|
499
|
+
children: t,
|
|
500
|
+
...e
|
|
492
501
|
}) => /* @__PURE__ */ d(
|
|
493
502
|
E,
|
|
494
503
|
{
|
|
@@ -499,20 +508,20 @@ const X = g.createContext({
|
|
|
499
508
|
px: "6",
|
|
500
509
|
py: "4",
|
|
501
510
|
borderTop: "px",
|
|
502
|
-
...
|
|
503
|
-
children:
|
|
511
|
+
...e,
|
|
512
|
+
children: t
|
|
504
513
|
}
|
|
505
|
-
),
|
|
506
|
-
Object.assign(
|
|
507
|
-
Root:
|
|
508
|
-
Content:
|
|
509
|
-
Close:
|
|
510
|
-
Body:
|
|
511
|
-
Header:
|
|
512
|
-
Footer:
|
|
514
|
+
), ke = {};
|
|
515
|
+
Object.assign(ke, {
|
|
516
|
+
Root: De,
|
|
517
|
+
Content: Se,
|
|
518
|
+
Close: Te,
|
|
519
|
+
Body: Be,
|
|
520
|
+
Header: We,
|
|
521
|
+
Footer: Ne
|
|
513
522
|
});
|
|
514
523
|
export {
|
|
515
|
-
|
|
516
|
-
|
|
524
|
+
ke as Modal,
|
|
525
|
+
ze as ModalStackingProvider
|
|
517
526
|
};
|
|
518
527
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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-slot/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../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-dismissable-layer/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/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/node_modules/@radix-ui/react-use-callback-ref/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/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/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-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-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","Slot","React","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","useComposedRefs","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,EAE/B;AACA;ACNA,SAASC,GAAOC,GAAKC,GAAO;AAC1B,EAAI,OAAOD,KAAQ,aACjBA,EAAIC,CAAK,IACAD,KAAQ,SACjBA,EAAI,UAAUC;AAElB;AACA,SAASC,MAAeC,GAAM;AAC5B,SAAO,CAACC,MAASD,EAAK,QAAQ,CAACH,MAAQD,GAAOC,GAAKI,CAAI,CAAC;AAC1D;ACPA,IAAIC,IAAOC,EAAM,WAAW,CAACC,GAAOC,MA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IACJ,IAAG;AAAA,IACH,IAAG;AAAA,IACH,WAAU;AAAA,IACT,GAAGhJ;AAAA,IAEH,UAAAE;AAAA,EAAA;AAAA,GAKD2J,KAAQ,CAAC;AASf,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,8,9]}
|
|
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-slot/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../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-dismissable-layer/node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../../../node_modules/@radix-ui/react-dismissable-layer/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs","../../../../node_modules/@radix-ui/react-use-escape-keydown/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/node_modules/@radix-ui/react-use-callback-ref/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/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/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-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-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-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","Slot","React","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","useComposedRefs","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,MAAeC,GAAM;AAC5B,SAAO,CAACC,MAASD,EAAK,QAAQ,CAACH,MAAQD,GAAOC,GAAKI,CAAI,CAAC;AAC1D;ACPA,IAAIC,IAAOC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACnD,QAAM,EAAE,UAAAC,GAAU,GAAGC,EAAS,IAAKH,GAC7BI,IAAgBL,EAAM,SAAS,QAAQG,CAAQ,GAC/CG,IAAYD,EAAc,KAAKE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A,GAAGF;AACL,MAEI,gBAAAU;AAAA,EAACsI;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,GAAGhJ;AAAA,IAEH,UAAAE;AAAA,EAAA;AACH,GAIE2J,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,8,9,10]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegraph/modal",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/modal",
|
|
5
5
|
"author": "@knocklabs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,11 +33,11 @@
|
|
|
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.
|
|
36
|
+
"@telegraph/button": "^0.0.59",
|
|
37
37
|
"@telegraph/helpers": "^0.0.7",
|
|
38
|
-
"@telegraph/icon": "^0.0.
|
|
39
|
-
"@telegraph/layout": "^0.1.
|
|
40
|
-
"@telegraph/style-engine": "^0.1.
|
|
38
|
+
"@telegraph/icon": "^0.0.39",
|
|
39
|
+
"@telegraph/layout": "^0.1.5",
|
|
40
|
+
"@telegraph/style-engine": "^0.1.3",
|
|
41
41
|
"framer-motion": "^11.1.9"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react": "^18.2.0",
|
|
52
52
|
"react-dom": "^18.3.1",
|
|
53
53
|
"typescript": "^5.5.4",
|
|
54
|
-
"vite": "^
|
|
54
|
+
"vite": "^6.0.11"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"react": "^18.2.0",
|