blunt-ui 0.3.3 → 0.3.5

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 (4) hide show
  1. package/README.md +249 -125
  2. package/dist/index.cjs +32 -29
  3. package/dist/index.js +368 -360
  4. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx as s, jsxs as C, Fragment as Lo } from "react/jsx-runtime";
2
- import i, { css as t, keyframes as L, ThemeProvider as Fo, createGlobalStyle as Bo } from "styled-components";
3
- import po, { useId as A, useState as M, useContext as io, createContext as ao, forwardRef as ko, createElement as to, useRef as G, useEffect as j, useCallback as V, useMemo as lo } from "react";
1
+ import { jsx as s, jsxs as k, Fragment as Lo } from "react/jsx-runtime";
2
+ import i, { css as t, keyframes as F, ThemeProvider as Fo, createGlobalStyle as Bo } from "styled-components";
3
+ import po, { useId as 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";
4
4
  import { createPortal as Co } from "react-dom";
5
5
  const H = (o, r, n) => t`
6
6
  background: ${r};
@@ -308,49 +308,49 @@ function qo({
308
308
  error: c,
309
309
  leftElement: d,
310
310
  rightElement: p,
311
- clearable: $,
312
- onClear: g,
313
- fullWidth: y,
314
- id: b,
315
- value: f,
311
+ clearable: g,
312
+ onClear: b,
313
+ fullWidth: h,
314
+ id: y,
315
+ value: $,
316
316
  defaultValue: x,
317
- onChange: w,
318
- ...S
317
+ onChange: v,
318
+ ...C
319
319
  }) {
320
- const T = A(), z = b ?? T, I = `${z}-hint`, [k, m] = M(x ?? ""), v = f !== void 0, D = v ? f : k, W = typeof c == "string" ? c : void 0, F = !!(a || c), O = (P) => {
321
- v || m(P.target.value), w?.(P);
322
- }, U = () => {
323
- v || m(""), g?.();
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);
322
+ }, K = () => {
323
+ w || z(""), b?.();
324
324
  };
325
- return /* @__PURE__ */ C(Ao, { $fullWidth: y, children: [
326
- l && /* @__PURE__ */ s(Ro, { htmlFor: z, children: l }),
327
- /* @__PURE__ */ C(Ho, { $size: n, $variant: e, $error: !!c, children: [
325
+ return /* @__PURE__ */ k(Ao, { $fullWidth: h, children: [
326
+ l && /* @__PURE__ */ s(Ro, { htmlFor: f, children: l }),
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: z,
332
+ id: f,
333
333
  ref: o,
334
334
  type: r,
335
- value: D,
336
- onChange: O,
337
- ...S,
335
+ value: I,
336
+ onChange: P,
337
+ ...C,
338
338
  "aria-invalid": !!c,
339
- "aria-describedby": F ? I : void 0
339
+ "aria-describedby": O ? T : void 0
340
340
  }
341
341
  ),
342
- $ && D && /* @__PURE__ */ s(
342
+ g && I && /* @__PURE__ */ s(
343
343
  Ko,
344
344
  {
345
345
  type: "button",
346
- onClick: U,
346
+ onClick: K,
347
347
  "aria-label": "Clear input",
348
348
  children: "✕"
349
349
  }
350
350
  ),
351
351
  p && /* @__PURE__ */ s(fo, { children: p })
352
352
  ] }),
353
- F && /* @__PURE__ */ s(Yo, { id: I, $error: !!c, children: W ?? a })
353
+ O && /* @__PURE__ */ s(Yo, { id: T, $error: !!c, children: W ?? 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: $,
441
- onChange: g,
442
- ...y
440
+ defaultValue: g,
441
+ onChange: b,
442
+ ...h
443
443
  }) {
444
- const b = A(), f = d ?? b, x = `${f}-hint`, [w, S] = M($ ?? ""), T = p !== void 0, z = T ? p : w, I = typeof a == "string" ? a : void 0, k = !!(l || a);
445
- return /* @__PURE__ */ C(Go, { $fullWidth: c, children: [
446
- e && /* @__PURE__ */ s(Jo, { htmlFor: f, children: e }),
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);
445
+ return /* @__PURE__ */ k(Go, { $fullWidth: c, children: [
446
+ e && /* @__PURE__ */ s(Jo, { htmlFor: $, children: e }),
447
447
  /* @__PURE__ */ s(Zo, { $size: r, $variant: n, $error: !!a, children: /* @__PURE__ */ s(
448
448
  Qo,
449
449
  {
450
- id: f,
450
+ id: $,
451
451
  ref: o,
452
- value: z,
453
- onChange: (v) => {
454
- T || S(v.target.value), g?.(v);
452
+ value: f,
453
+ onChange: (w) => {
454
+ M || C(w.target.value), b?.(w);
455
455
  },
456
- ...y,
456
+ ...h,
457
457
  "aria-invalid": !!a,
458
- "aria-describedby": k ? x : void 0
458
+ "aria-describedby": S ? x : void 0
459
459
  }
460
460
  ) }),
461
- k && /* @__PURE__ */ s(Xo, { id: x, $error: !!a, children: I ?? l })
461
+ S && /* @__PURE__ */ s(Xo, { id: x, $error: !!a, children: T ?? 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: $ = 24,
495
- strokeWidth: g = 2,
496
- absoluteStrokeWidth: y = !1,
497
- color: b = "currentColor",
498
- className: f = ""
499
- } = er() ?? {}, x = e ?? y ? Number(n ?? g) * 24 / Number(r ?? $) : n ?? g;
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;
500
500
  return to(
501
501
  "svg",
502
502
  {
503
503
  ref: p,
504
504
  ...ro,
505
- width: r ?? $ ?? ro.width,
506
- height: r ?? $ ?? ro.height,
507
- stroke: o ?? b,
505
+ width: r ?? g ?? ro.width,
506
+ height: r ?? g ?? ro.height,
507
+ stroke: o ?? y,
508
508
  strokeWidth: x,
509
- className: So("lucide", f, l),
509
+ className: So("lucide", $, l),
510
510
  ...!a && !tr(d) && { "aria-hidden": "true" },
511
511
  ...d
512
512
  },
513
513
  [
514
- ...c.map(([w, S]) => to(w, S)),
514
+ ...c.map(([v, C]) => to(v, C)),
515
515
  ...Array.isArray(a) ? a : [a]
516
516
  ]
517
517
  );
@@ -669,21 +669,21 @@ function Tr({
669
669
  clearable: c,
670
670
  onClear: d,
671
671
  id: p,
672
- value: $,
673
- defaultValue: g,
674
- onChange: y,
675
- ...b
672
+ value: g,
673
+ defaultValue: b,
674
+ onChange: h,
675
+ ...y
676
676
  }) {
677
- const f = A(), x = p ?? f, w = `${x}-hint`, S = typeof l == "string" ? l : void 0, [T, z] = M(
678
- g ?? ""
679
- ), I = $ !== void 0, k = I ? $ : T, m = (W) => {
680
- I || z(W.target.value), y?.(W);
681
- }, v = () => {
682
- I || z(""), d?.();
683
- }, D = c && !!k;
684
- return /* @__PURE__ */ C(mr, { $fullWidth: a, children: [
685
- /* @__PURE__ */ C(vr, { children: [
686
- /* @__PURE__ */ C(
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;
684
+ return /* @__PURE__ */ k(mr, { $fullWidth: a, children: [
685
+ /* @__PURE__ */ k(vr, { children: [
686
+ /* @__PURE__ */ k(
687
687
  Cr,
688
688
  {
689
689
  id: x,
@@ -691,27 +691,27 @@ function Tr({
691
691
  $variant: e,
692
692
  $error: !!l,
693
693
  "aria-invalid": !!l,
694
- "aria-describedby": S ? w : void 0,
695
- value: k,
696
- onChange: m,
697
- ...b,
694
+ "aria-describedby": C ? v : void 0,
695
+ value: S,
696
+ onChange: z,
697
+ ...y,
698
698
  children: [
699
699
  r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
700
700
  o.map((W) => /* @__PURE__ */ s("option", { value: W.value, disabled: W.disabled, children: W.label }, W.value))
701
701
  ]
702
702
  }
703
703
  ),
704
- D ? /* @__PURE__ */ s(
704
+ I ? /* @__PURE__ */ s(
705
705
  Sr,
706
706
  {
707
707
  type: "button",
708
- onClick: v,
708
+ onClick: w,
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
- S && /* @__PURE__ */ s(kr, { id: w, $error: !0, children: S })
714
+ C && /* @__PURE__ */ s(kr, { id: v, $error: !0, children: C })
715
715
  ] });
716
716
  }
717
717
  Tr.displayName = "Select";
@@ -734,6 +734,9 @@ const go = i.span`
734
734
  opacity: 0.5;
735
735
  ` : t`
736
736
  cursor: text;
737
+ transition:
738
+ border-color 0.15s ease,
739
+ box-shadow 0.15s ease;
737
740
 
738
741
  &:hover {
739
742
  ${r.brutalism ? t`
@@ -752,7 +755,7 @@ const go = i.span`
752
755
  box-shadow: ${r.shadows.focusRing};
753
756
  }
754
757
  `}
755
- `, Mr = i.input`
758
+ `, Dr = i.input`
756
759
  display: inline-block;
757
760
  min-width: 60px;
758
761
  padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
@@ -772,7 +775,7 @@ const go = i.span`
772
775
  box-shadow: ${o.shadows.focusRing};
773
776
  `}
774
777
  `;
775
- function Dr({
778
+ function Mr({
776
779
  value: o,
777
780
  defaultValue: r = "",
778
781
  onChange: n,
@@ -781,26 +784,26 @@ function Dr({
781
784
  placeholder: a = "Click to edit",
782
785
  disabled: c = !1
783
786
  }) {
784
- const d = o !== void 0, [p, $] = M(r), g = d ? o : p, [y, b] = M(!1), [f, x] = M(""), w = G(null), S = () => {
785
- c || (x(g), b(!0), setTimeout(() => {
786
- w.current?.focus(), w.current?.select();
787
+ 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
790
  }, 0));
788
- }, T = () => {
789
- d || $(f), n?.(f), e?.(f), b(!1);
790
- }, z = () => {
791
- l?.(g), b(!1);
792
- }, I = (k) => {
793
- k.key === "Enter" ? T() : k.key === "Escape" && z();
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();
794
797
  };
795
- return y ? /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
796
- Mr,
798
+ return h ? /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
799
+ Dr,
797
800
  {
798
- ref: w,
799
- value: f,
800
- size: Math.max(f.length, a.length, 10),
801
- onChange: (k) => x(k.target.value),
802
- onBlur: T,
803
- onKeyDown: I,
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,
804
807
  "aria-label": "Edit value"
805
808
  }
806
809
  ) }) : /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
@@ -809,14 +812,14 @@ function Dr({
809
812
  role: c ? void 0 : "button",
810
813
  tabIndex: c ? void 0 : 0,
811
814
  $disabled: c,
812
- $empty: !g,
813
- onClick: S,
814
- onKeyDown: (k) => k.key === "Enter" && S(),
815
- children: g || a
815
+ $empty: !b,
816
+ onClick: C,
817
+ onKeyDown: (S) => S.key === "Enter" && C(),
818
+ children: b || a
816
819
  }
817
820
  ) });
818
821
  }
819
- Dr.displayName = "Editable";
822
+ Mr.displayName = "Editable";
820
823
  const Wr = i.a`
821
824
  text-decoration: underline;
822
825
  text-underline-offset: 2px;
@@ -873,22 +876,22 @@ const Or = i.div`
873
876
  color: ${({ theme: o }) => o.colors.neutral[900]};
874
877
  `;
875
878
  function Er({ label: o, value: r, href: n }) {
876
- return /* @__PURE__ */ C(Or, { children: [
879
+ return /* @__PURE__ */ k(Or, { children: [
877
880
  /* @__PURE__ */ s(Pr, { children: o }),
878
881
  n ? /* @__PURE__ */ s(To, { href: n, external: !0, children: r }) : /* @__PURE__ */ s(Nr, { children: r ?? "—" })
879
882
  ] });
880
883
  }
881
884
  Er.displayName = "Field";
882
- const Lr = L`
885
+ const Lr = F`
883
886
  from { opacity: 0; }
884
887
  to { opacity: 1; }
885
- `, Fr = L`
888
+ `, Fr = F`
886
889
  from { opacity: 1; }
887
890
  to { opacity: 0; }
888
- `, Br = L`
891
+ `, Br = F`
889
892
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
890
893
  to { opacity: 1; transform: scale(1) translateY(0); }
891
- `, Vr = L`
894
+ `, Vr = F`
892
895
  from { opacity: 1; transform: scale(1) translateY(0); }
893
896
  to { opacity: 0; transform: scale(0.95) translateY(-8px); }
894
897
  `, _r = i.div`
@@ -1000,69 +1003,74 @@ function Io({
1000
1003
  closeOnBackdrop: c = !0,
1001
1004
  closeOnEscape: d = !0,
1002
1005
  ariaLabelledBy: p,
1003
- ariaDescribedBy: $
1006
+ ariaDescribedBy: g
1004
1007
  }) {
1005
- const g = G(null), y = A(), b = p ?? (n ? y : void 0), [f, x] = M(o), [w, S] = M(!1);
1008
+ const b = U(null), h = U(null), y = A(), $ = p ?? (n ? y : void 0), [x, v] = D(o), [C, M] = D(!1);
1006
1009
  return j(() => {
1007
1010
  if (o)
1008
- x(!0), S(!1);
1009
- else if (f) {
1010
- S(!0);
1011
- const T = setTimeout(() => {
1012
- x(!1), S(!1);
1011
+ v(!0), M(!1);
1012
+ else if (x) {
1013
+ M(!0);
1014
+ const f = setTimeout(() => {
1015
+ v(!1), M(!1);
1013
1016
  }, 150);
1014
- return () => clearTimeout(T);
1017
+ return () => clearTimeout(f);
1015
1018
  }
1016
- }, [o, f]), j(() => {
1019
+ }, [o, x]), j(() => {
1017
1020
  if (!o)
1018
1021
  return;
1019
- const T = document.body.style.overflow;
1022
+ const f = document.body.style.overflow;
1020
1023
  return document.body.style.overflow = "hidden", () => {
1021
- document.body.style.overflow = T;
1024
+ document.body.style.overflow = f;
1022
1025
  };
1023
1026
  }, [o]), j(() => {
1024
- if (!o || !g.current)
1027
+ if (!o || !b.current)
1025
1028
  return;
1026
- const T = g.current, z = document.activeElement;
1027
- (bo(T)[0] ?? T).focus();
1028
- const k = (m) => {
1029
- if (m.key === "Escape" && d) {
1029
+ const f = b.current, T = document.activeElement;
1030
+ (bo(f)[0] ?? f).focus();
1031
+ const z = (w) => {
1032
+ if (w.key === "Escape" && d) {
1030
1033
  r();
1031
1034
  return;
1032
1035
  }
1033
- if (m.key !== "Tab")
1036
+ if (w.key !== "Tab")
1034
1037
  return;
1035
- const v = bo(T);
1036
- if (v.length === 0) {
1037
- m.preventDefault();
1038
+ const I = bo(f);
1039
+ if (I.length === 0) {
1040
+ w.preventDefault();
1038
1041
  return;
1039
1042
  }
1040
- const D = v[0], W = v[v.length - 1];
1041
- m.shiftKey ? document.activeElement === D && (m.preventDefault(), W.focus()) : document.activeElement === W && (m.preventDefault(), D.focus());
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());
1042
1045
  };
1043
- return document.addEventListener("keydown", k), () => {
1044
- document.removeEventListener("keydown", k), z?.focus();
1046
+ return document.addEventListener("keydown", z), () => {
1047
+ document.removeEventListener("keydown", z), T?.focus();
1045
1048
  };
1046
- }, [o, d, r, f]), f ? Co(
1049
+ }, [o, d, r, x]), x ? Co(
1047
1050
  /* @__PURE__ */ s(
1048
1051
  _r,
1049
1052
  {
1050
- $closing: w,
1051
- onClick: c ? r : void 0,
1052
- children: /* @__PURE__ */ C(
1053
+ $closing: C,
1054
+ onMouseDown: (f) => {
1055
+ h.current = f.target;
1056
+ },
1057
+ onClick: (f) => {
1058
+ c && h.current === f.currentTarget && r();
1059
+ },
1060
+ children: /* @__PURE__ */ k(
1053
1061
  jr,
1054
1062
  {
1055
- ref: g,
1063
+ ref: b,
1056
1064
  role: "dialog",
1057
1065
  "aria-modal": "true",
1058
- "aria-labelledby": b,
1059
- "aria-describedby": $,
1066
+ "aria-labelledby": $,
1067
+ "aria-describedby": g,
1060
1068
  $size: a,
1061
- $closing: w,
1069
+ $closing: C,
1062
1070
  tabIndex: -1,
1063
- onClick: (T) => T.stopPropagation(),
1071
+ onClick: (f) => f.stopPropagation(),
1064
1072
  children: [
1065
- /* @__PURE__ */ C(Ar, { children: [
1073
+ /* @__PURE__ */ k(Ar, { children: [
1066
1074
  n && /* @__PURE__ */ s(Rr, { id: y, children: n }),
1067
1075
  /* @__PURE__ */ s(Yr, { onClick: r, "aria-label": "Close modal", children: "×" })
1068
1076
  ] }),
@@ -1077,13 +1085,13 @@ function Io({
1077
1085
  ) : null;
1078
1086
  }
1079
1087
  Io.displayName = "Modal";
1080
- const qr = L`
1088
+ const qr = F`
1081
1089
  from { opacity: 0; transform: translateY(12px); }
1082
1090
  to { opacity: 1; transform: translateY(0); }
1083
- `, Gr = L`
1091
+ `, Gr = F`
1084
1092
  from { opacity: 0; transform: translateY(-12px); }
1085
1093
  to { opacity: 1; transform: translateY(0); }
1086
- `, Jr = L`
1094
+ `, Jr = F`
1087
1095
  from { opacity: 1; }
1088
1096
  to { opacity: 0; }
1089
1097
  `, Xr = i.div`
@@ -1197,7 +1205,7 @@ const qr = L`
1197
1205
  outline-offset: 2px;
1198
1206
  }
1199
1207
  `;
1200
- function Mo({
1208
+ function Do({
1201
1209
  open: o,
1202
1210
  onClose: r,
1203
1211
  message: n,
@@ -1205,28 +1213,28 @@ function Mo({
1205
1213
  duration: l = 4e3,
1206
1214
  position: a = "bottom-right"
1207
1215
  }) {
1208
- const [c, d] = M(o), [p, $] = M(!1);
1216
+ const [c, d] = D(o), [p, g] = D(!1);
1209
1217
  return j(() => {
1210
1218
  if (o)
1211
- d(!0), $(!1);
1219
+ d(!0), g(!1);
1212
1220
  else if (c) {
1213
- $(!0);
1214
- const g = setTimeout(() => {
1215
- d(!1), $(!1);
1221
+ g(!0);
1222
+ const b = setTimeout(() => {
1223
+ d(!1), g(!1);
1216
1224
  }, 200);
1217
1225
  return () => {
1218
- clearTimeout(g);
1226
+ clearTimeout(b);
1219
1227
  };
1220
1228
  }
1221
1229
  }, [o, c]), j(() => {
1222
1230
  if (!o || l === 0)
1223
1231
  return;
1224
- const g = setTimeout(r, l);
1232
+ const b = setTimeout(r, l);
1225
1233
  return () => {
1226
- clearTimeout(g);
1234
+ clearTimeout(b);
1227
1235
  };
1228
1236
  }, [o, l, r]), c ? Co(
1229
- /* @__PURE__ */ C(
1237
+ /* @__PURE__ */ k(
1230
1238
  Zr,
1231
1239
  {
1232
1240
  $position: a,
@@ -1243,10 +1251,10 @@ function Mo({
1243
1251
  document.body
1244
1252
  ) : null;
1245
1253
  }
1246
- Mo.displayName = "Toast";
1247
- const Do = ao(null);
1254
+ Do.displayName = "Toast";
1255
+ const Mo = ao(null);
1248
1256
  function yt({ children: o }) {
1249
- const [r, n] = M(null), e = V((a) => {
1257
+ const [r, n] = D(null), e = V((a) => {
1250
1258
  n({ ...a, id: Date.now() });
1251
1259
  }, []), l = lo(() => Object.assign((a) => e(a), {
1252
1260
  success: (a, c) => e({ ...c, message: a, variant: "success" }),
@@ -1254,10 +1262,10 @@ function yt({ children: o }) {
1254
1262
  warning: (a, c) => e({ ...c, message: a, variant: "warning" }),
1255
1263
  info: (a, c) => e({ ...c, message: a, variant: "info" })
1256
1264
  }), [e]);
1257
- return /* @__PURE__ */ C(Do.Provider, { value: { toast: l }, children: [
1265
+ return /* @__PURE__ */ k(Mo.Provider, { value: { toast: l }, children: [
1258
1266
  o,
1259
1267
  r && /* @__PURE__ */ s(
1260
- Mo,
1268
+ Do,
1261
1269
  {
1262
1270
  open: !0,
1263
1271
  onClose: () => n(null),
@@ -1271,7 +1279,7 @@ function yt({ children: o }) {
1271
1279
  ] });
1272
1280
  }
1273
1281
  function ht() {
1274
- const o = io(Do);
1282
+ const o = io(Mo);
1275
1283
  if (!o)
1276
1284
  throw new Error("useToast must be used within a ToastProvider");
1277
1285
  return o;
@@ -1316,7 +1324,7 @@ function ln({
1316
1324
  required: e,
1317
1325
  children: l
1318
1326
  }) {
1319
- const a = A(), c = `${a}-hint`, d = !!(r || n), p = typeof r == "string" ? r : void 0, $ = po.isValidElement(l) ? po.cloneElement(
1327
+ const a = A(), c = `${a}-hint`, d = !!(r || n), p = typeof r == "string" ? r : void 0, g = po.isValidElement(l) ? po.cloneElement(
1320
1328
  l,
1321
1329
  {
1322
1330
  id: a,
@@ -1324,12 +1332,12 @@ function ln({
1324
1332
  ...r && { "aria-invalid": !0 }
1325
1333
  }
1326
1334
  ) : l;
1327
- return /* @__PURE__ */ C(nn, { children: [
1328
- o && /* @__PURE__ */ C(tn, { htmlFor: a, children: [
1335
+ return /* @__PURE__ */ k(nn, { children: [
1336
+ o && /* @__PURE__ */ k(tn, { htmlFor: a, children: [
1329
1337
  o,
1330
1338
  e && /* @__PURE__ */ s(sn, { "aria-hidden": "true", children: " *" })
1331
1339
  ] }),
1332
- $,
1340
+ g,
1333
1341
  d && /* @__PURE__ */ s(en, { id: c, $error: !!r, children: p ?? n })
1334
1342
  ] });
1335
1343
  }
@@ -1340,83 +1348,83 @@ function wt({
1340
1348
  onSubmit: n,
1341
1349
  onError: e
1342
1350
  }) {
1343
- const [l, a] = M(o), [c, d] = M(
1351
+ const [l, a] = D(o), [c, d] = D(
1344
1352
  {}
1345
- ), [p, $] = M({}), [g, y] = M(!1), b = G(l);
1346
- b.current = l;
1347
- const f = V(
1348
- (m) => {
1353
+ ), [p, g] = D({}), [b, h] = D(!1), y = U(l);
1354
+ y.current = l;
1355
+ const $ = V(
1356
+ (z) => {
1349
1357
  if (!r)
1350
1358
  return {};
1351
- const v = r(m);
1359
+ const w = r(z);
1352
1360
  return Object.fromEntries(
1353
- Object.entries(v).filter(([, D]) => D !== void 0)
1361
+ Object.entries(w).filter(([, I]) => I !== void 0)
1354
1362
  );
1355
1363
  },
1356
1364
  [r]
1357
- ), x = G(p);
1365
+ ), x = U(p);
1358
1366
  x.current = p;
1359
- const w = V(
1360
- (m) => {
1361
- const { name: v, value: D } = m.target;
1362
- process.env.NODE_ENV !== "production" && !v && console.warn(
1367
+ const v = V(
1368
+ (z) => {
1369
+ const { name: w, value: I } = z.target;
1370
+ process.env.NODE_ENV !== "production" && !w && console.warn(
1363
1371
  "[useForm] handleChange: field is missing a `name` attribute — value will not be tracked."
1364
1372
  );
1365
- const W = { ...b.current, [v]: D };
1366
- a(W), x.current[v] && d(f(W));
1373
+ const W = { ...y.current, [w]: I };
1374
+ a(W), x.current[w] && d($(W));
1367
1375
  },
1368
- [f]
1369
- ), S = V(
1370
- (m) => {
1371
- const { name: v } = m.target;
1372
- process.env.NODE_ENV !== "production" && !v && console.warn(
1376
+ [$]
1377
+ ), C = V(
1378
+ (z) => {
1379
+ const { name: w } = z.target;
1380
+ process.env.NODE_ENV !== "production" && !w && console.warn(
1373
1381
  "[useForm] handleBlur: field is missing a `name` attribute — touched state will not be tracked."
1374
- ), $((D) => ({ ...D, [v]: !0 })), d(f(b.current));
1382
+ ), g((I) => ({ ...I, [w]: !0 })), d($(y.current));
1375
1383
  },
1376
- [f]
1377
- ), T = V(
1378
- (m) => {
1379
- m?.preventDefault();
1380
- const v = Object.keys(b.current).reduce(
1381
- (F, O) => ({ ...F, [O]: !0 }),
1384
+ [$]
1385
+ ), M = V(
1386
+ (z) => {
1387
+ z?.preventDefault();
1388
+ const w = Object.keys(y.current).reduce(
1389
+ (O, P) => ({ ...O, [P]: !0 }),
1382
1390
  {}
1383
1391
  );
1384
- $(v);
1385
- const D = f(b.current);
1386
- if (d(D), Object.keys(D).length > 0) {
1387
- e?.(D);
1392
+ g(w);
1393
+ const I = $(y.current);
1394
+ if (d(I), Object.keys(I).length > 0) {
1395
+ e?.(I);
1388
1396
  return;
1389
1397
  }
1390
1398
  (async () => {
1391
- y(!0);
1399
+ h(!0);
1392
1400
  try {
1393
- await n?.(b.current);
1401
+ await n?.(y.current);
1394
1402
  } finally {
1395
- y(!1);
1403
+ h(!1);
1396
1404
  }
1397
1405
  })();
1398
1406
  },
1399
- [f, n, e]
1400
- ), z = V((m, v) => {
1401
- a((D) => ({ ...D, [m]: v }));
1402
- }, []), I = V(
1403
- (m) => {
1404
- a(m ?? o), d({}), $({}), y(!1);
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);
1405
1413
  },
1406
1414
  [o]
1407
- ), k = Object.fromEntries(
1408
- Object.entries(c).filter(([m]) => p[m])
1415
+ ), S = Object.fromEntries(
1416
+ Object.entries(c).filter(([z]) => p[z])
1409
1417
  );
1410
1418
  return {
1411
1419
  values: l,
1412
- errors: k,
1420
+ errors: S,
1413
1421
  touched: p,
1414
- handleChange: w,
1415
- handleBlur: S,
1416
- handleSubmit: T,
1417
- setFieldValue: z,
1418
- reset: I,
1419
- isSubmitting: g
1422
+ handleChange: v,
1423
+ handleBlur: C,
1424
+ handleSubmit: M,
1425
+ setFieldValue: f,
1426
+ reset: T,
1427
+ isSubmitting: b
1420
1428
  };
1421
1429
  }
1422
1430
  const cn = i.div`
@@ -1510,24 +1518,24 @@ function wn({
1510
1518
  headerActions: c,
1511
1519
  accentColor: d
1512
1520
  }) {
1513
- const [p, $] = M(n), g = A(), y = e !== void 0, b = y ? e : p;
1514
- return /* @__PURE__ */ C(cn, { $accentColor: d, children: [
1515
- /* @__PURE__ */ C(
1521
+ const [p, g] = D(n), b = A(), h = e !== void 0, y = h ? e : p;
1522
+ return /* @__PURE__ */ k(cn, { $accentColor: d, children: [
1523
+ /* @__PURE__ */ k(
1516
1524
  dn,
1517
1525
  {
1518
1526
  type: "button",
1519
- $open: b,
1527
+ $open: y,
1520
1528
  $accentColor: d,
1521
- "aria-expanded": b,
1522
- "aria-controls": g,
1529
+ "aria-expanded": y,
1530
+ "aria-controls": b,
1523
1531
  onClick: () => {
1524
- const x = !b;
1525
- y || $(x), l?.(x);
1532
+ const x = !y;
1533
+ h || g(x), l?.(x);
1526
1534
  },
1527
1535
  children: [
1528
- /* @__PURE__ */ C(un, { children: [
1536
+ /* @__PURE__ */ k(un, { children: [
1529
1537
  /* @__PURE__ */ s(pn, { children: o }),
1530
- (a || c) && /* @__PURE__ */ C($n, { children: [
1538
+ (a || c) && /* @__PURE__ */ k($n, { children: [
1531
1539
  a && /* @__PURE__ */ s(fn, { children: a }),
1532
1540
  c && /* @__PURE__ */ s(gn, { onClick: (x) => x.stopPropagation(), children: c })
1533
1541
  ] })
@@ -1535,7 +1543,7 @@ function wn({
1535
1543
  /* @__PURE__ */ s(
1536
1544
  bn,
1537
1545
  {
1538
- $open: b,
1546
+ $open: y,
1539
1547
  $accentColor: d,
1540
1548
  "aria-hidden": "true",
1541
1549
  children: /* @__PURE__ */ s(zo, { size: 18, strokeWidth: 2.5 })
@@ -1544,11 +1552,11 @@ function wn({
1544
1552
  ]
1545
1553
  }
1546
1554
  ),
1547
- /* @__PURE__ */ s(xn, { $open: b, children: /* @__PURE__ */ s(yn, { id: g, role: "region", "aria-label": o, children: /* @__PURE__ */ s(hn, { children: r }) }) })
1555
+ /* @__PURE__ */ s(xn, { $open: y, children: /* @__PURE__ */ s(yn, { id: b, role: "region", "aria-label": o, children: /* @__PURE__ */ s(hn, { children: r }) }) })
1548
1556
  ] });
1549
1557
  }
1550
1558
  wn.displayName = "CollapsibleCard";
1551
- const mn = L`
1559
+ const mn = F`
1552
1560
  to { transform: rotate(360deg); }
1553
1561
  `, vn = {
1554
1562
  sm: "16px",
@@ -1600,19 +1608,19 @@ function Tn({
1600
1608
  defaultSort: n,
1601
1609
  onSortChange: e
1602
1610
  }) {
1603
- const l = r !== void 0, [a, c] = M(
1611
+ const l = r !== void 0, [a, c] = D(
1604
1612
  n ?? null
1605
- ), d = l ? r ?? null : a, p = (g) => {
1606
- const y = zn(d, g);
1607
- return l || c(y), e?.(y), y;
1608
- }, $ = lo(() => l || !d ? o : [...o].sort((g, y) => {
1609
- const b = g[d.key], f = y[d.key], x = b < f ? -1 : b > f ? 1 : 0;
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;
1610
1618
  return d.direction === "asc" ? x : -x;
1611
1619
  }), [o, d, l]);
1612
- return { activeSort: d, sortedData: $, handleSort: p };
1620
+ return { activeSort: d, sortedData: g, handleSort: p };
1613
1621
  }
1614
1622
  const In = 7, xo = 3, yo = 1;
1615
- function Mn(o, r) {
1623
+ function Dn(o, r) {
1616
1624
  if (r <= In)
1617
1625
  return Array.from({ length: r }, (e, l) => l + 1);
1618
1626
  const n = [1];
@@ -1621,7 +1629,7 @@ function Mn(o, r) {
1621
1629
  n.push(e);
1622
1630
  return o < r - xo + 1 && n.push("..."), n.push(r), n;
1623
1631
  }
1624
- function Dn({
1632
+ function Mn({
1625
1633
  data: o,
1626
1634
  pageSize: r,
1627
1635
  page: n,
@@ -1629,15 +1637,15 @@ function Dn({
1629
1637
  totalRows: l,
1630
1638
  onPageChange: a
1631
1639
  }) {
1632
- const c = n !== void 0, [d, p] = M(e ?? 1), $ = c ? n : d, g = (w) => {
1633
- c || p(w), a?.(w);
1634
- }, y = c || l !== void 0, b = l ?? o.length, f = r ? Math.max(1, Math.ceil(b / r)) : 1, x = lo(() => {
1635
- if (!r || y)
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)
1636
1644
  return o;
1637
- const w = ($ - 1) * r;
1638
- return o.slice(w, w + r);
1639
- }, [o, r, $, y]);
1640
- return { activePage: $, totalPages: f, displayData: x, handlePageChange: g };
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 };
1641
1649
  }
1642
1650
  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`
1643
1651
  width: 100%;
@@ -1793,7 +1801,7 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
1793
1801
  padding: ${({ theme: o }) => `${o.spacing[4]} ${o.spacing[3]}`};
1794
1802
  font-size: ${({ theme: o }) => o.fontSizes.sm};
1795
1803
  border-bottom: none;
1796
- `, _n = L`
1804
+ `, _n = F`
1797
1805
  0% { background-position: -400px 0; }
1798
1806
  100% { background-position: 400px 0; }
1799
1807
  `, jn = i(Oo)``, An = i.div`
@@ -1877,88 +1885,88 @@ function Un({
1877
1885
  stickyHeader: c,
1878
1886
  caption: d,
1879
1887
  emptyMessage: p = "No data",
1880
- loading: $,
1881
- sort: g,
1882
- defaultSort: y,
1883
- onSortChange: b,
1884
- pageSize: f,
1888
+ loading: g,
1889
+ sort: b,
1890
+ defaultSort: h,
1891
+ onSortChange: y,
1892
+ pageSize: $,
1885
1893
  page: x,
1886
- defaultPage: w,
1887
- totalRows: S,
1888
- onPageChange: T,
1889
- onChange: z,
1890
- onRowClick: I,
1891
- borderColor: k,
1892
- headerColor: m,
1893
- rowColor: v,
1894
- stripeColor: D,
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,
1895
1903
  className: W,
1896
- style: F
1904
+ style: O
1897
1905
  }) {
1898
1906
  const {
1899
- activeSort: O,
1900
- sortedData: U,
1901
- handleSort: P
1907
+ activeSort: P,
1908
+ sortedData: K,
1909
+ handleSort: N
1902
1910
  } = Tn({
1903
1911
  data: r,
1904
- sort: g,
1905
- defaultSort: y,
1906
- onSortChange: b
1912
+ sort: b,
1913
+ defaultSort: h,
1914
+ onSortChange: y
1907
1915
  }), {
1908
- activePage: N,
1909
- totalPages: K,
1916
+ activePage: E,
1917
+ totalPages: q,
1910
1918
  displayData: u,
1911
1919
  handlePageChange: B
1912
- } = Dn({
1913
- data: U,
1914
- pageSize: f,
1920
+ } = Mn({
1921
+ data: K,
1922
+ pageSize: $,
1915
1923
  page: x,
1916
- defaultPage: w,
1917
- totalRows: S,
1918
- onPageChange: T
1919
- }), R = (h) => {
1920
- const E = P(h);
1921
- z?.({ sort: E, page: N });
1922
- }, Y = (h) => {
1923
- B(h), z?.({ sort: O, page: h });
1924
- }, Z = (h, E) => String(n ? h[n] : E), Q = !$ && u.length === 0, Eo = f ?? Yn;
1925
- return /* @__PURE__ */ C(
1924
+ defaultPage: v,
1925
+ totalRows: C,
1926
+ onPageChange: M
1927
+ }), R = (m) => {
1928
+ 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;
1933
+ return /* @__PURE__ */ k(
1926
1934
  Wn,
1927
1935
  {
1928
- $borderColor: k,
1936
+ $borderColor: S,
1929
1937
  $stickyHeader: c,
1930
1938
  className: W,
1931
- style: F,
1939
+ style: O,
1932
1940
  children: [
1933
- /* @__PURE__ */ C(On, { $size: e, children: [
1941
+ /* @__PURE__ */ k(On, { $size: e, children: [
1934
1942
  d && /* @__PURE__ */ s("caption", { children: d }),
1935
1943
  /* @__PURE__ */ s(
1936
1944
  Pn,
1937
1945
  {
1938
- $headerColor: m,
1939
- $borderColor: k,
1946
+ $headerColor: z,
1947
+ $borderColor: S,
1940
1948
  $stickyHeader: c,
1941
- children: /* @__PURE__ */ s(X, { children: o.map((h) => /* @__PURE__ */ s(
1949
+ children: /* @__PURE__ */ s(X, { children: o.map((m) => /* @__PURE__ */ s(
1942
1950
  Ln,
1943
1951
  {
1944
1952
  $size: e,
1945
1953
  $bordered: a,
1946
1954
  scope: "col",
1947
- style: h.width ? { width: h.width } : void 0,
1948
- children: h.sortable ? /* @__PURE__ */ C(
1955
+ style: m.width ? { width: m.width } : void 0,
1956
+ children: m.sortable ? /* @__PURE__ */ k(
1949
1957
  Fn,
1950
1958
  {
1951
1959
  type: "button",
1952
- onClick: () => R(h.key),
1953
- "aria-label": `Sort by ${h.header}${O?.key === h.key ? `, ${O.direction}ending` : ""}`,
1960
+ onClick: () => R(m.key),
1961
+ "aria-label": `Sort by ${m.header}${P?.key === m.key ? `, ${P.direction}ending` : ""}`,
1954
1962
  children: [
1955
- h.header,
1956
- /* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(O, h.key) })
1963
+ m.header,
1964
+ /* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(P, m.key) })
1957
1965
  ]
1958
1966
  }
1959
- ) : h.header
1967
+ ) : m.header
1960
1968
  },
1961
- h.key
1969
+ m.key
1962
1970
  )) })
1963
1971
  }
1964
1972
  ),
@@ -1966,77 +1974,77 @@ function Un({
1966
1974
  Nn,
1967
1975
  {
1968
1976
  $striped: l,
1969
- $rowColor: v,
1970
- $stripeColor: D,
1971
- children: $ ? Array.from({ length: Eo }).map((h, E) => /* @__PURE__ */ s(X, { children: o.map((uo) => /* @__PURE__ */ s(
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(
1972
1980
  jn,
1973
1981
  {
1974
1982
  $size: e,
1975
1983
  $bordered: a,
1976
- $borderColor: k,
1984
+ $borderColor: S,
1977
1985
  children: /* @__PURE__ */ s(An, {})
1978
1986
  },
1979
1987
  uo.key
1980
- )) }, E)) : Q ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(Vn, { colSpan: o.length, children: p }) }) : u.map((h, E) => /* @__PURE__ */ s(
1981
- I ? En : X,
1988
+ )) }, L)) : Q ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(Vn, { colSpan: o.length, children: p }) }) : u.map((m, L) => /* @__PURE__ */ s(
1989
+ T ? En : X,
1982
1990
  {
1983
- onClick: I ? () => I(h) : void 0,
1984
- $accentColor: I ? k : void 0,
1985
- children: o.map((q) => /* @__PURE__ */ s(
1991
+ onClick: T ? () => T(m) : void 0,
1992
+ $accentColor: T ? S : void 0,
1993
+ children: o.map((G) => /* @__PURE__ */ s(
1986
1994
  Oo,
1987
1995
  {
1988
1996
  $size: e,
1989
1997
  $bordered: a,
1990
- $borderColor: k,
1991
- children: q.render ? q.render(h[q.key], h, E) : String(h[q.key] ?? "") || " "
1998
+ $borderColor: S,
1999
+ children: G.render ? G.render(m[G.key], m, L) : String(m[G.key] ?? "") || " "
1992
2000
  },
1993
- q.key
2001
+ G.key
1994
2002
  ))
1995
2003
  },
1996
- Z(h, E)
2004
+ Z(m, L)
1997
2005
  ))
1998
2006
  }
1999
2007
  )
2000
2008
  ] }),
2001
- f && K > 1 && /* @__PURE__ */ C(Rn, { children: [
2009
+ $ && q > 1 && /* @__PURE__ */ k(Rn, { children: [
2002
2010
  /* @__PURE__ */ s(
2003
2011
  no,
2004
2012
  {
2005
2013
  type: "button",
2006
- onClick: () => Y(N - 1),
2007
- disabled: N <= 1,
2014
+ onClick: () => Y(E - 1),
2015
+ disabled: E <= 1,
2008
2016
  "aria-label": "Previous page",
2009
2017
  children: "←"
2010
2018
  }
2011
2019
  ),
2012
- Mn(N, K).map(
2013
- (h, E) => h === "..." ? /* @__PURE__ */ s(
2020
+ Dn(E, q).map(
2021
+ (m, L) => m === "..." ? /* @__PURE__ */ s(
2014
2022
  "span",
2015
2023
  {
2016
2024
  "aria-hidden": "true",
2017
2025
  style: { padding: "0 4px" },
2018
2026
  children: "…"
2019
2027
  },
2020
- `e${E}`
2028
+ `e${L}`
2021
2029
  ) : /* @__PURE__ */ s(
2022
2030
  no,
2023
2031
  {
2024
2032
  type: "button",
2025
- $active: h === N,
2026
- onClick: () => Y(h),
2027
- "aria-label": `Page ${h}`,
2028
- "aria-current": h === N ? "page" : void 0,
2029
- children: h
2033
+ $active: m === E,
2034
+ onClick: () => Y(m),
2035
+ "aria-label": `Page ${m}`,
2036
+ "aria-current": m === E ? "page" : void 0,
2037
+ children: m
2030
2038
  },
2031
- h
2039
+ m
2032
2040
  )
2033
2041
  ),
2034
2042
  /* @__PURE__ */ s(
2035
2043
  no,
2036
2044
  {
2037
2045
  type: "button",
2038
- onClick: () => Y(N + 1),
2039
- disabled: N >= K,
2046
+ onClick: () => Y(E + 1),
2047
+ disabled: E >= q,
2040
2048
  "aria-label": "Next page",
2041
2049
  children: "→"
2042
2050
  }
@@ -2051,7 +2059,7 @@ function mt({
2051
2059
  defaultSort: o,
2052
2060
  defaultPage: r = 1
2053
2061
  } = {}) {
2054
- const [n, e] = M(o ?? null), [l, a] = M(r);
2062
+ const [n, e] = D(o ?? null), [l, a] = D(r);
2055
2063
  return { sort: n, page: l, onSortChange: (p) => {
2056
2064
  e(p), a(1);
2057
2065
  }, onPageChange: (p) => {
@@ -2123,7 +2131,7 @@ function Po({
2123
2131
  title: r,
2124
2132
  size: c,
2125
2133
  closeOnBackdrop: !1,
2126
- footer: /* @__PURE__ */ C(Lo, { children: [
2134
+ footer: /* @__PURE__ */ k(Lo, { children: [
2127
2135
  /* @__PURE__ */ s(so, { variant: "outline", onClick: p, children: l }),
2128
2136
  a === "danger" ? /* @__PURE__ */ s(qn, { type: "button", onClick: d, children: e }) : /* @__PURE__ */ s(so, { variant: "primary", onClick: d, children: e })
2129
2137
  ] }),
@@ -2134,14 +2142,14 @@ function Po({
2134
2142
  Po.displayName = "ConfirmDialog";
2135
2143
  const No = ao(null);
2136
2144
  function vt({ children: o }) {
2137
- const [r, n] = M(null), e = V((c) => new Promise((d) => {
2145
+ const [r, n] = D(null), e = V((c) => new Promise((d) => {
2138
2146
  n({ ...c, resolve: d });
2139
2147
  }), []), l = () => {
2140
2148
  r?.resolve(!0), n(null);
2141
2149
  }, a = () => {
2142
2150
  r?.resolve(!1), n(null);
2143
2151
  };
2144
- return /* @__PURE__ */ C(No.Provider, { value: { confirm: e }, children: [
2152
+ return /* @__PURE__ */ k(No.Provider, { value: { confirm: e }, children: [
2145
2153
  o,
2146
2154
  r && /* @__PURE__ */ s(
2147
2155
  Po,
@@ -2430,65 +2438,65 @@ function pt({
2430
2438
  minDate: c,
2431
2439
  maxDate: d,
2432
2440
  formatDate: p,
2433
- id: $,
2434
- error: g
2441
+ id: g,
2442
+ error: b
2435
2443
  }) {
2436
- const y = A(), b = $ ?? y, f = /* @__PURE__ */ new Date(), [x, w] = M(!1), [S, T] = M(
2437
- () => (o ?? f).getFullYear()
2438
- ), [z, I] = M(() => (o ?? f).getMonth()), k = G(null);
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);
2439
2447
  j(() => {
2440
2448
  if (!x) return;
2441
2449
  const u = (B) => {
2442
- k.current && !k.current.contains(B.target) && w(!1);
2450
+ S.current && !S.current.contains(B.target) && v(!1);
2443
2451
  };
2444
2452
  return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
2445
2453
  }, [x]), j(() => {
2446
- o && (T(o.getFullYear()), I(o.getMonth()));
2454
+ o && (M(o.getFullYear()), T(o.getMonth()));
2447
2455
  }, [o]);
2448
- const m = o ? p ? p(o) : dt(o) : "", v = (u) => {
2449
- r?.(new Date(S, z, u)), w(!1);
2450
- }, D = (u) => {
2456
+ const z = o ? p ? p(o) : dt(o) : "", w = (u) => {
2457
+ r?.(new Date(C, f, u)), v(!1);
2458
+ }, I = (u) => {
2451
2459
  u.stopPropagation(), r?.(null);
2452
2460
  }, W = () => {
2453
- z === 0 ? (I(11), T((u) => u - 1)) : I((u) => u - 1);
2454
- }, F = () => {
2455
- z === 11 ? (I(0), T((u) => u + 1)) : I((u) => u + 1);
2456
- }, O = mo(S, z), U = lt(S, z), P = [], N = mo(
2457
- z === 0 ? S - 1 : S,
2458
- z === 0 ? 11 : z - 1
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
2459
2467
  );
2460
- for (let u = U - 1; u >= 0; u--)
2461
- P.push({ day: N - u, currentMonth: !1 });
2462
- for (let u = 1; u <= O; u++)
2463
- P.push({ day: u, currentMonth: !0 });
2464
- const K = 42 - P.length;
2465
- for (let u = 1; u <= K; u++)
2466
- P.push({ day: u, currentMonth: !1 });
2467
- return /* @__PURE__ */ C(Gn, { ref: k, children: [
2468
- /* @__PURE__ */ C(
2468
+ for (let u = K - 1; u >= 0; u--)
2469
+ N.push({ day: E - u, currentMonth: !1 });
2470
+ for (let u = 1; u <= P; u++)
2471
+ N.push({ day: u, currentMonth: !0 });
2472
+ const q = 42 - N.length;
2473
+ for (let u = 1; u <= q; u++)
2474
+ N.push({ day: u, currentMonth: !1 });
2475
+ return /* @__PURE__ */ k(Gn, { ref: S, children: [
2476
+ /* @__PURE__ */ k(
2469
2477
  Jn,
2470
2478
  {
2471
- id: b,
2479
+ id: y,
2472
2480
  $size: e,
2473
- $error: !!g,
2481
+ $error: !!b,
2474
2482
  $disabled: l,
2475
2483
  role: "combobox",
2476
2484
  "aria-haspopup": "true",
2477
2485
  "aria-expanded": x,
2478
2486
  tabIndex: l ? -1 : 0,
2479
2487
  onClick: () => {
2480
- l || w((u) => !u);
2488
+ l || v((u) => !u);
2481
2489
  },
2482
2490
  onKeyDown: (u) => {
2483
- (u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(), w((B) => !B)), u.key === "Escape" && w(!1);
2491
+ (u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(), v((B) => !B)), u.key === "Escape" && v(!1);
2484
2492
  },
2485
2493
  children: [
2486
- /* @__PURE__ */ s(Xn, { $hasValue: !!o, children: m || n }),
2494
+ /* @__PURE__ */ s(Xn, { $hasValue: !!o, children: z || n }),
2487
2495
  a && o ? /* @__PURE__ */ s(
2488
2496
  Qn,
2489
2497
  {
2490
2498
  type: "button",
2491
- onClick: D,
2499
+ onClick: I,
2492
2500
  "aria-label": "Clear date",
2493
2501
  children: /* @__PURE__ */ s(co, { size: 14 })
2494
2502
  }
@@ -2496,9 +2504,9 @@ function pt({
2496
2504
  ]
2497
2505
  }
2498
2506
  ),
2499
- typeof g == "string" && /* @__PURE__ */ s(ot, { $error: !0, children: g }),
2500
- x && /* @__PURE__ */ C(rt, { role: "dialog", "aria-label": "Calendar", children: [
2501
- /* @__PURE__ */ C(nt, { children: [
2507
+ typeof b == "string" && /* @__PURE__ */ s(ot, { $error: !0, children: b }),
2508
+ x && /* @__PURE__ */ k(rt, { role: "dialog", "aria-label": "Calendar", children: [
2509
+ /* @__PURE__ */ k(nt, { children: [
2502
2510
  /* @__PURE__ */ s(
2503
2511
  ho,
2504
2512
  {
@@ -2508,24 +2516,24 @@ function pt({
2508
2516
  children: /* @__PURE__ */ s(xr, { size: 16 })
2509
2517
  }
2510
2518
  ),
2511
- /* @__PURE__ */ C(tt, { children: [
2512
- it[z],
2519
+ /* @__PURE__ */ k(tt, { children: [
2520
+ it[f],
2513
2521
  " ",
2514
- S
2522
+ C
2515
2523
  ] }),
2516
2524
  /* @__PURE__ */ s(
2517
2525
  ho,
2518
2526
  {
2519
2527
  type: "button",
2520
- onClick: F,
2528
+ onClick: O,
2521
2529
  "aria-label": "Next month",
2522
2530
  children: /* @__PURE__ */ s(hr, { size: 16 })
2523
2531
  }
2524
2532
  )
2525
2533
  ] }),
2526
- /* @__PURE__ */ C(st, { children: [
2534
+ /* @__PURE__ */ k(st, { children: [
2527
2535
  at.map((u) => /* @__PURE__ */ s(et, { children: u }, u)),
2528
- P.map((u, B) => {
2536
+ N.map((u, B) => {
2529
2537
  if (!u.currentMonth)
2530
2538
  return /* @__PURE__ */ s(
2531
2539
  wo,
@@ -2540,7 +2548,7 @@ function pt({
2540
2548
  },
2541
2549
  B
2542
2550
  );
2543
- const R = new Date(S, z, u.day), Y = o ? vo(R, o) : !1, Z = vo(R, f), Q = ct(R, c, d);
2551
+ const R = new Date(C, f, u.day), Y = o ? vo(R, o) : !1, Z = vo(R, $), Q = ct(R, c, d);
2544
2552
  return /* @__PURE__ */ s(
2545
2553
  wo,
2546
2554
  {
@@ -2551,7 +2559,7 @@ function pt({
2551
2559
  disabled: Q,
2552
2560
  "aria-label": ut(R),
2553
2561
  "aria-pressed": Y,
2554
- onClick: () => v(u.day),
2562
+ onClick: () => w(u.day),
2555
2563
  children: u.day
2556
2564
  },
2557
2565
  B
@@ -2641,7 +2649,7 @@ export {
2641
2649
  Po as ConfirmDialog,
2642
2650
  vt as ConfirmProvider,
2643
2651
  pt as DatePicker,
2644
- Dr as Editable,
2652
+ Mr as Editable,
2645
2653
  Er as Field,
2646
2654
  an as Form,
2647
2655
  ln as FormField,
@@ -2654,7 +2662,7 @@ export {
2654
2662
  Un as Table,
2655
2663
  or as Textarea,
2656
2664
  St as ThemeProvider,
2657
- Mo as Toast,
2665
+ Do as Toast,
2658
2666
  yt as ToastProvider,
2659
2667
  Ct as createNeoBrutalTheme,
2660
2668
  eo as neoBrutalTheme,