@arkyn/components 1.3.71 → 1.3.73
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/bundle.js +395 -405
- package/dist/bundle.umd.cjs +9 -9
- package/dist/components/Alert/AlertButton/index.d.ts +5 -0
- package/dist/components/Alert/AlertButton/index.d.ts.map +1 -0
- package/dist/components/Alert/AlertButton/index.js +12 -0
- package/dist/components/Input/MaskInput/index.d.ts.map +1 -1
- package/dist/components/Input/MaskInput/index.js +1 -1
- package/dist/components/Select/getConfig.d.ts +0 -1
- package/dist/components/Select/getConfig.d.ts.map +1 -1
- package/dist/components/Select/getConfig.js +1 -2
- package/dist/components/Select/index.js +3 -3
- package/dist/components/Tabs/TabContainer/index.d.ts.map +1 -1
- package/dist/components/Tabs/TabContainer/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Alert/AlertButton/index.tsx +43 -0
- package/src/components/Alert/AlertButton/styles.css +214 -0
- package/src/components/Alert/AlertContent/styles.css +1 -1
- package/src/components/Alert/AlertDescription/styles.css +1 -1
- package/src/components/Alert/AlertTitle/styles.css +1 -1
- package/src/components/Input/MaskInput/index.tsx +1 -0
- package/src/components/Select/getConfig.tsx +2 -2
- package/src/components/Select/index.tsx +3 -3
- package/src/components/Tabs/TabContainer/index.tsx +1 -6
package/dist/bundle.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import p, { createContext as ke, useContext as ye, useRef as Ee, useId as tn, useState as
|
1
|
+
import p, { createContext as ke, useContext as ye, useRef as Ee, useId as tn, useState as oe, useEffect as Ze, forwardRef as nn } from "react";
|
2
2
|
import { Info as ot, AlertTriangle as rn, XCircle as Et, CheckCircle2 as St, Loader2 as $e, Check as Rt, ChevronDown as an, ChevronRight as it, ChevronLeft as sn, Ellipsis as xt, X as $t, AlertCircle as on } from "lucide-react";
|
3
3
|
import { useActionData as Pt, useLocation as Tt, Link as ln, useNavigate as cn } from "@remix-run/react";
|
4
4
|
import { InputMask as un } from "@react-input/mask";
|
@@ -53,27 +53,27 @@ function mn() {
|
|
53
53
|
{
|
54
54
|
for (var f = arguments.length, g = new Array(f > 1 ? f - 1 : 0), N = 1; N < f; N++)
|
55
55
|
g[N - 1] = arguments[N];
|
56
|
-
|
56
|
+
I("error", n, g);
|
57
57
|
}
|
58
58
|
}
|
59
|
-
function
|
59
|
+
function I(n, f, g) {
|
60
60
|
{
|
61
61
|
var N = v.ReactDebugCurrentFrame, D = N.getStackAddendum();
|
62
62
|
D !== "" && (f += "%s", g = g.concat([D]));
|
63
|
-
var Y = g.map(function(
|
64
|
-
return String(
|
63
|
+
var Y = g.map(function(O) {
|
64
|
+
return String(O);
|
65
65
|
});
|
66
66
|
Y.unshift("Warning: " + f), Function.prototype.apply.call(console[n], console, Y);
|
67
67
|
}
|
68
68
|
}
|
69
|
-
var
|
70
|
-
|
71
|
-
function
|
72
|
-
return !!(typeof n == "string" || typeof n == "function" || n === s || n === l ||
|
69
|
+
var z = !1, R = !1, V = !1, B = !1, U = !1, W;
|
70
|
+
W = Symbol.for("react.module.reference");
|
71
|
+
function G(n) {
|
72
|
+
return !!(typeof n == "string" || typeof n == "function" || n === s || n === l || U || n === i || n === h || n === m || B || n === b || z || R || V || typeof n == "object" && n !== null && (n.$$typeof === o || n.$$typeof === y || n.$$typeof === d || n.$$typeof === c || n.$$typeof === u || // This needs to include all possible module reference object
|
73
73
|
// types supported by any Flight configuration anywhere since
|
74
74
|
// we don't know which Flight build this will end up being used
|
75
75
|
// with.
|
76
|
-
n.$$typeof ===
|
76
|
+
n.$$typeof === W || n.getModuleId !== void 0));
|
77
77
|
}
|
78
78
|
function F(n, f, g) {
|
79
79
|
var N = n.displayName;
|
@@ -82,7 +82,7 @@ function mn() {
|
|
82
82
|
var D = f.displayName || f.name || "";
|
83
83
|
return D !== "" ? g + "(" + D + ")" : g;
|
84
84
|
}
|
85
|
-
function
|
85
|
+
function te(n) {
|
86
86
|
return n.displayName || "Context";
|
87
87
|
}
|
88
88
|
function j(n) {
|
@@ -110,19 +110,19 @@ function mn() {
|
|
110
110
|
switch (n.$$typeof) {
|
111
111
|
case c:
|
112
112
|
var f = n;
|
113
|
-
return
|
113
|
+
return te(f) + ".Consumer";
|
114
114
|
case d:
|
115
115
|
var g = n;
|
116
|
-
return
|
116
|
+
return te(g._context) + ".Provider";
|
117
117
|
case u:
|
118
118
|
return F(n, n.render, "ForwardRef");
|
119
119
|
case y:
|
120
120
|
var N = n.displayName || null;
|
121
121
|
return N !== null ? N : j(n.type) || "Memo";
|
122
122
|
case o: {
|
123
|
-
var D = n, Y = D._payload,
|
123
|
+
var D = n, Y = D._payload, O = D._init;
|
124
124
|
try {
|
125
|
-
return j(
|
125
|
+
return j(O(Y));
|
126
126
|
} catch {
|
127
127
|
return null;
|
128
128
|
}
|
@@ -130,18 +130,18 @@ function mn() {
|
|
130
130
|
}
|
131
131
|
return null;
|
132
132
|
}
|
133
|
-
var
|
134
|
-
function
|
133
|
+
var H = Object.assign, M = 0, K, Q, $, q, ie, T, S;
|
134
|
+
function _() {
|
135
135
|
}
|
136
|
-
|
137
|
-
function
|
136
|
+
_.__reactDisabledLog = !0;
|
137
|
+
function Z() {
|
138
138
|
{
|
139
139
|
if (M === 0) {
|
140
|
-
|
140
|
+
K = console.log, Q = console.info, $ = console.warn, q = console.error, ie = console.group, T = console.groupCollapsed, S = console.groupEnd;
|
141
141
|
var n = {
|
142
142
|
configurable: !0,
|
143
143
|
enumerable: !0,
|
144
|
-
value:
|
144
|
+
value: _,
|
145
145
|
writable: !0
|
146
146
|
};
|
147
147
|
Object.defineProperties(console, {
|
@@ -157,7 +157,7 @@ function mn() {
|
|
157
157
|
M++;
|
158
158
|
}
|
159
159
|
}
|
160
|
-
function
|
160
|
+
function le() {
|
161
161
|
{
|
162
162
|
if (M--, M === 0) {
|
163
163
|
var n = {
|
@@ -166,33 +166,33 @@ function mn() {
|
|
166
166
|
writable: !0
|
167
167
|
};
|
168
168
|
Object.defineProperties(console, {
|
169
|
-
log:
|
170
|
-
value:
|
169
|
+
log: H({}, n, {
|
170
|
+
value: K
|
171
171
|
}),
|
172
|
-
info:
|
173
|
-
value:
|
172
|
+
info: H({}, n, {
|
173
|
+
value: Q
|
174
174
|
}),
|
175
|
-
warn:
|
176
|
-
value:
|
175
|
+
warn: H({}, n, {
|
176
|
+
value: $
|
177
177
|
}),
|
178
|
-
error:
|
179
|
-
value:
|
178
|
+
error: H({}, n, {
|
179
|
+
value: q
|
180
180
|
}),
|
181
|
-
group:
|
182
|
-
value:
|
181
|
+
group: H({}, n, {
|
182
|
+
value: ie
|
183
183
|
}),
|
184
|
-
groupCollapsed:
|
185
|
-
value:
|
184
|
+
groupCollapsed: H({}, n, {
|
185
|
+
value: T
|
186
186
|
}),
|
187
|
-
groupEnd:
|
188
|
-
value:
|
187
|
+
groupEnd: H({}, n, {
|
188
|
+
value: S
|
189
189
|
})
|
190
190
|
});
|
191
191
|
}
|
192
192
|
M < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
193
193
|
}
|
194
194
|
}
|
195
|
-
var
|
195
|
+
var X = v.ReactCurrentDispatcher, xe;
|
196
196
|
function me(n, f, g) {
|
197
197
|
{
|
198
198
|
if (xe === void 0)
|
@@ -206,48 +206,48 @@ function mn() {
|
|
206
206
|
` + xe + n;
|
207
207
|
}
|
208
208
|
}
|
209
|
-
var
|
209
|
+
var J = !1, re;
|
210
210
|
{
|
211
211
|
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
|
212
|
-
|
212
|
+
re = new Ne();
|
213
213
|
}
|
214
214
|
function Pe(n, f) {
|
215
|
-
if (!n ||
|
215
|
+
if (!n || J)
|
216
216
|
return "";
|
217
217
|
{
|
218
|
-
var g =
|
218
|
+
var g = re.get(n);
|
219
219
|
if (g !== void 0)
|
220
220
|
return g;
|
221
221
|
}
|
222
222
|
var N;
|
223
|
-
|
223
|
+
J = !0;
|
224
224
|
var D = Error.prepareStackTrace;
|
225
225
|
Error.prepareStackTrace = void 0;
|
226
226
|
var Y;
|
227
|
-
Y =
|
227
|
+
Y = X.current, X.current = null, Z();
|
228
228
|
try {
|
229
229
|
if (f) {
|
230
|
-
var
|
230
|
+
var O = function() {
|
231
231
|
throw Error();
|
232
232
|
};
|
233
|
-
if (Object.defineProperty(
|
233
|
+
if (Object.defineProperty(O.prototype, "props", {
|
234
234
|
set: function() {
|
235
235
|
throw Error();
|
236
236
|
}
|
237
237
|
}), typeof Reflect == "object" && Reflect.construct) {
|
238
238
|
try {
|
239
|
-
Reflect.construct(
|
239
|
+
Reflect.construct(O, []);
|
240
240
|
} catch (de) {
|
241
241
|
N = de;
|
242
242
|
}
|
243
|
-
Reflect.construct(n, [],
|
243
|
+
Reflect.construct(n, [], O);
|
244
244
|
} else {
|
245
245
|
try {
|
246
|
-
|
246
|
+
O.call();
|
247
247
|
} catch (de) {
|
248
248
|
N = de;
|
249
249
|
}
|
250
|
-
n.call(
|
250
|
+
n.call(O.prototype);
|
251
251
|
}
|
252
252
|
} else {
|
253
253
|
try {
|
@@ -259,28 +259,28 @@ function mn() {
|
|
259
259
|
}
|
260
260
|
} catch (de) {
|
261
261
|
if (de && N && typeof de.stack == "string") {
|
262
|
-
for (var
|
263
|
-
`),
|
264
|
-
`),
|
262
|
+
for (var P = de.stack.split(`
|
263
|
+
`), ce = N.stack.split(`
|
264
|
+
`), ee = P.length - 1, ne = ce.length - 1; ee >= 1 && ne >= 0 && P[ee] !== ce[ne]; )
|
265
265
|
ne--;
|
266
|
-
for (;
|
267
|
-
if (
|
268
|
-
if (
|
266
|
+
for (; ee >= 1 && ne >= 0; ee--, ne--)
|
267
|
+
if (P[ee] !== ce[ne]) {
|
268
|
+
if (ee !== 1 || ne !== 1)
|
269
269
|
do
|
270
|
-
if (
|
270
|
+
if (ee--, ne--, ne < 0 || P[ee] !== ce[ne]) {
|
271
271
|
var ge = `
|
272
|
-
` +
|
273
|
-
return n.displayName && ge.includes("<anonymous>") && (ge = ge.replace("<anonymous>", n.displayName)), typeof n == "function" &&
|
272
|
+
` + P[ee].replace(" at new ", " at ");
|
273
|
+
return n.displayName && ge.includes("<anonymous>") && (ge = ge.replace("<anonymous>", n.displayName)), typeof n == "function" && re.set(n, ge), ge;
|
274
274
|
}
|
275
|
-
while (
|
275
|
+
while (ee >= 1 && ne >= 0);
|
276
276
|
break;
|
277
277
|
}
|
278
278
|
}
|
279
279
|
} finally {
|
280
|
-
|
280
|
+
J = !1, X.current = Y, le(), Error.prepareStackTrace = D;
|
281
281
|
}
|
282
282
|
var Oe = n ? n.displayName || n.name : "", Re = Oe ? me(Oe) : "";
|
283
|
-
return typeof n == "function" &&
|
283
|
+
return typeof n == "function" && re.set(n, Re), Re;
|
284
284
|
}
|
285
285
|
function et(n, f, g) {
|
286
286
|
return Pe(n, !1);
|
@@ -319,7 +319,7 @@ function mn() {
|
|
319
319
|
return "";
|
320
320
|
}
|
321
321
|
var he = Object.prototype.hasOwnProperty, Ye = {}, Ue = v.ReactDebugCurrentFrame;
|
322
|
-
function
|
322
|
+
function ae(n) {
|
323
323
|
if (n) {
|
324
324
|
var f = n._owner, g = Se(n.type, n._source, f ? f.type : null);
|
325
325
|
Ue.setExtraStackFrame(g);
|
@@ -329,19 +329,19 @@ function mn() {
|
|
329
329
|
function Ce(n, f, g, N, D) {
|
330
330
|
{
|
331
331
|
var Y = Function.call.bind(he);
|
332
|
-
for (var
|
333
|
-
if (Y(n,
|
334
|
-
var
|
332
|
+
for (var O in n)
|
333
|
+
if (Y(n, O)) {
|
334
|
+
var P = void 0;
|
335
335
|
try {
|
336
|
-
if (typeof n[
|
337
|
-
var
|
338
|
-
throw
|
336
|
+
if (typeof n[O] != "function") {
|
337
|
+
var ce = Error((N || "React class") + ": " + g + " type `" + O + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof n[O] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
338
|
+
throw ce.name = "Invariant Violation", ce;
|
339
339
|
}
|
340
|
-
|
341
|
-
} catch (
|
342
|
-
|
340
|
+
P = n[O](f, O, N, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
341
|
+
} catch (ee) {
|
342
|
+
P = ee;
|
343
343
|
}
|
344
|
-
|
344
|
+
P && !(P instanceof Error) && (ae(D), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", N || "React class", g, O, typeof P), ae(null)), P instanceof Error && !(P.message in Ye) && (Ye[P.message] = !0, ae(D), x("Failed %s type: %s", g, P.message), ae(null));
|
345
345
|
}
|
346
346
|
}
|
347
347
|
}
|
@@ -420,60 +420,60 @@ function mn() {
|
|
420
420
|
});
|
421
421
|
}
|
422
422
|
}
|
423
|
-
var at = function(n, f, g, N, D, Y,
|
424
|
-
var
|
423
|
+
var at = function(n, f, g, N, D, Y, O) {
|
424
|
+
var P = {
|
425
425
|
// This tag allows us to uniquely identify this as a React Element
|
426
426
|
$$typeof: t,
|
427
427
|
// Built-in properties that belong on the element
|
428
428
|
type: n,
|
429
429
|
key: f,
|
430
430
|
ref: g,
|
431
|
-
props:
|
431
|
+
props: O,
|
432
432
|
// Record the component responsible for creating this element.
|
433
433
|
_owner: Y
|
434
434
|
};
|
435
|
-
return
|
435
|
+
return P._store = {}, Object.defineProperty(P._store, "validated", {
|
436
436
|
configurable: !1,
|
437
437
|
enumerable: !1,
|
438
438
|
writable: !0,
|
439
439
|
value: !1
|
440
|
-
}), Object.defineProperty(
|
440
|
+
}), Object.defineProperty(P, "_self", {
|
441
441
|
configurable: !1,
|
442
442
|
enumerable: !1,
|
443
443
|
writable: !1,
|
444
444
|
value: N
|
445
|
-
}), Object.defineProperty(
|
445
|
+
}), Object.defineProperty(P, "_source", {
|
446
446
|
configurable: !1,
|
447
447
|
enumerable: !1,
|
448
448
|
writable: !1,
|
449
449
|
value: D
|
450
|
-
}), Object.freeze && (Object.freeze(
|
450
|
+
}), Object.freeze && (Object.freeze(P.props), Object.freeze(P)), P;
|
451
451
|
};
|
452
|
-
function
|
452
|
+
function E(n, f, g, N, D) {
|
453
453
|
{
|
454
|
-
var Y,
|
455
|
-
g !== void 0 && (Ie(g),
|
454
|
+
var Y, O = {}, P = null, ce = null;
|
455
|
+
g !== void 0 && (Ie(g), P = "" + g), Xe(f) && (Ie(f.key), P = "" + f.key), Ke(f) && (ce = f.ref, rt(f, D));
|
456
456
|
for (Y in f)
|
457
|
-
he.call(f, Y) && !He.hasOwnProperty(Y) && (
|
457
|
+
he.call(f, Y) && !He.hasOwnProperty(Y) && (O[Y] = f[Y]);
|
458
458
|
if (n && n.defaultProps) {
|
459
|
-
var
|
460
|
-
for (Y in
|
461
|
-
|
459
|
+
var ee = n.defaultProps;
|
460
|
+
for (Y in ee)
|
461
|
+
O[Y] === void 0 && (O[Y] = ee[Y]);
|
462
462
|
}
|
463
|
-
if (
|
463
|
+
if (P || ce) {
|
464
464
|
var ne = typeof n == "function" ? n.displayName || n.name || "Unknown" : n;
|
465
|
-
|
465
|
+
P && Me(O, ne), ce && be(O, ne);
|
466
466
|
}
|
467
|
-
return at(n,
|
467
|
+
return at(n, P, ce, D, N, pe.current, O);
|
468
468
|
}
|
469
469
|
}
|
470
|
-
var
|
471
|
-
function
|
470
|
+
var L = v.ReactCurrentOwner, A = v.ReactDebugCurrentFrame;
|
471
|
+
function se(n) {
|
472
472
|
if (n) {
|
473
473
|
var f = n._owner, g = Se(n.type, n._source, f ? f.type : null);
|
474
|
-
|
474
|
+
A.setExtraStackFrame(g);
|
475
475
|
} else
|
476
|
-
|
476
|
+
A.setExtraStackFrame(null);
|
477
477
|
}
|
478
478
|
var ue;
|
479
479
|
ue = !1;
|
@@ -482,8 +482,8 @@ function mn() {
|
|
482
482
|
}
|
483
483
|
function Je() {
|
484
484
|
{
|
485
|
-
if (
|
486
|
-
var n = j(
|
485
|
+
if (L.current) {
|
486
|
+
var n = j(L.current.type);
|
487
487
|
if (n)
|
488
488
|
return `
|
489
489
|
|
@@ -526,7 +526,7 @@ Check the top-level render call using <` + g + ">.");
|
|
526
526
|
return;
|
527
527
|
pt[g] = !0;
|
528
528
|
var N = "";
|
529
|
-
n && n._owner && n._owner !==
|
529
|
+
n && n._owner && n._owner !== L.current && (N = " It was passed a child from " + j(n._owner.type) + "."), se(n), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, N), se(null);
|
530
530
|
}
|
531
531
|
}
|
532
532
|
function vt(n, f) {
|
@@ -543,8 +543,8 @@ Check the top-level render call using <` + g + ">.");
|
|
543
543
|
else if (n) {
|
544
544
|
var D = k(n);
|
545
545
|
if (typeof D == "function" && D !== n.entries)
|
546
|
-
for (var Y = D.call(n),
|
547
|
-
_e(
|
546
|
+
for (var Y = D.call(n), O; !(O = Y.next()).done; )
|
547
|
+
_e(O.value) && gt(O.value, f);
|
548
548
|
}
|
549
549
|
}
|
550
550
|
}
|
@@ -578,29 +578,29 @@ Check the top-level render call using <` + g + ">.");
|
|
578
578
|
for (var f = Object.keys(n.props), g = 0; g < f.length; g++) {
|
579
579
|
var N = f[g];
|
580
580
|
if (N !== "children" && N !== "key") {
|
581
|
-
|
581
|
+
se(n), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", N), se(null);
|
582
582
|
break;
|
583
583
|
}
|
584
584
|
}
|
585
|
-
n.ref !== null && (
|
585
|
+
n.ref !== null && (se(n), x("Invalid attribute `ref` supplied to `React.Fragment`."), se(null));
|
586
586
|
}
|
587
587
|
}
|
588
588
|
var bt = {};
|
589
589
|
function yt(n, f, g, N, D, Y) {
|
590
590
|
{
|
591
|
-
var
|
592
|
-
if (!
|
593
|
-
var
|
594
|
-
(n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (
|
595
|
-
var
|
596
|
-
|
597
|
-
var
|
598
|
-
n === null ?
|
591
|
+
var O = G(n);
|
592
|
+
if (!O) {
|
593
|
+
var P = "";
|
594
|
+
(n === void 0 || typeof n == "object" && n !== null && Object.keys(n).length === 0) && (P += " 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 ce = Ut(D);
|
596
|
+
ce ? P += ce : P += Je();
|
597
|
+
var ee;
|
598
|
+
n === null ? ee = "null" : ze(n) ? ee = "array" : n !== void 0 && n.$$typeof === t ? (ee = "<" + (j(n.type) || "Unknown") + " />", P = " Did you accidentally export a JSX literal instead of a component?") : ee = typeof n, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ee, P);
|
599
599
|
}
|
600
|
-
var ne =
|
600
|
+
var ne = E(n, f, g, D, Y);
|
601
601
|
if (ne == null)
|
602
602
|
return ne;
|
603
|
-
if (
|
603
|
+
if (O) {
|
604
604
|
var ge = f.children;
|
605
605
|
if (ge !== void 0)
|
606
606
|
if (N)
|
@@ -794,10 +794,10 @@ function Er(e) {
|
|
794
794
|
onCheck: c,
|
795
795
|
value: u,
|
796
796
|
...h
|
797
|
-
} = e, { id: m, inputRef: y, error: o } = ve(), b = i || !!o, [C, w] =
|
797
|
+
} = e, { id: m, inputRef: y, error: o } = ve(), b = i || !!o, [C, w] = oe(l || !1), k = typeof d == "boolean" ? d : C, v = `arkyn_checkbox ${s} ${b ? "error" : ""} ${k ? "checked" : ""} ${r}`;
|
798
798
|
function x() {
|
799
|
-
const
|
800
|
-
w(!
|
799
|
+
const I = C;
|
800
|
+
w(!I), c && c(I ? "" : u || "checked");
|
801
801
|
}
|
802
802
|
return /* @__PURE__ */ a.jsxs(
|
803
803
|
"button",
|
@@ -899,15 +899,15 @@ function bn(e, t) {
|
|
899
899
|
title: k,
|
900
900
|
style: v,
|
901
901
|
onChange: x,
|
902
|
-
...
|
902
|
+
...I
|
903
903
|
} = e;
|
904
|
-
function
|
905
|
-
let M = ft(
|
906
|
-
const
|
904
|
+
function z(H) {
|
905
|
+
let M = ft(H);
|
906
|
+
const K = Bt(M);
|
907
907
|
if (!(M.length > Mt))
|
908
|
-
return M = Dt(M, mt[
|
908
|
+
return M = Dt(M, mt[K]), M;
|
909
909
|
}
|
910
|
-
const
|
910
|
+
const R = m ? "right" : "left", F = `arkyn_input ${c ? "hasPrefix" : ""} ${u ? "hasSufix" : ""} ${d} ${i} ${y || b || r ? "opacity" : ""} ${s ? "errored" : ""} ${t ? "focused" : ""} ${l}`, j = { md: 20, lg: 20 }[i];
|
911
911
|
return {
|
912
912
|
isLoading: r,
|
913
913
|
className: F,
|
@@ -915,7 +915,7 @@ function bn(e, t) {
|
|
915
915
|
sufix: je(u, j, "sufix"),
|
916
916
|
LeftIcon: h,
|
917
917
|
RightIcon: m,
|
918
|
-
defaultValue:
|
918
|
+
defaultValue: z(o || ""),
|
919
919
|
disabled: y,
|
920
920
|
readOnly: b,
|
921
921
|
onFocus: C,
|
@@ -923,14 +923,14 @@ function bn(e, t) {
|
|
923
923
|
title: k,
|
924
924
|
style: v,
|
925
925
|
onChange: x,
|
926
|
-
loadingPosition:
|
926
|
+
loadingPosition: R,
|
927
927
|
iconSize: j,
|
928
928
|
Spinner: /* @__PURE__ */ a.jsx($e, { className: "spinner", size: j, strokeWidth: 2.5 }),
|
929
|
-
...
|
929
|
+
...I
|
930
930
|
};
|
931
931
|
}
|
932
932
|
function yn(e) {
|
933
|
-
const [t, r] =
|
933
|
+
const [t, r] = oe(!1), s = Ee(null), { inputRef: i, id: l, error: d } = ve(), c = i || s, u = e.isError || !!d, {
|
934
934
|
disabled: h,
|
935
935
|
title: m,
|
936
936
|
style: y,
|
@@ -941,56 +941,56 @@ function yn(e) {
|
|
941
941
|
loadingPosition: k,
|
942
942
|
isLoading: v,
|
943
943
|
LeftIcon: x,
|
944
|
-
readOnly:
|
945
|
-
onFocus:
|
946
|
-
onBlur:
|
947
|
-
RightIcon:
|
944
|
+
readOnly: I,
|
945
|
+
onFocus: z,
|
946
|
+
onBlur: R,
|
947
|
+
RightIcon: V,
|
948
948
|
Spinner: B,
|
949
|
-
onChange:
|
950
|
-
value:
|
951
|
-
defaultValue:
|
949
|
+
onChange: U,
|
950
|
+
value: W,
|
951
|
+
defaultValue: G,
|
952
952
|
...F
|
953
|
-
} = bn({ ...e, id: l, isError: u }, t), [
|
954
|
-
function
|
953
|
+
} = bn({ ...e, id: l, isError: u }, t), [te, j] = oe(G), H = x && !v, M = V && !v, K = k === "left" && v, Q = k === "right" && v;
|
954
|
+
function $() {
|
955
955
|
h || !(c != null && c.current) || (r(!0), c.current.focus());
|
956
956
|
}
|
957
|
-
function
|
958
|
-
let
|
959
|
-
const
|
960
|
-
|
957
|
+
function q(S) {
|
958
|
+
let _ = ft(S.target.value);
|
959
|
+
const Z = Bt(_);
|
960
|
+
_.length > Mt || (_ = Dt(_, mt[Z]), S.target.value = _, j(_), U && U(S));
|
961
961
|
}
|
962
|
-
function
|
963
|
-
r(!0),
|
962
|
+
function ie(S) {
|
963
|
+
r(!0), z && z(S);
|
964
964
|
}
|
965
|
-
function S
|
966
|
-
r(!1),
|
965
|
+
function T(S) {
|
966
|
+
r(!1), R && R(S);
|
967
967
|
}
|
968
968
|
return /* @__PURE__ */ a.jsxs(
|
969
969
|
"section",
|
970
970
|
{
|
971
971
|
title: m,
|
972
972
|
style: y,
|
973
|
-
onClick:
|
973
|
+
onClick: $,
|
974
974
|
className: o,
|
975
975
|
children: [
|
976
976
|
b,
|
977
|
-
|
978
|
-
|
977
|
+
K && B,
|
978
|
+
H && /* @__PURE__ */ a.jsx(x, { size: w, strokeWidth: 2.5 }),
|
979
979
|
/* @__PURE__ */ a.jsx(
|
980
980
|
"input",
|
981
981
|
{
|
982
982
|
disabled: h || v,
|
983
|
-
readOnly:
|
983
|
+
readOnly: I,
|
984
984
|
ref: c,
|
985
|
-
value:
|
986
|
-
onFocus:
|
987
|
-
onChange:
|
988
|
-
onBlur:
|
985
|
+
value: W || te,
|
986
|
+
onFocus: ie,
|
987
|
+
onChange: q,
|
988
|
+
onBlur: T,
|
989
989
|
...F
|
990
990
|
}
|
991
991
|
),
|
992
|
-
M && /* @__PURE__ */ a.jsx(
|
993
|
-
|
992
|
+
M && /* @__PURE__ */ a.jsx(V, { size: w, strokeWidth: 2.5 }),
|
993
|
+
Q && B,
|
994
994
|
C
|
995
995
|
]
|
996
996
|
}
|
@@ -1030,9 +1030,9 @@ function kn(e, t) {
|
|
1030
1030
|
// showCents = false,
|
1031
1031
|
max: v = 1e9,
|
1032
1032
|
locale: x = "pt-BR",
|
1033
|
-
currency:
|
1034
|
-
...
|
1035
|
-
} = e,
|
1033
|
+
currency: I = "BRL",
|
1034
|
+
...z
|
1035
|
+
} = e, R = m ? "right" : "left", F = `arkyn_input ${c ? "hasPrefix" : ""} ${u ? "hasSufix" : ""} ${d} ${i} ${y || o || r ? "opacity" : ""} ${s ? "errored" : ""} ${t ? "focused" : ""} ${l}`, j = { md: 20, lg: 20 }[i];
|
1036
1036
|
return {
|
1037
1037
|
isLoading: r,
|
1038
1038
|
className: F,
|
@@ -1042,7 +1042,7 @@ function kn(e, t) {
|
|
1042
1042
|
RightIcon: m,
|
1043
1043
|
disabled: y,
|
1044
1044
|
locale: x,
|
1045
|
-
currency:
|
1045
|
+
currency: I,
|
1046
1046
|
readOnly: o,
|
1047
1047
|
onFocus: b,
|
1048
1048
|
onBlur: C,
|
@@ -1050,14 +1050,14 @@ function kn(e, t) {
|
|
1050
1050
|
style: k,
|
1051
1051
|
max: v,
|
1052
1052
|
// showCents,
|
1053
|
-
loadingPosition:
|
1053
|
+
loadingPosition: R,
|
1054
1054
|
iconSize: j,
|
1055
1055
|
Spinner: /* @__PURE__ */ a.jsx($e, { className: "spinner", size: j, strokeWidth: 2.5 }),
|
1056
|
-
...
|
1056
|
+
...z
|
1057
1057
|
};
|
1058
1058
|
}
|
1059
1059
|
function Nn(e) {
|
1060
|
-
const [t, r] =
|
1060
|
+
const [t, r] = oe(!1), [s, i] = oe("0"), l = Ee(null), { inputRef: d, id: c, error: u } = ve(), h = d || l, m = e.isError || !!u, {
|
1061
1061
|
disabled: y,
|
1062
1062
|
title: o,
|
1063
1063
|
style: b,
|
@@ -1066,75 +1066,75 @@ function Nn(e) {
|
|
1066
1066
|
sufix: k,
|
1067
1067
|
iconSize: v,
|
1068
1068
|
loadingPosition: x,
|
1069
|
-
isLoading:
|
1070
|
-
LeftIcon:
|
1071
|
-
readOnly:
|
1072
|
-
onFocus:
|
1069
|
+
isLoading: I,
|
1070
|
+
LeftIcon: z,
|
1071
|
+
readOnly: R,
|
1072
|
+
onFocus: V,
|
1073
1073
|
onBlur: B,
|
1074
|
-
RightIcon:
|
1075
|
-
Spinner:
|
1076
|
-
value:
|
1074
|
+
RightIcon: U,
|
1075
|
+
Spinner: W,
|
1076
|
+
value: G,
|
1077
1077
|
max: F,
|
1078
|
-
onChangeValue:
|
1078
|
+
onChangeValue: te,
|
1079
1079
|
onKeyPress: j,
|
1080
|
-
currency:
|
1080
|
+
currency: H,
|
1081
1081
|
locale: M,
|
1082
|
-
name:
|
1083
|
-
defaultValue:
|
1084
|
-
|
1085
|
-
} = kn({ ...e, id: c, isError: m }, t),
|
1086
|
-
function
|
1082
|
+
name: K,
|
1083
|
+
defaultValue: Q,
|
1084
|
+
...$
|
1085
|
+
} = kn({ ...e, id: c, isError: m }, t), q = z && !I, ie = U && !I, T = x === "left" && I, S = x === "right" && I;
|
1086
|
+
function _() {
|
1087
1087
|
y || !(h != null && h.current) || (r(!0), h.current.focus());
|
1088
1088
|
}
|
1089
|
-
function
|
1090
|
-
r(!0),
|
1089
|
+
function Z(J) {
|
1090
|
+
r(!0), V && V(J);
|
1091
1091
|
}
|
1092
|
-
function
|
1093
|
-
r(!1), B && B(
|
1092
|
+
function le(J) {
|
1093
|
+
r(!1), B && B(J);
|
1094
1094
|
}
|
1095
|
-
const
|
1096
|
-
const [
|
1095
|
+
const X = (J) => {
|
1096
|
+
const [re, Ne] = Ct(
|
1097
1097
|
M,
|
1098
|
-
|
1099
|
-
|
1098
|
+
J,
|
1099
|
+
H
|
1100
1100
|
);
|
1101
|
-
return !F ||
|
1102
|
-
}, xe = (
|
1103
|
-
|
1104
|
-
const [
|
1105
|
-
|
1106
|
-
}, me = (
|
1101
|
+
return !F || re <= F ? (i(Ne), [re, Ne]) : [ct(s), s];
|
1102
|
+
}, xe = (J) => {
|
1103
|
+
J.preventDefault();
|
1104
|
+
const [re, Ne] = X(J.target.value);
|
1105
|
+
te(J, String(re), String(Ne));
|
1106
|
+
}, me = (J) => j && j(J, J.key, J.key);
|
1107
1107
|
return Ze(() => {
|
1108
|
-
const
|
1109
|
-
i(
|
1110
|
-
}, [
|
1108
|
+
const J = G || Q || void 0, [, re] = Ct(M, J, H);
|
1109
|
+
i(re);
|
1110
|
+
}, [H, Q, G]), /* @__PURE__ */ a.jsxs(
|
1111
1111
|
"section",
|
1112
1112
|
{
|
1113
1113
|
title: o,
|
1114
1114
|
style: b,
|
1115
|
-
onClick:
|
1115
|
+
onClick: _,
|
1116
1116
|
className: C,
|
1117
1117
|
children: [
|
1118
1118
|
w,
|
1119
|
-
|
1120
|
-
|
1119
|
+
T && W,
|
1120
|
+
q && /* @__PURE__ */ a.jsx(z, { size: v, strokeWidth: 2.5 }),
|
1121
1121
|
/* @__PURE__ */ a.jsx(
|
1122
1122
|
"input",
|
1123
1123
|
{
|
1124
1124
|
value: s,
|
1125
1125
|
onChange: xe,
|
1126
|
-
onBlur:
|
1127
|
-
onFocus:
|
1126
|
+
onBlur: le,
|
1127
|
+
onFocus: Z,
|
1128
1128
|
onKeyUp: me,
|
1129
|
-
disabled: y ||
|
1130
|
-
readOnly:
|
1129
|
+
disabled: y || I,
|
1130
|
+
readOnly: R,
|
1131
1131
|
ref: h,
|
1132
|
-
|
1132
|
+
...$
|
1133
1133
|
}
|
1134
1134
|
),
|
1135
|
-
/* @__PURE__ */ a.jsx("input", { type: "hidden", name:
|
1136
|
-
|
1137
|
-
|
1135
|
+
/* @__PURE__ */ a.jsx("input", { type: "hidden", name: K, value: ct(s) }),
|
1136
|
+
S && W,
|
1137
|
+
ie && /* @__PURE__ */ a.jsx(U, { size: v, strokeWidth: 2.5 }),
|
1138
1138
|
k
|
1139
1139
|
]
|
1140
1140
|
}
|
@@ -1159,9 +1159,9 @@ function Cn(e, t) {
|
|
1159
1159
|
style: k,
|
1160
1160
|
onChange: v,
|
1161
1161
|
showMask: x = !1,
|
1162
|
-
type:
|
1163
|
-
...
|
1164
|
-
} = e,
|
1162
|
+
type: I,
|
1163
|
+
...z
|
1164
|
+
} = e, R = m ? "right" : "left", F = `arkyn_input ${c ? "hasPrefix" : ""} ${u ? "hasSufix" : ""} ${d} ${i} ${y || o || r ? "opacity" : ""} ${s ? "errored" : ""} ${t ? "focused" : ""} ${l}`, j = { md: 20, lg: 20 }[i];
|
1165
1165
|
return {
|
1166
1166
|
isLoading: r,
|
1167
1167
|
className: F,
|
@@ -1176,16 +1176,16 @@ function Cn(e, t) {
|
|
1176
1176
|
title: w,
|
1177
1177
|
style: k,
|
1178
1178
|
onChange: v,
|
1179
|
-
loadingPosition:
|
1179
|
+
loadingPosition: R,
|
1180
1180
|
iconSize: j,
|
1181
1181
|
showMask: x,
|
1182
1182
|
Spinner: /* @__PURE__ */ a.jsx($e, { className: "spinner", size: j, strokeWidth: 2.5 }),
|
1183
|
-
...
|
1183
|
+
...z
|
1184
1184
|
};
|
1185
1185
|
}
|
1186
1186
|
const _n = nn((e, t) => /* @__PURE__ */ a.jsx("input", { ref: t, ...e }));
|
1187
1187
|
function jn(e) {
|
1188
|
-
const [t, r] =
|
1188
|
+
const [t, r] = oe(!1), s = Ee(null), { inputRef: i, id: l, error: d } = ve(), c = i || s, u = e.isError || !!d, {
|
1189
1189
|
disabled: h,
|
1190
1190
|
title: m,
|
1191
1191
|
style: y,
|
@@ -1196,21 +1196,21 @@ function jn(e) {
|
|
1196
1196
|
loadingPosition: k,
|
1197
1197
|
isLoading: v,
|
1198
1198
|
LeftIcon: x,
|
1199
|
-
readOnly:
|
1200
|
-
onFocus:
|
1201
|
-
onBlur:
|
1202
|
-
RightIcon:
|
1199
|
+
readOnly: I,
|
1200
|
+
onFocus: z,
|
1201
|
+
onBlur: R,
|
1202
|
+
RightIcon: V,
|
1203
1203
|
Spinner: B,
|
1204
|
-
...
|
1205
|
-
} = Cn({ ...e, id: l, isError: u }, t),
|
1204
|
+
...U
|
1205
|
+
} = Cn({ ...e, id: l, isError: u }, t), W = x && !v, G = V && !v, F = k === "left" && v, te = k === "right" && v;
|
1206
1206
|
function j() {
|
1207
1207
|
h || !(c != null && c.current) || (r(!0), c.current.focus());
|
1208
1208
|
}
|
1209
|
-
function K
|
1210
|
-
r(!0),
|
1209
|
+
function H(K) {
|
1210
|
+
r(!0), z && z(K);
|
1211
1211
|
}
|
1212
|
-
function M(
|
1213
|
-
r(!1),
|
1212
|
+
function M(K) {
|
1213
|
+
r(!1), R && R(K);
|
1214
1214
|
}
|
1215
1215
|
return /* @__PURE__ */ a.jsxs(
|
1216
1216
|
"section",
|
@@ -1222,19 +1222,20 @@ function jn(e) {
|
|
1222
1222
|
children: [
|
1223
1223
|
b,
|
1224
1224
|
F && B,
|
1225
|
-
|
1225
|
+
W && /* @__PURE__ */ a.jsx(x, { size: w, strokeWidth: 2.5 }),
|
1226
1226
|
/* @__PURE__ */ a.jsx(
|
1227
1227
|
un,
|
1228
1228
|
{
|
1229
1229
|
component: _n,
|
1230
1230
|
ref: c,
|
1231
|
-
onFocus:
|
1231
|
+
onFocus: H,
|
1232
1232
|
onBlur: M,
|
1233
|
-
|
1233
|
+
disabled: h,
|
1234
|
+
...U
|
1234
1235
|
}
|
1235
1236
|
),
|
1236
|
-
|
1237
|
-
|
1237
|
+
G && /* @__PURE__ */ a.jsx(V, { size: w, strokeWidth: 2.5 }),
|
1238
|
+
te && B,
|
1238
1239
|
C
|
1239
1240
|
]
|
1240
1241
|
}
|
@@ -1259,10 +1260,10 @@ function En(e, t) {
|
|
1259
1260
|
style: k,
|
1260
1261
|
onChange: v,
|
1261
1262
|
...x
|
1262
|
-
} = e,
|
1263
|
+
} = e, I = m ? "right" : "left", W = `arkyn_input ${c ? "hasPrefix" : ""} ${u ? "hasSufix" : ""} ${d} ${i} ${y || o || r ? "opacity" : ""} ${s ? "errored" : ""} ${t ? "focused" : ""} ${l}`, F = { md: 20, lg: 20 }[i];
|
1263
1264
|
return {
|
1264
1265
|
isLoading: r,
|
1265
|
-
className:
|
1266
|
+
className: W,
|
1266
1267
|
prefix: je(c, F, "prefix"),
|
1267
1268
|
sufix: je(u, F, "sufix"),
|
1268
1269
|
LeftIcon: h,
|
@@ -1274,14 +1275,14 @@ function En(e, t) {
|
|
1274
1275
|
title: w,
|
1275
1276
|
style: k,
|
1276
1277
|
onChange: v,
|
1277
|
-
loadingPosition:
|
1278
|
+
loadingPosition: I,
|
1278
1279
|
iconSize: F,
|
1279
1280
|
Spinner: /* @__PURE__ */ a.jsx($e, { className: "spinner", size: F, strokeWidth: 2.5 }),
|
1280
1281
|
...x
|
1281
1282
|
};
|
1282
1283
|
}
|
1283
1284
|
function Sn(e) {
|
1284
|
-
const [t, r] =
|
1285
|
+
const [t, r] = oe(!1), s = Ee(null), { inputRef: i, id: l, error: d } = ve(), c = i || s, u = e.isError || !!d, {
|
1285
1286
|
disabled: h,
|
1286
1287
|
title: m,
|
1287
1288
|
style: y,
|
@@ -1292,22 +1293,22 @@ function Sn(e) {
|
|
1292
1293
|
loadingPosition: k,
|
1293
1294
|
isLoading: v,
|
1294
1295
|
LeftIcon: x,
|
1295
|
-
readOnly:
|
1296
|
-
onFocus:
|
1297
|
-
onBlur:
|
1298
|
-
RightIcon:
|
1296
|
+
readOnly: I,
|
1297
|
+
onFocus: z,
|
1298
|
+
onBlur: R,
|
1299
|
+
RightIcon: V,
|
1299
1300
|
type: B,
|
1300
|
-
Spinner:
|
1301
|
-
...
|
1302
|
-
} = En({ ...e, id: l, isError: u }, t),
|
1303
|
-
function
|
1301
|
+
Spinner: U,
|
1302
|
+
...W
|
1303
|
+
} = En({ ...e, id: l, isError: u }, t), G = x && !v, F = V && !v, te = k === "left" && v, j = k === "right" && v;
|
1304
|
+
function H() {
|
1304
1305
|
h || !(c != null && c.current) || (r(!0), c.current.focus());
|
1305
1306
|
}
|
1306
|
-
function M(
|
1307
|
-
r(!0),
|
1307
|
+
function M(Q) {
|
1308
|
+
r(!0), z && z(Q);
|
1308
1309
|
}
|
1309
|
-
function
|
1310
|
-
r(!1),
|
1310
|
+
function K(Q) {
|
1311
|
+
r(!1), R && R(Q);
|
1311
1312
|
}
|
1312
1313
|
return B === "hidden" ? /* @__PURE__ */ a.jsx(
|
1313
1314
|
"input",
|
@@ -1316,33 +1317,33 @@ function Sn(e) {
|
|
1316
1317
|
readOnly: !0,
|
1317
1318
|
type: "text",
|
1318
1319
|
ref: c,
|
1319
|
-
...
|
1320
|
+
...W
|
1320
1321
|
}
|
1321
1322
|
) : /* @__PURE__ */ a.jsxs(
|
1322
1323
|
"section",
|
1323
1324
|
{
|
1324
1325
|
title: m,
|
1325
1326
|
style: y,
|
1326
|
-
onClick:
|
1327
|
+
onClick: H,
|
1327
1328
|
className: o,
|
1328
1329
|
children: [
|
1329
1330
|
b,
|
1330
|
-
|
1331
|
-
|
1331
|
+
te && U,
|
1332
|
+
G && /* @__PURE__ */ a.jsx(x, { size: w, strokeWidth: 2.5 }),
|
1332
1333
|
/* @__PURE__ */ a.jsx(
|
1333
1334
|
"input",
|
1334
1335
|
{
|
1335
1336
|
disabled: h || v,
|
1336
|
-
readOnly:
|
1337
|
+
readOnly: I,
|
1337
1338
|
ref: c,
|
1338
1339
|
onFocus: M,
|
1339
|
-
onBlur:
|
1340
|
+
onBlur: K,
|
1340
1341
|
type: B,
|
1341
|
-
...
|
1342
|
+
...W
|
1342
1343
|
}
|
1343
1344
|
),
|
1344
|
-
F && /* @__PURE__ */ a.jsx(
|
1345
|
-
j &&
|
1345
|
+
F && /* @__PURE__ */ a.jsx(V, { size: w, strokeWidth: 2.5 }),
|
1346
|
+
j && U,
|
1346
1347
|
C
|
1347
1348
|
]
|
1348
1349
|
}
|
@@ -1364,7 +1365,7 @@ function Tr(e) {
|
|
1364
1365
|
size: l = "md",
|
1365
1366
|
className: d,
|
1366
1367
|
...c
|
1367
|
-
} = e, [u, h] =
|
1368
|
+
} = e, [u, h] = oe(t || ""), { inputRef: m, id: y } = ve();
|
1368
1369
|
function o(C) {
|
1369
1370
|
h(C), i && i(C);
|
1370
1371
|
}
|
@@ -1428,14 +1429,13 @@ function $n(e, t) {
|
|
1428
1429
|
style: C,
|
1429
1430
|
closeOnSelect: w = !0,
|
1430
1431
|
...k
|
1431
|
-
} = e,
|
1432
|
+
} = e, R = `arkyn_select ${c ? "hasPrefix" : ""} ${d} ${i} ${h || m || r ? "opacity" : ""} ${s ? "errored" : ""} ${t ? "focused" : ""} ${l}`, B = { md: 20, lg: 20 }[i];
|
1432
1433
|
return {
|
1433
1434
|
isLoading: r,
|
1434
|
-
className:
|
1435
|
+
className: R,
|
1435
1436
|
prefix: vn(c, B, "prefix"),
|
1436
1437
|
LeftIcon: u,
|
1437
|
-
disabled: h,
|
1438
|
-
readOnly: m,
|
1438
|
+
disabled: h || r || m,
|
1439
1439
|
onFocus: y,
|
1440
1440
|
onBlur: o,
|
1441
1441
|
title: b,
|
@@ -1447,8 +1447,8 @@ function $n(e, t) {
|
|
1447
1447
|
};
|
1448
1448
|
}
|
1449
1449
|
function Or(e) {
|
1450
|
-
var
|
1451
|
-
const [t, r] =
|
1450
|
+
var S;
|
1451
|
+
const [t, r] = oe(!1), { inputRef: s, id: i, error: l } = ve(), d = Ee(null), c = s || d, u = e.isError || !!l, {
|
1452
1452
|
disabled: h,
|
1453
1453
|
title: m,
|
1454
1454
|
style: y,
|
@@ -1459,36 +1459,35 @@ function Or(e) {
|
|
1459
1459
|
LeftIcon: k,
|
1460
1460
|
value: v = null,
|
1461
1461
|
defaultValue: x = "",
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
placeholder: J,
|
1462
|
+
onFocus: I,
|
1463
|
+
onBlur: z,
|
1464
|
+
Spinner: R,
|
1465
|
+
name: V,
|
1466
|
+
placeholder: B,
|
1468
1467
|
onSelect: U,
|
1469
|
-
options:
|
1470
|
-
optionMaxHeight:
|
1471
|
-
closeOnSelect:
|
1472
|
-
...
|
1473
|
-
} = $n({ ...e, id: i, isError: u }, t), [
|
1474
|
-
function
|
1475
|
-
h || !(c != null && c.current) || (r(!0), c.current.focus());
|
1468
|
+
options: W,
|
1469
|
+
optionMaxHeight: G,
|
1470
|
+
closeOnSelect: F,
|
1471
|
+
...te
|
1472
|
+
} = $n({ ...e, id: i, isError: u }, t), [j, H] = oe(x);
|
1473
|
+
function M() {
|
1474
|
+
h || !(c != null && c.current) || t || (r(!0), c.current.focus());
|
1476
1475
|
}
|
1477
|
-
function
|
1478
|
-
t || (r(!0),
|
1476
|
+
function K(_) {
|
1477
|
+
t || (r(!0), I && I(_));
|
1479
1478
|
}
|
1480
|
-
function
|
1481
|
-
r(!1),
|
1479
|
+
function Q() {
|
1480
|
+
r(!1), z && c.current && c.current.blur();
|
1482
1481
|
}
|
1483
|
-
function
|
1484
|
-
const { label:
|
1485
|
-
|
1482
|
+
function $(_) {
|
1483
|
+
const { label: Z, value: le } = _;
|
1484
|
+
H(j !== le ? le : ""), U && U({ label: Z, value: le }), F && Q();
|
1486
1485
|
}
|
1487
|
-
const
|
1488
|
-
if (!t &&
|
1489
|
-
if (!t && !
|
1490
|
-
if (t &&
|
1491
|
-
if (t && !
|
1486
|
+
const q = typeof v == "string" ? v : j, ie = ((S = W.find((_) => _.value === q)) == null ? void 0 : S.label) || "", T = () => {
|
1487
|
+
if (!t && ie) return !0;
|
1488
|
+
if (!t && !ie) return !1;
|
1489
|
+
if (t && ie) return !0;
|
1490
|
+
if (t && !ie) return !1;
|
1492
1491
|
};
|
1493
1492
|
return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
1494
1493
|
/* @__PURE__ */ a.jsxs(
|
@@ -1496,19 +1495,19 @@ function Or(e) {
|
|
1496
1495
|
{
|
1497
1496
|
title: m,
|
1498
1497
|
style: y,
|
1499
|
-
onClick:
|
1500
|
-
className: `${o} placeholder_dark_${
|
1498
|
+
onClick: M,
|
1499
|
+
className: `${o} placeholder_dark_${T()}`,
|
1501
1500
|
children: [
|
1502
1501
|
b,
|
1503
1502
|
k && /* @__PURE__ */ a.jsx(k, { size: C, strokeWidth: 2.5 }),
|
1504
1503
|
/* @__PURE__ */ a.jsx(
|
1505
1504
|
"input",
|
1506
1505
|
{
|
1507
|
-
disabled: h
|
1506
|
+
disabled: h,
|
1508
1507
|
readOnly: !0,
|
1509
|
-
placeholder:
|
1510
|
-
onFocus:
|
1511
|
-
...
|
1508
|
+
placeholder: ie || B,
|
1509
|
+
onFocus: K,
|
1510
|
+
...te
|
1512
1511
|
}
|
1513
1512
|
),
|
1514
1513
|
/* @__PURE__ */ a.jsx(
|
@@ -1516,8 +1515,8 @@ function Or(e) {
|
|
1516
1515
|
{
|
1517
1516
|
type: "hidden",
|
1518
1517
|
ref: c,
|
1519
|
-
name:
|
1520
|
-
value:
|
1518
|
+
name: V,
|
1519
|
+
value: q || "",
|
1521
1520
|
readOnly: !0
|
1522
1521
|
}
|
1523
1522
|
),
|
@@ -1525,22 +1524,22 @@ function Or(e) {
|
|
1525
1524
|
"div",
|
1526
1525
|
{
|
1527
1526
|
className: "arkyn_select_content",
|
1528
|
-
style: { overflow: "auto", maxHeight:
|
1527
|
+
style: { overflow: "auto", maxHeight: G },
|
1529
1528
|
children: [
|
1530
|
-
|
1529
|
+
W.map(({ label: _, value: Z }) => /* @__PURE__ */ a.jsxs(
|
1531
1530
|
"div",
|
1532
1531
|
{
|
1533
|
-
onClick: () =>
|
1534
|
-
className:
|
1532
|
+
onClick: () => $({ label: _, value: Z }),
|
1533
|
+
className: q === Z ? "arkyn_select_option active" : "arkyn_select_option",
|
1535
1534
|
children: [
|
1536
|
-
|
1535
|
+
_,
|
1537
1536
|
" ",
|
1538
1537
|
/* @__PURE__ */ a.jsx(Rt, {})
|
1539
1538
|
]
|
1540
1539
|
},
|
1541
|
-
|
1540
|
+
Z
|
1542
1541
|
)),
|
1543
|
-
|
1542
|
+
W.length <= 0 && /* @__PURE__ */ a.jsx("p", { children: "Sem opções disponíveis" })
|
1544
1543
|
]
|
1545
1544
|
}
|
1546
1545
|
),
|
@@ -1552,11 +1551,11 @@ function Or(e) {
|
|
1552
1551
|
strokeWidth: 2.5
|
1553
1552
|
}
|
1554
1553
|
),
|
1555
|
-
w &&
|
1554
|
+
w && R
|
1556
1555
|
]
|
1557
1556
|
}
|
1558
1557
|
),
|
1559
|
-
t && /* @__PURE__ */ a.jsx("aside", { className: "arkyn_select_overlay", onClick:
|
1558
|
+
t && /* @__PURE__ */ a.jsx("aside", { className: "arkyn_select_overlay", onClick: Q })
|
1560
1559
|
] });
|
1561
1560
|
}
|
1562
1561
|
function zr(e) {
|
@@ -1571,15 +1570,15 @@ function zr(e) {
|
|
1571
1570
|
title: u,
|
1572
1571
|
style: h,
|
1573
1572
|
...m
|
1574
|
-
} = e, [y, o] =
|
1573
|
+
} = e, [y, o] = oe(!1), { inputRef: b, id: C, error: w } = ve(), k = Ee(null), v = b || k, I = e.isError || !!w ? "errored" : "", V = `arkyn_textarea ${t} ${r} ${i || l ? "opacity" : ""} ${I} ${y ? "focused" : ""} ${s}`;
|
1575
1574
|
function B() {
|
1576
1575
|
i || !(v != null && v.current) || (o(!0), v.current.focus());
|
1577
1576
|
}
|
1578
|
-
function
|
1579
|
-
o(!0), d && d(
|
1577
|
+
function U(G) {
|
1578
|
+
o(!0), d && d(G);
|
1580
1579
|
}
|
1581
|
-
function
|
1582
|
-
o(!1), c && c(
|
1580
|
+
function W(G) {
|
1581
|
+
o(!1), c && c(G);
|
1583
1582
|
}
|
1584
1583
|
return /* @__PURE__ */ a.jsx(
|
1585
1584
|
"section",
|
@@ -1587,7 +1586,7 @@ function zr(e) {
|
|
1587
1586
|
title: u,
|
1588
1587
|
style: h,
|
1589
1588
|
onClick: B,
|
1590
|
-
className:
|
1589
|
+
className: V,
|
1591
1590
|
children: /* @__PURE__ */ a.jsx(
|
1592
1591
|
"textarea",
|
1593
1592
|
{
|
@@ -1595,8 +1594,8 @@ function zr(e) {
|
|
1595
1594
|
disabled: i,
|
1596
1595
|
readOnly: l,
|
1597
1596
|
ref: v,
|
1598
|
-
onFocus:
|
1599
|
-
onBlur:
|
1597
|
+
onFocus: U,
|
1598
|
+
onBlur: W,
|
1600
1599
|
...m
|
1601
1600
|
}
|
1602
1601
|
)
|
@@ -1725,16 +1724,16 @@ function Mr(e) {
|
|
1725
1724
|
defaultActive: s,
|
1726
1725
|
className: i,
|
1727
1726
|
...l
|
1728
|
-
} = e, [d, c] =
|
1727
|
+
} = e, [d, c] = oe(s || ""), [u, h] = oe(!0), m = Ee(null), y = `arkyn_tab_container ${i || ""}`, [o, b] = oe({
|
1729
1728
|
width: "0px",
|
1730
1729
|
left: "0px",
|
1731
1730
|
transition: "none"
|
1732
1731
|
}), C = (k, v) => {
|
1733
|
-
const x = k.getBoundingClientRect(),
|
1732
|
+
const x = k.getBoundingClientRect(), I = m.current.getBoundingClientRect(), z = v ? void 0 : "none";
|
1734
1733
|
h(!1), b({
|
1735
|
-
transition:
|
1734
|
+
transition: z,
|
1736
1735
|
width: `${x.width}px`,
|
1737
|
-
left: `${x.left -
|
1736
|
+
left: `${x.left - I.left}px`
|
1738
1737
|
});
|
1739
1738
|
};
|
1740
1739
|
Ze(() => {
|
@@ -1747,19 +1746,10 @@ function Mr(e) {
|
|
1747
1746
|
const v = k.target;
|
1748
1747
|
v && (c(v.value), v.classList.add("active"), C(v, !0), r && r(v.value));
|
1749
1748
|
};
|
1750
|
-
return /* @__PURE__ */ a.jsxs(
|
1751
|
-
|
1752
|
-
{
|
1753
|
-
|
1754
|
-
onClick: w,
|
1755
|
-
className: y.trim(),
|
1756
|
-
...l,
|
1757
|
-
children: [
|
1758
|
-
/* @__PURE__ */ a.jsx(ut.Provider, { value: { handleTabClick: w, showInitialTab: u, value: d }, children: t }),
|
1759
|
-
/* @__PURE__ */ a.jsx("div", { className: "active-line", style: o })
|
1760
|
-
]
|
1761
|
-
}
|
1762
|
-
);
|
1749
|
+
return /* @__PURE__ */ a.jsxs("nav", { ref: m, className: y.trim(), ...l, children: [
|
1750
|
+
/* @__PURE__ */ a.jsx(ut.Provider, { value: { handleTabClick: w, showInitialTab: u, value: d }, children: t }),
|
1751
|
+
/* @__PURE__ */ a.jsx("div", { className: "active-line", style: o })
|
1752
|
+
] });
|
1763
1753
|
}
|
1764
1754
|
function Lr(e) {
|
1765
1755
|
const { children: t, className: r = "", onClick: s, ...i } = e, { value: l, showInitialTab: d, handleTabClick: c } = Tn(), u = l === i.value && l ? "active" : "", m = `arkyn_tab_button ${l === i.value && d ? "show_border_bottom" : ""} ${u} ${r}`;
|
@@ -1884,7 +1874,7 @@ function Ur(e) {
|
|
1884
1874
|
] });
|
1885
1875
|
}
|
1886
1876
|
function Hr(e) {
|
1887
|
-
const { children: t, button: r, closeOnClick: s, orientation: i = "bottom-left" } = e, [l, d] =
|
1877
|
+
const { children: t, button: r, closeOnClick: s, orientation: i = "bottom-left" } = e, [l, d] = oe(!1), c = `arkyn_popover ${i} ${l ? "show" : ""}`;
|
1888
1878
|
function u() {
|
1889
1879
|
l || d(!0);
|
1890
1880
|
}
|
@@ -2009,7 +1999,7 @@ function Gr(e) {
|
|
2009
1999
|
return t;
|
2010
2000
|
}
|
2011
2001
|
function qr(e) {
|
2012
|
-
const { children: t = !1 } = e, [r, s] =
|
2002
|
+
const { children: t = !1 } = e, [r, s] = oe([]);
|
2013
2003
|
function i(u) {
|
2014
2004
|
return !!r.some((h) => h.key === u);
|
2015
2005
|
}
|
@@ -2033,7 +2023,7 @@ function qr(e) {
|
|
2033
2023
|
);
|
2034
2024
|
}
|
2035
2025
|
function Zr(e) {
|
2036
|
-
const { children: t = !1 } = e, [r, s] =
|
2026
|
+
const { children: t = !1 } = e, [r, s] = oe([]);
|
2037
2027
|
function i(u) {
|
2038
2028
|
return !!r.some((h) => h.key === u);
|
2039
2029
|
}
|
@@ -2142,77 +2132,77 @@ function rr(...e) {
|
|
2142
2132
|
}
|
2143
2133
|
var ar = (e) => {
|
2144
2134
|
var t, r, s, i, l, d, c, u, h, m;
|
2145
|
-
let { invert: y, toast: o, unstyled: b, interacting: C, setHeights: w, visibleToasts: k, heights: v, index: x, toasts:
|
2146
|
-
var
|
2147
|
-
return (
|
2148
|
-
}, [o.closeButton, B]), Fe = p.useMemo(() => o.duration || j || Zn, [o.duration, j]), Ie = p.useRef(0), pe = p.useRef(0), He = p.useRef(0), we = p.useRef(null), [De, Be] =
|
2135
|
+
let { invert: y, toast: o, unstyled: b, interacting: C, setHeights: w, visibleToasts: k, heights: v, index: x, toasts: I, expanded: z, removeToast: R, defaultRichColors: V, closeButton: B, style: U, cancelButtonStyle: W, actionButtonStyle: G, className: F = "", descriptionClassName: te = "", duration: j, position: H, gap: M, loadingIcon: K, expandByDefault: Q, classNames: $, icons: q, closeButtonAriaLabel: ie = "Close toast", pauseWhenPageIsHidden: T, cn: S } = e, [_, Z] = p.useState(!1), [le, X] = p.useState(!1), [xe, me] = p.useState(!1), [J, re] = p.useState(!1), [Ne, Pe] = p.useState(0), [et, We] = p.useState(0), Se = p.useRef(null), he = p.useRef(null), Ye = x === 0, Ue = x + 1 <= k, ae = o.type, Ce = o.dismissible !== !1, tt = o.className || "", ze = o.descriptionClassName || "", Te = p.useMemo(() => v.findIndex((E) => E.toastId === o.id) || 0, [v, o.id]), nt = p.useMemo(() => {
|
2136
|
+
var E;
|
2137
|
+
return (E = o.closeButton) != null ? E : B;
|
2138
|
+
}, [o.closeButton, B]), Fe = p.useMemo(() => o.duration || j || Zn, [o.duration, j]), Ie = p.useRef(0), pe = p.useRef(0), He = p.useRef(0), we = p.useRef(null), [De, Be] = H.split("-"), Ke = p.useMemo(() => v.reduce((E, L, A) => A >= Te ? E : E + L.height, 0), [v, Te]), Xe = Vn(), rt = o.invert || y, Me = ae === "loading";
|
2149
2139
|
pe.current = p.useMemo(() => Te * M + Ke, [Te, Ke]), p.useEffect(() => {
|
2150
|
-
|
2140
|
+
Z(!0);
|
2151
2141
|
}, []), p.useLayoutEffect(() => {
|
2152
|
-
if (
|
2153
|
-
let
|
2154
|
-
|
2155
|
-
let
|
2156
|
-
|
2157
|
-
}, [
|
2142
|
+
if (!_) return;
|
2143
|
+
let E = he.current, L = E.style.height;
|
2144
|
+
E.style.height = "auto";
|
2145
|
+
let A = E.getBoundingClientRect().height;
|
2146
|
+
E.style.height = L, We(A), w((se) => se.find((ue) => ue.toastId === o.id) ? se.map((ue) => ue.toastId === o.id ? { ...ue, height: A } : ue) : [{ toastId: o.id, height: A, position: o.position }, ...se]);
|
2147
|
+
}, [_, o.title, o.description, w, o.id]);
|
2158
2148
|
let be = p.useCallback(() => {
|
2159
|
-
|
2160
|
-
|
2149
|
+
X(!0), Pe(pe.current), w((E) => E.filter((L) => L.toastId !== o.id)), setTimeout(() => {
|
2150
|
+
R(o);
|
2161
2151
|
}, nr);
|
2162
|
-
}, [o,
|
2152
|
+
}, [o, R, w, pe]);
|
2163
2153
|
p.useEffect(() => {
|
2164
|
-
if (o.promise &&
|
2165
|
-
let
|
2166
|
-
return
|
2154
|
+
if (o.promise && ae === "loading" || o.duration === 1 / 0 || o.type === "loading") return;
|
2155
|
+
let E, L = Fe;
|
2156
|
+
return z || C || T && Xe ? (() => {
|
2167
2157
|
if (He.current < Ie.current) {
|
2168
|
-
let
|
2169
|
-
|
2158
|
+
let A = (/* @__PURE__ */ new Date()).getTime() - Ie.current;
|
2159
|
+
L = L - A;
|
2170
2160
|
}
|
2171
2161
|
He.current = (/* @__PURE__ */ new Date()).getTime();
|
2172
|
-
})() :
|
2173
|
-
var
|
2174
|
-
(
|
2175
|
-
},
|
2176
|
-
}, [
|
2177
|
-
let
|
2178
|
-
if (
|
2179
|
-
let
|
2180
|
-
return We(
|
2162
|
+
})() : L !== 1 / 0 && (Ie.current = (/* @__PURE__ */ new Date()).getTime(), E = setTimeout(() => {
|
2163
|
+
var A;
|
2164
|
+
(A = o.onAutoClose) == null || A.call(o, o), be();
|
2165
|
+
}, L)), () => clearTimeout(E);
|
2166
|
+
}, [z, C, Q, o, Fe, be, o.promise, ae, T, Xe]), p.useEffect(() => {
|
2167
|
+
let E = he.current;
|
2168
|
+
if (E) {
|
2169
|
+
let L = E.getBoundingClientRect().height;
|
2170
|
+
return We(L), w((A) => [{ toastId: o.id, height: L, position: o.position }, ...A]), () => w((A) => A.filter((se) => se.toastId !== o.id));
|
2181
2171
|
}
|
2182
2172
|
}, [w, o.id]), p.useEffect(() => {
|
2183
2173
|
o.delete && be();
|
2184
2174
|
}, [be, o.delete]);
|
2185
2175
|
function at() {
|
2186
|
-
return
|
2176
|
+
return q != null && q.loading ? p.createElement("div", { className: "sonner-loader", "data-visible": ae === "loading" }, q.loading) : K ? p.createElement("div", { className: "sonner-loader", "data-visible": ae === "loading" }, K) : p.createElement(Dn, { visible: ae === "loading" });
|
2187
2177
|
}
|
2188
|
-
return p.createElement("li", { "aria-live": o.important ? "assertive" : "polite", "aria-atomic": "true", role: "status", tabIndex: 0, ref: he, className:
|
2189
|
-
Me || !Ce || (Se.current = /* @__PURE__ */ new Date(), Pe(pe.current),
|
2178
|
+
return p.createElement("li", { "aria-live": o.important ? "assertive" : "polite", "aria-atomic": "true", role: "status", tabIndex: 0, ref: he, className: S(F, tt, $ == null ? void 0 : $.toast, (t = o == null ? void 0 : o.classNames) == null ? void 0 : t.toast, $ == null ? void 0 : $.default, $ == null ? void 0 : $[ae], (r = o == null ? void 0 : o.classNames) == null ? void 0 : r[ae]), "data-sonner-toast": "", "data-rich-colors": (s = o.richColors) != null ? s : V, "data-styled": !(o.jsx || o.unstyled || b), "data-mounted": _, "data-promise": !!o.promise, "data-removed": le, "data-visible": Ue, "data-y-position": De, "data-x-position": Be, "data-index": x, "data-front": Ye, "data-swiping": xe, "data-dismissible": Ce, "data-type": ae, "data-invert": rt, "data-swipe-out": J, "data-expanded": !!(z || Q && _), style: { "--index": x, "--toasts-before": x, "--z-index": I.length - x, "--offset": `${le ? Ne : pe.current}px`, "--initial-height": Q ? "auto" : `${et}px`, ...U, ...o.style }, onPointerDown: (E) => {
|
2179
|
+
Me || !Ce || (Se.current = /* @__PURE__ */ new Date(), Pe(pe.current), E.target.setPointerCapture(E.pointerId), E.target.tagName !== "BUTTON" && (me(!0), we.current = { x: E.clientX, y: E.clientY }));
|
2190
2180
|
}, onPointerUp: () => {
|
2191
|
-
var
|
2192
|
-
if (
|
2181
|
+
var E, L, A, se;
|
2182
|
+
if (J || !Ce) return;
|
2193
2183
|
we.current = null;
|
2194
|
-
let ue = Number(((
|
2184
|
+
let ue = Number(((E = he.current) == null ? void 0 : E.style.getPropertyValue("--swipe-amount").replace("px", "")) || 0), _e = (/* @__PURE__ */ new Date()).getTime() - ((L = Se.current) == null ? void 0 : L.getTime()), Je = Math.abs(ue) / _e;
|
2195
2185
|
if (Math.abs(ue) >= tr || Je > 0.11) {
|
2196
|
-
Pe(pe.current), (
|
2186
|
+
Pe(pe.current), (A = o.onDismiss) == null || A.call(o, o), be(), re(!0);
|
2197
2187
|
return;
|
2198
2188
|
}
|
2199
|
-
(
|
2200
|
-
}, onPointerMove: (
|
2201
|
-
var
|
2189
|
+
(se = he.current) == null || se.style.setProperty("--swipe-amount", "0px"), me(!1);
|
2190
|
+
}, onPointerMove: (E) => {
|
2191
|
+
var L;
|
2202
2192
|
if (!we.current || !Ce) return;
|
2203
|
-
let
|
2204
|
-
Math.abs(ue) > _e ? (
|
2205
|
-
} }, nt && !o.jsx ? p.createElement("button", { "aria-label":
|
2193
|
+
let A = E.clientY - we.current.y, se = E.clientX - we.current.x, ue = (De === "top" ? Math.min : Math.max)(0, A), _e = E.pointerType === "touch" ? 10 : 2;
|
2194
|
+
Math.abs(ue) > _e ? (L = he.current) == null || L.style.setProperty("--swipe-amount", `${A}px`) : Math.abs(se) > _e && (we.current = null);
|
2195
|
+
} }, nt && !o.jsx ? p.createElement("button", { "aria-label": ie, "data-disabled": Me, "data-close-button": !0, onClick: Me || !Ce ? () => {
|
2206
2196
|
} : () => {
|
2207
|
-
var
|
2208
|
-
be(), (
|
2209
|
-
}, className:
|
2210
|
-
var
|
2211
|
-
qe(o.cancel) && Ce && ((
|
2212
|
-
}, className:
|
2213
|
-
var
|
2214
|
-
qe(o.action) && (
|
2215
|
-
}, className:
|
2197
|
+
var E;
|
2198
|
+
be(), (E = o.onDismiss) == null || E.call(o, o);
|
2199
|
+
}, className: S($ == null ? void 0 : $.closeButton, (i = o == null ? void 0 : o.classNames) == null ? void 0 : i.closeButton) }, p.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }, p.createElement("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), p.createElement("line", { x1: "6", y1: "6", x2: "18", y2: "18" }))) : null, o.jsx || p.isValidElement(o.title) ? o.jsx || o.title : p.createElement(p.Fragment, null, ae || o.icon || o.promise ? p.createElement("div", { "data-icon": "", className: S($ == null ? void 0 : $.icon, (l = o == null ? void 0 : o.classNames) == null ? void 0 : l.icon) }, o.promise || o.type === "loading" && !o.icon ? o.icon || at() : null, o.type !== "loading" ? o.icon || (q == null ? void 0 : q[ae]) || zn(ae) : null) : null, p.createElement("div", { "data-content": "", className: S($ == null ? void 0 : $.content, (d = o == null ? void 0 : o.classNames) == null ? void 0 : d.content) }, p.createElement("div", { "data-title": "", className: S($ == null ? void 0 : $.title, (c = o == null ? void 0 : o.classNames) == null ? void 0 : c.title) }, o.title), o.description ? p.createElement("div", { "data-description": "", className: S(te, ze, $ == null ? void 0 : $.description, (u = o == null ? void 0 : o.classNames) == null ? void 0 : u.description) }, o.description) : null), p.isValidElement(o.cancel) ? o.cancel : o.cancel && qe(o.cancel) ? p.createElement("button", { "data-button": !0, "data-cancel": !0, style: o.cancelButtonStyle || W, onClick: (E) => {
|
2200
|
+
var L, A;
|
2201
|
+
qe(o.cancel) && Ce && ((A = (L = o.cancel).onClick) == null || A.call(L, E), be());
|
2202
|
+
}, className: S($ == null ? void 0 : $.cancelButton, (h = o == null ? void 0 : o.classNames) == null ? void 0 : h.cancelButton) }, o.cancel.label) : null, p.isValidElement(o.action) ? o.action : o.action && qe(o.action) ? p.createElement("button", { "data-button": !0, "data-action": !0, style: o.actionButtonStyle || G, onClick: (E) => {
|
2203
|
+
var L, A;
|
2204
|
+
qe(o.action) && (E.defaultPrevented || ((A = (L = o.action).onClick) == null || A.call(L, E), be()));
|
2205
|
+
}, className: S($ == null ? void 0 : $.actionButton, (m = o == null ? void 0 : o.classNames) == null ? void 0 : m.actionButton) }, o.action.label) : null));
|
2216
2206
|
};
|
2217
2207
|
function jt() {
|
2218
2208
|
if (typeof window > "u" || typeof document > "u") return "ltr";
|
@@ -2220,20 +2210,20 @@ function jt() {
|
|
2220
2210
|
return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
|
2221
2211
|
}
|
2222
2212
|
var sr = (e) => {
|
2223
|
-
let { invert: t, position: r = "bottom-right", hotkey: s = ["altKey", "KeyT"], expand: i, closeButton: l, className: d, offset: c, theme: u = "light", richColors: h, duration: m, style: y, visibleToasts: o = Gn, toastOptions: b, dir: C = jt(), gap: w = er, loadingIcon: k, icons: v, containerAriaLabel: x = "Notifications", pauseWhenPageIsHidden:
|
2224
|
-
var
|
2225
|
-
(
|
2226
|
-
}, [
|
2227
|
-
return p.useEffect(() => fe.subscribe((
|
2228
|
-
if (
|
2229
|
-
|
2213
|
+
let { invert: t, position: r = "bottom-right", hotkey: s = ["altKey", "KeyT"], expand: i, closeButton: l, className: d, offset: c, theme: u = "light", richColors: h, duration: m, style: y, visibleToasts: o = Gn, toastOptions: b, dir: C = jt(), gap: w = er, loadingIcon: k, icons: v, containerAriaLabel: x = "Notifications", pauseWhenPageIsHidden: I, cn: z = rr } = e, [R, V] = p.useState([]), B = p.useMemo(() => Array.from(new Set([r].concat(R.filter((T) => T.position).map((T) => T.position)))), [R, r]), [U, W] = p.useState([]), [G, F] = p.useState(!1), [te, j] = p.useState(!1), [H, M] = p.useState(u !== "system" ? u : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), K = p.useRef(null), Q = s.join("+").replace(/Key/g, "").replace(/Digit/g, ""), $ = p.useRef(null), q = p.useRef(!1), ie = p.useCallback((T) => {
|
2214
|
+
var S;
|
2215
|
+
(S = R.find((_) => _.id === T.id)) != null && S.delete || fe.dismiss(T.id), V((_) => _.filter(({ id: Z }) => Z !== T.id));
|
2216
|
+
}, [R]);
|
2217
|
+
return p.useEffect(() => fe.subscribe((T) => {
|
2218
|
+
if (T.dismiss) {
|
2219
|
+
V((S) => S.map((_) => _.id === T.id ? { ..._, delete: !0 } : _));
|
2230
2220
|
return;
|
2231
2221
|
}
|
2232
2222
|
setTimeout(() => {
|
2233
2223
|
dn.flushSync(() => {
|
2234
|
-
|
2235
|
-
let
|
2236
|
-
return
|
2224
|
+
V((S) => {
|
2225
|
+
let _ = S.findIndex((Z) => Z.id === T.id);
|
2226
|
+
return _ !== -1 ? [...S.slice(0, _), { ...S[_], ...T }, ...S.slice(_ + 1)] : [T, ...S];
|
2237
2227
|
});
|
2238
2228
|
});
|
2239
2229
|
});
|
@@ -2242,35 +2232,35 @@ var sr = (e) => {
|
|
2242
2232
|
M(u);
|
2243
2233
|
return;
|
2244
2234
|
}
|
2245
|
-
u === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? M("dark") : M("light")), typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", ({ matches:
|
2246
|
-
M(
|
2235
|
+
u === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? M("dark") : M("light")), typeof window < "u" && window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", ({ matches: T }) => {
|
2236
|
+
M(T ? "dark" : "light");
|
2247
2237
|
});
|
2248
2238
|
}, [u]), p.useEffect(() => {
|
2249
|
-
|
2250
|
-
}, [
|
2251
|
-
let
|
2252
|
-
var
|
2253
|
-
s.every((
|
2239
|
+
R.length <= 1 && F(!1);
|
2240
|
+
}, [R]), p.useEffect(() => {
|
2241
|
+
let T = (S) => {
|
2242
|
+
var _, Z;
|
2243
|
+
s.every((le) => S[le] || S.code === le) && (F(!0), (_ = K.current) == null || _.focus()), S.code === "Escape" && (document.activeElement === K.current || (Z = K.current) != null && Z.contains(document.activeElement)) && F(!1);
|
2254
2244
|
};
|
2255
|
-
return document.addEventListener("keydown",
|
2245
|
+
return document.addEventListener("keydown", T), () => document.removeEventListener("keydown", T);
|
2256
2246
|
}, [s]), p.useEffect(() => {
|
2257
|
-
if (
|
2258
|
-
|
2247
|
+
if (K.current) return () => {
|
2248
|
+
$.current && ($.current.focus({ preventScroll: !0 }), $.current = null, q.current = !1);
|
2259
2249
|
};
|
2260
|
-
}, [
|
2261
|
-
var
|
2262
|
-
let [
|
2263
|
-
return p.createElement("ol", { key:
|
2264
|
-
|
2265
|
-
}, onFocus: (
|
2266
|
-
|
2250
|
+
}, [K.current]), R.length ? p.createElement("section", { "aria-label": `${x} ${Q}`, tabIndex: -1 }, B.map((T, S) => {
|
2251
|
+
var _;
|
2252
|
+
let [Z, le] = T.split("-");
|
2253
|
+
return p.createElement("ol", { key: T, dir: C === "auto" ? jt() : C, tabIndex: -1, ref: K, className: d, "data-sonner-toaster": !0, "data-theme": H, "data-y-position": Z, "data-x-position": le, style: { "--front-toast-height": `${((_ = U[0]) == null ? void 0 : _.height) || 0}px`, "--offset": typeof c == "number" ? `${c}px` : c || qn, "--width": `${Qn}px`, "--gap": `${w}px`, ...y }, onBlur: (X) => {
|
2254
|
+
q.current && !X.currentTarget.contains(X.relatedTarget) && (q.current = !1, $.current && ($.current.focus({ preventScroll: !0 }), $.current = null));
|
2255
|
+
}, onFocus: (X) => {
|
2256
|
+
X.target instanceof HTMLElement && X.target.dataset.dismissible === "false" || q.current || (q.current = !0, $.current = X.relatedTarget);
|
2267
2257
|
}, onMouseEnter: () => F(!0), onMouseMove: () => F(!0), onMouseLeave: () => {
|
2268
|
-
|
2269
|
-
}, onPointerDown: (
|
2270
|
-
|
2271
|
-
}, onPointerUp: () => j(!1) },
|
2272
|
-
var me,
|
2273
|
-
return p.createElement(ar, { key:
|
2258
|
+
te || F(!1);
|
2259
|
+
}, onPointerDown: (X) => {
|
2260
|
+
X.target instanceof HTMLElement && X.target.dataset.dismissible === "false" || j(!0);
|
2261
|
+
}, onPointerUp: () => j(!1) }, R.filter((X) => !X.position && S === 0 || X.position === T).map((X, xe) => {
|
2262
|
+
var me, J;
|
2263
|
+
return p.createElement(ar, { key: X.id, icons: v, index: xe, toast: X, defaultRichColors: h, duration: (me = b == null ? void 0 : b.duration) != null ? me : m, className: b == null ? void 0 : b.className, descriptionClassName: b == null ? void 0 : b.descriptionClassName, invert: t, visibleToasts: o, closeButton: (J = b == null ? void 0 : b.closeButton) != null ? J : l, interacting: te, position: T, style: b == null ? void 0 : b.style, unstyled: b == null ? void 0 : b.unstyled, classNames: b == null ? void 0 : b.classNames, cancelButtonStyle: b == null ? void 0 : b.cancelButtonStyle, actionButtonStyle: b == null ? void 0 : b.actionButtonStyle, removeToast: ie, toasts: R.filter((re) => re.position == X.position), heights: U.filter((re) => re.position == X.position), setHeights: W, expandByDefault: i, gap: w, loadingIcon: k, expanded: G, pauseWhenPageIsHidden: I, cn: z });
|
2274
2264
|
}));
|
2275
2265
|
})) : null;
|
2276
2266
|
};
|