@edinelsonslima/toast-notification 0.0.16

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 ADDED
@@ -0,0 +1,30 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
+
14
+ - Configure the top-level `parserOptions` property like this:
15
+
16
+ ```js
17
+ export default {
18
+ // other rules...
19
+ parserOptions: {
20
+ ecmaVersion: 'latest',
21
+ sourceType: 'module',
22
+ project: ['./tsconfig.json', './tsconfig.node.json'],
23
+ tsconfigRootDir: __dirname,
24
+ },
25
+ }
26
+ ```
27
+
28
+ - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29
+ - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30
+ - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
@@ -0,0 +1,13 @@
1
+ import { CSSProperties } from "react";
2
+ import { IToast } from "../../helpers/toast.helper";
3
+ export interface IToastData extends IToast {
4
+ id: string;
5
+ }
6
+ interface IToastContainerProps {
7
+ classNames?: {
8
+ [type in IToast["type"]]?: HTMLButtonElement["className"] | CSSProperties;
9
+ };
10
+ position?: "right-top" | "right-center" | "right-bottom" | "center-top" | "center-center" | "center-bottom" | "left-top" | "left-center" | "left-bottom";
11
+ }
12
+ export declare function ToastContainer({ classNames, position, }: IToastContainerProps): import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,11 @@
1
+ import { CSSProperties } from "react";
2
+ import { IToastData } from "./toast-container.component";
3
+ interface IToastMessageProps {
4
+ message: IToastData;
5
+ onRemoveMessage(id: IToastData["id"]): void;
6
+ classNames?: {
7
+ [type in IToastData["type"]]?: HTMLButtonElement["className"] | CSSProperties;
8
+ };
9
+ }
10
+ export default function ToastMessage({ message: { duration, id, text, type }, onRemoveMessage, classNames, }: IToastMessageProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,19 @@
1
+ import EventManager from "../services/event-manager.service";
2
+ export interface IToast {
3
+ text: string;
4
+ type: "success" | "info" | "warn" | "error" | "ghost";
5
+ duration?: number;
6
+ }
7
+ type IToastEvents = {
8
+ "add-toast": IToast;
9
+ };
10
+ export declare const toastEventManager: EventManager<IToastEvents>;
11
+ declare function toast({ duration, text, type }: IToast): void;
12
+ declare namespace toast {
13
+ var error: ({ duration, text }: Omit<IToast, "type">) => void;
14
+ var success: ({ duration, text }: Omit<IToast, "type">) => void;
15
+ var warn: ({ duration, text }: Omit<IToast, "type">) => void;
16
+ var info: ({ duration, text }: Omit<IToast, "type">) => void;
17
+ var ghost: ({ duration, text }: Omit<IToast, "type">) => void;
18
+ }
19
+ export { toast };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export default function useAnimationUnmount<TElement extends HTMLElement>(visible?: boolean): {
3
+ animatedElementRef: import("react").RefObject<TElement>;
4
+ shouldRender: boolean;
5
+ };
@@ -0,0 +1,2 @@
1
+ export { toast } from "./helpers/toast.helper";
2
+ export { ToastContainer } from "./components/Toast/toast-container.component";
@@ -0,0 +1,6 @@
1
+ export default class EventManager<TEvents extends Record<keyof TEvents, TEvents[keyof TEvents]>> {
2
+ private listeners;
3
+ on<TKey extends keyof TEvents>(event: TKey, listener: (parameters: TEvents[TKey]) => void): void;
4
+ emit<TKey extends keyof TEvents>(event: TKey, payload: TEvents[TKey]): void;
5
+ removeListener<TKey extends keyof TEvents>(event: TKey, listenerToRemove: (parameters: TEvents[TKey]) => void): void;
6
+ }
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ :root{--animation-time: .5s}._toast-container_m73xp_5{position:fixed;display:flex;flex-direction:column-reverse;gap:1rem;z-index:99999999}._toast-container_m73xp_5[data-position=right-top]{right:1rem;top:1rem}._toast-container_m73xp_5[data-position=right-center]{right:1rem;top:50%;transform:translateY(-50%)}._toast-container_m73xp_5[data-position=right-bottom]{right:1rem;bottom:1rem}._toast-container_m73xp_5[data-position=right-top] ._toast-message_m73xp_29,._toast-container_m73xp_5[data-position=right-center] ._toast-message_m73xp_29,._toast-container_m73xp_5[data-position=right-bottom] ._toast-message_m73xp_29{animation:_screenRightIn_m73xp_1 var(--animation-time) ease-in-out}._toast-container_m73xp_5[data-position=center-top]{left:50%;top:1rem;transform:translate(-50%)}._toast-container_m73xp_5[data-position=center-center]{left:50%;top:50%;transform:translate(-50%,-50%)}._toast-container_m73xp_5[data-position=center-bottom]{left:50%;bottom:1rem;transform:translate(-50%)}._toast-container_m73xp_5[data-position=center-top] ._toast-message_m73xp_29,._toast-container_m73xp_5[data-position=center-bottom] ._toast-message_m73xp_29,._toast-container_m73xp_5[data-position=center-center] ._toast-message_m73xp_29{animation:_screenCenterIn_m73xp_1 var(--animation-time) ease-in-out}._toast-container_m73xp_5[data-position=left-top]{left:1rem;top:1rem}._toast-container_m73xp_5[data-position=left-center]{left:1rem;top:50%;transform:translateY(-50%)}._toast-container_m73xp_5[data-position=left-bottom]{left:1rem;bottom:1rem}._toast-container_m73xp_5[data-position=left-top] ._toast-message_m73xp_29,._toast-container_m73xp_5[data-position=left-center] ._toast-message_m73xp_29,._toast-container_m73xp_5[data-position=left-bottom] ._toast-message_m73xp_29{animation:_screenLeftIn_m73xp_1 var(--animation-time) ease-in-out}._toast-message_m73xp_29[data-animation-end=true]{animation:_screenOut_m73xp_1 var(--animation-time) ease-in-out forwards!important}._toast-message_m73xp_29{display:flex;gap:.5rem;align-items:center;justify-content:center;border-radius:.2rem;padding:.5rem;background:#c2c2c2;box-shadow:0 3px 10px #0000001a,0 3px 3px #0000000d;border:none;outline:none;cursor:pointer;transition:all .5s ease-in-out}._toast-message_m73xp_29:hover{filter:brightness(.9)}._toast-message_m73xp_29:active{filter:brightness(1.1)}._toast-message_m73xp_29[data-type=success]{background:#61d345}._toast-message_m73xp_29[data-type=info]{background:#4b8aff;color:#fff}._toast-message_m73xp_29[data-type=warn]{background:#ffcc00}._toast-message_m73xp_29[data-type=error]{background:#ff4b4b;color:#fff}._toast-message_m73xp_29[data-type=ghost]{background:#ffffff}@keyframes _screenRightIn_m73xp_1{0%{transform:translate(150%)}to{transform:translate(0)}}@keyframes _screenLeftIn_m73xp_1{0%{transform:translate(-150%)}to{transform:translate(0)}}@keyframes _screenCenterIn_m73xp_1{0%{transform:translateY(-150%)}to{transform:translate(0)}}@keyframes _screenOut_m73xp_1{0%{opacity:1}to{opacity:0}}
@@ -0,0 +1,736 @@
1
+ var vr = Object.defineProperty;
2
+ var pr = (i, a, l) => a in i ? vr(i, a, { enumerable: !0, configurable: !0, writable: !0, value: l }) : i[a] = l;
3
+ var Oe = (i, a, l) => (pr(i, typeof a != "symbol" ? a + "" : a, l), l);
4
+ import Se, { useState as Pe, useEffect as je, useCallback as gr } from "react";
5
+ class hr {
6
+ constructor() {
7
+ Oe(this, "listeners", /* @__PURE__ */ new Map([]));
8
+ }
9
+ on(a, l) {
10
+ var c;
11
+ this.listeners.has(a) || this.listeners.set(a, []), (c = this.listeners.get(a)) == null || c.push(l);
12
+ }
13
+ emit(a, l) {
14
+ var c;
15
+ this.listeners.has(a) && ((c = this.listeners.get(a)) == null || c.forEach((_) => _(l)));
16
+ }
17
+ removeListener(a, l) {
18
+ const c = this.listeners.get(a);
19
+ if (!c)
20
+ return;
21
+ const _ = c.filter(
22
+ (d) => d !== l
23
+ );
24
+ this.listeners.set(a, _);
25
+ }
26
+ }
27
+ const X = new hr();
28
+ function C({ duration: i, text: a, type: l }) {
29
+ X.emit("add-toast", { duration: i, text: a, type: l });
30
+ }
31
+ C.error = ({ duration: i, text: a }) => C({ duration: i, text: a, type: "error" });
32
+ C.success = ({ duration: i, text: a }) => C({ duration: i, text: a, type: "success" });
33
+ C.warn = ({ duration: i, text: a }) => C({ duration: i, text: a, type: "warn" });
34
+ C.info = ({ duration: i, text: a }) => C({ duration: i, text: a, type: "info" });
35
+ C.ghost = ({ duration: i, text: a }) => C({ duration: i, text: a, type: "ghost" });
36
+ var Z = { exports: {} }, F = {};
37
+ /**
38
+ * @license React
39
+ * react-jsx-runtime.development.js
40
+ *
41
+ * Copyright (c) Facebook, Inc. and its affiliates.
42
+ *
43
+ * This source code is licensed under the MIT license found in the
44
+ * LICENSE file in the root directory of this source tree.
45
+ */
46
+ var we;
47
+ function mr() {
48
+ return we || (we = 1, process.env.NODE_ENV !== "production" && function() {
49
+ var i = Se, a = Symbol.for("react.element"), l = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), b = Symbol.for("react.provider"), y = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), ee = Symbol.iterator, Ie = "@@iterator";
50
+ function De(e) {
51
+ if (e === null || typeof e != "object")
52
+ return null;
53
+ var r = ee && e[ee] || e[Ie];
54
+ return typeof r == "function" ? r : null;
55
+ }
56
+ var j = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
57
+ function h(e) {
58
+ {
59
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
60
+ t[n - 1] = arguments[n];
61
+ Ae("error", e, t);
62
+ }
63
+ }
64
+ function Ae(e, r, t) {
65
+ {
66
+ var n = j.ReactDebugCurrentFrame, u = n.getStackAddendum();
67
+ u !== "" && (r += "%s", t = t.concat([u]));
68
+ var f = t.map(function(s) {
69
+ return String(s);
70
+ });
71
+ f.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, f);
72
+ }
73
+ }
74
+ var Fe = !1, $e = !1, Le = !1, We = !1, Me = !1, re;
75
+ re = Symbol.for("react.module.reference");
76
+ function Ye(e) {
77
+ return !!(typeof e == "string" || typeof e == "function" || e === c || e === d || Me || e === _ || e === T || e === E || We || e === L || Fe || $e || Le || typeof e == "object" && e !== null && (e.$$typeof === S || e.$$typeof === O || e.$$typeof === b || e.$$typeof === y || e.$$typeof === p || // This needs to include all possible module reference object
78
+ // types supported by any Flight configuration anywhere since
79
+ // we don't know which Flight build this will end up being used
80
+ // with.
81
+ e.$$typeof === re || e.getModuleId !== void 0));
82
+ }
83
+ function Ue(e, r, t) {
84
+ var n = e.displayName;
85
+ if (n)
86
+ return n;
87
+ var u = r.displayName || r.name || "";
88
+ return u !== "" ? t + "(" + u + ")" : t;
89
+ }
90
+ function te(e) {
91
+ return e.displayName || "Context";
92
+ }
93
+ function w(e) {
94
+ if (e == null)
95
+ return null;
96
+ 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")
97
+ return e.displayName || e.name || null;
98
+ if (typeof e == "string")
99
+ return e;
100
+ switch (e) {
101
+ case c:
102
+ return "Fragment";
103
+ case l:
104
+ return "Portal";
105
+ case d:
106
+ return "Profiler";
107
+ case _:
108
+ return "StrictMode";
109
+ case T:
110
+ return "Suspense";
111
+ case E:
112
+ return "SuspenseList";
113
+ }
114
+ if (typeof e == "object")
115
+ switch (e.$$typeof) {
116
+ case y:
117
+ var r = e;
118
+ return te(r) + ".Consumer";
119
+ case b:
120
+ var t = e;
121
+ return te(t._context) + ".Provider";
122
+ case p:
123
+ return Ue(e, e.render, "ForwardRef");
124
+ case O:
125
+ var n = e.displayName || null;
126
+ return n !== null ? n : w(e.type) || "Memo";
127
+ case S: {
128
+ var u = e, f = u._payload, s = u._init;
129
+ try {
130
+ return w(s(f));
131
+ } catch {
132
+ return null;
133
+ }
134
+ }
135
+ }
136
+ return null;
137
+ }
138
+ var P = Object.assign, D = 0, ne, ae, oe, ie, se, ue, fe;
139
+ function ce() {
140
+ }
141
+ ce.__reactDisabledLog = !0;
142
+ function Ve() {
143
+ {
144
+ if (D === 0) {
145
+ ne = console.log, ae = console.info, oe = console.warn, ie = console.error, se = console.group, ue = console.groupCollapsed, fe = console.groupEnd;
146
+ var e = {
147
+ configurable: !0,
148
+ enumerable: !0,
149
+ value: ce,
150
+ writable: !0
151
+ };
152
+ Object.defineProperties(console, {
153
+ info: e,
154
+ log: e,
155
+ warn: e,
156
+ error: e,
157
+ group: e,
158
+ groupCollapsed: e,
159
+ groupEnd: e
160
+ });
161
+ }
162
+ D++;
163
+ }
164
+ }
165
+ function Ne() {
166
+ {
167
+ if (D--, D === 0) {
168
+ var e = {
169
+ configurable: !0,
170
+ enumerable: !0,
171
+ writable: !0
172
+ };
173
+ Object.defineProperties(console, {
174
+ log: P({}, e, {
175
+ value: ne
176
+ }),
177
+ info: P({}, e, {
178
+ value: ae
179
+ }),
180
+ warn: P({}, e, {
181
+ value: oe
182
+ }),
183
+ error: P({}, e, {
184
+ value: ie
185
+ }),
186
+ group: P({}, e, {
187
+ value: se
188
+ }),
189
+ groupCollapsed: P({}, e, {
190
+ value: ue
191
+ }),
192
+ groupEnd: P({}, e, {
193
+ value: fe
194
+ })
195
+ });
196
+ }
197
+ D < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
198
+ }
199
+ }
200
+ var N = j.ReactCurrentDispatcher, B;
201
+ function W(e, r, t) {
202
+ {
203
+ if (B === void 0)
204
+ try {
205
+ throw Error();
206
+ } catch (u) {
207
+ var n = u.stack.trim().match(/\n( *(at )?)/);
208
+ B = n && n[1] || "";
209
+ }
210
+ return `
211
+ ` + B + e;
212
+ }
213
+ }
214
+ var q = !1, M;
215
+ {
216
+ var Be = typeof WeakMap == "function" ? WeakMap : Map;
217
+ M = new Be();
218
+ }
219
+ function le(e, r) {
220
+ if (!e || q)
221
+ return "";
222
+ {
223
+ var t = M.get(e);
224
+ if (t !== void 0)
225
+ return t;
226
+ }
227
+ var n;
228
+ q = !0;
229
+ var u = Error.prepareStackTrace;
230
+ Error.prepareStackTrace = void 0;
231
+ var f;
232
+ f = N.current, N.current = null, Ve();
233
+ try {
234
+ if (r) {
235
+ var s = function() {
236
+ throw Error();
237
+ };
238
+ if (Object.defineProperty(s.prototype, "props", {
239
+ set: function() {
240
+ throw Error();
241
+ }
242
+ }), typeof Reflect == "object" && Reflect.construct) {
243
+ try {
244
+ Reflect.construct(s, []);
245
+ } catch (x) {
246
+ n = x;
247
+ }
248
+ Reflect.construct(e, [], s);
249
+ } else {
250
+ try {
251
+ s.call();
252
+ } catch (x) {
253
+ n = x;
254
+ }
255
+ e.call(s.prototype);
256
+ }
257
+ } else {
258
+ try {
259
+ throw Error();
260
+ } catch (x) {
261
+ n = x;
262
+ }
263
+ e();
264
+ }
265
+ } catch (x) {
266
+ if (x && n && typeof x.stack == "string") {
267
+ for (var o = x.stack.split(`
268
+ `), m = n.stack.split(`
269
+ `), v = o.length - 1, g = m.length - 1; v >= 1 && g >= 0 && o[v] !== m[g]; )
270
+ g--;
271
+ for (; v >= 1 && g >= 0; v--, g--)
272
+ if (o[v] !== m[g]) {
273
+ if (v !== 1 || g !== 1)
274
+ do
275
+ if (v--, g--, g < 0 || o[v] !== m[g]) {
276
+ var R = `
277
+ ` + o[v].replace(" at new ", " at ");
278
+ return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, R), R;
279
+ }
280
+ while (v >= 1 && g >= 0);
281
+ break;
282
+ }
283
+ }
284
+ } finally {
285
+ q = !1, N.current = f, Ne(), Error.prepareStackTrace = u;
286
+ }
287
+ var I = e ? e.displayName || e.name : "", Ce = I ? W(I) : "";
288
+ return typeof e == "function" && M.set(e, Ce), Ce;
289
+ }
290
+ function qe(e, r, t) {
291
+ return le(e, !1);
292
+ }
293
+ function Je(e) {
294
+ var r = e.prototype;
295
+ return !!(r && r.isReactComponent);
296
+ }
297
+ function Y(e, r, t) {
298
+ if (e == null)
299
+ return "";
300
+ if (typeof e == "function")
301
+ return le(e, Je(e));
302
+ if (typeof e == "string")
303
+ return W(e);
304
+ switch (e) {
305
+ case T:
306
+ return W("Suspense");
307
+ case E:
308
+ return W("SuspenseList");
309
+ }
310
+ if (typeof e == "object")
311
+ switch (e.$$typeof) {
312
+ case p:
313
+ return qe(e.render);
314
+ case O:
315
+ return Y(e.type, r, t);
316
+ case S: {
317
+ var n = e, u = n._payload, f = n._init;
318
+ try {
319
+ return Y(f(u), r, t);
320
+ } catch {
321
+ }
322
+ }
323
+ }
324
+ return "";
325
+ }
326
+ var U = Object.prototype.hasOwnProperty, de = {}, ve = j.ReactDebugCurrentFrame;
327
+ function V(e) {
328
+ if (e) {
329
+ var r = e._owner, t = Y(e.type, e._source, r ? r.type : null);
330
+ ve.setExtraStackFrame(t);
331
+ } else
332
+ ve.setExtraStackFrame(null);
333
+ }
334
+ function Ge(e, r, t, n, u) {
335
+ {
336
+ var f = Function.call.bind(U);
337
+ for (var s in e)
338
+ if (f(e, s)) {
339
+ var o = void 0;
340
+ try {
341
+ if (typeof e[s] != "function") {
342
+ var m = Error((n || "React class") + ": " + t + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
343
+ throw m.name = "Invariant Violation", m;
344
+ }
345
+ o = e[s](r, s, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
346
+ } catch (v) {
347
+ o = v;
348
+ }
349
+ o && !(o instanceof Error) && (V(u), 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, s, typeof o), V(null)), o instanceof Error && !(o.message in de) && (de[o.message] = !0, V(u), h("Failed %s type: %s", t, o.message), V(null));
350
+ }
351
+ }
352
+ }
353
+ var ze = Array.isArray;
354
+ function J(e) {
355
+ return ze(e);
356
+ }
357
+ function Ke(e) {
358
+ {
359
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
360
+ return t;
361
+ }
362
+ }
363
+ function He(e) {
364
+ try {
365
+ return pe(e), !1;
366
+ } catch {
367
+ return !0;
368
+ }
369
+ }
370
+ function pe(e) {
371
+ return "" + e;
372
+ }
373
+ function ge(e) {
374
+ if (He(e))
375
+ return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), pe(e);
376
+ }
377
+ var A = j.ReactCurrentOwner, Xe = {
378
+ key: !0,
379
+ ref: !0,
380
+ __self: !0,
381
+ __source: !0
382
+ }, he, me, G;
383
+ G = {};
384
+ function Ze(e) {
385
+ if (U.call(e, "ref")) {
386
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
387
+ if (r && r.isReactWarning)
388
+ return !1;
389
+ }
390
+ return e.ref !== void 0;
391
+ }
392
+ function Qe(e) {
393
+ if (U.call(e, "key")) {
394
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
395
+ if (r && r.isReactWarning)
396
+ return !1;
397
+ }
398
+ return e.key !== void 0;
399
+ }
400
+ function er(e, r) {
401
+ if (typeof e.ref == "string" && A.current && r && A.current.stateNode !== r) {
402
+ var t = w(A.current.type);
403
+ G[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', w(A.current.type), e.ref), G[t] = !0);
404
+ }
405
+ }
406
+ function rr(e, r) {
407
+ {
408
+ var t = function() {
409
+ he || (he = !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));
410
+ };
411
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
412
+ get: t,
413
+ configurable: !0
414
+ });
415
+ }
416
+ }
417
+ function tr(e, r) {
418
+ {
419
+ var t = function() {
420
+ me || (me = !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));
421
+ };
422
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
423
+ get: t,
424
+ configurable: !0
425
+ });
426
+ }
427
+ }
428
+ var nr = function(e, r, t, n, u, f, s) {
429
+ var o = {
430
+ // This tag allows us to uniquely identify this as a React Element
431
+ $$typeof: a,
432
+ // Built-in properties that belong on the element
433
+ type: e,
434
+ key: r,
435
+ ref: t,
436
+ props: s,
437
+ // Record the component responsible for creating this element.
438
+ _owner: f
439
+ };
440
+ return o._store = {}, Object.defineProperty(o._store, "validated", {
441
+ configurable: !1,
442
+ enumerable: !1,
443
+ writable: !0,
444
+ value: !1
445
+ }), Object.defineProperty(o, "_self", {
446
+ configurable: !1,
447
+ enumerable: !1,
448
+ writable: !1,
449
+ value: n
450
+ }), Object.defineProperty(o, "_source", {
451
+ configurable: !1,
452
+ enumerable: !1,
453
+ writable: !1,
454
+ value: u
455
+ }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
456
+ };
457
+ function ar(e, r, t, n, u) {
458
+ {
459
+ var f, s = {}, o = null, m = null;
460
+ t !== void 0 && (ge(t), o = "" + t), Qe(r) && (ge(r.key), o = "" + r.key), Ze(r) && (m = r.ref, er(r, u));
461
+ for (f in r)
462
+ U.call(r, f) && !Xe.hasOwnProperty(f) && (s[f] = r[f]);
463
+ if (e && e.defaultProps) {
464
+ var v = e.defaultProps;
465
+ for (f in v)
466
+ s[f] === void 0 && (s[f] = v[f]);
467
+ }
468
+ if (o || m) {
469
+ var g = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
470
+ o && rr(s, g), m && tr(s, g);
471
+ }
472
+ return nr(e, o, m, u, n, A.current, s);
473
+ }
474
+ }
475
+ var z = j.ReactCurrentOwner, _e = j.ReactDebugCurrentFrame;
476
+ function k(e) {
477
+ if (e) {
478
+ var r = e._owner, t = Y(e.type, e._source, r ? r.type : null);
479
+ _e.setExtraStackFrame(t);
480
+ } else
481
+ _e.setExtraStackFrame(null);
482
+ }
483
+ var K;
484
+ K = !1;
485
+ function H(e) {
486
+ return typeof e == "object" && e !== null && e.$$typeof === a;
487
+ }
488
+ function ye() {
489
+ {
490
+ if (z.current) {
491
+ var e = w(z.current.type);
492
+ if (e)
493
+ return `
494
+
495
+ Check the render method of \`` + e + "`.";
496
+ }
497
+ return "";
498
+ }
499
+ }
500
+ function or(e) {
501
+ {
502
+ if (e !== void 0) {
503
+ var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
504
+ return `
505
+
506
+ Check your code at ` + r + ":" + t + ".";
507
+ }
508
+ return "";
509
+ }
510
+ }
511
+ var Ee = {};
512
+ function ir(e) {
513
+ {
514
+ var r = ye();
515
+ if (!r) {
516
+ var t = typeof e == "string" ? e : e.displayName || e.name;
517
+ t && (r = `
518
+
519
+ Check the top-level render call using <` + t + ">.");
520
+ }
521
+ return r;
522
+ }
523
+ }
524
+ function be(e, r) {
525
+ {
526
+ if (!e._store || e._store.validated || e.key != null)
527
+ return;
528
+ e._store.validated = !0;
529
+ var t = ir(r);
530
+ if (Ee[t])
531
+ return;
532
+ Ee[t] = !0;
533
+ var n = "";
534
+ e && e._owner && e._owner !== z.current && (n = " It was passed a child from " + w(e._owner.type) + "."), k(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), k(null);
535
+ }
536
+ }
537
+ function Re(e, r) {
538
+ {
539
+ if (typeof e != "object")
540
+ return;
541
+ if (J(e))
542
+ for (var t = 0; t < e.length; t++) {
543
+ var n = e[t];
544
+ H(n) && be(n, r);
545
+ }
546
+ else if (H(e))
547
+ e._store && (e._store.validated = !0);
548
+ else if (e) {
549
+ var u = De(e);
550
+ if (typeof u == "function" && u !== e.entries)
551
+ for (var f = u.call(e), s; !(s = f.next()).done; )
552
+ H(s.value) && be(s.value, r);
553
+ }
554
+ }
555
+ }
556
+ function sr(e) {
557
+ {
558
+ var r = e.type;
559
+ if (r == null || typeof r == "string")
560
+ return;
561
+ var t;
562
+ if (typeof r == "function")
563
+ t = r.propTypes;
564
+ else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
565
+ // Inner props are checked in the reconciler.
566
+ r.$$typeof === O))
567
+ t = r.propTypes;
568
+ else
569
+ return;
570
+ if (t) {
571
+ var n = w(r);
572
+ Ge(t, e.props, "prop", n, e);
573
+ } else if (r.PropTypes !== void 0 && !K) {
574
+ K = !0;
575
+ var u = w(r);
576
+ h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
577
+ }
578
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
579
+ }
580
+ }
581
+ function ur(e) {
582
+ {
583
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
584
+ var n = r[t];
585
+ if (n !== "children" && n !== "key") {
586
+ k(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
587
+ break;
588
+ }
589
+ }
590
+ e.ref !== null && (k(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
591
+ }
592
+ }
593
+ function Te(e, r, t, n, u, f) {
594
+ {
595
+ var s = Ye(e);
596
+ if (!s) {
597
+ var o = "";
598
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
599
+ var m = or(u);
600
+ m ? o += m : o += ye();
601
+ var v;
602
+ e === null ? v = "null" : J(e) ? v = "array" : e !== void 0 && e.$$typeof === a ? (v = "<" + (w(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : v = 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", v, o);
603
+ }
604
+ var g = ar(e, r, t, u, f);
605
+ if (g == null)
606
+ return g;
607
+ if (s) {
608
+ var R = r.children;
609
+ if (R !== void 0)
610
+ if (n)
611
+ if (J(R)) {
612
+ for (var I = 0; I < R.length; I++)
613
+ Re(R[I], e);
614
+ Object.freeze && Object.freeze(R);
615
+ } else
616
+ 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.");
617
+ else
618
+ Re(R, e);
619
+ }
620
+ return e === c ? ur(g) : sr(g), g;
621
+ }
622
+ }
623
+ function fr(e, r, t) {
624
+ return Te(e, r, t, !0);
625
+ }
626
+ function cr(e, r, t) {
627
+ return Te(e, r, t, !1);
628
+ }
629
+ var lr = cr, dr = fr;
630
+ F.Fragment = c, F.jsx = lr, F.jsxs = dr;
631
+ }()), F;
632
+ }
633
+ var $ = {};
634
+ /**
635
+ * @license React
636
+ * react-jsx-runtime.production.min.js
637
+ *
638
+ * Copyright (c) Facebook, Inc. and its affiliates.
639
+ *
640
+ * This source code is licensed under the MIT license found in the
641
+ * LICENSE file in the root directory of this source tree.
642
+ */
643
+ var xe;
644
+ function _r() {
645
+ if (xe)
646
+ return $;
647
+ xe = 1;
648
+ var i = Se, a = Symbol.for("react.element"), l = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, _ = i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
649
+ function b(y, p, T) {
650
+ var E, O = {}, S = null, L = null;
651
+ T !== void 0 && (S = "" + T), p.key !== void 0 && (S = "" + p.key), p.ref !== void 0 && (L = p.ref);
652
+ for (E in p)
653
+ c.call(p, E) && !d.hasOwnProperty(E) && (O[E] = p[E]);
654
+ if (y && y.defaultProps)
655
+ for (E in p = y.defaultProps, p)
656
+ O[E] === void 0 && (O[E] = p[E]);
657
+ return { $$typeof: a, type: y, key: S, ref: L, props: O, _owner: _.current };
658
+ }
659
+ return $.Fragment = l, $.jsx = b, $.jsxs = b, $;
660
+ }
661
+ process.env.NODE_ENV === "production" ? Z.exports = _r() : Z.exports = mr();
662
+ var Q = Z.exports;
663
+ const yr = "_screenRightIn_m73xp_1", Er = "_screenCenterIn_m73xp_1", br = "_screenLeftIn_m73xp_1", Rr = "_screenOut_m73xp_1", ke = {
664
+ "toast-container": "_toast-container_m73xp_5",
665
+ "toast-message": "_toast-message_m73xp_29",
666
+ screenRightIn: yr,
667
+ screenCenterIn: Er,
668
+ screenLeftIn: br,
669
+ screenOut: Rr
670
+ };
671
+ function Tr({
672
+ message: { duration: i = 1e3 * 7, id: a, text: l, type: c },
673
+ onRemoveMessage: _,
674
+ classNames: d
675
+ }) {
676
+ const [b, y] = Pe(!1);
677
+ function p() {
678
+ b && _(a);
679
+ }
680
+ return je(() => {
681
+ const T = setTimeout(() => y(!0), i);
682
+ return () => clearTimeout(T);
683
+ }, [_, a, i]), /* @__PURE__ */ Q.jsx(
684
+ "button",
685
+ {
686
+ tabIndex: 0,
687
+ onClick: p,
688
+ onAnimationEnd: p,
689
+ style: Cr(d == null ? void 0 : d[c]),
690
+ className: `${ke["toast-message"]} ${Or(d == null ? void 0 : d[c])}`,
691
+ "data-type": c,
692
+ "data-animation-end": b,
693
+ children: l
694
+ }
695
+ );
696
+ }
697
+ function Cr(i) {
698
+ if (!(!i || typeof i != "object"))
699
+ return i;
700
+ }
701
+ function Or(i) {
702
+ return !i || typeof i != "string" ? "" : i;
703
+ }
704
+ function Sr({
705
+ classNames: i,
706
+ position: a = "right-top"
707
+ }) {
708
+ const [l, c] = Pe([]), _ = gr((d) => {
709
+ c(
710
+ (b) => b.filter((y) => y.id !== d)
711
+ );
712
+ }, []);
713
+ return je(() => {
714
+ function d({ text: b, duration: y, type: p }) {
715
+ c((T) => [
716
+ ...T,
717
+ { id: crypto.randomUUID(), text: b, duration: y, type: p }
718
+ ]);
719
+ }
720
+ return X.on("add-toast", d), () => {
721
+ X.removeListener("add-toast", d);
722
+ };
723
+ }, []), /* @__PURE__ */ Q.jsx("div", { "data-position": a, className: ke["toast-container"], children: l.map((d) => /* @__PURE__ */ Q.jsx(
724
+ Tr,
725
+ {
726
+ message: d,
727
+ classNames: i,
728
+ onRemoveMessage: _
729
+ },
730
+ d.id
731
+ )) });
732
+ }
733
+ export {
734
+ Sr as ToastContainer,
735
+ C as toast
736
+ };
@@ -0,0 +1,27 @@
1
+ (function(y,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],g):(y=typeof globalThis<"u"?globalThis:y||self,g(y["toast-notification"]={},y.React))})(this,function(y,g){"use strict";var yr=Object.defineProperty;var Er=(y,g,j)=>g in y?yr(y,g,{enumerable:!0,configurable:!0,writable:!0,value:j}):y[g]=j;var ke=(y,g,j)=>(Er(y,typeof g!="symbol"?g+"":g,j),j);class j{constructor(){ke(this,"listeners",new Map([]))}on(i,h){var c;this.listeners.has(i)||this.listeners.set(i,[]),(c=this.listeners.get(i))==null||c.push(h)}emit(i,h){var c;this.listeners.has(i)&&((c=this.listeners.get(i))==null||c.forEach(E=>E(h)))}removeListener(i,h){const c=this.listeners.get(i);if(!c)return;const E=c.filter(l=>l!==h);this.listeners.set(i,E)}}const G=new j;function O({duration:u,text:i,type:h}){G.emit("add-toast",{duration:u,text:i,type:h})}O.error=({duration:u,text:i})=>O({duration:u,text:i,type:"error"}),O.success=({duration:u,text:i})=>O({duration:u,text:i,type:"success"}),O.warn=({duration:u,text:i})=>O({duration:u,text:i,type:"warn"}),O.info=({duration:u,text:i})=>O({duration:u,text:i,type:"info"}),O.ghost=({duration:u,text:i})=>O({duration:u,text:i,type:"ghost"});var z={exports:{}},L={};/**
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 ne;function Ie(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&function(){var u=g,i=Symbol.for("react.element"),h=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),b=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),ie=Symbol.iterator,We="@@iterator";function Ye(e){if(e===null||typeof e!="object")return null;var r=ie&&e[ie]||e[We];return typeof r=="function"?r:null}var D=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Ue("error",e,t)}}function Ue(e,r,t){{var n=D.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var f=t.map(function(o){return String(o)});f.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,f)}}var Ve=!1,$e=!1,Ne=!1,Be=!1,Je=!1,se;se=Symbol.for("react.module.reference");function Ge(e){return!!(typeof e=="string"||typeof e=="function"||e===c||e===l||Je||e===E||e===S||e===R||Be||e===U||Ve||$e||Ne||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===w||e.$$typeof===T||e.$$typeof===b||e.$$typeof===v||e.$$typeof===se||e.getModuleId!==void 0))}function ze(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function ue(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&m("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 h:return"Portal";case l:return"Profiler";case E:return"StrictMode";case S:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b:var r=e;return ue(r)+".Consumer";case T:var t=e;return ue(t._context)+".Provider";case v:return ze(e,e.render,"ForwardRef");case w:var n=e.displayName||null;return n!==null?n:x(e.type)||"Memo";case k:{var s=e,f=s._payload,o=s._init;try{return x(o(f))}catch{return null}}}return null}var I=Object.assign,W=0,fe,ce,le,de,ve,pe,ge;function he(){}he.__reactDisabledLog=!0;function Ke(){{if(W===0){fe=console.log,ce=console.info,le=console.warn,de=console.error,ve=console.group,pe=console.groupCollapsed,ge=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})}W++}}function He(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:fe}),info:I({},e,{value:ce}),warn:I({},e,{value:le}),error:I({},e,{value:de}),group:I({},e,{value:ve}),groupCollapsed:I({},e,{value:pe}),groupEnd:I({},e,{value:ge})})}W<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=D.ReactCurrentDispatcher,X;function V(e,r,t){{if(X===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||""}return`
10
+ `+X+e}}var q=!1,$;{var Xe=typeof WeakMap=="function"?WeakMap:Map;$=new Xe}function me(e,r){if(!e||q)return"";{var t=$.get(e);if(t!==void 0)return t}var n;q=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var f;f=H.current,H.current=null,Ke();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
+ `),_=n.stack.split(`
12
+ `),d=a.length-1,p=_.length-1;d>=1&&p>=0&&a[d]!==_[p];)p--;for(;d>=1&&p>=0;d--,p--)if(a[d]!==_[p]){if(d!==1||p!==1)do if(d--,p--,p<0||a[d]!==_[p]){var C=`
13
+ `+a[d].replace(" at new "," at ");return e.displayName&&C.includes("<anonymous>")&&(C=C.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,C),C}while(d>=1&&p>=0);break}}}finally{q=!1,H.current=f,He(),Error.prepareStackTrace=s}var F=e?e.displayName||e.name:"",je=F?V(F):"";return typeof e=="function"&&$.set(e,je),je}function qe(e,r,t){return me(e,!1)}function Ze(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function N(e,r,t){if(e==null)return"";if(typeof e=="function")return me(e,Ze(e));if(typeof e=="string")return V(e);switch(e){case S:return V("Suspense");case R:return V("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case v:return qe(e.render);case w:return N(e.type,r,t);case k:{var n=e,s=n._payload,f=n._init;try{return N(f(s),r,t)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,_e={},ye=D.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);ye.setExtraStackFrame(t)}else ye.setExtraStackFrame(null)}function Qe(e,r,t,n,s){{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 _=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 _.name="Invariant Violation",_}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(d){a=d}a&&!(a instanceof Error)&&(J(s),m("%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 _e)&&(_e[a.message]=!0,J(s),m("Failed %s type: %s",t,a.message),J(null))}}}var er=Array.isArray;function Z(e){return er(e)}function rr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function tr(e){try{return Ee(e),!1}catch{return!0}}function Ee(e){return""+e}function be(e){if(tr(e))return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rr(e)),Ee(e)}var Y=D.ReactCurrentOwner,nr={key:!0,ref:!0,__self:!0,__source:!0},Re,Te,Q;Q={};function ar(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 or(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 ir(e,r){if(typeof e.ref=="string"&&Y.current&&r&&Y.current.stateNode!==r){var t=x(Y.current.type);Q[t]||(m('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',x(Y.current.type),e.ref),Q[t]=!0)}}function sr(e,r){{var t=function(){Re||(Re=!0,m("%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 ur(e,r){{var t=function(){Te||(Te=!0,m("%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 fr=function(e,r,t,n,s,f,o){var a={$$typeof:i,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:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function cr(e,r,t,n,s){{var f,o={},a=null,_=null;t!==void 0&&(be(t),a=""+t),or(r)&&(be(r.key),a=""+r.key),ar(r)&&(_=r.ref,ir(r,s));for(f in r)B.call(r,f)&&!nr.hasOwnProperty(f)&&(o[f]=r[f]);if(e&&e.defaultProps){var d=e.defaultProps;for(f in d)o[f]===void 0&&(o[f]=d[f])}if(a||_){var p=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&sr(o,p),_&&ur(o,p)}return fr(e,a,_,s,n,Y.current,o)}}var ee=D.ReactCurrentOwner,Ce=D.ReactDebugCurrentFrame;function A(e){if(e){var r=e._owner,t=N(e.type,e._source,r?r.type:null);Ce.setExtraStackFrame(t)}else Ce.setExtraStackFrame(null)}var re;re=!1;function te(e){return typeof e=="object"&&e!==null&&e.$$typeof===i}function Oe(){{if(ee.current){var e=x(ee.current.type);if(e)return`
14
+
15
+ Check the render method of \``+e+"`."}return""}}function lr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
16
+
17
+ Check your code at `+r+":"+t+"."}return""}}var Se={};function dr(e){{var r=Oe();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 we(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=dr(r);if(Se[t])return;Se[t]=!0;var n="";e&&e._owner&&e._owner!==ee.current&&(n=" It was passed a child from "+x(e._owner.type)+"."),A(e),m('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),A(null)}}function xe(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var n=e[t];te(n)&&we(n,r)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var s=Ye(e);if(typeof s=="function"&&s!==e.entries)for(var f=s.call(e),o;!(o=f.next()).done;)te(o.value)&&we(o.value,r)}}}function vr(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===v||r.$$typeof===w))t=r.propTypes;else return;if(t){var n=x(r);Qe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!re){re=!0;var s=x(r);m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),m("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function Pe(e,r,t,n,s,f){{var o=Ge(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 _=lr(s);_?a+=_:a+=Oe();var d;e===null?d="null":Z(e)?d="array":e!==void 0&&e.$$typeof===i?(d="<"+(x(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):d=typeof e,m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",d,a)}var p=cr(e,r,t,s,f);if(p==null)return p;if(o){var C=r.children;if(C!==void 0)if(n)if(Z(C)){for(var F=0;F<C.length;F++)xe(C[F],e);Object.freeze&&Object.freeze(C)}else m("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 xe(C,e)}return e===c?pr(p):vr(p),p}}function gr(e,r,t){return Pe(e,r,t,!0)}function hr(e,r,t){return Pe(e,r,t,!1)}var mr=hr,_r=gr;L.Fragment=c,L.jsx=mr,L.jsxs=_r}()),L}var M={};/**
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 ae;function De(){if(ae)return M;ae=1;var u=g,i=Symbol.for("react.element"),h=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,E=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function T(b,v,S){var R,w={},k=null,U=null;S!==void 0&&(k=""+S),v.key!==void 0&&(k=""+v.key),v.ref!==void 0&&(U=v.ref);for(R in v)c.call(v,R)&&!l.hasOwnProperty(R)&&(w[R]=v[R]);if(b&&b.defaultProps)for(R in v=b.defaultProps,v)w[R]===void 0&&(w[R]=v[R]);return{$$typeof:i,type:b,key:k,ref:U,props:w,_owner:E.current}}return M.Fragment=h,M.jsx=T,M.jsxs=T,M}process.env.NODE_ENV==="production"?z.exports=De():z.exports=Ie();var K=z.exports;const oe={"toast-container":"_toast-container_m73xp_5","toast-message":"_toast-message_m73xp_29",screenRightIn:"_screenRightIn_m73xp_1",screenCenterIn:"_screenCenterIn_m73xp_1",screenLeftIn:"_screenLeftIn_m73xp_1",screenOut:"_screenOut_m73xp_1"};function Ae({message:{duration:u=1e3*7,id:i,text:h,type:c},onRemoveMessage:E,classNames:l}){const[T,b]=g.useState(!1);function v(){T&&E(i)}return g.useEffect(()=>{const S=setTimeout(()=>b(!0),u);return()=>clearTimeout(S)},[E,i,u]),K.jsx("button",{tabIndex:0,onClick:v,onAnimationEnd:v,style:Fe(l==null?void 0:l[c]),className:`${oe["toast-message"]} ${Le(l==null?void 0:l[c])}`,"data-type":c,"data-animation-end":T,children:h})}function Fe(u){if(!(!u||typeof u!="object"))return u}function Le(u){return!u||typeof u!="string"?"":u}function Me({classNames:u,position:i="right-top"}){const[h,c]=g.useState([]),E=g.useCallback(l=>{c(T=>T.filter(b=>b.id!==l))},[]);return g.useEffect(()=>{function l({text:T,duration:b,type:v}){c(S=>[...S,{id:crypto.randomUUID(),text:T,duration:b,type:v}])}return G.on("add-toast",l),()=>{G.removeListener("add-toast",l)}},[]),K.jsx("div",{"data-position":i,className:oe["toast-container"],children:h.map(l=>K.jsx(Ae,{message:l,classNames:u,onRemoveMessage:E},l.id))})}y.ToastContainer=Me,y.toast=O,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})});
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@edinelsonslima/toast-notification",
3
+ "version": "0.0.16",
4
+ "author": "@edinelsonslima",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/edinelsonslima/@edinelsonslima/toast-notification.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/edinelsonslima/@edinelsonslima/toast-notification/issues"
12
+ },
13
+ "homepage": "https://github.com/edinelsonslima/@edinelsonslima/toast-notification#readme",
14
+ "main": "./dist/toast-notification.umd.js",
15
+ "module": "./dist/toast-notification.es.js",
16
+ "types": "./dist/index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/toast-notification.es.js",
20
+ "require": "./dist/toast-notification.umd.js"
21
+ },
22
+ "./dist/style.css": {
23
+ "import": "./dist/style.css",
24
+ "require": "./dist/style.css"
25
+ }
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "scripts": {
31
+ "dev": "vite",
32
+ "build": "tsc && vite build",
33
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
34
+ "preview": "vite preview"
35
+ },
36
+ "dependencies": {
37
+ "react": "^18.2.0",
38
+ "react-dom": "^18.2.0"
39
+ },
40
+ "devDependencies": {
41
+ "@types/react": "^18.2.37",
42
+ "@types/react-dom": "^18.2.15",
43
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
44
+ "@typescript-eslint/parser": "^6.10.0",
45
+ "@vitejs/plugin-react-swc": "^3.5.0",
46
+ "eslint": "^8.53.0",
47
+ "eslint-plugin-react-hooks": "^4.6.0",
48
+ "eslint-plugin-react-refresh": "^0.4.4",
49
+ "path": "^0.12.7",
50
+ "typescript": "^5.2.2",
51
+ "vite": "^5.0.0",
52
+ "vite-plugin-dts": "^3.6.4"
53
+ }
54
+ }