@telegraph/modal 0.0.46 → 0.0.47
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 +6 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +463 -114
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/Modal/Modal.d.ts +2 -1
- package/dist/types/Modal/Modal.d.ts.map +1 -1
- package/dist/types/Modal/Modal.helpers.d.ts +10 -0
- package/dist/types/Modal/Modal.helpers.d.ts.map +1 -0
- package/dist/types/Modal/ModalStacking.d.ts +18 -0
- package/dist/types/Modal/ModalStacking.d.ts.map +1 -0
- package/dist/types/Modal/index.d.ts +1 -0
- package/dist/types/Modal/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @telegraph/modal
|
|
2
2
|
|
|
3
|
+
## 0.0.47
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#295](https://github.com/knocklabs/telegraph/pull/295) [`17d9d04`](https://github.com/knocklabs/telegraph/commit/17d9d0468df142513e6ef49d7adfe18b25e2fb79) Thanks [@kylemcd](https://github.com/kylemcd)! - modal stacking
|
|
8
|
+
|
|
3
9
|
## 0.0.46
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),y=require("@radix-ui/react-dialog"),p=require("@radix-ui/react-visually-hidden"),j=require("@telegraph/button"),f=require("@telegraph/icon"),r=require("@telegraph/layout"),s=require("framer-motion"),m=require("react");function d(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const c=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(i,o,c.get?c:{enumerable:!0,get:()=>e[o]})}}return i.default=e,Object.freeze(i)}const n=d(y),b=d(p),g=({defaultOpen:e,open:i,onOpenChange:o,a11yTitle:c,a11yDescription:l,children:x,...a})=>t.jsxs(n.Root,{open:i,onOpenChange:o,defaultOpen:e,children:[t.jsxs(b.Root,{children:[t.jsx(n.Title,{children:c}),l&&t.jsx(n.Description,{children:l})]}),t.jsx(s.AnimatePresence,{children:i&&t.jsx(t.Fragment,{children:t.jsxs(n.Overlay,{children:[t.jsx(r.Box,{as:s.motion.div,onClick:()=>o==null?void 0:o(!1),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,bounce:0,type:"spring"},bg:"alpha-black-6",zIndex:"overlay",style:{position:"fixed",inset:"0px"}}),t.jsx(r.Stack,{zIndex:"modal",w:"full",style:{position:"fixed",top:0,left:"50%",maxHeight:"calc(100vh - var(--tgph-spacing-32))",maxWidth:"calc(100vw - var(--tgph-spacing-8))"},children:t.jsx(r.Stack,{direction:"column",as:s.motion.div,my:"16",initial:{scale:.8,opacity:0,y:-20,x:"-50%"},animate:{scale:1,opacity:1,y:0,x:"-50%"},exit:{scale:.8,opacity:0,y:-20,x:"-50%"},transition:{duration:.2,bounce:0,type:"spring"},maxW:a.maxW??"160",w:a.w??"full",bg:"surface-1",border:"px",rounded:"4",shadow:"1",...a,children:x})})]})})})]}),h=m.forwardRef(({children:e,...i},o)=>t.jsx(n.Content,{ref:o,...i,asChild:!0,children:t.jsx(r.Stack,{direction:"column",h:"full",...i,children:e})})),v=({size:e="1",variant:i="ghost",...o})=>t.jsx(n.Close,{asChild:!0,children:t.jsx(j.Button,{icon:{icon:f.Lucide.X,alt:"Close Modal"},variant:i,size:e,...o})}),w=({children:e,...i})=>t.jsx(r.Stack,{direction:"column",px:"6",py:"4",...i,children:e}),S=({children:e,...i})=>t.jsx(r.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...i,children:e}),k=({children:e,...i})=>t.jsx(r.Stack,{direction:"row",align:"center",justify:"flex-end",gap:"2",px:"6",py:"4",borderTop:"px",...i,children:e}),u={};Object.assign(u,{Root:g,Content:h,Close:v,Body:w,Header:S,Footer:k});exports.Modal=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),Y=require("@radix-ui/react-dialog"),Z=require("@radix-ui/react-focus-scope"),v=require("react"),G=require("@radix-ui/react-visually-hidden"),J=require("@telegraph/button"),Q=require("@telegraph/icon"),m=require("@telegraph/layout"),P=require("framer-motion"),ee=require("react-dom");function L(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=L(Y),o=L(v),te=L(G),ne=L(ee);function _(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]=se({defaultProp:t,onChange:n}),i=e!==void 0,l=i?e:r,a=_(n),d=o.useCallback(c=>{if(i){const g=typeof c=="function"?c(e):c;g!==e&&a(g)}else s(c)},[i,e,s,a]);return[l,d]}function se({defaultProp:e,onChange:t}){const n=o.useState(e),[r]=n,s=o.useRef(r),i=_(t);return o.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function R(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 oe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ie(...e){return t=>e.forEach(n=>oe(n,t))}var F=o.forwardRef((e,t)=>{const{children:n,...r}=e,s=o.Children.toArray(n),i=s.find(ce);if(i){const l=i.props.children,a=s.map(d=>d===i?o.Children.count(l)>1?o.Children.only(null):o.isValidElement(l)?l.props.children:null:d);return u.jsx(S,{...r,ref:t,children:o.isValidElement(l)?o.cloneElement(l,void 0,a):null})}return u.jsx(S,{...r,ref:t,children:n})});F.displayName="Slot";var S=o.forwardRef((e,t)=>{const{children:n,...r}=e;if(o.isValidElement(n)){const s=ue(n);return o.cloneElement(n,{...le(r,n.props),ref:t?ie(t,s):s})}return o.Children.count(n)>1?o.Children.only(null):null});S.displayName="SlotClone";var ae=({children:e})=>u.jsx(u.Fragment,{children:e});function ce(e){return o.isValidElement(e)&&e.type===ae}function le(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]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function ue(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 de=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],A=de.reduce((e,t)=>{const n=o.forwardRef((r,s)=>{const{asChild:i,...l}=r,a=i?F:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(a,{...l,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fe(e,t){e&&ne.flushSync(()=>e.dispatchEvent(t))}function pe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function ye(...e){return t=>e.forEach(n=>pe(n,t))}function I(...e){return o.useCallback(ye(...e),e)}function D(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 he(e,t=globalThis==null?void 0:globalThis.document){const n=D(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 ve="DismissableLayer",w="dismissableLayer.update",me="dismissableLayer.pointerDownOutside",ge="dismissableLayer.focusOutside",M,q=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:l,onDismiss:a,...d}=e,c=o.useContext(q),[p,g]=o.useState(null),y=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=o.useState({}),h=I(t,f=>g(f)),O=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),K=O.indexOf(x),T=p?O.indexOf(p):-1,H=c.layersWithOutsidePointerEventsDisabled.size>0,k=T>=K,X=xe(f=>{const C=f.target,B=[...c.branches].some(j=>j.contains(C));!k||B||(s==null||s(f),l==null||l(f),f.defaultPrevented||a==null||a())},y),W=Ce(f=>{const C=f.target;[...c.branches].some(j=>j.contains(C))||(i==null||i(f),l==null||l(f),f.defaultPrevented||a==null||a())},y);return he(f=>{T===c.layers.size-1&&(r==null||r(f),!f.defaultPrevented&&a&&(f.preventDefault(),a()))},y),o.useEffect(()=>{if(p)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(M=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(p)),c.layers.add(p),N(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=M)}},[p,y,n,c]),o.useEffect(()=>()=>{p&&(c.layers.delete(p),c.layersWithOutsidePointerEventsDisabled.delete(p),N())},[p,c]),o.useEffect(()=>{const f=()=>b({});return document.addEventListener(w,f),()=>document.removeEventListener(w,f)},[]),u.jsx(A.div,{...d,ref:h,style:{pointerEvents:H?k?"auto":"none":void 0,...e.style},onFocusCapture:R(e.onFocusCapture,W.onFocusCapture),onBlurCapture:R(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:R(e.onPointerDownCapture,X.onPointerDownCapture)})});$.displayName=ve;var Ee="DismissableLayerBranch",be=o.forwardRef((e,t)=>{const n=o.useContext(q),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]),u.jsx(A.div,{...e,ref:s})});be.displayName=Ee;function xe(e,t=globalThis==null?void 0:globalThis.document){const n=D(e),r=o.useRef(!1),s=o.useRef(()=>{});return o.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let d=function(){z(me,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=d,t.addEventListener("click",s.current,{once:!0})):d()}else t.removeEventListener("click",s.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ce(e,t=globalThis==null?void 0:globalThis.document){const n=D(e),r=o.useRef(!1);return o.useEffect(()=>{const s=i=>{i.target&&!r.current&&z(ge,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 N(){const e=new CustomEvent(w);document.dispatchEvent(e)}function z(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?fe(s,i):s.dispatchEvent(i)}const Pe=({id:e,layers:t,children:n,...r})=>e===t[t.length-1]?u.jsx($,{...r,children:n}):u.jsx(u.Fragment,{children:n}),U=v.createContext({layers:[],setLayers:()=>{},addLayer:()=>{},removeLayer:()=>{},removeTopLayer:()=>{}}),Le=({children:e})=>{const[t,n]=v.useState([]),r=(l,a={})=>{const{layer:d}=a;if(typeof d=="number")return n(c=>c.length-1<d?[...c,l]:[...c.slice(0,d),l,...c.slice(d)]);n(c=>[...c,l])},s=l=>{n(t.filter(a=>a!==l))},i=()=>{const l=t[t.length-1];l&&s(l)};return u.jsx(U.Provider,{value:{layers:t,setLayers:n,addLayer:r,removeLayer:s,removeTopLayer:i},children:e})},Oe=()=>v.useContext(U),je=({defaultOpen:e,open:t,onOpenChange:n,...r})=>{const[s,i]=re({prop:t,onChange:n,defaultProp:e});if(s)return u.jsx(Re,{open:s,onOpenChange:i,...r})},Re=({open:e,onOpenChange:t,a11yTitle:n,a11yDescription:r,children:s,layer:i,...l})=>{var y,b;const a=v.useId(),d=Oe();v.useEffect(()=>{!d||!e||d.layers.includes(a)||d.addLayer(a,{layer:i})},[a,i,d,e]);const c=((y=d.layers)==null?void 0:y.indexOf(a))||0,p=((b=d.layers)==null?void 0:b.length)||0,g=c!==0;return u.jsx(Pe,{id:a,layers:d.layers,onEscapeKeyDown:h=>{h.preventDefault(),d.removeTopLayer(),t(!1)},onPointerDownOutside:h=>{h.preventDefault(),d.removeTopLayer(),t(!1)},children:u.jsxs(E.Root,{open:e,onOpenChange:h=>{var x;if(((x=d==null?void 0:d.layers)==null?void 0:x.length)>0)return h===!1&&a===d.layers[d.layers.length-1]?(d.removeLayer(a),t(!1)):void 0;t(h)},children:[u.jsxs(te.Root,{children:[u.jsx(E.Title,{children:n}),r&&u.jsx(E.Description,{children:r})]}),u.jsx(P.AnimatePresence,{children:e&&u.jsx(Se,{layer:c,children:u.jsx(m.Stack,{as:P.motion.div,initial:{top:`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${p-1})`},animate:{top:g?`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${c} )`:"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) + ${c})`},children:u.jsx(m.Stack,{direction:"column",as:P.motion.div,animate:{scale:1.02-Math.abs(p-c)*.02,transformOrigin:"center center"},transition:{duration:.2,bounce:0,type:"spring"},maxW:l.maxW??"160",w:l.w??"full",bg:"surface-1",border:"px",rounded:"4",shadow:"3",...l,children:s},`content-${a}`)},`container-${a}`)})})]},a)})},Se=({layer:e,children:t})=>e>0?t:u.jsxs(E.Overlay,{children:[u.jsx(m.Box,{as:P.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]}),we=v.forwardRef(({children:e,...t},n)=>u.jsx(Z.FocusScope,{trapped:!0,children:u.jsx(E.Content,{ref:n,asChild:!0,...t,children:u.jsx(m.Stack,{direction:"column",h:"full",...t,children:e})})})),De=({size:e="1",variant:t="ghost",...n})=>u.jsx(E.Close,{asChild:!0,children:u.jsx(J.Button,{icon:{icon:Q.Lucide.X,alt:"Close Modal"},variant:t,size:e,...n})}),Te=({children:e,...t})=>u.jsx(m.Stack,{direction:"column",px:"6",py:"4",...t,children:e}),ke=({children:e,...t})=>u.jsx(m.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...t,children:e}),We=({children:e,...t})=>u.jsx(m.Stack,{direction:"row",align:"center",justify:"flex-end",gap:"2",px:"6",py:"4",borderTop:"px",...t,children:e}),V={};Object.assign(V,{Root:je,Content:we,Close:De,Body:Te,Header:ke,Footer:We});exports.Modal=V;exports.ModalStackingProvider=Le;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/Modal/Modal.tsx"],"sourcesContent":["import * as Dialog from \"@radix-ui/react-dialog\";\nimport * as VisuallyHidden from \"@radix-ui/react-visually-hidden\";\nimport { Button } from \"@telegraph/button\";\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\ntype RootProps = Omit<\n React.ComponentPropsWithoutRef<typeof Dialog.Root>,\n \"modal\"\n> &\n TgphComponentProps<typeof Stack> & {\n a11yTitle: string;\n a11yDescription?: string;\n };\n\nconst Root = ({\n defaultOpen,\n open,\n onOpenChange,\n a11yTitle,\n a11yDescription,\n children,\n ...props\n}: RootProps) => {\n return (\n <Dialog.Root\n open={open}\n onOpenChange={onOpenChange}\n defaultOpen={defaultOpen}\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 <>\n <Dialog.Overlay>\n <Box\n as={motion.div}\n onClick={() => onOpenChange?.(false)}\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 zIndex=\"overlay\"\n style={{\n position: \"fixed\",\n inset: \"0px\",\n }}\n />\n <Stack\n zIndex=\"modal\"\n w=\"full\"\n style={{\n position: \"fixed\",\n top: 0,\n left: \"50%\",\n maxHeight: \"calc(100vh - var(--tgph-spacing-32))\",\n maxWidth: \"calc(100vw - var(--tgph-spacing-8))\",\n }}\n >\n <Stack\n direction=\"column\"\n as={motion.div}\n my=\"16\"\n initial={{ scale: 0.8, opacity: 0, y: -20, x: \"-50%\" }}\n animate={{ scale: 1, opacity: 1, y: 0, x: \"-50%\" }}\n exit={{ scale: 0.8, opacity: 0, y: -20, x: \"-50%\" }}\n transition={{ duration: 0.2, bounce: 0, type: \"spring\" }}\n maxW={props.maxW ?? \"160\"}\n w={props.w ?? \"full\"}\n bg=\"surface-1\"\n border=\"px\"\n rounded=\"4\"\n shadow=\"1\"\n {...props}\n >\n {children}\n </Stack>\n </Stack>\n </Dialog.Overlay>\n </>\n )}\n </AnimatePresence>\n </Dialog.Root>\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} {...props} asChild>\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>({ children, ...props }: BodyProps<T>) => {\n return (\n <Stack direction=\"column\" px=\"6\" py=\"4\" {...props}>\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":["Root","defaultOpen","open","onOpenChange","a11yTitle","a11yDescription","children","props","jsxs","Dialog","VisuallyHidden","jsx","AnimatePresence","Box","motion","Stack","Content","React","forwardedRef","Close","size","variant","Button","Lucide","Body","Header","Footer","Modal"],"mappings":"gnBAsBMA,EAAO,CAAC,CACZ,YAAAC,EACA,KAAAC,EACA,aAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,SAAAC,EACA,GAAGC,CACL,IAEIC,EAAA,KAACC,EAAO,KAAP,CACC,KAAAP,EACA,aAAAC,EACA,YAAAF,EAEA,SAAA,CAACO,EAAAA,KAAAE,EAAe,KAAf,CACC,SAAA,CAACC,EAAAA,IAAAF,EAAO,MAAP,CAAc,SAAUL,CAAA,CAAA,EACxBC,GACCM,EAAA,IAACF,EAAO,YAAP,CAAoB,SAAgBJ,EAAA,CAAA,EAEzC,QACCO,EAAAA,gBACE,CAAA,SAAAV,qBAEG,SAACM,EAAAA,KAAAC,EAAO,QAAP,CACC,SAAA,CAAAE,EAAA,IAACE,EAAA,IAAA,CACC,GAAIC,EAAO,OAAA,IACX,QAAS,IAAMX,GAAA,YAAAA,EAAe,IAC9B,QAAS,CAAE,QAAS,CAAE,EACtB,QAAS,CAAE,Q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AE,KAAMC,EAAAA,OAAO,EAAG,IAAK,aAAc,EAC3C,QAAAF,EACA,KAAAD,EACC,GAAGb,CAAA,CAER,CAAA,CAAA,EAOEiB,EAAO,CAAwB,CAAE,SAAAlB,EAAU,GAAGC,KAEhDI,EAAA,IAACI,EAAM,MAAA,CAAA,UAAU,SAAS,GAAG,IAAI,GAAG,IAAK,GAAGR,EACzC,SAAAD,CACH,CAAA,EAOEmB,EAAS,CAAwB,CACrC,SAAAnB,EACA,GAAGC,CACL,IAEII,EAAA,IAACI,EAAA,MAAA,CACC,UAAU,MACV,QAAQ,gBACR,MAAM,SACN,GAAG,IACH,GAAG,IACH,aAAa,KACZ,GAAGR,EAEH,SAAAD,CAAA,CAAA,EAQDoB,EAAS,CAAwB,CACrC,SAAApB,EACA,GAAGC,CACL,IAEII,EAAA,IAACI,EAAA,MAAA,CACC,UAAU,MACV,MAAM,SACN,QAAQ,WACR,IAAI,IACJ,GAAG,IACH,GAAG,IACH,UAAU,KACT,GAAGR,EAEH,SAAAD,CAAA,CAAA,EAKDqB,EAAQ,CAAC,EASf,OAAO,OAAOA,EAAO,CACnB,KAAA3B,EACA,QAAAgB,EACA,MAAAG,EACA,KAAAK,EACA,OAAAC,EACA,OAAAC,CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../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","../../../../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","../../src/Modal/Modal.helpers.tsx","../../src/Modal/ModalStacking.tsx","../../src/Modal/Modal.tsx"],"sourcesContent":["// 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","// 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","import {\n DismissableLayer,\n type DismissableLayerProps,\n} from \"@radix-ui/react-dismissable-layer\";\n\ntype DismissableWrapperProps = DismissableLayerProps & {\n id: string;\n layers: Array<string>;\n children: React.ReactNode;\n};\n\n//\n// Handles the logic for when a global action like \"esc\" or clicking outside\n// should close the modal. When stacking modals, we don't want to close the\n// modal if we are not on the top-most layer.\n//\nconst DismissableWrapper = ({\n id,\n layers,\n children,\n ...props\n}: DismissableWrapperProps) => {\n const isTopLayer = id === layers[layers.length - 1];\n\n if (isTopLayer) {\n return <DismissableLayer {...props}>{children}</DismissableLayer>;\n }\n\n return <>{children}</>;\n};\n\nexport { DismissableWrapper };\n","import React from \"react\";\n\ntype AddLayerOptions = {\n layer?: number;\n};\n\nconst ModalStackingContext = React.createContext<{\n layers: Array<string>;\n setLayers: React.Dispatch<React.SetStateAction<Array<string>>>;\n addLayer: (id: string, options: AddLayerOptions) => 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, options: AddLayerOptions = {}) => {\n const { layer } = options;\n\n // If a layer is specified, insert the layer at the specified index\n // so that the modal renders at the correct layer in the stack.\n if (typeof layer === \"number\") {\n return setLayers((current) => {\n if (current.length - 1 < layer) {\n return [...current, id];\n }\n\n return [...current.slice(0, layer), id, ...current.slice(layer)];\n });\n } else {\n setLayers((current) => [...current, id]);\n }\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 { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as VisuallyHidden from \"@radix-ui/react-visually-hidden\";\nimport { Button } from \"@telegraph/button\";\nimport type { Required } 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 { DismissableWrapper } from \"./Modal.helpers\";\nimport { useModalStacking } from \"./ModalStacking\";\n\ntype RootProps = Omit<\n React.ComponentPropsWithoutRef<typeof Dialog.Root>,\n \"modal\"\n> &\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 // 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\nconst RootComponent = ({\n open,\n onOpenChange,\n a11yTitle,\n a11yDescription,\n children,\n layer: layerProp,\n ...props\n}: Required<RootProps, \"open\" | \"onOpenChange\">) => {\n const id = React.useId();\n const stacking = useModalStacking();\n\n React.useEffect(() => {\n if (!stacking || !open || stacking.layers.includes(id)) return;\n stacking.addLayer(id, { layer: layerProp });\n }, [id, layerProp, stacking, open]);\n\n const layer = stacking.layers?.indexOf(id) || 0;\n const layersLength = stacking.layers?.length || 0;\n const isStacked = layer !== 0;\n\n return (\n <DismissableWrapper\n id={id}\n layers={stacking.layers}\n onEscapeKeyDown={(event) => {\n event.preventDefault();\n stacking.removeTopLayer();\n onOpenChange(false);\n }}\n onPointerDownOutside={(event) => {\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 <Overlay layer={layer}>\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={{ duration: 0.2, bounce: 0, type: \"spring\" }}\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 </Overlay>\n )}\n </AnimatePresence>\n </Dialog.Root>\n </DismissableWrapper>\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 <FocusScope trapped={true}>\n <Dialog.Content ref={forwardedRef} asChild {...props}>\n <Stack direction=\"column\" h=\"full\" {...props}>\n {children}\n </Stack>\n </Dialog.Content>\n </FocusScope>\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>({ children, ...props }: BodyProps<T>) => {\n return (\n <Stack direction=\"column\" px=\"6\" py=\"4\" {...props}>\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":["useCallbackRef","callback","callbackRef","React","args","_a","useControllableState","prop","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","useUncontrolledState","isControlled","value","handleChange","setValue","nextValue","value2","uncontrolledState","prevValueRef","composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","setRef","ref","composeRefs","refs","node","Slot","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","SlotClone","childrenRef","getElementRef","mergeProps","Slottable","Fragment","childProps","overrideProps","propName","slotPropValue","childPropValue","element","getter","mayWarn","_b","NODES","Primitive","primitive","Node","asChild","primitiveProps","Comp","dispatchDiscreteCustomEvent","target","ReactDOM","useComposedRefs","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","DismissableWrapper","id","ModalStackingContext","ModalStackingProvider","setLayers","addLayer","options","layer","current","removeLayer","removeTopLayer","useModalStacking","Root","defaultOpenProp","openProp","onOpenChangeProp","open","onOpenChange","RootComponent","a11yTitle","a11yDescription","layerProp","stacking","layersLength","isStacked","jsxs","Dialog","VisuallyHidden","AnimatePresence","Overlay","Stack","motion","Box","Content","FocusScope","Close","size","variant","Button","Lucide","Body","Header","Footer","Modal"],"mappings":"ksBAEA,SAASA,EAAeC,EAAU,CAChC,MAAMC,EAAcC,EAAM,OAAOF,CAAQ,EACzCE,OAAAA,EAAM,UAAU,IAAM,CACpBD,EAAY,QAAUD,CAC1B,CAAG,EACME,EAAM,QAAQ,IAAM,IAAIC,IAAI,OAAK,OAAAC,EAAAH,EAAY,UAAZ,YAAAG,EAAA,KAAAH,EAAsB,GAAGE,IAAO,CAAA,CAAE,CAC5E,CCLA,SAASE,GAAqB,CAC5B,KAAAC,EACA,YAAAC,EACA,SAAAC,EAAW,IAAM,CAChB,CACH,EAAG,CACD,KAAM,CAACC,EAAkBC,CAAmB,EAAIC,GAAqB,CAAE,YAAAJ,EAAa,SAAAC,CAAQ,CAAE,EACxFI,EAAeN,IAAS,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SAAAjI,EAAU,GAAGF,KAEhDU,EAAA,IAAC+G,EAAM,MAAA,CAAA,UAAU,SAAS,GAAG,IAAI,GAAG,IAAK,GAAGzH,EACzC,SAAAE,CACH,CAAA,EAOEkI,GAAS,CAAwB,CACrC,SAAAlI,EACA,GAAGF,CACL,IAEIU,EAAA,IAAC+G,EAAA,MAAA,CACC,UAAU,MACV,QAAQ,gBACR,MAAM,SACN,GAAG,IACH,GAAG,IACH,aAAa,KACZ,GAAGzH,EAEH,SAAAE,CAAA,CAAA,EAQDmI,GAAS,CAAwB,CACrC,SAAAnI,EACA,GAAGF,CACL,IAEIU,EAAA,IAAC+G,EAAA,MAAA,CACC,UAAU,MACV,MAAM,SACN,QAAQ,WACR,IAAI,IACJ,GAAG,IACH,GAAG,IACH,UAAU,KACT,GAAGzH,EAEH,SAAAE,CAAA,CAAA,EAKDoI,EAAQ,CAAC,EASf,OAAO,OAAOA,EAAO,CACnB,KAAA/B,GACA,QAAAqB,GACA,MAAAE,GACA,KAAAK,GACA,OAAAC,GACA,OAAAC,EACF,CAAC","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9]}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,104 +1,452 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
...
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
import { jsx as d, Fragment as I, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import * as v from "@radix-ui/react-dialog";
|
|
3
|
+
import { FocusScope as Z } from "@radix-ui/react-focus-scope";
|
|
4
|
+
import * as o from "react";
|
|
5
|
+
import E from "react";
|
|
6
|
+
import * as q from "@radix-ui/react-visually-hidden";
|
|
7
|
+
import { Button as G } from "@telegraph/button";
|
|
8
|
+
import { Lucide as J } from "@telegraph/icon";
|
|
9
|
+
import { Stack as g, Box as Q } from "@telegraph/layout";
|
|
10
|
+
import { AnimatePresence as ee, motion as O } from "framer-motion";
|
|
11
|
+
import * as te from "react-dom";
|
|
12
|
+
function M(t) {
|
|
13
|
+
const e = o.useRef(t);
|
|
14
|
+
return o.useEffect(() => {
|
|
15
|
+
e.current = t;
|
|
16
|
+
}), o.useMemo(() => (...n) => {
|
|
17
|
+
var r;
|
|
18
|
+
return (r = e.current) == null ? void 0 : r.call(e, ...n);
|
|
19
|
+
}, []);
|
|
20
|
+
}
|
|
21
|
+
function ne({
|
|
22
|
+
prop: t,
|
|
23
|
+
defaultProp: e,
|
|
24
|
+
onChange: n = () => {
|
|
25
|
+
}
|
|
26
|
+
}) {
|
|
27
|
+
const [r, s] = re({ defaultProp: e, onChange: n }), i = t !== void 0, l = i ? t : r, a = M(n), u = o.useCallback(
|
|
28
|
+
(c) => {
|
|
29
|
+
if (i) {
|
|
30
|
+
const m = typeof c == "function" ? c(t) : c;
|
|
31
|
+
m !== t && a(m);
|
|
32
|
+
} else
|
|
33
|
+
s(c);
|
|
34
|
+
},
|
|
35
|
+
[i, t, s, a]
|
|
36
|
+
);
|
|
37
|
+
return [l, u];
|
|
38
|
+
}
|
|
39
|
+
function re({
|
|
40
|
+
defaultProp: t,
|
|
41
|
+
onChange: e
|
|
42
|
+
}) {
|
|
43
|
+
const n = o.useState(t), [r] = n, s = o.useRef(r), i = M(e);
|
|
44
|
+
return o.useEffect(() => {
|
|
45
|
+
s.current !== r && (i(r), s.current = r);
|
|
46
|
+
}, [r, s, i]), n;
|
|
47
|
+
}
|
|
48
|
+
function R(t, e, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
49
|
+
return function(s) {
|
|
50
|
+
if (t == null || t(s), n === !1 || !s.defaultPrevented)
|
|
51
|
+
return e == null ? void 0 : e(s);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function se(t, e) {
|
|
55
|
+
typeof t == "function" ? t(e) : t != null && (t.current = e);
|
|
56
|
+
}
|
|
57
|
+
function oe(...t) {
|
|
58
|
+
return (e) => t.forEach((n) => se(n, e));
|
|
59
|
+
}
|
|
60
|
+
var j = o.forwardRef((t, e) => {
|
|
61
|
+
const { children: n, ...r } = t, s = o.Children.toArray(n), i = s.find(ae);
|
|
62
|
+
if (i) {
|
|
63
|
+
const l = i.props.children, a = s.map((u) => u === i ? o.Children.count(l) > 1 ? o.Children.only(null) : o.isValidElement(l) ? l.props.children : null : u);
|
|
64
|
+
return /* @__PURE__ */ d(x, { ...r, ref: e, children: o.isValidElement(l) ? o.cloneElement(l, void 0, a) : null });
|
|
65
|
+
}
|
|
66
|
+
return /* @__PURE__ */ d(x, { ...r, ref: e, children: n });
|
|
67
|
+
});
|
|
68
|
+
j.displayName = "Slot";
|
|
69
|
+
var x = o.forwardRef((t, e) => {
|
|
70
|
+
const { children: n, ...r } = t;
|
|
71
|
+
if (o.isValidElement(n)) {
|
|
72
|
+
const s = le(n);
|
|
73
|
+
return o.cloneElement(n, {
|
|
74
|
+
...ce(r, n.props),
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
ref: e ? oe(e, s) : s
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return o.Children.count(n) > 1 ? o.Children.only(null) : null;
|
|
80
|
+
});
|
|
81
|
+
x.displayName = "SlotClone";
|
|
82
|
+
var ie = ({ children: t }) => /* @__PURE__ */ d(I, { children: t });
|
|
83
|
+
function ae(t) {
|
|
84
|
+
return o.isValidElement(t) && t.type === ie;
|
|
85
|
+
}
|
|
86
|
+
function ce(t, e) {
|
|
87
|
+
const n = { ...e };
|
|
88
|
+
for (const r in e) {
|
|
89
|
+
const s = t[r], i = e[r];
|
|
90
|
+
/^on[A-Z]/.test(r) ? s && i ? n[r] = (...a) => {
|
|
91
|
+
i(...a), s(...a);
|
|
92
|
+
} : s && (n[r] = s) : r === "style" ? n[r] = { ...s, ...i } : r === "className" && (n[r] = [s, i].filter(Boolean).join(" "));
|
|
93
|
+
}
|
|
94
|
+
return { ...t, ...n };
|
|
95
|
+
}
|
|
96
|
+
function le(t) {
|
|
97
|
+
var r, s;
|
|
98
|
+
let e = (r = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : r.get, n = e && "isReactWarning" in e && e.isReactWarning;
|
|
99
|
+
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);
|
|
100
|
+
}
|
|
101
|
+
var ue = [
|
|
102
|
+
"a",
|
|
103
|
+
"button",
|
|
104
|
+
"div",
|
|
105
|
+
"form",
|
|
106
|
+
"h2",
|
|
107
|
+
"h3",
|
|
108
|
+
"img",
|
|
109
|
+
"input",
|
|
110
|
+
"label",
|
|
111
|
+
"li",
|
|
112
|
+
"nav",
|
|
113
|
+
"ol",
|
|
114
|
+
"p",
|
|
115
|
+
"span",
|
|
116
|
+
"svg",
|
|
117
|
+
"ul"
|
|
118
|
+
], _ = ue.reduce((t, e) => {
|
|
119
|
+
const n = o.forwardRef((r, s) => {
|
|
120
|
+
const { asChild: i, ...l } = r, a = i ? j : e;
|
|
121
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ d(a, { ...l, ref: s });
|
|
122
|
+
});
|
|
123
|
+
return n.displayName = `Primitive.${e}`, { ...t, [e]: n };
|
|
124
|
+
}, {});
|
|
125
|
+
function de(t, e) {
|
|
126
|
+
t && te.flushSync(() => t.dispatchEvent(e));
|
|
127
|
+
}
|
|
128
|
+
function fe(t, e) {
|
|
129
|
+
typeof t == "function" ? t(e) : t != null && (t.current = e);
|
|
130
|
+
}
|
|
131
|
+
function pe(...t) {
|
|
132
|
+
return (e) => t.forEach((n) => fe(n, e));
|
|
133
|
+
}
|
|
134
|
+
function $(...t) {
|
|
135
|
+
return o.useCallback(pe(...t), t);
|
|
136
|
+
}
|
|
137
|
+
function T(t) {
|
|
138
|
+
const e = o.useRef(t);
|
|
139
|
+
return o.useEffect(() => {
|
|
140
|
+
e.current = t;
|
|
141
|
+
}), o.useMemo(() => (...n) => {
|
|
142
|
+
var r;
|
|
143
|
+
return (r = e.current) == null ? void 0 : r.call(e, ...n);
|
|
144
|
+
}, []);
|
|
145
|
+
}
|
|
146
|
+
function ye(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
147
|
+
const n = T(t);
|
|
148
|
+
o.useEffect(() => {
|
|
149
|
+
const r = (s) => {
|
|
150
|
+
s.key === "Escape" && n(s);
|
|
151
|
+
};
|
|
152
|
+
return e.addEventListener("keydown", r, { capture: !0 }), () => e.removeEventListener("keydown", r, { capture: !0 });
|
|
153
|
+
}, [n, e]);
|
|
154
|
+
}
|
|
155
|
+
var he = "DismissableLayer", S = "dismissableLayer.update", me = "dismissableLayer.pointerDownOutside", ve = "dismissableLayer.focusOutside", A, U = o.createContext({
|
|
156
|
+
layers: /* @__PURE__ */ new Set(),
|
|
157
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
158
|
+
branches: /* @__PURE__ */ new Set()
|
|
159
|
+
}), z = o.forwardRef(
|
|
160
|
+
(t, e) => {
|
|
161
|
+
const {
|
|
162
|
+
disableOutsidePointerEvents: n = !1,
|
|
163
|
+
onEscapeKeyDown: r,
|
|
164
|
+
onPointerDownOutside: s,
|
|
165
|
+
onFocusOutside: i,
|
|
166
|
+
onInteractOutside: l,
|
|
167
|
+
onDismiss: a,
|
|
168
|
+
...u
|
|
169
|
+
} = t, c = o.useContext(U), [p, m] = o.useState(null), y = (p == null ? void 0 : p.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, b] = o.useState({}), h = $(e, (f) => m(f)), P = Array.from(c.layers), [C] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), X = P.indexOf(C), W = p ? P.indexOf(p) : -1, H = c.layersWithOutsidePointerEventsDisabled.size > 0, B = W >= X, Y = be((f) => {
|
|
170
|
+
const L = f.target, k = [...c.branches].some((w) => w.contains(L));
|
|
171
|
+
!B || k || (s == null || s(f), l == null || l(f), f.defaultPrevented || a == null || a());
|
|
172
|
+
}, y), N = Ce((f) => {
|
|
173
|
+
const L = f.target;
|
|
174
|
+
[...c.branches].some((w) => w.contains(L)) || (i == null || i(f), l == null || l(f), f.defaultPrevented || a == null || a());
|
|
175
|
+
}, y);
|
|
176
|
+
return ye((f) => {
|
|
177
|
+
W === c.layers.size - 1 && (r == null || r(f), !f.defaultPrevented && a && (f.preventDefault(), a()));
|
|
178
|
+
}, y), o.useEffect(() => {
|
|
179
|
+
if (p)
|
|
180
|
+
return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (A = y.body.style.pointerEvents, y.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(p)), c.layers.add(p), F(), () => {
|
|
181
|
+
n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (y.body.style.pointerEvents = A);
|
|
182
|
+
};
|
|
183
|
+
}, [p, y, n, c]), o.useEffect(() => () => {
|
|
184
|
+
p && (c.layers.delete(p), c.layersWithOutsidePointerEventsDisabled.delete(p), F());
|
|
185
|
+
}, [p, c]), o.useEffect(() => {
|
|
186
|
+
const f = () => b({});
|
|
187
|
+
return document.addEventListener(S, f), () => document.removeEventListener(S, f);
|
|
188
|
+
}, []), /* @__PURE__ */ d(
|
|
189
|
+
_.div,
|
|
190
|
+
{
|
|
191
|
+
...u,
|
|
192
|
+
ref: h,
|
|
193
|
+
style: {
|
|
194
|
+
pointerEvents: H ? B ? "auto" : "none" : void 0,
|
|
195
|
+
...t.style
|
|
196
|
+
},
|
|
197
|
+
onFocusCapture: R(t.onFocusCapture, N.onFocusCapture),
|
|
198
|
+
onBlurCapture: R(t.onBlurCapture, N.onBlurCapture),
|
|
199
|
+
onPointerDownCapture: R(
|
|
200
|
+
t.onPointerDownCapture,
|
|
201
|
+
Y.onPointerDownCapture
|
|
79
202
|
)
|
|
80
|
-
|
|
81
|
-
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
z.displayName = he;
|
|
208
|
+
var Ee = "DismissableLayerBranch", ge = o.forwardRef((t, e) => {
|
|
209
|
+
const n = o.useContext(U), r = o.useRef(null), s = $(e, r);
|
|
210
|
+
return o.useEffect(() => {
|
|
211
|
+
const i = r.current;
|
|
212
|
+
if (i)
|
|
213
|
+
return n.branches.add(i), () => {
|
|
214
|
+
n.branches.delete(i);
|
|
215
|
+
};
|
|
216
|
+
}, [n.branches]), /* @__PURE__ */ d(_.div, { ...t, ref: s });
|
|
217
|
+
});
|
|
218
|
+
ge.displayName = Ee;
|
|
219
|
+
function be(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
220
|
+
const n = T(t), r = o.useRef(!1), s = o.useRef(() => {
|
|
221
|
+
});
|
|
222
|
+
return o.useEffect(() => {
|
|
223
|
+
const i = (a) => {
|
|
224
|
+
if (a.target && !r.current) {
|
|
225
|
+
let u = function() {
|
|
226
|
+
V(
|
|
227
|
+
me,
|
|
228
|
+
n,
|
|
229
|
+
c,
|
|
230
|
+
{ discrete: !0 }
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
const c = { originalEvent: a };
|
|
234
|
+
a.pointerType === "touch" ? (e.removeEventListener("click", s.current), s.current = u, e.addEventListener("click", s.current, { once: !0 })) : u();
|
|
235
|
+
} else
|
|
236
|
+
e.removeEventListener("click", s.current);
|
|
237
|
+
r.current = !1;
|
|
238
|
+
}, l = window.setTimeout(() => {
|
|
239
|
+
e.addEventListener("pointerdown", i);
|
|
240
|
+
}, 0);
|
|
241
|
+
return () => {
|
|
242
|
+
window.clearTimeout(l), e.removeEventListener("pointerdown", i), e.removeEventListener("click", s.current);
|
|
243
|
+
};
|
|
244
|
+
}, [e, n]), {
|
|
245
|
+
// ensures we check React component tree (not just DOM tree)
|
|
246
|
+
onPointerDownCapture: () => r.current = !0
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
function Ce(t, e = globalThis == null ? void 0 : globalThis.document) {
|
|
250
|
+
const n = T(t), r = o.useRef(!1);
|
|
251
|
+
return o.useEffect(() => {
|
|
252
|
+
const s = (i) => {
|
|
253
|
+
i.target && !r.current && V(ve, n, { originalEvent: i }, {
|
|
254
|
+
discrete: !1
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
return e.addEventListener("focusin", s), () => e.removeEventListener("focusin", s);
|
|
258
|
+
}, [e, n]), {
|
|
259
|
+
onFocusCapture: () => r.current = !0,
|
|
260
|
+
onBlurCapture: () => r.current = !1
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function F() {
|
|
264
|
+
const t = new CustomEvent(S);
|
|
265
|
+
document.dispatchEvent(t);
|
|
266
|
+
}
|
|
267
|
+
function V(t, e, n, { discrete: r }) {
|
|
268
|
+
const s = n.originalEvent.target, i = new CustomEvent(t, { bubbles: !1, cancelable: !0, detail: n });
|
|
269
|
+
e && s.addEventListener(t, e, { once: !0 }), r ? de(s, i) : s.dispatchEvent(i);
|
|
270
|
+
}
|
|
271
|
+
const Le = ({
|
|
272
|
+
id: t,
|
|
273
|
+
layers: e,
|
|
274
|
+
children: n,
|
|
275
|
+
...r
|
|
276
|
+
}) => t === e[e.length - 1] ? /* @__PURE__ */ d(z, { ...r, children: n }) : /* @__PURE__ */ d(I, { children: n }), K = E.createContext({
|
|
277
|
+
layers: [],
|
|
278
|
+
setLayers: () => {
|
|
279
|
+
},
|
|
280
|
+
addLayer: () => {
|
|
281
|
+
},
|
|
282
|
+
removeLayer: () => {
|
|
283
|
+
},
|
|
284
|
+
removeTopLayer: () => {
|
|
82
285
|
}
|
|
83
|
-
),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
286
|
+
}), _e = ({ children: t }) => {
|
|
287
|
+
const [e, n] = E.useState([]), r = (l, a = {}) => {
|
|
288
|
+
const { layer: u } = a;
|
|
289
|
+
if (typeof u == "number")
|
|
290
|
+
return n((c) => c.length - 1 < u ? [...c, l] : [...c.slice(0, u), l, ...c.slice(u)]);
|
|
291
|
+
n((c) => [...c, l]);
|
|
292
|
+
}, s = (l) => {
|
|
293
|
+
n(e.filter((a) => a !== l));
|
|
294
|
+
}, i = () => {
|
|
295
|
+
const l = e[e.length - 1];
|
|
296
|
+
l && s(l);
|
|
297
|
+
};
|
|
298
|
+
return /* @__PURE__ */ d(
|
|
299
|
+
K.Provider,
|
|
300
|
+
{
|
|
301
|
+
value: { layers: e, setLayers: n, addLayer: r, removeLayer: s, removeTopLayer: i },
|
|
302
|
+
children: t
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
}, Pe = () => E.useContext(K), we = ({
|
|
306
|
+
defaultOpen: t,
|
|
307
|
+
open: e,
|
|
308
|
+
onOpenChange: n,
|
|
88
309
|
...r
|
|
89
|
-
}) =>
|
|
90
|
-
|
|
310
|
+
}) => {
|
|
311
|
+
const [s, i] = ne({
|
|
312
|
+
prop: e,
|
|
313
|
+
onChange: n,
|
|
314
|
+
defaultProp: t
|
|
315
|
+
});
|
|
316
|
+
if (s)
|
|
317
|
+
return /* @__PURE__ */ d(Re, { open: s, onOpenChange: i, ...r });
|
|
318
|
+
}, Re = ({
|
|
319
|
+
open: t,
|
|
320
|
+
onOpenChange: e,
|
|
321
|
+
a11yTitle: n,
|
|
322
|
+
a11yDescription: r,
|
|
323
|
+
children: s,
|
|
324
|
+
layer: i,
|
|
325
|
+
...l
|
|
326
|
+
}) => {
|
|
327
|
+
var y, b;
|
|
328
|
+
const a = E.useId(), u = Pe();
|
|
329
|
+
E.useEffect(() => {
|
|
330
|
+
!u || !t || u.layers.includes(a) || u.addLayer(a, { layer: i });
|
|
331
|
+
}, [a, i, u, t]);
|
|
332
|
+
const c = ((y = u.layers) == null ? void 0 : y.indexOf(a)) || 0, p = ((b = u.layers) == null ? void 0 : b.length) || 0, m = c !== 0;
|
|
333
|
+
return /* @__PURE__ */ d(
|
|
334
|
+
Le,
|
|
335
|
+
{
|
|
336
|
+
id: a,
|
|
337
|
+
layers: u.layers,
|
|
338
|
+
onEscapeKeyDown: (h) => {
|
|
339
|
+
h.preventDefault(), u.removeTopLayer(), e(!1);
|
|
340
|
+
},
|
|
341
|
+
onPointerDownOutside: (h) => {
|
|
342
|
+
h.preventDefault(), u.removeTopLayer(), e(!1);
|
|
343
|
+
},
|
|
344
|
+
children: /* @__PURE__ */ D(
|
|
345
|
+
v.Root,
|
|
346
|
+
{
|
|
347
|
+
open: t,
|
|
348
|
+
onOpenChange: (h) => {
|
|
349
|
+
var C;
|
|
350
|
+
if (((C = u == null ? void 0 : u.layers) == null ? void 0 : C.length) > 0)
|
|
351
|
+
return h === !1 && a === u.layers[u.layers.length - 1] ? (u.removeLayer(a), e(!1)) : void 0;
|
|
352
|
+
e(h);
|
|
353
|
+
},
|
|
354
|
+
children: [
|
|
355
|
+
/* @__PURE__ */ D(q.Root, { children: [
|
|
356
|
+
/* @__PURE__ */ d(v.Title, { children: n }),
|
|
357
|
+
r && /* @__PURE__ */ d(v.Description, { children: r })
|
|
358
|
+
] }),
|
|
359
|
+
/* @__PURE__ */ d(ee, { children: t && /* @__PURE__ */ d(De, { layer: c, children: /* @__PURE__ */ d(
|
|
360
|
+
g,
|
|
361
|
+
{
|
|
362
|
+
as: O.div,
|
|
363
|
+
initial: {
|
|
364
|
+
top: `calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${p - 1})`
|
|
365
|
+
},
|
|
366
|
+
animate: {
|
|
367
|
+
top: m ? `calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${c} )` : "var(--tgph-spacing-16)"
|
|
368
|
+
},
|
|
369
|
+
exit: { top: 0 },
|
|
370
|
+
transition: { type: "spring", duration: 0.3, bounce: 0 },
|
|
371
|
+
w: "full",
|
|
372
|
+
justify: "center",
|
|
373
|
+
style: {
|
|
374
|
+
position: "fixed",
|
|
375
|
+
left: 0,
|
|
376
|
+
maxHeight: "calc(100vh - var(--tgph-spacing-32))",
|
|
377
|
+
maxWidth: "calc(100vw - var(--tgph-spacing-8))",
|
|
378
|
+
zIndex: `calc(var(--tgph-zIndex-modal) + ${c})`
|
|
379
|
+
},
|
|
380
|
+
children: /* @__PURE__ */ d(
|
|
381
|
+
g,
|
|
382
|
+
{
|
|
383
|
+
direction: "column",
|
|
384
|
+
as: O.div,
|
|
385
|
+
animate: {
|
|
386
|
+
scale: 1.02 - Math.abs(p - c) * 0.02,
|
|
387
|
+
transformOrigin: "center center"
|
|
388
|
+
},
|
|
389
|
+
transition: { duration: 0.2, bounce: 0, type: "spring" },
|
|
390
|
+
maxW: l.maxW ?? "160",
|
|
391
|
+
w: l.w ?? "full",
|
|
392
|
+
bg: "surface-1",
|
|
393
|
+
border: "px",
|
|
394
|
+
rounded: "4",
|
|
395
|
+
shadow: "3",
|
|
396
|
+
...l,
|
|
397
|
+
children: s
|
|
398
|
+
},
|
|
399
|
+
`content-${a}`
|
|
400
|
+
)
|
|
401
|
+
},
|
|
402
|
+
`container-${a}`
|
|
403
|
+
) }) })
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
a
|
|
407
|
+
)
|
|
408
|
+
}
|
|
409
|
+
);
|
|
410
|
+
}, De = ({ layer: t, children: e }) => t > 0 ? e : /* @__PURE__ */ D(v.Overlay, { children: [
|
|
411
|
+
/* @__PURE__ */ d(
|
|
412
|
+
Q,
|
|
413
|
+
{
|
|
414
|
+
as: O.div,
|
|
415
|
+
initial: { opacity: 0 },
|
|
416
|
+
animate: { opacity: 1 },
|
|
417
|
+
exit: { opacity: 0 },
|
|
418
|
+
transition: { duration: 0.3, bounce: 0, type: "spring" },
|
|
419
|
+
bg: "alpha-black-6",
|
|
420
|
+
w: "full",
|
|
421
|
+
h: "full",
|
|
422
|
+
zIndex: "overlay",
|
|
423
|
+
style: {
|
|
424
|
+
position: "fixed",
|
|
425
|
+
cursor: "pointer",
|
|
426
|
+
inset: "0px"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
),
|
|
430
|
+
e
|
|
431
|
+
] }), Oe = E.forwardRef(
|
|
432
|
+
({ children: t, ...e }, n) => /* @__PURE__ */ d(Z, { trapped: !0, children: /* @__PURE__ */ d(v.Content, { ref: n, asChild: !0, ...e, children: /* @__PURE__ */ d(g, { direction: "column", h: "full", ...e, children: t }) }) })
|
|
433
|
+
), xe = ({
|
|
434
|
+
size: t = "1",
|
|
435
|
+
variant: e = "ghost",
|
|
436
|
+
...n
|
|
437
|
+
}) => /* @__PURE__ */ d(v.Close, { asChild: !0, children: /* @__PURE__ */ d(
|
|
438
|
+
G,
|
|
91
439
|
{
|
|
92
|
-
icon: { icon:
|
|
93
|
-
variant:
|
|
94
|
-
size:
|
|
95
|
-
...
|
|
440
|
+
icon: { icon: J.X, alt: "Close Modal" },
|
|
441
|
+
variant: e,
|
|
442
|
+
size: t,
|
|
443
|
+
...n
|
|
96
444
|
}
|
|
97
|
-
) }),
|
|
98
|
-
children:
|
|
99
|
-
...
|
|
100
|
-
}) => /* @__PURE__ */
|
|
101
|
-
|
|
445
|
+
) }), Se = ({ children: t, ...e }) => /* @__PURE__ */ d(g, { direction: "column", px: "6", py: "4", ...e, children: t }), Te = ({
|
|
446
|
+
children: t,
|
|
447
|
+
...e
|
|
448
|
+
}) => /* @__PURE__ */ d(
|
|
449
|
+
g,
|
|
102
450
|
{
|
|
103
451
|
direction: "row",
|
|
104
452
|
justify: "space-between",
|
|
@@ -106,14 +454,14 @@ const b = ({
|
|
|
106
454
|
px: "6",
|
|
107
455
|
py: "4",
|
|
108
456
|
borderBottom: "px",
|
|
109
|
-
...
|
|
110
|
-
children:
|
|
457
|
+
...e,
|
|
458
|
+
children: t
|
|
111
459
|
}
|
|
112
|
-
),
|
|
113
|
-
children:
|
|
114
|
-
...
|
|
115
|
-
}) => /* @__PURE__ */
|
|
116
|
-
|
|
460
|
+
), We = ({
|
|
461
|
+
children: t,
|
|
462
|
+
...e
|
|
463
|
+
}) => /* @__PURE__ */ d(
|
|
464
|
+
g,
|
|
117
465
|
{
|
|
118
466
|
direction: "row",
|
|
119
467
|
align: "center",
|
|
@@ -122,19 +470,20 @@ const b = ({
|
|
|
122
470
|
px: "6",
|
|
123
471
|
py: "4",
|
|
124
472
|
borderTop: "px",
|
|
125
|
-
...
|
|
126
|
-
children:
|
|
473
|
+
...e,
|
|
474
|
+
children: t
|
|
127
475
|
}
|
|
128
|
-
),
|
|
129
|
-
Object.assign(
|
|
130
|
-
Root:
|
|
131
|
-
Content:
|
|
132
|
-
Close:
|
|
133
|
-
Body:
|
|
134
|
-
Header:
|
|
135
|
-
Footer:
|
|
476
|
+
), Be = {};
|
|
477
|
+
Object.assign(Be, {
|
|
478
|
+
Root: we,
|
|
479
|
+
Content: Oe,
|
|
480
|
+
Close: xe,
|
|
481
|
+
Body: Se,
|
|
482
|
+
Header: Te,
|
|
483
|
+
Footer: We
|
|
136
484
|
});
|
|
137
485
|
export {
|
|
138
|
-
|
|
486
|
+
Be as Modal,
|
|
487
|
+
_e as ModalStackingProvider
|
|
139
488
|
};
|
|
140
489
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/Modal/Modal.tsx"],"sourcesContent":["import * as Dialog from \"@radix-ui/react-dialog\";\nimport * as VisuallyHidden from \"@radix-ui/react-visually-hidden\";\nimport { Button } from \"@telegraph/button\";\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\ntype RootProps = Omit<\n React.ComponentPropsWithoutRef<typeof Dialog.Root>,\n \"modal\"\n> &\n TgphComponentProps<typeof Stack> & {\n a11yTitle: string;\n a11yDescription?: string;\n };\n\nconst Root = ({\n defaultOpen,\n open,\n onOpenChange,\n a11yTitle,\n a11yDescription,\n children,\n ...props\n}: RootProps) => {\n return (\n <Dialog.Root\n open={open}\n onOpenChange={onOpenChange}\n defaultOpen={defaultOpen}\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 <>\n <Dialog.Overlay>\n <Box\n as={motion.div}\n onClick={() => onOpenChange?.(false)}\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 zIndex=\"overlay\"\n style={{\n position: \"fixed\",\n inset: \"0px\",\n }}\n />\n <Stack\n zIndex=\"modal\"\n w=\"full\"\n style={{\n position: \"fixed\",\n top: 0,\n left: \"50%\",\n maxHeight: \"calc(100vh - var(--tgph-spacing-32))\",\n maxWidth: \"calc(100vw - var(--tgph-spacing-8))\",\n }}\n >\n <Stack\n direction=\"column\"\n as={motion.div}\n my=\"16\"\n initial={{ scale: 0.8, opacity: 0, y: -20, x: \"-50%\" }}\n animate={{ scale: 1, opacity: 1, y: 0, x: \"-50%\" }}\n exit={{ scale: 0.8, opacity: 0, y: -20, x: \"-50%\" }}\n transition={{ duration: 0.2, bounce: 0, type: \"spring\" }}\n maxW={props.maxW ?? \"160\"}\n w={props.w ?? \"full\"}\n bg=\"surface-1\"\n border=\"px\"\n rounded=\"4\"\n shadow=\"1\"\n {...props}\n >\n {children}\n </Stack>\n </Stack>\n </Dialog.Overlay>\n </>\n )}\n </AnimatePresence>\n </Dialog.Root>\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} {...props} asChild>\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>({ children, ...props }: BodyProps<T>) => {\n return (\n <Stack direction=\"column\" px=\"6\" py=\"4\" {...props}>\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":["Root","defaultOpen","open","onOpenChange","a11yTitle","a11yDescription","children","props","jsxs","Dialog","VisuallyHidden","jsx","AnimatePresence","Box","motion","Stack","Content","React","forwardedRef","Close","size","variant","Button","Lucide","Body","Header","Footer","Modal"],"mappings":";;;;;;;;AAsBA,MAAMA,IAAO,CAAC;AAAA,EACZ,aAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAC;AAAA,EAACC,EAAO;AAAA,EAAP;AAAA,IACC,MAAAP;AAAA,IACA,cAAAC;AAAA,IACA,aAAAF;AAAA,IAEA,UAAA;AAAA,MAAC,gBAAAO,EAAAE,EAAe,MAAf,EACC,UAAA;AAAA,QA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UAAAD;AAAA,EAAA;AAAA,GAQDoB,IAAS,CAAwB;AAAA,EACrC,UAAApB;AAAA,EACA,GAAGC;AACL,MAEI,gBAAAI;AAAA,EAACI;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,GAAGR;AAAA,IAEH,UAAAD;AAAA,EAAA;AAAA,GAKDqB,IAAQ,CAAC;AASf,OAAO,OAAOA,GAAO;AAAA,EACnB,MAAA3B;AAAA,EACA,SAAAgB;AAAA,EACA,OAAAG;AAAA,EACA,MAAAK;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../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","../../../../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","../../src/Modal/Modal.helpers.tsx","../../src/Modal/ModalStacking.tsx","../../src/Modal/Modal.tsx"],"sourcesContent":["// 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","// 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","import {\n DismissableLayer,\n type DismissableLayerProps,\n} from \"@radix-ui/react-dismissable-layer\";\n\ntype DismissableWrapperProps = DismissableLayerProps & {\n id: string;\n layers: Array<string>;\n children: React.ReactNode;\n};\n\n//\n// Handles the logic for when a global action like \"esc\" or clicking outside\n// should close the modal. When stacking modals, we don't want to close the\n// modal if we are not on the top-most layer.\n//\nconst DismissableWrapper = ({\n id,\n layers,\n children,\n ...props\n}: DismissableWrapperProps) => {\n const isTopLayer = id === layers[layers.length - 1];\n\n if (isTopLayer) {\n return <DismissableLayer {...props}>{children}</DismissableLayer>;\n }\n\n return <>{children}</>;\n};\n\nexport { DismissableWrapper };\n","import React from \"react\";\n\ntype AddLayerOptions = {\n layer?: number;\n};\n\nconst ModalStackingContext = React.createContext<{\n layers: Array<string>;\n setLayers: React.Dispatch<React.SetStateAction<Array<string>>>;\n addLayer: (id: string, options: AddLayerOptions) => 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, options: AddLayerOptions = {}) => {\n const { layer } = options;\n\n // If a layer is specified, insert the layer at the specified index\n // so that the modal renders at the correct layer in the stack.\n if (typeof layer === \"number\") {\n return setLayers((current) => {\n if (current.length - 1 < layer) {\n return [...current, id];\n }\n\n return [...current.slice(0, layer), id, ...current.slice(layer)];\n });\n } else {\n setLayers((current) => [...current, id]);\n }\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 { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as VisuallyHidden from \"@radix-ui/react-visually-hidden\";\nimport { Button } from \"@telegraph/button\";\nimport type { Required } 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 { DismissableWrapper } from \"./Modal.helpers\";\nimport { useModalStacking } from \"./ModalStacking\";\n\ntype RootProps = Omit<\n React.ComponentPropsWithoutRef<typeof Dialog.Root>,\n \"modal\"\n> &\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 // 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\nconst RootComponent = ({\n open,\n onOpenChange,\n a11yTitle,\n a11yDescription,\n children,\n layer: layerProp,\n ...props\n}: Required<RootProps, \"open\" | \"onOpenChange\">) => {\n const id = React.useId();\n const stacking = useModalStacking();\n\n React.useEffect(() => {\n if (!stacking || !open || stacking.layers.includes(id)) return;\n stacking.addLayer(id, { layer: layerProp });\n }, [id, layerProp, stacking, open]);\n\n const layer = stacking.layers?.indexOf(id) || 0;\n const layersLength = stacking.layers?.length || 0;\n const isStacked = layer !== 0;\n\n return (\n <DismissableWrapper\n id={id}\n layers={stacking.layers}\n onEscapeKeyDown={(event) => {\n event.preventDefault();\n stacking.removeTopLayer();\n onOpenChange(false);\n }}\n onPointerDownOutside={(event) => {\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 <Overlay layer={layer}>\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={{ duration: 0.2, bounce: 0, type: \"spring\" }}\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 </Overlay>\n )}\n </AnimatePresence>\n </Dialog.Root>\n </DismissableWrapper>\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 <FocusScope trapped={true}>\n <Dialog.Content ref={forwardedRef} asChild {...props}>\n <Stack direction=\"column\" h=\"full\" {...props}>\n {children}\n </Stack>\n </Dialog.Content>\n </FocusScope>\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>({ children, ...props }: BodyProps<T>) => {\n return (\n <Stack direction=\"column\" px=\"6\" py=\"4\" {...props}>\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":["useCallbackRef","callback","callbackRef","React","args","_a","useControllableState","prop","defaultProp","onChange","uncontrolledProp","setUncontrolledProp","useUncontrolledState","isControlled","value","handleChange","setValue","nextValue","value2","uncontrolledState","prevValueRef","composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","setRef","ref","composeRefs","refs","node","Slot","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","SlotClone","childrenRef","getElementRef","mergeProps","Slottable","Fragment","childProps","overrideProps","propName","slotPropValue","childPropValue","element","getter","mayWarn","_b","NODES","Primitive","primitive","Node","asChild","primitiveProps","Comp","dispatchDiscreteCustomEvent","target","ReactDOM","useComposedRefs","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","DismissableWrapper","id","ModalStackingContext","ModalStackingProvider","setLayers","addLayer","options","layer","current","removeLayer","removeTopLayer","useModalStacking","Root","defaultOpenProp","openProp","onOpenChangeProp","open","onOpenChange","RootComponent","a11yTitle","a11yDescription","layerProp","stacking","layersLength","isStacked","jsxs","Dialog","VisuallyHidden","AnimatePresence","Overlay","Stack","motion","Box","Content","FocusScope","Close","size","variant","Button","Lucide","Body","Header","Footer","Modal"],"mappings":";;;;;;;;;;;AAEA,SAASA,EAAeC,GAAU;AAChC,QAAMC,IAAcC,EAAM,OAAOF,CAAQ;AACzC,SAAAE,EAAM,UAAU,MAAM;AACpB,IAAAD,EAAY,UAAUD;AAAA,EAC1B,CAAG,GACME,EAAM,QAAQ,MAAM,IAAIC,MAAI;;AAAK,YAAAC,IAAAH,EAAY,YAAZ,gBAAAG,EAAA,KAAAH,GAAsB,GAAGE;AAAA,KAAO,CAAA,CAAE;AAC5E;ACLA,SAASE,GAAqB;AAAA,EAC5B,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC,IAAW,MAAM;AAAA,EAChB;AACH,GAAG;AACD,QAAM,CAACC,GAAkBC,CAAmB,IAAIC,GAAqB,EAAE,aAAAJ,GAAa,UAAAC,EAAQ,CAAE,GACxFI,IAAeN,MAAS,QACxBO,IAAQD,IAAeN,IAAOG,GAC9BK,IAAef,EAAeS,CAAQ,GACtCO,IAAWb,EAAM;AAAA,IACrB,CAACc,MAAc;AACb,UAAIJ,GAAc;AAEhB,cAAMK,IAAS,OAAOD,KAAc,aADrBA,EACyCV,CAAI,IAAIU;AAChE,QAAIC,MAAWX,KAAMQ,EAAaG,CAAM;AAAA,MAChD;AACQ,QAAAP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-dialog";
|
|
|
6
6
|
type RootProps = Omit<React.ComponentPropsWithoutRef<typeof Dialog.Root>, "modal"> & TgphComponentProps<typeof Stack> & {
|
|
7
7
|
a11yTitle: string;
|
|
8
8
|
a11yDescription?: string;
|
|
9
|
+
layer?: number;
|
|
9
10
|
};
|
|
10
|
-
declare const Root: ({ defaultOpen, open, onOpenChange
|
|
11
|
+
declare const Root: ({ defaultOpen: defaultOpenProp, open: openProp, onOpenChange: onOpenChangeProp, ...props }: RootProps) => import("react/jsx-runtime").JSX.Element | undefined;
|
|
11
12
|
type ContentProps = React.ComponentPropsWithoutRef<typeof Dialog.Content> & TgphComponentProps<typeof Stack>;
|
|
12
13
|
declare const Content: React.ForwardRefExoticComponent<Omit<ContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
14
|
type CloseProps<T extends TgphElement> = TgphComponentProps<typeof Button<T>> & Omit<React.ComponentPropsWithoutRef<typeof Dialog.Close>, "color">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AAIjD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAO,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,KAAK,SAAS,GAAG,IAAI,CACnB,KAAK,CAAC,wBAAwB,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,EAClD,OAAO,CACR,GACC,kBAAkB,CAAC,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AAC,SAAS,WAAW,0BAGlC,WAAW,CAAC,CAAC,CAAC,4CAehB,CAAC;AAEF,QAAA,MAAM,KAAK,EAAS;IAClB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,MAAM,CAAC;CACvB,CAAC;AAWF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DismissableLayerProps } from '@radix-ui/react-dismissable-layer';
|
|
2
|
+
|
|
3
|
+
type DismissableWrapperProps = DismissableLayerProps & {
|
|
4
|
+
id: string;
|
|
5
|
+
layers: Array<string>;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
declare const DismissableWrapper: ({ id, layers, children, ...props }: DismissableWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { DismissableWrapper };
|
|
10
|
+
//# sourceMappingURL=Modal.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.helpers.d.ts","sourceRoot":"","sources":["../../../src/Modal/Modal.helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,mCAAmC,CAAC;AAE3C,KAAK,uBAAuB,GAAG,qBAAqB,GAAG;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAOF,QAAA,MAAM,kBAAkB,uCAKrB,uBAAuB,4CAQzB,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
type AddLayerOptions = {
|
|
4
|
+
layer?: number;
|
|
5
|
+
};
|
|
6
|
+
type ModalStackingProviderProps = {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
declare const ModalStackingProvider: ({ children }: ModalStackingProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const useModalStacking: () => {
|
|
11
|
+
layers: Array<string>;
|
|
12
|
+
setLayers: React.Dispatch<React.SetStateAction<Array<string>>>;
|
|
13
|
+
addLayer: (id: string, options: AddLayerOptions) => void;
|
|
14
|
+
removeLayer: (id: string) => void;
|
|
15
|
+
removeTopLayer: () => void;
|
|
16
|
+
};
|
|
17
|
+
export { ModalStackingProvider, useModalStacking };
|
|
18
|
+
//# sourceMappingURL=ModalStacking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalStacking.d.ts","sourceRoot":"","sources":["../../../src/Modal/ModalStacking.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgBF,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,qBAAqB,iBAAkB,0BAA0B,4CAsCtE,CAAC;AAEF,QAAA,MAAM,gBAAgB;YAzDZ,KAAK,CAAC,MAAM,CAAC;eACV,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;cACpD,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,KAAK,IAAI;iBAC3C,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI;oBACjB,MAAM,IAAI;CAuD3B,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Modal } from './Modal';
|
|
1
|
+
export { Modal, ModalStackingProvider } from './Modal';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telegraph/modal",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.47",
|
|
4
4
|
"repository": "https://github.com/knocklabs/telegraph/tree/main/packages/modal",
|
|
5
5
|
"author": "@knocklabs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@radix-ui/react-dialog": "^1.1.1",
|
|
33
|
+
"@radix-ui/react-focus-scope": "^1.1.0",
|
|
33
34
|
"@radix-ui/react-visually-hidden": "^1.1.0",
|
|
34
35
|
"@telegraph/button": "^0.0.52",
|
|
35
36
|
"@telegraph/helpers": "^0.0.7",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"react": "^18.2.0",
|
|
50
51
|
"react-dom": "^18.3.1",
|
|
51
52
|
"typescript": "^5.5.4",
|
|
52
|
-
"vite": "^5.
|
|
53
|
+
"vite": "^5.4.7"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
56
|
"react": "^18.2.0",
|