vyrn 1.9.0 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Toast.tsx +41 -136
- package/src/styles/toast.css +122 -121
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t,{useEffect as e,useState as r,useRef as n,useCallback as a}from"react";import{X as o,Info as i,AlertTriangle as s,AlertCircle as c,CheckCircle as l}from"lucide-react";import{motion as m,AnimatePresence as d}from"framer-motion";var p=function(){return p=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var a in e=arguments[r])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},p.apply(this,arguments)};function u(t,e,r){if(r||2===arguments.length)for(var n,a=0,o=e.length;a<o;a++)!n&&a in e||(n||(n=Array.prototype.slice.call(e,0,a)),n[a]=e[a]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var f=t.createContext(void 0),v=function(){var e=t.useContext(f);if(void 0===e)throw new Error("useToastContext must be used within a ToastProvider");return e},y=function(r){var n=r.id,a=r.message,d=r.type,u=r.duration,f=void 0===u?3e3:u,y=r.title,b=r.description,x=r.action,g=r.isExpanded,h=v().removeToast;e((function(){var t=setTimeout((function(){h(n)}),f);return function(){return clearTimeout(t)}}),[n,f,h]);var w={className:"w-5 h-5 ".concat("success"===d?"text-emerald-500":"error"===d?"text-rose-500":"warning"===d?"text-amber-500":"text-blue-500")};return t.createElement(m.div,{className:"\n relative\n overflow-hidden\n rounded-lg\n border-l-4\n shadow-lg\n backdrop-blur-md\n ".concat({success:"bg-gradient-to-r from-emerald-50 to-green-50 border-l-emerald-500",error:"bg-gradient-to-r from-rose-50 to-red-50 border-l-rose-500",warning:"bg-gradient-to-r from-amber-50 to-yellow-50 border-l-amber-500",info:"bg-gradient-to-r from-blue-50 to-sky-50 border-l-blue-500"}[d],"\n transition-all\n duration-200\n hover:shadow-xl\n hover:scale-[1.02]\n ").concat(g?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-gray-900":"","\n "),role:"alert",initial:{opacity:0,y:-20},animate:{opacity:1,y:0,height:g?"auto":"64px"},exit:{opacity:0,scale:.95},transition:{duration:.2}},t.createElement("div",{className:"flex items-start p-4 gap-3"},t.createElement("div",{className:"flex-shrink-0 mt-0.5"},function(){switch(d){case"success":return t.createElement(l,p({},w));case"error":return t.createElement(c,p({},w));case"warning":return t.createElement(s,p({},w));default:return t.createElement(i,p({},w))}}()),t.createElement("div",{className:"flex-1 min-w-0"},y&&t.createElement(m.h3,{className:"font-semibold text-gray-900 dark:text-gray-100 mb-1",layout:!0},y),t.createElement(m.div,{className:"\n text-sm text-gray-700 dark:text-gray-300\n transition-all duration-200\n ".concat(g?"whitespace-normal":"whitespace-nowrap overflow-hidden text-ellipsis","\n "),layout:!0},a),b&&t.createElement(m.div,{className:"\n mt-2 text-sm text-gray-600 dark:text-gray-400\n transition-all duration-200\n ".concat(g?"opacity-100":"opacity-0 h-0","\n "),layout:!0},b)),t.createElement("div",{className:"flex-shrink-0 flex items-start gap-2"},x&&g&&t.createElement(m.button,{className:"\n px-3 py-1.5\n text-sm font-medium\n rounded-md\n transition-colors\n ".concat("success"===d?"bg-emerald-100 hover:bg-emerald-200 text-emerald-700":"error"===d?"bg-rose-100 hover:bg-rose-200 text-rose-700":"warning"===d?"bg-amber-100 hover:bg-amber-200 text-amber-700":"bg-blue-100 hover:bg-blue-200 text-blue-700","\n "),onClick:x.onClick,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9}},x.label),t.createElement("button",{className:"p-1 rounded-full opacity-60 hover:opacity-100 transition-opacity",onClick:function(){return h(n)},"aria-label":"Close"},t.createElement(o,{className:"w-4 h-4"})))),t.createElement(m.div,{className:"\n absolute bottom-0 left-0 h-1\n ".concat({success:"bg-emerald-500",error:"bg-rose-500",warning:"bg-amber-500",info:"bg-blue-500"}[d],"\n opacity-80\n "),initial:{width:"100%"},animate:{width:"0%"},transition:{duration:f/1e3,ease:"linear"}}))},b=function(a){var o=a.toasts,i=a.position,s=a.swipeDirection,c=r(null),l=c[0],f=c[1],v=n(null);e((function(){var t=function(t){v.current&&!v.current.contains(t.target)&&f(null)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}}),[]);var b=function(){switch(s){case"left":return{x:-100};case"right":return{x:100};case"up":return{y:-100};case"down":return{y:100}}},x=u([],o,!0).reverse();return t.createElement("div",{className:"vyrn-toast-container vyrn-toast-".concat(i),"aria-live":"polite","aria-atomic":"true",ref:v,onMouseLeave:function(){return f(null)}},t.createElement(d,{initial:!1},x.map((function(e,r){var n=l===e.id,a=null!==l,o=r*(a?10:-45);a&&(r>x.findIndex((function(t){return t.id===l}))&&(o+=60));return t.createElement(m.div,{key:e.id,layout:!0,initial:p({opacity:0,y:-20},b()),animate:{opacity:1,x:0,y:i.startsWith("top")?o:-o,scale:n?1.02:1,zIndex:n?9999:9999-r},exit:{opacity:0,x:"left"===s?-100:"right"===s?100:0,y:"up"===s?-100:"down"===s?100:0},transition:{type:"spring",stiffness:500,damping:30,layout:{type:"spring",stiffness:200,damping:25}},style:{position:"absolute",width:"100%",transformOrigin:i.startsWith("top")?"top":"bottom"},onHoverStart:function(){return f(e.id)},drag:"left"===s||"right"===s?"x":"y",dragConstraints:{left:0,right:0,top:0,bottom:0},dragElastic:.9,onDragEnd:function(t,r){var n;(Math.abs(r.offset.x)>100||Math.abs(r.offset.y)>100)&&(null===(n=e.onClose)||void 0===n||n.call(e))}},t.createElement(y,p({},e,{isExpanded:n})))}))))};!function(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t))}}('.vyrn-toast-container{box-sizing:border-box;max-width:420px;padding:1rem;perspective:1000px;pointer-events:none;position:fixed;transform-style:preserve-3d;width:calc(100% - 2rem);z-index:9999}.vyrn-toast-top-right{right:max(env(safe-area-inset-right,0px),1rem);top:max(env(safe-area-inset-top,0px),1rem);transform-origin:top right}.vyrn-toast-top-left{left:max(env(safe-area-inset-left,0px),1rem);top:max(env(safe-area-inset-top,0px),1rem);transform-origin:top left}.vyrn-toast-bottom-right{bottom:max(env(safe-area-inset-bottom,0px),1rem);right:max(env(safe-area-inset-right,0px),1rem);transform-origin:bottom right}.vyrn-toast-bottom-left{bottom:max(env(safe-area-inset-bottom,0px),1rem);left:max(env(safe-area-inset-left,0px),1rem);transform-origin:bottom left}.vyrn-toast-top-center{left:50%;top:max(env(safe-area-inset-top,0px),1rem);transform:translateX(-50%);transform-origin:top center}.vyrn-toast-bottom-center{bottom:max(env(safe-area-inset-bottom,0px),1rem);left:50%;transform:translateX(-50%);transform-origin:bottom center}.vyrn-toast{-webkit-font-smoothing:subpixel-antialiased;backface-visibility:hidden;margin-bottom:.75rem;pointer-events:auto;position:relative;transform:translateZ(0)}.vyrn-toast-container::-webkit-scrollbar{width:6px}.vyrn-toast-container::-webkit-scrollbar-track{background:transparent}.vyrn-toast-container::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.2);border:2px solid transparent;border-radius:3px}.vyrn-toast-container>div{filter:drop-shadow(0 4px 12px rgba(0,0,0,.1));opacity:1;transform:scale(1);transition:all .2s cubic-bezier(.68,-.55,.265,1.55)}.vyrn-toast-container>div:not(:first-child){margin-top:-.5rem;opacity:.95;transform:scale(.95) translateY(5px);z-index:-1}.vyrn-toast-container>div:not(:first-child):not(:nth-child(2)){opacity:.9;transform:scale(.9) translateY(10px);z-index:-2}.vyrn-toast-container:hover>div:not(:first-child){opacity:1;transform:scale(.98) translateY(0)}@media (max-width:640px){.vyrn-toast-container{max-width:calc(100vw - 2rem);padding:.5rem}.vyrn-toast{margin-bottom:.5rem}.vyrn-toast-bottom-center,.vyrn-toast-bottom-left,.vyrn-toast-bottom-right{bottom:max(env(safe-area-inset-bottom,0px),.5rem)}}@media (prefers-reduced-motion:reduce){.vyrn-toast-container>div{transition:none}}@media (prefers-color-scheme:dark){.vyrn-toast-container>div{filter:drop-shadow(0 4px 12px rgba(0,0,0,.3))}}@supports (backdrop-filter:blur(10px)){.vyrn-toast-container:before{backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);content:"";inset:0;opacity:0;position:absolute;transition:opacity .3s ease;z-index:-1}.vyrn-toast-container:hover:before{opacity:1}}@keyframes vyrnSlideIn{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes vyrnSlideOut{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(.95)}}.vyrn-toast-enter{animation:vyrnSlideIn .3s cubic-bezier(.68,-.55,.265,1.55) forwards}.vyrn-toast-exit{animation:vyrnSlideOut .2s cubic-bezier(.68,-.55,.265,1.55) forwards}',{insertAt:"top"});var x=function(e){var n=e.children,o=e.position,i=void 0===o?"top-right":o,s=e.maxToasts,c=void 0===s?5:s,l=e.swipeDirection,m=void 0===l?"right":l,d=r([]),v=d[0],y=d[1],x=a((function(t){var e=Math.random().toString(36).substr(2,9);return y((function(r){return u(u([],r,!0),[p(p({},t),{id:e})],!1).slice(-c)})),e}),[c]),g=a((function(t){y((function(e){return e.filter((function(e){return e.id!==t}))}))}),[]),h=a((function(t,e){y((function(r){return r.map((function(r){return r.id===t?p(p({},r),e):r}))}))}),[]);return t.createElement(f.Provider,{value:{addToast:x,removeToast:g,updateToast:h,position:i}},n,t.createElement(b,{toasts:v,position:i,swipeDirection:m}))},g=function(){var t=v(),e=t.addToast,r=t.removeToast,n=t.updateToast,o=t.position,i=a((function(t){return e(p(p({},t),{type:t.type||"info"}))}),[e]),s=a((function(t,e){n(t,e)}),[n]),c=a((function(t){r(t)}),[r]);return{toast:i,update:s,dismiss:c,info:function(t,e){return i(p({message:t,type:"info"},e))},success:function(t,e){return i(p({message:t,type:"success"},e))},warning:function(t,e){return i(p({message:t,type:"warning"},e))},error:function(t,e){return i(p({message:t,type:"error"},e))},position:o}},h=function(e){var r=e.children,n=e.position,a=e.maxToasts,o=e.swipeDirection;return t.createElement(x,{position:n,maxToasts:a,swipeDirection:o},r)};export{h as ClientToastProvider,x as ToastProvider,g as useToast};
|
|
1
|
+
import t,{useEffect as e,useState as n,useRef as r,useCallback as o}from"react";import{X as a,AlertTriangle as i,Info as s,AlertCircle as c,CheckCircle as l}from"lucide-react";import{motion as d,AnimatePresence as p}from"framer-motion";var u=function(){return u=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},u.apply(this,arguments)};function m(t,e,n){if(n||2===arguments.length)for(var r,o=0,a=e.length;o<a;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var f=t.createContext(void 0),v=function(){var e=t.useContext(f);if(void 0===e)throw new Error("useToastContext must be used within a ToastProvider");return e},y=function(n){var r=n.id,o=n.message,p=n.type,u=n.duration,m=void 0===u?3e3:u,f=n.title,y=n.description,g=n.action,h=n.isExpanded,x=v(),b=x.removeToast;x.updateToast,e((function(){var t=setTimeout((function(){b(r)}),m);return function(){return clearTimeout(t)}}),[r,m,b]);return t.createElement(d.div,{className:"vyrn-toast vyrn-toast-".concat(p," ").concat(h?"vyrn-toast-expanded":""),role:"alert",animate:{height:h?"auto":"60px"}},function(){switch(p){case"success":return t.createElement(l,{className:"vyrn-toast-icon"});case"error":return t.createElement(c,{className:"vyrn-toast-icon"});case"info":return t.createElement(s,{className:"vyrn-toast-icon"});case"warning":return t.createElement(i,{className:"vyrn-toast-icon"});default:return null}}(),t.createElement("div",{className:"vyrn-toast-content"},f&&t.createElement("div",{className:"vyrn-toast-title"},f),t.createElement("div",{className:"vyrn-toast-message"},o),h&&y&&t.createElement("div",{className:"vyrn-toast-description"},y)),h&&g&&t.createElement("button",{className:"vyrn-toast-action",onClick:g.onClick},g.label),t.createElement("button",{className:"vyrn-toast-close",onClick:function(){return b(r)},"aria-label":"Close"},t.createElement(a,{size:18})),t.createElement(d.div,{className:"vyrn-toast-progress",initial:{width:"100%"},animate:{width:"0%"},transition:{duration:m/1e3,ease:"linear"}}))},g=function(o){var a=o.toasts,i=o.position,s=o.swipeDirection,c=n(null),l=c[0],f=c[1],v=r(null);e((function(){var t=function(t){v.current&&!v.current.contains(t.target)&&f(null)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}}),[]);var g=function(){switch(s){case"left":return{x:-100};case"right":return{x:100};case"up":return{y:-100};case"down":return{y:100}}},h=m([],a,!0).reverse();return t.createElement("div",{className:"vyrn-toast-container vyrn-toast-".concat(i),"aria-live":"polite","aria-atomic":"true",ref:v,onMouseLeave:function(){return f(null)}},t.createElement(p,{initial:!1},h.map((function(e,n){var r=l===e.id,o=null!==l,a=n*(o?10:-45);o&&(n>h.findIndex((function(t){return t.id===l}))&&(a+=60));return t.createElement(d.div,{key:e.id,layout:!0,initial:u({opacity:0,y:-20},g()),animate:{opacity:1,x:0,y:i.startsWith("top")?a:-a,scale:r?1.02:1,zIndex:r?9999:9999-n},exit:{opacity:0,x:"left"===s?-100:"right"===s?100:0,y:"up"===s?-100:"down"===s?100:0},transition:{type:"spring",stiffness:500,damping:30,layout:{type:"spring",stiffness:200,damping:25}},style:{position:"absolute",width:"100%",transformOrigin:i.startsWith("top")?"top":"bottom"},onHoverStart:function(){return f(e.id)},drag:"left"===s||"right"===s?"x":"y",dragConstraints:{left:0,right:0,top:0,bottom:0},dragElastic:.9,onDragEnd:function(t,n){var r;(Math.abs(n.offset.x)>100||Math.abs(n.offset.y)>100)&&(null===(r=e.onClose)||void 0===r||r.call(e))}},t.createElement(y,u({},e,{isExpanded:r})))}))))};!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".vyrn-toast-container{box-sizing:border-box;max-width:380px;padding:1rem;pointer-events:none;position:fixed;width:100%;z-index:9999}.vyrn-toast-bottom-right,.vyrn-toast-top-right{right:1rem}.vyrn-toast-bottom-left,.vyrn-toast-top-left{left:1rem}.vyrn-toast-bottom-center,.vyrn-toast-top-center{left:50%;transform:translateX(-50%)}.vyrn-toast-top-center,.vyrn-toast-top-left,.vyrn-toast-top-right{top:1rem}.vyrn-toast-bottom-center,.vyrn-toast-bottom-left,.vyrn-toast-bottom-right{bottom:1rem}.vyrn-toast{align-items:center;background:#fff;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,.15);cursor:pointer;display:flex;height:60px;overflow:hidden;padding:12px 16px;pointer-events:auto;position:relative;transition:all .2s ease;will-change:transform}.vyrn-toast-expanded{box-shadow:0 8px 24px rgba(0,0,0,.2);height:auto!important}.vyrn-toast-expanded .vyrn-toast-message{white-space:normal}.vyrn-toast-expanded .vyrn-toast-description{display:block;max-height:200px}.vyrn-toast-icon{flex-shrink:0;height:20px;margin-right:12px;width:20px}.vyrn-toast-content{flex-grow:1;margin-right:12px;overflow:hidden}.vyrn-toast-title{font-size:1rem;font-weight:600;margin-bottom:4px}.vyrn-toast-message,.vyrn-toast-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vyrn-toast-message{font-size:.875rem;line-height:1.25rem;transition:white-space .2s ease}.vyrn-toast-description{font-size:.75rem;margin-top:4px;max-height:0;opacity:.8;overflow:hidden;transition:max-height .3s ease,opacity .3s ease}.vyrn-toast-close{align-items:center;background:none;border:none;color:inherit;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:0;transition:opacity .2s}.vyrn-toast-close:hover{opacity:1}.vyrn-toast-action{background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;font-weight:600;padding:4px 8px;transition:background-color .2s}.vyrn-toast-action:hover{background-color:rgba(0,0,0,.05)}.vyrn-toast-info{border-left:4px solid #3498db}.vyrn-toast-success{border-left:4px solid #2ecc71}.vyrn-toast-warning{border-left:4px solid #f39c12}.vyrn-toast-error{border-left:4px solid #e74c3c}.vyrn-toast-progress{background-color:rgba(0,0,0,.2);bottom:0;height:3px;left:0;position:absolute}@keyframes vyrnSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes vyrnFadeOut{0%{opacity:1}to{opacity:0}}.vyrn-toast-enter{animation:vyrnSlideIn .3s ease-out}.vyrn-toast-exit{animation:vyrnFadeOut .3s ease-in forwards}",{insertAt:"top"});var h=function(e){var r=e.children,a=e.position,i=void 0===a?"top-right":a,s=e.maxToasts,c=void 0===s?5:s,l=e.swipeDirection,d=void 0===l?"right":l,p=n([]),v=p[0],y=p[1],h=o((function(t){var e=Math.random().toString(36).substr(2,9);return y((function(n){return m(m([],n,!0),[u(u({},t),{id:e})],!1).slice(-c)})),e}),[c]),x=o((function(t){y((function(e){return e.filter((function(e){return e.id!==t}))}))}),[]),b=o((function(t,e){y((function(n){return n.map((function(n){return n.id===t?u(u({},n),e):n}))}))}),[]);return t.createElement(f.Provider,{value:{addToast:h,removeToast:x,updateToast:b,position:i}},r,t.createElement(g,{toasts:v,position:i,swipeDirection:d}))},x=function(){var t=v(),e=t.addToast,n=t.removeToast,r=t.updateToast,a=t.position,i=o((function(t){return e(u(u({},t),{type:t.type||"info"}))}),[e]),s=o((function(t,e){r(t,e)}),[r]),c=o((function(t){n(t)}),[n]);return{toast:i,update:s,dismiss:c,info:function(t,e){return i(u({message:t,type:"info"},e))},success:function(t,e){return i(u({message:t,type:"success"},e))},warning:function(t,e){return i(u({message:t,type:"warning"},e))},error:function(t,e){return i(u({message:t,type:"error"},e))},position:a}},b=function(e){var n=e.children,r=e.position,o=e.maxToasts,a=e.swipeDirection;return t.createElement(h,{position:r,maxToasts:o,swipeDirection:a},n)};export{b as ClientToastProvider,h as ToastProvider,x as useToast};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":"8qHAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("lucide-react"),r=require("framer-motion");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=n(t),o=function(){return o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var a in e=arguments[r])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t},o.apply(this,arguments)};function i(t,e,r){if(r||2===arguments.length)for(var n,a=0,o=e.length;a<o;a++)!n&&a in e||(n||(n=Array.prototype.slice.call(e,0,a)),n[a]=e[a]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var s=a.default.createContext(void 0),l=function(){var t=a.default.useContext(s);if(void 0===t)throw new Error("useToastContext must be used within a ToastProvider");return t},c=function(n){var i=n.id,s=n.message,c=n.type,d=n.duration,u=void 0===d?3e3:d,m=n.title,f=n.description,p=n.action,v=n.isExpanded,b=l().removeToast;t.useEffect((function(){var t=setTimeout((function(){b(i)}),u);return function(){return clearTimeout(t)}}),[i,u,b]);var y={className:"w-5 h-5 ".concat("success"===c?"text-emerald-500":"error"===c?"text-rose-500":"warning"===c?"text-amber-500":"text-blue-500")};return a.default.createElement(r.motion.div,{className:"\n relative\n overflow-hidden\n rounded-lg\n border-l-4\n shadow-lg\n backdrop-blur-md\n ".concat({success:"bg-gradient-to-r from-emerald-50 to-green-50 border-l-emerald-500",error:"bg-gradient-to-r from-rose-50 to-red-50 border-l-rose-500",warning:"bg-gradient-to-r from-amber-50 to-yellow-50 border-l-amber-500",info:"bg-gradient-to-r from-blue-50 to-sky-50 border-l-blue-500"}[c],"\n transition-all\n duration-200\n hover:shadow-xl\n hover:scale-[1.02]\n ").concat(v?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-gray-900":"","\n "),role:"alert",initial:{opacity:0,y:-20},animate:{opacity:1,y:0,height:v?"auto":"64px"},exit:{opacity:0,scale:.95},transition:{duration:.2}},a.default.createElement("div",{className:"flex items-start p-4 gap-3"},a.default.createElement("div",{className:"flex-shrink-0 mt-0.5"},function(){switch(c){case"success":return a.default.createElement(e.CheckCircle,o({},y));case"error":return a.default.createElement(e.AlertCircle,o({},y));case"warning":return a.default.createElement(e.AlertTriangle,o({},y));default:return a.default.createElement(e.Info,o({},y))}}()),a.default.createElement("div",{className:"flex-1 min-w-0"},m&&a.default.createElement(r.motion.h3,{className:"font-semibold text-gray-900 dark:text-gray-100 mb-1",layout:!0},m),a.default.createElement(r.motion.div,{className:"\n text-sm text-gray-700 dark:text-gray-300\n transition-all duration-200\n ".concat(v?"whitespace-normal":"whitespace-nowrap overflow-hidden text-ellipsis","\n "),layout:!0},s),f&&a.default.createElement(r.motion.div,{className:"\n mt-2 text-sm text-gray-600 dark:text-gray-400\n transition-all duration-200\n ".concat(v?"opacity-100":"opacity-0 h-0","\n "),layout:!0},f)),a.default.createElement("div",{className:"flex-shrink-0 flex items-start gap-2"},p&&v&&a.default.createElement(r.motion.button,{className:"\n px-3 py-1.5\n text-sm font-medium\n rounded-md\n transition-colors\n ".concat("success"===c?"bg-emerald-100 hover:bg-emerald-200 text-emerald-700":"error"===c?"bg-rose-100 hover:bg-rose-200 text-rose-700":"warning"===c?"bg-amber-100 hover:bg-amber-200 text-amber-700":"bg-blue-100 hover:bg-blue-200 text-blue-700","\n "),onClick:p.onClick,initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9}},p.label),a.default.createElement("button",{className:"p-1 rounded-full opacity-60 hover:opacity-100 transition-opacity",onClick:function(){return b(i)},"aria-label":"Close"},a.default.createElement(e.X,{className:"w-4 h-4"})))),a.default.createElement(r.motion.div,{className:"\n absolute bottom-0 left-0 h-1\n ".concat({success:"bg-emerald-500",error:"bg-rose-500",warning:"bg-amber-500",info:"bg-blue-500"}[c],"\n opacity-80\n "),initial:{width:"100%"},animate:{width:"0%"},transition:{duration:u/1e3,ease:"linear"}}))},d=function(e){var n=e.toasts,s=e.position,l=e.swipeDirection,d=t.useState(null),u=d[0],m=d[1],f=t.useRef(null);t.useEffect((function(){var t=function(t){f.current&&!f.current.contains(t.target)&&m(null)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}}),[]);var p=function(){switch(l){case"left":return{x:-100};case"right":return{x:100};case"up":return{y:-100};case"down":return{y:100}}},v=i([],n,!0).reverse();return a.default.createElement("div",{className:"vyrn-toast-container vyrn-toast-".concat(s),"aria-live":"polite","aria-atomic":"true",ref:f,onMouseLeave:function(){return m(null)}},a.default.createElement(r.AnimatePresence,{initial:!1},v.map((function(t,e){var n=u===t.id,i=null!==u,d=e*(i?10:-45);i&&(e>v.findIndex((function(t){return t.id===u}))&&(d+=60));return a.default.createElement(r.motion.div,{key:t.id,layout:!0,initial:o({opacity:0,y:-20},p()),animate:{opacity:1,x:0,y:s.startsWith("top")?d:-d,scale:n?1.02:1,zIndex:n?9999:9999-e},exit:{opacity:0,x:"left"===l?-100:"right"===l?100:0,y:"up"===l?-100:"down"===l?100:0},transition:{type:"spring",stiffness:500,damping:30,layout:{type:"spring",stiffness:200,damping:25}},style:{position:"absolute",width:"100%",transformOrigin:s.startsWith("top")?"top":"bottom"},onHoverStart:function(){return m(t.id)},drag:"left"===l||"right"===l?"x":"y",dragConstraints:{left:0,right:0,top:0,bottom:0},dragElastic:.9,onDragEnd:function(e,r){var n;(Math.abs(r.offset.x)>100||Math.abs(r.offset.y)>100)&&(null===(n=t.onClose)||void 0===n||n.call(t))}},a.default.createElement(c,o({},t,{isExpanded:n})))}))))};!function(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t))}}('.vyrn-toast-container{box-sizing:border-box;max-width:420px;padding:1rem;perspective:1000px;pointer-events:none;position:fixed;transform-style:preserve-3d;width:calc(100% - 2rem);z-index:9999}.vyrn-toast-top-right{right:max(env(safe-area-inset-right,0px),1rem);top:max(env(safe-area-inset-top,0px),1rem);transform-origin:top right}.vyrn-toast-top-left{left:max(env(safe-area-inset-left,0px),1rem);top:max(env(safe-area-inset-top,0px),1rem);transform-origin:top left}.vyrn-toast-bottom-right{bottom:max(env(safe-area-inset-bottom,0px),1rem);right:max(env(safe-area-inset-right,0px),1rem);transform-origin:bottom right}.vyrn-toast-bottom-left{bottom:max(env(safe-area-inset-bottom,0px),1rem);left:max(env(safe-area-inset-left,0px),1rem);transform-origin:bottom left}.vyrn-toast-top-center{left:50%;top:max(env(safe-area-inset-top,0px),1rem);transform:translateX(-50%);transform-origin:top center}.vyrn-toast-bottom-center{bottom:max(env(safe-area-inset-bottom,0px),1rem);left:50%;transform:translateX(-50%);transform-origin:bottom center}.vyrn-toast{-webkit-font-smoothing:subpixel-antialiased;backface-visibility:hidden;margin-bottom:.75rem;pointer-events:auto;position:relative;transform:translateZ(0)}.vyrn-toast-container::-webkit-scrollbar{width:6px}.vyrn-toast-container::-webkit-scrollbar-track{background:transparent}.vyrn-toast-container::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.2);border:2px solid transparent;border-radius:3px}.vyrn-toast-container>div{filter:drop-shadow(0 4px 12px rgba(0,0,0,.1));opacity:1;transform:scale(1);transition:all .2s cubic-bezier(.68,-.55,.265,1.55)}.vyrn-toast-container>div:not(:first-child){margin-top:-.5rem;opacity:.95;transform:scale(.95) translateY(5px);z-index:-1}.vyrn-toast-container>div:not(:first-child):not(:nth-child(2)){opacity:.9;transform:scale(.9) translateY(10px);z-index:-2}.vyrn-toast-container:hover>div:not(:first-child){opacity:1;transform:scale(.98) translateY(0)}@media (max-width:640px){.vyrn-toast-container{max-width:calc(100vw - 2rem);padding:.5rem}.vyrn-toast{margin-bottom:.5rem}.vyrn-toast-bottom-center,.vyrn-toast-bottom-left,.vyrn-toast-bottom-right{bottom:max(env(safe-area-inset-bottom,0px),.5rem)}}@media (prefers-reduced-motion:reduce){.vyrn-toast-container>div{transition:none}}@media (prefers-color-scheme:dark){.vyrn-toast-container>div{filter:drop-shadow(0 4px 12px rgba(0,0,0,.3))}}@supports (backdrop-filter:blur(10px)){.vyrn-toast-container:before{backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);content:"";inset:0;opacity:0;position:absolute;transition:opacity .3s ease;z-index:-1}.vyrn-toast-container:hover:before{opacity:1}}@keyframes vyrnSlideIn{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes vyrnSlideOut{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-20px) scale(.95)}}.vyrn-toast-enter{animation:vyrnSlideIn .3s cubic-bezier(.68,-.55,.265,1.55) forwards}.vyrn-toast-exit{animation:vyrnSlideOut .2s cubic-bezier(.68,-.55,.265,1.55) forwards}',{insertAt:"top"});var u=function(e){var r=e.children,n=e.position,l=void 0===n?"top-right":n,c=e.maxToasts,u=void 0===c?5:c,m=e.swipeDirection,f=void 0===m?"right":m,p=t.useState([]),v=p[0],b=p[1],y=t.useCallback((function(t){var e=Math.random().toString(36).substr(2,9);return b((function(r){return i(i([],r,!0),[o(o({},t),{id:e})],!1).slice(-u)})),e}),[u]),x=t.useCallback((function(t){b((function(e){return e.filter((function(e){return e.id!==t}))}))}),[]),g=t.useCallback((function(t,e){b((function(r){return r.map((function(r){return r.id===t?o(o({},r),e):r}))}))}),[]);return a.default.createElement(s.Provider,{value:{addToast:y,removeToast:x,updateToast:g,position:l}},r,a.default.createElement(d,{toasts:v,position:l,swipeDirection:f}))};exports.ClientToastProvider=function(t){var e=t.children,r=t.position,n=t.maxToasts,o=t.swipeDirection;return a.default.createElement(u,{position:r,maxToasts:n,swipeDirection:o},e)},exports.ToastProvider=u,exports.useToast=function(){var e=l(),r=e.addToast,n=e.removeToast,a=e.updateToast,i=e.position,s=t.useCallback((function(t){return r(o(o({},t),{type:t.type||"info"}))}),[r]),c=t.useCallback((function(t,e){a(t,e)}),[a]),d=t.useCallback((function(t){n(t)}),[n]);return{toast:s,update:c,dismiss:d,info:function(t,e){return s(o({message:t,type:"info"},e))},success:function(t,e){return s(o({message:t,type:"success"},e))},warning:function(t,e){return s(o({message:t,type:"warning"},e))},error:function(t,e){return s(o({message:t,type:"error"},e))},position:i}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("lucide-react"),n=require("framer-motion");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=r(t),a=function(){return a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},a.apply(this,arguments)};function i(t,e,n){if(n||2===arguments.length)for(var r,o=0,a=e.length;o<a;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var s=o.default.createContext(void 0),c=function(){var t=o.default.useContext(s);if(void 0===t)throw new Error("useToastContext must be used within a ToastProvider");return t},l=function(r){var a=r.id,i=r.message,s=r.type,l=r.duration,u=void 0===l?3e3:l,d=r.title,p=r.description,f=r.action,m=r.isExpanded,v=c(),y=v.removeToast;v.updateToast,t.useEffect((function(){var t=setTimeout((function(){y(a)}),u);return function(){return clearTimeout(t)}}),[a,u,y]);return o.default.createElement(n.motion.div,{className:"vyrn-toast vyrn-toast-".concat(s," ").concat(m?"vyrn-toast-expanded":""),role:"alert",animate:{height:m?"auto":"60px"}},function(){switch(s){case"success":return o.default.createElement(e.CheckCircle,{className:"vyrn-toast-icon"});case"error":return o.default.createElement(e.AlertCircle,{className:"vyrn-toast-icon"});case"info":return o.default.createElement(e.Info,{className:"vyrn-toast-icon"});case"warning":return o.default.createElement(e.AlertTriangle,{className:"vyrn-toast-icon"});default:return null}}(),o.default.createElement("div",{className:"vyrn-toast-content"},d&&o.default.createElement("div",{className:"vyrn-toast-title"},d),o.default.createElement("div",{className:"vyrn-toast-message"},i),m&&p&&o.default.createElement("div",{className:"vyrn-toast-description"},p)),m&&f&&o.default.createElement("button",{className:"vyrn-toast-action",onClick:f.onClick},f.label),o.default.createElement("button",{className:"vyrn-toast-close",onClick:function(){return y(a)},"aria-label":"Close"},o.default.createElement(e.X,{size:18})),o.default.createElement(n.motion.div,{className:"vyrn-toast-progress",initial:{width:"100%"},animate:{width:"0%"},transition:{duration:u/1e3,ease:"linear"}}))},u=function(e){var r=e.toasts,s=e.position,c=e.swipeDirection,u=t.useState(null),d=u[0],p=u[1],f=t.useRef(null);t.useEffect((function(){var t=function(t){f.current&&!f.current.contains(t.target)&&p(null)};return document.addEventListener("mousedown",t),function(){document.removeEventListener("mousedown",t)}}),[]);var m=function(){switch(c){case"left":return{x:-100};case"right":return{x:100};case"up":return{y:-100};case"down":return{y:100}}},v=i([],r,!0).reverse();return o.default.createElement("div",{className:"vyrn-toast-container vyrn-toast-".concat(s),"aria-live":"polite","aria-atomic":"true",ref:f,onMouseLeave:function(){return p(null)}},o.default.createElement(n.AnimatePresence,{initial:!1},v.map((function(t,e){var r=d===t.id,i=null!==d,u=e*(i?10:-45);i&&(e>v.findIndex((function(t){return t.id===d}))&&(u+=60));return o.default.createElement(n.motion.div,{key:t.id,layout:!0,initial:a({opacity:0,y:-20},m()),animate:{opacity:1,x:0,y:s.startsWith("top")?u:-u,scale:r?1.02:1,zIndex:r?9999:9999-e},exit:{opacity:0,x:"left"===c?-100:"right"===c?100:0,y:"up"===c?-100:"down"===c?100:0},transition:{type:"spring",stiffness:500,damping:30,layout:{type:"spring",stiffness:200,damping:25}},style:{position:"absolute",width:"100%",transformOrigin:s.startsWith("top")?"top":"bottom"},onHoverStart:function(){return p(t.id)},drag:"left"===c||"right"===c?"x":"y",dragConstraints:{left:0,right:0,top:0,bottom:0},dragElastic:.9,onDragEnd:function(e,n){var r;(Math.abs(n.offset.x)>100||Math.abs(n.offset.y)>100)&&(null===(r=t.onClose)||void 0===r||r.call(t))}},o.default.createElement(l,a({},t,{isExpanded:r})))}))))};!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".vyrn-toast-container{box-sizing:border-box;max-width:380px;padding:1rem;pointer-events:none;position:fixed;width:100%;z-index:9999}.vyrn-toast-bottom-right,.vyrn-toast-top-right{right:1rem}.vyrn-toast-bottom-left,.vyrn-toast-top-left{left:1rem}.vyrn-toast-bottom-center,.vyrn-toast-top-center{left:50%;transform:translateX(-50%)}.vyrn-toast-top-center,.vyrn-toast-top-left,.vyrn-toast-top-right{top:1rem}.vyrn-toast-bottom-center,.vyrn-toast-bottom-left,.vyrn-toast-bottom-right{bottom:1rem}.vyrn-toast{align-items:center;background:#fff;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,.15);cursor:pointer;display:flex;height:60px;overflow:hidden;padding:12px 16px;pointer-events:auto;position:relative;transition:all .2s ease;will-change:transform}.vyrn-toast-expanded{box-shadow:0 8px 24px rgba(0,0,0,.2);height:auto!important}.vyrn-toast-expanded .vyrn-toast-message{white-space:normal}.vyrn-toast-expanded .vyrn-toast-description{display:block;max-height:200px}.vyrn-toast-icon{flex-shrink:0;height:20px;margin-right:12px;width:20px}.vyrn-toast-content{flex-grow:1;margin-right:12px;overflow:hidden}.vyrn-toast-title{font-size:1rem;font-weight:600;margin-bottom:4px}.vyrn-toast-message,.vyrn-toast-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vyrn-toast-message{font-size:.875rem;line-height:1.25rem;transition:white-space .2s ease}.vyrn-toast-description{font-size:.75rem;margin-top:4px;max-height:0;opacity:.8;overflow:hidden;transition:max-height .3s ease,opacity .3s ease}.vyrn-toast-close{align-items:center;background:none;border:none;color:inherit;cursor:pointer;display:flex;justify-content:center;opacity:.7;padding:0;transition:opacity .2s}.vyrn-toast-close:hover{opacity:1}.vyrn-toast-action{background:none;border:none;border-radius:4px;color:inherit;cursor:pointer;font-weight:600;padding:4px 8px;transition:background-color .2s}.vyrn-toast-action:hover{background-color:rgba(0,0,0,.05)}.vyrn-toast-info{border-left:4px solid #3498db}.vyrn-toast-success{border-left:4px solid #2ecc71}.vyrn-toast-warning{border-left:4px solid #f39c12}.vyrn-toast-error{border-left:4px solid #e74c3c}.vyrn-toast-progress{background-color:rgba(0,0,0,.2);bottom:0;height:3px;left:0;position:absolute}@keyframes vyrnSlideIn{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}@keyframes vyrnFadeOut{0%{opacity:1}to{opacity:0}}.vyrn-toast-enter{animation:vyrnSlideIn .3s ease-out}.vyrn-toast-exit{animation:vyrnFadeOut .3s ease-in forwards}",{insertAt:"top"});var d=function(e){var n=e.children,r=e.position,c=void 0===r?"top-right":r,l=e.maxToasts,d=void 0===l?5:l,p=e.swipeDirection,f=void 0===p?"right":p,m=t.useState([]),v=m[0],y=m[1],g=t.useCallback((function(t){var e=Math.random().toString(36).substr(2,9);return y((function(n){return i(i([],n,!0),[a(a({},t),{id:e})],!1).slice(-d)})),e}),[d]),h=t.useCallback((function(t){y((function(e){return e.filter((function(e){return e.id!==t}))}))}),[]),x=t.useCallback((function(t,e){y((function(n){return n.map((function(n){return n.id===t?a(a({},n),e):n}))}))}),[]);return o.default.createElement(s.Provider,{value:{addToast:g,removeToast:h,updateToast:x,position:c}},n,o.default.createElement(u,{toasts:v,position:c,swipeDirection:f}))};exports.ClientToastProvider=function(t){var e=t.children,n=t.position,r=t.maxToasts,a=t.swipeDirection;return o.default.createElement(d,{position:n,maxToasts:r,swipeDirection:a},e)},exports.ToastProvider=d,exports.useToast=function(){var e=c(),n=e.addToast,r=e.removeToast,o=e.updateToast,i=e.position,s=t.useCallback((function(t){return n(a(a({},t),{type:t.type||"info"}))}),[n]),l=t.useCallback((function(t,e){o(t,e)}),[o]),u=t.useCallback((function(t){r(t)}),[r]);return{toast:s,update:l,dismiss:u,info:function(t,e){return s(a({message:t,type:"info"},e))},success:function(t,e){return s(a({message:t,type:"success"},e))},warning:function(t,e){return s(a({message:t,type:"warning"},e))},error:function(t,e){return s(a({message:t,type:"error"},e))},position:i}};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode"],"mappings":"+6HAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBY,CAqB1D"}
|
package/package.json
CHANGED
package/src/components/Toast.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import React, { useEffect } from 'react';
|
|
2
4
|
import { ToastProps } from '../types';
|
|
3
5
|
import { useToastContext } from '../context/ToastContext';
|
|
@@ -9,17 +11,17 @@ interface ToastComponentProps extends ToastProps {
|
|
|
9
11
|
isExpanded: boolean;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
export const Toast: React.FC<ToastComponentProps> = ({
|
|
13
|
-
id,
|
|
14
|
-
message,
|
|
15
|
-
type,
|
|
14
|
+
export const Toast: React.FC<ToastComponentProps> = ({
|
|
15
|
+
id,
|
|
16
|
+
message,
|
|
17
|
+
type,
|
|
16
18
|
duration = DEFAULT_DURATION,
|
|
17
19
|
title,
|
|
18
20
|
description,
|
|
19
21
|
action,
|
|
20
22
|
isExpanded
|
|
21
23
|
}) => {
|
|
22
|
-
const { removeToast } = useToastContext();
|
|
24
|
+
const { removeToast, updateToast } = useToastContext();
|
|
23
25
|
|
|
24
26
|
useEffect(() => {
|
|
25
27
|
const timer = setTimeout(() => {
|
|
@@ -29,149 +31,52 @@ export const Toast: React.FC<ToastComponentProps> = ({
|
|
|
29
31
|
return () => clearTimeout(timer);
|
|
30
32
|
}, [id, duration, removeToast]);
|
|
31
33
|
|
|
32
|
-
const iconProps = {
|
|
33
|
-
className: `w-5 h-5 ${
|
|
34
|
-
type === 'success' ? 'text-emerald-500' :
|
|
35
|
-
type === 'error' ? 'text-rose-500' :
|
|
36
|
-
type === 'warning' ? 'text-amber-500' :
|
|
37
|
-
'text-blue-500'
|
|
38
|
-
}`
|
|
39
|
-
};
|
|
40
|
-
|
|
41
34
|
const getIcon = () => {
|
|
42
35
|
switch (type) {
|
|
43
|
-
case 'success':
|
|
44
|
-
|
|
45
|
-
case '
|
|
46
|
-
|
|
36
|
+
case 'success':
|
|
37
|
+
return <CheckCircle className="vyrn-toast-icon" />;
|
|
38
|
+
case 'error':
|
|
39
|
+
return <AlertCircle className="vyrn-toast-icon" />;
|
|
40
|
+
case 'info':
|
|
41
|
+
return <Info className="vyrn-toast-icon" />;
|
|
42
|
+
case 'warning':
|
|
43
|
+
return <AlertTriangle className="vyrn-toast-icon" />;
|
|
44
|
+
default:
|
|
45
|
+
return null;
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
48
|
|
|
50
|
-
const toastStyles = {
|
|
51
|
-
success: 'bg-gradient-to-r from-emerald-50 to-green-50 border-l-emerald-500',
|
|
52
|
-
error: 'bg-gradient-to-r from-rose-50 to-red-50 border-l-rose-500',
|
|
53
|
-
warning: 'bg-gradient-to-r from-amber-50 to-yellow-50 border-l-amber-500',
|
|
54
|
-
info: 'bg-gradient-to-r from-blue-50 to-sky-50 border-l-blue-500'
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const progressStyles = {
|
|
58
|
-
success: 'bg-emerald-500',
|
|
59
|
-
error: 'bg-rose-500',
|
|
60
|
-
warning: 'bg-amber-500',
|
|
61
|
-
info: 'bg-blue-500'
|
|
62
|
-
};
|
|
63
|
-
|
|
64
49
|
return (
|
|
65
|
-
<motion.div
|
|
66
|
-
className={`
|
|
67
|
-
relative
|
|
68
|
-
overflow-hidden
|
|
69
|
-
rounded-lg
|
|
70
|
-
border-l-4
|
|
71
|
-
shadow-lg
|
|
72
|
-
backdrop-blur-md
|
|
73
|
-
${toastStyles[type]}
|
|
74
|
-
transition-all
|
|
75
|
-
duration-200
|
|
76
|
-
hover:shadow-xl
|
|
77
|
-
hover:scale-[1.02]
|
|
78
|
-
${isExpanded ? 'ring-2 ring-offset-2 ring-offset-white dark:ring-offset-gray-900' : ''}
|
|
79
|
-
`}
|
|
50
|
+
<motion.div
|
|
51
|
+
className={`vyrn-toast vyrn-toast-${type} ${isExpanded ? 'vyrn-toast-expanded' : ''}`}
|
|
80
52
|
role="alert"
|
|
81
|
-
|
|
82
|
-
animate={{
|
|
83
|
-
opacity: 1,
|
|
84
|
-
y: 0,
|
|
85
|
-
height: isExpanded ? 'auto' : '64px'
|
|
86
|
-
}}
|
|
87
|
-
exit={{ opacity: 0, scale: 0.95 }}
|
|
88
|
-
transition={{ duration: 0.2 }}
|
|
53
|
+
animate={{ height: isExpanded ? 'auto' : '60px' }}
|
|
89
54
|
>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div className="flex-1 min-w-0">
|
|
96
|
-
{title && (
|
|
97
|
-
<motion.h3
|
|
98
|
-
className="font-semibold text-gray-900 dark:text-gray-100 mb-1"
|
|
99
|
-
layout
|
|
100
|
-
>
|
|
101
|
-
{title}
|
|
102
|
-
</motion.h3>
|
|
103
|
-
)}
|
|
104
|
-
|
|
105
|
-
<motion.div
|
|
106
|
-
className={`
|
|
107
|
-
text-sm text-gray-700 dark:text-gray-300
|
|
108
|
-
transition-all duration-200
|
|
109
|
-
${isExpanded ? 'whitespace-normal' : 'whitespace-nowrap overflow-hidden text-ellipsis'}
|
|
110
|
-
`}
|
|
111
|
-
layout
|
|
112
|
-
>
|
|
113
|
-
{message}
|
|
114
|
-
</motion.div>
|
|
115
|
-
|
|
116
|
-
{description && (
|
|
117
|
-
<motion.div
|
|
118
|
-
className={`
|
|
119
|
-
mt-2 text-sm text-gray-600 dark:text-gray-400
|
|
120
|
-
transition-all duration-200
|
|
121
|
-
${isExpanded ? 'opacity-100' : 'opacity-0 h-0'}
|
|
122
|
-
`}
|
|
123
|
-
layout
|
|
124
|
-
>
|
|
125
|
-
{description}
|
|
126
|
-
</motion.div>
|
|
127
|
-
)}
|
|
128
|
-
</div>
|
|
129
|
-
|
|
130
|
-
<div className="flex-shrink-0 flex items-start gap-2">
|
|
131
|
-
{action && isExpanded && (
|
|
132
|
-
<motion.button
|
|
133
|
-
className={`
|
|
134
|
-
px-3 py-1.5
|
|
135
|
-
text-sm font-medium
|
|
136
|
-
rounded-md
|
|
137
|
-
transition-colors
|
|
138
|
-
${type === 'success' ? 'bg-emerald-100 hover:bg-emerald-200 text-emerald-700' :
|
|
139
|
-
type === 'error' ? 'bg-rose-100 hover:bg-rose-200 text-rose-700' :
|
|
140
|
-
type === 'warning' ? 'bg-amber-100 hover:bg-amber-200 text-amber-700' :
|
|
141
|
-
'bg-blue-100 hover:bg-blue-200 text-blue-700'}
|
|
142
|
-
`}
|
|
143
|
-
onClick={action.onClick}
|
|
144
|
-
initial={{ opacity: 0, scale: 0.9 }}
|
|
145
|
-
animate={{ opacity: 1, scale: 1 }}
|
|
146
|
-
exit={{ opacity: 0, scale: 0.9 }}
|
|
147
|
-
>
|
|
148
|
-
{action.label}
|
|
149
|
-
</motion.button>
|
|
150
|
-
)}
|
|
151
|
-
|
|
152
|
-
<button
|
|
153
|
-
className="p-1 rounded-full opacity-60 hover:opacity-100 transition-opacity"
|
|
154
|
-
onClick={() => removeToast(id)}
|
|
155
|
-
aria-label="Close"
|
|
156
|
-
>
|
|
157
|
-
<X className="w-4 h-4" />
|
|
158
|
-
</button>
|
|
159
|
-
</div>
|
|
55
|
+
{getIcon()}
|
|
56
|
+
<div className="vyrn-toast-content">
|
|
57
|
+
{title && <div className="vyrn-toast-title">{title}</div>}
|
|
58
|
+
<div className="vyrn-toast-message">{message}</div>
|
|
59
|
+
{isExpanded && description && <div className="vyrn-toast-description">{description}</div>}
|
|
160
60
|
</div>
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
61
|
+
{isExpanded && action && (
|
|
62
|
+
<button className="vyrn-toast-action" onClick={action.onClick}>
|
|
63
|
+
{action.label}
|
|
64
|
+
</button>
|
|
65
|
+
)}
|
|
66
|
+
<button
|
|
67
|
+
className="vyrn-toast-close"
|
|
68
|
+
onClick={() => removeToast(id)}
|
|
69
|
+
aria-label="Close"
|
|
70
|
+
>
|
|
71
|
+
<X size={18} />
|
|
72
|
+
</button>
|
|
73
|
+
<motion.div
|
|
74
|
+
className="vyrn-toast-progress"
|
|
168
75
|
initial={{ width: '100%' }}
|
|
169
76
|
animate={{ width: '0%' }}
|
|
170
|
-
transition={{
|
|
171
|
-
duration: duration / 1000,
|
|
172
|
-
ease: 'linear'
|
|
173
|
-
}}
|
|
77
|
+
transition={{ duration: duration / 1000, ease: 'linear' }}
|
|
174
78
|
/>
|
|
175
79
|
</motion.div>
|
|
176
80
|
);
|
|
177
81
|
};
|
|
82
|
+
|
package/src/styles/toast.css
CHANGED
|
@@ -1,187 +1,188 @@
|
|
|
1
|
-
/* Base container styles */
|
|
2
1
|
.vyrn-toast-container {
|
|
3
2
|
position: fixed;
|
|
4
3
|
z-index: 9999;
|
|
5
|
-
max-width:
|
|
6
|
-
width:
|
|
4
|
+
max-width: 380px;
|
|
5
|
+
width: 100%;
|
|
7
6
|
pointer-events: none;
|
|
8
7
|
padding: 1rem;
|
|
9
8
|
box-sizing: border-box;
|
|
10
|
-
perspective: 1000px;
|
|
11
|
-
transform-style: preserve-3d;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/* Container positions with safe area insets */
|
|
15
|
-
.vyrn-toast-top-right {
|
|
16
|
-
top: max(env(safe-area-inset-top, 0px), 1rem);
|
|
17
|
-
right: max(env(safe-area-inset-right, 0px), 1rem);
|
|
18
|
-
transform-origin: top right;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.vyrn-toast-top-left {
|
|
22
|
-
top: max(env(safe-area-inset-top, 0px), 1rem);
|
|
23
|
-
left: max(env(safe-area-inset-left, 0px), 1rem);
|
|
24
|
-
transform-origin: top left;
|
|
25
9
|
}
|
|
26
10
|
|
|
11
|
+
/* Existing position classes - unchanged */
|
|
12
|
+
.vyrn-toast-top-right,
|
|
27
13
|
.vyrn-toast-bottom-right {
|
|
28
|
-
|
|
29
|
-
right: max(env(safe-area-inset-right, 0px), 1rem);
|
|
30
|
-
transform-origin: bottom right;
|
|
14
|
+
right: 1rem;
|
|
31
15
|
}
|
|
32
|
-
|
|
16
|
+
.vyrn-toast-top-left,
|
|
33
17
|
.vyrn-toast-bottom-left {
|
|
34
|
-
|
|
35
|
-
left: max(env(safe-area-inset-left, 0px), 1rem);
|
|
36
|
-
transform-origin: bottom left;
|
|
18
|
+
left: 1rem;
|
|
37
19
|
}
|
|
38
|
-
|
|
39
|
-
.vyrn-toast-
|
|
40
|
-
top: max(env(safe-area-inset-top, 0px), 1rem);
|
|
20
|
+
.vyrn-toast-top-center,
|
|
21
|
+
.vyrn-toast-bottom-center {
|
|
41
22
|
left: 50%;
|
|
42
23
|
transform: translateX(-50%);
|
|
43
|
-
transform-origin: top center;
|
|
44
24
|
}
|
|
45
|
-
|
|
25
|
+
.vyrn-toast-top-right,
|
|
26
|
+
.vyrn-toast-top-left,
|
|
27
|
+
.vyrn-toast-top-center {
|
|
28
|
+
top: 1rem;
|
|
29
|
+
}
|
|
30
|
+
.vyrn-toast-bottom-right,
|
|
31
|
+
.vyrn-toast-bottom-left,
|
|
46
32
|
.vyrn-toast-bottom-center {
|
|
47
|
-
bottom:
|
|
48
|
-
left: 50%;
|
|
49
|
-
transform: translateX(-50%);
|
|
50
|
-
transform-origin: bottom center;
|
|
33
|
+
bottom: 1rem;
|
|
51
34
|
}
|
|
52
35
|
|
|
53
|
-
/*
|
|
36
|
+
/* Updated toast styles */
|
|
37
|
+
|
|
54
38
|
.vyrn-toast {
|
|
55
|
-
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
padding: 12px 16px;
|
|
42
|
+
border-radius: 8px;
|
|
43
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
44
|
+
background: #fff;
|
|
45
|
+
overflow: hidden;
|
|
56
46
|
position: relative;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
-
|
|
47
|
+
pointer-events: auto;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
transition: all 0.2s ease;
|
|
50
|
+
will-change: transform;
|
|
51
|
+
height: 60px;
|
|
61
52
|
}
|
|
62
53
|
|
|
63
|
-
/*
|
|
64
|
-
.vyrn-toast-
|
|
65
|
-
|
|
54
|
+
/* New styles for expanded state */
|
|
55
|
+
.vyrn-toast-expanded {
|
|
56
|
+
height: auto !important;
|
|
57
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
|
|
66
58
|
}
|
|
67
59
|
|
|
68
|
-
.vyrn-toast-
|
|
69
|
-
|
|
60
|
+
.vyrn-toast-expanded .vyrn-toast-message {
|
|
61
|
+
white-space: normal;
|
|
70
62
|
}
|
|
71
63
|
|
|
72
|
-
.vyrn-toast-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
border: 2px solid transparent;
|
|
64
|
+
.vyrn-toast-expanded .vyrn-toast-description {
|
|
65
|
+
display: block;
|
|
66
|
+
max-height: 200px;
|
|
76
67
|
}
|
|
77
68
|
|
|
78
|
-
/*
|
|
79
|
-
.vyrn-toast-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
69
|
+
/* Rest of the existing styles remain unchanged */
|
|
70
|
+
.vyrn-toast-icon {
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
margin-right: 12px;
|
|
73
|
+
width: 20px;
|
|
74
|
+
height: 20px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.vyrn-toast-content {
|
|
78
|
+
flex-grow: 1;
|
|
79
|
+
margin-right: 12px;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.vyrn-toast-title {
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
font-size: 1rem;
|
|
86
|
+
margin-bottom: 4px;
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
text-overflow: ellipsis;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.vyrn-toast-message {
|
|
93
|
+
font-size: 0.875rem;
|
|
94
|
+
line-height: 1.25rem;
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
text-overflow: ellipsis;
|
|
98
|
+
transition: white-space 0.2s ease;
|
|
84
99
|
}
|
|
85
100
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
margin-top:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
.vyrn-toast-description {
|
|
102
|
+
font-size: 0.75rem;
|
|
103
|
+
margin-top: 4px;
|
|
104
|
+
opacity: 0.8;
|
|
105
|
+
max-height: 0;
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
transition: max-height 0.3s ease, opacity 0.3s ease;
|
|
92
108
|
}
|
|
93
109
|
|
|
94
|
-
.vyrn-toast-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
.vyrn-toast-close {
|
|
111
|
+
background: none;
|
|
112
|
+
border: none;
|
|
113
|
+
color: inherit;
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
opacity: 0.7;
|
|
116
|
+
transition: opacity 0.2s;
|
|
117
|
+
padding: 0;
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
justify-content: center;
|
|
98
121
|
}
|
|
99
122
|
|
|
100
|
-
|
|
101
|
-
.vyrn-toast-container:hover > div:not(:first-child) {
|
|
102
|
-
transform: scale(0.98) translateY(0);
|
|
123
|
+
.vyrn-toast-close:hover {
|
|
103
124
|
opacity: 1;
|
|
104
125
|
}
|
|
105
126
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* Adjust positioning for mobile safe areas */
|
|
118
|
-
.vyrn-toast-bottom-center,
|
|
119
|
-
.vyrn-toast-bottom-left,
|
|
120
|
-
.vyrn-toast-bottom-right {
|
|
121
|
-
bottom: max(env(safe-area-inset-bottom, 0px), 0.5rem);
|
|
122
|
-
}
|
|
127
|
+
.vyrn-toast-action {
|
|
128
|
+
background: none;
|
|
129
|
+
border: none;
|
|
130
|
+
color: inherit;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
font-weight: 600;
|
|
133
|
+
padding: 4px 8px;
|
|
134
|
+
border-radius: 4px;
|
|
135
|
+
transition: background-color 0.2s;
|
|
123
136
|
}
|
|
124
137
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
.vyrn-toast-container > div {
|
|
128
|
-
transition: none;
|
|
129
|
-
}
|
|
138
|
+
.vyrn-toast-action:hover {
|
|
139
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
130
140
|
}
|
|
131
141
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
142
|
+
.vyrn-toast-info {
|
|
143
|
+
border-left: 4px solid #3498db;
|
|
144
|
+
}
|
|
145
|
+
.vyrn-toast-success {
|
|
146
|
+
border-left: 4px solid #2ecc71;
|
|
147
|
+
}
|
|
148
|
+
.vyrn-toast-warning {
|
|
149
|
+
border-left: 4px solid #f39c12;
|
|
150
|
+
}
|
|
151
|
+
.vyrn-toast-error {
|
|
152
|
+
border-left: 4px solid #e74c3c;
|
|
137
153
|
}
|
|
138
154
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
backdrop-filter: blur(8px);
|
|
146
|
-
-webkit-backdrop-filter: blur(8px);
|
|
147
|
-
z-index: -1;
|
|
148
|
-
opacity: 0;
|
|
149
|
-
transition: opacity 0.3s ease;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.vyrn-toast-container:hover::before {
|
|
153
|
-
opacity: 1;
|
|
154
|
-
}
|
|
155
|
+
.vyrn-toast-progress {
|
|
156
|
+
position: absolute;
|
|
157
|
+
bottom: 0;
|
|
158
|
+
left: 0;
|
|
159
|
+
height: 3px;
|
|
160
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
155
161
|
}
|
|
156
162
|
|
|
157
|
-
/* Animation keyframes for enter/exit */
|
|
158
163
|
@keyframes vyrnSlideIn {
|
|
159
164
|
from {
|
|
160
|
-
transform: translateY(20px)
|
|
165
|
+
transform: translateY(20px);
|
|
161
166
|
opacity: 0;
|
|
162
167
|
}
|
|
163
168
|
to {
|
|
164
|
-
transform: translateY(0)
|
|
169
|
+
transform: translateY(0);
|
|
165
170
|
opacity: 1;
|
|
166
171
|
}
|
|
167
172
|
}
|
|
168
173
|
|
|
169
|
-
@keyframes
|
|
174
|
+
@keyframes vyrnFadeOut {
|
|
170
175
|
from {
|
|
171
|
-
transform: translateY(0) scale(1);
|
|
172
176
|
opacity: 1;
|
|
173
177
|
}
|
|
174
178
|
to {
|
|
175
|
-
transform: translateY(-20px) scale(0.95);
|
|
176
179
|
opacity: 0;
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
182
|
|
|
180
|
-
/* Toast animations */
|
|
181
183
|
.vyrn-toast-enter {
|
|
182
|
-
animation: vyrnSlideIn 0.3s
|
|
184
|
+
animation: vyrnSlideIn 0.3s ease-out;
|
|
183
185
|
}
|
|
184
|
-
|
|
185
186
|
.vyrn-toast-exit {
|
|
186
|
-
animation:
|
|
187
|
+
animation: vyrnFadeOut 0.3s ease-in forwards;
|
|
187
188
|
}
|