@mateosuarezdev/react-ui 1.0.7 → 1.0.13

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,12 +1,12 @@
1
1
  import { jsx as f, jsxs as w, Fragment as Te } from "react/jsx-runtime";
2
- import { useRef as N, useEffect as j, useState as L, useSyncExternalStore as Ke, useCallback as K, useId as ve, forwardRef as H, memo as Be, useContext as xe, createContext as we } from "react";
2
+ import { useRef as N, useEffect as I, useState as D, useSyncExternalStore as Ke, useCallback as K, useId as ve, forwardRef as H, memo as Be, useContext as xe, createContext as we } from "react";
3
3
  import { createPortal as ye } from "react-dom";
4
4
  import { clsx as Ve } from "clsx";
5
5
  import { twMerge as Xe } from "tailwind-merge";
6
6
  import { atom as Ue } from "@mateosuarezdev/atoms";
7
- import { appendErrors as ke, FormProvider as Ze, useForm as Pe, useFormContext as W, Controller as R } from "react-hook-form";
7
+ import { appendErrors as ke, FormProvider as Ze, useForm as Pe, useFormContext as R, Controller as W } from "react-hook-form";
8
8
  import { validateFieldsNatively as me, toNestErrors as be } from "@hookform/resolvers";
9
- import { Check as Ne, Minus as Ye, DollarSign as qe, CheckIcon as J, EyeOffIcon as Ge, Eye as Je, XIcon as Qe, ChevronDownIcon as He, X as We, Plus as Re } from "lucide-react";
9
+ import { Check as Ne, Minus as Ye, DollarSign as qe, CheckIcon as J, EyeOffIcon as Ge, Eye as Je, XIcon as Qe, ChevronDownIcon as He, X as Re, Plus as We } from "lucide-react";
10
10
  import { AnimatePresence as et, motion as tt } from "framer-motion";
11
11
  const p = (...e) => Xe(Ve(e));
12
12
  function ae(e, n = 100) {
@@ -115,7 +115,7 @@ const Q = (e) => {
115
115
  deps: i = []
116
116
  } = {}) => {
117
117
  const l = N(null);
118
- return j(() => {
118
+ return I(() => {
119
119
  if (!l.current || !t) return;
120
120
  let s = !1;
121
121
  const a = ae(() => {
@@ -138,8 +138,8 @@ const Q = (e) => {
138
138
  enabled: r = !0,
139
139
  deps: t = []
140
140
  } = {}) => {
141
- const i = N(null), [l, s] = L(null);
142
- return j(() => {
141
+ const i = N(null), [l, s] = D(null);
142
+ return I(() => {
143
143
  if (!i.current || !r) return;
144
144
  let o = !1;
145
145
  const c = ae(() => {
@@ -239,7 +239,7 @@ const pe = ae(() => {
239
239
  le.set(window.innerWidth > 1024);
240
240
  });
241
241
  typeof window < "u" && (se && (window.removeEventListener("resize", pe), se = !1), window.addEventListener("resize", pe), se = !0);
242
- const lt = () => (j(() => {
242
+ const lt = () => (I(() => {
243
243
  le.set(window.innerWidth > 1024);
244
244
  }, []), ot(le));
245
245
  function it(...e) {
@@ -290,7 +290,7 @@ const at = (e = !0, n) => {
290
290
  onOpen: o,
291
291
  onClose: a
292
292
  } = {}) => {
293
- const [c, u] = L(!1), [d, b] = L({
293
+ const [c, u] = D(!1), [d, b] = D({
294
294
  width: 192,
295
295
  height: 300
296
296
  }), m = N(null), g = N(null), v = N({
@@ -320,7 +320,7 @@ const at = (e = !0, n) => {
320
320
  },
321
321
  [v.current, d, n, r]
322
322
  );
323
- j(() => {
323
+ I(() => {
324
324
  if (!c || !e || (x.current = document.getElementById(e), !x.current)) return;
325
325
  c && O();
326
326
  const E = () => {
@@ -437,7 +437,7 @@ const at = (e = !0, n) => {
437
437
  };
438
438
  function ar(e) {
439
439
  const n = N(null);
440
- return j(() => {
440
+ return I(() => {
441
441
  const r = (t) => {
442
442
  n.current && !n.current.contains(t.target) && e();
443
443
  };
@@ -452,7 +452,7 @@ function cr(e, n = {}) {
452
452
  events: t = ["mousedown", "touchstart"],
453
453
  excludeRefs: i = []
454
454
  } = n, l = N(null);
455
- return j(() => {
455
+ return I(() => {
456
456
  if (!r) return;
457
457
  const s = (o) => {
458
458
  const a = o.target;
@@ -470,7 +470,7 @@ function cr(e, n = {}) {
470
470
  }, [e, r, t, i]), l;
471
471
  }
472
472
  function ft(e, n, r = !0) {
473
- j(() => {
473
+ I(() => {
474
474
  if (!r) return;
475
475
  const t = (i) => {
476
476
  e.current && !e.current.contains(i.target) && n(i);
@@ -480,6 +480,21 @@ function ft(e, n, r = !0) {
480
480
  };
481
481
  }, [e, n, r]);
482
482
  }
483
+ function ur(e, { target: n = window, event: r = "keydown", enabled: t } = {}) {
484
+ const i = N(e);
485
+ I(() => {
486
+ i.current = e;
487
+ }, [e]), I(() => {
488
+ if (!t) return;
489
+ const l = (s) => {
490
+ const o = s.key, a = i.current[o];
491
+ a && a(s);
492
+ };
493
+ return n.addEventListener(r, l), () => {
494
+ n.removeEventListener(r, l);
495
+ };
496
+ }, [n, r, t]);
497
+ }
483
498
  const dt = "relative shrink-0 select-none transition outline-none duration-200 ease-out focus:ring-border-brand-light flex items-center justify-center cursor-pointer", ht = {
484
499
  xs: "text-xs px-1 gap-x-0.5 py-1",
485
500
  sm: "text-sm px-2.5 gap-x-1 py-1.5",
@@ -553,7 +568,7 @@ const dt = "relative shrink-0 select-none transition outline-none duration-200 e
553
568
  type: b = "button",
554
569
  ...m
555
570
  }, g) => {
556
- const [v, x] = L(!1), A = ($) => {
571
+ const [v, x] = D(!1), A = ($) => {
557
572
  i === "enabled" && (d ? (x(!0), l && l($), setTimeout(() => x(!1), 1e3)) : l && l($));
558
573
  }, { ref: F, ripple: O } = at(
559
574
  a,
@@ -585,7 +600,7 @@ const dt = "relative shrink-0 select-none transition outline-none duration-200 e
585
600
  }
586
601
  );
587
602
  ie.displayName = "Button";
588
- const ur = ({ className: e }) => /* @__PURE__ */ f("div", { className: p("w-full h-px bg-base-4", e) }), xt = ({
603
+ const fr = ({ className: e }) => /* @__PURE__ */ f("div", { className: p("w-full h-px bg-base-4", e) }), xt = ({
589
604
  children: e,
590
605
  size: n = 24,
591
606
  strokeWidth: r = 2,
@@ -757,7 +772,7 @@ function zt(e, n) {
757
772
  }
758
773
  return r;
759
774
  }
760
- function Dt(e, n, r) {
775
+ function Lt(e, n, r) {
761
776
  if (r === void 0 && (r = {}), (function(t) {
762
777
  return "_def" in t && typeof t._def == "object" && "typeName" in t._def;
763
778
  })(e)) return function(t, i, l) {
@@ -796,7 +811,7 @@ function Dt(e, n, r) {
796
811
  };
797
812
  throw new Error("Invalid input: not a Zod schema");
798
813
  }
799
- function fr({
814
+ function dr({
800
815
  methods: e,
801
816
  onSubmit: n,
802
817
  onError: r,
@@ -812,7 +827,7 @@ function fr({
812
827
  l
813
828
  ),
814
829
  onSubmit: e.handleSubmit(
815
- (s) => n(s),
830
+ (s) => n(s, e),
816
831
  (s) => {
817
832
  i && console.log(s), r?.(s);
818
833
  }
@@ -821,9 +836,9 @@ function fr({
821
836
  }
822
837
  ) });
823
838
  }
824
- function dr(e, n) {
839
+ function hr(e, n) {
825
840
  return Pe({
826
- resolver: Dt(e),
841
+ resolver: Lt(e),
827
842
  defaultValues: n
828
843
  });
829
844
  }
@@ -832,7 +847,7 @@ const G = {
832
847
  checked: "bg-brand lg:hover:bg-brand-hover text-brand-text",
833
848
  uncheckedDisabled: "bg-base-3 border-base-4",
834
849
  checkedDisabled: "bg-base-3 border-base-4 text-base-10"
835
- }, Lt = H(
850
+ }, Dt = H(
836
851
  ({
837
852
  checked: e = !1,
838
853
  onCheckedChange: n,
@@ -924,11 +939,11 @@ const G = {
924
939
  ] });
925
940
  }
926
941
  );
927
- Lt.displayName = "Checkbox";
928
- const Mt = {
942
+ Dt.displayName = "Checkbox";
943
+ const It = {
929
944
  solid: "bg-base-3 border border-base-4 drop-shadow-sm dark-theme:drop-shadow-none",
930
945
  outline: "border border-base-6"
931
- }, It = {
946
+ }, Mt = {
932
947
  brand: "ring-1 ring-brand",
933
948
  solid: "ring-1 ring-base-6"
934
949
  }, ze = H(
@@ -951,8 +966,8 @@ const Mt = {
951
966
  value: v,
952
967
  ...x
953
968
  }, A) => {
954
- const F = N(null), O = N(!1), [S, $] = L(!1), [E, z] = L(!1), _ = g === "password", B = _ && S ? "text" : c ? "number" : g, U = v !== "" && v !== null && v !== void 0;
955
- return j(() => {
969
+ const F = N(null), O = N(!1), [S, $] = D(!1), [E, z] = D(!1), _ = g === "password", B = _ && S ? "text" : c ? "number" : g, U = v !== "" && v !== null && v !== void 0;
970
+ return I(() => {
956
971
  if (!O.current) {
957
972
  O.current = !0;
958
973
  return;
@@ -971,10 +986,10 @@ const Mt = {
971
986
  {
972
987
  className: p(
973
988
  "rounded-6 transition cursor-text relative",
974
- Mt[t],
989
+ It[t],
975
990
  {
976
991
  "pt-[22px] pb-1.5": r === "floating",
977
- [It[i]]: !o && E,
992
+ [Mt[i]]: !o && E,
978
993
  "bg-red-4 text-red-9": !!o,
979
994
  "ring-1 ring-red-9": !!o && E
980
995
  },
@@ -1072,14 +1087,14 @@ const Mt = {
1072
1087
  }
1073
1088
  );
1074
1089
  ze.displayName = "Input";
1075
- const hr = ({
1090
+ const mr = ({
1076
1091
  name: e,
1077
1092
  customRead: n,
1078
1093
  customSet: r,
1079
1094
  withNullSet: t = !0,
1080
1095
  ...i
1081
1096
  }) => {
1082
- const { control: l } = W(), s = K(
1097
+ const { control: l } = R(), s = K(
1083
1098
  (a) => n ? n(a) : a === null ? Ce(a) : a,
1084
1099
  [n]
1085
1100
  ), o = K(
@@ -1087,7 +1102,7 @@ const hr = ({
1087
1102
  [r]
1088
1103
  );
1089
1104
  return l ? /* @__PURE__ */ f(
1090
- R,
1105
+ W,
1091
1106
  {
1092
1107
  name: e,
1093
1108
  control: l,
@@ -1110,7 +1125,7 @@ const hr = ({
1110
1125
  }, jt = {
1111
1126
  brand: "ring-1 ring-brand",
1112
1127
  solid: "ring-1 ring-base-6"
1113
- }, De = H(
1128
+ }, Le = H(
1114
1129
  ({
1115
1130
  label: e,
1116
1131
  labelPosition: n = "default",
@@ -1122,7 +1137,7 @@ const hr = ({
1122
1137
  rows: o = 3,
1123
1138
  ...a
1124
1139
  }, c) => {
1125
- const [u, d] = L(!1), b = s !== "" && s !== null && s !== void 0;
1140
+ const [u, d] = D(!1), b = s !== "" && s !== null && s !== void 0;
1126
1141
  return /* @__PURE__ */ w("div", { className: "relative", children: [
1127
1142
  n === "default" ? /* @__PURE__ */ f(
1128
1143
  "label",
@@ -1186,14 +1201,14 @@ const hr = ({
1186
1201
  ] });
1187
1202
  }
1188
1203
  );
1189
- De.displayName = "TextArea";
1190
- const mr = ({
1204
+ Le.displayName = "TextArea";
1205
+ const br = ({
1191
1206
  name: e,
1192
1207
  customRead: n,
1193
1208
  customSet: r,
1194
1209
  ...t
1195
1210
  }) => {
1196
- const { control: i } = W(), l = K(
1211
+ const { control: i } = R(), l = K(
1197
1212
  (o) => n ? n(o) : o === null ? Ce(o) : o,
1198
1213
  [n]
1199
1214
  ), s = K(
@@ -1201,13 +1216,13 @@ const mr = ({
1201
1216
  [r]
1202
1217
  );
1203
1218
  return i ? /* @__PURE__ */ f(
1204
- R,
1219
+ W,
1205
1220
  {
1206
1221
  name: e,
1207
1222
  control: i,
1208
1223
  render: ({ field: o, fieldState: a }) => /* @__PURE__ */ w("div", { children: [
1209
1224
  /* @__PURE__ */ f(
1210
- De,
1225
+ Le,
1211
1226
  {
1212
1227
  value: l(o.value),
1213
1228
  onChange: (c) => o.onChange(s(c.target.value)),
@@ -1235,14 +1250,14 @@ const mr = ({
1235
1250
  maxTags: a,
1236
1251
  validateTag: c
1237
1252
  }) => {
1238
- const [u, d] = L(""), [b, m] = L(!1), [g, v] = L(null), x = N(null), A = N(null), F = N([]), O = t.length > 0, S = N(
1253
+ const [u, d] = D(""), [b, m] = D(!1), [g, v] = D(null), x = N(null), A = N(null), F = N([]), O = t.length > 0, S = N(
1239
1254
  `taginput-${Math.random().toString(36).substr(2, 9)}`
1240
1255
  ).current, $ = N(
1241
1256
  `label-${Math.random().toString(36).substr(2, 9)}`
1242
1257
  ).current, E = N(
1243
1258
  `error-${Math.random().toString(36).substr(2, 9)}`
1244
1259
  ).current;
1245
- j(() => {
1260
+ I(() => {
1246
1261
  F.current = F.current.slice(0, t.length);
1247
1262
  }, [t.length]);
1248
1263
  const z = (k) => {
@@ -1258,11 +1273,11 @@ const mr = ({
1258
1273
  return;
1259
1274
  }
1260
1275
  if (c) {
1261
- const I = c(C);
1262
- if (typeof I == "string") {
1263
- v(I);
1276
+ const j = c(C);
1277
+ if (typeof j == "string") {
1278
+ v(j);
1264
1279
  return;
1265
- } else if (I === !1) {
1280
+ } else if (j === !1) {
1266
1281
  v("Invalid tag");
1267
1282
  return;
1268
1283
  }
@@ -1275,13 +1290,13 @@ const mr = ({
1275
1290
  }, _ = (k, C) => {
1276
1291
  if (k.key === "Backspace" || k.key === "Delete") {
1277
1292
  k.preventDefault();
1278
- const I = t[C], Z = [...t];
1293
+ const j = t[C], Z = [...t];
1279
1294
  Z.splice(C, 1), i(Z), setTimeout(() => {
1280
1295
  x.current && x.current.focus();
1281
- }, 0), M(`Removed tag ${I}`);
1296
+ }, 0), M(`Removed tag ${j}`);
1282
1297
  } else k.key === "ArrowRight" ? (k.preventDefault(), C < t.length - 1 ? F.current[C + 1]?.focus() : x.current?.focus()) : k.key === "ArrowLeft" && (k.preventDefault(), C > 0 && F.current[C - 1]?.focus());
1283
1298
  }, B = (k, C) => {
1284
- i(t.filter((I) => I !== k)), setTimeout(() => {
1299
+ i(t.filter((j) => j !== k)), setTimeout(() => {
1285
1300
  C < t.length - 1 ? F.current[C]?.focus() : C > 0 ? F.current[C - 1]?.focus() : x.current?.focus();
1286
1301
  }, 0), M(`Removed tag ${k}`);
1287
1302
  }, U = (k) => {
@@ -1356,8 +1371,8 @@ const mr = ({
1356
1371
  t.map((k, C) => /* @__PURE__ */ w(
1357
1372
  "div",
1358
1373
  {
1359
- ref: (I) => {
1360
- F.current[C] = I;
1374
+ ref: (j) => {
1375
+ F.current[C] = j;
1361
1376
  },
1362
1377
  className: p(
1363
1378
  "line-clamp-1 text-brand rounded-full px-2 text-sm flex items-center",
@@ -1369,7 +1384,7 @@ const mr = ({
1369
1384
  tabIndex: 0,
1370
1385
  role: "button",
1371
1386
  "aria-label": `${k}, press delete or backspace to remove`,
1372
- onKeyDown: (I) => _(I, C),
1387
+ onKeyDown: (j) => _(j, C),
1373
1388
  children: [
1374
1389
  k,
1375
1390
  /* @__PURE__ */ f(
@@ -1425,10 +1440,10 @@ const mr = ({
1425
1440
  ),
1426
1441
  /* @__PURE__ */ f("div", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: t.length > 0 ? `Current tags: ${t.join(", ")}` : "No tags added yet" })
1427
1442
  ] });
1428
- }, br = ({ name: e, ...n }) => {
1429
- const { control: r } = W();
1443
+ }, pr = ({ name: e, ...n }) => {
1444
+ const { control: r } = R();
1430
1445
  return r ? /* @__PURE__ */ f(
1431
- R,
1446
+ W,
1432
1447
  {
1433
1448
  name: e,
1434
1449
  control: r,
@@ -1463,7 +1478,7 @@ const mr = ({
1463
1478
  disabled: m = !1,
1464
1479
  className: g
1465
1480
  }) => {
1466
- const [v, x] = L(""), [A, F] = L(!1), [O, S] = L(-1), $ = N(null), E = N(null), z = N([]), {
1481
+ const [v, x] = D(""), [A, F] = D(!1), [O, S] = D(-1), $ = N(null), E = N(null), z = N([]), {
1467
1482
  triggerRef: _,
1468
1483
  triggerProps: B,
1469
1484
  popoverRef: U,
@@ -1481,7 +1496,7 @@ const mr = ({
1481
1496
  onClose: () => {
1482
1497
  F(!1), x(""), S(-1);
1483
1498
  }
1484
- }), I = N(
1499
+ }), j = N(
1485
1500
  `multiselect-${Math.random().toString(36).substr(2, 9)}`
1486
1501
  ).current, Z = N(
1487
1502
  `label-${Math.random().toString(36).substr(2, 9)}`
@@ -1490,11 +1505,11 @@ const mr = ({
1490
1505
  ).current, ee = N(
1491
1506
  `listbox-${Math.random().toString(36).substr(2, 9)}`
1492
1507
  ).current, T = o ? t.map((h) => r.find(
1493
- (D) => l(D) === h || l(D) === l(h)
1508
+ (L) => l(L) === h || l(L) === l(h)
1494
1509
  )).filter(Boolean) : t, te = T.length > 0, X = b ? r.filter(
1495
1510
  (h) => s(h).toLowerCase().includes(v.toLowerCase())
1496
1511
  ) : r;
1497
- j(() => {
1512
+ I(() => {
1498
1513
  z.current = z.current.slice(0, X.length);
1499
1514
  }, [X.length]);
1500
1515
  const ue = (h) => o ? t.some(
@@ -1506,13 +1521,13 @@ const mr = ({
1506
1521
  if (ue(h)) {
1507
1522
  let y;
1508
1523
  if (o) {
1509
- const D = l(h);
1524
+ const L = l(h);
1510
1525
  y = t.filter(
1511
- (P) => P !== D && l(P) !== D
1526
+ (P) => P !== L && l(P) !== L
1512
1527
  );
1513
1528
  } else
1514
1529
  y = t.filter(
1515
- (D) => l(D) !== l(h)
1530
+ (L) => l(L) !== l(h)
1516
1531
  );
1517
1532
  i(y), Y(`Removed ${s(h)}`);
1518
1533
  } else {
@@ -1527,13 +1542,13 @@ const mr = ({
1527
1542
  if (m) return;
1528
1543
  let y;
1529
1544
  if (o) {
1530
- const D = l(h);
1545
+ const L = l(h);
1531
1546
  y = t.filter(
1532
- (P) => P !== D && l(P) !== D
1547
+ (P) => P !== L && l(P) !== L
1533
1548
  );
1534
1549
  } else
1535
1550
  y = t.filter(
1536
- (D) => l(D) !== l(h)
1551
+ (L) => l(L) !== l(h)
1537
1552
  );
1538
1553
  i(y), Y(`Removed ${s(h)}`);
1539
1554
  }, he = (h) => {
@@ -1566,7 +1581,7 @@ const mr = ({
1566
1581
  }
1567
1582
  break;
1568
1583
  }
1569
- }, Ie = (h) => {
1584
+ }, Me = (h) => {
1570
1585
  x(h.target.value), S(-1);
1571
1586
  }, je = () => {
1572
1587
  m || (b && $.current && $.current.focus(), k());
@@ -1620,7 +1635,7 @@ const mr = ({
1620
1635
  "label",
1621
1636
  {
1622
1637
  id: Z,
1623
- htmlFor: I,
1638
+ htmlFor: j,
1624
1639
  className: p(
1625
1640
  "absolute transition-all duration-200 pointer-events-none",
1626
1641
  "text-base top-4 font-semibold left-3",
@@ -1674,11 +1689,11 @@ const mr = ({
1674
1689
  "input",
1675
1690
  {
1676
1691
  ref: $,
1677
- id: I,
1692
+ id: j,
1678
1693
  type: "text",
1679
1694
  className: "flex-grow min-w-[60px] bg-transparent outline-none placeholder:text-sm",
1680
1695
  value: v,
1681
- onChange: Ie,
1696
+ onChange: Me,
1682
1697
  onKeyDown: he,
1683
1698
  placeholder: te ? "" : u,
1684
1699
  disabled: m,
@@ -1731,7 +1746,7 @@ const mr = ({
1731
1746
  id: ee,
1732
1747
  "aria-labelledby": Z,
1733
1748
  children: X.length === 0 ? /* @__PURE__ */ f("div", { className: "px-3 py-2 text-sm text-secondarytext", children: v ? "No results found" : "No options available" }) : X.map((h, y) => {
1734
- const D = ue(h);
1749
+ const L = ue(h);
1735
1750
  return /* @__PURE__ */ w(
1736
1751
  "div",
1737
1752
  {
@@ -1745,16 +1760,16 @@ const mr = ({
1745
1760
  // !selected && "pl-9",
1746
1761
  {
1747
1762
  "bg-base-3 dark-theme:bg-base-4": y === O,
1748
- "bg-brandfadedbg text-brand": D
1763
+ "bg-brandfadedbg text-brand": L
1749
1764
  }
1750
1765
  ),
1751
1766
  onClick: () => fe(h),
1752
1767
  role: "option",
1753
- "aria-selected": D,
1768
+ "aria-selected": L,
1754
1769
  onMouseEnter: () => S(y),
1755
1770
  children: [
1756
1771
  /* @__PURE__ */ f("span", { children: s(h) }),
1757
- D && /* @__PURE__ */ f(J, { size: 16 })
1772
+ L && /* @__PURE__ */ f(J, { size: 16 })
1758
1773
  ]
1759
1774
  },
1760
1775
  l(h)
@@ -1773,13 +1788,13 @@ const mr = ({
1773
1788
  ),
1774
1789
  /* @__PURE__ */ f("div", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: T.length > 0 ? `Selected: ${T.map(s).join(", ")}` : "No selections" })
1775
1790
  ] });
1776
- }, pr = ({
1791
+ }, gr = ({
1777
1792
  name: e,
1778
1793
  ...n
1779
1794
  }) => {
1780
- const { control: r } = W();
1795
+ const { control: r } = R();
1781
1796
  return r ? /* @__PURE__ */ f(
1782
- R,
1797
+ W,
1783
1798
  {
1784
1799
  name: e,
1785
1800
  control: r,
@@ -1797,7 +1812,7 @@ const mr = ({
1797
1812
  "Form control missing for field: ",
1798
1813
  e
1799
1814
  ] }));
1800
- }, gr = ({
1815
+ }, vr = ({
1801
1816
  isEditable: e,
1802
1817
  isDeletable: n = !0,
1803
1818
  createUpdateLoading: r,
@@ -1809,7 +1824,7 @@ const mr = ({
1809
1824
  deleteText: a = "Eliminar",
1810
1825
  className: c
1811
1826
  }) => {
1812
- const [u, d] = L(!1);
1827
+ const [u, d] = D(!1);
1813
1828
  return /* @__PURE__ */ w("div", { className: `w-full grid grid-cols-2 gap-4 col-span-full ${c}`, children: [
1814
1829
  e && n ? /* @__PURE__ */ w(
1815
1830
  ie,
@@ -1820,7 +1835,7 @@ const mr = ({
1820
1835
  l ? u ? i?.() : d(!0) : i?.();
1821
1836
  },
1822
1837
  children: [
1823
- /* @__PURE__ */ f(We, { size: 18 }),
1838
+ /* @__PURE__ */ f(Re, { size: 18 }),
1824
1839
  l && u ? "Confirmar" : a
1825
1840
  ]
1826
1841
  }
@@ -1833,14 +1848,14 @@ const mr = ({
1833
1848
  state: r ? "loading" : t ? "disabled" : "enabled",
1834
1849
  type: "submit",
1835
1850
  children: [
1836
- r ? /* @__PURE__ */ f(wt, {}) : e ? /* @__PURE__ */ f(Ne, { size: 18 }) : /* @__PURE__ */ f(Re, { size: 18 }),
1851
+ r ? /* @__PURE__ */ f(wt, {}) : e ? /* @__PURE__ */ f(Ne, { size: 18 }) : /* @__PURE__ */ f(We, { size: 18 }),
1837
1852
  e ? o : s
1838
1853
  ]
1839
1854
  }
1840
1855
  )
1841
1856
  ] });
1842
1857
  };
1843
- function vr({
1858
+ function xr({
1844
1859
  checked: e,
1845
1860
  onCheckedChange: n,
1846
1861
  disabled: r = !1,
@@ -1863,12 +1878,11 @@ function vr({
1863
1878
  r || n(!e);
1864
1879
  },
1865
1880
  className: p(
1866
- `
1867
- relative inline-flex h-6 w-11 items-center rounded-full
1881
+ `relative inline-flex h-[28px] w-[48px] items-center rounded-full
1868
1882
  transition-colors duration-200 ease-in-out
1869
- focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2
1870
- focus-visible:ring-blue-500`,
1871
- e ? "bg-blue-600" : "bg-gray-200",
1883
+ focus-visible:outline-none focus-visible:ring-1
1884
+ focus-visible:ring-base-6`,
1885
+ e ? "bg-brand" : "bg-base-3",
1872
1886
  r ? "opacity-50 cursor-not-allowed" : "cursor-pointer",
1873
1887
  l
1874
1888
  ),
@@ -1877,10 +1891,10 @@ function vr({
1877
1891
  "span",
1878
1892
  {
1879
1893
  className: p(
1880
- `inline-block h-5 w-5 transform rounded-full bg-white
1894
+ `inline-block h-6 w-6 transform rounded-full
1881
1895
  transition-transform duration-200 ease-in-out
1882
- shadow-lg`,
1883
- e ? "translate-x-6" : "translate-x-0.5"
1896
+ shadow`,
1897
+ e ? "bg-brand-text translate-x-[22px]" : "bg-base-1 dark-theme:bg-base-12 translate-x-[2px]"
1884
1898
  )
1885
1899
  }
1886
1900
  ),
@@ -1903,16 +1917,16 @@ function vr({
1903
1917
  }
1904
1918
  );
1905
1919
  }
1906
- const Le = we(null), Kt = ({
1920
+ const De = we(null), Kt = ({
1907
1921
  children: e,
1908
1922
  value: n
1909
- }) => /* @__PURE__ */ f(Le.Provider, { value: n, children: e }), Bt = () => {
1910
- const e = xe(Le);
1923
+ }) => /* @__PURE__ */ f(De.Provider, { value: n, children: e }), Bt = () => {
1924
+ const e = xe(De);
1911
1925
  if (!e)
1912
1926
  throw new Error("useAliveScope must be wrapped within AliveScopeProvider");
1913
1927
  return e;
1914
- }, xr = ({ children: e }) => {
1915
- const [n, r] = L({}), t = N(
1928
+ }, wr = ({ children: e }) => {
1929
+ const [n, r] = D({}), t = N(
1916
1930
  {}
1917
1931
  ), i = N(
1918
1932
  {}
@@ -1954,16 +1968,16 @@ const Le = we(null), Kt = ({
1954
1968
  ]
1955
1969
  }
1956
1970
  );
1957
- }, Me = we(
1971
+ }, Ie = we(
1958
1972
  null
1959
1973
  ), Vt = ({
1960
1974
  children: e,
1961
1975
  value: n
1962
- }) => /* @__PURE__ */ f(Me.Provider, { value: n, children: e }), Xt = Be(({ id: e, onMountCallbacks: n, onDropCallbacks: r, children: t, element: i }) => /* @__PURE__ */ f(
1976
+ }) => /* @__PURE__ */ f(Ie.Provider, { value: n, children: e }), Xt = Be(({ id: e, onMountCallbacks: n, onDropCallbacks: r, children: t, element: i }) => /* @__PURE__ */ f(
1963
1977
  Vt,
1964
1978
  {
1965
1979
  value: { keepAliveId: e, onKeepAliveMount: (o, a = { runOnFirstMount: !1 }) => {
1966
- j(() => {
1980
+ I(() => {
1967
1981
  const c = () => {
1968
1982
  if (document.getElementById(e))
1969
1983
  o(e);
@@ -1984,7 +1998,7 @@ const Le = we(null), Kt = ({
1984
1998
  };
1985
1999
  }, []);
1986
2000
  }, onKeepAliveDrop: (o) => {
1987
- j(() => (r.current[e].push(o), () => {
2001
+ I(() => (r.current[e].push(o), () => {
1988
2002
  r.current[e] = r.current[e].filter(
1989
2003
  (a) => a !== o
1990
2004
  );
@@ -1992,47 +2006,47 @@ const Le = we(null), Kt = ({
1992
2006
  } },
1993
2007
  children: ye(t, i, e)
1994
2008
  }
1995
- )), wr = () => {
1996
- const e = xe(Me);
2009
+ )), yr = () => {
2010
+ const e = xe(Ie);
1997
2011
  if (!e)
1998
2012
  throw new Error("useKeepAlive must be used within KeepAliveProvider");
1999
2013
  return e;
2000
- }, yr = ({
2014
+ }, kr = ({
2001
2015
  aliveKey: e,
2002
2016
  children: n,
2003
2017
  enabled: r = !0,
2004
2018
  ...t
2005
2019
  }) => {
2006
2020
  const i = N(null), { getPortalElement: l } = Bt();
2007
- return j(() => {
2021
+ return I(() => {
2008
2022
  const s = l(e, n, t.className);
2009
2023
  return r && i.current && i.current.replaceWith(s), () => {
2010
2024
  };
2011
2025
  }, [e, n, r, t]), /* @__PURE__ */ f("div", { ...t, ref: i, children: n });
2012
2026
  };
2013
2027
  export {
2014
- xr as AliveScope,
2028
+ wr as AliveScope,
2015
2029
  lr as Avatar,
2016
2030
  ir as AvatarsGroup,
2017
2031
  ie as Button,
2018
- Lt as Checkbox,
2032
+ Dt as Checkbox,
2019
2033
  nr as FocusTrap,
2020
- fr as Form,
2021
- hr as FormInput,
2022
- pr as FormMultiSelect,
2023
- gr as FormSubmit,
2024
- br as FormTags,
2025
- mr as FormTextArea,
2034
+ dr as Form,
2035
+ mr as FormInput,
2036
+ gr as FormMultiSelect,
2037
+ vr as FormSubmit,
2038
+ pr as FormTags,
2039
+ br as FormTextArea,
2026
2040
  xt as Icon,
2027
2041
  ze as Input,
2028
- yr as KeepAlive,
2042
+ kr as KeepAlive,
2029
2043
  Tt as MultiSelect,
2030
2044
  yt as Portal,
2031
- ur as Separator,
2045
+ fr as Separator,
2032
2046
  wt as Spinner,
2033
- vr as Switch,
2047
+ xr as Switch,
2034
2048
  _t as Tags,
2035
- De as TextArea,
2049
+ Le as TextArea,
2036
2050
  ut as calculatePopoverPosition,
2037
2051
  Q as checkOverflow,
2038
2052
  p as cn,
@@ -2048,10 +2062,11 @@ export {
2048
2062
  ar as useClickAway,
2049
2063
  cr as useClickAwayAdvanced,
2050
2064
  ft as useClickAwayWithRef,
2051
- wr as useKeepAlive,
2065
+ yr as useKeepAlive,
2066
+ ur as useKeyListener,
2052
2067
  lt as useLargeScreen,
2053
2068
  it as useMergedRef,
2054
- dr as useMethods,
2069
+ hr as useMethods,
2055
2070
  sr as useOverflow,
2056
2071
  or as useOverflowState,
2057
2072
  ct as usePopover,