blunt-ui 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Badge/Badge.types.d.ts +4 -4
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/DataTable/DataTable.d.ts +5 -0
- package/dist/components/DataTable/DataTable.stories.d.ts +13 -0
- package/dist/components/{EditableTable/EditableTable.types.d.ts → DataTable/DataTable.types.d.ts} +7 -4
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.stories.d.ts +25 -0
- package/dist/components/Table/Table.types.d.ts +29 -2
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Table/useTablePagination.d.ts +16 -0
- package/dist/components/Table/useTableSort.d.ts +13 -0
- package/dist/index.cjs +400 -276
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1094 -698
- package/package.json +1 -1
- package/dist/components/EditableTable/EditableTable.d.ts +0 -5
- package/dist/components/EditableTable/index.d.ts +0 -2
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 s, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import i, { css as t, keyframes as M, ThemeProvider as Ao } from "styled-components";
|
|
3
|
+
import bo, { useId as G, useState as D, useRef as oo, useEffect as K, useContext as ko, createContext as mo, forwardRef as So, createElement as lo, useCallback as R, useMemo as uo } from "react";
|
|
4
|
+
import { createPortal as Co } from "react-dom";
|
|
5
|
+
const F = (o, r, n) => t`
|
|
6
6
|
background: ${r};
|
|
7
|
-
color: ${
|
|
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
|
+
`, jo = i.span`
|
|
11
11
|
display: inline-flex;
|
|
12
12
|
align-items: center;
|
|
13
13
|
font-weight: 700;
|
|
@@ -20,82 +20,82 @@ const N = (o, r, s) => n`
|
|
|
20
20
|
max-width: 20ch;
|
|
21
21
|
|
|
22
22
|
${({ $size: o, theme: r }) => ({
|
|
23
|
-
sm:
|
|
23
|
+
sm: t`
|
|
24
24
|
padding: 2px 8px;
|
|
25
25
|
font-size: ${r.fontSizes.xs};
|
|
26
26
|
`,
|
|
27
|
-
md:
|
|
27
|
+
md: t`
|
|
28
28
|
padding: 4px 10px;
|
|
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: F(
|
|
35
35
|
r,
|
|
36
36
|
r.colors.primary[500],
|
|
37
37
|
r.colors.primary.contrast
|
|
38
38
|
),
|
|
39
|
-
neutral:
|
|
39
|
+
neutral: F(
|
|
40
40
|
r,
|
|
41
41
|
r.colors.neutral[200],
|
|
42
42
|
r.colors.neutral[900]
|
|
43
43
|
),
|
|
44
|
-
success:
|
|
44
|
+
success: F(
|
|
45
45
|
r,
|
|
46
46
|
r.colors.success[50],
|
|
47
47
|
r.colors.success[500]
|
|
48
48
|
),
|
|
49
|
-
error:
|
|
49
|
+
error: F(
|
|
50
50
|
r,
|
|
51
51
|
r.colors.error[50],
|
|
52
52
|
r.colors.error[500]
|
|
53
53
|
),
|
|
54
|
-
warning:
|
|
54
|
+
warning: F(
|
|
55
55
|
r,
|
|
56
56
|
r.colors.warning[50],
|
|
57
57
|
r.colors.warning[500]
|
|
58
58
|
),
|
|
59
|
-
info:
|
|
59
|
+
info: F(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 Ro({
|
|
88
88
|
variant: o = "primary",
|
|
89
89
|
size: r = "md",
|
|
90
|
-
children:
|
|
91
|
-
...
|
|
90
|
+
children: n,
|
|
91
|
+
...e
|
|
92
92
|
}) {
|
|
93
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ s(jo, { $variant: o, $size: r, ...e, children: n });
|
|
94
94
|
}
|
|
95
|
-
|
|
96
|
-
const
|
|
95
|
+
Ro.displayName = "Badge";
|
|
96
|
+
const so = (o, r, n) => t`
|
|
97
97
|
background-color: ${r};
|
|
98
|
-
color: ${
|
|
98
|
+
color: ${n};
|
|
99
99
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
100
100
|
box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
|
|
101
101
|
0 ${o.colors.neutral[900]};
|
|
@@ -106,7 +106,7 @@ const _ = (o, r, s) => n`
|
|
|
106
106
|
transform: translate(2px, 2px);
|
|
107
107
|
box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`, _o = i.button`
|
|
110
110
|
display: inline-flex;
|
|
111
111
|
align-items: center;
|
|
112
112
|
justify-content: center;
|
|
@@ -126,23 +126,23 @@ const _ = (o, r, s) => n`
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
${({ $variant: o, theme: r }) => r.brutalism ? {
|
|
129
|
-
primary:
|
|
129
|
+
primary: so(
|
|
130
130
|
r,
|
|
131
131
|
r.colors.primary[500],
|
|
132
132
|
r.colors.primary.contrast
|
|
133
133
|
),
|
|
134
|
-
secondary:
|
|
134
|
+
secondary: so(
|
|
135
135
|
r,
|
|
136
136
|
r.colors.neutral[100],
|
|
137
137
|
r.colors.neutral[900]
|
|
138
138
|
),
|
|
139
|
-
outline:
|
|
139
|
+
outline: so(
|
|
140
140
|
r,
|
|
141
141
|
r.colors.neutral[0],
|
|
142
142
|
r.colors.neutral[900]
|
|
143
143
|
)
|
|
144
144
|
}[o] : {
|
|
145
|
-
primary:
|
|
145
|
+
primary: t`
|
|
146
146
|
background-color: ${r.colors.primary[500]};
|
|
147
147
|
color: ${r.colors.neutral[0]};
|
|
148
148
|
border: none;
|
|
@@ -150,7 +150,7 @@ const _ = (o, r, s) => n`
|
|
|
150
150
|
background-color: ${r.colors.primary[700]};
|
|
151
151
|
}
|
|
152
152
|
`,
|
|
153
|
-
secondary:
|
|
153
|
+
secondary: t`
|
|
154
154
|
background-color: ${r.colors.neutral[200]};
|
|
155
155
|
color: ${r.colors.neutral[600]};
|
|
156
156
|
border: none;
|
|
@@ -158,7 +158,7 @@ const _ = (o, r, s) => n`
|
|
|
158
158
|
background-color: ${r.colors.neutral[300]};
|
|
159
159
|
}
|
|
160
160
|
`,
|
|
161
|
-
outline:
|
|
161
|
+
outline: t`
|
|
162
162
|
background-color: transparent;
|
|
163
163
|
color: ${r.colors.primary[500]};
|
|
164
164
|
border: 2px solid ${r.colors.primary[500]};
|
|
@@ -169,58 +169,58 @@ const _ = (o, r, s) => n`
|
|
|
169
169
|
}[o]}
|
|
170
170
|
|
|
171
171
|
${({ $size: o, theme: r }) => ({
|
|
172
|
-
sm:
|
|
172
|
+
sm: t`
|
|
173
173
|
padding: ${r.spacing[1]} ${r.spacing[3]};
|
|
174
174
|
font-size: ${r.fontSizes.sm};
|
|
175
175
|
`,
|
|
176
|
-
md:
|
|
176
|
+
md: t`
|
|
177
177
|
padding: ${r.spacing[2]} ${r.spacing[4]};
|
|
178
178
|
font-size: ${r.fontSizes.md};
|
|
179
179
|
`,
|
|
180
|
-
lg:
|
|
180
|
+
lg: t`
|
|
181
181
|
padding: ${r.spacing[3]} ${r.spacing[6]};
|
|
182
182
|
font-size: ${r.fontSizes.lg};
|
|
183
183
|
`
|
|
184
184
|
})[o]}
|
|
185
185
|
`;
|
|
186
|
-
function
|
|
186
|
+
function Mo({
|
|
187
187
|
ref: o,
|
|
188
188
|
as: r,
|
|
189
|
-
href:
|
|
190
|
-
variant:
|
|
191
|
-
size:
|
|
192
|
-
isLoading:
|
|
193
|
-
disabled:
|
|
194
|
-
children:
|
|
195
|
-
...
|
|
189
|
+
href: n,
|
|
190
|
+
variant: e = "primary",
|
|
191
|
+
size: c = "md",
|
|
192
|
+
isLoading: a,
|
|
193
|
+
disabled: l,
|
|
194
|
+
children: u,
|
|
195
|
+
...x
|
|
196
196
|
}) {
|
|
197
|
-
return /* @__PURE__ */
|
|
198
|
-
|
|
197
|
+
return /* @__PURE__ */ s(
|
|
198
|
+
_o,
|
|
199
199
|
{
|
|
200
200
|
ref: o,
|
|
201
|
-
as: r ?? (
|
|
202
|
-
href:
|
|
203
|
-
$variant:
|
|
204
|
-
$size:
|
|
205
|
-
disabled:
|
|
206
|
-
...
|
|
207
|
-
children:
|
|
201
|
+
as: r ?? (n ? "a" : "button"),
|
|
202
|
+
href: n,
|
|
203
|
+
$variant: e,
|
|
204
|
+
$size: c,
|
|
205
|
+
disabled: a || l,
|
|
206
|
+
...x,
|
|
207
|
+
children: a ? "Loading..." : u
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
const
|
|
211
|
+
Mo.displayName = "Button";
|
|
212
|
+
const Vo = i.div`
|
|
213
213
|
display: flex;
|
|
214
214
|
flex-direction: column;
|
|
215
215
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
216
216
|
width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
|
|
217
|
-
`,
|
|
217
|
+
`, Fo = i.label`
|
|
218
218
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
219
219
|
font-weight: ${({ theme: o }) => o.brutalism ? "700" : "500"};
|
|
220
|
-
`,
|
|
220
|
+
`, Ko = i.span`
|
|
221
221
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
222
222
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
223
|
-
`,
|
|
223
|
+
`, Ho = i.div`
|
|
224
224
|
display: flex;
|
|
225
225
|
align-items: center;
|
|
226
226
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -229,43 +229,43 @@ const Co = t.div`
|
|
|
229
229
|
box-shadow 0.2s;
|
|
230
230
|
|
|
231
231
|
${({ $size: o = "md", theme: r }) => ({
|
|
232
|
-
sm:
|
|
232
|
+
sm: t`
|
|
233
233
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
234
234
|
font-size: ${r.fontSizes.sm};
|
|
235
235
|
`,
|
|
236
|
-
md:
|
|
236
|
+
md: t`
|
|
237
237
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
238
238
|
font-size: ${r.fontSizes.md};
|
|
239
239
|
`,
|
|
240
|
-
lg:
|
|
240
|
+
lg: t`
|
|
241
241
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
242
242
|
font-size: ${r.fontSizes.lg};
|
|
243
243
|
`
|
|
244
244
|
})[o]}
|
|
245
245
|
|
|
246
|
-
${({ $variant: o = "default", theme: r }) => r.brutalism ?
|
|
246
|
+
${({ $variant: o = "default", theme: r }) => r.brutalism ? t`
|
|
247
247
|
border: ${r.brutalism.borderWidth} solid
|
|
248
248
|
${r.colors.neutral[900]};
|
|
249
249
|
background-color: ${r.colors.neutral[0]};
|
|
250
250
|
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
251
251
|
` : {
|
|
252
|
-
default:
|
|
252
|
+
default: t`
|
|
253
253
|
border: 1px solid ${r.colors.neutral[400]};
|
|
254
254
|
background-color: ${r.colors.neutral[0]};
|
|
255
255
|
`,
|
|
256
|
-
outlined:
|
|
256
|
+
outlined: t`
|
|
257
257
|
border: 2px solid ${r.colors.primary[500]};
|
|
258
258
|
background-color: ${r.colors.neutral[0]};
|
|
259
259
|
`,
|
|
260
|
-
filled:
|
|
260
|
+
filled: t`
|
|
261
261
|
border: 1px solid transparent;
|
|
262
262
|
background-color: ${r.colors.neutral[100]};
|
|
263
263
|
`
|
|
264
264
|
}[o]}
|
|
265
265
|
|
|
266
|
-
${({ $error: o, theme: r }) => o &&
|
|
266
|
+
${({ $error: o, theme: r }) => o && t`
|
|
267
267
|
border-color: ${r.colors.error[500]};
|
|
268
|
-
${r.brutalism &&
|
|
268
|
+
${r.brutalism && t`
|
|
269
269
|
box-shadow: 3px 3px 0 ${r.colors.error[500]};
|
|
270
270
|
`}
|
|
271
271
|
`}
|
|
@@ -273,7 +273,7 @@ const Co = t.div`
|
|
|
273
273
|
&:focus-within {
|
|
274
274
|
box-shadow: ${({ theme: o }) => o.shadows.focusRing};
|
|
275
275
|
}
|
|
276
|
-
`,
|
|
276
|
+
`, Yo = i.input`
|
|
277
277
|
flex: 1;
|
|
278
278
|
border: none;
|
|
279
279
|
outline: none;
|
|
@@ -284,11 +284,11 @@ const Co = t.div`
|
|
|
284
284
|
cursor: not-allowed;
|
|
285
285
|
opacity: 0.6;
|
|
286
286
|
}
|
|
287
|
-
`,
|
|
287
|
+
`, $o = i.div`
|
|
288
288
|
display: inline-flex;
|
|
289
289
|
align-items: center;
|
|
290
290
|
margin: 0 ${({ theme: o }) => o.spacing[1]};
|
|
291
|
-
`,
|
|
291
|
+
`, Uo = i.button`
|
|
292
292
|
display: inline-flex;
|
|
293
293
|
align-items: center;
|
|
294
294
|
margin: 0 ${({ theme: o }) => o.spacing[1]};
|
|
@@ -302,75 +302,75 @@ const Co = t.div`
|
|
|
302
302
|
opacity: 0.8;
|
|
303
303
|
}
|
|
304
304
|
`;
|
|
305
|
-
function
|
|
305
|
+
function qo({
|
|
306
306
|
ref: o,
|
|
307
307
|
type: r = "text",
|
|
308
|
-
size:
|
|
309
|
-
variant:
|
|
310
|
-
label:
|
|
311
|
-
helperText:
|
|
312
|
-
error:
|
|
313
|
-
leftElement:
|
|
314
|
-
rightElement:
|
|
315
|
-
clearable:
|
|
316
|
-
onClear:
|
|
317
|
-
fullWidth:
|
|
318
|
-
id:
|
|
319
|
-
value:
|
|
320
|
-
defaultValue:
|
|
321
|
-
onChange:
|
|
308
|
+
size: n = "md",
|
|
309
|
+
variant: e = "default",
|
|
310
|
+
label: c,
|
|
311
|
+
helperText: a,
|
|
312
|
+
error: l,
|
|
313
|
+
leftElement: u,
|
|
314
|
+
rightElement: x,
|
|
315
|
+
clearable: p,
|
|
316
|
+
onClear: b,
|
|
317
|
+
fullWidth: w,
|
|
318
|
+
id: y,
|
|
319
|
+
value: g,
|
|
320
|
+
defaultValue: k,
|
|
321
|
+
onChange: T,
|
|
322
322
|
...z
|
|
323
323
|
}) {
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
},
|
|
327
|
-
|
|
324
|
+
const v = G(), I = y ?? v, P = `${I}-hint`, [B, h] = D(k ?? ""), $ = g !== void 0, m = $ ? g : B, O = typeof l == "string" ? l : void 0, j = !!(a || l), _ = (N) => {
|
|
325
|
+
$ || h(N.target.value), T?.(N);
|
|
326
|
+
}, H = () => {
|
|
327
|
+
$ || h(""), b?.();
|
|
328
328
|
};
|
|
329
|
-
return /* @__PURE__ */
|
|
330
|
-
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
|
|
329
|
+
return /* @__PURE__ */ C(Vo, { $fullWidth: w, children: [
|
|
330
|
+
c && /* @__PURE__ */ s(Fo, { htmlFor: I, children: c }),
|
|
331
|
+
/* @__PURE__ */ C(Ho, { $size: n, $variant: e, $error: !!l, children: [
|
|
332
|
+
u && /* @__PURE__ */ s($o, { children: u }),
|
|
333
|
+
/* @__PURE__ */ s(
|
|
334
|
+
Yo,
|
|
335
335
|
{
|
|
336
|
-
id:
|
|
336
|
+
id: I,
|
|
337
337
|
ref: o,
|
|
338
338
|
type: r,
|
|
339
|
-
value:
|
|
340
|
-
onChange:
|
|
339
|
+
value: m,
|
|
340
|
+
onChange: _,
|
|
341
341
|
...z,
|
|
342
|
-
"aria-invalid": !!
|
|
343
|
-
"aria-describedby":
|
|
342
|
+
"aria-invalid": !!l,
|
|
343
|
+
"aria-describedby": j ? P : void 0
|
|
344
344
|
}
|
|
345
345
|
),
|
|
346
|
-
|
|
347
|
-
|
|
346
|
+
p && m && /* @__PURE__ */ s(
|
|
347
|
+
Uo,
|
|
348
348
|
{
|
|
349
349
|
type: "button",
|
|
350
|
-
onClick:
|
|
350
|
+
onClick: H,
|
|
351
351
|
"aria-label": "Clear input",
|
|
352
352
|
children: "✕"
|
|
353
353
|
}
|
|
354
354
|
),
|
|
355
|
-
|
|
355
|
+
x && /* @__PURE__ */ s($o, { children: x })
|
|
356
356
|
] }),
|
|
357
|
-
|
|
357
|
+
j && /* @__PURE__ */ s(Ko, { id: P, $error: !!l, children: O ?? a })
|
|
358
358
|
] });
|
|
359
359
|
}
|
|
360
|
-
|
|
361
|
-
const
|
|
360
|
+
qo.displayName = "Input";
|
|
361
|
+
const Go = M`
|
|
362
362
|
from { opacity: 0; }
|
|
363
363
|
to { opacity: 1; }
|
|
364
|
-
`,
|
|
364
|
+
`, Xo = M`
|
|
365
365
|
from { opacity: 1; }
|
|
366
366
|
to { opacity: 0; }
|
|
367
|
-
`,
|
|
367
|
+
`, Zo = M`
|
|
368
368
|
from { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
369
369
|
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
370
|
-
`,
|
|
370
|
+
`, Jo = M`
|
|
371
371
|
from { opacity: 1; transform: scale(1) translateY(0); }
|
|
372
372
|
to { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
373
|
-
`,
|
|
373
|
+
`, Qo = i.div`
|
|
374
374
|
position: fixed;
|
|
375
375
|
inset: 0;
|
|
376
376
|
background-color: rgba(0, 0, 0, 0.5);
|
|
@@ -378,9 +378,9 @@ const Bo = R`
|
|
|
378
378
|
align-items: center;
|
|
379
379
|
justify-content: center;
|
|
380
380
|
z-index: ${({ theme: o }) => o.zIndex.modal};
|
|
381
|
-
animation: ${({ $closing: o }) => o ?
|
|
381
|
+
animation: ${({ $closing: o }) => o ? Xo : Go} 0.15s ease
|
|
382
382
|
forwards;
|
|
383
|
-
`,
|
|
383
|
+
`, or = i.div`
|
|
384
384
|
position: relative;
|
|
385
385
|
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
386
386
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -389,37 +389,37 @@ const Bo = R`
|
|
|
389
389
|
display: flex;
|
|
390
390
|
flex-direction: column;
|
|
391
391
|
max-height: 90vh;
|
|
392
|
-
animation: ${({ $closing: o }) => o ?
|
|
392
|
+
animation: ${({ $closing: o }) => o ? Jo : Zo} 0.15s ease
|
|
393
393
|
forwards;
|
|
394
394
|
|
|
395
|
-
${({ $size: o }) => o === "sm" &&
|
|
395
|
+
${({ $size: o }) => o === "sm" && t`
|
|
396
396
|
width: min(400px, 90vw);
|
|
397
397
|
`}
|
|
398
|
-
${({ $size: o }) => o === "md" &&
|
|
398
|
+
${({ $size: o }) => o === "md" && t`
|
|
399
399
|
width: min(560px, 90vw);
|
|
400
400
|
`}
|
|
401
|
-
${({ $size: o }) => o === "lg" &&
|
|
401
|
+
${({ $size: o }) => o === "lg" && t`
|
|
402
402
|
width: min(720px, 90vw);
|
|
403
403
|
`}
|
|
404
|
-
${({ $size: o }) => o === "fullscreen" &&
|
|
404
|
+
${({ $size: o }) => o === "fullscreen" && t`
|
|
405
405
|
width: 100vw;
|
|
406
406
|
height: 100vh;
|
|
407
407
|
max-height: 100vh;
|
|
408
408
|
border-radius: 0;
|
|
409
409
|
`}
|
|
410
|
-
`,
|
|
410
|
+
`, rr = i.div`
|
|
411
411
|
display: flex;
|
|
412
412
|
align-items: center;
|
|
413
413
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
414
414
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
415
415
|
border-bottom: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
416
416
|
flex-shrink: 0;
|
|
417
|
-
`,
|
|
417
|
+
`, nr = i.h2`
|
|
418
418
|
flex: 1;
|
|
419
419
|
font-size: ${({ theme: o }) => o.fontSizes.lg};
|
|
420
420
|
font-weight: 600;
|
|
421
421
|
margin: 0;
|
|
422
|
-
`,
|
|
422
|
+
`, tr = i.button`
|
|
423
423
|
display: inline-flex;
|
|
424
424
|
align-items: center;
|
|
425
425
|
justify-content: center;
|
|
@@ -444,11 +444,11 @@ const Bo = R`
|
|
|
444
444
|
outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
|
|
445
445
|
outline-offset: 2px;
|
|
446
446
|
}
|
|
447
|
-
`,
|
|
447
|
+
`, sr = i.div`
|
|
448
448
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
449
449
|
overflow-y: auto;
|
|
450
450
|
flex: 1;
|
|
451
|
-
`,
|
|
451
|
+
`, ir = i.div`
|
|
452
452
|
display: flex;
|
|
453
453
|
align-items: center;
|
|
454
454
|
justify-content: flex-end;
|
|
@@ -456,7 +456,7 @@ const Bo = R`
|
|
|
456
456
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
457
457
|
border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
458
458
|
flex-shrink: 0;
|
|
459
|
-
`,
|
|
459
|
+
`, er = [
|
|
460
460
|
"button:not([disabled])",
|
|
461
461
|
"input:not([disabled])",
|
|
462
462
|
"select:not([disabled])",
|
|
@@ -464,89 +464,89 @@ const Bo = R`
|
|
|
464
464
|
"a[href]",
|
|
465
465
|
'[tabindex]:not([tabindex="-1"])'
|
|
466
466
|
].join(", ");
|
|
467
|
-
function
|
|
467
|
+
function xo(o) {
|
|
468
468
|
return Array.from(
|
|
469
|
-
o.querySelectorAll(
|
|
469
|
+
o.querySelectorAll(er)
|
|
470
470
|
);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function ar({
|
|
473
473
|
open: o,
|
|
474
474
|
onClose: r,
|
|
475
|
-
title:
|
|
476
|
-
children:
|
|
477
|
-
footer:
|
|
478
|
-
size:
|
|
479
|
-
closeOnBackdrop:
|
|
480
|
-
closeOnEscape:
|
|
481
|
-
ariaLabelledBy:
|
|
482
|
-
ariaDescribedBy:
|
|
475
|
+
title: n,
|
|
476
|
+
children: e,
|
|
477
|
+
footer: c,
|
|
478
|
+
size: a = "md",
|
|
479
|
+
closeOnBackdrop: l = !0,
|
|
480
|
+
closeOnEscape: u = !0,
|
|
481
|
+
ariaLabelledBy: x,
|
|
482
|
+
ariaDescribedBy: p
|
|
483
483
|
}) {
|
|
484
|
-
const
|
|
485
|
-
return
|
|
484
|
+
const b = oo(null), w = G(), y = x ?? (n ? w : void 0), [g, k] = D(o), [T, z] = D(!1);
|
|
485
|
+
return K(() => {
|
|
486
486
|
if (o)
|
|
487
|
-
|
|
488
|
-
else if (
|
|
487
|
+
k(!0), z(!1);
|
|
488
|
+
else if (g) {
|
|
489
489
|
z(!0);
|
|
490
|
-
const
|
|
491
|
-
|
|
490
|
+
const v = setTimeout(() => {
|
|
491
|
+
k(!1), z(!1);
|
|
492
492
|
}, 150);
|
|
493
|
-
return () => clearTimeout(
|
|
493
|
+
return () => clearTimeout(v);
|
|
494
494
|
}
|
|
495
|
-
}, [o,
|
|
495
|
+
}, [o, g]), K(() => {
|
|
496
496
|
if (!o)
|
|
497
497
|
return;
|
|
498
|
-
const
|
|
498
|
+
const v = document.body.style.overflow;
|
|
499
499
|
return document.body.style.overflow = "hidden", () => {
|
|
500
|
-
document.body.style.overflow =
|
|
500
|
+
document.body.style.overflow = v;
|
|
501
501
|
};
|
|
502
|
-
}, [o]),
|
|
503
|
-
if (!o || !
|
|
502
|
+
}, [o]), K(() => {
|
|
503
|
+
if (!o || !b.current)
|
|
504
504
|
return;
|
|
505
|
-
const
|
|
506
|
-
(
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
505
|
+
const v = b.current, I = document.activeElement;
|
|
506
|
+
(xo(v)[0] ?? v).focus();
|
|
507
|
+
const B = (h) => {
|
|
508
|
+
if (h.key === "Escape" && u) {
|
|
509
509
|
r();
|
|
510
510
|
return;
|
|
511
511
|
}
|
|
512
|
-
if (
|
|
512
|
+
if (h.key !== "Tab")
|
|
513
513
|
return;
|
|
514
|
-
const
|
|
515
|
-
if (
|
|
516
|
-
|
|
514
|
+
const $ = xo(v);
|
|
515
|
+
if ($.length === 0) {
|
|
516
|
+
h.preventDefault();
|
|
517
517
|
return;
|
|
518
518
|
}
|
|
519
|
-
const
|
|
520
|
-
|
|
519
|
+
const m = $[0], O = $[$.length - 1];
|
|
520
|
+
h.shiftKey ? document.activeElement === m && (h.preventDefault(), O.focus()) : document.activeElement === O && (h.preventDefault(), m.focus());
|
|
521
521
|
};
|
|
522
|
-
return document.addEventListener("keydown",
|
|
523
|
-
document.removeEventListener("keydown",
|
|
522
|
+
return document.addEventListener("keydown", B), () => {
|
|
523
|
+
document.removeEventListener("keydown", B), I?.focus();
|
|
524
524
|
};
|
|
525
|
-
}, [o,
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
|
|
525
|
+
}, [o, u, r, g]), g ? Co(
|
|
526
|
+
/* @__PURE__ */ s(
|
|
527
|
+
Qo,
|
|
528
528
|
{
|
|
529
|
-
$closing:
|
|
530
|
-
onClick:
|
|
531
|
-
children: /* @__PURE__ */
|
|
532
|
-
|
|
529
|
+
$closing: T,
|
|
530
|
+
onClick: l ? r : void 0,
|
|
531
|
+
children: /* @__PURE__ */ C(
|
|
532
|
+
or,
|
|
533
533
|
{
|
|
534
|
-
ref:
|
|
534
|
+
ref: b,
|
|
535
535
|
role: "dialog",
|
|
536
536
|
"aria-modal": "true",
|
|
537
|
-
"aria-labelledby":
|
|
538
|
-
"aria-describedby":
|
|
539
|
-
$size:
|
|
540
|
-
$closing:
|
|
537
|
+
"aria-labelledby": y,
|
|
538
|
+
"aria-describedby": p,
|
|
539
|
+
$size: a,
|
|
540
|
+
$closing: T,
|
|
541
541
|
tabIndex: -1,
|
|
542
|
-
onClick: (
|
|
542
|
+
onClick: (v) => v.stopPropagation(),
|
|
543
543
|
children: [
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
|
|
546
|
-
/* @__PURE__ */
|
|
544
|
+
/* @__PURE__ */ C(rr, { children: [
|
|
545
|
+
n && /* @__PURE__ */ s(nr, { id: w, children: n }),
|
|
546
|
+
/* @__PURE__ */ s(tr, { onClick: r, "aria-label": "Close modal", children: "×" })
|
|
547
547
|
] }),
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
|
|
548
|
+
/* @__PURE__ */ s(sr, { children: e }),
|
|
549
|
+
c && /* @__PURE__ */ s(ir, { children: c })
|
|
550
550
|
]
|
|
551
551
|
}
|
|
552
552
|
)
|
|
@@ -555,18 +555,18 @@ function Yo({
|
|
|
555
555
|
document.body
|
|
556
556
|
) : null;
|
|
557
557
|
}
|
|
558
|
-
|
|
559
|
-
const
|
|
560
|
-
const
|
|
561
|
-
const
|
|
558
|
+
ar.displayName = "Modal";
|
|
559
|
+
const zo = (...o) => o.filter((r, n, e) => !!r && r.trim() !== "" && e.indexOf(r) === n).join(" ").trim();
|
|
560
|
+
const lr = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
561
|
+
const cr = (o) => o.replace(
|
|
562
562
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
563
|
-
(r,
|
|
563
|
+
(r, n, e) => e ? e.toUpperCase() : n.toLowerCase()
|
|
564
564
|
);
|
|
565
|
-
const
|
|
566
|
-
const r =
|
|
565
|
+
const yo = (o) => {
|
|
566
|
+
const r = cr(o);
|
|
567
567
|
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
568
568
|
};
|
|
569
|
-
var
|
|
569
|
+
var io = {
|
|
570
570
|
xmlns: "http://www.w3.org/2000/svg",
|
|
571
571
|
width: 24,
|
|
572
572
|
height: 24,
|
|
@@ -577,69 +577,83 @@ var K = {
|
|
|
577
577
|
strokeLinecap: "round",
|
|
578
578
|
strokeLinejoin: "round"
|
|
579
579
|
};
|
|
580
|
-
const
|
|
580
|
+
const dr = (o) => {
|
|
581
581
|
for (const r in o)
|
|
582
582
|
if (r.startsWith("aria-") || r === "role" || r === "title")
|
|
583
583
|
return !0;
|
|
584
584
|
return !1;
|
|
585
|
-
},
|
|
586
|
-
({ color: o, size: r, strokeWidth:
|
|
585
|
+
}, ur = mo({}), pr = () => ko(ur), fr = So(
|
|
586
|
+
({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth: e, className: c = "", children: a, iconNode: l, ...u }, x) => {
|
|
587
587
|
const {
|
|
588
|
-
size:
|
|
589
|
-
strokeWidth:
|
|
590
|
-
absoluteStrokeWidth:
|
|
591
|
-
color:
|
|
592
|
-
className:
|
|
593
|
-
} =
|
|
594
|
-
return
|
|
588
|
+
size: p = 24,
|
|
589
|
+
strokeWidth: b = 2,
|
|
590
|
+
absoluteStrokeWidth: w = !1,
|
|
591
|
+
color: y = "currentColor",
|
|
592
|
+
className: g = ""
|
|
593
|
+
} = pr() ?? {}, k = e ?? w ? Number(n ?? b) * 24 / Number(r ?? p) : n ?? b;
|
|
594
|
+
return lo(
|
|
595
595
|
"svg",
|
|
596
596
|
{
|
|
597
|
-
ref:
|
|
598
|
-
...
|
|
599
|
-
width: r ??
|
|
600
|
-
height: r ??
|
|
601
|
-
stroke: o ??
|
|
602
|
-
strokeWidth:
|
|
603
|
-
className:
|
|
604
|
-
...!
|
|
605
|
-
...
|
|
597
|
+
ref: x,
|
|
598
|
+
...io,
|
|
599
|
+
width: r ?? p ?? io.width,
|
|
600
|
+
height: r ?? p ?? io.height,
|
|
601
|
+
stroke: o ?? y,
|
|
602
|
+
strokeWidth: k,
|
|
603
|
+
className: zo("lucide", g, c),
|
|
604
|
+
...!a && !dr(u) && { "aria-hidden": "true" },
|
|
605
|
+
...u
|
|
606
606
|
},
|
|
607
607
|
[
|
|
608
|
-
...
|
|
609
|
-
...Array.isArray(
|
|
608
|
+
...l.map(([T, z]) => lo(T, z)),
|
|
609
|
+
...Array.isArray(a) ? a : [a]
|
|
610
610
|
]
|
|
611
611
|
);
|
|
612
612
|
}
|
|
613
613
|
);
|
|
614
|
-
const
|
|
615
|
-
const
|
|
616
|
-
({ className:
|
|
617
|
-
ref:
|
|
614
|
+
const X = (o, r) => {
|
|
615
|
+
const n = So(
|
|
616
|
+
({ className: e, ...c }, a) => lo(fr, {
|
|
617
|
+
ref: a,
|
|
618
618
|
iconNode: r,
|
|
619
|
-
className:
|
|
620
|
-
`lucide-${
|
|
619
|
+
className: zo(
|
|
620
|
+
`lucide-${lr(yo(o))}`,
|
|
621
621
|
`lucide-${o}`,
|
|
622
|
-
|
|
622
|
+
e
|
|
623
623
|
),
|
|
624
|
-
...
|
|
624
|
+
...c
|
|
625
625
|
})
|
|
626
626
|
);
|
|
627
|
-
return
|
|
627
|
+
return n.displayName = yo(o), n;
|
|
628
628
|
};
|
|
629
|
-
const
|
|
630
|
-
|
|
629
|
+
const gr = [
|
|
630
|
+
["path", { d: "M12 5v14", key: "s699le" }],
|
|
631
|
+
["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
|
|
632
|
+
], br = X("arrow-down", gr);
|
|
633
|
+
const $r = [
|
|
634
|
+
["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
|
|
635
|
+
["path", { d: "M17 20V4", key: "1ejh1v" }],
|
|
636
|
+
["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
|
|
637
|
+
["path", { d: "M7 4v16", key: "1glfcx" }]
|
|
638
|
+
], xr = X("arrow-up-down", $r);
|
|
639
|
+
const yr = [
|
|
640
|
+
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
641
|
+
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
642
|
+
], hr = X("arrow-up", yr);
|
|
643
|
+
const wr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], To = X("chevron-down", wr);
|
|
644
|
+
const vr = [
|
|
631
645
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
632
646
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
633
|
-
],
|
|
647
|
+
], Io = X("x", vr), kr = M`
|
|
634
648
|
from { opacity: 0; transform: translateY(12px); }
|
|
635
649
|
to { opacity: 1; transform: translateY(0); }
|
|
636
|
-
`,
|
|
650
|
+
`, mr = M`
|
|
637
651
|
from { opacity: 0; transform: translateY(-12px); }
|
|
638
652
|
to { opacity: 1; transform: translateY(0); }
|
|
639
|
-
`,
|
|
653
|
+
`, Sr = M`
|
|
640
654
|
from { opacity: 1; }
|
|
641
655
|
to { opacity: 0; }
|
|
642
|
-
`,
|
|
656
|
+
`, Cr = i.div`
|
|
643
657
|
position: fixed;
|
|
644
658
|
z-index: ${({ theme: o }) => o.zIndex.toast};
|
|
645
659
|
display: flex;
|
|
@@ -649,85 +663,85 @@ const Go = [
|
|
|
649
663
|
max-width: 400px;
|
|
650
664
|
padding: ${({ theme: o }) => `${o.spacing[3]} ${o.spacing[4]}`};
|
|
651
665
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
652
|
-
animation: ${({ $closing: o, $position: r }) => o ?
|
|
653
|
-
${
|
|
654
|
-
` : r.startsWith("top") ?
|
|
655
|
-
${
|
|
656
|
-
` :
|
|
657
|
-
${
|
|
666
|
+
animation: ${({ $closing: o, $position: r }) => o ? t`
|
|
667
|
+
${Sr} 0.2s ease forwards
|
|
668
|
+
` : r.startsWith("top") ? t`
|
|
669
|
+
${mr} 0.2s ease forwards
|
|
670
|
+
` : t`
|
|
671
|
+
${kr} 0.2s ease forwards
|
|
658
672
|
`};
|
|
659
673
|
|
|
660
674
|
${({ $position: o, theme: r }) => ({
|
|
661
|
-
"bottom-right":
|
|
675
|
+
"bottom-right": t`
|
|
662
676
|
bottom: ${r.spacing[6]};
|
|
663
677
|
right: ${r.spacing[6]};
|
|
664
678
|
`,
|
|
665
|
-
"bottom-left":
|
|
679
|
+
"bottom-left": t`
|
|
666
680
|
bottom: ${r.spacing[6]};
|
|
667
681
|
left: ${r.spacing[6]};
|
|
668
682
|
`,
|
|
669
|
-
"top-right":
|
|
683
|
+
"top-right": t`
|
|
670
684
|
top: ${r.spacing[6]};
|
|
671
685
|
right: ${r.spacing[6]};
|
|
672
686
|
`,
|
|
673
|
-
"top-left":
|
|
687
|
+
"top-left": t`
|
|
674
688
|
top: ${r.spacing[6]};
|
|
675
689
|
left: ${r.spacing[6]};
|
|
676
690
|
`
|
|
677
691
|
})[o]}
|
|
678
|
-
`,
|
|
692
|
+
`, Q = (o, r, n) => t`
|
|
679
693
|
background: ${r};
|
|
680
|
-
border: ${o.brutalism.borderWidth} solid ${
|
|
694
|
+
border: ${o.brutalism.borderWidth} solid ${n};
|
|
681
695
|
box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
|
|
682
|
-
0 ${
|
|
683
|
-
`,
|
|
696
|
+
0 ${n};
|
|
697
|
+
`, zr = i(Cr)`
|
|
684
698
|
${({ $variant: o, theme: r }) => r.brutalism ? {
|
|
685
|
-
success:
|
|
699
|
+
success: Q(
|
|
686
700
|
r,
|
|
687
701
|
r.colors.success[50],
|
|
688
702
|
r.colors.success[500]
|
|
689
703
|
),
|
|
690
|
-
error:
|
|
704
|
+
error: Q(
|
|
691
705
|
r,
|
|
692
706
|
r.colors.error[50],
|
|
693
707
|
r.colors.error[500]
|
|
694
708
|
),
|
|
695
|
-
warning:
|
|
709
|
+
warning: Q(
|
|
696
710
|
r,
|
|
697
711
|
r.colors.warning[50],
|
|
698
712
|
r.colors.warning[500]
|
|
699
713
|
),
|
|
700
|
-
info:
|
|
714
|
+
info: Q(r, r.colors.info[50], r.colors.info[500])
|
|
701
715
|
}[o] : {
|
|
702
|
-
success:
|
|
716
|
+
success: t`
|
|
703
717
|
background: ${r.colors.success[50]};
|
|
704
718
|
border-left: 4px solid ${r.colors.success[500]};
|
|
705
719
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
706
720
|
`,
|
|
707
|
-
error:
|
|
721
|
+
error: t`
|
|
708
722
|
background: ${r.colors.error[50]};
|
|
709
723
|
border-left: 4px solid ${r.colors.error[500]};
|
|
710
724
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
711
725
|
`,
|
|
712
|
-
warning:
|
|
726
|
+
warning: t`
|
|
713
727
|
background: ${r.colors.warning[50]};
|
|
714
728
|
border-left: 4px solid ${r.colors.warning[500]};
|
|
715
729
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
716
730
|
`,
|
|
717
|
-
info:
|
|
731
|
+
info: t`
|
|
718
732
|
background: ${r.colors.info[50]};
|
|
719
733
|
border-left: 4px solid ${r.colors.info[500]};
|
|
720
734
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
|
|
721
735
|
`
|
|
722
736
|
}[o]}
|
|
723
|
-
`,
|
|
737
|
+
`, Tr = i.p`
|
|
724
738
|
flex: 1;
|
|
725
739
|
margin: 0;
|
|
726
740
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
727
741
|
font-weight: ${({ theme: o }) => o.brutalism ? 600 : 400};
|
|
728
742
|
line-height: 1.5;
|
|
729
743
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
730
|
-
`,
|
|
744
|
+
`, Ir = i.button`
|
|
731
745
|
flex-shrink: 0;
|
|
732
746
|
display: inline-flex;
|
|
733
747
|
align-items: center;
|
|
@@ -750,121 +764,124 @@ const Go = [
|
|
|
750
764
|
outline-offset: 2px;
|
|
751
765
|
}
|
|
752
766
|
`;
|
|
753
|
-
function
|
|
767
|
+
function Eo({
|
|
754
768
|
open: o,
|
|
755
769
|
onClose: r,
|
|
756
|
-
message:
|
|
757
|
-
variant:
|
|
758
|
-
duration:
|
|
759
|
-
position:
|
|
770
|
+
message: n,
|
|
771
|
+
variant: e = "info",
|
|
772
|
+
duration: c = 4e3,
|
|
773
|
+
position: a = "bottom-right"
|
|
760
774
|
}) {
|
|
761
|
-
const [
|
|
762
|
-
return
|
|
775
|
+
const [l, u] = D(o), [x, p] = D(!1);
|
|
776
|
+
return K(() => {
|
|
763
777
|
if (o)
|
|
764
|
-
|
|
765
|
-
else if (
|
|
766
|
-
|
|
767
|
-
const
|
|
768
|
-
|
|
778
|
+
u(!0), p(!1);
|
|
779
|
+
else if (l) {
|
|
780
|
+
p(!0);
|
|
781
|
+
const b = setTimeout(() => {
|
|
782
|
+
u(!1), p(!1);
|
|
769
783
|
}, 200);
|
|
770
|
-
return () =>
|
|
784
|
+
return () => {
|
|
785
|
+
clearTimeout(b);
|
|
786
|
+
};
|
|
771
787
|
}
|
|
772
|
-
}, [o,
|
|
773
|
-
if (!o ||
|
|
788
|
+
}, [o, l]), K(() => {
|
|
789
|
+
if (!o || c === 0)
|
|
774
790
|
return;
|
|
775
|
-
const
|
|
776
|
-
return () =>
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
791
|
+
const b = setTimeout(r, c);
|
|
792
|
+
return () => {
|
|
793
|
+
clearTimeout(b);
|
|
794
|
+
};
|
|
795
|
+
}, [o, c, r]), l ? Co(
|
|
796
|
+
/* @__PURE__ */ C(
|
|
797
|
+
zr,
|
|
780
798
|
{
|
|
781
|
-
$position:
|
|
782
|
-
$variant:
|
|
783
|
-
$closing:
|
|
799
|
+
$position: a,
|
|
800
|
+
$variant: e,
|
|
801
|
+
$closing: x,
|
|
784
802
|
role: "alert",
|
|
785
803
|
"aria-live": "polite",
|
|
786
804
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ s(Tr, { children: n }),
|
|
806
|
+
/* @__PURE__ */ s(Ir, { onClick: r, "aria-label": "Close notification", children: /* @__PURE__ */ s(Io, { size: 14, strokeWidth: 2.5 }) })
|
|
789
807
|
]
|
|
790
808
|
}
|
|
791
809
|
),
|
|
792
810
|
document.body
|
|
793
811
|
) : null;
|
|
794
812
|
}
|
|
795
|
-
|
|
796
|
-
const
|
|
813
|
+
Eo.displayName = "Toast";
|
|
814
|
+
const Er = i.form`
|
|
797
815
|
display: flex;
|
|
798
816
|
flex-direction: column;
|
|
799
817
|
gap: ${({ theme: o }) => o.spacing[4]};
|
|
800
|
-
`,
|
|
818
|
+
`, Wr = i.div`
|
|
801
819
|
display: flex;
|
|
802
820
|
flex-direction: column;
|
|
803
821
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
804
|
-
`,
|
|
822
|
+
`, Or = i.label`
|
|
805
823
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
806
824
|
font-weight: 500;
|
|
807
825
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
808
|
-
`,
|
|
826
|
+
`, Pr = i.span`
|
|
809
827
|
color: ${({ theme: o }) => o.colors.error[500]};
|
|
810
828
|
margin-left: 2px;
|
|
811
|
-
|
|
812
|
-
`, cr = t.span`
|
|
829
|
+
`, Br = i.span`
|
|
813
830
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
814
831
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
815
832
|
`;
|
|
816
|
-
function
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
|
|
833
|
+
function Dr({ onSubmit: o, children: r, ...n }) {
|
|
834
|
+
return /* @__PURE__ */ s(
|
|
835
|
+
Er,
|
|
819
836
|
{
|
|
820
|
-
onSubmit: (
|
|
821
|
-
|
|
837
|
+
onSubmit: (e) => {
|
|
838
|
+
e.preventDefault(), o?.(e);
|
|
822
839
|
},
|
|
823
840
|
noValidate: !0,
|
|
824
|
-
...
|
|
841
|
+
...n,
|
|
825
842
|
children: r
|
|
826
843
|
}
|
|
827
844
|
);
|
|
828
845
|
}
|
|
829
|
-
|
|
830
|
-
function
|
|
846
|
+
Dr.displayName = "Form";
|
|
847
|
+
function Nr({
|
|
831
848
|
label: o,
|
|
832
849
|
error: r,
|
|
833
|
-
helperText:
|
|
834
|
-
required:
|
|
835
|
-
children:
|
|
850
|
+
helperText: n,
|
|
851
|
+
required: e,
|
|
852
|
+
children: c
|
|
836
853
|
}) {
|
|
837
|
-
const
|
|
838
|
-
|
|
854
|
+
const a = G(), l = `${a}-hint`, u = !!(r || n), x = typeof r == "string" ? r : void 0, p = bo.isValidElement(c) ? bo.cloneElement(
|
|
855
|
+
c,
|
|
839
856
|
{
|
|
840
|
-
id:
|
|
841
|
-
...
|
|
857
|
+
id: a,
|
|
858
|
+
...u && { "aria-describedby": l },
|
|
842
859
|
...r && { "aria-invalid": !0 }
|
|
843
860
|
}
|
|
844
|
-
) :
|
|
845
|
-
return /* @__PURE__ */
|
|
846
|
-
o && /* @__PURE__ */
|
|
861
|
+
) : c;
|
|
862
|
+
return /* @__PURE__ */ C(Wr, { children: [
|
|
863
|
+
o && /* @__PURE__ */ C(Or, { htmlFor: a, children: [
|
|
847
864
|
o,
|
|
848
|
-
|
|
865
|
+
e && /* @__PURE__ */ s(Pr, { "aria-hidden": "true", children: " *" })
|
|
849
866
|
] }),
|
|
850
|
-
|
|
851
|
-
|
|
867
|
+
p,
|
|
868
|
+
u && /* @__PURE__ */ s(Br, { id: l, $error: !!r, children: x ?? n })
|
|
852
869
|
] });
|
|
853
870
|
}
|
|
854
|
-
|
|
855
|
-
const
|
|
871
|
+
Nr.displayName = "FormField";
|
|
872
|
+
const Lr = i.div`
|
|
856
873
|
display: inline-flex;
|
|
857
874
|
flex-direction: column;
|
|
858
875
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
859
876
|
width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
|
|
860
|
-
`,
|
|
877
|
+
`, Ar = i.div`
|
|
861
878
|
position: relative;
|
|
862
879
|
display: flex;
|
|
863
880
|
width: 100%;
|
|
864
|
-
`,
|
|
881
|
+
`, jr = i.span`
|
|
865
882
|
font-size: ${({ theme: o }) => o.fontSizes.xs};
|
|
866
883
|
color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
|
|
867
|
-
`,
|
|
884
|
+
`, Rr = i.select`
|
|
868
885
|
appearance: none;
|
|
869
886
|
width: 100%;
|
|
870
887
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
@@ -876,15 +893,15 @@ const pr = t.div`
|
|
|
876
893
|
box-shadow 0.2s;
|
|
877
894
|
|
|
878
895
|
${({ $size: o, theme: r }) => ({
|
|
879
|
-
sm:
|
|
896
|
+
sm: t`
|
|
880
897
|
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
881
898
|
font-size: ${r.fontSizes.sm};
|
|
882
899
|
`,
|
|
883
|
-
md:
|
|
900
|
+
md: t`
|
|
884
901
|
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
885
902
|
font-size: ${r.fontSizes.md};
|
|
886
903
|
`,
|
|
887
|
-
lg:
|
|
904
|
+
lg: t`
|
|
888
905
|
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
889
906
|
font-size: ${r.fontSizes.lg};
|
|
890
907
|
`
|
|
@@ -892,27 +909,27 @@ const pr = t.div`
|
|
|
892
909
|
|
|
893
910
|
padding-right: 2.5rem;
|
|
894
911
|
|
|
895
|
-
${({ $variant: o, theme: r }) => r.brutalism ?
|
|
912
|
+
${({ $variant: o, theme: r }) => r.brutalism ? t`
|
|
896
913
|
border: ${r.brutalism.borderWidth} solid
|
|
897
914
|
${r.colors.neutral[900]};
|
|
898
915
|
background-color: ${r.colors.neutral[0]};
|
|
899
916
|
box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
|
|
900
917
|
` : {
|
|
901
|
-
default:
|
|
918
|
+
default: t`
|
|
902
919
|
border: 1px solid ${r.colors.neutral[400]};
|
|
903
920
|
background-color: ${r.colors.neutral[0]};
|
|
904
921
|
`,
|
|
905
|
-
outlined:
|
|
922
|
+
outlined: t`
|
|
906
923
|
border: 2px solid ${r.colors.primary[500]};
|
|
907
924
|
background-color: ${r.colors.neutral[0]};
|
|
908
925
|
`,
|
|
909
|
-
filled:
|
|
926
|
+
filled: t`
|
|
910
927
|
border: 1px solid transparent;
|
|
911
928
|
background-color: ${r.colors.neutral[100]};
|
|
912
929
|
`
|
|
913
930
|
}[o]}
|
|
914
931
|
|
|
915
|
-
${({ $error: o, theme: r }) => o &&
|
|
932
|
+
${({ $error: o, theme: r }) => o && t`
|
|
916
933
|
border-color: ${r.colors.error[500]};
|
|
917
934
|
`}
|
|
918
935
|
|
|
@@ -925,7 +942,7 @@ const pr = t.div`
|
|
|
925
942
|
cursor: not-allowed;
|
|
926
943
|
opacity: 0.6;
|
|
927
944
|
}
|
|
928
|
-
`,
|
|
945
|
+
`, _r = i.button`
|
|
929
946
|
position: absolute;
|
|
930
947
|
right: ${({ theme: o }) => o.spacing[3]};
|
|
931
948
|
top: 50%;
|
|
@@ -947,7 +964,7 @@ const pr = t.div`
|
|
|
947
964
|
outline-offset: 2px;
|
|
948
965
|
border-radius: 2px;
|
|
949
966
|
}
|
|
950
|
-
`,
|
|
967
|
+
`, Mr = i.span`
|
|
951
968
|
position: absolute;
|
|
952
969
|
right: ${({ theme: o }) => o.spacing[3]};
|
|
953
970
|
top: 50%;
|
|
@@ -957,63 +974,63 @@ const pr = t.div`
|
|
|
957
974
|
align-items: center;
|
|
958
975
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
959
976
|
`;
|
|
960
|
-
function
|
|
977
|
+
function Vr({
|
|
961
978
|
options: o,
|
|
962
979
|
placeholder: r,
|
|
963
|
-
size:
|
|
964
|
-
variant:
|
|
965
|
-
error:
|
|
966
|
-
fullWidth:
|
|
967
|
-
clearable:
|
|
968
|
-
onClear:
|
|
969
|
-
id:
|
|
970
|
-
value:
|
|
971
|
-
defaultValue:
|
|
972
|
-
onChange:
|
|
973
|
-
...
|
|
980
|
+
size: n = "md",
|
|
981
|
+
variant: e = "default",
|
|
982
|
+
error: c,
|
|
983
|
+
fullWidth: a,
|
|
984
|
+
clearable: l,
|
|
985
|
+
onClear: u,
|
|
986
|
+
id: x,
|
|
987
|
+
value: p,
|
|
988
|
+
defaultValue: b,
|
|
989
|
+
onChange: w,
|
|
990
|
+
...y
|
|
974
991
|
}) {
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
-
),
|
|
978
|
-
|
|
979
|
-
},
|
|
980
|
-
|
|
981
|
-
},
|
|
982
|
-
return /* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
|
|
992
|
+
const g = G(), k = x ?? g, T = `${k}-hint`, z = typeof c == "string" ? c : void 0, [v, I] = D(
|
|
993
|
+
b ?? ""
|
|
994
|
+
), P = p !== void 0, B = P ? p : v, h = (O) => {
|
|
995
|
+
P || I(O.target.value), w?.(O);
|
|
996
|
+
}, $ = () => {
|
|
997
|
+
P || I(""), u?.();
|
|
998
|
+
}, m = l && !!B;
|
|
999
|
+
return /* @__PURE__ */ C(Lr, { $fullWidth: a, children: [
|
|
1000
|
+
/* @__PURE__ */ C(Ar, { children: [
|
|
1001
|
+
/* @__PURE__ */ C(
|
|
1002
|
+
Rr,
|
|
986
1003
|
{
|
|
987
|
-
id:
|
|
988
|
-
$size:
|
|
989
|
-
$variant:
|
|
990
|
-
$error: !!
|
|
991
|
-
"aria-invalid": !!
|
|
992
|
-
"aria-describedby": z ?
|
|
993
|
-
value:
|
|
994
|
-
onChange:
|
|
995
|
-
...
|
|
1004
|
+
id: k,
|
|
1005
|
+
$size: n,
|
|
1006
|
+
$variant: e,
|
|
1007
|
+
$error: !!c,
|
|
1008
|
+
"aria-invalid": !!c,
|
|
1009
|
+
"aria-describedby": z ? T : void 0,
|
|
1010
|
+
value: B,
|
|
1011
|
+
onChange: h,
|
|
1012
|
+
...y,
|
|
996
1013
|
children: [
|
|
997
|
-
r && /* @__PURE__ */
|
|
998
|
-
o.map((
|
|
1014
|
+
r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
|
|
1015
|
+
o.map((O) => /* @__PURE__ */ s("option", { value: O.value, disabled: O.disabled, children: O.label }, O.value))
|
|
999
1016
|
]
|
|
1000
1017
|
}
|
|
1001
1018
|
),
|
|
1002
|
-
|
|
1003
|
-
|
|
1019
|
+
m ? /* @__PURE__ */ s(
|
|
1020
|
+
_r,
|
|
1004
1021
|
{
|
|
1005
1022
|
type: "button",
|
|
1006
|
-
onClick:
|
|
1023
|
+
onClick: $,
|
|
1007
1024
|
"aria-label": "Clear selection",
|
|
1008
|
-
children: /* @__PURE__ */
|
|
1025
|
+
children: /* @__PURE__ */ s(Io, { size: 14 })
|
|
1009
1026
|
}
|
|
1010
|
-
) : /* @__PURE__ */
|
|
1027
|
+
) : /* @__PURE__ */ s(Mr, { "aria-hidden": "true", children: /* @__PURE__ */ s(To, { size: 14 }) })
|
|
1011
1028
|
] }),
|
|
1012
|
-
z && /* @__PURE__ */
|
|
1029
|
+
z && /* @__PURE__ */ s(jr, { id: T, $error: !0, children: z })
|
|
1013
1030
|
] });
|
|
1014
1031
|
}
|
|
1015
|
-
|
|
1016
|
-
const
|
|
1032
|
+
Vr.displayName = "Select";
|
|
1033
|
+
const Fr = i.a`
|
|
1017
1034
|
text-decoration: underline;
|
|
1018
1035
|
text-underline-offset: 2px;
|
|
1019
1036
|
transition: color 0.15s;
|
|
@@ -1025,13 +1042,13 @@ const wr = t.a`
|
|
|
1025
1042
|
}
|
|
1026
1043
|
|
|
1027
1044
|
${({ $variant: o, theme: r }) => ({
|
|
1028
|
-
default:
|
|
1045
|
+
default: t`
|
|
1029
1046
|
color: ${r.colors.primary[500]};
|
|
1030
1047
|
&:hover {
|
|
1031
1048
|
color: ${r.colors.primary[700]};
|
|
1032
1049
|
}
|
|
1033
1050
|
`,
|
|
1034
|
-
subtle:
|
|
1051
|
+
subtle: t`
|
|
1035
1052
|
color: ${r.colors.neutral[500]};
|
|
1036
1053
|
&:hover {
|
|
1037
1054
|
color: ${r.colors.neutral[900]};
|
|
@@ -1039,39 +1056,39 @@ const wr = t.a`
|
|
|
1039
1056
|
`
|
|
1040
1057
|
})[o]}
|
|
1041
1058
|
`;
|
|
1042
|
-
function
|
|
1059
|
+
function Kr({
|
|
1043
1060
|
variant: o = "default",
|
|
1044
1061
|
external: r,
|
|
1045
|
-
children:
|
|
1046
|
-
...
|
|
1062
|
+
children: n,
|
|
1063
|
+
...e
|
|
1047
1064
|
}) {
|
|
1048
|
-
return /* @__PURE__ */
|
|
1049
|
-
|
|
1065
|
+
return /* @__PURE__ */ s(
|
|
1066
|
+
Fr,
|
|
1050
1067
|
{
|
|
1051
1068
|
$variant: o,
|
|
1052
1069
|
...r && { target: "_blank", rel: "noreferrer" },
|
|
1053
|
-
...
|
|
1054
|
-
children:
|
|
1070
|
+
...e,
|
|
1071
|
+
children: n
|
|
1055
1072
|
}
|
|
1056
1073
|
);
|
|
1057
1074
|
}
|
|
1058
|
-
|
|
1059
|
-
const
|
|
1075
|
+
Kr.displayName = "Link";
|
|
1076
|
+
const Hr = i.div`
|
|
1060
1077
|
border-radius: ${({ theme: o }) => o.radius.md};
|
|
1061
1078
|
background: ${({ theme: o }) => o.colors.neutral[0]};
|
|
1062
1079
|
overflow: hidden;
|
|
1063
1080
|
|
|
1064
|
-
${({ theme: o, $accentColor: r }) => o.brutalism ?
|
|
1081
|
+
${({ theme: o, $accentColor: r }) => o.brutalism ? t`
|
|
1065
1082
|
border: ${o.brutalism.borderWidth} solid
|
|
1066
1083
|
${r ?? o.colors.neutral[900]};
|
|
1067
1084
|
box-shadow: ${o.brutalism.shadowOffset}
|
|
1068
1085
|
${o.brutalism.shadowOffset} 0
|
|
1069
1086
|
${r ?? o.colors.neutral[900]};
|
|
1070
|
-
` :
|
|
1087
|
+
` : t`
|
|
1071
1088
|
border: 1px solid ${r ?? o.colors.neutral[200]};
|
|
1072
1089
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
1073
1090
|
`}
|
|
1074
|
-
`,
|
|
1091
|
+
`, Yr = i.button`
|
|
1075
1092
|
width: 100%;
|
|
1076
1093
|
display: flex;
|
|
1077
1094
|
align-items: flex-start;
|
|
@@ -1091,19 +1108,19 @@ const mr = t.div`
|
|
|
1091
1108
|
${({ theme: o, $accentColor: r }) => r ?? o.colors.primary[500]};
|
|
1092
1109
|
outline-offset: -2px;
|
|
1093
1110
|
}
|
|
1094
|
-
`,
|
|
1111
|
+
`, Ur = i.div`
|
|
1095
1112
|
flex: 1;
|
|
1096
1113
|
min-width: 0;
|
|
1097
|
-
`,
|
|
1114
|
+
`, qr = i.span`
|
|
1098
1115
|
display: block;
|
|
1099
1116
|
font-size: ${({ theme: o }) => o.fontSizes.md};
|
|
1100
1117
|
font-weight: 600;
|
|
1101
1118
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
1102
|
-
`,
|
|
1119
|
+
`, Gr = i.span`
|
|
1103
1120
|
display: block;
|
|
1104
1121
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1105
1122
|
color: ${({ theme: o }) => o.colors.neutral[500]};
|
|
1106
|
-
`,
|
|
1123
|
+
`, Xr = i.div`
|
|
1107
1124
|
display: flex;
|
|
1108
1125
|
flex-direction: row;
|
|
1109
1126
|
align-items: center;
|
|
@@ -1115,11 +1132,11 @@ const mr = t.div`
|
|
|
1115
1132
|
align-items: flex-start;
|
|
1116
1133
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1117
1134
|
}
|
|
1118
|
-
`,
|
|
1135
|
+
`, Zr = i.div`
|
|
1119
1136
|
display: flex;
|
|
1120
1137
|
align-items: center;
|
|
1121
1138
|
gap: ${({ theme: o }) => o.spacing[2]};
|
|
1122
|
-
`,
|
|
1139
|
+
`, Jr = i.span`
|
|
1123
1140
|
display: inline-flex;
|
|
1124
1141
|
align-items: center;
|
|
1125
1142
|
justify-content: center;
|
|
@@ -1127,79 +1144,81 @@ const mr = t.div`
|
|
|
1127
1144
|
transition: transform 0.2s ease;
|
|
1128
1145
|
transform: ${({ $open: o }) => o ? "rotate(180deg)" : "rotate(0deg)"};
|
|
1129
1146
|
color: ${({ theme: o, $accentColor: r }) => r ?? o.colors.neutral[500]};
|
|
1130
|
-
`,
|
|
1147
|
+
`, Qr = i.div`
|
|
1131
1148
|
display: grid;
|
|
1132
1149
|
grid-template-rows: ${({ $open: o }) => o ? "1fr" : "0fr"};
|
|
1133
1150
|
transition: grid-template-rows 0.2s ease;
|
|
1134
|
-
`,
|
|
1151
|
+
`, on = i.div`
|
|
1135
1152
|
overflow: hidden;
|
|
1136
|
-
`,
|
|
1153
|
+
`, rn = i.div`
|
|
1137
1154
|
padding: ${({ theme: o }) => o.spacing[4]};
|
|
1138
1155
|
border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
|
|
1139
1156
|
`;
|
|
1140
|
-
function
|
|
1157
|
+
function nn({
|
|
1141
1158
|
title: o,
|
|
1142
1159
|
children: r,
|
|
1143
|
-
defaultOpen:
|
|
1144
|
-
open:
|
|
1145
|
-
onToggle:
|
|
1146
|
-
subtitle:
|
|
1147
|
-
headerActions:
|
|
1148
|
-
accentColor:
|
|
1160
|
+
defaultOpen: n = !1,
|
|
1161
|
+
open: e,
|
|
1162
|
+
onToggle: c,
|
|
1163
|
+
subtitle: a,
|
|
1164
|
+
headerActions: l,
|
|
1165
|
+
accentColor: u
|
|
1149
1166
|
}) {
|
|
1150
|
-
const [
|
|
1151
|
-
return /* @__PURE__ */
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
|
|
1167
|
+
const [x, p] = D(n), b = G(), w = e !== void 0, y = w ? e : x;
|
|
1168
|
+
return /* @__PURE__ */ C(Hr, { $accentColor: u, children: [
|
|
1169
|
+
/* @__PURE__ */ C(
|
|
1170
|
+
Yr,
|
|
1154
1171
|
{
|
|
1155
1172
|
type: "button",
|
|
1156
|
-
$open:
|
|
1157
|
-
$accentColor:
|
|
1158
|
-
"aria-expanded":
|
|
1159
|
-
"aria-controls":
|
|
1173
|
+
$open: y,
|
|
1174
|
+
$accentColor: u,
|
|
1175
|
+
"aria-expanded": y,
|
|
1176
|
+
"aria-controls": b,
|
|
1160
1177
|
onClick: () => {
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1178
|
+
const k = !y;
|
|
1179
|
+
w || p(k), c?.(k);
|
|
1163
1180
|
},
|
|
1164
1181
|
children: [
|
|
1165
|
-
/* @__PURE__ */
|
|
1166
|
-
/* @__PURE__ */
|
|
1167
|
-
(
|
|
1168
|
-
|
|
1169
|
-
|
|
1182
|
+
/* @__PURE__ */ C(Ur, { children: [
|
|
1183
|
+
/* @__PURE__ */ s(qr, { children: o }),
|
|
1184
|
+
(a || l) && /* @__PURE__ */ C(Xr, { children: [
|
|
1185
|
+
a && /* @__PURE__ */ s(Gr, { children: a }),
|
|
1186
|
+
l && /* @__PURE__ */ s(Zr, { onClick: (k) => k.stopPropagation(), children: l })
|
|
1170
1187
|
] })
|
|
1171
1188
|
] }),
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
|
|
1189
|
+
/* @__PURE__ */ s(
|
|
1190
|
+
Jr,
|
|
1174
1191
|
{
|
|
1175
|
-
$open:
|
|
1176
|
-
$accentColor:
|
|
1192
|
+
$open: y,
|
|
1193
|
+
$accentColor: u,
|
|
1177
1194
|
"aria-hidden": "true",
|
|
1178
|
-
children: /* @__PURE__ */
|
|
1195
|
+
children: /* @__PURE__ */ s(To, { size: 18, strokeWidth: 2.5 })
|
|
1179
1196
|
}
|
|
1180
1197
|
)
|
|
1181
1198
|
]
|
|
1182
1199
|
}
|
|
1183
1200
|
),
|
|
1184
|
-
/* @__PURE__ */
|
|
1201
|
+
/* @__PURE__ */ s(Qr, { $open: y, children: /* @__PURE__ */ s(on, { id: b, role: "region", "aria-label": o, children: /* @__PURE__ */ s(rn, { children: r }) }) })
|
|
1185
1202
|
] });
|
|
1186
1203
|
}
|
|
1187
|
-
|
|
1188
|
-
const
|
|
1189
|
-
function
|
|
1190
|
-
const [r,
|
|
1191
|
-
|
|
1192
|
-
}, []),
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1204
|
+
nn.displayName = "CollapsibleCard";
|
|
1205
|
+
const Wo = mo(null);
|
|
1206
|
+
function An({ children: o }) {
|
|
1207
|
+
const [r, n] = D(null), e = R((a) => {
|
|
1208
|
+
n({ ...a, id: Date.now() });
|
|
1209
|
+
}, []), c = uo(() => Object.assign((a) => e(a), {
|
|
1210
|
+
success: (a, l) => e({ ...l, message: a, variant: "success" }),
|
|
1211
|
+
error: (a, l) => e({ ...l, message: a, variant: "error" }),
|
|
1212
|
+
warning: (a, l) => e({ ...l, message: a, variant: "warning" }),
|
|
1213
|
+
info: (a, l) => e({ ...l, message: a, variant: "info" })
|
|
1214
|
+
}), [e]);
|
|
1215
|
+
return /* @__PURE__ */ C(Wo.Provider, { value: { toast: c }, children: [
|
|
1197
1216
|
o,
|
|
1198
|
-
r && /* @__PURE__ */
|
|
1199
|
-
|
|
1217
|
+
r && /* @__PURE__ */ s(
|
|
1218
|
+
Eo,
|
|
1200
1219
|
{
|
|
1201
1220
|
open: !0,
|
|
1202
|
-
onClose: () =>
|
|
1221
|
+
onClose: () => n(null),
|
|
1203
1222
|
message: r.message,
|
|
1204
1223
|
variant: r.variant,
|
|
1205
1224
|
duration: r.duration,
|
|
@@ -1209,102 +1228,156 @@ function Gr({ children: o }) {
|
|
|
1209
1228
|
)
|
|
1210
1229
|
] });
|
|
1211
1230
|
}
|
|
1212
|
-
function
|
|
1213
|
-
const o =
|
|
1231
|
+
function jn() {
|
|
1232
|
+
const o = ko(Wo);
|
|
1214
1233
|
if (!o)
|
|
1215
1234
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1216
1235
|
return o;
|
|
1217
1236
|
}
|
|
1218
|
-
function
|
|
1237
|
+
function Rn({
|
|
1219
1238
|
initialValues: o,
|
|
1220
1239
|
validate: r,
|
|
1221
|
-
onSubmit:
|
|
1222
|
-
onError:
|
|
1240
|
+
onSubmit: n,
|
|
1241
|
+
onError: e
|
|
1223
1242
|
}) {
|
|
1224
|
-
const [
|
|
1243
|
+
const [c, a] = D(o), [l, u] = D(
|
|
1225
1244
|
{}
|
|
1226
|
-
), [
|
|
1227
|
-
|
|
1228
|
-
const
|
|
1229
|
-
(
|
|
1245
|
+
), [x, p] = D({}), [b, w] = D(!1), y = oo(c);
|
|
1246
|
+
y.current = c;
|
|
1247
|
+
const g = R(
|
|
1248
|
+
(h) => {
|
|
1230
1249
|
if (!r)
|
|
1231
1250
|
return {};
|
|
1232
|
-
const
|
|
1251
|
+
const $ = r(h);
|
|
1233
1252
|
return Object.fromEntries(
|
|
1234
|
-
Object.entries(
|
|
1253
|
+
Object.entries($).filter(([, m]) => m !== void 0)
|
|
1235
1254
|
);
|
|
1236
1255
|
},
|
|
1237
1256
|
[r]
|
|
1238
|
-
),
|
|
1239
|
-
|
|
1240
|
-
const
|
|
1241
|
-
(
|
|
1242
|
-
const { name:
|
|
1243
|
-
|
|
1257
|
+
), k = oo(x);
|
|
1258
|
+
k.current = x;
|
|
1259
|
+
const T = R(
|
|
1260
|
+
(h) => {
|
|
1261
|
+
const { name: $, value: m } = h.target, O = { ...y.current, [$]: m };
|
|
1262
|
+
a(O), k.current[$] && u(g(O));
|
|
1244
1263
|
},
|
|
1245
|
-
[
|
|
1246
|
-
), z =
|
|
1247
|
-
(
|
|
1248
|
-
const { name:
|
|
1249
|
-
|
|
1264
|
+
[g]
|
|
1265
|
+
), z = R(
|
|
1266
|
+
(h) => {
|
|
1267
|
+
const { name: $ } = h.target;
|
|
1268
|
+
p((m) => ({ ...m, [$]: !0 })), u(g(y.current));
|
|
1250
1269
|
},
|
|
1251
|
-
[
|
|
1252
|
-
),
|
|
1253
|
-
(
|
|
1254
|
-
|
|
1255
|
-
const
|
|
1256
|
-
(
|
|
1270
|
+
[g]
|
|
1271
|
+
), v = R(
|
|
1272
|
+
(h) => {
|
|
1273
|
+
h?.preventDefault();
|
|
1274
|
+
const $ = Object.keys(y.current).reduce(
|
|
1275
|
+
(j, _) => ({ ...j, [_]: !0 }),
|
|
1257
1276
|
{}
|
|
1258
1277
|
);
|
|
1259
|
-
|
|
1260
|
-
const
|
|
1261
|
-
if (
|
|
1262
|
-
|
|
1278
|
+
p($);
|
|
1279
|
+
const m = g(y.current);
|
|
1280
|
+
if (u(m), Object.keys(m).length > 0) {
|
|
1281
|
+
e?.(m);
|
|
1263
1282
|
return;
|
|
1264
1283
|
}
|
|
1265
1284
|
(async () => {
|
|
1266
|
-
|
|
1285
|
+
w(!0);
|
|
1267
1286
|
try {
|
|
1268
|
-
await
|
|
1287
|
+
await n?.(y.current);
|
|
1269
1288
|
} finally {
|
|
1270
|
-
|
|
1289
|
+
w(!1);
|
|
1271
1290
|
}
|
|
1272
1291
|
})();
|
|
1273
1292
|
},
|
|
1274
|
-
[
|
|
1275
|
-
),
|
|
1276
|
-
|
|
1277
|
-
}, []),
|
|
1278
|
-
|
|
1279
|
-
}, [o]),
|
|
1280
|
-
Object.entries(
|
|
1293
|
+
[g, n, e]
|
|
1294
|
+
), I = R((h, $) => {
|
|
1295
|
+
a((m) => ({ ...m, [h]: $ }));
|
|
1296
|
+
}, []), P = R(() => {
|
|
1297
|
+
a(o), u({}), p({}), w(!1);
|
|
1298
|
+
}, [o]), B = Object.fromEntries(
|
|
1299
|
+
Object.entries(l).filter(([h]) => x[h])
|
|
1281
1300
|
);
|
|
1282
1301
|
return {
|
|
1283
|
-
values:
|
|
1284
|
-
errors:
|
|
1285
|
-
touched:
|
|
1286
|
-
handleChange:
|
|
1302
|
+
values: c,
|
|
1303
|
+
errors: B,
|
|
1304
|
+
touched: x,
|
|
1305
|
+
handleChange: T,
|
|
1287
1306
|
handleBlur: z,
|
|
1288
|
-
handleSubmit:
|
|
1289
|
-
setFieldValue:
|
|
1290
|
-
reset:
|
|
1291
|
-
isSubmitting:
|
|
1307
|
+
handleSubmit: v,
|
|
1308
|
+
setFieldValue: I,
|
|
1309
|
+
reset: P,
|
|
1310
|
+
isSubmitting: b
|
|
1292
1311
|
};
|
|
1293
1312
|
}
|
|
1294
|
-
|
|
1295
|
-
|
|
1313
|
+
function tn(o, r) {
|
|
1314
|
+
return o?.key !== r ? { key: r, direction: "asc" } : o.direction === "asc" ? { key: r, direction: "desc" } : null;
|
|
1315
|
+
}
|
|
1316
|
+
function sn({
|
|
1317
|
+
data: o,
|
|
1318
|
+
sort: r,
|
|
1319
|
+
defaultSort: n,
|
|
1320
|
+
onSortChange: e
|
|
1321
|
+
}) {
|
|
1322
|
+
const c = r !== void 0, [a, l] = D(
|
|
1323
|
+
n ?? null
|
|
1324
|
+
), u = c ? r ?? null : a, x = (b) => {
|
|
1325
|
+
const w = tn(u, b);
|
|
1326
|
+
return c || l(w), e?.(w), w;
|
|
1327
|
+
}, p = uo(() => c || !u ? o : [...o].sort((b, w) => {
|
|
1328
|
+
const y = b[u.key], g = w[u.key], k = y < g ? -1 : y > g ? 1 : 0;
|
|
1329
|
+
return u.direction === "asc" ? k : -k;
|
|
1330
|
+
}), [o, u, c]);
|
|
1331
|
+
return { activeSort: u, sortedData: p, handleSort: x };
|
|
1332
|
+
}
|
|
1333
|
+
const en = 7, ho = 3, wo = 1;
|
|
1334
|
+
function an(o, r) {
|
|
1335
|
+
if (r <= en)
|
|
1336
|
+
return Array.from({ length: r }, (e, c) => c + 1);
|
|
1337
|
+
const n = [1];
|
|
1338
|
+
o > ho && n.push("...");
|
|
1339
|
+
for (let e = Math.max(2, o - wo); e <= Math.min(r - 1, o + wo); e++)
|
|
1340
|
+
n.push(e);
|
|
1341
|
+
return o < r - ho + 1 && n.push("..."), n.push(r), n;
|
|
1342
|
+
}
|
|
1343
|
+
function ln({
|
|
1344
|
+
data: o,
|
|
1345
|
+
pageSize: r,
|
|
1346
|
+
page: n,
|
|
1347
|
+
defaultPage: e,
|
|
1348
|
+
totalRows: c,
|
|
1349
|
+
onPageChange: a
|
|
1350
|
+
}) {
|
|
1351
|
+
const l = n !== void 0, [u, x] = D(e ?? 1), p = l ? n : u, b = (T) => {
|
|
1352
|
+
l || x(T), a?.(T);
|
|
1353
|
+
}, w = l || c !== void 0, y = c ?? o.length, g = r ? Math.max(1, Math.ceil(y / r)) : 1, k = uo(() => {
|
|
1354
|
+
if (!r || w)
|
|
1355
|
+
return o;
|
|
1356
|
+
const T = (p - 1) * r;
|
|
1357
|
+
return o.slice(T, T + r);
|
|
1358
|
+
}, [o, r, p, w]);
|
|
1359
|
+
return { activePage: p, totalPages: g, displayData: k, handlePageChange: b };
|
|
1360
|
+
}
|
|
1361
|
+
const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg" ? `${r.spacing[3]} ${r.spacing[4]}` : `${r.spacing[2]} ${r.spacing[3]}`, Po = i.div`
|
|
1296
1362
|
width: 100%;
|
|
1297
1363
|
|
|
1298
|
-
${({ theme: o }) => o.brutalism ?
|
|
1299
|
-
border: ${o.brutalism.borderWidth} solid
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1364
|
+
${({ theme: o, $borderColor: r }) => o.brutalism ? t`
|
|
1365
|
+
border: ${o.brutalism.borderWidth} solid
|
|
1366
|
+
${r ?? o.colors.neutral[900]};
|
|
1367
|
+
box-shadow: ${o.brutalism.shadowOffset}
|
|
1368
|
+
${o.brutalism.shadowOffset} 0
|
|
1369
|
+
${r ?? o.colors.neutral[900]};
|
|
1370
|
+
` : t`
|
|
1371
|
+
border: 1px solid ${r ?? o.colors.neutral[300]};
|
|
1304
1372
|
border-radius: ${o.radius.md};
|
|
1305
1373
|
overflow: hidden;
|
|
1306
1374
|
`}
|
|
1307
|
-
|
|
1375
|
+
|
|
1376
|
+
overflow-x: auto;
|
|
1377
|
+
${({ $stickyHeader: o }) => o && t`
|
|
1378
|
+
overflow-y: auto;
|
|
1379
|
+
`}
|
|
1380
|
+
`, Bo = i.table`
|
|
1308
1381
|
width: 100%;
|
|
1309
1382
|
border-collapse: collapse;
|
|
1310
1383
|
font-size: ${({ $size: o, theme: r }) => ({
|
|
@@ -1312,108 +1385,366 @@ const fo = t.div`
|
|
|
1312
1385
|
md: r.fontSizes.md,
|
|
1313
1386
|
lg: r.fontSizes.lg
|
|
1314
1387
|
})[o]};
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1388
|
+
|
|
1389
|
+
caption {
|
|
1390
|
+
padding: 8px 0;
|
|
1391
|
+
}
|
|
1392
|
+
`, Do = i.thead`
|
|
1393
|
+
${({ $stickyHeader: o }) => o && t`
|
|
1394
|
+
position: sticky;
|
|
1395
|
+
top: 0;
|
|
1396
|
+
z-index: 1;
|
|
1397
|
+
`}
|
|
1398
|
+
|
|
1399
|
+
${({ theme: o, $headerColor: r, $borderColor: n }) => r ? t`
|
|
1400
|
+
--th-bg: ${r};
|
|
1401
|
+
--th-text: ${o.colors.neutral[0]};
|
|
1402
|
+
--th-sep: rgba(255, 255, 255, 0.25);
|
|
1403
|
+
` : o.brutalism ? t`
|
|
1404
|
+
--th-bg: ${o.colors.neutral[900]};
|
|
1405
|
+
--th-text: ${o.colors.neutral[0]};
|
|
1406
|
+
--th-sep: ${n ?? o.colors.neutral[600]};
|
|
1407
|
+
` : t`
|
|
1408
|
+
--th-bg: ${o.colors.neutral[100]};
|
|
1409
|
+
--th-text: ${o.colors.neutral[600]};
|
|
1410
|
+
--th-sep: ${n ?? o.colors.neutral[300]};
|
|
1411
|
+
`}
|
|
1412
|
+
`, No = i.tbody`
|
|
1413
|
+
${({ $rowColor: o }) => o && t`
|
|
1414
|
+
tr {
|
|
1415
|
+
background-color: ${o};
|
|
1416
|
+
}
|
|
1417
|
+
`}
|
|
1418
|
+
|
|
1419
|
+
${({ $striped: o, theme: r, $stripeColor: n }) => o && t`
|
|
1325
1420
|
tr:nth-child(even) {
|
|
1326
|
-
background-color: ${r.colors.neutral[100]};
|
|
1421
|
+
background-color: ${n ?? r.colors.neutral[100]};
|
|
1327
1422
|
}
|
|
1328
1423
|
`}
|
|
1329
1424
|
|
|
1330
1425
|
tr:last-child td {
|
|
1331
1426
|
border-bottom: none;
|
|
1332
1427
|
}
|
|
1333
|
-
`,
|
|
1428
|
+
`, q = i.tr``, po = i.th`
|
|
1429
|
+
background-color: var(--th-bg);
|
|
1430
|
+
color: var(--th-text);
|
|
1334
1431
|
text-align: left;
|
|
1335
1432
|
font-weight: 700;
|
|
1336
1433
|
white-space: nowrap;
|
|
1337
1434
|
|
|
1338
|
-
${({ $size: o, theme: r }) => (
|
|
1339
|
-
sm: n`
|
|
1340
|
-
padding: ${r.spacing[1]} ${r.spacing[2]};
|
|
1341
|
-
`,
|
|
1342
|
-
md: n`
|
|
1343
|
-
padding: ${r.spacing[2]} ${r.spacing[3]};
|
|
1344
|
-
`,
|
|
1345
|
-
lg: n`
|
|
1346
|
-
padding: ${r.spacing[3]} ${r.spacing[4]};
|
|
1347
|
-
`
|
|
1348
|
-
})[o]}
|
|
1435
|
+
padding: ${({ $size: o, theme: r }) => Oo(o, r)};
|
|
1349
1436
|
|
|
1350
|
-
${({ theme: o }) => o.brutalism ?
|
|
1351
|
-
border-right: 1px solid
|
|
1352
|
-
&:last-child {
|
|
1353
|
-
border-right: none;
|
|
1354
|
-
}
|
|
1355
|
-
` : n`
|
|
1356
|
-
border-bottom: 2px solid ${o.colors.neutral[300]};
|
|
1357
|
-
border-right: 1px solid ${o.colors.neutral[200]};
|
|
1437
|
+
${({ theme: o, $bordered: r }) => o.brutalism ? t`
|
|
1438
|
+
border-right: 1px solid var(--th-sep);
|
|
1358
1439
|
&:last-child {
|
|
1359
1440
|
border-right: none;
|
|
1360
1441
|
}
|
|
1442
|
+
` : t`
|
|
1443
|
+
border-bottom: 2px solid var(--th-sep);
|
|
1444
|
+
${r && t`
|
|
1445
|
+
border-right: 1px solid var(--th-sep);
|
|
1446
|
+
&:last-child {
|
|
1447
|
+
border-right: none;
|
|
1448
|
+
}
|
|
1449
|
+
`}
|
|
1361
1450
|
`}
|
|
1362
|
-
`,
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1451
|
+
`, cn = i.button`
|
|
1452
|
+
display: inline-flex;
|
|
1453
|
+
align-items: center;
|
|
1454
|
+
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1455
|
+
background: none;
|
|
1456
|
+
border: none;
|
|
1457
|
+
cursor: pointer;
|
|
1458
|
+
font: inherit;
|
|
1459
|
+
color: inherit;
|
|
1460
|
+
font-weight: 700;
|
|
1461
|
+
padding: 0;
|
|
1462
|
+
width: 100%;
|
|
1463
|
+
text-align: left;
|
|
1374
1464
|
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1465
|
+
&:focus-visible {
|
|
1466
|
+
outline: 2px solid currentColor;
|
|
1467
|
+
outline-offset: 2px;
|
|
1468
|
+
border-radius: 2px;
|
|
1469
|
+
}
|
|
1470
|
+
`, dn = i.span`
|
|
1471
|
+
opacity: 0.5;
|
|
1472
|
+
display: inline-flex;
|
|
1473
|
+
align-items: center;
|
|
1474
|
+
`, ro = i.td`
|
|
1475
|
+
padding: ${({ $size: o, theme: r }) => Oo(o, r)};
|
|
1476
|
+
|
|
1477
|
+
${({ $bordered: o, $borderColor: r, theme: n }) => n.brutalism ? t`
|
|
1478
|
+
border-bottom: ${n.brutalism.borderWidth} solid
|
|
1479
|
+
${r ?? n.colors.neutral[900]};
|
|
1480
|
+
${o && t`
|
|
1481
|
+
border-right: ${n.brutalism.borderWidth} solid
|
|
1482
|
+
${r ?? n.colors.neutral[900]};
|
|
1381
1483
|
&:last-child {
|
|
1382
1484
|
border-right: none;
|
|
1383
1485
|
}
|
|
1384
1486
|
`}
|
|
1385
|
-
` : o
|
|
1386
|
-
border: 1px solid ${r.colors.neutral[300]};
|
|
1387
|
-
` :
|
|
1388
|
-
border-bottom: 1px solid
|
|
1487
|
+
` : o ? t`
|
|
1488
|
+
border: 1px solid ${r ?? n.colors.neutral[300]};
|
|
1489
|
+
` : t`
|
|
1490
|
+
border-bottom: 1px solid
|
|
1491
|
+
${r ?? n.colors.neutral[200]};
|
|
1389
1492
|
`}
|
|
1390
|
-
|
|
1391
|
-
|
|
1493
|
+
`, un = i.td`
|
|
1494
|
+
text-align: center;
|
|
1495
|
+
color: ${({ theme: o }) => o.colors.neutral[400]};
|
|
1496
|
+
padding: ${({ theme: o }) => `${o.spacing[4]} ${o.spacing[3]}`};
|
|
1497
|
+
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1498
|
+
border-bottom: none;
|
|
1499
|
+
`, pn = M`
|
|
1500
|
+
0% { background-position: -400px 0; }
|
|
1501
|
+
100% { background-position: 400px 0; }
|
|
1502
|
+
`, fn = i(ro)``, gn = i.div`
|
|
1503
|
+
height: 14px;
|
|
1504
|
+
border-radius: 4px;
|
|
1505
|
+
background: linear-gradient(
|
|
1506
|
+
90deg,
|
|
1507
|
+
${({ theme: o }) => o.colors.neutral[200]} 25%,
|
|
1508
|
+
${({ theme: o }) => o.colors.neutral[100]} 50%,
|
|
1509
|
+
${({ theme: o }) => o.colors.neutral[200]} 75%
|
|
1510
|
+
);
|
|
1511
|
+
background-size: 800px 100%;
|
|
1512
|
+
animation: ${pn} 1.6s ease-in-out infinite;
|
|
1513
|
+
`, bn = i.div`
|
|
1514
|
+
display: flex;
|
|
1515
|
+
align-items: center;
|
|
1516
|
+
justify-content: center;
|
|
1517
|
+
gap: ${({ theme: o }) => o.spacing[1]};
|
|
1518
|
+
padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
|
|
1519
|
+
|
|
1520
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
1521
|
+
border-top: ${o.brutalism.borderWidth} solid
|
|
1522
|
+
${o.colors.neutral[900]};
|
|
1523
|
+
` : t`
|
|
1524
|
+
border-top: 1px solid ${o.colors.neutral[200]};
|
|
1525
|
+
`}
|
|
1526
|
+
`, eo = i.button`
|
|
1527
|
+
display: inline-flex;
|
|
1528
|
+
align-items: center;
|
|
1529
|
+
justify-content: center;
|
|
1530
|
+
min-width: 32px;
|
|
1531
|
+
height: 32px;
|
|
1532
|
+
padding: 0 ${({ theme: o }) => o.spacing[2]};
|
|
1533
|
+
font: inherit;
|
|
1534
|
+
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1535
|
+
cursor: pointer;
|
|
1536
|
+
|
|
1537
|
+
${({ $active: o, theme: r }) => r.brutalism ? t`
|
|
1538
|
+
border: ${r.brutalism.borderWidth} solid
|
|
1539
|
+
${r.colors.neutral[900]};
|
|
1540
|
+
background: ${o ? r.colors.neutral[900] : "transparent"};
|
|
1541
|
+
color: ${o ? r.colors.neutral[0] : r.colors.neutral[900]};
|
|
1542
|
+
box-shadow: ${o ? "none" : `2px 2px 0 ${r.colors.neutral[900]}`};
|
|
1543
|
+
|
|
1544
|
+
&:hover:not(:disabled) {
|
|
1545
|
+
background: ${o ? r.colors.neutral[600] : r.colors.neutral[100]};
|
|
1546
|
+
}
|
|
1547
|
+
` : t`
|
|
1548
|
+
border: 1px solid
|
|
1549
|
+
${o ? r.colors.primary[500] : "transparent"};
|
|
1550
|
+
border-radius: ${r.radius.md};
|
|
1551
|
+
background: ${o ? r.colors.primary[500] : "transparent"};
|
|
1552
|
+
color: ${o ? r.colors.neutral[0] : r.colors.neutral[600]};
|
|
1553
|
+
|
|
1554
|
+
&:hover:not(:disabled) {
|
|
1555
|
+
background: ${o ? r.colors.primary[700] : r.colors.neutral[100]};
|
|
1556
|
+
border-color: ${o ? r.colors.primary[700] : r.colors.neutral[200]};
|
|
1557
|
+
}
|
|
1558
|
+
`}
|
|
1559
|
+
|
|
1560
|
+
&:disabled {
|
|
1561
|
+
opacity: 0.4;
|
|
1562
|
+
cursor: not-allowed;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
&:focus-visible {
|
|
1566
|
+
outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
|
|
1567
|
+
outline-offset: 2px;
|
|
1568
|
+
}
|
|
1569
|
+
`, $n = 4;
|
|
1570
|
+
function xn(o, r) {
|
|
1571
|
+
return o?.key !== r ? /* @__PURE__ */ s(xr, { size: 14 }) : o.direction === "asc" ? /* @__PURE__ */ s(hr, { size: 14 }) : /* @__PURE__ */ s(br, { size: 14 });
|
|
1572
|
+
}
|
|
1573
|
+
function yn({
|
|
1392
1574
|
columns: o,
|
|
1393
1575
|
data: r,
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1576
|
+
rowKey: n,
|
|
1577
|
+
size: e = "md",
|
|
1578
|
+
striped: c,
|
|
1579
|
+
bordered: a,
|
|
1580
|
+
stickyHeader: l,
|
|
1581
|
+
caption: u,
|
|
1582
|
+
emptyMessage: x = "No data",
|
|
1583
|
+
loading: p,
|
|
1584
|
+
sort: b,
|
|
1585
|
+
defaultSort: w,
|
|
1586
|
+
onSortChange: y,
|
|
1587
|
+
pageSize: g,
|
|
1588
|
+
page: k,
|
|
1589
|
+
defaultPage: T,
|
|
1590
|
+
totalRows: z,
|
|
1591
|
+
onPageChange: v,
|
|
1592
|
+
onChange: I,
|
|
1593
|
+
borderColor: P,
|
|
1594
|
+
headerColor: B,
|
|
1595
|
+
rowColor: h,
|
|
1596
|
+
stripeColor: $,
|
|
1597
|
+
className: m,
|
|
1598
|
+
style: O
|
|
1399
1599
|
}) {
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1600
|
+
const {
|
|
1601
|
+
activeSort: j,
|
|
1602
|
+
sortedData: _,
|
|
1603
|
+
handleSort: H
|
|
1604
|
+
} = sn({
|
|
1605
|
+
data: r,
|
|
1606
|
+
sort: b,
|
|
1607
|
+
defaultSort: w,
|
|
1608
|
+
onSortChange: y
|
|
1609
|
+
}), {
|
|
1610
|
+
activePage: N,
|
|
1611
|
+
totalPages: Y,
|
|
1612
|
+
displayData: Z,
|
|
1613
|
+
handlePageChange: no
|
|
1614
|
+
} = ln({
|
|
1615
|
+
data: _,
|
|
1616
|
+
pageSize: g,
|
|
1617
|
+
page: k,
|
|
1618
|
+
defaultPage: T,
|
|
1619
|
+
totalRows: z,
|
|
1620
|
+
onPageChange: v
|
|
1621
|
+
}), to = (d) => {
|
|
1622
|
+
const S = H(d);
|
|
1623
|
+
I?.({ sort: S, page: N });
|
|
1624
|
+
}, U = (d) => {
|
|
1625
|
+
no(d), I?.({ sort: j, page: d });
|
|
1626
|
+
}, f = (d, S) => String(n ? d[n] : S), E = !p && Z.length === 0, W = g ?? $n;
|
|
1627
|
+
return /* @__PURE__ */ C(
|
|
1628
|
+
Po,
|
|
1629
|
+
{
|
|
1630
|
+
$borderColor: P,
|
|
1631
|
+
$stickyHeader: l,
|
|
1632
|
+
className: m,
|
|
1633
|
+
style: O,
|
|
1634
|
+
children: [
|
|
1635
|
+
/* @__PURE__ */ C(Bo, { $size: e, children: [
|
|
1636
|
+
u && /* @__PURE__ */ s("caption", { children: u }),
|
|
1637
|
+
/* @__PURE__ */ s(
|
|
1638
|
+
Do,
|
|
1639
|
+
{
|
|
1640
|
+
$headerColor: B,
|
|
1641
|
+
$borderColor: P,
|
|
1642
|
+
$stickyHeader: l,
|
|
1643
|
+
children: /* @__PURE__ */ s(q, { children: o.map((d) => /* @__PURE__ */ s(
|
|
1644
|
+
po,
|
|
1645
|
+
{
|
|
1646
|
+
$size: e,
|
|
1647
|
+
$bordered: a,
|
|
1648
|
+
scope: "col",
|
|
1649
|
+
style: d.width ? { width: d.width } : void 0,
|
|
1650
|
+
children: d.sortable ? /* @__PURE__ */ C(
|
|
1651
|
+
cn,
|
|
1652
|
+
{
|
|
1653
|
+
type: "button",
|
|
1654
|
+
onClick: () => to(d.key),
|
|
1655
|
+
"aria-label": `Sort by ${d.header}${j?.key === d.key ? `, ${j.direction}ending` : ""}`,
|
|
1656
|
+
children: [
|
|
1657
|
+
d.header,
|
|
1658
|
+
/* @__PURE__ */ s(dn, { "aria-hidden": "true", children: xn(j, d.key) })
|
|
1659
|
+
]
|
|
1660
|
+
}
|
|
1661
|
+
) : d.header
|
|
1662
|
+
},
|
|
1663
|
+
d.key
|
|
1664
|
+
)) })
|
|
1665
|
+
}
|
|
1666
|
+
),
|
|
1667
|
+
/* @__PURE__ */ s(
|
|
1668
|
+
No,
|
|
1669
|
+
{
|
|
1670
|
+
$striped: c,
|
|
1671
|
+
$rowColor: h,
|
|
1672
|
+
$stripeColor: $,
|
|
1673
|
+
children: p ? Array.from({ length: W }).map((d, S) => /* @__PURE__ */ s(q, { children: o.map((L) => /* @__PURE__ */ s(
|
|
1674
|
+
fn,
|
|
1675
|
+
{
|
|
1676
|
+
$size: e,
|
|
1677
|
+
$bordered: a,
|
|
1678
|
+
$borderColor: P,
|
|
1679
|
+
children: /* @__PURE__ */ s(gn, {})
|
|
1680
|
+
},
|
|
1681
|
+
L.key
|
|
1682
|
+
)) }, S)) : E ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(un, { colSpan: o.length, children: x }) }) : Z.map((d, S) => /* @__PURE__ */ s(q, { children: o.map((L) => /* @__PURE__ */ s(
|
|
1683
|
+
ro,
|
|
1684
|
+
{
|
|
1685
|
+
$size: e,
|
|
1686
|
+
$bordered: a,
|
|
1687
|
+
$borderColor: P,
|
|
1688
|
+
children: L.render ? L.render(d[L.key], d, S) : String(d[L.key] ?? "") || " "
|
|
1689
|
+
},
|
|
1690
|
+
L.key
|
|
1691
|
+
)) }, f(d, S)))
|
|
1692
|
+
}
|
|
1693
|
+
)
|
|
1694
|
+
] }),
|
|
1695
|
+
g && Y > 1 && /* @__PURE__ */ C(bn, { children: [
|
|
1696
|
+
/* @__PURE__ */ s(
|
|
1697
|
+
eo,
|
|
1698
|
+
{
|
|
1699
|
+
type: "button",
|
|
1700
|
+
onClick: () => U(N - 1),
|
|
1701
|
+
disabled: N <= 1,
|
|
1702
|
+
"aria-label": "Previous page",
|
|
1703
|
+
children: "←"
|
|
1704
|
+
}
|
|
1705
|
+
),
|
|
1706
|
+
an(N, Y).map(
|
|
1707
|
+
(d, S) => d === "..." ? /* @__PURE__ */ s(
|
|
1708
|
+
"span",
|
|
1709
|
+
{
|
|
1710
|
+
"aria-hidden": "true",
|
|
1711
|
+
style: { padding: "0 4px" },
|
|
1712
|
+
children: "…"
|
|
1713
|
+
},
|
|
1714
|
+
`e${S}`
|
|
1715
|
+
) : /* @__PURE__ */ s(
|
|
1716
|
+
eo,
|
|
1717
|
+
{
|
|
1718
|
+
type: "button",
|
|
1719
|
+
$active: d === N,
|
|
1720
|
+
onClick: () => U(d),
|
|
1721
|
+
"aria-label": `Page ${d}`,
|
|
1722
|
+
"aria-current": d === N ? "page" : void 0,
|
|
1723
|
+
children: d
|
|
1724
|
+
},
|
|
1725
|
+
d
|
|
1726
|
+
)
|
|
1727
|
+
),
|
|
1728
|
+
/* @__PURE__ */ s(
|
|
1729
|
+
eo,
|
|
1730
|
+
{
|
|
1731
|
+
type: "button",
|
|
1732
|
+
onClick: () => U(N + 1),
|
|
1733
|
+
disabled: N >= Y,
|
|
1734
|
+
"aria-label": "Next page",
|
|
1735
|
+
children: "→"
|
|
1736
|
+
}
|
|
1737
|
+
)
|
|
1738
|
+
] })
|
|
1739
|
+
]
|
|
1740
|
+
}
|
|
1741
|
+
);
|
|
1413
1742
|
}
|
|
1414
|
-
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1743
|
+
yn.displayName = "Table";
|
|
1744
|
+
const hn = i(Bo)`
|
|
1745
|
+
table-layout: fixed;
|
|
1746
|
+
`, wn = i(ro)`
|
|
1747
|
+
${({ $editable: o, theme: r }) => o && t`
|
|
1417
1748
|
cursor: pointer;
|
|
1418
1749
|
position: relative;
|
|
1419
1750
|
|
|
@@ -1421,8 +1752,11 @@ const Rr = t(X)`
|
|
|
1421
1752
|
background-color: ${r.brutalism ? r.colors.neutral[100] : r.colors.primary[50]};
|
|
1422
1753
|
}
|
|
1423
1754
|
`}
|
|
1424
|
-
`,
|
|
1755
|
+
`, vn = i.input`
|
|
1756
|
+
display: block;
|
|
1425
1757
|
width: 100%;
|
|
1758
|
+
min-width: 0;
|
|
1759
|
+
box-sizing: border-box;
|
|
1426
1760
|
border: none;
|
|
1427
1761
|
outline: none;
|
|
1428
1762
|
background: transparent;
|
|
@@ -1431,24 +1765,24 @@ const Rr = t(X)`
|
|
|
1431
1765
|
padding: 0;
|
|
1432
1766
|
margin: 0;
|
|
1433
1767
|
|
|
1434
|
-
${({ theme: o }) => o.brutalism ?
|
|
1768
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
1435
1769
|
&:focus {
|
|
1436
1770
|
outline: 2px solid ${o.colors.neutral[900]};
|
|
1437
1771
|
outline-offset: 1px;
|
|
1438
1772
|
}
|
|
1439
|
-
` :
|
|
1773
|
+
` : t`
|
|
1440
1774
|
&:focus {
|
|
1441
1775
|
box-shadow: ${o.shadows.focusRing};
|
|
1442
1776
|
}
|
|
1443
1777
|
`}
|
|
1444
|
-
`,
|
|
1778
|
+
`, kn = i(po)`
|
|
1445
1779
|
width: 40px;
|
|
1446
|
-
`,
|
|
1780
|
+
`, mn = i(ro)`
|
|
1447
1781
|
width: 40px;
|
|
1448
1782
|
text-align: center;
|
|
1449
1783
|
padding-left: 0;
|
|
1450
1784
|
padding-right: 0;
|
|
1451
|
-
`,
|
|
1785
|
+
`, Sn = i.button`
|
|
1452
1786
|
display: inline-flex;
|
|
1453
1787
|
align-items: center;
|
|
1454
1788
|
justify-content: center;
|
|
@@ -1466,18 +1800,18 @@ const Rr = t(X)`
|
|
|
1466
1800
|
&:hover {
|
|
1467
1801
|
color: ${({ theme: o }) => o.colors.error[500]};
|
|
1468
1802
|
|
|
1469
|
-
${({ theme: o }) => o.brutalism &&
|
|
1803
|
+
${({ theme: o }) => o.brutalism && t`
|
|
1470
1804
|
background-color: ${o.colors.error[50]};
|
|
1471
1805
|
`}
|
|
1472
1806
|
}
|
|
1473
|
-
`,
|
|
1474
|
-
${({ theme: o }) => o.brutalism ?
|
|
1807
|
+
`, Cn = i.tr`
|
|
1808
|
+
${({ theme: o }) => o.brutalism ? t`
|
|
1475
1809
|
border-top: ${o.brutalism.borderWidth} solid
|
|
1476
1810
|
${o.colors.neutral[900]};
|
|
1477
|
-
` :
|
|
1811
|
+
` : t`
|
|
1478
1812
|
border-top: 1px solid ${o.colors.neutral[200]};
|
|
1479
1813
|
`}
|
|
1480
|
-
`,
|
|
1814
|
+
`, zn = i.button`
|
|
1481
1815
|
display: inline-flex;
|
|
1482
1816
|
align-items: center;
|
|
1483
1817
|
gap: ${({ theme: o }) => o.spacing[1]};
|
|
@@ -1500,104 +1834,166 @@ const Rr = t(X)`
|
|
|
1500
1834
|
outline-offset: 2px;
|
|
1501
1835
|
}
|
|
1502
1836
|
`;
|
|
1503
|
-
function
|
|
1837
|
+
function ao(o, r, n) {
|
|
1838
|
+
return typeof o.editable == "function" ? o.editable(r, n) : !!o.editable;
|
|
1839
|
+
}
|
|
1840
|
+
function Tn({
|
|
1504
1841
|
columns: o,
|
|
1505
1842
|
defaultData: r,
|
|
1506
|
-
data:
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1843
|
+
data: n,
|
|
1844
|
+
rowKey: e,
|
|
1845
|
+
onChange: c,
|
|
1846
|
+
size: a = "md",
|
|
1847
|
+
borderColor: l,
|
|
1848
|
+
headerColor: u,
|
|
1849
|
+
addRowLabel: x = "Add row",
|
|
1850
|
+
newRowFactory: p,
|
|
1851
|
+
deletable: b = !1,
|
|
1852
|
+
className: w,
|
|
1853
|
+
style: y
|
|
1514
1854
|
}) {
|
|
1515
|
-
const
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
}, [
|
|
1519
|
-
const
|
|
1520
|
-
(
|
|
1521
|
-
|
|
1855
|
+
const g = n !== void 0, [k, T] = D(r ?? []), z = g ? n : k, [v, I] = D(null), [P, B] = D(""), h = oo(null);
|
|
1856
|
+
K(() => {
|
|
1857
|
+
v && (h.current?.focus(), h.current?.select());
|
|
1858
|
+
}, [v]);
|
|
1859
|
+
const $ = R(
|
|
1860
|
+
(f) => {
|
|
1861
|
+
g || T(f), c?.(f);
|
|
1862
|
+
},
|
|
1863
|
+
[g, c]
|
|
1864
|
+
), m = R(
|
|
1865
|
+
() => p ? p() : Object.fromEntries(o.map((f) => [f.key, ""])),
|
|
1866
|
+
[p, o]
|
|
1867
|
+
), O = R(
|
|
1868
|
+
(f) => {
|
|
1869
|
+
const E = [];
|
|
1870
|
+
return f.forEach((W, d) => {
|
|
1871
|
+
o.forEach((S) => {
|
|
1872
|
+
ao(S, W, d) && E.push({ rowIndex: d, colKey: S.key });
|
|
1873
|
+
});
|
|
1874
|
+
}), E;
|
|
1522
1875
|
},
|
|
1523
|
-
[
|
|
1524
|
-
),
|
|
1525
|
-
|
|
1526
|
-
},
|
|
1527
|
-
if (!
|
|
1528
|
-
|
|
1529
|
-
|
|
1876
|
+
[o]
|
|
1877
|
+
), j = (f, E, W) => {
|
|
1878
|
+
I({ rowIndex: f, colKey: E }), B(String(W ?? ""));
|
|
1879
|
+
}, _ = R(() => {
|
|
1880
|
+
if (!v)
|
|
1881
|
+
return;
|
|
1882
|
+
const { rowIndex: f, colKey: E } = v, W = z.map(
|
|
1883
|
+
(d, S) => S === f ? { ...d, [E]: P } : d
|
|
1530
1884
|
);
|
|
1531
|
-
|
|
1532
|
-
}, [
|
|
1533
|
-
|
|
1534
|
-
},
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
)
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1885
|
+
$(W), I(null);
|
|
1886
|
+
}, [v, z, P, $]), H = () => {
|
|
1887
|
+
I(null), B("");
|
|
1888
|
+
}, N = (f) => {
|
|
1889
|
+
if (!v)
|
|
1890
|
+
return;
|
|
1891
|
+
f.preventDefault();
|
|
1892
|
+
const { rowIndex: E, colKey: W } = v, d = z.map(
|
|
1893
|
+
(A, J) => J === E ? { ...A, [W]: P } : A
|
|
1894
|
+
);
|
|
1895
|
+
$(d);
|
|
1896
|
+
const S = O(d), L = S.findIndex(
|
|
1897
|
+
(A) => A.rowIndex === E && A.colKey === W
|
|
1898
|
+
), V = f.shiftKey ? L - 1 : L + 1;
|
|
1899
|
+
if (V >= 0 && V < S.length) {
|
|
1900
|
+
const A = S[V];
|
|
1901
|
+
I(A), B(String(d[A.rowIndex][A.colKey] ?? ""));
|
|
1902
|
+
return;
|
|
1903
|
+
}
|
|
1904
|
+
if (!f.shiftKey && V >= S.length) {
|
|
1905
|
+
const A = m(), J = [...d, A];
|
|
1906
|
+
$(J);
|
|
1907
|
+
const fo = J.length - 1, go = o.find(
|
|
1908
|
+
(Lo) => ao(Lo, A, fo)
|
|
1909
|
+
);
|
|
1910
|
+
I(
|
|
1911
|
+
go ? { rowIndex: fo, colKey: go.key } : null
|
|
1912
|
+
), B("");
|
|
1913
|
+
return;
|
|
1914
|
+
}
|
|
1915
|
+
I(null), B("");
|
|
1916
|
+
}, Y = (f) => {
|
|
1917
|
+
if (f.key === "Enter") {
|
|
1918
|
+
_();
|
|
1919
|
+
return;
|
|
1920
|
+
}
|
|
1921
|
+
if (f.key === "Escape") {
|
|
1922
|
+
H();
|
|
1923
|
+
return;
|
|
1924
|
+
}
|
|
1925
|
+
f.key === "Tab" && N(f);
|
|
1926
|
+
}, Z = () => $([...z, m()]), no = (f) => {
|
|
1927
|
+
v?.rowIndex === f && I(null), $(z.filter((E, W) => W !== f));
|
|
1928
|
+
}, to = (f, E) => String(e ? f[e] : E), U = b ? o.length + 1 : o.length;
|
|
1929
|
+
return /* @__PURE__ */ s(
|
|
1930
|
+
Po,
|
|
1931
|
+
{
|
|
1932
|
+
$borderColor: l,
|
|
1933
|
+
className: w,
|
|
1934
|
+
style: y,
|
|
1935
|
+
children: /* @__PURE__ */ C(hn, { $size: a, children: [
|
|
1936
|
+
/* @__PURE__ */ s(Do, { $headerColor: u, $borderColor: l, children: /* @__PURE__ */ C(q, { children: [
|
|
1937
|
+
o.map((f) => /* @__PURE__ */ s(
|
|
1938
|
+
po,
|
|
1561
1939
|
{
|
|
1562
|
-
$size:
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
children: L ? /* @__PURE__ */ i(
|
|
1567
|
-
Ar,
|
|
1568
|
-
{
|
|
1569
|
-
ref: E,
|
|
1570
|
-
$size: l,
|
|
1571
|
-
value: z,
|
|
1572
|
-
onChange: (xo) => h(xo.target.value),
|
|
1573
|
-
onBlur: $,
|
|
1574
|
-
onKeyDown: v,
|
|
1575
|
-
"aria-label": `Edit ${I.header}`
|
|
1576
|
-
}
|
|
1577
|
-
) : I.render ? I.render(F, g, T) : String(F ?? "")
|
|
1940
|
+
$size: a,
|
|
1941
|
+
scope: "col",
|
|
1942
|
+
style: f.width ? { width: f.width } : void 0,
|
|
1943
|
+
children: f.header
|
|
1578
1944
|
},
|
|
1579
|
-
|
|
1580
|
-
)
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
{
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1945
|
+
f.key
|
|
1946
|
+
)),
|
|
1947
|
+
b && /* @__PURE__ */ s(kn, { $size: a, "aria-label": "Actions" })
|
|
1948
|
+
] }) }),
|
|
1949
|
+
/* @__PURE__ */ C(No, { children: [
|
|
1950
|
+
z.map((f, E) => /* @__PURE__ */ C(q, { children: [
|
|
1951
|
+
o.map((W) => {
|
|
1952
|
+
const d = v?.rowIndex === E && v.colKey === W.key, S = f[W.key], L = ao(W, f, E);
|
|
1953
|
+
return /* @__PURE__ */ s(
|
|
1954
|
+
wn,
|
|
1955
|
+
{
|
|
1956
|
+
$size: a,
|
|
1957
|
+
$borderColor: l,
|
|
1958
|
+
$editable: L && !d,
|
|
1959
|
+
onClick: L && !d ? () => j(E, W.key, S) : void 0,
|
|
1960
|
+
children: d ? /* @__PURE__ */ s(
|
|
1961
|
+
vn,
|
|
1962
|
+
{
|
|
1963
|
+
ref: h,
|
|
1964
|
+
$size: a,
|
|
1965
|
+
value: P,
|
|
1966
|
+
onChange: (V) => B(V.target.value),
|
|
1967
|
+
onBlur: _,
|
|
1968
|
+
onKeyDown: Y,
|
|
1969
|
+
"aria-label": `Edit ${W.header}`
|
|
1970
|
+
}
|
|
1971
|
+
) : W.render ? W.render(S, f, E) : String(S ?? "") || " "
|
|
1972
|
+
},
|
|
1973
|
+
W.key
|
|
1974
|
+
);
|
|
1975
|
+
}),
|
|
1976
|
+
b && /* @__PURE__ */ s(mn, { $size: a, $borderColor: l, children: /* @__PURE__ */ s(
|
|
1977
|
+
Sn,
|
|
1978
|
+
{
|
|
1979
|
+
type: "button",
|
|
1980
|
+
onClick: () => no(E),
|
|
1981
|
+
"aria-label": "Delete row",
|
|
1982
|
+
children: "✕"
|
|
1983
|
+
}
|
|
1984
|
+
) })
|
|
1985
|
+
] }, to(f, E))),
|
|
1986
|
+
/* @__PURE__ */ s(Cn, { children: /* @__PURE__ */ s("td", { colSpan: U, children: /* @__PURE__ */ C(zn, { type: "button", onClick: Z, children: [
|
|
1987
|
+
"+ ",
|
|
1988
|
+
x
|
|
1989
|
+
] }) }) })
|
|
1990
|
+
] })
|
|
1991
|
+
] })
|
|
1992
|
+
}
|
|
1993
|
+
);
|
|
1598
1994
|
}
|
|
1599
|
-
|
|
1600
|
-
const
|
|
1995
|
+
Tn.displayName = "DataTable";
|
|
1996
|
+
const vo = {
|
|
1601
1997
|
primary: {
|
|
1602
1998
|
50: "#f0f8ff",
|
|
1603
1999
|
500: "#0070f3",
|
|
@@ -1629,38 +2025,38 @@ const ro = {
|
|
|
1629
2025
|
50: "#eff6ff",
|
|
1630
2026
|
500: "#2563eb"
|
|
1631
2027
|
}
|
|
1632
|
-
},
|
|
2028
|
+
}, In = {
|
|
1633
2029
|
1: "4px",
|
|
1634
2030
|
2: "8px",
|
|
1635
2031
|
3: "12px",
|
|
1636
2032
|
4: "16px",
|
|
1637
2033
|
5: "20px",
|
|
1638
2034
|
6: "24px"
|
|
1639
|
-
},
|
|
2035
|
+
}, En = {
|
|
1640
2036
|
md: "6px"
|
|
1641
|
-
},
|
|
2037
|
+
}, Wn = {
|
|
1642
2038
|
modal: 1e3,
|
|
1643
2039
|
toast: 1100
|
|
1644
|
-
},
|
|
2040
|
+
}, On = {
|
|
1645
2041
|
xs: "12px",
|
|
1646
2042
|
sm: "14px",
|
|
1647
2043
|
md: "16px",
|
|
1648
2044
|
lg: "18px"
|
|
1649
|
-
},
|
|
1650
|
-
colors: { ...
|
|
1651
|
-
spacing:
|
|
1652
|
-
fontSizes:
|
|
1653
|
-
radius:
|
|
1654
|
-
zIndex:
|
|
2045
|
+
}, _n = {
|
|
2046
|
+
colors: { ...vo, primary: { ...vo.primary, contrast: "#ffffff" } },
|
|
2047
|
+
spacing: In,
|
|
2048
|
+
fontSizes: On,
|
|
2049
|
+
radius: En,
|
|
2050
|
+
zIndex: Wn,
|
|
1655
2051
|
shadows: {
|
|
1656
2052
|
focusRing: "0 0 0 2px rgba(0, 112, 243, 0.25)"
|
|
1657
2053
|
}
|
|
1658
2054
|
};
|
|
1659
|
-
function
|
|
1660
|
-
const r = parseInt(o.slice(1, 3), 16) / 255,
|
|
1661
|
-
return 0.2126 *
|
|
2055
|
+
function Pn(o) {
|
|
2056
|
+
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, c = (l) => l <= 0.03928 ? l / 12.92 : ((l + 0.055) / 1.055) ** 2.4;
|
|
2057
|
+
return 0.2126 * c(r) + 0.7152 * c(n) + 0.0722 * c(e) > 0.179 ? "#111111" : "#ffffff";
|
|
1662
2058
|
}
|
|
1663
|
-
const
|
|
2059
|
+
const co = {
|
|
1664
2060
|
colors: {
|
|
1665
2061
|
primary: {
|
|
1666
2062
|
50: "#fffde6",
|
|
@@ -1690,44 +2086,44 @@ const U = {
|
|
|
1690
2086
|
shadows: { focusRing: "3px 3px 0 #111111" },
|
|
1691
2087
|
brutalism: { borderWidth: "2px", shadowOffset: "4px" }
|
|
1692
2088
|
};
|
|
1693
|
-
function
|
|
2089
|
+
function Mn(o) {
|
|
1694
2090
|
return {
|
|
1695
|
-
...
|
|
2091
|
+
...co,
|
|
1696
2092
|
colors: {
|
|
1697
|
-
...
|
|
2093
|
+
...co.colors,
|
|
1698
2094
|
primary: {
|
|
1699
2095
|
50: "#fffff0",
|
|
1700
2096
|
500: o,
|
|
1701
2097
|
700: o,
|
|
1702
|
-
contrast:
|
|
2098
|
+
contrast: Pn(o)
|
|
1703
2099
|
}
|
|
1704
2100
|
}
|
|
1705
2101
|
};
|
|
1706
2102
|
}
|
|
1707
|
-
function
|
|
1708
|
-
theme: o =
|
|
2103
|
+
function Vn({
|
|
2104
|
+
theme: o = co,
|
|
1709
2105
|
children: r
|
|
1710
2106
|
}) {
|
|
1711
|
-
return /* @__PURE__ */
|
|
2107
|
+
return /* @__PURE__ */ s(Ao, { theme: o, children: r });
|
|
1712
2108
|
}
|
|
1713
2109
|
export {
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
2110
|
+
Ro as Badge,
|
|
2111
|
+
Mo as Button,
|
|
2112
|
+
nn as CollapsibleCard,
|
|
2113
|
+
Tn as DataTable,
|
|
2114
|
+
Dr as Form,
|
|
2115
|
+
Nr as FormField,
|
|
2116
|
+
qo as Input,
|
|
2117
|
+
Kr as Link,
|
|
2118
|
+
ar as Modal,
|
|
2119
|
+
Vr as Select,
|
|
2120
|
+
yn as Table,
|
|
2121
|
+
Vn as ThemeProvider,
|
|
2122
|
+
Eo as Toast,
|
|
2123
|
+
An as ToastProvider,
|
|
2124
|
+
Mn as createNeoBrutalTheme,
|
|
2125
|
+
_n as defaultTheme,
|
|
2126
|
+
co as neoBrutalTheme,
|
|
2127
|
+
Rn as useForm,
|
|
2128
|
+
jn as useToast
|
|
1733
2129
|
};
|