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