blunt-ui 1.1.0 → 1.1.1
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/index.cjs +80 -57
- package/dist/index.js +852 -821
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import Mo, { useId as ro, useState as T, useContext as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as i, jsxs as S, Fragment as ur } from "react/jsx-runtime";
|
|
2
|
+
import s, { css as t, keyframes as oo, ThemeProvider as pr, createGlobalStyle as fr } from "styled-components";
|
|
3
|
+
import Mo, { useId as ro, useState as T, useContext as Wo, createContext as Do, forwardRef as Uo, createElement as Co, useRef as K, useCallback as X, useEffect as _, useLayoutEffect as gr, useMemo as Eo } from "react";
|
|
4
|
+
import { createPortal as yo } from "react-dom";
|
|
5
|
+
const po = (o, r, n) => t`
|
|
6
6
|
background: ${r};
|
|
7
7
|
color: ${n};
|
|
8
8
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
9
9
|
box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
|
|
10
|
-
`,
|
|
10
|
+
`, $r = s.span`
|
|
11
11
|
display: inline-flex;
|
|
12
12
|
align-items: center;
|
|
13
13
|
font-weight: ${({ theme: o }) => o.fontWeights.bold};
|
|
@@ -31,32 +31,32 @@ const uo = (o, r, n) => t`
|
|
|
31
31
|
})[o]}
|
|
32
32
|
|
|
33
33
|
${({ $variant: o, theme: r }) => r.brutalism ? {
|
|
34
|
-
primary:
|
|
34
|
+
primary: po(
|
|
35
35
|
r,
|
|
36
36
|
r.colors.primary[500],
|
|
37
37
|
r.colors.primary.contrast
|
|
38
38
|
),
|
|
39
|
-
neutral:
|
|
39
|
+
neutral: po(
|
|
40
40
|
r,
|
|
41
41
|
r.colors.neutral[200],
|
|
42
42
|
r.colors.neutral[900]
|
|
43
43
|
),
|
|
44
|
-
success:
|
|
44
|
+
success: po(
|
|
45
45
|
r,
|
|
46
46
|
r.colors.success[50],
|
|
47
47
|
r.colors.success[500]
|
|
48
48
|
),
|
|
49
|
-
error:
|
|
49
|
+
error: po(
|
|
50
50
|
r,
|
|
51
51
|
r.colors.error[50],
|
|
52
52
|
r.colors.error[500]
|
|
53
53
|
),
|
|
54
|
-
warning:
|
|
54
|
+
warning: po(
|
|
55
55
|
r,
|
|
56
56
|
r.colors.warning[50],
|
|
57
57
|
r.colors.warning[500]
|
|
58
58
|
),
|
|
59
|
-
info:
|
|
59
|
+
info: po(r, r.colors.info[50], r.colors.info[500])
|
|
60
60
|
}[o] : {
|
|
61
61
|
primary: t`
|
|
62
62
|
background: ${r.colors.primary[50]};
|
|
@@ -84,16 +84,16 @@ const uo = (o, r, n) => t`
|
|
|
84
84
|
`
|
|
85
85
|
}[o]}
|
|
86
86
|
`;
|
|
87
|
-
function
|
|
87
|
+
function br({
|
|
88
88
|
variant: o = "primary",
|
|
89
89
|
size: r = "md",
|
|
90
90
|
children: n,
|
|
91
|
-
...
|
|
91
|
+
...e
|
|
92
92
|
}) {
|
|
93
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ i($r, { $variant: o, $size: r, ...e, children: n });
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
const
|
|
95
|
+
br.displayName = "Badge";
|
|
96
|
+
const wo = (o, r, n) => t`
|
|
97
97
|
background-color: ${r};
|
|
98
98
|
color: ${n};
|
|
99
99
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
@@ -106,7 +106,7 @@ const ho = (o, r, n) => t`
|
|
|
106
106
|
transform: translate(2px, 2px);
|
|
107
107
|
box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`, xr = s.button`
|
|
110
110
|
display: inline-flex;
|
|
111
111
|
align-items: center;
|
|
112
112
|
justify-content: center;
|
|
@@ -114,6 +114,7 @@ const ho = (o, r, n) => t`
|
|
|
114
114
|
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
115
115
|
cursor: pointer;
|
|
116
116
|
text-decoration: none;
|
|
117
|
+
touch-action: manipulation;
|
|
117
118
|
|
|
118
119
|
&:focus-visible {
|
|
119
120
|
outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
|
|
@@ -126,17 +127,17 @@ const ho = (o, r, n) => t`
|
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
${({ $variant: o, theme: r }) => r.brutalism ? {
|
|
129
|
-
primary:
|
|
130
|
+
primary: wo(
|
|
130
131
|
r,
|
|
131
132
|
r.colors.primary[500],
|
|
132
133
|
r.colors.primary.contrast
|
|
133
134
|
),
|
|
134
|
-
secondary:
|
|
135
|
+
secondary: wo(
|
|
135
136
|
r,
|
|
136
137
|
r.colors.neutral[100],
|
|
137
138
|
r.colors.neutral[900]
|
|
138
139
|
),
|
|
139
|
-
outline:
|
|
140
|
+
outline: wo(
|
|
140
141
|
r,
|
|
141
142
|
r.colors.neutral[0],
|
|
142
143
|
r.colors.neutral[900]
|
|
@@ -183,24 +184,24 @@ const ho = (o, r, n) => t`
|
|
|
183
184
|
`
|
|
184
185
|
})[o]}
|
|
185
186
|
`;
|
|
186
|
-
function
|
|
187
|
+
function Io({
|
|
187
188
|
ref: o,
|
|
188
189
|
as: r,
|
|
189
190
|
href: n,
|
|
190
|
-
variant:
|
|
191
|
+
variant: e = "primary",
|
|
191
192
|
size: a = "md",
|
|
192
193
|
isLoading: l,
|
|
193
194
|
disabled: d,
|
|
194
195
|
children: p,
|
|
195
196
|
...u
|
|
196
197
|
}) {
|
|
197
|
-
return /* @__PURE__ */
|
|
198
|
-
|
|
198
|
+
return /* @__PURE__ */ i(
|
|
199
|
+
xr,
|
|
199
200
|
{
|
|
200
201
|
ref: o,
|
|
201
202
|
as: r ?? (n ? "a" : "button"),
|
|
202
203
|
href: n,
|
|
203
|
-
$variant:
|
|
204
|
+
$variant: e,
|
|
204
205
|
$size: a,
|
|
205
206
|
disabled: l || d,
|
|
206
207
|
...u,
|
|
@@ -208,19 +209,19 @@ function Co({
|
|
|
208
209
|
}
|
|
209
210
|
);
|
|
210
211
|
}
|
|
211
|
-
|
|
212
|
-
const
|
|
212
|
+
Io.displayName = "Button";
|
|
213
|
+
const yr = s.div`
|
|
213
214
|
display: flex;
|
|
214
215
|
flex-direction: column;
|
|
215
216
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
216
217
|
width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
|
|
217
|
-
`,
|
|
218
|
+
`, hr = s.label`
|
|
218
219
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
219
220
|
font-weight: ${({ theme: o }) => o.brutalism ? o.fontWeights.bold : o.fontWeights.medium};
|
|
220
|
-
`,
|
|
221
|
+
`, wr = s.span`
|
|
221
222
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
222
223
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
223
|
-
`,
|
|
224
|
+
`, mr = s.div`
|
|
224
225
|
display: flex;
|
|
225
226
|
align-items: center;
|
|
226
227
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -269,7 +270,7 @@ const br = i.div`
|
|
|
269
270
|
&:focus-within {
|
|
270
271
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
271
272
|
}
|
|
272
|
-
`,
|
|
273
|
+
`, vr = s.input`
|
|
273
274
|
flex: 1;
|
|
274
275
|
border: none;
|
|
275
276
|
outline: none;
|
|
@@ -280,11 +281,11 @@ const br = i.div`
|
|
|
280
281
|
cursor: not-allowed;
|
|
281
282
|
opacity: 0.6;
|
|
282
283
|
}
|
|
283
|
-
`, Lo =
|
|
284
|
+
`, Lo = s.div`
|
|
284
285
|
display: inline-flex;
|
|
285
286
|
align-items: center;
|
|
286
287
|
margin: 0 ${({ theme: o }) => o.spacing[1]};
|
|
287
|
-
`,
|
|
288
|
+
`, kr = s.button`
|
|
288
289
|
display: inline-flex;
|
|
289
290
|
align-items: center;
|
|
290
291
|
margin: 0 ${({ theme: o }) => o.spacing[1]};
|
|
@@ -298,36 +299,36 @@ const br = i.div`
|
|
|
298
299
|
opacity: 0.8;
|
|
299
300
|
}
|
|
300
301
|
`;
|
|
301
|
-
function
|
|
302
|
+
function Sr({
|
|
302
303
|
ref: o,
|
|
303
304
|
type: r = "text",
|
|
304
305
|
size: n = "md",
|
|
305
|
-
variant:
|
|
306
|
+
variant: e = "default",
|
|
306
307
|
label: a,
|
|
307
308
|
helperText: l,
|
|
308
309
|
error: d,
|
|
309
310
|
leftElement: p,
|
|
310
311
|
rightElement: u,
|
|
311
312
|
clearable: f,
|
|
312
|
-
onClear:
|
|
313
|
+
onClear: $,
|
|
313
314
|
fullWidth: m,
|
|
314
315
|
id: v,
|
|
315
|
-
value:
|
|
316
|
+
value: y,
|
|
316
317
|
defaultValue: k,
|
|
317
318
|
onChange: C,
|
|
318
319
|
...M
|
|
319
320
|
}) {
|
|
320
|
-
const P = ro(), L = v ?? P, x = `${L}-hint`, [I, w] = T(k ?? ""), b =
|
|
321
|
-
b || w(
|
|
321
|
+
const P = ro(), L = v ?? P, x = `${L}-hint`, [I, w] = T(k ?? ""), b = y !== void 0, z = b ? y : I, E = typeof d == "string" ? d : void 0, D = !!(l || d), N = (B) => {
|
|
322
|
+
b || w(B.target.value), C?.(B);
|
|
322
323
|
}, F = () => {
|
|
323
|
-
b || w(""),
|
|
324
|
+
b || w(""), $?.();
|
|
324
325
|
};
|
|
325
|
-
return /* @__PURE__ */ S(
|
|
326
|
-
a && /* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */ S(
|
|
328
|
-
p && /* @__PURE__ */
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
|
|
326
|
+
return /* @__PURE__ */ S(yr, { $fullWidth: m, children: [
|
|
327
|
+
a && /* @__PURE__ */ i(hr, { htmlFor: L, children: a }),
|
|
328
|
+
/* @__PURE__ */ S(mr, { $size: n, $variant: e, $error: !!d, children: [
|
|
329
|
+
p && /* @__PURE__ */ i(Lo, { children: p }),
|
|
330
|
+
/* @__PURE__ */ i(
|
|
331
|
+
vr,
|
|
331
332
|
{
|
|
332
333
|
id: L,
|
|
333
334
|
ref: o,
|
|
@@ -336,11 +337,11 @@ function vr({
|
|
|
336
337
|
onChange: N,
|
|
337
338
|
...M,
|
|
338
339
|
"aria-invalid": !!d,
|
|
339
|
-
"aria-describedby":
|
|
340
|
+
"aria-describedby": D ? x : void 0
|
|
340
341
|
}
|
|
341
342
|
),
|
|
342
|
-
f && z && /* @__PURE__ */
|
|
343
|
-
|
|
343
|
+
f && z && /* @__PURE__ */ i(
|
|
344
|
+
kr,
|
|
344
345
|
{
|
|
345
346
|
type: "button",
|
|
346
347
|
onClick: F,
|
|
@@ -348,24 +349,24 @@ function vr({
|
|
|
348
349
|
children: "✕"
|
|
349
350
|
}
|
|
350
351
|
),
|
|
351
|
-
u && /* @__PURE__ */
|
|
352
|
+
u && /* @__PURE__ */ i(Lo, { children: u })
|
|
352
353
|
] }),
|
|
353
|
-
|
|
354
|
+
D && /* @__PURE__ */ i(wr, { id: x, $error: !!d, children: E ?? l })
|
|
354
355
|
] });
|
|
355
356
|
}
|
|
356
|
-
|
|
357
|
-
const
|
|
357
|
+
Sr.displayName = "Input";
|
|
358
|
+
const zr = s.div`
|
|
358
359
|
display: flex;
|
|
359
360
|
flex-direction: column;
|
|
360
361
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
361
362
|
width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
|
|
362
|
-
`,
|
|
363
|
+
`, Cr = s.label`
|
|
363
364
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
364
365
|
font-weight: ${({ theme: o }) => o.brutalism ? o.fontWeights.bold : o.fontWeights.medium};
|
|
365
|
-
`,
|
|
366
|
+
`, Ir = s.span`
|
|
366
367
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
367
368
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
368
|
-
`,
|
|
369
|
+
`, Tr = s.div`
|
|
369
370
|
display: flex;
|
|
370
371
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
371
372
|
transition:
|
|
@@ -413,7 +414,7 @@ const kr = i.div`
|
|
|
413
414
|
&:focus-within {
|
|
414
415
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
415
416
|
}
|
|
416
|
-
`,
|
|
417
|
+
`, Wr = s.textarea`
|
|
417
418
|
flex: 1;
|
|
418
419
|
border: none;
|
|
419
420
|
outline: none;
|
|
@@ -427,52 +428,52 @@ const kr = i.div`
|
|
|
427
428
|
opacity: 0.6;
|
|
428
429
|
}
|
|
429
430
|
`;
|
|
430
|
-
function
|
|
431
|
+
function Dr({
|
|
431
432
|
ref: o,
|
|
432
433
|
size: r = "md",
|
|
433
434
|
variant: n = "default",
|
|
434
|
-
label:
|
|
435
|
+
label: e,
|
|
435
436
|
helperText: a,
|
|
436
437
|
error: l,
|
|
437
438
|
fullWidth: d,
|
|
438
439
|
id: p,
|
|
439
440
|
value: u,
|
|
440
441
|
defaultValue: f,
|
|
441
|
-
onChange:
|
|
442
|
+
onChange: $,
|
|
442
443
|
...m
|
|
443
444
|
}) {
|
|
444
|
-
const v = ro(),
|
|
445
|
-
return /* @__PURE__ */ S(
|
|
446
|
-
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
|
|
445
|
+
const v = ro(), y = p ?? v, k = `${y}-hint`, [C, M] = T(f ?? ""), P = u !== void 0, L = P ? u : C, x = typeof l == "string" ? l : void 0, I = !!(a || l);
|
|
446
|
+
return /* @__PURE__ */ S(zr, { $fullWidth: d, children: [
|
|
447
|
+
e && /* @__PURE__ */ i(Cr, { htmlFor: y, children: e }),
|
|
448
|
+
/* @__PURE__ */ i(Tr, { $size: r, $variant: n, $error: !!l, children: /* @__PURE__ */ i(
|
|
449
|
+
Wr,
|
|
449
450
|
{
|
|
450
|
-
id:
|
|
451
|
+
id: y,
|
|
451
452
|
ref: o,
|
|
452
453
|
value: L,
|
|
453
454
|
onChange: (b) => {
|
|
454
|
-
P || M(b.target.value),
|
|
455
|
+
P || M(b.target.value), $?.(b);
|
|
455
456
|
},
|
|
456
457
|
...m,
|
|
457
458
|
"aria-invalid": !!l,
|
|
458
459
|
"aria-describedby": I ? k : void 0
|
|
459
460
|
}
|
|
460
461
|
) }),
|
|
461
|
-
I && /* @__PURE__ */
|
|
462
|
+
I && /* @__PURE__ */ i(Ir, { id: k, $error: !!l, children: x ?? a })
|
|
462
463
|
] });
|
|
463
464
|
}
|
|
464
|
-
|
|
465
|
-
const
|
|
466
|
-
const
|
|
467
|
-
const
|
|
465
|
+
Dr.displayName = "Textarea";
|
|
466
|
+
const Yo = (...o) => o.filter((r, n, e) => !!r && r.trim() !== "" && e.indexOf(r) === n).join(" ").trim();
|
|
467
|
+
const Er = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
468
|
+
const Or = (o) => o.replace(
|
|
468
469
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
469
|
-
(r, n,
|
|
470
|
+
(r, n, e) => e ? e.toUpperCase() : n.toLowerCase()
|
|
470
471
|
);
|
|
471
472
|
const No = (o) => {
|
|
472
|
-
const r =
|
|
473
|
+
const r = Or(o);
|
|
473
474
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
474
475
|
};
|
|
475
|
-
var
|
|
476
|
+
var mo = {
|
|
476
477
|
xmlns: "http://www.w3.org/2000/svg",
|
|
477
478
|
width: 24,
|
|
478
479
|
height: 24,
|
|
@@ -483,96 +484,96 @@ var wo = {
|
|
|
483
484
|
strokeLinecap: "round",
|
|
484
485
|
strokeLinejoin: "round"
|
|
485
486
|
};
|
|
486
|
-
const
|
|
487
|
+
const Mr = (o) => {
|
|
487
488
|
for (const r in o)
|
|
488
489
|
if (r.startsWith("aria-") || r === "role" || r === "title")
|
|
489
490
|
return !0;
|
|
490
491
|
return !1;
|
|
491
|
-
},
|
|
492
|
-
({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth:
|
|
492
|
+
}, Lr = Do({}), Nr = () => Wo(Lr), Pr = Uo(
|
|
493
|
+
({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth: e, className: a = "", children: l, iconNode: d, ...p }, u) => {
|
|
493
494
|
const {
|
|
494
495
|
size: f = 24,
|
|
495
|
-
strokeWidth:
|
|
496
|
+
strokeWidth: $ = 2,
|
|
496
497
|
absoluteStrokeWidth: m = !1,
|
|
497
498
|
color: v = "currentColor",
|
|
498
|
-
className:
|
|
499
|
-
} =
|
|
500
|
-
return
|
|
499
|
+
className: y = ""
|
|
500
|
+
} = Nr() ?? {}, k = e ?? m ? Number(n ?? $) * 24 / Number(r ?? f) : n ?? $;
|
|
501
|
+
return Co(
|
|
501
502
|
"svg",
|
|
502
503
|
{
|
|
503
504
|
ref: u,
|
|
504
|
-
...
|
|
505
|
-
width: r ?? f ??
|
|
506
|
-
height: r ?? f ??
|
|
505
|
+
...mo,
|
|
506
|
+
width: r ?? f ?? mo.width,
|
|
507
|
+
height: r ?? f ?? mo.height,
|
|
507
508
|
stroke: o ?? v,
|
|
508
509
|
strokeWidth: k,
|
|
509
|
-
className:
|
|
510
|
-
...!l && !
|
|
510
|
+
className: Yo("lucide", y, a),
|
|
511
|
+
...!l && !Mr(p) && { "aria-hidden": "true" },
|
|
511
512
|
...p
|
|
512
513
|
},
|
|
513
514
|
[
|
|
514
|
-
...d.map(([C, M]) =>
|
|
515
|
+
...d.map(([C, M]) => Co(C, M)),
|
|
515
516
|
...Array.isArray(l) ? l : [l]
|
|
516
517
|
]
|
|
517
518
|
);
|
|
518
519
|
}
|
|
519
520
|
);
|
|
520
|
-
const
|
|
521
|
-
const n =
|
|
522
|
-
({ className:
|
|
521
|
+
const to = (o, r) => {
|
|
522
|
+
const n = Uo(
|
|
523
|
+
({ className: e, ...a }, l) => Co(Pr, {
|
|
523
524
|
ref: l,
|
|
524
525
|
iconNode: r,
|
|
525
|
-
className:
|
|
526
|
-
`lucide-${
|
|
526
|
+
className: Yo(
|
|
527
|
+
`lucide-${Er(No(o))}`,
|
|
527
528
|
`lucide-${o}`,
|
|
528
|
-
|
|
529
|
+
e
|
|
529
530
|
),
|
|
530
531
|
...a
|
|
531
532
|
})
|
|
532
533
|
);
|
|
533
534
|
return n.displayName = No(o), n;
|
|
534
535
|
};
|
|
535
|
-
const
|
|
536
|
+
const Rr = [
|
|
536
537
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
537
538
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
538
|
-
],
|
|
539
|
-
const
|
|
539
|
+
], Vr = to("arrow-down", Rr);
|
|
540
|
+
const Br = [
|
|
540
541
|
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
541
542
|
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
542
543
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
543
544
|
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
544
|
-
],
|
|
545
|
-
const
|
|
545
|
+
], Fr = to("arrow-up-down", Br);
|
|
546
|
+
const Ar = [
|
|
546
547
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
547
548
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
548
|
-
],
|
|
549
|
-
const
|
|
549
|
+
], _r = to("arrow-up", Ar);
|
|
550
|
+
const jr = [
|
|
550
551
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
551
552
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
552
553
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
553
554
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
554
|
-
],
|
|
555
|
-
const
|
|
556
|
-
const
|
|
557
|
-
const
|
|
558
|
-
const
|
|
555
|
+
], Hr = to("calendar", jr);
|
|
556
|
+
const Ur = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Ko = to("chevron-down", Ur);
|
|
557
|
+
const Yr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Kr = to("chevron-left", Yr);
|
|
558
|
+
const qr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Gr = to("chevron-right", qr);
|
|
559
|
+
const Xr = [
|
|
559
560
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
560
561
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
561
|
-
],
|
|
562
|
+
], ho = to("x", Xr), Jr = s.div`
|
|
562
563
|
display: inline-flex;
|
|
563
564
|
flex-direction: column;
|
|
564
565
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
565
566
|
width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
|
|
566
567
|
position: relative;
|
|
567
568
|
min-width: 0;
|
|
568
|
-
`,
|
|
569
|
+
`, Qr = s.div`
|
|
569
570
|
height: 0;
|
|
570
571
|
overflow: hidden;
|
|
571
572
|
visibility: hidden;
|
|
572
573
|
pointer-events: none;
|
|
573
574
|
display: flex;
|
|
574
575
|
flex-direction: column;
|
|
575
|
-
`,
|
|
576
|
+
`, Zr = s.button`
|
|
576
577
|
appearance: none;
|
|
577
578
|
width: 100%;
|
|
578
579
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -631,24 +632,24 @@ const qr = [
|
|
|
631
632
|
outline: none;
|
|
632
633
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
633
634
|
}
|
|
634
|
-
`,
|
|
635
|
+
`, vo = s.span`
|
|
635
636
|
flex: 1;
|
|
636
637
|
overflow: hidden;
|
|
637
638
|
white-space: nowrap;
|
|
638
639
|
text-overflow: ellipsis;
|
|
639
640
|
color: ${({ $placeholder: o, theme: r }) => o ? r.colors.neutral[400] : r.colors.neutral[900]};
|
|
640
|
-
`,
|
|
641
|
+
`, on = s.span`
|
|
641
642
|
display: flex;
|
|
642
643
|
align-items: center;
|
|
643
644
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
644
645
|
flex-shrink: 0;
|
|
645
646
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
646
|
-
`,
|
|
647
|
+
`, rn = s.span`
|
|
647
648
|
display: inline-flex;
|
|
648
649
|
align-items: center;
|
|
649
650
|
transition: transform 0.15s;
|
|
650
651
|
transform: ${({ $open: o }) => o ? "rotate(180deg)" : "rotate(0deg)"};
|
|
651
|
-
`,
|
|
652
|
+
`, nn = s.ul`
|
|
652
653
|
z-index: ${({ theme: o }) => o.zIndex.modal};
|
|
653
654
|
margin: 0;
|
|
654
655
|
padding: ${({ theme: o }) => o.spacing[1]} 0;
|
|
@@ -667,10 +668,10 @@ const qr = [
|
|
|
667
668
|
border: 1px solid ${o.colors.neutral[300]};
|
|
668
669
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
669
670
|
`}
|
|
670
|
-
`,
|
|
671
|
+
`, tn = s.div`
|
|
671
672
|
padding: ${({ theme: o }) => o.spacing[2]};
|
|
672
673
|
border-bottom: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
673
|
-
`,
|
|
674
|
+
`, en = s.input`
|
|
674
675
|
width: 100%;
|
|
675
676
|
border: 1px solid ${({ theme: o }) => o.colors.neutral[300]};
|
|
676
677
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -692,12 +693,12 @@ const qr = [
|
|
|
692
693
|
box-shadow: ${o.shadows.focusRing};
|
|
693
694
|
}
|
|
694
695
|
`}
|
|
695
|
-
`,
|
|
696
|
+
`, sn = s.li`
|
|
696
697
|
padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
|
|
697
698
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
698
699
|
color: ${({ theme: o }) => o.colors.neutral[400]};
|
|
699
700
|
list-style: none;
|
|
700
|
-
`,
|
|
701
|
+
`, an = s.li`
|
|
701
702
|
display: flex;
|
|
702
703
|
align-items: center;
|
|
703
704
|
padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
|
|
@@ -717,10 +718,10 @@ const qr = [
|
|
|
717
718
|
&:hover {
|
|
718
719
|
background-color: ${({ $disabled: o, $selected: r, theme: n }) => o ? "transparent" : r ? n.colors.primary[50] : n.colors.neutral[100]};
|
|
719
720
|
}
|
|
720
|
-
`,
|
|
721
|
+
`, ln = s.span`
|
|
721
722
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
722
723
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
723
|
-
`,
|
|
724
|
+
`, cn = s.button`
|
|
724
725
|
display: inline-flex;
|
|
725
726
|
align-items: center;
|
|
726
727
|
padding: 0;
|
|
@@ -739,110 +740,116 @@ const qr = [
|
|
|
739
740
|
border-radius: 2px;
|
|
740
741
|
}
|
|
741
742
|
`;
|
|
742
|
-
function
|
|
743
|
+
function qo({
|
|
743
744
|
options: o,
|
|
744
745
|
placeholder: r,
|
|
745
746
|
size: n = "md",
|
|
746
|
-
variant:
|
|
747
|
+
variant: e = "default",
|
|
747
748
|
error: a,
|
|
748
749
|
fullWidth: l,
|
|
749
750
|
clearable: d,
|
|
750
751
|
onClear: p,
|
|
751
752
|
id: u,
|
|
752
753
|
name: f,
|
|
753
|
-
value:
|
|
754
|
+
value: $,
|
|
754
755
|
defaultValue: m,
|
|
755
756
|
onChange: v,
|
|
756
|
-
disabled:
|
|
757
|
+
disabled: y,
|
|
757
758
|
searchable: k,
|
|
758
759
|
"aria-label": C,
|
|
759
760
|
"aria-describedby": M
|
|
760
761
|
}) {
|
|
761
|
-
const P = ro(), L = u ?? P, x = `${L}-list`, I = `${L}-search`, w = typeof a == "string" ? a : void 0, [b, z] = T(!1), [
|
|
762
|
+
const P = ro(), L = u ?? P, x = `${L}-list`, I = `${L}-search`, w = typeof a == "string" ? a : void 0, [b, z] = T(!1), [E, D] = T(-1), [N, F] = T(""), [B, V] = T({
|
|
762
763
|
top: 0,
|
|
764
|
+
bottom: 0,
|
|
763
765
|
left: 0,
|
|
764
|
-
width: 0
|
|
765
|
-
|
|
766
|
+
width: 0,
|
|
767
|
+
openUpward: !1
|
|
768
|
+
}), [q, ao] = T(
|
|
766
769
|
m ?? ""
|
|
767
|
-
), O =
|
|
770
|
+
), O = $ !== void 0, H = O ? $ : q, lo = K(null), G = K(null), no = K(null), J = K(null), co = o.find(
|
|
768
771
|
(c) => c.value === H
|
|
769
772
|
), j = k && N ? o.filter(
|
|
770
773
|
(c) => c.label.toLowerCase().includes(N.toLowerCase())
|
|
771
|
-
) : o,
|
|
772
|
-
if (!
|
|
774
|
+
) : o, U = X(() => {
|
|
775
|
+
if (!G.current)
|
|
773
776
|
return;
|
|
774
|
-
const c =
|
|
777
|
+
const c = G.current.getBoundingClientRect(), W = window.innerHeight, Y = no.current?.getBoundingClientRect().height ?? 200, io = W - c.bottom, $o = io < Y + 4 && c.top > io;
|
|
775
778
|
V({
|
|
776
779
|
top: c.bottom + 4,
|
|
780
|
+
bottom: W - c.top + 4,
|
|
777
781
|
left: c.left,
|
|
778
|
-
width: c.width
|
|
782
|
+
width: c.width,
|
|
783
|
+
openUpward: $o
|
|
779
784
|
});
|
|
780
785
|
}, []);
|
|
781
|
-
|
|
786
|
+
_(() => {
|
|
782
787
|
if (b)
|
|
783
|
-
return
|
|
784
|
-
window.removeEventListener("scroll",
|
|
788
|
+
return U(), window.addEventListener("scroll", U, !0), window.addEventListener("resize", U), () => {
|
|
789
|
+
window.removeEventListener("scroll", U, !0), window.removeEventListener("resize", U);
|
|
785
790
|
};
|
|
786
|
-
}, [b,
|
|
791
|
+
}, [b, U]), gr(() => {
|
|
792
|
+
b && U();
|
|
793
|
+
}, [b, U]), _(() => {
|
|
787
794
|
if (!b)
|
|
788
795
|
return;
|
|
789
|
-
const c = (
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
),
|
|
793
|
-
|
|
796
|
+
const c = (W) => {
|
|
797
|
+
const Y = lo.current?.contains(
|
|
798
|
+
W.target
|
|
799
|
+
), io = no.current?.contains(
|
|
800
|
+
W.target
|
|
794
801
|
);
|
|
795
|
-
!
|
|
802
|
+
!Y && !io && z(!1);
|
|
796
803
|
};
|
|
797
804
|
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
798
|
-
}, [b]),
|
|
799
|
-
b && k && setTimeout(() => J.current?.focus(), 0), b || (F(""),
|
|
800
|
-
}, [b, k]),
|
|
801
|
-
|
|
802
|
-
}, [N]),
|
|
803
|
-
if (
|
|
805
|
+
}, [b]), _(() => {
|
|
806
|
+
b && k && setTimeout(() => J.current?.focus(), 0), b || (F(""), D(-1));
|
|
807
|
+
}, [b, k]), _(() => {
|
|
808
|
+
D(-1);
|
|
809
|
+
}, [N]), _(() => {
|
|
810
|
+
if (E < 0)
|
|
804
811
|
return;
|
|
805
|
-
const c = document.getElementById(`${x}-option-${
|
|
812
|
+
const c = document.getElementById(`${x}-option-${E}`);
|
|
806
813
|
c && typeof c.scrollIntoView == "function" && c.scrollIntoView({ block: "nearest" });
|
|
807
|
-
}, [
|
|
808
|
-
function Q(c,
|
|
809
|
-
let
|
|
810
|
-
for (;
|
|
811
|
-
if (!j[
|
|
812
|
-
return
|
|
813
|
-
|
|
814
|
+
}, [E, x]);
|
|
815
|
+
function Q(c, W) {
|
|
816
|
+
let Y = c + W;
|
|
817
|
+
for (; Y >= 0 && Y < j.length; ) {
|
|
818
|
+
if (!j[Y].disabled)
|
|
819
|
+
return Y;
|
|
820
|
+
Y += W;
|
|
814
821
|
}
|
|
815
822
|
return c;
|
|
816
823
|
}
|
|
817
824
|
function Z() {
|
|
818
825
|
return j.findIndex((c) => !c.disabled);
|
|
819
826
|
}
|
|
820
|
-
function
|
|
827
|
+
function eo() {
|
|
821
828
|
for (let c = j.length - 1; c >= 0; c--)
|
|
822
829
|
if (!j[c].disabled)
|
|
823
830
|
return c;
|
|
824
831
|
return -1;
|
|
825
832
|
}
|
|
826
|
-
function
|
|
833
|
+
function so(c) {
|
|
827
834
|
if (c.disabled)
|
|
828
835
|
return;
|
|
829
|
-
O ||
|
|
830
|
-
const
|
|
836
|
+
O || ao(c.value);
|
|
837
|
+
const W = {
|
|
831
838
|
target: { name: f ?? "", value: c.value },
|
|
832
839
|
currentTarget: { name: f ?? "", value: c.value }
|
|
833
840
|
};
|
|
834
|
-
v?.(
|
|
841
|
+
v?.(W), z(!1), G.current?.focus();
|
|
835
842
|
}
|
|
836
|
-
function
|
|
837
|
-
c.stopPropagation(), O ||
|
|
843
|
+
function h(c) {
|
|
844
|
+
c.stopPropagation(), O || ao(""), v?.({
|
|
838
845
|
target: { name: f ?? "", value: "" },
|
|
839
846
|
currentTarget: { name: f ?? "", value: "" }
|
|
840
|
-
}), p?.(),
|
|
847
|
+
}), p?.(), G.current?.focus();
|
|
841
848
|
}
|
|
842
849
|
function A(c) {
|
|
843
|
-
if (!
|
|
850
|
+
if (!y) {
|
|
844
851
|
if (!b) {
|
|
845
|
-
["ArrowDown", "ArrowUp", "Enter", " "].includes(c.key) && (c.preventDefault(), z(!0), k ||
|
|
852
|
+
["ArrowDown", "ArrowUp", "Enter", " "].includes(c.key) && (c.preventDefault(), z(!0), k || D(Z()));
|
|
846
853
|
return;
|
|
847
854
|
}
|
|
848
855
|
if (c.key === "Escape") {
|
|
@@ -851,54 +858,54 @@ function ln({
|
|
|
851
858
|
}
|
|
852
859
|
if (!k) {
|
|
853
860
|
if (c.key === "ArrowDown") {
|
|
854
|
-
c.preventDefault(),
|
|
861
|
+
c.preventDefault(), D((W) => Q(W, 1));
|
|
855
862
|
return;
|
|
856
863
|
}
|
|
857
864
|
if (c.key === "ArrowUp") {
|
|
858
|
-
c.preventDefault(),
|
|
865
|
+
c.preventDefault(), D((W) => Q(W, -1));
|
|
859
866
|
return;
|
|
860
867
|
}
|
|
861
868
|
if (c.key === "Home") {
|
|
862
|
-
c.preventDefault(),
|
|
869
|
+
c.preventDefault(), D(Z());
|
|
863
870
|
return;
|
|
864
871
|
}
|
|
865
872
|
if (c.key === "End") {
|
|
866
|
-
c.preventDefault(),
|
|
873
|
+
c.preventDefault(), D(eo());
|
|
867
874
|
return;
|
|
868
875
|
}
|
|
869
|
-
(c.key === "Enter" || c.key === " ") &&
|
|
876
|
+
(c.key === "Enter" || c.key === " ") && E >= 0 && (c.preventDefault(), so(j[E]));
|
|
870
877
|
}
|
|
871
878
|
}
|
|
872
879
|
}
|
|
873
|
-
function
|
|
880
|
+
function uo(c) {
|
|
874
881
|
if (c.key === "Escape") {
|
|
875
|
-
z(!1),
|
|
882
|
+
z(!1), G.current?.focus();
|
|
876
883
|
return;
|
|
877
884
|
}
|
|
878
885
|
if (c.key === "ArrowDown") {
|
|
879
|
-
c.preventDefault(),
|
|
880
|
-
(
|
|
886
|
+
c.preventDefault(), D(
|
|
887
|
+
(W) => W < 0 ? Z() : Q(W, 1)
|
|
881
888
|
);
|
|
882
889
|
return;
|
|
883
890
|
}
|
|
884
891
|
if (c.key === "ArrowUp") {
|
|
885
|
-
c.preventDefault(),
|
|
886
|
-
(
|
|
892
|
+
c.preventDefault(), D(
|
|
893
|
+
(W) => W < 0 ? eo() : Q(W, -1)
|
|
887
894
|
);
|
|
888
895
|
return;
|
|
889
896
|
}
|
|
890
|
-
c.key === "Enter" &&
|
|
897
|
+
c.key === "Enter" && E >= 0 && (c.preventDefault(), so(j[E]));
|
|
891
898
|
}
|
|
892
|
-
const
|
|
893
|
-
return /* @__PURE__ */ S(
|
|
894
|
-
/* @__PURE__ */ S(
|
|
895
|
-
r && /* @__PURE__ */
|
|
896
|
-
o.map((c) => /* @__PURE__ */
|
|
899
|
+
const g = d && !!H && !y, R = E >= 0 ? `${x}-option-${E}` : void 0;
|
|
900
|
+
return /* @__PURE__ */ S(Jr, { ref: lo, $fullWidth: l, children: [
|
|
901
|
+
/* @__PURE__ */ S(Qr, { "aria-hidden": "true", children: [
|
|
902
|
+
r && /* @__PURE__ */ i(vo, { children: r }),
|
|
903
|
+
o.map((c) => /* @__PURE__ */ i(vo, { children: c.label }, c.value))
|
|
897
904
|
] }),
|
|
898
905
|
/* @__PURE__ */ S(
|
|
899
|
-
|
|
906
|
+
Zr,
|
|
900
907
|
{
|
|
901
|
-
ref:
|
|
908
|
+
ref: G,
|
|
902
909
|
id: L,
|
|
903
910
|
type: "button",
|
|
904
911
|
role: "combobox",
|
|
@@ -910,47 +917,48 @@ function ln({
|
|
|
910
917
|
"aria-label": C,
|
|
911
918
|
"aria-describedby": M,
|
|
912
919
|
$size: n,
|
|
913
|
-
$variant:
|
|
920
|
+
$variant: e,
|
|
914
921
|
$error: !!a,
|
|
915
|
-
$disabled:
|
|
922
|
+
$disabled: y,
|
|
916
923
|
$open: b,
|
|
917
|
-
disabled:
|
|
918
|
-
onClick: () => !
|
|
924
|
+
disabled: y,
|
|
925
|
+
onClick: () => !y && z((c) => !c),
|
|
919
926
|
onKeyDown: A,
|
|
920
927
|
children: [
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */ S(
|
|
923
|
-
|
|
924
|
-
|
|
928
|
+
/* @__PURE__ */ i(vo, { $placeholder: !co, children: co?.label ?? r ?? "Select..." }),
|
|
929
|
+
/* @__PURE__ */ S(on, { children: [
|
|
930
|
+
g && /* @__PURE__ */ i(
|
|
931
|
+
cn,
|
|
925
932
|
{
|
|
926
933
|
type: "button",
|
|
927
|
-
onClick:
|
|
934
|
+
onClick: h,
|
|
928
935
|
"aria-label": "Clear selection",
|
|
929
|
-
children: /* @__PURE__ */
|
|
936
|
+
children: /* @__PURE__ */ i(ho, { size: 14 })
|
|
930
937
|
}
|
|
931
938
|
),
|
|
932
|
-
/* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ i(rn, { $open: b, "aria-hidden": "true", children: /* @__PURE__ */ i(Ko, { size: 14 }) })
|
|
933
940
|
] })
|
|
934
941
|
]
|
|
935
942
|
}
|
|
936
943
|
),
|
|
937
|
-
b &&
|
|
944
|
+
b && yo(
|
|
938
945
|
/* @__PURE__ */ S(
|
|
939
|
-
|
|
946
|
+
nn,
|
|
940
947
|
{
|
|
941
|
-
ref:
|
|
948
|
+
ref: no,
|
|
942
949
|
id: x,
|
|
943
950
|
role: "listbox",
|
|
944
951
|
"aria-label": r ?? "Options",
|
|
945
952
|
style: {
|
|
946
953
|
position: "fixed",
|
|
947
|
-
top:
|
|
948
|
-
|
|
949
|
-
|
|
954
|
+
top: B.openUpward ? "auto" : B.top,
|
|
955
|
+
bottom: B.openUpward ? B.bottom : "auto",
|
|
956
|
+
left: B.left,
|
|
957
|
+
width: B.width
|
|
950
958
|
},
|
|
951
959
|
children: [
|
|
952
|
-
k && /* @__PURE__ */
|
|
953
|
-
|
|
960
|
+
k && /* @__PURE__ */ i(tn, { children: /* @__PURE__ */ i(
|
|
961
|
+
en,
|
|
954
962
|
{
|
|
955
963
|
ref: J,
|
|
956
964
|
id: I,
|
|
@@ -958,25 +966,25 @@ function ln({
|
|
|
958
966
|
placeholder: "Search...",
|
|
959
967
|
value: N,
|
|
960
968
|
onChange: (c) => F(c.target.value),
|
|
961
|
-
onKeyDown:
|
|
969
|
+
onKeyDown: uo,
|
|
962
970
|
"aria-label": "Search options",
|
|
963
971
|
"aria-controls": x,
|
|
964
972
|
"aria-activedescendant": R
|
|
965
973
|
}
|
|
966
974
|
) }),
|
|
967
|
-
j.length === 0 && /* @__PURE__ */
|
|
968
|
-
j.map((c,
|
|
969
|
-
|
|
975
|
+
j.length === 0 && /* @__PURE__ */ i(sn, { children: "No options found" }),
|
|
976
|
+
j.map((c, W) => /* @__PURE__ */ i(
|
|
977
|
+
an,
|
|
970
978
|
{
|
|
971
|
-
id: `${x}-option-${
|
|
979
|
+
id: `${x}-option-${W}`,
|
|
972
980
|
role: "option",
|
|
973
981
|
"aria-selected": c.value === H,
|
|
974
982
|
"aria-disabled": c.disabled,
|
|
975
983
|
$selected: c.value === H,
|
|
976
|
-
$focused:
|
|
984
|
+
$focused: W === E,
|
|
977
985
|
$disabled: c.disabled,
|
|
978
|
-
onClick: () =>
|
|
979
|
-
onMouseEnter: () => !c.disabled && W
|
|
986
|
+
onClick: () => so(c),
|
|
987
|
+
onMouseEnter: () => !c.disabled && D(W),
|
|
980
988
|
children: c.label
|
|
981
989
|
},
|
|
982
990
|
c.value
|
|
@@ -986,13 +994,13 @@ function ln({
|
|
|
986
994
|
),
|
|
987
995
|
document.body
|
|
988
996
|
),
|
|
989
|
-
w && /* @__PURE__ */
|
|
997
|
+
w && /* @__PURE__ */ i(ln, { $error: !0, children: w })
|
|
990
998
|
] });
|
|
991
999
|
}
|
|
992
|
-
|
|
993
|
-
const Po =
|
|
1000
|
+
qo.displayName = "Select";
|
|
1001
|
+
const Po = s.span`
|
|
994
1002
|
display: inline-block;
|
|
995
|
-
`,
|
|
1003
|
+
`, dn = s.span`
|
|
996
1004
|
display: inline-block;
|
|
997
1005
|
min-width: 60px;
|
|
998
1006
|
padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
|
|
@@ -1030,7 +1038,7 @@ const Po = i.span`
|
|
|
1030
1038
|
box-shadow: ${r.shadows.focusRing};
|
|
1031
1039
|
}
|
|
1032
1040
|
`}
|
|
1033
|
-
`,
|
|
1041
|
+
`, un = s.input`
|
|
1034
1042
|
display: inline-block;
|
|
1035
1043
|
min-width: 60px;
|
|
1036
1044
|
padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
|
|
@@ -1050,52 +1058,52 @@ const Po = i.span`
|
|
|
1050
1058
|
box-shadow: ${o.shadows.focusRing};
|
|
1051
1059
|
`}
|
|
1052
1060
|
`;
|
|
1053
|
-
function
|
|
1061
|
+
function pn({
|
|
1054
1062
|
value: o,
|
|
1055
1063
|
defaultValue: r = "",
|
|
1056
1064
|
onChange: n,
|
|
1057
|
-
onSubmit:
|
|
1065
|
+
onSubmit: e,
|
|
1058
1066
|
onCancel: a,
|
|
1059
1067
|
placeholder: l = "Click to edit",
|
|
1060
1068
|
disabled: d = !1
|
|
1061
1069
|
}) {
|
|
1062
|
-
const p = o !== void 0, [u, f] = T(r),
|
|
1063
|
-
d || (k(
|
|
1070
|
+
const p = o !== void 0, [u, f] = T(r), $ = p ? o : u, [m, v] = T(!1), [y, k] = T(""), C = K(null), M = () => {
|
|
1071
|
+
d || (k($), v(!0), setTimeout(() => {
|
|
1064
1072
|
C.current?.focus(), C.current?.select();
|
|
1065
1073
|
}, 0));
|
|
1066
1074
|
}, P = () => {
|
|
1067
|
-
p || f(
|
|
1075
|
+
p || f(y), n?.(y), e?.(y), v(!1);
|
|
1068
1076
|
}, L = () => {
|
|
1069
|
-
a?.(
|
|
1077
|
+
a?.($), v(!1);
|
|
1070
1078
|
}, x = (I) => {
|
|
1071
1079
|
I.key === "Enter" ? P() : I.key === "Escape" && L();
|
|
1072
1080
|
};
|
|
1073
|
-
return m ? /* @__PURE__ */
|
|
1074
|
-
|
|
1081
|
+
return m ? /* @__PURE__ */ i(Po, { children: /* @__PURE__ */ i(
|
|
1082
|
+
un,
|
|
1075
1083
|
{
|
|
1076
1084
|
ref: C,
|
|
1077
|
-
value:
|
|
1078
|
-
size: Math.max(
|
|
1085
|
+
value: y,
|
|
1086
|
+
size: Math.max(y.length, l.length, 10),
|
|
1079
1087
|
onChange: (I) => k(I.target.value),
|
|
1080
1088
|
onBlur: P,
|
|
1081
1089
|
onKeyDown: x,
|
|
1082
1090
|
"aria-label": "Edit value"
|
|
1083
1091
|
}
|
|
1084
|
-
) }) : /* @__PURE__ */
|
|
1085
|
-
|
|
1092
|
+
) }) : /* @__PURE__ */ i(Po, { children: /* @__PURE__ */ i(
|
|
1093
|
+
dn,
|
|
1086
1094
|
{
|
|
1087
1095
|
role: d ? void 0 : "button",
|
|
1088
1096
|
tabIndex: d ? void 0 : 0,
|
|
1089
1097
|
$disabled: d,
|
|
1090
|
-
$empty:
|
|
1098
|
+
$empty: !$,
|
|
1091
1099
|
onClick: M,
|
|
1092
1100
|
onKeyDown: (I) => I.key === "Enter" && M(),
|
|
1093
|
-
children:
|
|
1101
|
+
children: $ || l
|
|
1094
1102
|
}
|
|
1095
1103
|
) });
|
|
1096
1104
|
}
|
|
1097
|
-
|
|
1098
|
-
const
|
|
1105
|
+
pn.displayName = "Editable";
|
|
1106
|
+
const fn = s.a`
|
|
1099
1107
|
text-decoration: underline;
|
|
1100
1108
|
text-underline-offset: 2px;
|
|
1101
1109
|
transition: color 0.15s;
|
|
@@ -1121,55 +1129,55 @@ const pn = i.a`
|
|
|
1121
1129
|
`
|
|
1122
1130
|
})[o]}
|
|
1123
1131
|
`;
|
|
1124
|
-
function
|
|
1132
|
+
function Go({
|
|
1125
1133
|
variant: o = "default",
|
|
1126
1134
|
external: r,
|
|
1127
1135
|
children: n,
|
|
1128
|
-
...
|
|
1136
|
+
...e
|
|
1129
1137
|
}) {
|
|
1130
|
-
return /* @__PURE__ */
|
|
1131
|
-
|
|
1138
|
+
return /* @__PURE__ */ i(
|
|
1139
|
+
fn,
|
|
1132
1140
|
{
|
|
1133
1141
|
$variant: o,
|
|
1134
1142
|
...r && { target: "_blank", rel: "noreferrer" },
|
|
1135
|
-
...
|
|
1143
|
+
...e,
|
|
1136
1144
|
children: n
|
|
1137
1145
|
}
|
|
1138
1146
|
);
|
|
1139
1147
|
}
|
|
1140
|
-
|
|
1141
|
-
const
|
|
1148
|
+
Go.displayName = "Link";
|
|
1149
|
+
const gn = s.div`
|
|
1142
1150
|
display: flex;
|
|
1143
1151
|
flex-direction: column;
|
|
1144
1152
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1145
|
-
`, $n =
|
|
1153
|
+
`, $n = s.span`
|
|
1146
1154
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
1147
1155
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
1148
1156
|
font-weight: ${({ theme: o }) => o.brutalism ? o.fontWeights.bold : o.fontWeights.medium};
|
|
1149
|
-
`,
|
|
1157
|
+
`, bn = s.span`
|
|
1150
1158
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
1151
1159
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
1152
1160
|
`;
|
|
1153
|
-
function
|
|
1154
|
-
return /* @__PURE__ */ S(
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
n ? /* @__PURE__ */
|
|
1161
|
+
function xn({ label: o, value: r, href: n }) {
|
|
1162
|
+
return /* @__PURE__ */ S(gn, { children: [
|
|
1163
|
+
/* @__PURE__ */ i($n, { children: o }),
|
|
1164
|
+
n ? /* @__PURE__ */ i(Go, { href: n, external: !0, children: r }) : /* @__PURE__ */ i(bn, { children: r ?? "—" })
|
|
1157
1165
|
] });
|
|
1158
1166
|
}
|
|
1159
|
-
|
|
1160
|
-
const
|
|
1167
|
+
xn.displayName = "Field";
|
|
1168
|
+
const yn = oo`
|
|
1161
1169
|
from { opacity: 0; }
|
|
1162
1170
|
to { opacity: 1; }
|
|
1163
|
-
`,
|
|
1171
|
+
`, hn = oo`
|
|
1164
1172
|
from { opacity: 1; }
|
|
1165
1173
|
to { opacity: 0; }
|
|
1166
|
-
`,
|
|
1174
|
+
`, wn = oo`
|
|
1167
1175
|
from { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
1168
1176
|
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
1169
|
-
`,
|
|
1177
|
+
`, mn = oo`
|
|
1170
1178
|
from { opacity: 1; transform: scale(1) translateY(0); }
|
|
1171
1179
|
to { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
1172
|
-
`,
|
|
1180
|
+
`, vn = s.div`
|
|
1173
1181
|
position: fixed;
|
|
1174
1182
|
inset: 0;
|
|
1175
1183
|
background-color: rgba(0, 0, 0, 0.5);
|
|
@@ -1177,9 +1185,9 @@ const xn = oo`
|
|
|
1177
1185
|
align-items: center;
|
|
1178
1186
|
justify-content: center;
|
|
1179
1187
|
z-index: ${({ theme: o }) => o.zIndex.modal};
|
|
1180
|
-
animation: ${({ $closing: o }) => o ?
|
|
1188
|
+
animation: ${({ $closing: o }) => o ? hn : yn} 0.15s ease
|
|
1181
1189
|
forwards;
|
|
1182
|
-
`,
|
|
1190
|
+
`, kn = s.div`
|
|
1183
1191
|
position: relative;
|
|
1184
1192
|
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
1185
1193
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -1188,7 +1196,7 @@ const xn = oo`
|
|
|
1188
1196
|
display: flex;
|
|
1189
1197
|
flex-direction: column;
|
|
1190
1198
|
max-height: 90vh;
|
|
1191
|
-
animation: ${({ $closing: o }) => o ?
|
|
1199
|
+
animation: ${({ $closing: o }) => o ? mn : wn} 0.15s ease
|
|
1192
1200
|
forwards;
|
|
1193
1201
|
|
|
1194
1202
|
${({ $size: o }) => o === "sm" && t`
|
|
@@ -1206,19 +1214,19 @@ const xn = oo`
|
|
|
1206
1214
|
max-height: 100vh;
|
|
1207
1215
|
border-radius: 0;
|
|
1208
1216
|
`}
|
|
1209
|
-
`,
|
|
1217
|
+
`, Sn = s.div`
|
|
1210
1218
|
display: flex;
|
|
1211
1219
|
align-items: center;
|
|
1212
1220
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1213
1221
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
1214
1222
|
border-bottom: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
1215
1223
|
flex-shrink: 0;
|
|
1216
|
-
`,
|
|
1224
|
+
`, zn = s.h2`
|
|
1217
1225
|
flex: 1;
|
|
1218
1226
|
font-size: ${({ theme: o }) => o.fontSizes.lg};
|
|
1219
1227
|
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
1220
1228
|
margin: 0;
|
|
1221
|
-
`,
|
|
1229
|
+
`, Cn = s.button`
|
|
1222
1230
|
display: inline-flex;
|
|
1223
1231
|
align-items: center;
|
|
1224
1232
|
justify-content: center;
|
|
@@ -1243,11 +1251,11 @@ const xn = oo`
|
|
|
1243
1251
|
outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
|
|
1244
1252
|
outline-offset: 2px;
|
|
1245
1253
|
}
|
|
1246
|
-
`,
|
|
1254
|
+
`, In = s.div`
|
|
1247
1255
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
1248
1256
|
overflow-y: auto;
|
|
1249
1257
|
flex: 1;
|
|
1250
|
-
`,
|
|
1258
|
+
`, Tn = s.div`
|
|
1251
1259
|
display: flex;
|
|
1252
1260
|
align-items: center;
|
|
1253
1261
|
justify-content: flex-end;
|
|
@@ -1255,7 +1263,7 @@ const xn = oo`
|
|
|
1255
1263
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
1256
1264
|
border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
1257
1265
|
flex-shrink: 0;
|
|
1258
|
-
`,
|
|
1266
|
+
`, Wn = [
|
|
1259
1267
|
"button:not([disabled])",
|
|
1260
1268
|
"input:not([disabled])",
|
|
1261
1269
|
"select:not([disabled])",
|
|
@@ -1265,14 +1273,14 @@ const xn = oo`
|
|
|
1265
1273
|
].join(", ");
|
|
1266
1274
|
function Ro(o) {
|
|
1267
1275
|
return Array.from(
|
|
1268
|
-
o.querySelectorAll(
|
|
1276
|
+
o.querySelectorAll(Wn)
|
|
1269
1277
|
);
|
|
1270
1278
|
}
|
|
1271
|
-
function
|
|
1279
|
+
function Xo({
|
|
1272
1280
|
open: o,
|
|
1273
1281
|
onClose: r,
|
|
1274
1282
|
title: n,
|
|
1275
|
-
children:
|
|
1283
|
+
children: e,
|
|
1276
1284
|
footer: a,
|
|
1277
1285
|
size: l = "md",
|
|
1278
1286
|
closeOnBackdrop: d = !0,
|
|
@@ -1280,10 +1288,10 @@ function Go({
|
|
|
1280
1288
|
ariaLabelledBy: u,
|
|
1281
1289
|
ariaDescribedBy: f
|
|
1282
1290
|
}) {
|
|
1283
|
-
const
|
|
1291
|
+
const $ = K(null), m = K(null), v = K(r);
|
|
1284
1292
|
v.current = r;
|
|
1285
|
-
const
|
|
1286
|
-
return
|
|
1293
|
+
const y = ro(), k = u ?? (n ? y : void 0), [C, M] = T(o), [P, L] = T(!1);
|
|
1294
|
+
return _(() => {
|
|
1287
1295
|
if (o)
|
|
1288
1296
|
M(!0), L(!1);
|
|
1289
1297
|
else if (C) {
|
|
@@ -1293,17 +1301,17 @@ function Go({
|
|
|
1293
1301
|
}, 150);
|
|
1294
1302
|
return () => clearTimeout(x);
|
|
1295
1303
|
}
|
|
1296
|
-
}, [o, C]),
|
|
1304
|
+
}, [o, C]), _(() => {
|
|
1297
1305
|
if (!o)
|
|
1298
1306
|
return;
|
|
1299
1307
|
const x = document.body.style.overflow;
|
|
1300
1308
|
return document.body.style.overflow = "hidden", () => {
|
|
1301
1309
|
document.body.style.overflow = x;
|
|
1302
1310
|
};
|
|
1303
|
-
}, [o]),
|
|
1304
|
-
if (!o ||
|
|
1311
|
+
}, [o]), _(() => {
|
|
1312
|
+
if (!o || !$.current)
|
|
1305
1313
|
return;
|
|
1306
|
-
const x =
|
|
1314
|
+
const x = $.current, I = document.activeElement;
|
|
1307
1315
|
(Ro(x)[0] ?? x).focus();
|
|
1308
1316
|
const b = (z) => {
|
|
1309
1317
|
if (z.key === "Escape" && p) {
|
|
@@ -1312,20 +1320,20 @@ function Go({
|
|
|
1312
1320
|
}
|
|
1313
1321
|
if (z.key !== "Tab")
|
|
1314
1322
|
return;
|
|
1315
|
-
const
|
|
1316
|
-
if (
|
|
1323
|
+
const E = Ro(x);
|
|
1324
|
+
if (E.length === 0) {
|
|
1317
1325
|
z.preventDefault();
|
|
1318
1326
|
return;
|
|
1319
1327
|
}
|
|
1320
|
-
const
|
|
1321
|
-
z.shiftKey ? document.activeElement ===
|
|
1328
|
+
const D = E[0], N = E[E.length - 1];
|
|
1329
|
+
z.shiftKey ? document.activeElement === D && (z.preventDefault(), N.focus()) : document.activeElement === N && (z.preventDefault(), D.focus());
|
|
1322
1330
|
};
|
|
1323
1331
|
return document.addEventListener("keydown", b), () => {
|
|
1324
1332
|
document.removeEventListener("keydown", b), I?.focus();
|
|
1325
1333
|
};
|
|
1326
|
-
}, [o, p, C]), C ?
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
|
|
1334
|
+
}, [o, p, C]), C ? yo(
|
|
1335
|
+
/* @__PURE__ */ i(
|
|
1336
|
+
vn,
|
|
1329
1337
|
{
|
|
1330
1338
|
$closing: P,
|
|
1331
1339
|
onMouseDown: (x) => {
|
|
@@ -1335,9 +1343,9 @@ function Go({
|
|
|
1335
1343
|
d && m.current === x.currentTarget && r();
|
|
1336
1344
|
},
|
|
1337
1345
|
children: /* @__PURE__ */ S(
|
|
1338
|
-
|
|
1346
|
+
kn,
|
|
1339
1347
|
{
|
|
1340
|
-
ref:
|
|
1348
|
+
ref: $,
|
|
1341
1349
|
role: "dialog",
|
|
1342
1350
|
"aria-modal": "true",
|
|
1343
1351
|
"aria-labelledby": k,
|
|
@@ -1347,12 +1355,12 @@ function Go({
|
|
|
1347
1355
|
tabIndex: -1,
|
|
1348
1356
|
onClick: (x) => x.stopPropagation(),
|
|
1349
1357
|
children: [
|
|
1350
|
-
/* @__PURE__ */ S(
|
|
1351
|
-
n && /* @__PURE__ */
|
|
1352
|
-
/* @__PURE__ */
|
|
1358
|
+
/* @__PURE__ */ S(Sn, { children: [
|
|
1359
|
+
n && /* @__PURE__ */ i(zn, { id: y, children: n }),
|
|
1360
|
+
/* @__PURE__ */ i(Cn, { onClick: r, "aria-label": "Close modal", children: "×" })
|
|
1353
1361
|
] }),
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
a && /* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ i(In, { children: e }),
|
|
1363
|
+
a && /* @__PURE__ */ i(Tn, { children: a })
|
|
1356
1364
|
]
|
|
1357
1365
|
}
|
|
1358
1366
|
)
|
|
@@ -1361,40 +1369,40 @@ function Go({
|
|
|
1361
1369
|
document.body
|
|
1362
1370
|
) : null;
|
|
1363
1371
|
}
|
|
1364
|
-
|
|
1365
|
-
const
|
|
1372
|
+
Xo.displayName = "Modal";
|
|
1373
|
+
const Jo = oo`
|
|
1366
1374
|
from { opacity: 0; transform: translateY(12px); }
|
|
1367
1375
|
to { opacity: 1; transform: translateY(0); }
|
|
1368
|
-
`,
|
|
1376
|
+
`, Qo = oo`
|
|
1369
1377
|
from { opacity: 0; transform: translateY(-12px); }
|
|
1370
1378
|
to { opacity: 1; transform: translateY(0); }
|
|
1371
|
-
`,
|
|
1379
|
+
`, Zo = oo`
|
|
1372
1380
|
from { opacity: 1; }
|
|
1373
1381
|
to { opacity: 0; }
|
|
1374
|
-
`,
|
|
1382
|
+
`, bo = (o, r, n) => t`
|
|
1375
1383
|
background: ${r};
|
|
1376
1384
|
border: ${o.brutalism.borderWidth} solid ${n};
|
|
1377
1385
|
box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
|
|
1378
1386
|
0 ${n};
|
|
1379
1387
|
`;
|
|
1380
|
-
function
|
|
1388
|
+
function or(o, r) {
|
|
1381
1389
|
return r.brutalism ? {
|
|
1382
|
-
success:
|
|
1390
|
+
success: bo(
|
|
1383
1391
|
r,
|
|
1384
1392
|
r.colors.success[50],
|
|
1385
1393
|
r.colors.success[500]
|
|
1386
1394
|
),
|
|
1387
|
-
error:
|
|
1395
|
+
error: bo(
|
|
1388
1396
|
r,
|
|
1389
1397
|
r.colors.error[50],
|
|
1390
1398
|
r.colors.error[500]
|
|
1391
1399
|
),
|
|
1392
|
-
warning:
|
|
1400
|
+
warning: bo(
|
|
1393
1401
|
r,
|
|
1394
1402
|
r.colors.warning[50],
|
|
1395
1403
|
r.colors.warning[500]
|
|
1396
1404
|
),
|
|
1397
|
-
info:
|
|
1405
|
+
info: bo(r, r.colors.info[50], r.colors.info[500])
|
|
1398
1406
|
}[o] : {
|
|
1399
1407
|
success: t`
|
|
1400
1408
|
background: ${r.colors.success[50]};
|
|
@@ -1418,7 +1426,7 @@ function Zo(o, r) {
|
|
|
1418
1426
|
`
|
|
1419
1427
|
}[o];
|
|
1420
1428
|
}
|
|
1421
|
-
const
|
|
1429
|
+
const rr = t`
|
|
1422
1430
|
display: flex;
|
|
1423
1431
|
align-items: center;
|
|
1424
1432
|
gap: ${({ theme: o }) => o.spacing[3]};
|
|
@@ -1426,7 +1434,13 @@ const or = t`
|
|
|
1426
1434
|
max-width: 400px;
|
|
1427
1435
|
padding: ${({ theme: o }) => `${o.spacing[3]} ${o.spacing[4]}`};
|
|
1428
1436
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
1429
|
-
|
|
1437
|
+
|
|
1438
|
+
@media (max-width: 640px) {
|
|
1439
|
+
min-width: unset;
|
|
1440
|
+
max-width: unset;
|
|
1441
|
+
width: 100%;
|
|
1442
|
+
}
|
|
1443
|
+
`, Dn = {
|
|
1430
1444
|
"bottom-right": t`
|
|
1431
1445
|
bottom: 24px;
|
|
1432
1446
|
right: 24px;
|
|
@@ -1443,35 +1457,35 @@ const or = t`
|
|
|
1443
1457
|
top: 24px;
|
|
1444
1458
|
left: 24px;
|
|
1445
1459
|
`
|
|
1446
|
-
},
|
|
1460
|
+
}, En = s.div`
|
|
1447
1461
|
position: fixed;
|
|
1448
1462
|
z-index: ${({ theme: o }) => o.zIndex.toast};
|
|
1449
|
-
${
|
|
1463
|
+
${rr}
|
|
1450
1464
|
|
|
1451
1465
|
animation: ${({ $closing: o, $position: r }) => o ? t`
|
|
1452
|
-
${
|
|
1466
|
+
${Zo} 0.2s ease forwards
|
|
1453
1467
|
` : r.startsWith("top") ? t`
|
|
1454
|
-
${
|
|
1468
|
+
${Qo} 0.2s ease forwards
|
|
1455
1469
|
` : t`
|
|
1456
|
-
${
|
|
1470
|
+
${Jo} 0.2s ease forwards
|
|
1457
1471
|
`};
|
|
1458
1472
|
|
|
1459
|
-
${({ $position: o }) =>
|
|
1460
|
-
${({ $variant: o, theme: r }) =>
|
|
1461
|
-
`,
|
|
1462
|
-
${
|
|
1473
|
+
${({ $position: o }) => Dn[o]}
|
|
1474
|
+
${({ $variant: o, theme: r }) => or(o, r)}
|
|
1475
|
+
`, On = s.div`
|
|
1476
|
+
${rr}
|
|
1463
1477
|
pointer-events: all;
|
|
1464
1478
|
|
|
1465
1479
|
animation: ${({ $closing: o, $isTop: r }) => o ? t`
|
|
1466
|
-
${
|
|
1480
|
+
${Zo} 0.2s ease forwards
|
|
1467
1481
|
` : r ? t`
|
|
1468
|
-
${
|
|
1482
|
+
${Qo} 0.2s ease forwards
|
|
1469
1483
|
` : t`
|
|
1470
|
-
${
|
|
1484
|
+
${Jo} 0.2s ease forwards
|
|
1471
1485
|
`};
|
|
1472
1486
|
|
|
1473
|
-
${({ $variant: o, theme: r }) =>
|
|
1474
|
-
`,
|
|
1487
|
+
${({ $variant: o, theme: r }) => or(o, r)}
|
|
1488
|
+
`, Mn = s.div`
|
|
1475
1489
|
position: fixed;
|
|
1476
1490
|
z-index: ${({ theme: o }) => o.zIndex.toast};
|
|
1477
1491
|
display: flex;
|
|
@@ -1501,14 +1515,22 @@ const or = t`
|
|
|
1501
1515
|
align-items: flex-start;
|
|
1502
1516
|
`
|
|
1503
1517
|
})[o]}
|
|
1504
|
-
|
|
1518
|
+
|
|
1519
|
+
@media (max-width: 640px) {
|
|
1520
|
+
top: ${({ theme: o }) => o.spacing[4]};
|
|
1521
|
+
left: ${({ theme: o }) => o.spacing[3]};
|
|
1522
|
+
right: ${({ theme: o }) => o.spacing[3]};
|
|
1523
|
+
bottom: auto;
|
|
1524
|
+
align-items: stretch;
|
|
1525
|
+
}
|
|
1526
|
+
`, nr = s.p`
|
|
1505
1527
|
flex: 1;
|
|
1506
1528
|
margin: 0;
|
|
1507
1529
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1508
1530
|
font-weight: ${({ theme: o }) => o.brutalism ? o.fontWeights.semibold : o.fontWeights.normal};
|
|
1509
1531
|
line-height: 1.5;
|
|
1510
1532
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
1511
|
-
`,
|
|
1533
|
+
`, tr = s.button`
|
|
1512
1534
|
flex-shrink: 0;
|
|
1513
1535
|
display: inline-flex;
|
|
1514
1536
|
align-items: center;
|
|
@@ -1531,67 +1553,67 @@ const or = t`
|
|
|
1531
1553
|
outline-offset: 2px;
|
|
1532
1554
|
}
|
|
1533
1555
|
`;
|
|
1534
|
-
function
|
|
1556
|
+
function Ln({
|
|
1535
1557
|
open: o,
|
|
1536
1558
|
onClose: r,
|
|
1537
1559
|
message: n,
|
|
1538
|
-
variant:
|
|
1560
|
+
variant: e = "info",
|
|
1539
1561
|
duration: a = 4e3,
|
|
1540
1562
|
position: l = "bottom-right"
|
|
1541
1563
|
}) {
|
|
1542
1564
|
const [d, p] = T(o), [u, f] = T(!1);
|
|
1543
|
-
return
|
|
1565
|
+
return _(() => {
|
|
1544
1566
|
if (o)
|
|
1545
1567
|
p(!0), f(!1);
|
|
1546
1568
|
else if (d) {
|
|
1547
1569
|
f(!0);
|
|
1548
|
-
const
|
|
1570
|
+
const $ = setTimeout(() => {
|
|
1549
1571
|
p(!1), f(!1);
|
|
1550
1572
|
}, 200);
|
|
1551
1573
|
return () => {
|
|
1552
|
-
clearTimeout(
|
|
1574
|
+
clearTimeout($);
|
|
1553
1575
|
};
|
|
1554
1576
|
}
|
|
1555
|
-
}, [o, d]),
|
|
1577
|
+
}, [o, d]), _(() => {
|
|
1556
1578
|
if (!o || a === 0)
|
|
1557
1579
|
return;
|
|
1558
|
-
const
|
|
1580
|
+
const $ = setTimeout(r, a);
|
|
1559
1581
|
return () => {
|
|
1560
|
-
clearTimeout(
|
|
1582
|
+
clearTimeout($);
|
|
1561
1583
|
};
|
|
1562
|
-
}, [o, a, r]), d ?
|
|
1584
|
+
}, [o, a, r]), d ? yo(
|
|
1563
1585
|
/* @__PURE__ */ S(
|
|
1564
|
-
|
|
1586
|
+
En,
|
|
1565
1587
|
{
|
|
1566
1588
|
$position: l,
|
|
1567
|
-
$variant:
|
|
1589
|
+
$variant: e,
|
|
1568
1590
|
$closing: u,
|
|
1569
1591
|
role: "alert",
|
|
1570
1592
|
"aria-live": "polite",
|
|
1571
1593
|
children: [
|
|
1572
|
-
/* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1594
|
+
/* @__PURE__ */ i(nr, { children: n }),
|
|
1595
|
+
/* @__PURE__ */ i(tr, { onClick: r, "aria-label": "Close notification", children: /* @__PURE__ */ i(ho, { size: 14, strokeWidth: 2.5 }) })
|
|
1574
1596
|
]
|
|
1575
1597
|
}
|
|
1576
1598
|
),
|
|
1577
1599
|
document.body
|
|
1578
1600
|
) : null;
|
|
1579
1601
|
}
|
|
1580
|
-
|
|
1581
|
-
const
|
|
1582
|
-
function
|
|
1602
|
+
Ln.displayName = "Toast";
|
|
1603
|
+
const er = Do(null), Vo = 5, Nn = "bottom-right";
|
|
1604
|
+
function Pn({
|
|
1583
1605
|
toast: o,
|
|
1584
1606
|
isTop: r,
|
|
1585
1607
|
onClose: n
|
|
1586
1608
|
}) {
|
|
1587
|
-
return
|
|
1588
|
-
const
|
|
1589
|
-
if (
|
|
1609
|
+
return _(() => {
|
|
1610
|
+
const e = o.duration ?? 4e3;
|
|
1611
|
+
if (e === 0)
|
|
1590
1612
|
return;
|
|
1591
|
-
const a = setTimeout(() => n(o.id),
|
|
1613
|
+
const a = setTimeout(() => n(o.id), e);
|
|
1592
1614
|
return () => clearTimeout(a);
|
|
1593
1615
|
}, [o.id, o.duration, n]), /* @__PURE__ */ S(
|
|
1594
|
-
|
|
1616
|
+
On,
|
|
1595
1617
|
{
|
|
1596
1618
|
$variant: o.variant ?? "info",
|
|
1597
1619
|
$closing: o.closing,
|
|
@@ -1599,51 +1621,51 @@ function Nn({
|
|
|
1599
1621
|
role: "alert",
|
|
1600
1622
|
"aria-live": "polite",
|
|
1601
1623
|
children: [
|
|
1602
|
-
/* @__PURE__ */
|
|
1603
|
-
/* @__PURE__ */
|
|
1604
|
-
|
|
1624
|
+
/* @__PURE__ */ i(nr, { children: o.message }),
|
|
1625
|
+
/* @__PURE__ */ i(
|
|
1626
|
+
tr,
|
|
1605
1627
|
{
|
|
1606
1628
|
onClick: () => n(o.id),
|
|
1607
1629
|
"aria-label": "Close notification",
|
|
1608
|
-
children: /* @__PURE__ */
|
|
1630
|
+
children: /* @__PURE__ */ i(ho, { size: 14, strokeWidth: 2.5 })
|
|
1609
1631
|
}
|
|
1610
1632
|
)
|
|
1611
1633
|
]
|
|
1612
1634
|
}
|
|
1613
1635
|
);
|
|
1614
1636
|
}
|
|
1615
|
-
function
|
|
1616
|
-
const [r, n] = T([]),
|
|
1637
|
+
function ye({ children: o }) {
|
|
1638
|
+
const [r, n] = T([]), e = X((u) => {
|
|
1617
1639
|
n(
|
|
1618
1640
|
(f) => f.map(
|
|
1619
|
-
(
|
|
1641
|
+
($) => $.id === u ? { ...$, closing: !0 } : $
|
|
1620
1642
|
)
|
|
1621
1643
|
), setTimeout(() => {
|
|
1622
1644
|
n(
|
|
1623
|
-
(f) => f.filter((
|
|
1645
|
+
(f) => f.filter(($) => $.id !== u)
|
|
1624
1646
|
);
|
|
1625
1647
|
}, 200);
|
|
1626
1648
|
}, []), a = X((u) => {
|
|
1627
1649
|
const f = Date.now();
|
|
1628
|
-
n((
|
|
1629
|
-
const m = [
|
|
1650
|
+
n(($) => {
|
|
1651
|
+
const m = [...$, { ...u, id: f, closing: !1 }];
|
|
1630
1652
|
return m.length > Vo ? m.slice(m.length - Vo) : m;
|
|
1631
1653
|
});
|
|
1632
|
-
}, []), l =
|
|
1654
|
+
}, []), l = Eo(() => Object.assign((u) => a(u), {
|
|
1633
1655
|
success: (u, f) => a({ ...f, message: u, variant: "success" }),
|
|
1634
1656
|
error: (u, f) => a({ ...f, message: u, variant: "error" }),
|
|
1635
1657
|
warning: (u, f) => a({ ...f, message: u, variant: "warning" }),
|
|
1636
1658
|
info: (u, f) => a({ ...f, message: u, variant: "info" })
|
|
1637
|
-
}), [a]), d = r[r.length - 1]?.position ??
|
|
1638
|
-
return /* @__PURE__ */ S(
|
|
1659
|
+
}), [a]), d = r[r.length - 1]?.position ?? Nn, p = d.startsWith("top");
|
|
1660
|
+
return /* @__PURE__ */ S(er.Provider, { value: { toast: l }, children: [
|
|
1639
1661
|
o,
|
|
1640
|
-
r.length > 0 &&
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
|
|
1662
|
+
r.length > 0 && yo(
|
|
1663
|
+
/* @__PURE__ */ i(Mn, { $position: d, children: r.map((u) => /* @__PURE__ */ i(
|
|
1664
|
+
Pn,
|
|
1643
1665
|
{
|
|
1644
1666
|
toast: u,
|
|
1645
1667
|
isTop: p,
|
|
1646
|
-
onClose:
|
|
1668
|
+
onClose: e
|
|
1647
1669
|
},
|
|
1648
1670
|
u.id
|
|
1649
1671
|
)) }),
|
|
@@ -1651,23 +1673,23 @@ function xs({ children: o }) {
|
|
|
1651
1673
|
)
|
|
1652
1674
|
] });
|
|
1653
1675
|
}
|
|
1654
|
-
function
|
|
1655
|
-
const o =
|
|
1676
|
+
function he() {
|
|
1677
|
+
const o = Wo(er);
|
|
1656
1678
|
if (!o)
|
|
1657
1679
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1658
1680
|
return o;
|
|
1659
1681
|
}
|
|
1660
|
-
const
|
|
1682
|
+
const Rn = s.form`
|
|
1661
1683
|
display: flex;
|
|
1662
1684
|
flex-direction: column;
|
|
1663
1685
|
gap: ${({ theme: o }) => o.spacing[4]};
|
|
1664
1686
|
`;
|
|
1665
|
-
function
|
|
1666
|
-
return /* @__PURE__ */
|
|
1667
|
-
|
|
1687
|
+
function Vn({ onSubmit: o, children: r, ...n }) {
|
|
1688
|
+
return /* @__PURE__ */ i(
|
|
1689
|
+
Rn,
|
|
1668
1690
|
{
|
|
1669
|
-
onSubmit: (
|
|
1670
|
-
|
|
1691
|
+
onSubmit: (e) => {
|
|
1692
|
+
e.preventDefault(), o?.(e);
|
|
1671
1693
|
},
|
|
1672
1694
|
noValidate: !0,
|
|
1673
1695
|
...n,
|
|
@@ -1675,19 +1697,19 @@ function Rn({ onSubmit: o, children: r, ...n }) {
|
|
|
1675
1697
|
}
|
|
1676
1698
|
);
|
|
1677
1699
|
}
|
|
1678
|
-
|
|
1679
|
-
const
|
|
1700
|
+
Vn.displayName = "Form";
|
|
1701
|
+
const Bn = s.div`
|
|
1680
1702
|
display: flex;
|
|
1681
1703
|
flex-direction: column;
|
|
1682
1704
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1683
|
-
`, Fn =
|
|
1705
|
+
`, Fn = s.label`
|
|
1684
1706
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1685
1707
|
font-weight: ${({ theme: o }) => o.fontWeights.medium};
|
|
1686
1708
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
1687
|
-
`, An =
|
|
1709
|
+
`, An = s.span`
|
|
1688
1710
|
color: ${({ theme: o }) => o.colors.error[500]};
|
|
1689
1711
|
margin-left: ${({ theme: o }) => o.spacing[0.5]};
|
|
1690
|
-
`,
|
|
1712
|
+
`, _n = s.span`
|
|
1691
1713
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
1692
1714
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
1693
1715
|
`;
|
|
@@ -1695,7 +1717,7 @@ function sr({
|
|
|
1695
1717
|
label: o,
|
|
1696
1718
|
error: r,
|
|
1697
1719
|
helperText: n,
|
|
1698
|
-
required:
|
|
1720
|
+
required: e,
|
|
1699
1721
|
children: a
|
|
1700
1722
|
}) {
|
|
1701
1723
|
const l = ro(), d = `${l}-hint`, p = !!(r || n), u = typeof r == "string" ? r : void 0, f = Mo.isValidElement(a) ? Mo.cloneElement(
|
|
@@ -1706,27 +1728,27 @@ function sr({
|
|
|
1706
1728
|
...r && { "aria-invalid": !0 }
|
|
1707
1729
|
}
|
|
1708
1730
|
) : a;
|
|
1709
|
-
return /* @__PURE__ */ S(
|
|
1731
|
+
return /* @__PURE__ */ S(Bn, { children: [
|
|
1710
1732
|
o && /* @__PURE__ */ S(Fn, { htmlFor: l, children: [
|
|
1711
1733
|
o,
|
|
1712
|
-
|
|
1734
|
+
e && /* @__PURE__ */ i(An, { "aria-hidden": "true", children: " *" })
|
|
1713
1735
|
] }),
|
|
1714
1736
|
f,
|
|
1715
|
-
p && /* @__PURE__ */
|
|
1737
|
+
p && /* @__PURE__ */ i(_n, { id: d, $error: !!r, children: u ?? n })
|
|
1716
1738
|
] });
|
|
1717
1739
|
}
|
|
1718
1740
|
sr.displayName = "FormField";
|
|
1719
|
-
function
|
|
1741
|
+
function we({
|
|
1720
1742
|
initialValues: o,
|
|
1721
1743
|
validate: r,
|
|
1722
1744
|
onSubmit: n,
|
|
1723
|
-
onError:
|
|
1745
|
+
onError: e
|
|
1724
1746
|
}) {
|
|
1725
1747
|
const [a, l] = T(o), [d, p] = T(
|
|
1726
1748
|
{}
|
|
1727
|
-
), [u, f] = T({}), [
|
|
1749
|
+
), [u, f] = T({}), [$, m] = T(!1), v = K(a);
|
|
1728
1750
|
v.current = a;
|
|
1729
|
-
const
|
|
1751
|
+
const y = X(
|
|
1730
1752
|
(w) => {
|
|
1731
1753
|
if (!r)
|
|
1732
1754
|
return {};
|
|
@@ -1736,7 +1758,7 @@ function hs({
|
|
|
1736
1758
|
);
|
|
1737
1759
|
},
|
|
1738
1760
|
[r]
|
|
1739
|
-
), k =
|
|
1761
|
+
), k = K(u);
|
|
1740
1762
|
k.current = u;
|
|
1741
1763
|
const C = X(
|
|
1742
1764
|
(w) => {
|
|
@@ -1744,29 +1766,29 @@ function hs({
|
|
|
1744
1766
|
process.env.NODE_ENV !== "production" && !b && console.warn(
|
|
1745
1767
|
"[useForm] handleChange: field is missing a `name` attribute — value will not be tracked."
|
|
1746
1768
|
);
|
|
1747
|
-
const
|
|
1748
|
-
l(
|
|
1769
|
+
const E = { ...v.current, [b]: z };
|
|
1770
|
+
l(E), k.current[b] && p(y(E));
|
|
1749
1771
|
},
|
|
1750
|
-
[
|
|
1772
|
+
[y]
|
|
1751
1773
|
), M = X(
|
|
1752
1774
|
(w) => {
|
|
1753
1775
|
const { name: b } = w.target;
|
|
1754
1776
|
process.env.NODE_ENV !== "production" && !b && console.warn(
|
|
1755
1777
|
"[useForm] handleBlur: field is missing a `name` attribute — touched state will not be tracked."
|
|
1756
|
-
), f((z) => ({ ...z, [b]: !0 })), p(
|
|
1778
|
+
), f((z) => ({ ...z, [b]: !0 })), p(y(v.current));
|
|
1757
1779
|
},
|
|
1758
|
-
[
|
|
1780
|
+
[y]
|
|
1759
1781
|
), P = X(
|
|
1760
1782
|
(w) => {
|
|
1761
1783
|
w?.preventDefault();
|
|
1762
1784
|
const b = Object.keys(v.current).reduce(
|
|
1763
|
-
(
|
|
1785
|
+
(D, N) => ({ ...D, [N]: !0 }),
|
|
1764
1786
|
{}
|
|
1765
1787
|
);
|
|
1766
1788
|
f(b);
|
|
1767
|
-
const z =
|
|
1789
|
+
const z = y(v.current);
|
|
1768
1790
|
if (p(z), Object.keys(z).length > 0) {
|
|
1769
|
-
|
|
1791
|
+
e?.(z);
|
|
1770
1792
|
return;
|
|
1771
1793
|
}
|
|
1772
1794
|
(async () => {
|
|
@@ -1778,7 +1800,7 @@ function hs({
|
|
|
1778
1800
|
}
|
|
1779
1801
|
})();
|
|
1780
1802
|
},
|
|
1781
|
-
[
|
|
1803
|
+
[y, n, e]
|
|
1782
1804
|
), L = X((w, b) => {
|
|
1783
1805
|
l((z) => ({ ...z, [w]: b }));
|
|
1784
1806
|
}, []), x = X(
|
|
@@ -1798,52 +1820,52 @@ function hs({
|
|
|
1798
1820
|
handleSubmit: P,
|
|
1799
1821
|
setFieldValue: L,
|
|
1800
1822
|
reset: x,
|
|
1801
|
-
isSubmitting:
|
|
1823
|
+
isSubmitting: $
|
|
1802
1824
|
};
|
|
1803
1825
|
}
|
|
1804
|
-
const
|
|
1826
|
+
const me = (o = "Required") => (r) => {
|
|
1805
1827
|
if (!r.trim())
|
|
1806
1828
|
return o;
|
|
1807
|
-
},
|
|
1829
|
+
}, ve = (o, r) => (n) => {
|
|
1808
1830
|
if (n.length < o)
|
|
1809
1831
|
return r ?? `Must be at least ${o} characters`;
|
|
1810
|
-
},
|
|
1832
|
+
}, ke = (o, r) => (n) => {
|
|
1811
1833
|
if (n.length > o)
|
|
1812
1834
|
return r ?? `Must be at most ${o} characters`;
|
|
1813
|
-
},
|
|
1835
|
+
}, Se = (o = "Enter a valid email") => (r) => {
|
|
1814
1836
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))
|
|
1815
1837
|
return o;
|
|
1816
|
-
},
|
|
1838
|
+
}, ze = (o = "Enter a valid URL") => (r) => {
|
|
1817
1839
|
try {
|
|
1818
1840
|
new URL(r);
|
|
1819
1841
|
return;
|
|
1820
1842
|
} catch {
|
|
1821
1843
|
return o;
|
|
1822
1844
|
}
|
|
1823
|
-
},
|
|
1845
|
+
}, Ce = (o, r) => (n) => {
|
|
1824
1846
|
if (!o.test(n))
|
|
1825
1847
|
return r;
|
|
1826
1848
|
};
|
|
1827
|
-
function
|
|
1849
|
+
function Ie(...o) {
|
|
1828
1850
|
return (r) => {
|
|
1829
1851
|
for (const n of o) {
|
|
1830
|
-
const
|
|
1831
|
-
if (
|
|
1832
|
-
return
|
|
1852
|
+
const e = n(r);
|
|
1853
|
+
if (e !== void 0)
|
|
1854
|
+
return e;
|
|
1833
1855
|
}
|
|
1834
1856
|
};
|
|
1835
1857
|
}
|
|
1836
|
-
const
|
|
1858
|
+
const jn = s.div`
|
|
1837
1859
|
display: flex;
|
|
1838
1860
|
flex-direction: column;
|
|
1839
1861
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1840
|
-
`,
|
|
1862
|
+
`, Hn = s.label`
|
|
1841
1863
|
display: inline-flex;
|
|
1842
1864
|
align-items: center;
|
|
1843
1865
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1844
1866
|
cursor: ${({ $disabled: o }) => o ? "not-allowed" : "pointer"};
|
|
1845
1867
|
opacity: ${({ $disabled: o }) => o ? 0.6 : 1};
|
|
1846
|
-
`,
|
|
1868
|
+
`, Un = s.input`
|
|
1847
1869
|
position: absolute;
|
|
1848
1870
|
opacity: 0;
|
|
1849
1871
|
width: 0;
|
|
@@ -1854,7 +1876,7 @@ const _n = i.div`
|
|
|
1854
1876
|
&:focus-visible + div {
|
|
1855
1877
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
1856
1878
|
}
|
|
1857
|
-
`, Yn =
|
|
1879
|
+
`, Yn = s.div`
|
|
1858
1880
|
position: relative;
|
|
1859
1881
|
display: flex;
|
|
1860
1882
|
align-items: center;
|
|
@@ -1891,71 +1913,71 @@ const _n = i.div`
|
|
|
1891
1913
|
transform: rotate(45deg) translate(-1px, -1px);
|
|
1892
1914
|
}
|
|
1893
1915
|
`}
|
|
1894
|
-
`,
|
|
1916
|
+
`, Kn = s.span`
|
|
1895
1917
|
font-size: ${({ $size: o = "md", theme: r }) => o === "sm" ? r.fontSizes.sm : r.fontSizes.md};
|
|
1896
1918
|
font-weight: ${({ theme: o }) => o.fontWeights.medium};
|
|
1897
|
-
`,
|
|
1919
|
+
`, qn = s.span`
|
|
1898
1920
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
1899
1921
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
1900
1922
|
`;
|
|
1901
|
-
function
|
|
1923
|
+
function Gn({
|
|
1902
1924
|
ref: o,
|
|
1903
1925
|
label: r,
|
|
1904
1926
|
size: n = "md",
|
|
1905
|
-
error:
|
|
1927
|
+
error: e,
|
|
1906
1928
|
helperText: a,
|
|
1907
1929
|
disabled: l,
|
|
1908
1930
|
checked: d,
|
|
1909
1931
|
id: p,
|
|
1910
1932
|
color: u,
|
|
1911
1933
|
borderColor: f,
|
|
1912
|
-
checkColor:
|
|
1934
|
+
checkColor: $,
|
|
1913
1935
|
...m
|
|
1914
1936
|
}) {
|
|
1915
|
-
const v = ro(),
|
|
1916
|
-
return /* @__PURE__ */ S(
|
|
1917
|
-
/* @__PURE__ */ S(
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
|
|
1937
|
+
const v = ro(), y = p ?? v, k = typeof e == "string" ? e : void 0, C = !!(a || e);
|
|
1938
|
+
return /* @__PURE__ */ S(jn, { children: [
|
|
1939
|
+
/* @__PURE__ */ S(Hn, { htmlFor: y, $disabled: l, children: [
|
|
1940
|
+
/* @__PURE__ */ i(
|
|
1941
|
+
Un,
|
|
1920
1942
|
{
|
|
1921
|
-
id:
|
|
1943
|
+
id: y,
|
|
1922
1944
|
ref: o,
|
|
1923
1945
|
type: "checkbox",
|
|
1924
1946
|
checked: d,
|
|
1925
1947
|
disabled: l,
|
|
1926
|
-
"aria-invalid": !!
|
|
1948
|
+
"aria-invalid": !!e,
|
|
1927
1949
|
...m
|
|
1928
1950
|
}
|
|
1929
1951
|
),
|
|
1930
|
-
/* @__PURE__ */
|
|
1952
|
+
/* @__PURE__ */ i(
|
|
1931
1953
|
Yn,
|
|
1932
1954
|
{
|
|
1933
1955
|
$checked: d,
|
|
1934
|
-
$error: !!
|
|
1956
|
+
$error: !!e,
|
|
1935
1957
|
$disabled: l,
|
|
1936
1958
|
$size: n,
|
|
1937
1959
|
$color: u,
|
|
1938
1960
|
$borderColor: f,
|
|
1939
|
-
$checkColor:
|
|
1961
|
+
$checkColor: $
|
|
1940
1962
|
}
|
|
1941
1963
|
),
|
|
1942
|
-
r && /* @__PURE__ */
|
|
1964
|
+
r && /* @__PURE__ */ i(Kn, { $size: n, children: r })
|
|
1943
1965
|
] }),
|
|
1944
|
-
C && /* @__PURE__ */
|
|
1966
|
+
C && /* @__PURE__ */ i(qn, { $error: !!e, children: k ?? a })
|
|
1945
1967
|
] });
|
|
1946
1968
|
}
|
|
1947
|
-
|
|
1948
|
-
const
|
|
1969
|
+
Gn.displayName = "Checkbox";
|
|
1970
|
+
const Xn = s.div`
|
|
1949
1971
|
display: flex;
|
|
1950
1972
|
flex-direction: column;
|
|
1951
1973
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1952
|
-
`,
|
|
1974
|
+
`, Jn = s.label`
|
|
1953
1975
|
display: inline-flex;
|
|
1954
1976
|
align-items: center;
|
|
1955
1977
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1956
1978
|
cursor: ${({ $disabled: o }) => o ? "not-allowed" : "pointer"};
|
|
1957
1979
|
opacity: ${({ $disabled: o }) => o ? 0.6 : 1};
|
|
1958
|
-
`,
|
|
1980
|
+
`, Qn = s.input`
|
|
1959
1981
|
position: absolute;
|
|
1960
1982
|
opacity: 0;
|
|
1961
1983
|
width: 0;
|
|
@@ -1966,7 +1988,7 @@ const Gn = i.div`
|
|
|
1966
1988
|
&:focus-visible + div {
|
|
1967
1989
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
1968
1990
|
}
|
|
1969
|
-
`,
|
|
1991
|
+
`, Zn = s.div`
|
|
1970
1992
|
position: relative;
|
|
1971
1993
|
display: flex;
|
|
1972
1994
|
align-items: center;
|
|
@@ -2001,69 +2023,69 @@ const Gn = i.div`
|
|
|
2001
2023
|
background-color: ${r ?? n.colors.primary[500]};
|
|
2002
2024
|
}
|
|
2003
2025
|
`}
|
|
2004
|
-
`,
|
|
2026
|
+
`, ot = s.span`
|
|
2005
2027
|
font-size: ${({ $size: o = "md", theme: r }) => o === "sm" ? r.fontSizes.sm : r.fontSizes.md};
|
|
2006
2028
|
font-weight: ${({ theme: o }) => o.fontWeights.medium};
|
|
2007
|
-
`,
|
|
2029
|
+
`, rt = s.span`
|
|
2008
2030
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
2009
2031
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
2010
2032
|
`;
|
|
2011
|
-
function
|
|
2033
|
+
function nt({
|
|
2012
2034
|
ref: o,
|
|
2013
2035
|
label: r,
|
|
2014
2036
|
size: n = "md",
|
|
2015
|
-
error:
|
|
2037
|
+
error: e,
|
|
2016
2038
|
helperText: a,
|
|
2017
2039
|
disabled: l,
|
|
2018
2040
|
checked: d,
|
|
2019
2041
|
id: p,
|
|
2020
2042
|
color: u,
|
|
2021
2043
|
borderColor: f,
|
|
2022
|
-
|
|
2044
|
+
...$
|
|
2023
2045
|
}) {
|
|
2024
|
-
const m = ro(), v = p ?? m,
|
|
2025
|
-
return /* @__PURE__ */ S(
|
|
2026
|
-
/* @__PURE__ */ S(
|
|
2027
|
-
/* @__PURE__ */
|
|
2028
|
-
|
|
2046
|
+
const m = ro(), v = p ?? m, y = !!(a || e);
|
|
2047
|
+
return /* @__PURE__ */ S(Xn, { children: [
|
|
2048
|
+
/* @__PURE__ */ S(Jn, { htmlFor: v, $disabled: l, children: [
|
|
2049
|
+
/* @__PURE__ */ i(
|
|
2050
|
+
Qn,
|
|
2029
2051
|
{
|
|
2030
2052
|
id: v,
|
|
2031
2053
|
ref: o,
|
|
2032
2054
|
type: "radio",
|
|
2033
2055
|
checked: d,
|
|
2034
2056
|
disabled: l,
|
|
2035
|
-
"aria-invalid": !!
|
|
2036
|
-
|
|
2057
|
+
"aria-invalid": !!e,
|
|
2058
|
+
...$
|
|
2037
2059
|
}
|
|
2038
2060
|
),
|
|
2039
|
-
/* @__PURE__ */
|
|
2040
|
-
|
|
2061
|
+
/* @__PURE__ */ i(
|
|
2062
|
+
Zn,
|
|
2041
2063
|
{
|
|
2042
2064
|
$checked: d,
|
|
2043
|
-
$error:
|
|
2065
|
+
$error: e,
|
|
2044
2066
|
$disabled: l,
|
|
2045
2067
|
$size: n,
|
|
2046
2068
|
$color: u,
|
|
2047
2069
|
$borderColor: f
|
|
2048
2070
|
}
|
|
2049
2071
|
),
|
|
2050
|
-
r && /* @__PURE__ */
|
|
2072
|
+
r && /* @__PURE__ */ i(ot, { $size: n, children: r })
|
|
2051
2073
|
] }),
|
|
2052
|
-
|
|
2074
|
+
y && /* @__PURE__ */ i(rt, { $error: e, children: a })
|
|
2053
2075
|
] });
|
|
2054
2076
|
}
|
|
2055
|
-
|
|
2056
|
-
const
|
|
2077
|
+
nt.displayName = "Radio";
|
|
2078
|
+
const tt = s.div`
|
|
2057
2079
|
display: flex;
|
|
2058
2080
|
flex-direction: column;
|
|
2059
2081
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
2060
|
-
`,
|
|
2082
|
+
`, et = s.label`
|
|
2061
2083
|
display: inline-flex;
|
|
2062
2084
|
align-items: center;
|
|
2063
2085
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
2064
2086
|
cursor: ${({ $disabled: o }) => o ? "not-allowed" : "pointer"};
|
|
2065
2087
|
opacity: ${({ $disabled: o }) => o ? 0.6 : 1};
|
|
2066
|
-
`, st =
|
|
2088
|
+
`, st = s.input`
|
|
2067
2089
|
position: absolute;
|
|
2068
2090
|
opacity: 0;
|
|
2069
2091
|
width: 0;
|
|
@@ -2074,7 +2096,7 @@ const nt = i.div`
|
|
|
2074
2096
|
&:focus-visible + div {
|
|
2075
2097
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
2076
2098
|
}
|
|
2077
|
-
`,
|
|
2099
|
+
`, it = s.div`
|
|
2078
2100
|
position: relative;
|
|
2079
2101
|
flex-shrink: 0;
|
|
2080
2102
|
border-radius: 9999px;
|
|
@@ -2116,46 +2138,46 @@ const nt = i.div`
|
|
|
2116
2138
|
height: 12px;
|
|
2117
2139
|
margin-top: -6px;
|
|
2118
2140
|
transform: translateX(${r ? "calc(100% + 4px)" : "2px"});
|
|
2119
|
-
`,
|
|
2141
|
+
`, e = t`
|
|
2120
2142
|
width: 16px;
|
|
2121
2143
|
height: 16px;
|
|
2122
2144
|
margin-top: -8px;
|
|
2123
2145
|
transform: translateX(${r ? "calc(100% + 4px)" : "2px"});
|
|
2124
2146
|
`;
|
|
2125
|
-
return o === "sm" ? n :
|
|
2147
|
+
return o === "sm" ? n : e;
|
|
2126
2148
|
}}
|
|
2127
2149
|
}
|
|
2128
|
-
`,
|
|
2150
|
+
`, at = s.span`
|
|
2129
2151
|
font-size: ${({ $size: o = "md", theme: r }) => o === "sm" ? r.fontSizes.sm : r.fontSizes.md};
|
|
2130
2152
|
font-weight: ${({ theme: o }) => o.fontWeights.medium};
|
|
2131
2153
|
`;
|
|
2132
|
-
function
|
|
2154
|
+
function lt({
|
|
2133
2155
|
ref: o,
|
|
2134
2156
|
label: r,
|
|
2135
2157
|
size: n = "md",
|
|
2136
|
-
disabled:
|
|
2158
|
+
disabled: e,
|
|
2137
2159
|
checked: a,
|
|
2138
2160
|
id: l,
|
|
2139
2161
|
color: d,
|
|
2140
2162
|
borderColor: p,
|
|
2141
2163
|
...u
|
|
2142
2164
|
}) {
|
|
2143
|
-
const f = ro(),
|
|
2144
|
-
return /* @__PURE__ */
|
|
2145
|
-
/* @__PURE__ */
|
|
2165
|
+
const f = ro(), $ = l ?? f;
|
|
2166
|
+
return /* @__PURE__ */ i(tt, { children: /* @__PURE__ */ S(et, { htmlFor: $, $disabled: e, children: [
|
|
2167
|
+
/* @__PURE__ */ i(
|
|
2146
2168
|
st,
|
|
2147
2169
|
{
|
|
2148
|
-
id:
|
|
2170
|
+
id: $,
|
|
2149
2171
|
ref: o,
|
|
2150
2172
|
type: "checkbox",
|
|
2151
2173
|
role: "switch",
|
|
2152
2174
|
checked: a,
|
|
2153
|
-
disabled:
|
|
2175
|
+
disabled: e,
|
|
2154
2176
|
...u
|
|
2155
2177
|
}
|
|
2156
2178
|
),
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
|
|
2179
|
+
/* @__PURE__ */ i(
|
|
2180
|
+
it,
|
|
2159
2181
|
{
|
|
2160
2182
|
$checked: a,
|
|
2161
2183
|
$size: n,
|
|
@@ -2163,11 +2185,11 @@ function at({
|
|
|
2163
2185
|
$borderColor: p
|
|
2164
2186
|
}
|
|
2165
2187
|
),
|
|
2166
|
-
r && /* @__PURE__ */
|
|
2188
|
+
r && /* @__PURE__ */ i(at, { $size: n, children: r })
|
|
2167
2189
|
] }) });
|
|
2168
2190
|
}
|
|
2169
|
-
|
|
2170
|
-
const
|
|
2191
|
+
lt.displayName = "Switch";
|
|
2192
|
+
const ct = s.div`
|
|
2171
2193
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
2172
2194
|
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
2173
2195
|
overflow: hidden;
|
|
@@ -2182,7 +2204,7 @@ const lt = i.div`
|
|
|
2182
2204
|
border: 1px solid ${r ?? o.colors.neutral[200]};
|
|
2183
2205
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
2184
2206
|
`}
|
|
2185
|
-
`,
|
|
2207
|
+
`, dt = s.button`
|
|
2186
2208
|
width: 100%;
|
|
2187
2209
|
display: flex;
|
|
2188
2210
|
align-items: flex-start;
|
|
@@ -2202,19 +2224,19 @@ const lt = i.div`
|
|
|
2202
2224
|
${({ theme: o, $accentColor: r }) => r ?? o.colors.primary[500]};
|
|
2203
2225
|
outline-offset: -2px;
|
|
2204
2226
|
}
|
|
2205
|
-
`,
|
|
2227
|
+
`, ut = s.div`
|
|
2206
2228
|
flex: 1;
|
|
2207
2229
|
min-width: 0;
|
|
2208
|
-
`,
|
|
2230
|
+
`, pt = s.span`
|
|
2209
2231
|
display: block;
|
|
2210
2232
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
2211
2233
|
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
2212
2234
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
2213
|
-
`,
|
|
2235
|
+
`, ft = s.span`
|
|
2214
2236
|
display: block;
|
|
2215
2237
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
2216
2238
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
2217
|
-
`,
|
|
2239
|
+
`, gt = s.div`
|
|
2218
2240
|
display: flex;
|
|
2219
2241
|
flex-direction: row;
|
|
2220
2242
|
align-items: center;
|
|
@@ -2226,11 +2248,11 @@ const lt = i.div`
|
|
|
2226
2248
|
align-items: flex-start;
|
|
2227
2249
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
2228
2250
|
}
|
|
2229
|
-
`, $t =
|
|
2251
|
+
`, $t = s.div`
|
|
2230
2252
|
display: flex;
|
|
2231
2253
|
align-items: center;
|
|
2232
2254
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
2233
|
-
`,
|
|
2255
|
+
`, bt = s.span`
|
|
2234
2256
|
display: inline-flex;
|
|
2235
2257
|
align-items: center;
|
|
2236
2258
|
justify-content: center;
|
|
@@ -2238,81 +2260,81 @@ const lt = i.div`
|
|
|
2238
2260
|
transition: transform 0.2s ease;
|
|
2239
2261
|
transform: ${({ $open: o }) => o ? "rotate(180deg)" : "rotate(0deg)"};
|
|
2240
2262
|
color: ${({ theme: o, $accentColor: r }) => r ?? o.colors.neutral[500]};
|
|
2241
|
-
`,
|
|
2263
|
+
`, xt = s.div`
|
|
2242
2264
|
display: grid;
|
|
2243
2265
|
grid-template-rows: ${({ $open: o }) => o ? "1fr" : "0fr"};
|
|
2244
2266
|
transition: grid-template-rows 0.2s ease;
|
|
2245
|
-
`,
|
|
2267
|
+
`, yt = s.div`
|
|
2246
2268
|
overflow: hidden;
|
|
2247
|
-
`,
|
|
2269
|
+
`, ht = s.div`
|
|
2248
2270
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
2249
2271
|
border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
2250
2272
|
`;
|
|
2251
|
-
function
|
|
2273
|
+
function wt({
|
|
2252
2274
|
title: o,
|
|
2253
2275
|
children: r,
|
|
2254
2276
|
defaultOpen: n = !1,
|
|
2255
|
-
open:
|
|
2277
|
+
open: e,
|
|
2256
2278
|
onToggle: a,
|
|
2257
2279
|
subtitle: l,
|
|
2258
2280
|
headerActions: d,
|
|
2259
2281
|
accentColor: p
|
|
2260
2282
|
}) {
|
|
2261
|
-
const [u, f] = T(n),
|
|
2262
|
-
return /* @__PURE__ */ S(
|
|
2283
|
+
const [u, f] = T(n), $ = ro(), m = e !== void 0, v = m ? e : u;
|
|
2284
|
+
return /* @__PURE__ */ S(ct, { $accentColor: p, children: [
|
|
2263
2285
|
/* @__PURE__ */ S(
|
|
2264
|
-
|
|
2286
|
+
dt,
|
|
2265
2287
|
{
|
|
2266
2288
|
type: "button",
|
|
2267
2289
|
$open: v,
|
|
2268
2290
|
$accentColor: p,
|
|
2269
2291
|
"aria-expanded": v,
|
|
2270
|
-
"aria-controls":
|
|
2292
|
+
"aria-controls": $,
|
|
2271
2293
|
onClick: () => {
|
|
2272
2294
|
const k = !v;
|
|
2273
2295
|
m || f(k), a?.(k);
|
|
2274
2296
|
},
|
|
2275
2297
|
children: [
|
|
2276
|
-
/* @__PURE__ */ S(
|
|
2277
|
-
/* @__PURE__ */
|
|
2278
|
-
(l || d) && /* @__PURE__ */ S(
|
|
2279
|
-
l && /* @__PURE__ */
|
|
2280
|
-
d && /* @__PURE__ */
|
|
2298
|
+
/* @__PURE__ */ S(ut, { children: [
|
|
2299
|
+
/* @__PURE__ */ i(pt, { children: o }),
|
|
2300
|
+
(l || d) && /* @__PURE__ */ S(gt, { children: [
|
|
2301
|
+
l && /* @__PURE__ */ i(ft, { children: l }),
|
|
2302
|
+
d && /* @__PURE__ */ i($t, { onClick: (k) => k.stopPropagation(), children: d })
|
|
2281
2303
|
] })
|
|
2282
2304
|
] }),
|
|
2283
|
-
/* @__PURE__ */
|
|
2284
|
-
|
|
2305
|
+
/* @__PURE__ */ i(
|
|
2306
|
+
bt,
|
|
2285
2307
|
{
|
|
2286
2308
|
$open: v,
|
|
2287
2309
|
$accentColor: p,
|
|
2288
2310
|
"aria-hidden": "true",
|
|
2289
|
-
children: /* @__PURE__ */
|
|
2311
|
+
children: /* @__PURE__ */ i(Ko, { size: 18, strokeWidth: 2.5 })
|
|
2290
2312
|
}
|
|
2291
2313
|
)
|
|
2292
2314
|
]
|
|
2293
2315
|
}
|
|
2294
2316
|
),
|
|
2295
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ i(xt, { $open: v, children: /* @__PURE__ */ i(yt, { id: $, role: "region", "aria-label": o, children: /* @__PURE__ */ i(ht, { children: r }) }) })
|
|
2296
2318
|
] });
|
|
2297
2319
|
}
|
|
2298
|
-
|
|
2299
|
-
const
|
|
2320
|
+
wt.displayName = "CollapsibleCard";
|
|
2321
|
+
const mt = oo`
|
|
2300
2322
|
to { transform: rotate(360deg); }
|
|
2301
|
-
`,
|
|
2323
|
+
`, vt = {
|
|
2302
2324
|
sm: "16px",
|
|
2303
2325
|
md: "24px",
|
|
2304
2326
|
lg: "40px"
|
|
2305
|
-
},
|
|
2327
|
+
}, kt = {
|
|
2306
2328
|
thin: "2px",
|
|
2307
2329
|
normal: "3px",
|
|
2308
2330
|
bold: "5px"
|
|
2309
|
-
},
|
|
2331
|
+
}, St = s.span`
|
|
2310
2332
|
display: inline-block;
|
|
2311
2333
|
border-radius: 50%;
|
|
2312
|
-
animation: ${
|
|
2334
|
+
animation: ${mt} 0.7s linear infinite;
|
|
2313
2335
|
|
|
2314
|
-
${({ $size: o = "md", $weight: r = "normal", $color: n, theme:
|
|
2315
|
-
const a =
|
|
2336
|
+
${({ $size: o = "md", $weight: r = "normal", $color: n, theme: e }) => {
|
|
2337
|
+
const a = vt[o], l = kt[r], d = e.colors.neutral[200], p = n ?? e.colors.primary[500];
|
|
2316
2338
|
return t`
|
|
2317
2339
|
width: ${a};
|
|
2318
2340
|
height: ${a};
|
|
@@ -2321,84 +2343,84 @@ const wt = oo`
|
|
|
2321
2343
|
`;
|
|
2322
2344
|
}}
|
|
2323
2345
|
`;
|
|
2324
|
-
function
|
|
2346
|
+
function zt({
|
|
2325
2347
|
size: o = "md",
|
|
2326
2348
|
weight: r = "normal",
|
|
2327
2349
|
color: n,
|
|
2328
|
-
label:
|
|
2350
|
+
label: e = "Loading..."
|
|
2329
2351
|
}) {
|
|
2330
|
-
return /* @__PURE__ */
|
|
2331
|
-
|
|
2352
|
+
return /* @__PURE__ */ i(
|
|
2353
|
+
St,
|
|
2332
2354
|
{
|
|
2333
2355
|
$size: o,
|
|
2334
2356
|
$weight: r,
|
|
2335
2357
|
$color: n,
|
|
2336
2358
|
role: "status",
|
|
2337
|
-
"aria-label":
|
|
2359
|
+
"aria-label": e
|
|
2338
2360
|
}
|
|
2339
2361
|
);
|
|
2340
2362
|
}
|
|
2341
|
-
|
|
2342
|
-
const
|
|
2343
|
-
function
|
|
2363
|
+
zt.displayName = "Spinner";
|
|
2364
|
+
const Ct = 7, Bo = 3, Fo = 1;
|
|
2365
|
+
function Te({
|
|
2344
2366
|
defaultSort: o,
|
|
2345
2367
|
defaultPage: r = 1
|
|
2346
2368
|
} = {}) {
|
|
2347
|
-
const [n,
|
|
2369
|
+
const [n, e] = T(o ?? null), [a, l] = T(r);
|
|
2348
2370
|
return { sort: n, page: a, onSortChange: (u) => {
|
|
2349
|
-
|
|
2371
|
+
e(u), l(1);
|
|
2350
2372
|
}, onPageChange: (u) => {
|
|
2351
2373
|
l(u);
|
|
2352
2374
|
} };
|
|
2353
2375
|
}
|
|
2354
|
-
function
|
|
2376
|
+
function It(o, r) {
|
|
2355
2377
|
return o?.key !== r ? { key: r, direction: "asc" } : o.direction === "asc" ? { key: r, direction: "desc" } : null;
|
|
2356
2378
|
}
|
|
2357
|
-
function
|
|
2379
|
+
function Tt({
|
|
2358
2380
|
data: o,
|
|
2359
2381
|
sort: r,
|
|
2360
2382
|
defaultSort: n,
|
|
2361
|
-
onSortChange:
|
|
2383
|
+
onSortChange: e
|
|
2362
2384
|
}) {
|
|
2363
2385
|
const a = r !== void 0, [l, d] = T(
|
|
2364
2386
|
n ?? null
|
|
2365
|
-
), p = a ? r ?? null : l, u = (
|
|
2366
|
-
const m =
|
|
2367
|
-
return a || d(m),
|
|
2368
|
-
}, f =
|
|
2369
|
-
const v =
|
|
2387
|
+
), p = a ? r ?? null : l, u = ($) => {
|
|
2388
|
+
const m = It(p, $);
|
|
2389
|
+
return a || d(m), e?.(m), m;
|
|
2390
|
+
}, f = Eo(() => a || !p ? o : [...o].sort(($, m) => {
|
|
2391
|
+
const v = $[p.key], y = m[p.key], k = v < y ? -1 : v > y ? 1 : 0;
|
|
2370
2392
|
return p.direction === "asc" ? k : -k;
|
|
2371
2393
|
}), [o, p, a]);
|
|
2372
2394
|
return { activeSort: p, sortedData: f, handleSort: u };
|
|
2373
2395
|
}
|
|
2374
|
-
function
|
|
2375
|
-
if (r <=
|
|
2376
|
-
return Array.from({ length: r }, (
|
|
2396
|
+
function Wt(o, r) {
|
|
2397
|
+
if (r <= Ct)
|
|
2398
|
+
return Array.from({ length: r }, (e, a) => a + 1);
|
|
2377
2399
|
const n = [1];
|
|
2378
|
-
o >
|
|
2379
|
-
for (let
|
|
2380
|
-
n.push(
|
|
2381
|
-
return o < r -
|
|
2400
|
+
o > Bo && n.push("...");
|
|
2401
|
+
for (let e = Math.max(2, o - Fo); e <= Math.min(r - 1, o + Fo); e++)
|
|
2402
|
+
n.push(e);
|
|
2403
|
+
return o < r - Bo + 1 && n.push("..."), n.push(r), n;
|
|
2382
2404
|
}
|
|
2383
|
-
function
|
|
2405
|
+
function Dt({
|
|
2384
2406
|
data: o,
|
|
2385
2407
|
pageSize: r,
|
|
2386
2408
|
page: n,
|
|
2387
|
-
defaultPage:
|
|
2409
|
+
defaultPage: e,
|
|
2388
2410
|
totalRows: a,
|
|
2389
2411
|
onPageChange: l
|
|
2390
2412
|
}) {
|
|
2391
|
-
const d = n !== void 0, [p, u] = T(
|
|
2413
|
+
const d = n !== void 0, [p, u] = T(e ?? 1), f = d ? n : p, $ = (C) => {
|
|
2392
2414
|
d || u(C), l?.(C);
|
|
2393
|
-
}, m = a !== void 0, v = a ?? o.length,
|
|
2415
|
+
}, m = a !== void 0, v = a ?? o.length, y = r ? Math.max(1, Math.ceil(v / r)) : 1, k = Eo(() => {
|
|
2394
2416
|
if (!r || m)
|
|
2395
2417
|
return o;
|
|
2396
2418
|
const C = (f - 1) * r;
|
|
2397
2419
|
return o.slice(C, C + r);
|
|
2398
2420
|
}, [o, r, f, m]);
|
|
2399
|
-
return { activePage: f, totalPages:
|
|
2421
|
+
return { activePage: f, totalPages: y, displayData: k, handlePageChange: $ };
|
|
2400
2422
|
}
|
|
2401
|
-
const
|
|
2423
|
+
const ir = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg" ? `${r.spacing[3]} ${r.spacing[4]}` : `${r.spacing[2]} ${r.spacing[3]}`, Et = s.div`
|
|
2402
2424
|
width: 100%;
|
|
2403
2425
|
|
|
2404
2426
|
${({ theme: o, $borderColor: r }) => o.brutalism ? t`
|
|
@@ -2419,11 +2441,12 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2419
2441
|
` : t`
|
|
2420
2442
|
overflow-x: auto;
|
|
2421
2443
|
`}
|
|
2422
|
-
`,
|
|
2444
|
+
`, Ot = s.div`
|
|
2423
2445
|
overflow: auto;
|
|
2424
2446
|
min-height: 0;
|
|
2425
|
-
`,
|
|
2426
|
-
width:
|
|
2447
|
+
`, Mt = s.table`
|
|
2448
|
+
width: max-content;
|
|
2449
|
+
min-width: 100%;
|
|
2427
2450
|
border-collapse: collapse;
|
|
2428
2451
|
font-size: ${({ $size: o, theme: r }) => ({
|
|
2429
2452
|
sm: r.fontSizes.sm,
|
|
@@ -2434,7 +2457,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2434
2457
|
caption {
|
|
2435
2458
|
padding: ${({ theme: o }) => o.spacing[2]} 0;
|
|
2436
2459
|
}
|
|
2437
|
-
`,
|
|
2460
|
+
`, Lt = s.thead`
|
|
2438
2461
|
${({ $stickyHeader: o }) => o && t`
|
|
2439
2462
|
position: sticky;
|
|
2440
2463
|
top: 0;
|
|
@@ -2454,7 +2477,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2454
2477
|
--th-text: ${o.colors.neutral[600]};
|
|
2455
2478
|
--th-sep: ${n ?? o.colors.neutral[300]};
|
|
2456
2479
|
`}
|
|
2457
|
-
`,
|
|
2480
|
+
`, Nt = s.tbody`
|
|
2458
2481
|
${({ $rowColor: o }) => o && t`
|
|
2459
2482
|
tr {
|
|
2460
2483
|
background-color: ${o};
|
|
@@ -2474,7 +2497,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2474
2497
|
tr:hover td {
|
|
2475
2498
|
background-color: rgba(0, 0, 0, 0.04);
|
|
2476
2499
|
}
|
|
2477
|
-
`,
|
|
2500
|
+
`, xo = s.tr``, Pt = s(xo)`
|
|
2478
2501
|
cursor: pointer;
|
|
2479
2502
|
|
|
2480
2503
|
td {
|
|
@@ -2491,14 +2514,14 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2491
2514
|
box-shadow: inset 4px 0 0
|
|
2492
2515
|
${({ $accentColor: o, theme: r }) => o ?? r.colors.neutral[900]};
|
|
2493
2516
|
}
|
|
2494
|
-
`,
|
|
2517
|
+
`, Rt = s.th`
|
|
2495
2518
|
background-color: var(--th-bg);
|
|
2496
2519
|
color: var(--th-text);
|
|
2497
2520
|
text-align: left;
|
|
2498
2521
|
font-weight: ${({ theme: o }) => o.fontWeights.bold};
|
|
2499
2522
|
white-space: nowrap;
|
|
2500
2523
|
|
|
2501
|
-
padding: ${({ $size: o, theme: r }) =>
|
|
2524
|
+
padding: ${({ $size: o, theme: r }) => ir(o, r)};
|
|
2502
2525
|
|
|
2503
2526
|
${({ theme: o, $bordered: r }) => o.brutalism ? t`` : t`
|
|
2504
2527
|
border-bottom: 2px solid var(--th-sep);
|
|
@@ -2509,7 +2532,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2509
2532
|
}
|
|
2510
2533
|
`}
|
|
2511
2534
|
`}
|
|
2512
|
-
`,
|
|
2535
|
+
`, Vt = s.button`
|
|
2513
2536
|
display: inline-flex;
|
|
2514
2537
|
align-items: center;
|
|
2515
2538
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
@@ -2528,12 +2551,12 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2528
2551
|
outline-offset: 2px;
|
|
2529
2552
|
border-radius: 2px;
|
|
2530
2553
|
}
|
|
2531
|
-
`,
|
|
2554
|
+
`, Bt = s.span`
|
|
2532
2555
|
opacity: 0.5;
|
|
2533
2556
|
display: inline-flex;
|
|
2534
2557
|
align-items: center;
|
|
2535
|
-
`,
|
|
2536
|
-
padding: ${({ $size: o, theme: r }) =>
|
|
2558
|
+
`, ar = s.td`
|
|
2559
|
+
padding: ${({ $size: o, theme: r }) => ir(o, r)};
|
|
2537
2560
|
|
|
2538
2561
|
${({ $bordered: o, $borderColor: r, theme: n }) => n.brutalism ? t`
|
|
2539
2562
|
border-bottom: ${n.brutalism.borderWidth} solid
|
|
@@ -2551,7 +2574,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2551
2574
|
border-bottom: 1px solid
|
|
2552
2575
|
${r ?? n.colors.neutral[200]};
|
|
2553
2576
|
`}
|
|
2554
|
-
`, Ft =
|
|
2577
|
+
`, Ft = s.td`
|
|
2555
2578
|
text-align: center;
|
|
2556
2579
|
color: ${({ theme: o }) => o.colors.neutral[400]};
|
|
2557
2580
|
padding: ${({ theme: o }) => `${o.spacing[4]} ${o.spacing[3]}`};
|
|
@@ -2560,7 +2583,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2560
2583
|
`, At = oo`
|
|
2561
2584
|
0% { background-position: -400px 0; }
|
|
2562
2585
|
100% { background-position: 400px 0; }
|
|
2563
|
-
`,
|
|
2586
|
+
`, _t = s(ar)``, jt = s.div`
|
|
2564
2587
|
height: 14px;
|
|
2565
2588
|
border-radius: 4px;
|
|
2566
2589
|
background: linear-gradient(
|
|
@@ -2571,13 +2594,14 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2571
2594
|
);
|
|
2572
2595
|
background-size: 800px 100%;
|
|
2573
2596
|
animation: ${At} 1.6s ease-in-out infinite;
|
|
2574
|
-
`,
|
|
2597
|
+
`, Ht = s.div`
|
|
2575
2598
|
display: flex;
|
|
2576
2599
|
align-items: center;
|
|
2577
2600
|
justify-content: ${({ $hasPageSizeOptions: o }) => o ? "space-between" : "center"};
|
|
2578
2601
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
2579
2602
|
padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
|
|
2580
2603
|
flex-shrink: 0;
|
|
2604
|
+
flex-wrap: wrap;
|
|
2581
2605
|
|
|
2582
2606
|
${({ theme: o }) => o.brutalism ? t`
|
|
2583
2607
|
border-top: ${o.brutalism.borderWidth} solid
|
|
@@ -2585,7 +2609,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2585
2609
|
` : t`
|
|
2586
2610
|
border-top: 1px solid ${o.colors.neutral[200]};
|
|
2587
2611
|
`}
|
|
2588
|
-
`,
|
|
2612
|
+
`, Ut = s.label`
|
|
2589
2613
|
display: flex;
|
|
2590
2614
|
align-items: center;
|
|
2591
2615
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
@@ -2618,11 +2642,13 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2618
2642
|
}
|
|
2619
2643
|
`}
|
|
2620
2644
|
}
|
|
2621
|
-
`, Yt =
|
|
2645
|
+
`, Yt = s.div`
|
|
2622
2646
|
display: flex;
|
|
2623
2647
|
align-items: center;
|
|
2624
2648
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
2625
|
-
|
|
2649
|
+
flex-wrap: wrap;
|
|
2650
|
+
justify-content: center;
|
|
2651
|
+
`, ko = s.button`
|
|
2626
2652
|
display: inline-flex;
|
|
2627
2653
|
align-items: center;
|
|
2628
2654
|
justify-content: center;
|
|
@@ -2665,25 +2691,25 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2665
2691
|
outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
|
|
2666
2692
|
outline-offset: 2px;
|
|
2667
2693
|
}
|
|
2668
|
-
`,
|
|
2669
|
-
function
|
|
2670
|
-
return o?.key !== r ? /* @__PURE__ */
|
|
2694
|
+
`, Kt = 4;
|
|
2695
|
+
function qt(o, r) {
|
|
2696
|
+
return o?.key !== r ? /* @__PURE__ */ i(Fr, { size: 14 }) : o.direction === "asc" ? /* @__PURE__ */ i(_r, { size: 14 }) : /* @__PURE__ */ i(Vr, { size: 14 });
|
|
2671
2697
|
}
|
|
2672
|
-
function
|
|
2698
|
+
function Gt({
|
|
2673
2699
|
columns: o,
|
|
2674
2700
|
data: r,
|
|
2675
2701
|
rowKey: n,
|
|
2676
|
-
size:
|
|
2702
|
+
size: e = "md",
|
|
2677
2703
|
striped: a,
|
|
2678
2704
|
bordered: l,
|
|
2679
2705
|
stickyHeader: d,
|
|
2680
2706
|
stickyPagination: p,
|
|
2681
2707
|
caption: u,
|
|
2682
2708
|
emptyMessage: f = "No data",
|
|
2683
|
-
loading:
|
|
2709
|
+
loading: $,
|
|
2684
2710
|
sort: m,
|
|
2685
2711
|
defaultSort: v,
|
|
2686
|
-
onSortChange:
|
|
2712
|
+
onSortChange: y,
|
|
2687
2713
|
pageSize: k,
|
|
2688
2714
|
page: C,
|
|
2689
2715
|
defaultPage: M,
|
|
@@ -2694,113 +2720,114 @@ function qt({
|
|
|
2694
2720
|
onChange: w,
|
|
2695
2721
|
onRowClick: b,
|
|
2696
2722
|
borderColor: z,
|
|
2697
|
-
headerColor:
|
|
2698
|
-
rowColor:
|
|
2723
|
+
headerColor: E,
|
|
2724
|
+
rowColor: D,
|
|
2699
2725
|
stripeColor: N,
|
|
2700
2726
|
className: F,
|
|
2701
|
-
style:
|
|
2727
|
+
style: B
|
|
2702
2728
|
}) {
|
|
2703
2729
|
const {
|
|
2704
2730
|
activeSort: V,
|
|
2705
|
-
sortedData:
|
|
2706
|
-
handleSort:
|
|
2707
|
-
} =
|
|
2731
|
+
sortedData: q,
|
|
2732
|
+
handleSort: ao
|
|
2733
|
+
} = Tt({
|
|
2708
2734
|
data: r,
|
|
2709
2735
|
sort: m,
|
|
2710
2736
|
defaultSort: v,
|
|
2711
|
-
onSortChange:
|
|
2737
|
+
onSortChange: y
|
|
2712
2738
|
}), {
|
|
2713
2739
|
activePage: O,
|
|
2714
2740
|
totalPages: H,
|
|
2715
|
-
displayData:
|
|
2716
|
-
handlePageChange:
|
|
2717
|
-
} =
|
|
2718
|
-
data:
|
|
2741
|
+
displayData: lo,
|
|
2742
|
+
handlePageChange: G
|
|
2743
|
+
} = Dt({
|
|
2744
|
+
data: q,
|
|
2719
2745
|
pageSize: k,
|
|
2720
2746
|
page: C,
|
|
2721
2747
|
defaultPage: M,
|
|
2722
2748
|
totalRows: P,
|
|
2723
2749
|
onPageChange: L
|
|
2724
|
-
}),
|
|
2725
|
-
const A =
|
|
2750
|
+
}), no = (h) => {
|
|
2751
|
+
const A = ao(h);
|
|
2726
2752
|
w?.({ sort: A, page: O });
|
|
2727
|
-
}, J = (
|
|
2728
|
-
|
|
2729
|
-
},
|
|
2730
|
-
u && /* @__PURE__ */
|
|
2731
|
-
/* @__PURE__ */
|
|
2732
|
-
|
|
2753
|
+
}, J = (h) => {
|
|
2754
|
+
G(h), w?.({ sort: V, page: h });
|
|
2755
|
+
}, co = (h, A) => String(n ? h[n] : A), j = !$ && lo.length === 0, U = k ?? Kt, Q = !!k && H > 1, Z = !!x?.length, eo = /* @__PURE__ */ S(Mt, { $size: e, children: [
|
|
2756
|
+
u && /* @__PURE__ */ i("caption", { children: u }),
|
|
2757
|
+
/* @__PURE__ */ i(
|
|
2758
|
+
Lt,
|
|
2733
2759
|
{
|
|
2734
|
-
$headerColor:
|
|
2760
|
+
$headerColor: E,
|
|
2735
2761
|
$borderColor: z,
|
|
2736
2762
|
$stickyHeader: d,
|
|
2737
|
-
children: /* @__PURE__ */
|
|
2738
|
-
|
|
2763
|
+
children: /* @__PURE__ */ i(xo, { children: o.map((h) => /* @__PURE__ */ i(
|
|
2764
|
+
Rt,
|
|
2739
2765
|
{
|
|
2740
|
-
$size:
|
|
2766
|
+
$size: e,
|
|
2741
2767
|
$bordered: l,
|
|
2742
2768
|
scope: "col",
|
|
2743
|
-
style:
|
|
2744
|
-
children:
|
|
2745
|
-
|
|
2769
|
+
style: h.width ? { width: h.width } : void 0,
|
|
2770
|
+
children: h.sortable ? /* @__PURE__ */ S(
|
|
2771
|
+
Vt,
|
|
2746
2772
|
{
|
|
2747
2773
|
type: "button",
|
|
2748
|
-
onClick: () =>
|
|
2749
|
-
"aria-label": `Sort by ${
|
|
2774
|
+
onClick: () => no(h.key),
|
|
2775
|
+
"aria-label": `Sort by ${h.header}${V?.key === h.key ? `, ${V.direction}ending` : ""}`,
|
|
2750
2776
|
children: [
|
|
2751
|
-
|
|
2752
|
-
/* @__PURE__ */
|
|
2777
|
+
h.header,
|
|
2778
|
+
/* @__PURE__ */ i(Bt, { "aria-hidden": "true", children: qt(V, h.key) })
|
|
2753
2779
|
]
|
|
2754
2780
|
}
|
|
2755
|
-
) :
|
|
2781
|
+
) : h.header
|
|
2756
2782
|
},
|
|
2757
|
-
|
|
2783
|
+
h.key
|
|
2758
2784
|
)) })
|
|
2759
2785
|
}
|
|
2760
2786
|
),
|
|
2761
|
-
/* @__PURE__ */
|
|
2762
|
-
|
|
2787
|
+
/* @__PURE__ */ i(Nt, { $striped: a, $rowColor: D, $stripeColor: N, children: $ ? Array.from({ length: U }).map((h, A) => /* @__PURE__ */ i(xo, { children: o.map((uo) => /* @__PURE__ */ i(
|
|
2788
|
+
_t,
|
|
2763
2789
|
{
|
|
2764
|
-
$size:
|
|
2790
|
+
$size: e,
|
|
2765
2791
|
$bordered: l,
|
|
2766
2792
|
$borderColor: z,
|
|
2767
|
-
children: /* @__PURE__ */
|
|
2793
|
+
children: /* @__PURE__ */ i(jt, {})
|
|
2768
2794
|
},
|
|
2769
|
-
|
|
2770
|
-
)) }, A)) : j ? /* @__PURE__ */
|
|
2771
|
-
b ?
|
|
2795
|
+
uo.key
|
|
2796
|
+
)) }, A)) : j ? /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i(Ft, { colSpan: o.length, children: f }) }) : lo.map((h, A) => /* @__PURE__ */ i(
|
|
2797
|
+
b ? Pt : xo,
|
|
2772
2798
|
{
|
|
2773
|
-
onClick: b ? () => b(
|
|
2799
|
+
onClick: b ? () => b(h) : void 0,
|
|
2774
2800
|
$accentColor: b ? z : void 0,
|
|
2775
|
-
children: o.map((
|
|
2776
|
-
|
|
2801
|
+
children: o.map((g) => /* @__PURE__ */ i(
|
|
2802
|
+
ar,
|
|
2777
2803
|
{
|
|
2778
|
-
$size:
|
|
2804
|
+
$size: e,
|
|
2779
2805
|
$bordered: l,
|
|
2780
2806
|
$borderColor: z,
|
|
2781
|
-
children:
|
|
2807
|
+
children: g.render ? g.render(h[g.key], h, A) : String(h[g.key] ?? "") || " "
|
|
2782
2808
|
},
|
|
2783
|
-
|
|
2809
|
+
g.key
|
|
2784
2810
|
))
|
|
2785
2811
|
},
|
|
2786
|
-
|
|
2812
|
+
co(h, A)
|
|
2787
2813
|
)) })
|
|
2788
|
-
] }),
|
|
2789
|
-
Z && /* @__PURE__ */ S(
|
|
2814
|
+
] }), so = (Q || Z) && /* @__PURE__ */ S(Ht, { $hasPageSizeOptions: Z, children: [
|
|
2815
|
+
Z && /* @__PURE__ */ S(Ut, { children: [
|
|
2790
2816
|
"Rows per page:",
|
|
2791
|
-
/* @__PURE__ */
|
|
2792
|
-
|
|
2817
|
+
/* @__PURE__ */ i(
|
|
2818
|
+
qo,
|
|
2793
2819
|
{
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2820
|
+
size: "sm",
|
|
2821
|
+
value: String(k),
|
|
2822
|
+
options: x.map((h) => ({ value: String(h), label: String(h) })),
|
|
2823
|
+
onChange: (h) => I?.(Number(h.target.value)),
|
|
2824
|
+
"aria-label": "Rows per page"
|
|
2798
2825
|
}
|
|
2799
2826
|
)
|
|
2800
2827
|
] }),
|
|
2801
2828
|
Q && /* @__PURE__ */ S(Yt, { children: [
|
|
2802
|
-
/* @__PURE__ */
|
|
2803
|
-
|
|
2829
|
+
/* @__PURE__ */ i(
|
|
2830
|
+
ko,
|
|
2804
2831
|
{
|
|
2805
2832
|
type: "button",
|
|
2806
2833
|
onClick: () => J(O - 1),
|
|
@@ -2809,8 +2836,8 @@ function qt({
|
|
|
2809
2836
|
children: "←"
|
|
2810
2837
|
}
|
|
2811
2838
|
),
|
|
2812
|
-
|
|
2813
|
-
(
|
|
2839
|
+
Wt(O, H).map(
|
|
2840
|
+
(h, A) => h === "..." ? /* @__PURE__ */ i(
|
|
2814
2841
|
"span",
|
|
2815
2842
|
{
|
|
2816
2843
|
"aria-hidden": "true",
|
|
@@ -2818,21 +2845,21 @@ function qt({
|
|
|
2818
2845
|
children: "…"
|
|
2819
2846
|
},
|
|
2820
2847
|
`e${A}`
|
|
2821
|
-
) : /* @__PURE__ */
|
|
2822
|
-
|
|
2848
|
+
) : /* @__PURE__ */ i(
|
|
2849
|
+
ko,
|
|
2823
2850
|
{
|
|
2824
2851
|
type: "button",
|
|
2825
|
-
$active:
|
|
2826
|
-
onClick: () => J(
|
|
2827
|
-
"aria-label": `Page ${
|
|
2828
|
-
"aria-current":
|
|
2829
|
-
children:
|
|
2852
|
+
$active: h === O,
|
|
2853
|
+
onClick: () => J(h),
|
|
2854
|
+
"aria-label": `Page ${h}`,
|
|
2855
|
+
"aria-current": h === O ? "page" : void 0,
|
|
2856
|
+
children: h
|
|
2830
2857
|
},
|
|
2831
|
-
|
|
2858
|
+
h
|
|
2832
2859
|
)
|
|
2833
2860
|
),
|
|
2834
|
-
/* @__PURE__ */
|
|
2835
|
-
|
|
2861
|
+
/* @__PURE__ */ i(
|
|
2862
|
+
ko,
|
|
2836
2863
|
{
|
|
2837
2864
|
type: "button",
|
|
2838
2865
|
onClick: () => J(O + 1),
|
|
@@ -2844,26 +2871,26 @@ function qt({
|
|
|
2844
2871
|
] })
|
|
2845
2872
|
] });
|
|
2846
2873
|
return /* @__PURE__ */ S(
|
|
2847
|
-
|
|
2874
|
+
Et,
|
|
2848
2875
|
{
|
|
2849
2876
|
$borderColor: z,
|
|
2850
2877
|
$stickyPagination: p,
|
|
2851
2878
|
className: F,
|
|
2852
|
-
style:
|
|
2879
|
+
style: B,
|
|
2853
2880
|
children: [
|
|
2854
|
-
p ? /* @__PURE__ */
|
|
2855
|
-
|
|
2881
|
+
p ? /* @__PURE__ */ i(Ot, { children: eo }) : eo,
|
|
2882
|
+
so
|
|
2856
2883
|
]
|
|
2857
2884
|
}
|
|
2858
2885
|
);
|
|
2859
2886
|
}
|
|
2860
|
-
|
|
2861
|
-
const
|
|
2887
|
+
Gt.displayName = "Table";
|
|
2888
|
+
const Xt = s.p`
|
|
2862
2889
|
margin: 0;
|
|
2863
2890
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
2864
2891
|
color: ${({ theme: o }) => o.colors.neutral[600]};
|
|
2865
2892
|
line-height: 1.5;
|
|
2866
|
-
`,
|
|
2893
|
+
`, Jt = s.button`
|
|
2867
2894
|
display: inline-flex;
|
|
2868
2895
|
align-items: center;
|
|
2869
2896
|
justify-content: center;
|
|
@@ -2904,47 +2931,47 @@ const Gt = i.p`
|
|
|
2904
2931
|
}
|
|
2905
2932
|
`}
|
|
2906
2933
|
`;
|
|
2907
|
-
function
|
|
2934
|
+
function lr({
|
|
2908
2935
|
open: o,
|
|
2909
2936
|
title: r = "Are you sure?",
|
|
2910
2937
|
message: n,
|
|
2911
|
-
confirmLabel:
|
|
2938
|
+
confirmLabel: e = "Confirm",
|
|
2912
2939
|
cancelLabel: a = "Cancel",
|
|
2913
2940
|
variant: l = "default",
|
|
2914
2941
|
size: d = "sm",
|
|
2915
2942
|
onConfirm: p,
|
|
2916
2943
|
onCancel: u
|
|
2917
2944
|
}) {
|
|
2918
|
-
return /* @__PURE__ */
|
|
2919
|
-
|
|
2945
|
+
return /* @__PURE__ */ i(
|
|
2946
|
+
Xo,
|
|
2920
2947
|
{
|
|
2921
2948
|
open: o,
|
|
2922
2949
|
onClose: u,
|
|
2923
2950
|
title: r,
|
|
2924
2951
|
size: d,
|
|
2925
2952
|
closeOnBackdrop: !1,
|
|
2926
|
-
footer: /* @__PURE__ */ S(
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
l === "danger" ? /* @__PURE__ */
|
|
2953
|
+
footer: /* @__PURE__ */ S(ur, { children: [
|
|
2954
|
+
/* @__PURE__ */ i(Io, { variant: "outline", onClick: u, children: a }),
|
|
2955
|
+
l === "danger" ? /* @__PURE__ */ i(Jt, { type: "button", onClick: p, children: e }) : /* @__PURE__ */ i(Io, { variant: "primary", onClick: p, children: e })
|
|
2929
2956
|
] }),
|
|
2930
|
-
children: /* @__PURE__ */
|
|
2957
|
+
children: /* @__PURE__ */ i(Xt, { children: n })
|
|
2931
2958
|
}
|
|
2932
2959
|
);
|
|
2933
2960
|
}
|
|
2934
|
-
|
|
2935
|
-
const
|
|
2936
|
-
function
|
|
2937
|
-
const [r, n] = T(null),
|
|
2961
|
+
lr.displayName = "ConfirmDialog";
|
|
2962
|
+
const cr = Do(null);
|
|
2963
|
+
function We({ children: o }) {
|
|
2964
|
+
const [r, n] = T(null), e = X((d) => new Promise((p) => {
|
|
2938
2965
|
n({ ...d, resolve: p });
|
|
2939
2966
|
}), []), a = () => {
|
|
2940
2967
|
r?.resolve(!0), n(null);
|
|
2941
2968
|
}, l = () => {
|
|
2942
2969
|
r?.resolve(!1), n(null);
|
|
2943
2970
|
};
|
|
2944
|
-
return /* @__PURE__ */ S(
|
|
2971
|
+
return /* @__PURE__ */ S(cr.Provider, { value: { confirm: e }, children: [
|
|
2945
2972
|
o,
|
|
2946
|
-
r && /* @__PURE__ */
|
|
2947
|
-
|
|
2973
|
+
r && /* @__PURE__ */ i(
|
|
2974
|
+
lr,
|
|
2948
2975
|
{
|
|
2949
2976
|
open: !0,
|
|
2950
2977
|
title: r.title,
|
|
@@ -2959,18 +2986,18 @@ function Ts({ children: o }) {
|
|
|
2959
2986
|
)
|
|
2960
2987
|
] });
|
|
2961
2988
|
}
|
|
2962
|
-
function
|
|
2963
|
-
const o =
|
|
2989
|
+
function De() {
|
|
2990
|
+
const o = Wo(cr);
|
|
2964
2991
|
if (!o)
|
|
2965
2992
|
throw new Error("useConfirm must be used within a ConfirmProvider");
|
|
2966
2993
|
return o.confirm;
|
|
2967
2994
|
}
|
|
2968
|
-
const
|
|
2995
|
+
const Qt = s.div`
|
|
2969
2996
|
position: relative;
|
|
2970
2997
|
display: inline-flex;
|
|
2971
2998
|
flex-direction: column;
|
|
2972
2999
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
2973
|
-
`,
|
|
3000
|
+
`, Zt = s.div`
|
|
2974
3001
|
display: flex;
|
|
2975
3002
|
align-items: center;
|
|
2976
3003
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -3019,19 +3046,19 @@ const Jt = i.div`
|
|
|
3019
3046
|
outline: none;
|
|
3020
3047
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
3021
3048
|
}
|
|
3022
|
-
`,
|
|
3049
|
+
`, oe = s.span`
|
|
3023
3050
|
flex: 1;
|
|
3024
3051
|
color: ${({ $hasValue: o, theme: r }) => o ? r.colors.neutral[900] : r.colors.neutral[400]};
|
|
3025
3052
|
white-space: nowrap;
|
|
3026
3053
|
overflow: hidden;
|
|
3027
3054
|
text-overflow: ellipsis;
|
|
3028
|
-
`,
|
|
3055
|
+
`, re = s.span`
|
|
3029
3056
|
display: inline-flex;
|
|
3030
3057
|
align-items: center;
|
|
3031
3058
|
margin-left: ${({ theme: o }) => o.spacing[2]};
|
|
3032
3059
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
3033
3060
|
flex-shrink: 0;
|
|
3034
|
-
`,
|
|
3061
|
+
`, ne = s.button`
|
|
3035
3062
|
display: inline-flex;
|
|
3036
3063
|
align-items: center;
|
|
3037
3064
|
margin-left: ${({ theme: o }) => o.spacing[2]};
|
|
@@ -3052,11 +3079,11 @@ const Jt = i.div`
|
|
|
3052
3079
|
border-radius: 2px;
|
|
3053
3080
|
}
|
|
3054
3081
|
`;
|
|
3055
|
-
|
|
3082
|
+
s.span`
|
|
3056
3083
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
3057
3084
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
3058
3085
|
`;
|
|
3059
|
-
const
|
|
3086
|
+
const te = s.div`
|
|
3060
3087
|
position: absolute;
|
|
3061
3088
|
top: calc(100% + 4px);
|
|
3062
3089
|
left: 0;
|
|
@@ -3075,12 +3102,12 @@ const ns = i.div`
|
|
|
3075
3102
|
border: 1px solid ${o.colors.neutral[200]};
|
|
3076
3103
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
3077
3104
|
`}
|
|
3078
|
-
`,
|
|
3105
|
+
`, ee = s.div`
|
|
3079
3106
|
display: flex;
|
|
3080
3107
|
align-items: center;
|
|
3081
3108
|
justify-content: space-between;
|
|
3082
3109
|
margin-bottom: ${({ theme: o }) => o.spacing[3]};
|
|
3083
|
-
`,
|
|
3110
|
+
`, Ao = s.button`
|
|
3084
3111
|
display: inline-flex;
|
|
3085
3112
|
align-items: center;
|
|
3086
3113
|
justify-content: center;
|
|
@@ -3110,15 +3137,15 @@ const ns = i.div`
|
|
|
3110
3137
|
transform: translate(1px, 1px);
|
|
3111
3138
|
}
|
|
3112
3139
|
`}
|
|
3113
|
-
`,
|
|
3140
|
+
`, se = s.span`
|
|
3114
3141
|
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
3115
3142
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
3116
3143
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
3117
|
-
`,
|
|
3144
|
+
`, ie = s.div`
|
|
3118
3145
|
display: grid;
|
|
3119
3146
|
grid-template-columns: repeat(7, 1fr);
|
|
3120
3147
|
gap: ${({ theme: o }) => o.spacing[0.5]};
|
|
3121
|
-
`,
|
|
3148
|
+
`, ae = s.span`
|
|
3122
3149
|
display: flex;
|
|
3123
3150
|
align-items: center;
|
|
3124
3151
|
justify-content: center;
|
|
@@ -3127,7 +3154,7 @@ const ns = i.div`
|
|
|
3127
3154
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
3128
3155
|
padding: ${({ theme: o }) => o.spacing[1]};
|
|
3129
3156
|
margin-bottom: ${({ theme: o }) => o.spacing[0.5]};
|
|
3130
|
-
`,
|
|
3157
|
+
`, So = s.button`
|
|
3131
3158
|
display: flex;
|
|
3132
3159
|
align-items: center;
|
|
3133
3160
|
justify-content: center;
|
|
@@ -3142,32 +3169,32 @@ const ns = i.div`
|
|
|
3142
3169
|
$today: o,
|
|
3143
3170
|
$selected: r,
|
|
3144
3171
|
$rangeStart: n,
|
|
3145
|
-
$rangeEnd:
|
|
3172
|
+
$rangeEnd: e,
|
|
3146
3173
|
$inRange: a,
|
|
3147
3174
|
theme: l
|
|
3148
|
-
}) => o || r || n ||
|
|
3175
|
+
}) => o || r || n || e ? l.fontWeights.semibold : l.fontWeights.normal};
|
|
3149
3176
|
pointer-events: ${({ $currentMonth: o }) => o ? "auto" : "none"};
|
|
3150
3177
|
|
|
3151
3178
|
color: ${({
|
|
3152
3179
|
$currentMonth: o,
|
|
3153
3180
|
$selected: r,
|
|
3154
3181
|
$today: n,
|
|
3155
|
-
$rangeStart:
|
|
3182
|
+
$rangeStart: e,
|
|
3156
3183
|
$rangeEnd: a,
|
|
3157
3184
|
theme: l
|
|
3158
|
-
}) => o ? r ||
|
|
3185
|
+
}) => o ? r || e || a ? l.colors.primary.contrast : n ? l.colors.primary[500] : l.colors.neutral[900] : l.colors.neutral[300]};
|
|
3159
3186
|
|
|
3160
3187
|
background-color: ${({
|
|
3161
3188
|
$selected: o,
|
|
3162
3189
|
$rangeStart: r,
|
|
3163
3190
|
$rangeEnd: n,
|
|
3164
|
-
$inRange:
|
|
3191
|
+
$inRange: e,
|
|
3165
3192
|
$currentMonth: a,
|
|
3166
3193
|
theme: l
|
|
3167
|
-
}) => a ? o || r || n ? l.colors.primary[500] :
|
|
3194
|
+
}) => a ? o || r || n ? l.colors.primary[500] : e ? l.colors.primary[50] : "transparent" : "transparent"};
|
|
3168
3195
|
|
|
3169
3196
|
&:hover:not(:disabled) {
|
|
3170
|
-
background-color: ${({ $selected: o, $rangeStart: r, $rangeEnd: n, theme:
|
|
3197
|
+
background-color: ${({ $selected: o, $rangeStart: r, $rangeEnd: n, theme: e }) => o || r || n ? e.colors.primary[700] : e.colors.neutral[100]};
|
|
3171
3198
|
}
|
|
3172
3199
|
|
|
3173
3200
|
&:disabled {
|
|
@@ -3180,13 +3207,13 @@ const ns = i.div`
|
|
|
3180
3207
|
outline-offset: 1px;
|
|
3181
3208
|
}
|
|
3182
3209
|
|
|
3183
|
-
${({ $selected: o, $rangeStart: r, $rangeEnd: n, $today:
|
|
3210
|
+
${({ $selected: o, $rangeStart: r, $rangeEnd: n, $today: e, theme: a }) => a.brutalism && (o || r || n || e) && t`
|
|
3184
3211
|
border: ${a.brutalism.borderWidth} solid ${a.colors.neutral[900]};
|
|
3185
3212
|
${(o || r || n) && t`
|
|
3186
3213
|
box-shadow: 2px 2px 0 ${a.colors.neutral[900]};
|
|
3187
3214
|
`}
|
|
3188
3215
|
`}
|
|
3189
|
-
`,
|
|
3216
|
+
`, le = [
|
|
3190
3217
|
"January",
|
|
3191
3218
|
"February",
|
|
3192
3219
|
"March",
|
|
@@ -3199,33 +3226,33 @@ const ns = i.div`
|
|
|
3199
3226
|
"October",
|
|
3200
3227
|
"November",
|
|
3201
3228
|
"December"
|
|
3202
|
-
],
|
|
3229
|
+
], ce = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
3203
3230
|
function _o(o, r) {
|
|
3204
3231
|
return new Date(o, r + 1, 0).getDate();
|
|
3205
3232
|
}
|
|
3206
|
-
function
|
|
3233
|
+
function de(o, r) {
|
|
3207
3234
|
return new Date(o, r, 1).getDay();
|
|
3208
3235
|
}
|
|
3209
|
-
function
|
|
3236
|
+
function go(o, r) {
|
|
3210
3237
|
return o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate();
|
|
3211
3238
|
}
|
|
3212
|
-
function
|
|
3239
|
+
function ue(o, r, n) {
|
|
3213
3240
|
if (r) {
|
|
3214
|
-
const
|
|
3241
|
+
const e = new Date(
|
|
3215
3242
|
r.getFullYear(),
|
|
3216
3243
|
r.getMonth(),
|
|
3217
3244
|
r.getDate()
|
|
3218
3245
|
);
|
|
3219
|
-
if (o <
|
|
3246
|
+
if (o < e)
|
|
3220
3247
|
return !0;
|
|
3221
3248
|
}
|
|
3222
3249
|
if (n) {
|
|
3223
|
-
const
|
|
3250
|
+
const e = new Date(
|
|
3224
3251
|
n.getFullYear(),
|
|
3225
3252
|
n.getMonth(),
|
|
3226
3253
|
n.getDate()
|
|
3227
3254
|
);
|
|
3228
|
-
if (o >
|
|
3255
|
+
if (o > e)
|
|
3229
3256
|
return !0;
|
|
3230
3257
|
}
|
|
3231
3258
|
return !1;
|
|
@@ -3245,182 +3272,182 @@ function Ho(o) {
|
|
|
3245
3272
|
year: "numeric"
|
|
3246
3273
|
});
|
|
3247
3274
|
}
|
|
3248
|
-
function
|
|
3275
|
+
function zo(o) {
|
|
3249
3276
|
if (!o)
|
|
3250
3277
|
return null;
|
|
3251
3278
|
const r = o.split("-");
|
|
3252
3279
|
if (r.length !== 3)
|
|
3253
3280
|
return null;
|
|
3254
|
-
const n = parseInt(r[0], 10),
|
|
3255
|
-
return isNaN(n) || isNaN(
|
|
3281
|
+
const n = parseInt(r[0], 10), e = parseInt(r[1], 10), a = parseInt(r[2], 10);
|
|
3282
|
+
return isNaN(n) || isNaN(e) || isNaN(a) ? null : new Date(n, e - 1, a);
|
|
3256
3283
|
}
|
|
3257
|
-
function
|
|
3258
|
-
const r = o.getFullYear(), n = String(o.getMonth() + 1).padStart(2, "0"),
|
|
3259
|
-
return `${r}-${n}-${
|
|
3284
|
+
function fo(o) {
|
|
3285
|
+
const r = o.getFullYear(), n = String(o.getMonth() + 1).padStart(2, "0"), e = String(o.getDate()).padStart(2, "0");
|
|
3286
|
+
return `${r}-${n}-${e}`;
|
|
3260
3287
|
}
|
|
3261
|
-
function
|
|
3288
|
+
function pe({
|
|
3262
3289
|
name: o,
|
|
3263
3290
|
label: r,
|
|
3264
3291
|
value: n,
|
|
3265
|
-
onChange:
|
|
3292
|
+
onChange: e,
|
|
3266
3293
|
placeholder: a = "Select date...",
|
|
3267
3294
|
size: l = "md",
|
|
3268
3295
|
disabled: d = !1,
|
|
3269
3296
|
clearable: p = !1,
|
|
3270
3297
|
minDate: u,
|
|
3271
3298
|
maxDate: f,
|
|
3272
|
-
formatDate:
|
|
3299
|
+
formatDate: $,
|
|
3273
3300
|
error: m,
|
|
3274
3301
|
required: v,
|
|
3275
|
-
helperText:
|
|
3302
|
+
helperText: y,
|
|
3276
3303
|
mode: k = "single",
|
|
3277
3304
|
nameFrom: C,
|
|
3278
3305
|
nameTo: M,
|
|
3279
3306
|
valueFrom: P,
|
|
3280
3307
|
valueTo: L
|
|
3281
3308
|
}) {
|
|
3282
|
-
const x = k === "range", I =
|
|
3283
|
-
() =>
|
|
3284
|
-
), [V,
|
|
3285
|
-
() =>
|
|
3286
|
-
), [
|
|
3287
|
-
|
|
3288
|
-
if (!
|
|
3309
|
+
const x = k === "range", I = zo(n ?? ""), w = zo(P ?? ""), b = zo(L ?? ""), z = /* @__PURE__ */ new Date(), E = () => x ? w ?? b ?? z : I ?? z, [D, N] = T(!1), [F, B] = T(
|
|
3310
|
+
() => E().getFullYear()
|
|
3311
|
+
), [V, q] = T(
|
|
3312
|
+
() => E().getMonth()
|
|
3313
|
+
), [ao, O] = T("from"), H = K(null);
|
|
3314
|
+
_(() => {
|
|
3315
|
+
if (!D)
|
|
3289
3316
|
return;
|
|
3290
|
-
const
|
|
3317
|
+
const g = (R) => {
|
|
3291
3318
|
H.current && !H.current.contains(R.target) && (N(!1), x && O("from"));
|
|
3292
3319
|
};
|
|
3293
|
-
return document.addEventListener("mousedown",
|
|
3294
|
-
}, [
|
|
3295
|
-
!x && I && (
|
|
3296
|
-
}, [n, x]),
|
|
3297
|
-
x && w && (
|
|
3320
|
+
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
3321
|
+
}, [D, x]), _(() => {
|
|
3322
|
+
!x && I && (B(I.getFullYear()), q(I.getMonth()));
|
|
3323
|
+
}, [n, x]), _(() => {
|
|
3324
|
+
x && w && (B(w.getFullYear()), q(w.getMonth()));
|
|
3298
3325
|
}, [P, x]);
|
|
3299
|
-
const
|
|
3326
|
+
const G = (() => {
|
|
3300
3327
|
if (!x)
|
|
3301
|
-
return I ?
|
|
3328
|
+
return I ? $ ? $(I) : jo(I) : "";
|
|
3302
3329
|
if (!w && !b)
|
|
3303
3330
|
return "";
|
|
3304
|
-
const
|
|
3305
|
-
return w && b ? `${
|
|
3306
|
-
})(),
|
|
3307
|
-
const R = new Date(F, V,
|
|
3331
|
+
const g = $ ?? jo;
|
|
3332
|
+
return w && b ? `${g(w)} - ${g(b)}` : w ? `${g(w)} - ...` : "";
|
|
3333
|
+
})(), no = x ? !!(w || b) : !!I, J = (g) => {
|
|
3334
|
+
const R = new Date(F, V, g);
|
|
3308
3335
|
if (!x) {
|
|
3309
|
-
|
|
3336
|
+
e(o ?? "", fo(R)), N(!1);
|
|
3310
3337
|
return;
|
|
3311
3338
|
}
|
|
3312
|
-
if (
|
|
3313
|
-
|
|
3339
|
+
if (ao === "from") {
|
|
3340
|
+
e(C ?? "", fo(R)), O("to");
|
|
3314
3341
|
return;
|
|
3315
3342
|
}
|
|
3316
3343
|
if (!w) {
|
|
3317
|
-
|
|
3344
|
+
e(C ?? "", fo(R)), O("to");
|
|
3318
3345
|
return;
|
|
3319
3346
|
}
|
|
3320
|
-
if (
|
|
3321
|
-
|
|
3347
|
+
if (go(R, w)) {
|
|
3348
|
+
e(C ?? "", ""), e(M ?? "", ""), O("from");
|
|
3322
3349
|
return;
|
|
3323
3350
|
}
|
|
3324
3351
|
if (R >= w) {
|
|
3325
|
-
|
|
3352
|
+
e(M ?? "", fo(R)), O("from"), N(!1);
|
|
3326
3353
|
return;
|
|
3327
3354
|
}
|
|
3328
|
-
|
|
3329
|
-
},
|
|
3330
|
-
|
|
3355
|
+
e(M ?? "", fo(w)), e(C ?? "", fo(R)), O("from"), N(!1);
|
|
3356
|
+
}, co = (g) => {
|
|
3357
|
+
g.stopPropagation(), x ? (e(C ?? "", ""), e(M ?? "", ""), O("from")) : e(o ?? "", "");
|
|
3331
3358
|
}, j = () => {
|
|
3332
3359
|
if (d)
|
|
3333
3360
|
return;
|
|
3334
|
-
const
|
|
3335
|
-
N(
|
|
3336
|
-
},
|
|
3337
|
-
if ((
|
|
3338
|
-
|
|
3339
|
-
const R = !
|
|
3361
|
+
const g = !D;
|
|
3362
|
+
N(g), !g && x && O("from");
|
|
3363
|
+
}, U = (g) => {
|
|
3364
|
+
if ((g.key === "Enter" || g.key === " ") && !d) {
|
|
3365
|
+
g.preventDefault();
|
|
3366
|
+
const R = !D;
|
|
3340
3367
|
N(R), !R && x && O("from");
|
|
3341
3368
|
}
|
|
3342
|
-
|
|
3369
|
+
g.key === "Escape" && (N(!1), x && O("from"));
|
|
3343
3370
|
}, Q = () => {
|
|
3344
|
-
V === 0 ? (
|
|
3371
|
+
V === 0 ? (q(11), B((g) => g - 1)) : q((g) => g - 1);
|
|
3345
3372
|
}, Z = () => {
|
|
3346
|
-
V === 11 ? (
|
|
3347
|
-
},
|
|
3373
|
+
V === 11 ? (q(0), B((g) => g + 1)) : q((g) => g + 1);
|
|
3374
|
+
}, eo = _o(F, V), so = de(F, V), h = [], A = _o(
|
|
3348
3375
|
V === 0 ? F - 1 : F,
|
|
3349
3376
|
V === 0 ? 11 : V - 1
|
|
3350
3377
|
);
|
|
3351
|
-
for (let
|
|
3352
|
-
|
|
3353
|
-
for (let
|
|
3354
|
-
|
|
3355
|
-
const
|
|
3356
|
-
for (let
|
|
3357
|
-
|
|
3358
|
-
return /* @__PURE__ */
|
|
3378
|
+
for (let g = so - 1; g >= 0; g--)
|
|
3379
|
+
h.push({ day: A - g, currentMonth: !1 });
|
|
3380
|
+
for (let g = 1; g <= eo; g++)
|
|
3381
|
+
h.push({ day: g, currentMonth: !0 });
|
|
3382
|
+
const uo = 42 - h.length;
|
|
3383
|
+
for (let g = 1; g <= uo; g++)
|
|
3384
|
+
h.push({ day: g, currentMonth: !1 });
|
|
3385
|
+
return /* @__PURE__ */ i(
|
|
3359
3386
|
sr,
|
|
3360
3387
|
{
|
|
3361
3388
|
label: r,
|
|
3362
3389
|
error: m,
|
|
3363
|
-
helperText:
|
|
3390
|
+
helperText: y,
|
|
3364
3391
|
required: v,
|
|
3365
|
-
children: /* @__PURE__ */ S(
|
|
3392
|
+
children: /* @__PURE__ */ S(Qt, { ref: H, children: [
|
|
3366
3393
|
/* @__PURE__ */ S(
|
|
3367
|
-
|
|
3394
|
+
Zt,
|
|
3368
3395
|
{
|
|
3369
3396
|
$size: l,
|
|
3370
3397
|
$error: !!m,
|
|
3371
3398
|
$disabled: d,
|
|
3372
3399
|
role: "combobox",
|
|
3373
3400
|
"aria-haspopup": "true",
|
|
3374
|
-
"aria-expanded":
|
|
3401
|
+
"aria-expanded": D,
|
|
3375
3402
|
tabIndex: d ? -1 : 0,
|
|
3376
3403
|
onClick: j,
|
|
3377
|
-
onKeyDown:
|
|
3404
|
+
onKeyDown: U,
|
|
3378
3405
|
children: [
|
|
3379
|
-
/* @__PURE__ */
|
|
3380
|
-
p &&
|
|
3381
|
-
|
|
3406
|
+
/* @__PURE__ */ i(oe, { $hasValue: no, children: G || a }),
|
|
3407
|
+
p && no ? /* @__PURE__ */ i(
|
|
3408
|
+
ne,
|
|
3382
3409
|
{
|
|
3383
3410
|
type: "button",
|
|
3384
|
-
onClick:
|
|
3411
|
+
onClick: co,
|
|
3385
3412
|
"aria-label": "Clear date",
|
|
3386
|
-
children: /* @__PURE__ */
|
|
3413
|
+
children: /* @__PURE__ */ i(ho, { size: 14 })
|
|
3387
3414
|
}
|
|
3388
|
-
) : /* @__PURE__ */
|
|
3415
|
+
) : /* @__PURE__ */ i(re, { "aria-hidden": "true", children: /* @__PURE__ */ i(Hr, { size: 14 }) })
|
|
3389
3416
|
]
|
|
3390
3417
|
}
|
|
3391
3418
|
),
|
|
3392
|
-
|
|
3393
|
-
/* @__PURE__ */ S(
|
|
3394
|
-
/* @__PURE__ */
|
|
3395
|
-
|
|
3419
|
+
D && /* @__PURE__ */ S(te, { role: "dialog", "aria-label": "Calendar", children: [
|
|
3420
|
+
/* @__PURE__ */ S(ee, { children: [
|
|
3421
|
+
/* @__PURE__ */ i(
|
|
3422
|
+
Ao,
|
|
3396
3423
|
{
|
|
3397
3424
|
type: "button",
|
|
3398
3425
|
onClick: Q,
|
|
3399
3426
|
"aria-label": "Previous month",
|
|
3400
|
-
children: /* @__PURE__ */
|
|
3427
|
+
children: /* @__PURE__ */ i(Kr, { size: 16 })
|
|
3401
3428
|
}
|
|
3402
3429
|
),
|
|
3403
|
-
/* @__PURE__ */ S(
|
|
3404
|
-
|
|
3430
|
+
/* @__PURE__ */ S(se, { children: [
|
|
3431
|
+
le[V],
|
|
3405
3432
|
" ",
|
|
3406
3433
|
F
|
|
3407
3434
|
] }),
|
|
3408
|
-
/* @__PURE__ */
|
|
3409
|
-
|
|
3435
|
+
/* @__PURE__ */ i(
|
|
3436
|
+
Ao,
|
|
3410
3437
|
{
|
|
3411
3438
|
type: "button",
|
|
3412
3439
|
onClick: Z,
|
|
3413
3440
|
"aria-label": "Next month",
|
|
3414
|
-
children: /* @__PURE__ */
|
|
3441
|
+
children: /* @__PURE__ */ i(Gr, { size: 16 })
|
|
3415
3442
|
}
|
|
3416
3443
|
)
|
|
3417
3444
|
] }),
|
|
3418
|
-
/* @__PURE__ */ S(
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
if (
|
|
3422
|
-
return /* @__PURE__ */
|
|
3423
|
-
|
|
3445
|
+
/* @__PURE__ */ S(ie, { children: [
|
|
3446
|
+
ce.map((g) => /* @__PURE__ */ i(ae, { children: g }, g)),
|
|
3447
|
+
h.map((g, R) => {
|
|
3448
|
+
if (!g.currentMonth)
|
|
3449
|
+
return /* @__PURE__ */ i(
|
|
3450
|
+
So,
|
|
3424
3451
|
{
|
|
3425
3452
|
type: "button",
|
|
3426
3453
|
$currentMonth: !1,
|
|
@@ -3428,45 +3455,45 @@ function us({
|
|
|
3428
3455
|
$today: !1,
|
|
3429
3456
|
disabled: !0,
|
|
3430
3457
|
tabIndex: -1,
|
|
3431
|
-
children:
|
|
3458
|
+
children: g.day
|
|
3432
3459
|
},
|
|
3433
3460
|
R
|
|
3434
3461
|
);
|
|
3435
|
-
const c = new Date(F, V,
|
|
3462
|
+
const c = new Date(F, V, g.day), W = go(c, z), Y = ue(c, u, f);
|
|
3436
3463
|
if (x) {
|
|
3437
|
-
const
|
|
3438
|
-
return /* @__PURE__ */
|
|
3439
|
-
|
|
3464
|
+
const $o = w ? go(c, w) : !1, Oo = b ? go(c, b) : !1, dr = w && b ? c > w && c < b : !1;
|
|
3465
|
+
return /* @__PURE__ */ i(
|
|
3466
|
+
So,
|
|
3440
3467
|
{
|
|
3441
3468
|
type: "button",
|
|
3442
3469
|
$currentMonth: !0,
|
|
3443
3470
|
$selected: !1,
|
|
3444
|
-
$today:
|
|
3445
|
-
$rangeStart:
|
|
3471
|
+
$today: W,
|
|
3472
|
+
$rangeStart: $o,
|
|
3446
3473
|
$rangeEnd: Oo,
|
|
3447
|
-
$inRange:
|
|
3448
|
-
disabled:
|
|
3474
|
+
$inRange: dr,
|
|
3475
|
+
disabled: Y,
|
|
3449
3476
|
"aria-label": Ho(c),
|
|
3450
|
-
"aria-pressed":
|
|
3451
|
-
onClick: () => J(
|
|
3452
|
-
children:
|
|
3477
|
+
"aria-pressed": $o || Oo,
|
|
3478
|
+
onClick: () => J(g.day),
|
|
3479
|
+
children: g.day
|
|
3453
3480
|
},
|
|
3454
3481
|
R
|
|
3455
3482
|
);
|
|
3456
3483
|
}
|
|
3457
|
-
const
|
|
3458
|
-
return /* @__PURE__ */
|
|
3459
|
-
|
|
3484
|
+
const io = I ? go(c, I) : !1;
|
|
3485
|
+
return /* @__PURE__ */ i(
|
|
3486
|
+
So,
|
|
3460
3487
|
{
|
|
3461
3488
|
type: "button",
|
|
3462
3489
|
$currentMonth: !0,
|
|
3463
|
-
$selected:
|
|
3464
|
-
$today:
|
|
3465
|
-
disabled:
|
|
3490
|
+
$selected: io,
|
|
3491
|
+
$today: W,
|
|
3492
|
+
disabled: Y,
|
|
3466
3493
|
"aria-label": Ho(c),
|
|
3467
|
-
"aria-pressed":
|
|
3468
|
-
onClick: () => J(
|
|
3469
|
-
children:
|
|
3494
|
+
"aria-pressed": io,
|
|
3495
|
+
onClick: () => J(g.day),
|
|
3496
|
+
children: g.day
|
|
3470
3497
|
},
|
|
3471
3498
|
R
|
|
3472
3499
|
);
|
|
@@ -3477,12 +3504,12 @@ function us({
|
|
|
3477
3504
|
}
|
|
3478
3505
|
);
|
|
3479
3506
|
}
|
|
3480
|
-
|
|
3481
|
-
function
|
|
3482
|
-
const r = parseInt(o.slice(1, 3), 16) / 255, n = parseInt(o.slice(3, 5), 16) / 255,
|
|
3483
|
-
return 0.2126 * a(r) + 0.7152 * a(n) + 0.0722 * a(
|
|
3507
|
+
pe.displayName = "DatePicker";
|
|
3508
|
+
function fe(o) {
|
|
3509
|
+
const r = parseInt(o.slice(1, 3), 16) / 255, n = parseInt(o.slice(3, 5), 16) / 255, e = parseInt(o.slice(5, 7), 16) / 255, a = (d) => d <= 0.03928 ? d / 12.92 : ((d + 0.055) / 1.055) ** 2.4;
|
|
3510
|
+
return 0.2126 * a(r) + 0.7152 * a(n) + 0.0722 * a(e) > 0.179 ? "#111111" : "#ffffff";
|
|
3484
3511
|
}
|
|
3485
|
-
const
|
|
3512
|
+
const To = {
|
|
3486
3513
|
colors: {
|
|
3487
3514
|
primary: {
|
|
3488
3515
|
50: "#fffde6",
|
|
@@ -3523,27 +3550,27 @@ const Io = {
|
|
|
3523
3550
|
shadows: { focusRing: "3px 3px 0 #111111" },
|
|
3524
3551
|
brutalism: { borderWidth: "2px", shadowOffset: "4px" }
|
|
3525
3552
|
};
|
|
3526
|
-
function
|
|
3553
|
+
function Ee(o) {
|
|
3527
3554
|
return {
|
|
3528
|
-
...
|
|
3555
|
+
...To,
|
|
3529
3556
|
colors: {
|
|
3530
|
-
...
|
|
3557
|
+
...To.colors,
|
|
3531
3558
|
primary: {
|
|
3532
3559
|
50: "#fffff0",
|
|
3533
3560
|
500: o,
|
|
3534
3561
|
700: o,
|
|
3535
|
-
contrast:
|
|
3562
|
+
contrast: fe(o)
|
|
3536
3563
|
}
|
|
3537
3564
|
}
|
|
3538
3565
|
};
|
|
3539
3566
|
}
|
|
3540
|
-
function
|
|
3541
|
-
theme: o =
|
|
3567
|
+
function Oe({
|
|
3568
|
+
theme: o = To,
|
|
3542
3569
|
children: r
|
|
3543
3570
|
}) {
|
|
3544
|
-
return /* @__PURE__ */
|
|
3571
|
+
return /* @__PURE__ */ i(pr, { theme: o, children: r });
|
|
3545
3572
|
}
|
|
3546
|
-
const
|
|
3573
|
+
const Me = fr`
|
|
3547
3574
|
*, *::before, *::after {
|
|
3548
3575
|
box-sizing: border-box;
|
|
3549
3576
|
margin: 0;
|
|
@@ -3560,43 +3587,47 @@ const Os = pr`
|
|
|
3560
3587
|
button, input, select, textarea {
|
|
3561
3588
|
font-family: inherit;
|
|
3562
3589
|
}
|
|
3590
|
+
|
|
3591
|
+
button, a, [role="button"] {
|
|
3592
|
+
touch-action: manipulation;
|
|
3593
|
+
}
|
|
3563
3594
|
`;
|
|
3564
3595
|
export {
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3596
|
+
br as Badge,
|
|
3597
|
+
Io as Button,
|
|
3598
|
+
Gn as Checkbox,
|
|
3599
|
+
wt as CollapsibleCard,
|
|
3600
|
+
lr as ConfirmDialog,
|
|
3601
|
+
We as ConfirmProvider,
|
|
3602
|
+
pe as DatePicker,
|
|
3603
|
+
pn as Editable,
|
|
3604
|
+
xn as Field,
|
|
3605
|
+
Vn as Form,
|
|
3575
3606
|
sr as FormField,
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3607
|
+
Me as GlobalStyles,
|
|
3608
|
+
Sr as Input,
|
|
3609
|
+
Go as Link,
|
|
3610
|
+
Xo as Modal,
|
|
3611
|
+
nt as Radio,
|
|
3612
|
+
qo as Select,
|
|
3613
|
+
zt as Spinner,
|
|
3614
|
+
lt as Switch,
|
|
3615
|
+
Gt as Table,
|
|
3616
|
+
Dr as Textarea,
|
|
3617
|
+
Oe as ThemeProvider,
|
|
3618
|
+
Ln as Toast,
|
|
3619
|
+
ye as ToastProvider,
|
|
3620
|
+
Ie as composeValidators,
|
|
3621
|
+
Ee as createNeoBrutalTheme,
|
|
3622
|
+
Se as isEmail,
|
|
3623
|
+
ze as isUrl,
|
|
3624
|
+
ke as maxLength,
|
|
3625
|
+
ve as minLength,
|
|
3626
|
+
To as neoBrutalTheme,
|
|
3627
|
+
Ce as pattern,
|
|
3628
|
+
me as required,
|
|
3629
|
+
De as useConfirm,
|
|
3630
|
+
we as useForm,
|
|
3631
|
+
Te as useTable,
|
|
3632
|
+
he as useToast
|
|
3602
3633
|
};
|