blunt-ui 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -12
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.types.d.ts +3 -0
- package/dist/components/Table/stories/Table.stories.d.ts +1 -5
- package/dist/index.cjs +93 -50
- package/dist/index.js +918 -866
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as S, Fragment as dr } from "react/jsx-runtime";
|
|
2
|
-
import i, { css as
|
|
3
|
-
import
|
|
4
|
-
import { createPortal as
|
|
5
|
-
const
|
|
2
|
+
import i, { css as t, keyframes as oo, ThemeProvider as ur, createGlobalStyle as pr } from "styled-components";
|
|
3
|
+
import Mo, { useId as ro, useState as T, useContext as To, createContext as Wo, forwardRef as Yo, createElement as zo, useRef as Y, useCallback as X, useEffect as B, useMemo as Do } from "react";
|
|
4
|
+
import { createPortal as xo } from "react-dom";
|
|
5
|
+
const uo = (o, r, n) => t`
|
|
6
6
|
background: ${r};
|
|
7
7
|
color: ${n};
|
|
8
8
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
@@ -20,65 +20,65 @@ const eo = (o, r, n) => s`
|
|
|
20
20
|
max-width: 20ch;
|
|
21
21
|
|
|
22
22
|
${({ $size: o, theme: r }) => ({
|
|
23
|
-
sm:
|
|
23
|
+
sm: t`
|
|
24
24
|
padding: ${r.spacing[0.5]} ${r.spacing[2]};
|
|
25
25
|
font-size: ${r.fontSizes.xs};
|
|
26
26
|
`,
|
|
27
|
-
md:
|
|
27
|
+
md: t`
|
|
28
28
|
padding: ${r.spacing[1]} ${r.spacing[3]};
|
|
29
29
|
font-size: ${r.fontSizes.sm};
|
|
30
30
|
`
|
|
31
31
|
})[o]}
|
|
32
32
|
|
|
33
33
|
${({ $variant: o, theme: r }) => r.brutalism ? {
|
|
34
|
-
primary:
|
|
34
|
+
primary: uo(
|
|
35
35
|
r,
|
|
36
36
|
r.colors.primary[500],
|
|
37
37
|
r.colors.primary.contrast
|
|
38
38
|
),
|
|
39
|
-
neutral:
|
|
39
|
+
neutral: uo(
|
|
40
40
|
r,
|
|
41
41
|
r.colors.neutral[200],
|
|
42
42
|
r.colors.neutral[900]
|
|
43
43
|
),
|
|
44
|
-
success:
|
|
44
|
+
success: uo(
|
|
45
45
|
r,
|
|
46
46
|
r.colors.success[50],
|
|
47
47
|
r.colors.success[500]
|
|
48
48
|
),
|
|
49
|
-
error:
|
|
49
|
+
error: uo(
|
|
50
50
|
r,
|
|
51
51
|
r.colors.error[50],
|
|
52
52
|
r.colors.error[500]
|
|
53
53
|
),
|
|
54
|
-
warning:
|
|
54
|
+
warning: uo(
|
|
55
55
|
r,
|
|
56
56
|
r.colors.warning[50],
|
|
57
57
|
r.colors.warning[500]
|
|
58
58
|
),
|
|
59
|
-
info:
|
|
59
|
+
info: uo(r, r.colors.info[50], r.colors.info[500])
|
|
60
60
|
}[o] : {
|
|
61
|
-
primary:
|
|
61
|
+
primary: t`
|
|
62
62
|
background: ${r.colors.primary[50]};
|
|
63
63
|
color: ${r.colors.primary[500]};
|
|
64
64
|
`,
|
|
65
|
-
neutral:
|
|
65
|
+
neutral: t`
|
|
66
66
|
background: ${r.colors.neutral[200]};
|
|
67
67
|
color: ${r.colors.neutral[600]};
|
|
68
68
|
`,
|
|
69
|
-
success:
|
|
69
|
+
success: t`
|
|
70
70
|
background: ${r.colors.success[50]};
|
|
71
71
|
color: ${r.colors.success[500]};
|
|
72
72
|
`,
|
|
73
|
-
error:
|
|
73
|
+
error: t`
|
|
74
74
|
background: ${r.colors.error[50]};
|
|
75
75
|
color: ${r.colors.error[500]};
|
|
76
76
|
`,
|
|
77
|
-
warning:
|
|
77
|
+
warning: t`
|
|
78
78
|
background: ${r.colors.warning[50]};
|
|
79
79
|
color: ${r.colors.warning[500]};
|
|
80
80
|
`,
|
|
81
|
-
info:
|
|
81
|
+
info: t`
|
|
82
82
|
background: ${r.colors.info[50]};
|
|
83
83
|
color: ${r.colors.info[500]};
|
|
84
84
|
`
|
|
@@ -88,12 +88,12 @@ function $r({
|
|
|
88
88
|
variant: o = "primary",
|
|
89
89
|
size: r = "md",
|
|
90
90
|
children: n,
|
|
91
|
-
...
|
|
91
|
+
...s
|
|
92
92
|
}) {
|
|
93
|
-
return /* @__PURE__ */ e(fr, { $variant: o, $size: r, ...
|
|
93
|
+
return /* @__PURE__ */ e(fr, { $variant: o, $size: r, ...s, children: n });
|
|
94
94
|
}
|
|
95
95
|
$r.displayName = "Badge";
|
|
96
|
-
const ho = (o, r, n) =>
|
|
96
|
+
const ho = (o, r, n) => t`
|
|
97
97
|
background-color: ${r};
|
|
98
98
|
color: ${n};
|
|
99
99
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
@@ -142,7 +142,7 @@ const ho = (o, r, n) => s`
|
|
|
142
142
|
r.colors.neutral[900]
|
|
143
143
|
)
|
|
144
144
|
}[o] : {
|
|
145
|
-
primary:
|
|
145
|
+
primary: t`
|
|
146
146
|
background-color: ${r.colors.primary[500]};
|
|
147
147
|
color: ${r.colors.neutral[0]};
|
|
148
148
|
border: none;
|
|
@@ -150,7 +150,7 @@ const ho = (o, r, n) => s`
|
|
|
150
150
|
background-color: ${r.colors.primary[700]};
|
|
151
151
|
}
|
|
152
152
|
`,
|
|
153
|
-
secondary:
|
|
153
|
+
secondary: t`
|
|
154
154
|
background-color: ${r.colors.neutral[200]};
|
|
155
155
|
color: ${r.colors.neutral[600]};
|
|
156
156
|
border: none;
|
|
@@ -158,7 +158,7 @@ const ho = (o, r, n) => s`
|
|
|
158
158
|
background-color: ${r.colors.neutral[300]};
|
|
159
159
|
}
|
|
160
160
|
`,
|
|
161
|
-
outline:
|
|
161
|
+
outline: t`
|
|
162
162
|
background-color: transparent;
|
|
163
163
|
color: ${r.colors.primary[500]};
|
|
164
164
|
border: 2px solid ${r.colors.primary[500]};
|
|
@@ -169,15 +169,15 @@ const ho = (o, r, n) => s`
|
|
|
169
169
|
}[o]}
|
|
170
170
|
|
|
171
171
|
${({ $size: o, theme: r }) => ({
|
|
172
|
-
sm:
|
|
172
|
+
sm: t`
|
|
173
173
|
padding: ${r.spacing[1]} ${r.spacing[3]};
|
|
174
174
|
font-size: ${r.fontSizes.sm};
|
|
175
175
|
`,
|
|
176
|
-
md:
|
|
176
|
+
md: t`
|
|
177
177
|
padding: ${r.spacing[2]} ${r.spacing[4]};
|
|
178
178
|
font-size: ${r.fontSizes.md};
|
|
179
179
|
`,
|
|
180
|
-
lg:
|
|
180
|
+
lg: t`
|
|
181
181
|
padding: ${r.spacing[3]} ${r.spacing[6]};
|
|
182
182
|
font-size: ${r.fontSizes.lg};
|
|
183
183
|
`
|
|
@@ -187,7 +187,7 @@ function Co({
|
|
|
187
187
|
ref: o,
|
|
188
188
|
as: r,
|
|
189
189
|
href: n,
|
|
190
|
-
variant:
|
|
190
|
+
variant: s = "primary",
|
|
191
191
|
size: a = "md",
|
|
192
192
|
isLoading: l,
|
|
193
193
|
disabled: d,
|
|
@@ -200,7 +200,7 @@ function Co({
|
|
|
200
200
|
ref: o,
|
|
201
201
|
as: r ?? (n ? "a" : "button"),
|
|
202
202
|
href: n,
|
|
203
|
-
$variant:
|
|
203
|
+
$variant: s,
|
|
204
204
|
$size: a,
|
|
205
205
|
disabled: l || d,
|
|
206
206
|
...u,
|
|
@@ -229,39 +229,39 @@ const br = i.div`
|
|
|
229
229
|
box-shadow 0.2s;
|
|
230
230
|
|
|
231
231
|
${({ $size: o = "md", theme: r }) => ({
|
|
232
|
-
sm:
|
|
232
|
+
sm: t`
|
|
233
233
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
234
234
|
font-size: ${r.fontSizes.sm};
|
|
235
235
|
`,
|
|
236
|
-
md:
|
|
236
|
+
md: t`
|
|
237
237
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
238
238
|
font-size: ${r.fontSizes.md};
|
|
239
239
|
`,
|
|
240
|
-
lg:
|
|
240
|
+
lg: t`
|
|
241
241
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
242
242
|
font-size: ${r.fontSizes.lg};
|
|
243
243
|
`
|
|
244
244
|
})[o]}
|
|
245
245
|
|
|
246
|
-
${({ $variant: o = "default", theme: r }) => r.brutalism ?
|
|
246
|
+
${({ $variant: o = "default", theme: r }) => r.brutalism ? t`
|
|
247
247
|
border: ${r.brutalism.borderWidth} solid
|
|
248
248
|
${r.colors.neutral[900]};
|
|
249
249
|
background-color: ${r.colors.neutral[0]};
|
|
250
250
|
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
251
251
|
` : {
|
|
252
|
-
default:
|
|
252
|
+
default: t`
|
|
253
253
|
border: 1px solid ${r.colors.neutral[400]};
|
|
254
254
|
background-color: ${r.colors.neutral[0]};
|
|
255
255
|
`,
|
|
256
|
-
outlined:
|
|
256
|
+
outlined: t`
|
|
257
257
|
border: 2px solid ${r.colors.primary[500]};
|
|
258
258
|
background-color: ${r.colors.neutral[0]};
|
|
259
259
|
`
|
|
260
260
|
}[o]}
|
|
261
261
|
|
|
262
|
-
${({ $error: o, theme: r }) => o &&
|
|
262
|
+
${({ $error: o, theme: r }) => o && t`
|
|
263
263
|
border-color: ${r.colors.error[500]};
|
|
264
|
-
${r.brutalism &&
|
|
264
|
+
${r.brutalism && t`
|
|
265
265
|
box-shadow: 3px 3px 0 ${r.colors.error[500]};
|
|
266
266
|
`}
|
|
267
267
|
`}
|
|
@@ -302,29 +302,29 @@ function vr({
|
|
|
302
302
|
ref: o,
|
|
303
303
|
type: r = "text",
|
|
304
304
|
size: n = "md",
|
|
305
|
-
variant:
|
|
305
|
+
variant: s = "default",
|
|
306
306
|
label: a,
|
|
307
307
|
helperText: l,
|
|
308
308
|
error: d,
|
|
309
309
|
leftElement: p,
|
|
310
310
|
rightElement: u,
|
|
311
311
|
clearable: f,
|
|
312
|
-
onClear:
|
|
313
|
-
fullWidth:
|
|
314
|
-
id:
|
|
315
|
-
value:
|
|
316
|
-
defaultValue:
|
|
317
|
-
onChange:
|
|
318
|
-
...
|
|
312
|
+
onClear: g,
|
|
313
|
+
fullWidth: m,
|
|
314
|
+
id: v,
|
|
315
|
+
value: h,
|
|
316
|
+
defaultValue: k,
|
|
317
|
+
onChange: C,
|
|
318
|
+
...M
|
|
319
319
|
}) {
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
},
|
|
323
|
-
|
|
320
|
+
const P = ro(), L = v ?? P, x = `${L}-hint`, [I, w] = T(k ?? ""), b = h !== void 0, z = b ? h : I, D = typeof d == "string" ? d : void 0, W = !!(l || d), N = (_) => {
|
|
321
|
+
b || w(_.target.value), C?.(_);
|
|
322
|
+
}, F = () => {
|
|
323
|
+
b || w(""), g?.();
|
|
324
324
|
};
|
|
325
|
-
return /* @__PURE__ */ S(br, { $fullWidth:
|
|
325
|
+
return /* @__PURE__ */ S(br, { $fullWidth: m, children: [
|
|
326
326
|
a && /* @__PURE__ */ e(xr, { htmlFor: L, children: a }),
|
|
327
|
-
/* @__PURE__ */ S(hr, { $size: n, $variant:
|
|
327
|
+
/* @__PURE__ */ S(hr, { $size: n, $variant: s, $error: !!d, children: [
|
|
328
328
|
p && /* @__PURE__ */ e(Lo, { children: p }),
|
|
329
329
|
/* @__PURE__ */ e(
|
|
330
330
|
wr,
|
|
@@ -332,25 +332,25 @@ function vr({
|
|
|
332
332
|
id: L,
|
|
333
333
|
ref: o,
|
|
334
334
|
type: r,
|
|
335
|
-
value:
|
|
336
|
-
onChange:
|
|
337
|
-
...
|
|
335
|
+
value: z,
|
|
336
|
+
onChange: N,
|
|
337
|
+
...M,
|
|
338
338
|
"aria-invalid": !!d,
|
|
339
|
-
"aria-describedby": W ?
|
|
339
|
+
"aria-describedby": W ? x : void 0
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
f &&
|
|
342
|
+
f && z && /* @__PURE__ */ e(
|
|
343
343
|
mr,
|
|
344
344
|
{
|
|
345
345
|
type: "button",
|
|
346
|
-
onClick:
|
|
346
|
+
onClick: F,
|
|
347
347
|
"aria-label": "Clear input",
|
|
348
348
|
children: "✕"
|
|
349
349
|
}
|
|
350
350
|
),
|
|
351
351
|
u && /* @__PURE__ */ e(Lo, { children: u })
|
|
352
352
|
] }),
|
|
353
|
-
W && /* @__PURE__ */ e(yr, { id:
|
|
353
|
+
W && /* @__PURE__ */ e(yr, { id: x, $error: !!d, children: D ?? l })
|
|
354
354
|
] });
|
|
355
355
|
}
|
|
356
356
|
vr.displayName = "Input";
|
|
@@ -373,39 +373,39 @@ const kr = i.div`
|
|
|
373
373
|
box-shadow 0.2s;
|
|
374
374
|
|
|
375
375
|
${({ $size: o = "md", theme: r }) => ({
|
|
376
|
-
sm:
|
|
376
|
+
sm: t`
|
|
377
377
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
378
378
|
font-size: ${r.fontSizes.sm};
|
|
379
379
|
`,
|
|
380
|
-
md:
|
|
380
|
+
md: t`
|
|
381
381
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
382
382
|
font-size: ${r.fontSizes.md};
|
|
383
383
|
`,
|
|
384
|
-
lg:
|
|
384
|
+
lg: t`
|
|
385
385
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
386
386
|
font-size: ${r.fontSizes.lg};
|
|
387
387
|
`
|
|
388
388
|
})[o]}
|
|
389
389
|
|
|
390
|
-
${({ $variant: o = "default", theme: r }) => r.brutalism ?
|
|
390
|
+
${({ $variant: o = "default", theme: r }) => r.brutalism ? t`
|
|
391
391
|
border: ${r.brutalism.borderWidth} solid
|
|
392
392
|
${r.colors.neutral[900]};
|
|
393
393
|
background-color: ${r.colors.neutral[0]};
|
|
394
394
|
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
395
395
|
` : {
|
|
396
|
-
default:
|
|
396
|
+
default: t`
|
|
397
397
|
border: 1px solid ${r.colors.neutral[400]};
|
|
398
398
|
background-color: ${r.colors.neutral[0]};
|
|
399
399
|
`,
|
|
400
|
-
outlined:
|
|
400
|
+
outlined: t`
|
|
401
401
|
border: 2px solid ${r.colors.primary[500]};
|
|
402
402
|
background-color: ${r.colors.neutral[0]};
|
|
403
403
|
`
|
|
404
404
|
}[o]}
|
|
405
405
|
|
|
406
|
-
${({ $error: o, theme: r }) => o &&
|
|
406
|
+
${({ $error: o, theme: r }) => o && t`
|
|
407
407
|
border-color: ${r.colors.error[500]};
|
|
408
|
-
${r.brutalism &&
|
|
408
|
+
${r.brutalism && t`
|
|
409
409
|
box-shadow: 3px 3px 0 ${r.colors.error[500]};
|
|
410
410
|
`}
|
|
411
411
|
`}
|
|
@@ -431,42 +431,42 @@ function Tr({
|
|
|
431
431
|
ref: o,
|
|
432
432
|
size: r = "md",
|
|
433
433
|
variant: n = "default",
|
|
434
|
-
label:
|
|
434
|
+
label: s,
|
|
435
435
|
helperText: a,
|
|
436
436
|
error: l,
|
|
437
437
|
fullWidth: d,
|
|
438
438
|
id: p,
|
|
439
439
|
value: u,
|
|
440
440
|
defaultValue: f,
|
|
441
|
-
onChange:
|
|
442
|
-
...
|
|
441
|
+
onChange: g,
|
|
442
|
+
...m
|
|
443
443
|
}) {
|
|
444
|
-
const
|
|
444
|
+
const v = ro(), h = p ?? v, k = `${h}-hint`, [C, M] = T(f ?? ""), P = u !== void 0, L = P ? u : C, x = typeof l == "string" ? l : void 0, I = !!(a || l);
|
|
445
445
|
return /* @__PURE__ */ S(kr, { $fullWidth: d, children: [
|
|
446
|
-
|
|
446
|
+
s && /* @__PURE__ */ e(Sr, { htmlFor: h, children: s }),
|
|
447
447
|
/* @__PURE__ */ e(Cr, { $size: r, $variant: n, $error: !!l, children: /* @__PURE__ */ e(
|
|
448
448
|
Ir,
|
|
449
449
|
{
|
|
450
|
-
id:
|
|
450
|
+
id: h,
|
|
451
451
|
ref: o,
|
|
452
452
|
value: L,
|
|
453
|
-
onChange: (
|
|
454
|
-
|
|
453
|
+
onChange: (b) => {
|
|
454
|
+
P || M(b.target.value), g?.(b);
|
|
455
455
|
},
|
|
456
|
-
...
|
|
456
|
+
...m,
|
|
457
457
|
"aria-invalid": !!l,
|
|
458
|
-
"aria-describedby":
|
|
458
|
+
"aria-describedby": I ? k : void 0
|
|
459
459
|
}
|
|
460
460
|
) }),
|
|
461
|
-
|
|
461
|
+
I && /* @__PURE__ */ e(zr, { id: k, $error: !!l, children: x ?? a })
|
|
462
462
|
] });
|
|
463
463
|
}
|
|
464
464
|
Tr.displayName = "Textarea";
|
|
465
|
-
const Uo = (...o) => o.filter((r, n,
|
|
465
|
+
const Uo = (...o) => o.filter((r, n, s) => !!r && r.trim() !== "" && s.indexOf(r) === n).join(" ").trim();
|
|
466
466
|
const Wr = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
467
467
|
const Dr = (o) => o.replace(
|
|
468
468
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
469
|
-
(r, n,
|
|
469
|
+
(r, n, s) => s ? s.toUpperCase() : n.toLowerCase()
|
|
470
470
|
);
|
|
471
471
|
const No = (o) => {
|
|
472
472
|
const r = Dr(o);
|
|
@@ -488,15 +488,15 @@ const Er = (o) => {
|
|
|
488
488
|
if (r.startsWith("aria-") || r === "role" || r === "title")
|
|
489
489
|
return !0;
|
|
490
490
|
return !1;
|
|
491
|
-
},
|
|
492
|
-
({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth:
|
|
491
|
+
}, Or = Wo({}), Mr = () => To(Or), Lr = Yo(
|
|
492
|
+
({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth: s, className: a = "", children: l, iconNode: d, ...p }, u) => {
|
|
493
493
|
const {
|
|
494
494
|
size: f = 24,
|
|
495
|
-
strokeWidth:
|
|
496
|
-
absoluteStrokeWidth:
|
|
497
|
-
color:
|
|
498
|
-
className:
|
|
499
|
-
} =
|
|
495
|
+
strokeWidth: g = 2,
|
|
496
|
+
absoluteStrokeWidth: m = !1,
|
|
497
|
+
color: v = "currentColor",
|
|
498
|
+
className: h = ""
|
|
499
|
+
} = Mr() ?? {}, k = s ?? m ? Number(n ?? g) * 24 / Number(r ?? f) : n ?? g;
|
|
500
500
|
return zo(
|
|
501
501
|
"svg",
|
|
502
502
|
{
|
|
@@ -504,28 +504,28 @@ const Er = (o) => {
|
|
|
504
504
|
...wo,
|
|
505
505
|
width: r ?? f ?? wo.width,
|
|
506
506
|
height: r ?? f ?? wo.height,
|
|
507
|
-
stroke: o ??
|
|
508
|
-
strokeWidth:
|
|
509
|
-
className: Uo("lucide",
|
|
507
|
+
stroke: o ?? v,
|
|
508
|
+
strokeWidth: k,
|
|
509
|
+
className: Uo("lucide", h, a),
|
|
510
510
|
...!l && !Er(p) && { "aria-hidden": "true" },
|
|
511
511
|
...p
|
|
512
512
|
},
|
|
513
513
|
[
|
|
514
|
-
...d.map(([
|
|
514
|
+
...d.map(([C, M]) => zo(C, M)),
|
|
515
515
|
...Array.isArray(l) ? l : [l]
|
|
516
516
|
]
|
|
517
517
|
);
|
|
518
518
|
}
|
|
519
519
|
);
|
|
520
|
-
const
|
|
520
|
+
const no = (o, r) => {
|
|
521
521
|
const n = Yo(
|
|
522
|
-
({ className:
|
|
522
|
+
({ className: s, ...a }, l) => zo(Lr, {
|
|
523
523
|
ref: l,
|
|
524
524
|
iconNode: r,
|
|
525
525
|
className: Uo(
|
|
526
526
|
`lucide-${Wr(No(o))}`,
|
|
527
527
|
`lucide-${o}`,
|
|
528
|
-
|
|
528
|
+
s
|
|
529
529
|
),
|
|
530
530
|
...a
|
|
531
531
|
})
|
|
@@ -535,30 +535,30 @@ const Z = (o, r) => {
|
|
|
535
535
|
const Nr = [
|
|
536
536
|
["path", { d: "M12 5v14", key: "s699le" }],
|
|
537
537
|
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
538
|
-
], Pr =
|
|
538
|
+
], Pr = no("arrow-down", Nr);
|
|
539
539
|
const Rr = [
|
|
540
540
|
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
541
541
|
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
542
542
|
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
543
543
|
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
544
|
-
], Vr =
|
|
544
|
+
], Vr = no("arrow-up-down", Rr);
|
|
545
545
|
const Fr = [
|
|
546
546
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
547
547
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
548
|
-
], Ar =
|
|
548
|
+
], Ar = no("arrow-up", Fr);
|
|
549
549
|
const Br = [
|
|
550
550
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
551
551
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
552
552
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
553
553
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
554
|
-
], _r =
|
|
555
|
-
const jr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Ko =
|
|
556
|
-
const Hr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Yr =
|
|
557
|
-
const Ur = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Kr =
|
|
554
|
+
], _r = no("calendar", Br);
|
|
555
|
+
const jr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Ko = no("chevron-down", jr);
|
|
556
|
+
const Hr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Yr = no("chevron-left", Hr);
|
|
557
|
+
const Ur = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Kr = no("chevron-right", Ur);
|
|
558
558
|
const qr = [
|
|
559
559
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
560
560
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
561
|
-
],
|
|
561
|
+
], yo = no("x", qr), Gr = i.div`
|
|
562
562
|
display: inline-flex;
|
|
563
563
|
flex-direction: column;
|
|
564
564
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
@@ -589,41 +589,41 @@ const qr = [
|
|
|
589
589
|
box-shadow 0.2s;
|
|
590
590
|
|
|
591
591
|
${({ $size: o, theme: r }) => ({
|
|
592
|
-
sm:
|
|
592
|
+
sm: t`
|
|
593
593
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
594
594
|
font-size: ${r.fontSizes.sm};
|
|
595
595
|
`,
|
|
596
|
-
md:
|
|
596
|
+
md: t`
|
|
597
597
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
598
598
|
font-size: ${r.fontSizes.md};
|
|
599
599
|
`,
|
|
600
|
-
lg:
|
|
600
|
+
lg: t`
|
|
601
601
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
602
602
|
font-size: ${r.fontSizes.lg};
|
|
603
603
|
`
|
|
604
604
|
})[o]}
|
|
605
605
|
|
|
606
|
-
${({ $variant: o, theme: r }) => r.brutalism ?
|
|
606
|
+
${({ $variant: o, theme: r }) => r.brutalism ? t`
|
|
607
607
|
border: ${r.brutalism.borderWidth} solid
|
|
608
608
|
${r.colors.neutral[900]};
|
|
609
609
|
background-color: ${r.colors.neutral[0]};
|
|
610
610
|
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
611
611
|
` : {
|
|
612
|
-
default:
|
|
612
|
+
default: t`
|
|
613
613
|
border: 1px solid ${r.colors.neutral[400]};
|
|
614
614
|
background-color: ${r.colors.neutral[0]};
|
|
615
615
|
`,
|
|
616
|
-
outlined:
|
|
616
|
+
outlined: t`
|
|
617
617
|
border: 2px solid ${r.colors.primary[500]};
|
|
618
618
|
background-color: ${r.colors.neutral[0]};
|
|
619
619
|
`
|
|
620
620
|
}[o]}
|
|
621
621
|
|
|
622
|
-
${({ $error: o, theme: r }) => o &&
|
|
622
|
+
${({ $error: o, theme: r }) => o && t`
|
|
623
623
|
border-color: ${r.colors.error[500]};
|
|
624
624
|
`}
|
|
625
625
|
|
|
626
|
-
${({ $disabled: o }) => o &&
|
|
626
|
+
${({ $disabled: o }) => o && t`
|
|
627
627
|
opacity: 0.6;
|
|
628
628
|
`}
|
|
629
629
|
|
|
@@ -658,12 +658,12 @@ const qr = [
|
|
|
658
658
|
max-height: 240px;
|
|
659
659
|
overflow-y: auto;
|
|
660
660
|
|
|
661
|
-
${({ theme: o }) => o.brutalism ?
|
|
661
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
662
662
|
border: ${o.brutalism.borderWidth} solid
|
|
663
663
|
${o.colors.neutral[900]};
|
|
664
664
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
665
665
|
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
666
|
-
` :
|
|
666
|
+
` : t`
|
|
667
667
|
border: 1px solid ${o.colors.neutral[300]};
|
|
668
668
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
669
669
|
`}
|
|
@@ -686,7 +686,7 @@ const qr = [
|
|
|
686
686
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
687
687
|
}
|
|
688
688
|
|
|
689
|
-
${({ theme: o }) => o.brutalism &&
|
|
689
|
+
${({ theme: o }) => o.brutalism && t`
|
|
690
690
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
691
691
|
&:focus {
|
|
692
692
|
box-shadow: ${o.shadows.focusRing};
|
|
@@ -709,7 +709,7 @@ const qr = [
|
|
|
709
709
|
|
|
710
710
|
font-weight: ${({ $selected: o, theme: r }) => o ? r.fontWeights.semibold : r.fontWeights.normal};
|
|
711
711
|
|
|
712
|
-
${({ $selected: o, theme: r }) => o &&
|
|
712
|
+
${({ $selected: o, theme: r }) => o && t`
|
|
713
713
|
border-left: ${r.spacing[1]} solid ${r.colors.primary[500]};
|
|
714
714
|
padding-left: ${r.spacing[2]};
|
|
715
715
|
`}
|
|
@@ -743,154 +743,154 @@ function ln({
|
|
|
743
743
|
options: o,
|
|
744
744
|
placeholder: r,
|
|
745
745
|
size: n = "md",
|
|
746
|
-
variant:
|
|
746
|
+
variant: s = "default",
|
|
747
747
|
error: a,
|
|
748
748
|
fullWidth: l,
|
|
749
749
|
clearable: d,
|
|
750
750
|
onClear: p,
|
|
751
751
|
id: u,
|
|
752
752
|
name: f,
|
|
753
|
-
value:
|
|
754
|
-
defaultValue:
|
|
755
|
-
onChange:
|
|
756
|
-
disabled:
|
|
757
|
-
searchable:
|
|
758
|
-
"aria-label":
|
|
759
|
-
"aria-describedby":
|
|
753
|
+
value: g,
|
|
754
|
+
defaultValue: m,
|
|
755
|
+
onChange: v,
|
|
756
|
+
disabled: h,
|
|
757
|
+
searchable: k,
|
|
758
|
+
"aria-label": C,
|
|
759
|
+
"aria-describedby": M
|
|
760
760
|
}) {
|
|
761
|
-
const
|
|
761
|
+
const P = ro(), L = u ?? P, x = `${L}-list`, I = `${L}-search`, w = typeof a == "string" ? a : void 0, [b, z] = T(!1), [D, W] = T(-1), [N, F] = T(""), [_, V] = T({
|
|
762
762
|
top: 0,
|
|
763
763
|
left: 0,
|
|
764
764
|
width: 0
|
|
765
|
-
}), [
|
|
766
|
-
|
|
767
|
-
),
|
|
768
|
-
(c) => c.value ===
|
|
769
|
-
),
|
|
770
|
-
(c) => c.label.toLowerCase().includes(
|
|
771
|
-
) : o,
|
|
772
|
-
if (!
|
|
765
|
+
}), [U, io] = T(
|
|
766
|
+
m ?? ""
|
|
767
|
+
), O = g !== void 0, H = O ? g : U, ao = Y(null), K = Y(null), to = Y(null), J = Y(null), lo = o.find(
|
|
768
|
+
(c) => c.value === H
|
|
769
|
+
), j = k && N ? o.filter(
|
|
770
|
+
(c) => c.label.toLowerCase().includes(N.toLowerCase())
|
|
771
|
+
) : o, q = X(() => {
|
|
772
|
+
if (!K.current)
|
|
773
773
|
return;
|
|
774
|
-
const c =
|
|
775
|
-
|
|
774
|
+
const c = K.current.getBoundingClientRect();
|
|
775
|
+
V({
|
|
776
776
|
top: c.bottom + 4,
|
|
777
777
|
left: c.left,
|
|
778
778
|
width: c.width
|
|
779
779
|
});
|
|
780
780
|
}, []);
|
|
781
781
|
B(() => {
|
|
782
|
-
if (
|
|
783
|
-
return
|
|
784
|
-
window.removeEventListener("scroll",
|
|
782
|
+
if (b)
|
|
783
|
+
return q(), window.addEventListener("scroll", q, !0), window.addEventListener("resize", q), () => {
|
|
784
|
+
window.removeEventListener("scroll", q, !0), window.removeEventListener("resize", q);
|
|
785
785
|
};
|
|
786
|
-
}, [
|
|
787
|
-
if (!
|
|
786
|
+
}, [b, q]), B(() => {
|
|
787
|
+
if (!b)
|
|
788
788
|
return;
|
|
789
789
|
const c = (E) => {
|
|
790
|
-
const G =
|
|
790
|
+
const G = ao.current?.contains(
|
|
791
791
|
E.target
|
|
792
|
-
),
|
|
792
|
+
), $o = to.current?.contains(
|
|
793
793
|
E.target
|
|
794
794
|
);
|
|
795
|
-
!G &&
|
|
795
|
+
!G && !$o && z(!1);
|
|
796
796
|
};
|
|
797
797
|
return document.addEventListener("mousedown", c), () => document.removeEventListener("mousedown", c);
|
|
798
|
-
}, [
|
|
799
|
-
|
|
800
|
-
}, [
|
|
798
|
+
}, [b]), B(() => {
|
|
799
|
+
b && k && setTimeout(() => J.current?.focus(), 0), b || (F(""), W(-1));
|
|
800
|
+
}, [b, k]), B(() => {
|
|
801
801
|
W(-1);
|
|
802
|
-
}, [
|
|
802
|
+
}, [N]), B(() => {
|
|
803
803
|
if (D < 0)
|
|
804
804
|
return;
|
|
805
|
-
const c = document.getElementById(`${
|
|
805
|
+
const c = document.getElementById(`${x}-option-${D}`);
|
|
806
806
|
c && typeof c.scrollIntoView == "function" && c.scrollIntoView({ block: "nearest" });
|
|
807
|
-
}, [D,
|
|
808
|
-
function
|
|
807
|
+
}, [D, x]);
|
|
808
|
+
function Q(c, E) {
|
|
809
809
|
let G = c + E;
|
|
810
|
-
for (; G >= 0 && G <
|
|
811
|
-
if (!
|
|
810
|
+
for (; G >= 0 && G < j.length; ) {
|
|
811
|
+
if (!j[G].disabled)
|
|
812
812
|
return G;
|
|
813
813
|
G += E;
|
|
814
814
|
}
|
|
815
815
|
return c;
|
|
816
816
|
}
|
|
817
|
-
function
|
|
818
|
-
return
|
|
817
|
+
function Z() {
|
|
818
|
+
return j.findIndex((c) => !c.disabled);
|
|
819
819
|
}
|
|
820
|
-
function
|
|
821
|
-
for (let c =
|
|
822
|
-
if (!
|
|
820
|
+
function so() {
|
|
821
|
+
for (let c = j.length - 1; c >= 0; c--)
|
|
822
|
+
if (!j[c].disabled)
|
|
823
823
|
return c;
|
|
824
824
|
return -1;
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function eo(c) {
|
|
827
827
|
if (c.disabled)
|
|
828
828
|
return;
|
|
829
|
-
|
|
829
|
+
O || io(c.value);
|
|
830
830
|
const E = {
|
|
831
831
|
target: { name: f ?? "", value: c.value },
|
|
832
832
|
currentTarget: { name: f ?? "", value: c.value }
|
|
833
833
|
};
|
|
834
|
-
|
|
834
|
+
v?.(E), z(!1), K.current?.focus();
|
|
835
835
|
}
|
|
836
|
-
function
|
|
837
|
-
c.stopPropagation(),
|
|
836
|
+
function y(c) {
|
|
837
|
+
c.stopPropagation(), O || io(""), v?.({
|
|
838
838
|
target: { name: f ?? "", value: "" },
|
|
839
839
|
currentTarget: { name: f ?? "", value: "" }
|
|
840
|
-
}), p?.(),
|
|
840
|
+
}), p?.(), K.current?.focus();
|
|
841
841
|
}
|
|
842
|
-
function
|
|
843
|
-
if (!
|
|
844
|
-
if (!
|
|
845
|
-
["ArrowDown", "ArrowUp", "Enter", " "].includes(c.key) && (c.preventDefault(),
|
|
842
|
+
function A(c) {
|
|
843
|
+
if (!h) {
|
|
844
|
+
if (!b) {
|
|
845
|
+
["ArrowDown", "ArrowUp", "Enter", " "].includes(c.key) && (c.preventDefault(), z(!0), k || W(Z()));
|
|
846
846
|
return;
|
|
847
847
|
}
|
|
848
848
|
if (c.key === "Escape") {
|
|
849
|
-
c.preventDefault(),
|
|
849
|
+
c.preventDefault(), z(!1);
|
|
850
850
|
return;
|
|
851
851
|
}
|
|
852
|
-
if (!
|
|
852
|
+
if (!k) {
|
|
853
853
|
if (c.key === "ArrowDown") {
|
|
854
|
-
c.preventDefault(), W((E) =>
|
|
854
|
+
c.preventDefault(), W((E) => Q(E, 1));
|
|
855
855
|
return;
|
|
856
856
|
}
|
|
857
857
|
if (c.key === "ArrowUp") {
|
|
858
|
-
c.preventDefault(), W((E) =>
|
|
858
|
+
c.preventDefault(), W((E) => Q(E, -1));
|
|
859
859
|
return;
|
|
860
860
|
}
|
|
861
861
|
if (c.key === "Home") {
|
|
862
|
-
c.preventDefault(), W(
|
|
862
|
+
c.preventDefault(), W(Z());
|
|
863
863
|
return;
|
|
864
864
|
}
|
|
865
865
|
if (c.key === "End") {
|
|
866
|
-
c.preventDefault(), W(
|
|
866
|
+
c.preventDefault(), W(so());
|
|
867
867
|
return;
|
|
868
868
|
}
|
|
869
|
-
(c.key === "Enter" || c.key === " ") && D >= 0 && (c.preventDefault(),
|
|
869
|
+
(c.key === "Enter" || c.key === " ") && D >= 0 && (c.preventDefault(), eo(j[D]));
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function co(c) {
|
|
874
874
|
if (c.key === "Escape") {
|
|
875
|
-
|
|
875
|
+
z(!1), K.current?.focus();
|
|
876
876
|
return;
|
|
877
877
|
}
|
|
878
878
|
if (c.key === "ArrowDown") {
|
|
879
879
|
c.preventDefault(), W(
|
|
880
|
-
(E) => E < 0 ?
|
|
880
|
+
(E) => E < 0 ? Z() : Q(E, 1)
|
|
881
881
|
);
|
|
882
882
|
return;
|
|
883
883
|
}
|
|
884
884
|
if (c.key === "ArrowUp") {
|
|
885
885
|
c.preventDefault(), W(
|
|
886
|
-
(E) => E < 0 ?
|
|
886
|
+
(E) => E < 0 ? so() : Q(E, -1)
|
|
887
887
|
);
|
|
888
888
|
return;
|
|
889
889
|
}
|
|
890
|
-
c.key === "Enter" && D >= 0 && (c.preventDefault(),
|
|
890
|
+
c.key === "Enter" && D >= 0 && (c.preventDefault(), eo(j[D]));
|
|
891
891
|
}
|
|
892
|
-
const
|
|
893
|
-
return /* @__PURE__ */ S(Gr, { ref:
|
|
892
|
+
const $ = d && !!H && !h, R = D >= 0 ? `${x}-option-${D}` : void 0;
|
|
893
|
+
return /* @__PURE__ */ S(Gr, { ref: ao, $fullWidth: l, children: [
|
|
894
894
|
/* @__PURE__ */ S(Xr, { "aria-hidden": "true", children: [
|
|
895
895
|
r && /* @__PURE__ */ e(mo, { children: r }),
|
|
896
896
|
o.map((c) => /* @__PURE__ */ e(mo, { children: c.label }, c.value))
|
|
@@ -898,48 +898,48 @@ function ln({
|
|
|
898
898
|
/* @__PURE__ */ S(
|
|
899
899
|
Jr,
|
|
900
900
|
{
|
|
901
|
-
ref:
|
|
901
|
+
ref: K,
|
|
902
902
|
id: L,
|
|
903
903
|
type: "button",
|
|
904
904
|
role: "combobox",
|
|
905
|
-
"aria-expanded":
|
|
905
|
+
"aria-expanded": b,
|
|
906
906
|
"aria-haspopup": "listbox",
|
|
907
|
-
"aria-controls":
|
|
908
|
-
"aria-activedescendant":
|
|
907
|
+
"aria-controls": b ? x : void 0,
|
|
908
|
+
"aria-activedescendant": b && !k ? R : void 0,
|
|
909
909
|
"aria-invalid": !!a,
|
|
910
|
-
"aria-label":
|
|
911
|
-
"aria-describedby":
|
|
910
|
+
"aria-label": C,
|
|
911
|
+
"aria-describedby": M,
|
|
912
912
|
$size: n,
|
|
913
|
-
$variant:
|
|
913
|
+
$variant: s,
|
|
914
914
|
$error: !!a,
|
|
915
|
-
$disabled:
|
|
916
|
-
$open:
|
|
917
|
-
disabled:
|
|
918
|
-
onClick: () => !
|
|
919
|
-
onKeyDown:
|
|
915
|
+
$disabled: h,
|
|
916
|
+
$open: b,
|
|
917
|
+
disabled: h,
|
|
918
|
+
onClick: () => !h && z((c) => !c),
|
|
919
|
+
onKeyDown: A,
|
|
920
920
|
children: [
|
|
921
|
-
/* @__PURE__ */ e(mo, { $placeholder: !
|
|
921
|
+
/* @__PURE__ */ e(mo, { $placeholder: !lo, children: lo?.label ?? r ?? "Select..." }),
|
|
922
922
|
/* @__PURE__ */ S(Qr, { children: [
|
|
923
|
-
|
|
923
|
+
$ && /* @__PURE__ */ e(
|
|
924
924
|
an,
|
|
925
925
|
{
|
|
926
926
|
type: "button",
|
|
927
|
-
onClick:
|
|
927
|
+
onClick: y,
|
|
928
928
|
"aria-label": "Clear selection",
|
|
929
|
-
children: /* @__PURE__ */ e(
|
|
929
|
+
children: /* @__PURE__ */ e(yo, { size: 14 })
|
|
930
930
|
}
|
|
931
931
|
),
|
|
932
|
-
/* @__PURE__ */ e(Zr, { $open:
|
|
932
|
+
/* @__PURE__ */ e(Zr, { $open: b, "aria-hidden": "true", children: /* @__PURE__ */ e(Ko, { size: 14 }) })
|
|
933
933
|
] })
|
|
934
934
|
]
|
|
935
935
|
}
|
|
936
936
|
),
|
|
937
|
-
|
|
937
|
+
b && xo(
|
|
938
938
|
/* @__PURE__ */ S(
|
|
939
939
|
on,
|
|
940
940
|
{
|
|
941
|
-
ref:
|
|
942
|
-
id:
|
|
941
|
+
ref: to,
|
|
942
|
+
id: x,
|
|
943
943
|
role: "listbox",
|
|
944
944
|
"aria-label": r ?? "Options",
|
|
945
945
|
style: {
|
|
@@ -949,33 +949,33 @@ function ln({
|
|
|
949
949
|
width: _.width
|
|
950
950
|
},
|
|
951
951
|
children: [
|
|
952
|
-
|
|
952
|
+
k && /* @__PURE__ */ e(rn, { children: /* @__PURE__ */ e(
|
|
953
953
|
nn,
|
|
954
954
|
{
|
|
955
|
-
ref:
|
|
956
|
-
id:
|
|
955
|
+
ref: J,
|
|
956
|
+
id: I,
|
|
957
957
|
type: "text",
|
|
958
958
|
placeholder: "Search...",
|
|
959
|
-
value:
|
|
960
|
-
onChange: (c) =>
|
|
961
|
-
onKeyDown:
|
|
959
|
+
value: N,
|
|
960
|
+
onChange: (c) => F(c.target.value),
|
|
961
|
+
onKeyDown: co,
|
|
962
962
|
"aria-label": "Search options",
|
|
963
|
-
"aria-controls":
|
|
964
|
-
"aria-activedescendant":
|
|
963
|
+
"aria-controls": x,
|
|
964
|
+
"aria-activedescendant": R
|
|
965
965
|
}
|
|
966
966
|
) }),
|
|
967
|
-
|
|
968
|
-
|
|
967
|
+
j.length === 0 && /* @__PURE__ */ e(tn, { children: "No options found" }),
|
|
968
|
+
j.map((c, E) => /* @__PURE__ */ e(
|
|
969
969
|
sn,
|
|
970
970
|
{
|
|
971
|
-
id: `${
|
|
971
|
+
id: `${x}-option-${E}`,
|
|
972
972
|
role: "option",
|
|
973
|
-
"aria-selected": c.value ===
|
|
973
|
+
"aria-selected": c.value === H,
|
|
974
974
|
"aria-disabled": c.disabled,
|
|
975
|
-
$selected: c.value ===
|
|
975
|
+
$selected: c.value === H,
|
|
976
976
|
$focused: E === D,
|
|
977
977
|
$disabled: c.disabled,
|
|
978
|
-
onClick: () =>
|
|
978
|
+
onClick: () => eo(c),
|
|
979
979
|
onMouseEnter: () => !c.disabled && W(E),
|
|
980
980
|
children: c.label
|
|
981
981
|
},
|
|
@@ -986,7 +986,7 @@ function ln({
|
|
|
986
986
|
),
|
|
987
987
|
document.body
|
|
988
988
|
),
|
|
989
|
-
|
|
989
|
+
w && /* @__PURE__ */ e(en, { $error: !0, children: w })
|
|
990
990
|
] });
|
|
991
991
|
}
|
|
992
992
|
ln.displayName = "Select";
|
|
@@ -999,27 +999,27 @@ const Po = i.span`
|
|
|
999
999
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
1000
1000
|
color: ${({ $empty: o, theme: r }) => o ? r.colors.neutral[400] : "inherit"};
|
|
1001
1001
|
|
|
1002
|
-
${({ theme: o }) => o.brutalism ?
|
|
1002
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
1003
1003
|
border: ${o.brutalism.borderWidth} solid transparent;
|
|
1004
|
-
` :
|
|
1004
|
+
` : t`
|
|
1005
1005
|
border: 1px solid transparent;
|
|
1006
1006
|
`}
|
|
1007
1007
|
|
|
1008
|
-
${({ $disabled: o, theme: r }) => o ?
|
|
1008
|
+
${({ $disabled: o, theme: r }) => o ? t`
|
|
1009
1009
|
opacity: 0.5;
|
|
1010
|
-
` :
|
|
1010
|
+
` : t`
|
|
1011
1011
|
cursor: text;
|
|
1012
1012
|
transition:
|
|
1013
1013
|
border-color 0.15s ease,
|
|
1014
1014
|
box-shadow 0.15s ease;
|
|
1015
1015
|
|
|
1016
1016
|
&:hover {
|
|
1017
|
-
${r.brutalism ?
|
|
1017
|
+
${r.brutalism ? t`
|
|
1018
1018
|
border-color: ${r.colors.neutral[900]};
|
|
1019
1019
|
box-shadow: ${r.brutalism.shadowOffset}
|
|
1020
1020
|
${r.brutalism.shadowOffset} 0
|
|
1021
1021
|
${r.colors.neutral[900]};
|
|
1022
|
-
` :
|
|
1022
|
+
` : t`
|
|
1023
1023
|
border-color: ${r.colors.primary[500]};
|
|
1024
1024
|
box-shadow: ${r.shadows.focusRing};
|
|
1025
1025
|
`}
|
|
@@ -1040,12 +1040,12 @@ const Po = i.span`
|
|
|
1040
1040
|
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
1041
1041
|
outline: none;
|
|
1042
1042
|
|
|
1043
|
-
${({ theme: o }) => o.brutalism ?
|
|
1043
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
1044
1044
|
border: ${o.brutalism.borderWidth} solid
|
|
1045
1045
|
${o.colors.neutral[900]};
|
|
1046
1046
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
1047
1047
|
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
1048
|
-
` :
|
|
1048
|
+
` : t`
|
|
1049
1049
|
border: 1px solid ${o.colors.primary[500]};
|
|
1050
1050
|
box-shadow: ${o.shadows.focusRing};
|
|
1051
1051
|
`}
|
|
@@ -1054,31 +1054,31 @@ function un({
|
|
|
1054
1054
|
value: o,
|
|
1055
1055
|
defaultValue: r = "",
|
|
1056
1056
|
onChange: n,
|
|
1057
|
-
onSubmit:
|
|
1057
|
+
onSubmit: s,
|
|
1058
1058
|
onCancel: a,
|
|
1059
1059
|
placeholder: l = "Click to edit",
|
|
1060
1060
|
disabled: d = !1
|
|
1061
1061
|
}) {
|
|
1062
|
-
const p = o !== void 0, [u, f] = T(r),
|
|
1063
|
-
d || (
|
|
1064
|
-
|
|
1062
|
+
const p = o !== void 0, [u, f] = T(r), g = p ? o : u, [m, v] = T(!1), [h, k] = T(""), C = Y(null), M = () => {
|
|
1063
|
+
d || (k(g), v(!0), setTimeout(() => {
|
|
1064
|
+
C.current?.focus(), C.current?.select();
|
|
1065
1065
|
}, 0));
|
|
1066
|
-
},
|
|
1067
|
-
p || f(
|
|
1066
|
+
}, P = () => {
|
|
1067
|
+
p || f(h), n?.(h), s?.(h), v(!1);
|
|
1068
1068
|
}, L = () => {
|
|
1069
|
-
a?.(
|
|
1070
|
-
},
|
|
1071
|
-
|
|
1069
|
+
a?.(g), v(!1);
|
|
1070
|
+
}, x = (I) => {
|
|
1071
|
+
I.key === "Enter" ? P() : I.key === "Escape" && L();
|
|
1072
1072
|
};
|
|
1073
|
-
return
|
|
1073
|
+
return m ? /* @__PURE__ */ e(Po, { children: /* @__PURE__ */ e(
|
|
1074
1074
|
dn,
|
|
1075
1075
|
{
|
|
1076
|
-
ref:
|
|
1077
|
-
value:
|
|
1078
|
-
size: Math.max(
|
|
1079
|
-
onChange: (
|
|
1080
|
-
onBlur:
|
|
1081
|
-
onKeyDown:
|
|
1076
|
+
ref: C,
|
|
1077
|
+
value: h,
|
|
1078
|
+
size: Math.max(h.length, l.length, 10),
|
|
1079
|
+
onChange: (I) => k(I.target.value),
|
|
1080
|
+
onBlur: P,
|
|
1081
|
+
onKeyDown: x,
|
|
1082
1082
|
"aria-label": "Edit value"
|
|
1083
1083
|
}
|
|
1084
1084
|
) }) : /* @__PURE__ */ e(Po, { children: /* @__PURE__ */ e(
|
|
@@ -1087,10 +1087,10 @@ function un({
|
|
|
1087
1087
|
role: d ? void 0 : "button",
|
|
1088
1088
|
tabIndex: d ? void 0 : 0,
|
|
1089
1089
|
$disabled: d,
|
|
1090
|
-
$empty:
|
|
1091
|
-
onClick:
|
|
1092
|
-
onKeyDown: (
|
|
1093
|
-
children:
|
|
1090
|
+
$empty: !g,
|
|
1091
|
+
onClick: M,
|
|
1092
|
+
onKeyDown: (I) => I.key === "Enter" && M(),
|
|
1093
|
+
children: g || l
|
|
1094
1094
|
}
|
|
1095
1095
|
) });
|
|
1096
1096
|
}
|
|
@@ -1107,13 +1107,13 @@ const pn = i.a`
|
|
|
1107
1107
|
}
|
|
1108
1108
|
|
|
1109
1109
|
${({ $variant: o, theme: r }) => ({
|
|
1110
|
-
default:
|
|
1110
|
+
default: t`
|
|
1111
1111
|
color: ${r.colors.primary[500]};
|
|
1112
1112
|
&:hover {
|
|
1113
1113
|
color: ${r.colors.primary[700]};
|
|
1114
1114
|
}
|
|
1115
1115
|
`,
|
|
1116
|
-
subtle:
|
|
1116
|
+
subtle: t`
|
|
1117
1117
|
color: ${r.colors.neutral[500]};
|
|
1118
1118
|
&:hover {
|
|
1119
1119
|
color: ${r.colors.neutral[900]};
|
|
@@ -1125,14 +1125,14 @@ function qo({
|
|
|
1125
1125
|
variant: o = "default",
|
|
1126
1126
|
external: r,
|
|
1127
1127
|
children: n,
|
|
1128
|
-
...
|
|
1128
|
+
...s
|
|
1129
1129
|
}) {
|
|
1130
1130
|
return /* @__PURE__ */ e(
|
|
1131
1131
|
pn,
|
|
1132
1132
|
{
|
|
1133
1133
|
$variant: o,
|
|
1134
1134
|
...r && { target: "_blank", rel: "noreferrer" },
|
|
1135
|
-
...
|
|
1135
|
+
...s,
|
|
1136
1136
|
children: n
|
|
1137
1137
|
}
|
|
1138
1138
|
);
|
|
@@ -1157,16 +1157,16 @@ function bn({ label: o, value: r, href: n }) {
|
|
|
1157
1157
|
] });
|
|
1158
1158
|
}
|
|
1159
1159
|
bn.displayName = "Field";
|
|
1160
|
-
const xn =
|
|
1160
|
+
const xn = oo`
|
|
1161
1161
|
from { opacity: 0; }
|
|
1162
1162
|
to { opacity: 1; }
|
|
1163
|
-
`, yn =
|
|
1163
|
+
`, yn = oo`
|
|
1164
1164
|
from { opacity: 1; }
|
|
1165
1165
|
to { opacity: 0; }
|
|
1166
|
-
`, hn =
|
|
1166
|
+
`, hn = oo`
|
|
1167
1167
|
from { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
1168
1168
|
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
1169
|
-
`, wn =
|
|
1169
|
+
`, wn = oo`
|
|
1170
1170
|
from { opacity: 1; transform: scale(1) translateY(0); }
|
|
1171
1171
|
to { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
1172
1172
|
`, mn = i.div`
|
|
@@ -1191,16 +1191,16 @@ const xn = J`
|
|
|
1191
1191
|
animation: ${({ $closing: o }) => o ? wn : hn} 0.15s ease
|
|
1192
1192
|
forwards;
|
|
1193
1193
|
|
|
1194
|
-
${({ $size: o }) => o === "sm" &&
|
|
1194
|
+
${({ $size: o }) => o === "sm" && t`
|
|
1195
1195
|
width: min(400px, 90vw);
|
|
1196
1196
|
`}
|
|
1197
|
-
${({ $size: o }) => o === "md" &&
|
|
1197
|
+
${({ $size: o }) => o === "md" && t`
|
|
1198
1198
|
width: min(560px, 90vw);
|
|
1199
1199
|
`}
|
|
1200
|
-
${({ $size: o }) => o === "lg" &&
|
|
1200
|
+
${({ $size: o }) => o === "lg" && t`
|
|
1201
1201
|
width: min(720px, 90vw);
|
|
1202
1202
|
`}
|
|
1203
|
-
${({ $size: o }) => o === "fullscreen" &&
|
|
1203
|
+
${({ $size: o }) => o === "fullscreen" && t`
|
|
1204
1204
|
width: 100vw;
|
|
1205
1205
|
height: 100vh;
|
|
1206
1206
|
max-height: 100vh;
|
|
@@ -1272,7 +1272,7 @@ function Go({
|
|
|
1272
1272
|
open: o,
|
|
1273
1273
|
onClose: r,
|
|
1274
1274
|
title: n,
|
|
1275
|
-
children:
|
|
1275
|
+
children: s,
|
|
1276
1276
|
footer: a,
|
|
1277
1277
|
size: l = "md",
|
|
1278
1278
|
closeOnBackdrop: d = !0,
|
|
@@ -1280,78 +1280,78 @@ function Go({
|
|
|
1280
1280
|
ariaLabelledBy: u,
|
|
1281
1281
|
ariaDescribedBy: f
|
|
1282
1282
|
}) {
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1285
|
-
const
|
|
1283
|
+
const g = Y(null), m = Y(null), v = Y(r);
|
|
1284
|
+
v.current = r;
|
|
1285
|
+
const h = ro(), k = u ?? (n ? h : void 0), [C, M] = T(o), [P, L] = T(!1);
|
|
1286
1286
|
return B(() => {
|
|
1287
1287
|
if (o)
|
|
1288
|
-
|
|
1289
|
-
else if (
|
|
1288
|
+
M(!0), L(!1);
|
|
1289
|
+
else if (C) {
|
|
1290
1290
|
L(!0);
|
|
1291
|
-
const
|
|
1292
|
-
|
|
1291
|
+
const x = setTimeout(() => {
|
|
1292
|
+
M(!1), L(!1);
|
|
1293
1293
|
}, 150);
|
|
1294
|
-
return () => clearTimeout(
|
|
1294
|
+
return () => clearTimeout(x);
|
|
1295
1295
|
}
|
|
1296
|
-
}, [o,
|
|
1296
|
+
}, [o, C]), B(() => {
|
|
1297
1297
|
if (!o)
|
|
1298
1298
|
return;
|
|
1299
|
-
const
|
|
1299
|
+
const x = document.body.style.overflow;
|
|
1300
1300
|
return document.body.style.overflow = "hidden", () => {
|
|
1301
|
-
document.body.style.overflow =
|
|
1301
|
+
document.body.style.overflow = x;
|
|
1302
1302
|
};
|
|
1303
1303
|
}, [o]), B(() => {
|
|
1304
|
-
if (!o ||
|
|
1304
|
+
if (!o || !g.current)
|
|
1305
1305
|
return;
|
|
1306
|
-
const
|
|
1307
|
-
(Ro(
|
|
1308
|
-
const
|
|
1309
|
-
if (
|
|
1310
|
-
|
|
1306
|
+
const x = g.current, I = document.activeElement;
|
|
1307
|
+
(Ro(x)[0] ?? x).focus();
|
|
1308
|
+
const b = (z) => {
|
|
1309
|
+
if (z.key === "Escape" && p) {
|
|
1310
|
+
v.current();
|
|
1311
1311
|
return;
|
|
1312
1312
|
}
|
|
1313
|
-
if (
|
|
1313
|
+
if (z.key !== "Tab")
|
|
1314
1314
|
return;
|
|
1315
|
-
const D = Ro(
|
|
1315
|
+
const D = Ro(x);
|
|
1316
1316
|
if (D.length === 0) {
|
|
1317
|
-
|
|
1317
|
+
z.preventDefault();
|
|
1318
1318
|
return;
|
|
1319
1319
|
}
|
|
1320
|
-
const W = D[0],
|
|
1321
|
-
|
|
1320
|
+
const W = D[0], N = D[D.length - 1];
|
|
1321
|
+
z.shiftKey ? document.activeElement === W && (z.preventDefault(), N.focus()) : document.activeElement === N && (z.preventDefault(), W.focus());
|
|
1322
1322
|
};
|
|
1323
|
-
return document.addEventListener("keydown",
|
|
1324
|
-
document.removeEventListener("keydown",
|
|
1323
|
+
return document.addEventListener("keydown", b), () => {
|
|
1324
|
+
document.removeEventListener("keydown", b), I?.focus();
|
|
1325
1325
|
};
|
|
1326
|
-
}, [o, p,
|
|
1326
|
+
}, [o, p, C]), C ? xo(
|
|
1327
1327
|
/* @__PURE__ */ e(
|
|
1328
1328
|
mn,
|
|
1329
1329
|
{
|
|
1330
|
-
$closing:
|
|
1331
|
-
onMouseDown: (
|
|
1332
|
-
|
|
1330
|
+
$closing: P,
|
|
1331
|
+
onMouseDown: (x) => {
|
|
1332
|
+
m.current = x.target;
|
|
1333
1333
|
},
|
|
1334
|
-
onClick: (
|
|
1335
|
-
d &&
|
|
1334
|
+
onClick: (x) => {
|
|
1335
|
+
d && m.current === x.currentTarget && r();
|
|
1336
1336
|
},
|
|
1337
1337
|
children: /* @__PURE__ */ S(
|
|
1338
1338
|
vn,
|
|
1339
1339
|
{
|
|
1340
|
-
ref:
|
|
1340
|
+
ref: g,
|
|
1341
1341
|
role: "dialog",
|
|
1342
1342
|
"aria-modal": "true",
|
|
1343
|
-
"aria-labelledby":
|
|
1343
|
+
"aria-labelledby": k,
|
|
1344
1344
|
"aria-describedby": f,
|
|
1345
1345
|
$size: l,
|
|
1346
|
-
$closing:
|
|
1346
|
+
$closing: P,
|
|
1347
1347
|
tabIndex: -1,
|
|
1348
|
-
onClick: (
|
|
1348
|
+
onClick: (x) => x.stopPropagation(),
|
|
1349
1349
|
children: [
|
|
1350
1350
|
/* @__PURE__ */ S(kn, { children: [
|
|
1351
|
-
n && /* @__PURE__ */ e(Sn, { id:
|
|
1351
|
+
n && /* @__PURE__ */ e(Sn, { id: h, children: n }),
|
|
1352
1352
|
/* @__PURE__ */ e(zn, { onClick: r, "aria-label": "Close modal", children: "×" })
|
|
1353
1353
|
] }),
|
|
1354
|
-
/* @__PURE__ */ e(Cn, { children:
|
|
1354
|
+
/* @__PURE__ */ e(Cn, { children: s }),
|
|
1355
1355
|
a && /* @__PURE__ */ e(In, { children: a })
|
|
1356
1356
|
]
|
|
1357
1357
|
}
|
|
@@ -1362,16 +1362,16 @@ function Go({
|
|
|
1362
1362
|
) : null;
|
|
1363
1363
|
}
|
|
1364
1364
|
Go.displayName = "Modal";
|
|
1365
|
-
const Xo =
|
|
1365
|
+
const Xo = oo`
|
|
1366
1366
|
from { opacity: 0; transform: translateY(12px); }
|
|
1367
1367
|
to { opacity: 1; transform: translateY(0); }
|
|
1368
|
-
`, Jo =
|
|
1368
|
+
`, Jo = oo`
|
|
1369
1369
|
from { opacity: 0; transform: translateY(-12px); }
|
|
1370
1370
|
to { opacity: 1; transform: translateY(0); }
|
|
1371
|
-
`, Qo =
|
|
1371
|
+
`, Qo = oo`
|
|
1372
1372
|
from { opacity: 1; }
|
|
1373
1373
|
to { opacity: 0; }
|
|
1374
|
-
`,
|
|
1374
|
+
`, go = (o, r, n) => t`
|
|
1375
1375
|
background: ${r};
|
|
1376
1376
|
border: ${o.brutalism.borderWidth} solid ${n};
|
|
1377
1377
|
box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
|
|
@@ -1379,46 +1379,46 @@ const Xo = J`
|
|
|
1379
1379
|
`;
|
|
1380
1380
|
function Zo(o, r) {
|
|
1381
1381
|
return r.brutalism ? {
|
|
1382
|
-
success:
|
|
1382
|
+
success: go(
|
|
1383
1383
|
r,
|
|
1384
1384
|
r.colors.success[50],
|
|
1385
1385
|
r.colors.success[500]
|
|
1386
1386
|
),
|
|
1387
|
-
error:
|
|
1387
|
+
error: go(
|
|
1388
1388
|
r,
|
|
1389
1389
|
r.colors.error[50],
|
|
1390
1390
|
r.colors.error[500]
|
|
1391
1391
|
),
|
|
1392
|
-
warning:
|
|
1392
|
+
warning: go(
|
|
1393
1393
|
r,
|
|
1394
1394
|
r.colors.warning[50],
|
|
1395
1395
|
r.colors.warning[500]
|
|
1396
1396
|
),
|
|
1397
|
-
info:
|
|
1397
|
+
info: go(r, r.colors.info[50], r.colors.info[500])
|
|
1398
1398
|
}[o] : {
|
|
1399
|
-
success:
|
|
1399
|
+
success: t`
|
|
1400
1400
|
background: ${r.colors.success[50]};
|
|
1401
1401
|
border-left: ${r.spacing[1]} solid ${r.colors.success[500]};
|
|
1402
1402
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1403
1403
|
`,
|
|
1404
|
-
error:
|
|
1404
|
+
error: t`
|
|
1405
1405
|
background: ${r.colors.error[50]};
|
|
1406
1406
|
border-left: ${r.spacing[1]} solid ${r.colors.error[500]};
|
|
1407
1407
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1408
1408
|
`,
|
|
1409
|
-
warning:
|
|
1409
|
+
warning: t`
|
|
1410
1410
|
background: ${r.colors.warning[50]};
|
|
1411
1411
|
border-left: ${r.spacing[1]} solid ${r.colors.warning[500]};
|
|
1412
1412
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1413
1413
|
`,
|
|
1414
|
-
info:
|
|
1414
|
+
info: t`
|
|
1415
1415
|
background: ${r.colors.info[50]};
|
|
1416
1416
|
border-left: ${r.spacing[1]} solid ${r.colors.info[500]};
|
|
1417
1417
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
1418
1418
|
`
|
|
1419
1419
|
}[o];
|
|
1420
1420
|
}
|
|
1421
|
-
const or =
|
|
1421
|
+
const or = t`
|
|
1422
1422
|
display: flex;
|
|
1423
1423
|
align-items: center;
|
|
1424
1424
|
gap: ${({ theme: o }) => o.spacing[3]};
|
|
@@ -1427,19 +1427,19 @@ const or = s`
|
|
|
1427
1427
|
padding: ${({ theme: o }) => `${o.spacing[3]} ${o.spacing[4]}`};
|
|
1428
1428
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
1429
1429
|
`, Wn = {
|
|
1430
|
-
"bottom-right":
|
|
1430
|
+
"bottom-right": t`
|
|
1431
1431
|
bottom: 24px;
|
|
1432
1432
|
right: 24px;
|
|
1433
1433
|
`,
|
|
1434
|
-
"bottom-left":
|
|
1434
|
+
"bottom-left": t`
|
|
1435
1435
|
bottom: 24px;
|
|
1436
1436
|
left: 24px;
|
|
1437
1437
|
`,
|
|
1438
|
-
"top-right":
|
|
1438
|
+
"top-right": t`
|
|
1439
1439
|
top: 24px;
|
|
1440
1440
|
right: 24px;
|
|
1441
1441
|
`,
|
|
1442
|
-
"top-left":
|
|
1442
|
+
"top-left": t`
|
|
1443
1443
|
top: 24px;
|
|
1444
1444
|
left: 24px;
|
|
1445
1445
|
`
|
|
@@ -1448,11 +1448,11 @@ const or = s`
|
|
|
1448
1448
|
z-index: ${({ theme: o }) => o.zIndex.toast};
|
|
1449
1449
|
${or}
|
|
1450
1450
|
|
|
1451
|
-
animation: ${({ $closing: o, $position: r }) => o ?
|
|
1451
|
+
animation: ${({ $closing: o, $position: r }) => o ? t`
|
|
1452
1452
|
${Qo} 0.2s ease forwards
|
|
1453
|
-
` : r.startsWith("top") ?
|
|
1453
|
+
` : r.startsWith("top") ? t`
|
|
1454
1454
|
${Jo} 0.2s ease forwards
|
|
1455
|
-
` :
|
|
1455
|
+
` : t`
|
|
1456
1456
|
${Xo} 0.2s ease forwards
|
|
1457
1457
|
`};
|
|
1458
1458
|
|
|
@@ -1462,16 +1462,16 @@ const or = s`
|
|
|
1462
1462
|
${or}
|
|
1463
1463
|
pointer-events: all;
|
|
1464
1464
|
|
|
1465
|
-
animation: ${({ $closing: o, $isTop: r }) => o ?
|
|
1465
|
+
animation: ${({ $closing: o, $isTop: r }) => o ? t`
|
|
1466
1466
|
${Qo} 0.2s ease forwards
|
|
1467
|
-
` : r ?
|
|
1467
|
+
` : r ? t`
|
|
1468
1468
|
${Jo} 0.2s ease forwards
|
|
1469
|
-
` :
|
|
1469
|
+
` : t`
|
|
1470
1470
|
${Xo} 0.2s ease forwards
|
|
1471
1471
|
`};
|
|
1472
1472
|
|
|
1473
1473
|
${({ $variant: o, theme: r }) => Zo(o, r)}
|
|
1474
|
-
`,
|
|
1474
|
+
`, On = i.div`
|
|
1475
1475
|
position: fixed;
|
|
1476
1476
|
z-index: ${({ theme: o }) => o.zIndex.toast};
|
|
1477
1477
|
display: flex;
|
|
@@ -1480,22 +1480,22 @@ const or = s`
|
|
|
1480
1480
|
pointer-events: none;
|
|
1481
1481
|
|
|
1482
1482
|
${({ $position: o, theme: r }) => ({
|
|
1483
|
-
"bottom-right":
|
|
1483
|
+
"bottom-right": t`
|
|
1484
1484
|
bottom: ${r.spacing[6]};
|
|
1485
1485
|
right: ${r.spacing[6]};
|
|
1486
1486
|
align-items: flex-end;
|
|
1487
1487
|
`,
|
|
1488
|
-
"bottom-left":
|
|
1488
|
+
"bottom-left": t`
|
|
1489
1489
|
bottom: ${r.spacing[6]};
|
|
1490
1490
|
left: ${r.spacing[6]};
|
|
1491
1491
|
align-items: flex-start;
|
|
1492
1492
|
`,
|
|
1493
|
-
"top-right":
|
|
1493
|
+
"top-right": t`
|
|
1494
1494
|
top: ${r.spacing[6]};
|
|
1495
1495
|
right: ${r.spacing[6]};
|
|
1496
1496
|
align-items: flex-end;
|
|
1497
1497
|
`,
|
|
1498
|
-
"top-left":
|
|
1498
|
+
"top-left": t`
|
|
1499
1499
|
top: ${r.spacing[6]};
|
|
1500
1500
|
left: ${r.spacing[6]};
|
|
1501
1501
|
align-items: flex-start;
|
|
@@ -1531,11 +1531,11 @@ const or = s`
|
|
|
1531
1531
|
outline-offset: 2px;
|
|
1532
1532
|
}
|
|
1533
1533
|
`;
|
|
1534
|
-
function
|
|
1534
|
+
function Mn({
|
|
1535
1535
|
open: o,
|
|
1536
1536
|
onClose: r,
|
|
1537
1537
|
message: n,
|
|
1538
|
-
variant:
|
|
1538
|
+
variant: s = "info",
|
|
1539
1539
|
duration: a = 4e3,
|
|
1540
1540
|
position: l = "bottom-right"
|
|
1541
1541
|
}) {
|
|
@@ -1545,39 +1545,39 @@ function On({
|
|
|
1545
1545
|
p(!0), f(!1);
|
|
1546
1546
|
else if (d) {
|
|
1547
1547
|
f(!0);
|
|
1548
|
-
const
|
|
1548
|
+
const g = setTimeout(() => {
|
|
1549
1549
|
p(!1), f(!1);
|
|
1550
1550
|
}, 200);
|
|
1551
1551
|
return () => {
|
|
1552
|
-
clearTimeout(
|
|
1552
|
+
clearTimeout(g);
|
|
1553
1553
|
};
|
|
1554
1554
|
}
|
|
1555
1555
|
}, [o, d]), B(() => {
|
|
1556
1556
|
if (!o || a === 0)
|
|
1557
1557
|
return;
|
|
1558
|
-
const
|
|
1558
|
+
const g = setTimeout(r, a);
|
|
1559
1559
|
return () => {
|
|
1560
|
-
clearTimeout(
|
|
1560
|
+
clearTimeout(g);
|
|
1561
1561
|
};
|
|
1562
|
-
}, [o, a, r]), d ?
|
|
1562
|
+
}, [o, a, r]), d ? xo(
|
|
1563
1563
|
/* @__PURE__ */ S(
|
|
1564
1564
|
Dn,
|
|
1565
1565
|
{
|
|
1566
1566
|
$position: l,
|
|
1567
|
-
$variant:
|
|
1567
|
+
$variant: s,
|
|
1568
1568
|
$closing: u,
|
|
1569
1569
|
role: "alert",
|
|
1570
1570
|
"aria-live": "polite",
|
|
1571
1571
|
children: [
|
|
1572
1572
|
/* @__PURE__ */ e(rr, { children: n }),
|
|
1573
|
-
/* @__PURE__ */ e(nr, { onClick: r, "aria-label": "Close notification", children: /* @__PURE__ */ e(
|
|
1573
|
+
/* @__PURE__ */ e(nr, { onClick: r, "aria-label": "Close notification", children: /* @__PURE__ */ e(yo, { size: 14, strokeWidth: 2.5 }) })
|
|
1574
1574
|
]
|
|
1575
1575
|
}
|
|
1576
1576
|
),
|
|
1577
1577
|
document.body
|
|
1578
1578
|
) : null;
|
|
1579
1579
|
}
|
|
1580
|
-
|
|
1580
|
+
Mn.displayName = "Toast";
|
|
1581
1581
|
const tr = Wo(null), Vo = 5, Ln = "bottom-right";
|
|
1582
1582
|
function Nn({
|
|
1583
1583
|
toast: o,
|
|
@@ -1585,10 +1585,10 @@ function Nn({
|
|
|
1585
1585
|
onClose: n
|
|
1586
1586
|
}) {
|
|
1587
1587
|
return B(() => {
|
|
1588
|
-
const
|
|
1589
|
-
if (
|
|
1588
|
+
const s = o.duration ?? 4e3;
|
|
1589
|
+
if (s === 0)
|
|
1590
1590
|
return;
|
|
1591
|
-
const a = setTimeout(() => n(o.id),
|
|
1591
|
+
const a = setTimeout(() => n(o.id), s);
|
|
1592
1592
|
return () => clearTimeout(a);
|
|
1593
1593
|
}, [o.id, o.duration, n]), /* @__PURE__ */ S(
|
|
1594
1594
|
En,
|
|
@@ -1605,29 +1605,29 @@ function Nn({
|
|
|
1605
1605
|
{
|
|
1606
1606
|
onClick: () => n(o.id),
|
|
1607
1607
|
"aria-label": "Close notification",
|
|
1608
|
-
children: /* @__PURE__ */ e(
|
|
1608
|
+
children: /* @__PURE__ */ e(yo, { size: 14, strokeWidth: 2.5 })
|
|
1609
1609
|
}
|
|
1610
1610
|
)
|
|
1611
1611
|
]
|
|
1612
1612
|
}
|
|
1613
1613
|
);
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1616
|
-
const [r, n] = T([]),
|
|
1615
|
+
function xs({ children: o }) {
|
|
1616
|
+
const [r, n] = T([]), s = X((u) => {
|
|
1617
1617
|
n(
|
|
1618
1618
|
(f) => f.map(
|
|
1619
|
-
(
|
|
1619
|
+
(g) => g.id === u ? { ...g, closing: !0 } : g
|
|
1620
1620
|
)
|
|
1621
1621
|
), setTimeout(() => {
|
|
1622
1622
|
n(
|
|
1623
|
-
(f) => f.filter((
|
|
1623
|
+
(f) => f.filter((g) => g.id !== u)
|
|
1624
1624
|
);
|
|
1625
1625
|
}, 200);
|
|
1626
1626
|
}, []), a = X((u) => {
|
|
1627
1627
|
const f = Date.now();
|
|
1628
|
-
n((
|
|
1629
|
-
const
|
|
1630
|
-
return
|
|
1628
|
+
n((g) => {
|
|
1629
|
+
const m = [...g, { ...u, id: f, closing: !1 }];
|
|
1630
|
+
return m.length > Vo ? m.slice(m.length - Vo) : m;
|
|
1631
1631
|
});
|
|
1632
1632
|
}, []), l = Do(() => Object.assign((u) => a(u), {
|
|
1633
1633
|
success: (u, f) => a({ ...f, message: u, variant: "success" }),
|
|
@@ -1637,13 +1637,13 @@ function $s({ children: o }) {
|
|
|
1637
1637
|
}), [a]), d = r[r.length - 1]?.position ?? Ln, p = d.startsWith("top");
|
|
1638
1638
|
return /* @__PURE__ */ S(tr.Provider, { value: { toast: l }, children: [
|
|
1639
1639
|
o,
|
|
1640
|
-
r.length > 0 &&
|
|
1641
|
-
/* @__PURE__ */ e(
|
|
1640
|
+
r.length > 0 && xo(
|
|
1641
|
+
/* @__PURE__ */ e(On, { $position: d, children: r.map((u) => /* @__PURE__ */ e(
|
|
1642
1642
|
Nn,
|
|
1643
1643
|
{
|
|
1644
1644
|
toast: u,
|
|
1645
1645
|
isTop: p,
|
|
1646
|
-
onClose:
|
|
1646
|
+
onClose: s
|
|
1647
1647
|
},
|
|
1648
1648
|
u.id
|
|
1649
1649
|
)) }),
|
|
@@ -1651,7 +1651,7 @@ function $s({ children: o }) {
|
|
|
1651
1651
|
)
|
|
1652
1652
|
] });
|
|
1653
1653
|
}
|
|
1654
|
-
function
|
|
1654
|
+
function ys() {
|
|
1655
1655
|
const o = To(tr);
|
|
1656
1656
|
if (!o)
|
|
1657
1657
|
throw new Error("useToast must be used within a ToastProvider");
|
|
@@ -1666,8 +1666,8 @@ function Rn({ onSubmit: o, children: r, ...n }) {
|
|
|
1666
1666
|
return /* @__PURE__ */ e(
|
|
1667
1667
|
Pn,
|
|
1668
1668
|
{
|
|
1669
|
-
onSubmit: (
|
|
1670
|
-
|
|
1669
|
+
onSubmit: (s) => {
|
|
1670
|
+
s.preventDefault(), o?.(s);
|
|
1671
1671
|
},
|
|
1672
1672
|
noValidate: !0,
|
|
1673
1673
|
...n,
|
|
@@ -1695,10 +1695,10 @@ function sr({
|
|
|
1695
1695
|
label: o,
|
|
1696
1696
|
error: r,
|
|
1697
1697
|
helperText: n,
|
|
1698
|
-
required:
|
|
1698
|
+
required: s,
|
|
1699
1699
|
children: a
|
|
1700
1700
|
}) {
|
|
1701
|
-
const l =
|
|
1701
|
+
const l = ro(), d = `${l}-hint`, p = !!(r || n), u = typeof r == "string" ? r : void 0, f = Mo.isValidElement(a) ? Mo.cloneElement(
|
|
1702
1702
|
a,
|
|
1703
1703
|
{
|
|
1704
1704
|
id: l,
|
|
@@ -1709,127 +1709,127 @@ function sr({
|
|
|
1709
1709
|
return /* @__PURE__ */ S(Vn, { children: [
|
|
1710
1710
|
o && /* @__PURE__ */ S(Fn, { htmlFor: l, children: [
|
|
1711
1711
|
o,
|
|
1712
|
-
|
|
1712
|
+
s && /* @__PURE__ */ e(An, { "aria-hidden": "true", children: " *" })
|
|
1713
1713
|
] }),
|
|
1714
1714
|
f,
|
|
1715
1715
|
p && /* @__PURE__ */ e(Bn, { id: d, $error: !!r, children: u ?? n })
|
|
1716
1716
|
] });
|
|
1717
1717
|
}
|
|
1718
1718
|
sr.displayName = "FormField";
|
|
1719
|
-
function
|
|
1719
|
+
function hs({
|
|
1720
1720
|
initialValues: o,
|
|
1721
1721
|
validate: r,
|
|
1722
1722
|
onSubmit: n,
|
|
1723
|
-
onError:
|
|
1723
|
+
onError: s
|
|
1724
1724
|
}) {
|
|
1725
1725
|
const [a, l] = T(o), [d, p] = T(
|
|
1726
1726
|
{}
|
|
1727
|
-
), [u, f] = T({}), [
|
|
1728
|
-
|
|
1729
|
-
const
|
|
1730
|
-
(
|
|
1727
|
+
), [u, f] = T({}), [g, m] = T(!1), v = Y(a);
|
|
1728
|
+
v.current = a;
|
|
1729
|
+
const h = X(
|
|
1730
|
+
(w) => {
|
|
1731
1731
|
if (!r)
|
|
1732
1732
|
return {};
|
|
1733
|
-
const
|
|
1733
|
+
const b = r(w);
|
|
1734
1734
|
return Object.fromEntries(
|
|
1735
|
-
Object.entries(
|
|
1735
|
+
Object.entries(b).filter(([, z]) => z !== void 0)
|
|
1736
1736
|
);
|
|
1737
1737
|
},
|
|
1738
1738
|
[r]
|
|
1739
|
-
),
|
|
1740
|
-
|
|
1741
|
-
const
|
|
1742
|
-
(
|
|
1743
|
-
const { name:
|
|
1744
|
-
process.env.NODE_ENV !== "production" && !
|
|
1739
|
+
), k = Y(u);
|
|
1740
|
+
k.current = u;
|
|
1741
|
+
const C = X(
|
|
1742
|
+
(w) => {
|
|
1743
|
+
const { name: b, value: z } = w.target;
|
|
1744
|
+
process.env.NODE_ENV !== "production" && !b && console.warn(
|
|
1745
1745
|
"[useForm] handleChange: field is missing a `name` attribute — value will not be tracked."
|
|
1746
1746
|
);
|
|
1747
|
-
const D = { ...
|
|
1748
|
-
l(D),
|
|
1747
|
+
const D = { ...v.current, [b]: z };
|
|
1748
|
+
l(D), k.current[b] && p(h(D));
|
|
1749
1749
|
},
|
|
1750
|
-
[
|
|
1751
|
-
),
|
|
1752
|
-
(
|
|
1753
|
-
const { name:
|
|
1754
|
-
process.env.NODE_ENV !== "production" && !
|
|
1750
|
+
[h]
|
|
1751
|
+
), M = X(
|
|
1752
|
+
(w) => {
|
|
1753
|
+
const { name: b } = w.target;
|
|
1754
|
+
process.env.NODE_ENV !== "production" && !b && console.warn(
|
|
1755
1755
|
"[useForm] handleBlur: field is missing a `name` attribute — touched state will not be tracked."
|
|
1756
|
-
), f((
|
|
1756
|
+
), f((z) => ({ ...z, [b]: !0 })), p(h(v.current));
|
|
1757
1757
|
},
|
|
1758
|
-
[
|
|
1759
|
-
),
|
|
1760
|
-
(
|
|
1761
|
-
|
|
1762
|
-
const
|
|
1763
|
-
(W,
|
|
1758
|
+
[h]
|
|
1759
|
+
), P = X(
|
|
1760
|
+
(w) => {
|
|
1761
|
+
w?.preventDefault();
|
|
1762
|
+
const b = Object.keys(v.current).reduce(
|
|
1763
|
+
(W, N) => ({ ...W, [N]: !0 }),
|
|
1764
1764
|
{}
|
|
1765
1765
|
);
|
|
1766
|
-
f(
|
|
1767
|
-
const
|
|
1768
|
-
if (p(
|
|
1769
|
-
|
|
1766
|
+
f(b);
|
|
1767
|
+
const z = h(v.current);
|
|
1768
|
+
if (p(z), Object.keys(z).length > 0) {
|
|
1769
|
+
s?.(z);
|
|
1770
1770
|
return;
|
|
1771
1771
|
}
|
|
1772
1772
|
(async () => {
|
|
1773
|
-
|
|
1773
|
+
m(!0);
|
|
1774
1774
|
try {
|
|
1775
|
-
await n?.(
|
|
1775
|
+
await n?.(v.current);
|
|
1776
1776
|
} finally {
|
|
1777
|
-
|
|
1777
|
+
m(!1);
|
|
1778
1778
|
}
|
|
1779
1779
|
})();
|
|
1780
1780
|
},
|
|
1781
|
-
[
|
|
1782
|
-
), L = X((
|
|
1783
|
-
l((
|
|
1784
|
-
}, []),
|
|
1785
|
-
(
|
|
1786
|
-
l(
|
|
1781
|
+
[h, n, s]
|
|
1782
|
+
), L = X((w, b) => {
|
|
1783
|
+
l((z) => ({ ...z, [w]: b }));
|
|
1784
|
+
}, []), x = X(
|
|
1785
|
+
(w) => {
|
|
1786
|
+
l(w ?? o), p({}), f({}), m(!1);
|
|
1787
1787
|
},
|
|
1788
1788
|
[o]
|
|
1789
|
-
),
|
|
1790
|
-
Object.entries(d).filter(([
|
|
1789
|
+
), I = Object.fromEntries(
|
|
1790
|
+
Object.entries(d).filter(([w]) => u[w])
|
|
1791
1791
|
);
|
|
1792
1792
|
return {
|
|
1793
1793
|
values: a,
|
|
1794
|
-
errors:
|
|
1794
|
+
errors: I,
|
|
1795
1795
|
touched: u,
|
|
1796
|
-
handleChange:
|
|
1797
|
-
handleBlur:
|
|
1798
|
-
handleSubmit:
|
|
1796
|
+
handleChange: C,
|
|
1797
|
+
handleBlur: M,
|
|
1798
|
+
handleSubmit: P,
|
|
1799
1799
|
setFieldValue: L,
|
|
1800
|
-
reset:
|
|
1801
|
-
isSubmitting:
|
|
1800
|
+
reset: x,
|
|
1801
|
+
isSubmitting: g
|
|
1802
1802
|
};
|
|
1803
1803
|
}
|
|
1804
|
-
const
|
|
1804
|
+
const ws = (o = "Required") => (r) => {
|
|
1805
1805
|
if (!r.trim())
|
|
1806
1806
|
return o;
|
|
1807
|
-
},
|
|
1807
|
+
}, ms = (o, r) => (n) => {
|
|
1808
1808
|
if (n.length < o)
|
|
1809
1809
|
return r ?? `Must be at least ${o} characters`;
|
|
1810
|
-
},
|
|
1810
|
+
}, vs = (o, r) => (n) => {
|
|
1811
1811
|
if (n.length > o)
|
|
1812
1812
|
return r ?? `Must be at most ${o} characters`;
|
|
1813
|
-
},
|
|
1813
|
+
}, ks = (o = "Enter a valid email") => (r) => {
|
|
1814
1814
|
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))
|
|
1815
1815
|
return o;
|
|
1816
|
-
},
|
|
1816
|
+
}, Ss = (o = "Enter a valid URL") => (r) => {
|
|
1817
1817
|
try {
|
|
1818
1818
|
new URL(r);
|
|
1819
1819
|
return;
|
|
1820
1820
|
} catch {
|
|
1821
1821
|
return o;
|
|
1822
1822
|
}
|
|
1823
|
-
},
|
|
1823
|
+
}, zs = (o, r) => (n) => {
|
|
1824
1824
|
if (!o.test(n))
|
|
1825
1825
|
return r;
|
|
1826
1826
|
};
|
|
1827
|
-
function
|
|
1827
|
+
function Cs(...o) {
|
|
1828
1828
|
return (r) => {
|
|
1829
1829
|
for (const n of o) {
|
|
1830
|
-
const
|
|
1831
|
-
if (
|
|
1832
|
-
return
|
|
1830
|
+
const s = n(r);
|
|
1831
|
+
if (s !== void 0)
|
|
1832
|
+
return s;
|
|
1833
1833
|
}
|
|
1834
1834
|
};
|
|
1835
1835
|
}
|
|
@@ -1869,17 +1869,17 @@ const _n = i.div`
|
|
|
1869
1869
|
border-color 0.1s;
|
|
1870
1870
|
|
|
1871
1871
|
${({ $size: o = "md", theme: r }) => ({
|
|
1872
|
-
sm:
|
|
1872
|
+
sm: t`
|
|
1873
1873
|
width: ${r.spacing[4]};
|
|
1874
1874
|
height: ${r.spacing[4]};
|
|
1875
1875
|
`,
|
|
1876
|
-
md:
|
|
1876
|
+
md: t`
|
|
1877
1877
|
width: ${r.spacing[5]};
|
|
1878
1878
|
height: ${r.spacing[5]};
|
|
1879
1879
|
`
|
|
1880
1880
|
})[o]}
|
|
1881
1881
|
|
|
1882
|
-
${({ $checked: o, $checkColor: r }) => o &&
|
|
1882
|
+
${({ $checked: o, $checkColor: r }) => o && t`
|
|
1883
1883
|
&::after {
|
|
1884
1884
|
content: "";
|
|
1885
1885
|
display: block;
|
|
@@ -1902,46 +1902,46 @@ function qn({
|
|
|
1902
1902
|
ref: o,
|
|
1903
1903
|
label: r,
|
|
1904
1904
|
size: n = "md",
|
|
1905
|
-
error:
|
|
1905
|
+
error: s,
|
|
1906
1906
|
helperText: a,
|
|
1907
1907
|
disabled: l,
|
|
1908
1908
|
checked: d,
|
|
1909
1909
|
id: p,
|
|
1910
1910
|
color: u,
|
|
1911
1911
|
borderColor: f,
|
|
1912
|
-
checkColor:
|
|
1913
|
-
...
|
|
1912
|
+
checkColor: g,
|
|
1913
|
+
...m
|
|
1914
1914
|
}) {
|
|
1915
|
-
const
|
|
1915
|
+
const v = ro(), h = p ?? v, k = typeof s == "string" ? s : void 0, C = !!(a || s);
|
|
1916
1916
|
return /* @__PURE__ */ S(_n, { children: [
|
|
1917
|
-
/* @__PURE__ */ S(jn, { htmlFor:
|
|
1917
|
+
/* @__PURE__ */ S(jn, { htmlFor: h, $disabled: l, children: [
|
|
1918
1918
|
/* @__PURE__ */ e(
|
|
1919
1919
|
Hn,
|
|
1920
1920
|
{
|
|
1921
|
-
id:
|
|
1921
|
+
id: h,
|
|
1922
1922
|
ref: o,
|
|
1923
1923
|
type: "checkbox",
|
|
1924
1924
|
checked: d,
|
|
1925
1925
|
disabled: l,
|
|
1926
|
-
"aria-invalid": !!
|
|
1927
|
-
...
|
|
1926
|
+
"aria-invalid": !!s,
|
|
1927
|
+
...m
|
|
1928
1928
|
}
|
|
1929
1929
|
),
|
|
1930
1930
|
/* @__PURE__ */ e(
|
|
1931
1931
|
Yn,
|
|
1932
1932
|
{
|
|
1933
1933
|
$checked: d,
|
|
1934
|
-
$error: !!
|
|
1934
|
+
$error: !!s,
|
|
1935
1935
|
$disabled: l,
|
|
1936
1936
|
$size: n,
|
|
1937
1937
|
$color: u,
|
|
1938
1938
|
$borderColor: f,
|
|
1939
|
-
$checkColor:
|
|
1939
|
+
$checkColor: g
|
|
1940
1940
|
}
|
|
1941
1941
|
),
|
|
1942
1942
|
r && /* @__PURE__ */ e(Un, { $size: n, children: r })
|
|
1943
1943
|
] }),
|
|
1944
|
-
|
|
1944
|
+
C && /* @__PURE__ */ e(Kn, { $error: !!s, children: k ?? a })
|
|
1945
1945
|
] });
|
|
1946
1946
|
}
|
|
1947
1947
|
qn.displayName = "Checkbox";
|
|
@@ -1981,17 +1981,17 @@ const Gn = i.div`
|
|
|
1981
1981
|
border-color 0.1s;
|
|
1982
1982
|
|
|
1983
1983
|
${({ $size: o = "md", theme: r }) => ({
|
|
1984
|
-
sm:
|
|
1984
|
+
sm: t`
|
|
1985
1985
|
width: ${r.spacing[4]};
|
|
1986
1986
|
height: ${r.spacing[4]};
|
|
1987
1987
|
`,
|
|
1988
|
-
md:
|
|
1988
|
+
md: t`
|
|
1989
1989
|
width: ${r.spacing[5]};
|
|
1990
1990
|
height: ${r.spacing[5]};
|
|
1991
1991
|
`
|
|
1992
1992
|
})[o]}
|
|
1993
1993
|
|
|
1994
|
-
${({ $checked: o, $color: r, theme: n }) => o &&
|
|
1994
|
+
${({ $checked: o, $color: r, theme: n }) => o && t`
|
|
1995
1995
|
&::after {
|
|
1996
1996
|
content: "";
|
|
1997
1997
|
display: block;
|
|
@@ -2012,35 +2012,35 @@ function rt({
|
|
|
2012
2012
|
ref: o,
|
|
2013
2013
|
label: r,
|
|
2014
2014
|
size: n = "md",
|
|
2015
|
-
error:
|
|
2015
|
+
error: s,
|
|
2016
2016
|
helperText: a,
|
|
2017
2017
|
disabled: l,
|
|
2018
2018
|
checked: d,
|
|
2019
2019
|
id: p,
|
|
2020
2020
|
color: u,
|
|
2021
2021
|
borderColor: f,
|
|
2022
|
-
|
|
2022
|
+
...g
|
|
2023
2023
|
}) {
|
|
2024
|
-
const
|
|
2024
|
+
const m = ro(), v = p ?? m, h = !!(a || s);
|
|
2025
2025
|
return /* @__PURE__ */ S(Gn, { children: [
|
|
2026
|
-
/* @__PURE__ */ S(Xn, { htmlFor:
|
|
2026
|
+
/* @__PURE__ */ S(Xn, { htmlFor: v, $disabled: l, children: [
|
|
2027
2027
|
/* @__PURE__ */ e(
|
|
2028
2028
|
Jn,
|
|
2029
2029
|
{
|
|
2030
|
-
id:
|
|
2030
|
+
id: v,
|
|
2031
2031
|
ref: o,
|
|
2032
2032
|
type: "radio",
|
|
2033
2033
|
checked: d,
|
|
2034
2034
|
disabled: l,
|
|
2035
|
-
"aria-invalid": !!
|
|
2036
|
-
|
|
2035
|
+
"aria-invalid": !!s,
|
|
2036
|
+
...g
|
|
2037
2037
|
}
|
|
2038
2038
|
),
|
|
2039
2039
|
/* @__PURE__ */ e(
|
|
2040
2040
|
Qn,
|
|
2041
2041
|
{
|
|
2042
2042
|
$checked: d,
|
|
2043
|
-
$error:
|
|
2043
|
+
$error: s,
|
|
2044
2044
|
$disabled: l,
|
|
2045
2045
|
$size: n,
|
|
2046
2046
|
$color: u,
|
|
@@ -2049,7 +2049,7 @@ function rt({
|
|
|
2049
2049
|
),
|
|
2050
2050
|
r && /* @__PURE__ */ e(Zn, { $size: n, children: r })
|
|
2051
2051
|
] }),
|
|
2052
|
-
|
|
2052
|
+
h && /* @__PURE__ */ e(ot, { $error: s, children: a })
|
|
2053
2053
|
] });
|
|
2054
2054
|
}
|
|
2055
2055
|
rt.displayName = "Radio";
|
|
@@ -2085,17 +2085,17 @@ const nt = i.div`
|
|
|
2085
2085
|
background-color 0.15s,
|
|
2086
2086
|
box-shadow 0.15s;
|
|
2087
2087
|
|
|
2088
|
-
${({ $checked: o, theme: r }) => o &&
|
|
2088
|
+
${({ $checked: o, theme: r }) => o && t`
|
|
2089
2089
|
box-shadow: ${r.brutalism?.shadowOffset ?? "4px"}
|
|
2090
2090
|
${r.brutalism?.shadowOffset ?? "4px"} 0 ${r.colors.neutral[900]};
|
|
2091
2091
|
`}
|
|
2092
2092
|
|
|
2093
2093
|
${({ $size: o = "md" }) => ({
|
|
2094
|
-
sm:
|
|
2094
|
+
sm: t`
|
|
2095
2095
|
width: 36px;
|
|
2096
2096
|
height: 20px;
|
|
2097
2097
|
`,
|
|
2098
|
-
md:
|
|
2098
|
+
md: t`
|
|
2099
2099
|
width: 44px;
|
|
2100
2100
|
height: 24px;
|
|
2101
2101
|
`
|
|
@@ -2111,18 +2111,18 @@ const nt = i.div`
|
|
|
2111
2111
|
transition: transform 0.15s;
|
|
2112
2112
|
|
|
2113
2113
|
${({ $size: o = "md", $checked: r }) => {
|
|
2114
|
-
const n =
|
|
2114
|
+
const n = t`
|
|
2115
2115
|
width: 12px;
|
|
2116
2116
|
height: 12px;
|
|
2117
2117
|
margin-top: -6px;
|
|
2118
2118
|
transform: translateX(${r ? "calc(100% + 4px)" : "2px"});
|
|
2119
|
-
`,
|
|
2119
|
+
`, s = t`
|
|
2120
2120
|
width: 16px;
|
|
2121
2121
|
height: 16px;
|
|
2122
2122
|
margin-top: -8px;
|
|
2123
2123
|
transform: translateX(${r ? "calc(100% + 4px)" : "2px"});
|
|
2124
2124
|
`;
|
|
2125
|
-
return o === "sm" ? n :
|
|
2125
|
+
return o === "sm" ? n : s;
|
|
2126
2126
|
}}
|
|
2127
2127
|
}
|
|
2128
2128
|
`, it = i.span`
|
|
@@ -2133,24 +2133,24 @@ function at({
|
|
|
2133
2133
|
ref: o,
|
|
2134
2134
|
label: r,
|
|
2135
2135
|
size: n = "md",
|
|
2136
|
-
disabled:
|
|
2136
|
+
disabled: s,
|
|
2137
2137
|
checked: a,
|
|
2138
2138
|
id: l,
|
|
2139
2139
|
color: d,
|
|
2140
2140
|
borderColor: p,
|
|
2141
2141
|
...u
|
|
2142
2142
|
}) {
|
|
2143
|
-
const f =
|
|
2144
|
-
return /* @__PURE__ */ e(nt, { children: /* @__PURE__ */ S(tt, { htmlFor:
|
|
2143
|
+
const f = ro(), g = l ?? f;
|
|
2144
|
+
return /* @__PURE__ */ e(nt, { children: /* @__PURE__ */ S(tt, { htmlFor: g, $disabled: s, children: [
|
|
2145
2145
|
/* @__PURE__ */ e(
|
|
2146
2146
|
st,
|
|
2147
2147
|
{
|
|
2148
|
-
id:
|
|
2148
|
+
id: g,
|
|
2149
2149
|
ref: o,
|
|
2150
2150
|
type: "checkbox",
|
|
2151
2151
|
role: "switch",
|
|
2152
2152
|
checked: a,
|
|
2153
|
-
disabled:
|
|
2153
|
+
disabled: s,
|
|
2154
2154
|
...u
|
|
2155
2155
|
}
|
|
2156
2156
|
),
|
|
@@ -2172,13 +2172,13 @@ const lt = i.div`
|
|
|
2172
2172
|
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
2173
2173
|
overflow: hidden;
|
|
2174
2174
|
|
|
2175
|
-
${({ theme: o, $accentColor: r }) => o.brutalism ?
|
|
2175
|
+
${({ theme: o, $accentColor: r }) => o.brutalism ? t`
|
|
2176
2176
|
border: ${o.brutalism.borderWidth} solid
|
|
2177
2177
|
${r ?? o.colors.neutral[900]};
|
|
2178
2178
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
2179
2179
|
${o.brutalism.shadowOffset} 0
|
|
2180
2180
|
${r ?? o.colors.neutral[900]};
|
|
2181
|
-
` :
|
|
2181
|
+
` : t`
|
|
2182
2182
|
border: 1px solid ${r ?? o.colors.neutral[200]};
|
|
2183
2183
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
2184
2184
|
`}
|
|
@@ -2252,38 +2252,38 @@ function ht({
|
|
|
2252
2252
|
title: o,
|
|
2253
2253
|
children: r,
|
|
2254
2254
|
defaultOpen: n = !1,
|
|
2255
|
-
open:
|
|
2255
|
+
open: s,
|
|
2256
2256
|
onToggle: a,
|
|
2257
2257
|
subtitle: l,
|
|
2258
2258
|
headerActions: d,
|
|
2259
2259
|
accentColor: p
|
|
2260
2260
|
}) {
|
|
2261
|
-
const [u, f] = T(n),
|
|
2261
|
+
const [u, f] = T(n), g = ro(), m = s !== void 0, v = m ? s : u;
|
|
2262
2262
|
return /* @__PURE__ */ S(lt, { $accentColor: p, children: [
|
|
2263
2263
|
/* @__PURE__ */ S(
|
|
2264
2264
|
ct,
|
|
2265
2265
|
{
|
|
2266
2266
|
type: "button",
|
|
2267
|
-
$open:
|
|
2267
|
+
$open: v,
|
|
2268
2268
|
$accentColor: p,
|
|
2269
|
-
"aria-expanded":
|
|
2270
|
-
"aria-controls":
|
|
2269
|
+
"aria-expanded": v,
|
|
2270
|
+
"aria-controls": g,
|
|
2271
2271
|
onClick: () => {
|
|
2272
|
-
const
|
|
2273
|
-
|
|
2272
|
+
const k = !v;
|
|
2273
|
+
m || f(k), a?.(k);
|
|
2274
2274
|
},
|
|
2275
2275
|
children: [
|
|
2276
2276
|
/* @__PURE__ */ S(dt, { children: [
|
|
2277
2277
|
/* @__PURE__ */ e(ut, { children: o }),
|
|
2278
2278
|
(l || d) && /* @__PURE__ */ S(ft, { children: [
|
|
2279
2279
|
l && /* @__PURE__ */ e(pt, { children: l }),
|
|
2280
|
-
d && /* @__PURE__ */ e($t, { onClick: (
|
|
2280
|
+
d && /* @__PURE__ */ e($t, { onClick: (k) => k.stopPropagation(), children: d })
|
|
2281
2281
|
] })
|
|
2282
2282
|
] }),
|
|
2283
2283
|
/* @__PURE__ */ e(
|
|
2284
2284
|
gt,
|
|
2285
2285
|
{
|
|
2286
|
-
$open:
|
|
2286
|
+
$open: v,
|
|
2287
2287
|
$accentColor: p,
|
|
2288
2288
|
"aria-hidden": "true",
|
|
2289
2289
|
children: /* @__PURE__ */ e(Ko, { size: 18, strokeWidth: 2.5 })
|
|
@@ -2292,11 +2292,11 @@ function ht({
|
|
|
2292
2292
|
]
|
|
2293
2293
|
}
|
|
2294
2294
|
),
|
|
2295
|
-
/* @__PURE__ */ e(bt, { $open:
|
|
2295
|
+
/* @__PURE__ */ e(bt, { $open: v, children: /* @__PURE__ */ e(xt, { id: g, role: "region", "aria-label": o, children: /* @__PURE__ */ e(yt, { children: r }) }) })
|
|
2296
2296
|
] });
|
|
2297
2297
|
}
|
|
2298
2298
|
ht.displayName = "CollapsibleCard";
|
|
2299
|
-
const wt =
|
|
2299
|
+
const wt = oo`
|
|
2300
2300
|
to { transform: rotate(360deg); }
|
|
2301
2301
|
`, mt = {
|
|
2302
2302
|
sm: "16px",
|
|
@@ -2311,9 +2311,9 @@ const wt = J`
|
|
|
2311
2311
|
border-radius: 50%;
|
|
2312
2312
|
animation: ${wt} 0.7s linear infinite;
|
|
2313
2313
|
|
|
2314
|
-
${({ $size: o = "md", $weight: r = "normal", $color: n, theme:
|
|
2315
|
-
const a = mt[o], l = vt[r], d =
|
|
2316
|
-
return
|
|
2314
|
+
${({ $size: o = "md", $weight: r = "normal", $color: n, theme: s }) => {
|
|
2315
|
+
const a = mt[o], l = vt[r], d = s.colors.neutral[200], p = n ?? s.colors.primary[500];
|
|
2316
|
+
return t`
|
|
2317
2317
|
width: ${a};
|
|
2318
2318
|
height: ${a};
|
|
2319
2319
|
border: ${l} solid ${d};
|
|
@@ -2325,7 +2325,7 @@ function St({
|
|
|
2325
2325
|
size: o = "md",
|
|
2326
2326
|
weight: r = "normal",
|
|
2327
2327
|
color: n,
|
|
2328
|
-
label:
|
|
2328
|
+
label: s = "Loading..."
|
|
2329
2329
|
}) {
|
|
2330
2330
|
return /* @__PURE__ */ e(
|
|
2331
2331
|
kt,
|
|
@@ -2334,19 +2334,19 @@ function St({
|
|
|
2334
2334
|
$weight: r,
|
|
2335
2335
|
$color: n,
|
|
2336
2336
|
role: "status",
|
|
2337
|
-
"aria-label":
|
|
2337
|
+
"aria-label": s
|
|
2338
2338
|
}
|
|
2339
2339
|
);
|
|
2340
2340
|
}
|
|
2341
2341
|
St.displayName = "Spinner";
|
|
2342
2342
|
const zt = 7, Fo = 3, Ao = 1;
|
|
2343
|
-
function
|
|
2343
|
+
function Is({
|
|
2344
2344
|
defaultSort: o,
|
|
2345
2345
|
defaultPage: r = 1
|
|
2346
2346
|
} = {}) {
|
|
2347
|
-
const [n,
|
|
2347
|
+
const [n, s] = T(o ?? null), [a, l] = T(r);
|
|
2348
2348
|
return { sort: n, page: a, onSortChange: (u) => {
|
|
2349
|
-
|
|
2349
|
+
s(u), l(1);
|
|
2350
2350
|
}, onPageChange: (u) => {
|
|
2351
2351
|
l(u);
|
|
2352
2352
|
} };
|
|
@@ -2358,66 +2358,71 @@ function It({
|
|
|
2358
2358
|
data: o,
|
|
2359
2359
|
sort: r,
|
|
2360
2360
|
defaultSort: n,
|
|
2361
|
-
onSortChange:
|
|
2361
|
+
onSortChange: s
|
|
2362
2362
|
}) {
|
|
2363
2363
|
const a = r !== void 0, [l, d] = T(
|
|
2364
2364
|
n ?? null
|
|
2365
|
-
), p = a ? r ?? null : l, u = (
|
|
2366
|
-
const
|
|
2367
|
-
return a || d(
|
|
2368
|
-
}, f = Do(() => a || !p ? o : [...o].sort((
|
|
2369
|
-
const
|
|
2370
|
-
return p.direction === "asc" ?
|
|
2365
|
+
), p = a ? r ?? null : l, u = (g) => {
|
|
2366
|
+
const m = Ct(p, g);
|
|
2367
|
+
return a || d(m), s?.(m), m;
|
|
2368
|
+
}, f = Do(() => a || !p ? o : [...o].sort((g, m) => {
|
|
2369
|
+
const v = g[p.key], h = m[p.key], k = v < h ? -1 : v > h ? 1 : 0;
|
|
2370
|
+
return p.direction === "asc" ? k : -k;
|
|
2371
2371
|
}), [o, p, a]);
|
|
2372
2372
|
return { activeSort: p, sortedData: f, handleSort: u };
|
|
2373
2373
|
}
|
|
2374
2374
|
function Tt(o, r) {
|
|
2375
2375
|
if (r <= zt)
|
|
2376
|
-
return Array.from({ length: r }, (
|
|
2376
|
+
return Array.from({ length: r }, (s, a) => a + 1);
|
|
2377
2377
|
const n = [1];
|
|
2378
2378
|
o > Fo && n.push("...");
|
|
2379
|
-
for (let
|
|
2380
|
-
n.push(
|
|
2379
|
+
for (let s = Math.max(2, o - Ao); s <= Math.min(r - 1, o + Ao); s++)
|
|
2380
|
+
n.push(s);
|
|
2381
2381
|
return o < r - Fo + 1 && n.push("..."), n.push(r), n;
|
|
2382
2382
|
}
|
|
2383
2383
|
function Wt({
|
|
2384
2384
|
data: o,
|
|
2385
2385
|
pageSize: r,
|
|
2386
2386
|
page: n,
|
|
2387
|
-
defaultPage:
|
|
2387
|
+
defaultPage: s,
|
|
2388
2388
|
totalRows: a,
|
|
2389
2389
|
onPageChange: l
|
|
2390
2390
|
}) {
|
|
2391
|
-
const d = n !== void 0, [p, u] = T(
|
|
2392
|
-
d || u(
|
|
2393
|
-
},
|
|
2394
|
-
if (!r ||
|
|
2391
|
+
const d = n !== void 0, [p, u] = T(s ?? 1), f = d ? n : p, g = (C) => {
|
|
2392
|
+
d || u(C), l?.(C);
|
|
2393
|
+
}, m = a !== void 0, v = a ?? o.length, h = r ? Math.max(1, Math.ceil(v / r)) : 1, k = Do(() => {
|
|
2394
|
+
if (!r || m)
|
|
2395
2395
|
return o;
|
|
2396
|
-
const
|
|
2397
|
-
return o.slice(
|
|
2398
|
-
}, [o, r, f,
|
|
2399
|
-
return { activePage: f, totalPages:
|
|
2396
|
+
const C = (f - 1) * r;
|
|
2397
|
+
return o.slice(C, C + r);
|
|
2398
|
+
}, [o, r, f, m]);
|
|
2399
|
+
return { activePage: f, totalPages: h, displayData: k, handlePageChange: g };
|
|
2400
2400
|
}
|
|
2401
2401
|
const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg" ? `${r.spacing[3]} ${r.spacing[4]}` : `${r.spacing[2]} ${r.spacing[3]}`, Dt = i.div`
|
|
2402
2402
|
width: 100%;
|
|
2403
2403
|
|
|
2404
|
-
${({ theme: o, $borderColor: r }) => o.brutalism ?
|
|
2404
|
+
${({ theme: o, $borderColor: r }) => o.brutalism ? t`
|
|
2405
2405
|
border: ${o.brutalism.borderWidth} solid
|
|
2406
2406
|
${r ?? o.colors.neutral[900]};
|
|
2407
2407
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
2408
2408
|
${o.brutalism.shadowOffset} 0
|
|
2409
2409
|
${r ?? o.colors.neutral[900]};
|
|
2410
|
-
` :
|
|
2410
|
+
` : t`
|
|
2411
2411
|
border: 1px solid ${r ?? o.colors.neutral[300]};
|
|
2412
2412
|
border-radius: ${o.radius.md};
|
|
2413
2413
|
overflow: hidden;
|
|
2414
2414
|
`}
|
|
2415
2415
|
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2416
|
+
${({ $stickyPagination: o }) => o ? t`
|
|
2417
|
+
display: flex;
|
|
2418
|
+
flex-direction: column;
|
|
2419
|
+
` : t`
|
|
2420
|
+
overflow-x: auto;
|
|
2421
|
+
`}
|
|
2422
|
+
`, Et = i.div`
|
|
2423
|
+
overflow: auto;
|
|
2424
|
+
min-height: 0;
|
|
2425
|
+
`, Ot = i.table`
|
|
2421
2426
|
width: 100%;
|
|
2422
2427
|
border-collapse: collapse;
|
|
2423
2428
|
font-size: ${({ $size: o, theme: r }) => ({
|
|
@@ -2430,33 +2435,33 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2430
2435
|
padding: ${({ theme: o }) => o.spacing[2]} 0;
|
|
2431
2436
|
}
|
|
2432
2437
|
`, Mt = i.thead`
|
|
2433
|
-
${({ $stickyHeader: o }) => o &&
|
|
2438
|
+
${({ $stickyHeader: o }) => o && t`
|
|
2434
2439
|
position: sticky;
|
|
2435
2440
|
top: 0;
|
|
2436
2441
|
z-index: 1;
|
|
2437
2442
|
`}
|
|
2438
2443
|
|
|
2439
|
-
${({ theme: o, $headerColor: r, $borderColor: n }) => r ?
|
|
2444
|
+
${({ theme: o, $headerColor: r, $borderColor: n }) => r ? t`
|
|
2440
2445
|
--th-bg: ${r};
|
|
2441
2446
|
--th-text: ${o.colors.neutral[0]};
|
|
2442
2447
|
--th-sep: rgba(255, 255, 255, 0.25);
|
|
2443
|
-
` : o.brutalism ?
|
|
2448
|
+
` : o.brutalism ? t`
|
|
2444
2449
|
--th-bg: ${o.colors.neutral[900]};
|
|
2445
2450
|
--th-text: ${o.colors.neutral[0]};
|
|
2446
2451
|
--th-sep: ${n ?? o.colors.neutral[600]};
|
|
2447
|
-
` :
|
|
2452
|
+
` : t`
|
|
2448
2453
|
--th-bg: ${o.colors.neutral[100]};
|
|
2449
2454
|
--th-text: ${o.colors.neutral[600]};
|
|
2450
2455
|
--th-sep: ${n ?? o.colors.neutral[300]};
|
|
2451
2456
|
`}
|
|
2452
|
-
`,
|
|
2453
|
-
${({ $rowColor: o }) => o &&
|
|
2457
|
+
`, Lt = i.tbody`
|
|
2458
|
+
${({ $rowColor: o }) => o && t`
|
|
2454
2459
|
tr {
|
|
2455
2460
|
background-color: ${o};
|
|
2456
2461
|
}
|
|
2457
2462
|
`}
|
|
2458
2463
|
|
|
2459
|
-
${({ $striped: o, theme: r, $stripeColor: n }) => o &&
|
|
2464
|
+
${({ $striped: o, theme: r, $stripeColor: n }) => o && t`
|
|
2460
2465
|
tr:nth-child(even) {
|
|
2461
2466
|
background-color: ${n ?? r.colors.neutral[100]};
|
|
2462
2467
|
}
|
|
@@ -2469,7 +2474,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2469
2474
|
tr:hover td {
|
|
2470
2475
|
background-color: rgba(0, 0, 0, 0.04);
|
|
2471
2476
|
}
|
|
2472
|
-
`,
|
|
2477
|
+
`, bo = i.tr``, Nt = i(bo)`
|
|
2473
2478
|
cursor: pointer;
|
|
2474
2479
|
|
|
2475
2480
|
td {
|
|
@@ -2486,7 +2491,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2486
2491
|
box-shadow: inset 4px 0 0
|
|
2487
2492
|
${({ $accentColor: o, theme: r }) => o ?? r.colors.neutral[900]};
|
|
2488
2493
|
}
|
|
2489
|
-
`,
|
|
2494
|
+
`, Pt = i.th`
|
|
2490
2495
|
background-color: var(--th-bg);
|
|
2491
2496
|
color: var(--th-text);
|
|
2492
2497
|
text-align: left;
|
|
@@ -2495,16 +2500,16 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2495
2500
|
|
|
2496
2501
|
padding: ${({ $size: o, theme: r }) => er(o, r)};
|
|
2497
2502
|
|
|
2498
|
-
${({ theme: o, $bordered: r }) => o.brutalism ?
|
|
2503
|
+
${({ theme: o, $bordered: r }) => o.brutalism ? t`` : t`
|
|
2499
2504
|
border-bottom: 2px solid var(--th-sep);
|
|
2500
|
-
${r &&
|
|
2505
|
+
${r && t`
|
|
2501
2506
|
border-right: 1px solid var(--th-sep);
|
|
2502
2507
|
&:last-child {
|
|
2503
2508
|
border-right: none;
|
|
2504
2509
|
}
|
|
2505
2510
|
`}
|
|
2506
2511
|
`}
|
|
2507
|
-
`,
|
|
2512
|
+
`, Rt = i.button`
|
|
2508
2513
|
display: inline-flex;
|
|
2509
2514
|
align-items: center;
|
|
2510
2515
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
@@ -2523,39 +2528,39 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2523
2528
|
outline-offset: 2px;
|
|
2524
2529
|
border-radius: 2px;
|
|
2525
2530
|
}
|
|
2526
|
-
`,
|
|
2531
|
+
`, Vt = i.span`
|
|
2527
2532
|
opacity: 0.5;
|
|
2528
2533
|
display: inline-flex;
|
|
2529
2534
|
align-items: center;
|
|
2530
2535
|
`, ir = i.td`
|
|
2531
2536
|
padding: ${({ $size: o, theme: r }) => er(o, r)};
|
|
2532
2537
|
|
|
2533
|
-
${({ $bordered: o, $borderColor: r, theme: n }) => n.brutalism ?
|
|
2538
|
+
${({ $bordered: o, $borderColor: r, theme: n }) => n.brutalism ? t`
|
|
2534
2539
|
border-bottom: ${n.brutalism.borderWidth} solid
|
|
2535
2540
|
${r ?? n.colors.neutral[900]};
|
|
2536
|
-
${o &&
|
|
2541
|
+
${o && t`
|
|
2537
2542
|
border-right: ${n.brutalism.borderWidth} solid
|
|
2538
2543
|
${r ?? n.colors.neutral[900]};
|
|
2539
2544
|
&:last-child {
|
|
2540
2545
|
border-right: none;
|
|
2541
2546
|
}
|
|
2542
2547
|
`}
|
|
2543
|
-
` : o ?
|
|
2548
|
+
` : o ? t`
|
|
2544
2549
|
border: 1px solid ${r ?? n.colors.neutral[300]};
|
|
2545
|
-
` :
|
|
2550
|
+
` : t`
|
|
2546
2551
|
border-bottom: 1px solid
|
|
2547
2552
|
${r ?? n.colors.neutral[200]};
|
|
2548
2553
|
`}
|
|
2549
|
-
`,
|
|
2554
|
+
`, Ft = i.td`
|
|
2550
2555
|
text-align: center;
|
|
2551
2556
|
color: ${({ theme: o }) => o.colors.neutral[400]};
|
|
2552
2557
|
padding: ${({ theme: o }) => `${o.spacing[4]} ${o.spacing[3]}`};
|
|
2553
2558
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
2554
2559
|
border-bottom: none;
|
|
2555
|
-
`,
|
|
2560
|
+
`, At = oo`
|
|
2556
2561
|
0% { background-position: -400px 0; }
|
|
2557
2562
|
100% { background-position: 400px 0; }
|
|
2558
|
-
`,
|
|
2563
|
+
`, Bt = i(ir)``, _t = i.div`
|
|
2559
2564
|
height: 14px;
|
|
2560
2565
|
border-radius: 4px;
|
|
2561
2566
|
background: linear-gradient(
|
|
@@ -2565,20 +2570,58 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2565
2570
|
${({ theme: o }) => o.colors.neutral[200]} 75%
|
|
2566
2571
|
);
|
|
2567
2572
|
background-size: 800px 100%;
|
|
2568
|
-
animation: ${
|
|
2569
|
-
`,
|
|
2573
|
+
animation: ${At} 1.6s ease-in-out infinite;
|
|
2574
|
+
`, jt = i.div`
|
|
2570
2575
|
display: flex;
|
|
2571
2576
|
align-items: center;
|
|
2572
|
-
justify-content: center;
|
|
2577
|
+
justify-content: ${({ $hasPageSizeOptions: o }) => o ? "space-between" : "center"};
|
|
2573
2578
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
2574
2579
|
padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
|
|
2580
|
+
flex-shrink: 0;
|
|
2575
2581
|
|
|
2576
|
-
${({ theme: o }) => o.brutalism ?
|
|
2582
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
2577
2583
|
border-top: ${o.brutalism.borderWidth} solid
|
|
2578
2584
|
${o.colors.neutral[900]};
|
|
2579
|
-
` :
|
|
2585
|
+
` : t`
|
|
2580
2586
|
border-top: 1px solid ${o.colors.neutral[200]};
|
|
2581
2587
|
`}
|
|
2588
|
+
`, Ht = i.label`
|
|
2589
|
+
display: flex;
|
|
2590
|
+
align-items: center;
|
|
2591
|
+
gap: ${({ theme: o }) => o.spacing[2]};
|
|
2592
|
+
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
2593
|
+
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
2594
|
+
white-space: nowrap;
|
|
2595
|
+
|
|
2596
|
+
select {
|
|
2597
|
+
padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
|
|
2598
|
+
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
2599
|
+
font-family: inherit;
|
|
2600
|
+
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
2601
|
+
background-color: ${({ theme: o }) => o.colors.neutral[0]};
|
|
2602
|
+
cursor: pointer;
|
|
2603
|
+
|
|
2604
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
2605
|
+
border: ${o.brutalism.borderWidth} solid
|
|
2606
|
+
${o.colors.neutral[900]};
|
|
2607
|
+
` : t`
|
|
2608
|
+
border: 1px solid ${o.colors.neutral[300]};
|
|
2609
|
+
border-radius: ${o.radius.md};
|
|
2610
|
+
|
|
2611
|
+
&:hover {
|
|
2612
|
+
border-color: ${o.colors.neutral[400]};
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
&:focus {
|
|
2616
|
+
outline: 2px solid ${o.colors.primary[500]};
|
|
2617
|
+
outline-offset: 1px;
|
|
2618
|
+
}
|
|
2619
|
+
`}
|
|
2620
|
+
}
|
|
2621
|
+
`, Yt = i.div`
|
|
2622
|
+
display: flex;
|
|
2623
|
+
align-items: center;
|
|
2624
|
+
gap: ${({ theme: o }) => o.spacing[1]};
|
|
2582
2625
|
`, vo = i.button`
|
|
2583
2626
|
display: inline-flex;
|
|
2584
2627
|
align-items: center;
|
|
@@ -2590,7 +2633,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2590
2633
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
2591
2634
|
cursor: pointer;
|
|
2592
2635
|
|
|
2593
|
-
${({ $active: o, theme: r }) => r.brutalism ?
|
|
2636
|
+
${({ $active: o, theme: r }) => r.brutalism ? t`
|
|
2594
2637
|
border: ${r.brutalism.borderWidth} solid
|
|
2595
2638
|
${r.colors.neutral[900]};
|
|
2596
2639
|
background: ${o ? r.colors.neutral[900] : "transparent"};
|
|
@@ -2600,7 +2643,7 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2600
2643
|
&:hover:not(:disabled) {
|
|
2601
2644
|
background: ${o ? r.colors.neutral[600] : r.colors.neutral[100]};
|
|
2602
2645
|
}
|
|
2603
|
-
` :
|
|
2646
|
+
` : t`
|
|
2604
2647
|
border: 1px solid
|
|
2605
2648
|
${o ? r.colors.primary[500] : "transparent"};
|
|
2606
2649
|
border-radius: ${r.radius.md};
|
|
@@ -2622,196 +2665,205 @@ const er = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
2622
2665
|
outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
|
|
2623
2666
|
outline-offset: 2px;
|
|
2624
2667
|
}
|
|
2625
|
-
`,
|
|
2626
|
-
function
|
|
2668
|
+
`, Ut = 4;
|
|
2669
|
+
function Kt(o, r) {
|
|
2627
2670
|
return o?.key !== r ? /* @__PURE__ */ e(Vr, { size: 14 }) : o.direction === "asc" ? /* @__PURE__ */ e(Ar, { size: 14 }) : /* @__PURE__ */ e(Pr, { size: 14 });
|
|
2628
2671
|
}
|
|
2629
|
-
function
|
|
2672
|
+
function qt({
|
|
2630
2673
|
columns: o,
|
|
2631
2674
|
data: r,
|
|
2632
2675
|
rowKey: n,
|
|
2633
|
-
size:
|
|
2676
|
+
size: s = "md",
|
|
2634
2677
|
striped: a,
|
|
2635
2678
|
bordered: l,
|
|
2636
2679
|
stickyHeader: d,
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2680
|
+
stickyPagination: p,
|
|
2681
|
+
caption: u,
|
|
2682
|
+
emptyMessage: f = "No data",
|
|
2683
|
+
loading: g,
|
|
2684
|
+
sort: m,
|
|
2685
|
+
defaultSort: v,
|
|
2686
|
+
onSortChange: h,
|
|
2687
|
+
pageSize: k,
|
|
2688
|
+
page: C,
|
|
2689
|
+
defaultPage: M,
|
|
2690
|
+
totalRows: P,
|
|
2691
|
+
onPageChange: L,
|
|
2692
|
+
pageSizeOptions: x,
|
|
2693
|
+
onPageSizeChange: I,
|
|
2694
|
+
onChange: w,
|
|
2695
|
+
onRowClick: b,
|
|
2696
|
+
borderColor: z,
|
|
2697
|
+
headerColor: D,
|
|
2698
|
+
rowColor: W,
|
|
2699
|
+
stripeColor: N,
|
|
2700
|
+
className: F,
|
|
2701
|
+
style: _
|
|
2656
2702
|
}) {
|
|
2657
2703
|
const {
|
|
2658
|
-
activeSort:
|
|
2659
|
-
sortedData:
|
|
2660
|
-
handleSort:
|
|
2704
|
+
activeSort: V,
|
|
2705
|
+
sortedData: U,
|
|
2706
|
+
handleSort: io
|
|
2661
2707
|
} = It({
|
|
2662
2708
|
data: r,
|
|
2663
|
-
sort:
|
|
2664
|
-
defaultSort:
|
|
2665
|
-
onSortChange:
|
|
2709
|
+
sort: m,
|
|
2710
|
+
defaultSort: v,
|
|
2711
|
+
onSortChange: h
|
|
2666
2712
|
}), {
|
|
2667
|
-
activePage:
|
|
2668
|
-
totalPages:
|
|
2669
|
-
displayData:
|
|
2670
|
-
handlePageChange:
|
|
2713
|
+
activePage: O,
|
|
2714
|
+
totalPages: H,
|
|
2715
|
+
displayData: ao,
|
|
2716
|
+
handlePageChange: K
|
|
2671
2717
|
} = Wt({
|
|
2672
|
-
data:
|
|
2673
|
-
pageSize:
|
|
2674
|
-
page:
|
|
2675
|
-
defaultPage:
|
|
2676
|
-
totalRows:
|
|
2677
|
-
onPageChange:
|
|
2678
|
-
}),
|
|
2679
|
-
const
|
|
2680
|
-
|
|
2681
|
-
},
|
|
2682
|
-
|
|
2683
|
-
},
|
|
2718
|
+
data: U,
|
|
2719
|
+
pageSize: k,
|
|
2720
|
+
page: C,
|
|
2721
|
+
defaultPage: M,
|
|
2722
|
+
totalRows: P,
|
|
2723
|
+
onPageChange: L
|
|
2724
|
+
}), to = (y) => {
|
|
2725
|
+
const A = io(y);
|
|
2726
|
+
w?.({ sort: A, page: O });
|
|
2727
|
+
}, J = (y) => {
|
|
2728
|
+
K(y), w?.({ sort: V, page: y });
|
|
2729
|
+
}, lo = (y, A) => String(n ? y[n] : A), j = !g && ao.length === 0, q = k ?? Ut, Q = !!k && H > 1, Z = !!x?.length, so = /* @__PURE__ */ S(Ot, { $size: s, children: [
|
|
2730
|
+
u && /* @__PURE__ */ e("caption", { children: u }),
|
|
2731
|
+
/* @__PURE__ */ e(
|
|
2732
|
+
Mt,
|
|
2733
|
+
{
|
|
2734
|
+
$headerColor: D,
|
|
2735
|
+
$borderColor: z,
|
|
2736
|
+
$stickyHeader: d,
|
|
2737
|
+
children: /* @__PURE__ */ e(bo, { children: o.map((y) => /* @__PURE__ */ e(
|
|
2738
|
+
Pt,
|
|
2739
|
+
{
|
|
2740
|
+
$size: s,
|
|
2741
|
+
$bordered: l,
|
|
2742
|
+
scope: "col",
|
|
2743
|
+
style: y.width ? { width: y.width } : void 0,
|
|
2744
|
+
children: y.sortable ? /* @__PURE__ */ S(
|
|
2745
|
+
Rt,
|
|
2746
|
+
{
|
|
2747
|
+
type: "button",
|
|
2748
|
+
onClick: () => to(y.key),
|
|
2749
|
+
"aria-label": `Sort by ${y.header}${V?.key === y.key ? `, ${V.direction}ending` : ""}`,
|
|
2750
|
+
children: [
|
|
2751
|
+
y.header,
|
|
2752
|
+
/* @__PURE__ */ e(Vt, { "aria-hidden": "true", children: Kt(V, y.key) })
|
|
2753
|
+
]
|
|
2754
|
+
}
|
|
2755
|
+
) : y.header
|
|
2756
|
+
},
|
|
2757
|
+
y.key
|
|
2758
|
+
)) })
|
|
2759
|
+
}
|
|
2760
|
+
),
|
|
2761
|
+
/* @__PURE__ */ e(Lt, { $striped: a, $rowColor: W, $stripeColor: N, children: g ? Array.from({ length: q }).map((y, A) => /* @__PURE__ */ e(bo, { children: o.map((co) => /* @__PURE__ */ e(
|
|
2762
|
+
Bt,
|
|
2763
|
+
{
|
|
2764
|
+
$size: s,
|
|
2765
|
+
$bordered: l,
|
|
2766
|
+
$borderColor: z,
|
|
2767
|
+
children: /* @__PURE__ */ e(_t, {})
|
|
2768
|
+
},
|
|
2769
|
+
co.key
|
|
2770
|
+
)) }, A)) : j ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(Ft, { colSpan: o.length, children: f }) }) : ao.map((y, A) => /* @__PURE__ */ e(
|
|
2771
|
+
b ? Nt : bo,
|
|
2772
|
+
{
|
|
2773
|
+
onClick: b ? () => b(y) : void 0,
|
|
2774
|
+
$accentColor: b ? z : void 0,
|
|
2775
|
+
children: o.map(($) => /* @__PURE__ */ e(
|
|
2776
|
+
ir,
|
|
2777
|
+
{
|
|
2778
|
+
$size: s,
|
|
2779
|
+
$bordered: l,
|
|
2780
|
+
$borderColor: z,
|
|
2781
|
+
children: $.render ? $.render(y[$.key], y, A) : String(y[$.key] ?? "") || " "
|
|
2782
|
+
},
|
|
2783
|
+
$.key
|
|
2784
|
+
))
|
|
2785
|
+
},
|
|
2786
|
+
lo(y, A)
|
|
2787
|
+
)) })
|
|
2788
|
+
] }), eo = (Q || Z) && /* @__PURE__ */ S(jt, { $hasPageSizeOptions: Z, children: [
|
|
2789
|
+
Z && /* @__PURE__ */ S(Ht, { children: [
|
|
2790
|
+
"Rows per page:",
|
|
2791
|
+
/* @__PURE__ */ e(
|
|
2792
|
+
"select",
|
|
2793
|
+
{
|
|
2794
|
+
value: k,
|
|
2795
|
+
onChange: (y) => I?.(Number(y.target.value)),
|
|
2796
|
+
"aria-label": "Rows per page",
|
|
2797
|
+
children: x.map((y) => /* @__PURE__ */ e("option", { value: y, children: y }, y))
|
|
2798
|
+
}
|
|
2799
|
+
)
|
|
2800
|
+
] }),
|
|
2801
|
+
Q && /* @__PURE__ */ S(Yt, { children: [
|
|
2802
|
+
/* @__PURE__ */ e(
|
|
2803
|
+
vo,
|
|
2804
|
+
{
|
|
2805
|
+
type: "button",
|
|
2806
|
+
onClick: () => J(O - 1),
|
|
2807
|
+
disabled: O <= 1,
|
|
2808
|
+
"aria-label": "Previous page",
|
|
2809
|
+
children: "←"
|
|
2810
|
+
}
|
|
2811
|
+
),
|
|
2812
|
+
Tt(O, H).map(
|
|
2813
|
+
(y, A) => y === "..." ? /* @__PURE__ */ e(
|
|
2814
|
+
"span",
|
|
2815
|
+
{
|
|
2816
|
+
"aria-hidden": "true",
|
|
2817
|
+
style: { padding: "0 4px" },
|
|
2818
|
+
children: "…"
|
|
2819
|
+
},
|
|
2820
|
+
`e${A}`
|
|
2821
|
+
) : /* @__PURE__ */ e(
|
|
2822
|
+
vo,
|
|
2823
|
+
{
|
|
2824
|
+
type: "button",
|
|
2825
|
+
$active: y === O,
|
|
2826
|
+
onClick: () => J(y),
|
|
2827
|
+
"aria-label": `Page ${y}`,
|
|
2828
|
+
"aria-current": y === O ? "page" : void 0,
|
|
2829
|
+
children: y
|
|
2830
|
+
},
|
|
2831
|
+
y
|
|
2832
|
+
)
|
|
2833
|
+
),
|
|
2834
|
+
/* @__PURE__ */ e(
|
|
2835
|
+
vo,
|
|
2836
|
+
{
|
|
2837
|
+
type: "button",
|
|
2838
|
+
onClick: () => J(O + 1),
|
|
2839
|
+
disabled: O >= H,
|
|
2840
|
+
"aria-label": "Next page",
|
|
2841
|
+
children: "→"
|
|
2842
|
+
}
|
|
2843
|
+
)
|
|
2844
|
+
] })
|
|
2845
|
+
] });
|
|
2684
2846
|
return /* @__PURE__ */ S(
|
|
2685
2847
|
Dt,
|
|
2686
2848
|
{
|
|
2687
|
-
$borderColor:
|
|
2688
|
-
$
|
|
2689
|
-
className:
|
|
2690
|
-
style:
|
|
2849
|
+
$borderColor: z,
|
|
2850
|
+
$stickyPagination: p,
|
|
2851
|
+
className: F,
|
|
2852
|
+
style: _,
|
|
2691
2853
|
children: [
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
|
|
2694
|
-
/* @__PURE__ */ e(
|
|
2695
|
-
Mt,
|
|
2696
|
-
{
|
|
2697
|
-
$headerColor: m,
|
|
2698
|
-
$borderColor: C,
|
|
2699
|
-
$stickyHeader: d,
|
|
2700
|
-
children: /* @__PURE__ */ e($o, { children: o.map((k) => /* @__PURE__ */ e(
|
|
2701
|
-
Nt,
|
|
2702
|
-
{
|
|
2703
|
-
$size: t,
|
|
2704
|
-
$bordered: l,
|
|
2705
|
-
scope: "col",
|
|
2706
|
-
style: k.width ? { width: k.width } : void 0,
|
|
2707
|
-
children: k.sortable ? /* @__PURE__ */ S(
|
|
2708
|
-
Pt,
|
|
2709
|
-
{
|
|
2710
|
-
type: "button",
|
|
2711
|
-
onClick: () => K(k.key),
|
|
2712
|
-
"aria-label": `Sort by ${k.header}${M?.key === k.key ? `, ${M.direction}ending` : ""}`,
|
|
2713
|
-
children: [
|
|
2714
|
-
k.header,
|
|
2715
|
-
/* @__PURE__ */ e(Rt, { "aria-hidden": "true", children: Ht(M, k.key) })
|
|
2716
|
-
]
|
|
2717
|
-
}
|
|
2718
|
-
) : k.header
|
|
2719
|
-
},
|
|
2720
|
-
k.key
|
|
2721
|
-
)) })
|
|
2722
|
-
}
|
|
2723
|
-
),
|
|
2724
|
-
/* @__PURE__ */ e(
|
|
2725
|
-
Ot,
|
|
2726
|
-
{
|
|
2727
|
-
$striped: a,
|
|
2728
|
-
$rowColor: x,
|
|
2729
|
-
$stripeColor: I,
|
|
2730
|
-
children: f ? Array.from({ length: to }).map((k, N) => /* @__PURE__ */ e($o, { children: o.map((Y) => /* @__PURE__ */ e(
|
|
2731
|
-
At,
|
|
2732
|
-
{
|
|
2733
|
-
$size: t,
|
|
2734
|
-
$bordered: l,
|
|
2735
|
-
$borderColor: C,
|
|
2736
|
-
children: /* @__PURE__ */ e(Bt, {})
|
|
2737
|
-
},
|
|
2738
|
-
Y.key
|
|
2739
|
-
)) }, N)) : no ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(Vt, { colSpan: o.length, children: u }) }) : oo.map((k, N) => /* @__PURE__ */ e(
|
|
2740
|
-
g ? Lt : $o,
|
|
2741
|
-
{
|
|
2742
|
-
onClick: g ? () => g(k) : void 0,
|
|
2743
|
-
$accentColor: g ? C : void 0,
|
|
2744
|
-
children: o.map((H) => /* @__PURE__ */ e(
|
|
2745
|
-
ir,
|
|
2746
|
-
{
|
|
2747
|
-
$size: t,
|
|
2748
|
-
$bordered: l,
|
|
2749
|
-
$borderColor: C,
|
|
2750
|
-
children: H.render ? H.render(k[H.key], k, N) : String(k[H.key] ?? "") || " "
|
|
2751
|
-
},
|
|
2752
|
-
H.key
|
|
2753
|
-
))
|
|
2754
|
-
},
|
|
2755
|
-
q(k, N)
|
|
2756
|
-
))
|
|
2757
|
-
}
|
|
2758
|
-
)
|
|
2759
|
-
] }),
|
|
2760
|
-
y && j > 1 && /* @__PURE__ */ S(_t, { children: [
|
|
2761
|
-
/* @__PURE__ */ e(
|
|
2762
|
-
vo,
|
|
2763
|
-
{
|
|
2764
|
-
type: "button",
|
|
2765
|
-
onClick: () => ro(P - 1),
|
|
2766
|
-
disabled: P <= 1,
|
|
2767
|
-
"aria-label": "Previous page",
|
|
2768
|
-
children: "←"
|
|
2769
|
-
}
|
|
2770
|
-
),
|
|
2771
|
-
Tt(P, j).map(
|
|
2772
|
-
(k, N) => k === "..." ? /* @__PURE__ */ e(
|
|
2773
|
-
"span",
|
|
2774
|
-
{
|
|
2775
|
-
"aria-hidden": "true",
|
|
2776
|
-
style: { padding: "0 4px" },
|
|
2777
|
-
children: "…"
|
|
2778
|
-
},
|
|
2779
|
-
`e${N}`
|
|
2780
|
-
) : /* @__PURE__ */ e(
|
|
2781
|
-
vo,
|
|
2782
|
-
{
|
|
2783
|
-
type: "button",
|
|
2784
|
-
$active: k === P,
|
|
2785
|
-
onClick: () => ro(k),
|
|
2786
|
-
"aria-label": `Page ${k}`,
|
|
2787
|
-
"aria-current": k === P ? "page" : void 0,
|
|
2788
|
-
children: k
|
|
2789
|
-
},
|
|
2790
|
-
k
|
|
2791
|
-
)
|
|
2792
|
-
),
|
|
2793
|
-
/* @__PURE__ */ e(
|
|
2794
|
-
vo,
|
|
2795
|
-
{
|
|
2796
|
-
type: "button",
|
|
2797
|
-
onClick: () => ro(P + 1),
|
|
2798
|
-
disabled: P >= j,
|
|
2799
|
-
"aria-label": "Next page",
|
|
2800
|
-
children: "→"
|
|
2801
|
-
}
|
|
2802
|
-
)
|
|
2803
|
-
] })
|
|
2854
|
+
p ? /* @__PURE__ */ e(Et, { children: so }) : so,
|
|
2855
|
+
eo
|
|
2804
2856
|
]
|
|
2805
2857
|
}
|
|
2806
2858
|
);
|
|
2807
2859
|
}
|
|
2808
|
-
|
|
2809
|
-
const
|
|
2860
|
+
qt.displayName = "Table";
|
|
2861
|
+
const Gt = i.p`
|
|
2810
2862
|
margin: 0;
|
|
2811
2863
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
2812
2864
|
color: ${({ theme: o }) => o.colors.neutral[600]};
|
|
2813
2865
|
line-height: 1.5;
|
|
2814
|
-
`,
|
|
2866
|
+
`, Xt = i.button`
|
|
2815
2867
|
display: inline-flex;
|
|
2816
2868
|
align-items: center;
|
|
2817
2869
|
justify-content: center;
|
|
@@ -2838,7 +2890,7 @@ const Ut = i.p`
|
|
|
2838
2890
|
cursor: not-allowed;
|
|
2839
2891
|
}
|
|
2840
2892
|
|
|
2841
|
-
${({ theme: o }) => o.brutalism &&
|
|
2893
|
+
${({ theme: o }) => o.brutalism && t`
|
|
2842
2894
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
2843
2895
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
2844
2896
|
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
@@ -2856,7 +2908,7 @@ function ar({
|
|
|
2856
2908
|
open: o,
|
|
2857
2909
|
title: r = "Are you sure?",
|
|
2858
2910
|
message: n,
|
|
2859
|
-
confirmLabel:
|
|
2911
|
+
confirmLabel: s = "Confirm",
|
|
2860
2912
|
cancelLabel: a = "Cancel",
|
|
2861
2913
|
variant: l = "default",
|
|
2862
2914
|
size: d = "sm",
|
|
@@ -2873,23 +2925,23 @@ function ar({
|
|
|
2873
2925
|
closeOnBackdrop: !1,
|
|
2874
2926
|
footer: /* @__PURE__ */ S(dr, { children: [
|
|
2875
2927
|
/* @__PURE__ */ e(Co, { variant: "outline", onClick: u, children: a }),
|
|
2876
|
-
l === "danger" ? /* @__PURE__ */ e(
|
|
2928
|
+
l === "danger" ? /* @__PURE__ */ e(Xt, { type: "button", onClick: p, children: s }) : /* @__PURE__ */ e(Co, { variant: "primary", onClick: p, children: s })
|
|
2877
2929
|
] }),
|
|
2878
|
-
children: /* @__PURE__ */ e(
|
|
2930
|
+
children: /* @__PURE__ */ e(Gt, { children: n })
|
|
2879
2931
|
}
|
|
2880
2932
|
);
|
|
2881
2933
|
}
|
|
2882
2934
|
ar.displayName = "ConfirmDialog";
|
|
2883
2935
|
const lr = Wo(null);
|
|
2884
|
-
function
|
|
2885
|
-
const [r, n] = T(null),
|
|
2936
|
+
function Ts({ children: o }) {
|
|
2937
|
+
const [r, n] = T(null), s = X((d) => new Promise((p) => {
|
|
2886
2938
|
n({ ...d, resolve: p });
|
|
2887
2939
|
}), []), a = () => {
|
|
2888
2940
|
r?.resolve(!0), n(null);
|
|
2889
2941
|
}, l = () => {
|
|
2890
2942
|
r?.resolve(!1), n(null);
|
|
2891
2943
|
};
|
|
2892
|
-
return /* @__PURE__ */ S(lr.Provider, { value: { confirm:
|
|
2944
|
+
return /* @__PURE__ */ S(lr.Provider, { value: { confirm: s }, children: [
|
|
2893
2945
|
o,
|
|
2894
2946
|
r && /* @__PURE__ */ e(
|
|
2895
2947
|
ar,
|
|
@@ -2907,18 +2959,18 @@ function zs({ children: o }) {
|
|
|
2907
2959
|
)
|
|
2908
2960
|
] });
|
|
2909
2961
|
}
|
|
2910
|
-
function
|
|
2962
|
+
function Ws() {
|
|
2911
2963
|
const o = To(lr);
|
|
2912
2964
|
if (!o)
|
|
2913
2965
|
throw new Error("useConfirm must be used within a ConfirmProvider");
|
|
2914
2966
|
return o.confirm;
|
|
2915
2967
|
}
|
|
2916
|
-
const
|
|
2968
|
+
const Jt = i.div`
|
|
2917
2969
|
position: relative;
|
|
2918
2970
|
display: inline-flex;
|
|
2919
2971
|
flex-direction: column;
|
|
2920
2972
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
2921
|
-
`,
|
|
2973
|
+
`, Qt = i.div`
|
|
2922
2974
|
display: flex;
|
|
2923
2975
|
align-items: center;
|
|
2924
2976
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -2930,35 +2982,35 @@ const qt = i.div`
|
|
|
2930
2982
|
box-shadow 0.2s;
|
|
2931
2983
|
|
|
2932
2984
|
${({ $size: o, theme: r }) => ({
|
|
2933
|
-
sm:
|
|
2985
|
+
sm: t`
|
|
2934
2986
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
2935
2987
|
font-size: ${r.fontSizes.sm};
|
|
2936
2988
|
`,
|
|
2937
|
-
md:
|
|
2989
|
+
md: t`
|
|
2938
2990
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
2939
2991
|
font-size: ${r.fontSizes.md};
|
|
2940
2992
|
`,
|
|
2941
|
-
lg:
|
|
2993
|
+
lg: t`
|
|
2942
2994
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
2943
2995
|
font-size: ${r.fontSizes.lg};
|
|
2944
2996
|
`
|
|
2945
2997
|
})[o]}
|
|
2946
2998
|
|
|
2947
|
-
${({ theme: o }) => o.brutalism ?
|
|
2999
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
2948
3000
|
border: ${o.brutalism.borderWidth} solid
|
|
2949
3001
|
${o.colors.neutral[900]};
|
|
2950
3002
|
background-color: ${o.colors.neutral[0]};
|
|
2951
3003
|
box-shadow: 3px 3px 0 ${o.colors.neutral[900]};
|
|
2952
|
-
` :
|
|
3004
|
+
` : t`
|
|
2953
3005
|
border: 1px solid ${o.colors.neutral[400]};
|
|
2954
3006
|
background-color: ${o.colors.neutral[0]};
|
|
2955
3007
|
`}
|
|
2956
3008
|
|
|
2957
|
-
${({ $error: o, theme: r }) => o &&
|
|
3009
|
+
${({ $error: o, theme: r }) => o && t`
|
|
2958
3010
|
border-color: ${r.colors.error[500]};
|
|
2959
3011
|
`}
|
|
2960
3012
|
|
|
2961
|
-
${({ $disabled: o }) => o &&
|
|
3013
|
+
${({ $disabled: o }) => o && t`
|
|
2962
3014
|
cursor: not-allowed;
|
|
2963
3015
|
opacity: 0.6;
|
|
2964
3016
|
`}
|
|
@@ -2967,19 +3019,19 @@ const qt = i.div`
|
|
|
2967
3019
|
outline: none;
|
|
2968
3020
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
2969
3021
|
}
|
|
2970
|
-
`,
|
|
3022
|
+
`, Zt = i.span`
|
|
2971
3023
|
flex: 1;
|
|
2972
3024
|
color: ${({ $hasValue: o, theme: r }) => o ? r.colors.neutral[900] : r.colors.neutral[400]};
|
|
2973
3025
|
white-space: nowrap;
|
|
2974
3026
|
overflow: hidden;
|
|
2975
3027
|
text-overflow: ellipsis;
|
|
2976
|
-
`,
|
|
3028
|
+
`, os = i.span`
|
|
2977
3029
|
display: inline-flex;
|
|
2978
3030
|
align-items: center;
|
|
2979
3031
|
margin-left: ${({ theme: o }) => o.spacing[2]};
|
|
2980
3032
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
2981
3033
|
flex-shrink: 0;
|
|
2982
|
-
`,
|
|
3034
|
+
`, rs = i.button`
|
|
2983
3035
|
display: inline-flex;
|
|
2984
3036
|
align-items: center;
|
|
2985
3037
|
margin-left: ${({ theme: o }) => o.spacing[2]};
|
|
@@ -3004,7 +3056,7 @@ i.span`
|
|
|
3004
3056
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
3005
3057
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
3006
3058
|
`;
|
|
3007
|
-
const
|
|
3059
|
+
const ns = i.div`
|
|
3008
3060
|
position: absolute;
|
|
3009
3061
|
top: calc(100% + 4px);
|
|
3010
3062
|
left: 0;
|
|
@@ -3014,16 +3066,16 @@ const Zt = i.div`
|
|
|
3014
3066
|
padding: ${({ theme: o }) => o.spacing[3]};
|
|
3015
3067
|
min-width: 280px;
|
|
3016
3068
|
|
|
3017
|
-
${({ theme: o }) => o.brutalism ?
|
|
3069
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
3018
3070
|
border: ${o.brutalism.borderWidth} solid
|
|
3019
3071
|
${o.colors.neutral[900]};
|
|
3020
3072
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
3021
3073
|
${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
|
|
3022
|
-
` :
|
|
3074
|
+
` : t`
|
|
3023
3075
|
border: 1px solid ${o.colors.neutral[200]};
|
|
3024
3076
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
3025
3077
|
`}
|
|
3026
|
-
`,
|
|
3078
|
+
`, ts = i.div`
|
|
3027
3079
|
display: flex;
|
|
3028
3080
|
align-items: center;
|
|
3029
3081
|
justify-content: space-between;
|
|
@@ -3051,22 +3103,22 @@ const Zt = i.div`
|
|
|
3051
3103
|
outline-offset: 2px;
|
|
3052
3104
|
}
|
|
3053
3105
|
|
|
3054
|
-
${({ theme: o }) => o.brutalism &&
|
|
3106
|
+
${({ theme: o }) => o.brutalism && t`
|
|
3055
3107
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
3056
3108
|
&:hover {
|
|
3057
3109
|
background-color: ${o.colors.neutral[100]};
|
|
3058
3110
|
transform: translate(1px, 1px);
|
|
3059
3111
|
}
|
|
3060
3112
|
`}
|
|
3061
|
-
`,
|
|
3113
|
+
`, ss = i.span`
|
|
3062
3114
|
font-weight: ${({ theme: o }) => o.fontWeights.semibold};
|
|
3063
3115
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
3064
3116
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
3065
|
-
`,
|
|
3117
|
+
`, es = i.div`
|
|
3066
3118
|
display: grid;
|
|
3067
3119
|
grid-template-columns: repeat(7, 1fr);
|
|
3068
3120
|
gap: ${({ theme: o }) => o.spacing[0.5]};
|
|
3069
|
-
`,
|
|
3121
|
+
`, is = i.span`
|
|
3070
3122
|
display: flex;
|
|
3071
3123
|
align-items: center;
|
|
3072
3124
|
justify-content: center;
|
|
@@ -3090,32 +3142,32 @@ const Zt = i.div`
|
|
|
3090
3142
|
$today: o,
|
|
3091
3143
|
$selected: r,
|
|
3092
3144
|
$rangeStart: n,
|
|
3093
|
-
$rangeEnd:
|
|
3145
|
+
$rangeEnd: s,
|
|
3094
3146
|
$inRange: a,
|
|
3095
3147
|
theme: l
|
|
3096
|
-
}) => o || r || n ||
|
|
3148
|
+
}) => o || r || n || s ? l.fontWeights.semibold : l.fontWeights.normal};
|
|
3097
3149
|
pointer-events: ${({ $currentMonth: o }) => o ? "auto" : "none"};
|
|
3098
3150
|
|
|
3099
3151
|
color: ${({
|
|
3100
3152
|
$currentMonth: o,
|
|
3101
3153
|
$selected: r,
|
|
3102
3154
|
$today: n,
|
|
3103
|
-
$rangeStart:
|
|
3155
|
+
$rangeStart: s,
|
|
3104
3156
|
$rangeEnd: a,
|
|
3105
3157
|
theme: l
|
|
3106
|
-
}) => o ? r ||
|
|
3158
|
+
}) => o ? r || s || a ? l.colors.primary.contrast : n ? l.colors.primary[500] : l.colors.neutral[900] : l.colors.neutral[300]};
|
|
3107
3159
|
|
|
3108
3160
|
background-color: ${({
|
|
3109
3161
|
$selected: o,
|
|
3110
3162
|
$rangeStart: r,
|
|
3111
3163
|
$rangeEnd: n,
|
|
3112
|
-
$inRange:
|
|
3164
|
+
$inRange: s,
|
|
3113
3165
|
$currentMonth: a,
|
|
3114
3166
|
theme: l
|
|
3115
|
-
}) => a ? o || r || n ? l.colors.primary[500] :
|
|
3167
|
+
}) => a ? o || r || n ? l.colors.primary[500] : s ? l.colors.primary[50] : "transparent" : "transparent"};
|
|
3116
3168
|
|
|
3117
3169
|
&:hover:not(:disabled) {
|
|
3118
|
-
background-color: ${({ $selected: o, $rangeStart: r, $rangeEnd: n, theme:
|
|
3170
|
+
background-color: ${({ $selected: o, $rangeStart: r, $rangeEnd: n, theme: s }) => o || r || n ? s.colors.primary[700] : s.colors.neutral[100]};
|
|
3119
3171
|
}
|
|
3120
3172
|
|
|
3121
3173
|
&:disabled {
|
|
@@ -3128,13 +3180,13 @@ const Zt = i.div`
|
|
|
3128
3180
|
outline-offset: 1px;
|
|
3129
3181
|
}
|
|
3130
3182
|
|
|
3131
|
-
${({ $selected: o, $rangeStart: r, $rangeEnd: n, $today:
|
|
3183
|
+
${({ $selected: o, $rangeStart: r, $rangeEnd: n, $today: s, theme: a }) => a.brutalism && (o || r || n || s) && t`
|
|
3132
3184
|
border: ${a.brutalism.borderWidth} solid ${a.colors.neutral[900]};
|
|
3133
|
-
${(o || r || n) &&
|
|
3185
|
+
${(o || r || n) && t`
|
|
3134
3186
|
box-shadow: 2px 2px 0 ${a.colors.neutral[900]};
|
|
3135
3187
|
`}
|
|
3136
3188
|
`}
|
|
3137
|
-
`,
|
|
3189
|
+
`, as = [
|
|
3138
3190
|
"January",
|
|
3139
3191
|
"February",
|
|
3140
3192
|
"March",
|
|
@@ -3147,33 +3199,33 @@ const Zt = i.div`
|
|
|
3147
3199
|
"October",
|
|
3148
3200
|
"November",
|
|
3149
3201
|
"December"
|
|
3150
|
-
],
|
|
3202
|
+
], ls = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
3151
3203
|
function _o(o, r) {
|
|
3152
3204
|
return new Date(o, r + 1, 0).getDate();
|
|
3153
3205
|
}
|
|
3154
|
-
function
|
|
3206
|
+
function cs(o, r) {
|
|
3155
3207
|
return new Date(o, r, 1).getDay();
|
|
3156
3208
|
}
|
|
3157
|
-
function
|
|
3209
|
+
function fo(o, r) {
|
|
3158
3210
|
return o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate();
|
|
3159
3211
|
}
|
|
3160
|
-
function
|
|
3212
|
+
function ds(o, r, n) {
|
|
3161
3213
|
if (r) {
|
|
3162
|
-
const
|
|
3214
|
+
const s = new Date(
|
|
3163
3215
|
r.getFullYear(),
|
|
3164
3216
|
r.getMonth(),
|
|
3165
3217
|
r.getDate()
|
|
3166
3218
|
);
|
|
3167
|
-
if (o <
|
|
3219
|
+
if (o < s)
|
|
3168
3220
|
return !0;
|
|
3169
3221
|
}
|
|
3170
3222
|
if (n) {
|
|
3171
|
-
const
|
|
3223
|
+
const s = new Date(
|
|
3172
3224
|
n.getFullYear(),
|
|
3173
3225
|
n.getMonth(),
|
|
3174
3226
|
n.getDate()
|
|
3175
3227
|
);
|
|
3176
|
-
if (o >
|
|
3228
|
+
if (o > s)
|
|
3177
3229
|
return !0;
|
|
3178
3230
|
}
|
|
3179
3231
|
return !1;
|
|
@@ -3199,174 +3251,174 @@ function So(o) {
|
|
|
3199
3251
|
const r = o.split("-");
|
|
3200
3252
|
if (r.length !== 3)
|
|
3201
3253
|
return null;
|
|
3202
|
-
const n = parseInt(r[0], 10),
|
|
3203
|
-
return isNaN(n) || isNaN(
|
|
3254
|
+
const n = parseInt(r[0], 10), s = parseInt(r[1], 10), a = parseInt(r[2], 10);
|
|
3255
|
+
return isNaN(n) || isNaN(s) || isNaN(a) ? null : new Date(n, s - 1, a);
|
|
3204
3256
|
}
|
|
3205
|
-
function
|
|
3206
|
-
const r = o.getFullYear(), n = String(o.getMonth() + 1).padStart(2, "0"),
|
|
3207
|
-
return `${r}-${n}-${
|
|
3257
|
+
function po(o) {
|
|
3258
|
+
const r = o.getFullYear(), n = String(o.getMonth() + 1).padStart(2, "0"), s = String(o.getDate()).padStart(2, "0");
|
|
3259
|
+
return `${r}-${n}-${s}`;
|
|
3208
3260
|
}
|
|
3209
|
-
function
|
|
3261
|
+
function us({
|
|
3210
3262
|
name: o,
|
|
3211
3263
|
label: r,
|
|
3212
3264
|
value: n,
|
|
3213
|
-
onChange:
|
|
3265
|
+
onChange: s,
|
|
3214
3266
|
placeholder: a = "Select date...",
|
|
3215
3267
|
size: l = "md",
|
|
3216
3268
|
disabled: d = !1,
|
|
3217
3269
|
clearable: p = !1,
|
|
3218
3270
|
minDate: u,
|
|
3219
3271
|
maxDate: f,
|
|
3220
|
-
formatDate:
|
|
3221
|
-
error:
|
|
3222
|
-
required:
|
|
3223
|
-
helperText:
|
|
3224
|
-
mode:
|
|
3225
|
-
nameFrom:
|
|
3226
|
-
nameTo:
|
|
3227
|
-
valueFrom:
|
|
3272
|
+
formatDate: g,
|
|
3273
|
+
error: m,
|
|
3274
|
+
required: v,
|
|
3275
|
+
helperText: h,
|
|
3276
|
+
mode: k = "single",
|
|
3277
|
+
nameFrom: C,
|
|
3278
|
+
nameTo: M,
|
|
3279
|
+
valueFrom: P,
|
|
3228
3280
|
valueTo: L
|
|
3229
3281
|
}) {
|
|
3230
|
-
const
|
|
3282
|
+
const x = k === "range", I = So(n ?? ""), w = So(P ?? ""), b = So(L ?? ""), z = /* @__PURE__ */ new Date(), D = () => x ? w ?? b ?? z : I ?? z, [W, N] = T(!1), [F, _] = T(
|
|
3231
3283
|
() => D().getFullYear()
|
|
3232
|
-
), [
|
|
3284
|
+
), [V, U] = T(
|
|
3233
3285
|
() => D().getMonth()
|
|
3234
|
-
), [
|
|
3286
|
+
), [io, O] = T("from"), H = Y(null);
|
|
3235
3287
|
B(() => {
|
|
3236
3288
|
if (!W)
|
|
3237
3289
|
return;
|
|
3238
|
-
const
|
|
3239
|
-
|
|
3290
|
+
const $ = (R) => {
|
|
3291
|
+
H.current && !H.current.contains(R.target) && (N(!1), x && O("from"));
|
|
3240
3292
|
};
|
|
3241
|
-
return document.addEventListener("mousedown",
|
|
3242
|
-
}, [W,
|
|
3243
|
-
!
|
|
3244
|
-
}, [n,
|
|
3245
|
-
|
|
3246
|
-
}, [
|
|
3247
|
-
const
|
|
3248
|
-
if (!
|
|
3249
|
-
return
|
|
3250
|
-
if (!
|
|
3293
|
+
return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
|
|
3294
|
+
}, [W, x]), B(() => {
|
|
3295
|
+
!x && I && (_(I.getFullYear()), U(I.getMonth()));
|
|
3296
|
+
}, [n, x]), B(() => {
|
|
3297
|
+
x && w && (_(w.getFullYear()), U(w.getMonth()));
|
|
3298
|
+
}, [P, x]);
|
|
3299
|
+
const K = (() => {
|
|
3300
|
+
if (!x)
|
|
3301
|
+
return I ? g ? g(I) : jo(I) : "";
|
|
3302
|
+
if (!w && !b)
|
|
3251
3303
|
return "";
|
|
3252
|
-
const
|
|
3253
|
-
return
|
|
3254
|
-
})(),
|
|
3255
|
-
const
|
|
3256
|
-
if (!
|
|
3257
|
-
|
|
3304
|
+
const $ = g ?? jo;
|
|
3305
|
+
return w && b ? `${$(w)} - ${$(b)}` : w ? `${$(w)} - ...` : "";
|
|
3306
|
+
})(), to = x ? !!(w || b) : !!I, J = ($) => {
|
|
3307
|
+
const R = new Date(F, V, $);
|
|
3308
|
+
if (!x) {
|
|
3309
|
+
s(o ?? "", po(R)), N(!1);
|
|
3258
3310
|
return;
|
|
3259
3311
|
}
|
|
3260
|
-
if (
|
|
3261
|
-
|
|
3312
|
+
if (io === "from") {
|
|
3313
|
+
s(C ?? "", po(R)), O("to");
|
|
3262
3314
|
return;
|
|
3263
3315
|
}
|
|
3264
|
-
if (!
|
|
3265
|
-
|
|
3316
|
+
if (!w) {
|
|
3317
|
+
s(C ?? "", po(R)), O("to");
|
|
3266
3318
|
return;
|
|
3267
3319
|
}
|
|
3268
|
-
if (
|
|
3269
|
-
|
|
3320
|
+
if (fo(R, w)) {
|
|
3321
|
+
s(C ?? "", ""), s(M ?? "", ""), O("from");
|
|
3270
3322
|
return;
|
|
3271
3323
|
}
|
|
3272
|
-
if (
|
|
3273
|
-
|
|
3324
|
+
if (R >= w) {
|
|
3325
|
+
s(M ?? "", po(R)), O("from"), N(!1);
|
|
3274
3326
|
return;
|
|
3275
3327
|
}
|
|
3276
|
-
|
|
3277
|
-
},
|
|
3278
|
-
|
|
3279
|
-
},
|
|
3328
|
+
s(M ?? "", po(w)), s(C ?? "", po(R)), O("from"), N(!1);
|
|
3329
|
+
}, lo = ($) => {
|
|
3330
|
+
$.stopPropagation(), x ? (s(C ?? "", ""), s(M ?? "", ""), O("from")) : s(o ?? "", "");
|
|
3331
|
+
}, j = () => {
|
|
3280
3332
|
if (d)
|
|
3281
3333
|
return;
|
|
3282
|
-
const
|
|
3283
|
-
|
|
3284
|
-
},
|
|
3285
|
-
if ((
|
|
3286
|
-
|
|
3287
|
-
const
|
|
3288
|
-
|
|
3334
|
+
const $ = !W;
|
|
3335
|
+
N($), !$ && x && O("from");
|
|
3336
|
+
}, q = ($) => {
|
|
3337
|
+
if (($.key === "Enter" || $.key === " ") && !d) {
|
|
3338
|
+
$.preventDefault();
|
|
3339
|
+
const R = !W;
|
|
3340
|
+
N(R), !R && x && O("from");
|
|
3289
3341
|
}
|
|
3290
|
-
|
|
3291
|
-
},
|
|
3292
|
-
|
|
3293
|
-
},
|
|
3294
|
-
|
|
3295
|
-
},
|
|
3296
|
-
|
|
3297
|
-
|
|
3342
|
+
$.key === "Escape" && (N(!1), x && O("from"));
|
|
3343
|
+
}, Q = () => {
|
|
3344
|
+
V === 0 ? (U(11), _(($) => $ - 1)) : U(($) => $ - 1);
|
|
3345
|
+
}, Z = () => {
|
|
3346
|
+
V === 11 ? (U(0), _(($) => $ + 1)) : U(($) => $ + 1);
|
|
3347
|
+
}, so = _o(F, V), eo = cs(F, V), y = [], A = _o(
|
|
3348
|
+
V === 0 ? F - 1 : F,
|
|
3349
|
+
V === 0 ? 11 : V - 1
|
|
3298
3350
|
);
|
|
3299
|
-
for (let
|
|
3300
|
-
|
|
3301
|
-
for (let
|
|
3302
|
-
|
|
3303
|
-
const
|
|
3304
|
-
for (let
|
|
3305
|
-
|
|
3351
|
+
for (let $ = eo - 1; $ >= 0; $--)
|
|
3352
|
+
y.push({ day: A - $, currentMonth: !1 });
|
|
3353
|
+
for (let $ = 1; $ <= so; $++)
|
|
3354
|
+
y.push({ day: $, currentMonth: !0 });
|
|
3355
|
+
const co = 42 - y.length;
|
|
3356
|
+
for (let $ = 1; $ <= co; $++)
|
|
3357
|
+
y.push({ day: $, currentMonth: !1 });
|
|
3306
3358
|
return /* @__PURE__ */ e(
|
|
3307
3359
|
sr,
|
|
3308
3360
|
{
|
|
3309
3361
|
label: r,
|
|
3310
|
-
error:
|
|
3311
|
-
helperText:
|
|
3312
|
-
required:
|
|
3313
|
-
children: /* @__PURE__ */ S(
|
|
3362
|
+
error: m,
|
|
3363
|
+
helperText: h,
|
|
3364
|
+
required: v,
|
|
3365
|
+
children: /* @__PURE__ */ S(Jt, { ref: H, children: [
|
|
3314
3366
|
/* @__PURE__ */ S(
|
|
3315
|
-
|
|
3367
|
+
Qt,
|
|
3316
3368
|
{
|
|
3317
3369
|
$size: l,
|
|
3318
|
-
$error: !!
|
|
3370
|
+
$error: !!m,
|
|
3319
3371
|
$disabled: d,
|
|
3320
3372
|
role: "combobox",
|
|
3321
3373
|
"aria-haspopup": "true",
|
|
3322
3374
|
"aria-expanded": W,
|
|
3323
3375
|
tabIndex: d ? -1 : 0,
|
|
3324
|
-
onClick:
|
|
3325
|
-
onKeyDown:
|
|
3376
|
+
onClick: j,
|
|
3377
|
+
onKeyDown: q,
|
|
3326
3378
|
children: [
|
|
3327
|
-
/* @__PURE__ */ e(
|
|
3328
|
-
p &&
|
|
3329
|
-
|
|
3379
|
+
/* @__PURE__ */ e(Zt, { $hasValue: to, children: K || a }),
|
|
3380
|
+
p && to ? /* @__PURE__ */ e(
|
|
3381
|
+
rs,
|
|
3330
3382
|
{
|
|
3331
3383
|
type: "button",
|
|
3332
|
-
onClick:
|
|
3384
|
+
onClick: lo,
|
|
3333
3385
|
"aria-label": "Clear date",
|
|
3334
|
-
children: /* @__PURE__ */ e(
|
|
3386
|
+
children: /* @__PURE__ */ e(yo, { size: 14 })
|
|
3335
3387
|
}
|
|
3336
|
-
) : /* @__PURE__ */ e(
|
|
3388
|
+
) : /* @__PURE__ */ e(os, { "aria-hidden": "true", children: /* @__PURE__ */ e(_r, { size: 14 }) })
|
|
3337
3389
|
]
|
|
3338
3390
|
}
|
|
3339
3391
|
),
|
|
3340
|
-
W && /* @__PURE__ */ S(
|
|
3341
|
-
/* @__PURE__ */ S(
|
|
3392
|
+
W && /* @__PURE__ */ S(ns, { role: "dialog", "aria-label": "Calendar", children: [
|
|
3393
|
+
/* @__PURE__ */ S(ts, { children: [
|
|
3342
3394
|
/* @__PURE__ */ e(
|
|
3343
3395
|
Bo,
|
|
3344
3396
|
{
|
|
3345
3397
|
type: "button",
|
|
3346
|
-
onClick:
|
|
3398
|
+
onClick: Q,
|
|
3347
3399
|
"aria-label": "Previous month",
|
|
3348
3400
|
children: /* @__PURE__ */ e(Yr, { size: 16 })
|
|
3349
3401
|
}
|
|
3350
3402
|
),
|
|
3351
|
-
/* @__PURE__ */ S(
|
|
3352
|
-
|
|
3403
|
+
/* @__PURE__ */ S(ss, { children: [
|
|
3404
|
+
as[V],
|
|
3353
3405
|
" ",
|
|
3354
|
-
|
|
3406
|
+
F
|
|
3355
3407
|
] }),
|
|
3356
3408
|
/* @__PURE__ */ e(
|
|
3357
3409
|
Bo,
|
|
3358
3410
|
{
|
|
3359
3411
|
type: "button",
|
|
3360
|
-
onClick:
|
|
3412
|
+
onClick: Z,
|
|
3361
3413
|
"aria-label": "Next month",
|
|
3362
3414
|
children: /* @__PURE__ */ e(Kr, { size: 16 })
|
|
3363
3415
|
}
|
|
3364
3416
|
)
|
|
3365
3417
|
] }),
|
|
3366
|
-
/* @__PURE__ */ S(
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
if (
|
|
3418
|
+
/* @__PURE__ */ S(es, { children: [
|
|
3419
|
+
ls.map(($) => /* @__PURE__ */ e(is, { children: $ }, $)),
|
|
3420
|
+
y.map(($, R) => {
|
|
3421
|
+
if (!$.currentMonth)
|
|
3370
3422
|
return /* @__PURE__ */ e(
|
|
3371
3423
|
ko,
|
|
3372
3424
|
{
|
|
@@ -3376,13 +3428,13 @@ function ls({
|
|
|
3376
3428
|
$today: !1,
|
|
3377
3429
|
disabled: !0,
|
|
3378
3430
|
tabIndex: -1,
|
|
3379
|
-
children:
|
|
3431
|
+
children: $.day
|
|
3380
3432
|
},
|
|
3381
|
-
|
|
3433
|
+
R
|
|
3382
3434
|
);
|
|
3383
|
-
const c = new Date(
|
|
3384
|
-
if (
|
|
3385
|
-
const Eo =
|
|
3435
|
+
const c = new Date(F, V, $.day), E = fo(c, z), G = ds(c, u, f);
|
|
3436
|
+
if (x) {
|
|
3437
|
+
const Eo = w ? fo(c, w) : !1, Oo = b ? fo(c, b) : !1, cr = w && b ? c > w && c < b : !1;
|
|
3386
3438
|
return /* @__PURE__ */ e(
|
|
3387
3439
|
ko,
|
|
3388
3440
|
{
|
|
@@ -3391,32 +3443,32 @@ function ls({
|
|
|
3391
3443
|
$selected: !1,
|
|
3392
3444
|
$today: E,
|
|
3393
3445
|
$rangeStart: Eo,
|
|
3394
|
-
$rangeEnd:
|
|
3446
|
+
$rangeEnd: Oo,
|
|
3395
3447
|
$inRange: cr,
|
|
3396
3448
|
disabled: G,
|
|
3397
3449
|
"aria-label": Ho(c),
|
|
3398
|
-
"aria-pressed": Eo ||
|
|
3399
|
-
onClick: () =>
|
|
3400
|
-
children:
|
|
3450
|
+
"aria-pressed": Eo || Oo,
|
|
3451
|
+
onClick: () => J($.day),
|
|
3452
|
+
children: $.day
|
|
3401
3453
|
},
|
|
3402
|
-
|
|
3454
|
+
R
|
|
3403
3455
|
);
|
|
3404
3456
|
}
|
|
3405
|
-
const
|
|
3457
|
+
const $o = I ? fo(c, I) : !1;
|
|
3406
3458
|
return /* @__PURE__ */ e(
|
|
3407
3459
|
ko,
|
|
3408
3460
|
{
|
|
3409
3461
|
type: "button",
|
|
3410
3462
|
$currentMonth: !0,
|
|
3411
|
-
$selected:
|
|
3463
|
+
$selected: $o,
|
|
3412
3464
|
$today: E,
|
|
3413
3465
|
disabled: G,
|
|
3414
3466
|
"aria-label": Ho(c),
|
|
3415
|
-
"aria-pressed":
|
|
3416
|
-
onClick: () =>
|
|
3417
|
-
children:
|
|
3467
|
+
"aria-pressed": $o,
|
|
3468
|
+
onClick: () => J($.day),
|
|
3469
|
+
children: $.day
|
|
3418
3470
|
},
|
|
3419
|
-
|
|
3471
|
+
R
|
|
3420
3472
|
);
|
|
3421
3473
|
})
|
|
3422
3474
|
] })
|
|
@@ -3425,10 +3477,10 @@ function ls({
|
|
|
3425
3477
|
}
|
|
3426
3478
|
);
|
|
3427
3479
|
}
|
|
3428
|
-
|
|
3429
|
-
function
|
|
3430
|
-
const r = parseInt(o.slice(1, 3), 16) / 255, n = parseInt(o.slice(3, 5), 16) / 255,
|
|
3431
|
-
return 0.2126 * a(r) + 0.7152 * a(n) + 0.0722 * a(
|
|
3480
|
+
us.displayName = "DatePicker";
|
|
3481
|
+
function ps(o) {
|
|
3482
|
+
const r = parseInt(o.slice(1, 3), 16) / 255, n = parseInt(o.slice(3, 5), 16) / 255, s = parseInt(o.slice(5, 7), 16) / 255, a = (d) => d <= 0.03928 ? d / 12.92 : ((d + 0.055) / 1.055) ** 2.4;
|
|
3483
|
+
return 0.2126 * a(r) + 0.7152 * a(n) + 0.0722 * a(s) > 0.179 ? "#111111" : "#ffffff";
|
|
3432
3484
|
}
|
|
3433
3485
|
const Io = {
|
|
3434
3486
|
colors: {
|
|
@@ -3471,7 +3523,7 @@ const Io = {
|
|
|
3471
3523
|
shadows: { focusRing: "3px 3px 0 #111111" },
|
|
3472
3524
|
brutalism: { borderWidth: "2px", shadowOffset: "4px" }
|
|
3473
3525
|
};
|
|
3474
|
-
function
|
|
3526
|
+
function Ds(o) {
|
|
3475
3527
|
return {
|
|
3476
3528
|
...Io,
|
|
3477
3529
|
colors: {
|
|
@@ -3480,18 +3532,18 @@ function Is(o) {
|
|
|
3480
3532
|
50: "#fffff0",
|
|
3481
3533
|
500: o,
|
|
3482
3534
|
700: o,
|
|
3483
|
-
contrast:
|
|
3535
|
+
contrast: ps(o)
|
|
3484
3536
|
}
|
|
3485
3537
|
}
|
|
3486
3538
|
};
|
|
3487
3539
|
}
|
|
3488
|
-
function
|
|
3540
|
+
function Es({
|
|
3489
3541
|
theme: o = Io,
|
|
3490
3542
|
children: r
|
|
3491
3543
|
}) {
|
|
3492
3544
|
return /* @__PURE__ */ e(ur, { theme: o, children: r });
|
|
3493
3545
|
}
|
|
3494
|
-
const
|
|
3546
|
+
const Os = pr`
|
|
3495
3547
|
*, *::before, *::after {
|
|
3496
3548
|
box-sizing: border-box;
|
|
3497
3549
|
margin: 0;
|
|
@@ -3515,13 +3567,13 @@ export {
|
|
|
3515
3567
|
qn as Checkbox,
|
|
3516
3568
|
ht as CollapsibleCard,
|
|
3517
3569
|
ar as ConfirmDialog,
|
|
3518
|
-
|
|
3519
|
-
|
|
3570
|
+
Ts as ConfirmProvider,
|
|
3571
|
+
us as DatePicker,
|
|
3520
3572
|
un as Editable,
|
|
3521
3573
|
bn as Field,
|
|
3522
3574
|
Rn as Form,
|
|
3523
3575
|
sr as FormField,
|
|
3524
|
-
|
|
3576
|
+
Os as GlobalStyles,
|
|
3525
3577
|
vr as Input,
|
|
3526
3578
|
qo as Link,
|
|
3527
3579
|
Go as Modal,
|
|
@@ -3529,22 +3581,22 @@ export {
|
|
|
3529
3581
|
ln as Select,
|
|
3530
3582
|
St as Spinner,
|
|
3531
3583
|
at as Switch,
|
|
3532
|
-
|
|
3584
|
+
qt as Table,
|
|
3533
3585
|
Tr as Textarea,
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3586
|
+
Es as ThemeProvider,
|
|
3587
|
+
Mn as Toast,
|
|
3588
|
+
xs as ToastProvider,
|
|
3589
|
+
Cs as composeValidators,
|
|
3590
|
+
Ds as createNeoBrutalTheme,
|
|
3591
|
+
ks as isEmail,
|
|
3592
|
+
Ss as isUrl,
|
|
3593
|
+
vs as maxLength,
|
|
3594
|
+
ms as minLength,
|
|
3543
3595
|
Io as neoBrutalTheme,
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3596
|
+
zs as pattern,
|
|
3597
|
+
ws as required,
|
|
3598
|
+
Ws as useConfirm,
|
|
3599
|
+
hs as useForm,
|
|
3600
|
+
Is as useTable,
|
|
3601
|
+
ys as useToast
|
|
3550
3602
|
};
|