blunt-ui 0.3.1 → 0.3.3

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.
Files changed (59) hide show
  1. package/README.md +101 -1
  2. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +5 -0
  3. package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts +8 -0
  4. package/dist/components/ConfirmDialog/ConfirmDialog.test.d.ts +0 -0
  5. package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts +13 -0
  6. package/dist/components/ConfirmDialog/index.d.ts +4 -0
  7. package/dist/components/ConfirmDialog/useConfirm.d.ts +6 -0
  8. package/dist/components/ConfirmDialog/useConfirm.test.d.ts +0 -0
  9. package/dist/components/ConfirmDialog/useConfirm.types.d.ts +14 -0
  10. package/dist/components/DatePicker/DatePicker.d.ts +5 -0
  11. package/dist/components/DatePicker/DatePicker.stories.d.ts +11 -0
  12. package/dist/components/DatePicker/DatePicker.test.d.ts +0 -0
  13. package/dist/components/DatePicker/DatePicker.types.d.ts +14 -0
  14. package/dist/components/DatePicker/index.d.ts +2 -0
  15. package/dist/components/Editable/Editable.d.ts +5 -0
  16. package/dist/components/Editable/Editable.stories.d.ts +10 -0
  17. package/dist/components/Editable/Editable.types.d.ts +9 -0
  18. package/dist/components/Editable/index.d.ts +2 -0
  19. package/dist/components/Field/Field.d.ts +5 -0
  20. package/dist/components/Field/Field.stories.d.ts +8 -0
  21. package/dist/components/Field/Field.types.d.ts +6 -0
  22. package/dist/components/Field/index.d.ts +2 -0
  23. package/dist/components/Form/index.d.ts +2 -0
  24. package/dist/components/Form/useForm.d.ts +2 -0
  25. package/dist/components/Form/useForm.test.d.ts +1 -0
  26. package/dist/components/Form/useForm.types.d.ts +20 -0
  27. package/dist/components/Input/Input.types.d.ts +1 -1
  28. package/dist/components/Select/Select.types.d.ts +2 -3
  29. package/dist/components/Spinner/Spinner.d.ts +5 -0
  30. package/dist/components/Spinner/Spinner.stories.d.ts +9 -0
  31. package/dist/components/Spinner/Spinner.types.d.ts +8 -0
  32. package/dist/components/Spinner/index.d.ts +2 -0
  33. package/dist/components/Table/Table.d.ts +1 -1
  34. package/dist/components/Table/Table.stories.d.ts +2 -10
  35. package/dist/components/Table/Table.types.d.ts +2 -1
  36. package/dist/components/Table/index.d.ts +2 -0
  37. package/dist/components/Table/useTable.d.ts +12 -0
  38. package/dist/components/Table/useTableSort.d.ts +1 -1
  39. package/dist/components/Textarea/Textarea.d.ts +5 -0
  40. package/dist/components/Textarea/Textarea.stories.d.ts +8 -0
  41. package/dist/components/Textarea/Textarea.types.d.ts +11 -0
  42. package/dist/components/Textarea/index.d.ts +2 -0
  43. package/dist/components/Toast/index.d.ts +2 -0
  44. package/dist/components/Toast/useToast.d.ts +6 -0
  45. package/dist/components/Toast/useToast.test.d.ts +0 -0
  46. package/dist/components/Toast/useToast.types.d.ts +17 -0
  47. package/dist/index.cjs +576 -257
  48. package/dist/index.d.ts +21 -14
  49. package/dist/index.js +1757 -1221
  50. package/dist/{components/ThemeProvider/index.d.ts → themes/ThemeProvider.d.ts} +1 -1
  51. package/dist/themes/index.d.ts +2 -1
  52. package/package.json +1 -1
  53. package/dist/components/DataTable/DataTable.d.ts +0 -5
  54. package/dist/components/DataTable/DataTable.stories.d.ts +0 -13
  55. package/dist/components/DataTable/DataTable.types.d.ts +0 -25
  56. package/dist/components/DataTable/index.d.ts +0 -2
  57. package/dist/themes/default.d.ts +0 -2
  58. /package/dist/{styles → themes}/GlobalStyles.d.ts +0 -0
  59. /package/dist/{consts.d.ts → themes/consts.d.ts} +0 -0
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
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";
1
+ import { jsx as s, jsxs as C, Fragment as Lo } from "react/jsx-runtime";
2
+ import i, { css as t, keyframes as L, ThemeProvider as Fo, createGlobalStyle as Bo } from "styled-components";
3
+ import po, { useId as A, useState as M, useContext as io, createContext as ao, forwardRef as ko, createElement as to, useRef as G, useEffect as j, useCallback as V, useMemo as lo } from "react";
4
4
  import { createPortal as Co } from "react-dom";
5
- const F = (o, r, n) => t`
5
+ const H = (o, r, n) => t`
6
6
  background: ${r};
7
7
  color: ${n};
8
8
  border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
9
9
  box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
10
- `, jo = i.span`
10
+ `, Vo = i.span`
11
11
  display: inline-flex;
12
12
  align-items: center;
13
13
  font-weight: 700;
@@ -31,32 +31,32 @@ const F = (o, r, n) => t`
31
31
  })[o]}
32
32
 
33
33
  ${({ $variant: o, theme: r }) => r.brutalism ? {
34
- primary: F(
34
+ primary: H(
35
35
  r,
36
36
  r.colors.primary[500],
37
37
  r.colors.primary.contrast
38
38
  ),
39
- neutral: F(
39
+ neutral: H(
40
40
  r,
41
41
  r.colors.neutral[200],
42
42
  r.colors.neutral[900]
43
43
  ),
44
- success: F(
44
+ success: H(
45
45
  r,
46
46
  r.colors.success[50],
47
47
  r.colors.success[500]
48
48
  ),
49
- error: F(
49
+ error: H(
50
50
  r,
51
51
  r.colors.error[50],
52
52
  r.colors.error[500]
53
53
  ),
54
- warning: F(
54
+ warning: H(
55
55
  r,
56
56
  r.colors.warning[50],
57
57
  r.colors.warning[500]
58
58
  ),
59
- info: F(r, r.colors.info[50], r.colors.info[500])
59
+ info: H(r, r.colors.info[50], r.colors.info[500])
60
60
  }[o] : {
61
61
  primary: t`
62
62
  background: ${r.colors.primary[50]};
@@ -84,16 +84,16 @@ const F = (o, r, n) => t`
84
84
  `
85
85
  }[o]}
86
86
  `;
87
- function Ro({
87
+ function _o({
88
88
  variant: o = "primary",
89
89
  size: r = "md",
90
90
  children: n,
91
91
  ...e
92
92
  }) {
93
- return /* @__PURE__ */ s(jo, { $variant: o, $size: r, ...e, children: n });
93
+ return /* @__PURE__ */ s(Vo, { $variant: o, $size: r, ...e, children: n });
94
94
  }
95
- Ro.displayName = "Badge";
96
- const so = (o, r, n) => t`
95
+ _o.displayName = "Badge";
96
+ const oo = (o, r, n) => t`
97
97
  background-color: ${r};
98
98
  color: ${n};
99
99
  border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
@@ -106,7 +106,7 @@ const so = (o, r, n) => t`
106
106
  transform: translate(2px, 2px);
107
107
  box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
108
108
  }
109
- `, _o = i.button`
109
+ `, jo = i.button`
110
110
  display: inline-flex;
111
111
  align-items: center;
112
112
  justify-content: center;
@@ -126,17 +126,17 @@ const so = (o, r, n) => t`
126
126
  }
127
127
 
128
128
  ${({ $variant: o, theme: r }) => r.brutalism ? {
129
- primary: so(
129
+ primary: oo(
130
130
  r,
131
131
  r.colors.primary[500],
132
132
  r.colors.primary.contrast
133
133
  ),
134
- secondary: so(
134
+ secondary: oo(
135
135
  r,
136
136
  r.colors.neutral[100],
137
137
  r.colors.neutral[900]
138
138
  ),
139
- outline: so(
139
+ outline: oo(
140
140
  r,
141
141
  r.colors.neutral[0],
142
142
  r.colors.neutral[900]
@@ -183,41 +183,41 @@ const so = (o, r, n) => t`
183
183
  `
184
184
  })[o]}
185
185
  `;
186
- function Mo({
186
+ function so({
187
187
  ref: o,
188
188
  as: r,
189
189
  href: n,
190
190
  variant: e = "primary",
191
- size: c = "md",
191
+ size: l = "md",
192
192
  isLoading: a,
193
- disabled: l,
194
- children: u,
195
- ...x
193
+ disabled: c,
194
+ children: d,
195
+ ...p
196
196
  }) {
197
197
  return /* @__PURE__ */ s(
198
- _o,
198
+ jo,
199
199
  {
200
200
  ref: o,
201
201
  as: r ?? (n ? "a" : "button"),
202
202
  href: n,
203
203
  $variant: e,
204
- $size: c,
205
- disabled: a || l,
206
- ...x,
207
- children: a ? "Loading..." : u
204
+ $size: l,
205
+ disabled: a || c,
206
+ ...p,
207
+ children: a ? "Loading..." : d
208
208
  }
209
209
  );
210
210
  }
211
- Mo.displayName = "Button";
212
- const Vo = i.div`
211
+ so.displayName = "Button";
212
+ const Ao = 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
- `, Fo = i.label`
217
+ `, Ro = i.label`
218
218
  font-size: ${({ theme: o }) => o.fontSizes.sm};
219
219
  font-weight: ${({ theme: o }) => o.brutalism ? "700" : "500"};
220
- `, Ko = i.span`
220
+ `, Yo = 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`
@@ -256,10 +256,6 @@ const Vo = i.div`
256
256
  outlined: t`
257
257
  border: 2px solid ${r.colors.primary[500]};
258
258
  background-color: ${r.colors.neutral[0]};
259
- `,
260
- filled: t`
261
- border: 1px solid transparent;
262
- background-color: ${r.colors.neutral[100]};
263
259
  `
264
260
  }[o]}
265
261
 
@@ -273,7 +269,7 @@ const Vo = i.div`
273
269
  &:focus-within {
274
270
  box-shadow: ${({ theme: o }) => o.shadows.focusRing};
275
271
  }
276
- `, Yo = i.input`
272
+ `, Uo = i.input`
277
273
  flex: 1;
278
274
  border: none;
279
275
  outline: none;
@@ -284,11 +280,11 @@ const Vo = i.div`
284
280
  cursor: not-allowed;
285
281
  opacity: 0.6;
286
282
  }
287
- `, $o = i.div`
283
+ `, fo = i.div`
288
284
  display: inline-flex;
289
285
  align-items: center;
290
286
  margin: 0 ${({ theme: o }) => o.spacing[1]};
291
- `, Uo = i.button`
287
+ `, Ko = i.button`
292
288
  display: inline-flex;
293
289
  align-items: center;
294
290
  margin: 0 ${({ theme: o }) => o.spacing[1]};
@@ -307,266 +303,176 @@ function qo({
307
303
  type: r = "text",
308
304
  size: n = "md",
309
305
  variant: e = "default",
310
- label: c,
306
+ label: l,
311
307
  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
- ...z
308
+ error: c,
309
+ leftElement: d,
310
+ rightElement: p,
311
+ clearable: $,
312
+ onClear: g,
313
+ fullWidth: y,
314
+ id: b,
315
+ value: f,
316
+ defaultValue: x,
317
+ onChange: w,
318
+ ...S
323
319
  }) {
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?.();
320
+ const T = A(), z = b ?? T, I = `${z}-hint`, [k, m] = M(x ?? ""), v = f !== void 0, D = v ? f : k, W = typeof c == "string" ? c : void 0, F = !!(a || c), O = (P) => {
321
+ v || m(P.target.value), w?.(P);
322
+ }, U = () => {
323
+ v || m(""), g?.();
328
324
  };
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 }),
325
+ return /* @__PURE__ */ C(Ao, { $fullWidth: y, children: [
326
+ l && /* @__PURE__ */ s(Ro, { htmlFor: z, children: l }),
327
+ /* @__PURE__ */ C(Ho, { $size: n, $variant: e, $error: !!c, children: [
328
+ d && /* @__PURE__ */ s(fo, { children: d }),
333
329
  /* @__PURE__ */ s(
334
- Yo,
330
+ Uo,
335
331
  {
336
- id: I,
332
+ id: z,
337
333
  ref: o,
338
334
  type: r,
339
- value: m,
340
- onChange: _,
341
- ...z,
342
- "aria-invalid": !!l,
343
- "aria-describedby": j ? P : void 0
335
+ value: D,
336
+ onChange: O,
337
+ ...S,
338
+ "aria-invalid": !!c,
339
+ "aria-describedby": F ? I : void 0
344
340
  }
345
341
  ),
346
- p && m && /* @__PURE__ */ s(
347
- Uo,
342
+ $ && D && /* @__PURE__ */ s(
343
+ Ko,
348
344
  {
349
345
  type: "button",
350
- onClick: H,
346
+ onClick: U,
351
347
  "aria-label": "Clear input",
352
348
  children: "✕"
353
349
  }
354
350
  ),
355
- x && /* @__PURE__ */ s($o, { children: x })
351
+ p && /* @__PURE__ */ s(fo, { children: p })
356
352
  ] }),
357
- j && /* @__PURE__ */ s(Ko, { id: P, $error: !!l, children: O ?? a })
353
+ F && /* @__PURE__ */ s(Yo, { id: I, $error: !!c, children: W ?? a })
358
354
  ] });
359
355
  }
360
356
  qo.displayName = "Input";
361
- const Go = M`
362
- from { opacity: 0; }
363
- to { opacity: 1; }
364
- `, Xo = M`
365
- from { opacity: 1; }
366
- to { opacity: 0; }
367
- `, Zo = M`
368
- from { opacity: 0; transform: scale(0.95) translateY(-8px); }
369
- to { opacity: 1; transform: scale(1) translateY(0); }
370
- `, Jo = M`
371
- from { opacity: 1; transform: scale(1) translateY(0); }
372
- to { opacity: 0; transform: scale(0.95) translateY(-8px); }
373
- `, Qo = i.div`
374
- position: fixed;
375
- inset: 0;
376
- background-color: rgba(0, 0, 0, 0.5);
377
- display: flex;
378
- align-items: center;
379
- justify-content: center;
380
- z-index: ${({ theme: o }) => o.zIndex.modal};
381
- animation: ${({ $closing: o }) => o ? Xo : Go} 0.15s ease
382
- forwards;
383
- `, or = i.div`
384
- position: relative;
385
- background: ${({ theme: o }) => o.colors.neutral[0]};
386
- border-radius: ${({ theme: o }) => o.radius.md};
387
- box-shadow: ${({ theme: o }) => o.brutalism ? `${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]}` : "0 20px 60px rgba(0,0,0,0.3)"};
388
- border: ${({ theme: o }) => o.brutalism ? `${o.brutalism.borderWidth} solid ${o.colors.neutral[900]}` : "none"};
357
+ const Go = i.div`
389
358
  display: flex;
390
359
  flex-direction: column;
391
- max-height: 90vh;
392
- animation: ${({ $closing: o }) => o ? Jo : Zo} 0.15s ease
393
- forwards;
394
-
395
- ${({ $size: o }) => o === "sm" && t`
396
- width: min(400px, 90vw);
397
- `}
398
- ${({ $size: o }) => o === "md" && t`
399
- width: min(560px, 90vw);
400
- `}
401
- ${({ $size: o }) => o === "lg" && t`
402
- width: min(720px, 90vw);
403
- `}
404
- ${({ $size: o }) => o === "fullscreen" && t`
405
- width: 100vw;
406
- height: 100vh;
407
- max-height: 100vh;
408
- border-radius: 0;
409
- `}
410
- `, rr = i.div`
360
+ gap: ${({ theme: o }) => o.spacing[1]};
361
+ width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
362
+ `, Jo = i.label`
363
+ font-size: ${({ theme: o }) => o.fontSizes.sm};
364
+ font-weight: ${({ theme: o }) => o.brutalism ? "700" : "500"};
365
+ `, Xo = i.span`
366
+ font-size: ${({ theme: o }) => o.fontSizes.xs};
367
+ color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
368
+ `, Zo = i.div`
411
369
  display: flex;
412
- align-items: center;
413
- gap: ${({ theme: o }) => o.spacing[2]};
414
- padding: ${({ theme: o }) => o.spacing[4]};
415
- border-bottom: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
416
- flex-shrink: 0;
417
- `, nr = i.h2`
418
- flex: 1;
419
- font-size: ${({ theme: o }) => o.fontSizes.lg};
420
- font-weight: 600;
421
- margin: 0;
422
- `, tr = i.button`
423
- display: inline-flex;
424
- align-items: center;
425
- justify-content: center;
426
- margin-left: auto;
427
- flex-shrink: 0;
428
- width: 32px;
429
- height: 32px;
430
- border: none;
431
- background: none;
432
- cursor: pointer;
433
370
  border-radius: ${({ theme: o }) => o.radius.md};
434
- font-size: 20px;
435
- line-height: 1;
436
- color: ${({ theme: o }) => o.colors.neutral[500]};
371
+ transition:
372
+ border-color 0.2s,
373
+ box-shadow 0.2s;
437
374
 
438
- &:hover {
439
- background-color: ${({ theme: o }) => o.colors.neutral[100]};
440
- color: ${({ theme: o }) => o.colors.neutral[900]};
441
- }
375
+ ${({ $size: o = "md", theme: r }) => ({
376
+ sm: t`
377
+ padding: ${r.spacing[1]} ${r.spacing[2]};
378
+ font-size: ${r.fontSizes.sm};
379
+ `,
380
+ md: t`
381
+ padding: ${r.spacing[2]} ${r.spacing[3]};
382
+ font-size: ${r.fontSizes.md};
383
+ `,
384
+ lg: t`
385
+ padding: ${r.spacing[3]} ${r.spacing[4]};
386
+ font-size: ${r.fontSizes.lg};
387
+ `
388
+ })[o]}
442
389
 
443
- &:focus-visible {
444
- outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
445
- outline-offset: 2px;
390
+ ${({ $variant: o = "default", theme: r }) => r.brutalism ? t`
391
+ border: ${r.brutalism.borderWidth} solid
392
+ ${r.colors.neutral[900]};
393
+ background-color: ${r.colors.neutral[0]};
394
+ box-shadow: 3px 3px 0 ${r.colors.neutral[900]};
395
+ ` : {
396
+ default: t`
397
+ border: 1px solid ${r.colors.neutral[400]};
398
+ background-color: ${r.colors.neutral[0]};
399
+ `,
400
+ outlined: t`
401
+ border: 2px solid ${r.colors.primary[500]};
402
+ background-color: ${r.colors.neutral[0]};
403
+ `
404
+ }[o]}
405
+
406
+ ${({ $error: o, theme: r }) => o && t`
407
+ border-color: ${r.colors.error[500]};
408
+ ${r.brutalism && t`
409
+ box-shadow: 3px 3px 0 ${r.colors.error[500]};
410
+ `}
411
+ `}
412
+
413
+ &:focus-within {
414
+ box-shadow: ${({ theme: o }) => o.shadows.focusRing};
446
415
  }
447
- `, sr = i.div`
448
- padding: ${({ theme: o }) => o.spacing[4]};
449
- overflow-y: auto;
416
+ `, Qo = i.textarea`
450
417
  flex: 1;
451
- `, ir = i.div`
452
- display: flex;
453
- align-items: center;
454
- justify-content: flex-end;
455
- gap: ${({ theme: o }) => o.spacing[2]};
456
- padding: ${({ theme: o }) => o.spacing[4]};
457
- border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
458
- flex-shrink: 0;
459
- `, er = [
460
- "button:not([disabled])",
461
- "input:not([disabled])",
462
- "select:not([disabled])",
463
- "textarea:not([disabled])",
464
- "a[href]",
465
- '[tabindex]:not([tabindex="-1"])'
466
- ].join(", ");
467
- function xo(o) {
468
- return Array.from(
469
- o.querySelectorAll(er)
470
- );
471
- }
472
- function ar({
473
- open: o,
474
- onClose: r,
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
418
+ border: none;
419
+ outline: none;
420
+ background: transparent;
421
+ font: inherit;
422
+ resize: vertical;
423
+ min-height: 80px;
424
+
425
+ &:disabled {
426
+ cursor: not-allowed;
427
+ opacity: 0.6;
428
+ }
429
+ `;
430
+ function or({
431
+ ref: o,
432
+ size: r = "md",
433
+ variant: n = "default",
434
+ label: e,
435
+ helperText: l,
436
+ error: a,
437
+ fullWidth: c,
438
+ id: d,
439
+ value: p,
440
+ defaultValue: $,
441
+ onChange: g,
442
+ ...y
483
443
  }) {
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
- if (o)
487
- k(!0), z(!1);
488
- else if (g) {
489
- z(!0);
490
- const v = setTimeout(() => {
491
- k(!1), z(!1);
492
- }, 150);
493
- return () => clearTimeout(v);
494
- }
495
- }, [o, g]), K(() => {
496
- if (!o)
497
- return;
498
- const v = document.body.style.overflow;
499
- return document.body.style.overflow = "hidden", () => {
500
- document.body.style.overflow = v;
501
- };
502
- }, [o]), K(() => {
503
- if (!o || !b.current)
504
- return;
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
- r();
510
- return;
511
- }
512
- if (h.key !== "Tab")
513
- return;
514
- const $ = xo(v);
515
- if ($.length === 0) {
516
- h.preventDefault();
517
- return;
518
- }
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
- };
522
- return document.addEventListener("keydown", B), () => {
523
- document.removeEventListener("keydown", B), I?.focus();
524
- };
525
- }, [o, u, r, g]), g ? Co(
526
- /* @__PURE__ */ s(
444
+ const b = A(), f = d ?? b, x = `${f}-hint`, [w, S] = M($ ?? ""), T = p !== void 0, z = T ? p : w, I = typeof a == "string" ? a : void 0, k = !!(l || a);
445
+ return /* @__PURE__ */ C(Go, { $fullWidth: c, children: [
446
+ e && /* @__PURE__ */ s(Jo, { htmlFor: f, children: e }),
447
+ /* @__PURE__ */ s(Zo, { $size: r, $variant: n, $error: !!a, children: /* @__PURE__ */ s(
527
448
  Qo,
528
449
  {
529
- $closing: T,
530
- onClick: l ? r : void 0,
531
- children: /* @__PURE__ */ C(
532
- or,
533
- {
534
- ref: b,
535
- role: "dialog",
536
- "aria-modal": "true",
537
- "aria-labelledby": y,
538
- "aria-describedby": p,
539
- $size: a,
540
- $closing: T,
541
- tabIndex: -1,
542
- onClick: (v) => v.stopPropagation(),
543
- children: [
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
- ] }),
548
- /* @__PURE__ */ s(sr, { children: e }),
549
- c && /* @__PURE__ */ s(ir, { children: c })
550
- ]
551
- }
552
- )
450
+ id: f,
451
+ ref: o,
452
+ value: z,
453
+ onChange: (v) => {
454
+ T || S(v.target.value), g?.(v);
455
+ },
456
+ ...y,
457
+ "aria-invalid": !!a,
458
+ "aria-describedby": k ? x : void 0
553
459
  }
554
- ),
555
- document.body
556
- ) : null;
460
+ ) }),
461
+ k && /* @__PURE__ */ s(Xo, { id: x, $error: !!a, children: I ?? l })
462
+ ] });
557
463
  }
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(
464
+ or.displayName = "Textarea";
465
+ const So = (...o) => o.filter((r, n, e) => !!r && r.trim() !== "" && e.indexOf(r) === n).join(" ").trim();
466
+ const rr = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
467
+ const nr = (o) => o.replace(
562
468
  /^([A-Z])|[\s-_]+(\w)/g,
563
469
  (r, n, e) => e ? e.toUpperCase() : n.toLowerCase()
564
470
  );
565
- const yo = (o) => {
566
- const r = cr(o);
471
+ const $o = (o) => {
472
+ const r = nr(o);
567
473
  return r.charAt(0).toUpperCase() + r.slice(1);
568
474
  };
569
- var io = {
475
+ var ro = {
570
476
  xmlns: "http://www.w3.org/2000/svg",
571
477
  width: 24,
572
478
  height: 24,
@@ -577,333 +483,116 @@ var io = {
577
483
  strokeLinecap: "round",
578
484
  strokeLinejoin: "round"
579
485
  };
580
- const dr = (o) => {
486
+ const tr = (o) => {
581
487
  for (const r in o)
582
488
  if (r.startsWith("aria-") || r === "role" || r === "title")
583
489
  return !0;
584
490
  return !1;
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) => {
491
+ }, sr = ao({}), er = () => io(sr), ir = ko(
492
+ ({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth: e, className: l = "", children: a, iconNode: c, ...d }, p) => {
587
493
  const {
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(
494
+ size: $ = 24,
495
+ strokeWidth: g = 2,
496
+ absoluteStrokeWidth: y = !1,
497
+ color: b = "currentColor",
498
+ className: f = ""
499
+ } = er() ?? {}, x = e ?? y ? Number(n ?? g) * 24 / Number(r ?? $) : n ?? g;
500
+ return to(
595
501
  "svg",
596
502
  {
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
503
+ ref: p,
504
+ ...ro,
505
+ width: r ?? $ ?? ro.width,
506
+ height: r ?? $ ?? ro.height,
507
+ stroke: o ?? b,
508
+ strokeWidth: x,
509
+ className: So("lucide", f, l),
510
+ ...!a && !tr(d) && { "aria-hidden": "true" },
511
+ ...d
606
512
  },
607
513
  [
608
- ...l.map(([T, z]) => lo(T, z)),
514
+ ...c.map(([w, S]) => to(w, S)),
609
515
  ...Array.isArray(a) ? a : [a]
610
516
  ]
611
517
  );
612
518
  }
613
519
  );
614
- const X = (o, r) => {
615
- const n = So(
616
- ({ className: e, ...c }, a) => lo(fr, {
520
+ const _ = (o, r) => {
521
+ const n = ko(
522
+ ({ className: e, ...l }, a) => to(ir, {
617
523
  ref: a,
618
524
  iconNode: r,
619
- className: zo(
620
- `lucide-${lr(yo(o))}`,
525
+ className: So(
526
+ `lucide-${rr($o(o))}`,
621
527
  `lucide-${o}`,
622
528
  e
623
529
  ),
624
- ...c
530
+ ...l
625
531
  })
626
532
  );
627
- return n.displayName = yo(o), n;
533
+ return n.displayName = $o(o), n;
628
534
  };
629
- const gr = [
535
+ const ar = [
630
536
  ["path", { d: "M12 5v14", key: "s699le" }],
631
537
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
632
- ], br = X("arrow-down", gr);
633
- const $r = [
538
+ ], lr = _("arrow-down", ar);
539
+ const cr = [
634
540
  ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
635
541
  ["path", { d: "M17 20V4", key: "1ejh1v" }],
636
542
  ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
637
543
  ["path", { d: "M7 4v16", key: "1glfcx" }]
638
- ], xr = X("arrow-up-down", $r);
639
- const yr = [
544
+ ], dr = _("arrow-up-down", cr);
545
+ const ur = [
640
546
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
641
547
  ["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 = [
548
+ ], pr = _("arrow-up", ur);
549
+ const fr = [
550
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
551
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
552
+ ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
553
+ ["path", { d: "M3 10h18", key: "8toen8" }]
554
+ ], $r = _("calendar", fr);
555
+ const gr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], zo = _("chevron-down", gr);
556
+ const br = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], xr = _("chevron-left", br);
557
+ const yr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], hr = _("chevron-right", yr);
558
+ const wr = [
645
559
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
646
560
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
647
- ], Io = X("x", vr), kr = M`
648
- from { opacity: 0; transform: translateY(12px); }
649
- to { opacity: 1; transform: translateY(0); }
650
- `, mr = M`
651
- from { opacity: 0; transform: translateY(-12px); }
652
- to { opacity: 1; transform: translateY(0); }
653
- `, Sr = M`
654
- from { opacity: 1; }
655
- to { opacity: 0; }
656
- `, Cr = i.div`
657
- position: fixed;
658
- z-index: ${({ theme: o }) => o.zIndex.toast};
561
+ ], co = _("x", wr), mr = i.div`
562
+ display: inline-flex;
563
+ flex-direction: column;
564
+ gap: ${({ theme: o }) => o.spacing[1]};
565
+ width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
566
+ `, vr = i.div`
567
+ position: relative;
659
568
  display: flex;
660
- align-items: center;
661
- gap: ${({ theme: o }) => o.spacing[3]};
662
- min-width: 280px;
663
- max-width: 400px;
664
- padding: ${({ theme: o }) => `${o.spacing[3]} ${o.spacing[4]}`};
569
+ width: 100%;
570
+ `, kr = i.span`
571
+ font-size: ${({ theme: o }) => o.fontSizes.xs};
572
+ color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
573
+ `, Cr = i.select`
574
+ appearance: none;
575
+ width: 100%;
665
576
  border-radius: ${({ theme: o }) => o.radius.md};
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
672
- `};
577
+ cursor: pointer;
578
+ font: inherit;
579
+ color: ${({ theme: o }) => o.colors.neutral[900]};
580
+ transition:
581
+ border-color 0.2s,
582
+ box-shadow 0.2s;
673
583
 
674
- ${({ $position: o, theme: r }) => ({
675
- "bottom-right": t`
676
- bottom: ${r.spacing[6]};
677
- right: ${r.spacing[6]};
678
- `,
679
- "bottom-left": t`
680
- bottom: ${r.spacing[6]};
681
- left: ${r.spacing[6]};
584
+ ${({ $size: o, theme: r }) => ({
585
+ sm: t`
586
+ padding: ${r.spacing[1]} ${r.spacing[2]};
587
+ font-size: ${r.fontSizes.sm};
682
588
  `,
683
- "top-right": t`
684
- top: ${r.spacing[6]};
685
- right: ${r.spacing[6]};
589
+ md: t`
590
+ padding: ${r.spacing[2]} ${r.spacing[3]};
591
+ font-size: ${r.fontSizes.md};
686
592
  `,
687
- "top-left": t`
688
- top: ${r.spacing[6]};
689
- left: ${r.spacing[6]};
690
- `
691
- })[o]}
692
- `, Q = (o, r, n) => t`
693
- background: ${r};
694
- border: ${o.brutalism.borderWidth} solid ${n};
695
- box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
696
- 0 ${n};
697
- `, zr = i(Cr)`
698
- ${({ $variant: o, theme: r }) => r.brutalism ? {
699
- success: Q(
700
- r,
701
- r.colors.success[50],
702
- r.colors.success[500]
703
- ),
704
- error: Q(
705
- r,
706
- r.colors.error[50],
707
- r.colors.error[500]
708
- ),
709
- warning: Q(
710
- r,
711
- r.colors.warning[50],
712
- r.colors.warning[500]
713
- ),
714
- info: Q(r, r.colors.info[50], r.colors.info[500])
715
- }[o] : {
716
- success: t`
717
- background: ${r.colors.success[50]};
718
- border-left: 4px solid ${r.colors.success[500]};
719
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
720
- `,
721
- error: t`
722
- background: ${r.colors.error[50]};
723
- border-left: 4px solid ${r.colors.error[500]};
724
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
725
- `,
726
- warning: t`
727
- background: ${r.colors.warning[50]};
728
- border-left: 4px solid ${r.colors.warning[500]};
729
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
730
- `,
731
- info: t`
732
- background: ${r.colors.info[50]};
733
- border-left: 4px solid ${r.colors.info[500]};
734
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
735
- `
736
- }[o]}
737
- `, Tr = i.p`
738
- flex: 1;
739
- margin: 0;
740
- font-size: ${({ theme: o }) => o.fontSizes.sm};
741
- font-weight: ${({ theme: o }) => o.brutalism ? 600 : 400};
742
- line-height: 1.5;
743
- color: ${({ theme: o }) => o.colors.neutral[900]};
744
- `, Ir = i.button`
745
- flex-shrink: 0;
746
- display: inline-flex;
747
- align-items: center;
748
- justify-content: center;
749
- width: 24px;
750
- height: 24px;
751
- border: none;
752
- background: none;
753
- cursor: pointer;
754
- border-radius: ${({ theme: o }) => o.radius.md};
755
- color: ${({ theme: o }) => o.colors.neutral[500]};
756
-
757
- &:hover {
758
- background-color: rgba(0, 0, 0, 0.06);
759
- color: ${({ theme: o }) => o.colors.neutral[900]};
760
- }
761
-
762
- &:focus-visible {
763
- outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
764
- outline-offset: 2px;
765
- }
766
- `;
767
- function Eo({
768
- open: o,
769
- onClose: r,
770
- message: n,
771
- variant: e = "info",
772
- duration: c = 4e3,
773
- position: a = "bottom-right"
774
- }) {
775
- const [l, u] = D(o), [x, p] = D(!1);
776
- return K(() => {
777
- if (o)
778
- u(!0), p(!1);
779
- else if (l) {
780
- p(!0);
781
- const b = setTimeout(() => {
782
- u(!1), p(!1);
783
- }, 200);
784
- return () => {
785
- clearTimeout(b);
786
- };
787
- }
788
- }, [o, l]), K(() => {
789
- if (!o || c === 0)
790
- return;
791
- const b = setTimeout(r, c);
792
- return () => {
793
- clearTimeout(b);
794
- };
795
- }, [o, c, r]), l ? Co(
796
- /* @__PURE__ */ C(
797
- zr,
798
- {
799
- $position: a,
800
- $variant: e,
801
- $closing: x,
802
- role: "alert",
803
- "aria-live": "polite",
804
- children: [
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 }) })
807
- ]
808
- }
809
- ),
810
- document.body
811
- ) : null;
812
- }
813
- Eo.displayName = "Toast";
814
- const Er = i.form`
815
- display: flex;
816
- flex-direction: column;
817
- gap: ${({ theme: o }) => o.spacing[4]};
818
- `, Wr = i.div`
819
- display: flex;
820
- flex-direction: column;
821
- gap: ${({ theme: o }) => o.spacing[1]};
822
- `, Or = i.label`
823
- font-size: ${({ theme: o }) => o.fontSizes.sm};
824
- font-weight: 500;
825
- color: ${({ theme: o }) => o.colors.neutral[900]};
826
- `, Pr = i.span`
827
- color: ${({ theme: o }) => o.colors.error[500]};
828
- margin-left: 2px;
829
- `, Br = i.span`
830
- font-size: ${({ theme: o }) => o.fontSizes.xs};
831
- color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
832
- `;
833
- function Dr({ onSubmit: o, children: r, ...n }) {
834
- return /* @__PURE__ */ s(
835
- Er,
836
- {
837
- onSubmit: (e) => {
838
- e.preventDefault(), o?.(e);
839
- },
840
- noValidate: !0,
841
- ...n,
842
- children: r
843
- }
844
- );
845
- }
846
- Dr.displayName = "Form";
847
- function Nr({
848
- label: o,
849
- error: r,
850
- helperText: n,
851
- required: e,
852
- children: c
853
- }) {
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,
856
- {
857
- id: a,
858
- ...u && { "aria-describedby": l },
859
- ...r && { "aria-invalid": !0 }
860
- }
861
- ) : c;
862
- return /* @__PURE__ */ C(Wr, { children: [
863
- o && /* @__PURE__ */ C(Or, { htmlFor: a, children: [
864
- o,
865
- e && /* @__PURE__ */ s(Pr, { "aria-hidden": "true", children: " *" })
866
- ] }),
867
- p,
868
- u && /* @__PURE__ */ s(Br, { id: l, $error: !!r, children: x ?? n })
869
- ] });
870
- }
871
- Nr.displayName = "FormField";
872
- const Lr = i.div`
873
- display: inline-flex;
874
- flex-direction: column;
875
- gap: ${({ theme: o }) => o.spacing[1]};
876
- width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
877
- `, Ar = i.div`
878
- position: relative;
879
- display: flex;
880
- width: 100%;
881
- `, jr = i.span`
882
- font-size: ${({ theme: o }) => o.fontSizes.xs};
883
- color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
884
- `, Rr = i.select`
885
- appearance: none;
886
- width: 100%;
887
- border-radius: ${({ theme: o }) => o.radius.md};
888
- cursor: pointer;
889
- font: inherit;
890
- color: ${({ theme: o }) => o.colors.neutral[900]};
891
- transition:
892
- border-color 0.2s,
893
- box-shadow 0.2s;
894
-
895
- ${({ $size: o, theme: r }) => ({
896
- sm: t`
897
- padding: ${r.spacing[1]} ${r.spacing[2]};
898
- font-size: ${r.fontSizes.sm};
899
- `,
900
- md: t`
901
- padding: ${r.spacing[2]} ${r.spacing[3]};
902
- font-size: ${r.fontSizes.md};
903
- `,
904
- lg: t`
905
- padding: ${r.spacing[3]} ${r.spacing[4]};
906
- font-size: ${r.fontSizes.lg};
593
+ lg: t`
594
+ padding: ${r.spacing[3]} ${r.spacing[4]};
595
+ font-size: ${r.fontSizes.lg};
907
596
  `
908
597
  })[o]}
909
598
 
@@ -922,10 +611,6 @@ const Lr = i.div`
922
611
  outlined: t`
923
612
  border: 2px solid ${r.colors.primary[500]};
924
613
  background-color: ${r.colors.neutral[0]};
925
- `,
926
- filled: t`
927
- border: 1px solid transparent;
928
- background-color: ${r.colors.neutral[100]};
929
614
  `
930
615
  }[o]}
931
616
 
@@ -942,7 +627,7 @@ const Lr = i.div`
942
627
  cursor: not-allowed;
943
628
  opacity: 0.6;
944
629
  }
945
- `, _r = i.button`
630
+ `, Sr = i.button`
946
631
  position: absolute;
947
632
  right: ${({ theme: o }) => o.spacing[3]};
948
633
  top: 50%;
@@ -964,7 +649,7 @@ const Lr = i.div`
964
649
  outline-offset: 2px;
965
650
  border-radius: 2px;
966
651
  }
967
- `, Mr = i.span`
652
+ `, zr = i.span`
968
653
  position: absolute;
969
654
  right: ${({ theme: o }) => o.spacing[3]};
970
655
  top: 50%;
@@ -974,63 +659,165 @@ const Lr = i.div`
974
659
  align-items: center;
975
660
  color: ${({ theme: o }) => o.colors.neutral[500]};
976
661
  `;
977
- function Vr({
662
+ function Tr({
978
663
  options: o,
979
664
  placeholder: r,
980
665
  size: n = "md",
981
666
  variant: e = "default",
982
- error: c,
667
+ error: l,
983
668
  fullWidth: a,
984
- clearable: l,
985
- onClear: u,
986
- id: x,
987
- value: p,
988
- defaultValue: b,
989
- onChange: w,
990
- ...y
669
+ clearable: c,
670
+ onClear: d,
671
+ id: p,
672
+ value: $,
673
+ defaultValue: g,
674
+ onChange: y,
675
+ ...b
991
676
  }) {
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: [
677
+ const f = A(), x = p ?? f, w = `${x}-hint`, S = typeof l == "string" ? l : void 0, [T, z] = M(
678
+ g ?? ""
679
+ ), I = $ !== void 0, k = I ? $ : T, m = (W) => {
680
+ I || z(W.target.value), y?.(W);
681
+ }, v = () => {
682
+ I || z(""), d?.();
683
+ }, D = c && !!k;
684
+ return /* @__PURE__ */ C(mr, { $fullWidth: a, children: [
685
+ /* @__PURE__ */ C(vr, { children: [
1001
686
  /* @__PURE__ */ C(
1002
- Rr,
687
+ Cr,
1003
688
  {
1004
- id: k,
689
+ id: x,
1005
690
  $size: n,
1006
691
  $variant: e,
1007
- $error: !!c,
1008
- "aria-invalid": !!c,
1009
- "aria-describedby": z ? T : void 0,
1010
- value: B,
1011
- onChange: h,
1012
- ...y,
692
+ $error: !!l,
693
+ "aria-invalid": !!l,
694
+ "aria-describedby": S ? w : void 0,
695
+ value: k,
696
+ onChange: m,
697
+ ...b,
1013
698
  children: [
1014
699
  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))
700
+ o.map((W) => /* @__PURE__ */ s("option", { value: W.value, disabled: W.disabled, children: W.label }, W.value))
1016
701
  ]
1017
702
  }
1018
703
  ),
1019
- m ? /* @__PURE__ */ s(
1020
- _r,
704
+ D ? /* @__PURE__ */ s(
705
+ Sr,
1021
706
  {
1022
707
  type: "button",
1023
- onClick: $,
708
+ onClick: v,
1024
709
  "aria-label": "Clear selection",
1025
- children: /* @__PURE__ */ s(Io, { size: 14 })
710
+ children: /* @__PURE__ */ s(co, { size: 14 })
1026
711
  }
1027
- ) : /* @__PURE__ */ s(Mr, { "aria-hidden": "true", children: /* @__PURE__ */ s(To, { size: 14 }) })
712
+ ) : /* @__PURE__ */ s(zr, { "aria-hidden": "true", children: /* @__PURE__ */ s(zo, { size: 14 }) })
1028
713
  ] }),
1029
- z && /* @__PURE__ */ s(jr, { id: T, $error: !0, children: z })
714
+ S && /* @__PURE__ */ s(kr, { id: w, $error: !0, children: S })
1030
715
  ] });
1031
716
  }
1032
- Vr.displayName = "Select";
1033
- const Fr = i.a`
717
+ Tr.displayName = "Select";
718
+ const go = i.span`
719
+ display: inline-block;
720
+ `, Ir = i.span`
721
+ display: inline-block;
722
+ min-width: 60px;
723
+ padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
724
+ border-radius: ${({ theme: o }) => o.radius.md};
725
+ color: ${({ $empty: o, theme: r }) => o ? r.colors.neutral[400] : "inherit"};
726
+
727
+ ${({ theme: o }) => o.brutalism ? t`
728
+ border: ${o.brutalism.borderWidth} solid transparent;
729
+ ` : t`
730
+ border: 1px solid transparent;
731
+ `}
732
+
733
+ ${({ $disabled: o, theme: r }) => o ? t`
734
+ opacity: 0.5;
735
+ ` : t`
736
+ cursor: text;
737
+
738
+ &:hover {
739
+ ${r.brutalism ? t`
740
+ border-color: ${r.colors.neutral[900]};
741
+ box-shadow: ${r.brutalism.shadowOffset}
742
+ ${r.brutalism.shadowOffset} 0
743
+ ${r.colors.neutral[900]};
744
+ ` : t`
745
+ border-color: ${r.colors.primary[500]};
746
+ box-shadow: ${r.shadows.focusRing};
747
+ `}
748
+ }
749
+
750
+ &:focus {
751
+ outline: none;
752
+ box-shadow: ${r.shadows.focusRing};
753
+ }
754
+ `}
755
+ `, Mr = i.input`
756
+ display: inline-block;
757
+ min-width: 60px;
758
+ padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
759
+ border-radius: ${({ theme: o }) => o.radius.md};
760
+ font: inherit;
761
+ color: inherit;
762
+ background: ${({ theme: o }) => o.colors.neutral[0]};
763
+ outline: none;
764
+
765
+ ${({ theme: o }) => o.brutalism ? t`
766
+ border: ${o.brutalism.borderWidth} solid
767
+ ${o.colors.neutral[900]};
768
+ box-shadow: ${o.brutalism.shadowOffset}
769
+ ${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
770
+ ` : t`
771
+ border: 1px solid ${o.colors.primary[500]};
772
+ box-shadow: ${o.shadows.focusRing};
773
+ `}
774
+ `;
775
+ function Dr({
776
+ value: o,
777
+ defaultValue: r = "",
778
+ onChange: n,
779
+ onSubmit: e,
780
+ onCancel: l,
781
+ placeholder: a = "Click to edit",
782
+ disabled: c = !1
783
+ }) {
784
+ const d = o !== void 0, [p, $] = M(r), g = d ? o : p, [y, b] = M(!1), [f, x] = M(""), w = G(null), S = () => {
785
+ c || (x(g), b(!0), setTimeout(() => {
786
+ w.current?.focus(), w.current?.select();
787
+ }, 0));
788
+ }, T = () => {
789
+ d || $(f), n?.(f), e?.(f), b(!1);
790
+ }, z = () => {
791
+ l?.(g), b(!1);
792
+ }, I = (k) => {
793
+ k.key === "Enter" ? T() : k.key === "Escape" && z();
794
+ };
795
+ return y ? /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
796
+ Mr,
797
+ {
798
+ ref: w,
799
+ value: f,
800
+ size: Math.max(f.length, a.length, 10),
801
+ onChange: (k) => x(k.target.value),
802
+ onBlur: T,
803
+ onKeyDown: I,
804
+ "aria-label": "Edit value"
805
+ }
806
+ ) }) : /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
807
+ Ir,
808
+ {
809
+ role: c ? void 0 : "button",
810
+ tabIndex: c ? void 0 : 0,
811
+ $disabled: c,
812
+ $empty: !g,
813
+ onClick: S,
814
+ onKeyDown: (k) => k.key === "Enter" && S(),
815
+ children: g || a
816
+ }
817
+ ) });
818
+ }
819
+ Dr.displayName = "Editable";
820
+ const Wr = i.a`
1034
821
  text-decoration: underline;
1035
822
  text-underline-offset: 2px;
1036
823
  transition: color 0.15s;
@@ -1056,14 +843,14 @@ const Fr = i.a`
1056
843
  `
1057
844
  })[o]}
1058
845
  `;
1059
- function Kr({
846
+ function To({
1060
847
  variant: o = "default",
1061
848
  external: r,
1062
849
  children: n,
1063
850
  ...e
1064
851
  }) {
1065
852
  return /* @__PURE__ */ s(
1066
- Fr,
853
+ Wr,
1067
854
  {
1068
855
  $variant: o,
1069
856
  ...r && { target: "_blank", rel: "noreferrer" },
@@ -1072,150 +859,405 @@ function Kr({
1072
859
  }
1073
860
  );
1074
861
  }
1075
- Kr.displayName = "Link";
1076
- const Hr = i.div`
1077
- border-radius: ${({ theme: o }) => o.radius.md};
1078
- background: ${({ theme: o }) => o.colors.neutral[0]};
1079
- overflow: hidden;
1080
-
1081
- ${({ theme: o, $accentColor: r }) => o.brutalism ? t`
1082
- border: ${o.brutalism.borderWidth} solid
1083
- ${r ?? o.colors.neutral[900]};
1084
- box-shadow: ${o.brutalism.shadowOffset}
1085
- ${o.brutalism.shadowOffset} 0
1086
- ${r ?? o.colors.neutral[900]};
1087
- ` : t`
1088
- border: 1px solid ${r ?? o.colors.neutral[200]};
1089
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
1090
- `}
1091
- `, Yr = i.button`
1092
- width: 100%;
862
+ To.displayName = "Link";
863
+ const Or = i.div`
1093
864
  display: flex;
1094
- align-items: flex-start;
1095
- gap: ${({ theme: o }) => o.spacing[3]};
1096
- padding: ${({ theme: o }) => o.spacing[4]};
1097
- background: ${({ theme: o }) => o.brutalism ? o.colors.neutral[100] : o.colors.neutral[0]};
1098
- border: none;
1099
- cursor: pointer;
1100
- text-align: left;
1101
-
1102
- &:hover {
1103
- background: ${({ theme: o }) => o.colors.neutral[100]};
1104
- }
1105
-
1106
- &:focus-visible {
1107
- outline: 2px solid
1108
- ${({ theme: o, $accentColor: r }) => r ?? o.colors.primary[500]};
1109
- outline-offset: -2px;
1110
- }
1111
- `, Ur = i.div`
1112
- flex: 1;
1113
- min-width: 0;
1114
- `, qr = i.span`
1115
- display: block;
865
+ flex-direction: column;
866
+ gap: ${({ theme: o }) => o.spacing[1]};
867
+ `, Pr = i.span`
868
+ font-size: ${({ theme: o }) => o.fontSizes.xs};
869
+ color: ${({ theme: o }) => o.colors.neutral[500]};
870
+ font-weight: ${({ theme: o }) => o.brutalism ? "700" : "500"};
871
+ `, Nr = i.span`
1116
872
  font-size: ${({ theme: o }) => o.fontSizes.md};
1117
- font-weight: 600;
1118
873
  color: ${({ theme: o }) => o.colors.neutral[900]};
1119
- `, Gr = i.span`
1120
- display: block;
1121
- font-size: ${({ theme: o }) => o.fontSizes.sm};
1122
- color: ${({ theme: o }) => o.colors.neutral[500]};
1123
- `, Xr = i.div`
1124
- display: flex;
1125
- flex-direction: row;
1126
- align-items: center;
1127
- justify-content: space-between;
1128
- margin-top: ${({ theme: o }) => o.spacing[1]};
874
+ `;
875
+ function Er({ label: o, value: r, href: n }) {
876
+ return /* @__PURE__ */ C(Or, { children: [
877
+ /* @__PURE__ */ s(Pr, { children: o }),
878
+ n ? /* @__PURE__ */ s(To, { href: n, external: !0, children: r }) : /* @__PURE__ */ s(Nr, { children: r ?? "—" })
879
+ ] });
880
+ }
881
+ Er.displayName = "Field";
882
+ const Lr = L`
883
+ from { opacity: 0; }
884
+ to { opacity: 1; }
885
+ `, Fr = L`
886
+ from { opacity: 1; }
887
+ to { opacity: 0; }
888
+ `, Br = L`
889
+ from { opacity: 0; transform: scale(0.95) translateY(-8px); }
890
+ to { opacity: 1; transform: scale(1) translateY(0); }
891
+ `, Vr = L`
892
+ from { opacity: 1; transform: scale(1) translateY(0); }
893
+ to { opacity: 0; transform: scale(0.95) translateY(-8px); }
894
+ `, _r = i.div`
895
+ position: fixed;
896
+ inset: 0;
897
+ background-color: rgba(0, 0, 0, 0.5);
898
+ display: flex;
899
+ align-items: center;
900
+ justify-content: center;
901
+ z-index: ${({ theme: o }) => o.zIndex.modal};
902
+ animation: ${({ $closing: o }) => o ? Fr : Lr} 0.15s ease
903
+ forwards;
904
+ `, jr = i.div`
905
+ position: relative;
906
+ background: ${({ theme: o }) => o.colors.neutral[0]};
907
+ border-radius: ${({ theme: o }) => o.radius.md};
908
+ box-shadow: ${({ theme: o }) => o.brutalism ? `${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]}` : "0 20px 60px rgba(0,0,0,0.3)"};
909
+ border: ${({ theme: o }) => o.brutalism ? `${o.brutalism.borderWidth} solid ${o.colors.neutral[900]}` : "none"};
910
+ display: flex;
911
+ flex-direction: column;
912
+ max-height: 90vh;
913
+ animation: ${({ $closing: o }) => o ? Vr : Br} 0.15s ease
914
+ forwards;
1129
915
 
1130
- @media (max-width: 640px) {
1131
- flex-direction: column;
1132
- align-items: flex-start;
1133
- gap: ${({ theme: o }) => o.spacing[2]};
1134
- }
1135
- `, Zr = i.div`
916
+ ${({ $size: o }) => o === "sm" && t`
917
+ width: min(400px, 90vw);
918
+ `}
919
+ ${({ $size: o }) => o === "md" && t`
920
+ width: min(560px, 90vw);
921
+ `}
922
+ ${({ $size: o }) => o === "lg" && t`
923
+ width: min(720px, 90vw);
924
+ `}
925
+ ${({ $size: o }) => o === "fullscreen" && t`
926
+ width: 100vw;
927
+ height: 100vh;
928
+ max-height: 100vh;
929
+ border-radius: 0;
930
+ `}
931
+ `, Ar = i.div`
1136
932
  display: flex;
1137
933
  align-items: center;
1138
934
  gap: ${({ theme: o }) => o.spacing[2]};
1139
- `, Jr = i.span`
935
+ padding: ${({ theme: o }) => o.spacing[4]};
936
+ border-bottom: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
937
+ flex-shrink: 0;
938
+ `, Rr = i.h2`
939
+ flex: 1;
940
+ font-size: ${({ theme: o }) => o.fontSizes.lg};
941
+ font-weight: 600;
942
+ margin: 0;
943
+ `, Yr = i.button`
1140
944
  display: inline-flex;
1141
945
  align-items: center;
1142
946
  justify-content: center;
947
+ margin-left: auto;
1143
948
  flex-shrink: 0;
1144
- transition: transform 0.2s ease;
1145
- transform: ${({ $open: o }) => o ? "rotate(180deg)" : "rotate(0deg)"};
1146
- color: ${({ theme: o, $accentColor: r }) => r ?? o.colors.neutral[500]};
1147
- `, Qr = i.div`
1148
- display: grid;
1149
- grid-template-rows: ${({ $open: o }) => o ? "1fr" : "0fr"};
1150
- transition: grid-template-rows 0.2s ease;
1151
- `, on = i.div`
1152
- overflow: hidden;
1153
- `, rn = i.div`
949
+ width: 32px;
950
+ height: 32px;
951
+ border: none;
952
+ background: none;
953
+ cursor: pointer;
954
+ border-radius: ${({ theme: o }) => o.radius.md};
955
+ font-size: 20px;
956
+ line-height: 1;
957
+ color: ${({ theme: o }) => o.colors.neutral[500]};
958
+
959
+ &:hover {
960
+ background-color: ${({ theme: o }) => o.colors.neutral[100]};
961
+ color: ${({ theme: o }) => o.colors.neutral[900]};
962
+ }
963
+
964
+ &:focus-visible {
965
+ outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
966
+ outline-offset: 2px;
967
+ }
968
+ `, Hr = i.div`
969
+ padding: ${({ theme: o }) => o.spacing[4]};
970
+ overflow-y: auto;
971
+ flex: 1;
972
+ `, Ur = i.div`
973
+ display: flex;
974
+ align-items: center;
975
+ justify-content: flex-end;
976
+ gap: ${({ theme: o }) => o.spacing[2]};
1154
977
  padding: ${({ theme: o }) => o.spacing[4]};
1155
978
  border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
979
+ flex-shrink: 0;
980
+ `, Kr = [
981
+ "button:not([disabled])",
982
+ "input:not([disabled])",
983
+ "select:not([disabled])",
984
+ "textarea:not([disabled])",
985
+ "a[href]",
986
+ '[tabindex]:not([tabindex="-1"])'
987
+ ].join(", ");
988
+ function bo(o) {
989
+ return Array.from(
990
+ o.querySelectorAll(Kr)
991
+ );
992
+ }
993
+ function Io({
994
+ open: o,
995
+ onClose: r,
996
+ title: n,
997
+ children: e,
998
+ footer: l,
999
+ size: a = "md",
1000
+ closeOnBackdrop: c = !0,
1001
+ closeOnEscape: d = !0,
1002
+ ariaLabelledBy: p,
1003
+ ariaDescribedBy: $
1004
+ }) {
1005
+ const g = G(null), y = A(), b = p ?? (n ? y : void 0), [f, x] = M(o), [w, S] = M(!1);
1006
+ return j(() => {
1007
+ if (o)
1008
+ x(!0), S(!1);
1009
+ else if (f) {
1010
+ S(!0);
1011
+ const T = setTimeout(() => {
1012
+ x(!1), S(!1);
1013
+ }, 150);
1014
+ return () => clearTimeout(T);
1015
+ }
1016
+ }, [o, f]), j(() => {
1017
+ if (!o)
1018
+ return;
1019
+ const T = document.body.style.overflow;
1020
+ return document.body.style.overflow = "hidden", () => {
1021
+ document.body.style.overflow = T;
1022
+ };
1023
+ }, [o]), j(() => {
1024
+ if (!o || !g.current)
1025
+ return;
1026
+ const T = g.current, z = document.activeElement;
1027
+ (bo(T)[0] ?? T).focus();
1028
+ const k = (m) => {
1029
+ if (m.key === "Escape" && d) {
1030
+ r();
1031
+ return;
1032
+ }
1033
+ if (m.key !== "Tab")
1034
+ return;
1035
+ const v = bo(T);
1036
+ if (v.length === 0) {
1037
+ m.preventDefault();
1038
+ return;
1039
+ }
1040
+ const D = v[0], W = v[v.length - 1];
1041
+ m.shiftKey ? document.activeElement === D && (m.preventDefault(), W.focus()) : document.activeElement === W && (m.preventDefault(), D.focus());
1042
+ };
1043
+ return document.addEventListener("keydown", k), () => {
1044
+ document.removeEventListener("keydown", k), z?.focus();
1045
+ };
1046
+ }, [o, d, r, f]), f ? Co(
1047
+ /* @__PURE__ */ s(
1048
+ _r,
1049
+ {
1050
+ $closing: w,
1051
+ onClick: c ? r : void 0,
1052
+ children: /* @__PURE__ */ C(
1053
+ jr,
1054
+ {
1055
+ ref: g,
1056
+ role: "dialog",
1057
+ "aria-modal": "true",
1058
+ "aria-labelledby": b,
1059
+ "aria-describedby": $,
1060
+ $size: a,
1061
+ $closing: w,
1062
+ tabIndex: -1,
1063
+ onClick: (T) => T.stopPropagation(),
1064
+ children: [
1065
+ /* @__PURE__ */ C(Ar, { children: [
1066
+ n && /* @__PURE__ */ s(Rr, { id: y, children: n }),
1067
+ /* @__PURE__ */ s(Yr, { onClick: r, "aria-label": "Close modal", children: "×" })
1068
+ ] }),
1069
+ /* @__PURE__ */ s(Hr, { children: e }),
1070
+ l && /* @__PURE__ */ s(Ur, { children: l })
1071
+ ]
1072
+ }
1073
+ )
1074
+ }
1075
+ ),
1076
+ document.body
1077
+ ) : null;
1078
+ }
1079
+ Io.displayName = "Modal";
1080
+ const qr = L`
1081
+ from { opacity: 0; transform: translateY(12px); }
1082
+ to { opacity: 1; transform: translateY(0); }
1083
+ `, Gr = L`
1084
+ from { opacity: 0; transform: translateY(-12px); }
1085
+ to { opacity: 1; transform: translateY(0); }
1086
+ `, Jr = L`
1087
+ from { opacity: 1; }
1088
+ to { opacity: 0; }
1089
+ `, Xr = i.div`
1090
+ position: fixed;
1091
+ z-index: ${({ theme: o }) => o.zIndex.toast};
1092
+ display: flex;
1093
+ align-items: center;
1094
+ gap: ${({ theme: o }) => o.spacing[3]};
1095
+ min-width: 280px;
1096
+ max-width: 400px;
1097
+ padding: ${({ theme: o }) => `${o.spacing[3]} ${o.spacing[4]}`};
1098
+ border-radius: ${({ theme: o }) => o.radius.md};
1099
+ animation: ${({ $closing: o, $position: r }) => o ? t`
1100
+ ${Jr} 0.2s ease forwards
1101
+ ` : r.startsWith("top") ? t`
1102
+ ${Gr} 0.2s ease forwards
1103
+ ` : t`
1104
+ ${qr} 0.2s ease forwards
1105
+ `};
1106
+
1107
+ ${({ $position: o, theme: r }) => ({
1108
+ "bottom-right": t`
1109
+ bottom: ${r.spacing[6]};
1110
+ right: ${r.spacing[6]};
1111
+ `,
1112
+ "bottom-left": t`
1113
+ bottom: ${r.spacing[6]};
1114
+ left: ${r.spacing[6]};
1115
+ `,
1116
+ "top-right": t`
1117
+ top: ${r.spacing[6]};
1118
+ right: ${r.spacing[6]};
1119
+ `,
1120
+ "top-left": t`
1121
+ top: ${r.spacing[6]};
1122
+ left: ${r.spacing[6]};
1123
+ `
1124
+ })[o]}
1125
+ `, J = (o, r, n) => t`
1126
+ background: ${r};
1127
+ border: ${o.brutalism.borderWidth} solid ${n};
1128
+ box-shadow: ${o.brutalism.shadowOffset} ${o.brutalism.shadowOffset}
1129
+ 0 ${n};
1130
+ `, Zr = i(Xr)`
1131
+ ${({ $variant: o, theme: r }) => r.brutalism ? {
1132
+ success: J(
1133
+ r,
1134
+ r.colors.success[50],
1135
+ r.colors.success[500]
1136
+ ),
1137
+ error: J(
1138
+ r,
1139
+ r.colors.error[50],
1140
+ r.colors.error[500]
1141
+ ),
1142
+ warning: J(
1143
+ r,
1144
+ r.colors.warning[50],
1145
+ r.colors.warning[500]
1146
+ ),
1147
+ info: J(r, r.colors.info[50], r.colors.info[500])
1148
+ }[o] : {
1149
+ success: t`
1150
+ background: ${r.colors.success[50]};
1151
+ border-left: 4px solid ${r.colors.success[500]};
1152
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
1153
+ `,
1154
+ error: t`
1155
+ background: ${r.colors.error[50]};
1156
+ border-left: 4px solid ${r.colors.error[500]};
1157
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
1158
+ `,
1159
+ warning: t`
1160
+ background: ${r.colors.warning[50]};
1161
+ border-left: 4px solid ${r.colors.warning[500]};
1162
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
1163
+ `,
1164
+ info: t`
1165
+ background: ${r.colors.info[50]};
1166
+ border-left: 4px solid ${r.colors.info[500]};
1167
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
1168
+ `
1169
+ }[o]}
1170
+ `, Qr = i.p`
1171
+ flex: 1;
1172
+ margin: 0;
1173
+ font-size: ${({ theme: o }) => o.fontSizes.sm};
1174
+ font-weight: ${({ theme: o }) => o.brutalism ? 600 : 400};
1175
+ line-height: 1.5;
1176
+ color: ${({ theme: o }) => o.colors.neutral[900]};
1177
+ `, on = i.button`
1178
+ flex-shrink: 0;
1179
+ display: inline-flex;
1180
+ align-items: center;
1181
+ justify-content: center;
1182
+ width: 24px;
1183
+ height: 24px;
1184
+ border: none;
1185
+ background: none;
1186
+ cursor: pointer;
1187
+ border-radius: ${({ theme: o }) => o.radius.md};
1188
+ color: ${({ theme: o }) => o.colors.neutral[500]};
1189
+
1190
+ &:hover {
1191
+ background-color: rgba(0, 0, 0, 0.06);
1192
+ color: ${({ theme: o }) => o.colors.neutral[900]};
1193
+ }
1194
+
1195
+ &:focus-visible {
1196
+ outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
1197
+ outline-offset: 2px;
1198
+ }
1156
1199
  `;
1157
- function nn({
1158
- title: o,
1159
- children: r,
1160
- defaultOpen: n = !1,
1161
- open: e,
1162
- onToggle: c,
1163
- subtitle: a,
1164
- headerActions: l,
1165
- accentColor: u
1200
+ function Mo({
1201
+ open: o,
1202
+ onClose: r,
1203
+ message: n,
1204
+ variant: e = "info",
1205
+ duration: l = 4e3,
1206
+ position: a = "bottom-right"
1166
1207
  }) {
1167
- const [x, p] = D(n), b = G(), w = e !== void 0, y = w ? e : x;
1168
- return /* @__PURE__ */ C(Hr, { $accentColor: u, children: [
1208
+ const [c, d] = M(o), [p, $] = M(!1);
1209
+ return j(() => {
1210
+ if (o)
1211
+ d(!0), $(!1);
1212
+ else if (c) {
1213
+ $(!0);
1214
+ const g = setTimeout(() => {
1215
+ d(!1), $(!1);
1216
+ }, 200);
1217
+ return () => {
1218
+ clearTimeout(g);
1219
+ };
1220
+ }
1221
+ }, [o, c]), j(() => {
1222
+ if (!o || l === 0)
1223
+ return;
1224
+ const g = setTimeout(r, l);
1225
+ return () => {
1226
+ clearTimeout(g);
1227
+ };
1228
+ }, [o, l, r]), c ? Co(
1169
1229
  /* @__PURE__ */ C(
1170
- Yr,
1230
+ Zr,
1171
1231
  {
1172
- type: "button",
1173
- $open: y,
1174
- $accentColor: u,
1175
- "aria-expanded": y,
1176
- "aria-controls": b,
1177
- onClick: () => {
1178
- const k = !y;
1179
- w || p(k), c?.(k);
1180
- },
1232
+ $position: a,
1233
+ $variant: e,
1234
+ $closing: p,
1235
+ role: "alert",
1236
+ "aria-live": "polite",
1181
1237
  children: [
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 })
1187
- ] })
1188
- ] }),
1189
- /* @__PURE__ */ s(
1190
- Jr,
1191
- {
1192
- $open: y,
1193
- $accentColor: u,
1194
- "aria-hidden": "true",
1195
- children: /* @__PURE__ */ s(To, { size: 18, strokeWidth: 2.5 })
1196
- }
1197
- )
1238
+ /* @__PURE__ */ s(Qr, { children: n }),
1239
+ /* @__PURE__ */ s(on, { onClick: r, "aria-label": "Close notification", children: /* @__PURE__ */ s(co, { size: 14, strokeWidth: 2.5 }) })
1198
1240
  ]
1199
1241
  }
1200
1242
  ),
1201
- /* @__PURE__ */ s(Qr, { $open: y, children: /* @__PURE__ */ s(on, { id: b, role: "region", "aria-label": o, children: /* @__PURE__ */ s(rn, { children: r }) }) })
1202
- ] });
1243
+ document.body
1244
+ ) : null;
1203
1245
  }
1204
- nn.displayName = "CollapsibleCard";
1205
- const Wo = mo(null);
1206
- function An({ children: o }) {
1207
- const [r, n] = D(null), e = R((a) => {
1246
+ Mo.displayName = "Toast";
1247
+ const Do = ao(null);
1248
+ function yt({ children: o }) {
1249
+ const [r, n] = M(null), e = V((a) => {
1208
1250
  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" })
1251
+ }, []), l = lo(() => Object.assign((a) => e(a), {
1252
+ success: (a, c) => e({ ...c, message: a, variant: "success" }),
1253
+ error: (a, c) => e({ ...c, message: a, variant: "error" }),
1254
+ warning: (a, c) => e({ ...c, message: a, variant: "warning" }),
1255
+ info: (a, c) => e({ ...c, message: a, variant: "info" })
1214
1256
  }), [e]);
1215
- return /* @__PURE__ */ C(Wo.Provider, { value: { toast: c }, children: [
1257
+ return /* @__PURE__ */ C(Do.Provider, { value: { toast: l }, children: [
1216
1258
  o,
1217
1259
  r && /* @__PURE__ */ s(
1218
- Eo,
1260
+ Mo,
1219
1261
  {
1220
1262
  open: !0,
1221
1263
  onClose: () => n(null),
@@ -1228,137 +1270,376 @@ function An({ children: o }) {
1228
1270
  )
1229
1271
  ] });
1230
1272
  }
1231
- function jn() {
1232
- const o = ko(Wo);
1273
+ function ht() {
1274
+ const o = io(Do);
1233
1275
  if (!o)
1234
1276
  throw new Error("useToast must be used within a ToastProvider");
1235
1277
  return o;
1236
1278
  }
1237
- function Rn({
1279
+ const rn = i.form`
1280
+ display: flex;
1281
+ flex-direction: column;
1282
+ gap: ${({ theme: o }) => o.spacing[4]};
1283
+ `, nn = i.div`
1284
+ display: flex;
1285
+ flex-direction: column;
1286
+ gap: ${({ theme: o }) => o.spacing[1]};
1287
+ `, tn = i.label`
1288
+ font-size: ${({ theme: o }) => o.fontSizes.sm};
1289
+ font-weight: 500;
1290
+ color: ${({ theme: o }) => o.colors.neutral[900]};
1291
+ `, sn = i.span`
1292
+ color: ${({ theme: o }) => o.colors.error[500]};
1293
+ margin-left: 2px;
1294
+ `, en = i.span`
1295
+ font-size: ${({ theme: o }) => o.fontSizes.xs};
1296
+ color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
1297
+ `;
1298
+ function an({ onSubmit: o, children: r, ...n }) {
1299
+ return /* @__PURE__ */ s(
1300
+ rn,
1301
+ {
1302
+ onSubmit: (e) => {
1303
+ e.preventDefault(), o?.(e);
1304
+ },
1305
+ noValidate: !0,
1306
+ ...n,
1307
+ children: r
1308
+ }
1309
+ );
1310
+ }
1311
+ an.displayName = "Form";
1312
+ function ln({
1313
+ label: o,
1314
+ error: r,
1315
+ helperText: n,
1316
+ required: e,
1317
+ children: l
1318
+ }) {
1319
+ const a = A(), c = `${a}-hint`, d = !!(r || n), p = typeof r == "string" ? r : void 0, $ = po.isValidElement(l) ? po.cloneElement(
1320
+ l,
1321
+ {
1322
+ id: a,
1323
+ ...d && { "aria-describedby": c },
1324
+ ...r && { "aria-invalid": !0 }
1325
+ }
1326
+ ) : l;
1327
+ return /* @__PURE__ */ C(nn, { children: [
1328
+ o && /* @__PURE__ */ C(tn, { htmlFor: a, children: [
1329
+ o,
1330
+ e && /* @__PURE__ */ s(sn, { "aria-hidden": "true", children: " *" })
1331
+ ] }),
1332
+ $,
1333
+ d && /* @__PURE__ */ s(en, { id: c, $error: !!r, children: p ?? n })
1334
+ ] });
1335
+ }
1336
+ ln.displayName = "FormField";
1337
+ function wt({
1238
1338
  initialValues: o,
1239
1339
  validate: r,
1240
1340
  onSubmit: n,
1241
1341
  onError: e
1242
1342
  }) {
1243
- const [c, a] = D(o), [l, u] = D(
1343
+ const [l, a] = M(o), [c, d] = M(
1244
1344
  {}
1245
- ), [x, p] = D({}), [b, w] = D(!1), y = oo(c);
1246
- y.current = c;
1247
- const g = R(
1248
- (h) => {
1345
+ ), [p, $] = M({}), [g, y] = M(!1), b = G(l);
1346
+ b.current = l;
1347
+ const f = V(
1348
+ (m) => {
1249
1349
  if (!r)
1250
1350
  return {};
1251
- const $ = r(h);
1351
+ const v = r(m);
1252
1352
  return Object.fromEntries(
1253
- Object.entries($).filter(([, m]) => m !== void 0)
1353
+ Object.entries(v).filter(([, D]) => D !== void 0)
1254
1354
  );
1255
1355
  },
1256
1356
  [r]
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));
1357
+ ), x = G(p);
1358
+ x.current = p;
1359
+ const w = V(
1360
+ (m) => {
1361
+ const { name: v, value: D } = m.target;
1362
+ process.env.NODE_ENV !== "production" && !v && console.warn(
1363
+ "[useForm] handleChange: field is missing a `name` attribute — value will not be tracked."
1364
+ );
1365
+ const W = { ...b.current, [v]: D };
1366
+ a(W), x.current[v] && d(f(W));
1263
1367
  },
1264
- [g]
1265
- ), z = R(
1266
- (h) => {
1267
- const { name: $ } = h.target;
1268
- p((m) => ({ ...m, [$]: !0 })), u(g(y.current));
1368
+ [f]
1369
+ ), S = V(
1370
+ (m) => {
1371
+ const { name: v } = m.target;
1372
+ process.env.NODE_ENV !== "production" && !v && console.warn(
1373
+ "[useForm] handleBlur: field is missing a `name` attribute — touched state will not be tracked."
1374
+ ), $((D) => ({ ...D, [v]: !0 })), d(f(b.current));
1269
1375
  },
1270
- [g]
1271
- ), v = R(
1272
- (h) => {
1273
- h?.preventDefault();
1274
- const $ = Object.keys(y.current).reduce(
1275
- (j, _) => ({ ...j, [_]: !0 }),
1376
+ [f]
1377
+ ), T = V(
1378
+ (m) => {
1379
+ m?.preventDefault();
1380
+ const v = Object.keys(b.current).reduce(
1381
+ (F, O) => ({ ...F, [O]: !0 }),
1276
1382
  {}
1277
1383
  );
1278
- p($);
1279
- const m = g(y.current);
1280
- if (u(m), Object.keys(m).length > 0) {
1281
- e?.(m);
1384
+ $(v);
1385
+ const D = f(b.current);
1386
+ if (d(D), Object.keys(D).length > 0) {
1387
+ e?.(D);
1282
1388
  return;
1283
1389
  }
1284
1390
  (async () => {
1285
- w(!0);
1391
+ y(!0);
1286
1392
  try {
1287
- await n?.(y.current);
1393
+ await n?.(b.current);
1288
1394
  } finally {
1289
- w(!1);
1395
+ y(!1);
1290
1396
  }
1291
1397
  })();
1292
1398
  },
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])
1399
+ [f, n, e]
1400
+ ), z = V((m, v) => {
1401
+ a((D) => ({ ...D, [m]: v }));
1402
+ }, []), I = V(
1403
+ (m) => {
1404
+ a(m ?? o), d({}), $({}), y(!1);
1405
+ },
1406
+ [o]
1407
+ ), k = Object.fromEntries(
1408
+ Object.entries(c).filter(([m]) => p[m])
1300
1409
  );
1301
1410
  return {
1302
- values: c,
1303
- errors: B,
1304
- touched: x,
1305
- handleChange: T,
1306
- handleBlur: z,
1307
- handleSubmit: v,
1308
- setFieldValue: I,
1309
- reset: P,
1310
- isSubmitting: b
1411
+ values: l,
1412
+ errors: k,
1413
+ touched: p,
1414
+ handleChange: w,
1415
+ handleBlur: S,
1416
+ handleSubmit: T,
1417
+ setFieldValue: z,
1418
+ reset: I,
1419
+ isSubmitting: g
1311
1420
  };
1312
1421
  }
1313
- function tn(o, r) {
1422
+ const cn = i.div`
1423
+ border-radius: ${({ theme: o }) => o.radius.md};
1424
+ background: ${({ theme: o }) => o.colors.neutral[0]};
1425
+ overflow: hidden;
1426
+
1427
+ ${({ theme: o, $accentColor: r }) => o.brutalism ? t`
1428
+ border: ${o.brutalism.borderWidth} solid
1429
+ ${r ?? o.colors.neutral[900]};
1430
+ box-shadow: ${o.brutalism.shadowOffset}
1431
+ ${o.brutalism.shadowOffset} 0
1432
+ ${r ?? o.colors.neutral[900]};
1433
+ ` : t`
1434
+ border: 1px solid ${r ?? o.colors.neutral[200]};
1435
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
1436
+ `}
1437
+ `, dn = i.button`
1438
+ width: 100%;
1439
+ display: flex;
1440
+ align-items: flex-start;
1441
+ gap: ${({ theme: o }) => o.spacing[3]};
1442
+ padding: ${({ theme: o }) => o.spacing[4]};
1443
+ background: ${({ theme: o }) => o.brutalism ? o.colors.neutral[100] : o.colors.neutral[0]};
1444
+ border: none;
1445
+ cursor: pointer;
1446
+ text-align: left;
1447
+
1448
+ &:hover {
1449
+ background: ${({ theme: o }) => o.colors.neutral[100]};
1450
+ }
1451
+
1452
+ &:focus-visible {
1453
+ outline: 2px solid
1454
+ ${({ theme: o, $accentColor: r }) => r ?? o.colors.primary[500]};
1455
+ outline-offset: -2px;
1456
+ }
1457
+ `, un = i.div`
1458
+ flex: 1;
1459
+ min-width: 0;
1460
+ `, pn = i.span`
1461
+ display: block;
1462
+ font-size: ${({ theme: o }) => o.fontSizes.md};
1463
+ font-weight: 600;
1464
+ color: ${({ theme: o }) => o.colors.neutral[900]};
1465
+ `, fn = i.span`
1466
+ display: block;
1467
+ font-size: ${({ theme: o }) => o.fontSizes.sm};
1468
+ color: ${({ theme: o }) => o.colors.neutral[500]};
1469
+ `, $n = i.div`
1470
+ display: flex;
1471
+ flex-direction: row;
1472
+ align-items: center;
1473
+ justify-content: space-between;
1474
+ margin-top: ${({ theme: o }) => o.spacing[1]};
1475
+
1476
+ @media (max-width: 640px) {
1477
+ flex-direction: column;
1478
+ align-items: flex-start;
1479
+ gap: ${({ theme: o }) => o.spacing[2]};
1480
+ }
1481
+ `, gn = i.div`
1482
+ display: flex;
1483
+ align-items: center;
1484
+ gap: ${({ theme: o }) => o.spacing[2]};
1485
+ `, bn = i.span`
1486
+ display: inline-flex;
1487
+ align-items: center;
1488
+ justify-content: center;
1489
+ flex-shrink: 0;
1490
+ transition: transform 0.2s ease;
1491
+ transform: ${({ $open: o }) => o ? "rotate(180deg)" : "rotate(0deg)"};
1492
+ color: ${({ theme: o, $accentColor: r }) => r ?? o.colors.neutral[500]};
1493
+ `, xn = i.div`
1494
+ display: grid;
1495
+ grid-template-rows: ${({ $open: o }) => o ? "1fr" : "0fr"};
1496
+ transition: grid-template-rows 0.2s ease;
1497
+ `, yn = i.div`
1498
+ overflow: hidden;
1499
+ `, hn = i.div`
1500
+ padding: ${({ theme: o }) => o.spacing[4]};
1501
+ border-top: 1px solid ${({ theme: o }) => o.colors.neutral[200]};
1502
+ `;
1503
+ function wn({
1504
+ title: o,
1505
+ children: r,
1506
+ defaultOpen: n = !1,
1507
+ open: e,
1508
+ onToggle: l,
1509
+ subtitle: a,
1510
+ headerActions: c,
1511
+ accentColor: d
1512
+ }) {
1513
+ const [p, $] = M(n), g = A(), y = e !== void 0, b = y ? e : p;
1514
+ return /* @__PURE__ */ C(cn, { $accentColor: d, children: [
1515
+ /* @__PURE__ */ C(
1516
+ dn,
1517
+ {
1518
+ type: "button",
1519
+ $open: b,
1520
+ $accentColor: d,
1521
+ "aria-expanded": b,
1522
+ "aria-controls": g,
1523
+ onClick: () => {
1524
+ const x = !b;
1525
+ y || $(x), l?.(x);
1526
+ },
1527
+ children: [
1528
+ /* @__PURE__ */ C(un, { children: [
1529
+ /* @__PURE__ */ s(pn, { children: o }),
1530
+ (a || c) && /* @__PURE__ */ C($n, { children: [
1531
+ a && /* @__PURE__ */ s(fn, { children: a }),
1532
+ c && /* @__PURE__ */ s(gn, { onClick: (x) => x.stopPropagation(), children: c })
1533
+ ] })
1534
+ ] }),
1535
+ /* @__PURE__ */ s(
1536
+ bn,
1537
+ {
1538
+ $open: b,
1539
+ $accentColor: d,
1540
+ "aria-hidden": "true",
1541
+ children: /* @__PURE__ */ s(zo, { size: 18, strokeWidth: 2.5 })
1542
+ }
1543
+ )
1544
+ ]
1545
+ }
1546
+ ),
1547
+ /* @__PURE__ */ s(xn, { $open: b, children: /* @__PURE__ */ s(yn, { id: g, role: "region", "aria-label": o, children: /* @__PURE__ */ s(hn, { children: r }) }) })
1548
+ ] });
1549
+ }
1550
+ wn.displayName = "CollapsibleCard";
1551
+ const mn = L`
1552
+ to { transform: rotate(360deg); }
1553
+ `, vn = {
1554
+ sm: "16px",
1555
+ md: "24px",
1556
+ lg: "40px"
1557
+ }, kn = {
1558
+ thin: "2px",
1559
+ normal: "3px",
1560
+ bold: "5px"
1561
+ }, Cn = i.span`
1562
+ display: inline-block;
1563
+ border-radius: 50%;
1564
+ animation: ${mn} 0.7s linear infinite;
1565
+
1566
+ ${({ $size: o = "md", $weight: r = "normal", $color: n, theme: e }) => {
1567
+ const l = vn[o], a = kn[r], c = e.colors.neutral[200], d = n ?? e.colors.primary[500];
1568
+ return t`
1569
+ width: ${l};
1570
+ height: ${l};
1571
+ border: ${a} solid ${c};
1572
+ border-top-color: ${d};
1573
+ `;
1574
+ }}
1575
+ `;
1576
+ function Sn({
1577
+ size: o = "md",
1578
+ weight: r = "normal",
1579
+ color: n,
1580
+ label: e = "Loading..."
1581
+ }) {
1582
+ return /* @__PURE__ */ s(
1583
+ Cn,
1584
+ {
1585
+ $size: o,
1586
+ $weight: r,
1587
+ $color: n,
1588
+ role: "status",
1589
+ "aria-label": e
1590
+ }
1591
+ );
1592
+ }
1593
+ Sn.displayName = "Spinner";
1594
+ function zn(o, r) {
1314
1595
  return o?.key !== r ? { key: r, direction: "asc" } : o.direction === "asc" ? { key: r, direction: "desc" } : null;
1315
1596
  }
1316
- function sn({
1597
+ function Tn({
1317
1598
  data: o,
1318
1599
  sort: r,
1319
1600
  defaultSort: n,
1320
1601
  onSortChange: e
1321
1602
  }) {
1322
- const c = r !== void 0, [a, l] = D(
1603
+ const l = r !== void 0, [a, c] = M(
1323
1604
  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 };
1605
+ ), d = l ? r ?? null : a, p = (g) => {
1606
+ const y = zn(d, g);
1607
+ return l || c(y), e?.(y), y;
1608
+ }, $ = lo(() => l || !d ? o : [...o].sort((g, y) => {
1609
+ const b = g[d.key], f = y[d.key], x = b < f ? -1 : b > f ? 1 : 0;
1610
+ return d.direction === "asc" ? x : -x;
1611
+ }), [o, d, l]);
1612
+ return { activeSort: d, sortedData: $, handleSort: p };
1332
1613
  }
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);
1614
+ const In = 7, xo = 3, yo = 1;
1615
+ function Mn(o, r) {
1616
+ if (r <= In)
1617
+ return Array.from({ length: r }, (e, l) => l + 1);
1337
1618
  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++)
1619
+ o > xo && n.push("...");
1620
+ for (let e = Math.max(2, o - yo); e <= Math.min(r - 1, o + yo); e++)
1340
1621
  n.push(e);
1341
- return o < r - ho + 1 && n.push("..."), n.push(r), n;
1622
+ return o < r - xo + 1 && n.push("..."), n.push(r), n;
1342
1623
  }
1343
- function ln({
1624
+ function Dn({
1344
1625
  data: o,
1345
1626
  pageSize: r,
1346
1627
  page: n,
1347
1628
  defaultPage: e,
1348
- totalRows: c,
1629
+ totalRows: l,
1349
1630
  onPageChange: a
1350
1631
  }) {
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)
1632
+ const c = n !== void 0, [d, p] = M(e ?? 1), $ = c ? n : d, g = (w) => {
1633
+ c || p(w), a?.(w);
1634
+ }, y = c || l !== void 0, b = l ?? o.length, f = r ? Math.max(1, Math.ceil(b / r)) : 1, x = lo(() => {
1635
+ if (!r || y)
1355
1636
  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 };
1637
+ const w = ($ - 1) * r;
1638
+ return o.slice(w, w + r);
1639
+ }, [o, r, $, y]);
1640
+ return { activePage: $, totalPages: f, displayData: x, handlePageChange: g };
1360
1641
  }
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`
1642
+ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg" ? `${r.spacing[3]} ${r.spacing[4]}` : `${r.spacing[2]} ${r.spacing[3]}`, Wn = i.div`
1362
1643
  width: 100%;
1363
1644
 
1364
1645
  ${({ theme: o, $borderColor: r }) => o.brutalism ? t`
@@ -1377,7 +1658,7 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1377
1658
  ${({ $stickyHeader: o }) => o && t`
1378
1659
  overflow-y: auto;
1379
1660
  `}
1380
- `, Bo = i.table`
1661
+ `, On = i.table`
1381
1662
  width: 100%;
1382
1663
  border-collapse: collapse;
1383
1664
  font-size: ${({ $size: o, theme: r }) => ({
@@ -1389,7 +1670,7 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1389
1670
  caption {
1390
1671
  padding: 8px 0;
1391
1672
  }
1392
- `, Do = i.thead`
1673
+ `, Pn = i.thead`
1393
1674
  ${({ $stickyHeader: o }) => o && t`
1394
1675
  position: sticky;
1395
1676
  top: 0;
@@ -1409,7 +1690,7 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1409
1690
  --th-text: ${o.colors.neutral[600]};
1410
1691
  --th-sep: ${n ?? o.colors.neutral[300]};
1411
1692
  `}
1412
- `, No = i.tbody`
1693
+ `, Nn = i.tbody`
1413
1694
  ${({ $rowColor: o }) => o && t`
1414
1695
  tr {
1415
1696
  background-color: ${o};
@@ -1425,21 +1706,37 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1425
1706
  tr:last-child td {
1426
1707
  border-bottom: none;
1427
1708
  }
1428
- `, q = i.tr``, po = i.th`
1709
+
1710
+ tr:hover td {
1711
+ background-color: rgba(0, 0, 0, 0.04);
1712
+ }
1713
+ `, X = i.tr``, En = i(X)`
1714
+ cursor: pointer;
1715
+
1716
+ td {
1717
+ transition:
1718
+ background-color 0.1s,
1719
+ box-shadow 0.1s;
1720
+ }
1721
+
1722
+ &:hover td {
1723
+ background-color: rgba(0, 0, 0, 0.04);
1724
+ }
1725
+
1726
+ &:hover td:first-child {
1727
+ box-shadow: inset 4px 0 0
1728
+ ${({ $accentColor: o, theme: r }) => o ?? r.colors.neutral[900]};
1729
+ }
1730
+ `, Ln = i.th`
1429
1731
  background-color: var(--th-bg);
1430
1732
  color: var(--th-text);
1431
1733
  text-align: left;
1432
1734
  font-weight: 700;
1433
1735
  white-space: nowrap;
1434
1736
 
1435
- padding: ${({ $size: o, theme: r }) => Oo(o, r)};
1737
+ padding: ${({ $size: o, theme: r }) => Wo(o, r)};
1436
1738
 
1437
- ${({ theme: o, $bordered: r }) => o.brutalism ? t`
1438
- border-right: 1px solid var(--th-sep);
1439
- &:last-child {
1440
- border-right: none;
1441
- }
1442
- ` : t`
1739
+ ${({ theme: o, $bordered: r }) => o.brutalism ? t`` : t`
1443
1740
  border-bottom: 2px solid var(--th-sep);
1444
1741
  ${r && t`
1445
1742
  border-right: 1px solid var(--th-sep);
@@ -1448,7 +1745,7 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1448
1745
  }
1449
1746
  `}
1450
1747
  `}
1451
- `, cn = i.button`
1748
+ `, Fn = i.button`
1452
1749
  display: inline-flex;
1453
1750
  align-items: center;
1454
1751
  gap: ${({ theme: o }) => o.spacing[1]};
@@ -1467,12 +1764,12 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1467
1764
  outline-offset: 2px;
1468
1765
  border-radius: 2px;
1469
1766
  }
1470
- `, dn = i.span`
1767
+ `, Bn = i.span`
1471
1768
  opacity: 0.5;
1472
1769
  display: inline-flex;
1473
1770
  align-items: center;
1474
- `, ro = i.td`
1475
- padding: ${({ $size: o, theme: r }) => Oo(o, r)};
1771
+ `, Oo = i.td`
1772
+ padding: ${({ $size: o, theme: r }) => Wo(o, r)};
1476
1773
 
1477
1774
  ${({ $bordered: o, $borderColor: r, theme: n }) => n.brutalism ? t`
1478
1775
  border-bottom: ${n.brutalism.borderWidth} solid
@@ -1490,16 +1787,16 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1490
1787
  border-bottom: 1px solid
1491
1788
  ${r ?? n.colors.neutral[200]};
1492
1789
  `}
1493
- `, un = i.td`
1790
+ `, Vn = i.td`
1494
1791
  text-align: center;
1495
1792
  color: ${({ theme: o }) => o.colors.neutral[400]};
1496
1793
  padding: ${({ theme: o }) => `${o.spacing[4]} ${o.spacing[3]}`};
1497
1794
  font-size: ${({ theme: o }) => o.fontSizes.sm};
1498
1795
  border-bottom: none;
1499
- `, pn = M`
1796
+ `, _n = L`
1500
1797
  0% { background-position: -400px 0; }
1501
1798
  100% { background-position: 400px 0; }
1502
- `, fn = i(ro)``, gn = i.div`
1799
+ `, jn = i(Oo)``, An = i.div`
1503
1800
  height: 14px;
1504
1801
  border-radius: 4px;
1505
1802
  background: linear-gradient(
@@ -1509,8 +1806,8 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1509
1806
  ${({ theme: o }) => o.colors.neutral[200]} 75%
1510
1807
  );
1511
1808
  background-size: 800px 100%;
1512
- animation: ${pn} 1.6s ease-in-out infinite;
1513
- `, bn = i.div`
1809
+ animation: ${_n} 1.6s ease-in-out infinite;
1810
+ `, Rn = i.div`
1514
1811
  display: flex;
1515
1812
  align-items: center;
1516
1813
  justify-content: center;
@@ -1523,7 +1820,7 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1523
1820
  ` : t`
1524
1821
  border-top: 1px solid ${o.colors.neutral[200]};
1525
1822
  `}
1526
- `, eo = i.button`
1823
+ `, no = i.button`
1527
1824
  display: inline-flex;
1528
1825
  align-items: center;
1529
1826
  justify-content: center;
@@ -1566,171 +1863,180 @@ const Oo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1566
1863
  outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
1567
1864
  outline-offset: 2px;
1568
1865
  }
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 });
1866
+ `, Yn = 4;
1867
+ function Hn(o, r) {
1868
+ return o?.key !== r ? /* @__PURE__ */ s(dr, { size: 14 }) : o.direction === "asc" ? /* @__PURE__ */ s(pr, { size: 14 }) : /* @__PURE__ */ s(lr, { size: 14 });
1572
1869
  }
1573
- function yn({
1870
+ function Un({
1574
1871
  columns: o,
1575
1872
  data: r,
1576
1873
  rowKey: n,
1577
1874
  size: e = "md",
1578
- striped: c,
1875
+ striped: l,
1579
1876
  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
1877
+ stickyHeader: c,
1878
+ caption: d,
1879
+ emptyMessage: p = "No data",
1880
+ loading: $,
1881
+ sort: g,
1882
+ defaultSort: y,
1883
+ onSortChange: b,
1884
+ pageSize: f,
1885
+ page: x,
1886
+ defaultPage: w,
1887
+ totalRows: S,
1888
+ onPageChange: T,
1889
+ onChange: z,
1890
+ onRowClick: I,
1891
+ borderColor: k,
1892
+ headerColor: m,
1893
+ rowColor: v,
1894
+ stripeColor: D,
1895
+ className: W,
1896
+ style: F
1599
1897
  }) {
1600
1898
  const {
1601
- activeSort: j,
1602
- sortedData: _,
1603
- handleSort: H
1604
- } = sn({
1899
+ activeSort: O,
1900
+ sortedData: U,
1901
+ handleSort: P
1902
+ } = Tn({
1605
1903
  data: r,
1606
- sort: b,
1607
- defaultSort: w,
1608
- onSortChange: y
1904
+ sort: g,
1905
+ defaultSort: y,
1906
+ onSortChange: b
1609
1907
  }), {
1610
1908
  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;
1909
+ totalPages: K,
1910
+ displayData: u,
1911
+ handlePageChange: B
1912
+ } = Dn({
1913
+ data: U,
1914
+ pageSize: f,
1915
+ page: x,
1916
+ defaultPage: w,
1917
+ totalRows: S,
1918
+ onPageChange: T
1919
+ }), R = (h) => {
1920
+ const E = P(h);
1921
+ z?.({ sort: E, page: N });
1922
+ }, Y = (h) => {
1923
+ B(h), z?.({ sort: O, page: h });
1924
+ }, Z = (h, E) => String(n ? h[n] : E), Q = !$ && u.length === 0, Eo = f ?? Yn;
1627
1925
  return /* @__PURE__ */ C(
1628
- Po,
1926
+ Wn,
1629
1927
  {
1630
- $borderColor: P,
1631
- $stickyHeader: l,
1632
- className: m,
1633
- style: O,
1928
+ $borderColor: k,
1929
+ $stickyHeader: c,
1930
+ className: W,
1931
+ style: F,
1634
1932
  children: [
1635
- /* @__PURE__ */ C(Bo, { $size: e, children: [
1636
- u && /* @__PURE__ */ s("caption", { children: u }),
1933
+ /* @__PURE__ */ C(On, { $size: e, children: [
1934
+ d && /* @__PURE__ */ s("caption", { children: d }),
1637
1935
  /* @__PURE__ */ s(
1638
- Do,
1936
+ Pn,
1639
1937
  {
1640
- $headerColor: B,
1641
- $borderColor: P,
1642
- $stickyHeader: l,
1643
- children: /* @__PURE__ */ s(q, { children: o.map((d) => /* @__PURE__ */ s(
1644
- po,
1938
+ $headerColor: m,
1939
+ $borderColor: k,
1940
+ $stickyHeader: c,
1941
+ children: /* @__PURE__ */ s(X, { children: o.map((h) => /* @__PURE__ */ s(
1942
+ Ln,
1645
1943
  {
1646
1944
  $size: e,
1647
1945
  $bordered: a,
1648
1946
  scope: "col",
1649
- style: d.width ? { width: d.width } : void 0,
1650
- children: d.sortable ? /* @__PURE__ */ C(
1651
- cn,
1947
+ style: h.width ? { width: h.width } : void 0,
1948
+ children: h.sortable ? /* @__PURE__ */ C(
1949
+ Fn,
1652
1950
  {
1653
1951
  type: "button",
1654
- onClick: () => to(d.key),
1655
- "aria-label": `Sort by ${d.header}${j?.key === d.key ? `, ${j.direction}ending` : ""}`,
1952
+ onClick: () => R(h.key),
1953
+ "aria-label": `Sort by ${h.header}${O?.key === h.key ? `, ${O.direction}ending` : ""}`,
1656
1954
  children: [
1657
- d.header,
1658
- /* @__PURE__ */ s(dn, { "aria-hidden": "true", children: xn(j, d.key) })
1955
+ h.header,
1956
+ /* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(O, h.key) })
1659
1957
  ]
1660
1958
  }
1661
- ) : d.header
1959
+ ) : h.header
1662
1960
  },
1663
- d.key
1961
+ h.key
1664
1962
  )) })
1665
1963
  }
1666
1964
  ),
1667
1965
  /* @__PURE__ */ s(
1668
- No,
1966
+ Nn,
1669
1967
  {
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,
1968
+ $striped: l,
1969
+ $rowColor: v,
1970
+ $stripeColor: D,
1971
+ children: $ ? Array.from({ length: Eo }).map((h, E) => /* @__PURE__ */ s(X, { children: o.map((uo) => /* @__PURE__ */ s(
1972
+ jn,
1675
1973
  {
1676
1974
  $size: e,
1677
1975
  $bordered: a,
1678
- $borderColor: P,
1679
- children: /* @__PURE__ */ s(gn, {})
1976
+ $borderColor: k,
1977
+ children: /* @__PURE__ */ s(An, {})
1680
1978
  },
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,
1979
+ uo.key
1980
+ )) }, E)) : Q ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(Vn, { colSpan: o.length, children: p }) }) : u.map((h, E) => /* @__PURE__ */ s(
1981
+ I ? En : X,
1684
1982
  {
1685
- $size: e,
1686
- $bordered: a,
1687
- $borderColor: P,
1688
- children: L.render ? L.render(d[L.key], d, S) : String(d[L.key] ?? "") || " "
1983
+ onClick: I ? () => I(h) : void 0,
1984
+ $accentColor: I ? k : void 0,
1985
+ children: o.map((q) => /* @__PURE__ */ s(
1986
+ Oo,
1987
+ {
1988
+ $size: e,
1989
+ $bordered: a,
1990
+ $borderColor: k,
1991
+ children: q.render ? q.render(h[q.key], h, E) : String(h[q.key] ?? "") || " "
1992
+ },
1993
+ q.key
1994
+ ))
1689
1995
  },
1690
- L.key
1691
- )) }, f(d, S)))
1996
+ Z(h, E)
1997
+ ))
1692
1998
  }
1693
1999
  )
1694
2000
  ] }),
1695
- g && Y > 1 && /* @__PURE__ */ C(bn, { children: [
2001
+ f && K > 1 && /* @__PURE__ */ C(Rn, { children: [
1696
2002
  /* @__PURE__ */ s(
1697
- eo,
2003
+ no,
1698
2004
  {
1699
2005
  type: "button",
1700
- onClick: () => U(N - 1),
2006
+ onClick: () => Y(N - 1),
1701
2007
  disabled: N <= 1,
1702
2008
  "aria-label": "Previous page",
1703
2009
  children: "←"
1704
2010
  }
1705
2011
  ),
1706
- an(N, Y).map(
1707
- (d, S) => d === "..." ? /* @__PURE__ */ s(
2012
+ Mn(N, K).map(
2013
+ (h, E) => h === "..." ? /* @__PURE__ */ s(
1708
2014
  "span",
1709
2015
  {
1710
2016
  "aria-hidden": "true",
1711
2017
  style: { padding: "0 4px" },
1712
2018
  children: "…"
1713
2019
  },
1714
- `e${S}`
2020
+ `e${E}`
1715
2021
  ) : /* @__PURE__ */ s(
1716
- eo,
2022
+ no,
1717
2023
  {
1718
2024
  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
2025
+ $active: h === N,
2026
+ onClick: () => Y(h),
2027
+ "aria-label": `Page ${h}`,
2028
+ "aria-current": h === N ? "page" : void 0,
2029
+ children: h
1724
2030
  },
1725
- d
2031
+ h
1726
2032
  )
1727
2033
  ),
1728
2034
  /* @__PURE__ */ s(
1729
- eo,
2035
+ no,
1730
2036
  {
1731
2037
  type: "button",
1732
- onClick: () => U(N + 1),
1733
- disabled: N >= Y,
2038
+ onClick: () => Y(N + 1),
2039
+ disabled: N >= K,
1734
2040
  "aria-label": "Next page",
1735
2041
  children: "→"
1736
2042
  }
@@ -1740,323 +2046,527 @@ function yn({
1740
2046
  }
1741
2047
  );
1742
2048
  }
1743
- yn.displayName = "Table";
1744
- const hn = i(Bo)`
1745
- table-layout: fixed;
1746
- `, wn = i(ro)`
1747
- ${({ $editable: o, theme: r }) => o && t`
1748
- cursor: pointer;
1749
- position: relative;
1750
-
1751
- &:hover {
1752
- background-color: ${r.brutalism ? r.colors.neutral[100] : r.colors.primary[50]};
2049
+ Un.displayName = "Table";
2050
+ function mt({
2051
+ defaultSort: o,
2052
+ defaultPage: r = 1
2053
+ } = {}) {
2054
+ const [n, e] = M(o ?? null), [l, a] = M(r);
2055
+ return { sort: n, page: l, onSortChange: (p) => {
2056
+ e(p), a(1);
2057
+ }, onPageChange: (p) => {
2058
+ a(p);
2059
+ } };
2060
+ }
2061
+ const Kn = i.p`
2062
+ margin: 0;
2063
+ font-size: ${({ theme: o }) => o.fontSizes.md};
2064
+ color: ${({ theme: o }) => o.colors.neutral[600]};
2065
+ line-height: 1.5;
2066
+ `, qn = i.button`
2067
+ display: inline-flex;
2068
+ align-items: center;
2069
+ justify-content: center;
2070
+ border-radius: ${({ theme: o }) => o.radius.md};
2071
+ font-weight: 600;
2072
+ cursor: pointer;
2073
+ padding: ${({ theme: o }) => o.spacing[2]} ${({ theme: o }) => o.spacing[4]};
2074
+ font-size: ${({ theme: o }) => o.fontSizes.md};
2075
+ background-color: ${({ theme: o }) => o.colors.error[500]};
2076
+ color: ${({ theme: o }) => o.colors.neutral[0]};
2077
+ border: none;
2078
+
2079
+ &:hover:not(:disabled) {
2080
+ opacity: 0.88;
2081
+ }
2082
+
2083
+ &:focus-visible {
2084
+ outline: 2px solid ${({ theme: o }) => o.colors.error[500]};
2085
+ outline-offset: 2px;
2086
+ }
2087
+
2088
+ &:disabled {
2089
+ opacity: 0.5;
2090
+ cursor: not-allowed;
2091
+ }
2092
+
2093
+ ${({ theme: o }) => o.brutalism && t`
2094
+ border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
2095
+ box-shadow: ${o.brutalism.shadowOffset}
2096
+ ${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
2097
+ transition:
2098
+ transform 0.1s,
2099
+ box-shadow 0.1s;
2100
+ &:hover:not(:disabled) {
2101
+ opacity: 1;
2102
+ transform: translate(2px, 2px);
2103
+ box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
2104
+ }
2105
+ `}
2106
+ `;
2107
+ function Po({
2108
+ open: o,
2109
+ title: r = "Are you sure?",
2110
+ message: n,
2111
+ confirmLabel: e = "Confirm",
2112
+ cancelLabel: l = "Cancel",
2113
+ variant: a = "default",
2114
+ size: c = "sm",
2115
+ onConfirm: d,
2116
+ onCancel: p
2117
+ }) {
2118
+ return /* @__PURE__ */ s(
2119
+ Io,
2120
+ {
2121
+ open: o,
2122
+ onClose: p,
2123
+ title: r,
2124
+ size: c,
2125
+ closeOnBackdrop: !1,
2126
+ footer: /* @__PURE__ */ C(Lo, { children: [
2127
+ /* @__PURE__ */ s(so, { variant: "outline", onClick: p, children: l }),
2128
+ a === "danger" ? /* @__PURE__ */ s(qn, { type: "button", onClick: d, children: e }) : /* @__PURE__ */ s(so, { variant: "primary", onClick: d, children: e })
2129
+ ] }),
2130
+ children: /* @__PURE__ */ s(Kn, { children: n })
2131
+ }
2132
+ );
2133
+ }
2134
+ Po.displayName = "ConfirmDialog";
2135
+ const No = ao(null);
2136
+ function vt({ children: o }) {
2137
+ const [r, n] = M(null), e = V((c) => new Promise((d) => {
2138
+ n({ ...c, resolve: d });
2139
+ }), []), l = () => {
2140
+ r?.resolve(!0), n(null);
2141
+ }, a = () => {
2142
+ r?.resolve(!1), n(null);
2143
+ };
2144
+ return /* @__PURE__ */ C(No.Provider, { value: { confirm: e }, children: [
2145
+ o,
2146
+ r && /* @__PURE__ */ s(
2147
+ Po,
2148
+ {
2149
+ open: !0,
2150
+ title: r.title,
2151
+ message: r.message,
2152
+ confirmLabel: r.confirmLabel,
2153
+ cancelLabel: r.cancelLabel,
2154
+ variant: r.variant,
2155
+ size: r.size,
2156
+ onConfirm: l,
2157
+ onCancel: a
1753
2158
  }
1754
- `}
1755
- `, vn = i.input`
1756
- display: block;
1757
- width: 100%;
1758
- min-width: 0;
1759
- box-sizing: border-box;
1760
- border: none;
1761
- outline: none;
1762
- background: transparent;
1763
- font: inherit;
1764
- color: inherit;
1765
- padding: 0;
1766
- margin: 0;
2159
+ )
2160
+ ] });
2161
+ }
2162
+ function kt() {
2163
+ const o = io(No);
2164
+ if (!o)
2165
+ throw new Error("useConfirm must be used within a ConfirmProvider");
2166
+ return o.confirm;
2167
+ }
2168
+ const Gn = i.div`
2169
+ position: relative;
2170
+ display: inline-flex;
2171
+ flex-direction: column;
2172
+ gap: ${({ theme: o }) => o.spacing[1]};
2173
+ `, Jn = i.div`
2174
+ display: flex;
2175
+ align-items: center;
2176
+ border-radius: ${({ theme: o }) => o.radius.md};
2177
+ cursor: pointer;
2178
+ user-select: none;
2179
+ min-width: 200px;
2180
+ transition:
2181
+ border-color 0.2s,
2182
+ box-shadow 0.2s;
2183
+
2184
+ ${({ $size: o, theme: r }) => ({
2185
+ sm: t`
2186
+ padding: ${r.spacing[1]} ${r.spacing[2]};
2187
+ font-size: ${r.fontSizes.sm};
2188
+ `,
2189
+ md: t`
2190
+ padding: ${r.spacing[2]} ${r.spacing[3]};
2191
+ font-size: ${r.fontSizes.md};
2192
+ `,
2193
+ lg: t`
2194
+ padding: ${r.spacing[3]} ${r.spacing[4]};
2195
+ font-size: ${r.fontSizes.lg};
2196
+ `
2197
+ })[o]}
1767
2198
 
1768
2199
  ${({ theme: o }) => o.brutalism ? t`
1769
- &:focus {
1770
- outline: 2px solid ${o.colors.neutral[900]};
1771
- outline-offset: 1px;
1772
- }
1773
- ` : t`
1774
- &:focus {
1775
- box-shadow: ${o.shadows.focusRing};
1776
- }
1777
- `}
1778
- `, kn = i(po)`
1779
- width: 40px;
1780
- `, mn = i(ro)`
1781
- width: 40px;
1782
- text-align: center;
1783
- padding-left: 0;
1784
- padding-right: 0;
1785
- `, Sn = i.button`
2200
+ border: ${o.brutalism.borderWidth} solid
2201
+ ${o.colors.neutral[900]};
2202
+ background-color: ${o.colors.neutral[0]};
2203
+ box-shadow: 3px 3px 0 ${o.colors.neutral[900]};
2204
+ ` : t`
2205
+ border: 1px solid ${o.colors.neutral[400]};
2206
+ background-color: ${o.colors.neutral[0]};
2207
+ `}
2208
+
2209
+ ${({ $error: o, theme: r }) => o && t`
2210
+ border-color: ${r.colors.error[500]};
2211
+ `}
2212
+
2213
+ ${({ $disabled: o }) => o && t`
2214
+ cursor: not-allowed;
2215
+ opacity: 0.6;
2216
+ `}
2217
+
2218
+ &:focus {
2219
+ outline: none;
2220
+ box-shadow: ${({ theme: o }) => o.shadows.focusRing};
2221
+ }
2222
+ `, Xn = i.span`
2223
+ flex: 1;
2224
+ color: ${({ $hasValue: o, theme: r }) => o ? r.colors.neutral[900] : r.colors.neutral[400]};
2225
+ white-space: nowrap;
2226
+ overflow: hidden;
2227
+ text-overflow: ellipsis;
2228
+ `, Zn = i.span`
1786
2229
  display: inline-flex;
1787
2230
  align-items: center;
1788
- justify-content: center;
1789
- width: 24px;
1790
- height: 24px;
2231
+ margin-left: ${({ theme: o }) => o.spacing[2]};
2232
+ color: ${({ theme: o }) => o.colors.neutral[500]};
2233
+ flex-shrink: 0;
2234
+ `, Qn = i.button`
2235
+ display: inline-flex;
2236
+ align-items: center;
2237
+ margin-left: ${({ theme: o }) => o.spacing[2]};
1791
2238
  padding: 0;
1792
2239
  background: none;
1793
2240
  border: none;
1794
2241
  cursor: pointer;
1795
- font-size: ${({ theme: o }) => o.fontSizes.xs};
1796
2242
  color: ${({ theme: o }) => o.colors.neutral[500]};
1797
- border-radius: ${({ theme: o }) => o.radius.md};
1798
- transition: color 0.1s;
2243
+ flex-shrink: 0;
1799
2244
 
1800
2245
  &:hover {
1801
- color: ${({ theme: o }) => o.colors.error[500]};
2246
+ color: ${({ theme: o }) => o.colors.neutral[900]};
2247
+ }
1802
2248
 
1803
- ${({ theme: o }) => o.brutalism && t`
1804
- background-color: ${o.colors.error[50]};
1805
- `}
2249
+ &:focus-visible {
2250
+ outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
2251
+ outline-offset: 2px;
2252
+ border-radius: 2px;
1806
2253
  }
1807
- `, Cn = i.tr`
2254
+ `, ot = i.span`
2255
+ font-size: ${({ theme: o }) => o.fontSizes.xs};
2256
+ color: ${({ $error: o, theme: r }) => o ? r.colors.error[500] : r.colors.neutral[500]};
2257
+ `, rt = i.div`
2258
+ position: absolute;
2259
+ top: calc(100% + 4px);
2260
+ left: 0;
2261
+ z-index: ${({ theme: o }) => o.zIndex.modal};
2262
+ background: ${({ theme: o }) => o.colors.neutral[0]};
2263
+ border-radius: ${({ theme: o }) => o.radius.md};
2264
+ padding: ${({ theme: o }) => o.spacing[3]};
2265
+ min-width: 280px;
2266
+
1808
2267
  ${({ theme: o }) => o.brutalism ? t`
1809
- border-top: ${o.brutalism.borderWidth} solid
1810
- ${o.colors.neutral[900]};
1811
- ` : t`
1812
- border-top: 1px solid ${o.colors.neutral[200]};
1813
- `}
1814
- `, zn = i.button`
2268
+ border: ${o.brutalism.borderWidth} solid
2269
+ ${o.colors.neutral[900]};
2270
+ box-shadow: ${o.brutalism.shadowOffset}
2271
+ ${o.brutalism.shadowOffset} 0 ${o.colors.neutral[900]};
2272
+ ` : t`
2273
+ border: 1px solid ${o.colors.neutral[200]};
2274
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
2275
+ `}
2276
+ `, nt = i.div`
2277
+ display: flex;
2278
+ align-items: center;
2279
+ justify-content: space-between;
2280
+ margin-bottom: ${({ theme: o }) => o.spacing[3]};
2281
+ `, ho = i.button`
1815
2282
  display: inline-flex;
1816
2283
  align-items: center;
1817
- gap: ${({ theme: o }) => o.spacing[1]};
1818
- background: none;
2284
+ justify-content: center;
2285
+ width: 28px;
2286
+ height: 28px;
1819
2287
  border: none;
2288
+ background: none;
2289
+ border-radius: ${({ theme: o }) => o.radius.md};
1820
2290
  cursor: pointer;
1821
- font: inherit;
1822
- font-weight: 600;
1823
2291
  color: ${({ theme: o }) => o.colors.neutral[600]};
1824
- padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
1825
- width: 100%;
1826
- text-align: left;
2292
+ padding: 0;
1827
2293
 
1828
2294
  &:hover {
1829
- color: ${({ theme: o }) => o.brutalism ? o.colors.neutral[900] : o.colors.primary[500]};
2295
+ background-color: ${({ theme: o }) => o.colors.neutral[100]};
2296
+ color: ${({ theme: o }) => o.colors.neutral[900]};
1830
2297
  }
1831
2298
 
1832
2299
  &:focus-visible {
1833
2300
  outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
1834
2301
  outline-offset: 2px;
1835
2302
  }
1836
- `;
1837
- function ao(o, r, n) {
1838
- return typeof o.editable == "function" ? o.editable(r, n) : !!o.editable;
2303
+
2304
+ ${({ theme: o }) => o.brutalism && t`
2305
+ border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
2306
+ &:hover {
2307
+ background-color: ${o.colors.neutral[100]};
2308
+ transform: translate(1px, 1px);
2309
+ }
2310
+ `}
2311
+ `, tt = i.span`
2312
+ font-weight: 600;
2313
+ font-size: ${({ theme: o }) => o.fontSizes.md};
2314
+ color: ${({ theme: o }) => o.colors.neutral[900]};
2315
+ `, st = i.div`
2316
+ display: grid;
2317
+ grid-template-columns: repeat(7, 1fr);
2318
+ gap: 2px;
2319
+ `, et = i.span`
2320
+ display: flex;
2321
+ align-items: center;
2322
+ justify-content: center;
2323
+ font-size: ${({ theme: o }) => o.fontSizes.xs};
2324
+ font-weight: 600;
2325
+ color: ${({ theme: o }) => o.colors.neutral[500]};
2326
+ padding: ${({ theme: o }) => o.spacing[1]};
2327
+ margin-bottom: 2px;
2328
+ `, wo = i.button`
2329
+ display: flex;
2330
+ align-items: center;
2331
+ justify-content: center;
2332
+ aspect-ratio: 1;
2333
+ border: none;
2334
+ background: none;
2335
+ border-radius: ${({ theme: o }) => o.radius.md};
2336
+ cursor: pointer;
2337
+ font-size: ${({ theme: o }) => o.fontSizes.sm};
2338
+ padding: ${({ theme: o }) => o.spacing[1]};
2339
+ font-weight: ${({ $today: o, $selected: r }) => o || r ? "600" : "400"};
2340
+ pointer-events: ${({ $currentMonth: o }) => o ? "auto" : "none"};
2341
+
2342
+ color: ${({ $currentMonth: o, $selected: r, $today: n, theme: e }) => o ? r ? e.colors.primary.contrast : n ? e.colors.primary[500] : e.colors.neutral[900] : e.colors.neutral[300]};
2343
+
2344
+ background-color: ${({ $selected: o, theme: r }) => o ? r.colors.primary[500] : "transparent"};
2345
+
2346
+ &:hover:not(:disabled) {
2347
+ background-color: ${({ $selected: o, theme: r }) => o ? r.colors.primary[700] : r.colors.neutral[100]};
2348
+ }
2349
+
2350
+ &:disabled {
2351
+ opacity: 0.35;
2352
+ cursor: not-allowed;
2353
+ }
2354
+
2355
+ &:focus-visible {
2356
+ outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
2357
+ outline-offset: 1px;
2358
+ }
2359
+
2360
+ ${({ $selected: o, $today: r, theme: n }) => n.brutalism && (o || r) && t`
2361
+ border: ${n.brutalism.borderWidth} solid ${n.colors.neutral[900]};
2362
+ ${o && t`
2363
+ box-shadow: 2px 2px 0 ${n.colors.neutral[900]};
2364
+ `}
2365
+ `}
2366
+ `, it = [
2367
+ "January",
2368
+ "February",
2369
+ "March",
2370
+ "April",
2371
+ "May",
2372
+ "June",
2373
+ "July",
2374
+ "August",
2375
+ "September",
2376
+ "October",
2377
+ "November",
2378
+ "December"
2379
+ ], at = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
2380
+ function mo(o, r) {
2381
+ return new Date(o, r + 1, 0).getDate();
1839
2382
  }
1840
- function Tn({
1841
- columns: o,
1842
- defaultData: r,
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
1854
- }) {
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;
1875
- },
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
2383
+ function lt(o, r) {
2384
+ return new Date(o, r, 1).getDay();
2385
+ }
2386
+ function vo(o, r) {
2387
+ return o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate();
2388
+ }
2389
+ function ct(o, r, n) {
2390
+ if (r) {
2391
+ const e = new Date(
2392
+ r.getFullYear(),
2393
+ r.getMonth(),
2394
+ r.getDate()
1884
2395
  );
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
2396
+ if (o < e) return !0;
2397
+ }
2398
+ if (n) {
2399
+ const e = new Date(
2400
+ n.getFullYear(),
2401
+ n.getMonth(),
2402
+ n.getDate()
1894
2403
  );
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,
2404
+ if (o > e) return !0;
2405
+ }
2406
+ return !1;
2407
+ }
2408
+ function dt(o) {
2409
+ return o.toLocaleDateString("en-US", {
2410
+ month: "short",
2411
+ day: "numeric",
2412
+ year: "numeric"
2413
+ });
2414
+ }
2415
+ function ut(o) {
2416
+ return o.toLocaleDateString("en-US", {
2417
+ weekday: "long",
2418
+ month: "long",
2419
+ day: "numeric",
2420
+ year: "numeric"
2421
+ });
2422
+ }
2423
+ function pt({
2424
+ value: o = null,
2425
+ onChange: r,
2426
+ placeholder: n = "Select date...",
2427
+ size: e = "md",
2428
+ disabled: l = !1,
2429
+ clearable: a = !1,
2430
+ minDate: c,
2431
+ maxDate: d,
2432
+ formatDate: p,
2433
+ id: $,
2434
+ error: g
2435
+ }) {
2436
+ const y = A(), b = $ ?? y, f = /* @__PURE__ */ new Date(), [x, w] = M(!1), [S, T] = M(
2437
+ () => (o ?? f).getFullYear()
2438
+ ), [z, I] = M(() => (o ?? f).getMonth()), k = G(null);
2439
+ j(() => {
2440
+ if (!x) return;
2441
+ const u = (B) => {
2442
+ k.current && !k.current.contains(B.target) && w(!1);
2443
+ };
2444
+ return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
2445
+ }, [x]), j(() => {
2446
+ o && (T(o.getFullYear()), I(o.getMonth()));
2447
+ }, [o]);
2448
+ const m = o ? p ? p(o) : dt(o) : "", v = (u) => {
2449
+ r?.(new Date(S, z, u)), w(!1);
2450
+ }, D = (u) => {
2451
+ u.stopPropagation(), r?.(null);
2452
+ }, W = () => {
2453
+ z === 0 ? (I(11), T((u) => u - 1)) : I((u) => u - 1);
2454
+ }, F = () => {
2455
+ z === 11 ? (I(0), T((u) => u + 1)) : I((u) => u + 1);
2456
+ }, O = mo(S, z), U = lt(S, z), P = [], N = mo(
2457
+ z === 0 ? S - 1 : S,
2458
+ z === 0 ? 11 : z - 1
2459
+ );
2460
+ for (let u = U - 1; u >= 0; u--)
2461
+ P.push({ day: N - u, currentMonth: !1 });
2462
+ for (let u = 1; u <= O; u++)
2463
+ P.push({ day: u, currentMonth: !0 });
2464
+ const K = 42 - P.length;
2465
+ for (let u = 1; u <= K; u++)
2466
+ P.push({ day: u, currentMonth: !1 });
2467
+ return /* @__PURE__ */ C(Gn, { ref: k, children: [
2468
+ /* @__PURE__ */ C(
2469
+ Jn,
2470
+ {
2471
+ id: b,
2472
+ $size: e,
2473
+ $error: !!g,
2474
+ $disabled: l,
2475
+ role: "combobox",
2476
+ "aria-haspopup": "true",
2477
+ "aria-expanded": x,
2478
+ tabIndex: l ? -1 : 0,
2479
+ onClick: () => {
2480
+ l || w((u) => !u);
2481
+ },
2482
+ onKeyDown: (u) => {
2483
+ (u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(), w((B) => !B)), u.key === "Escape" && w(!1);
2484
+ },
2485
+ children: [
2486
+ /* @__PURE__ */ s(Xn, { $hasValue: !!o, children: m || n }),
2487
+ a && o ? /* @__PURE__ */ s(
2488
+ Qn,
1939
2489
  {
1940
- $size: a,
1941
- scope: "col",
1942
- style: f.width ? { width: f.width } : void 0,
1943
- children: f.header
1944
- },
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,
2490
+ type: "button",
2491
+ onClick: D,
2492
+ "aria-label": "Clear date",
2493
+ children: /* @__PURE__ */ s(co, { size: 14 })
2494
+ }
2495
+ ) : /* @__PURE__ */ s(Zn, { "aria-hidden": "true", children: /* @__PURE__ */ s($r, { size: 14 }) })
2496
+ ]
2497
+ }
2498
+ ),
2499
+ typeof g == "string" && /* @__PURE__ */ s(ot, { $error: !0, children: g }),
2500
+ x && /* @__PURE__ */ C(rt, { role: "dialog", "aria-label": "Calendar", children: [
2501
+ /* @__PURE__ */ C(nt, { children: [
2502
+ /* @__PURE__ */ s(
2503
+ ho,
2504
+ {
2505
+ type: "button",
2506
+ onClick: W,
2507
+ "aria-label": "Previous month",
2508
+ children: /* @__PURE__ */ s(xr, { size: 16 })
2509
+ }
2510
+ ),
2511
+ /* @__PURE__ */ C(tt, { children: [
2512
+ it[z],
2513
+ " ",
2514
+ S
2515
+ ] }),
2516
+ /* @__PURE__ */ s(
2517
+ ho,
2518
+ {
2519
+ type: "button",
2520
+ onClick: F,
2521
+ "aria-label": "Next month",
2522
+ children: /* @__PURE__ */ s(hr, { size: 16 })
2523
+ }
2524
+ )
2525
+ ] }),
2526
+ /* @__PURE__ */ C(st, { children: [
2527
+ at.map((u) => /* @__PURE__ */ s(et, { children: u }, u)),
2528
+ P.map((u, B) => {
2529
+ if (!u.currentMonth)
2530
+ return /* @__PURE__ */ s(
2531
+ wo,
1978
2532
  {
1979
2533
  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
- ] })
2534
+ $currentMonth: !1,
2535
+ $selected: !1,
2536
+ $today: !1,
2537
+ disabled: !0,
2538
+ tabIndex: -1,
2539
+ children: u.day
2540
+ },
2541
+ B
2542
+ );
2543
+ const R = new Date(S, z, u.day), Y = o ? vo(R, o) : !1, Z = vo(R, f), Q = ct(R, c, d);
2544
+ return /* @__PURE__ */ s(
2545
+ wo,
2546
+ {
2547
+ type: "button",
2548
+ $currentMonth: !0,
2549
+ $selected: Y,
2550
+ $today: Z,
2551
+ disabled: Q,
2552
+ "aria-label": ut(R),
2553
+ "aria-pressed": Y,
2554
+ onClick: () => v(u.day),
2555
+ children: u.day
2556
+ },
2557
+ B
2558
+ );
2559
+ })
1991
2560
  ] })
1992
- }
1993
- );
2561
+ ] })
2562
+ ] });
1994
2563
  }
1995
- Tn.displayName = "DataTable";
1996
- const vo = {
1997
- primary: {
1998
- 50: "#f0f8ff",
1999
- 500: "#0070f3",
2000
- 700: "#005bb5"
2001
- },
2002
- neutral: {
2003
- 0: "#ffffff",
2004
- 100: "#f5f5f5",
2005
- 200: "#eaeaea",
2006
- 300: "#cacaca",
2007
- 400: "#cccccc",
2008
- 500: "#666666",
2009
- 600: "#333333",
2010
- 900: "#111111"
2011
- },
2012
- error: {
2013
- 50: "#fef2f2",
2014
- 500: "#d32f2f"
2015
- },
2016
- success: {
2017
- 50: "#f0fdf4",
2018
- 500: "#16a34a"
2019
- },
2020
- warning: {
2021
- 50: "#fffbeb",
2022
- 500: "#d97706"
2023
- },
2024
- info: {
2025
- 50: "#eff6ff",
2026
- 500: "#2563eb"
2027
- }
2028
- }, In = {
2029
- 1: "4px",
2030
- 2: "8px",
2031
- 3: "12px",
2032
- 4: "16px",
2033
- 5: "20px",
2034
- 6: "24px"
2035
- }, En = {
2036
- md: "6px"
2037
- }, Wn = {
2038
- modal: 1e3,
2039
- toast: 1100
2040
- }, On = {
2041
- xs: "12px",
2042
- sm: "14px",
2043
- md: "16px",
2044
- lg: "18px"
2045
- }, _n = {
2046
- colors: { ...vo, primary: { ...vo.primary, contrast: "#ffffff" } },
2047
- spacing: In,
2048
- fontSizes: On,
2049
- radius: En,
2050
- zIndex: Wn,
2051
- shadows: {
2052
- focusRing: "0 0 0 2px rgba(0, 112, 243, 0.25)"
2053
- }
2054
- };
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";
2564
+ pt.displayName = "DatePicker";
2565
+ function ft(o) {
2566
+ 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, l = (c) => c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
2567
+ return 0.2126 * l(r) + 0.7152 * l(n) + 0.0722 * l(e) > 0.179 ? "#111111" : "#ffffff";
2058
2568
  }
2059
- const co = {
2569
+ const eo = {
2060
2570
  colors: {
2061
2571
  primary: {
2062
2572
  50: "#fffde6",
@@ -2086,44 +2596,70 @@ const co = {
2086
2596
  shadows: { focusRing: "3px 3px 0 #111111" },
2087
2597
  brutalism: { borderWidth: "2px", shadowOffset: "4px" }
2088
2598
  };
2089
- function Mn(o) {
2599
+ function Ct(o) {
2090
2600
  return {
2091
- ...co,
2601
+ ...eo,
2092
2602
  colors: {
2093
- ...co.colors,
2603
+ ...eo.colors,
2094
2604
  primary: {
2095
2605
  50: "#fffff0",
2096
2606
  500: o,
2097
2607
  700: o,
2098
- contrast: Pn(o)
2608
+ contrast: ft(o)
2099
2609
  }
2100
2610
  }
2101
2611
  };
2102
2612
  }
2103
- function Vn({
2104
- theme: o = co,
2613
+ function St({
2614
+ theme: o = eo,
2105
2615
  children: r
2106
2616
  }) {
2107
- return /* @__PURE__ */ s(Ao, { theme: o, children: r });
2617
+ return /* @__PURE__ */ s(Fo, { theme: o, children: r });
2108
2618
  }
2619
+ const zt = Bo`
2620
+ *, *::before, *::after {
2621
+ box-sizing: border-box;
2622
+ margin: 0;
2623
+ padding: 0;
2624
+ }
2625
+
2626
+ html, body {
2627
+ font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
2628
+ font-size: ${({ theme: o }) => o.fontSizes.md};
2629
+ color: ${({ theme: o }) => o.colors.neutral[900]};
2630
+ background-color: ${({ theme: o }) => o.colors.neutral[0]};
2631
+ }
2632
+
2633
+ button, input, select, textarea {
2634
+ font-family: inherit;
2635
+ }
2636
+ `;
2109
2637
  export {
2110
- Ro as Badge,
2111
- Mo as Button,
2112
- nn as CollapsibleCard,
2113
- Tn as DataTable,
2114
- Dr as Form,
2115
- Nr as FormField,
2638
+ _o as Badge,
2639
+ so as Button,
2640
+ wn as CollapsibleCard,
2641
+ Po as ConfirmDialog,
2642
+ vt as ConfirmProvider,
2643
+ pt as DatePicker,
2644
+ Dr as Editable,
2645
+ Er as Field,
2646
+ an as Form,
2647
+ ln as FormField,
2648
+ zt as GlobalStyles,
2116
2649
  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
2650
+ To as Link,
2651
+ Io as Modal,
2652
+ Tr as Select,
2653
+ Sn as Spinner,
2654
+ Un as Table,
2655
+ or as Textarea,
2656
+ St as ThemeProvider,
2657
+ Mo as Toast,
2658
+ yt as ToastProvider,
2659
+ Ct as createNeoBrutalTheme,
2660
+ eo as neoBrutalTheme,
2661
+ kt as useConfirm,
2662
+ wt as useForm,
2663
+ mt as useTable,
2664
+ ht as useToast
2129
2665
  };