blunt-ui 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +22 -22
  2. package/dist/index.js +308 -306
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx as s, jsxs as k, Fragment as Lo } from "react/jsx-runtime";
2
2
  import i, { css as t, keyframes as F, ThemeProvider as Fo, createGlobalStyle as Bo } from "styled-components";
3
- import po, { useId as A, useState as D, useContext as io, createContext as ao, forwardRef as ko, createElement as to, useRef as U, useEffect as j, useCallback as V, useMemo as lo } from "react";
3
+ import po, { useId as R, useState as D, useContext as io, createContext as ao, forwardRef as ko, createElement as to, useRef as j, useEffect as A, useCallback as V, useMemo as lo } from "react";
4
4
  import { createPortal as Co } from "react-dom";
5
- const H = (o, r, n) => t`
5
+ const U = (o, r, n) => t`
6
6
  background: ${r};
7
7
  color: ${n};
8
8
  border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
@@ -31,32 +31,32 @@ const H = (o, r, n) => t`
31
31
  })[o]}
32
32
 
33
33
  ${({ $variant: o, theme: r }) => r.brutalism ? {
34
- primary: H(
34
+ primary: U(
35
35
  r,
36
36
  r.colors.primary[500],
37
37
  r.colors.primary.contrast
38
38
  ),
39
- neutral: H(
39
+ neutral: U(
40
40
  r,
41
41
  r.colors.neutral[200],
42
42
  r.colors.neutral[900]
43
43
  ),
44
- success: H(
44
+ success: U(
45
45
  r,
46
46
  r.colors.success[50],
47
47
  r.colors.success[500]
48
48
  ),
49
- error: H(
49
+ error: U(
50
50
  r,
51
51
  r.colors.error[50],
52
52
  r.colors.error[500]
53
53
  ),
54
- warning: H(
54
+ warning: U(
55
55
  r,
56
56
  r.colors.warning[50],
57
57
  r.colors.warning[500]
58
58
  ),
59
- info: H(r, r.colors.info[50], r.colors.info[500])
59
+ info: U(r, r.colors.info[50], r.colors.info[500])
60
60
  }[o] : {
61
61
  primary: t`
62
62
  background: ${r.colors.primary[50]};
@@ -308,38 +308,38 @@ function qo({
308
308
  error: c,
309
309
  leftElement: d,
310
310
  rightElement: p,
311
- clearable: g,
312
- onClear: b,
313
- fullWidth: h,
314
- id: y,
315
- value: $,
316
- defaultValue: x,
317
- onChange: v,
318
- ...C
311
+ clearable: $,
312
+ onClear: g,
313
+ fullWidth: w,
314
+ id: x,
315
+ value: f,
316
+ defaultValue: y,
317
+ onChange: h,
318
+ ...z
319
319
  }) {
320
- const M = A(), f = y ?? M, T = `${f}-hint`, [S, z] = D(x ?? ""), w = $ !== void 0, I = w ? $ : S, W = typeof c == "string" ? c : void 0, O = !!(a || c), P = (N) => {
321
- w || z(N.target.value), v?.(N);
320
+ const W = R(), v = x ?? W, b = `${v}-hint`, [C, I] = D(y ?? ""), S = f !== void 0, T = S ? f : C, M = typeof c == "string" ? c : void 0, P = !!(a || c), O = (N) => {
321
+ S || I(N.target.value), h?.(N);
322
322
  }, K = () => {
323
- w || z(""), b?.();
323
+ S || I(""), g?.();
324
324
  };
325
- return /* @__PURE__ */ k(Ao, { $fullWidth: h, children: [
326
- l && /* @__PURE__ */ s(Ro, { htmlFor: f, children: l }),
325
+ return /* @__PURE__ */ k(Ao, { $fullWidth: w, children: [
326
+ l && /* @__PURE__ */ s(Ro, { htmlFor: v, children: l }),
327
327
  /* @__PURE__ */ k(Ho, { $size: n, $variant: e, $error: !!c, children: [
328
328
  d && /* @__PURE__ */ s(fo, { children: d }),
329
329
  /* @__PURE__ */ s(
330
330
  Uo,
331
331
  {
332
- id: f,
332
+ id: v,
333
333
  ref: o,
334
334
  type: r,
335
- value: I,
336
- onChange: P,
337
- ...C,
335
+ value: T,
336
+ onChange: O,
337
+ ...z,
338
338
  "aria-invalid": !!c,
339
- "aria-describedby": O ? T : void 0
339
+ "aria-describedby": P ? b : void 0
340
340
  }
341
341
  ),
342
- g && I && /* @__PURE__ */ s(
342
+ $ && T && /* @__PURE__ */ s(
343
343
  Ko,
344
344
  {
345
345
  type: "button",
@@ -350,7 +350,7 @@ function qo({
350
350
  ),
351
351
  p && /* @__PURE__ */ s(fo, { children: p })
352
352
  ] }),
353
- O && /* @__PURE__ */ s(Yo, { id: T, $error: !!c, children: W ?? a })
353
+ P && /* @__PURE__ */ s(Yo, { id: b, $error: !!c, children: M ?? a })
354
354
  ] });
355
355
  }
356
356
  qo.displayName = "Input";
@@ -437,28 +437,28 @@ function or({
437
437
  fullWidth: c,
438
438
  id: d,
439
439
  value: p,
440
- defaultValue: g,
441
- onChange: b,
442
- ...h
440
+ defaultValue: $,
441
+ onChange: g,
442
+ ...w
443
443
  }) {
444
- const y = A(), $ = d ?? y, x = `${$}-hint`, [v, C] = D(g ?? ""), M = p !== void 0, f = M ? p : v, T = typeof a == "string" ? a : void 0, S = !!(l || a);
444
+ const x = R(), f = d ?? x, y = `${f}-hint`, [h, z] = D($ ?? ""), W = p !== void 0, v = W ? p : h, b = typeof a == "string" ? a : void 0, C = !!(l || a);
445
445
  return /* @__PURE__ */ k(Go, { $fullWidth: c, children: [
446
- e && /* @__PURE__ */ s(Jo, { htmlFor: $, children: e }),
446
+ e && /* @__PURE__ */ s(Jo, { htmlFor: f, children: e }),
447
447
  /* @__PURE__ */ s(Zo, { $size: r, $variant: n, $error: !!a, children: /* @__PURE__ */ s(
448
448
  Qo,
449
449
  {
450
- id: $,
450
+ id: f,
451
451
  ref: o,
452
- value: f,
453
- onChange: (w) => {
454
- M || C(w.target.value), b?.(w);
452
+ value: v,
453
+ onChange: (S) => {
454
+ W || z(S.target.value), g?.(S);
455
455
  },
456
- ...h,
456
+ ...w,
457
457
  "aria-invalid": !!a,
458
- "aria-describedby": S ? x : void 0
458
+ "aria-describedby": C ? y : void 0
459
459
  }
460
460
  ) }),
461
- S && /* @__PURE__ */ s(Xo, { id: x, $error: !!a, children: T ?? l })
461
+ C && /* @__PURE__ */ s(Xo, { id: y, $error: !!a, children: b ?? l })
462
462
  ] });
463
463
  }
464
464
  or.displayName = "Textarea";
@@ -491,27 +491,27 @@ const tr = (o) => {
491
491
  }, sr = ao({}), er = () => io(sr), ir = ko(
492
492
  ({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth: e, className: l = "", children: a, iconNode: c, ...d }, p) => {
493
493
  const {
494
- size: g = 24,
495
- strokeWidth: b = 2,
496
- absoluteStrokeWidth: h = !1,
497
- color: y = "currentColor",
498
- className: $ = ""
499
- } = er() ?? {}, x = e ?? h ? Number(n ?? b) * 24 / Number(r ?? g) : n ?? b;
494
+ size: $ = 24,
495
+ strokeWidth: g = 2,
496
+ absoluteStrokeWidth: w = !1,
497
+ color: x = "currentColor",
498
+ className: f = ""
499
+ } = er() ?? {}, y = e ?? w ? Number(n ?? g) * 24 / Number(r ?? $) : n ?? g;
500
500
  return to(
501
501
  "svg",
502
502
  {
503
503
  ref: p,
504
504
  ...ro,
505
- width: r ?? g ?? ro.width,
506
- height: r ?? g ?? ro.height,
507
- stroke: o ?? y,
508
- strokeWidth: x,
509
- className: So("lucide", $, l),
505
+ width: r ?? $ ?? ro.width,
506
+ height: r ?? $ ?? ro.height,
507
+ stroke: o ?? x,
508
+ strokeWidth: y,
509
+ className: So("lucide", f, l),
510
510
  ...!a && !tr(d) && { "aria-hidden": "true" },
511
511
  ...d
512
512
  },
513
513
  [
514
- ...c.map(([v, C]) => to(v, C)),
514
+ ...c.map(([h, z]) => to(h, z)),
515
515
  ...Array.isArray(a) ? a : [a]
516
516
  ]
517
517
  );
@@ -669,49 +669,49 @@ function Tr({
669
669
  clearable: c,
670
670
  onClear: d,
671
671
  id: p,
672
- value: g,
673
- defaultValue: b,
674
- onChange: h,
675
- ...y
672
+ value: $,
673
+ defaultValue: g,
674
+ onChange: w,
675
+ ...x
676
676
  }) {
677
- const $ = A(), x = p ?? $, v = `${x}-hint`, C = typeof l == "string" ? l : void 0, [M, f] = D(
678
- b ?? ""
679
- ), T = g !== void 0, S = T ? g : M, z = (W) => {
680
- T || f(W.target.value), h?.(W);
681
- }, w = () => {
682
- T || f(""), d?.();
683
- }, I = c && !!S;
677
+ const f = R(), y = p ?? f, h = `${y}-hint`, z = typeof l == "string" ? l : void 0, [W, v] = D(
678
+ g ?? ""
679
+ ), b = $ !== void 0, C = b ? $ : W, I = (M) => {
680
+ b || v(M.target.value), w?.(M);
681
+ }, S = () => {
682
+ b || v(""), d?.();
683
+ }, T = c && !!C;
684
684
  return /* @__PURE__ */ k(mr, { $fullWidth: a, children: [
685
685
  /* @__PURE__ */ k(vr, { children: [
686
686
  /* @__PURE__ */ k(
687
687
  Cr,
688
688
  {
689
- id: x,
689
+ id: y,
690
690
  $size: n,
691
691
  $variant: e,
692
692
  $error: !!l,
693
693
  "aria-invalid": !!l,
694
- "aria-describedby": C ? v : void 0,
695
- value: S,
696
- onChange: z,
697
- ...y,
694
+ "aria-describedby": z ? h : void 0,
695
+ value: C,
696
+ onChange: I,
697
+ ...x,
698
698
  children: [
699
699
  r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
700
- o.map((W) => /* @__PURE__ */ s("option", { value: W.value, disabled: W.disabled, children: W.label }, W.value))
700
+ o.map((M) => /* @__PURE__ */ s("option", { value: M.value, disabled: M.disabled, children: M.label }, M.value))
701
701
  ]
702
702
  }
703
703
  ),
704
- I ? /* @__PURE__ */ s(
704
+ T ? /* @__PURE__ */ s(
705
705
  Sr,
706
706
  {
707
707
  type: "button",
708
- onClick: w,
708
+ onClick: S,
709
709
  "aria-label": "Clear selection",
710
710
  children: /* @__PURE__ */ s(co, { size: 14 })
711
711
  }
712
712
  ) : /* @__PURE__ */ s(zr, { "aria-hidden": "true", children: /* @__PURE__ */ s(zo, { size: 14 }) })
713
713
  ] }),
714
- C && /* @__PURE__ */ s(kr, { id: v, $error: !0, children: C })
714
+ z && /* @__PURE__ */ s(kr, { id: h, $error: !0, children: z })
715
715
  ] });
716
716
  }
717
717
  Tr.displayName = "Select";
@@ -784,26 +784,26 @@ function Mr({
784
784
  placeholder: a = "Click to edit",
785
785
  disabled: c = !1
786
786
  }) {
787
- const d = o !== void 0, [p, g] = D(r), b = d ? o : p, [h, y] = D(!1), [$, x] = D(""), v = U(null), C = () => {
788
- c || (x(b), y(!0), setTimeout(() => {
789
- v.current?.focus(), v.current?.select();
787
+ const d = o !== void 0, [p, $] = D(r), g = d ? o : p, [w, x] = D(!1), [f, y] = D(""), h = j(null), z = () => {
788
+ c || (y(g), x(!0), setTimeout(() => {
789
+ h.current?.focus(), h.current?.select();
790
790
  }, 0));
791
- }, M = () => {
792
- d || g($), n?.($), e?.($), y(!1);
793
- }, f = () => {
794
- l?.(b), y(!1);
795
- }, T = (S) => {
796
- S.key === "Enter" ? M() : S.key === "Escape" && f();
791
+ }, W = () => {
792
+ d || $(f), n?.(f), e?.(f), x(!1);
793
+ }, v = () => {
794
+ l?.(g), x(!1);
795
+ }, b = (C) => {
796
+ C.key === "Enter" ? W() : C.key === "Escape" && v();
797
797
  };
798
- return h ? /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
798
+ return w ? /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
799
799
  Dr,
800
800
  {
801
- ref: v,
802
- value: $,
803
- size: Math.max($.length, a.length, 10),
804
- onChange: (S) => x(S.target.value),
805
- onBlur: M,
806
- onKeyDown: T,
801
+ ref: h,
802
+ value: f,
803
+ size: Math.max(f.length, a.length, 10),
804
+ onChange: (C) => y(C.target.value),
805
+ onBlur: W,
806
+ onKeyDown: b,
807
807
  "aria-label": "Edit value"
808
808
  }
809
809
  ) }) : /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
@@ -812,10 +812,10 @@ function Mr({
812
812
  role: c ? void 0 : "button",
813
813
  tabIndex: c ? void 0 : 0,
814
814
  $disabled: c,
815
- $empty: !b,
816
- onClick: C,
817
- onKeyDown: (S) => S.key === "Enter" && C(),
818
- children: b || a
815
+ $empty: !g,
816
+ onClick: z,
817
+ onKeyDown: (C) => C.key === "Enter" && z(),
818
+ children: g || a
819
819
  }
820
820
  ) });
821
821
  }
@@ -1003,75 +1003,77 @@ function Io({
1003
1003
  closeOnBackdrop: c = !0,
1004
1004
  closeOnEscape: d = !0,
1005
1005
  ariaLabelledBy: p,
1006
- ariaDescribedBy: g
1006
+ ariaDescribedBy: $
1007
1007
  }) {
1008
- const b = U(null), h = U(null), y = A(), $ = p ?? (n ? y : void 0), [x, v] = D(o), [C, M] = D(!1);
1009
- return j(() => {
1008
+ const g = j(null), w = j(null), x = j(r);
1009
+ x.current = r;
1010
+ const f = R(), y = p ?? (n ? f : void 0), [h, z] = D(o), [W, v] = D(!1);
1011
+ return A(() => {
1010
1012
  if (o)
1011
- v(!0), M(!1);
1012
- else if (x) {
1013
- M(!0);
1014
- const f = setTimeout(() => {
1015
- v(!1), M(!1);
1013
+ z(!0), v(!1);
1014
+ else if (h) {
1015
+ v(!0);
1016
+ const b = setTimeout(() => {
1017
+ z(!1), v(!1);
1016
1018
  }, 150);
1017
- return () => clearTimeout(f);
1019
+ return () => clearTimeout(b);
1018
1020
  }
1019
- }, [o, x]), j(() => {
1021
+ }, [o, h]), A(() => {
1020
1022
  if (!o)
1021
1023
  return;
1022
- const f = document.body.style.overflow;
1024
+ const b = document.body.style.overflow;
1023
1025
  return document.body.style.overflow = "hidden", () => {
1024
- document.body.style.overflow = f;
1026
+ document.body.style.overflow = b;
1025
1027
  };
1026
- }, [o]), j(() => {
1027
- if (!o || !b.current)
1028
+ }, [o]), A(() => {
1029
+ if (!o || !g.current)
1028
1030
  return;
1029
- const f = b.current, T = document.activeElement;
1030
- (bo(f)[0] ?? f).focus();
1031
- const z = (w) => {
1032
- if (w.key === "Escape" && d) {
1033
- r();
1031
+ const b = g.current, C = document.activeElement;
1032
+ (bo(b)[0] ?? b).focus();
1033
+ const S = (T) => {
1034
+ if (T.key === "Escape" && d) {
1035
+ x.current();
1034
1036
  return;
1035
1037
  }
1036
- if (w.key !== "Tab")
1038
+ if (T.key !== "Tab")
1037
1039
  return;
1038
- const I = bo(f);
1039
- if (I.length === 0) {
1040
- w.preventDefault();
1040
+ const M = bo(b);
1041
+ if (M.length === 0) {
1042
+ T.preventDefault();
1041
1043
  return;
1042
1044
  }
1043
- const W = I[0], O = I[I.length - 1];
1044
- w.shiftKey ? document.activeElement === W && (w.preventDefault(), O.focus()) : document.activeElement === O && (w.preventDefault(), W.focus());
1045
+ const P = M[0], O = M[M.length - 1];
1046
+ T.shiftKey ? document.activeElement === P && (T.preventDefault(), O.focus()) : document.activeElement === O && (T.preventDefault(), P.focus());
1045
1047
  };
1046
- return document.addEventListener("keydown", z), () => {
1047
- document.removeEventListener("keydown", z), T?.focus();
1048
+ return document.addEventListener("keydown", S), () => {
1049
+ document.removeEventListener("keydown", S), C?.focus();
1048
1050
  };
1049
- }, [o, d, r, x]), x ? Co(
1051
+ }, [o, d, h]), h ? Co(
1050
1052
  /* @__PURE__ */ s(
1051
1053
  _r,
1052
1054
  {
1053
- $closing: C,
1054
- onMouseDown: (f) => {
1055
- h.current = f.target;
1055
+ $closing: W,
1056
+ onMouseDown: (b) => {
1057
+ w.current = b.target;
1056
1058
  },
1057
- onClick: (f) => {
1058
- c && h.current === f.currentTarget && r();
1059
+ onClick: (b) => {
1060
+ c && w.current === b.currentTarget && r();
1059
1061
  },
1060
1062
  children: /* @__PURE__ */ k(
1061
1063
  jr,
1062
1064
  {
1063
- ref: b,
1065
+ ref: g,
1064
1066
  role: "dialog",
1065
1067
  "aria-modal": "true",
1066
- "aria-labelledby": $,
1067
- "aria-describedby": g,
1068
+ "aria-labelledby": y,
1069
+ "aria-describedby": $,
1068
1070
  $size: a,
1069
- $closing: C,
1071
+ $closing: W,
1070
1072
  tabIndex: -1,
1071
- onClick: (f) => f.stopPropagation(),
1073
+ onClick: (b) => b.stopPropagation(),
1072
1074
  children: [
1073
1075
  /* @__PURE__ */ k(Ar, { children: [
1074
- n && /* @__PURE__ */ s(Rr, { id: y, children: n }),
1076
+ n && /* @__PURE__ */ s(Rr, { id: f, children: n }),
1075
1077
  /* @__PURE__ */ s(Yr, { onClick: r, "aria-label": "Close modal", children: "×" })
1076
1078
  ] }),
1077
1079
  /* @__PURE__ */ s(Hr, { children: e }),
@@ -1213,25 +1215,25 @@ function Do({
1213
1215
  duration: l = 4e3,
1214
1216
  position: a = "bottom-right"
1215
1217
  }) {
1216
- const [c, d] = D(o), [p, g] = D(!1);
1217
- return j(() => {
1218
+ const [c, d] = D(o), [p, $] = D(!1);
1219
+ return A(() => {
1218
1220
  if (o)
1219
- d(!0), g(!1);
1221
+ d(!0), $(!1);
1220
1222
  else if (c) {
1221
- g(!0);
1222
- const b = setTimeout(() => {
1223
- d(!1), g(!1);
1223
+ $(!0);
1224
+ const g = setTimeout(() => {
1225
+ d(!1), $(!1);
1224
1226
  }, 200);
1225
1227
  return () => {
1226
- clearTimeout(b);
1228
+ clearTimeout(g);
1227
1229
  };
1228
1230
  }
1229
- }, [o, c]), j(() => {
1231
+ }, [o, c]), A(() => {
1230
1232
  if (!o || l === 0)
1231
1233
  return;
1232
- const b = setTimeout(r, l);
1234
+ const g = setTimeout(r, l);
1233
1235
  return () => {
1234
- clearTimeout(b);
1236
+ clearTimeout(g);
1235
1237
  };
1236
1238
  }, [o, l, r]), c ? Co(
1237
1239
  /* @__PURE__ */ k(
@@ -1324,7 +1326,7 @@ function ln({
1324
1326
  required: e,
1325
1327
  children: l
1326
1328
  }) {
1327
- const a = A(), c = `${a}-hint`, d = !!(r || n), p = typeof r == "string" ? r : void 0, g = po.isValidElement(l) ? po.cloneElement(
1329
+ const a = R(), c = `${a}-hint`, d = !!(r || n), p = typeof r == "string" ? r : void 0, $ = po.isValidElement(l) ? po.cloneElement(
1328
1330
  l,
1329
1331
  {
1330
1332
  id: a,
@@ -1337,7 +1339,7 @@ function ln({
1337
1339
  o,
1338
1340
  e && /* @__PURE__ */ s(sn, { "aria-hidden": "true", children: " *" })
1339
1341
  ] }),
1340
- g,
1342
+ $,
1341
1343
  d && /* @__PURE__ */ s(en, { id: c, $error: !!r, children: p ?? n })
1342
1344
  ] });
1343
1345
  }
@@ -1350,81 +1352,81 @@ function wt({
1350
1352
  }) {
1351
1353
  const [l, a] = D(o), [c, d] = D(
1352
1354
  {}
1353
- ), [p, g] = D({}), [b, h] = D(!1), y = U(l);
1354
- y.current = l;
1355
- const $ = V(
1356
- (z) => {
1355
+ ), [p, $] = D({}), [g, w] = D(!1), x = j(l);
1356
+ x.current = l;
1357
+ const f = V(
1358
+ (I) => {
1357
1359
  if (!r)
1358
1360
  return {};
1359
- const w = r(z);
1361
+ const S = r(I);
1360
1362
  return Object.fromEntries(
1361
- Object.entries(w).filter(([, I]) => I !== void 0)
1363
+ Object.entries(S).filter(([, T]) => T !== void 0)
1362
1364
  );
1363
1365
  },
1364
1366
  [r]
1365
- ), x = U(p);
1366
- x.current = p;
1367
- const v = V(
1368
- (z) => {
1369
- const { name: w, value: I } = z.target;
1370
- process.env.NODE_ENV !== "production" && !w && console.warn(
1367
+ ), y = j(p);
1368
+ y.current = p;
1369
+ const h = V(
1370
+ (I) => {
1371
+ const { name: S, value: T } = I.target;
1372
+ process.env.NODE_ENV !== "production" && !S && console.warn(
1371
1373
  "[useForm] handleChange: field is missing a `name` attribute — value will not be tracked."
1372
1374
  );
1373
- const W = { ...y.current, [w]: I };
1374
- a(W), x.current[w] && d($(W));
1375
+ const M = { ...x.current, [S]: T };
1376
+ a(M), y.current[S] && d(f(M));
1375
1377
  },
1376
- [$]
1377
- ), C = V(
1378
- (z) => {
1379
- const { name: w } = z.target;
1380
- process.env.NODE_ENV !== "production" && !w && console.warn(
1378
+ [f]
1379
+ ), z = V(
1380
+ (I) => {
1381
+ const { name: S } = I.target;
1382
+ process.env.NODE_ENV !== "production" && !S && console.warn(
1381
1383
  "[useForm] handleBlur: field is missing a `name` attribute — touched state will not be tracked."
1382
- ), g((I) => ({ ...I, [w]: !0 })), d($(y.current));
1384
+ ), $((T) => ({ ...T, [S]: !0 })), d(f(x.current));
1383
1385
  },
1384
- [$]
1385
- ), M = V(
1386
- (z) => {
1387
- z?.preventDefault();
1388
- const w = Object.keys(y.current).reduce(
1389
- (O, P) => ({ ...O, [P]: !0 }),
1386
+ [f]
1387
+ ), W = V(
1388
+ (I) => {
1389
+ I?.preventDefault();
1390
+ const S = Object.keys(x.current).reduce(
1391
+ (P, O) => ({ ...P, [O]: !0 }),
1390
1392
  {}
1391
1393
  );
1392
- g(w);
1393
- const I = $(y.current);
1394
- if (d(I), Object.keys(I).length > 0) {
1395
- e?.(I);
1394
+ $(S);
1395
+ const T = f(x.current);
1396
+ if (d(T), Object.keys(T).length > 0) {
1397
+ e?.(T);
1396
1398
  return;
1397
1399
  }
1398
1400
  (async () => {
1399
- h(!0);
1401
+ w(!0);
1400
1402
  try {
1401
- await n?.(y.current);
1403
+ await n?.(x.current);
1402
1404
  } finally {
1403
- h(!1);
1405
+ w(!1);
1404
1406
  }
1405
1407
  })();
1406
1408
  },
1407
- [$, n, e]
1408
- ), f = V((z, w) => {
1409
- a((I) => ({ ...I, [z]: w }));
1410
- }, []), T = V(
1411
- (z) => {
1412
- a(z ?? o), d({}), g({}), h(!1);
1409
+ [f, n, e]
1410
+ ), v = V((I, S) => {
1411
+ a((T) => ({ ...T, [I]: S }));
1412
+ }, []), b = V(
1413
+ (I) => {
1414
+ a(I ?? o), d({}), $({}), w(!1);
1413
1415
  },
1414
1416
  [o]
1415
- ), S = Object.fromEntries(
1416
- Object.entries(c).filter(([z]) => p[z])
1417
+ ), C = Object.fromEntries(
1418
+ Object.entries(c).filter(([I]) => p[I])
1417
1419
  );
1418
1420
  return {
1419
1421
  values: l,
1420
- errors: S,
1422
+ errors: C,
1421
1423
  touched: p,
1422
- handleChange: v,
1423
- handleBlur: C,
1424
- handleSubmit: M,
1425
- setFieldValue: f,
1426
- reset: T,
1427
- isSubmitting: b
1424
+ handleChange: h,
1425
+ handleBlur: z,
1426
+ handleSubmit: W,
1427
+ setFieldValue: v,
1428
+ reset: b,
1429
+ isSubmitting: g
1428
1430
  };
1429
1431
  }
1430
1432
  const cn = i.div`
@@ -1518,32 +1520,32 @@ function wn({
1518
1520
  headerActions: c,
1519
1521
  accentColor: d
1520
1522
  }) {
1521
- const [p, g] = D(n), b = A(), h = e !== void 0, y = h ? e : p;
1523
+ const [p, $] = D(n), g = R(), w = e !== void 0, x = w ? e : p;
1522
1524
  return /* @__PURE__ */ k(cn, { $accentColor: d, children: [
1523
1525
  /* @__PURE__ */ k(
1524
1526
  dn,
1525
1527
  {
1526
1528
  type: "button",
1527
- $open: y,
1529
+ $open: x,
1528
1530
  $accentColor: d,
1529
- "aria-expanded": y,
1530
- "aria-controls": b,
1531
+ "aria-expanded": x,
1532
+ "aria-controls": g,
1531
1533
  onClick: () => {
1532
- const x = !y;
1533
- h || g(x), l?.(x);
1534
+ const y = !x;
1535
+ w || $(y), l?.(y);
1534
1536
  },
1535
1537
  children: [
1536
1538
  /* @__PURE__ */ k(un, { children: [
1537
1539
  /* @__PURE__ */ s(pn, { children: o }),
1538
1540
  (a || c) && /* @__PURE__ */ k($n, { children: [
1539
1541
  a && /* @__PURE__ */ s(fn, { children: a }),
1540
- c && /* @__PURE__ */ s(gn, { onClick: (x) => x.stopPropagation(), children: c })
1542
+ c && /* @__PURE__ */ s(gn, { onClick: (y) => y.stopPropagation(), children: c })
1541
1543
  ] })
1542
1544
  ] }),
1543
1545
  /* @__PURE__ */ s(
1544
1546
  bn,
1545
1547
  {
1546
- $open: y,
1548
+ $open: x,
1547
1549
  $accentColor: d,
1548
1550
  "aria-hidden": "true",
1549
1551
  children: /* @__PURE__ */ s(zo, { size: 18, strokeWidth: 2.5 })
@@ -1552,7 +1554,7 @@ function wn({
1552
1554
  ]
1553
1555
  }
1554
1556
  ),
1555
- /* @__PURE__ */ s(xn, { $open: y, children: /* @__PURE__ */ s(yn, { id: b, role: "region", "aria-label": o, children: /* @__PURE__ */ s(hn, { children: r }) }) })
1557
+ /* @__PURE__ */ s(xn, { $open: x, children: /* @__PURE__ */ s(yn, { id: g, role: "region", "aria-label": o, children: /* @__PURE__ */ s(hn, { children: r }) }) })
1556
1558
  ] });
1557
1559
  }
1558
1560
  wn.displayName = "CollapsibleCard";
@@ -1610,14 +1612,14 @@ function Tn({
1610
1612
  }) {
1611
1613
  const l = r !== void 0, [a, c] = D(
1612
1614
  n ?? null
1613
- ), d = l ? r ?? null : a, p = (b) => {
1614
- const h = zn(d, b);
1615
- return l || c(h), e?.(h), h;
1616
- }, g = lo(() => l || !d ? o : [...o].sort((b, h) => {
1617
- const y = b[d.key], $ = h[d.key], x = y < $ ? -1 : y > $ ? 1 : 0;
1618
- return d.direction === "asc" ? x : -x;
1615
+ ), d = l ? r ?? null : a, p = (g) => {
1616
+ const w = zn(d, g);
1617
+ return l || c(w), e?.(w), w;
1618
+ }, $ = lo(() => l || !d ? o : [...o].sort((g, w) => {
1619
+ const x = g[d.key], f = w[d.key], y = x < f ? -1 : x > f ? 1 : 0;
1620
+ return d.direction === "asc" ? y : -y;
1619
1621
  }), [o, d, l]);
1620
- return { activeSort: d, sortedData: g, handleSort: p };
1622
+ return { activeSort: d, sortedData: $, handleSort: p };
1621
1623
  }
1622
1624
  const In = 7, xo = 3, yo = 1;
1623
1625
  function Dn(o, r) {
@@ -1637,15 +1639,15 @@ function Mn({
1637
1639
  totalRows: l,
1638
1640
  onPageChange: a
1639
1641
  }) {
1640
- const c = n !== void 0, [d, p] = D(e ?? 1), g = c ? n : d, b = (v) => {
1641
- c || p(v), a?.(v);
1642
- }, h = c || l !== void 0, y = l ?? o.length, $ = r ? Math.max(1, Math.ceil(y / r)) : 1, x = lo(() => {
1643
- if (!r || h)
1642
+ const c = n !== void 0, [d, p] = D(e ?? 1), $ = c ? n : d, g = (h) => {
1643
+ c || p(h), a?.(h);
1644
+ }, w = c || l !== void 0, x = l ?? o.length, f = r ? Math.max(1, Math.ceil(x / r)) : 1, y = lo(() => {
1645
+ if (!r || w)
1644
1646
  return o;
1645
- const v = (g - 1) * r;
1646
- return o.slice(v, v + r);
1647
- }, [o, r, g, h]);
1648
- return { activePage: g, totalPages: $, displayData: x, handlePageChange: b };
1647
+ const h = ($ - 1) * r;
1648
+ return o.slice(h, h + r);
1649
+ }, [o, r, $, w]);
1650
+ return { activePage: $, totalPages: f, displayData: y, handlePageChange: g };
1649
1651
  }
1650
1652
  const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg" ? `${r.spacing[3]} ${r.spacing[4]}` : `${r.spacing[2]} ${r.spacing[3]}`, Wn = i.div`
1651
1653
  width: 100%;
@@ -1885,33 +1887,33 @@ function Un({
1885
1887
  stickyHeader: c,
1886
1888
  caption: d,
1887
1889
  emptyMessage: p = "No data",
1888
- loading: g,
1889
- sort: b,
1890
- defaultSort: h,
1891
- onSortChange: y,
1892
- pageSize: $,
1893
- page: x,
1894
- defaultPage: v,
1895
- totalRows: C,
1896
- onPageChange: M,
1897
- onChange: f,
1898
- onRowClick: T,
1899
- borderColor: S,
1900
- headerColor: z,
1901
- rowColor: w,
1902
- stripeColor: I,
1903
- className: W,
1904
- style: O
1890
+ loading: $,
1891
+ sort: g,
1892
+ defaultSort: w,
1893
+ onSortChange: x,
1894
+ pageSize: f,
1895
+ page: y,
1896
+ defaultPage: h,
1897
+ totalRows: z,
1898
+ onPageChange: W,
1899
+ onChange: v,
1900
+ onRowClick: b,
1901
+ borderColor: C,
1902
+ headerColor: I,
1903
+ rowColor: S,
1904
+ stripeColor: T,
1905
+ className: M,
1906
+ style: P
1905
1907
  }) {
1906
1908
  const {
1907
- activeSort: P,
1909
+ activeSort: O,
1908
1910
  sortedData: K,
1909
1911
  handleSort: N
1910
1912
  } = Tn({
1911
1913
  data: r,
1912
- sort: b,
1913
- defaultSort: h,
1914
- onSortChange: y
1914
+ sort: g,
1915
+ defaultSort: w,
1916
+ onSortChange: x
1915
1917
  }), {
1916
1918
  activePage: E,
1917
1919
  totalPages: q,
@@ -1919,32 +1921,32 @@ function Un({
1919
1921
  handlePageChange: B
1920
1922
  } = Mn({
1921
1923
  data: K,
1922
- pageSize: $,
1923
- page: x,
1924
- defaultPage: v,
1925
- totalRows: C,
1926
- onPageChange: M
1927
- }), R = (m) => {
1924
+ pageSize: f,
1925
+ page: y,
1926
+ defaultPage: h,
1927
+ totalRows: z,
1928
+ onPageChange: W
1929
+ }), Y = (m) => {
1928
1930
  const L = N(m);
1929
- f?.({ sort: L, page: E });
1930
- }, Y = (m) => {
1931
- B(m), f?.({ sort: P, page: m });
1932
- }, Z = (m, L) => String(n ? m[n] : L), Q = !g && u.length === 0, Eo = $ ?? Yn;
1931
+ v?.({ sort: L, page: E });
1932
+ }, H = (m) => {
1933
+ B(m), v?.({ sort: O, page: m });
1934
+ }, Z = (m, L) => String(n ? m[n] : L), Q = !$ && u.length === 0, Eo = f ?? Yn;
1933
1935
  return /* @__PURE__ */ k(
1934
1936
  Wn,
1935
1937
  {
1936
- $borderColor: S,
1938
+ $borderColor: C,
1937
1939
  $stickyHeader: c,
1938
- className: W,
1939
- style: O,
1940
+ className: M,
1941
+ style: P,
1940
1942
  children: [
1941
1943
  /* @__PURE__ */ k(On, { $size: e, children: [
1942
1944
  d && /* @__PURE__ */ s("caption", { children: d }),
1943
1945
  /* @__PURE__ */ s(
1944
1946
  Pn,
1945
1947
  {
1946
- $headerColor: z,
1947
- $borderColor: S,
1948
+ $headerColor: I,
1949
+ $borderColor: C,
1948
1950
  $stickyHeader: c,
1949
1951
  children: /* @__PURE__ */ s(X, { children: o.map((m) => /* @__PURE__ */ s(
1950
1952
  Ln,
@@ -1957,11 +1959,11 @@ function Un({
1957
1959
  Fn,
1958
1960
  {
1959
1961
  type: "button",
1960
- onClick: () => R(m.key),
1961
- "aria-label": `Sort by ${m.header}${P?.key === m.key ? `, ${P.direction}ending` : ""}`,
1962
+ onClick: () => Y(m.key),
1963
+ "aria-label": `Sort by ${m.header}${O?.key === m.key ? `, ${O.direction}ending` : ""}`,
1962
1964
  children: [
1963
1965
  m.header,
1964
- /* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(P, m.key) })
1966
+ /* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(O, m.key) })
1965
1967
  ]
1966
1968
  }
1967
1969
  ) : m.header
@@ -1974,28 +1976,28 @@ function Un({
1974
1976
  Nn,
1975
1977
  {
1976
1978
  $striped: l,
1977
- $rowColor: w,
1978
- $stripeColor: I,
1979
- children: g ? Array.from({ length: Eo }).map((m, L) => /* @__PURE__ */ s(X, { children: o.map((uo) => /* @__PURE__ */ s(
1979
+ $rowColor: S,
1980
+ $stripeColor: T,
1981
+ children: $ ? Array.from({ length: Eo }).map((m, L) => /* @__PURE__ */ s(X, { children: o.map((uo) => /* @__PURE__ */ s(
1980
1982
  jn,
1981
1983
  {
1982
1984
  $size: e,
1983
1985
  $bordered: a,
1984
- $borderColor: S,
1986
+ $borderColor: C,
1985
1987
  children: /* @__PURE__ */ s(An, {})
1986
1988
  },
1987
1989
  uo.key
1988
1990
  )) }, L)) : Q ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(Vn, { colSpan: o.length, children: p }) }) : u.map((m, L) => /* @__PURE__ */ s(
1989
- T ? En : X,
1991
+ b ? En : X,
1990
1992
  {
1991
- onClick: T ? () => T(m) : void 0,
1992
- $accentColor: T ? S : void 0,
1993
+ onClick: b ? () => b(m) : void 0,
1994
+ $accentColor: b ? C : void 0,
1993
1995
  children: o.map((G) => /* @__PURE__ */ s(
1994
1996
  Oo,
1995
1997
  {
1996
1998
  $size: e,
1997
1999
  $bordered: a,
1998
- $borderColor: S,
2000
+ $borderColor: C,
1999
2001
  children: G.render ? G.render(m[G.key], m, L) : String(m[G.key] ?? "") || " "
2000
2002
  },
2001
2003
  G.key
@@ -2006,12 +2008,12 @@ function Un({
2006
2008
  }
2007
2009
  )
2008
2010
  ] }),
2009
- $ && q > 1 && /* @__PURE__ */ k(Rn, { children: [
2011
+ f && q > 1 && /* @__PURE__ */ k(Rn, { children: [
2010
2012
  /* @__PURE__ */ s(
2011
2013
  no,
2012
2014
  {
2013
2015
  type: "button",
2014
- onClick: () => Y(E - 1),
2016
+ onClick: () => H(E - 1),
2015
2017
  disabled: E <= 1,
2016
2018
  "aria-label": "Previous page",
2017
2019
  children: "←"
@@ -2031,7 +2033,7 @@ function Un({
2031
2033
  {
2032
2034
  type: "button",
2033
2035
  $active: m === E,
2034
- onClick: () => Y(m),
2036
+ onClick: () => H(m),
2035
2037
  "aria-label": `Page ${m}`,
2036
2038
  "aria-current": m === E ? "page" : void 0,
2037
2039
  children: m
@@ -2043,7 +2045,7 @@ function Un({
2043
2045
  no,
2044
2046
  {
2045
2047
  type: "button",
2046
- onClick: () => Y(E + 1),
2048
+ onClick: () => H(E + 1),
2047
2049
  disabled: E >= q,
2048
2050
  "aria-label": "Next page",
2049
2051
  children: "→"
@@ -2438,65 +2440,65 @@ function pt({
2438
2440
  minDate: c,
2439
2441
  maxDate: d,
2440
2442
  formatDate: p,
2441
- id: g,
2442
- error: b
2443
+ id: $,
2444
+ error: g
2443
2445
  }) {
2444
- const h = A(), y = g ?? h, $ = /* @__PURE__ */ new Date(), [x, v] = D(!1), [C, M] = D(
2445
- () => (o ?? $).getFullYear()
2446
- ), [f, T] = D(() => (o ?? $).getMonth()), S = U(null);
2447
- j(() => {
2448
- if (!x) return;
2446
+ const w = R(), x = $ ?? w, f = /* @__PURE__ */ new Date(), [y, h] = D(!1), [z, W] = D(
2447
+ () => (o ?? f).getFullYear()
2448
+ ), [v, b] = D(() => (o ?? f).getMonth()), C = j(null);
2449
+ A(() => {
2450
+ if (!y) return;
2449
2451
  const u = (B) => {
2450
- S.current && !S.current.contains(B.target) && v(!1);
2452
+ C.current && !C.current.contains(B.target) && h(!1);
2451
2453
  };
2452
2454
  return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
2453
- }, [x]), j(() => {
2454
- o && (M(o.getFullYear()), T(o.getMonth()));
2455
+ }, [y]), A(() => {
2456
+ o && (W(o.getFullYear()), b(o.getMonth()));
2455
2457
  }, [o]);
2456
- const z = o ? p ? p(o) : dt(o) : "", w = (u) => {
2457
- r?.(new Date(C, f, u)), v(!1);
2458
- }, I = (u) => {
2458
+ const I = o ? p ? p(o) : dt(o) : "", S = (u) => {
2459
+ r?.(new Date(z, v, u)), h(!1);
2460
+ }, T = (u) => {
2459
2461
  u.stopPropagation(), r?.(null);
2460
- }, W = () => {
2461
- f === 0 ? (T(11), M((u) => u - 1)) : T((u) => u - 1);
2462
- }, O = () => {
2463
- f === 11 ? (T(0), M((u) => u + 1)) : T((u) => u + 1);
2464
- }, P = mo(C, f), K = lt(C, f), N = [], E = mo(
2465
- f === 0 ? C - 1 : C,
2466
- f === 0 ? 11 : f - 1
2462
+ }, M = () => {
2463
+ v === 0 ? (b(11), W((u) => u - 1)) : b((u) => u - 1);
2464
+ }, P = () => {
2465
+ v === 11 ? (b(0), W((u) => u + 1)) : b((u) => u + 1);
2466
+ }, O = mo(z, v), K = lt(z, v), N = [], E = mo(
2467
+ v === 0 ? z - 1 : z,
2468
+ v === 0 ? 11 : v - 1
2467
2469
  );
2468
2470
  for (let u = K - 1; u >= 0; u--)
2469
2471
  N.push({ day: E - u, currentMonth: !1 });
2470
- for (let u = 1; u <= P; u++)
2472
+ for (let u = 1; u <= O; u++)
2471
2473
  N.push({ day: u, currentMonth: !0 });
2472
2474
  const q = 42 - N.length;
2473
2475
  for (let u = 1; u <= q; u++)
2474
2476
  N.push({ day: u, currentMonth: !1 });
2475
- return /* @__PURE__ */ k(Gn, { ref: S, children: [
2477
+ return /* @__PURE__ */ k(Gn, { ref: C, children: [
2476
2478
  /* @__PURE__ */ k(
2477
2479
  Jn,
2478
2480
  {
2479
- id: y,
2481
+ id: x,
2480
2482
  $size: e,
2481
- $error: !!b,
2483
+ $error: !!g,
2482
2484
  $disabled: l,
2483
2485
  role: "combobox",
2484
2486
  "aria-haspopup": "true",
2485
- "aria-expanded": x,
2487
+ "aria-expanded": y,
2486
2488
  tabIndex: l ? -1 : 0,
2487
2489
  onClick: () => {
2488
- l || v((u) => !u);
2490
+ l || h((u) => !u);
2489
2491
  },
2490
2492
  onKeyDown: (u) => {
2491
- (u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(), v((B) => !B)), u.key === "Escape" && v(!1);
2493
+ (u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(), h((B) => !B)), u.key === "Escape" && h(!1);
2492
2494
  },
2493
2495
  children: [
2494
- /* @__PURE__ */ s(Xn, { $hasValue: !!o, children: z || n }),
2496
+ /* @__PURE__ */ s(Xn, { $hasValue: !!o, children: I || n }),
2495
2497
  a && o ? /* @__PURE__ */ s(
2496
2498
  Qn,
2497
2499
  {
2498
2500
  type: "button",
2499
- onClick: I,
2501
+ onClick: T,
2500
2502
  "aria-label": "Clear date",
2501
2503
  children: /* @__PURE__ */ s(co, { size: 14 })
2502
2504
  }
@@ -2504,28 +2506,28 @@ function pt({
2504
2506
  ]
2505
2507
  }
2506
2508
  ),
2507
- typeof b == "string" && /* @__PURE__ */ s(ot, { $error: !0, children: b }),
2508
- x && /* @__PURE__ */ k(rt, { role: "dialog", "aria-label": "Calendar", children: [
2509
+ typeof g == "string" && /* @__PURE__ */ s(ot, { $error: !0, children: g }),
2510
+ y && /* @__PURE__ */ k(rt, { role: "dialog", "aria-label": "Calendar", children: [
2509
2511
  /* @__PURE__ */ k(nt, { children: [
2510
2512
  /* @__PURE__ */ s(
2511
2513
  ho,
2512
2514
  {
2513
2515
  type: "button",
2514
- onClick: W,
2516
+ onClick: M,
2515
2517
  "aria-label": "Previous month",
2516
2518
  children: /* @__PURE__ */ s(xr, { size: 16 })
2517
2519
  }
2518
2520
  ),
2519
2521
  /* @__PURE__ */ k(tt, { children: [
2520
- it[f],
2522
+ it[v],
2521
2523
  " ",
2522
- C
2524
+ z
2523
2525
  ] }),
2524
2526
  /* @__PURE__ */ s(
2525
2527
  ho,
2526
2528
  {
2527
2529
  type: "button",
2528
- onClick: O,
2530
+ onClick: P,
2529
2531
  "aria-label": "Next month",
2530
2532
  children: /* @__PURE__ */ s(hr, { size: 16 })
2531
2533
  }
@@ -2548,18 +2550,18 @@ function pt({
2548
2550
  },
2549
2551
  B
2550
2552
  );
2551
- const R = new Date(C, f, u.day), Y = o ? vo(R, o) : !1, Z = vo(R, $), Q = ct(R, c, d);
2553
+ const Y = new Date(z, v, u.day), H = o ? vo(Y, o) : !1, Z = vo(Y, f), Q = ct(Y, c, d);
2552
2554
  return /* @__PURE__ */ s(
2553
2555
  wo,
2554
2556
  {
2555
2557
  type: "button",
2556
2558
  $currentMonth: !0,
2557
- $selected: Y,
2559
+ $selected: H,
2558
2560
  $today: Z,
2559
2561
  disabled: Q,
2560
- "aria-label": ut(R),
2561
- "aria-pressed": Y,
2562
- onClick: () => w(u.day),
2562
+ "aria-label": ut(Y),
2563
+ "aria-pressed": H,
2564
+ onClick: () => S(u.day),
2563
2565
  children: u.day
2564
2566
  },
2565
2567
  B