@vuesimple/vs-toast 3.0.8 → 3.1.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/README.md CHANGED
@@ -19,7 +19,7 @@ A light weight vue plugin built groundup.
19
19
 
20
20
  ### 📺 Live Demo
21
21
 
22
- Code Sandbox: [Link](https://codesandbox.io/s/vs-toast-hti14)
22
+ Demo: [Link](https://vuesimple.netlify.app)
23
23
 
24
24
  <br />
25
25
 
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode(".vs-alert{--vs-alert-success-bc: #aecfc2;--vs-alert-success-bg: #edf8f4;--vs-alert-success-color: #186146;--vs-alert-success-icon: #038153;--vs-alert-warning-bc: #fed6a8;--vs-alert-warning-bg: #fff7ed;--vs-alert-warning-color: #ad5918;--vs-alert-warning-icon: #ad5918;--vs-alert-error-bc: #f5b5ba;--vs-alert-error-bg: #fff0f1;--vs-alert-error-color: #8c232c;--vs-alert-error-icon: #cc3340;--vs-alert-info-bc: #adcce4;--vs-alert-info-bg: #edf7ff;--vs-alert-info-color: #1f73b7;--vs-alert-info-icon: #337fbd;--vs-alert-secondary-bc: #d8dcde;--vs-alert-secondary-bg: #f8f9f9;--vs-alert-secondary-color: #68737d;--vs-alert-secondary-icon: #68737d;position:relative;border-radius:4px;padding:20px 20px 20px 40px;line-height:1.42857;font-size:14px}.vs-alert-icon__wrapper svg{position:absolute;left:15px;margin-top:1px}.vs-alert__heading{font-weight:600;filter:brightness(85%)}.vs-alert-button{display:block;position:absolute;top:15px;right:10px;transition:background-color .1s ease-in-out 0s,color .25s ease-in-out 0s;border:none;background-color:transparent;cursor:pointer;padding:0;width:28px;height:28px;overflow:hidden;color:#333;font-size:0px;user-select:none}.vs-alert-button.success{color:var(--vs-alert-success-color)}.vs-alert-button.warning{color:var(--vs-alert-warning-color)}.vs-alert-button.error{color:var(--vs-alert-error-color)}.vs-alert-button.info{color:var(--vs-alert-info-color)}.vs-alert-button.secondary{color:var(--vs-alert-secondary-color)}.vs-alert-success{border:1px solid var(--vs-alert-success-bc);background-color:var(--vs-alert-success-bg);color:var(--vs-alert-success-color)}.vs-alert-warning{border:1px solid var(--vs-alert-warning-bc);background-color:var(--vs-alert-warning-bg);color:var(--vs-alert-warning-color)}.vs-alert-error{border:1px solid var(--vs-alert-error-bc);background-color:var(--vs-alert-error-bg);color:var(--vs-alert-error-color)}.vs-alert-info{border:1px solid var(--vs-alert-info-bc);background-color:var(--vs-alert-info-bg);color:var(--vs-alert-info-color)}.vs-alert-secondary{border:1px solid var(--vs-alert-secondary-bc);background-color:var(--vs-alert-secondary-bg);color:var(--vs-alert-secondary-color)}.vs-alert.vs-alert--small:not(.vs-alert--is-close){padding:12px 20px 12px 40px}.vs-alert.vs-alert--is-close:not(.vs-alert--small){padding:20px 40px}.vs-alert.vs-alert--is-close.vs-alert--small{padding:12px 40px}.vs-alert.vs-alert--is-close.vs-alert--small .vs-alert-button{top:8px}.vs-alert--no-bg{background-color:transparent;border-color:transparent;padding:0 22px;font-size:13px}.vs-alert--no-bg .vs-alert-icon__wrapper svg{left:0;margin-top:0}.vs-alert--no-bg.vs-alert-warning{color:var(--vs-alert-warning-icon)}.vs-alert--no-bg.vs-alert-error{color:var(--vs-alert-error-icon)}.vs-alert--toast{background-color:#fff;border:solid 1px #d8dcde;color:#2f3941;box-shadow:#17494d26 0 20px 28px;padding:15px 40px}.vs-alert--toast .vs-alert__heading{filter:brightness(100%)}.vs-alert--toast.vs-alert-success .vs-alert__heading{color:var(--vs-alert-success-icon)}.vs-alert--toast.vs-alert-warning .vs-alert__heading{color:var(--vs-alert-warning-icon)}.vs-alert--toast.vs-alert-error .vs-alert__heading{color:var(--vs-alert-error-icon)}.vs-alert--toast.vs-alert-info .vs-alert__heading{color:var(--vs-alert-info-icon)}.vs-alert--toast.vs-alert-secondary .vs-alert__heading{color:var(--vs-alert-secondary-icon)}.vs-alert--toast .vs-alert-button{color:#68737d;top:10px}.vs-toast{position:fixed;width:350px;max-width:350px;z-index:9999;font-family:inherit;text-align:left}.vs-toast .vs-alert{padding:15px 40px}.vs-toast .vs-alert .vs-alert-button{top:10px}.vs-toast--top-center{left:calc(50% - 175px);top:5px}.vs-toast--top-left{left:5px;top:5px}.vs-toast--top-right{right:5px;top:5px}.vs-toast--bottom-center{left:calc(50% - 175px);bottom:5px}.vs-toast--bottom-left{left:5px;bottom:5px}.vs-toast--bottom-right{right:5px;bottom:5px}.vs-toast--transition-slide-down-enter-active,.vs-toast--transition-slide-down-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:0;transform:translateY(-30px)}.vs-toast--transition-slide-up-enter-active,.vs-toast--transition-slide-up-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:0;transform:translateY(30px)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();import { openBlock as i, createElementBlock as r, normalizeClass as h, createElementVNode as s, renderSlot as c, createCommentVNode as a, Fragment as C, createTextVNode as m, toDisplayString as p, resolveComponent as x, createBlock as b, Transition as B, withCtx as _, createVNode as T, createApp as O, h as S } from "vue";
1
+ (function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode("[data-theme=dark] .vs-alert,.dark .vs-alert{--vs-alert-success-bc: #0b3b29;--vs-alert-success-bg: #0c261c;--vs-alert-success-color: #94c1b0;--vs-alert-success-icon: #94c1b0;--vs-alert-warning-bc: #5c3b24;--vs-alert-warning-bg: #3b2615;--vs-alert-warning-color: #ffb366;--vs-alert-warning-icon: #ff9f1a;--vs-alert-error-bc: #5a2328;--vs-alert-error-bg: #3a151a;--vs-alert-error-color: #ff8088;--vs-alert-error-icon: #ff4d57;--vs-alert-info-bc: #25455e;--vs-alert-info-bg: #17303f;--vs-alert-info-color: #66b0ff;--vs-alert-info-icon: #3399ff;--vs-alert-secondary-bc: #39434b;--vs-alert-secondary-bg: #1c2227;--vs-alert-secondary-color: #919ca5;--vs-alert-secondary-icon: #919ca5}.vs-alert{--vs-alert-success-bc: #aecfc2;--vs-alert-success-bg: #edf8f4;--vs-alert-success-color: #186146;--vs-alert-success-icon: #038153;--vs-alert-warning-bc: #fed6a8;--vs-alert-warning-bg: #fff7ed;--vs-alert-warning-color: #ad5918;--vs-alert-warning-icon: #ad5918;--vs-alert-error-bc: #f5b5ba;--vs-alert-error-bg: #fff0f1;--vs-alert-error-color: #8c232c;--vs-alert-error-icon: #cc3340;--vs-alert-info-bc: #adcce4;--vs-alert-info-bg: #edf7ff;--vs-alert-info-color: #1f73b7;--vs-alert-info-icon: #337fbd;--vs-alert-secondary-bc: #d8dcde;--vs-alert-secondary-bg: #f8f9f9;--vs-alert-secondary-color: #68737d;--vs-alert-secondary-icon: #68737d;position:relative;border-radius:4px;padding:20px 20px 20px 40px;line-height:1.42857;font-size:14px}.vs-alert-icon__wrapper svg{position:absolute;left:15px;margin-top:1px}.vs-alert__heading{font-weight:600;filter:brightness(85%)}.vs-alert-button{display:block;position:absolute;top:15px;right:10px;transition:background-color .1s ease-in-out 0s,color .25s ease-in-out 0s;border:none;background-color:transparent;cursor:pointer;padding:0;width:28px;height:28px;overflow:hidden;color:#333;font-size:0px;user-select:none}.vs-alert-button.success{color:var(--vs-alert-success-color)}.vs-alert-button.warning{color:var(--vs-alert-warning-color)}.vs-alert-button.error{color:var(--vs-alert-error-color)}.vs-alert-button.info{color:var(--vs-alert-info-color)}.vs-alert-button.secondary{color:var(--vs-alert-secondary-color)}.vs-alert-success{border:1px solid var(--vs-alert-success-bc);background-color:var(--vs-alert-success-bg);color:var(--vs-alert-success-color)}.vs-alert-warning{border:1px solid var(--vs-alert-warning-bc);background-color:var(--vs-alert-warning-bg);color:var(--vs-alert-warning-color)}.vs-alert-error{border:1px solid var(--vs-alert-error-bc);background-color:var(--vs-alert-error-bg);color:var(--vs-alert-error-color)}.vs-alert-info{border:1px solid var(--vs-alert-info-bc);background-color:var(--vs-alert-info-bg);color:var(--vs-alert-info-color)}.vs-alert-secondary{border:1px solid var(--vs-alert-secondary-bc);background-color:var(--vs-alert-secondary-bg);color:var(--vs-alert-secondary-color)}.vs-alert.vs-alert--small:not(.vs-alert--is-close){padding:12px 20px 12px 40px}.vs-alert.vs-alert--is-close:not(.vs-alert--small){padding:20px 40px}.vs-alert.vs-alert--is-close.vs-alert--small{padding:12px 40px}.vs-alert.vs-alert--is-close.vs-alert--small .vs-alert-button{top:8px}.vs-alert--no-bg{background-color:transparent;border-color:transparent;padding:0 22px;font-size:13px}.vs-alert--no-bg .vs-alert-icon__wrapper svg{left:0;margin-top:0}.vs-alert--no-bg.vs-alert-warning{color:var(--vs-alert-warning-icon)}.vs-alert--no-bg.vs-alert-error{color:var(--vs-alert-error-icon)}.vs-alert--toast{box-shadow:#17494d26 0 20px 28px;padding:15px 40px}.vs-alert--toast .vs-alert__heading{filter:brightness(100%)}.vs-alert--toast.vs-alert-success .vs-alert__heading{color:var(--vs-alert-success-icon)}.vs-alert--toast.vs-alert-warning .vs-alert__heading{color:var(--vs-alert-warning-icon)}.vs-alert--toast.vs-alert-error .vs-alert__heading{color:var(--vs-alert-error-icon)}.vs-alert--toast.vs-alert-info .vs-alert__heading{color:var(--vs-alert-info-icon)}.vs-alert--toast.vs-alert-secondary .vs-alert__heading{color:var(--vs-alert-secondary-icon)}.vs-alert--toast .vs-alert-button{color:#68737d;top:10px}html:not([data-theme=dark]):not(.dark) .vs-alert--toast{background-color:#fff;border:solid 1px #d8dcde;color:#2f3941}.vs-toast{position:fixed;width:350px;max-width:350px;z-index:9999;font-family:inherit;text-align:left}.vs-toast .vs-alert{padding:15px 40px}.vs-toast .vs-alert .vs-alert-button{top:10px}.vs-toast--top-center{left:calc(50% - 175px);top:5px}.vs-toast--top-left{left:5px;top:5px}.vs-toast--top-right{right:5px;top:5px}.vs-toast--bottom-center{left:calc(50% - 175px);bottom:5px}.vs-toast--bottom-left{left:5px;bottom:5px}.vs-toast--bottom-right{right:5px;bottom:5px}.vs-toast--transition-slide-down-enter-active,.vs-toast--transition-slide-down-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:0;transform:translateY(-30px)}.vs-toast--transition-slide-up-enter-active,.vs-toast--transition-slide-up-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:0;transform:translateY(30px)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();import { openBlock as i, createElementBlock as r, normalizeClass as h, createElementVNode as s, renderSlot as c, createCommentVNode as a, Fragment as C, createTextVNode as m, toDisplayString as p, resolveComponent as x, createBlock as b, Transition as B, withCtx as _, createVNode as T, createApp as O, h as S } from "vue";
2
2
  const g = (t, e) => {
3
3
  const o = t.__vccOpts || t;
4
4
  for (const [l, u] of e)
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- (function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode(".vs-alert{--vs-alert-success-bc: #aecfc2;--vs-alert-success-bg: #edf8f4;--vs-alert-success-color: #186146;--vs-alert-success-icon: #038153;--vs-alert-warning-bc: #fed6a8;--vs-alert-warning-bg: #fff7ed;--vs-alert-warning-color: #ad5918;--vs-alert-warning-icon: #ad5918;--vs-alert-error-bc: #f5b5ba;--vs-alert-error-bg: #fff0f1;--vs-alert-error-color: #8c232c;--vs-alert-error-icon: #cc3340;--vs-alert-info-bc: #adcce4;--vs-alert-info-bg: #edf7ff;--vs-alert-info-color: #1f73b7;--vs-alert-info-icon: #337fbd;--vs-alert-secondary-bc: #d8dcde;--vs-alert-secondary-bg: #f8f9f9;--vs-alert-secondary-color: #68737d;--vs-alert-secondary-icon: #68737d;position:relative;border-radius:4px;padding:20px 20px 20px 40px;line-height:1.42857;font-size:14px}.vs-alert-icon__wrapper svg{position:absolute;left:15px;margin-top:1px}.vs-alert__heading{font-weight:600;filter:brightness(85%)}.vs-alert-button{display:block;position:absolute;top:15px;right:10px;transition:background-color .1s ease-in-out 0s,color .25s ease-in-out 0s;border:none;background-color:transparent;cursor:pointer;padding:0;width:28px;height:28px;overflow:hidden;color:#333;font-size:0px;user-select:none}.vs-alert-button.success{color:var(--vs-alert-success-color)}.vs-alert-button.warning{color:var(--vs-alert-warning-color)}.vs-alert-button.error{color:var(--vs-alert-error-color)}.vs-alert-button.info{color:var(--vs-alert-info-color)}.vs-alert-button.secondary{color:var(--vs-alert-secondary-color)}.vs-alert-success{border:1px solid var(--vs-alert-success-bc);background-color:var(--vs-alert-success-bg);color:var(--vs-alert-success-color)}.vs-alert-warning{border:1px solid var(--vs-alert-warning-bc);background-color:var(--vs-alert-warning-bg);color:var(--vs-alert-warning-color)}.vs-alert-error{border:1px solid var(--vs-alert-error-bc);background-color:var(--vs-alert-error-bg);color:var(--vs-alert-error-color)}.vs-alert-info{border:1px solid var(--vs-alert-info-bc);background-color:var(--vs-alert-info-bg);color:var(--vs-alert-info-color)}.vs-alert-secondary{border:1px solid var(--vs-alert-secondary-bc);background-color:var(--vs-alert-secondary-bg);color:var(--vs-alert-secondary-color)}.vs-alert.vs-alert--small:not(.vs-alert--is-close){padding:12px 20px 12px 40px}.vs-alert.vs-alert--is-close:not(.vs-alert--small){padding:20px 40px}.vs-alert.vs-alert--is-close.vs-alert--small{padding:12px 40px}.vs-alert.vs-alert--is-close.vs-alert--small .vs-alert-button{top:8px}.vs-alert--no-bg{background-color:transparent;border-color:transparent;padding:0 22px;font-size:13px}.vs-alert--no-bg .vs-alert-icon__wrapper svg{left:0;margin-top:0}.vs-alert--no-bg.vs-alert-warning{color:var(--vs-alert-warning-icon)}.vs-alert--no-bg.vs-alert-error{color:var(--vs-alert-error-icon)}.vs-alert--toast{background-color:#fff;border:solid 1px #d8dcde;color:#2f3941;box-shadow:#17494d26 0 20px 28px;padding:15px 40px}.vs-alert--toast .vs-alert__heading{filter:brightness(100%)}.vs-alert--toast.vs-alert-success .vs-alert__heading{color:var(--vs-alert-success-icon)}.vs-alert--toast.vs-alert-warning .vs-alert__heading{color:var(--vs-alert-warning-icon)}.vs-alert--toast.vs-alert-error .vs-alert__heading{color:var(--vs-alert-error-icon)}.vs-alert--toast.vs-alert-info .vs-alert__heading{color:var(--vs-alert-info-icon)}.vs-alert--toast.vs-alert-secondary .vs-alert__heading{color:var(--vs-alert-secondary-icon)}.vs-alert--toast .vs-alert-button{color:#68737d;top:10px}.vs-toast{position:fixed;width:350px;max-width:350px;z-index:9999;font-family:inherit;text-align:left}.vs-toast .vs-alert{padding:15px 40px}.vs-toast .vs-alert .vs-alert-button{top:10px}.vs-toast--top-center{left:calc(50% - 175px);top:5px}.vs-toast--top-left{left:5px;top:5px}.vs-toast--top-right{right:5px;top:5px}.vs-toast--bottom-center{left:calc(50% - 175px);bottom:5px}.vs-toast--bottom-left{left:5px;bottom:5px}.vs-toast--bottom-right{right:5px;bottom:5px}.vs-toast--transition-slide-down-enter-active,.vs-toast--transition-slide-down-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:0;transform:translateY(-30px)}.vs-toast--transition-slide-up-enter-active,.vs-toast--transition-slide-up-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:0;transform:translateY(30px)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();var VsToast=function(e){"use strict";const I="",c=(t,o)=>{const s=t.__vccOpts||t;for(const[r,i]of o)s[r]=i;return s},_={name:"VsAlert",props:{variant:{type:String,required:!0,validator:t=>["success","error","info","warning","secondary"].includes(t.toLowerCase())},showClose:{type:Boolean,default:!1},title:{type:String},noBg:{type:Boolean,default:!1},small:{type:Boolean,default:!1},toast:{type:Boolean,default:!1}},computed:{classList(){return[`vs-alert-${this.variant}`,{"vs-alert--no-bg":this.noBg},{"vs-alert--small":this.small},{"vs-alert--toast":this.toast},{"vs-alert--is-close":this.showClose}]}}},f={class:"vs-alert-icon__wrapper"},p={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},g=[e.createElementVNode("g",{fill:"none",stroke:"var(--vs-alert-success-icon)"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 9l2.5 2.5 5-5"}),e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7"})],-1)],w={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},u=[e.createElementVNode("path",{fill:"none",stroke:"var(--vs-alert-warning-icon)","stroke-linecap":"round",d:"M.88 13.77L7.06 1.86c.19-.36.7-.36.89 0l6.18 11.91c.17.33-.07.73-.44.73H1.32c-.37 0-.61-.4-.44-.73zM7.5 6v3.5"},null,-1),e.createElementVNode("circle",{cx:"7.5",cy:"12",r:"1",fill:"#ad5918"},null,-1)],y={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},k=[e.createElementVNode("g",{fill:"none",stroke:"var(--vs-alert-error-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 4.5V9"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"12",r:"1",fill:"var(--vs-alert-error-icon)"},null,-1)],V={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},E=[e.createElementVNode("g",{stroke:"var(--vs-alert-info-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7",fill:"none"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 12.5V8"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"5",r:"1",fill:"var(--vs-alert-info-icon)"},null,-1)],B={key:4,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},C=[e.createElementVNode("g",{stroke:"var(--vs-alert-secondary-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7",fill:"none"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 12.5V8"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"5",r:"1",fill:"var(--vs-alert-secondary-icon)"},null,-1)],N={class:"vs-alert__heading"},v=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",role:"presentation",focusable:"false"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round",d:"M3 9l6-6m0 6L3 3"})],-1)];function x(t,o,s,r,i,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vs-alert",n.classList])},[e.createElementVNode("span",f,[e.renderSlot(t.$slots,"icon",{},()=>[s.variant==="success"?(e.openBlock(),e.createElementBlock("svg",p,g)):e.createCommentVNode("",!0),s.variant==="warning"?(e.openBlock(),e.createElementBlock("svg",w,u)):e.createCommentVNode("",!0),s.variant==="error"?(e.openBlock(),e.createElementBlock("svg",y,k)):e.createCommentVNode("",!0),s.variant==="info"?(e.openBlock(),e.createElementBlock("svg",V,E)):e.createCommentVNode("",!0),s.variant==="secondary"?(e.openBlock(),e.createElementBlock("svg",B,C)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",N,[e.renderSlot(t.$slots,"title",{},()=>[s.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(s.title),1)],64)):e.createCommentVNode("",!0)])]),e.renderSlot(t.$slots,"default"),s.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vs-alert-button",s.variant]),onClick:o[0]||(o[0]=m=>t.$emit("close",!0)),"aria-label":"Close"},v,2)):e.createCommentVNode("",!0)],2)}const S=c(_,[["render",x]]),R="",T={name:"VsToast",props:{type:{type:String,default:"toast"},title:{type:String},message:{type:String},variant:{type:String},showClose:{type:Boolean,default:!0},position:{type:String,default:"top-center",validator:t=>["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"].includes(t.toLowerCase())},animation:{type:String},timeout:{type:Number,default:5e3},isSticky:{type:Boolean,default:!1}},components:{VsAlert:S},data(){return{isOpen:!1,timerId:null,isMouseHovered:!1,isTimedOut:!1,_position:"top-center"}},computed:{classList(){return[`vs-toast--${this._position}`]},toggleTransition(){var o,s;const t=((s=(o=this._position)==null?void 0:o.split("-"))==null?void 0:s[0])||"";return this._animation?`vs-toast--transition-${this._animation}`:t==="top"?"vs-toast--transition-slide-down":"vs-toast--transition-slide-up"}},methods:{async open(t={}){if(Object.keys(t).length!==0){if(this.isOpen){this.close(),this.$nextTick(()=>this.open(t));return}t={...this.$props,...t},Object.keys(t).forEach(o=>this[`_${o}`]=t[o]||"")}this.timerId&&await this.close(),this.isOpen=!0,this.isTimedOut=!1,this._isSticky||(this.timerId=setTimeout(async()=>{this.isMouseHovered||await this.close(),this.isTimedOut=!0},this._timeout))},close(){return this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.isOpen=!1,new Promise(t=>setTimeout(()=>{this.$emit("input",this.isOpen),t()},10))},mouseHover(t=!1){this.isMouseHovered=t,this.isTimedOut&&!this.isMouseHovered&&this.close()},onEnter(){this.$emit("reveal")},onLeave(){this.$emit("hide")}}};function b(t,o,s,r,i,n){const m=e.resolveComponent("vs-alert");return e.openBlock(),e.createBlock(e.Transition,{name:n.toggleTransition,onAfterEnter:n.onEnter,onAfterLeave:n.onLeave},{default:e.withCtx(()=>[i.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vs-toast",n.classList]),role:"status",onMouseover:o[0]||(o[0]=H=>n.mouseHover(!0)),onMouseleave:o[1]||(o[1]=H=>n.mouseHover(!1))},[e.renderSlot(t.$slots,"custom",{close:n.close},()=>[e.createVNode(m,{title:t._title,variant:t._variant,showClose:!!t._showClose,onClose:n.close,toast:t._type==="toast"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t._message),1)])]),_:3},8,["title","variant","showClose","onClose","toast"])])],34)):e.createCommentVNode("",!0)]),_:3},8,["name","onAfterEnter","onAfterLeave"])}const O=c(T,[["render",b]]),M=["success","warning","error","info","secondary"],d={title:"",message:"",variant:"success",position:"top-center",type:"toast",timeout:5e3,showClose:!0,isSticky:!1};let a=null;function L(){const t=e.createApp({render(){return e.h(O,{ref:"toast"})}}),o=document.createElement("div");return document.body.appendChild(o),t.mount(o)}function l(){return a||(a=L()),a}function h(t={}){l().$refs.toast.open({...d,...t})}function $(){l().$refs.toast.close()}function A(){const t={};return M.forEach(o=>t[o]=(s,r={})=>h({variant:o,message:s,...r})),t}return{show:h,close:$,getToastCmp:l,defaultOptions:d,...A()}}(Vue);
1
+ (function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode("[data-theme=dark] .vs-alert,.dark .vs-alert{--vs-alert-success-bc: #0b3b29;--vs-alert-success-bg: #0c261c;--vs-alert-success-color: #94c1b0;--vs-alert-success-icon: #94c1b0;--vs-alert-warning-bc: #5c3b24;--vs-alert-warning-bg: #3b2615;--vs-alert-warning-color: #ffb366;--vs-alert-warning-icon: #ff9f1a;--vs-alert-error-bc: #5a2328;--vs-alert-error-bg: #3a151a;--vs-alert-error-color: #ff8088;--vs-alert-error-icon: #ff4d57;--vs-alert-info-bc: #25455e;--vs-alert-info-bg: #17303f;--vs-alert-info-color: #66b0ff;--vs-alert-info-icon: #3399ff;--vs-alert-secondary-bc: #39434b;--vs-alert-secondary-bg: #1c2227;--vs-alert-secondary-color: #919ca5;--vs-alert-secondary-icon: #919ca5}.vs-alert{--vs-alert-success-bc: #aecfc2;--vs-alert-success-bg: #edf8f4;--vs-alert-success-color: #186146;--vs-alert-success-icon: #038153;--vs-alert-warning-bc: #fed6a8;--vs-alert-warning-bg: #fff7ed;--vs-alert-warning-color: #ad5918;--vs-alert-warning-icon: #ad5918;--vs-alert-error-bc: #f5b5ba;--vs-alert-error-bg: #fff0f1;--vs-alert-error-color: #8c232c;--vs-alert-error-icon: #cc3340;--vs-alert-info-bc: #adcce4;--vs-alert-info-bg: #edf7ff;--vs-alert-info-color: #1f73b7;--vs-alert-info-icon: #337fbd;--vs-alert-secondary-bc: #d8dcde;--vs-alert-secondary-bg: #f8f9f9;--vs-alert-secondary-color: #68737d;--vs-alert-secondary-icon: #68737d;position:relative;border-radius:4px;padding:20px 20px 20px 40px;line-height:1.42857;font-size:14px}.vs-alert-icon__wrapper svg{position:absolute;left:15px;margin-top:1px}.vs-alert__heading{font-weight:600;filter:brightness(85%)}.vs-alert-button{display:block;position:absolute;top:15px;right:10px;transition:background-color .1s ease-in-out 0s,color .25s ease-in-out 0s;border:none;background-color:transparent;cursor:pointer;padding:0;width:28px;height:28px;overflow:hidden;color:#333;font-size:0px;user-select:none}.vs-alert-button.success{color:var(--vs-alert-success-color)}.vs-alert-button.warning{color:var(--vs-alert-warning-color)}.vs-alert-button.error{color:var(--vs-alert-error-color)}.vs-alert-button.info{color:var(--vs-alert-info-color)}.vs-alert-button.secondary{color:var(--vs-alert-secondary-color)}.vs-alert-success{border:1px solid var(--vs-alert-success-bc);background-color:var(--vs-alert-success-bg);color:var(--vs-alert-success-color)}.vs-alert-warning{border:1px solid var(--vs-alert-warning-bc);background-color:var(--vs-alert-warning-bg);color:var(--vs-alert-warning-color)}.vs-alert-error{border:1px solid var(--vs-alert-error-bc);background-color:var(--vs-alert-error-bg);color:var(--vs-alert-error-color)}.vs-alert-info{border:1px solid var(--vs-alert-info-bc);background-color:var(--vs-alert-info-bg);color:var(--vs-alert-info-color)}.vs-alert-secondary{border:1px solid var(--vs-alert-secondary-bc);background-color:var(--vs-alert-secondary-bg);color:var(--vs-alert-secondary-color)}.vs-alert.vs-alert--small:not(.vs-alert--is-close){padding:12px 20px 12px 40px}.vs-alert.vs-alert--is-close:not(.vs-alert--small){padding:20px 40px}.vs-alert.vs-alert--is-close.vs-alert--small{padding:12px 40px}.vs-alert.vs-alert--is-close.vs-alert--small .vs-alert-button{top:8px}.vs-alert--no-bg{background-color:transparent;border-color:transparent;padding:0 22px;font-size:13px}.vs-alert--no-bg .vs-alert-icon__wrapper svg{left:0;margin-top:0}.vs-alert--no-bg.vs-alert-warning{color:var(--vs-alert-warning-icon)}.vs-alert--no-bg.vs-alert-error{color:var(--vs-alert-error-icon)}.vs-alert--toast{box-shadow:#17494d26 0 20px 28px;padding:15px 40px}.vs-alert--toast .vs-alert__heading{filter:brightness(100%)}.vs-alert--toast.vs-alert-success .vs-alert__heading{color:var(--vs-alert-success-icon)}.vs-alert--toast.vs-alert-warning .vs-alert__heading{color:var(--vs-alert-warning-icon)}.vs-alert--toast.vs-alert-error .vs-alert__heading{color:var(--vs-alert-error-icon)}.vs-alert--toast.vs-alert-info .vs-alert__heading{color:var(--vs-alert-info-icon)}.vs-alert--toast.vs-alert-secondary .vs-alert__heading{color:var(--vs-alert-secondary-icon)}.vs-alert--toast .vs-alert-button{color:#68737d;top:10px}html:not([data-theme=dark]):not(.dark) .vs-alert--toast{background-color:#fff;border:solid 1px #d8dcde;color:#2f3941}.vs-toast{position:fixed;width:350px;max-width:350px;z-index:9999;font-family:inherit;text-align:left}.vs-toast .vs-alert{padding:15px 40px}.vs-toast .vs-alert .vs-alert-button{top:10px}.vs-toast--top-center{left:calc(50% - 175px);top:5px}.vs-toast--top-left{left:5px;top:5px}.vs-toast--top-right{right:5px;top:5px}.vs-toast--bottom-center{left:calc(50% - 175px);bottom:5px}.vs-toast--bottom-left{left:5px;bottom:5px}.vs-toast--bottom-right{right:5px;bottom:5px}.vs-toast--transition-slide-down-enter-active,.vs-toast--transition-slide-down-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:0;transform:translateY(-30px)}.vs-toast--transition-slide-up-enter-active,.vs-toast--transition-slide-up-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:0;transform:translateY(30px)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();var VsToast=function(e){"use strict";const I="",c=(t,o)=>{const s=t.__vccOpts||t;for(const[r,i]of o)s[r]=i;return s},_={name:"VsAlert",props:{variant:{type:String,required:!0,validator:t=>["success","error","info","warning","secondary"].includes(t.toLowerCase())},showClose:{type:Boolean,default:!1},title:{type:String},noBg:{type:Boolean,default:!1},small:{type:Boolean,default:!1},toast:{type:Boolean,default:!1}},computed:{classList(){return[`vs-alert-${this.variant}`,{"vs-alert--no-bg":this.noBg},{"vs-alert--small":this.small},{"vs-alert--toast":this.toast},{"vs-alert--is-close":this.showClose}]}}},f={class:"vs-alert-icon__wrapper"},p={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},g=[e.createElementVNode("g",{fill:"none",stroke:"var(--vs-alert-success-icon)"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 9l2.5 2.5 5-5"}),e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7"})],-1)],w={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},u=[e.createElementVNode("path",{fill:"none",stroke:"var(--vs-alert-warning-icon)","stroke-linecap":"round",d:"M.88 13.77L7.06 1.86c.19-.36.7-.36.89 0l6.18 11.91c.17.33-.07.73-.44.73H1.32c-.37 0-.61-.4-.44-.73zM7.5 6v3.5"},null,-1),e.createElementVNode("circle",{cx:"7.5",cy:"12",r:"1",fill:"#ad5918"},null,-1)],y={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},k=[e.createElementVNode("g",{fill:"none",stroke:"var(--vs-alert-error-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 4.5V9"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"12",r:"1",fill:"var(--vs-alert-error-icon)"},null,-1)],V={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},E=[e.createElementVNode("g",{stroke:"var(--vs-alert-info-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7",fill:"none"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 12.5V8"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"5",r:"1",fill:"var(--vs-alert-info-icon)"},null,-1)],B={key:4,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},C=[e.createElementVNode("g",{stroke:"var(--vs-alert-secondary-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7",fill:"none"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 12.5V8"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"5",r:"1",fill:"var(--vs-alert-secondary-icon)"},null,-1)],N={class:"vs-alert__heading"},v=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",role:"presentation",focusable:"false"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round",d:"M3 9l6-6m0 6L3 3"})],-1)];function x(t,o,s,r,i,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vs-alert",n.classList])},[e.createElementVNode("span",f,[e.renderSlot(t.$slots,"icon",{},()=>[s.variant==="success"?(e.openBlock(),e.createElementBlock("svg",p,g)):e.createCommentVNode("",!0),s.variant==="warning"?(e.openBlock(),e.createElementBlock("svg",w,u)):e.createCommentVNode("",!0),s.variant==="error"?(e.openBlock(),e.createElementBlock("svg",y,k)):e.createCommentVNode("",!0),s.variant==="info"?(e.openBlock(),e.createElementBlock("svg",V,E)):e.createCommentVNode("",!0),s.variant==="secondary"?(e.openBlock(),e.createElementBlock("svg",B,C)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",N,[e.renderSlot(t.$slots,"title",{},()=>[s.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(s.title),1)],64)):e.createCommentVNode("",!0)])]),e.renderSlot(t.$slots,"default"),s.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vs-alert-button",s.variant]),onClick:o[0]||(o[0]=m=>t.$emit("close",!0)),"aria-label":"Close"},v,2)):e.createCommentVNode("",!0)],2)}const S=c(_,[["render",x]]),R="",T={name:"VsToast",props:{type:{type:String,default:"toast"},title:{type:String},message:{type:String},variant:{type:String},showClose:{type:Boolean,default:!0},position:{type:String,default:"top-center",validator:t=>["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"].includes(t.toLowerCase())},animation:{type:String},timeout:{type:Number,default:5e3},isSticky:{type:Boolean,default:!1}},components:{VsAlert:S},data(){return{isOpen:!1,timerId:null,isMouseHovered:!1,isTimedOut:!1,_position:"top-center"}},computed:{classList(){return[`vs-toast--${this._position}`]},toggleTransition(){var o,s;const t=((s=(o=this._position)==null?void 0:o.split("-"))==null?void 0:s[0])||"";return this._animation?`vs-toast--transition-${this._animation}`:t==="top"?"vs-toast--transition-slide-down":"vs-toast--transition-slide-up"}},methods:{async open(t={}){if(Object.keys(t).length!==0){if(this.isOpen){this.close(),this.$nextTick(()=>this.open(t));return}t={...this.$props,...t},Object.keys(t).forEach(o=>this[`_${o}`]=t[o]||"")}this.timerId&&await this.close(),this.isOpen=!0,this.isTimedOut=!1,this._isSticky||(this.timerId=setTimeout(async()=>{this.isMouseHovered||await this.close(),this.isTimedOut=!0},this._timeout))},close(){return this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.isOpen=!1,new Promise(t=>setTimeout(()=>{this.$emit("input",this.isOpen),t()},10))},mouseHover(t=!1){this.isMouseHovered=t,this.isTimedOut&&!this.isMouseHovered&&this.close()},onEnter(){this.$emit("reveal")},onLeave(){this.$emit("hide")}}};function b(t,o,s,r,i,n){const m=e.resolveComponent("vs-alert");return e.openBlock(),e.createBlock(e.Transition,{name:n.toggleTransition,onAfterEnter:n.onEnter,onAfterLeave:n.onLeave},{default:e.withCtx(()=>[i.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vs-toast",n.classList]),role:"status",onMouseover:o[0]||(o[0]=H=>n.mouseHover(!0)),onMouseleave:o[1]||(o[1]=H=>n.mouseHover(!1))},[e.renderSlot(t.$slots,"custom",{close:n.close},()=>[e.createVNode(m,{title:t._title,variant:t._variant,showClose:!!t._showClose,onClose:n.close,toast:t._type==="toast"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t._message),1)])]),_:3},8,["title","variant","showClose","onClose","toast"])])],34)):e.createCommentVNode("",!0)]),_:3},8,["name","onAfterEnter","onAfterLeave"])}const O=c(T,[["render",b]]),M=["success","warning","error","info","secondary"],d={title:"",message:"",variant:"success",position:"top-center",type:"toast",timeout:5e3,showClose:!0,isSticky:!1};let a=null;function L(){const t=e.createApp({render(){return e.h(O,{ref:"toast"})}}),o=document.createElement("div");return document.body.appendChild(o),t.mount(o)}function l(){return a||(a=L()),a}function h(t={}){l().$refs.toast.open({...d,...t})}function $(){l().$refs.toast.close()}function A(){const t={};return M.forEach(o=>t[o]=(s,r={})=>h({variant:o,message:s,...r})),t}return{show:h,close:$,getToastCmp:l,defaultOptions:d,...A()}}(Vue);
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode(".vs-alert{--vs-alert-success-bc: #aecfc2;--vs-alert-success-bg: #edf8f4;--vs-alert-success-color: #186146;--vs-alert-success-icon: #038153;--vs-alert-warning-bc: #fed6a8;--vs-alert-warning-bg: #fff7ed;--vs-alert-warning-color: #ad5918;--vs-alert-warning-icon: #ad5918;--vs-alert-error-bc: #f5b5ba;--vs-alert-error-bg: #fff0f1;--vs-alert-error-color: #8c232c;--vs-alert-error-icon: #cc3340;--vs-alert-info-bc: #adcce4;--vs-alert-info-bg: #edf7ff;--vs-alert-info-color: #1f73b7;--vs-alert-info-icon: #337fbd;--vs-alert-secondary-bc: #d8dcde;--vs-alert-secondary-bg: #f8f9f9;--vs-alert-secondary-color: #68737d;--vs-alert-secondary-icon: #68737d;position:relative;border-radius:4px;padding:20px 20px 20px 40px;line-height:1.42857;font-size:14px}.vs-alert-icon__wrapper svg{position:absolute;left:15px;margin-top:1px}.vs-alert__heading{font-weight:600;filter:brightness(85%)}.vs-alert-button{display:block;position:absolute;top:15px;right:10px;transition:background-color .1s ease-in-out 0s,color .25s ease-in-out 0s;border:none;background-color:transparent;cursor:pointer;padding:0;width:28px;height:28px;overflow:hidden;color:#333;font-size:0px;user-select:none}.vs-alert-button.success{color:var(--vs-alert-success-color)}.vs-alert-button.warning{color:var(--vs-alert-warning-color)}.vs-alert-button.error{color:var(--vs-alert-error-color)}.vs-alert-button.info{color:var(--vs-alert-info-color)}.vs-alert-button.secondary{color:var(--vs-alert-secondary-color)}.vs-alert-success{border:1px solid var(--vs-alert-success-bc);background-color:var(--vs-alert-success-bg);color:var(--vs-alert-success-color)}.vs-alert-warning{border:1px solid var(--vs-alert-warning-bc);background-color:var(--vs-alert-warning-bg);color:var(--vs-alert-warning-color)}.vs-alert-error{border:1px solid var(--vs-alert-error-bc);background-color:var(--vs-alert-error-bg);color:var(--vs-alert-error-color)}.vs-alert-info{border:1px solid var(--vs-alert-info-bc);background-color:var(--vs-alert-info-bg);color:var(--vs-alert-info-color)}.vs-alert-secondary{border:1px solid var(--vs-alert-secondary-bc);background-color:var(--vs-alert-secondary-bg);color:var(--vs-alert-secondary-color)}.vs-alert.vs-alert--small:not(.vs-alert--is-close){padding:12px 20px 12px 40px}.vs-alert.vs-alert--is-close:not(.vs-alert--small){padding:20px 40px}.vs-alert.vs-alert--is-close.vs-alert--small{padding:12px 40px}.vs-alert.vs-alert--is-close.vs-alert--small .vs-alert-button{top:8px}.vs-alert--no-bg{background-color:transparent;border-color:transparent;padding:0 22px;font-size:13px}.vs-alert--no-bg .vs-alert-icon__wrapper svg{left:0;margin-top:0}.vs-alert--no-bg.vs-alert-warning{color:var(--vs-alert-warning-icon)}.vs-alert--no-bg.vs-alert-error{color:var(--vs-alert-error-icon)}.vs-alert--toast{background-color:#fff;border:solid 1px #d8dcde;color:#2f3941;box-shadow:#17494d26 0 20px 28px;padding:15px 40px}.vs-alert--toast .vs-alert__heading{filter:brightness(100%)}.vs-alert--toast.vs-alert-success .vs-alert__heading{color:var(--vs-alert-success-icon)}.vs-alert--toast.vs-alert-warning .vs-alert__heading{color:var(--vs-alert-warning-icon)}.vs-alert--toast.vs-alert-error .vs-alert__heading{color:var(--vs-alert-error-icon)}.vs-alert--toast.vs-alert-info .vs-alert__heading{color:var(--vs-alert-info-icon)}.vs-alert--toast.vs-alert-secondary .vs-alert__heading{color:var(--vs-alert-secondary-icon)}.vs-alert--toast .vs-alert-button{color:#68737d;top:10px}.vs-toast{position:fixed;width:350px;max-width:350px;z-index:9999;font-family:inherit;text-align:left}.vs-toast .vs-alert{padding:15px 40px}.vs-toast .vs-alert .vs-alert-button{top:10px}.vs-toast--top-center{left:calc(50% - 175px);top:5px}.vs-toast--top-left{left:5px;top:5px}.vs-toast--top-right{right:5px;top:5px}.vs-toast--bottom-center{left:calc(50% - 175px);bottom:5px}.vs-toast--bottom-left{left:5px;bottom:5px}.vs-toast--bottom-right{right:5px;bottom:5px}.vs-toast--transition-slide-down-enter-active,.vs-toast--transition-slide-down-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:0;transform:translateY(-30px)}.vs-toast--transition-slide-up-enter-active,.vs-toast--transition-slide-up-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:0;transform:translateY(30px)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("vue")):typeof define=="function"&&define.amd?define(["vue"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.VsToast=i(e.Vue))})(this,function(e){"use strict";const i="",d=(t,o)=>{const s=t.__vccOpts||t;for(const[r,l]of o)s[r]=l;return s},f={name:"VsAlert",props:{variant:{type:String,required:!0,validator:t=>["success","error","info","warning","secondary"].includes(t.toLowerCase())},showClose:{type:Boolean,default:!1},title:{type:String},noBg:{type:Boolean,default:!1},small:{type:Boolean,default:!1},toast:{type:Boolean,default:!1}},computed:{classList(){return[`vs-alert-${this.variant}`,{"vs-alert--no-bg":this.noBg},{"vs-alert--small":this.small},{"vs-alert--toast":this.toast},{"vs-alert--is-close":this.showClose}]}}},p={class:"vs-alert-icon__wrapper"},u={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},g=[e.createElementVNode("g",{fill:"none",stroke:"var(--vs-alert-success-icon)"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 9l2.5 2.5 5-5"}),e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7"})],-1)],w={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},y=[e.createElementVNode("path",{fill:"none",stroke:"var(--vs-alert-warning-icon)","stroke-linecap":"round",d:"M.88 13.77L7.06 1.86c.19-.36.7-.36.89 0l6.18 11.91c.17.33-.07.73-.44.73H1.32c-.37 0-.61-.4-.44-.73zM7.5 6v3.5"},null,-1),e.createElementVNode("circle",{cx:"7.5",cy:"12",r:"1",fill:"#ad5918"},null,-1)],k={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},V=[e.createElementVNode("g",{fill:"none",stroke:"var(--vs-alert-error-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 4.5V9"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"12",r:"1",fill:"var(--vs-alert-error-icon)"},null,-1)],E={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},B=[e.createElementVNode("g",{stroke:"var(--vs-alert-info-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7",fill:"none"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 12.5V8"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"5",r:"1",fill:"var(--vs-alert-info-icon)"},null,-1)],C={key:4,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},N=[e.createElementVNode("g",{stroke:"var(--vs-alert-secondary-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7",fill:"none"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 12.5V8"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"5",r:"1",fill:"var(--vs-alert-secondary-icon)"},null,-1)],v={class:"vs-alert__heading"},x=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",role:"presentation",focusable:"false"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round",d:"M3 9l6-6m0 6L3 3"})],-1)];function T(t,o,s,r,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vs-alert",n.classList])},[e.createElementVNode("span",p,[e.renderSlot(t.$slots,"icon",{},()=>[s.variant==="success"?(e.openBlock(),e.createElementBlock("svg",u,g)):e.createCommentVNode("",!0),s.variant==="warning"?(e.openBlock(),e.createElementBlock("svg",w,y)):e.createCommentVNode("",!0),s.variant==="error"?(e.openBlock(),e.createElementBlock("svg",k,V)):e.createCommentVNode("",!0),s.variant==="info"?(e.openBlock(),e.createElementBlock("svg",E,B)):e.createCommentVNode("",!0),s.variant==="secondary"?(e.openBlock(),e.createElementBlock("svg",C,N)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",v,[e.renderSlot(t.$slots,"title",{},()=>[s.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(s.title),1)],64)):e.createCommentVNode("",!0)])]),e.renderSlot(t.$slots,"default"),s.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vs-alert-button",s.variant]),onClick:o[0]||(o[0]=_=>t.$emit("close",!0)),"aria-label":"Close"},x,2)):e.createCommentVNode("",!0)],2)}const S=d(f,[["render",T]]),R="",b={name:"VsToast",props:{type:{type:String,default:"toast"},title:{type:String},message:{type:String},variant:{type:String},showClose:{type:Boolean,default:!0},position:{type:String,default:"top-center",validator:t=>["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"].includes(t.toLowerCase())},animation:{type:String},timeout:{type:Number,default:5e3},isSticky:{type:Boolean,default:!1}},components:{VsAlert:S},data(){return{isOpen:!1,timerId:null,isMouseHovered:!1,isTimedOut:!1,_position:"top-center"}},computed:{classList(){return[`vs-toast--${this._position}`]},toggleTransition(){var o,s;const t=((s=(o=this._position)==null?void 0:o.split("-"))==null?void 0:s[0])||"";return this._animation?`vs-toast--transition-${this._animation}`:t==="top"?"vs-toast--transition-slide-down":"vs-toast--transition-slide-up"}},methods:{async open(t={}){if(Object.keys(t).length!==0){if(this.isOpen){this.close(),this.$nextTick(()=>this.open(t));return}t={...this.$props,...t},Object.keys(t).forEach(o=>this[`_${o}`]=t[o]||"")}this.timerId&&await this.close(),this.isOpen=!0,this.isTimedOut=!1,this._isSticky||(this.timerId=setTimeout(async()=>{this.isMouseHovered||await this.close(),this.isTimedOut=!0},this._timeout))},close(){return this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.isOpen=!1,new Promise(t=>setTimeout(()=>{this.$emit("input",this.isOpen),t()},10))},mouseHover(t=!1){this.isMouseHovered=t,this.isTimedOut&&!this.isMouseHovered&&this.close()},onEnter(){this.$emit("reveal")},onLeave(){this.$emit("hide")}}};function O(t,o,s,r,l,n){const _=e.resolveComponent("vs-alert");return e.openBlock(),e.createBlock(e.Transition,{name:n.toggleTransition,onAfterEnter:n.onEnter,onAfterLeave:n.onLeave},{default:e.withCtx(()=>[l.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vs-toast",n.classList]),role:"status",onMouseover:o[0]||(o[0]=I=>n.mouseHover(!0)),onMouseleave:o[1]||(o[1]=I=>n.mouseHover(!1))},[e.renderSlot(t.$slots,"custom",{close:n.close},()=>[e.createVNode(_,{title:t._title,variant:t._variant,showClose:!!t._showClose,onClose:n.close,toast:t._type==="toast"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t._message),1)])]),_:3},8,["title","variant","showClose","onClose","toast"])])],34)):e.createCommentVNode("",!0)]),_:3},8,["name","onAfterEnter","onAfterLeave"])}const M=d(b,[["render",O]]),L=["success","warning","error","info","secondary"],h={title:"",message:"",variant:"success",position:"top-center",type:"toast",timeout:5e3,showClose:!0,isSticky:!1};let a=null;function $(){const t=e.createApp({render(){return e.h(M,{ref:"toast"})}}),o=document.createElement("div");return document.body.appendChild(o),t.mount(o)}function c(){return a||(a=$()),a}function m(t={}){c().$refs.toast.open({...h,...t})}function A(){c().$refs.toast.close()}function H(){const t={};return L.forEach(o=>t[o]=(s,r={})=>m({variant:o,message:s,...r})),t}return{show:m,close:A,getToastCmp:c,defaultOptions:h,...H()}});
1
+ (function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode("[data-theme=dark] .vs-alert,.dark .vs-alert{--vs-alert-success-bc: #0b3b29;--vs-alert-success-bg: #0c261c;--vs-alert-success-color: #94c1b0;--vs-alert-success-icon: #94c1b0;--vs-alert-warning-bc: #5c3b24;--vs-alert-warning-bg: #3b2615;--vs-alert-warning-color: #ffb366;--vs-alert-warning-icon: #ff9f1a;--vs-alert-error-bc: #5a2328;--vs-alert-error-bg: #3a151a;--vs-alert-error-color: #ff8088;--vs-alert-error-icon: #ff4d57;--vs-alert-info-bc: #25455e;--vs-alert-info-bg: #17303f;--vs-alert-info-color: #66b0ff;--vs-alert-info-icon: #3399ff;--vs-alert-secondary-bc: #39434b;--vs-alert-secondary-bg: #1c2227;--vs-alert-secondary-color: #919ca5;--vs-alert-secondary-icon: #919ca5}.vs-alert{--vs-alert-success-bc: #aecfc2;--vs-alert-success-bg: #edf8f4;--vs-alert-success-color: #186146;--vs-alert-success-icon: #038153;--vs-alert-warning-bc: #fed6a8;--vs-alert-warning-bg: #fff7ed;--vs-alert-warning-color: #ad5918;--vs-alert-warning-icon: #ad5918;--vs-alert-error-bc: #f5b5ba;--vs-alert-error-bg: #fff0f1;--vs-alert-error-color: #8c232c;--vs-alert-error-icon: #cc3340;--vs-alert-info-bc: #adcce4;--vs-alert-info-bg: #edf7ff;--vs-alert-info-color: #1f73b7;--vs-alert-info-icon: #337fbd;--vs-alert-secondary-bc: #d8dcde;--vs-alert-secondary-bg: #f8f9f9;--vs-alert-secondary-color: #68737d;--vs-alert-secondary-icon: #68737d;position:relative;border-radius:4px;padding:20px 20px 20px 40px;line-height:1.42857;font-size:14px}.vs-alert-icon__wrapper svg{position:absolute;left:15px;margin-top:1px}.vs-alert__heading{font-weight:600;filter:brightness(85%)}.vs-alert-button{display:block;position:absolute;top:15px;right:10px;transition:background-color .1s ease-in-out 0s,color .25s ease-in-out 0s;border:none;background-color:transparent;cursor:pointer;padding:0;width:28px;height:28px;overflow:hidden;color:#333;font-size:0px;user-select:none}.vs-alert-button.success{color:var(--vs-alert-success-color)}.vs-alert-button.warning{color:var(--vs-alert-warning-color)}.vs-alert-button.error{color:var(--vs-alert-error-color)}.vs-alert-button.info{color:var(--vs-alert-info-color)}.vs-alert-button.secondary{color:var(--vs-alert-secondary-color)}.vs-alert-success{border:1px solid var(--vs-alert-success-bc);background-color:var(--vs-alert-success-bg);color:var(--vs-alert-success-color)}.vs-alert-warning{border:1px solid var(--vs-alert-warning-bc);background-color:var(--vs-alert-warning-bg);color:var(--vs-alert-warning-color)}.vs-alert-error{border:1px solid var(--vs-alert-error-bc);background-color:var(--vs-alert-error-bg);color:var(--vs-alert-error-color)}.vs-alert-info{border:1px solid var(--vs-alert-info-bc);background-color:var(--vs-alert-info-bg);color:var(--vs-alert-info-color)}.vs-alert-secondary{border:1px solid var(--vs-alert-secondary-bc);background-color:var(--vs-alert-secondary-bg);color:var(--vs-alert-secondary-color)}.vs-alert.vs-alert--small:not(.vs-alert--is-close){padding:12px 20px 12px 40px}.vs-alert.vs-alert--is-close:not(.vs-alert--small){padding:20px 40px}.vs-alert.vs-alert--is-close.vs-alert--small{padding:12px 40px}.vs-alert.vs-alert--is-close.vs-alert--small .vs-alert-button{top:8px}.vs-alert--no-bg{background-color:transparent;border-color:transparent;padding:0 22px;font-size:13px}.vs-alert--no-bg .vs-alert-icon__wrapper svg{left:0;margin-top:0}.vs-alert--no-bg.vs-alert-warning{color:var(--vs-alert-warning-icon)}.vs-alert--no-bg.vs-alert-error{color:var(--vs-alert-error-icon)}.vs-alert--toast{box-shadow:#17494d26 0 20px 28px;padding:15px 40px}.vs-alert--toast .vs-alert__heading{filter:brightness(100%)}.vs-alert--toast.vs-alert-success .vs-alert__heading{color:var(--vs-alert-success-icon)}.vs-alert--toast.vs-alert-warning .vs-alert__heading{color:var(--vs-alert-warning-icon)}.vs-alert--toast.vs-alert-error .vs-alert__heading{color:var(--vs-alert-error-icon)}.vs-alert--toast.vs-alert-info .vs-alert__heading{color:var(--vs-alert-info-icon)}.vs-alert--toast.vs-alert-secondary .vs-alert__heading{color:var(--vs-alert-secondary-icon)}.vs-alert--toast .vs-alert-button{color:#68737d;top:10px}html:not([data-theme=dark]):not(.dark) .vs-alert--toast{background-color:#fff;border:solid 1px #d8dcde;color:#2f3941}.vs-toast{position:fixed;width:350px;max-width:350px;z-index:9999;font-family:inherit;text-align:left}.vs-toast .vs-alert{padding:15px 40px}.vs-toast .vs-alert .vs-alert-button{top:10px}.vs-toast--top-center{left:calc(50% - 175px);top:5px}.vs-toast--top-left{left:5px;top:5px}.vs-toast--top-right{right:5px;top:5px}.vs-toast--bottom-center{left:calc(50% - 175px);bottom:5px}.vs-toast--bottom-left{left:5px;bottom:5px}.vs-toast--bottom-right{right:5px;bottom:5px}.vs-toast--transition-slide-down-enter-active,.vs-toast--transition-slide-down-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-down-enter-from,.vs-toast--transition-slide-down-leave-to{opacity:0;transform:translateY(-30px)}.vs-toast--transition-slide-up-enter-active,.vs-toast--transition-slide-up-leave-active{transition:.3s all ease-in-out}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:1;transform:translateY(0)}.vs-toast--transition-slide-up-enter-from,.vs-toast--transition-slide-up-leave-to{opacity:0;transform:translateY(30px)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();(function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("vue")):typeof define=="function"&&define.amd?define(["vue"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.VsToast=i(e.Vue))})(this,function(e){"use strict";const i="",d=(t,o)=>{const s=t.__vccOpts||t;for(const[r,l]of o)s[r]=l;return s},f={name:"VsAlert",props:{variant:{type:String,required:!0,validator:t=>["success","error","info","warning","secondary"].includes(t.toLowerCase())},showClose:{type:Boolean,default:!1},title:{type:String},noBg:{type:Boolean,default:!1},small:{type:Boolean,default:!1},toast:{type:Boolean,default:!1}},computed:{classList(){return[`vs-alert-${this.variant}`,{"vs-alert--no-bg":this.noBg},{"vs-alert--small":this.small},{"vs-alert--toast":this.toast},{"vs-alert--is-close":this.showClose}]}}},p={class:"vs-alert-icon__wrapper"},u={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},g=[e.createElementVNode("g",{fill:"none",stroke:"var(--vs-alert-success-icon)"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 9l2.5 2.5 5-5"}),e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7"})],-1)],w={key:1,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},y=[e.createElementVNode("path",{fill:"none",stroke:"var(--vs-alert-warning-icon)","stroke-linecap":"round",d:"M.88 13.77L7.06 1.86c.19-.36.7-.36.89 0l6.18 11.91c.17.33-.07.73-.44.73H1.32c-.37 0-.61-.4-.44-.73zM7.5 6v3.5"},null,-1),e.createElementVNode("circle",{cx:"7.5",cy:"12",r:"1",fill:"#ad5918"},null,-1)],k={key:2,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},V=[e.createElementVNode("g",{fill:"none",stroke:"var(--vs-alert-error-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 4.5V9"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"12",r:"1",fill:"var(--vs-alert-error-icon)"},null,-1)],E={key:3,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},B=[e.createElementVNode("g",{stroke:"var(--vs-alert-info-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7",fill:"none"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 12.5V8"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"5",r:"1",fill:"var(--vs-alert-info-icon)"},null,-1)],C={key:4,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",role:"presentation",focussable:"false"},N=[e.createElementVNode("g",{stroke:"var(--vs-alert-secondary-icon)"},[e.createElementVNode("circle",{cx:"7.5",cy:"8.5",r:"7",fill:"none"}),e.createElementVNode("path",{"stroke-linecap":"round",d:"M7.5 12.5V8"})],-1),e.createElementVNode("circle",{cx:"7.5",cy:"5",r:"1",fill:"var(--vs-alert-secondary-icon)"},null,-1)],v={class:"vs-alert__heading"},x=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",role:"presentation",focusable:"false"},[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round",d:"M3 9l6-6m0 6L3 3"})],-1)];function T(t,o,s,r,l,n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vs-alert",n.classList])},[e.createElementVNode("span",p,[e.renderSlot(t.$slots,"icon",{},()=>[s.variant==="success"?(e.openBlock(),e.createElementBlock("svg",u,g)):e.createCommentVNode("",!0),s.variant==="warning"?(e.openBlock(),e.createElementBlock("svg",w,y)):e.createCommentVNode("",!0),s.variant==="error"?(e.openBlock(),e.createElementBlock("svg",k,V)):e.createCommentVNode("",!0),s.variant==="info"?(e.openBlock(),e.createElementBlock("svg",E,B)):e.createCommentVNode("",!0),s.variant==="secondary"?(e.openBlock(),e.createElementBlock("svg",C,N)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",v,[e.renderSlot(t.$slots,"title",{},()=>[s.title?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(s.title),1)],64)):e.createCommentVNode("",!0)])]),e.renderSlot(t.$slots,"default"),s.showClose?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["vs-alert-button",s.variant]),onClick:o[0]||(o[0]=_=>t.$emit("close",!0)),"aria-label":"Close"},x,2)):e.createCommentVNode("",!0)],2)}const S=d(f,[["render",T]]),R="",b={name:"VsToast",props:{type:{type:String,default:"toast"},title:{type:String},message:{type:String},variant:{type:String},showClose:{type:Boolean,default:!0},position:{type:String,default:"top-center",validator:t=>["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"].includes(t.toLowerCase())},animation:{type:String},timeout:{type:Number,default:5e3},isSticky:{type:Boolean,default:!1}},components:{VsAlert:S},data(){return{isOpen:!1,timerId:null,isMouseHovered:!1,isTimedOut:!1,_position:"top-center"}},computed:{classList(){return[`vs-toast--${this._position}`]},toggleTransition(){var o,s;const t=((s=(o=this._position)==null?void 0:o.split("-"))==null?void 0:s[0])||"";return this._animation?`vs-toast--transition-${this._animation}`:t==="top"?"vs-toast--transition-slide-down":"vs-toast--transition-slide-up"}},methods:{async open(t={}){if(Object.keys(t).length!==0){if(this.isOpen){this.close(),this.$nextTick(()=>this.open(t));return}t={...this.$props,...t},Object.keys(t).forEach(o=>this[`_${o}`]=t[o]||"")}this.timerId&&await this.close(),this.isOpen=!0,this.isTimedOut=!1,this._isSticky||(this.timerId=setTimeout(async()=>{this.isMouseHovered||await this.close(),this.isTimedOut=!0},this._timeout))},close(){return this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.isOpen=!1,new Promise(t=>setTimeout(()=>{this.$emit("input",this.isOpen),t()},10))},mouseHover(t=!1){this.isMouseHovered=t,this.isTimedOut&&!this.isMouseHovered&&this.close()},onEnter(){this.$emit("reveal")},onLeave(){this.$emit("hide")}}};function O(t,o,s,r,l,n){const _=e.resolveComponent("vs-alert");return e.openBlock(),e.createBlock(e.Transition,{name:n.toggleTransition,onAfterEnter:n.onEnter,onAfterLeave:n.onLeave},{default:e.withCtx(()=>[l.isOpen?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vs-toast",n.classList]),role:"status",onMouseover:o[0]||(o[0]=I=>n.mouseHover(!0)),onMouseleave:o[1]||(o[1]=I=>n.mouseHover(!1))},[e.renderSlot(t.$slots,"custom",{close:n.close},()=>[e.createVNode(_,{title:t._title,variant:t._variant,showClose:!!t._showClose,onClose:n.close,toast:t._type==="toast"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t._message),1)])]),_:3},8,["title","variant","showClose","onClose","toast"])])],34)):e.createCommentVNode("",!0)]),_:3},8,["name","onAfterEnter","onAfterLeave"])}const M=d(b,[["render",O]]),L=["success","warning","error","info","secondary"],h={title:"",message:"",variant:"success",position:"top-center",type:"toast",timeout:5e3,showClose:!0,isSticky:!1};let a=null;function $(){const t=e.createApp({render(){return e.h(M,{ref:"toast"})}}),o=document.createElement("div");return document.body.appendChild(o),t.mount(o)}function c(){return a||(a=$()),a}function m(t={}){c().$refs.toast.open({...h,...t})}function A(){c().$refs.toast.close()}function H(){const t={};return L.forEach(o=>t[o]=(s,r={})=>m({variant:o,message:s,...r})),t}return{show:m,close:A,getToastCmp:c,defaultOptions:h,...H()}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuesimple/vs-toast",
3
- "version": "3.0.8",
3
+ "version": "3.1.2",
4
4
  "description": "A simple vue toast.",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.esm.js",
@@ -44,5 +44,5 @@
44
44
  "url": "https://github.com/ashwinkshenoy/vue-simple/issues"
45
45
  },
46
46
  "homepage": "https://github.com/ashwinkshenoy/vue-simple",
47
- "gitHead": "32b74133a5f1e145f07810121cc7ff1cc37a94f6"
47
+ "gitHead": "7fd4d8145903b0c6cb74e11b5a4de2e49ddbc2bc"
48
48
  }