blunt-ui 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { jsx as l, jsxs as h } from "react/jsx-runtime";
2
- import i, { css as s, keyframes as O, ThemeProvider as eo } from "styled-components";
3
- import H, { useId as F, useState as z, useRef as M, useEffect as j, useContext as Z, createContext as X, forwardRef as G, createElement as P, useCallback as B, useMemo as ao } from "react";
4
- import { createPortal as J } from "react-dom";
5
- const L = (o, r, n) => s`
1
+ import { jsx as i, jsxs as m } from "react/jsx-runtime";
2
+ import t, { css as n, keyframes as R, ThemeProvider as yo } from "styled-components";
3
+ import G, { useId as M, useState as W, useRef as Y, useEffect as V, useContext as no, createContext as so, forwardRef as to, createElement as q, useCallback as j, useMemo as wo } from "react";
4
+ import { createPortal as io } from "react-dom";
5
+ const N = (o, r, s) => n`
6
6
  background: ${r};
7
- color: ${n};
7
+ color: ${s};
8
8
  border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
9
9
  box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
10
- `, lo = i.span`
10
+ `, vo = t.span`
11
11
  display: inline-flex;
12
12
  align-items: center;
13
13
  font-weight: 700;
@@ -20,82 +20,82 @@ const L = (o, r, n) => s`
20
20
  max-width: 20ch;
21
21
 
22
22
  ${({ $size: o, theme: r }) => ({
23
- sm: s`
23
+ sm: n`
24
24
  padding: 2px 8px;
25
25
  font-size: ${r.fontSizes.xs};
26
26
  `,
27
- md: s`
27
+ md: n`
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: L(
34
+ primary: N(
35
35
  r,
36
36
  r.colors.primary[500],
37
37
  r.colors.primary.contrast
38
38
  ),
39
- neutral: L(
39
+ neutral: N(
40
40
  r,
41
41
  r.colors.neutral[200],
42
42
  r.colors.neutral[900]
43
43
  ),
44
- success: L(
44
+ success: N(
45
45
  r,
46
46
  r.colors.success[50],
47
47
  r.colors.success[500]
48
48
  ),
49
- error: L(
49
+ error: N(
50
50
  r,
51
51
  r.colors.error[50],
52
52
  r.colors.error[500]
53
53
  ),
54
- warning: L(
54
+ warning: N(
55
55
  r,
56
56
  r.colors.warning[50],
57
57
  r.colors.warning[500]
58
58
  ),
59
- info: L(r, r.colors.info[50], r.colors.info[500])
59
+ info: N(r, r.colors.info[50], r.colors.info[500])
60
60
  }[o] : {
61
- primary: s`
61
+ primary: n`
62
62
  background: ${r.colors.primary[50]};
63
63
  color: ${r.colors.primary[500]};
64
64
  `,
65
- neutral: s`
65
+ neutral: n`
66
66
  background: ${r.colors.neutral[200]};
67
67
  color: ${r.colors.neutral[600]};
68
68
  `,
69
- success: s`
69
+ success: n`
70
70
  background: ${r.colors.success[50]};
71
71
  color: ${r.colors.success[500]};
72
72
  `,
73
- error: s`
73
+ error: n`
74
74
  background: ${r.colors.error[50]};
75
75
  color: ${r.colors.error[500]};
76
76
  `,
77
- warning: s`
77
+ warning: n`
78
78
  background: ${r.colors.warning[50]};
79
79
  color: ${r.colors.warning[500]};
80
80
  `,
81
- info: s`
81
+ info: n`
82
82
  background: ${r.colors.info[50]};
83
83
  color: ${r.colors.info[500]};
84
84
  `
85
85
  }[o]}
86
86
  `;
87
- function co({
87
+ function mo({
88
88
  variant: o = "primary",
89
89
  size: r = "md",
90
- children: n,
91
- ...t
90
+ children: s,
91
+ ...a
92
92
  }) {
93
- return /* @__PURE__ */ l(lo, { $variant: o, $size: r, ...t, children: n });
93
+ return /* @__PURE__ */ i(vo, { $variant: o, $size: r, ...a, children: s });
94
94
  }
95
- co.displayName = "Badge";
96
- const A = (o, r, n) => s`
95
+ mo.displayName = "Badge";
96
+ const _ = (o, r, s) => n`
97
97
  background-color: ${r};
98
- color: ${n};
98
+ color: ${s};
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 A = (o, r, n) => s`
106
106
  transform: translate(2px, 2px);
107
107
  box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
108
108
  }
109
- `, uo = i.button`
109
+ `, ho = t.button`
110
110
  display: inline-flex;
111
111
  align-items: center;
112
112
  justify-content: center;
@@ -126,23 +126,23 @@ const A = (o, r, n) => s`
126
126
  }
127
127
 
128
128
  ${({ $variant: o, theme: r }) => r.brutalism ? {
129
- primary: A(
129
+ primary: _(
130
130
  r,
131
131
  r.colors.primary[500],
132
132
  r.colors.primary.contrast
133
133
  ),
134
- secondary: A(
134
+ secondary: _(
135
135
  r,
136
136
  r.colors.neutral[100],
137
137
  r.colors.neutral[900]
138
138
  ),
139
- outline: A(
139
+ outline: _(
140
140
  r,
141
141
  r.colors.neutral[0],
142
142
  r.colors.neutral[900]
143
143
  )
144
144
  }[o] : {
145
- primary: s`
145
+ primary: n`
146
146
  background-color: ${r.colors.primary[500]};
147
147
  color: ${r.colors.neutral[0]};
148
148
  border: none;
@@ -150,7 +150,7 @@ const A = (o, r, n) => s`
150
150
  background-color: ${r.colors.primary[700]};
151
151
  }
152
152
  `,
153
- secondary: s`
153
+ secondary: n`
154
154
  background-color: ${r.colors.neutral[200]};
155
155
  color: ${r.colors.neutral[600]};
156
156
  border: none;
@@ -158,7 +158,7 @@ const A = (o, r, n) => s`
158
158
  background-color: ${r.colors.neutral[300]};
159
159
  }
160
160
  `,
161
- outline: s`
161
+ outline: n`
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 A = (o, r, n) => s`
169
169
  }[o]}
170
170
 
171
171
  ${({ $size: o, theme: r }) => ({
172
- sm: s`
172
+ sm: n`
173
173
  padding: ${r.spacing[1]} ${r.spacing[3]};
174
174
  font-size: ${r.fontSizes.sm};
175
175
  `,
176
- md: s`
176
+ md: n`
177
177
  padding: ${r.spacing[2]} ${r.spacing[4]};
178
178
  font-size: ${r.fontSizes.md};
179
179
  `,
180
- lg: s`
180
+ lg: n`
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 fo({
186
+ function ko({
187
187
  ref: o,
188
188
  as: r,
189
- href: n,
190
- variant: t = "primary",
191
- size: c = "md",
192
- isLoading: a,
193
- disabled: e,
194
- children: d,
189
+ href: s,
190
+ variant: a = "primary",
191
+ size: l = "md",
192
+ isLoading: d,
193
+ disabled: c,
194
+ children: e,
195
195
  ...p
196
196
  }) {
197
- return /* @__PURE__ */ l(
198
- uo,
197
+ return /* @__PURE__ */ i(
198
+ ho,
199
199
  {
200
200
  ref: o,
201
- as: r ?? (n ? "a" : "button"),
202
- href: n,
203
- $variant: t,
204
- $size: c,
205
- disabled: a || e,
201
+ as: r ?? (s ? "a" : "button"),
202
+ href: s,
203
+ $variant: a,
204
+ $size: l,
205
+ disabled: d || c,
206
206
  ...p,
207
- children: a ? "Loading..." : d
207
+ children: d ? "Loading..." : e
208
208
  }
209
209
  );
210
210
  }
211
- fo.displayName = "Button";
212
- const po = i.div`
211
+ ko.displayName = "Button";
212
+ const Co = t.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
- `, go = i.label`
217
+ `, zo = t.label`
218
218
  font-size: ${({ theme: o }) => o.fontSizes.sm};
219
219
  font-weight: ${({ theme: o }) => o.brutalism ? "700" : "500"};
220
- `, $o = i.span`
220
+ `, So = t.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
- `, bo = i.div`
223
+ `, To = t.div`
224
224
  display: flex;
225
225
  align-items: center;
226
226
  border-radius: ${({ theme: o }) => o.radius.md};
@@ -229,43 +229,43 @@ const po = i.div`
229
229
  box-shadow 0.2s;
230
230
 
231
231
  ${({ $size: o = "md", theme: r }) => ({
232
- sm: s`
232
+ sm: n`
233
233
  padding: ${r.spacing[1]} ${r.spacing[2]};
234
234
  font-size: ${r.fontSizes.sm};
235
235
  `,
236
- md: s`
236
+ md: n`
237
237
  padding: ${r.spacing[2]} ${r.spacing[3]};
238
238
  font-size: ${r.fontSizes.md};
239
239
  `,
240
- lg: s`
240
+ lg: n`
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 ? s`
246
+ ${({ $variant: o = "default", theme: r }) => r.brutalism ? n`
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: s`
252
+ default: n`
253
253
  border: 1px solid ${r.colors.neutral[400]};
254
254
  background-color: ${r.colors.neutral[0]};
255
255
  `,
256
- outlined: s`
256
+ outlined: n`
257
257
  border: 2px solid ${r.colors.primary[500]};
258
258
  background-color: ${r.colors.neutral[0]};
259
259
  `,
260
- filled: s`
260
+ filled: n`
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 && s`
266
+ ${({ $error: o, theme: r }) => o && n`
267
267
  border-color: ${r.colors.error[500]};
268
- ${r.brutalism && s`
268
+ ${r.brutalism && n`
269
269
  box-shadow: 3px 3px 0 ${r.colors.error[500]};
270
270
  `}
271
271
  `}
@@ -273,7 +273,7 @@ const po = i.div`
273
273
  &:focus-within {
274
274
  box-shadow: ${({ theme: o }) => o.shadows.focusRing};
275
275
  }
276
- `, xo = i.input`
276
+ `, Io = t.input`
277
277
  flex: 1;
278
278
  border: none;
279
279
  outline: none;
@@ -284,11 +284,11 @@ const po = i.div`
284
284
  cursor: not-allowed;
285
285
  opacity: 0.6;
286
286
  }
287
- `, _ = i.div`
287
+ `, J = t.div`
288
288
  display: inline-flex;
289
289
  align-items: center;
290
290
  margin: 0 ${({ theme: o }) => o.spacing[1]};
291
- `, yo = i.button`
291
+ `, Wo = t.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 po = i.div`
302
302
  opacity: 0.8;
303
303
  }
304
304
  `;
305
- function wo({
305
+ function Eo({
306
306
  ref: o,
307
307
  type: r = "text",
308
- size: n = "md",
309
- variant: t = "default",
310
- label: c,
311
- helperText: a,
312
- error: e,
313
- leftElement: d,
308
+ size: s = "md",
309
+ variant: a = "default",
310
+ label: l,
311
+ helperText: d,
312
+ error: c,
313
+ leftElement: e,
314
314
  rightElement: p,
315
315
  clearable: u,
316
- onClear: b,
317
- fullWidth: m,
318
- id: $,
319
- value: x,
320
- defaultValue: w,
316
+ onClear: x,
317
+ fullWidth: C,
318
+ id: w,
319
+ value: b,
320
+ defaultValue: f,
321
321
  onChange: S,
322
- ...C
322
+ ...z
323
323
  }) {
324
- const k = F(), I = $ ?? k, T = `${I}-hint`, [W, f] = z(w ?? ""), g = x !== void 0, y = g ? x : W, v = typeof e == "string" ? e : void 0, E = !!(a || e), V = (D) => {
325
- g || f(D.target.value), S?.(D);
326
- }, io = () => {
327
- g || f(""), b?.();
324
+ const h = M(), E = w ?? h, B = `${E}-hint`, [O, $] = W(f ?? ""), y = b !== void 0, v = y ? b : O, k = typeof c == "string" ? c : void 0, A = !!(d || c), D = (T) => {
325
+ y || $(T.target.value), S?.(T);
326
+ }, g = () => {
327
+ y || $(""), x?.();
328
328
  };
329
- return /* @__PURE__ */ h(po, { $fullWidth: m, children: [
330
- c && /* @__PURE__ */ l(go, { htmlFor: I, children: c }),
331
- /* @__PURE__ */ h(bo, { $size: n, $variant: t, $error: !!e, children: [
332
- d && /* @__PURE__ */ l(_, { children: d }),
333
- /* @__PURE__ */ l(
334
- xo,
329
+ return /* @__PURE__ */ m(Co, { $fullWidth: C, children: [
330
+ l && /* @__PURE__ */ i(zo, { htmlFor: E, children: l }),
331
+ /* @__PURE__ */ m(To, { $size: s, $variant: a, $error: !!c, children: [
332
+ e && /* @__PURE__ */ i(J, { children: e }),
333
+ /* @__PURE__ */ i(
334
+ Io,
335
335
  {
336
- id: I,
336
+ id: E,
337
337
  ref: o,
338
338
  type: r,
339
- value: y,
340
- onChange: V,
341
- ...C,
342
- "aria-invalid": !!e,
343
- "aria-describedby": E ? T : void 0
339
+ value: v,
340
+ onChange: D,
341
+ ...z,
342
+ "aria-invalid": !!c,
343
+ "aria-describedby": A ? B : void 0
344
344
  }
345
345
  ),
346
- u && y && /* @__PURE__ */ l(
347
- yo,
346
+ u && v && /* @__PURE__ */ i(
347
+ Wo,
348
348
  {
349
349
  type: "button",
350
- onClick: io,
350
+ onClick: g,
351
351
  "aria-label": "Clear input",
352
352
  children: "✕"
353
353
  }
354
354
  ),
355
- p && /* @__PURE__ */ l(_, { children: p })
355
+ p && /* @__PURE__ */ i(J, { children: p })
356
356
  ] }),
357
- E && /* @__PURE__ */ l($o, { id: T, $error: !!e, children: v ?? a })
357
+ A && /* @__PURE__ */ i(So, { id: B, $error: !!c, children: k ?? d })
358
358
  ] });
359
359
  }
360
- wo.displayName = "Input";
361
- const vo = O`
360
+ Eo.displayName = "Input";
361
+ const Bo = R`
362
362
  from { opacity: 0; }
363
363
  to { opacity: 1; }
364
- `, mo = O`
364
+ `, Oo = R`
365
365
  from { opacity: 1; }
366
366
  to { opacity: 0; }
367
- `, ko = O`
367
+ `, jo = R`
368
368
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
369
369
  to { opacity: 1; transform: scale(1) translateY(0); }
370
- `, ho = O`
370
+ `, Ro = R`
371
371
  from { opacity: 1; transform: scale(1) translateY(0); }
372
372
  to { opacity: 0; transform: scale(0.95) translateY(-8px); }
373
- `, Co = i.div`
373
+ `, Ao = t.div`
374
374
  position: fixed;
375
375
  inset: 0;
376
376
  background-color: rgba(0, 0, 0, 0.5);
@@ -378,9 +378,9 @@ const vo = O`
378
378
  align-items: center;
379
379
  justify-content: center;
380
380
  z-index: ${({ theme: o }) => o.zIndex.modal};
381
- animation: ${({ $closing: o }) => o ? mo : vo} 0.15s ease
381
+ animation: ${({ $closing: o }) => o ? Oo : Bo} 0.15s ease
382
382
  forwards;
383
- `, zo = i.div`
383
+ `, Lo = t.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 vo = O`
389
389
  display: flex;
390
390
  flex-direction: column;
391
391
  max-height: 90vh;
392
- animation: ${({ $closing: o }) => o ? ho : ko} 0.15s ease
392
+ animation: ${({ $closing: o }) => o ? Ro : jo} 0.15s ease
393
393
  forwards;
394
394
 
395
- ${({ $size: o }) => o === "sm" && s`
395
+ ${({ $size: o }) => o === "sm" && n`
396
396
  width: min(400px, 90vw);
397
397
  `}
398
- ${({ $size: o }) => o === "md" && s`
398
+ ${({ $size: o }) => o === "md" && n`
399
399
  width: min(560px, 90vw);
400
400
  `}
401
- ${({ $size: o }) => o === "lg" && s`
401
+ ${({ $size: o }) => o === "lg" && n`
402
402
  width: min(720px, 90vw);
403
403
  `}
404
- ${({ $size: o }) => o === "fullscreen" && s`
404
+ ${({ $size: o }) => o === "fullscreen" && n`
405
405
  width: 100vw;
406
406
  height: 100vh;
407
407
  max-height: 100vh;
408
408
  border-radius: 0;
409
409
  `}
410
- `, So = i.div`
410
+ `, No = t.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
- `, Io = i.h2`
417
+ `, Vo = t.h2`
418
418
  flex: 1;
419
419
  font-size: ${({ theme: o }) => o.fontSizes.lg};
420
420
  font-weight: 600;
421
421
  margin: 0;
422
- `, To = i.button`
422
+ `, Do = t.button`
423
423
  display: inline-flex;
424
424
  align-items: center;
425
425
  justify-content: center;
@@ -444,11 +444,11 @@ const vo = O`
444
444
  outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
445
445
  outline-offset: 2px;
446
446
  }
447
- `, Wo = i.div`
447
+ `, Fo = t.div`
448
448
  padding: ${({ theme: o }) => o.spacing[4]};
449
449
  overflow-y: auto;
450
450
  flex: 1;
451
- `, Bo = i.div`
451
+ `, Mo = t.div`
452
452
  display: flex;
453
453
  align-items: center;
454
454
  justify-content: flex-end;
@@ -456,7 +456,7 @@ const vo = O`
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
- `, Oo = [
459
+ `, Po = [
460
460
  "button:not([disabled])",
461
461
  "input:not([disabled])",
462
462
  "select:not([disabled])",
@@ -464,89 +464,89 @@ const vo = O`
464
464
  "a[href]",
465
465
  '[tabindex]:not([tabindex="-1"])'
466
466
  ].join(", ");
467
- function q(o) {
467
+ function Q(o) {
468
468
  return Array.from(
469
- o.querySelectorAll(Oo)
469
+ o.querySelectorAll(Po)
470
470
  );
471
471
  }
472
- function Lo({
472
+ function Yo({
473
473
  open: o,
474
474
  onClose: r,
475
- title: n,
476
- children: t,
477
- footer: c,
478
- size: a = "md",
479
- closeOnBackdrop: e = !0,
480
- closeOnEscape: d = !0,
475
+ title: s,
476
+ children: a,
477
+ footer: l,
478
+ size: d = "md",
479
+ closeOnBackdrop: c = !0,
480
+ closeOnEscape: e = !0,
481
481
  ariaLabelledBy: p,
482
482
  ariaDescribedBy: u
483
483
  }) {
484
- const b = M(null), m = F(), $ = p ?? (n ? m : void 0), [x, w] = z(o), [S, C] = z(!1);
485
- return j(() => {
484
+ const x = Y(null), C = M(), w = p ?? (s ? C : void 0), [b, f] = W(o), [S, z] = W(!1);
485
+ return V(() => {
486
486
  if (o)
487
- w(!0), C(!1);
488
- else if (x) {
489
- C(!0);
490
- const k = setTimeout(() => {
491
- w(!1), C(!1);
487
+ f(!0), z(!1);
488
+ else if (b) {
489
+ z(!0);
490
+ const h = setTimeout(() => {
491
+ f(!1), z(!1);
492
492
  }, 150);
493
- return () => clearTimeout(k);
493
+ return () => clearTimeout(h);
494
494
  }
495
- }, [o, x]), j(() => {
495
+ }, [o, b]), V(() => {
496
496
  if (!o)
497
497
  return;
498
- const k = document.body.style.overflow;
498
+ const h = document.body.style.overflow;
499
499
  return document.body.style.overflow = "hidden", () => {
500
- document.body.style.overflow = k;
500
+ document.body.style.overflow = h;
501
501
  };
502
- }, [o]), j(() => {
503
- if (!o || !b.current)
502
+ }, [o]), V(() => {
503
+ if (!o || !x.current)
504
504
  return;
505
- const k = b.current, I = document.activeElement;
506
- (q(k)[0] ?? k).focus();
507
- const W = (f) => {
508
- if (f.key === "Escape" && d) {
505
+ const h = x.current, E = document.activeElement;
506
+ (Q(h)[0] ?? h).focus();
507
+ const O = ($) => {
508
+ if ($.key === "Escape" && e) {
509
509
  r();
510
510
  return;
511
511
  }
512
- if (f.key !== "Tab")
512
+ if ($.key !== "Tab")
513
513
  return;
514
- const g = q(k);
515
- if (g.length === 0) {
516
- f.preventDefault();
514
+ const y = Q(h);
515
+ if (y.length === 0) {
516
+ $.preventDefault();
517
517
  return;
518
518
  }
519
- const y = g[0], v = g[g.length - 1];
520
- f.shiftKey ? document.activeElement === y && (f.preventDefault(), v.focus()) : document.activeElement === v && (f.preventDefault(), y.focus());
519
+ const v = y[0], k = y[y.length - 1];
520
+ $.shiftKey ? document.activeElement === v && ($.preventDefault(), k.focus()) : document.activeElement === k && ($.preventDefault(), v.focus());
521
521
  };
522
- return document.addEventListener("keydown", W), () => {
523
- document.removeEventListener("keydown", W), I?.focus();
522
+ return document.addEventListener("keydown", O), () => {
523
+ document.removeEventListener("keydown", O), E?.focus();
524
524
  };
525
- }, [o, d, r, x]), x ? J(
526
- /* @__PURE__ */ l(
527
- Co,
525
+ }, [o, e, r, b]), b ? io(
526
+ /* @__PURE__ */ i(
527
+ Ao,
528
528
  {
529
529
  $closing: S,
530
- onClick: e ? r : void 0,
531
- children: /* @__PURE__ */ h(
532
- zo,
530
+ onClick: c ? r : void 0,
531
+ children: /* @__PURE__ */ m(
532
+ Lo,
533
533
  {
534
- ref: b,
534
+ ref: x,
535
535
  role: "dialog",
536
536
  "aria-modal": "true",
537
- "aria-labelledby": $,
537
+ "aria-labelledby": w,
538
538
  "aria-describedby": u,
539
- $size: a,
539
+ $size: d,
540
540
  $closing: S,
541
541
  tabIndex: -1,
542
- onClick: (k) => k.stopPropagation(),
542
+ onClick: (h) => h.stopPropagation(),
543
543
  children: [
544
- /* @__PURE__ */ h(So, { children: [
545
- n && /* @__PURE__ */ l(Io, { id: m, children: n }),
546
- /* @__PURE__ */ l(To, { onClick: r, "aria-label": "Close modal", children: "×" })
544
+ /* @__PURE__ */ m(No, { children: [
545
+ s && /* @__PURE__ */ i(Vo, { id: C, children: s }),
546
+ /* @__PURE__ */ i(Do, { onClick: r, "aria-label": "Close modal", children: "×" })
547
547
  ] }),
548
- /* @__PURE__ */ l(Wo, { children: t }),
549
- c && /* @__PURE__ */ l(Bo, { children: c })
548
+ /* @__PURE__ */ i(Fo, { children: a }),
549
+ l && /* @__PURE__ */ i(Mo, { children: l })
550
550
  ]
551
551
  }
552
552
  )
@@ -555,18 +555,18 @@ function Lo({
555
555
  document.body
556
556
  ) : null;
557
557
  }
558
- Lo.displayName = "Modal";
559
- const Q = (...o) => o.filter((r, n, t) => !!r && r.trim() !== "" && t.indexOf(r) === n).join(" ").trim();
560
- const jo = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
561
- const Fo = (o) => o.replace(
558
+ Yo.displayName = "Modal";
559
+ const ao = (...o) => o.filter((r, s, a) => !!r && r.trim() !== "" && a.indexOf(r) === s).join(" ").trim();
560
+ const Ho = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
561
+ const _o = (o) => o.replace(
562
562
  /^([A-Z])|[\s-_]+(\w)/g,
563
- (r, n, t) => t ? t.toUpperCase() : n.toLowerCase()
563
+ (r, s, a) => a ? a.toUpperCase() : s.toLowerCase()
564
564
  );
565
- const K = (o) => {
566
- const r = Fo(o);
565
+ const oo = (o) => {
566
+ const r = _o(o);
567
567
  return r.charAt(0).toUpperCase() + r.slice(1);
568
568
  };
569
- var R = {
569
+ var K = {
570
570
  xmlns: "http://www.w3.org/2000/svg",
571
571
  width: 24,
572
572
  height: 24,
@@ -577,69 +577,69 @@ var R = {
577
577
  strokeLinecap: "round",
578
578
  strokeLinejoin: "round"
579
579
  };
580
- const Eo = (o) => {
580
+ const Ko = (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
- }, No = X({}), Vo = () => Z(No), Ao = G(
586
- ({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth: t, className: c = "", children: a, iconNode: e, ...d }, p) => {
585
+ }, qo = so({}), Uo = () => no(qo), Zo = to(
586
+ ({ color: o, size: r, strokeWidth: s, absoluteStrokeWidth: a, className: l = "", children: d, iconNode: c, ...e }, p) => {
587
587
  const {
588
588
  size: u = 24,
589
- strokeWidth: b = 2,
590
- absoluteStrokeWidth: m = !1,
591
- color: $ = "currentColor",
592
- className: x = ""
593
- } = Vo() ?? {}, w = t ?? m ? Number(n ?? b) * 24 / Number(r ?? u) : n ?? b;
594
- return P(
589
+ strokeWidth: x = 2,
590
+ absoluteStrokeWidth: C = !1,
591
+ color: w = "currentColor",
592
+ className: b = ""
593
+ } = Uo() ?? {}, f = a ?? C ? Number(s ?? x) * 24 / Number(r ?? u) : s ?? x;
594
+ return q(
595
595
  "svg",
596
596
  {
597
597
  ref: p,
598
- ...R,
599
- width: r ?? u ?? R.width,
600
- height: r ?? u ?? R.height,
601
- stroke: o ?? $,
602
- strokeWidth: w,
603
- className: Q("lucide", x, c),
604
- ...!a && !Eo(d) && { "aria-hidden": "true" },
605
- ...d
598
+ ...K,
599
+ width: r ?? u ?? K.width,
600
+ height: r ?? u ?? K.height,
601
+ stroke: o ?? w,
602
+ strokeWidth: f,
603
+ className: ao("lucide", b, l),
604
+ ...!d && !Ko(e) && { "aria-hidden": "true" },
605
+ ...e
606
606
  },
607
607
  [
608
- ...e.map(([S, C]) => P(S, C)),
609
- ...Array.isArray(a) ? a : [a]
608
+ ...c.map(([S, z]) => q(S, z)),
609
+ ...Array.isArray(d) ? d : [d]
610
610
  ]
611
611
  );
612
612
  }
613
613
  );
614
- const oo = (o, r) => {
615
- const n = G(
616
- ({ className: t, ...c }, a) => P(Ao, {
617
- ref: a,
614
+ const eo = (o, r) => {
615
+ const s = to(
616
+ ({ className: a, ...l }, d) => q(Zo, {
617
+ ref: d,
618
618
  iconNode: r,
619
- className: Q(
620
- `lucide-${jo(K(o))}`,
619
+ className: ao(
620
+ `lucide-${Ho(oo(o))}`,
621
621
  `lucide-${o}`,
622
- t
622
+ a
623
623
  ),
624
- ...c
624
+ ...l
625
625
  })
626
626
  );
627
- return n.displayName = K(o), n;
627
+ return s.displayName = oo(o), s;
628
628
  };
629
- const Ro = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], ro = oo("chevron-down", Ro);
630
- const Mo = [
629
+ const Xo = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], lo = eo("chevron-down", Xo);
630
+ const Go = [
631
631
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
632
632
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
633
- ], no = oo("x", Mo), Po = O`
633
+ ], co = eo("x", Go), Jo = R`
634
634
  from { opacity: 0; transform: translateY(12px); }
635
635
  to { opacity: 1; transform: translateY(0); }
636
- `, Yo = O`
636
+ `, Qo = R`
637
637
  from { opacity: 0; transform: translateY(-12px); }
638
638
  to { opacity: 1; transform: translateY(0); }
639
- `, Do = O`
639
+ `, or = R`
640
640
  from { opacity: 1; }
641
641
  to { opacity: 0; }
642
- `, Ho = i.div`
642
+ `, rr = t.div`
643
643
  position: fixed;
644
644
  z-index: ${({ theme: o }) => o.zIndex.toast};
645
645
  display: flex;
@@ -649,85 +649,85 @@ const Mo = [
649
649
  max-width: 400px;
650
650
  padding: ${({ theme: o }) => `${o.spacing[3]} ${o.spacing[4]}`};
651
651
  border-radius: ${({ theme: o }) => o.radius.md};
652
- animation: ${({ $closing: o, $position: r }) => o ? s`
653
- ${Do} 0.2s ease forwards
654
- ` : r.startsWith("top") ? s`
655
- ${Yo} 0.2s ease forwards
656
- ` : s`
657
- ${Po} 0.2s ease forwards
652
+ animation: ${({ $closing: o, $position: r }) => o ? n`
653
+ ${or} 0.2s ease forwards
654
+ ` : r.startsWith("top") ? n`
655
+ ${Qo} 0.2s ease forwards
656
+ ` : n`
657
+ ${Jo} 0.2s ease forwards
658
658
  `};
659
659
 
660
660
  ${({ $position: o, theme: r }) => ({
661
- "bottom-right": s`
661
+ "bottom-right": n`
662
662
  bottom: ${r.spacing[6]};
663
663
  right: ${r.spacing[6]};
664
664
  `,
665
- "bottom-left": s`
665
+ "bottom-left": n`
666
666
  bottom: ${r.spacing[6]};
667
667
  left: ${r.spacing[6]};
668
668
  `,
669
- "top-right": s`
669
+ "top-right": n`
670
670
  top: ${r.spacing[6]};
671
671
  right: ${r.spacing[6]};
672
672
  `,
673
- "top-left": s`
673
+ "top-left": n`
674
674
  top: ${r.spacing[6]};
675
675
  left: ${r.spacing[6]};
676
676
  `
677
677
  })[o]}
678
- `, N = (o, r, n) => s`
678
+ `, P = (o, r, s) => n`
679
679
  background: ${r};
680
- border: ${o.brutalism.borderWidth} solid ${n};
680
+ border: ${o.brutalism.borderWidth} solid ${s};
681
681
  box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
682
- 0 ${n};
683
- `, _o = i(Ho)`
682
+ 0 ${s};
683
+ `, nr = t(rr)`
684
684
  ${({ $variant: o, theme: r }) => r.brutalism ? {
685
- success: N(
685
+ success: P(
686
686
  r,
687
687
  r.colors.success[50],
688
688
  r.colors.success[500]
689
689
  ),
690
- error: N(
690
+ error: P(
691
691
  r,
692
692
  r.colors.error[50],
693
693
  r.colors.error[500]
694
694
  ),
695
- warning: N(
695
+ warning: P(
696
696
  r,
697
697
  r.colors.warning[50],
698
698
  r.colors.warning[500]
699
699
  ),
700
- info: N(r, r.colors.info[50], r.colors.info[500])
700
+ info: P(r, r.colors.info[50], r.colors.info[500])
701
701
  }[o] : {
702
- success: s`
702
+ success: n`
703
703
  background: ${r.colors.success[50]};
704
704
  border-left: 4px solid ${r.colors.success[500]};
705
705
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
706
706
  `,
707
- error: s`
707
+ error: n`
708
708
  background: ${r.colors.error[50]};
709
709
  border-left: 4px solid ${r.colors.error[500]};
710
710
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
711
711
  `,
712
- warning: s`
712
+ warning: n`
713
713
  background: ${r.colors.warning[50]};
714
714
  border-left: 4px solid ${r.colors.warning[500]};
715
715
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
716
716
  `,
717
- info: s`
717
+ info: n`
718
718
  background: ${r.colors.info[50]};
719
719
  border-left: 4px solid ${r.colors.info[500]};
720
720
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
721
721
  `
722
722
  }[o]}
723
- `, qo = i.p`
723
+ `, sr = t.p`
724
724
  flex: 1;
725
725
  margin: 0;
726
726
  font-size: ${({ theme: o }) => o.fontSizes.sm};
727
727
  font-weight: ${({ theme: o }) => o.brutalism ? 600 : 400};
728
728
  line-height: 1.5;
729
729
  color: ${({ theme: o }) => o.colors.neutral[900]};
730
- `, Ko = i.button`
730
+ `, tr = t.button`
731
731
  flex-shrink: 0;
732
732
  display: inline-flex;
733
733
  align-items: center;
@@ -750,121 +750,121 @@ const Mo = [
750
750
  outline-offset: 2px;
751
751
  }
752
752
  `;
753
- function so({
753
+ function uo({
754
754
  open: o,
755
755
  onClose: r,
756
- message: n,
757
- variant: t = "info",
758
- duration: c = 4e3,
759
- position: a = "bottom-right"
756
+ message: s,
757
+ variant: a = "info",
758
+ duration: l = 4e3,
759
+ position: d = "bottom-right"
760
760
  }) {
761
- const [e, d] = z(o), [p, u] = z(!1);
762
- return j(() => {
761
+ const [c, e] = W(o), [p, u] = W(!1);
762
+ return V(() => {
763
763
  if (o)
764
- d(!0), u(!1);
765
- else if (e) {
764
+ e(!0), u(!1);
765
+ else if (c) {
766
766
  u(!0);
767
- const b = setTimeout(() => {
768
- d(!1), u(!1);
767
+ const x = setTimeout(() => {
768
+ e(!1), u(!1);
769
769
  }, 200);
770
- return () => clearTimeout(b);
770
+ return () => clearTimeout(x);
771
771
  }
772
- }, [o, e]), j(() => {
773
- if (!o || c === 0)
772
+ }, [o, c]), V(() => {
773
+ if (!o || l === 0)
774
774
  return;
775
- const b = setTimeout(r, c);
776
- return () => clearTimeout(b);
777
- }, [o, c, r]), e ? J(
778
- /* @__PURE__ */ h(
779
- _o,
775
+ const x = setTimeout(r, l);
776
+ return () => clearTimeout(x);
777
+ }, [o, l, r]), c ? io(
778
+ /* @__PURE__ */ m(
779
+ nr,
780
780
  {
781
- $position: a,
782
- $variant: t,
781
+ $position: d,
782
+ $variant: a,
783
783
  $closing: p,
784
784
  role: "alert",
785
785
  "aria-live": "polite",
786
786
  children: [
787
- /* @__PURE__ */ l(qo, { children: n }),
788
- /* @__PURE__ */ l(Ko, { onClick: r, "aria-label": "Close notification", children: /* @__PURE__ */ l(no, { size: 14, strokeWidth: 2.5 }) })
787
+ /* @__PURE__ */ i(sr, { children: s }),
788
+ /* @__PURE__ */ i(tr, { onClick: r, "aria-label": "Close notification", children: /* @__PURE__ */ i(co, { size: 14, strokeWidth: 2.5 }) })
789
789
  ]
790
790
  }
791
791
  ),
792
792
  document.body
793
793
  ) : null;
794
794
  }
795
- so.displayName = "Toast";
796
- const Uo = i.form`
795
+ uo.displayName = "Toast";
796
+ const ir = t.form`
797
797
  display: flex;
798
798
  flex-direction: column;
799
799
  gap: ${({ theme: o }) => o.spacing[4]};
800
- `, Zo = i.div`
800
+ `, ar = t.div`
801
801
  display: flex;
802
802
  flex-direction: column;
803
803
  gap: ${({ theme: o }) => o.spacing[1]};
804
- `, Xo = i.label`
804
+ `, er = t.label`
805
805
  font-size: ${({ theme: o }) => o.fontSizes.sm};
806
806
  font-weight: 500;
807
807
  color: ${({ theme: o }) => o.colors.neutral[900]};
808
- `, Go = i.span`
808
+ `, lr = t.span`
809
809
  color: ${({ theme: o }) => o.colors.error[500]};
810
810
  margin-left: 2px;
811
811
  aria-hidden: true;
812
- `, Jo = i.span`
812
+ `, cr = t.span`
813
813
  font-size: ${({ theme: o }) => o.fontSizes.xs};
814
814
  color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
815
815
  `;
816
- function Qo({ onSubmit: o, children: r, ...n }) {
817
- return /* @__PURE__ */ l(
818
- Uo,
816
+ function dr({ onSubmit: o, children: r, ...s }) {
817
+ return /* @__PURE__ */ i(
818
+ ir,
819
819
  {
820
- onSubmit: (t) => {
821
- t.preventDefault(), o?.(t);
820
+ onSubmit: (a) => {
821
+ a.preventDefault(), o?.(a);
822
822
  },
823
823
  noValidate: !0,
824
- ...n,
824
+ ...s,
825
825
  children: r
826
826
  }
827
827
  );
828
828
  }
829
- Qo.displayName = "Form";
830
- function or({
829
+ dr.displayName = "Form";
830
+ function ur({
831
831
  label: o,
832
832
  error: r,
833
- helperText: n,
834
- required: t,
835
- children: c
833
+ helperText: s,
834
+ required: a,
835
+ children: l
836
836
  }) {
837
- const a = F(), e = `${a}-hint`, d = !!(r || n), p = typeof r == "string" ? r : void 0, u = H.isValidElement(c) ? H.cloneElement(
838
- c,
837
+ const d = M(), c = `${d}-hint`, e = !!(r || s), p = typeof r == "string" ? r : void 0, u = G.isValidElement(l) ? G.cloneElement(
838
+ l,
839
839
  {
840
- id: a,
841
- ...d && { "aria-describedby": e },
840
+ id: d,
841
+ ...e && { "aria-describedby": c },
842
842
  ...r && { "aria-invalid": !0 }
843
843
  }
844
- ) : c;
845
- return /* @__PURE__ */ h(Zo, { children: [
846
- o && /* @__PURE__ */ h(Xo, { htmlFor: a, children: [
844
+ ) : l;
845
+ return /* @__PURE__ */ m(ar, { children: [
846
+ o && /* @__PURE__ */ m(er, { htmlFor: d, children: [
847
847
  o,
848
- t && /* @__PURE__ */ l(Go, { "aria-hidden": "true", children: " *" })
848
+ a && /* @__PURE__ */ i(lr, { "aria-hidden": "true", children: " *" })
849
849
  ] }),
850
850
  u,
851
- d && /* @__PURE__ */ l(Jo, { id: e, $error: !!r, children: p ?? n })
851
+ e && /* @__PURE__ */ i(cr, { id: c, $error: !!r, children: p ?? s })
852
852
  ] });
853
853
  }
854
- or.displayName = "FormField";
855
- const rr = i.div`
854
+ ur.displayName = "FormField";
855
+ const pr = t.div`
856
856
  display: inline-flex;
857
857
  flex-direction: column;
858
858
  gap: ${({ theme: o }) => o.spacing[1]};
859
859
  width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
860
- `, nr = i.div`
860
+ `, fr = t.div`
861
861
  position: relative;
862
862
  display: flex;
863
863
  width: 100%;
864
- `, sr = i.span`
864
+ `, $r = t.span`
865
865
  font-size: ${({ theme: o }) => o.fontSizes.xs};
866
866
  color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
867
- `, tr = i.select`
867
+ `, br = t.select`
868
868
  appearance: none;
869
869
  width: 100%;
870
870
  border-radius: ${({ theme: o }) => o.radius.md};
@@ -876,15 +876,15 @@ const rr = i.div`
876
876
  box-shadow 0.2s;
877
877
 
878
878
  ${({ $size: o, theme: r }) => ({
879
- sm: s`
879
+ sm: n`
880
880
  padding: ${r.spacing[1]} ${r.spacing[2]};
881
881
  font-size: ${r.fontSizes.sm};
882
882
  `,
883
- md: s`
883
+ md: n`
884
884
  padding: ${r.spacing[2]} ${r.spacing[3]};
885
885
  font-size: ${r.fontSizes.md};
886
886
  `,
887
- lg: s`
887
+ lg: n`
888
888
  padding: ${r.spacing[3]} ${r.spacing[4]};
889
889
  font-size: ${r.fontSizes.lg};
890
890
  `
@@ -892,27 +892,27 @@ const rr = i.div`
892
892
 
893
893
  padding-right: 2.5rem;
894
894
 
895
- ${({ $variant: o, theme: r }) => r.brutalism ? s`
895
+ ${({ $variant: o, theme: r }) => r.brutalism ? n`
896
896
  border: ${r.brutalism.borderWidth} solid
897
897
  ${r.colors.neutral[900]};
898
898
  background-color: ${r.colors.neutral[0]};
899
899
  box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
900
900
  ` : {
901
- default: s`
901
+ default: n`
902
902
  border: 1px solid ${r.colors.neutral[400]};
903
903
  background-color: ${r.colors.neutral[0]};
904
904
  `,
905
- outlined: s`
905
+ outlined: n`
906
906
  border: 2px solid ${r.colors.primary[500]};
907
907
  background-color: ${r.colors.neutral[0]};
908
908
  `,
909
- filled: s`
909
+ filled: n`
910
910
  border: 1px solid transparent;
911
911
  background-color: ${r.colors.neutral[100]};
912
912
  `
913
913
  }[o]}
914
914
 
915
- ${({ $error: o, theme: r }) => o && s`
915
+ ${({ $error: o, theme: r }) => o && n`
916
916
  border-color: ${r.colors.error[500]};
917
917
  `}
918
918
 
@@ -925,7 +925,7 @@ const rr = i.div`
925
925
  cursor: not-allowed;
926
926
  opacity: 0.6;
927
927
  }
928
- `, ir = i.button`
928
+ `, gr = t.button`
929
929
  position: absolute;
930
930
  right: ${({ theme: o }) => o.spacing[3]};
931
931
  top: 50%;
@@ -947,7 +947,7 @@ const rr = i.div`
947
947
  outline-offset: 2px;
948
948
  border-radius: 2px;
949
949
  }
950
- `, er = i.span`
950
+ `, xr = t.span`
951
951
  position: absolute;
952
952
  right: ${({ theme: o }) => o.spacing[3]};
953
953
  top: 50%;
@@ -957,63 +957,63 @@ const rr = i.div`
957
957
  align-items: center;
958
958
  color: ${({ theme: o }) => o.colors.neutral[500]};
959
959
  `;
960
- function ar({
960
+ function yr({
961
961
  options: o,
962
962
  placeholder: r,
963
- size: n = "md",
964
- variant: t = "default",
965
- error: c,
966
- fullWidth: a,
967
- clearable: e,
968
- onClear: d,
963
+ size: s = "md",
964
+ variant: a = "default",
965
+ error: l,
966
+ fullWidth: d,
967
+ clearable: c,
968
+ onClear: e,
969
969
  id: p,
970
970
  value: u,
971
- defaultValue: b,
972
- onChange: m,
973
- ...$
971
+ defaultValue: x,
972
+ onChange: C,
973
+ ...w
974
974
  }) {
975
- const x = F(), w = p ?? x, S = `${w}-hint`, C = typeof c == "string" ? c : void 0, [k, I] = z(
976
- b ?? ""
977
- ), T = u !== void 0, W = T ? u : k, f = (v) => {
978
- T || I(v.target.value), m?.(v);
979
- }, g = () => {
980
- T || I(""), d?.();
981
- }, y = e && !!W;
982
- return /* @__PURE__ */ h(rr, { $fullWidth: a, children: [
983
- /* @__PURE__ */ h(nr, { children: [
984
- /* @__PURE__ */ h(
985
- tr,
975
+ const b = M(), f = p ?? b, S = `${f}-hint`, z = typeof l == "string" ? l : void 0, [h, E] = W(
976
+ x ?? ""
977
+ ), B = u !== void 0, O = B ? u : h, $ = (k) => {
978
+ B || E(k.target.value), C?.(k);
979
+ }, y = () => {
980
+ B || E(""), e?.();
981
+ }, v = c && !!O;
982
+ return /* @__PURE__ */ m(pr, { $fullWidth: d, children: [
983
+ /* @__PURE__ */ m(fr, { children: [
984
+ /* @__PURE__ */ m(
985
+ br,
986
986
  {
987
- id: w,
988
- $size: n,
989
- $variant: t,
990
- $error: !!c,
991
- "aria-invalid": !!c,
992
- "aria-describedby": C ? S : void 0,
993
- value: W,
994
- onChange: f,
995
- ...$,
987
+ id: f,
988
+ $size: s,
989
+ $variant: a,
990
+ $error: !!l,
991
+ "aria-invalid": !!l,
992
+ "aria-describedby": z ? S : void 0,
993
+ value: O,
994
+ onChange: $,
995
+ ...w,
996
996
  children: [
997
- r && /* @__PURE__ */ l("option", { value: "", disabled: !0, children: r }),
998
- o.map((v) => /* @__PURE__ */ l("option", { value: v.value, disabled: v.disabled, children: v.label }, v.value))
997
+ r && /* @__PURE__ */ i("option", { value: "", disabled: !0, children: r }),
998
+ o.map((k) => /* @__PURE__ */ i("option", { value: k.value, disabled: k.disabled, children: k.label }, k.value))
999
999
  ]
1000
1000
  }
1001
1001
  ),
1002
- y ? /* @__PURE__ */ l(
1003
- ir,
1002
+ v ? /* @__PURE__ */ i(
1003
+ gr,
1004
1004
  {
1005
1005
  type: "button",
1006
- onClick: g,
1006
+ onClick: y,
1007
1007
  "aria-label": "Clear selection",
1008
- children: /* @__PURE__ */ l(no, { size: 14 })
1008
+ children: /* @__PURE__ */ i(co, { size: 14 })
1009
1009
  }
1010
- ) : /* @__PURE__ */ l(er, { "aria-hidden": "true", children: /* @__PURE__ */ l(ro, { size: 14 }) })
1010
+ ) : /* @__PURE__ */ i(xr, { "aria-hidden": "true", children: /* @__PURE__ */ i(lo, { size: 14 }) })
1011
1011
  ] }),
1012
- C && /* @__PURE__ */ l(sr, { id: S, $error: !0, children: C })
1012
+ z && /* @__PURE__ */ i($r, { id: S, $error: !0, children: z })
1013
1013
  ] });
1014
1014
  }
1015
- ar.displayName = "Select";
1016
- const lr = i.a`
1015
+ yr.displayName = "Select";
1016
+ const wr = t.a`
1017
1017
  text-decoration: underline;
1018
1018
  text-underline-offset: 2px;
1019
1019
  transition: color 0.15s;
@@ -1025,13 +1025,13 @@ const lr = i.a`
1025
1025
  }
1026
1026
 
1027
1027
  ${({ $variant: o, theme: r }) => ({
1028
- default: s`
1028
+ default: n`
1029
1029
  color: ${r.colors.primary[500]};
1030
1030
  &:hover {
1031
1031
  color: ${r.colors.primary[700]};
1032
1032
  }
1033
1033
  `,
1034
- subtle: s`
1034
+ subtle: n`
1035
1035
  color: ${r.colors.neutral[500]};
1036
1036
  &:hover {
1037
1037
  color: ${r.colors.neutral[900]};
@@ -1039,39 +1039,39 @@ const lr = i.a`
1039
1039
  `
1040
1040
  })[o]}
1041
1041
  `;
1042
- function cr({
1042
+ function vr({
1043
1043
  variant: o = "default",
1044
1044
  external: r,
1045
- children: n,
1046
- ...t
1045
+ children: s,
1046
+ ...a
1047
1047
  }) {
1048
- return /* @__PURE__ */ l(
1049
- lr,
1048
+ return /* @__PURE__ */ i(
1049
+ wr,
1050
1050
  {
1051
1051
  $variant: o,
1052
1052
  ...r && { target: "_blank", rel: "noreferrer" },
1053
- ...t,
1054
- children: n
1053
+ ...a,
1054
+ children: s
1055
1055
  }
1056
1056
  );
1057
1057
  }
1058
- cr.displayName = "Link";
1059
- const dr = i.div`
1058
+ vr.displayName = "Link";
1059
+ const mr = t.div`
1060
1060
  border-radius: ${({ theme: o }) => o.radius.md};
1061
1061
  background: ${({ theme: o }) => o.colors.neutral[0]};
1062
1062
  overflow: hidden;
1063
1063
 
1064
- ${({ theme: o, $accentColor: r }) => o.brutalism ? s`
1064
+ ${({ theme: o, $accentColor: r }) => o.brutalism ? n`
1065
1065
  border: ${o.brutalism.borderWidth} solid
1066
1066
  ${r ?? o.colors.neutral[900]};
1067
1067
  box-shadow: ${o.brutalism.shadowOffset}
1068
1068
  ${o.brutalism.shadowOffset} 0
1069
1069
  ${r ?? o.colors.neutral[900]};
1070
- ` : s`
1070
+ ` : n`
1071
1071
  border: 1px solid ${r ?? o.colors.neutral[200]};
1072
1072
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
1073
1073
  `}
1074
- `, ur = i.button`
1074
+ `, hr = t.button`
1075
1075
  width: 100%;
1076
1076
  display: flex;
1077
1077
  align-items: flex-start;
@@ -1091,19 +1091,19 @@ const dr = i.div`
1091
1091
  ${({ theme: o, $accentColor: r }) => r ?? o.colors.primary[500]};
1092
1092
  outline-offset: -2px;
1093
1093
  }
1094
- `, fr = i.div`
1094
+ `, kr = t.div`
1095
1095
  flex: 1;
1096
1096
  min-width: 0;
1097
- `, pr = i.span`
1097
+ `, Cr = t.span`
1098
1098
  display: block;
1099
1099
  font-size: ${({ theme: o }) => o.fontSizes.md};
1100
1100
  font-weight: 600;
1101
1101
  color: ${({ theme: o }) => o.colors.neutral[900]};
1102
- `, gr = i.span`
1102
+ `, zr = t.span`
1103
1103
  display: block;
1104
1104
  font-size: ${({ theme: o }) => o.fontSizes.sm};
1105
1105
  color: ${({ theme: o }) => o.colors.neutral[500]};
1106
- `, $r = i.div`
1106
+ `, Sr = t.div`
1107
1107
  display: flex;
1108
1108
  flex-direction: row;
1109
1109
  align-items: center;
@@ -1115,11 +1115,11 @@ const dr = i.div`
1115
1115
  align-items: flex-start;
1116
1116
  gap: ${({ theme: o }) => o.spacing[2]};
1117
1117
  }
1118
- `, br = i.div`
1118
+ `, Tr = t.div`
1119
1119
  display: flex;
1120
1120
  align-items: center;
1121
1121
  gap: ${({ theme: o }) => o.spacing[2]};
1122
- `, xr = i.span`
1122
+ `, Ir = t.span`
1123
1123
  display: inline-flex;
1124
1124
  align-items: center;
1125
1125
  justify-content: center;
@@ -1127,79 +1127,79 @@ const dr = i.div`
1127
1127
  transition: transform 0.2s ease;
1128
1128
  transform: ${({ $open: o }) => o ? "rotate(180deg)" : "rotate(0deg)"};
1129
1129
  color: ${({ theme: o, $accentColor: r }) => r ?? o.colors.neutral[500]};
1130
- `, yr = i.div`
1130
+ `, Wr = t.div`
1131
1131
  display: grid;
1132
1132
  grid-template-rows: ${({ $open: o }) => o ? "1fr" : "0fr"};
1133
1133
  transition: grid-template-rows 0.2s ease;
1134
- `, wr = i.div`
1134
+ `, Er = t.div`
1135
1135
  overflow: hidden;
1136
- `, vr = i.div`
1136
+ `, Br = t.div`
1137
1137
  padding: ${({ theme: o }) => o.spacing[4]};
1138
1138
  border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
1139
1139
  `;
1140
- function mr({
1140
+ function Or({
1141
1141
  title: o,
1142
1142
  children: r,
1143
- defaultOpen: n = !1,
1144
- open: t,
1145
- onToggle: c,
1146
- subtitle: a,
1147
- headerActions: e,
1148
- accentColor: d
1143
+ defaultOpen: s = !1,
1144
+ open: a,
1145
+ onToggle: l,
1146
+ subtitle: d,
1147
+ headerActions: c,
1148
+ accentColor: e
1149
1149
  }) {
1150
- const [p, u] = z(n), b = F(), m = t !== void 0, $ = m ? t : p;
1151
- return /* @__PURE__ */ h(dr, { $accentColor: d, children: [
1152
- /* @__PURE__ */ h(
1153
- ur,
1150
+ const [p, u] = W(s), x = M(), C = a !== void 0, w = C ? a : p;
1151
+ return /* @__PURE__ */ m(mr, { $accentColor: e, children: [
1152
+ /* @__PURE__ */ m(
1153
+ hr,
1154
1154
  {
1155
1155
  type: "button",
1156
- $open: $,
1157
- $accentColor: d,
1158
- "aria-expanded": $,
1159
- "aria-controls": b,
1156
+ $open: w,
1157
+ $accentColor: e,
1158
+ "aria-expanded": w,
1159
+ "aria-controls": x,
1160
1160
  onClick: () => {
1161
- const w = !$;
1162
- m || u(w), c?.(w);
1161
+ const f = !w;
1162
+ C || u(f), l?.(f);
1163
1163
  },
1164
1164
  children: [
1165
- /* @__PURE__ */ h(fr, { children: [
1166
- /* @__PURE__ */ l(pr, { children: o }),
1167
- (a || e) && /* @__PURE__ */ h($r, { children: [
1168
- a && /* @__PURE__ */ l(gr, { children: a }),
1169
- e && /* @__PURE__ */ l(br, { onClick: (w) => w.stopPropagation(), children: e })
1165
+ /* @__PURE__ */ m(kr, { children: [
1166
+ /* @__PURE__ */ i(Cr, { children: o }),
1167
+ (d || c) && /* @__PURE__ */ m(Sr, { children: [
1168
+ d && /* @__PURE__ */ i(zr, { children: d }),
1169
+ c && /* @__PURE__ */ i(Tr, { onClick: (f) => f.stopPropagation(), children: c })
1170
1170
  ] })
1171
1171
  ] }),
1172
- /* @__PURE__ */ l(
1173
- xr,
1172
+ /* @__PURE__ */ i(
1173
+ Ir,
1174
1174
  {
1175
- $open: $,
1176
- $accentColor: d,
1175
+ $open: w,
1176
+ $accentColor: e,
1177
1177
  "aria-hidden": "true",
1178
- children: /* @__PURE__ */ l(ro, { size: 18, strokeWidth: 2.5 })
1178
+ children: /* @__PURE__ */ i(lo, { size: 18, strokeWidth: 2.5 })
1179
1179
  }
1180
1180
  )
1181
1181
  ]
1182
1182
  }
1183
1183
  ),
1184
- /* @__PURE__ */ l(yr, { $open: $, children: /* @__PURE__ */ l(wr, { id: b, role: "region", "aria-label": o, children: /* @__PURE__ */ l(vr, { children: r }) }) })
1184
+ /* @__PURE__ */ i(Wr, { $open: w, children: /* @__PURE__ */ i(Er, { id: x, role: "region", "aria-label": o, children: /* @__PURE__ */ i(Br, { children: r }) }) })
1185
1185
  ] });
1186
1186
  }
1187
- mr.displayName = "CollapsibleCard";
1188
- const to = X(null);
1189
- function Or({ children: o }) {
1190
- const [r, n] = z(null), t = B((a) => {
1191
- n({ ...a, id: Date.now() });
1192
- }, []), c = ao(() => {
1193
- const a = (e) => t(e);
1194
- return a.success = (e, d) => t({ ...d, message: e, variant: "success" }), a.error = (e, d) => t({ ...d, message: e, variant: "error" }), a.warning = (e, d) => t({ ...d, message: e, variant: "warning" }), a.info = (e, d) => t({ ...d, message: e, variant: "info" }), a;
1195
- }, [t]);
1196
- return /* @__PURE__ */ h(to.Provider, { value: { toast: c }, children: [
1187
+ Or.displayName = "CollapsibleCard";
1188
+ const po = so(null);
1189
+ function Gr({ children: o }) {
1190
+ const [r, s] = W(null), a = j((d) => {
1191
+ s({ ...d, id: Date.now() });
1192
+ }, []), l = wo(() => {
1193
+ const d = (c) => a(c);
1194
+ return d.success = (c, e) => a({ ...e, message: c, variant: "success" }), d.error = (c, e) => a({ ...e, message: c, variant: "error" }), d.warning = (c, e) => a({ ...e, message: c, variant: "warning" }), d.info = (c, e) => a({ ...e, message: c, variant: "info" }), d;
1195
+ }, [a]);
1196
+ return /* @__PURE__ */ m(po.Provider, { value: { toast: l }, children: [
1197
1197
  o,
1198
- r && /* @__PURE__ */ l(
1199
- so,
1198
+ r && /* @__PURE__ */ i(
1199
+ uo,
1200
1200
  {
1201
1201
  open: !0,
1202
- onClose: () => n(null),
1202
+ onClose: () => s(null),
1203
1203
  message: r.message,
1204
1204
  variant: r.variant,
1205
1205
  duration: r.duration,
@@ -1209,89 +1209,395 @@ function Or({ children: o }) {
1209
1209
  )
1210
1210
  ] });
1211
1211
  }
1212
- function Lr() {
1213
- const o = Z(to);
1212
+ function Jr() {
1213
+ const o = no(po);
1214
1214
  if (!o)
1215
1215
  throw new Error("useToast must be used within a ToastProvider");
1216
1216
  return o;
1217
1217
  }
1218
- function jr({
1218
+ function Qr({
1219
1219
  initialValues: o,
1220
1220
  validate: r,
1221
- onSubmit: n,
1222
- onError: t
1221
+ onSubmit: s,
1222
+ onError: a
1223
1223
  }) {
1224
- const [c, a] = z(o), [e, d] = z(
1224
+ const [l, d] = W(o), [c, e] = W(
1225
1225
  {}
1226
- ), [p, u] = z({}), [b, m] = z(!1), $ = M(c);
1227
- $.current = c;
1228
- const x = B(
1229
- (f) => {
1226
+ ), [p, u] = W({}), [x, C] = W(!1), w = Y(l);
1227
+ w.current = l;
1228
+ const b = j(
1229
+ ($) => {
1230
1230
  if (!r)
1231
1231
  return {};
1232
- const g = r(f);
1232
+ const y = r($);
1233
1233
  return Object.fromEntries(
1234
- Object.entries(g).filter(([, y]) => y !== void 0)
1234
+ Object.entries(y).filter(([, v]) => v !== void 0)
1235
1235
  );
1236
1236
  },
1237
1237
  [r]
1238
- ), w = M(p);
1239
- w.current = p;
1240
- const S = B(
1241
- (f) => {
1242
- const { name: g, value: y } = f.target, v = { ...$.current, [g]: y };
1243
- a(v), w.current[g] && d(x(v));
1238
+ ), f = Y(p);
1239
+ f.current = p;
1240
+ const S = j(
1241
+ ($) => {
1242
+ const { name: y, value: v } = $.target, k = { ...w.current, [y]: v };
1243
+ d(k), f.current[y] && e(b(k));
1244
1244
  },
1245
- [x]
1246
- ), C = B(
1247
- (f) => {
1248
- const { name: g } = f.target;
1249
- u((y) => ({ ...y, [g]: !0 })), d(x($.current));
1245
+ [b]
1246
+ ), z = j(
1247
+ ($) => {
1248
+ const { name: y } = $.target;
1249
+ u((v) => ({ ...v, [y]: !0 })), e(b(w.current));
1250
1250
  },
1251
- [x]
1252
- ), k = B(
1253
- (f) => {
1254
- f?.preventDefault();
1255
- const g = Object.keys($.current).reduce(
1256
- (E, V) => ({ ...E, [V]: !0 }),
1251
+ [b]
1252
+ ), h = j(
1253
+ ($) => {
1254
+ $?.preventDefault();
1255
+ const y = Object.keys(w.current).reduce(
1256
+ (A, D) => ({ ...A, [D]: !0 }),
1257
1257
  {}
1258
1258
  );
1259
- u(g);
1260
- const y = x($.current);
1261
- if (d(y), Object.keys(y).length > 0) {
1262
- t?.(y);
1259
+ u(y);
1260
+ const v = b(w.current);
1261
+ if (e(v), Object.keys(v).length > 0) {
1262
+ a?.(v);
1263
1263
  return;
1264
1264
  }
1265
1265
  (async () => {
1266
- m(!0);
1266
+ C(!0);
1267
1267
  try {
1268
- await n?.($.current);
1268
+ await s?.(w.current);
1269
1269
  } finally {
1270
- m(!1);
1270
+ C(!1);
1271
1271
  }
1272
1272
  })();
1273
1273
  },
1274
- [x, n, t]
1275
- ), I = B((f, g) => {
1276
- a((y) => ({ ...y, [f]: g }));
1277
- }, []), T = B(() => {
1278
- a(o), d({}), u({}), m(!1);
1279
- }, [o]), W = Object.fromEntries(
1280
- Object.entries(e).filter(([f]) => p[f])
1274
+ [b, s, a]
1275
+ ), E = j(($, y) => {
1276
+ d((v) => ({ ...v, [$]: y }));
1277
+ }, []), B = j(() => {
1278
+ d(o), e({}), u({}), C(!1);
1279
+ }, [o]), O = Object.fromEntries(
1280
+ Object.entries(c).filter(([$]) => p[$])
1281
1281
  );
1282
1282
  return {
1283
- values: c,
1284
- errors: W,
1283
+ values: l,
1284
+ errors: O,
1285
1285
  touched: p,
1286
1286
  handleChange: S,
1287
- handleBlur: C,
1288
- handleSubmit: k,
1289
- setFieldValue: I,
1290
- reset: T,
1291
- isSubmitting: b
1287
+ handleBlur: z,
1288
+ handleSubmit: h,
1289
+ setFieldValue: E,
1290
+ reset: B,
1291
+ isSubmitting: x
1292
1292
  };
1293
1293
  }
1294
- const U = {
1294
+ const fo = t.div`
1295
+ overflow-x: auto;
1296
+ width: 100%;
1297
+
1298
+ ${({ theme: o }) => o.brutalism ? n`
1299
+ border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
1300
+ box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
1301
+ 0 ${o.colors.neutral[900]};
1302
+ ` : n`
1303
+ border: 1px solid ${o.colors.neutral[300]};
1304
+ border-radius: ${o.radius.md};
1305
+ overflow: hidden;
1306
+ `}
1307
+ `, $o = t.table`
1308
+ width: 100%;
1309
+ border-collapse: collapse;
1310
+ font-size: ${({ $size: o, theme: r }) => ({
1311
+ sm: r.fontSizes.sm,
1312
+ md: r.fontSizes.md,
1313
+ lg: r.fontSizes.lg
1314
+ })[o]};
1315
+ `, bo = t.thead`
1316
+ ${({ theme: o }) => o.brutalism ? n`
1317
+ background-color: ${o.colors.neutral[900]};
1318
+ color: ${o.colors.neutral[0]};
1319
+ ` : n`
1320
+ background-color: ${o.colors.neutral[100]};
1321
+ color: ${o.colors.neutral[600]};
1322
+ `}
1323
+ `, go = t.tbody`
1324
+ ${({ $variant: o, theme: r }) => o === "striped" && n`
1325
+ tr:nth-child(even) {
1326
+ background-color: ${r.colors.neutral[100]};
1327
+ }
1328
+ `}
1329
+
1330
+ tr:last-child td {
1331
+ border-bottom: none;
1332
+ }
1333
+ `, H = t.tr``, Z = t.th`
1334
+ text-align: left;
1335
+ font-weight: 700;
1336
+ white-space: nowrap;
1337
+
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]}
1349
+
1350
+ ${({ theme: o }) => o.brutalism ? n`
1351
+ border-right: 1px solid ${o.colors.neutral[600]};
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]};
1358
+ &:last-child {
1359
+ border-right: none;
1360
+ }
1361
+ `}
1362
+ `, X = t.td`
1363
+ ${({ $size: o, theme: r }) => ({
1364
+ sm: n`
1365
+ padding: ${r.spacing[1]} ${r.spacing[2]};
1366
+ `,
1367
+ md: n`
1368
+ padding: ${r.spacing[2]} ${r.spacing[3]};
1369
+ `,
1370
+ lg: n`
1371
+ padding: ${r.spacing[3]} ${r.spacing[4]};
1372
+ `
1373
+ })[o]}
1374
+
1375
+ ${({ $variant: o, theme: r }) => r.brutalism ? n`
1376
+ border-bottom: ${r.brutalism.borderWidth} solid
1377
+ ${r.colors.neutral[900]};
1378
+ ${o === "bordered" && n`
1379
+ border-right: ${r.brutalism.borderWidth} solid
1380
+ ${r.colors.neutral[900]};
1381
+ &:last-child {
1382
+ border-right: none;
1383
+ }
1384
+ `}
1385
+ ` : o === "bordered" ? n`
1386
+ border: 1px solid ${r.colors.neutral[300]};
1387
+ ` : n`
1388
+ border-bottom: 1px solid ${r.colors.neutral[200]};
1389
+ `}
1390
+ `;
1391
+ function jr({
1392
+ columns: o,
1393
+ data: r,
1394
+ size: s = "md",
1395
+ variant: a = "default",
1396
+ caption: l,
1397
+ className: d,
1398
+ style: c
1399
+ }) {
1400
+ return /* @__PURE__ */ i(fo, { className: d, style: c, children: /* @__PURE__ */ m($o, { $size: s, children: [
1401
+ l && /* @__PURE__ */ i("caption", { children: l }),
1402
+ /* @__PURE__ */ i(bo, { children: /* @__PURE__ */ i(H, { children: o.map((e) => /* @__PURE__ */ i(
1403
+ Z,
1404
+ {
1405
+ $size: s,
1406
+ style: e.width ? { width: e.width } : void 0,
1407
+ children: e.header
1408
+ },
1409
+ e.key
1410
+ )) }) }),
1411
+ /* @__PURE__ */ i(go, { $variant: a, children: r.map((e, p) => /* @__PURE__ */ i(H, { children: o.map((u) => /* @__PURE__ */ i(X, { $size: s, $variant: a, children: u.render ? u.render(e[u.key], e, p) : String(e[u.key] ?? "") }, u.key)) }, p)) })
1412
+ ] }) });
1413
+ }
1414
+ jr.displayName = "Table";
1415
+ const Rr = t(X)`
1416
+ ${({ $editable: o, theme: r }) => o && n`
1417
+ cursor: pointer;
1418
+ position: relative;
1419
+
1420
+ &:hover {
1421
+ background-color: ${r.brutalism ? r.colors.neutral[100] : r.colors.primary[50]};
1422
+ }
1423
+ `}
1424
+ `, Ar = t.input`
1425
+ width: 100%;
1426
+ border: none;
1427
+ outline: none;
1428
+ background: transparent;
1429
+ font: inherit;
1430
+ color: inherit;
1431
+ padding: 0;
1432
+ margin: 0;
1433
+
1434
+ ${({ theme: o }) => o.brutalism ? n`
1435
+ &:focus {
1436
+ outline: 2px solid ${o.colors.neutral[900]};
1437
+ outline-offset: 1px;
1438
+ }
1439
+ ` : n`
1440
+ &:focus {
1441
+ box-shadow: ${o.shadows.focusRing};
1442
+ }
1443
+ `}
1444
+ `, Lr = t(Z)`
1445
+ width: 40px;
1446
+ `, Nr = t(X)`
1447
+ width: 40px;
1448
+ text-align: center;
1449
+ padding-left: 0;
1450
+ padding-right: 0;
1451
+ `, Vr = t.button`
1452
+ display: inline-flex;
1453
+ align-items: center;
1454
+ justify-content: center;
1455
+ width: 24px;
1456
+ height: 24px;
1457
+ padding: 0;
1458
+ background: none;
1459
+ border: none;
1460
+ cursor: pointer;
1461
+ font-size: ${({ theme: o }) => o.fontSizes.xs};
1462
+ color: ${({ theme: o }) => o.colors.neutral[500]};
1463
+ border-radius: ${({ theme: o }) => o.radius.md};
1464
+ transition: color 0.1s;
1465
+
1466
+ &:hover {
1467
+ color: ${({ theme: o }) => o.colors.error[500]};
1468
+
1469
+ ${({ theme: o }) => o.brutalism && n`
1470
+ background-color: ${o.colors.error[50]};
1471
+ `}
1472
+ }
1473
+ `, Dr = t.tr`
1474
+ ${({ theme: o }) => o.brutalism ? n`
1475
+ border-top: ${o.brutalism.borderWidth} solid
1476
+ ${o.colors.neutral[900]};
1477
+ ` : n`
1478
+ border-top: 1px solid ${o.colors.neutral[200]};
1479
+ `}
1480
+ `, Fr = t.button`
1481
+ display: inline-flex;
1482
+ align-items: center;
1483
+ gap: ${({ theme: o }) => o.spacing[1]};
1484
+ background: none;
1485
+ border: none;
1486
+ cursor: pointer;
1487
+ font: inherit;
1488
+ font-weight: 600;
1489
+ color: ${({ theme: o }) => o.colors.neutral[600]};
1490
+ padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
1491
+ width: 100%;
1492
+ text-align: left;
1493
+
1494
+ &:hover {
1495
+ color: ${({ theme: o }) => o.brutalism ? o.colors.neutral[900] : o.colors.primary[500]};
1496
+ }
1497
+
1498
+ &:focus-visible {
1499
+ outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
1500
+ outline-offset: 2px;
1501
+ }
1502
+ `;
1503
+ function Mr({
1504
+ columns: o,
1505
+ defaultData: r,
1506
+ data: s,
1507
+ onChange: a,
1508
+ size: l = "md",
1509
+ addRowLabel: d = "Add row",
1510
+ newRowFactory: c,
1511
+ deletable: e = !1,
1512
+ className: p,
1513
+ style: u
1514
+ }) {
1515
+ const x = s !== void 0, [C, w] = W(r ?? []), b = x ? s : C, [f, S] = W(null), [z, h] = W(""), E = Y(null);
1516
+ V(() => {
1517
+ f && (E.current?.focus(), E.current?.select());
1518
+ }, [f]);
1519
+ const B = j(
1520
+ (g) => {
1521
+ x || w(g), a?.(g);
1522
+ },
1523
+ [x, a]
1524
+ ), O = (g, T, I) => {
1525
+ S({ rowIndex: g, colKey: T }), h(String(I ?? ""));
1526
+ }, $ = j(() => {
1527
+ if (!f) return;
1528
+ const { rowIndex: g, colKey: T } = f, I = b.map(
1529
+ (L, F) => F === g ? { ...L, [T]: z } : L
1530
+ );
1531
+ B(I), S(null);
1532
+ }, [f, b, z, B]), y = () => {
1533
+ S(null), h("");
1534
+ }, v = (g) => {
1535
+ g.key === "Enter" && $(), g.key === "Escape" && y();
1536
+ }, k = () => {
1537
+ const g = c ? c() : Object.fromEntries(o.map((T) => [T.key, ""]));
1538
+ B([...b, g]);
1539
+ }, A = (g) => {
1540
+ f?.rowIndex === g && S(null), B(b.filter((T, I) => I !== g));
1541
+ }, D = e ? o.length + 1 : o.length;
1542
+ return /* @__PURE__ */ i(fo, { className: p, style: u, children: /* @__PURE__ */ m($o, { $size: l, children: [
1543
+ /* @__PURE__ */ i(bo, { children: /* @__PURE__ */ m(H, { children: [
1544
+ o.map((g) => /* @__PURE__ */ i(
1545
+ Z,
1546
+ {
1547
+ $size: l,
1548
+ style: g.width ? { width: g.width } : void 0,
1549
+ children: g.header
1550
+ },
1551
+ g.key
1552
+ )),
1553
+ e && /* @__PURE__ */ i(Lr, { $size: l, "aria-label": "Actions" })
1554
+ ] }) }),
1555
+ /* @__PURE__ */ m(go, { $variant: "default", children: [
1556
+ b.map((g, T) => /* @__PURE__ */ m(H, { children: [
1557
+ o.map((I) => {
1558
+ const L = f?.rowIndex === T && f.colKey === I.key, F = g[I.key];
1559
+ return /* @__PURE__ */ i(
1560
+ Rr,
1561
+ {
1562
+ $size: l,
1563
+ $variant: "default",
1564
+ $editable: I.editable && !L,
1565
+ onClick: I.editable && !L ? () => O(T, I.key, F) : void 0,
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 ?? "")
1578
+ },
1579
+ I.key
1580
+ );
1581
+ }),
1582
+ e && /* @__PURE__ */ i(Nr, { $size: l, $variant: "default", children: /* @__PURE__ */ i(
1583
+ Vr,
1584
+ {
1585
+ type: "button",
1586
+ onClick: () => A(T),
1587
+ "aria-label": "Delete row",
1588
+ children: "✕"
1589
+ }
1590
+ ) })
1591
+ ] }, T)),
1592
+ /* @__PURE__ */ i(Dr, { children: /* @__PURE__ */ i("td", { colSpan: D, children: /* @__PURE__ */ m(Fr, { type: "button", onClick: k, children: [
1593
+ "+ ",
1594
+ d
1595
+ ] }) }) })
1596
+ ] })
1597
+ ] }) });
1598
+ }
1599
+ Mr.displayName = "EditableTable";
1600
+ const ro = {
1295
1601
  primary: {
1296
1602
  50: "#f0f8ff",
1297
1603
  500: "#0070f3",
@@ -1323,38 +1629,38 @@ const U = {
1323
1629
  50: "#eff6ff",
1324
1630
  500: "#2563eb"
1325
1631
  }
1326
- }, kr = {
1632
+ }, Pr = {
1327
1633
  1: "4px",
1328
1634
  2: "8px",
1329
1635
  3: "12px",
1330
1636
  4: "16px",
1331
1637
  5: "20px",
1332
1638
  6: "24px"
1333
- }, hr = {
1639
+ }, Yr = {
1334
1640
  md: "6px"
1335
- }, Cr = {
1641
+ }, Hr = {
1336
1642
  modal: 1e3,
1337
1643
  toast: 1100
1338
- }, zr = {
1644
+ }, _r = {
1339
1645
  xs: "12px",
1340
1646
  sm: "14px",
1341
1647
  md: "16px",
1342
1648
  lg: "18px"
1343
- }, Fr = {
1344
- colors: { ...U, primary: { ...U.primary, contrast: "#ffffff" } },
1345
- spacing: kr,
1346
- fontSizes: zr,
1347
- radius: hr,
1348
- zIndex: Cr,
1649
+ }, on = {
1650
+ colors: { ...ro, primary: { ...ro.primary, contrast: "#ffffff" } },
1651
+ spacing: Pr,
1652
+ fontSizes: _r,
1653
+ radius: Yr,
1654
+ zIndex: Hr,
1349
1655
  shadows: {
1350
1656
  focusRing: "0 0 0 2px rgba(0, 112, 243, 0.25)"
1351
1657
  }
1352
1658
  };
1353
- function Sr(o) {
1354
- const r = parseInt(o.slice(1, 3), 16) / 255, n = parseInt(o.slice(3, 5), 16) / 255, t = parseInt(o.slice(5, 7), 16) / 255, c = (e) => e <= 0.03928 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
1355
- return 0.2126 * c(r) + 0.7152 * c(n) + 0.0722 * c(t) > 0.179 ? "#111111" : "#ffffff";
1659
+ function Kr(o) {
1660
+ const r = parseInt(o.slice(1, 3), 16) / 255, s = parseInt(o.slice(3, 5), 16) / 255, a = parseInt(o.slice(5, 7), 16) / 255, l = (c) => c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
1661
+ return 0.2126 * l(r) + 0.7152 * l(s) + 0.0722 * l(a) > 0.179 ? "#111111" : "#ffffff";
1356
1662
  }
1357
- const Y = {
1663
+ const U = {
1358
1664
  colors: {
1359
1665
  primary: {
1360
1666
  50: "#fffde6",
@@ -1384,42 +1690,44 @@ const Y = {
1384
1690
  shadows: { focusRing: "3px 3px 0 #111111" },
1385
1691
  brutalism: { borderWidth: "2px", shadowOffset: "4px" }
1386
1692
  };
1387
- function Er(o) {
1693
+ function rn(o) {
1388
1694
  return {
1389
- ...Y,
1695
+ ...U,
1390
1696
  colors: {
1391
- ...Y.colors,
1697
+ ...U.colors,
1392
1698
  primary: {
1393
1699
  50: "#fffff0",
1394
1700
  500: o,
1395
1701
  700: o,
1396
- contrast: Sr(o)
1702
+ contrast: Kr(o)
1397
1703
  }
1398
1704
  }
1399
1705
  };
1400
1706
  }
1401
- function Nr({
1402
- theme: o = Y,
1707
+ function nn({
1708
+ theme: o = U,
1403
1709
  children: r
1404
1710
  }) {
1405
- return /* @__PURE__ */ l(eo, { theme: o, children: r });
1711
+ return /* @__PURE__ */ i(yo, { theme: o, children: r });
1406
1712
  }
1407
1713
  export {
1408
- co as Badge,
1409
- fo as Button,
1410
- mr as CollapsibleCard,
1411
- Qo as Form,
1412
- or as FormField,
1413
- wo as Input,
1414
- cr as Link,
1415
- Lo as Modal,
1416
- ar as Select,
1417
- Nr as ThemeProvider,
1418
- so as Toast,
1419
- Or as ToastProvider,
1420
- Er as createNeoBrutalTheme,
1421
- Fr as defaultTheme,
1422
- Y as neoBrutalTheme,
1423
- jr as useForm,
1424
- Lr as useToast
1714
+ mo as Badge,
1715
+ ko as Button,
1716
+ Or as CollapsibleCard,
1717
+ Mr as EditableTable,
1718
+ dr as Form,
1719
+ ur as FormField,
1720
+ Eo as Input,
1721
+ vr as Link,
1722
+ Yo as Modal,
1723
+ yr as Select,
1724
+ jr as Table,
1725
+ nn as ThemeProvider,
1726
+ uo as Toast,
1727
+ Gr as ToastProvider,
1728
+ rn as createNeoBrutalTheme,
1729
+ on as defaultTheme,
1730
+ U as neoBrutalTheme,
1731
+ Qr as useForm,
1732
+ Jr as useToast
1425
1733
  };