@edinelsonslima/toast-notification 0.1.40 → 0.1.42
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/index.iife.js +27 -0
- package/package.json +8 -8
- package/style.css +1 -1
- package/index.umd.js +0 -27
package/index.iife.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var Er=Object.defineProperty;var Rr=(w,b,D)=>b in w?Er(w,b,{enumerable:!0,configurable:!0,writable:!0,value:D}):w[b]=D;var Le=(w,b,D)=>(Rr(w,typeof b!="symbol"?b+"":b,D),D);this.toast=this.toast||{};this.toast.notification=function(w,b){"use strict";class D{constructor(){Le(this,"listeners",new Map([]))}on(u,_){var l;this.listeners.has(u)||this.listeners.set(u,[]),(l=this.listeners.get(u))==null||l.push(_)}emit(u,_){var l;this.listeners.has(u)&&((l=this.listeners.get(u))==null||l.forEach(E=>E(_)))}removeListener(u,_){const l=this.listeners.get(u);if(!l)return;const E=l.filter(f=>f!==_);this.listeners.set(u,E)}}function $(o){return function(u){if(b.isValidElement(u))return A({content:u,type:o});const{content:_,duration:l}=u;return A({content:_,duration:l,type:o})}}function Ue(o){if(o)return b.isValidElement(o)||typeof o!="object"||Array.isArray(o)?o:JSON.stringify(o)}const ee=new D;function A({duration:o,content:u,type:_}){u=Ue(u),ee.emit("add-toast",{content:u,duration:o,type:_})}A.error=$("error"),A.success=$("success"),A.warn=$("warn"),A.info=$("info"),A.ghost=$("ghost");var re={exports:{}},G={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.development.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var de;function Ye(){return de||(de=1,process.env.NODE_ENV!=="production"&&function(){var o=b,u=Symbol.for("react.element"),_=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),C=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),x=Symbol.iterator,W="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=x&&e[x]||e[W];return typeof r=="function"?r:null}var j=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];U("error",e,t)}}function U(e,r,t){{var n=j.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var c=t.map(function(i){return String(i)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var ne=!1,Be=!1,Je=!1,ze=!1,Ke=!1,ve;ve=Symbol.for("react.module.reference");function He(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===f||Ke||e===E||e===P||e===g||ze||e===T||ne||Be||Je||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===R||e.$$typeof===O||e.$$typeof===C||e.$$typeof===d||e.$$typeof===ve||e.getModuleId!==void 0))}function Xe(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function _e(e){return e.displayName||"Context"}function k(e){if(e==null)return null;if(typeof e.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case _:return"Portal";case f:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case C:var r=e;return _e(r)+".Consumer";case O:var t=e;return _e(t._context)+".Provider";case d:return Xe(e,e.render,"ForwardRef");case R:var n=e.displayName||null;return n!==null?n:k(e.type)||"Memo";case p:{var s=e,c=s._payload,i=s._init;try{return k(i(c))}catch{return null}}}return null}var M=Object.assign,J=0,ge,pe,he,be,ye,Ee,Re;function je(){}je.__reactDisabledLog=!0;function Ze(){{if(J===0){ge=console.log,pe=console.info,he=console.warn,be=console.error,ye=console.group,Ee=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:je,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function Qe(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:ge}),info:M({},e,{value:pe}),warn:M({},e,{value:he}),error:M({},e,{value:be}),group:M({},e,{value:ye}),groupCollapsed:M({},e,{value:Ee}),groupEnd:M({},e,{value:Re})})}J<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var oe=j.ReactCurrentDispatcher,ae;function X(e,r,t){{if(ae===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ae=n&&n[1]||""}return`
|
|
10
|
+
`+ae+e}}var ie=!1,Z;{var qe=typeof WeakMap=="function"?WeakMap:Map;Z=new qe}function Ce(e,r){if(!e||ie)return"";{var t=Z.get(e);if(t!==void 0)return t}var n;ie=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=oe.current,oe.current=null,Ze();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(I){n=I}Reflect.construct(e,[],i)}else{try{i.call()}catch(I){n=I}e.call(i.prototype)}}else{try{throw Error()}catch(I){n=I}e()}}catch(I){if(I&&n&&typeof I.stack=="string"){for(var a=I.stack.split(`
|
|
11
|
+
`),y=n.stack.split(`
|
|
12
|
+
`),m=a.length-1,v=y.length-1;m>=1&&v>=0&&a[m]!==y[v];)v--;for(;m>=1&&v>=0;m--,v--)if(a[m]!==y[v]){if(m!==1||v!==1)do if(m--,v--,v<0||a[m]!==y[v]){var S=`
|
|
13
|
+
`+a[m].replace(" at new "," at ");return e.displayName&&S.includes("<anonymous>")&&(S=S.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,S),S}while(m>=1&&v>=0);break}}}finally{ie=!1,oe.current=c,Qe(),Error.prepareStackTrace=s}var V=e?e.displayName||e.name:"",We=V?X(V):"";return typeof e=="function"&&Z.set(e,We),We}function Ne(e,r,t){return Ce(e,!1)}function er(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Q(e,r,t){if(e==null)return"";if(typeof e=="function")return Ce(e,er(e));if(typeof e=="string")return X(e);switch(e){case P:return X("Suspense");case g:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Ne(e.render);case R:return Q(e.type,r,t);case p:{var n=e,s=n._payload,c=n._init;try{return Q(c(s),r,t)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Te={},Se=j.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=Q(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(t)}else Se.setExtraStackFrame(null)}function rr(e,r,t,n,s){{var c=Function.call.bind(q);for(var i in e)if(c(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var y=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){a=m}a&&!(a instanceof Error)&&(N(s),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),N(null)),a instanceof Error&&!(a.message in Te)&&(Te[a.message]=!0,N(s),h("Failed %s type: %s",t,a.message),N(null))}}}var tr=Array.isArray;function se(e){return tr(e)}function nr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function or(e){try{return Oe(e),!1}catch{return!0}}function Oe(e){return""+e}function we(e){if(or(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nr(e)),Oe(e)}var z=j.ReactCurrentOwner,ar={key:!0,ref:!0,__self:!0,__source:!0},Pe,xe,ue;ue={};function ir(e){if(q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function sr(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ur(e,r){if(typeof e.ref=="string"&&z.current&&r&&z.current.stateNode!==r){var t=k(z.current.type);ue[t]||(h('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k(z.current.type),e.ref),ue[t]=!0)}}function cr(e,r){{var t=function(){Pe||(Pe=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function fr(e,r){{var t=function(){xe||(xe=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var lr=function(e,r,t,n,s,c,i){var a={$$typeof:u,type:e,key:r,ref:t,props:i,_owner:c};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function dr(e,r,t,n,s){{var c,i={},a=null,y=null;t!==void 0&&(we(t),a=""+t),sr(r)&&(we(r.key),a=""+r.key),ir(r)&&(y=r.ref,ur(r,s));for(c in r)q.call(r,c)&&!ar.hasOwnProperty(c)&&(i[c]=r[c]);if(e&&e.defaultProps){var m=e.defaultProps;for(c in m)i[c]===void 0&&(i[c]=m[c])}if(a||y){var v=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&cr(i,v),y&&fr(i,v)}return lr(e,a,y,s,n,z.current,i)}}var ce=j.ReactCurrentOwner,ke=j.ReactDebugCurrentFrame;function Y(e){if(e){var r=e._owner,t=Q(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(t)}else ke.setExtraStackFrame(null)}var fe;fe=!1;function le(e){return typeof e=="object"&&e!==null&&e.$$typeof===u}function Ie(){{if(ce.current){var e=k(ce.current.type);if(e)return`
|
|
14
|
+
|
|
15
|
+
Check the render method of \``+e+"`."}return""}}function mr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
16
|
+
|
|
17
|
+
Check your code at `+r+":"+t+"."}return""}}var Ae={};function vr(e){{var r=Ie();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
18
|
+
|
|
19
|
+
Check the top-level render call using <`+t+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=vr(r);if(Ae[t])return;Ae[t]=!0;var n="";e&&e._owner&&e._owner!==ce.current&&(n=" It was passed a child from "+k(e._owner.type)+"."),Y(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),Y(null)}}function Fe(e,r){{if(typeof e!="object")return;if(se(e))for(var t=0;t<e.length;t++){var n=e[t];le(n)&&De(n,r)}else if(le(e))e._store&&(e._store.validated=!0);else if(e){var s=L(e);if(typeof s=="function"&&s!==e.entries)for(var c=s.call(e),i;!(i=c.next()).done;)le(i.value)&&De(i.value,r)}}}function _r(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===R))t=r.propTypes;else return;if(t){var n=k(r);rr(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!fe){fe=!0;var s=k(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function gr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){Y(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),Y(null);break}}e.ref!==null&&(Y(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),Y(null))}}function Me(e,r,t,n,s,c){{var i=He(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var y=mr(s);y?a+=y:a+=Ie();var m;e===null?m="null":se(e)?m="array":e!==void 0&&e.$$typeof===u?(m="<"+(k(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,a)}var v=dr(e,r,t,s,c);if(v==null)return v;if(i){var S=r.children;if(S!==void 0)if(n)if(se(S)){for(var V=0;V<S.length;V++)Fe(S[V],e);Object.freeze&&Object.freeze(S)}else h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(S,e)}return e===l?gr(v):_r(v),v}}function pr(e,r,t){return Me(e,r,t,!0)}function hr(e,r,t){return Me(e,r,t,!1)}var br=hr,yr=pr;G.Fragment=l,G.jsx=br,G.jsxs=yr}()),G}var B={};/**
|
|
20
|
+
* @license React
|
|
21
|
+
* react-jsx-runtime.production.min.js
|
|
22
|
+
*
|
|
23
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
+
*
|
|
25
|
+
* This source code is licensed under the MIT license found in the
|
|
26
|
+
* LICENSE file in the root directory of this source tree.
|
|
27
|
+
*/var me;function Ve(){if(me)return B;me=1;var o=b,u=Symbol.for("react.element"),_=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,E=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function O(C,d,P){var g,R={},p=null,T=null;P!==void 0&&(p=""+P),d.key!==void 0&&(p=""+d.key),d.ref!==void 0&&(T=d.ref);for(g in d)l.call(d,g)&&!f.hasOwnProperty(g)&&(R[g]=d[g]);if(C&&C.defaultProps)for(g in d=C.defaultProps,d)R[g]===void 0&&(R[g]=d[g]);return{$$typeof:u,type:C,key:p,ref:T,props:R,_owner:E.current}}return B.Fragment=_,B.jsx=O,B.jsxs=O,B}process.env.NODE_ENV==="production"?re.exports=Ve():re.exports=Ye();var te=re.exports;function K(o){if(!(!o||typeof o!="object"))return o}function H(o){return!o||typeof o!="string"?"":o}const F={"toast-container":"_toast-container_1ojrm_1","animation-message-right-top":"_animation-message-right-top_1ojrm_9","animation-message-right-center":"_animation-message-right-center_1ojrm_10","animation-message-right-bottom":"_animation-message-right-bottom_1ojrm_11",screenRightIn:"_screenRightIn_1ojrm_1","right-top":"_right-top_1ojrm_15","right-center":"_right-center_1ojrm_16","right-bottom":"_right-bottom_1ojrm_17","animation-message-center-top":"_animation-message-center-top_1ojrm_37","animation-message-center-bottom":"_animation-message-center-bottom_1ojrm_38","animation-message-center-center":"_animation-message-center-center_1ojrm_39",screenCenterIn:"_screenCenterIn_1ojrm_1","center-top":"_center-top_1ojrm_43","center-center":"_center-center_1ojrm_44","center-bottom":"_center-bottom_1ojrm_45","animation-message-left-top":"_animation-message-left-top_1ojrm_64","animation-message-left-center":"_animation-message-left-center_1ojrm_65","animation-message-left-bottom":"_animation-message-left-bottom_1ojrm_66",screenLeftIn:"_screenLeftIn_1ojrm_1","left-top":"_left-top_1ojrm_70","left-center":"_left-center_1ojrm_71","left-bottom":"_left-bottom_1ojrm_72","toast-message":"_toast-message_1ojrm_90",success:"_success_1ojrm_114",info:"_info_1ojrm_118",warn:"_warn_1ojrm_123",error:"_error_1ojrm_127",ghost:"_ghost_1ojrm_132","animation-unmount":"_animation-unmount_1ojrm_136",screenOut:"_screenOut_1ojrm_1"};function $e({message:{duration:o=1e3*7,id:u,content:_,type:l},onRemoveMessage:E,classNames:f}){var W,L;const O=(W=f==null?void 0:f.toastMessages)==null?void 0:W["*"],C=(L=f==null?void 0:f.toastMessages)==null?void 0:L[l],[d,P]=b.useState(void 0);function g(){return d?F[d]?F[d]:d:""}function R(j){var U;const h=g();(U=j.currentTarget.classList)!=null&&U.contains(h)&&E(u)}function p(){const j=H(O),h=H(C),U=g(),ne=F[`animation-message-${f==null?void 0:f.toastPosition}`];return`${F["toast-message"]} ${F[l]} ${ne} ${U} ${h} ${j}`.trim()}function T(){return{...K(O),...K(C)}}const x=b.useCallback(()=>{P((f==null?void 0:f.animationUnmount)||"animation-unmount")},[f==null?void 0:f.animationUnmount]);return b.useEffect(()=>{const j=setTimeout(()=>x(),o);return()=>clearTimeout(j)},[E,u,o,x]),te.jsx("span",{tabIndex:0,onAnimationEnd:R,onClick:x,style:T(),className:p(),children:_})}function Ge({classNames:o,defaultDuration:u,position:_="right-top"}){var g,R;const l=(g=o==null?void 0:o.toastContainer)==null?void 0:g["*"],E=(R=o==null?void 0:o.toastContainer)==null?void 0:R[_],[f,O]=b.useState([]);function C(){const p=H(l),T=H(E);return`${F["toast-container"]} ${F[_]} ${T} ${p}`.trim()}function d(){return{...K(l),...K(E)}}const P=b.useCallback(p=>{O(T=>T.filter(x=>x.id!==p))},[]);return b.useEffect(()=>{function p(T){const{content:x,type:W,duration:L=u}=T;O(j=>[...j,{id:crypto.randomUUID(),content:x,duration:L,type:W}])}return ee.on("add-toast",p),()=>{ee.removeListener("add-toast",p)}},[u]),te.jsx("div",{style:d(),className:C(),children:f.map(p=>te.jsx($e,{message:p,onRemoveMessage:P,classNames:{toastPosition:_,toastMessages:o==null?void 0:o.toastMessages,animationUnmount:o==null?void 0:o.animationUnmount}},p.id))})}return w.ToastContainer=Ge,w.toast=A,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),w}({},React);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edinelsonslima/toast-notification",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.42",
|
|
4
4
|
"author": "@edinelsonslima",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"url": "https://github.com/edinelsonslima/toast-notification/issues"
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://github.com/edinelsonslima/toast-notification#readme",
|
|
15
|
-
"main": "index.
|
|
16
|
-
"module": "index.
|
|
17
|
-
"browser": "index.
|
|
15
|
+
"main": "index.iife.js",
|
|
16
|
+
"module": "index.iife.js",
|
|
17
|
+
"browser": "index.iife.js",
|
|
18
18
|
"types": "index.d.ts",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./index.d.ts",
|
|
22
|
-
"import": "./index.
|
|
23
|
-
"require": "./index.
|
|
24
|
-
"browser": "./index.
|
|
22
|
+
"import": "./index.iife.js",
|
|
23
|
+
"require": "./index.iife.js",
|
|
24
|
+
"browser": "./index.iife.js"
|
|
25
25
|
},
|
|
26
26
|
"./style.css": {
|
|
27
27
|
"import": "./style.css",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
32
|
"index.d.ts",
|
|
33
|
-
"index.
|
|
33
|
+
"index.iife.js",
|
|
34
34
|
"style.css"
|
|
35
35
|
],
|
|
36
36
|
"keywords": [
|
package/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._toast-
|
|
1
|
+
._toast-container_1ojrm_1{position:fixed;display:flex;flex-direction:column-reverse;gap:1rem;z-index:999}._animation-message-right-top_1ojrm_9,._animation-message-right-center_1ojrm_10,._animation-message-right-bottom_1ojrm_11{animation:_screenRightIn_1ojrm_1 .5s ease-in-out}._right-top_1ojrm_15,._right-center_1ojrm_16,._right-bottom_1ojrm_17{align-items:end;right:1rem}._right-top_1ojrm_15{top:1rem}._right-center_1ojrm_16{align-items:end;top:50%;transform:translateY(-50%)}._right-bottom_1ojrm_17{align-items:end;bottom:1rem}._animation-message-center-top_1ojrm_37,._animation-message-center-bottom_1ojrm_38,._animation-message-center-center_1ojrm_39{animation:_screenCenterIn_1ojrm_1 .5s ease-in-out}._center-top_1ojrm_43,._center-center_1ojrm_44,._center-bottom_1ojrm_45{left:50%;align-items:center;transform:translate(-50%)}._center-top_1ojrm_43{top:1rem}._center-center_1ojrm_44{top:50%;transform:translate(-50%,-50%)}._center-bottom_1ojrm_45{bottom:1rem}._animation-message-left-top_1ojrm_64,._animation-message-left-center_1ojrm_65,._animation-message-left-bottom_1ojrm_66{animation:_screenLeftIn_1ojrm_1 .5s ease-in-out}._left-top_1ojrm_70,._left-center_1ojrm_71,._left-bottom_1ojrm_72{align-items:start;left:1rem}._left-top_1ojrm_70{top:1rem}._left-center_1ojrm_71{top:50%;transform:translateY(-50%)}._left-bottom_1ojrm_72{bottom:1rem}._toast-message_1ojrm_90{display:flex;gap:.5rem;align-items:center;justify-content:center;border-radius:.2rem;padding:.5rem;background:#c2c2c2;box-shadow:0 3px 10px #0000001a;border:none;outline:none;cursor:pointer;transition:all .5s ease-in-out;font-size:.875rem}._toast-message_1ojrm_90:hover{filter:brightness(.9)}._toast-message_1ojrm_90:active{filter:brightness(1.1)}._success_1ojrm_114{background:#61d345}._info_1ojrm_118{background:#4b8aff;color:#fff}._warn_1ojrm_123{background:#fc0}._error_1ojrm_127{background:#ff4b4b;color:#fff}._ghost_1ojrm_132{background:#fff}._animation-unmount_1ojrm_136{animation:_screenOut_1ojrm_1 .5s ease-in-out forwards}@keyframes _screenRightIn_1ojrm_1{0%{transform:translate(150%)}to{transform:translate(0)}}@keyframes _screenLeftIn_1ojrm_1{0%{transform:translate(-150%)}to{transform:translate(0)}}@keyframes _screenCenterIn_1ojrm_1{0%{transform:translateY(-150%)}to{transform:translate(0)}}@keyframes _screenOut_1ojrm_1{0%{opacity:1}to{opacity:0}}
|
package/index.umd.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
(function(E,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],d):(E=typeof globalThis<"u"?globalThis:E||self,d(E["toast-notification"]={},E.React))})(this,function(E,d){"use strict";var Et=Object.defineProperty;var Rt=(E,d,D)=>d in E?Et(E,d,{enumerable:!0,configurable:!0,writable:!0,value:D}):E[d]=D;var Le=(E,d,D)=>(Rt(E,typeof d!="symbol"?d+"":d,D),D);class D{constructor(){Le(this,"listeners",new Map([]))}on(u,m){var l;this.listeners.has(u)||this.listeners.set(u,[]),(l=this.listeners.get(u))==null||l.push(m)}emit(u,m){var l;this.listeners.has(u)&&((l=this.listeners.get(u))==null||l.forEach(R=>R(m)))}removeListener(u,m){const l=this.listeners.get(u);if(!l)return;const R=l.filter(c=>c!==m);this.listeners.set(u,R)}}function $(o){return function(u){if(d.isValidElement(u))return A({content:u,type:o});const{content:m,duration:l}=u;return A({content:m,duration:l,type:o})}}function Ue(o){if(o)return d.isValidElement(o)||typeof o!="object"||Array.isArray(o)?o:JSON.stringify(o)}const ee=new D;function A({duration:o,content:u,type:m}){u=Ue(u),ee.emit("add-toast",{content:u,duration:o,type:m})}A.error=$("error"),A.success=$("success"),A.warn=$("warn"),A.info=$("info"),A.ghost=$("ghost");var te={exports:{}},G={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.development.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var de;function Ye(){return de||(de=1,process.env.NODE_ENV!=="production"&&function(){var o=d,u=Symbol.for("react.element"),m=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),C=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),j=Symbol.iterator,W="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var t=j&&e[j]||e[W];return typeof t=="function"?t:null}var x=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];U("error",e,r)}}function U(e,t,r){{var n=x.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(t+="%s",r=r.concat([s]));var f=r.map(function(i){return String(i)});f.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,f)}}var ne=!1,Be=!1,Je=!1,ze=!1,Ke=!1,_e;_e=Symbol.for("react.module.reference");function He(e){return!!(typeof e=="string"||typeof e=="function"||e===l||e===c||Ke||e===R||e===P||e===p||ze||e===T||ne||Be||Je||typeof e=="object"&&e!==null&&(e.$$typeof===h||e.$$typeof===w||e.$$typeof===O||e.$$typeof===C||e.$$typeof===v||e.$$typeof===_e||e.getModuleId!==void 0))}function Xe(e,t,r){var n=e.displayName;if(n)return n;var s=t.displayName||t.name||"";return s!==""?r+"("+s+")":r}function ge(e){return e.displayName||"Context"}function k(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case l:return"Fragment";case m:return"Portal";case c:return"Profiler";case R:return"StrictMode";case P:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case C:var t=e;return ge(t)+".Consumer";case O:var r=e;return ge(r._context)+".Provider";case v:return Xe(e,e.render,"ForwardRef");case w:var n=e.displayName||null;return n!==null?n:k(e.type)||"Memo";case h:{var s=e,f=s._payload,i=s._init;try{return k(i(f))}catch{return null}}}return null}var M=Object.assign,J=0,me,pe,he,be,ye,Ee,Re;function we(){}we.__reactDisabledLog=!0;function Ze(){{if(J===0){me=console.log,pe=console.info,he=console.warn,be=console.error,ye=console.group,Ee=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:we,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function Qe(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:me}),info:M({},e,{value:pe}),warn:M({},e,{value:he}),error:M({},e,{value:be}),group:M({},e,{value:ye}),groupCollapsed:M({},e,{value:Ee}),groupEnd:M({},e,{value:Re})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var oe=x.ReactCurrentDispatcher,ae;function X(e,t,r){{if(ae===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ae=n&&n[1]||""}return`
|
|
10
|
-
`+ae+e}}var ie=!1,Z;{var qe=typeof WeakMap=="function"?WeakMap:Map;Z=new qe}function xe(e,t){if(!e||ie)return"";{var r=Z.get(e);if(r!==void 0)return r}var n;ie=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=oe.current,oe.current=null,Ze();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(I){n=I}Reflect.construct(e,[],i)}else{try{i.call()}catch(I){n=I}e.call(i.prototype)}}else{try{throw Error()}catch(I){n=I}e()}}catch(I){if(I&&n&&typeof I.stack=="string"){for(var a=I.stack.split(`
|
|
11
|
-
`),y=n.stack.split(`
|
|
12
|
-
`),_=a.length-1,g=y.length-1;_>=1&&g>=0&&a[_]!==y[g];)g--;for(;_>=1&&g>=0;_--,g--)if(a[_]!==y[g]){if(_!==1||g!==1)do if(_--,g--,g<0||a[_]!==y[g]){var S=`
|
|
13
|
-
`+a[_].replace(" at new "," at ");return e.displayName&&S.includes("<anonymous>")&&(S=S.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,S),S}while(_>=1&&g>=0);break}}}finally{ie=!1,oe.current=f,Qe(),Error.prepareStackTrace=s}var V=e?e.displayName||e.name:"",We=V?X(V):"";return typeof e=="function"&&Z.set(e,We),We}function Ne(e,t,r){return xe(e,!1)}function et(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Q(e,t,r){if(e==null)return"";if(typeof e=="function")return xe(e,et(e));if(typeof e=="string")return X(e);switch(e){case P:return X("Suspense");case p:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return Ne(e.render);case w:return Q(e.type,t,r);case h:{var n=e,s=n._payload,f=n._init;try{return Q(f(s),t,r)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,Ce={},Te=x.ReactDebugCurrentFrame;function N(e){if(e){var t=e._owner,r=Q(e.type,e._source,t?t.type:null);Te.setExtraStackFrame(r)}else Te.setExtraStackFrame(null)}function tt(e,t,r,n,s){{var f=Function.call.bind(q);for(var i in e)if(f(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var y=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw y.name="Invariant Violation",y}a=e[i](t,i,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_){a=_}a&&!(a instanceof Error)&&(N(s),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,i,typeof a),N(null)),a instanceof Error&&!(a.message in Ce)&&(Ce[a.message]=!0,N(s),b("Failed %s type: %s",r,a.message),N(null))}}}var rt=Array.isArray;function se(e){return rt(e)}function nt(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function ot(e){try{return Se(e),!1}catch{return!0}}function Se(e){return""+e}function Oe(e){if(ot(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nt(e)),Se(e)}var z=x.ReactCurrentOwner,at={key:!0,ref:!0,__self:!0,__source:!0},Pe,je,ue;ue={};function it(e){if(q.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function st(e){if(q.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function ut(e,t){if(typeof e.ref=="string"&&z.current&&t&&z.current.stateNode!==t){var r=k(z.current.type);ue[r]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k(z.current.type),e.ref),ue[r]=!0)}}function ft(e,t){{var r=function(){Pe||(Pe=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function ct(e,t){{var r=function(){je||(je=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var lt=function(e,t,r,n,s,f,i){var a={$$typeof:u,type:e,key:t,ref:r,props:i,_owner:f};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function dt(e,t,r,n,s){{var f,i={},a=null,y=null;r!==void 0&&(Oe(r),a=""+r),st(t)&&(Oe(t.key),a=""+t.key),it(t)&&(y=t.ref,ut(t,s));for(f in t)q.call(t,f)&&!at.hasOwnProperty(f)&&(i[f]=t[f]);if(e&&e.defaultProps){var _=e.defaultProps;for(f in _)i[f]===void 0&&(i[f]=_[f])}if(a||y){var g=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&ft(i,g),y&&ct(i,g)}return lt(e,a,y,s,n,z.current,i)}}var fe=x.ReactCurrentOwner,ke=x.ReactDebugCurrentFrame;function Y(e){if(e){var t=e._owner,r=Q(e.type,e._source,t?t.type:null);ke.setExtraStackFrame(r)}else ke.setExtraStackFrame(null)}var ce;ce=!1;function le(e){return typeof e=="object"&&e!==null&&e.$$typeof===u}function Ie(){{if(fe.current){var e=k(fe.current.type);if(e)return`
|
|
14
|
-
|
|
15
|
-
Check the render method of \``+e+"`."}return""}}function vt(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),r=e.lineNumber;return`
|
|
16
|
-
|
|
17
|
-
Check your code at `+t+":"+r+"."}return""}}var Ae={};function _t(e){{var t=Ie();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=`
|
|
18
|
-
|
|
19
|
-
Check the top-level render call using <`+r+">.")}return t}}function De(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=_t(t);if(Ae[r])return;Ae[r]=!0;var n="";e&&e._owner&&e._owner!==fe.current&&(n=" It was passed a child from "+k(e._owner.type)+"."),Y(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),Y(null)}}function Fe(e,t){{if(typeof e!="object")return;if(se(e))for(var r=0;r<e.length;r++){var n=e[r];le(n)&&De(n,t)}else if(le(e))e._store&&(e._store.validated=!0);else if(e){var s=L(e);if(typeof s=="function"&&s!==e.entries)for(var f=s.call(e),i;!(i=f.next()).done;)le(i.value)&&De(i.value,t)}}}function gt(e){{var t=e.type;if(t==null||typeof t=="string")return;var r;if(typeof t=="function")r=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===v||t.$$typeof===w))r=t.propTypes;else return;if(r){var n=k(t);tt(r,e.props,"prop",n,e)}else if(t.PropTypes!==void 0&&!ce){ce=!0;var s=k(t);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mt(e){{for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if(n!=="children"&&n!=="key"){Y(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),Y(null);break}}e.ref!==null&&(Y(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),Y(null))}}function Me(e,t,r,n,s,f){{var i=He(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var y=vt(s);y?a+=y:a+=Ie();var _;e===null?_="null":se(e)?_="array":e!==void 0&&e.$$typeof===u?(_="<"+(k(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):_=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_,a)}var g=dt(e,t,r,s,f);if(g==null)return g;if(i){var S=t.children;if(S!==void 0)if(n)if(se(S)){for(var V=0;V<S.length;V++)Fe(S[V],e);Object.freeze&&Object.freeze(S)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Fe(S,e)}return e===l?mt(g):gt(g),g}}function pt(e,t,r){return Me(e,t,r,!0)}function ht(e,t,r){return Me(e,t,r,!1)}var bt=ht,yt=pt;G.Fragment=l,G.jsx=bt,G.jsxs=yt}()),G}var B={};/**
|
|
20
|
-
* @license React
|
|
21
|
-
* react-jsx-runtime.production.min.js
|
|
22
|
-
*
|
|
23
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the MIT license found in the
|
|
26
|
-
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var ve;function Ve(){if(ve)return B;ve=1;var o=d,u=Symbol.for("react.element"),m=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,R=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function O(C,v,P){var p,w={},h=null,T=null;P!==void 0&&(h=""+P),v.key!==void 0&&(h=""+v.key),v.ref!==void 0&&(T=v.ref);for(p in v)l.call(v,p)&&!c.hasOwnProperty(p)&&(w[p]=v[p]);if(C&&C.defaultProps)for(p in v=C.defaultProps,v)w[p]===void 0&&(w[p]=v[p]);return{$$typeof:u,type:C,key:h,ref:T,props:w,_owner:R.current}}return B.Fragment=m,B.jsx=O,B.jsxs=O,B}process.env.NODE_ENV==="production"?te.exports=Ve():te.exports=Ye();var re=te.exports;function K(o){if(!(!o||typeof o!="object"))return o}function H(o){return!o||typeof o!="string"?"":o}const F={"toast-container":"_toast-container_1xwv1_1","animation-message-right-top":"_animation-message-right-top_1xwv1_8","animation-message-right-center":"_animation-message-right-center_1xwv1_9","animation-message-right-bottom":"_animation-message-right-bottom_1xwv1_10",screenRightIn:"_screenRightIn_1xwv1_1","right-top":"_right-top_1xwv1_14","right-center":"_right-center_1xwv1_15","right-bottom":"_right-bottom_1xwv1_16","animation-message-center-top":"_animation-message-center-top_1xwv1_36","animation-message-center-bottom":"_animation-message-center-bottom_1xwv1_37","animation-message-center-center":"_animation-message-center-center_1xwv1_38",screenCenterIn:"_screenCenterIn_1xwv1_1","center-top":"_center-top_1xwv1_42","center-center":"_center-center_1xwv1_43","center-bottom":"_center-bottom_1xwv1_44","animation-message-left-top":"_animation-message-left-top_1xwv1_63","animation-message-left-center":"_animation-message-left-center_1xwv1_64","animation-message-left-bottom":"_animation-message-left-bottom_1xwv1_65",screenLeftIn:"_screenLeftIn_1xwv1_1","left-top":"_left-top_1xwv1_69","left-center":"_left-center_1xwv1_70","left-bottom":"_left-bottom_1xwv1_71","toast-message":"_toast-message_1xwv1_89",success:"_success_1xwv1_114",info:"_info_1xwv1_118",warn:"_warn_1xwv1_123",error:"_error_1xwv1_127",ghost:"_ghost_1xwv1_132","animation-unmount":"_animation-unmount_1xwv1_136",screenOut:"_screenOut_1xwv1_1"};function $e({message:{duration:o=1e3*7,id:u,content:m,type:l},onRemoveMessage:R,classNames:c}){var W,L;const O=(W=c==null?void 0:c.toastMessages)==null?void 0:W["*"],C=(L=c==null?void 0:c.toastMessages)==null?void 0:L[l],[v,P]=d.useState(void 0);function p(){return v?F[v]?F[v]:v:""}function w(x){var U;const b=p();(U=x.currentTarget.classList)!=null&&U.contains(b)&&R(u)}function h(){const x=H(O),b=H(C),U=p(),ne=F[`animation-message-${c==null?void 0:c.toastPosition}`];return`${F["toast-message"]} ${F[l]} ${ne} ${U} ${b} ${x}`.trim()}function T(){return{...K(O),...K(C)}}const j=d.useCallback(()=>{P((c==null?void 0:c.animationUnmount)||"animation-unmount")},[c==null?void 0:c.animationUnmount]);return d.useEffect(()=>{const x=setTimeout(()=>j(),o);return()=>clearTimeout(x)},[R,u,o,j]),re.jsx("span",{tabIndex:0,onAnimationEnd:w,onClick:j,style:T(),className:h(),children:m})}function Ge({classNames:o,defaultDuration:u,position:m="right-top"}){var p,w;const l=(p=o==null?void 0:o.toastContainer)==null?void 0:p["*"],R=(w=o==null?void 0:o.toastContainer)==null?void 0:w[m],[c,O]=d.useState([]);function C(){const h=H(l),T=H(R);return`${F["toast-container"]} ${F[m]} ${T} ${h}`.trim()}function v(){return{...K(l),...K(R)}}const P=d.useCallback(h=>{O(T=>T.filter(j=>j.id!==h))},[]);return d.useEffect(()=>{function h(T){const{content:j,type:W,duration:L=u}=T;O(x=>[...x,{id:crypto.randomUUID(),content:j,duration:L,type:W}])}return ee.on("add-toast",h),()=>{ee.removeListener("add-toast",h)}},[u]),re.jsx("div",{style:v(),className:C(),children:c.map(h=>re.jsx($e,{message:h,onRemoveMessage:P,classNames:{toastPosition:m,toastMessages:o==null?void 0:o.toastMessages,animationUnmount:o==null?void 0:o.animationUnmount}},h.id))})}E.ToastContainer=Ge,E.toast=A,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|