blunt-ui 0.3.2 → 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 (55) hide show
  1. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +5 -0
  2. package/dist/components/ConfirmDialog/ConfirmDialog.stories.d.ts +8 -0
  3. package/dist/components/ConfirmDialog/ConfirmDialog.test.d.ts +0 -0
  4. package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts +13 -0
  5. package/dist/components/ConfirmDialog/index.d.ts +4 -0
  6. package/dist/components/ConfirmDialog/useConfirm.d.ts +6 -0
  7. package/dist/components/ConfirmDialog/useConfirm.test.d.ts +0 -0
  8. package/dist/components/ConfirmDialog/useConfirm.types.d.ts +14 -0
  9. package/dist/components/DatePicker/DatePicker.d.ts +5 -0
  10. package/dist/components/DatePicker/DatePicker.stories.d.ts +11 -0
  11. package/dist/components/DatePicker/DatePicker.test.d.ts +0 -0
  12. package/dist/components/DatePicker/DatePicker.types.d.ts +14 -0
  13. package/dist/components/DatePicker/index.d.ts +2 -0
  14. package/dist/components/Editable/Editable.d.ts +5 -0
  15. package/dist/components/Editable/Editable.stories.d.ts +10 -0
  16. package/dist/components/Editable/Editable.types.d.ts +9 -0
  17. package/dist/components/Editable/index.d.ts +2 -0
  18. package/dist/components/Field/Field.d.ts +5 -0
  19. package/dist/components/Field/Field.stories.d.ts +8 -0
  20. package/dist/components/Field/Field.types.d.ts +6 -0
  21. package/dist/components/Field/index.d.ts +2 -0
  22. package/dist/components/Form/index.d.ts +2 -0
  23. package/dist/components/Form/useForm.d.ts +2 -0
  24. package/dist/components/Form/useForm.test.d.ts +1 -0
  25. package/dist/components/Form/useForm.types.d.ts +20 -0
  26. package/dist/components/Input/Input.types.d.ts +1 -1
  27. package/dist/components/Select/Select.types.d.ts +2 -3
  28. package/dist/components/Spinner/Spinner.d.ts +5 -0
  29. package/dist/components/Spinner/Spinner.stories.d.ts +9 -0
  30. package/dist/components/Spinner/Spinner.types.d.ts +8 -0
  31. package/dist/components/Spinner/index.d.ts +2 -0
  32. package/dist/components/Table/Table.d.ts +1 -1
  33. package/dist/components/Table/Table.stories.d.ts +1 -0
  34. package/dist/components/Table/Table.types.d.ts +1 -0
  35. package/dist/components/Textarea/Textarea.d.ts +5 -0
  36. package/dist/components/Textarea/Textarea.stories.d.ts +8 -0
  37. package/dist/components/Textarea/Textarea.types.d.ts +11 -0
  38. package/dist/components/Textarea/index.d.ts +2 -0
  39. package/dist/components/Toast/index.d.ts +2 -0
  40. package/dist/components/Toast/useToast.d.ts +6 -0
  41. package/dist/components/Toast/useToast.test.d.ts +0 -0
  42. package/dist/components/Toast/useToast.types.d.ts +17 -0
  43. package/dist/index.cjs +578 -264
  44. package/dist/index.d.ts +19 -12
  45. package/dist/index.js +1774 -1277
  46. package/dist/{components/ThemeProvider/index.d.ts → themes/ThemeProvider.d.ts} +1 -1
  47. package/dist/themes/index.d.ts +2 -1
  48. package/package.json +1 -1
  49. package/dist/components/DataTable/DataTable.d.ts +0 -5
  50. package/dist/components/DataTable/DataTable.stories.d.ts +0 -14
  51. package/dist/components/DataTable/DataTable.types.d.ts +0 -30
  52. package/dist/components/DataTable/index.d.ts +0 -2
  53. package/dist/themes/default.d.ts +0 -2
  54. /package/dist/{styles → themes}/GlobalStyles.d.ts +0 -0
  55. /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 T } from "react/jsx-runtime";
2
- import e, { css as t, keyframes as _, ThemeProvider as jo } from "styled-components";
3
- import $o, { useId as Z, useState as N, useRef as X, useEffect as F, useContext as mo, createContext as So, forwardRef as Co, createElement as co, useCallback as R, useMemo as po } from "react";
4
- import { createPortal as zo, flushSync as _o } from "react-dom";
5
- const K = (o, r, n) => t`
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
+ import { createPortal as Co } from "react-dom";
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
- `, Mo = e.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 K = (o, r, n) => t`
31
31
  })[o]}
32
32
 
33
33
  ${({ $variant: o, theme: r }) => r.brutalism ? {
34
- primary: K(
34
+ primary: H(
35
35
  r,
36
36
  r.colors.primary[500],
37
37
  r.colors.primary.contrast
38
38
  ),
39
- neutral: K(
39
+ neutral: H(
40
40
  r,
41
41
  r.colors.neutral[200],
42
42
  r.colors.neutral[900]
43
43
  ),
44
- success: K(
44
+ success: H(
45
45
  r,
46
46
  r.colors.success[50],
47
47
  r.colors.success[500]
48
48
  ),
49
- error: K(
49
+ error: H(
50
50
  r,
51
51
  r.colors.error[50],
52
52
  r.colors.error[500]
53
53
  ),
54
- warning: K(
54
+ warning: H(
55
55
  r,
56
56
  r.colors.warning[50],
57
57
  r.colors.warning[500]
58
58
  ),
59
- info: K(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 K = (o, r, n) => t`
84
84
  `
85
85
  }[o]}
86
86
  `;
87
- function Vo({
87
+ function _o({
88
88
  variant: o = "primary",
89
89
  size: r = "md",
90
90
  children: n,
91
- ...i
91
+ ...e
92
92
  }) {
93
- return /* @__PURE__ */ s(Mo, { $variant: o, $size: r, ...i, children: n });
93
+ return /* @__PURE__ */ s(Vo, { $variant: o, $size: r, ...e, children: n });
94
94
  }
95
- Vo.displayName = "Badge";
96
- const eo = (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 eo = (o, r, n) => t`
106
106
  transform: translate(2px, 2px);
107
107
  box-shadow: 2px 2px 0 ${o.colors.neutral[900]};
108
108
  }
109
- `, Ko = e.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 eo = (o, r, n) => t`
126
126
  }
127
127
 
128
128
  ${({ $variant: o, theme: r }) => r.brutalism ? {
129
- primary: eo(
129
+ primary: oo(
130
130
  r,
131
131
  r.colors.primary[500],
132
132
  r.colors.primary.contrast
133
133
  ),
134
- secondary: eo(
134
+ secondary: oo(
135
135
  r,
136
136
  r.colors.neutral[100],
137
137
  r.colors.neutral[900]
138
138
  ),
139
- outline: eo(
139
+ outline: oo(
140
140
  r,
141
141
  r.colors.neutral[0],
142
142
  r.colors.neutral[900]
@@ -183,44 +183,44 @@ const eo = (o, r, n) => t`
183
183
  `
184
184
  })[o]}
185
185
  `;
186
- function Fo({
186
+ function so({
187
187
  ref: o,
188
188
  as: r,
189
189
  href: n,
190
- variant: i = "primary",
191
- size: d = "md",
190
+ variant: e = "primary",
191
+ size: l = "md",
192
192
  isLoading: a,
193
193
  disabled: c,
194
- children: u,
195
- ...g
194
+ children: d,
195
+ ...p
196
196
  }) {
197
197
  return /* @__PURE__ */ s(
198
- Ko,
198
+ jo,
199
199
  {
200
200
  ref: o,
201
201
  as: r ?? (n ? "a" : "button"),
202
202
  href: n,
203
- $variant: i,
204
- $size: d,
203
+ $variant: e,
204
+ $size: l,
205
205
  disabled: a || c,
206
- ...g,
207
- children: a ? "Loading..." : u
206
+ ...p,
207
+ children: a ? "Loading..." : d
208
208
  }
209
209
  );
210
210
  }
211
- Fo.displayName = "Button";
212
- const Ho = e.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
- `, Yo = e.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
- `, Uo = e.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
- `, qo = e.div`
223
+ `, Ho = i.div`
224
224
  display: flex;
225
225
  align-items: center;
226
226
  border-radius: ${({ theme: o }) => o.radius.md};
@@ -256,10 +256,6 @@ const Ho = e.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 Ho = e.div`
273
269
  &:focus-within {
274
270
  box-shadow: ${({ theme: o }) => o.shadows.focusRing};
275
271
  }
276
- `, Go = e.input`
272
+ `, Uo = i.input`
277
273
  flex: 1;
278
274
  border: none;
279
275
  outline: none;
@@ -284,11 +280,11 @@ const Ho = e.div`
284
280
  cursor: not-allowed;
285
281
  opacity: 0.6;
286
282
  }
287
- `, xo = e.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
- `, Xo = e.button`
287
+ `, Ko = i.button`
292
288
  display: inline-flex;
293
289
  align-items: center;
294
290
  margin: 0 ${({ theme: o }) => o.spacing[1]};
@@ -302,271 +298,181 @@ const Ho = e.div`
302
298
  opacity: 0.8;
303
299
  }
304
300
  `;
305
- function Zo({
301
+ function qo({
306
302
  ref: o,
307
303
  type: r = "text",
308
304
  size: n = "md",
309
- variant: i = "default",
310
- label: d,
305
+ variant: e = "default",
306
+ label: l,
311
307
  helperText: a,
312
308
  error: c,
313
- leftElement: u,
314
- rightElement: g,
315
- clearable: f,
316
- onClear: $,
317
- fullWidth: w,
318
- id: y,
319
- value: b,
320
- defaultValue: m,
321
- onChange: W,
322
- ...I
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 x = Z(), P = y ?? x, O = `${P}-hint`, [D, h] = N(m ?? ""), v = b !== void 0, k = v ? b : D, B = typeof c == "string" ? c : void 0, A = !!(a || c), j = (L) => {
325
- v || h(L.target.value), W?.(L);
326
- }, M = () => {
327
- v || h(""), $?.();
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__ */ T(Ho, { $fullWidth: w, children: [
330
- d && /* @__PURE__ */ s(Yo, { htmlFor: P, children: d }),
331
- /* @__PURE__ */ T(qo, { $size: n, $variant: i, $error: !!c, children: [
332
- u && /* @__PURE__ */ s(xo, { 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
- Go,
330
+ Uo,
335
331
  {
336
- id: P,
332
+ id: z,
337
333
  ref: o,
338
334
  type: r,
339
- value: k,
340
- onChange: j,
341
- ...I,
335
+ value: D,
336
+ onChange: O,
337
+ ...S,
342
338
  "aria-invalid": !!c,
343
- "aria-describedby": A ? O : void 0
339
+ "aria-describedby": F ? I : void 0
344
340
  }
345
341
  ),
346
- f && k && /* @__PURE__ */ s(
347
- Xo,
342
+ $ && D && /* @__PURE__ */ s(
343
+ Ko,
348
344
  {
349
345
  type: "button",
350
- onClick: M,
346
+ onClick: U,
351
347
  "aria-label": "Clear input",
352
348
  children: "✕"
353
349
  }
354
350
  ),
355
- g && /* @__PURE__ */ s(xo, { children: g })
351
+ p && /* @__PURE__ */ s(fo, { children: p })
356
352
  ] }),
357
- A && /* @__PURE__ */ s(Uo, { id: O, $error: !!c, children: B ?? a })
353
+ F && /* @__PURE__ */ s(Yo, { id: I, $error: !!c, children: W ?? a })
358
354
  ] });
359
355
  }
360
- Zo.displayName = "Input";
361
- const Jo = _`
362
- from { opacity: 0; }
363
- to { opacity: 1; }
364
- `, Qo = _`
365
- from { opacity: 1; }
366
- to { opacity: 0; }
367
- `, or = _`
368
- from { opacity: 0; transform: scale(0.95) translateY(-8px); }
369
- to { opacity: 1; transform: scale(1) translateY(0); }
370
- `, rr = _`
371
- from { opacity: 1; transform: scale(1) translateY(0); }
372
- to { opacity: 0; transform: scale(0.95) translateY(-8px); }
373
- `, nr = e.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 ? Qo : Jo} 0.15s ease
382
- forwards;
383
- `, tr = e.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"};
356
+ qo.displayName = "Input";
357
+ const Go = i.div`
389
358
  display: flex;
390
359
  flex-direction: column;
391
- max-height: 90vh;
392
- animation: ${({ $closing: o }) => o ? rr : or} 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
- `, sr = e.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
- `, er = e.h2`
418
- flex: 1;
419
- font-size: ${({ theme: o }) => o.fontSizes.lg};
420
- font-weight: 600;
421
- margin: 0;
422
- `, ir = e.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
- `, ar = e.div`
448
- padding: ${({ theme: o }) => o.spacing[4]};
449
- overflow-y: auto;
416
+ `, Qo = i.textarea`
450
417
  flex: 1;
451
- `, lr = e.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
- `, cr = [
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 yo(o) {
468
- return Array.from(
469
- o.querySelectorAll(cr)
470
- );
471
- }
472
- function dr({
473
- open: o,
474
- onClose: r,
475
- title: n,
476
- children: i,
477
- footer: d,
478
- size: a = "md",
479
- closeOnBackdrop: c = !0,
480
- closeOnEscape: u = !0,
481
- ariaLabelledBy: g,
482
- ariaDescribedBy: f
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 $ = X(null), w = Z(), y = g ?? (n ? w : void 0), [b, m] = N(o), [W, I] = N(!1);
485
- return F(() => {
486
- if (o)
487
- m(!0), I(!1);
488
- else if (b) {
489
- I(!0);
490
- const x = setTimeout(() => {
491
- m(!1), I(!1);
492
- }, 150);
493
- return () => clearTimeout(x);
494
- }
495
- }, [o, b]), F(() => {
496
- if (!o)
497
- return;
498
- const x = document.body.style.overflow;
499
- return document.body.style.overflow = "hidden", () => {
500
- document.body.style.overflow = x;
501
- };
502
- }, [o]), F(() => {
503
- if (!o || !$.current)
504
- return;
505
- const x = $.current, P = document.activeElement;
506
- (yo(x)[0] ?? x).focus();
507
- const D = (h) => {
508
- if (h.key === "Escape" && u) {
509
- r();
510
- return;
511
- }
512
- if (h.key !== "Tab")
513
- return;
514
- const v = yo(x);
515
- if (v.length === 0) {
516
- h.preventDefault();
517
- return;
518
- }
519
- const k = v[0], B = v[v.length - 1];
520
- h.shiftKey ? document.activeElement === k && (h.preventDefault(), B.focus()) : document.activeElement === B && (h.preventDefault(), k.focus());
521
- };
522
- return document.addEventListener("keydown", D), () => {
523
- document.removeEventListener("keydown", D), P?.focus();
524
- };
525
- }, [o, u, r, b]), b ? zo(
526
- /* @__PURE__ */ s(
527
- nr,
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(
448
+ Qo,
528
449
  {
529
- $closing: W,
530
- onClick: c ? r : void 0,
531
- children: /* @__PURE__ */ T(
532
- tr,
533
- {
534
- ref: $,
535
- role: "dialog",
536
- "aria-modal": "true",
537
- "aria-labelledby": y,
538
- "aria-describedby": f,
539
- $size: a,
540
- $closing: W,
541
- tabIndex: -1,
542
- onClick: (x) => x.stopPropagation(),
543
- children: [
544
- /* @__PURE__ */ T(sr, { children: [
545
- n && /* @__PURE__ */ s(er, { id: w, children: n }),
546
- /* @__PURE__ */ s(ir, { onClick: r, "aria-label": "Close modal", children: "×" })
547
- ] }),
548
- /* @__PURE__ */ s(ar, { children: i }),
549
- d && /* @__PURE__ */ s(lr, { children: d })
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
- dr.displayName = "Modal";
559
- const To = (...o) => o.filter((r, n, i) => !!r && r.trim() !== "" && i.indexOf(r) === n).join(" ").trim();
560
- const ur = (o) => o.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
561
- const pr = (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
- (r, n, i) => i ? i.toUpperCase() : n.toLowerCase()
469
+ (r, n, e) => e ? e.toUpperCase() : n.toLowerCase()
564
470
  );
565
- const ho = (o) => {
566
- const r = pr(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 fr = (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
- }, gr = So({}), br = () => mo(gr), $r = Co(
586
- ({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth: i, className: d = "", children: a, iconNode: c, ...u }, g) => {
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: f = 24,
589
- strokeWidth: $ = 2,
590
- absoluteStrokeWidth: w = !1,
591
- color: y = "currentColor",
592
- className: b = ""
593
- } = br() ?? {}, m = i ?? w ? Number(n ?? $) * 24 / Number(r ?? f) : n ?? $;
594
- return co(
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: g,
598
- ...io,
599
- width: r ?? f ?? io.width,
600
- height: r ?? f ?? io.height,
601
- stroke: o ?? y,
602
- strokeWidth: m,
603
- className: To("lucide", b, d),
604
- ...!a && !fr(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
- ...c.map(([W, I]) => co(W, I)),
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 J = (o, r) => {
615
- const n = Co(
616
- ({ className: i, ...d }, a) => co($r, {
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: To(
620
- `lucide-${ur(ho(o))}`,
525
+ className: So(
526
+ `lucide-${rr($o(o))}`,
621
527
  `lucide-${o}`,
622
- i
528
+ e
623
529
  ),
624
- ...d
530
+ ...l
625
531
  })
626
532
  );
627
- return n.displayName = ho(o), n;
533
+ return n.displayName = $o(o), n;
628
534
  };
629
- const xr = [
535
+ const ar = [
630
536
  ["path", { d: "M12 5v14", key: "s699le" }],
631
537
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
632
- ], yr = J("arrow-down", xr);
633
- const hr = [
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
- ], wr = J("arrow-up-down", hr);
639
- const vr = [
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
- ], kr = J("arrow-up", vr);
643
- const mr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], Io = J("chevron-down", mr);
644
- const Sr = [
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
- ], Eo = J("x", Sr), Cr = _`
648
- from { opacity: 0; transform: translateY(12px); }
649
- to { opacity: 1; transform: translateY(0); }
650
- `, zr = _`
651
- from { opacity: 0; transform: translateY(-12px); }
652
- to { opacity: 1; transform: translateY(0); }
653
- `, Tr = _`
654
- from { opacity: 1; }
655
- to { opacity: 0; }
656
- `, Ir = e.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
- ${Tr} 0.2s ease forwards
668
- ` : r.startsWith("top") ? t`
669
- ${zr} 0.2s ease forwards
670
- ` : t`
671
- ${Cr} 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
- `, oo = (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
- `, Er = e(Ir)`
698
- ${({ $variant: o, theme: r }) => r.brutalism ? {
699
- success: oo(
700
- r,
701
- r.colors.success[50],
702
- r.colors.success[500]
703
- ),
704
- error: oo(
705
- r,
706
- r.colors.error[50],
707
- r.colors.error[500]
708
- ),
709
- warning: oo(
710
- r,
711
- r.colors.warning[50],
712
- r.colors.warning[500]
713
- ),
714
- info: oo(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
- `, Wr = e.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
- `, Pr = e.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 Wo({
768
- open: o,
769
- onClose: r,
770
- message: n,
771
- variant: i = "info",
772
- duration: d = 4e3,
773
- position: a = "bottom-right"
774
- }) {
775
- const [c, u] = N(o), [g, f] = N(!1);
776
- return F(() => {
777
- if (o)
778
- u(!0), f(!1);
779
- else if (c) {
780
- f(!0);
781
- const $ = setTimeout(() => {
782
- u(!1), f(!1);
783
- }, 200);
784
- return () => {
785
- clearTimeout($);
786
- };
787
- }
788
- }, [o, c]), F(() => {
789
- if (!o || d === 0)
790
- return;
791
- const $ = setTimeout(r, d);
792
- return () => {
793
- clearTimeout($);
794
- };
795
- }, [o, d, r]), c ? zo(
796
- /* @__PURE__ */ T(
797
- Er,
798
- {
799
- $position: a,
800
- $variant: i,
801
- $closing: g,
802
- role: "alert",
803
- "aria-live": "polite",
804
- children: [
805
- /* @__PURE__ */ s(Wr, { children: n }),
806
- /* @__PURE__ */ s(Pr, { onClick: r, "aria-label": "Close notification", children: /* @__PURE__ */ s(Eo, { size: 14, strokeWidth: 2.5 }) })
807
- ]
808
- }
809
- ),
810
- document.body
811
- ) : null;
812
- }
813
- Wo.displayName = "Toast";
814
- const Br = e.form`
815
- display: flex;
816
- flex-direction: column;
817
- gap: ${({ theme: o }) => o.spacing[4]};
818
- `, Or = e.div`
819
- display: flex;
820
- flex-direction: column;
821
- gap: ${({ theme: o }) => o.spacing[1]};
822
- `, Dr = e.label`
823
- font-size: ${({ theme: o }) => o.fontSizes.sm};
824
- font-weight: 500;
825
- color: ${({ theme: o }) => o.colors.neutral[900]};
826
- `, Nr = e.span`
827
- color: ${({ theme: o }) => o.colors.error[500]};
828
- margin-left: 2px;
829
- `, Lr = e.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 Ar({ onSubmit: o, children: r, ...n }) {
834
- return /* @__PURE__ */ s(
835
- Br,
836
- {
837
- onSubmit: (i) => {
838
- i.preventDefault(), o?.(i);
839
- },
840
- noValidate: !0,
841
- ...n,
842
- children: r
843
- }
844
- );
845
- }
846
- Ar.displayName = "Form";
847
- function Rr({
848
- label: o,
849
- error: r,
850
- helperText: n,
851
- required: i,
852
- children: d
853
- }) {
854
- const a = Z(), c = `${a}-hint`, u = !!(r || n), g = typeof r == "string" ? r : void 0, f = $o.isValidElement(d) ? $o.cloneElement(
855
- d,
856
- {
857
- id: a,
858
- ...u && { "aria-describedby": c },
859
- ...r && { "aria-invalid": !0 }
860
- }
861
- ) : d;
862
- return /* @__PURE__ */ T(Or, { children: [
863
- o && /* @__PURE__ */ T(Dr, { htmlFor: a, children: [
864
- o,
865
- i && /* @__PURE__ */ s(Nr, { "aria-hidden": "true", children: " *" })
866
- ] }),
867
- f,
868
- u && /* @__PURE__ */ s(Lr, { id: c, $error: !!r, children: g ?? n })
869
- ] });
870
- }
871
- Rr.displayName = "FormField";
872
- const jr = e.div`
873
- display: inline-flex;
874
- flex-direction: column;
875
- gap: ${({ theme: o }) => o.spacing[1]};
876
- width: ${({ $fullWidth: o }) => o ? "100%" : "auto"};
877
- `, _r = e.div`
878
- position: relative;
879
- display: flex;
880
- width: 100%;
881
- `, Mr = e.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
- `, Vr = e.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 jr = e.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 jr = e.div`
942
627
  cursor: not-allowed;
943
628
  opacity: 0.6;
944
629
  }
945
- `, Kr = e.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 jr = e.div`
964
649
  outline-offset: 2px;
965
650
  border-radius: 2px;
966
651
  }
967
- `, Fr = e.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 jr = e.div`
974
659
  align-items: center;
975
660
  color: ${({ theme: o }) => o.colors.neutral[500]};
976
661
  `;
977
- function Hr({
662
+ function Tr({
978
663
  options: o,
979
664
  placeholder: r,
980
665
  size: n = "md",
981
- variant: i = "default",
982
- error: d,
666
+ variant: e = "default",
667
+ error: l,
983
668
  fullWidth: a,
984
669
  clearable: c,
985
- onClear: u,
986
- id: g,
987
- value: f,
988
- defaultValue: $,
989
- onChange: w,
990
- ...y
670
+ onClear: d,
671
+ id: p,
672
+ value: $,
673
+ defaultValue: g,
674
+ onChange: y,
675
+ ...b
991
676
  }) {
992
- const b = Z(), m = g ?? b, W = `${m}-hint`, I = typeof d == "string" ? d : void 0, [x, P] = N(
993
- $ ?? ""
994
- ), O = f !== void 0, D = O ? f : x, h = (B) => {
995
- O || P(B.target.value), w?.(B);
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);
996
681
  }, v = () => {
997
- O || P(""), u?.();
998
- }, k = c && !!D;
999
- return /* @__PURE__ */ T(jr, { $fullWidth: a, children: [
1000
- /* @__PURE__ */ T(_r, { children: [
1001
- /* @__PURE__ */ T(
1002
- Vr,
682
+ I || z(""), d?.();
683
+ }, D = c && !!k;
684
+ return /* @__PURE__ */ C(mr, { $fullWidth: a, children: [
685
+ /* @__PURE__ */ C(vr, { children: [
686
+ /* @__PURE__ */ C(
687
+ Cr,
1003
688
  {
1004
- id: m,
689
+ id: x,
1005
690
  $size: n,
1006
- $variant: i,
1007
- $error: !!d,
1008
- "aria-invalid": !!d,
1009
- "aria-describedby": I ? W : void 0,
1010
- value: D,
1011
- onChange: h,
1012
- ...y,
691
+ $variant: e,
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((B) => /* @__PURE__ */ s("option", { value: B.value, disabled: B.disabled, children: B.label }, B.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
- k ? /* @__PURE__ */ s(
1020
- Kr,
704
+ D ? /* @__PURE__ */ s(
705
+ Sr,
1021
706
  {
1022
707
  type: "button",
1023
708
  onClick: v,
1024
709
  "aria-label": "Clear selection",
1025
- children: /* @__PURE__ */ s(Eo, { size: 14 })
710
+ children: /* @__PURE__ */ s(co, { size: 14 })
1026
711
  }
1027
- ) : /* @__PURE__ */ s(Fr, { "aria-hidden": "true", children: /* @__PURE__ */ s(Io, { size: 14 }) })
712
+ ) : /* @__PURE__ */ s(zr, { "aria-hidden": "true", children: /* @__PURE__ */ s(zo, { size: 14 }) })
1028
713
  ] }),
1029
- I && /* @__PURE__ */ s(Mr, { id: W, $error: !0, children: I })
714
+ S && /* @__PURE__ */ s(kr, { id: w, $error: !0, children: S })
1030
715
  ] });
1031
716
  }
1032
- Hr.displayName = "Select";
1033
- const Yr = e.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,166 +843,421 @@ const Yr = e.a`
1056
843
  `
1057
844
  })[o]}
1058
845
  `;
1059
- function Ur({
846
+ function To({
1060
847
  variant: o = "default",
1061
848
  external: r,
1062
849
  children: n,
1063
- ...i
850
+ ...e
1064
851
  }) {
1065
852
  return /* @__PURE__ */ s(
1066
- Yr,
853
+ Wr,
1067
854
  {
1068
855
  $variant: o,
1069
856
  ...r && { target: "_blank", rel: "noreferrer" },
1070
- ...i,
857
+ ...e,
1071
858
  children: n
1072
859
  }
1073
860
  );
1074
861
  }
1075
- Ur.displayName = "Link";
1076
- const qr = e.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
- `, Gr = e.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
- `, Xr = e.div`
1112
- flex: 1;
1113
- min-width: 0;
1114
- `, Zr = e.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
- `, Jr = e.span`
1120
- display: block;
1121
- font-size: ${({ theme: o }) => o.fontSizes.sm};
1122
- color: ${({ theme: o }) => o.colors.neutral[500]};
1123
- `, Qr = e.div`
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);
1124
898
  display: flex;
1125
- flex-direction: row;
1126
899
  align-items: center;
1127
- justify-content: space-between;
1128
- margin-top: ${({ theme: o }) => o.spacing[1]};
1129
-
1130
- @media (max-width: 640px) {
1131
- flex-direction: column;
1132
- align-items: flex-start;
1133
- gap: ${({ theme: o }) => o.spacing[2]};
1134
- }
1135
- `, on = e.div`
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;
915
+
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
- `, rn = e.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
- `, nn = e.div`
1148
- display: grid;
1149
- grid-template-rows: ${({ $open: o }) => o ? "1fr" : "0fr"};
1150
- transition: grid-template-rows 0.2s ease;
1151
- `, tn = e.div`
1152
- overflow: hidden;
1153
- `, sn = e.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 en({
1158
- title: o,
1159
- children: r,
1160
- defaultOpen: n = !1,
1161
- open: i,
1162
- onToggle: d,
1163
- subtitle: a,
1164
- headerActions: c,
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 [g, f] = N(n), $ = Z(), w = i !== void 0, y = w ? i : g;
1168
- return /* @__PURE__ */ T(qr, { $accentColor: u, children: [
1169
- /* @__PURE__ */ T(
1170
- Gr,
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(
1229
+ /* @__PURE__ */ C(
1230
+ Zr,
1171
1231
  {
1172
- type: "button",
1173
- $open: y,
1174
- $accentColor: u,
1175
- "aria-expanded": y,
1176
- "aria-controls": $,
1177
- onClick: () => {
1178
- const m = !y;
1179
- w || f(m), d?.(m);
1180
- },
1232
+ $position: a,
1233
+ $variant: e,
1234
+ $closing: p,
1235
+ role: "alert",
1236
+ "aria-live": "polite",
1181
1237
  children: [
1182
- /* @__PURE__ */ T(Xr, { children: [
1183
- /* @__PURE__ */ s(Zr, { children: o }),
1184
- (a || c) && /* @__PURE__ */ T(Qr, { children: [
1185
- a && /* @__PURE__ */ s(Jr, { children: a }),
1186
- c && /* @__PURE__ */ s(on, { onClick: (m) => m.stopPropagation(), children: c })
1187
- ] })
1188
- ] }),
1189
- /* @__PURE__ */ s(
1190
- rn,
1191
- {
1192
- $open: y,
1193
- $accentColor: u,
1194
- "aria-hidden": "true",
1195
- children: /* @__PURE__ */ s(Io, { 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(nn, { $open: y, children: /* @__PURE__ */ s(tn, { id: $, role: "region", "aria-label": o, children: /* @__PURE__ */ s(sn, { children: r }) }) })
1202
- ] });
1243
+ document.body
1244
+ ) : null;
1203
1245
  }
1204
- en.displayName = "CollapsibleCard";
1205
- const Po = So(null);
1206
- function Mn({ children: o }) {
1207
- const [r, n] = N(null), i = 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
- }, []), d = po(() => Object.assign((a) => i(a), {
1210
- success: (a, c) => i({ ...c, message: a, variant: "success" }),
1211
- error: (a, c) => i({ ...c, message: a, variant: "error" }),
1212
- warning: (a, c) => i({ ...c, message: a, variant: "warning" }),
1213
- info: (a, c) => i({ ...c, message: a, variant: "info" })
1214
- }), [i]);
1215
- return /* @__PURE__ */ T(Po.Provider, { value: { toast: d }, children: [
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" })
1256
+ }), [e]);
1257
+ return /* @__PURE__ */ C(Do.Provider, { value: { toast: l }, children: [
1216
1258
  o,
1217
1259
  r && /* @__PURE__ */ s(
1218
- Wo,
1260
+ Mo,
1219
1261
  {
1220
1262
  open: !0,
1221
1263
  onClose: () => n(null),
@@ -1228,137 +1270,376 @@ function Mn({ children: o }) {
1228
1270
  )
1229
1271
  ] });
1230
1272
  }
1231
- function Vn() {
1232
- const o = mo(Po);
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 Kn({
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
- onError: i
1341
+ onError: e
1242
1342
  }) {
1243
- const [d, a] = N(o), [c, u] = N(
1343
+ const [l, a] = M(o), [c, d] = M(
1244
1344
  {}
1245
- ), [g, f] = N({}), [$, w] = N(!1), y = X(d);
1246
- y.current = d;
1247
- const b = 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 v = r(h);
1351
+ const v = r(m);
1252
1352
  return Object.fromEntries(
1253
- Object.entries(v).filter(([, k]) => k !== void 0)
1353
+ Object.entries(v).filter(([, D]) => D !== void 0)
1254
1354
  );
1255
1355
  },
1256
1356
  [r]
1257
- ), m = X(g);
1258
- m.current = g;
1259
- const W = R(
1260
- (h) => {
1261
- const { name: v, value: k } = h.target, B = { ...y.current, [v]: k };
1262
- a(B), m.current[v] && u(b(B));
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
- [b]
1265
- ), I = R(
1266
- (h) => {
1267
- const { name: v } = h.target;
1268
- f((k) => ({ ...k, [v]: !0 })), u(b(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
- [b]
1271
- ), x = R(
1272
- (h) => {
1273
- h?.preventDefault();
1274
- const v = Object.keys(y.current).reduce(
1275
- (A, j) => ({ ...A, [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
- f(v);
1279
- const k = b(y.current);
1280
- if (u(k), Object.keys(k).length > 0) {
1281
- i?.(k);
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
- [b, n, i]
1294
- ), P = R((h, v) => {
1295
- a((k) => ({ ...k, [h]: v }));
1296
- }, []), O = R(() => {
1297
- a(o), u({}), f({}), w(!1);
1298
- }, [o]), D = Object.fromEntries(
1299
- Object.entries(c).filter(([h]) => g[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: d,
1303
- errors: D,
1304
- touched: g,
1305
- handleChange: W,
1306
- handleBlur: I,
1307
- handleSubmit: x,
1308
- setFieldValue: P,
1309
- reset: O,
1310
- isSubmitting: $
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 an(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 ln({
1597
+ function Tn({
1317
1598
  data: o,
1318
1599
  sort: r,
1319
1600
  defaultSort: n,
1320
- onSortChange: i
1601
+ onSortChange: e
1321
1602
  }) {
1322
- const d = r !== void 0, [a, c] = N(
1603
+ const l = r !== void 0, [a, c] = M(
1323
1604
  n ?? null
1324
- ), u = d ? r ?? null : a, g = ($) => {
1325
- const w = an(u, $);
1326
- return d || c(w), i?.(w), w;
1327
- }, f = po(() => d || !u ? o : [...o].sort(($, w) => {
1328
- const y = $[u.key], b = w[u.key], m = y < b ? -1 : y > b ? 1 : 0;
1329
- return u.direction === "asc" ? m : -m;
1330
- }), [o, u, d]);
1331
- return { activeSort: u, sortedData: f, handleSort: g };
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 cn = 7, wo = 3, vo = 1;
1334
- function dn(o, r) {
1335
- if (r <= cn)
1336
- return Array.from({ length: r }, (i, d) => d + 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 > wo && n.push("...");
1339
- for (let i = Math.max(2, o - vo); i <= Math.min(r - 1, o + vo); i++)
1340
- n.push(i);
1341
- return o < r - wo + 1 && n.push("..."), n.push(r), n;
1619
+ o > xo && n.push("...");
1620
+ for (let e = Math.max(2, o - yo); e <= Math.min(r - 1, o + yo); e++)
1621
+ n.push(e);
1622
+ return o < r - xo + 1 && n.push("..."), n.push(r), n;
1342
1623
  }
1343
- function un({
1624
+ function Dn({
1344
1625
  data: o,
1345
1626
  pageSize: r,
1346
1627
  page: n,
1347
- defaultPage: i,
1348
- totalRows: d,
1628
+ defaultPage: e,
1629
+ totalRows: l,
1349
1630
  onPageChange: a
1350
1631
  }) {
1351
- const c = n !== void 0, [u, g] = N(i ?? 1), f = c ? n : u, $ = (W) => {
1352
- c || g(W), a?.(W);
1353
- }, w = c || d !== void 0, y = d ?? o.length, b = r ? Math.max(1, Math.ceil(y / r)) : 1, m = po(() => {
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 W = (f - 1) * r;
1357
- return o.slice(W, W + r);
1358
- }, [o, r, f, w]);
1359
- return { activePage: f, totalPages: b, displayData: m, handlePageChange: $ };
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 Bo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg" ? `${r.spacing[3]} ${r.spacing[4]}` : `${r.spacing[2]} ${r.spacing[3]}`, Oo = e.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 Bo = (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
- `, Do = e.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 Bo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1389
1670
  caption {
1390
1671
  padding: 8px 0;
1391
1672
  }
1392
- `, No = e.thead`
1673
+ `, Pn = i.thead`
1393
1674
  ${({ $stickyHeader: o }) => o && t`
1394
1675
  position: sticky;
1395
1676
  top: 0;
@@ -1409,7 +1690,7 @@ const Bo = (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
- `, Lo = e.tbody`
1693
+ `, Nn = i.tbody`
1413
1694
  ${({ $rowColor: o }) => o && t`
1414
1695
  tr {
1415
1696
  background-color: ${o};
@@ -1425,21 +1706,37 @@ const Bo = (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
- `, G = e.tr``, fo = e.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 }) => Bo(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 Bo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1448
1745
  }
1449
1746
  `}
1450
1747
  `}
1451
- `, pn = e.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 Bo = (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
- `, fn = e.span`
1767
+ `, Bn = i.span`
1471
1768
  opacity: 0.5;
1472
1769
  display: inline-flex;
1473
1770
  align-items: center;
1474
- `, ro = e.td`
1475
- padding: ${({ $size: o, theme: r }) => Bo(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 Bo = (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
- `, gn = e.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
- `, bn = _`
1796
+ `, _n = L`
1500
1797
  0% { background-position: -400px 0; }
1501
1798
  100% { background-position: 400px 0; }
1502
- `, $n = e(ro)``, xn = e.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 Bo = (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: ${bn} 1.6s ease-in-out infinite;
1513
- `, yn = e.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 Bo = (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
- `, ao = e.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 Bo = (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
- `, hn = 4;
1570
- function wn(o, r) {
1571
- return o?.key !== r ? /* @__PURE__ */ s(wr, { size: 14 }) : o.direction === "asc" ? /* @__PURE__ */ s(kr, { size: 14 }) : /* @__PURE__ */ s(yr, { 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 vn({
1870
+ function Un({
1574
1871
  columns: o,
1575
1872
  data: r,
1576
1873
  rowKey: n,
1577
- size: i = "md",
1578
- striped: d,
1874
+ size: e = "md",
1875
+ striped: l,
1579
1876
  bordered: a,
1580
1877
  stickyHeader: c,
1581
- caption: u,
1582
- emptyMessage: g = "No data",
1583
- loading: f,
1584
- sort: $,
1585
- defaultSort: w,
1586
- onSortChange: y,
1587
- pageSize: b,
1588
- page: m,
1589
- defaultPage: W,
1590
- totalRows: I,
1591
- onPageChange: x,
1592
- onChange: P,
1593
- borderColor: O,
1594
- headerColor: D,
1595
- rowColor: h,
1596
- stripeColor: v,
1597
- className: k,
1598
- style: B
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: A,
1602
- sortedData: j,
1603
- handleSort: M
1604
- } = ln({
1899
+ activeSort: O,
1900
+ sortedData: U,
1901
+ handleSort: P
1902
+ } = Tn({
1605
1903
  data: r,
1606
- sort: $,
1607
- defaultSort: w,
1608
- onSortChange: y
1904
+ sort: g,
1905
+ defaultSort: y,
1906
+ onSortChange: b
1609
1907
  }), {
1610
- activePage: L,
1611
- totalPages: H,
1612
- displayData: Y,
1613
- handlePageChange: no
1614
- } = un({
1615
- data: j,
1616
- pageSize: b,
1617
- page: m,
1618
- defaultPage: W,
1619
- totalRows: I,
1620
- onPageChange: x
1621
- }), to = (l) => {
1622
- const S = M(l);
1623
- P?.({ sort: S, page: L });
1624
- }, U = (l) => {
1625
- no(l), P?.({ sort: A, page: l });
1626
- }, so = (l, S) => String(n ? l[n] : S), p = !f && Y.length === 0, C = b ?? hn;
1627
- return /* @__PURE__ */ T(
1628
- Oo,
1908
+ activePage: 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;
1925
+ return /* @__PURE__ */ C(
1926
+ Wn,
1629
1927
  {
1630
- $borderColor: O,
1928
+ $borderColor: k,
1631
1929
  $stickyHeader: c,
1632
- className: k,
1633
- style: B,
1930
+ className: W,
1931
+ style: F,
1634
1932
  children: [
1635
- /* @__PURE__ */ T(Do, { $size: i, 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
- No,
1936
+ Pn,
1639
1937
  {
1640
- $headerColor: D,
1641
- $borderColor: O,
1938
+ $headerColor: m,
1939
+ $borderColor: k,
1642
1940
  $stickyHeader: c,
1643
- children: /* @__PURE__ */ s(G, { children: o.map((l) => /* @__PURE__ */ s(
1644
- fo,
1941
+ children: /* @__PURE__ */ s(X, { children: o.map((h) => /* @__PURE__ */ s(
1942
+ Ln,
1645
1943
  {
1646
- $size: i,
1944
+ $size: e,
1647
1945
  $bordered: a,
1648
1946
  scope: "col",
1649
- style: l.width ? { width: l.width } : void 0,
1650
- children: l.sortable ? /* @__PURE__ */ T(
1651
- pn,
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(l.key),
1655
- "aria-label": `Sort by ${l.header}${A?.key === l.key ? `, ${A.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
- l.header,
1658
- /* @__PURE__ */ s(fn, { "aria-hidden": "true", children: wn(A, l.key) })
1955
+ h.header,
1956
+ /* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(O, h.key) })
1659
1957
  ]
1660
1958
  }
1661
- ) : l.header
1959
+ ) : h.header
1662
1960
  },
1663
- l.key
1961
+ h.key
1664
1962
  )) })
1665
1963
  }
1666
1964
  ),
1667
1965
  /* @__PURE__ */ s(
1668
- Lo,
1966
+ Nn,
1669
1967
  {
1670
- $striped: d,
1671
- $rowColor: h,
1672
- $stripeColor: v,
1673
- children: f ? Array.from({ length: C }).map((l, S) => /* @__PURE__ */ s(G, { children: o.map((z) => /* @__PURE__ */ s(
1674
- $n,
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
- $size: i,
1974
+ $size: e,
1677
1975
  $bordered: a,
1678
- $borderColor: O,
1679
- children: /* @__PURE__ */ s(xn, {})
1976
+ $borderColor: k,
1977
+ children: /* @__PURE__ */ s(An, {})
1680
1978
  },
1681
- z.key
1682
- )) }, S)) : p ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(gn, { colSpan: o.length, children: g }) }) : Y.map((l, S) => /* @__PURE__ */ s(G, { children: o.map((z) => /* @__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: i,
1686
- $bordered: a,
1687
- $borderColor: O,
1688
- children: z.render ? z.render(l[z.key], l, S) : String(l[z.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
- z.key
1691
- )) }, so(l, S)))
1996
+ Z(h, E)
1997
+ ))
1692
1998
  }
1693
1999
  )
1694
2000
  ] }),
1695
- b && H > 1 && /* @__PURE__ */ T(yn, { children: [
2001
+ f && K > 1 && /* @__PURE__ */ C(Rn, { children: [
1696
2002
  /* @__PURE__ */ s(
1697
- ao,
2003
+ no,
1698
2004
  {
1699
2005
  type: "button",
1700
- onClick: () => U(L - 1),
1701
- disabled: L <= 1,
2006
+ onClick: () => Y(N - 1),
2007
+ disabled: N <= 1,
1702
2008
  "aria-label": "Previous page",
1703
2009
  children: "←"
1704
2010
  }
1705
2011
  ),
1706
- dn(L, H).map(
1707
- (l, S) => l === "..." ? /* @__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
- ao,
2022
+ no,
1717
2023
  {
1718
2024
  type: "button",
1719
- $active: l === L,
1720
- onClick: () => U(l),
1721
- "aria-label": `Page ${l}`,
1722
- "aria-current": l === L ? "page" : void 0,
1723
- children: l
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
- l
2031
+ h
1726
2032
  )
1727
2033
  ),
1728
2034
  /* @__PURE__ */ s(
1729
- ao,
2035
+ no,
1730
2036
  {
1731
2037
  type: "button",
1732
- onClick: () => U(L + 1),
1733
- disabled: L >= H,
2038
+ onClick: () => Y(N + 1),
2039
+ disabled: N >= K,
1734
2040
  "aria-label": "Next page",
1735
2041
  children: "→"
1736
2042
  }
@@ -1740,361 +2046,527 @@ function vn({
1740
2046
  }
1741
2047
  );
1742
2048
  }
1743
- vn.displayName = "Table";
1744
- function Fn({
1745
- defaultSort: o,
1746
- defaultPage: r = 1
1747
- } = {}) {
1748
- const [n, i] = N(o ?? null), [d, a] = N(r);
1749
- return { sort: n, page: d, onSortChange: (g) => {
1750
- i(g), a(1);
1751
- }, onPageChange: (g) => {
1752
- a(g);
1753
- } };
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
2158
+ }
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;
1754
2167
  }
1755
- const kn = e(Do)`
1756
- table-layout: fixed;
1757
- `, mn = e(ro)`
1758
- ${({ $editable: o, theme: r }) => o && t`
1759
- cursor: pointer;
1760
- position: relative;
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;
1761
2183
 
1762
- &:hover {
1763
- background-color: ${r.brutalism ? r.colors.neutral[100] : r.colors.primary[50]};
1764
- }
1765
- `}
1766
- `, Ao = t`
1767
- display: block;
1768
- width: 100%;
1769
- min-width: 0;
1770
- box-sizing: border-box;
1771
- border: none;
1772
- outline: none;
1773
- background: transparent;
1774
- font: inherit;
1775
- color: inherit;
1776
- padding: 0;
1777
- margin: 0;
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]}
1778
2198
 
1779
2199
  ${({ theme: o }) => o.brutalism ? t`
1780
- &:focus {
1781
- outline: 2px solid ${o.colors.neutral[900]};
1782
- outline-offset: 1px;
1783
- }
1784
- ` : t`
1785
- &:focus {
1786
- box-shadow: ${o.shadows.focusRing};
1787
- }
1788
- `}
1789
- `, Sn = e.input`
1790
- ${Ao}
1791
- `, Cn = e.select`
1792
- ${Ao}
1793
- cursor: pointer;
1794
- `, zn = e(fo)`
1795
- width: 40px;
1796
- `, Tn = e(ro)`
1797
- width: 40px;
1798
- text-align: center;
1799
- padding-left: 0;
1800
- padding-right: 0;
1801
- `, In = e.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`
1802
2229
  display: inline-flex;
1803
2230
  align-items: center;
1804
- justify-content: center;
1805
- width: 24px;
1806
- 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]};
1807
2238
  padding: 0;
1808
2239
  background: none;
1809
2240
  border: none;
1810
2241
  cursor: pointer;
1811
- font-size: ${({ theme: o }) => o.fontSizes.xs};
1812
2242
  color: ${({ theme: o }) => o.colors.neutral[500]};
1813
- border-radius: ${({ theme: o }) => o.radius.md};
1814
- transition: color 0.1s;
2243
+ flex-shrink: 0;
1815
2244
 
1816
2245
  &:hover {
1817
- color: ${({ theme: o }) => o.colors.error[500]};
2246
+ color: ${({ theme: o }) => o.colors.neutral[900]};
2247
+ }
1818
2248
 
1819
- ${({ theme: o }) => o.brutalism && t`
1820
- background-color: ${o.colors.error[50]};
1821
- `}
2249
+ &:focus-visible {
2250
+ outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
2251
+ outline-offset: 2px;
2252
+ border-radius: 2px;
1822
2253
  }
1823
- `, En = e.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
+
1824
2267
  ${({ theme: o }) => o.brutalism ? t`
1825
- border-top: ${o.brutalism.borderWidth} solid
1826
- ${o.colors.neutral[900]};
1827
- ` : t`
1828
- border-top: 1px solid ${o.colors.neutral[200]};
1829
- `}
1830
- `, Wn = e.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`
1831
2282
  display: inline-flex;
1832
2283
  align-items: center;
1833
- gap: ${({ theme: o }) => o.spacing[1]};
1834
- background: none;
2284
+ justify-content: center;
2285
+ width: 28px;
2286
+ height: 28px;
1835
2287
  border: none;
2288
+ background: none;
2289
+ border-radius: ${({ theme: o }) => o.radius.md};
1836
2290
  cursor: pointer;
1837
- font: inherit;
1838
- font-weight: 600;
1839
2291
  color: ${({ theme: o }) => o.colors.neutral[600]};
1840
- padding: ${({ theme: o }) => `${o.spacing[2]} ${o.spacing[3]}`};
1841
- width: 100%;
1842
- text-align: left;
2292
+ padding: 0;
1843
2293
 
1844
2294
  &:hover {
1845
- 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]};
1846
2297
  }
1847
2298
 
1848
2299
  &:focus-visible {
1849
2300
  outline: 2px solid ${({ theme: o }) => o.colors.primary[500]};
1850
2301
  outline-offset: 2px;
1851
2302
  }
1852
- `;
1853
- function lo(o, r, n) {
1854
- 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();
1855
2382
  }
1856
- function Pn({
1857
- columns: o,
1858
- defaultData: r,
1859
- data: n,
1860
- rowKey: i,
1861
- onChange: d,
1862
- size: a = "md",
1863
- borderColor: c,
1864
- headerColor: u,
1865
- addRowLabel: g = "Add row",
1866
- newRowFactory: f,
1867
- deletable: $ = !1,
1868
- className: w,
1869
- style: y
1870
- }) {
1871
- const b = n !== void 0, [m, W] = N(r ?? []), I = b ? n : m, [x, P] = N(null), [O, D] = N(""), h = X(null), v = X(null);
1872
- F(() => {
1873
- if (!x)
1874
- return;
1875
- o.find((C) => C.key === x.colKey)?.options ? v.current?.focus() : (h.current?.focus(), h.current?.select());
1876
- }, [x, o]);
1877
- const k = R(
1878
- (p) => {
1879
- b || W(p), d?.(p);
1880
- },
1881
- [b, d]
1882
- ), B = R(
1883
- () => f ? f() : Object.fromEntries(o.map((p) => [p.key, ""])),
1884
- [f, o]
1885
- ), A = R(
1886
- (p) => {
1887
- const C = [];
1888
- return p.forEach((l, S) => {
1889
- o.forEach((z) => {
1890
- lo(z, l, S) && C.push({ rowIndex: S, colKey: z.key });
1891
- });
1892
- }), C;
1893
- },
1894
- [o]
1895
- ), j = (p, C, l) => {
1896
- P({ rowIndex: p, colKey: C }), D(String(l ?? ""));
1897
- }, M = R(() => {
1898
- if (!x)
1899
- return;
1900
- const { rowIndex: p, colKey: C } = x, l = I.map(
1901
- (S, z) => z === p ? { ...S, [C]: O } : S
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()
1902
2395
  );
1903
- k(l), P(null);
1904
- }, [x, I, O, k]), L = () => {
1905
- P(null), D("");
1906
- }, H = (p) => {
1907
- if (!x)
1908
- return;
1909
- p.preventDefault();
1910
- const { rowIndex: C, colKey: l } = x, S = I.map(
1911
- (E, Q) => Q === C ? { ...E, [l]: O } : E
2396
+ if (o < e) return !0;
2397
+ }
2398
+ if (n) {
2399
+ const e = new Date(
2400
+ n.getFullYear(),
2401
+ n.getMonth(),
2402
+ n.getDate()
1912
2403
  );
1913
- k(S);
1914
- const z = A(S), q = z.findIndex(
1915
- (E) => E.rowIndex === C && E.colKey === l
1916
- ), V = p.shiftKey ? q - 1 : q + 1;
1917
- if (V >= 0 && V < z.length) {
1918
- const E = z[V];
1919
- P(E), D(String(S[E.rowIndex][E.colKey] ?? ""));
1920
- return;
1921
- }
1922
- if (!p.shiftKey && V >= z.length) {
1923
- const E = B(), Q = [...S, E];
1924
- k(Q);
1925
- const go = Q.length - 1, bo = o.find(
1926
- (Ro) => lo(Ro, E, go)
1927
- );
1928
- P(
1929
- bo ? { rowIndex: go, colKey: bo.key } : null
1930
- ), D("");
1931
- return;
1932
- }
1933
- P(null), D("");
1934
- }, Y = (p) => {
1935
- if (p.key === "Enter") {
1936
- if (o.find((l) => l.key === x?.colKey)?.options) {
1937
- v.current?.showPicker();
1938
- return;
1939
- }
1940
- M();
1941
- return;
1942
- }
1943
- if (p.key === "Escape") {
1944
- L();
1945
- return;
1946
- }
1947
- p.key === "Tab" && H(p);
1948
- }, no = () => k([...I, B()]), to = (p) => {
1949
- x?.rowIndex === p && P(null), k(I.filter((C, l) => l !== p));
1950
- }, U = (p, C) => String(i ? p[i] : C), so = $ ? o.length + 1 : o.length;
1951
- return /* @__PURE__ */ s(
1952
- Oo,
1953
- {
1954
- $borderColor: c,
1955
- className: w,
1956
- style: y,
1957
- children: /* @__PURE__ */ T(kn, { $size: a, children: [
1958
- /* @__PURE__ */ s(No, { $headerColor: u, $borderColor: c, children: /* @__PURE__ */ T(G, { children: [
1959
- o.map((p) => /* @__PURE__ */ s(
1960
- fo,
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,
1961
2489
  {
1962
- $size: a,
1963
- scope: "col",
1964
- style: p.width ? { width: p.width } : void 0,
1965
- children: p.header
1966
- },
1967
- p.key
1968
- )),
1969
- $ && /* @__PURE__ */ s(zn, { $size: a, "aria-label": "Actions" })
1970
- ] }) }),
1971
- /* @__PURE__ */ T(Lo, { children: [
1972
- I.map((p, C) => /* @__PURE__ */ T(G, { children: [
1973
- o.map((l) => {
1974
- const S = x?.rowIndex === C && x.colKey === l.key, z = p[l.key], q = lo(l, p, C), V = l.options ? (l.options.find((E) => E.value === String(z ?? ""))?.label ?? String(z ?? "")) || " " : l.render ? l.render(z, p, C) : String(z ?? "") || " ";
1975
- return /* @__PURE__ */ s(
1976
- mn,
1977
- {
1978
- $size: a,
1979
- $borderColor: c,
1980
- $editable: q && !S,
1981
- onClick: q && !S ? () => {
1982
- l.options ? (_o(
1983
- () => j(C, l.key, z)
1984
- ), v.current?.showPicker()) : j(C, l.key, z);
1985
- } : void 0,
1986
- children: S && l.options ? /* @__PURE__ */ s(
1987
- Cn,
1988
- {
1989
- ref: v,
1990
- $size: a,
1991
- value: O,
1992
- onChange: (E) => D(E.target.value),
1993
- onBlur: M,
1994
- onKeyDown: Y,
1995
- "aria-label": `Edit ${l.header}`,
1996
- children: l.options.map((E) => /* @__PURE__ */ s("option", { value: E.value, children: E.label }, E.value))
1997
- }
1998
- ) : S ? /* @__PURE__ */ s(
1999
- Sn,
2000
- {
2001
- ref: h,
2002
- $size: a,
2003
- value: O,
2004
- onChange: (E) => D(E.target.value),
2005
- onBlur: M,
2006
- onKeyDown: Y,
2007
- "aria-label": `Edit ${l.header}`
2008
- }
2009
- ) : V
2010
- },
2011
- l.key
2012
- );
2013
- }),
2014
- $ && /* @__PURE__ */ s(Tn, { $size: a, $borderColor: c, children: /* @__PURE__ */ s(
2015
- In,
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,
2016
2532
  {
2017
2533
  type: "button",
2018
- onClick: () => to(C),
2019
- "aria-label": "Delete row",
2020
- children: "✕"
2021
- }
2022
- ) })
2023
- ] }, U(p, C))),
2024
- /* @__PURE__ */ s(En, { children: /* @__PURE__ */ s("td", { colSpan: so, children: /* @__PURE__ */ T(Wn, { type: "button", onClick: no, children: [
2025
- "+ ",
2026
- g
2027
- ] }) }) })
2028
- ] })
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
+ })
2029
2560
  ] })
2030
- }
2031
- );
2561
+ ] })
2562
+ ] });
2032
2563
  }
2033
- Pn.displayName = "DataTable";
2034
- const ko = {
2035
- primary: {
2036
- 50: "#f0f8ff",
2037
- 500: "#0070f3",
2038
- 700: "#005bb5"
2039
- },
2040
- neutral: {
2041
- 0: "#ffffff",
2042
- 100: "#f5f5f5",
2043
- 200: "#eaeaea",
2044
- 300: "#cacaca",
2045
- 400: "#cccccc",
2046
- 500: "#666666",
2047
- 600: "#333333",
2048
- 900: "#111111"
2049
- },
2050
- error: {
2051
- 50: "#fef2f2",
2052
- 500: "#d32f2f"
2053
- },
2054
- success: {
2055
- 50: "#f0fdf4",
2056
- 500: "#16a34a"
2057
- },
2058
- warning: {
2059
- 50: "#fffbeb",
2060
- 500: "#d97706"
2061
- },
2062
- info: {
2063
- 50: "#eff6ff",
2064
- 500: "#2563eb"
2065
- }
2066
- }, Bn = {
2067
- 1: "4px",
2068
- 2: "8px",
2069
- 3: "12px",
2070
- 4: "16px",
2071
- 5: "20px",
2072
- 6: "24px"
2073
- }, On = {
2074
- md: "6px"
2075
- }, Dn = {
2076
- modal: 1e3,
2077
- toast: 1100
2078
- }, Nn = {
2079
- xs: "12px",
2080
- sm: "14px",
2081
- md: "16px",
2082
- lg: "18px"
2083
- }, Hn = {
2084
- colors: { ...ko, primary: { ...ko.primary, contrast: "#ffffff" } },
2085
- spacing: Bn,
2086
- fontSizes: Nn,
2087
- radius: On,
2088
- zIndex: Dn,
2089
- shadows: {
2090
- focusRing: "0 0 0 2px rgba(0, 112, 243, 0.25)"
2091
- }
2092
- };
2093
- function Ln(o) {
2094
- const r = parseInt(o.slice(1, 3), 16) / 255, n = parseInt(o.slice(3, 5), 16) / 255, i = parseInt(o.slice(5, 7), 16) / 255, d = (c) => c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
2095
- return 0.2126 * d(r) + 0.7152 * d(n) + 0.0722 * d(i) > 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";
2096
2568
  }
2097
- const uo = {
2569
+ const eo = {
2098
2570
  colors: {
2099
2571
  primary: {
2100
2572
  50: "#fffde6",
@@ -2124,45 +2596,70 @@ const uo = {
2124
2596
  shadows: { focusRing: "3px 3px 0 #111111" },
2125
2597
  brutalism: { borderWidth: "2px", shadowOffset: "4px" }
2126
2598
  };
2127
- function Yn(o) {
2599
+ function Ct(o) {
2128
2600
  return {
2129
- ...uo,
2601
+ ...eo,
2130
2602
  colors: {
2131
- ...uo.colors,
2603
+ ...eo.colors,
2132
2604
  primary: {
2133
2605
  50: "#fffff0",
2134
2606
  500: o,
2135
2607
  700: o,
2136
- contrast: Ln(o)
2608
+ contrast: ft(o)
2137
2609
  }
2138
2610
  }
2139
2611
  };
2140
2612
  }
2141
- function Un({
2142
- theme: o = uo,
2613
+ function St({
2614
+ theme: o = eo,
2143
2615
  children: r
2144
2616
  }) {
2145
- return /* @__PURE__ */ s(jo, { theme: o, children: r });
2617
+ return /* @__PURE__ */ s(Fo, { theme: o, children: r });
2146
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
+ `;
2147
2637
  export {
2148
- Vo as Badge,
2149
- Fo as Button,
2150
- en as CollapsibleCard,
2151
- Pn as DataTable,
2152
- Ar as Form,
2153
- Rr as FormField,
2154
- Zo as Input,
2155
- Ur as Link,
2156
- dr as Modal,
2157
- Hr as Select,
2158
- vn as Table,
2159
- Un as ThemeProvider,
2160
- Wo as Toast,
2161
- Mn as ToastProvider,
2162
- Yn as createNeoBrutalTheme,
2163
- Hn as defaultTheme,
2164
- uo as neoBrutalTheme,
2165
- Kn as useForm,
2166
- Fn as useTable,
2167
- Vn as useToast
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,
2649
+ qo as Input,
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
2168
2665
  };