@purpurds/modal 8.5.0 → 8.5.2

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/dist/LICENSE.txt CHANGED
@@ -627,35 +627,35 @@ SOFTWARE.
627
627
  ---
628
628
 
629
629
  Name: @purpurds/button
630
- Version: 8.4.0
630
+ Version: 8.5.1
631
631
  License: AGPL-3.0-only
632
632
  Private: false
633
633
 
634
634
  ---
635
635
 
636
636
  Name: @purpurds/heading
637
- Version: 8.4.0
637
+ Version: 8.5.1
638
638
  License: AGPL-3.0-only
639
639
  Private: false
640
640
 
641
641
  ---
642
642
 
643
643
  Name: @purpurds/icon
644
- Version: 8.4.0
644
+ Version: 8.5.1
645
645
  License: AGPL-3.0-only
646
646
  Private: false
647
647
 
648
648
  ---
649
649
 
650
650
  Name: @purpurds/paragraph
651
- Version: 8.4.0
651
+ Version: 8.5.1
652
652
  License: AGPL-3.0-only
653
653
  Private: false
654
654
 
655
655
  ---
656
656
 
657
657
  Name: @purpurds/visually-hidden
658
- Version: 8.4.0
658
+ Version: 8.5.1
659
659
  License: AGPL-3.0-only
660
660
  Private: false
661
661
 
package/dist/modal.cjs.js CHANGED
@@ -38,7 +38,7 @@
38
38
  `)},$e=function(){var e=parseInt(document.body.getAttribute(H)||"0",10);return isFinite(e)?e:0},Qr=function(){s.useEffect(function(){return document.body.setAttribute(H,($e()+1).toString()),function(){var e=$e()-1;e<=0?document.body.removeAttribute(H):document.body.setAttribute(H,e.toString())}},[])},Jr=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;Qr();var n=s.useMemo(function(){return Yr(a)},[a]);return s.createElement(Xr,{styles:Zr(n,!t,a,r?"":"!important")})},we=!1;if(typeof window<"u")try{var Q=Object.defineProperty({},"passive",{get:function(){return we=!0,!0}});window.addEventListener("test",Q,Q),window.removeEventListener("test",Q,Q)}catch{we=!1}var B=we?{passive:!1}:!1,en=function(e){return e.tagName==="TEXTAREA"},gt=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!en(e)&&r[t]==="visible")},tn=function(e){return gt(e,"overflowY")},rn=function(e){return gt(e,"overflowX")},Me=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=_t(e,o);if(a){var n=yt(e,o),u=n[1],i=n[2];if(u>i)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},nn=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},on=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},_t=function(e,t){return e==="v"?tn(t):rn(t)},yt=function(e,t){return e==="v"?nn(t):on(t)},an=function(e,t){return e==="h"&&t==="rtl"?-1:1},un=function(e,t,r,o,a){var n=an(e,window.getComputedStyle(t).direction),u=n*o,i=r.target,p=t.contains(i),c=!1,f=u>0,v=0,h=0;do{if(!i)break;var g=yt(e,i),b=g[0],l=g[1],m=g[2],_=l-m-n*b;(b||_)&&_t(e,i)&&(v+=_,h+=b);var w=i.parentNode;i=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!p&&i!==document.body||p&&(t.contains(i)||t===i));return(f&&Math.abs(v)<1||!f&&Math.abs(h)<1)&&(c=!0),c},J=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ie=function(e){return[e.deltaX,e.deltaY]},Le=function(e){return e&&"current"in e?e.current:e},sn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cn=function(e){return`
39
39
  .block-interactivity-`.concat(e,` {pointer-events: none;}
40
40
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
- `)},ln=0,U=[];function dn(e){var t=s.useRef([]),r=s.useRef([0,0]),o=s.useRef(),a=s.useState(ln++)[0],n=s.useState(mt)[0],u=s.useRef(e);s.useEffect(function(){u.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var l=Ar([e.lockRef.current],(e.shards||[]).map(Le),!0).filter(Boolean);return l.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),l.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=s.useCallback(function(l,m){if("touches"in l&&l.touches.length===2||l.type==="wheel"&&l.ctrlKey)return!u.current.allowPinchZoom;var _=J(l),w=r.current,E="deltaX"in l?l.deltaX:w[0]-_[0],x="deltaY"in l?l.deltaY:w[1]-_[1],S,N=l.target,y=Math.abs(E)>Math.abs(x)?"h":"v";if("touches"in l&&y==="h"&&N.type==="range")return!1;var j=Me(y,N);if(!j)return!0;if(j?S=y:(S=y==="v"?"h":"v",j=Me(y,N)),!j)return!1;if(!o.current&&"changedTouches"in l&&(E||x)&&(o.current=S),!S)return!0;var R=o.current||S;return un(R,m,l,R==="h"?E:x)},[]),p=s.useCallback(function(l){var m=l;if(!(!U.length||U[U.length-1]!==n)){var _="deltaY"in m?Ie(m):J(m),w=t.current.filter(function(S){return S.name===m.type&&(S.target===m.target||m.target===S.shadowParent)&&sn(S.delta,_)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}if(!w){var E=(u.current.shards||[]).map(Le).filter(Boolean).filter(function(S){return S.contains(m.target)}),x=E.length>0?i(m,E[0]):!u.current.noIsolation;x&&m.cancelable&&m.preventDefault()}}},[]),c=s.useCallback(function(l,m,_,w){var E={name:l,delta:m,target:_,should:w,shadowParent:pn(_)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(x){return x!==E})},1)},[]),f=s.useCallback(function(l){r.current=J(l),o.current=void 0},[]),v=s.useCallback(function(l){c(l.type,Ie(l),l.target,i(l,e.lockRef.current))},[]),h=s.useCallback(function(l){c(l.type,J(l),l.target,i(l,e.lockRef.current))},[]);s.useEffect(function(){return U.push(n),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:h}),document.addEventListener("wheel",p,B),document.addEventListener("touchmove",p,B),document.addEventListener("touchstart",f,B),function(){U=U.filter(function(l){return l!==n}),document.removeEventListener("wheel",p,B),document.removeEventListener("touchmove",p,B),document.removeEventListener("touchstart",f,B)}},[]);var g=e.removeScrollBar,b=e.inert;return s.createElement(s.Fragment,null,b?s.createElement(n,{styles:cn(a)}):null,g?s.createElement(Jr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fn=Wr(ht,dn);var bt=s.forwardRef(function(e,t){return s.createElement(se,T({},e,{ref:t,sideCar:fn}))});bt.classNames=se.classNames;var vn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},V=new WeakMap,ee=new WeakMap,te={},_e=0,wt=function(e){return e&&(e.host||wt(e.parentNode))},hn=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=wt(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},mn=function(e,t,r,o){var a=hn(t,Array.isArray(e)?e:[e]);te[r]||(te[r]=new WeakMap);var n=te[r],u=[],i=new Set,p=new Set(a),c=function(v){!v||i.has(v)||(i.add(v),c(v.parentNode))};a.forEach(c);var f=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(h){if(i.has(h))f(h);else try{var g=h.getAttribute(o),b=g!==null&&g!=="false",l=(V.get(h)||0)+1,m=(n.get(h)||0)+1;V.set(h,l),n.set(h,m),u.push(h),l===1&&b&&ee.set(h,!0),m===1&&h.setAttribute(r,"true"),b||h.setAttribute(o,"true")}catch(_){console.error("aria-hidden: cannot operate on ",h,_)}})};return f(t),i.clear(),_e++,function(){u.forEach(function(v){var h=V.get(v)-1,g=n.get(v)-1;V.set(v,h),n.set(v,g),h||(ee.has(v)||v.removeAttribute(o),ee.delete(v)),g||v.removeAttribute(r)}),_e--,_e||(V=new WeakMap,V=new WeakMap,ee=new WeakMap,te={})}},gn=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=vn(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live], script"))),mn(o,a,r,"aria-hidden")):function(){return null}},ce="Dialog",[Et]=Xt(ce),[_n,A]=Et(ce),xt=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:n,modal:u=!0}=e,i=s.useRef(null),p=s.useRef(null),[c,f]=tr({prop:o,defaultProp:a??!1,onChange:n,caller:ce});return d.jsx(_n,{scope:t,triggerRef:i,contentRef:p,contentId:de(),titleId:de(),descriptionId:de(),open:c,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(v=>!v),[f]),modal:u,children:r})};xt.displayName=ce;var St="DialogTrigger",Ct=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A(St,r),n=k(t,a.triggerRef);return d.jsx($.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Se(a.open),...o,ref:n,onClick:L(e.onClick,a.onOpenToggle)})});Ct.displayName=St;var Ee="DialogPortal",[yn,Nt]=Et(Ee,{forceMount:void 0}),Ot=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:a}=e,n=A(Ee,t);return d.jsx(yn,{scope:t,forceMount:r,children:s.Children.map(o,u=>d.jsx(ue,{present:r||n.open,children:d.jsx(pt,{asChild:!0,container:a,children:u})}))})};Ot.displayName=Ee;var ie="DialogOverlay",Pt=s.forwardRef((e,t)=>{const r=Nt(ie,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=A(ie,e.__scopeDialog);return n.modal?d.jsx(ue,{present:o||n.open,children:d.jsx(wn,{...a,ref:t})}):null});Pt.displayName=ie;var bn=it("DialogOverlay.RemoveScroll"),wn=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A(ie,r);return d.jsx(bt,{as:bn,allowPinchZoom:!0,shards:[a.contentRef],children:d.jsx($.div,{"data-state":Se(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),F="DialogContent",Rt=s.forwardRef((e,t)=>{const r=Nt(F,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=A(F,e.__scopeDialog);return d.jsx(ue,{present:o||n.open,children:n.modal?d.jsx(En,{...a,ref:t}):d.jsx(xn,{...a,ref:t})})});Rt.displayName=F;var En=s.forwardRef((e,t)=>{const r=A(F,e.__scopeDialog),o=s.useRef(null),a=k(t,r.contentRef,o);return s.useEffect(()=>{const n=o.current;if(n)return gn(n)},[]),d.jsx(jt,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:L(e.onCloseAutoFocus,n=>{var u;n.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:L(e.onPointerDownOutside,n=>{const u=n.detail.originalEvent,i=u.button===0&&u.ctrlKey===!0;(u.button===2||i)&&n.preventDefault()}),onFocusOutside:L(e.onFocusOutside,n=>n.preventDefault())})}),xn=s.forwardRef((e,t)=>{const r=A(F,e.__scopeDialog),o=s.useRef(!1),a=s.useRef(!1);return d.jsx(jt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var u,i;(u=e.onCloseAutoFocus)==null||u.call(e,n),n.defaultPrevented||(o.current||(i=r.triggerRef.current)==null||i.focus(),n.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:n=>{var p,c;(p=e.onInteractOutside)==null||p.call(e,n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const u=n.target;((c=r.triggerRef.current)==null?void 0:c.contains(u))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&a.current&&n.preventDefault()}})}),jt=s.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:n,...u}=e,i=A(F,r),p=s.useRef(null),c=k(t,p);return jr(),d.jsxs(d.Fragment,{children:[d.jsx(lt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:n,children:d.jsx(st,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Se(i.open),...u,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Sn,{titleId:i.titleId}),d.jsx(Nn,{contentRef:p,descriptionId:i.descriptionId})]})]})}),xe="DialogTitle",At=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A(xe,r);return d.jsx($.h2,{id:a.titleId,...o,ref:t})});At.displayName=xe;var Dt="DialogDescription",Tt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A(Dt,r);return d.jsx($.p,{id:a.descriptionId,...o,ref:t})});Tt.displayName=Dt;var $t="DialogClose",Mt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A($t,r);return d.jsx($.button,{type:"button",...o,ref:t,onClick:L(e.onClick,()=>a.onOpenChange(!1))})});Mt.displayName=$t;function Se(e){return e?"open":"closed"}var It="DialogTitleWarning",[Fo,Lt]=Yt(It,{contentName:F,titleName:xe,docsSlug:"dialog"}),Sn=({titleId:e})=>{const t=Lt(It),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
41
+ `)},ln=0,U=[];function dn(e){var t=s.useRef([]),r=s.useRef([0,0]),o=s.useRef(),a=s.useState(ln++)[0],n=s.useState(mt)[0],u=s.useRef(e);s.useEffect(function(){u.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var l=Ar([e.lockRef.current],(e.shards||[]).map(Le),!0).filter(Boolean);return l.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),l.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var i=s.useCallback(function(l,m){if("touches"in l&&l.touches.length===2||l.type==="wheel"&&l.ctrlKey)return!u.current.allowPinchZoom;var _=J(l),w=r.current,E="deltaX"in l?l.deltaX:w[0]-_[0],x="deltaY"in l?l.deltaY:w[1]-_[1],S,N=l.target,y=Math.abs(E)>Math.abs(x)?"h":"v";if("touches"in l&&y==="h"&&N.type==="range")return!1;var j=Me(y,N);if(!j)return!0;if(j?S=y:(S=y==="v"?"h":"v",j=Me(y,N)),!j)return!1;if(!o.current&&"changedTouches"in l&&(E||x)&&(o.current=S),!S)return!0;var R=o.current||S;return un(R,m,l,R==="h"?E:x)},[]),p=s.useCallback(function(l){var m=l;if(!(!U.length||U[U.length-1]!==n)){var _="deltaY"in m?Ie(m):J(m),w=t.current.filter(function(S){return S.name===m.type&&(S.target===m.target||m.target===S.shadowParent)&&sn(S.delta,_)})[0];if(w&&w.should){m.cancelable&&m.preventDefault();return}if(!w){var E=(u.current.shards||[]).map(Le).filter(Boolean).filter(function(S){return S.contains(m.target)}),x=E.length>0?i(m,E[0]):!u.current.noIsolation;x&&m.cancelable&&m.preventDefault()}}},[]),c=s.useCallback(function(l,m,_,w){var E={name:l,delta:m,target:_,should:w,shadowParent:pn(_)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(x){return x!==E})},1)},[]),f=s.useCallback(function(l){r.current=J(l),o.current=void 0},[]),v=s.useCallback(function(l){c(l.type,Ie(l),l.target,i(l,e.lockRef.current))},[]),h=s.useCallback(function(l){c(l.type,J(l),l.target,i(l,e.lockRef.current))},[]);s.useEffect(function(){return U.push(n),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:h}),document.addEventListener("wheel",p,B),document.addEventListener("touchmove",p,B),document.addEventListener("touchstart",f,B),function(){U=U.filter(function(l){return l!==n}),document.removeEventListener("wheel",p,B),document.removeEventListener("touchmove",p,B),document.removeEventListener("touchstart",f,B)}},[]);var g=e.removeScrollBar,b=e.inert;return s.createElement(s.Fragment,null,b?s.createElement(n,{styles:cn(a)}):null,g?s.createElement(Jr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function pn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fn=Wr(ht,dn);var bt=s.forwardRef(function(e,t){return s.createElement(se,T({},e,{ref:t,sideCar:fn}))});bt.classNames=se.classNames;var vn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},V=new WeakMap,ee=new WeakMap,te={},_e=0,wt=function(e){return e&&(e.host||wt(e.parentNode))},hn=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=wt(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},mn=function(e,t,r,o){var a=hn(t,Array.isArray(e)?e:[e]);te[r]||(te[r]=new WeakMap);var n=te[r],u=[],i=new Set,p=new Set(a),c=function(v){!v||i.has(v)||(i.add(v),c(v.parentNode))};a.forEach(c);var f=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(h){if(i.has(h))f(h);else try{var g=h.getAttribute(o),b=g!==null&&g!=="false",l=(V.get(h)||0)+1,m=(n.get(h)||0)+1;V.set(h,l),n.set(h,m),u.push(h),l===1&&b&&ee.set(h,!0),m===1&&h.setAttribute(r,"true"),b||h.setAttribute(o,"true")}catch(_){console.error("aria-hidden: cannot operate on ",h,_)}})};return f(t),i.clear(),_e++,function(){u.forEach(function(v){var h=V.get(v)-1,g=n.get(v)-1;V.set(v,h),n.set(v,g),h||(ee.has(v)||v.removeAttribute(o),ee.delete(v)),g||v.removeAttribute(r)}),_e--,_e||(V=new WeakMap,V=new WeakMap,ee=new WeakMap,te={})}},gn=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=vn(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live], script"))),mn(o,a,r,"aria-hidden")):function(){return null}},ce="Dialog",[Et]=Xt(ce),[_n,A]=Et(ce),xt=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:n,modal:u=!0}=e,i=s.useRef(null),p=s.useRef(null),[c,f]=tr({prop:o,defaultProp:a??!1,onChange:n,caller:ce});return d.jsx(_n,{scope:t,triggerRef:i,contentRef:p,contentId:de(),titleId:de(),descriptionId:de(),open:c,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(v=>!v),[f]),modal:u,children:r})};xt.displayName=ce;var St="DialogTrigger",Ct=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A(St,r),n=k(t,a.triggerRef);return d.jsx($.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Se(a.open),...o,ref:n,onClick:L(e.onClick,a.onOpenToggle)})});Ct.displayName=St;var Ee="DialogPortal",[yn,Nt]=Et(Ee,{forceMount:void 0}),Ot=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:a}=e,n=A(Ee,t);return d.jsx(yn,{scope:t,forceMount:r,children:s.Children.map(o,u=>d.jsx(ue,{present:r||n.open,children:d.jsx(pt,{asChild:!0,container:a,children:u})}))})};Ot.displayName=Ee;var ie="DialogOverlay",Pt=s.forwardRef((e,t)=>{const r=Nt(ie,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=A(ie,e.__scopeDialog);return n.modal?d.jsx(ue,{present:o||n.open,children:d.jsx(wn,{...a,ref:t})}):null});Pt.displayName=ie;var bn=it("DialogOverlay.RemoveScroll"),wn=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A(ie,r);return d.jsx(bt,{as:bn,allowPinchZoom:!0,shards:[a.contentRef],children:d.jsx($.div,{"data-state":Se(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),F="DialogContent",Rt=s.forwardRef((e,t)=>{const r=Nt(F,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=A(F,e.__scopeDialog);return d.jsx(ue,{present:o||n.open,children:n.modal?d.jsx(En,{...a,ref:t}):d.jsx(xn,{...a,ref:t})})});Rt.displayName=F;var En=s.forwardRef((e,t)=>{const r=A(F,e.__scopeDialog),o=s.useRef(null),a=k(t,r.contentRef,o);return s.useEffect(()=>{const n=o.current;if(n)return gn(n)},[]),d.jsx(jt,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:L(e.onCloseAutoFocus,n=>{var u;n.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:L(e.onPointerDownOutside,n=>{const u=n.detail.originalEvent,i=u.button===0&&u.ctrlKey===!0;(u.button===2||i)&&n.preventDefault()}),onFocusOutside:L(e.onFocusOutside,n=>n.preventDefault())})}),xn=s.forwardRef((e,t)=>{const r=A(F,e.__scopeDialog),o=s.useRef(!1),a=s.useRef(!1);return d.jsx(jt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var u,i;(u=e.onCloseAutoFocus)==null||u.call(e,n),n.defaultPrevented||(o.current||(i=r.triggerRef.current)==null||i.focus(),n.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:n=>{var p,c;(p=e.onInteractOutside)==null||p.call(e,n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const u=n.target;((c=r.triggerRef.current)==null?void 0:c.contains(u))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&a.current&&n.preventDefault()}})}),jt=s.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:n,...u}=e,i=A(F,r),p=s.useRef(null),c=k(t,p);return jr(),d.jsxs(d.Fragment,{children:[d.jsx(lt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:n,children:d.jsx(st,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":Se(i.open),...u,ref:c,onDismiss:()=>i.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Sn,{titleId:i.titleId}),d.jsx(Nn,{contentRef:p,descriptionId:i.descriptionId})]})]})}),xe="DialogTitle",At=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A(xe,r);return d.jsx($.h2,{id:a.titleId,...o,ref:t})});At.displayName=xe;var Dt="DialogDescription",Tt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A(Dt,r);return d.jsx($.p,{id:a.descriptionId,...o,ref:t})});Tt.displayName=Dt;var $t="DialogClose",Mt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=A($t,r);return d.jsx($.button,{type:"button",...o,ref:t,onClick:L(e.onClick,()=>a.onOpenChange(!1))})});Mt.displayName=$t;function Se(e){return e?"open":"closed"}var It="DialogTitleWarning",[Bo,Lt]=Yt(It,{contentName:F,titleName:xe,docsSlug:"dialog"}),Sn=({titleId:e})=>{const t=Lt(It),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
42
 
43
43
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
44
 
@@ -58,7 +58,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
58
58
  Copyright (c) 2018 Jed Watson.
59
59
  Licensed under the MIT License (MIT), see
60
60
  http://jedwatson.github.io/classnames
61
- */var Ke;function eo(){return Ke||(Ke=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(n=a(n,o.call(this,i)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var u="";for(var i in n)t.call(n,i)&&n[i]&&(u=a(u,this&&this[i]||i));return u}function a(n,u){return u?n?n+" "+u:n+u:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Ge)),Ge.exports}var to=eo();const ro=Jn(to),no={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},oo=ro.bind(no),Ye="purpur-icon",ao="md",io=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),uo=({content:e="",title:t}={})=>{const r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},t?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],o=t?`<title>${t}</title>`:"";return`<svg ${io(r)}>${o}${e}</svg>`},so=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),Bt=({svg:e,allyTitle:t,className:r,size:o=ao,...a})=>{const n=uo({content:so(e.svg),title:t}),u=oo(r,Ye,`${Ye}--${o}`);return d.jsx("span",{className:u,dangerouslySetInnerHTML:{__html:n},...a})};Bt.displayName="Icon";const co={name:"close",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',keywords:["close"],category:"utility"},Ut=e=>d.jsx(Bt,{...e,svg:co});Ut.displayName="IconClose";function lo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xe={exports:{}};/*!
61
+ */var Ke;function eo(){return Ke||(Ke=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(n=a(n,o.call(this,i)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var u="";for(var i in n)t.call(n,i)&&n[i]&&(u=a(u,this&&this[i]||i));return u}function a(n,u){return u?n?n+" "+u:n+u:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(Ge)),Ge.exports}var to=eo();const ro=Jn(to),no={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},oo=ro.bind(no),Ye="purpur-icon",ao="md",io=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),uo=({content:e="",title:t}={})=>{const r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},t?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],o=t?`<title>${t}</title>`:"";return`<svg ${io(r)}>${o}${e}</svg>`},so=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),Bt=({svg:e,allyTitle:t,className:r,size:o=ao,...a})=>{const n=uo({content:so(e.svg),title:t}),u=oo(Ye,`${Ye}--${o}`,r);return d.jsx("span",{className:u,dangerouslySetInnerHTML:{__html:n},...a})};Bt.displayName="Icon";const co={name:"close",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',keywords:["close"],category:"utility"},Ut=e=>d.jsx(Bt,{...e,svg:co});Ut.displayName="IconClose";function lo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xe={exports:{}};/*!
62
62
  Copyright (c) 2018 Jed Watson.
63
63
  Licensed under the MIT License (MIT), see
64
64
  http://jedwatson.github.io/classnames
@@ -66,5 +66,5 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
66
66
  Copyright (c) 2018 Jed Watson.
67
67
  Licensed under the MIT License (MIT), see
68
68
  http://jedwatson.github.io/classnames
69
- */var Je;function Ao(){return Je||(Je=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(n=a(n,o.call(this,i)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var u="";for(var i in n)t.call(n,i)&&n[i]&&(u=a(u,this&&this[i]||i));return u}function a(n,u){return u?n?n+" "+u:n+u:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(ye)),ye.exports}var Do=Ao();const To=jo(Do),$o="_fadeIn_4aird_1",Mo={"purpur-modal-content":"_purpur-modal-content_4aird_1",fadeIn:$o,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_4aird_30","purpur-modal-content__close-button":"_purpur-modal-content__close-button_4aird_37","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_4aird_47","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_4aird_57","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_4aird_61","purpur-modal-content__header":"_purpur-modal-content__header_4aird_84","purpur-modal-content__title":"_purpur-modal-content__title_4aird_97","purpur-modal-content__description":"_purpur-modal-content__description_4aird_100","purpur-modal-content__body":"_purpur-modal-content__body_4aird_103","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_4aird_111","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_4aird_123","purpur-modal-content__notification":"_purpur-modal-content__notification_4aird_141","purpur-modal-content--with-image":"_purpur-modal-content--with-image_4aird_144","purpur-modal-content--overflow":"_purpur-modal-content--overflow_4aird_144","purpur-modal-content__actions":"_purpur-modal-content__actions_4aird_123","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_4aird_175","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_4aird_185"},et=e=>e.showCloseButton===!0,O=To.bind(Mo),C="purpur-modal-content",Io=P.forwardRef(({["data-testid"]:e,actions:t,children:r,className:o,description:a,disableCloseOnClickOutside:n,hideDescription:u,image:i,stickyButtons:p=!0,title:c,notification:f=void 0,zIndex:v,onCloseAutoFocus:h,...g},b)=>{const{closeButtonAriaLabel:l,showCloseButton:m,..._}=g,[w,E]=P.useState(!1),[x,S]=P.useState(0),N=P.useRef(null),y=P.useRef(null),j=O(C,{[`${C}--with-image`]:!!i},{[`${C}--overflow`]:w},{[`${C}--sticky-footer`]:p},o),R=D=>e?`${e} ${D}`:void 0,q=D=>{n&&D.preventDefault()},W=P.useCallback(()=>{if(!N.current||!y.current)return;const D=window.getComputedStyle(N.current,null),X=parseFloat(D.getPropertyValue("height")),Gt=y.current.offsetHeight;E(X<Gt),S((N.current.offsetWidth??0)-(N.current.clientWidth??0))},[]),qt=()=>{const D=y.current;if(D){const X=D.querySelector("h2");X&&setTimeout(()=>{X.focus()})}},zt=D=>{n&&!m&&D.preventDefault()};return P.useEffect(()=>(window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W)}),[W]),P.useEffect(()=>{W()},[f,r,W]),d.jsxs(Rn,{children:[d.jsx(jn,{className:O(`${C}__overlay`),style:{zIndex:v}}),d.jsxs(An,{..._,className:j,"data-testid":e,ref:b,...!a&&{"aria-describedby":void 0},onPointerDownOutside:q,onOpenAutoFocus:()=>{W(),qt()},onEscapeKeyDown:zt,onCloseAutoFocus:h,style:{zIndex:`calc(${v} + 1)`},children:[d.jsxs("div",{ref:N,className:O(`${C}__wrapper`),children:[et(g)&&l&&i&&d.jsx(tt,{"aria-label":l,hasImage:!0,scrollbarWidth:x,"data-testid":R("close-button")}),d.jsxs("div",{ref:y,className:O(`${C}__wrapper-inner`),children:[d.jsxs("div",{className:O(`${C}__header`),children:[et(g)&&l&&!i&&d.jsx(tt,{"aria-label":l,"data-testid":R("close-button")}),d.jsx(Dn,{asChild:!0,className:O(`${C}__title`),"data-testid":R("title"),children:d.jsx(Wt,{tag:"h2",variant:"title-200",tabIndex:-1,children:c})})]}),i&&d.jsx("div",{className:O(`${C}__image-wrapper`),"data-testid":R("image"),children:i}),d.jsx("div",{className:O(`${C}__body`),children:d.jsxs("div",{className:O(`${C}__body-inner`),children:[a&&u&&d.jsx(Ro,{asChild:!0,children:d.jsx(Fe,{"data-testid":R("description"),children:a})}),a&&!u&&d.jsx(Fe,{asChild:!0,className:O(`${C}__description`),"data-testid":R("description"),children:d.jsx(Vt,{variant:"paragraph-100",children:a})}),d.jsx("div",{children:r}),!p&&d.jsx(rt,{actions:t,notification:f})]})})]})]}),p&&d.jsx(rt,{actions:t,notification:f})]})]})}),tt=({["aria-label"]:e,hasImage:t,scrollbarWidth:r,["data-testid"]:o})=>d.jsx(Tn,{asChild:!0,children:d.jsx(kt,{variant:t?"primary":"tertiary-purple",negative:t,size:"sm",iconOnly:!0,"aria-label":e,className:O(`${C}__close-button`),style:{right:`calc(var(--purpur-spacing-100) + ${r||0}px)`},"data-testid":o,children:d.jsx(Ut,{})})}),rt=({actions:e,notification:t})=>{const r=P.useRef(null);return P.useEffect(()=>{var o,a;t&&((a=(o=r==null?void 0:r.current)==null?void 0:o.scrollIntoView)==null||a.call(o,!1))},[t]),e?d.jsxs("div",{className:O(`${C}__actions`),children:[d.jsx("div",{className:O(`${C}__actions-buttons`),"data-testid":"modal actions",children:e}),t&&d.jsx("div",{className:O(`${C}__notification`),ref:r,children:t}),d.jsx("span",{className:O(`${C}__actions-separator`)})]}):null},Lo=P.forwardRef(({children:e,...t},r)=>d.jsx(Pn,{asChild:!0,ref:r,...t,children:e})),le=({["data-testid"]:e,children:t,open:r,onOpenChange:o})=>d.jsx(On,{open:r,onOpenChange:o,"data-testid":e,children:t});le.Trigger=Lo;le.Content=Io;le.displayName="Modal";exports.Modal=le;
69
+ */var Je;function Ao(){return Je||(Je=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",u=0;u<arguments.length;u++){var i=arguments[u];i&&(n=a(n,o.call(this,i)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var u="";for(var i in n)t.call(n,i)&&n[i]&&(u=a(u,this&&this[i]||i));return u}function a(n,u){return u?n?n+" "+u:n+u:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(ye)),ye.exports}var Do=Ao();const To=jo(Do),$o="_fadeIn_slvdi_1",Mo="_fadeOut_slvdi_1",Io="_slideUp_slvdi_1",Lo="_slideDown_slvdi_1",Fo={"purpur-modal-content":"_purpur-modal-content_slvdi_1",fadeIn:$o,fadeOut:Mo,slideUp:Io,slideDown:Lo,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_slvdi_49","purpur-modal-content__close-button":"_purpur-modal-content__close-button_slvdi_65","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_slvdi_75","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_slvdi_85","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_slvdi_89","purpur-modal-content__header":"_purpur-modal-content__header_slvdi_112","purpur-modal-content__title":"_purpur-modal-content__title_slvdi_125","purpur-modal-content__description":"_purpur-modal-content__description_slvdi_128","purpur-modal-content__body":"_purpur-modal-content__body_slvdi_131","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_slvdi_139","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_slvdi_151","purpur-modal-content__notification":"_purpur-modal-content__notification_slvdi_169","purpur-modal-content--with-image":"_purpur-modal-content--with-image_slvdi_172","purpur-modal-content--overflow":"_purpur-modal-content--overflow_slvdi_172","purpur-modal-content__actions":"_purpur-modal-content__actions_slvdi_151","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_slvdi_203","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_slvdi_213"},et=e=>e.showCloseButton===!0,O=To.bind(Fo),C="purpur-modal-content",ko=P.forwardRef(({["data-testid"]:e,actions:t,children:r,className:o,description:a,disableCloseOnClickOutside:n,hideDescription:u,image:i,stickyButtons:p=!0,title:c,notification:f=void 0,zIndex:v,onCloseAutoFocus:h,...g},b)=>{const{closeButtonAriaLabel:l,showCloseButton:m,..._}=g,[w,E]=P.useState(!1),[x,S]=P.useState(0),N=P.useRef(null),y=P.useRef(null),j=O(C,{[`${C}--with-image`]:!!i},{[`${C}--overflow`]:w},{[`${C}--sticky-footer`]:p},o),R=D=>e?`${e} ${D}`:void 0,q=D=>{n&&D.preventDefault()},W=P.useCallback(()=>{if(!N.current||!y.current)return;const D=window.getComputedStyle(N.current,null),X=parseFloat(D.getPropertyValue("height")),Gt=y.current.offsetHeight;E(X<Gt),S((N.current.offsetWidth??0)-(N.current.clientWidth??0))},[]),qt=()=>{const D=y.current;if(D){const X=D.querySelector("h2");X&&setTimeout(()=>{X.focus()})}},zt=D=>{n&&!m&&D.preventDefault()};return P.useEffect(()=>(window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W)}),[W]),P.useEffect(()=>{W()},[f,r,W]),d.jsxs(Rn,{children:[d.jsx(jn,{className:O(`${C}__overlay`),style:{zIndex:v}}),d.jsxs(An,{..._,className:j,"data-testid":e,ref:b,...!a&&{"aria-describedby":void 0},onPointerDownOutside:q,onOpenAutoFocus:()=>{W(),qt()},onEscapeKeyDown:zt,onCloseAutoFocus:h,style:{zIndex:`calc(${v} + 1)`},children:[d.jsxs("div",{ref:N,className:O(`${C}__wrapper`),children:[et(g)&&l&&i&&d.jsx(tt,{"aria-label":l,hasImage:!0,scrollbarWidth:x,"data-testid":R("close-button")}),d.jsxs("div",{ref:y,className:O(`${C}__wrapper-inner`),children:[d.jsxs("div",{className:O(`${C}__header`),children:[et(g)&&l&&!i&&d.jsx(tt,{"aria-label":l,"data-testid":R("close-button")}),d.jsx(Dn,{asChild:!0,className:O(`${C}__title`),"data-testid":R("title"),children:d.jsx(Wt,{tag:"h2",variant:"title-200",tabIndex:-1,children:c})})]}),i&&d.jsx("div",{className:O(`${C}__image-wrapper`),"data-testid":R("image"),children:i}),d.jsx("div",{className:O(`${C}__body`),children:d.jsxs("div",{className:O(`${C}__body-inner`),children:[a&&u&&d.jsx(Ro,{asChild:!0,children:d.jsx(Fe,{"data-testid":R("description"),children:a})}),a&&!u&&d.jsx(Fe,{asChild:!0,className:O(`${C}__description`),"data-testid":R("description"),children:d.jsx(Vt,{variant:"paragraph-100",children:a})}),d.jsx("div",{children:r}),!p&&d.jsx(rt,{actions:t,notification:f})]})})]})]}),p&&d.jsx(rt,{actions:t,notification:f})]})]})}),tt=({["aria-label"]:e,hasImage:t,scrollbarWidth:r,["data-testid"]:o})=>d.jsx(Tn,{asChild:!0,children:d.jsx(kt,{variant:t?"primary":"tertiary-purple",negative:t,size:"sm",iconOnly:!0,"aria-label":e,className:O(`${C}__close-button`),style:{right:`calc(var(--purpur-spacing-100) + ${r||0}px)`},"data-testid":o,children:d.jsx(Ut,{})})}),rt=({actions:e,notification:t})=>{const r=P.useRef(null);return P.useEffect(()=>{var o,a;t&&((a=(o=r==null?void 0:r.current)==null?void 0:o.scrollIntoView)==null||a.call(o,!1))},[t]),e?d.jsxs("div",{className:O(`${C}__actions`),children:[d.jsx("div",{className:O(`${C}__actions-buttons`),"data-testid":"modal actions",children:e}),t&&d.jsx("div",{className:O(`${C}__notification`),ref:r,children:t}),d.jsx("span",{className:O(`${C}__actions-separator`)})]}):null},Wo=P.forwardRef(({children:e,...t},r)=>d.jsx(Pn,{asChild:!0,ref:r,...t,children:e})),le=({["data-testid"]:e,children:t,open:r,onOpenChange:o})=>d.jsx(On,{open:r,onOpenChange:o,"data-testid":e,children:t});le.Trigger=Wo;le.Content=ko;le.displayName="Modal";exports.Modal=le;
70
70
  //# sourceMappingURL=modal.cjs.js.map