@starasia/toast 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/toast.es.js +120 -759
- package/dist/toast.umd.js +42 -71
- package/package.json +1 -1
package/dist/toast.es.js
CHANGED
|
@@ -1,648 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
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");
|
|
1
|
+
import { jsx as t, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import f, { useState as p, useRef as x, useEffect as h } from "react";
|
|
3
|
+
import C from "react-dom";
|
|
4
|
+
const L = `@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
|
|
646
5
|
|
|
647
6
|
* {
|
|
648
7
|
margin: 0;
|
|
@@ -652,61 +11,63 @@ const ye = `@import url("https://fonts.googleapis.com/css2?family=Poppins&displa
|
|
|
652
11
|
}
|
|
653
12
|
|
|
654
13
|
:root {
|
|
14
|
+
/* white */
|
|
15
|
+
--starasia-ui-toast-color-white: var(--starasia-ui-color-gray-50, rgba(255, 254, 255, 1));
|
|
16
|
+
|
|
655
17
|
/* color solid default */
|
|
656
|
-
--starasia-ui-solid-background-default:
|
|
657
|
-
--starasia-ui-solid-color-default:
|
|
658
|
-
--starasia-ui-solid-border-default:
|
|
18
|
+
--starasia-ui-solid-background-default: rgba(17, 24, 39, 1);
|
|
19
|
+
--starasia-ui-solid-color-default: rgba(255, 255, 255, 1);
|
|
20
|
+
--starasia-ui-solid-border-default: rgba(229, 231, 235, 1);
|
|
659
21
|
|
|
660
22
|
/* color outline default */
|
|
661
|
-
--starasia-ui-outline-background-default:
|
|
662
|
-
--starasia-ui-outline-color-default:
|
|
663
|
-
--starasia-ui-outline-border-default:
|
|
664
|
-
--starasia-ui-outline-progress-default:
|
|
23
|
+
--starasia-ui-outline-background-default: rgba(249, 250, 251, 1);
|
|
24
|
+
--starasia-ui-outline-color-default: rgba(17, 24, 39, 1);
|
|
25
|
+
--starasia-ui-outline-border-default: rgba(229, 231, 235, 1);
|
|
26
|
+
--starasia-ui-outline-progress-default: rgba(24, 26, 25, 1);
|
|
665
27
|
|
|
666
28
|
/* color outline red */
|
|
667
|
-
--starasia-ui-outline-background-danger:
|
|
668
|
-
--starasia-ui-outline-color-danger:
|
|
669
|
-
--starasia-ui-outline-border-danger:
|
|
670
|
-
--starasia-ui-outline-progress-danger:
|
|
671
|
-
--starasia-ui-outline-progress-danger: #c9184a;
|
|
29
|
+
--starasia-ui-outline-background-danger: rgba(254, 242, 242, 1);
|
|
30
|
+
--starasia-ui-outline-color-danger: rgba(220, 38, 38, 1);
|
|
31
|
+
--starasia-ui-outline-border-danger: rgba(254, 202, 202, 1);
|
|
32
|
+
--starasia-ui-outline-progress-danger: rgba(201, 24, 74, 1);
|
|
672
33
|
|
|
673
34
|
/* color solid red */
|
|
674
|
-
--starasia-ui-solid-background-danger:
|
|
675
|
-
--starasia-ui-solid-color-danger:
|
|
676
|
-
--starasia-ui-solid-border-danger:
|
|
35
|
+
--starasia-ui-solid-background-danger: rgba(201, 24, 74, 1);
|
|
36
|
+
--starasia-ui-solid-color-danger: rgba(255, 240, 243, 1);
|
|
37
|
+
--starasia-ui-solid-border-danger: rgba(201, 24, 74, 1);
|
|
677
38
|
|
|
678
39
|
/* color outline success */
|
|
679
|
-
--starasia-ui-outline-background-success:
|
|
680
|
-
--starasia-ui-outline-color-success:
|
|
681
|
-
--starasia-ui-outline-border-success:
|
|
682
|
-
--starasia-ui-outline-progress-success:
|
|
40
|
+
--starasia-ui-outline-background-success: rgba(220, 246, 234, 1);
|
|
41
|
+
--starasia-ui-outline-color-success: rgba(40, 172, 110, 1);
|
|
42
|
+
--starasia-ui-outline-border-success: rgba(151, 230, 193, 1);
|
|
43
|
+
--starasia-ui-outline-progress-success: rgba(40, 172, 110, 1);
|
|
683
44
|
|
|
684
45
|
/* color solid success */
|
|
685
|
-
--starasia-ui-solid-background-success:
|
|
686
|
-
--starasia-ui-solid-color-success:
|
|
687
|
-
--starasia-ui-solid-border-success:
|
|
46
|
+
--starasia-ui-solid-background-success: rgba(40, 172, 110, 1);
|
|
47
|
+
--starasia-ui-solid-color-success: rgba(220, 246, 234, 1);
|
|
48
|
+
--starasia-ui-solid-border-success: rgba(40, 172, 110, 1);
|
|
688
49
|
|
|
689
|
-
/* color outline info */
|
|
690
|
-
--starasia-ui-outline-background-info:
|
|
691
|
-
--starasia-ui-outline-color-info:
|
|
692
|
-
--starasia-ui-outline-border-info:
|
|
693
|
-
--starasia-ui-outline-progress-info:
|
|
50
|
+
/* color outline info (semantic blue) */
|
|
51
|
+
--starasia-ui-outline-background-info: rgba(227, 242, 253, 1);
|
|
52
|
+
--starasia-ui-outline-color-info: rgba(25, 118, 210, 1);
|
|
53
|
+
--starasia-ui-outline-border-info: rgba(100, 181, 246, 1);
|
|
54
|
+
--starasia-ui-outline-progress-info: rgba(25, 118, 210, 1);
|
|
694
55
|
|
|
695
|
-
/* color solid info */
|
|
696
|
-
--starasia-ui-solid-background-info:
|
|
697
|
-
--starasia-ui-solid-color-info:
|
|
698
|
-
--starasia-ui-solid-border-info:
|
|
56
|
+
/* color solid info (semantic blue) */
|
|
57
|
+
--starasia-ui-solid-background-info: rgba(25, 118, 210, 1);
|
|
58
|
+
--starasia-ui-solid-color-info: rgba(227, 242, 253, 1);
|
|
59
|
+
--starasia-ui-solid-border-info: rgba(25, 118, 210, 1);
|
|
699
60
|
|
|
700
61
|
/* color outline warning */
|
|
701
|
-
--starasia-ui-outline-background-warning:
|
|
702
|
-
--starasia-ui-outline-color-warning:
|
|
703
|
-
--starasia-ui-outline-border-warning:
|
|
704
|
-
--starasia-ui-outline-progress-warning:
|
|
62
|
+
--starasia-ui-outline-background-warning: rgba(253, 243, 228, 1);
|
|
63
|
+
--starasia-ui-outline-color-warning: rgba(24, 26, 25, 1);
|
|
64
|
+
--starasia-ui-outline-border-warning: rgba(244, 197, 131, 1);
|
|
65
|
+
--starasia-ui-outline-progress-warning: rgba(237, 159, 48, 1);
|
|
705
66
|
|
|
706
67
|
/* color solid warning */
|
|
707
|
-
--starasia-ui-solid-background-warning:
|
|
708
|
-
--starasia-ui-solid-color-warning:
|
|
709
|
-
--starasia-ui-solid-border-warning:
|
|
68
|
+
--starasia-ui-solid-background-warning: rgba(237, 159, 48, 1);
|
|
69
|
+
--starasia-ui-solid-color-warning: var(--starasia-ui-toast-color-white);
|
|
70
|
+
--starasia-ui-solid-border-warning: rgba(237, 159, 48, 1);
|
|
710
71
|
|
|
711
72
|
/* height */
|
|
712
73
|
--starasia-ui-h-0-5: 0.125rem; /* 2px */
|
|
@@ -942,123 +303,123 @@ const ye = `@import url("https://fonts.googleapis.com/css2?family=Poppins&displa
|
|
|
942
303
|
}
|
|
943
304
|
}
|
|
944
305
|
`;
|
|
945
|
-
let
|
|
946
|
-
class
|
|
306
|
+
let E = 1;
|
|
307
|
+
class T {
|
|
947
308
|
constructor() {
|
|
948
309
|
this.subscribe = (a) => (this.subscribers.push(a), () => {
|
|
949
|
-
const
|
|
950
|
-
this.subscribers.splice(
|
|
310
|
+
const s = this.subscribers.indexOf(a);
|
|
311
|
+
this.subscribers.splice(s, 1);
|
|
951
312
|
}), this.publish = (a) => {
|
|
952
|
-
this.subscribers.forEach((
|
|
313
|
+
this.subscribers.forEach((s) => s(a));
|
|
953
314
|
}, this.addToast = (a) => {
|
|
954
315
|
this.publish(a), this.toasts = [...this.toasts, a];
|
|
955
316
|
}, this.create = (a) => {
|
|
956
|
-
const { message:
|
|
957
|
-
return this.addToast({ title:
|
|
958
|
-
}, this.dismiss = (a) => (this.subscribers.forEach((
|
|
317
|
+
const { message: s, type: i } = a, r = E++;
|
|
318
|
+
return this.addToast({ title: s, type: i, id: r }), r;
|
|
319
|
+
}, this.dismiss = (a) => (this.subscribers.forEach((s) => s({ 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
320
|
}
|
|
960
321
|
}
|
|
961
|
-
const
|
|
962
|
-
success:
|
|
963
|
-
info:
|
|
964
|
-
default:
|
|
965
|
-
danger:
|
|
966
|
-
warning:
|
|
967
|
-
}),
|
|
968
|
-
if (!document.getElementById(
|
|
322
|
+
const o = new T(), D = Object.assign({
|
|
323
|
+
success: o.success,
|
|
324
|
+
info: o.info,
|
|
325
|
+
default: o.default,
|
|
326
|
+
danger: o.danger,
|
|
327
|
+
warning: o.warning
|
|
328
|
+
}), v = "starasia-toast-styles", S = (n) => {
|
|
329
|
+
if (!document.getElementById(v)) {
|
|
969
330
|
const a = document.createElement("style");
|
|
970
|
-
a.id =
|
|
331
|
+
a.id = v, a.textContent = n, document.head.appendChild(a);
|
|
971
332
|
}
|
|
972
333
|
};
|
|
973
|
-
|
|
974
|
-
const
|
|
975
|
-
type:
|
|
334
|
+
S(L);
|
|
335
|
+
const N = ({
|
|
336
|
+
type: n = "outline",
|
|
976
337
|
direction: a = "bottom-right"
|
|
977
338
|
}) => {
|
|
978
|
-
const [
|
|
979
|
-
return
|
|
980
|
-
if (
|
|
981
|
-
|
|
339
|
+
const [s, i] = f.useState([]);
|
|
340
|
+
return f.useEffect(() => o.subscribe((r) => {
|
|
341
|
+
if (r.dismiss) {
|
|
342
|
+
i((e) => e.filter((c) => c.id !== r.id));
|
|
982
343
|
return;
|
|
983
344
|
}
|
|
984
345
|
setTimeout(() => {
|
|
985
|
-
|
|
986
|
-
|
|
346
|
+
C.flushSync(() => {
|
|
347
|
+
i((e) => [r, ...e]);
|
|
987
348
|
});
|
|
988
349
|
});
|
|
989
|
-
}), []), /* @__PURE__ */
|
|
350
|
+
}), []), /* @__PURE__ */ t(
|
|
990
351
|
"div",
|
|
991
352
|
{
|
|
992
353
|
className: `starasia-toast-container starasia-toast-container-${a}`,
|
|
993
|
-
children:
|
|
994
|
-
|
|
354
|
+
children: s.map((r) => /* @__PURE__ */ t(
|
|
355
|
+
R,
|
|
995
356
|
{
|
|
996
|
-
data:
|
|
997
|
-
type:
|
|
357
|
+
data: r,
|
|
358
|
+
type: n,
|
|
998
359
|
direction: a
|
|
999
360
|
},
|
|
1000
|
-
|
|
361
|
+
r.id
|
|
1001
362
|
))
|
|
1002
363
|
}
|
|
1003
364
|
);
|
|
1004
|
-
},
|
|
1005
|
-
const [
|
|
1006
|
-
const
|
|
1007
|
-
|
|
365
|
+
}, R = ({ data: n, type: a = "solid", direction: s }) => {
|
|
366
|
+
const [i, r] = p(null), [e, c] = p(!1), l = x(null), g = () => {
|
|
367
|
+
const u = setTimeout(() => {
|
|
368
|
+
m();
|
|
1008
369
|
}, 5e3);
|
|
1009
|
-
|
|
1010
|
-
},
|
|
1011
|
-
|
|
1012
|
-
},
|
|
1013
|
-
|
|
370
|
+
r(u);
|
|
371
|
+
}, d = () => {
|
|
372
|
+
i && (clearTimeout(i), r(null));
|
|
373
|
+
}, m = () => {
|
|
374
|
+
o.dismiss(n.id);
|
|
1014
375
|
};
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
}), [
|
|
1018
|
-
const
|
|
1019
|
-
|
|
376
|
+
h(() => (e ? d() : g(), () => {
|
|
377
|
+
d();
|
|
378
|
+
}), [e]), h(() => {
|
|
379
|
+
const u = l.current, b = () => {
|
|
380
|
+
m();
|
|
1020
381
|
};
|
|
1021
|
-
return
|
|
1022
|
-
|
|
382
|
+
return u && u.addEventListener("animationend", b), () => {
|
|
383
|
+
u && u.removeEventListener("animationend", b);
|
|
1023
384
|
};
|
|
1024
385
|
}, []);
|
|
1025
|
-
const
|
|
1026
|
-
|
|
1027
|
-
},
|
|
1028
|
-
|
|
386
|
+
const y = () => {
|
|
387
|
+
c(!0), d(), l.current && (l.current.style.animationPlayState = "paused");
|
|
388
|
+
}, w = () => {
|
|
389
|
+
c(!1), g(), l.current && (l.current.style.animationPlayState = "running");
|
|
1029
390
|
};
|
|
1030
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ k(
|
|
1031
392
|
"div",
|
|
1032
393
|
{
|
|
1033
|
-
className: `starasia-toast-item-container starasia-toast-item-container-${a}-${
|
|
1034
|
-
onMouseEnter:
|
|
1035
|
-
onMouseLeave:
|
|
394
|
+
className: `starasia-toast-item-container starasia-toast-item-container-${a}-${n.type} starasia-toast-item-container-animation-${s}`,
|
|
395
|
+
onMouseEnter: y,
|
|
396
|
+
onMouseLeave: w,
|
|
1036
397
|
children: [
|
|
1037
|
-
/* @__PURE__ */
|
|
1038
|
-
/* @__PURE__ */
|
|
1039
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ t("div", { style: { display: "flex" }, children: n.type === "success" ? /* @__PURE__ */ t(M, { style: { color: "inherit" } }) : /* @__PURE__ */ t(I, { style: { color: "inherit" } }) }),
|
|
399
|
+
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: n.title }),
|
|
400
|
+
/* @__PURE__ */ t(
|
|
1040
401
|
"div",
|
|
1041
402
|
{
|
|
1042
403
|
style: { display: "flex", cursor: "pointer" },
|
|
1043
|
-
onClick: () =>
|
|
1044
|
-
children: /* @__PURE__ */
|
|
404
|
+
onClick: () => o.dismiss(n.id),
|
|
405
|
+
children: /* @__PURE__ */ t(A, { style: { color: "inherit" } })
|
|
1045
406
|
}
|
|
1046
407
|
),
|
|
1047
|
-
a === "outline" ? /* @__PURE__ */
|
|
408
|
+
a === "outline" ? /* @__PURE__ */ t(
|
|
1048
409
|
"div",
|
|
1049
410
|
{
|
|
1050
|
-
ref:
|
|
1051
|
-
className: `starasia-toast-item-progress starasia-toast-item-progress-outline-${
|
|
411
|
+
ref: l,
|
|
412
|
+
className: `starasia-toast-item-progress starasia-toast-item-progress-outline-${n.type}`,
|
|
1052
413
|
style: {
|
|
1053
414
|
animation: "progressBarr 5s linear forwards",
|
|
1054
|
-
animationPlayState:
|
|
415
|
+
animationPlayState: e ? "paused" : "running"
|
|
1055
416
|
}
|
|
1056
417
|
}
|
|
1057
418
|
) : null
|
|
1058
419
|
]
|
|
1059
420
|
}
|
|
1060
421
|
);
|
|
1061
|
-
},
|
|
422
|
+
}, I = (n) => /* @__PURE__ */ t(
|
|
1062
423
|
"svg",
|
|
1063
424
|
{
|
|
1064
425
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1066,8 +427,8 @@ const Oe = ({
|
|
|
1066
427
|
height: "20",
|
|
1067
428
|
viewBox: "0 0 24 24",
|
|
1068
429
|
fill: "none",
|
|
1069
|
-
...
|
|
1070
|
-
children: /* @__PURE__ */
|
|
430
|
+
...n,
|
|
431
|
+
children: /* @__PURE__ */ t(
|
|
1071
432
|
"path",
|
|
1072
433
|
{
|
|
1073
434
|
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",
|
|
@@ -1079,7 +440,7 @@ const Oe = ({
|
|
|
1079
440
|
}
|
|
1080
441
|
)
|
|
1081
442
|
}
|
|
1082
|
-
),
|
|
443
|
+
), M = (n) => /* @__PURE__ */ t(
|
|
1083
444
|
"svg",
|
|
1084
445
|
{
|
|
1085
446
|
width: "20",
|
|
@@ -1087,8 +448,8 @@ const Oe = ({
|
|
|
1087
448
|
viewBox: "0 0 20 20",
|
|
1088
449
|
fill: "none",
|
|
1089
450
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1090
|
-
...
|
|
1091
|
-
children: /* @__PURE__ */
|
|
451
|
+
...n,
|
|
452
|
+
children: /* @__PURE__ */ t("g", { id: "Curved/Basic-actions-and-state", children: /* @__PURE__ */ t(
|
|
1092
453
|
"path",
|
|
1093
454
|
{
|
|
1094
455
|
id: "shape",
|
|
@@ -1100,7 +461,7 @@ const Oe = ({
|
|
|
1100
461
|
}
|
|
1101
462
|
) })
|
|
1102
463
|
}
|
|
1103
|
-
),
|
|
464
|
+
), A = (n) => /* @__PURE__ */ t(
|
|
1104
465
|
"svg",
|
|
1105
466
|
{
|
|
1106
467
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1108,8 +469,8 @@ const Oe = ({
|
|
|
1108
469
|
height: "20",
|
|
1109
470
|
viewBox: "0 0 24 24",
|
|
1110
471
|
fill: "none",
|
|
1111
|
-
...
|
|
1112
|
-
children: /* @__PURE__ */
|
|
472
|
+
...n,
|
|
473
|
+
children: /* @__PURE__ */ t(
|
|
1113
474
|
"path",
|
|
1114
475
|
{
|
|
1115
476
|
d: "M19 5L5 19M5.00003 5L19 19",
|
|
@@ -1122,6 +483,6 @@ const Oe = ({
|
|
|
1122
483
|
}
|
|
1123
484
|
);
|
|
1124
485
|
export {
|
|
1125
|
-
|
|
1126
|
-
|
|
486
|
+
N as ToastContainer,
|
|
487
|
+
D as toast
|
|
1127
488
|
};
|
package/dist/toast.umd.js
CHANGED
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.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 ar;function Ar(){if(ar)return W;ar=1;var l=w,a=Symbol.for("react.element"),b=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,p=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_={key:!0,ref:!0,__self:!0,__source:!0};function C(E,d,S){var g,x={},P=null,T=null;S!==void 0&&(P=""+S),d.key!==void 0&&(P=""+d.key),d.ref!==void 0&&(T=d.ref);for(g in d)y.call(d,g)&&!_.hasOwnProperty(g)&&(x[g]=d[g]);if(E&&E.defaultProps)for(g in d=E.defaultProps,d)x[g]===void 0&&(x[g]=d[g]);return{$$typeof:a,type:E,key:P,ref:T,props:x,_owner:p.current}}return W.Fragment=b,W.jsx=C,W.jsxs=C,W}var Y={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var or;function Dr(){return or||(or=1,process.env.NODE_ENV!=="production"&&function(){var l=w,a=Symbol.for("react.element"),b=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),E=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),N=Symbol.iterator,Vr="@@iterator";function Xr(r){if(r===null||typeof r!="object")return null;var e=N&&r[N]||r[Vr];return typeof e=="function"?e:null}var L=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(r){{for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];$r("error",r,n)}}function $r(r,e,n){{var t=L.ReactDebugCurrentFrame,s=t.getStackAddendum();s!==""&&(e+="%s",n=n.concat([s]));var u=n.map(function(i){return String(i)});u.unshift("Warning: "+e),Function.prototype.apply.call(console[r],console,u)}}var zr=!1,Gr=!1,Jr=!1,Kr=!1,Hr=!1,sr;sr=Symbol.for("react.module.reference");function Zr(r){return!!(typeof r=="string"||typeof r=="function"||r===y||r===_||Hr||r===p||r===S||r===g||Kr||r===T||zr||Gr||Jr||typeof r=="object"&&r!==null&&(r.$$typeof===P||r.$$typeof===x||r.$$typeof===C||r.$$typeof===E||r.$$typeof===d||r.$$typeof===sr||r.getModuleId!==void 0))}function qr(r,e,n){var t=r.displayName;if(t)return t;var s=e.displayName||e.name||"";return s!==""?n+"("+s+")":n}function ur(r){return r.displayName||"Context"}function j(r){if(r==null)return null;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")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case y:return"Fragment";case b:return"Portal";case _:return"Profiler";case p:return"StrictMode";case S:return"Suspense";case g:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case E:var e=r;return ur(e)+".Consumer";case C:var n=r;return ur(n._context)+".Provider";case d:return qr(r,r.render,"ForwardRef");case x:var t=r.displayName||null;return t!==null?t:j(r.type)||"Memo";case P:{var s=r,u=s._payload,i=s._init;try{return j(i(u))}catch{return null}}}return null}var D=Object.assign,U=0,lr,cr,fr,dr,vr,pr,gr;function mr(){}mr.__reactDisabledLog=!0;function Qr(){{if(U===0){lr=console.log,cr=console.info,fr=console.warn,dr=console.error,vr=console.group,pr=console.groupCollapsed,gr=console.groupEnd;var r={configurable:!0,enumerable:!0,value:mr,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}U++}}function re(){{if(U--,U===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},r,{value:lr}),info:D({},r,{value:cr}),warn:D({},r,{value:fr}),error:D({},r,{value:dr}),group:D({},r,{value:vr}),groupCollapsed:D({},r,{value:pr}),groupEnd:D({},r,{value:gr})})}U<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var K=L.ReactCurrentDispatcher,H;function X(r,e,n){{if(H===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);H=t&&t[1]||""}return`
|
|
18
|
-
`+H+r}}var Z=!1,$;{var ee=typeof WeakMap=="function"?WeakMap:Map;$=new ee}function br(r,e){if(!r||Z)return"";{var n=$.get(r);if(n!==void 0)return n}var t;Z=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=K.current,K.current=null,Qr();try{if(e){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(R){t=R}Reflect.construct(r,[],i)}else{try{i.call()}catch(R){t=R}r.call(i.prototype)}}else{try{throw Error()}catch(R){t=R}r()}}catch(R){if(R&&t&&typeof R.stack=="string"){for(var o=R.stack.split(`
|
|
19
|
-
`),h=t.stack.split(`
|
|
20
|
-
`),c=o.length-1,f=h.length-1;c>=1&&f>=0&&o[c]!==h[f];)f--;for(;c>=1&&f>=0;c--,f--)if(o[c]!==h[f]){if(c!==1||f!==1)do if(c--,f--,f<0||o[c]!==h[f]){var k=`
|
|
21
|
-
`+o[c].replace(" at new "," at ");return r.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",r.displayName)),typeof r=="function"&&$.set(r,k),k}while(c>=1&&f>=0);break}}}finally{Z=!1,K.current=u,re(),Error.prepareStackTrace=s}var M=r?r.displayName||r.name:"",F=M?X(M):"";return typeof r=="function"&&$.set(r,F),F}function ne(r,e,n){return br(r,!1)}function te(r){var e=r.prototype;return!!(e&&e.isReactComponent)}function z(r,e,n){if(r==null)return"";if(typeof r=="function")return br(r,te(r));if(typeof r=="string")return X(r);switch(r){case S:return X("Suspense");case g:return X("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case d:return ne(r.render);case x:return z(r.type,e,n);case P:{var t=r,s=t._payload,u=t._init;try{return z(u(s),e,n)}catch{}}}return""}var B=Object.prototype.hasOwnProperty,hr={},yr=L.ReactDebugCurrentFrame;function G(r){if(r){var e=r._owner,n=z(r.type,r._source,e?e.type:null);yr.setExtraStackFrame(n)}else yr.setExtraStackFrame(null)}function ae(r,e,n,t,s){{var u=Function.call.bind(B);for(var i in r)if(u(r,i)){var o=void 0;try{if(typeof r[i]!="function"){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`.");throw h.name="Invariant Violation",h}o=r[i](e,i,t,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(c){o=c}o&&!(o instanceof Error)&&(G(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),G(null)),o instanceof Error&&!(o.message in hr)&&(hr[o.message]=!0,G(s),m("Failed %s type: %s",n,o.message),G(null))}}}var oe=Array.isArray;function q(r){return oe(r)}function ie(r){{var e=typeof Symbol=="function"&&Symbol.toStringTag,n=e&&r[Symbol.toStringTag]||r.constructor.name||"Object";return n}}function se(r){try{return Er(r),!1}catch{return!0}}function Er(r){return""+r}function Rr(r){if(se(r))return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ie(r)),Er(r)}var V=L.ReactCurrentOwner,ue={key:!0,ref:!0,__self:!0,__source:!0},wr,_r,Q;Q={};function le(r){if(B.call(r,"ref")){var e=Object.getOwnPropertyDescriptor(r,"ref").get;if(e&&e.isReactWarning)return!1}return r.ref!==void 0}function ce(r){if(B.call(r,"key")){var e=Object.getOwnPropertyDescriptor(r,"key").get;if(e&&e.isReactWarning)return!1}return r.key!==void 0}function fe(r,e){if(typeof r.ref=="string"&&V.current&&e&&V.current.stateNode!==e){var n=j(V.current.type);Q[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',j(V.current.type),r.ref),Q[n]=!0)}}function de(r,e){{var n=function(){wr||(wr=!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))};n.isReactWarning=!0,Object.defineProperty(r,"key",{get:n,configurable:!0})}}function ve(r,e){{var n=function(){_r||(_r=!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))};n.isReactWarning=!0,Object.defineProperty(r,"ref",{get:n,configurable:!0})}}var pe=function(r,e,n,t,s,u,i){var o={$$typeof:a,type:r,key:e,ref:n,props:i,_owner:u};return o._store={},Object.defineProperty(o._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(o,"_self",{configurable:!1,enumerable:!1,writable:!1,value:t}),Object.defineProperty(o,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(o.props),Object.freeze(o)),o};function ge(r,e,n,t,s){{var u,i={},o=null,h=null;n!==void 0&&(Rr(n),o=""+n),ce(e)&&(Rr(e.key),o=""+e.key),le(e)&&(h=e.ref,fe(e,s));for(u in e)B.call(e,u)&&!ue.hasOwnProperty(u)&&(i[u]=e[u]);if(r&&r.defaultProps){var c=r.defaultProps;for(u in c)i[u]===void 0&&(i[u]=c[u])}if(o||h){var f=typeof r=="function"?r.displayName||r.name||"Unknown":r;o&&de(i,f),h&&ve(i,f)}return pe(r,o,h,s,t,V.current,i)}}var rr=L.ReactCurrentOwner,kr=L.ReactDebugCurrentFrame;function I(r){if(r){var e=r._owner,n=z(r.type,r._source,e?e.type:null);kr.setExtraStackFrame(n)}else kr.setExtraStackFrame(null)}var er;er=!1;function nr(r){return typeof r=="object"&&r!==null&&r.$$typeof===a}function xr(){{if(rr.current){var r=j(rr.current.type);if(r)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+r+"`."}return""}}function me(r){{if(r!==void 0){var e=r.fileName.replace(/^.*[\\\/]/,""),n=r.lineNumber;return`
|
|
24
|
-
|
|
25
|
-
Check your code at `+e+":"+n+"."}return""}}var Tr={};function be(r){{var e=xr();if(!e){var n=typeof r=="string"?r:r.displayName||r.name;n&&(e=`
|
|
26
|
-
|
|
27
|
-
Check the top-level render call using <`+n+">.")}return e}}function Cr(r,e){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var n=be(e);if(Tr[n])return;Tr[n]=!0;var t="";r&&r._owner&&r._owner!==rr.current&&(t=" It was passed a child from "+j(r._owner.type)+"."),I(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),I(null)}}function Sr(r,e){{if(typeof r!="object")return;if(q(r))for(var n=0;n<r.length;n++){var t=r[n];nr(t)&&Cr(t,e)}else if(nr(r))r._store&&(r._store.validated=!0);else if(r){var s=Xr(r);if(typeof s=="function"&&s!==r.entries)for(var u=s.call(r),i;!(i=u.next()).done;)nr(i.value)&&Cr(i.value,e)}}}function he(r){{var e=r.type;if(e==null||typeof e=="string")return;var n;if(typeof e=="function")n=e.propTypes;else if(typeof e=="object"&&(e.$$typeof===d||e.$$typeof===x))n=e.propTypes;else return;if(n){var t=j(e);ae(n,r.props,"prop",t,r)}else if(e.PropTypes!==void 0&&!er){er=!0;var s=j(e);m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof e.getDefaultProps=="function"&&!e.getDefaultProps.isReactClassApproved&&m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ye(r){{for(var e=Object.keys(r.props),n=0;n<e.length;n++){var t=e[n];if(t!=="children"&&t!=="key"){I(r),m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",t),I(null);break}}r.ref!==null&&(I(r),m("Invalid attribute `ref` supplied to `React.Fragment`."),I(null))}}var jr={};function Or(r,e,n,t,s,u){{var i=Zr(r);if(!i){var o="";(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.");var h=me(s);h?o+=h:o+=xr();var c;r===null?c="null":q(r)?c="array":r!==void 0&&r.$$typeof===a?(c="<"+(j(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)}var f=ge(r,e,n,s,u);if(f==null)return f;if(i){var k=e.children;if(k!==void 0)if(t)if(q(k)){for(var M=0;M<k.length;M++)Sr(k[M],r);Object.freeze&&Object.freeze(k)}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 Sr(k,r)}if(B.call(e,"key")){var F=j(r),R=Object.keys(e).filter(function(xe){return xe!=="key"}),tr=R.length>0?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}";if(!jr[F+tr]){var ke=R.length>0?"{"+R.join(": ..., ")+": ...}":"{}";m(`A props object containing a "key" prop is being spread into JSX:
|
|
28
|
-
let props = %s;
|
|
29
|
-
<%s {...props} />
|
|
30
|
-
React keys must be passed directly to JSX without using spread:
|
|
31
|
-
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,tr,F,ke,F),jr[F+tr]=!0}}return r===y?ye(f):he(f),f}}function Ee(r,e,n){return Or(r,e,n,!0)}function Re(r,e,n){return Or(r,e,n,!1)}var we=Re,_e=Ee;Y.Fragment=y,Y.jsx=we,Y.jsxs=_e}()),Y}process.env.NODE_ENV==="production"?J.exports=Ar():J.exports=Dr();var v=J.exports;const Fr=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
|
|
1
|
+
(function(o,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],n):(o=typeof globalThis<"u"?globalThis:o||self,n(o.Toast={},o.jsxRuntime,o.React,o.ReactDOM))})(this,function(o,n,e,v){"use strict";const y=`@import url("https://fonts.googleapis.com/css2?family=Poppins&display=swap");
|
|
33
2
|
|
|
34
3
|
* {
|
|
35
4
|
margin: 0;
|
|
@@ -39,61 +8,63 @@ React keys must be passed directly to JSX without using spread:
|
|
|
39
8
|
}
|
|
40
9
|
|
|
41
10
|
:root {
|
|
11
|
+
/* white */
|
|
12
|
+
--starasia-ui-toast-color-white: var(--starasia-ui-color-gray-50, rgba(255, 254, 255, 1));
|
|
13
|
+
|
|
42
14
|
/* color solid default */
|
|
43
|
-
--starasia-ui-solid-background-default:
|
|
44
|
-
--starasia-ui-solid-color-default:
|
|
45
|
-
--starasia-ui-solid-border-default:
|
|
15
|
+
--starasia-ui-solid-background-default: rgba(17, 24, 39, 1);
|
|
16
|
+
--starasia-ui-solid-color-default: rgba(255, 255, 255, 1);
|
|
17
|
+
--starasia-ui-solid-border-default: rgba(229, 231, 235, 1);
|
|
46
18
|
|
|
47
19
|
/* color outline default */
|
|
48
|
-
--starasia-ui-outline-background-default:
|
|
49
|
-
--starasia-ui-outline-color-default:
|
|
50
|
-
--starasia-ui-outline-border-default:
|
|
51
|
-
--starasia-ui-outline-progress-default:
|
|
20
|
+
--starasia-ui-outline-background-default: rgba(249, 250, 251, 1);
|
|
21
|
+
--starasia-ui-outline-color-default: rgba(17, 24, 39, 1);
|
|
22
|
+
--starasia-ui-outline-border-default: rgba(229, 231, 235, 1);
|
|
23
|
+
--starasia-ui-outline-progress-default: rgba(24, 26, 25, 1);
|
|
52
24
|
|
|
53
25
|
/* color outline red */
|
|
54
|
-
--starasia-ui-outline-background-danger:
|
|
55
|
-
--starasia-ui-outline-color-danger:
|
|
56
|
-
--starasia-ui-outline-border-danger:
|
|
57
|
-
--starasia-ui-outline-progress-danger:
|
|
58
|
-
--starasia-ui-outline-progress-danger: #c9184a;
|
|
26
|
+
--starasia-ui-outline-background-danger: rgba(254, 242, 242, 1);
|
|
27
|
+
--starasia-ui-outline-color-danger: rgba(220, 38, 38, 1);
|
|
28
|
+
--starasia-ui-outline-border-danger: rgba(254, 202, 202, 1);
|
|
29
|
+
--starasia-ui-outline-progress-danger: rgba(201, 24, 74, 1);
|
|
59
30
|
|
|
60
31
|
/* color solid red */
|
|
61
|
-
--starasia-ui-solid-background-danger:
|
|
62
|
-
--starasia-ui-solid-color-danger:
|
|
63
|
-
--starasia-ui-solid-border-danger:
|
|
32
|
+
--starasia-ui-solid-background-danger: rgba(201, 24, 74, 1);
|
|
33
|
+
--starasia-ui-solid-color-danger: rgba(255, 240, 243, 1);
|
|
34
|
+
--starasia-ui-solid-border-danger: rgba(201, 24, 74, 1);
|
|
64
35
|
|
|
65
36
|
/* color outline success */
|
|
66
|
-
--starasia-ui-outline-background-success:
|
|
67
|
-
--starasia-ui-outline-color-success:
|
|
68
|
-
--starasia-ui-outline-border-success:
|
|
69
|
-
--starasia-ui-outline-progress-success:
|
|
37
|
+
--starasia-ui-outline-background-success: rgba(220, 246, 234, 1);
|
|
38
|
+
--starasia-ui-outline-color-success: rgba(40, 172, 110, 1);
|
|
39
|
+
--starasia-ui-outline-border-success: rgba(151, 230, 193, 1);
|
|
40
|
+
--starasia-ui-outline-progress-success: rgba(40, 172, 110, 1);
|
|
70
41
|
|
|
71
42
|
/* color solid success */
|
|
72
|
-
--starasia-ui-solid-background-success:
|
|
73
|
-
--starasia-ui-solid-color-success:
|
|
74
|
-
--starasia-ui-solid-border-success:
|
|
43
|
+
--starasia-ui-solid-background-success: rgba(40, 172, 110, 1);
|
|
44
|
+
--starasia-ui-solid-color-success: rgba(220, 246, 234, 1);
|
|
45
|
+
--starasia-ui-solid-border-success: rgba(40, 172, 110, 1);
|
|
75
46
|
|
|
76
|
-
/* color outline info */
|
|
77
|
-
--starasia-ui-outline-background-info:
|
|
78
|
-
--starasia-ui-outline-color-info:
|
|
79
|
-
--starasia-ui-outline-border-info:
|
|
80
|
-
--starasia-ui-outline-progress-info:
|
|
47
|
+
/* color outline info (semantic blue) */
|
|
48
|
+
--starasia-ui-outline-background-info: rgba(227, 242, 253, 1);
|
|
49
|
+
--starasia-ui-outline-color-info: rgba(25, 118, 210, 1);
|
|
50
|
+
--starasia-ui-outline-border-info: rgba(100, 181, 246, 1);
|
|
51
|
+
--starasia-ui-outline-progress-info: rgba(25, 118, 210, 1);
|
|
81
52
|
|
|
82
|
-
/* color solid info */
|
|
83
|
-
--starasia-ui-solid-background-info:
|
|
84
|
-
--starasia-ui-solid-color-info:
|
|
85
|
-
--starasia-ui-solid-border-info:
|
|
53
|
+
/* color solid info (semantic blue) */
|
|
54
|
+
--starasia-ui-solid-background-info: rgba(25, 118, 210, 1);
|
|
55
|
+
--starasia-ui-solid-color-info: rgba(227, 242, 253, 1);
|
|
56
|
+
--starasia-ui-solid-border-info: rgba(25, 118, 210, 1);
|
|
86
57
|
|
|
87
58
|
/* color outline warning */
|
|
88
|
-
--starasia-ui-outline-background-warning:
|
|
89
|
-
--starasia-ui-outline-color-warning:
|
|
90
|
-
--starasia-ui-outline-border-warning:
|
|
91
|
-
--starasia-ui-outline-progress-warning:
|
|
59
|
+
--starasia-ui-outline-background-warning: rgba(253, 243, 228, 1);
|
|
60
|
+
--starasia-ui-outline-color-warning: rgba(24, 26, 25, 1);
|
|
61
|
+
--starasia-ui-outline-border-warning: rgba(244, 197, 131, 1);
|
|
62
|
+
--starasia-ui-outline-progress-warning: rgba(237, 159, 48, 1);
|
|
92
63
|
|
|
93
64
|
/* color solid warning */
|
|
94
|
-
--starasia-ui-solid-background-warning:
|
|
95
|
-
--starasia-ui-solid-color-warning:
|
|
96
|
-
--starasia-ui-solid-border-warning:
|
|
65
|
+
--starasia-ui-solid-background-warning: rgba(237, 159, 48, 1);
|
|
66
|
+
--starasia-ui-solid-color-warning: var(--starasia-ui-toast-color-white);
|
|
67
|
+
--starasia-ui-solid-border-warning: rgba(237, 159, 48, 1);
|
|
97
68
|
|
|
98
69
|
/* height */
|
|
99
70
|
--starasia-ui-h-0-5: 0.125rem; /* 2px */
|
|
@@ -328,4 +299,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
328
299
|
width: 0px;
|
|
329
300
|
}
|
|
330
301
|
}
|
|
331
|
-
`;let
|
|
302
|
+
`;let w=1;class k{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{const s=this.subscribers.indexOf(a);this.subscribers.splice(s,1)}),this.publish=a=>{this.subscribers.forEach(s=>s(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{const{message:s,type:l}=a,r=w++;return this.addToast({title:s,type:l,id:r}),r},this.dismiss=a=>(this.subscribers.forEach(s=>s({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=[]}}const i=new k,x=Object.assign({success:i.success,info:i.info,default:i.default,danger:i.danger,warning:i.warning}),b="starasia-toast-styles";(t=>{if(!document.getElementById(b)){const a=document.createElement("style");a.id=b,a.textContent=t,document.head.appendChild(a)}})(y);const C=({type:t="outline",direction:a="bottom-right"})=>{const[s,l]=e.useState([]);return e.useEffect(()=>i.subscribe(r=>{if(r.dismiss){l(u=>u.filter(g=>g.id!==r.id));return}setTimeout(()=>{v.flushSync(()=>{l(u=>[r,...u])})})}),[]),n.jsx("div",{className:`starasia-toast-container starasia-toast-container-${a}`,children:s.map(r=>n.jsx(T,{data:r,type:t,direction:a},r.id))})},T=({data:t,type:a="solid",direction:s})=>{const[l,r]=e.useState(null),[u,g]=e.useState(!1),c=e.useRef(null),m=()=>{const d=setTimeout(()=>{p()},5e3);r(d)},f=()=>{l&&(clearTimeout(l),r(null))},p=()=>{i.dismiss(t.id)};e.useEffect(()=>(u?f():m(),()=>{f()}),[u]),e.useEffect(()=>{const d=c.current,h=()=>{p()};return d&&d.addEventListener("animationend",h),()=>{d&&d.removeEventListener("animationend",h)}},[]);const M=()=>{g(!0),f(),c.current&&(c.current.style.animationPlayState="paused")},j=()=>{g(!1),m(),c.current&&(c.current.style.animationPlayState="running")};return n.jsxs("div",{className:`starasia-toast-item-container starasia-toast-item-container-${a}-${t.type} starasia-toast-item-container-animation-${s}`,onMouseEnter:M,onMouseLeave:j,children:[n.jsx("div",{style:{display:"flex"},children:t.type==="success"?n.jsx(E,{style:{color:"inherit"}}):n.jsx(L,{style:{color:"inherit"}})}),n.jsx("div",{style:{flex:1},children:t.title}),n.jsx("div",{style:{display:"flex",cursor:"pointer"},onClick:()=>i.dismiss(t.id),children:n.jsx(S,{style:{color:"inherit"}})}),a==="outline"?n.jsx("div",{ref:c,className:`starasia-toast-item-progress starasia-toast-item-progress-outline-${t.type}`,style:{animation:"progressBarr 5s linear forwards",animationPlayState:u?"paused":"running"}}):null]})},L=t=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",...t,children:n.jsx("path",{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",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",cursor:"pointer"})}),E=t=>n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:n.jsx("g",{id:"Curved/Basic-actions-and-state",children:n.jsx("path",{id:"shape",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",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),S=t=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",...t,children:n.jsx("path",{d:"M19 5L5 19M5.00003 5L19 19",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})});o.ToastContainer=C,o.toast=x,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|