tcce-design-system 0.1.16 → 0.1.17
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.
|
@@ -6534,7 +6534,7 @@ const $p = {
|
|
|
6534
6534
|
}
|
|
6535
6535
|
), qp = C.span`
|
|
6536
6536
|
${({ $size: e }) => F[e]}
|
|
6537
|
-
color: ${({ $color: e }) => e || "var(--color-main-
|
|
6537
|
+
color: ${({ $color: e }) => e || "var(--color-main-grey)"};
|
|
6538
6538
|
`, p1 = ({
|
|
6539
6539
|
children: e,
|
|
6540
6540
|
size: t = 16,
|
|
@@ -454,7 +454,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[Pn]+=1);const yr={80:S`
|
|
|
454
454
|
`}
|
|
455
455
|
`,Qm=({orientation:e="horizontal",color:t="var(--color-dark-300)",length:n,thickness:r,className:o=""})=>p.jsx(Jm,{$orientation:e,$color:t,$length:n,$thickness:r,className:o,role:"separator","aria-orientation":e}),eg=T.span`
|
|
456
456
|
${({$size:e})=>F[e]}
|
|
457
|
-
color: ${({$color:e})=>e||"var(--color-main-
|
|
457
|
+
color: ${({$color:e})=>e||"var(--color-main-grey)"};
|
|
458
458
|
`,tg=({children:e,size:t=16,color:n,className:r,style:o})=>p.jsx(eg,{$size:t,$color:n,className:r,style:o,children:e});function ng(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const rg=e=>{switch(e){case"success":return sg;case"info":return lg;case"warning":return ag;case"error":return cg;default:return null}},og=Array(12).fill(0),ig=({visible:e,className:t})=>f.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},f.createElement("div",{className:"sonner-spinner"},og.map((n,r)=>f.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),sg=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ag=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),lg=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),cg=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},f.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),dg=f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},f.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),f.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ug=()=>{const[e,t]=f.useState(document.hidden);return f.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Oo=1;class hg{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...o}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Oo++,i=this.toasts.find(c=>c.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:r}),{...c,...t,id:s,dismissible:a,title:r}):c):this.addToast({title:r,...o,dismissible:a,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,i;const a=o.then(async d=>{if(i=["resolve",d],f.isValidElement(d))s=!1,this.create({id:r,type:"default",message:d});else if(pg(d)&&!d.ok){s=!1;const l=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,g=typeof l=="object"&&!f.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:h,...g})}else if(d instanceof Error){s=!1;const l=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,g=typeof l=="object"&&!f.isValidElement(l)?l:{message:l};this.create({id:r,type:"error",description:h,...g})}else if(n.success!==void 0){s=!1;const l=typeof n.success=="function"?await n.success(d):n.success,h=typeof n.description=="function"?await n.description(d):n.description,g=typeof l=="object"&&!f.isValidElement(l)?l:{message:l};this.create({id:r,type:"success",description:h,...g})}}).catch(async d=>{if(i=["reject",d],n.error!==void 0){s=!1;const u=typeof n.error=="function"?await n.error(d):n.error,l=typeof n.description=="function"?await n.description(d):n.description,m=typeof u=="object"&&!f.isValidElement(u)?u:{message:u};this.create({id:r,type:"error",description:l,...m})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),c=()=>new Promise((d,u)=>a.then(()=>i[0]==="reject"?u(i[1]):d(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{const r=n?.id||Oo++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ye=new hg,fg=(e,t)=>{const n=t?.id||Oo++;return ye.addToast({title:e,...t,id:n}),n},pg=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",mg=fg,gg=()=>ye.toasts,yg=()=>ye.getActiveToasts(),vg=Object.assign(mg,{success:ye.success,info:ye.info,warning:ye.warning,error:ye.error,custom:ye.custom,message:ye.message,promise:ye.promise,dismiss:ye.dismiss,loading:ye.loading},{getHistory:gg,getToasts:yg});ng("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Kn(e){return e.label!==void 0}const bg=3,wg="24px",xg="16px",Yl=4e3,Sg=356,Cg=14,Tg=45,kg=200;function Be(...e){return e.filter(Boolean).join(" ")}function Pg(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Eg=e=>{var t,n,r,o,s,i,a,c,d;const{invert:u,toast:l,unstyled:h,interacting:m,setHeights:g,visibleToasts:v,heights:b,index:y,toasts:x,expanded:w,removeToast:A,defaultRichColors:P,closeButton:k,style:E,cancelButtonStyle:D,actionButtonStyle:I,className:_="",descriptionClassName:$="",duration:Y,position:K,gap:Pe,expandByDefault:re,classNames:j,icons:L,closeButtonAriaLabel:R="Close toast"}=e,[V,z]=f.useState(null),[oe,ie]=f.useState(null),[O,q]=f.useState(!1),[G,ae]=f.useState(!1),[Me,H]=f.useState(!1),[ve,Je]=f.useState(!1),[_e,pe]=f.useState(!1),[Yy,oi]=f.useState(0),[Gy,Oc]=f.useState(0),an=f.useRef(l.duration||Y||Yl),Fc=f.useRef(null),He=f.useRef(null),Xy=y===0,qy=y+1<=v,be=l.type,Ot=l.dismissible!==!1,Zy=l.className||"",Jy=l.descriptionClassName||"",Zn=f.useMemo(()=>b.findIndex(N=>N.toastId===l.id)||0,[b,l.id]),Qy=f.useMemo(()=>{var N;return(N=l.closeButton)!=null?N:k},[l.closeButton,k]),jc=f.useMemo(()=>l.duration||Y||Yl,[l.duration,Y]),ii=f.useRef(0),Ft=f.useRef(0),zc=f.useRef(0),jt=f.useRef(null),[ev,tv]=K.split("-"),Rc=f.useMemo(()=>b.reduce((N,le,he)=>he>=Zn?N:N+le.height,0),[b,Zn]),_c=ug(),nv=l.invert||u,si=be==="loading";Ft.current=f.useMemo(()=>Zn*Pe+Rc,[Zn,Rc]),f.useEffect(()=>{an.current=jc},[jc]),f.useEffect(()=>{q(!0)},[]),f.useEffect(()=>{const N=He.current;if(N){const le=N.getBoundingClientRect().height;return Oc(le),g(he=>[{toastId:l.id,height:le,position:l.position},...he]),()=>g(he=>he.filter(we=>we.toastId!==l.id))}},[g,l.id]),f.useLayoutEffect(()=>{if(!O)return;const N=He.current,le=N.style.height;N.style.height="auto";const he=N.getBoundingClientRect().height;N.style.height=le,Oc(he),g(we=>we.find(de=>de.toastId===l.id)?we.map(de=>de.toastId===l.id?{...de,height:he}:de):[{toastId:l.id,height:he,position:l.position},...we])},[O,l.title,l.description,g,l.id,l.jsx,l.action,l.cancel]);const Qe=f.useCallback(()=>{ae(!0),oi(Ft.current),g(N=>N.filter(le=>le.toastId!==l.id)),setTimeout(()=>{A(l)},kg)},[l,A,g,Ft]);f.useEffect(()=>{if(l.promise&&be==="loading"||l.duration===1/0||l.type==="loading")return;let N;return w||m||_c?(()=>{if(zc.current<ii.current){const we=new Date().getTime()-ii.current;an.current=an.current-we}zc.current=new Date().getTime()})():(()=>{an.current!==1/0&&(ii.current=new Date().getTime(),N=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),Qe()},an.current))})(),()=>clearTimeout(N)},[w,m,l,be,_c,Qe]),f.useEffect(()=>{l.delete&&(Qe(),l.onDismiss==null||l.onDismiss.call(l,l))},[Qe,l.delete]);function rv(){var N;if(L?.loading){var le;return f.createElement("div",{className:Be(j?.loader,l==null||(le=l.classNames)==null?void 0:le.loader,"sonner-loader"),"data-visible":be==="loading"},L.loading)}return f.createElement(ig,{className:Be(j?.loader,l==null||(N=l.classNames)==null?void 0:N.loader),visible:be==="loading"})}const ov=l.icon||L?.[be]||rg(be);var Hc,Uc;return f.createElement("li",{tabIndex:0,ref:He,className:Be(_,Zy,j?.toast,l==null||(t=l.classNames)==null?void 0:t.toast,j?.default,j?.[be],l==null||(n=l.classNames)==null?void 0:n[be]),"data-sonner-toast":"","data-rich-colors":(Hc=l.richColors)!=null?Hc:P,"data-styled":!(l.jsx||l.unstyled||h),"data-mounted":O,"data-promise":!!l.promise,"data-swiped":_e,"data-removed":G,"data-visible":qy,"data-y-position":ev,"data-x-position":tv,"data-index":y,"data-front":Xy,"data-swiping":Me,"data-dismissible":Ot,"data-type":be,"data-invert":nv,"data-swipe-out":ve,"data-swipe-direction":oe,"data-expanded":!!(w||re&&O),"data-testid":l.testId,style:{"--index":y,"--toasts-before":y,"--z-index":x.length-y,"--offset":`${G?Yy:Ft.current}px`,"--initial-height":re?"auto":`${Gy}px`,...E,...l.style},onDragEnd:()=>{H(!1),z(null),jt.current=null},onPointerDown:N=>{N.button!==2&&(si||!Ot||(Fc.current=new Date,oi(Ft.current),N.target.setPointerCapture(N.pointerId),N.target.tagName!=="BUTTON"&&(H(!0),jt.current={x:N.clientX,y:N.clientY})))},onPointerUp:()=>{var N,le,he;if(ve||!Ot)return;jt.current=null;const we=Number(((N=He.current)==null?void 0:N.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jn=Number(((le=He.current)==null?void 0:le.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),de=new Date().getTime()-((he=Fc.current)==null?void 0:he.getTime()),Ee=V==="x"?we:Jn,Qn=Math.abs(Ee)/de;if(Math.abs(Ee)>=Tg||Qn>.11){oi(Ft.current),l.onDismiss==null||l.onDismiss.call(l,l),ie(V==="x"?we>0?"right":"left":Jn>0?"down":"up"),Qe(),Je(!0);return}else{var Ve,Ie;(Ve=He.current)==null||Ve.style.setProperty("--swipe-amount-x","0px"),(Ie=He.current)==null||Ie.style.setProperty("--swipe-amount-y","0px")}pe(!1),H(!1),z(null)},onPointerMove:N=>{var le,he,we;if(!jt.current||!Ot||((le=window.getSelection())==null?void 0:le.toString().length)>0)return;const de=N.clientY-jt.current.y,Ee=N.clientX-jt.current.x;var Qn;const Ve=(Qn=e.swipeDirections)!=null?Qn:Pg(K);!V&&(Math.abs(Ee)>1||Math.abs(de)>1)&&z(Math.abs(Ee)>Math.abs(de)?"x":"y");let Ie={x:0,y:0};const Wc=pt=>1/(1.5+Math.abs(pt)/20);if(V==="y"){if(Ve.includes("top")||Ve.includes("bottom"))if(Ve.includes("top")&&de<0||Ve.includes("bottom")&&de>0)Ie.y=de;else{const pt=de*Wc(de);Ie.y=Math.abs(pt)<Math.abs(de)?pt:de}}else if(V==="x"&&(Ve.includes("left")||Ve.includes("right")))if(Ve.includes("left")&&Ee<0||Ve.includes("right")&&Ee>0)Ie.x=Ee;else{const pt=Ee*Wc(Ee);Ie.x=Math.abs(pt)<Math.abs(Ee)?pt:Ee}(Math.abs(Ie.x)>0||Math.abs(Ie.y)>0)&&pe(!0),(he=He.current)==null||he.style.setProperty("--swipe-amount-x",`${Ie.x}px`),(we=He.current)==null||we.style.setProperty("--swipe-amount-y",`${Ie.y}px`)}},Qy&&!l.jsx&&be!=="loading"?f.createElement("button",{"aria-label":R,"data-disabled":si,"data-close-button":!0,onClick:si||!Ot?()=>{}:()=>{Qe(),l.onDismiss==null||l.onDismiss.call(l,l)},className:Be(j?.closeButton,l==null||(r=l.classNames)==null?void 0:r.closeButton)},(Uc=L?.close)!=null?Uc:dg):null,(be||l.icon||l.promise)&&l.icon!==null&&(L?.[be]!==null||l.icon)?f.createElement("div",{"data-icon":"",className:Be(j?.icon,l==null||(o=l.classNames)==null?void 0:o.icon)},l.promise||l.type==="loading"&&!l.icon?l.icon||rv():null,l.type!=="loading"?ov:null):null,f.createElement("div",{"data-content":"",className:Be(j?.content,l==null||(s=l.classNames)==null?void 0:s.content)},f.createElement("div",{"data-title":"",className:Be(j?.title,l==null||(i=l.classNames)==null?void 0:i.title)},l.jsx?l.jsx:typeof l.title=="function"?l.title():l.title),l.description?f.createElement("div",{"data-description":"",className:Be($,Jy,j?.description,l==null||(a=l.classNames)==null?void 0:a.description)},typeof l.description=="function"?l.description():l.description):null),f.isValidElement(l.cancel)?l.cancel:l.cancel&&Kn(l.cancel)?f.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||D,onClick:N=>{Kn(l.cancel)&&Ot&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,N),Qe())},className:Be(j?.cancelButton,l==null||(c=l.classNames)==null?void 0:c.cancelButton)},l.cancel.label):null,f.isValidElement(l.action)?l.action:l.action&&Kn(l.action)?f.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||I,onClick:N=>{Kn(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,N),!N.defaultPrevented&&Qe())},className:Be(j?.actionButton,l==null||(d=l.classNames)==null?void 0:d.actionButton)},l.action.label):null)};function Gl(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Ag(e,t){const n={};return[e,t].forEach((r,o)=>{const s=o===1,i=s?"--mobile-offset":"--offset",a=s?xg:wg;function c(d){["top","right","bottom","left"].forEach(u=>{n[`${i}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${i}-${d}`]=a:n[`${i}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(a)}),n}const Dg=f.forwardRef(function(t,n){const{id:r,invert:o,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:c,className:d,offset:u,mobileOffset:l,theme:h="light",richColors:m,duration:g,style:v,visibleToasts:b=bg,toastOptions:y,dir:x=Gl(),gap:w=Cg,icons:A,containerAriaLabel:P="Notifications"}=t,[k,E]=f.useState([]),D=f.useMemo(()=>r?k.filter(O=>O.toasterId===r):k.filter(O=>!O.toasterId),[k,r]),I=f.useMemo(()=>Array.from(new Set([s].concat(D.filter(O=>O.position).map(O=>O.position)))),[D,s]),[_,$]=f.useState([]),[Y,K]=f.useState(!1),[Pe,re]=f.useState(!1),[j,L]=f.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),R=f.useRef(null),V=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=f.useRef(null),oe=f.useRef(!1),ie=f.useCallback(O=>{E(q=>{var G;return(G=q.find(ae=>ae.id===O.id))!=null&&G.delete||ye.dismiss(O.id),q.filter(({id:ae})=>ae!==O.id)})},[]);return f.useEffect(()=>ye.subscribe(O=>{if(O.dismiss){requestAnimationFrame(()=>{E(q=>q.map(G=>G.id===O.id?{...G,delete:!0}:G))});return}setTimeout(()=>{ai.flushSync(()=>{E(q=>{const G=q.findIndex(ae=>ae.id===O.id);return G!==-1?[...q.slice(0,G),{...q[G],...O},...q.slice(G+1)]:[O,...q]})})})}),[k]),f.useEffect(()=>{if(h!=="system"){L(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;const O=window.matchMedia("(prefers-color-scheme: dark)");try{O.addEventListener("change",({matches:q})=>{L(q?"dark":"light")})}catch{O.addListener(({matches:G})=>{try{L(G?"dark":"light")}catch(ae){console.error(ae)}})}},[h]),f.useEffect(()=>{k.length<=1&&K(!1)},[k]),f.useEffect(()=>{const O=q=>{var G;if(i.every(H=>q[H]||q.code===H)){var Me;K(!0),(Me=R.current)==null||Me.focus()}q.code==="Escape"&&(document.activeElement===R.current||(G=R.current)!=null&&G.contains(document.activeElement))&&K(!1)};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[i]),f.useEffect(()=>{if(R.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,oe.current=!1)}},[R.current]),f.createElement("section",{ref:n,"aria-label":`${P} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},I.map((O,q)=>{var G;const[ae,Me]=O.split("-");return D.length?f.createElement("ol",{key:O,dir:x==="auto"?Gl():x,tabIndex:-1,ref:R,className:d,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":ae,"data-x-position":Me,style:{"--front-toast-height":`${((G=_[0])==null?void 0:G.height)||0}px`,"--width":`${Sg}px`,"--gap":`${w}px`,...v,...Ag(u,l)},onBlur:H=>{oe.current&&!H.currentTarget.contains(H.relatedTarget)&&(oe.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||oe.current||(oe.current=!0,z.current=H.relatedTarget)},onMouseEnter:()=>K(!0),onMouseMove:()=>K(!0),onMouseLeave:()=>{Pe||K(!1)},onDragEnd:()=>K(!1),onPointerDown:H=>{H.target instanceof HTMLElement&&H.target.dataset.dismissible==="false"||re(!0)},onPointerUp:()=>re(!1)},D.filter(H=>!H.position&&q===0||H.position===O).map((H,ve)=>{var Je,_e;return f.createElement(Eg,{key:H.id,icons:A,index:ve,toast:H,defaultRichColors:m,duration:(Je=y?.duration)!=null?Je:g,className:y?.className,descriptionClassName:y?.descriptionClassName,invert:o,visibleToasts:b,closeButton:(_e=y?.closeButton)!=null?_e:c,interacting:Pe,position:O,style:y?.style,unstyled:y?.unstyled,classNames:y?.classNames,cancelButtonStyle:y?.cancelButtonStyle,actionButtonStyle:y?.actionButtonStyle,closeButtonAriaLabel:y?.closeButtonAriaLabel,removeToast:ie,toasts:D.filter(pe=>pe.position==H.position),heights:_.filter(pe=>pe.position==H.position),setHeights:$,expandByDefault:a,gap:w,expanded:Y,swipeDirections:t.swipeDirections})})):null}))}),$g=({spinnerColor:e="orange",...t})=>p.jsx(Dg,{position:"bottom-center",theme:"light",richColors:!0,visibleToasts:3,closeButton:!0,duration:3e3,mobileOffset:{bottom:"16px"},toastOptions:{className:"my-toast"},icons:{loading:p.jsx(Kl,{color:e})},...t}),Mg={elevated:S`
|
|
459
459
|
background-color: var(--color-main-white);
|
|
460
460
|
box-shadow: var(--shadow-black-card);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.17",
|
|
7
7
|
"description": "This package provides reusable UI components to ensure consistency across all CRM frontend applications",
|
|
8
8
|
"author": "BizAppsTotal <bizapps@tcce.biz>",
|
|
9
9
|
"type": "module",
|