@starasia/toast 1.0.0
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 +71 -0
- package/dist/Toast.d.ts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/state.d.ts +21 -0
- package/dist/toast.es.js +1127 -0
- package/dist/toast.umd.js +331 -0
- package/dist/types.d.ts +10 -0
- package/package.json +37 -0
package/dist/toast.es.js
ADDED
|
@@ -0,0 +1,1127 @@
|
|
|
1
|
+
import z, { useState as Cr, useRef as pe, useEffect as Sr } from "react";
|
|
2
|
+
import me from "react-dom";
|
|
3
|
+
var nr = { exports: {} }, Y = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.min.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var jr;
|
|
14
|
+
function be() {
|
|
15
|
+
if (jr)
|
|
16
|
+
return Y;
|
|
17
|
+
jr = 1;
|
|
18
|
+
var l = z, a = Symbol.for("react.element"), b = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, v = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, w = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
19
|
+
function T(E, d, C) {
|
|
20
|
+
var p, k = {}, j = null, x = null;
|
|
21
|
+
C !== void 0 && (j = "" + C), d.key !== void 0 && (j = "" + d.key), d.ref !== void 0 && (x = d.ref);
|
|
22
|
+
for (p in d)
|
|
23
|
+
y.call(d, p) && !w.hasOwnProperty(p) && (k[p] = d[p]);
|
|
24
|
+
if (E && E.defaultProps)
|
|
25
|
+
for (p in d = E.defaultProps, d)
|
|
26
|
+
k[p] === void 0 && (k[p] = d[p]);
|
|
27
|
+
return { $$typeof: a, type: E, key: j, ref: x, props: k, _owner: v.current };
|
|
28
|
+
}
|
|
29
|
+
return Y.Fragment = b, Y.jsx = T, Y.jsxs = T, Y;
|
|
30
|
+
}
|
|
31
|
+
var N = {};
|
|
32
|
+
/**
|
|
33
|
+
* @license React
|
|
34
|
+
* react-jsx-runtime.development.js
|
|
35
|
+
*
|
|
36
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the MIT license found in the
|
|
39
|
+
* LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/
|
|
41
|
+
var Or;
|
|
42
|
+
function he() {
|
|
43
|
+
return Or || (Or = 1, process.env.NODE_ENV !== "production" && function() {
|
|
44
|
+
var l = z, a = Symbol.for("react.element"), b = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), E = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), I = Symbol.iterator, Ar = "@@iterator";
|
|
45
|
+
function Dr(r) {
|
|
46
|
+
if (r === null || typeof r != "object")
|
|
47
|
+
return null;
|
|
48
|
+
var e = I && r[I] || r[Ar];
|
|
49
|
+
return typeof e == "function" ? e : null;
|
|
50
|
+
}
|
|
51
|
+
var D = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
52
|
+
function m(r) {
|
|
53
|
+
{
|
|
54
|
+
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), t = 1; t < e; t++)
|
|
55
|
+
n[t - 1] = arguments[t];
|
|
56
|
+
Fr("error", r, n);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function Fr(r, e, n) {
|
|
60
|
+
{
|
|
61
|
+
var t = D.ReactDebugCurrentFrame, s = t.getStackAddendum();
|
|
62
|
+
s !== "" && (e += "%s", n = n.concat([s]));
|
|
63
|
+
var u = n.map(function(i) {
|
|
64
|
+
return String(i);
|
|
65
|
+
});
|
|
66
|
+
u.unshift("Warning: " + e), Function.prototype.apply.call(console[r], console, u);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
var Lr = !1, Ir = !1, $r = !1, Wr = !1, Mr = !1, tr;
|
|
70
|
+
tr = Symbol.for("react.module.reference");
|
|
71
|
+
function Yr(r) {
|
|
72
|
+
return !!(typeof r == "string" || typeof r == "function" || r === y || r === w || Mr || r === v || r === C || r === p || Wr || r === x || Lr || Ir || $r || typeof r == "object" && r !== null && (r.$$typeof === j || r.$$typeof === k || r.$$typeof === T || r.$$typeof === E || r.$$typeof === d || // This needs to include all possible module reference object
|
|
73
|
+
// types supported by any Flight configuration anywhere since
|
|
74
|
+
// we don't know which Flight build this will end up being used
|
|
75
|
+
// with.
|
|
76
|
+
r.$$typeof === tr || r.getModuleId !== void 0));
|
|
77
|
+
}
|
|
78
|
+
function Nr(r, e, n) {
|
|
79
|
+
var t = r.displayName;
|
|
80
|
+
if (t)
|
|
81
|
+
return t;
|
|
82
|
+
var s = e.displayName || e.name || "";
|
|
83
|
+
return s !== "" ? n + "(" + s + ")" : n;
|
|
84
|
+
}
|
|
85
|
+
function ar(r) {
|
|
86
|
+
return r.displayName || "Context";
|
|
87
|
+
}
|
|
88
|
+
function S(r) {
|
|
89
|
+
if (r == null)
|
|
90
|
+
return null;
|
|
91
|
+
if (typeof r.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
|
|
92
|
+
return r.displayName || r.name || null;
|
|
93
|
+
if (typeof r == "string")
|
|
94
|
+
return r;
|
|
95
|
+
switch (r) {
|
|
96
|
+
case y:
|
|
97
|
+
return "Fragment";
|
|
98
|
+
case b:
|
|
99
|
+
return "Portal";
|
|
100
|
+
case w:
|
|
101
|
+
return "Profiler";
|
|
102
|
+
case v:
|
|
103
|
+
return "StrictMode";
|
|
104
|
+
case C:
|
|
105
|
+
return "Suspense";
|
|
106
|
+
case p:
|
|
107
|
+
return "SuspenseList";
|
|
108
|
+
}
|
|
109
|
+
if (typeof r == "object")
|
|
110
|
+
switch (r.$$typeof) {
|
|
111
|
+
case E:
|
|
112
|
+
var e = r;
|
|
113
|
+
return ar(e) + ".Consumer";
|
|
114
|
+
case T:
|
|
115
|
+
var n = r;
|
|
116
|
+
return ar(n._context) + ".Provider";
|
|
117
|
+
case d:
|
|
118
|
+
return Nr(r, r.render, "ForwardRef");
|
|
119
|
+
case k:
|
|
120
|
+
var t = r.displayName || null;
|
|
121
|
+
return t !== null ? t : S(r.type) || "Memo";
|
|
122
|
+
case j: {
|
|
123
|
+
var s = r, u = s._payload, i = s._init;
|
|
124
|
+
try {
|
|
125
|
+
return S(i(u));
|
|
126
|
+
} catch {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
var P = Object.assign, $ = 0, or, ir, sr, ur, lr, cr, fr;
|
|
134
|
+
function dr() {
|
|
135
|
+
}
|
|
136
|
+
dr.__reactDisabledLog = !0;
|
|
137
|
+
function Ur() {
|
|
138
|
+
{
|
|
139
|
+
if ($ === 0) {
|
|
140
|
+
or = console.log, ir = console.info, sr = console.warn, ur = console.error, lr = console.group, cr = console.groupCollapsed, fr = console.groupEnd;
|
|
141
|
+
var r = {
|
|
142
|
+
configurable: !0,
|
|
143
|
+
enumerable: !0,
|
|
144
|
+
value: dr,
|
|
145
|
+
writable: !0
|
|
146
|
+
};
|
|
147
|
+
Object.defineProperties(console, {
|
|
148
|
+
info: r,
|
|
149
|
+
log: r,
|
|
150
|
+
warn: r,
|
|
151
|
+
error: r,
|
|
152
|
+
group: r,
|
|
153
|
+
groupCollapsed: r,
|
|
154
|
+
groupEnd: r
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
$++;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function Br() {
|
|
161
|
+
{
|
|
162
|
+
if ($--, $ === 0) {
|
|
163
|
+
var r = {
|
|
164
|
+
configurable: !0,
|
|
165
|
+
enumerable: !0,
|
|
166
|
+
writable: !0
|
|
167
|
+
};
|
|
168
|
+
Object.defineProperties(console, {
|
|
169
|
+
log: P({}, r, {
|
|
170
|
+
value: or
|
|
171
|
+
}),
|
|
172
|
+
info: P({}, r, {
|
|
173
|
+
value: ir
|
|
174
|
+
}),
|
|
175
|
+
warn: P({}, r, {
|
|
176
|
+
value: sr
|
|
177
|
+
}),
|
|
178
|
+
error: P({}, r, {
|
|
179
|
+
value: ur
|
|
180
|
+
}),
|
|
181
|
+
group: P({}, r, {
|
|
182
|
+
value: lr
|
|
183
|
+
}),
|
|
184
|
+
groupCollapsed: P({}, r, {
|
|
185
|
+
value: cr
|
|
186
|
+
}),
|
|
187
|
+
groupEnd: P({}, r, {
|
|
188
|
+
value: fr
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
$ < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
var G = D.ReactCurrentDispatcher, J;
|
|
196
|
+
function U(r, e, n) {
|
|
197
|
+
{
|
|
198
|
+
if (J === void 0)
|
|
199
|
+
try {
|
|
200
|
+
throw Error();
|
|
201
|
+
} catch (s) {
|
|
202
|
+
var t = s.stack.trim().match(/\n( *(at )?)/);
|
|
203
|
+
J = t && t[1] || "";
|
|
204
|
+
}
|
|
205
|
+
return `
|
|
206
|
+
` + J + r;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
var q = !1, B;
|
|
210
|
+
{
|
|
211
|
+
var Vr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
212
|
+
B = new Vr();
|
|
213
|
+
}
|
|
214
|
+
function vr(r, e) {
|
|
215
|
+
if (!r || q)
|
|
216
|
+
return "";
|
|
217
|
+
{
|
|
218
|
+
var n = B.get(r);
|
|
219
|
+
if (n !== void 0)
|
|
220
|
+
return n;
|
|
221
|
+
}
|
|
222
|
+
var t;
|
|
223
|
+
q = !0;
|
|
224
|
+
var s = Error.prepareStackTrace;
|
|
225
|
+
Error.prepareStackTrace = void 0;
|
|
226
|
+
var u;
|
|
227
|
+
u = G.current, G.current = null, Ur();
|
|
228
|
+
try {
|
|
229
|
+
if (e) {
|
|
230
|
+
var i = function() {
|
|
231
|
+
throw Error();
|
|
232
|
+
};
|
|
233
|
+
if (Object.defineProperty(i.prototype, "props", {
|
|
234
|
+
set: function() {
|
|
235
|
+
throw Error();
|
|
236
|
+
}
|
|
237
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
238
|
+
try {
|
|
239
|
+
Reflect.construct(i, []);
|
|
240
|
+
} catch (R) {
|
|
241
|
+
t = R;
|
|
242
|
+
}
|
|
243
|
+
Reflect.construct(r, [], i);
|
|
244
|
+
} else {
|
|
245
|
+
try {
|
|
246
|
+
i.call();
|
|
247
|
+
} catch (R) {
|
|
248
|
+
t = R;
|
|
249
|
+
}
|
|
250
|
+
r.call(i.prototype);
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
try {
|
|
254
|
+
throw Error();
|
|
255
|
+
} catch (R) {
|
|
256
|
+
t = R;
|
|
257
|
+
}
|
|
258
|
+
r();
|
|
259
|
+
}
|
|
260
|
+
} catch (R) {
|
|
261
|
+
if (R && t && typeof R.stack == "string") {
|
|
262
|
+
for (var o = R.stack.split(`
|
|
263
|
+
`), h = t.stack.split(`
|
|
264
|
+
`), c = o.length - 1, f = h.length - 1; c >= 1 && f >= 0 && o[c] !== h[f]; )
|
|
265
|
+
f--;
|
|
266
|
+
for (; c >= 1 && f >= 0; c--, f--)
|
|
267
|
+
if (o[c] !== h[f]) {
|
|
268
|
+
if (c !== 1 || f !== 1)
|
|
269
|
+
do
|
|
270
|
+
if (c--, f--, f < 0 || o[c] !== h[f]) {
|
|
271
|
+
var _ = `
|
|
272
|
+
` + o[c].replace(" at new ", " at ");
|
|
273
|
+
return r.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", r.displayName)), typeof r == "function" && B.set(r, _), _;
|
|
274
|
+
}
|
|
275
|
+
while (c >= 1 && f >= 0);
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
} finally {
|
|
280
|
+
q = !1, G.current = u, Br(), Error.prepareStackTrace = s;
|
|
281
|
+
}
|
|
282
|
+
var L = r ? r.displayName || r.name : "", A = L ? U(L) : "";
|
|
283
|
+
return typeof r == "function" && B.set(r, A), A;
|
|
284
|
+
}
|
|
285
|
+
function Xr(r, e, n) {
|
|
286
|
+
return vr(r, !1);
|
|
287
|
+
}
|
|
288
|
+
function zr(r) {
|
|
289
|
+
var e = r.prototype;
|
|
290
|
+
return !!(e && e.isReactComponent);
|
|
291
|
+
}
|
|
292
|
+
function V(r, e, n) {
|
|
293
|
+
if (r == null)
|
|
294
|
+
return "";
|
|
295
|
+
if (typeof r == "function")
|
|
296
|
+
return vr(r, zr(r));
|
|
297
|
+
if (typeof r == "string")
|
|
298
|
+
return U(r);
|
|
299
|
+
switch (r) {
|
|
300
|
+
case C:
|
|
301
|
+
return U("Suspense");
|
|
302
|
+
case p:
|
|
303
|
+
return U("SuspenseList");
|
|
304
|
+
}
|
|
305
|
+
if (typeof r == "object")
|
|
306
|
+
switch (r.$$typeof) {
|
|
307
|
+
case d:
|
|
308
|
+
return Xr(r.render);
|
|
309
|
+
case k:
|
|
310
|
+
return V(r.type, e, n);
|
|
311
|
+
case j: {
|
|
312
|
+
var t = r, s = t._payload, u = t._init;
|
|
313
|
+
try {
|
|
314
|
+
return V(u(s), e, n);
|
|
315
|
+
} catch {
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return "";
|
|
320
|
+
}
|
|
321
|
+
var W = Object.prototype.hasOwnProperty, gr = {}, pr = D.ReactDebugCurrentFrame;
|
|
322
|
+
function X(r) {
|
|
323
|
+
if (r) {
|
|
324
|
+
var e = r._owner, n = V(r.type, r._source, e ? e.type : null);
|
|
325
|
+
pr.setExtraStackFrame(n);
|
|
326
|
+
} else
|
|
327
|
+
pr.setExtraStackFrame(null);
|
|
328
|
+
}
|
|
329
|
+
function Gr(r, e, n, t, s) {
|
|
330
|
+
{
|
|
331
|
+
var u = Function.call.bind(W);
|
|
332
|
+
for (var i in r)
|
|
333
|
+
if (u(r, i)) {
|
|
334
|
+
var o = void 0;
|
|
335
|
+
try {
|
|
336
|
+
if (typeof r[i] != "function") {
|
|
337
|
+
var h = Error((t || "React class") + ": " + n + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
338
|
+
throw h.name = "Invariant Violation", h;
|
|
339
|
+
}
|
|
340
|
+
o = r[i](e, i, t, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
341
|
+
} catch (c) {
|
|
342
|
+
o = c;
|
|
343
|
+
}
|
|
344
|
+
o && !(o instanceof Error) && (X(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).", t || "React class", n, i, typeof o), X(null)), o instanceof Error && !(o.message in gr) && (gr[o.message] = !0, X(s), m("Failed %s type: %s", n, o.message), X(null));
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
var Jr = Array.isArray;
|
|
349
|
+
function K(r) {
|
|
350
|
+
return Jr(r);
|
|
351
|
+
}
|
|
352
|
+
function qr(r) {
|
|
353
|
+
{
|
|
354
|
+
var e = typeof Symbol == "function" && Symbol.toStringTag, n = e && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
355
|
+
return n;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
function Kr(r) {
|
|
359
|
+
try {
|
|
360
|
+
return mr(r), !1;
|
|
361
|
+
} catch {
|
|
362
|
+
return !0;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function mr(r) {
|
|
366
|
+
return "" + r;
|
|
367
|
+
}
|
|
368
|
+
function br(r) {
|
|
369
|
+
if (Kr(r))
|
|
370
|
+
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qr(r)), mr(r);
|
|
371
|
+
}
|
|
372
|
+
var M = D.ReactCurrentOwner, Hr = {
|
|
373
|
+
key: !0,
|
|
374
|
+
ref: !0,
|
|
375
|
+
__self: !0,
|
|
376
|
+
__source: !0
|
|
377
|
+
}, hr, yr, H;
|
|
378
|
+
H = {};
|
|
379
|
+
function Zr(r) {
|
|
380
|
+
if (W.call(r, "ref")) {
|
|
381
|
+
var e = Object.getOwnPropertyDescriptor(r, "ref").get;
|
|
382
|
+
if (e && e.isReactWarning)
|
|
383
|
+
return !1;
|
|
384
|
+
}
|
|
385
|
+
return r.ref !== void 0;
|
|
386
|
+
}
|
|
387
|
+
function Qr(r) {
|
|
388
|
+
if (W.call(r, "key")) {
|
|
389
|
+
var e = Object.getOwnPropertyDescriptor(r, "key").get;
|
|
390
|
+
if (e && e.isReactWarning)
|
|
391
|
+
return !1;
|
|
392
|
+
}
|
|
393
|
+
return r.key !== void 0;
|
|
394
|
+
}
|
|
395
|
+
function re(r, e) {
|
|
396
|
+
if (typeof r.ref == "string" && M.current && e && M.current.stateNode !== e) {
|
|
397
|
+
var n = S(M.current.type);
|
|
398
|
+
H[n] || (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', S(M.current.type), r.ref), H[n] = !0);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function ee(r, e) {
|
|
402
|
+
{
|
|
403
|
+
var n = function() {
|
|
404
|
+
hr || (hr = !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)", e));
|
|
405
|
+
};
|
|
406
|
+
n.isReactWarning = !0, Object.defineProperty(r, "key", {
|
|
407
|
+
get: n,
|
|
408
|
+
configurable: !0
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function ne(r, e) {
|
|
413
|
+
{
|
|
414
|
+
var n = function() {
|
|
415
|
+
yr || (yr = !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)", e));
|
|
416
|
+
};
|
|
417
|
+
n.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
|
418
|
+
get: n,
|
|
419
|
+
configurable: !0
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
var te = function(r, e, n, t, s, u, i) {
|
|
424
|
+
var o = {
|
|
425
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
426
|
+
$$typeof: a,
|
|
427
|
+
// Built-in properties that belong on the element
|
|
428
|
+
type: r,
|
|
429
|
+
key: e,
|
|
430
|
+
ref: n,
|
|
431
|
+
props: i,
|
|
432
|
+
// Record the component responsible for creating this element.
|
|
433
|
+
_owner: u
|
|
434
|
+
};
|
|
435
|
+
return o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
436
|
+
configurable: !1,
|
|
437
|
+
enumerable: !1,
|
|
438
|
+
writable: !0,
|
|
439
|
+
value: !1
|
|
440
|
+
}), Object.defineProperty(o, "_self", {
|
|
441
|
+
configurable: !1,
|
|
442
|
+
enumerable: !1,
|
|
443
|
+
writable: !1,
|
|
444
|
+
value: t
|
|
445
|
+
}), Object.defineProperty(o, "_source", {
|
|
446
|
+
configurable: !1,
|
|
447
|
+
enumerable: !1,
|
|
448
|
+
writable: !1,
|
|
449
|
+
value: s
|
|
450
|
+
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
451
|
+
};
|
|
452
|
+
function ae(r, e, n, t, s) {
|
|
453
|
+
{
|
|
454
|
+
var u, i = {}, o = null, h = null;
|
|
455
|
+
n !== void 0 && (br(n), o = "" + n), Qr(e) && (br(e.key), o = "" + e.key), Zr(e) && (h = e.ref, re(e, s));
|
|
456
|
+
for (u in e)
|
|
457
|
+
W.call(e, u) && !Hr.hasOwnProperty(u) && (i[u] = e[u]);
|
|
458
|
+
if (r && r.defaultProps) {
|
|
459
|
+
var c = r.defaultProps;
|
|
460
|
+
for (u in c)
|
|
461
|
+
i[u] === void 0 && (i[u] = c[u]);
|
|
462
|
+
}
|
|
463
|
+
if (o || h) {
|
|
464
|
+
var f = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
465
|
+
o && ee(i, f), h && ne(i, f);
|
|
466
|
+
}
|
|
467
|
+
return te(r, o, h, s, t, M.current, i);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
var Z = D.ReactCurrentOwner, Er = D.ReactDebugCurrentFrame;
|
|
471
|
+
function F(r) {
|
|
472
|
+
if (r) {
|
|
473
|
+
var e = r._owner, n = V(r.type, r._source, e ? e.type : null);
|
|
474
|
+
Er.setExtraStackFrame(n);
|
|
475
|
+
} else
|
|
476
|
+
Er.setExtraStackFrame(null);
|
|
477
|
+
}
|
|
478
|
+
var Q;
|
|
479
|
+
Q = !1;
|
|
480
|
+
function rr(r) {
|
|
481
|
+
return typeof r == "object" && r !== null && r.$$typeof === a;
|
|
482
|
+
}
|
|
483
|
+
function Rr() {
|
|
484
|
+
{
|
|
485
|
+
if (Z.current) {
|
|
486
|
+
var r = S(Z.current.type);
|
|
487
|
+
if (r)
|
|
488
|
+
return `
|
|
489
|
+
|
|
490
|
+
Check the render method of \`` + r + "`.";
|
|
491
|
+
}
|
|
492
|
+
return "";
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function oe(r) {
|
|
496
|
+
{
|
|
497
|
+
if (r !== void 0) {
|
|
498
|
+
var e = r.fileName.replace(/^.*[\\\/]/, ""), n = r.lineNumber;
|
|
499
|
+
return `
|
|
500
|
+
|
|
501
|
+
Check your code at ` + e + ":" + n + ".";
|
|
502
|
+
}
|
|
503
|
+
return "";
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
var wr = {};
|
|
507
|
+
function ie(r) {
|
|
508
|
+
{
|
|
509
|
+
var e = Rr();
|
|
510
|
+
if (!e) {
|
|
511
|
+
var n = typeof r == "string" ? r : r.displayName || r.name;
|
|
512
|
+
n && (e = `
|
|
513
|
+
|
|
514
|
+
Check the top-level render call using <` + n + ">.");
|
|
515
|
+
}
|
|
516
|
+
return e;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
function _r(r, e) {
|
|
520
|
+
{
|
|
521
|
+
if (!r._store || r._store.validated || r.key != null)
|
|
522
|
+
return;
|
|
523
|
+
r._store.validated = !0;
|
|
524
|
+
var n = ie(e);
|
|
525
|
+
if (wr[n])
|
|
526
|
+
return;
|
|
527
|
+
wr[n] = !0;
|
|
528
|
+
var t = "";
|
|
529
|
+
r && r._owner && r._owner !== Z.current && (t = " It was passed a child from " + S(r._owner.type) + "."), F(r), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, t), F(null);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
function kr(r, e) {
|
|
533
|
+
{
|
|
534
|
+
if (typeof r != "object")
|
|
535
|
+
return;
|
|
536
|
+
if (K(r))
|
|
537
|
+
for (var n = 0; n < r.length; n++) {
|
|
538
|
+
var t = r[n];
|
|
539
|
+
rr(t) && _r(t, e);
|
|
540
|
+
}
|
|
541
|
+
else if (rr(r))
|
|
542
|
+
r._store && (r._store.validated = !0);
|
|
543
|
+
else if (r) {
|
|
544
|
+
var s = Dr(r);
|
|
545
|
+
if (typeof s == "function" && s !== r.entries)
|
|
546
|
+
for (var u = s.call(r), i; !(i = u.next()).done; )
|
|
547
|
+
rr(i.value) && _r(i.value, e);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
function se(r) {
|
|
552
|
+
{
|
|
553
|
+
var e = r.type;
|
|
554
|
+
if (e == null || typeof e == "string")
|
|
555
|
+
return;
|
|
556
|
+
var n;
|
|
557
|
+
if (typeof e == "function")
|
|
558
|
+
n = e.propTypes;
|
|
559
|
+
else if (typeof e == "object" && (e.$$typeof === d || // Note: Memo only checks outer props here.
|
|
560
|
+
// Inner props are checked in the reconciler.
|
|
561
|
+
e.$$typeof === k))
|
|
562
|
+
n = e.propTypes;
|
|
563
|
+
else
|
|
564
|
+
return;
|
|
565
|
+
if (n) {
|
|
566
|
+
var t = S(e);
|
|
567
|
+
Gr(n, r.props, "prop", t, r);
|
|
568
|
+
} else if (e.PropTypes !== void 0 && !Q) {
|
|
569
|
+
Q = !0;
|
|
570
|
+
var s = S(e);
|
|
571
|
+
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
|
|
572
|
+
}
|
|
573
|
+
typeof e.getDefaultProps == "function" && !e.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
function ue(r) {
|
|
577
|
+
{
|
|
578
|
+
for (var e = Object.keys(r.props), n = 0; n < e.length; n++) {
|
|
579
|
+
var t = e[n];
|
|
580
|
+
if (t !== "children" && t !== "key") {
|
|
581
|
+
F(r), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", t), F(null);
|
|
582
|
+
break;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
r.ref !== null && (F(r), m("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
var xr = {};
|
|
589
|
+
function Tr(r, e, n, t, s, u) {
|
|
590
|
+
{
|
|
591
|
+
var i = Yr(r);
|
|
592
|
+
if (!i) {
|
|
593
|
+
var o = "";
|
|
594
|
+
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).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.");
|
|
595
|
+
var h = oe(s);
|
|
596
|
+
h ? o += h : o += Rr();
|
|
597
|
+
var c;
|
|
598
|
+
r === null ? c = "null" : K(r) ? c = "array" : r !== void 0 && r.$$typeof === a ? (c = "<" + (S(r.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : c = typeof r, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, o);
|
|
599
|
+
}
|
|
600
|
+
var f = ae(r, e, n, s, u);
|
|
601
|
+
if (f == null)
|
|
602
|
+
return f;
|
|
603
|
+
if (i) {
|
|
604
|
+
var _ = e.children;
|
|
605
|
+
if (_ !== void 0)
|
|
606
|
+
if (t)
|
|
607
|
+
if (K(_)) {
|
|
608
|
+
for (var L = 0; L < _.length; L++)
|
|
609
|
+
kr(_[L], r);
|
|
610
|
+
Object.freeze && Object.freeze(_);
|
|
611
|
+
} else
|
|
612
|
+
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.");
|
|
613
|
+
else
|
|
614
|
+
kr(_, r);
|
|
615
|
+
}
|
|
616
|
+
if (W.call(e, "key")) {
|
|
617
|
+
var A = S(r), R = Object.keys(e).filter(function(ge) {
|
|
618
|
+
return ge !== "key";
|
|
619
|
+
}), er = R.length > 0 ? "{key: someKey, " + R.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
620
|
+
if (!xr[A + er]) {
|
|
621
|
+
var ve = R.length > 0 ? "{" + R.join(": ..., ") + ": ...}" : "{}";
|
|
622
|
+
m(`A props object containing a "key" prop is being spread into JSX:
|
|
623
|
+
let props = %s;
|
|
624
|
+
<%s {...props} />
|
|
625
|
+
React keys must be passed directly to JSX without using spread:
|
|
626
|
+
let props = %s;
|
|
627
|
+
<%s key={someKey} {...props} />`, er, A, ve, A), xr[A + er] = !0;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
return r === y ? ue(f) : se(f), f;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
function le(r, e, n) {
|
|
634
|
+
return Tr(r, e, n, !0);
|
|
635
|
+
}
|
|
636
|
+
function ce(r, e, n) {
|
|
637
|
+
return Tr(r, e, n, !1);
|
|
638
|
+
}
|
|
639
|
+
var fe = ce, de = le;
|
|
640
|
+
N.Fragment = y, N.jsx = fe, N.jsxs = de;
|
|
641
|
+
}()), N;
|
|
642
|
+
}
|
|
643
|
+
process.env.NODE_ENV === "production" ? nr.exports = be() : nr.exports = he();
|
|
644
|
+
var g = nr.exports;
|
|
645
|
+
const ye = `@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
|
|
646
|
+
|
|
647
|
+
* {
|
|
648
|
+
margin: 0;
|
|
649
|
+
padding: 0;
|
|
650
|
+
box-sizing: border-box;
|
|
651
|
+
font-family: "Poppins", sans-serif;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
:root {
|
|
655
|
+
/* color solid default */
|
|
656
|
+
--starasia-ui-solid-background-default: #111827;
|
|
657
|
+
--starasia-ui-solid-color-default: #fff;
|
|
658
|
+
--starasia-ui-solid-border-default: #e5e7eb;
|
|
659
|
+
|
|
660
|
+
/* color outline default */
|
|
661
|
+
--starasia-ui-outline-background-default: #f9fafb;
|
|
662
|
+
--starasia-ui-outline-color-default: #111827;
|
|
663
|
+
--starasia-ui-outline-border-default: #e5e7eb;
|
|
664
|
+
--starasia-ui-outline-progress-default: #181a19;
|
|
665
|
+
|
|
666
|
+
/* color outline red */
|
|
667
|
+
--starasia-ui-outline-background-danger: #fef2f2;
|
|
668
|
+
--starasia-ui-outline-color-danger: #dc2626;
|
|
669
|
+
--starasia-ui-outline-border-danger: #fecaca;
|
|
670
|
+
--starasia-ui-outline-progress-danger: #181a19;
|
|
671
|
+
--starasia-ui-outline-progress-danger: #c9184a;
|
|
672
|
+
|
|
673
|
+
/* color solid red */
|
|
674
|
+
--starasia-ui-solid-background-danger: #c9184a;
|
|
675
|
+
--starasia-ui-solid-color-danger: #fff0f3;
|
|
676
|
+
--starasia-ui-solid-border-danger: #c9184a;
|
|
677
|
+
|
|
678
|
+
/* color outline success */
|
|
679
|
+
--starasia-ui-outline-background-success: #dcf6ea;
|
|
680
|
+
--starasia-ui-outline-color-success: #28ac6e;
|
|
681
|
+
--starasia-ui-outline-border-success: #97e6c1;
|
|
682
|
+
--starasia-ui-outline-progress-success: #28ac6e;
|
|
683
|
+
|
|
684
|
+
/* color solid success */
|
|
685
|
+
--starasia-ui-solid-background-success: #28ac6e;
|
|
686
|
+
--starasia-ui-solid-color-success: #dcf6ea;
|
|
687
|
+
--starasia-ui-solid-border-success: #28ac6e;
|
|
688
|
+
|
|
689
|
+
/* color outline info */
|
|
690
|
+
--starasia-ui-outline-background-info: #e3f2fd;
|
|
691
|
+
--starasia-ui-outline-color-info: #1976d2;
|
|
692
|
+
--starasia-ui-outline-border-info: #64b5f6;
|
|
693
|
+
--starasia-ui-outline-progress-info: #1976d2;
|
|
694
|
+
|
|
695
|
+
/* color solid info */
|
|
696
|
+
--starasia-ui-solid-background-info: #1976d2;
|
|
697
|
+
--starasia-ui-solid-color-info: #e3f2fd;
|
|
698
|
+
--starasia-ui-solid-border-info: #1976d2;
|
|
699
|
+
|
|
700
|
+
/* color outline warning */
|
|
701
|
+
--starasia-ui-outline-background-warning: #fdf3e4;
|
|
702
|
+
--starasia-ui-outline-color-warning: #181a19;
|
|
703
|
+
--starasia-ui-outline-border-warning: #f4c583;
|
|
704
|
+
--starasia-ui-outline-progress-warning: #ed9f30;
|
|
705
|
+
|
|
706
|
+
/* color solid warning */
|
|
707
|
+
--starasia-ui-solid-background-warning: #ed9f30;
|
|
708
|
+
--starasia-ui-solid-color-warning: #fffeff;
|
|
709
|
+
--starasia-ui-solid-border-warning: #ed9f30;
|
|
710
|
+
|
|
711
|
+
/* height */
|
|
712
|
+
--starasia-ui-h-0-5: 0.125rem; /* 2px */
|
|
713
|
+
}
|
|
714
|
+
/* styling for container */
|
|
715
|
+
.starasia-toast-container {
|
|
716
|
+
display: flex;
|
|
717
|
+
flex-direction: column;
|
|
718
|
+
gap: var(--starasia-ui-spacing-xs, 4px);
|
|
719
|
+
padding: var(--starasia-ui-spacing-sm, 8px);
|
|
720
|
+
position: fixed;
|
|
721
|
+
max-height: 100vh;
|
|
722
|
+
overflow: auto;
|
|
723
|
+
z-index: 99999;
|
|
724
|
+
}
|
|
725
|
+
.starasia-toast-container-bottom-right {
|
|
726
|
+
bottom: 0;
|
|
727
|
+
right: 0;
|
|
728
|
+
}
|
|
729
|
+
.starasia-toast-container-bottom-left {
|
|
730
|
+
bottom: 0;
|
|
731
|
+
left: 0;
|
|
732
|
+
}
|
|
733
|
+
.starasia-toast-container-bottom-center {
|
|
734
|
+
bottom: 0;
|
|
735
|
+
left: 50%;
|
|
736
|
+
transform: translateX(-50%);
|
|
737
|
+
}
|
|
738
|
+
.starasia-toast-container-top-right {
|
|
739
|
+
top: 0;
|
|
740
|
+
right: 0;
|
|
741
|
+
}
|
|
742
|
+
.starasia-toast-container-top-left {
|
|
743
|
+
top: 0;
|
|
744
|
+
left: 0;
|
|
745
|
+
}
|
|
746
|
+
.starasia-toast-container-top-center {
|
|
747
|
+
top: 0;
|
|
748
|
+
left: 50%;
|
|
749
|
+
transform: translateX(-50%);
|
|
750
|
+
}
|
|
751
|
+
/* styling for */
|
|
752
|
+
.starasia-toast-item-container {
|
|
753
|
+
padding: var(--starasia-ui-spacing-lg, 16px);
|
|
754
|
+
width: max-content;
|
|
755
|
+
border-radius: var(--starasia-ui-radii-md, 6px);
|
|
756
|
+
display: flex;
|
|
757
|
+
align-items: center;
|
|
758
|
+
gap: var(--starasia-ui-spacing-sm, 8px);
|
|
759
|
+
border: var(--starasia-ui-border, 1px) solid transparent;
|
|
760
|
+
font-size: var(--starasia-ui-fontSizes-md, 14px);
|
|
761
|
+
position: relative;
|
|
762
|
+
overflow: hidden;
|
|
763
|
+
width: 100%;
|
|
764
|
+
}
|
|
765
|
+
/* DEFAULT TOAST */
|
|
766
|
+
.starasia-toast-item-container-solid-default {
|
|
767
|
+
background-color: var(--starasia-ui-solid-background-default);
|
|
768
|
+
color: var(--starasia-ui-solid-color-default);
|
|
769
|
+
border-color: var(--starasia-ui-solid-border-default);
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
.starasia-toast-item-container-outline-default {
|
|
773
|
+
background-color: var(--starasia-ui-outline-background-default);
|
|
774
|
+
color: var(--starasia-ui-outline-color-default);
|
|
775
|
+
border-color: var(--starasia-ui-outline-border-default);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/* DEFAULT DANGER */
|
|
779
|
+
.starasia-toast-item-container-outline-danger {
|
|
780
|
+
background-color: var(--starasia-ui-outline-background-danger);
|
|
781
|
+
color: var(--starasia-ui-outline-color-danger);
|
|
782
|
+
border-color: var(--starasia-ui-outline-border-danger);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.starasia-toast-item-container-solid-danger {
|
|
786
|
+
background-color: var(--starasia-ui-solid-background-danger);
|
|
787
|
+
color: var(--starasia-ui-solid-color-danger);
|
|
788
|
+
border-color: var(--starasia-ui-solid-border-danger);
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
/* DEFAULT SUCCESS */
|
|
792
|
+
.starasia-toast-item-container-outline-success {
|
|
793
|
+
background-color: var(--starasia-ui-outline-background-success);
|
|
794
|
+
color: var(--starasia-ui-outline-color-success);
|
|
795
|
+
border-color: var(--starasia-ui-outline-border-success);
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
.starasia-toast-item-container-solid-success {
|
|
799
|
+
background-color: var(--starasia-ui-solid-background-success);
|
|
800
|
+
color: var(--starasia-ui-solid-color-success);
|
|
801
|
+
border-color: var(--starasia-ui-solid-border-success);
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/* DEFAULT INFO */
|
|
805
|
+
.starasia-toast-item-container-outline-info {
|
|
806
|
+
background-color: var(--starasia-ui-outline-background-info);
|
|
807
|
+
color: var(--starasia-ui-outline-color-info);
|
|
808
|
+
border-color: var(--starasia-ui-outline-border-info);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.starasia-toast-item-container-solid-info {
|
|
812
|
+
background-color: var(--starasia-ui-solid-background-info);
|
|
813
|
+
color: var(--starasia-ui-solid-color-info);
|
|
814
|
+
border-color: var(--starasia-ui-solid-border-info);
|
|
815
|
+
}
|
|
816
|
+
/* DEFAULT WARNING */
|
|
817
|
+
.starasia-toast-item-container-outline-warning {
|
|
818
|
+
background-color: var(--starasia-ui-outline-background-warning);
|
|
819
|
+
color: var(--starasia-ui-outline-color-warning);
|
|
820
|
+
border-color: var(--starasia-ui-outline-border-warning);
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
.starasia-toast-item-container-solid-warning {
|
|
824
|
+
background-color: var(--starasia-ui-solid-background-warning);
|
|
825
|
+
color: var(--starasia-ui-solid-color-warning);
|
|
826
|
+
border-color: var(--starasia-ui-solid-border-warning);
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/* PROGRESS BAR */
|
|
830
|
+
.starasia-toast-item-progress {
|
|
831
|
+
height: var(--starasia-ui-h-0-5);
|
|
832
|
+
width: 100%;
|
|
833
|
+
position: absolute;
|
|
834
|
+
bottom: 0;
|
|
835
|
+
left: 0;
|
|
836
|
+
/* animation: progressBarr 5s forwards; */
|
|
837
|
+
animation: progressBarr 5s linear forwards;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
.starasia-toast-item-progress-outline-default {
|
|
841
|
+
background-color: var(--starasia-ui-outline-progress-default);
|
|
842
|
+
}
|
|
843
|
+
.starasia-toast-item-progress-outline-info {
|
|
844
|
+
background-color: var(--starasia-ui-outline-progress-info);
|
|
845
|
+
}
|
|
846
|
+
.starasia-toast-item-progress-outline-success {
|
|
847
|
+
background-color: var(--starasia-ui-outline-progress-success);
|
|
848
|
+
}
|
|
849
|
+
.starasia-toast-item-progress-outline-danger {
|
|
850
|
+
background-color: var(--starasia-ui-outline-progress-danger);
|
|
851
|
+
}
|
|
852
|
+
.starasia-toast-item-progress-outline-warning {
|
|
853
|
+
background-color: var(--starasia-ui-outline-progress-warning);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/* animation */
|
|
857
|
+
.starasia-toast-item-container-animation-bottom-right {
|
|
858
|
+
animation: bottomRight 0.375s;
|
|
859
|
+
}
|
|
860
|
+
.starasia-toast-item-container-animation-bottom-left {
|
|
861
|
+
animation: bottomLeft 0.375s;
|
|
862
|
+
}
|
|
863
|
+
.starasia-toast-item-container-animation-bottom-center {
|
|
864
|
+
animation: bottomCenter 0.375s;
|
|
865
|
+
}
|
|
866
|
+
.starasia-toast-item-container-animation-top-left {
|
|
867
|
+
animation: topLeft 0.375s;
|
|
868
|
+
}
|
|
869
|
+
.starasia-toast-item-container-animation-top-right {
|
|
870
|
+
animation: topRight 0.375s;
|
|
871
|
+
}
|
|
872
|
+
.starasia-toast-item-container-animation-top-center {
|
|
873
|
+
animation: topCenter 0.375s;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
@keyframes bottomRight {
|
|
877
|
+
from {
|
|
878
|
+
transform: translateX(100%);
|
|
879
|
+
opacity: 0.3;
|
|
880
|
+
}
|
|
881
|
+
to {
|
|
882
|
+
transform: translateX(0);
|
|
883
|
+
opacity: 1;
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
@keyframes bottomLeft {
|
|
887
|
+
from {
|
|
888
|
+
transform: translateX(-100%);
|
|
889
|
+
opacity: 0.3;
|
|
890
|
+
}
|
|
891
|
+
to {
|
|
892
|
+
transform: translateX(0);
|
|
893
|
+
opacity: 1;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
@keyframes bottomCenter {
|
|
897
|
+
from {
|
|
898
|
+
transform: translateY(100%);
|
|
899
|
+
opacity: 0.3;
|
|
900
|
+
}
|
|
901
|
+
to {
|
|
902
|
+
transform: translateY(0);
|
|
903
|
+
opacity: 1;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
@keyframes topRight {
|
|
907
|
+
from {
|
|
908
|
+
transform: translateX(100%);
|
|
909
|
+
opacity: 0.3;
|
|
910
|
+
}
|
|
911
|
+
to {
|
|
912
|
+
transform: translateX(0);
|
|
913
|
+
opacity: 1;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
@keyframes topCenter {
|
|
917
|
+
from {
|
|
918
|
+
transform: translateY(-100%);
|
|
919
|
+
opacity: 0.3;
|
|
920
|
+
}
|
|
921
|
+
to {
|
|
922
|
+
transform: translateY(0);
|
|
923
|
+
opacity: 1;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
@keyframes topLeft {
|
|
927
|
+
from {
|
|
928
|
+
transform: translateX(-100%);
|
|
929
|
+
opacity: 0.3;
|
|
930
|
+
}
|
|
931
|
+
to {
|
|
932
|
+
transform: translateX(0);
|
|
933
|
+
opacity: 1;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
@keyframes progressBarr {
|
|
937
|
+
from {
|
|
938
|
+
width: 100%;
|
|
939
|
+
}
|
|
940
|
+
to {
|
|
941
|
+
width: 0px;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
`;
|
|
945
|
+
let Ee = 1;
|
|
946
|
+
class Re {
|
|
947
|
+
constructor() {
|
|
948
|
+
this.subscribe = (a) => (this.subscribers.push(a), () => {
|
|
949
|
+
const b = this.subscribers.indexOf(a);
|
|
950
|
+
this.subscribers.splice(b, 1);
|
|
951
|
+
}), this.publish = (a) => {
|
|
952
|
+
this.subscribers.forEach((b) => b(a));
|
|
953
|
+
}, this.addToast = (a) => {
|
|
954
|
+
this.publish(a), this.toasts = [...this.toasts, a];
|
|
955
|
+
}, this.create = (a) => {
|
|
956
|
+
const { message: b, type: y } = a, v = Ee++;
|
|
957
|
+
return this.addToast({ title: b, type: y, id: v }), v;
|
|
958
|
+
}, this.dismiss = (a) => (this.subscribers.forEach((b) => b({ id: a, dismiss: !0 })), a), this.danger = (a) => this.create({ message: a, type: "danger" }), this.warning = (a) => this.create({ message: a, type: "warning" }), this.success = (a) => this.create({ type: "success", message: a }), this.info = (a) => this.create({ type: "info", message: a }), this.default = (a) => this.create({ type: "default", message: a }), this.subscribers = [], this.toasts = [];
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
const O = new Re(), je = Object.assign({
|
|
962
|
+
success: O.success,
|
|
963
|
+
info: O.info,
|
|
964
|
+
default: O.default,
|
|
965
|
+
danger: O.danger,
|
|
966
|
+
warning: O.warning
|
|
967
|
+
}), Pr = "starasia-toast-styles", we = (l) => {
|
|
968
|
+
if (!document.getElementById(Pr)) {
|
|
969
|
+
const a = document.createElement("style");
|
|
970
|
+
a.id = Pr, a.textContent = l, document.head.appendChild(a);
|
|
971
|
+
}
|
|
972
|
+
};
|
|
973
|
+
we(ye);
|
|
974
|
+
const Oe = ({
|
|
975
|
+
type: l = "outline",
|
|
976
|
+
direction: a = "bottom-right"
|
|
977
|
+
}) => {
|
|
978
|
+
const [b, y] = z.useState([]);
|
|
979
|
+
return z.useEffect(() => O.subscribe((v) => {
|
|
980
|
+
if (v.dismiss) {
|
|
981
|
+
y((w) => w.filter((T) => T.id !== v.id));
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
setTimeout(() => {
|
|
985
|
+
me.flushSync(() => {
|
|
986
|
+
y((w) => [v, ...w]);
|
|
987
|
+
});
|
|
988
|
+
});
|
|
989
|
+
}), []), /* @__PURE__ */ g.jsx(
|
|
990
|
+
"div",
|
|
991
|
+
{
|
|
992
|
+
className: `starasia-toast-container starasia-toast-container-${a}`,
|
|
993
|
+
children: b.map((v) => /* @__PURE__ */ g.jsx(
|
|
994
|
+
_e,
|
|
995
|
+
{
|
|
996
|
+
data: v,
|
|
997
|
+
type: l,
|
|
998
|
+
direction: a
|
|
999
|
+
},
|
|
1000
|
+
v.id
|
|
1001
|
+
))
|
|
1002
|
+
}
|
|
1003
|
+
);
|
|
1004
|
+
}, _e = ({ data: l, type: a = "solid", direction: b }) => {
|
|
1005
|
+
const [y, v] = Cr(null), [w, T] = Cr(!1), E = pe(null), d = () => {
|
|
1006
|
+
const x = setTimeout(() => {
|
|
1007
|
+
p();
|
|
1008
|
+
}, 5e3);
|
|
1009
|
+
v(x);
|
|
1010
|
+
}, C = () => {
|
|
1011
|
+
y && (clearTimeout(y), v(null));
|
|
1012
|
+
}, p = () => {
|
|
1013
|
+
O.dismiss(l.id);
|
|
1014
|
+
};
|
|
1015
|
+
Sr(() => (w ? C() : d(), () => {
|
|
1016
|
+
C();
|
|
1017
|
+
}), [w]), Sr(() => {
|
|
1018
|
+
const x = E.current, I = () => {
|
|
1019
|
+
p();
|
|
1020
|
+
};
|
|
1021
|
+
return x && x.addEventListener("animationend", I), () => {
|
|
1022
|
+
x && x.removeEventListener("animationend", I);
|
|
1023
|
+
};
|
|
1024
|
+
}, []);
|
|
1025
|
+
const k = () => {
|
|
1026
|
+
T(!0), C(), E.current && (E.current.style.animationPlayState = "paused");
|
|
1027
|
+
}, j = () => {
|
|
1028
|
+
T(!1), d(), E.current && (E.current.style.animationPlayState = "running");
|
|
1029
|
+
};
|
|
1030
|
+
return /* @__PURE__ */ g.jsxs(
|
|
1031
|
+
"div",
|
|
1032
|
+
{
|
|
1033
|
+
className: `starasia-toast-item-container starasia-toast-item-container-${a}-${l.type} starasia-toast-item-container-animation-${b}`,
|
|
1034
|
+
onMouseEnter: k,
|
|
1035
|
+
onMouseLeave: j,
|
|
1036
|
+
children: [
|
|
1037
|
+
/* @__PURE__ */ g.jsx("div", { style: { display: "flex" }, children: l.type === "success" ? /* @__PURE__ */ g.jsx(xe, { style: { color: "inherit" } }) : /* @__PURE__ */ g.jsx(ke, { style: { color: "inherit" } }) }),
|
|
1038
|
+
/* @__PURE__ */ g.jsx("div", { style: { flex: 1 }, children: l.title }),
|
|
1039
|
+
/* @__PURE__ */ g.jsx(
|
|
1040
|
+
"div",
|
|
1041
|
+
{
|
|
1042
|
+
style: { display: "flex", cursor: "pointer" },
|
|
1043
|
+
onClick: () => O.dismiss(l.id),
|
|
1044
|
+
children: /* @__PURE__ */ g.jsx(Te, { style: { color: "inherit" } })
|
|
1045
|
+
}
|
|
1046
|
+
),
|
|
1047
|
+
a === "outline" ? /* @__PURE__ */ g.jsx(
|
|
1048
|
+
"div",
|
|
1049
|
+
{
|
|
1050
|
+
ref: E,
|
|
1051
|
+
className: `starasia-toast-item-progress starasia-toast-item-progress-outline-${l.type}`,
|
|
1052
|
+
style: {
|
|
1053
|
+
animation: "progressBarr 5s linear forwards",
|
|
1054
|
+
animationPlayState: w ? "paused" : "running"
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
) : null
|
|
1058
|
+
]
|
|
1059
|
+
}
|
|
1060
|
+
);
|
|
1061
|
+
}, ke = (l) => /* @__PURE__ */ g.jsx(
|
|
1062
|
+
"svg",
|
|
1063
|
+
{
|
|
1064
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1065
|
+
width: "20",
|
|
1066
|
+
height: "20",
|
|
1067
|
+
viewBox: "0 0 24 24",
|
|
1068
|
+
fill: "none",
|
|
1069
|
+
...l,
|
|
1070
|
+
children: /* @__PURE__ */ g.jsx(
|
|
1071
|
+
"path",
|
|
1072
|
+
{
|
|
1073
|
+
d: "M12 7.01001V7.00002M12 17L12 10M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z",
|
|
1074
|
+
stroke: "currentColor",
|
|
1075
|
+
strokeWidth: "1.5",
|
|
1076
|
+
strokeLinecap: "round",
|
|
1077
|
+
strokeLinejoin: "round",
|
|
1078
|
+
cursor: "pointer"
|
|
1079
|
+
}
|
|
1080
|
+
)
|
|
1081
|
+
}
|
|
1082
|
+
), xe = (l) => /* @__PURE__ */ g.jsx(
|
|
1083
|
+
"svg",
|
|
1084
|
+
{
|
|
1085
|
+
width: "20",
|
|
1086
|
+
height: "20",
|
|
1087
|
+
viewBox: "0 0 20 20",
|
|
1088
|
+
fill: "none",
|
|
1089
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1090
|
+
...l,
|
|
1091
|
+
children: /* @__PURE__ */ g.jsx("g", { id: "Curved/Basic-actions-and-state", children: /* @__PURE__ */ g.jsx(
|
|
1092
|
+
"path",
|
|
1093
|
+
{
|
|
1094
|
+
id: "shape",
|
|
1095
|
+
d: "M14.1667 7.5L8.33332 13.3333L5.83328 10.8333M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z",
|
|
1096
|
+
stroke: "currentColor",
|
|
1097
|
+
strokeWidth: "1.5",
|
|
1098
|
+
strokeLinecap: "round",
|
|
1099
|
+
strokeLinejoin: "round"
|
|
1100
|
+
}
|
|
1101
|
+
) })
|
|
1102
|
+
}
|
|
1103
|
+
), Te = (l) => /* @__PURE__ */ g.jsx(
|
|
1104
|
+
"svg",
|
|
1105
|
+
{
|
|
1106
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1107
|
+
width: "20",
|
|
1108
|
+
height: "20",
|
|
1109
|
+
viewBox: "0 0 24 24",
|
|
1110
|
+
fill: "none",
|
|
1111
|
+
...l,
|
|
1112
|
+
children: /* @__PURE__ */ g.jsx(
|
|
1113
|
+
"path",
|
|
1114
|
+
{
|
|
1115
|
+
d: "M19 5L5 19M5.00003 5L19 19",
|
|
1116
|
+
stroke: "currentColor",
|
|
1117
|
+
strokeWidth: "1.5",
|
|
1118
|
+
strokeLinecap: "round",
|
|
1119
|
+
strokeLinejoin: "round"
|
|
1120
|
+
}
|
|
1121
|
+
)
|
|
1122
|
+
}
|
|
1123
|
+
);
|
|
1124
|
+
export {
|
|
1125
|
+
Oe as ToastContainer,
|
|
1126
|
+
je as toast
|
|
1127
|
+
};
|