@edinelsonslima/toast-notification 0.0.31 → 0.1.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -14
- package/dist/index.d.ts +17 -10
- package/dist/index.umd.js +10 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -61,35 +61,37 @@ export default function MyComponent(){
|
|
|
61
61
|
#### O que é disponível com o pacote
|
|
62
62
|
| função | propriedades |
|
|
63
63
|
|--------------------|------------------------------------------------------------|
|
|
64
|
-
| ToastContainer | `classNames` `position`
|
|
64
|
+
| ToastContainer | `classNames` `position` `defaultDuration` |
|
|
65
65
|
| toast | `text` `type` `duration` |
|
|
66
|
-
| style | `/dist/style.css`
|
|
66
|
+
| style | `/dist/style.css` |
|
|
67
67
|
|
|
68
68
|
#### As propriedades da função toast
|
|
69
69
|
|propriedade | toast |
|
|
70
70
|
|--------------------|----------------------------------------------------------- |
|
|
71
|
-
|
|
|
71
|
+
| content | A conteúdo que aparecerá dentro do toast |
|
|
72
72
|
| type | Define o tipo de toast que é para aparecer |
|
|
73
73
|
| duration | O tempo que o toast irá permanecer em tela |
|
|
74
74
|
|
|
75
75
|
#### As propriedades do componente ToastContainer
|
|
76
76
|
|propriedade | ToastContainer |
|
|
77
77
|
|--------------------|----------------------------------------------------------- |
|
|
78
|
-
| classNames | Um objeto de **chave:valor** onde a chave é o tipo de toast e o valor pode ser uma string (classNames) ou um objeto (CSSProperties)
|
|
79
|
-
| position | Define em qual parte da tela irá aparecer a toast notification, existe valores predefinidos
|
|
78
|
+
| classNames | Um objeto de **chave:valor** onde a chave é o tipo de toast e o valor pode ser uma string (classNames) ou um objeto (CSSProperties) |
|
|
79
|
+
| position | Define em qual parte da tela irá aparecer a toast notification, existe valores predefinidos |
|
|
80
|
+
| defaultDuration | Define tempo padrão de duração de todas as toast |
|
|
80
81
|
|
|
81
82
|
#### Mais detalhes sobre as propriedades
|
|
82
|
-
| propriedade
|
|
83
|
-
|
|
84
|
-
|
|
|
85
|
-
| type
|
|
86
|
-
| duration
|
|
87
|
-
|
|
|
88
|
-
|
|
|
83
|
+
| propriedade |tipo | é obrigatório | padrão |
|
|
84
|
+
|-----------------|---------|-----------------|-------------|
|
|
85
|
+
| content |ReactNode| sim | - |
|
|
86
|
+
| type |string | sim | - |
|
|
87
|
+
| duration |number | não | 7_0000 |
|
|
88
|
+
| defaultDuration |number | não | - |
|
|
89
|
+
| classNames |object | não | undefined |
|
|
90
|
+
| position |string | não | right-top |
|
|
89
91
|
|
|
90
|
-
ℹ️ O
|
|
92
|
+
ℹ️ O `duration` e `defaultDuration` estão em ms (milissegundos)
|
|
91
93
|
|
|
92
|
-
ℹ️ A função `toast` pode ser chamada de
|
|
94
|
+
ℹ️ A função `toast` pode ser chamada de algumas formas, veja os exemplos a seguir:
|
|
93
95
|
|
|
94
96
|
caso seja chamada direta, será obrigatório informa o **type**
|
|
95
97
|
```ts
|
|
@@ -99,6 +101,15 @@ ou pode acessar o tipo do toast diretamente, assim omitindo ele do objeto enviad
|
|
|
99
101
|
```ts
|
|
100
102
|
toast.info({ text: "mensagem exemplo", durantino: 1000 * 4 })
|
|
101
103
|
```
|
|
104
|
+
```ts
|
|
105
|
+
toast.info('mensagem exemplo')
|
|
106
|
+
```
|
|
107
|
+
```tsx
|
|
108
|
+
toast.info(<strong>mensagem exemplo</strong>)
|
|
109
|
+
```
|
|
110
|
+
```tsx
|
|
111
|
+
toast.info(<MeuComponente>mensagem exemplo</MeuComponente>)
|
|
112
|
+
```
|
|
102
113
|
|
|
103
114
|
|
|
104
115
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
3
4
|
|
|
4
|
-
declare
|
|
5
|
-
|
|
5
|
+
declare type IReactNode = Omit<ReactNode, "object"> | undefined;
|
|
6
|
+
|
|
7
|
+
declare interface IToast extends IToastWithoutType {
|
|
6
8
|
type: "success" | "info" | "warn" | "error" | "ghost";
|
|
7
|
-
duration?: number;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export declare interface IToastContainerProps {
|
|
12
|
+
defaultDuration?: number;
|
|
11
13
|
classNames?: {
|
|
12
14
|
[type in IToast["type"]]?: HTMLButtonElement["className"] | CSSProperties;
|
|
13
15
|
};
|
|
14
16
|
position?: "right-top" | "right-center" | "right-bottom" | "center-top" | "center-center" | "center-bottom" | "left-top" | "left-center" | "left-bottom";
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
declare interface IToastWithoutType {
|
|
20
|
+
content: IReactNode;
|
|
21
|
+
duration?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare function toast({ duration, content, type }: IToast): void;
|
|
18
25
|
|
|
19
26
|
export declare namespace toast {
|
|
20
|
-
var error: (
|
|
21
|
-
var success: (
|
|
22
|
-
var warn: (
|
|
23
|
-
var info: (
|
|
24
|
-
var ghost: (
|
|
27
|
+
var error: (data: IToastWithoutType | IReactNode) => void;
|
|
28
|
+
var success: (data: IToastWithoutType | IReactNode) => void;
|
|
29
|
+
var warn: (data: IToastWithoutType | IReactNode) => void;
|
|
30
|
+
var info: (data: IToastWithoutType | IReactNode) => void;
|
|
31
|
+
var ghost: (data: IToastWithoutType | IReactNode) => void;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
|
-
export declare function ToastContainer({ classNames, position, }: IToastContainerProps): JSX_2.Element;
|
|
34
|
+
export declare function ToastContainer({ classNames, defaultDuration, position, }: IToastContainerProps): JSX_2.Element;
|
|
28
35
|
|
|
29
36
|
export { }
|
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(b,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],l):(b=typeof globalThis<"u"?globalThis:b||self,l(b["toast-notification"]={},b.React))})(this,function(b,l){"use strict";var br=Object.defineProperty;var Rr=(b,l,x)=>l in b?br(b,l,{enumerable:!0,configurable:!0,writable:!0,value:x}):b[l]=x;var Ie=(b,l,x)=>(Rr(b,typeof l!="symbol"?l+"":l,x),x);class x{constructor(){Ie(this,"listeners",new Map([]))}on(u,g){var c;this.listeners.has(u)||this.listeners.set(u,[]),(c=this.listeners.get(u))==null||c.push(g)}emit(u,g){var c;this.listeners.has(u)&&((c=this.listeners.get(u))==null||c.forEach(R=>R(g)))}removeListener(u,g){const c=this.listeners.get(u);if(!c)return;const R=c.filter(h=>h!==g);this.listeners.set(u,R)}}function L(s){return function(u){if(l.isValidElement(u))return j({content:u,type:s});const{content:g,duration:c}=u;return j({content:g,duration:c,type:s})}}function Ae(s){if(s)return l.isValidElement(s)||typeof s!="object"||Array.isArray(s)?s:JSON.stringify(s)}const G=new x;function j({duration:s,content:u,type:g}){u=Ae(u),G.emit("add-toast",{content:u,duration:s,type:g})}j.error=L("error"),j.success=L("success"),j.warn=L("warn"),j.info=L("info"),j.ghost=L("ghost");var K={exports:{}},M={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
10
|
-
`+q+e}}var
|
|
11
|
-
`),
|
|
12
|
-
`),
|
|
13
|
-
`+a[
|
|
9
|
+
*/var oe;function De(){return oe||(oe=1,process.env.NODE_ENV!=="production"&&function(){var s=l,u=Symbol.for("react.element"),g=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),_=Symbol.for("react.provider"),T=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),se=Symbol.iterator,Ue="@@iterator";function Ve(e){if(e===null||typeof e!="object")return null;var r=se&&e[se]||e[Ue];return typeof r=="function"?r:null}var A=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ze("error",e,t)}}function ze(e,r,t){{var n=A.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var f=t.map(function(o){return String(o)});f.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,f)}}var Ne=!1,$e=!1,Be=!1,Je=!1,Ge=!1,ue;ue=Symbol.for("react.module.reference");function Ke(e){return!!(typeof e=="string"||typeof e=="function"||e===c||e===h||Ge||e===R||e===w||e===m||Je||e===V||Ne||$e||Be||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===O||e.$$typeof===_||e.$$typeof===T||e.$$typeof===d||e.$$typeof===ue||e.getModuleId!==void 0))}function He(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function fe(e){return e.displayName||"Context"}function S(e){if(e==null)return null;if(typeof e.tag=="number"&&y("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 c:return"Fragment";case g:return"Portal";case h:return"Profiler";case R:return"StrictMode";case w:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T:var r=e;return fe(r)+".Consumer";case _:var t=e;return fe(t._context)+".Provider";case d:return He(e,e.render,"ForwardRef");case O:var n=e.displayName||null;return n!==null?n:S(e.type)||"Memo";case k:{var i=e,f=i._payload,o=i._init;try{return S(o(f))}catch{return null}}}return null}var I=Object.assign,Y=0,ce,le,de,ve,pe,ge,_e;function he(){}he.__reactDisabledLog=!0;function Xe(){{if(Y===0){ce=console.log,le=console.info,de=console.warn,ve=console.error,pe=console.group,ge=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:he,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function Ze(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:ce}),info:I({},e,{value:le}),warn:I({},e,{value:de}),error:I({},e,{value:ve}),group:I({},e,{value:pe}),groupCollapsed:I({},e,{value:ge}),groupEnd:I({},e,{value:_e})})}Y<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=A.ReactCurrentDispatcher,q;function z(e,r,t){{if(q===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
|
|
10
|
+
`+q+e}}var Q=!1,N;{var qe=typeof WeakMap=="function"?WeakMap:Map;N=new qe}function me(e,r){if(!e||Q)return"";{var t=N.get(e);if(t!==void 0)return t}var n;Q=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=Z.current,Z.current=null,Xe();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(P){n=P}Reflect.construct(e,[],o)}else{try{o.call()}catch(P){n=P}e.call(o.prototype)}}else{try{throw Error()}catch(P){n=P}e()}}catch(P){if(P&&n&&typeof P.stack=="string"){for(var a=P.stack.split(`
|
|
11
|
+
`),E=n.stack.split(`
|
|
12
|
+
`),v=a.length-1,p=E.length-1;v>=1&&p>=0&&a[v]!==E[p];)p--;for(;v>=1&&p>=0;v--,p--)if(a[v]!==E[p]){if(v!==1||p!==1)do if(v--,p--,p<0||a[v]!==E[p]){var C=`
|
|
13
|
+
`+a[v].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&N.set(e,C),C}while(v>=1&&p>=0);break}}}finally{Q=!1,Z.current=f,Ze(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",ke=F?z(F):"";return typeof e=="function"&&N.set(e,ke),ke}function Qe(e,r,t){return me(e,!1)}function er(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function $(e,r,t){if(e==null)return"";if(typeof e=="function")return me(e,er(e));if(typeof e=="string")return z(e);switch(e){case w:return z("Suspense");case m:return z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Qe(e.render);case O:return $(e.type,r,t);case k:{var n=e,i=n._payload,f=n._init;try{return $(f(i),r,t)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,ye={},Ee=A.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=$(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}function rr(e,r,t,n,i){{var f=Function.call.bind(B);for(var o in e)if(f(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var E=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw E.name="Invariant Violation",E}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(v){a=v}a&&!(a instanceof Error)&&(J(i),y("%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,o,typeof a),J(null)),a instanceof Error&&!(a.message in ye)&&(ye[a.message]=!0,J(i),y("Failed %s type: %s",t,a.message),J(null))}}}var tr=Array.isArray;function ee(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 ar(e){try{return be(e),!1}catch{return!0}}function be(e){return""+e}function Re(e){if(ar(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",nr(e)),be(e)}var U=A.ReactCurrentOwner,or={key:!0,ref:!0,__self:!0,__source:!0},Te,Ce,re;re={};function ir(e){if(B.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(B.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"&&U.current&&r&&U.current.stateNode!==r){var t=S(U.current.type);re[t]||(y('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',S(U.current.type),e.ref),re[t]=!0)}}function fr(e,r){{var t=function(){Te||(Te=!0,y("%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 cr(e,r){{var t=function(){Ce||(Ce=!0,y("%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,i,f,o){var a={$$typeof:u,type:e,key:r,ref:t,props:o,_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:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function dr(e,r,t,n,i){{var f,o={},a=null,E=null;t!==void 0&&(Re(t),a=""+t),sr(r)&&(Re(r.key),a=""+r.key),ir(r)&&(E=r.ref,ur(r,i));for(f in r)B.call(r,f)&&!or.hasOwnProperty(f)&&(o[f]=r[f]);if(e&&e.defaultProps){var v=e.defaultProps;for(f in v)o[f]===void 0&&(o[f]=v[f])}if(a||E){var p=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&fr(o,p),E&&cr(o,p)}return lr(e,a,E,i,n,U.current,o)}}var te=A.ReactCurrentOwner,Oe=A.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=$(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(t)}else Oe.setExtraStackFrame(null)}var ne;ne=!1;function ae(e){return typeof e=="object"&&e!==null&&e.$$typeof===u}function we(){{if(te.current){var e=S(te.current.type);if(e)return`
|
|
14
14
|
|
|
15
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
15
|
+
Check the render method of \``+e+"`."}return""}}function vr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
16
16
|
|
|
17
|
-
Check your code at `+r+":"+t+"."}return""}}var
|
|
17
|
+
Check your code at `+r+":"+t+"."}return""}}var Se={};function pr(e){{var r=we();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+t+">.")}return r}}function
|
|
19
|
+
Check the top-level render call using <`+t+">.")}return r}}function Pe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=pr(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==te.current&&(n=" It was passed a child from "+S(e._owner.type)+"."),D(e),y('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),D(null)}}function je(e,r){{if(typeof e!="object")return;if(ee(e))for(var t=0;t<e.length;t++){var n=e[t];ae(n)&&Pe(n,r)}else if(ae(e))e._store&&(e._store.validated=!0);else if(e){var i=Ve(e);if(typeof i=="function"&&i!==e.entries)for(var f=i.call(e),o;!(o=f.next()).done;)ae(o.value)&&Pe(o.value,r)}}}function gr(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===O))t=r.propTypes;else return;if(t){var n=S(r);rr(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ne){ne=!0;var i=S(r);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _r(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}function xe(e,r,t,n,i,f){{var o=Ke(e);if(!o){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 E=vr(i);E?a+=E:a+=we();var v;e===null?v="null":ee(e)?v="array":e!==void 0&&e.$$typeof===u?(v="<"+(S(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):v=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",v,a)}var p=dr(e,r,t,i,f);if(p==null)return p;if(o){var C=r.children;if(C!==void 0)if(n)if(ee(C)){for(var F=0;F<C.length;F++)je(C[F],e);Object.freeze&&Object.freeze(C)}else y("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 je(C,e)}return e===c?_r(p):gr(p),p}}function hr(e,r,t){return xe(e,r,t,!0)}function mr(e,r,t){return xe(e,r,t,!1)}var yr=mr,Er=hr;M.Fragment=c,M.jsx=yr,M.jsxs=Er}()),M}var W={};/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
22
22
|
*
|
|
@@ -24,4 +24,4 @@ Check the top-level render call using <`+t+">.")}return r}}function Se(e,r){{if(
|
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var
|
|
27
|
+
*/var ie;function Fe(){if(ie)return W;ie=1;var s=l,u=Symbol.for("react.element"),g=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,R=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function _(T,d,w){var m,O={},k=null,V=null;w!==void 0&&(k=""+w),d.key!==void 0&&(k=""+d.key),d.ref!==void 0&&(V=d.ref);for(m in d)c.call(d,m)&&!h.hasOwnProperty(m)&&(O[m]=d[m]);if(T&&T.defaultProps)for(m in d=T.defaultProps,d)O[m]===void 0&&(O[m]=d[m]);return{$$typeof:u,type:T,key:k,ref:V,props:O,_owner:R.current}}return W.Fragment=g,W.jsx=_,W.jsxs=_,W}process.env.NODE_ENV==="production"?K.exports=Fe():K.exports=De();var H=K.exports;const X={"toast-container":"_toast-container_1p5ze_5","toast-message":"_toast-message_1p5ze_29",screenRightIn:"_screenRightIn_1p5ze_1",screenCenterIn:"_screenCenterIn_1p5ze_1",screenLeftIn:"_screenLeftIn_1p5ze_1",screenOut:"_screenOut_1p5ze_1",success:"_success_1p5ze_111",info:"_info_1p5ze_115",warn:"_warn_1p5ze_120",error:"_error_1p5ze_124",ghost:"_ghost_1p5ze_129"};function Le({message:{duration:s=1e3*7,id:u,content:g,type:c},onRemoveMessage:R,classNames:h}){const[_,T]=l.useState(!1);function d(){_&&R(u)}return l.useEffect(()=>{const w=setTimeout(()=>T(!0),s);return()=>clearTimeout(w)},[R,u,s]),H.jsx("button",{tabIndex:0,onAnimationEnd:d,onClick:()=>T(!0),"data-animation-end":_,style:Me(h==null?void 0:h[c]),className:`${X["toast-message"]} ${X[c]} ${We(h==null?void 0:h[c])}`,children:g})}function Me(s){if(!(!s||typeof s!="object"))return s}function We(s){return!s||typeof s!="string"?"":s}function Ye({classNames:s,defaultDuration:u,position:g="right-top"}){const[c,R]=l.useState([]),h=l.useCallback(_=>{R(T=>T.filter(d=>d.id!==_))},[]);return l.useEffect(()=>{function _(T){const{content:d,type:w,duration:m=u}=T;R(O=>[...O,{id:crypto.randomUUID(),content:d,duration:m,type:w}])}return G.on("add-toast",_),()=>{G.removeListener("add-toast",_)}},[u]),H.jsx("div",{"data-position":g,className:X["toast-container"],children:c.map(_=>H.jsx(Le,{message:_,classNames:s,onRemoveMessage:h},_.id))})}b.ToastContainer=Ye,b.toast=j,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|