blunt-ui 1.0.0 → 1.1.1

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