@apipass/design-system 4.0.0 → 4.2.1
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/lib/embedded-styles.js +1 -1
- package/dist/lib/json-viewer.index.cjs +1 -1
- package/dist/lib/json-viewer.index.js +4 -2
- package/dist/lib/json-viewer.index.js.map +1 -1
- package/dist/lib/lib.index.cjs +1 -1
- package/dist/lib/lib.index.js +696 -694
- package/dist/lib/lib.index.js.map +1 -1
- package/dist/lib/style.css +1 -1
- package/dist/lib/ui/components/DataTable/DataTable.cjs +1 -1
- package/dist/lib/ui/components/Widget/Widget.cjs +1 -1
- package/dist/lib/ui/components/WidgetGrid/WidgetGrid.cjs +1 -1
- package/dist/lib/ui/primitives/Button/Button.cjs +1 -1
- package/dist/lib/ui/primitives/CodeBlock/CodeBlock.cjs +1 -1
- package/dist/lib/ui/primitives/CodeEditor/CodeEditor.cjs +1 -1
- package/dist/lib/ui/primitives/ComboBox/ComboBox.cjs +1 -1
- package/dist/lib/ui/primitives/ComboBox/ComboBox.cjs.map +1 -1
- package/dist/lib/ui/primitives/ComboBox/ComboBox.js +60 -37
- package/dist/lib/ui/primitives/ComboBox/ComboBox.js.map +1 -1
- package/dist/lib/ui/primitives/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/lib/ui/primitives/FileUpload/FileUpload.cjs +1 -1
- package/dist/lib/ui/primitives/FileUpload/FileUpload.js +10 -10
- package/dist/lib/ui/primitives/IconButton/IconButton.cjs +1 -1
- package/dist/lib/ui/primitives/Input/Input.js +2 -2
- package/dist/lib/ui/primitives/JsonViewer/JsonEditor.cjs +2 -0
- package/dist/lib/ui/primitives/JsonViewer/JsonEditor.cjs.map +1 -0
- package/dist/lib/ui/primitives/JsonViewer/JsonEditor.js +95 -0
- package/dist/lib/ui/primitives/JsonViewer/JsonEditor.js.map +1 -0
- package/dist/lib/ui/primitives/JsonViewer/JsonViewer.cjs +1 -1
- package/dist/lib/ui/primitives/JsonViewer/JsonViewer.cjs.map +1 -1
- package/dist/lib/ui/primitives/JsonViewer/JsonViewer.js +37 -88
- package/dist/lib/ui/primitives/JsonViewer/JsonViewer.js.map +1 -1
- package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.cjs +2 -0
- package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.cjs.map +1 -0
- package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.js +64 -0
- package/dist/lib/ui/primitives/JsonViewer/json-code-mirror.js.map +1 -0
- package/dist/lib/ui/primitives/Link/Link.cjs +1 -1
- package/dist/lib/ui/primitives/Link/Link.js +3 -3
- package/dist/lib/ui/primitives/Menu/Menu.cjs +1 -1
- package/dist/lib/ui/primitives/Menu/Menu.cjs.map +1 -1
- package/dist/lib/ui/primitives/Menu/Menu.js +65 -45
- package/dist/lib/ui/primitives/Menu/Menu.js.map +1 -1
- package/dist/lib/ui/primitives/PermissionGate/PermissionGate.cjs.map +1 -1
- package/dist/lib/ui/primitives/PermissionGate/PermissionGate.js.map +1 -1
- package/dist/lib/ui/primitives/Search/Search.cjs +1 -1
- package/dist/lib/ui/primitives/Search/Search.js +8 -8
- package/dist/lib/ui/primitives/Select/MultiSelect.cjs +2 -0
- package/dist/lib/ui/primitives/Select/MultiSelect.cjs.map +1 -0
- package/dist/lib/ui/primitives/Select/MultiSelect.js +113 -0
- package/dist/lib/ui/primitives/Select/MultiSelect.js.map +1 -0
- package/dist/lib/ui/primitives/Select/Select.cjs +1 -1
- package/dist/lib/ui/primitives/Select/Select.cjs.map +1 -1
- package/dist/lib/ui/primitives/Select/Select.js +19 -12
- package/dist/lib/ui/primitives/Select/Select.js.map +1 -1
- package/dist/lib/vendor/@monaco-editor/react/dist/index.cjs +1 -1
- package/dist/lib/vendor/@monaco-editor/react/dist/index.cjs.map +1 -1
- package/dist/lib/vendor/@monaco-editor/react/dist/index.js +21 -21
- package/dist/lib/vendor/@react-aria/interactions/dist/useFocusable.cjs +1 -1
- package/dist/lib/vendor/@react-aria/interactions/dist/useFocusable.js +4 -4
- package/dist/lib/vendor/@react-aria/ssr/dist/SSRProvider.js.map +1 -1
- package/dist/lib/vendor/@react-stately/utils/dist/useControlledState.cjs +1 -1
- package/dist/lib/vendor/react-draggable/build/cjs/Draggable.cjs +2 -2
- package/dist/lib/vendor/react-draggable/build/cjs/Draggable.js +8 -8
- package/dist/lib/vendor/react-grid-layout/build/GridItem.cjs +1 -1
- package/dist/lib/vendor/react-grid-layout/build/ReactGridLayout.cjs +1 -1
- package/dist/lib/vendor/react-grid-layout/build/ReactGridLayout.js +6 -6
- package/dist/lib/vendor/react-grid-layout/build/ReactGridLayout.js.map +1 -1
- package/dist/lib/vendor/react-grid-layout/build/ReactGridLayoutPropTypes.js +2 -2
- package/dist/lib/vendor/react-grid-layout/build/ResponsiveReactGridLayout.cjs +1 -1
- package/dist/lib/vendor/react-grid-layout/build/ResponsiveReactGridLayout.js.map +1 -1
- package/dist/lib/vendor/react-grid-layout/build/components/WidthProvider.cjs +1 -1
- package/dist/lib/vendor/react-grid-layout/build/components/WidthProvider.js +6 -6
- package/dist/lib/vendor/react-grid-layout/build/components/WidthProvider.js.map +1 -1
- package/dist/lib/vendor/react-grid-layout/build/utils.cjs +1 -1
- package/dist/lib/vendor/react-grid-layout/build/utils.js +27 -27
- package/dist/lib/vendor/react-resizable/build/Resizable.cjs +1 -1
- package/dist/lib/vendor/react-resizable/build/Resizable.js +17 -17
- package/dist/lib/vendor/react-resizable/build/Resizable.js.map +1 -1
- package/dist/lib/vendor/react-resizable/build/ResizableBox.cjs +1 -1
- package/dist/lib/vendor/react-resizable/build/ResizableBox.js +5 -5
- package/dist/lib/vendor/react-resizable/build/ResizableBox.js.map +1 -1
- package/dist/lib/vendor/react-resizable/build/utils.cjs +1 -1
- package/dist/lib/vendor/react-resizable/build/utils.cjs.map +1 -1
- package/dist/lib/vendor/react-resizable/build/utils.js +2 -2
- package/dist/lib/vendor/react-toastify/dist/index.cjs +1 -1
- package/dist/lib/vendor/react-toastify/dist/index.js +10 -10
- package/dist/types/json-viewer.index.d.ts +1 -0
- package/dist/types/ui/primitives/JsonViewer/JsonEditor.d.ts +18 -0
- package/dist/types/ui/primitives/JsonViewer/json-code-mirror.d.ts +17 -0
- package/dist/types/ui/primitives/Menu/Menu.d.ts +1 -1
- package/dist/types/ui/primitives/PermissionGate/PermissionGate.d.ts +20 -0
- package/dist/types/ui/primitives/Select/MultiSelect.d.ts +15 -0
- package/dist/types/ui/primitives/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),D=require("../../clsx/dist/clsx.cjs");var N=t=>typeof t=="number"&&!isNaN(t),R=t=>typeof t=="string",$=t=>typeof t=="function",ft=t=>R(t)||N(t),K=t=>R(t)||$(t)?t:null,ct=(t,e)=>t===!1||N(t)&&t>0?t:e,Y=t=>i.isValidElement(t)||R(t)||$(t)||N(t);function J(t,e,o=300){let{scrollHeight:r,style:n}=t;requestAnimationFrame(()=>{n.minHeight="initial",n.height=r+"px",n.transition=`all ${o}ms`,requestAnimationFrame(()=>{n.height="0",n.padding="0",n.margin="0",setTimeout(e,o)})})}function Z({enter:t,exit:e,appendPosition:o=!1,collapse:r=!0,collapseDuration:n=300}){return function({children:f,position:a,preventExitTransition:u,done:c,nodeRef:m,isIn:v,playToast:x}){let E=o?`${t}--${a}`:t,k=o?`${e}--${a}`:e,I=i.useRef(0);return i.useLayoutEffect(()=>{let T=m.current,_=E.split(" "),p=s=>{s.target===m.current&&(x(),T.removeEventListener("animationend",p),T.removeEventListener("animationcancel",p),I.current===0&&s.type!=="animationcancel"&&T.classList.remove(..._))};T.classList.add(..._),T.addEventListener("animationend",p),T.addEventListener("animationcancel",p)},[]),i.useEffect(()=>{let T=m.current,_=()=>{T.removeEventListener("animationend",_),r?J(T,c,n):c()};v||(u?_():(I.current=1,T.className+=` ${k}`,T.addEventListener("animationend",_)))},[v]),i.createElement(i.Fragment,null,f)}}function W(t,e){return{content:tt(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:e}}function tt(t,e,o=!1){return i.isValidElement(t)&&!R(t.type)?i.cloneElement(t,{closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:o}):$(t)?t({closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:o}):t}function dt({closeToast:t,theme:e,ariaLabel:o="close"}){return i.createElement("button",{className:`Toastify__close-button Toastify__close-button--${e}`,type:"button",onClick:r=>{r.stopPropagation(),t(!0)},"aria-label":o},i.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},i.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ut({delay:t,isRunning:e,closeToast:o,type:r="default",hide:n,className:f,controlledProgress:a,progress:u,rtl:c,isIn:m,theme:v}){let x=n||a&&u===0,E={animationDuration:`${t}ms`,animationPlayState:e?"running":"paused"};a&&(E.transform=`scaleX(${u})`);let k=D.clsx("Toastify__progress-bar",a?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${v}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":c}),I=$(f)?f({rtl:c,type:r,defaultClassName:k}):D.clsx(k,f),T={[a&&u>=1?"onTransitionEnd":"onAnimationEnd"]:a&&u<1?null:()=>{m&&o()}};return i.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":x},i.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${v} Toastify__progress-bar--${r}`}),i.createElement("div",{role:"progressbar","aria-hidden":x?"true":"false","aria-label":"notification timer","aria-valuenow":a?Math.round(u*100):void 0,"aria-valuemin":0,"aria-valuemax":100,className:I,style:E,...T}))}var yt=1,et=()=>`${yt++}`;function mt(t,e,o){let r=1,n=0,f=[],a=[],u=e,c=new Map,m=new Set,v=s=>(m.add(s),()=>m.delete(s)),x=()=>{a=Array.from(c.values()),m.forEach(s=>s())},E=({containerId:s,toastId:l,updateId:d})=>{let h=s?s!==t:t!==1,C=c.has(l)&&d==null;return h||C},k=(s,l)=>{c.forEach(d=>{var h;(l==null||l===d.props.toastId)&&((h=d.toggle)==null||h.call(d,s))})},I=s=>{var l,d;s.isActive&&((d=(l=s.props)==null?void 0:l.onClose)==null||d.call(l,s.removalReason),s.isActive=!1,o(W(s,"removed")))},T=s=>{if(s==null)c.forEach(I);else{let l=c.get(s);l&&I(l)}x()},_=()=>{n-=f.length,f=[]},p=s=>{var l,d;let{toastId:h,updateId:C}=s.props,y=C==null;s.staleId&&c.delete(s.staleId),s.isActive=!0,c.set(h,s),x(),o(W(s,y?"added":"updated")),y&&((d=(l=s.props).onOpen)==null||d.call(l))};return{id:t,props:u,observe:v,toggle:k,removeToast:T,toasts:c,clearQueue:_,buildToast:(s,l)=>{if(E(l))return;let{toastId:d,updateId:h,data:C,staleId:y,delay:b}=l,L=h==null;L&&n++;let O={...u,style:u.toastStyle,key:r++,...Object.fromEntries(Object.entries(l).filter(([S,P])=>P!=null)),toastId:d,updateId:h,data:C,isIn:!1,className:K(l.className||u.toastClassName),progressClassName:K(l.progressClassName||u.progressClassName),autoClose:l.isLoading?!1:ct(l.autoClose,u.autoClose),closeToast(S){let P=c.get(d);P&&(P.removalReason=S,T(d))},deleteToast(){if(c.get(d)!=null){if(c.delete(d),n--,n<0&&(n=0),f.length>0){p(f.shift());return}x()}}};O.closeButton=u.closeButton,l.closeButton===!1||Y(l.closeButton)?O.closeButton=l.closeButton:l.closeButton===!0&&(O.closeButton=Y(u.closeButton)?u.closeButton:!0);let z={content:s,props:O,staleId:y};u.limit&&u.limit>0&&n>u.limit&&L?f.push(z):N(b)?setTimeout(()=>{p(z)},b):p(z)},setProps(s){u=s},setToggle:(s,l)=>{let d=c.get(s);d&&(d.toggle=l)},isToastActive:s=>{var l;return(l=c.get(s))==null?void 0:l.isActive},getSnapshot:()=>a}}var w=new Map,A=[],Q=new Set,pt=t=>Q.forEach(e=>e(t)),ot=()=>w.size>0;function _t(){A.forEach(t=>st(t.content,t.options)),A=[]}var gt=(t,{containerId:e})=>{var o;return(o=w.get(e||1))==null?void 0:o.toasts.get(t)};function at(t,e){var o;if(e)return!!((o=w.get(e))!=null&&o.isToastActive(t));let r=!1;return w.forEach(n=>{n.isToastActive(t)&&(r=!0)}),r}function vt(t){if(!ot()){A=A.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||ft(t))w.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=w.get(t.containerId);e?e.removeToast(t.id):w.forEach(o=>{o.removeToast(t.id)})}}var bt=(t={})=>{w.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function st(t,e){Y(t)&&(ot()||A.push({content:t,options:e}),w.forEach(o=>{o.buildToast(t,e)}))}function Tt(t){var e;(e=w.get(t.containerId||1))==null||e.setToggle(t.id,t.fn)}function rt(t,e){w.forEach(o=>{(e==null||!(e!=null&&e.containerId)||(e==null?void 0:e.containerId)===o.id)&&o.toggle(t,e==null?void 0:e.id)})}function ht(t){let e=t.containerId||1;return{subscribe(o){let r=mt(e,t,pt);w.set(e,r);let n=r.observe(o);return _t(),()=>{n(),w.delete(e)}},setProps(o){var r;(r=w.get(e))==null||r.setProps(o)},getSnapshot(){var o;return(o=w.get(e))==null?void 0:o.getSnapshot()}}}function xt(t){return Q.add(t),()=>{Q.delete(t)}}function kt(t){return t&&(R(t.toastId)||N(t.toastId))?t.toastId:et()}function M(t,e){return st(t,e),e.toastId}function U(t,e){return{...e,type:e&&e.type||t,toastId:kt(e)}}function H(t){return(e,o)=>M(e,U(t,o))}function g(t,e){return M(t,U("default",e))}g.loading=(t,e)=>M(t,U("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function Et(t,{pending:e,error:o,success:r},n){let f;e&&(f=R(e)?g.loading(e,n):g.loading(e.render,{...n,...e}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(m,v,x)=>{if(v==null){g.dismiss(f);return}let E={type:m,...a,...n,data:x},k=R(v)?{render:v}:v;return f?g.update(f,{...E,...k}):g(k.render,{...E,...k}),x},c=$(t)?t():t;return c.then(m=>u("success",r,m)).catch(m=>u("error",o,m)),c}g.promise=Et;g.success=H("success");g.info=H("info");g.error=H("error");g.warning=H("warning");g.warn=g.warning;g.dark=(t,e)=>M(t,U("default",{theme:"dark",...e}));function wt(t){vt(t)}g.dismiss=wt;g.clearWaitingQueue=bt;g.isActive=at;g.update=(t,e={})=>{let o=gt(t,e);if(o){let{props:r,content:n}=o,f={delay:100,...r,...e,toastId:e.toastId||t,updateId:et()};f.toastId!==t&&(f.staleId=t);let a=f.render||n;delete f.render,M(a,f)}};g.done=t=>{g.update(t,{progress:1})};g.onChange=xt;g.play=t=>rt(!0,t);g.pause=t=>rt(!1,t);function It(t){var e;let{subscribe:o,getSnapshot:r,setProps:n}=i.useRef(ht(t)).current;n(t);let f=(e=i.useSyncExternalStore(o,r,r))==null?void 0:e.slice();function a(u){if(!f)return[];let c=new Map;return t.newestOnTop&&f.reverse(),f.forEach(m=>{let{position:v}=m.props;c.has(v)||c.set(v,[]),c.get(v).push(m)}),Array.from(c,m=>u(m[0],m[1]))}return{getToastToRender:a,isToastActive:at,count:f==null?void 0:f.length}}function Ct(t){let[e,o]=i.useState(!1),[r,n]=i.useState(!1),f=i.useRef(null),a=i.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:u,pauseOnHover:c,closeToast:m,onClick:v,closeOnClick:x}=t;Tt({id:t.toastId,containerId:t.containerId,fn:o}),i.useEffect(()=>{if(t.pauseOnFocusLoss)return E(),()=>{k()}},[t.pauseOnFocusLoss]);function E(){document.hasFocus()||p(),window.addEventListener("focus",_),window.addEventListener("blur",p)}function k(){window.removeEventListener("focus",_),window.removeEventListener("blur",p)}function I(y){if(t.draggable===!0||t.draggable===y.pointerType){s();let b=f.current;a.canCloseOnClick=!0,a.canDrag=!0,b.style.transition="none",t.draggableDirection==="x"?(a.start=y.clientX,a.removalDistance=b.offsetWidth*(t.draggablePercent/100)):(a.start=y.clientY,a.removalDistance=b.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100)}}function T(y){let{top:b,bottom:L,left:O,right:z}=f.current.getBoundingClientRect();y.pointerType==="mouse"&&t.pauseOnHover&&y.clientX>=O&&y.clientX<=z&&y.clientY>=b&&y.clientY<=L?p():_()}function _(){o(!0)}function p(){o(!1)}function s(){a.didMove=!1,document.addEventListener("pointermove",d),document.addEventListener("pointerup",h)}function l(){document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",h)}function d(y){let b=f.current;if(a.canDrag&&b){a.didMove=!0,e&&p(),t.draggableDirection==="x"?a.delta=y.clientX-a.start:a.delta=y.clientY-a.start,a.start!==y.clientX&&(a.canCloseOnClick=!1);let L=t.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`;b.style.transform=`translate3d(${L},0)`,b.style.opacity=`${1-Math.abs(a.delta/a.removalDistance)}`}}function h(){l();let y=f.current;if(a.canDrag&&a.didMove&&y){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance){n(!0),t.closeToast(!0),t.collapseAll();return}y.style.transition="transform 0.2s, opacity 0.2s",y.style.removeProperty("transform"),y.style.removeProperty("opacity")}}let C={onPointerDown:I,onPointerUp:T};return u&&c&&(C.onMouseEnter=p,t.stacked||(C.onMouseLeave=_)),x&&(C.onClick=y=>{v&&v(y),a.canCloseOnClick&&m(!0)}),{playToast:_,pauseToast:p,isRunning:e,preventExitTransition:r,toastRef:f,eventHandlers:C}}var nt=typeof window<"u"?i.useLayoutEffect:i.useEffect,q=({theme:t,type:e,isLoading:o,...r})=>i.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${e})`,...r});function Lt(t){return i.createElement(q,{...t},i.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Ot(t){return i.createElement(q,{...t},i.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function zt(t){return i.createElement(q,{...t},i.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function $t(t){return i.createElement(q,{...t},i.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function Pt(){return i.createElement("div",{className:"Toastify__spinner"})}var X={info:Ot,warning:Lt,success:zt,error:$t,spinner:Pt},Dt=t=>t in X;function Rt({theme:t,type:e,isLoading:o,icon:r}){let n=null,f={theme:t,type:e};return r===!1||($(r)?n=r({...f,isLoading:o}):i.isValidElement(r)?n=i.cloneElement(r,f):o?n=X.spinner():Dt(e)&&(n=X[e](f))),n}var At=t=>{let{isRunning:e,preventExitTransition:o,toastRef:r,eventHandlers:n,playToast:f}=Ct(t),{closeButton:a,children:u,autoClose:c,onClick:m,type:v,hideProgressBar:x,closeToast:E,transition:k,position:I,className:T,style:_,progressClassName:p,updateId:s,role:l,progress:d,rtl:h,toastId:C,deleteToast:y,isIn:b,isLoading:L,closeOnClick:O,theme:z,ariaLabel:S}=t,P=D.clsx("Toastify__toast",`Toastify__toast-theme--${z}`,`Toastify__toast--${v}`,{"Toastify__toast--rtl":h},{"Toastify__toast--close-on-click":O}),lt=$(T)?T({rtl:h,position:I,type:v,defaultClassName:P}):D.clsx(P,T),V=Rt(t),j=!!d||!c,F={closeToast:E,type:v,theme:z},B=null;return a===!1||($(a)?B=a(F):i.isValidElement(a)?B=i.cloneElement(a,F):B=dt(F)),i.createElement(k,{isIn:b,done:y,position:I,preventExitTransition:o,nodeRef:r,playToast:f},i.createElement("div",{id:C,tabIndex:0,onClick:m,"data-in":b,className:lt,...n,style:_,ref:r,...b&&{role:l,"aria-label":S}},V!=null&&i.createElement("div",{className:D.clsx("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!L})},V),tt(u,t,!e),B,!t.customProgressBar&&i.createElement(ut,{...s&&!j?{key:`p-${s}`}:{},rtl:h,theme:z,delay:c,isRunning:e,isIn:b,closeToast:E,hide:x,type:v,className:p,controlledProgress:j,progress:d||0})))},Nt=(t,e=!1)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}),it=Z(Nt("bounce",!0)),Mt={position:"top-right",transition:it,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function St(t){let e={...Mt,...t},o=t.stacked,[r,n]=i.useState(!0),f=i.useRef(null),{getToastToRender:a,isToastActive:u,count:c}=It(e),{className:m,style:v,rtl:x,containerId:E,hotKeys:k}=e;function I(_){let p=D.clsx("Toastify__toast-container",`Toastify__toast-container--${_}`,{"Toastify__toast-container--rtl":x});return $(m)?m({position:_,rtl:x,defaultClassName:p}):D.clsx(p,K(m))}function T(){o&&(n(!0),g.play())}return nt(()=>{var _;if(o){let p=f.current.querySelectorAll('[data-in="true"]'),s=12,l=(_=e.position)==null?void 0:_.includes("top"),d=0,h=0;Array.from(p).reverse().forEach((C,y)=>{let b=C;b.classList.add("Toastify__toast--stacked"),y>0&&(b.dataset.collapsed=`${r}`),b.dataset.pos||(b.dataset.pos=l?"top":"bot");let L=d*(r?.2:1)+(r?0:s*y),O=Math.max(.5,1-(r?h:0));b.style.setProperty("--y",`${l?L:L*-1}px`),b.style.setProperty("--g",`${s}`),b.style.setProperty("--s",`${O}`),d+=b.offsetHeight,h+=.025})}},[r,c,o]),i.useEffect(()=>{function _(p){var s;let l=f.current;k(p)&&((s=l==null?void 0:l.querySelector('[tabIndex="0"]'))==null||s.focus(),n(!1),g.pause()),p.key==="Escape"&&(document.activeElement===l||l!=null&&l.contains(document.activeElement))&&(n(!0),g.play())}return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[k]),i.createElement("section",{ref:f,className:"Toastify",id:E,onMouseEnter:()=>{o&&(n(!1),g.pause())},onMouseLeave:T,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":e["aria-label"]},a((_,p)=>{let s=p.length?{...v}:{...v,pointerEvents:"none"};return i.createElement("div",{tabIndex:-1,className:I(_),"data-stacked":o,style:s,key:`c-${_}`},p.map(({content:l,props:d})=>i.createElement(At,{...d,stacked:o,collapseAll:T,isIn:u(d.toastId,d.containerId),key:`t-${d.key}`},l)))}))}var Bt=`:root {
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),R=require("../../clsx/dist/clsx.cjs");var N=t=>typeof t=="number"&&!isNaN(t),D=t=>typeof t=="string",$=t=>typeof t=="function",ft=t=>D(t)||N(t),K=t=>D(t)||$(t)?t:null,ct=(t,e)=>t===!1||N(t)&&t>0?t:e,Y=t=>i.isValidElement(t)||D(t)||$(t)||N(t);function J(t,e,o=300){let{scrollHeight:r,style:n}=t;requestAnimationFrame(()=>{n.minHeight="initial",n.height=r+"px",n.transition=`all ${o}ms`,requestAnimationFrame(()=>{n.height="0",n.padding="0",n.margin="0",setTimeout(e,o)})})}function Z({enter:t,exit:e,appendPosition:o=!1,collapse:r=!0,collapseDuration:n=300}){return function({children:f,position:a,preventExitTransition:u,done:c,nodeRef:m,isIn:v,playToast:x}){let E=o?`${t}--${a}`:t,k=o?`${e}--${a}`:e,I=i.useRef(0);return i.useLayoutEffect(()=>{let T=m.current,_=E.split(" "),p=s=>{s.target===m.current&&(x(),T.removeEventListener("animationend",p),T.removeEventListener("animationcancel",p),I.current===0&&s.type!=="animationcancel"&&T.classList.remove(..._))};T.classList.add(..._),T.addEventListener("animationend",p),T.addEventListener("animationcancel",p)},[]),i.useEffect(()=>{let T=m.current,_=()=>{T.removeEventListener("animationend",_),r?J(T,c,n):c()};v||(u?_():(I.current=1,T.className+=` ${k}`,T.addEventListener("animationend",_)))},[v]),i.createElement(i.Fragment,null,f)}}function W(t,e){return{content:tt(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:e}}function tt(t,e,o=!1){return i.isValidElement(t)&&!D(t.type)?i.cloneElement(t,{closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:o}):$(t)?t({closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:o}):t}function dt({closeToast:t,theme:e,ariaLabel:o="close"}){return i.createElement("button",{className:`Toastify__close-button Toastify__close-button--${e}`,type:"button",onClick:r=>{r.stopPropagation(),t(!0)},"aria-label":o},i.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},i.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function ut({delay:t,isRunning:e,closeToast:o,type:r="default",hide:n,className:f,controlledProgress:a,progress:u,rtl:c,isIn:m,theme:v}){let x=n||a&&u===0,E={animationDuration:`${t}ms`,animationPlayState:e?"running":"paused"};a&&(E.transform=`scaleX(${u})`);let k=R.clsx("Toastify__progress-bar",a?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${v}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":c}),I=$(f)?f({rtl:c,type:r,defaultClassName:k}):R.clsx(k,f),T={[a&&u>=1?"onTransitionEnd":"onAnimationEnd"]:a&&u<1?null:()=>{m&&o()}};return i.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":x},i.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${v} Toastify__progress-bar--${r}`}),i.createElement("div",{role:"progressbar","aria-hidden":x?"true":"false","aria-label":"notification timer","aria-valuenow":a?Math.round(u*100):void 0,"aria-valuemin":0,"aria-valuemax":100,className:I,style:E,...T}))}var yt=1,et=()=>`${yt++}`;function mt(t,e,o){let r=1,n=0,f=[],a=[],u=e,c=new Map,m=new Set,v=s=>(m.add(s),()=>m.delete(s)),x=()=>{a=Array.from(c.values()),m.forEach(s=>s())},E=({containerId:s,toastId:l,updateId:d})=>{let h=s?s!==t:t!==1,C=c.has(l)&&d==null;return h||C},k=(s,l)=>{c.forEach(d=>{var h;(l==null||l===d.props.toastId)&&((h=d.toggle)==null||h.call(d,s))})},I=s=>{var l,d;s.isActive&&((d=(l=s.props)==null?void 0:l.onClose)==null||d.call(l,s.removalReason),s.isActive=!1,o(W(s,"removed")))},T=s=>{if(s==null)c.forEach(I);else{let l=c.get(s);l&&I(l)}x()},_=()=>{n-=f.length,f=[]},p=s=>{var l,d;let{toastId:h,updateId:C}=s.props,y=C==null;s.staleId&&c.delete(s.staleId),s.isActive=!0,c.set(h,s),x(),o(W(s,y?"added":"updated")),y&&((d=(l=s.props).onOpen)==null||d.call(l))};return{id:t,props:u,observe:v,toggle:k,removeToast:T,toasts:c,clearQueue:_,buildToast:(s,l)=>{if(E(l))return;let{toastId:d,updateId:h,data:C,staleId:y,delay:b}=l,L=h==null;L&&n++;let O={...u,style:u.toastStyle,key:r++,...Object.fromEntries(Object.entries(l).filter(([S,P])=>P!=null)),toastId:d,updateId:h,data:C,isIn:!1,className:K(l.className||u.toastClassName),progressClassName:K(l.progressClassName||u.progressClassName),autoClose:l.isLoading?!1:ct(l.autoClose,u.autoClose),closeToast(S){let P=c.get(d);P&&(P.removalReason=S,T(d))},deleteToast(){if(c.get(d)!=null){if(c.delete(d),n--,n<0&&(n=0),f.length>0){p(f.shift());return}x()}}};O.closeButton=u.closeButton,l.closeButton===!1||Y(l.closeButton)?O.closeButton=l.closeButton:l.closeButton===!0&&(O.closeButton=Y(u.closeButton)?u.closeButton:!0);let z={content:s,props:O,staleId:y};u.limit&&u.limit>0&&n>u.limit&&L?f.push(z):N(b)?setTimeout(()=>{p(z)},b):p(z)},setProps(s){u=s},setToggle:(s,l)=>{let d=c.get(s);d&&(d.toggle=l)},isToastActive:s=>{var l;return(l=c.get(s))==null?void 0:l.isActive},getSnapshot:()=>a}}var w=new Map,A=[],Q=new Set,pt=t=>Q.forEach(e=>e(t)),ot=()=>w.size>0;function _t(){A.forEach(t=>st(t.content,t.options)),A=[]}var gt=(t,{containerId:e})=>{var o;return(o=w.get(e||1))==null?void 0:o.toasts.get(t)};function at(t,e){var o;if(e)return!!((o=w.get(e))!=null&&o.isToastActive(t));let r=!1;return w.forEach(n=>{n.isToastActive(t)&&(r=!0)}),r}function vt(t){if(!ot()){A=A.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||ft(t))w.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=w.get(t.containerId);e?e.removeToast(t.id):w.forEach(o=>{o.removeToast(t.id)})}}var bt=(t={})=>{w.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function st(t,e){Y(t)&&(ot()||A.push({content:t,options:e}),w.forEach(o=>{o.buildToast(t,e)}))}function Tt(t){var e;(e=w.get(t.containerId||1))==null||e.setToggle(t.id,t.fn)}function rt(t,e){w.forEach(o=>{(e==null||!(e!=null&&e.containerId)||(e==null?void 0:e.containerId)===o.id)&&o.toggle(t,e==null?void 0:e.id)})}function ht(t){let e=t.containerId||1;return{subscribe(o){let r=mt(e,t,pt);w.set(e,r);let n=r.observe(o);return _t(),()=>{n(),w.delete(e)}},setProps(o){var r;(r=w.get(e))==null||r.setProps(o)},getSnapshot(){var o;return(o=w.get(e))==null?void 0:o.getSnapshot()}}}function xt(t){return Q.add(t),()=>{Q.delete(t)}}function kt(t){return t&&(D(t.toastId)||N(t.toastId))?t.toastId:et()}function M(t,e){return st(t,e),e.toastId}function U(t,e){return{...e,type:e&&e.type||t,toastId:kt(e)}}function H(t){return(e,o)=>M(e,U(t,o))}function g(t,e){return M(t,U("default",e))}g.loading=(t,e)=>M(t,U("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function Et(t,{pending:e,error:o,success:r},n){let f;e&&(f=D(e)?g.loading(e,n):g.loading(e.render,{...n,...e}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(m,v,x)=>{if(v==null){g.dismiss(f);return}let E={type:m,...a,...n,data:x},k=D(v)?{render:v}:v;return f?g.update(f,{...E,...k}):g(k.render,{...E,...k}),x},c=$(t)?t():t;return c.then(m=>u("success",r,m)).catch(m=>u("error",o,m)),c}g.promise=Et;g.success=H("success");g.info=H("info");g.error=H("error");g.warning=H("warning");g.warn=g.warning;g.dark=(t,e)=>M(t,U("default",{theme:"dark",...e}));function wt(t){vt(t)}g.dismiss=wt;g.clearWaitingQueue=bt;g.isActive=at;g.update=(t,e={})=>{let o=gt(t,e);if(o){let{props:r,content:n}=o,f={delay:100,...r,...e,toastId:e.toastId||t,updateId:et()};f.toastId!==t&&(f.staleId=t);let a=f.render||n;delete f.render,M(a,f)}};g.done=t=>{g.update(t,{progress:1})};g.onChange=xt;g.play=t=>rt(!0,t);g.pause=t=>rt(!1,t);function It(t){var e;let{subscribe:o,getSnapshot:r,setProps:n}=i.useRef(ht(t)).current;n(t);let f=(e=i.useSyncExternalStore(o,r,r))==null?void 0:e.slice();function a(u){if(!f)return[];let c=new Map;return t.newestOnTop&&f.reverse(),f.forEach(m=>{let{position:v}=m.props;c.has(v)||c.set(v,[]),c.get(v).push(m)}),Array.from(c,m=>u(m[0],m[1]))}return{getToastToRender:a,isToastActive:at,count:f==null?void 0:f.length}}function Ct(t){let[e,o]=i.useState(!1),[r,n]=i.useState(!1),f=i.useRef(null),a=i.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:u,pauseOnHover:c,closeToast:m,onClick:v,closeOnClick:x}=t;Tt({id:t.toastId,containerId:t.containerId,fn:o}),i.useEffect(()=>{if(t.pauseOnFocusLoss)return E(),()=>{k()}},[t.pauseOnFocusLoss]);function E(){document.hasFocus()||p(),window.addEventListener("focus",_),window.addEventListener("blur",p)}function k(){window.removeEventListener("focus",_),window.removeEventListener("blur",p)}function I(y){if(t.draggable===!0||t.draggable===y.pointerType){s();let b=f.current;a.canCloseOnClick=!0,a.canDrag=!0,b.style.transition="none",t.draggableDirection==="x"?(a.start=y.clientX,a.removalDistance=b.offsetWidth*(t.draggablePercent/100)):(a.start=y.clientY,a.removalDistance=b.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100)}}function T(y){let{top:b,bottom:L,left:O,right:z}=f.current.getBoundingClientRect();y.pointerType==="mouse"&&t.pauseOnHover&&y.clientX>=O&&y.clientX<=z&&y.clientY>=b&&y.clientY<=L?p():_()}function _(){o(!0)}function p(){o(!1)}function s(){a.didMove=!1,document.addEventListener("pointermove",d),document.addEventListener("pointerup",h)}function l(){document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",h)}function d(y){let b=f.current;if(a.canDrag&&b){a.didMove=!0,e&&p(),t.draggableDirection==="x"?a.delta=y.clientX-a.start:a.delta=y.clientY-a.start,a.start!==y.clientX&&(a.canCloseOnClick=!1);let L=t.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`;b.style.transform=`translate3d(${L},0)`,b.style.opacity=`${1-Math.abs(a.delta/a.removalDistance)}`}}function h(){l();let y=f.current;if(a.canDrag&&a.didMove&&y){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance){n(!0),t.closeToast(!0),t.collapseAll();return}y.style.transition="transform 0.2s, opacity 0.2s",y.style.removeProperty("transform"),y.style.removeProperty("opacity")}}let C={onPointerDown:I,onPointerUp:T};return u&&c&&(C.onMouseEnter=p,t.stacked||(C.onMouseLeave=_)),x&&(C.onClick=y=>{v&&v(y),a.canCloseOnClick&&m(!0)}),{playToast:_,pauseToast:p,isRunning:e,preventExitTransition:r,toastRef:f,eventHandlers:C}}var nt=typeof window<"u"?i.useLayoutEffect:i.useEffect,q=({theme:t,type:e,isLoading:o,...r})=>i.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${e})`,...r});function Lt(t){return i.createElement(q,{...t},i.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function Ot(t){return i.createElement(q,{...t},i.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function zt(t){return i.createElement(q,{...t},i.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function $t(t){return i.createElement(q,{...t},i.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function Pt(){return i.createElement("div",{className:"Toastify__spinner"})}var X={info:Ot,warning:Lt,success:zt,error:$t,spinner:Pt},Rt=t=>t in X;function Dt({theme:t,type:e,isLoading:o,icon:r}){let n=null,f={theme:t,type:e};return r===!1||($(r)?n=r({...f,isLoading:o}):i.isValidElement(r)?n=i.cloneElement(r,f):o?n=X.spinner():Rt(e)&&(n=X[e](f))),n}var At=t=>{let{isRunning:e,preventExitTransition:o,toastRef:r,eventHandlers:n,playToast:f}=Ct(t),{closeButton:a,children:u,autoClose:c,onClick:m,type:v,hideProgressBar:x,closeToast:E,transition:k,position:I,className:T,style:_,progressClassName:p,updateId:s,role:l,progress:d,rtl:h,toastId:C,deleteToast:y,isIn:b,isLoading:L,closeOnClick:O,theme:z,ariaLabel:S}=t,P=R.clsx("Toastify__toast",`Toastify__toast-theme--${z}`,`Toastify__toast--${v}`,{"Toastify__toast--rtl":h},{"Toastify__toast--close-on-click":O}),lt=$(T)?T({rtl:h,position:I,type:v,defaultClassName:P}):R.clsx(P,T),V=Dt(t),j=!!d||!c,F={closeToast:E,type:v,theme:z},B=null;return a===!1||($(a)?B=a(F):i.isValidElement(a)?B=i.cloneElement(a,F):B=dt(F)),i.createElement(k,{isIn:b,done:y,position:I,preventExitTransition:o,nodeRef:r,playToast:f},i.createElement("div",{id:C,tabIndex:0,onClick:m,"data-in":b,className:lt,...n,style:_,ref:r,...b&&{role:l,"aria-label":S}},V!=null&&i.createElement("div",{className:R.clsx("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!L})},V),tt(u,t,!e),B,!t.customProgressBar&&i.createElement(ut,{...s&&!j?{key:`p-${s}`}:{},rtl:h,theme:z,delay:c,isRunning:e,isIn:b,closeToast:E,hide:x,type:v,className:p,controlledProgress:j,progress:d||0})))},Nt=(t,e=!1)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}),it=Z(Nt("bounce",!0)),Mt={position:"top-right",transition:it,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function St(t){let e={...Mt,...t},o=t.stacked,[r,n]=i.useState(!0),f=i.useRef(null),{getToastToRender:a,isToastActive:u,count:c}=It(e),{className:m,style:v,rtl:x,containerId:E,hotKeys:k}=e;function I(_){let p=R.clsx("Toastify__toast-container",`Toastify__toast-container--${_}`,{"Toastify__toast-container--rtl":x});return $(m)?m({position:_,rtl:x,defaultClassName:p}):R.clsx(p,K(m))}function T(){o&&(n(!0),g.play())}return nt(()=>{var _;if(o){let p=f.current.querySelectorAll('[data-in="true"]'),s=12,l=(_=e.position)==null?void 0:_.includes("top"),d=0,h=0;Array.from(p).reverse().forEach((C,y)=>{let b=C;b.classList.add("Toastify__toast--stacked"),y>0&&(b.dataset.collapsed=`${r}`),b.dataset.pos||(b.dataset.pos=l?"top":"bot");let L=d*(r?.2:1)+(r?0:s*y),O=Math.max(.5,1-(r?h:0));b.style.setProperty("--y",`${l?L:L*-1}px`),b.style.setProperty("--g",`${s}`),b.style.setProperty("--s",`${O}`),d+=b.offsetHeight,h+=.025})}},[r,c,o]),i.useEffect(()=>{function _(p){var s;let l=f.current;k(p)&&((s=l==null?void 0:l.querySelector('[tabIndex="0"]'))==null||s.focus(),n(!1),g.pause()),p.key==="Escape"&&(document.activeElement===l||l!=null&&l.contains(document.activeElement))&&(n(!0),g.play())}return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}},[k]),i.createElement("section",{ref:f,className:"Toastify",id:E,onMouseEnter:()=>{o&&(n(!1),g.pause())},onMouseLeave:T,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":e["aria-label"]},a((_,p)=>{let s=p.length?{...v}:{...v,pointerEvents:"none"};return i.createElement("div",{tabIndex:-1,className:I(_),"data-stacked":o,style:s,key:`c-${_}`},p.map(({content:l,props:d})=>i.createElement(At,{...d,stacked:o,collapseAll:T,isIn:u(d.toastId,d.containerId),key:`t-${d.key}`},l)))}))}var Bt=`:root {
|
|
2
2
|
--toastify-color-light: #fff;
|
|
3
3
|
--toastify-color-dark: #121212;
|
|
4
4
|
--toastify-color-info: #3498db;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import b, { isValidElement as U, useLayoutEffect as at, useEffect as H, useState as Q, useRef as N, useSyncExternalStore as yt, cloneElement as J } from "react";
|
|
2
2
|
import { clsx as D } from "../../clsx/dist/clsx.js";
|
|
3
|
-
var
|
|
3
|
+
var M = (t) => typeof t == "number" && !isNaN(t), A = (t) => typeof t == "string", $ = (t) => typeof t == "function", ut = (t) => A(t) || M(t), W = (t) => A(t) || $(t) ? t : null, mt = (t, e) => t === !1 || M(t) && t > 0 ? t : e, j = (t) => U(t) || A(t) || $(t) || M(t);
|
|
4
4
|
function pt(t, e, o = 300) {
|
|
5
5
|
let { scrollHeight: s, style: n } = t;
|
|
6
6
|
requestAnimationFrame(() => {
|
|
@@ -91,7 +91,7 @@ function Tt(t, e, o) {
|
|
|
91
91
|
} };
|
|
92
92
|
O.closeButton = d.closeButton, i.closeButton === !1 || j(i.closeButton) ? O.closeButton = i.closeButton : i.closeButton === !0 && (O.closeButton = j(d.closeButton) ? d.closeButton : !0);
|
|
93
93
|
let z = { content: r, props: O, staleId: y };
|
|
94
|
-
d.limit && d.limit > 0 && n > d.limit && L ? l.push(z) :
|
|
94
|
+
d.limit && d.limit > 0 && n > d.limit && L ? l.push(z) : M(v) ? setTimeout(() => {
|
|
95
95
|
m(z);
|
|
96
96
|
}, v) : m(z);
|
|
97
97
|
}, setProps(r) {
|
|
@@ -104,9 +104,9 @@ function Tt(t, e, o) {
|
|
|
104
104
|
return (i = f.get(r)) == null ? void 0 : i.isActive;
|
|
105
105
|
}, getSnapshot: () => a };
|
|
106
106
|
}
|
|
107
|
-
var E = /* @__PURE__ */ new Map(),
|
|
107
|
+
var E = /* @__PURE__ */ new Map(), R = [], G = /* @__PURE__ */ new Set(), ht = (t) => G.forEach((e) => e(t)), nt = () => E.size > 0;
|
|
108
108
|
function xt() {
|
|
109
|
-
|
|
109
|
+
R.forEach((t) => lt(t.content, t.options)), R = [];
|
|
110
110
|
}
|
|
111
111
|
var kt = (t, { containerId: e }) => {
|
|
112
112
|
var o;
|
|
@@ -122,7 +122,7 @@ function it(t, e) {
|
|
|
122
122
|
}
|
|
123
123
|
function wt(t) {
|
|
124
124
|
if (!nt()) {
|
|
125
|
-
|
|
125
|
+
R = R.filter((e) => t != null && e.options.toastId !== t);
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
128
|
if (t == null || ut(t)) E.forEach((e) => {
|
|
@@ -141,7 +141,7 @@ var Et = (t = {}) => {
|
|
|
141
141
|
});
|
|
142
142
|
};
|
|
143
143
|
function lt(t, e) {
|
|
144
|
-
j(t) && (nt() ||
|
|
144
|
+
j(t) && (nt() || R.push({ content: t, options: e }), E.forEach((o) => {
|
|
145
145
|
o.buildToast(t, e);
|
|
146
146
|
}));
|
|
147
147
|
}
|
|
@@ -177,7 +177,7 @@ function Lt(t) {
|
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
function Ot(t) {
|
|
180
|
-
return t && (A(t.toastId) ||
|
|
180
|
+
return t && (A(t.toastId) || M(t.toastId)) ? t.toastId : st();
|
|
181
181
|
}
|
|
182
182
|
function B(t, e) {
|
|
183
183
|
return lt(t, e), e.toastId;
|
|
@@ -315,16 +315,16 @@ function At(t) {
|
|
|
315
315
|
function Nt(t) {
|
|
316
316
|
return b.createElement(K, { ...t }, b.createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" }));
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Rt(t) {
|
|
319
319
|
return b.createElement(K, { ...t }, b.createElement("path", { d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z" }));
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Mt(t) {
|
|
322
322
|
return b.createElement(K, { ...t }, b.createElement("path", { d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" }));
|
|
323
323
|
}
|
|
324
324
|
function Bt() {
|
|
325
325
|
return b.createElement("div", { className: "Toastify__spinner" });
|
|
326
326
|
}
|
|
327
|
-
var V = { info: Nt, warning: At, success:
|
|
327
|
+
var V = { info: Nt, warning: At, success: Rt, error: Mt, spinner: Bt }, St = (t) => t in V;
|
|
328
328
|
function Xt({ theme: t, type: e, isLoading: o, icon: s }) {
|
|
329
329
|
let n = null, l = { theme: t, type: e };
|
|
330
330
|
return s === !1 || ($(s) ? n = s({ ...l, isLoading: o }) : U(s) ? n = J(s, l) : o ? n = V.spinner() : St(e) && (n = V[e](l))), n;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import "./jsonviewer.css";
|
|
2
|
+
export interface JsonEditorProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange?: (value: string) => void;
|
|
5
|
+
expandAllLabel: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
height?: string | number;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
isReadOnly?: boolean;
|
|
10
|
+
"aria-label"?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Editable sibling of `JsonViewer`: same CodeMirror-based visual (syntax
|
|
14
|
+
* colors, gutter, scrollbar, border/background) but with typing enabled.
|
|
15
|
+
* `JsonViewer` stays read-only-only on purpose so its bundle keeps assuming
|
|
16
|
+
* a static document; this component owns the editable/controlled behavior.
|
|
17
|
+
*/
|
|
18
|
+
export declare function JsonEditor({ value, onChange, expandAllLabel, className, height, isDisabled, isReadOnly, "aria-label": ariaLabel, }: JsonEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HighlightStyle } from "@codemirror/language";
|
|
2
|
+
export declare const jsonHighlightStyle: HighlightStyle;
|
|
3
|
+
export declare const jsonEditorTheme: import("@codemirror/state").Extension;
|
|
4
|
+
export declare const jsonEditorExtensions: import("@codemirror/state").Extension[];
|
|
5
|
+
export declare function serializeJson(value: unknown): string;
|
|
6
|
+
export declare function toCssSize(size: string | number): string;
|
|
7
|
+
/**
|
|
8
|
+
* Finds the fold range of every direct child (depth 1) of the root object/array
|
|
9
|
+
* by scanning the text itself for matching brackets. This mirrors what
|
|
10
|
+
* CodeMirror's `foldable()` would compute, but doesn't depend on the lezer
|
|
11
|
+
* parser having finished tokenizing the document — which for a multi-MB
|
|
12
|
+
* document is not guaranteed synchronously at mount time.
|
|
13
|
+
*/
|
|
14
|
+
export declare function computeFirstLevelFoldRanges(text: string): {
|
|
15
|
+
from: number;
|
|
16
|
+
to: number;
|
|
17
|
+
}[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonProps, DescriptionProps, KeyboardProps, LabelProps, type TextHeadingProps } from "primitives";
|
|
2
|
-
import
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { type MenuItemProps as RACMenuItemProps, type MenuProps as RACMenuProps, type MenuTriggerProps as RACMenuTriggerProps, type PopoverProps as RACPopoverProps, type SeparatorProps as RACSeparatorProps } from "react-aria-components";
|
|
4
4
|
import "./menu.css";
|
|
5
5
|
export type MenuProps<T> = RACMenuProps<T>;
|
|
@@ -16,5 +16,25 @@ export interface PermissionGateProps {
|
|
|
16
16
|
* When allowed, renders the trigger directly with no wrapper.
|
|
17
17
|
* When not allowed, wraps in a DS Tooltip with hover trigger.
|
|
18
18
|
* A `<span>` wrapper ensures disabled elements still receive pointer events.
|
|
19
|
+
*
|
|
20
|
+
* Dentro de coleções do react-aria-components (`Menu`, `ListBox`, `Table`,
|
|
21
|
+
* `Tree`) o gate vai NO CONTEÚDO do nó, nunca em volta dele:
|
|
22
|
+
*
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // ERRADO — o react-aria descarta esse item e os seguintes, e o menu abre
|
|
25
|
+
* // vazio se ele for o primeiro. Sem erro no console.
|
|
26
|
+
* <PermissionGate …><MenuItem>…</MenuItem></PermissionGate>
|
|
27
|
+
*
|
|
28
|
+
* // CERTO
|
|
29
|
+
* <MenuItem isDisabled={!allowed}>
|
|
30
|
+
* <PermissionGate …><span>…</span></PermissionGate>
|
|
31
|
+
* </MenuItem>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* O collection builder só reconhece nós de coleção; o `<span>` do ramo negado
|
|
35
|
+
* entra na coleção com `node` nulo e quebra a lista encadeada de chaves. Já o
|
|
36
|
+
* conteúdo de um nó é renderizado no DOM real, fora da coleção, e por isso é
|
|
37
|
+
* seguro — é onde o `DataTable` põe o gate nas ações de linha. O `Menu` avisa no
|
|
38
|
+
* console em desenvolvimento se o gate aparecer em volta de um item.
|
|
19
39
|
*/
|
|
20
40
|
export declare function PermissionGate({ isAllowed, noAccessLabel, children, }: PermissionGateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SharedFieldProps } from "primitives";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { type Key as RACKey } from "react-aria-components";
|
|
4
|
+
import "./select.css";
|
|
5
|
+
export interface MultiSelectFieldProps extends SharedFieldProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
selectedKeys: Iterable<RACKey>;
|
|
8
|
+
onSelectionChange: (keys: Set<RACKey>) => void;
|
|
9
|
+
className?: string;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
isInvalid?: boolean;
|
|
12
|
+
disallowEmptySelection?: boolean;
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function MultiSelectField({ className, label, description, errorMessage, placeholder, children, selectedKeys, onSelectionChange, isDisabled, isInvalid, disallowEmptySelection, "aria-label": ariaLabel, }: MultiSelectFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -26,6 +26,7 @@ export * from "./Notification/Notification";
|
|
|
26
26
|
export * from "./Pagination/Pagination";
|
|
27
27
|
export * from "./Radio/Radio";
|
|
28
28
|
export * from "./Search/Search";
|
|
29
|
+
export * from "./Select/MultiSelect";
|
|
29
30
|
export * from "./Select/Select";
|
|
30
31
|
export * from "./Slider/Slider";
|
|
31
32
|
export * from "./SplitButton/SplitButton";
|