blunt-ui 0.3.6 → 1.1.0

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