@framework-m/ui 0.12.4 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,55 +1,55 @@
1
- import e, { createContext as t, useContext as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
2
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
3
- import { TamaguiProvider as u, Text as d, View as f, createFont as p, createTamagui as m, createTokens as h, styled as g } from "@tamagui/core";
4
- import { useTranslation as _ } from "react-i18next";
5
- import { ScrollView as v } from "@tamagui/scroll-view";
6
- import y from "react-dom";
7
- import { Image as b } from "@tamagui/image";
8
- import * as x from "@tamagui/lucide-icons-2";
1
+ import e, { createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
2
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
3
+ import { TamaguiProvider as d, Text as f, View as p, createFont as m, createTamagui as h, createTokens as g, styled as _ } from "@tamagui/core";
4
+ import { useTranslation as v } from "react-i18next";
5
+ import { ScrollView as y } from "@tamagui/scroll-view";
6
+ import b from "react-dom";
7
+ import { Image as x } from "@tamagui/image";
8
+ import * as S from "@tamagui/lucide-icons-2";
9
9
  //#region src/theme/ThemeContext.tsx
10
- var S = t(null), C = "framework-m-theme";
11
- function w() {
12
- let e = localStorage.getItem(C);
10
+ var C = t(null), w = "framework-m-theme";
11
+ function T() {
12
+ let e = localStorage.getItem(w);
13
13
  return e === "light" || e === "dark" ? e : window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
14
14
  }
15
- function T(e) {
15
+ function E(e) {
16
16
  let t = document.documentElement;
17
17
  e === "dark" ? t.classList.add("dark") : t.classList.remove("dark");
18
18
  }
19
- function E({ children: e, defaultTheme: t }) {
20
- let [n, i] = o(t || w);
21
- r(() => {
22
- T(n);
23
- }, [n]), r(() => {
24
- t && i(t);
25
- }, [t]), r(() => {
19
+ function D({ children: e, defaultTheme: t }) {
20
+ let [n, r] = s(t || T);
21
+ i(() => {
22
+ E(n);
23
+ }, [n]), i(() => {
24
+ t && r(t);
25
+ }, [t]), i(() => {
26
26
  let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e) => {
27
- localStorage.getItem(C) || i(e.matches ? "dark" : "light");
27
+ localStorage.getItem(w) || r(e.matches ? "dark" : "light");
28
28
  };
29
29
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
30
30
  }, []);
31
31
  let a = (e) => {
32
- i(e), localStorage.setItem(C, e), T(e);
33
- }, s = {
32
+ r(e), localStorage.setItem(w, e), E(e);
33
+ }, o = {
34
34
  theme: n,
35
35
  setTheme: a,
36
36
  toggleTheme: () => {
37
37
  a(n === "light" ? "dark" : "light");
38
38
  }
39
39
  };
40
- return /* @__PURE__ */ c(S.Provider, {
41
- value: s,
40
+ return /* @__PURE__ */ l(C.Provider, {
41
+ value: o,
42
42
  children: e
43
43
  });
44
44
  }
45
- function D() {
46
- let e = n(S);
45
+ function O() {
46
+ let e = r(C);
47
47
  if (!e) throw Error("useTheme must be used within ThemeProvider");
48
48
  return e;
49
49
  }
50
50
  //#endregion
51
51
  //#region src/components/Primitives.tsx
52
- var O = g(f, {
52
+ var k = _(p, {
53
53
  name: "MStack",
54
54
  display: "flex",
55
55
  flexDirection: "column",
@@ -63,7 +63,7 @@ var O = g(f, {
63
63
  height: "100%",
64
64
  zIndex: 0
65
65
  } } }
66
- }), k = g(f, {
66
+ }), A = _(p, {
67
67
  name: "XStack",
68
68
  display: "flex",
69
69
  flexDirection: "row",
@@ -77,7 +77,7 @@ var O = g(f, {
77
77
  height: "100%",
78
78
  zIndex: 0
79
79
  } } }
80
- }), A = g(f, {
80
+ }), j = _(p, {
81
81
  name: "YStack",
82
82
  display: "flex",
83
83
  flexDirection: "column",
@@ -91,7 +91,7 @@ var O = g(f, {
91
91
  height: "100%",
92
92
  zIndex: 0
93
93
  } } }
94
- }), j = g(f, {
94
+ }), M = _(p, {
95
95
  name: "ZStack",
96
96
  display: "flex",
97
97
  position: "relative",
@@ -105,7 +105,7 @@ var O = g(f, {
105
105
  height: "100%",
106
106
  zIndex: 0
107
107
  } } }
108
- }), M = g(d, {
108
+ }), N = _(f, {
109
109
  name: "MText",
110
110
  fontFamily: "$body",
111
111
  display: "inline-flex",
@@ -118,11 +118,11 @@ var O = g(f, {
118
118
  $xl: { fontSize: "$xl" },
119
119
  $xxl: { fontSize: "$xxl" }
120
120
  } }
121
- }), N = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(M, {
121
+ }), P = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ l(N, {
122
122
  ref: r,
123
123
  ...n,
124
124
  style: [t, { textAlign: e === "start" ? "left" : e === "end" ? "right" : e }]
125
- })), P = g(d, {
125
+ })), F = _(f, {
126
126
  name: "Paragraph",
127
127
  fontFamily: "$body",
128
128
  display: "inline-flex",
@@ -135,11 +135,11 @@ var O = g(f, {
135
135
  $xl: { fontSize: "$xl" },
136
136
  $xxl: { fontSize: "$xxl" }
137
137
  } }
138
- }), F = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(P, {
138
+ }), I = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ l(F, {
139
139
  ref: r,
140
140
  ...n,
141
141
  style: [t, { textAlign: e === "start" ? "left" : e === "end" ? "right" : e }]
142
- })), I = g(d, {
142
+ })), L = _(f, {
143
143
  name: "Heading",
144
144
  fontFamily: "$body",
145
145
  fontWeight: "800",
@@ -153,11 +153,11 @@ var O = g(f, {
153
153
  $xl: { fontSize: "$xl" },
154
154
  $xxl: { fontSize: "$xxl" }
155
155
  } }
156
- }), L = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(I, {
156
+ }), R = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ l(L, {
157
157
  ref: r,
158
158
  ...n,
159
159
  style: [t, { textAlign: e === "start" ? "left" : e === "end" ? "right" : e }]
160
- })), R = {
160
+ })), z = {
161
161
  draft: {
162
162
  bg: "$backgroundActive",
163
163
  text: "$colorMuted"
@@ -196,13 +196,13 @@ var O = g(f, {
196
196
  }
197
197
  };
198
198
  function ee(e) {
199
- return R[e.toLowerCase().replace(/\s+/g, "_")] ?? R.default;
199
+ return z[e.toLowerCase().replace(/\s+/g, "_")] ?? z.default;
200
200
  }
201
201
  function te({ state: e, docstatus: t, className: n, style: r }) {
202
202
  let i = e ?? (t === 0 ? "Draft" : t === 1 ? "Submitted" : t === 2 ? "Cancelled" : void 0);
203
203
  if (!i) return null;
204
204
  let a = ee(i);
205
- return /* @__PURE__ */ c(N, {
205
+ return /* @__PURE__ */ l(P, {
206
206
  className: n,
207
207
  backgroundColor: a.bg,
208
208
  color: a.text,
@@ -250,19 +250,19 @@ var ne = [
250
250
  }
251
251
  ];
252
252
  function re({ language: e, onChangeLanguage: t, locales: n = ne, placement: r }) {
253
- return /* @__PURE__ */ l(k, {
253
+ return /* @__PURE__ */ u(A, {
254
254
  alignItems: "center",
255
255
  gap: "$xs",
256
256
  width: "auto",
257
257
  style: { verticalAlign: "middle" },
258
- children: [/* @__PURE__ */ c(N, {
258
+ children: [/* @__PURE__ */ l(P, {
259
259
  size: "$sm",
260
260
  style: { lineHeight: 1 },
261
- children: /* @__PURE__ */ c(K, {
261
+ children: /* @__PURE__ */ l(K, {
262
262
  name: "globe",
263
263
  size: 15
264
264
  })
265
- }), /* @__PURE__ */ c(W, {
265
+ }), /* @__PURE__ */ l(W, {
266
266
  value: e,
267
267
  onValueChange: t,
268
268
  options: n.map((e) => ({
@@ -277,7 +277,7 @@ function re({ language: e, onChangeLanguage: t, locales: n = ne, placement: r })
277
277
  }
278
278
  //#endregion
279
279
  //#region src/components/Skeleton.tsx
280
- var z = g(f, {
280
+ var ie = _(p, {
281
281
  name: "Skeleton",
282
282
  backgroundColor: "$backgroundTertiary",
283
283
  borderRadius: "$md",
@@ -310,23 +310,23 @@ var z = g(f, {
310
310
  }
311
311
  } },
312
312
  defaultVariants: { variant: "text" }
313
- }), ie = ({ count: e = 1, className: t = "", ...n }) => {
313
+ }), ae = ({ count: e = 1, className: t = "", ...n }) => {
314
314
  let r = `skeleton ${t}`.trim();
315
- return e > 1 ? /* @__PURE__ */ c(f, {
315
+ return e > 1 ? /* @__PURE__ */ l(p, {
316
316
  "aria-busy": !0,
317
317
  "aria-label": "Loading content",
318
- children: Array.from({ length: e }, (t, i) => /* @__PURE__ */ c(z, {
318
+ children: Array.from({ length: e }, (t, i) => /* @__PURE__ */ l(ie, {
319
319
  className: r,
320
320
  ...n,
321
321
  ...i === e - 1 && n.variant === "text" ? { width: "60%" } : {}
322
322
  }, i))
323
- }) : /* @__PURE__ */ c(z, {
323
+ }) : /* @__PURE__ */ l(ie, {
324
324
  className: r,
325
325
  "aria-busy": !0,
326
326
  "aria-label": "Loading",
327
327
  ...n
328
328
  });
329
- }, ae = g(f, {
329
+ }, oe = _(p, {
330
330
  name: "Button",
331
331
  flexDirection: "row",
332
332
  alignItems: "center",
@@ -413,16 +413,16 @@ var z = g(f, {
413
413
  variant: "default",
414
414
  size: "md"
415
415
  }
416
- }), oe = (e) => typeof e == "string" || typeof e == "number", B = e.forwardRef(({ children: t, variant: n = "default", size: r = "md", loading: i, disabled: a, tag: o = "button", ...s }, l) => {
417
- let u = ae, d = s.color || (n === "primary" || n === "danger" ? "$primaryColor" : "$color"), f = (e, t) => /* @__PURE__ */ c(N, {
416
+ }), se = (e) => typeof e == "string" || typeof e == "number", B = e.forwardRef(({ children: t, variant: n = "default", size: r = "md", loading: i, disabled: a, tag: o = "button", ...s }, c) => {
417
+ let u = oe, d = s.color || (n === "primary" || n === "danger" ? "$primaryColor" : "$color"), f = (e, t) => /* @__PURE__ */ l(P, {
418
418
  color: d,
419
419
  fontWeight: "600",
420
420
  fontSize: r === "sm" ? "$xs" : "$sm",
421
421
  pointerEvents: "none",
422
422
  children: e
423
- }, t), p = i ? f("...") : e.Children.map(t, (e, t) => oe(e) ? f(e, t) : e), { onPress: m, onClick: h, onKeyDown: g, ..._ } = s;
424
- return /* @__PURE__ */ c(u, {
425
- ref: l,
423
+ }, t), p = i ? f("...") : e.Children.map(t, (e, t) => se(e) ? f(e, t) : e), { onPress: m, onClick: h, onKeyDown: g, ..._ } = s;
424
+ return /* @__PURE__ */ l(u, {
425
+ ref: c,
426
426
  tag: o,
427
427
  type: s.type,
428
428
  variant: n,
@@ -449,7 +449,7 @@ var z = g(f, {
449
449
  },
450
450
  children: p
451
451
  });
452
- }), V = g(f, {
452
+ }), V = _(p, {
453
453
  name: "Card",
454
454
  flexDirection: "column",
455
455
  backgroundColor: "$background",
@@ -484,7 +484,7 @@ var z = g(f, {
484
484
  elevated: !0,
485
485
  padded: "md"
486
486
  }
487
- }), se = g("input", {
487
+ }), ce = _("input", {
488
488
  name: "Input",
489
489
  backgroundColor: "$backgroundSecondary",
490
490
  borderRadius: "$round",
@@ -535,7 +535,7 @@ var z = g(f, {
535
535
  defaultVariants: { size: "md" }
536
536
  }), H = e.forwardRef(({ onChange: e, onChangeText: t, value: n, textAlign: r, style: i, ...a }, o) => {
537
537
  let s = n !== void 0;
538
- return /* @__PURE__ */ c(se, {
538
+ return /* @__PURE__ */ l(ce, {
539
539
  ref: o,
540
540
  tabIndex: a.disabled ? -1 : 0,
541
541
  ...s ? { value: n } : {},
@@ -552,11 +552,11 @@ var z = g(f, {
552
552
  H.displayName = "Input";
553
553
  //#endregion
554
554
  //#region src/components/Popover.tsx
555
- function U({ trigger: e, content: t, placement: n = "bottom-start", open: i, onOpenChange: s }) {
556
- let [u, d] = o(!1), f = i === void 0 ? u : i, [p, m] = o(n), h = (e) => {
557
- d(e), s?.(e);
558
- }, g = a(null);
559
- return r(() => {
555
+ function U({ trigger: e, content: t, placement: n = "bottom-start", open: r, onOpenChange: a }) {
556
+ let [c, d] = s(!1), f = r === void 0 ? c : r, [p, m] = s(n), h = (e) => {
557
+ d(e), a?.(e);
558
+ }, g = o(null);
559
+ return i(() => {
560
560
  if (f && g.current && typeof window < "u") {
561
561
  let e = g.current;
562
562
  if (e.getBoundingClientRect) {
@@ -564,17 +564,17 @@ function U({ trigger: e, content: t, placement: n = "bottom-start", open: i, onO
564
564
  window.innerHeight - t.bottom < 350 && t.top > 350 && n.startsWith("bottom") ? m(n.replace("bottom", "top")) : m(n);
565
565
  }
566
566
  }
567
- }, [f, n]), r(() => {
567
+ }, [f, n]), i(() => {
568
568
  if (typeof document > "u") return;
569
569
  let e = (e) => {
570
570
  g.current && !g.current.contains(e.target) && h(!1);
571
571
  };
572
572
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
573
- }, [g]), /* @__PURE__ */ l(A, {
573
+ }, [g]), /* @__PURE__ */ u(j, {
574
574
  position: "relative",
575
575
  ref: g,
576
576
  zIndex: f ? 1e4 : 1,
577
- children: [/* @__PURE__ */ c(k, {
577
+ children: [/* @__PURE__ */ l(A, {
578
578
  onPress: () => h(!f),
579
579
  onClick: () => h(!f),
580
580
  style: { cursor: "pointer" },
@@ -586,7 +586,7 @@ function U({ trigger: e, content: t, placement: n = "bottom-start", open: i, onO
586
586
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), h(!f));
587
587
  },
588
588
  children: e
589
- }), f && /* @__PURE__ */ c(j, {
589
+ }), f && /* @__PURE__ */ l(M, {
590
590
  position: "absolute",
591
591
  zIndex: 1e3,
592
592
  ...(() => {
@@ -640,7 +640,7 @@ function U({ trigger: e, content: t, placement: n = "bottom-start", open: i, onO
640
640
  },
641
641
  shadowOpacity: .1,
642
642
  shadowRadius: 10,
643
- children: /* @__PURE__ */ c(V, {
643
+ children: /* @__PURE__ */ l(V, {
644
644
  elevated: !0,
645
645
  padding: "$sm",
646
646
  minWidth: 200,
@@ -653,28 +653,28 @@ function U({ trigger: e, content: t, placement: n = "bottom-start", open: i, onO
653
653
  }
654
654
  //#endregion
655
655
  //#region src/components/DatePicker.tsx
656
- var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date", placeholder: s, popoverPlacement: u = "bottom-start", ...d }, p) => {
657
- let { t: m } = _("ui"), [h, g] = o(!1), [v, y] = o(!1), [b, x] = o(!1), S = a === "datetime-local" || d.field?.format === "date-time" ? "datetime-local" : "date", C = (e) => {
656
+ var le = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: r = "date", placeholder: o, popoverPlacement: c = "bottom-start", ...d }, f) => {
657
+ let { t: m } = v("ui"), [h, g] = s(!1), [_, y] = s(!1), [b, x] = s(!1), S = r === "datetime-local" || d.field?.format === "date-time" ? "datetime-local" : "date", C = (e) => {
658
658
  let t = (e) => e.toString().padStart(2, "0"), n = e.getFullYear(), r = t(e.getMonth() + 1), i = t(e.getDate()), a = t(e.getHours()), o = t(e.getMinutes()), s = t(e.getSeconds());
659
659
  return S === "date" ? `${n}-${r}-${i}` : `${n}-${r}-${i}T${a}:${o}:${s}`;
660
- }, w = i(() => {
660
+ }, w = a(() => {
661
661
  if (!e) return /* @__PURE__ */ new Date();
662
662
  let t = new Date(e);
663
663
  return isNaN(t.getTime()) ? /* @__PURE__ */ new Date() : t;
664
- }, [e]), T = i(() => {
664
+ }, [e]), T = a(() => {
665
665
  if (!e) return "";
666
666
  let t = new Date(e);
667
667
  return isNaN(t.getTime()) ? String(e) : S === "date" ? t.toLocaleDateString() : t.toLocaleString();
668
- }, [e, S]), [E, D] = o(new Date(w)), j = () => {
668
+ }, [e, S]), [E, D] = s(new Date(w)), O = () => {
669
669
  g(!0);
670
670
  };
671
- r(() => {
671
+ i(() => {
672
672
  D(new Date(w));
673
673
  }, [w]);
674
674
  let M = (e) => {
675
675
  let r = C(e);
676
676
  t?.(r), n?.(r);
677
- }, P = (e) => {
677
+ }, N = (e) => {
678
678
  let t = new Date(E);
679
679
  t.setDate(e), t.setHours(w.getHours()), t.setMinutes(w.getMinutes()), t.setSeconds(w.getSeconds()), M(t), S === "date" && g(!1);
680
680
  }, F = (e, t, n = 0) => {
@@ -686,12 +686,12 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
686
686
  }, L = () => {
687
687
  let e = /* @__PURE__ */ new Date();
688
688
  M(e), D(new Date(e));
689
- }, R = (e, t) => new Date(t, e + 1, 0).getDate(), ee = (e, t) => new Date(t, e, 1).getDay(), te = i(() => {
690
- let e = R(E.getMonth(), E.getFullYear()), t = ee(E.getMonth(), E.getFullYear()), n = [];
689
+ }, R = (e, t) => new Date(t, e + 1, 0).getDate(), z = (e, t) => new Date(t, e, 1).getDay(), ee = a(() => {
690
+ let e = R(E.getMonth(), E.getFullYear()), t = z(E.getMonth(), E.getFullYear()), n = [];
691
691
  for (let e = 0; e < t; e++) n.push(null);
692
692
  for (let t = 1; t <= e; t++) n.push(t);
693
693
  return n;
694
- }, [E]), ne = [
694
+ }, [E]), te = [
695
695
  m("January"),
696
696
  m("February"),
697
697
  m("March"),
@@ -704,34 +704,34 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
704
704
  m("October"),
705
705
  m("November"),
706
706
  m("December")
707
- ], re = /* @__PURE__ */ l(k, {
707
+ ], ne = /* @__PURE__ */ u(A, {
708
708
  alignItems: "center",
709
709
  position: "relative",
710
710
  width: "100%",
711
- children: [/* @__PURE__ */ c(H, {
712
- ref: p,
711
+ children: [/* @__PURE__ */ l(H, {
712
+ ref: f,
713
713
  value: T,
714
714
  readOnly: !0,
715
- placeholder: s || m(S === "date" ? "Select Date..." : "Select Date & Time..."),
715
+ placeholder: o || m(S === "date" ? "Select Date..." : "Select Date & Time..."),
716
716
  paddingRight: 40,
717
717
  ...d,
718
718
  type: "text",
719
719
  onPressIn: (e) => {
720
- d.onPressIn?.(e), j();
720
+ d.onPressIn?.(e), O();
721
721
  },
722
722
  onClick: (e) => {
723
- d.onClick?.(e), j();
723
+ d.onClick?.(e), O();
724
724
  },
725
725
  onFocus: (e) => {
726
- d.onFocus?.(e), j();
726
+ d.onFocus?.(e), O();
727
727
  },
728
728
  cursor: "pointer"
729
- }), /* @__PURE__ */ c(k, {
729
+ }), /* @__PURE__ */ l(A, {
730
730
  position: "absolute",
731
731
  right: 12,
732
732
  pointerEvents: "none",
733
733
  opacity: .6,
734
- children: /* @__PURE__ */ l("svg", {
734
+ children: /* @__PURE__ */ u("svg", {
735
735
  viewBox: "0 0 24 24",
736
736
  width: "18",
737
737
  height: "18",
@@ -742,7 +742,7 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
742
742
  strokeLinejoin: "round",
743
743
  style: { color: "var(--primary)" },
744
744
  children: [
745
- /* @__PURE__ */ c("rect", {
745
+ /* @__PURE__ */ l("rect", {
746
746
  x: "3",
747
747
  y: "4",
748
748
  width: "18",
@@ -750,19 +750,19 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
750
750
  rx: "2",
751
751
  ry: "2"
752
752
  }),
753
- /* @__PURE__ */ c("line", {
753
+ /* @__PURE__ */ l("line", {
754
754
  x1: "16",
755
755
  y1: "2",
756
756
  x2: "16",
757
757
  y2: "6"
758
758
  }),
759
- /* @__PURE__ */ c("line", {
759
+ /* @__PURE__ */ l("line", {
760
760
  x1: "8",
761
761
  y1: "2",
762
762
  x2: "8",
763
763
  y2: "6"
764
764
  }),
765
- /* @__PURE__ */ c("line", {
765
+ /* @__PURE__ */ l("line", {
766
766
  x1: "3",
767
767
  y1: "10",
768
768
  x2: "21",
@@ -771,15 +771,15 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
771
771
  ]
772
772
  })
773
773
  })]
774
- }), z = /* @__PURE__ */ l(A, {
774
+ }), re = /* @__PURE__ */ u(j, {
775
775
  width: 304,
776
776
  children: [
777
- /* @__PURE__ */ l(k, {
777
+ /* @__PURE__ */ u(A, {
778
778
  justifyContent: "space-between",
779
779
  alignItems: "center",
780
780
  marginBottom: "$3",
781
781
  children: [
782
- /* @__PURE__ */ c(B, {
782
+ /* @__PURE__ */ l(B, {
783
783
  type: "button",
784
784
  size: "sm",
785
785
  borderRadius: 100,
@@ -787,20 +787,20 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
787
787
  height: 28,
788
788
  padding: 0,
789
789
  onPress: () => D(new Date(E.setMonth(E.getMonth() - 1))),
790
- children: /* @__PURE__ */ c(N, {
790
+ children: /* @__PURE__ */ l(P, {
791
791
  fontSize: 12,
792
792
  position: "relative",
793
793
  left: -1,
794
794
  children: "<"
795
795
  })
796
796
  }),
797
- /* @__PURE__ */ l(k, {
797
+ /* @__PURE__ */ u(A, {
798
798
  alignItems: "center",
799
799
  cursor: "pointer",
800
800
  children: [
801
- /* @__PURE__ */ c(A, {
801
+ /* @__PURE__ */ l(j, {
802
802
  onDoubleClick: () => x(!0),
803
- children: b ? /* @__PURE__ */ c(H, {
803
+ children: b ? /* @__PURE__ */ l(H, {
804
804
  size: "sm",
805
805
  width: 100,
806
806
  style: { textAlign: "center" },
@@ -813,17 +813,17 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
813
813
  let t = parseInt(e.target.value);
814
814
  !isNaN(t) && t > 0 && t <= 12 && D(new Date(E.setMonth(t - 1))), x(!1);
815
815
  }
816
- }) : /* @__PURE__ */ c(N, {
816
+ }) : /* @__PURE__ */ l(P, {
817
817
  fontSize: 12,
818
818
  fontWeight: "700",
819
819
  color: "$primary",
820
- children: ne[E.getMonth()]
820
+ children: te[E.getMonth()]
821
821
  })
822
822
  }),
823
- /* @__PURE__ */ c(f, { width: 12 }),
824
- /* @__PURE__ */ c(A, {
823
+ /* @__PURE__ */ l(p, { width: 12 }),
824
+ /* @__PURE__ */ l(j, {
825
825
  onDoubleClick: () => y(!0),
826
- children: v ? /* @__PURE__ */ c(H, {
826
+ children: _ ? /* @__PURE__ */ l(H, {
827
827
  size: "sm",
828
828
  width: 60,
829
829
  style: { textAlign: "center" },
@@ -836,7 +836,7 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
836
836
  let t = parseInt(e.target.value);
837
837
  isNaN(t) || D(new Date(E.setFullYear(t))), y(!1);
838
838
  }
839
- }) : /* @__PURE__ */ c(N, {
839
+ }) : /* @__PURE__ */ l(P, {
840
840
  fontWeight: "700",
841
841
  color: "$primary",
842
842
  children: E.getFullYear()
@@ -844,7 +844,7 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
844
844
  })
845
845
  ]
846
846
  }),
847
- /* @__PURE__ */ c(B, {
847
+ /* @__PURE__ */ l(B, {
848
848
  type: "button",
849
849
  size: "sm",
850
850
  borderRadius: 100,
@@ -852,7 +852,7 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
852
852
  height: 28,
853
853
  padding: 0,
854
854
  onPress: () => D(new Date(E.setMonth(E.getMonth() + 1))),
855
- children: /* @__PURE__ */ c(N, {
855
+ children: /* @__PURE__ */ l(P, {
856
856
  fontSize: 12,
857
857
  position: "relative",
858
858
  left: 1,
@@ -861,11 +861,11 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
861
861
  })
862
862
  ]
863
863
  }),
864
- /* @__PURE__ */ l(k, {
864
+ /* @__PURE__ */ u(A, {
865
865
  flexWrap: "wrap",
866
866
  gap: 2,
867
867
  marginBottom: "$2",
868
- children: [/* @__PURE__ */ c(k, {
868
+ children: [/* @__PURE__ */ l(A, {
869
869
  width: "100%",
870
870
  justifyContent: "space-around",
871
871
  children: [
@@ -876,19 +876,19 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
876
876
  m("Th"),
877
877
  m("Fr"),
878
878
  m("Sa")
879
- ].map((e) => /* @__PURE__ */ c(O, {
879
+ ].map((e) => /* @__PURE__ */ l(k, {
880
880
  width: 36,
881
881
  alignItems: "center",
882
- children: /* @__PURE__ */ c(N, {
882
+ children: /* @__PURE__ */ l(P, {
883
883
  fontSize: 10,
884
884
  color: "muted",
885
885
  fontWeight: "600",
886
886
  children: e
887
887
  })
888
888
  }, e))
889
- }), te.map((e, t) => {
889
+ }), ee.map((e, t) => {
890
890
  let n = e === w.getDate() && E.getMonth() === w.getMonth() && E.getFullYear() === w.getFullYear();
891
- return /* @__PURE__ */ c(O, {
891
+ return /* @__PURE__ */ l(k, {
892
892
  width: 36,
893
893
  height: 36,
894
894
  alignItems: "center",
@@ -897,8 +897,8 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
897
897
  cursor: e ? "pointer" : "default",
898
898
  backgroundColor: n ? "$primary" : "transparent",
899
899
  hoverStyle: e ? { backgroundColor: n ? "$primary" : "$backgroundHover" } : {},
900
- onPress: () => e && P(e),
901
- children: /* @__PURE__ */ c(N, {
900
+ onPress: () => e && N(e),
901
+ children: /* @__PURE__ */ l(P, {
902
902
  color: n ? "$primaryColor" : "$color",
903
903
  fontSize: 12,
904
904
  fontWeight: n ? "700" : "400",
@@ -907,32 +907,32 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
907
907
  }, t);
908
908
  })]
909
909
  }),
910
- S === "datetime-local" && /* @__PURE__ */ l(A, {
910
+ S === "datetime-local" && /* @__PURE__ */ u(j, {
911
911
  marginTop: "$2",
912
912
  paddingTop: "$3",
913
913
  borderTopWidth: 1,
914
914
  borderColor: "$borderColor",
915
915
  gap: "$2",
916
- children: [/* @__PURE__ */ l(k, {
916
+ children: [/* @__PURE__ */ u(A, {
917
917
  justifyContent: "space-around",
918
918
  alignItems: "center",
919
919
  children: [
920
- /* @__PURE__ */ l(A, {
920
+ /* @__PURE__ */ u(j, {
921
921
  alignItems: "center",
922
922
  gap: "$1",
923
923
  children: [
924
- /* @__PURE__ */ c(B, {
924
+ /* @__PURE__ */ l(B, {
925
925
  type: "button",
926
926
  size: "sm",
927
927
  variant: "ghost",
928
928
  padding: 0,
929
929
  onPress: () => F(1, 0, 0),
930
- children: /* @__PURE__ */ c(N, {
930
+ children: /* @__PURE__ */ l(P, {
931
931
  fontSize: 16,
932
932
  children: "+"
933
933
  })
934
934
  }),
935
- /* @__PURE__ */ c(H, {
935
+ /* @__PURE__ */ l(H, {
936
936
  size: "sm",
937
937
  width: 52,
938
938
  style: { textAlign: "center" },
@@ -950,20 +950,20 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
950
950
  }
951
951
  }
952
952
  }),
953
- /* @__PURE__ */ c(B, {
953
+ /* @__PURE__ */ l(B, {
954
954
  type: "button",
955
955
  size: "sm",
956
956
  variant: "ghost",
957
957
  padding: 0,
958
958
  onPress: () => F(-1, 0, 0),
959
- children: /* @__PURE__ */ c(N, {
959
+ children: /* @__PURE__ */ l(P, {
960
960
  fontSize: 16,
961
961
  children: "-"
962
962
  })
963
963
  })
964
964
  ]
965
965
  }),
966
- /* @__PURE__ */ c(N, {
966
+ /* @__PURE__ */ l(P, {
967
967
  fontSize: 16,
968
968
  color: "muted",
969
969
  marginTop: 10,
@@ -971,22 +971,22 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
971
971
  top: -2,
972
972
  children: ":"
973
973
  }),
974
- /* @__PURE__ */ l(A, {
974
+ /* @__PURE__ */ u(j, {
975
975
  alignItems: "center",
976
976
  gap: "$1",
977
977
  children: [
978
- /* @__PURE__ */ c(B, {
978
+ /* @__PURE__ */ l(B, {
979
979
  type: "button",
980
980
  size: "sm",
981
981
  variant: "ghost",
982
982
  padding: 0,
983
983
  onPress: () => F(0, 1, 0),
984
- children: /* @__PURE__ */ c(N, {
984
+ children: /* @__PURE__ */ l(P, {
985
985
  fontSize: 16,
986
986
  children: "+"
987
987
  })
988
988
  }),
989
- /* @__PURE__ */ c(H, {
989
+ /* @__PURE__ */ l(H, {
990
990
  size: "sm",
991
991
  width: 52,
992
992
  style: { textAlign: "center" },
@@ -1003,20 +1003,20 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
1003
1003
  }
1004
1004
  }
1005
1005
  }),
1006
- /* @__PURE__ */ c(B, {
1006
+ /* @__PURE__ */ l(B, {
1007
1007
  type: "button",
1008
1008
  size: "sm",
1009
1009
  variant: "ghost",
1010
1010
  padding: 0,
1011
1011
  onPress: () => F(0, -1, 0),
1012
- children: /* @__PURE__ */ c(N, {
1012
+ children: /* @__PURE__ */ l(P, {
1013
1013
  fontSize: 16,
1014
1014
  children: "-"
1015
1015
  })
1016
1016
  })
1017
1017
  ]
1018
1018
  }),
1019
- /* @__PURE__ */ c(N, {
1019
+ /* @__PURE__ */ l(P, {
1020
1020
  fontSize: 16,
1021
1021
  color: "muted",
1022
1022
  marginTop: 10,
@@ -1024,22 +1024,22 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
1024
1024
  top: -2,
1025
1025
  children: ":"
1026
1026
  }),
1027
- /* @__PURE__ */ l(A, {
1027
+ /* @__PURE__ */ u(j, {
1028
1028
  alignItems: "center",
1029
1029
  gap: "$1",
1030
1030
  children: [
1031
- /* @__PURE__ */ c(B, {
1031
+ /* @__PURE__ */ l(B, {
1032
1032
  type: "button",
1033
1033
  size: "sm",
1034
1034
  variant: "ghost",
1035
1035
  padding: 0,
1036
1036
  onPress: () => F(0, 0, 1),
1037
- children: /* @__PURE__ */ c(N, {
1037
+ children: /* @__PURE__ */ l(P, {
1038
1038
  fontSize: 16,
1039
1039
  children: "+"
1040
1040
  })
1041
1041
  }),
1042
- /* @__PURE__ */ c(H, {
1042
+ /* @__PURE__ */ l(H, {
1043
1043
  size: "sm",
1044
1044
  width: 52,
1045
1045
  style: { textAlign: "center" },
@@ -1056,25 +1056,25 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
1056
1056
  }
1057
1057
  }
1058
1058
  }),
1059
- /* @__PURE__ */ c(B, {
1059
+ /* @__PURE__ */ l(B, {
1060
1060
  type: "button",
1061
1061
  size: "sm",
1062
1062
  variant: "ghost",
1063
1063
  padding: 0,
1064
1064
  onPress: () => F(0, 0, -1),
1065
- children: /* @__PURE__ */ c(N, {
1065
+ children: /* @__PURE__ */ l(P, {
1066
1066
  fontSize: 16,
1067
1067
  children: "-"
1068
1068
  })
1069
1069
  })
1070
1070
  ]
1071
1071
  }),
1072
- /* @__PURE__ */ c(A, {
1072
+ /* @__PURE__ */ l(j, {
1073
1073
  justifyContent: "center",
1074
1074
  marginTop: 10,
1075
1075
  position: "relative",
1076
1076
  top: -2,
1077
- children: /* @__PURE__ */ c(B, {
1077
+ children: /* @__PURE__ */ l(B, {
1078
1078
  type: "button",
1079
1079
  size: "sm",
1080
1080
  variant: "primary",
@@ -1083,7 +1083,7 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
1083
1083
  borderRadius: "$2",
1084
1084
  minWidth: 46,
1085
1085
  backgroundColor: "$primary",
1086
- children: /* @__PURE__ */ c(N, {
1086
+ children: /* @__PURE__ */ l(P, {
1087
1087
  fontSize: 10,
1088
1088
  fontWeight: "900",
1089
1089
  color: "$primaryColor",
@@ -1092,10 +1092,10 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
1092
1092
  })
1093
1093
  })
1094
1094
  ]
1095
- }), /* @__PURE__ */ l(k, {
1095
+ }), /* @__PURE__ */ u(A, {
1096
1096
  marginTop: "$1",
1097
1097
  children: [
1098
- /* @__PURE__ */ c(B, {
1098
+ /* @__PURE__ */ l(B, {
1099
1099
  type: "button",
1100
1100
  variant: "default",
1101
1101
  size: "sm",
@@ -1103,8 +1103,8 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
1103
1103
  flex: 1,
1104
1104
  children: m("Now")
1105
1105
  }),
1106
- /* @__PURE__ */ c(f, { width: 8 }),
1107
- /* @__PURE__ */ c(B, {
1106
+ /* @__PURE__ */ l(p, { width: 8 }),
1107
+ /* @__PURE__ */ l(B, {
1108
1108
  type: "button",
1109
1109
  variant: "primary",
1110
1110
  size: "sm",
@@ -1117,30 +1117,30 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
1117
1117
  })
1118
1118
  ]
1119
1119
  });
1120
- return /* @__PURE__ */ c(A, {
1120
+ return /* @__PURE__ */ l(j, {
1121
1121
  position: "relative",
1122
1122
  width: d.width ?? "100%",
1123
1123
  zIndex: h ? 1e4 : 1,
1124
1124
  "data-fieldname": d.name,
1125
- children: /* @__PURE__ */ c(U, {
1126
- trigger: re,
1127
- content: z,
1128
- placement: u,
1125
+ children: /* @__PURE__ */ l(U, {
1126
+ trigger: ne,
1127
+ content: re,
1128
+ placement: c,
1129
1129
  open: h,
1130
1130
  onOpenChange: g
1131
1131
  })
1132
1132
  });
1133
1133
  });
1134
- ce.displayName = "DatePicker";
1134
+ le.displayName = "DatePicker";
1135
1135
  //#endregion
1136
1136
  //#region src/components/Select.tsx
1137
- var W = e.forwardRef(({ error: t, size: n = "md", value: r, onChange: i, onValueChange: a, options: s, placeholder: u, disabled: d, name: f, color: p, onBlur: m, onFocus: h, placement: g, backgroundColor: y, borderWidth: b, borderColor: x, borderRadius: S, paddingHorizontal: C, ...w }, T) => {
1138
- let { t: E } = _("ui"), D = (s || []).find((e) => e.value === r), O = D ? D.label : u || "Select an option...", [k, j] = o(!1), M = (e) => {
1137
+ var W = e.forwardRef(({ error: t, size: n = "md", value: r, onChange: i, onValueChange: a, options: o, placeholder: c, disabled: d, name: f, color: p, onBlur: m, onFocus: h, placement: g, backgroundColor: _, borderWidth: b, borderColor: x, borderRadius: S, paddingHorizontal: C, ...w }, T) => {
1138
+ let { t: E } = v("ui"), D = (o || []).find((e) => e.value === r), O = D ? D.label : c || "Select an option...", [k, A] = s(!1), M = (e) => {
1139
1139
  a?.(e), i && i({ target: {
1140
1140
  value: e,
1141
1141
  name: f || ""
1142
- } }), j(!1);
1143
- }, N = /* @__PURE__ */ l(B, {
1142
+ } }), A(!1);
1143
+ }, N = /* @__PURE__ */ u(B, {
1144
1144
  ref: T,
1145
1145
  disabled: d,
1146
1146
  tabIndex: -1,
@@ -1150,19 +1150,19 @@ var W = e.forwardRef(({ error: t, size: n = "md", value: r, onChange: i, onValue
1150
1150
  justifyContent: "space-between",
1151
1151
  borderWidth: b ?? 1,
1152
1152
  borderColor: t ? "$error" : x ?? "$borderColor",
1153
- backgroundColor: y ?? "$backgroundSecondary",
1153
+ backgroundColor: _ ?? "$backgroundSecondary",
1154
1154
  borderRadius: S ?? "$round",
1155
1155
  paddingHorizontal: C,
1156
1156
  hoverStyle: { backgroundColor: "$backgroundHover" },
1157
1157
  pointerEvents: "none",
1158
- children: [/* @__PURE__ */ c(F, {
1158
+ children: [/* @__PURE__ */ l(I, {
1159
1159
  fontSize: n === "sm" ? "$xs" : "$sm",
1160
1160
  color: D ? "$color" : "$colorMuted",
1161
1161
  numberOfLines: 1,
1162
1162
  flex: 1,
1163
1163
  overflow: "hidden",
1164
1164
  children: O
1165
- }), /* @__PURE__ */ c(A, {
1165
+ }), /* @__PURE__ */ l(j, {
1166
1166
  width: 0,
1167
1167
  height: 0,
1168
1168
  borderLeftWidth: 5,
@@ -1173,47 +1173,47 @@ var W = e.forwardRef(({ error: t, size: n = "md", value: r, onChange: i, onValue
1173
1173
  borderTopColor: "$colorMuted",
1174
1174
  opacity: .6
1175
1175
  })]
1176
- }), [P, I] = o(""), L = (s || []).filter((e) => e.label.toLowerCase().includes(P.toLowerCase())), R = /* @__PURE__ */ l(A, { children: [(s || []).length > 5 && /* @__PURE__ */ c(A, {
1176
+ }), [P, F] = s(""), L = (o || []).filter((e) => e.label.toLowerCase().includes(P.toLowerCase())), R = /* @__PURE__ */ u(j, { children: [(o || []).length > 5 && /* @__PURE__ */ l(j, {
1177
1177
  padding: "$xs",
1178
1178
  paddingBottom: 0,
1179
- children: /* @__PURE__ */ c(H, {
1179
+ children: /* @__PURE__ */ l(H, {
1180
1180
  size: "sm",
1181
1181
  placeholder: E("search", { defaultValue: "Search..." }),
1182
1182
  value: P,
1183
- onChangeText: I,
1183
+ onChangeText: F,
1184
1184
  onKeyDown: (e) => e.stopPropagation()
1185
1185
  })
1186
- }), /* @__PURE__ */ c(v, {
1186
+ }), /* @__PURE__ */ l(y, {
1187
1187
  maxHeight: 250,
1188
- children: /* @__PURE__ */ l(A, {
1188
+ children: /* @__PURE__ */ u(j, {
1189
1189
  gap: "$xs",
1190
1190
  padding: "$xs",
1191
1191
  children: [
1192
- u && /* @__PURE__ */ c(B, {
1192
+ c && /* @__PURE__ */ l(B, {
1193
1193
  variant: "ghost",
1194
1194
  size: "sm",
1195
1195
  justifyContent: "flex-start",
1196
1196
  onPress: () => M(""),
1197
- children: /* @__PURE__ */ c(F, {
1197
+ children: /* @__PURE__ */ l(I, {
1198
1198
  fontSize: "$sm",
1199
1199
  color: "$colorMuted",
1200
- children: u
1200
+ children: c
1201
1201
  })
1202
1202
  }),
1203
- L.length === 0 && /* @__PURE__ */ c(F, {
1203
+ L.length === 0 && /* @__PURE__ */ l(I, {
1204
1204
  fontSize: "$sm",
1205
1205
  color: "$colorMuted",
1206
1206
  padding: "$sm",
1207
1207
  textAlign: "center",
1208
1208
  children: E("no_options_found", { defaultValue: "No options found" })
1209
1209
  }),
1210
- L.map((e) => /* @__PURE__ */ c(B, {
1210
+ L.map((e) => /* @__PURE__ */ l(B, {
1211
1211
  variant: "ghost",
1212
1212
  size: "sm",
1213
1213
  justifyContent: "flex-start",
1214
1214
  onPress: () => M(e.value),
1215
1215
  backgroundColor: e.value === r ? "$backgroundActive" : "transparent",
1216
- children: /* @__PURE__ */ c(F, {
1216
+ children: /* @__PURE__ */ l(I, {
1217
1217
  fontSize: "$sm",
1218
1218
  children: e.label
1219
1219
  })
@@ -1222,37 +1222,37 @@ var W = e.forwardRef(({ error: t, size: n = "md", value: r, onChange: i, onValue
1222
1222
  })
1223
1223
  })] });
1224
1224
  return e.useEffect(() => {
1225
- k || I("");
1226
- }, [k]), /* @__PURE__ */ c(A, {
1225
+ k || F("");
1226
+ }, [k]), /* @__PURE__ */ l(j, {
1227
1227
  position: "relative",
1228
1228
  width: w.width || "100%",
1229
1229
  minWidth: w.minWidth,
1230
1230
  ...w,
1231
- children: /* @__PURE__ */ c(U, {
1231
+ children: /* @__PURE__ */ l(U, {
1232
1232
  trigger: N,
1233
1233
  content: R,
1234
1234
  placement: g || "bottom-start",
1235
1235
  open: k,
1236
- onOpenChange: j
1236
+ onOpenChange: A
1237
1237
  })
1238
1238
  });
1239
1239
  });
1240
1240
  W.displayName = "Select";
1241
1241
  //#endregion
1242
1242
  //#region src/components/Toast.tsx
1243
- var le = {
1243
+ var ue = {
1244
1244
  success: "✓",
1245
1245
  error: "✕",
1246
1246
  warning: "⚠",
1247
1247
  info: "ℹ"
1248
1248
  };
1249
- function ue({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }) {
1250
- return r(() => {
1251
- if (n > 0 && i) {
1252
- let e = setTimeout(i, n);
1249
+ function de({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: r }) {
1250
+ return i(() => {
1251
+ if (n > 0 && r) {
1252
+ let e = setTimeout(r, n);
1253
1253
  return () => clearTimeout(e);
1254
1254
  }
1255
- }, [n, i]), /* @__PURE__ */ c(A, {
1255
+ }, [n, r]), /* @__PURE__ */ l(j, {
1256
1256
  className: `toast toast-${t}`,
1257
1257
  role: "alert",
1258
1258
  "aria-live": "assertive",
@@ -1268,22 +1268,22 @@ function ue({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }
1268
1268
  width: 0,
1269
1269
  height: 4
1270
1270
  },
1271
- children: /* @__PURE__ */ l(k, {
1271
+ children: /* @__PURE__ */ u(A, {
1272
1272
  alignItems: "center",
1273
1273
  gap: "$sm",
1274
1274
  children: [
1275
- /* @__PURE__ */ c(N, {
1275
+ /* @__PURE__ */ l(P, {
1276
1276
  fontWeight: "600",
1277
- children: le[t]
1277
+ children: ue[t]
1278
1278
  }),
1279
- /* @__PURE__ */ c(N, {
1279
+ /* @__PURE__ */ l(P, {
1280
1280
  flex: 1,
1281
1281
  children: e
1282
1282
  }),
1283
- i && /* @__PURE__ */ c(B, {
1283
+ r && /* @__PURE__ */ l(B, {
1284
1284
  variant: "ghost",
1285
1285
  size: "sm",
1286
- onPress: i,
1286
+ onPress: r,
1287
1287
  "aria-label": "Dismiss notification",
1288
1288
  children: "✕"
1289
1289
  })
@@ -1291,8 +1291,8 @@ function ue({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }
1291
1291
  })
1292
1292
  });
1293
1293
  }
1294
- function de({ toasts: e, onDismiss: t }) {
1295
- return /* @__PURE__ */ c(A, {
1294
+ function fe({ toasts: e, onDismiss: t }) {
1295
+ return /* @__PURE__ */ l(j, {
1296
1296
  "aria-label": "Notifications",
1297
1297
  position: "fixed",
1298
1298
  bottom: "$lg",
@@ -1300,9 +1300,9 @@ function de({ toasts: e, onDismiss: t }) {
1300
1300
  zIndex: 60,
1301
1301
  gap: "$sm",
1302
1302
  pointerEvents: "none",
1303
- children: e.map((e) => /* @__PURE__ */ c(A, {
1303
+ children: e.map((e) => /* @__PURE__ */ l(j, {
1304
1304
  pointerEvents: "auto",
1305
- children: /* @__PURE__ */ c(ue, {
1305
+ children: /* @__PURE__ */ l(de, {
1306
1306
  ...e,
1307
1307
  onDismiss: () => t(e.id)
1308
1308
  })
@@ -1311,10 +1311,10 @@ function de({ toasts: e, onDismiss: t }) {
1311
1311
  }
1312
1312
  //#endregion
1313
1313
  //#region src/components/Portal.tsx
1314
- var fe = t(null), pe = ({ children: e }) => {
1315
- let [t, n] = o(/* @__PURE__ */ new Map());
1314
+ var pe = t(null), me = ({ children: e }) => {
1315
+ let [t, n] = s(/* @__PURE__ */ new Map());
1316
1316
  /* v8 ignore stop */
1317
- return /* @__PURE__ */ l(fe.Provider, {
1317
+ return /* @__PURE__ */ u(pe.Provider, {
1318
1318
  value: {
1319
1319
  register: (e, t) => {
1320
1320
  n((n) => {
@@ -1329,32 +1329,32 @@ var fe = t(null), pe = ({ children: e }) => {
1329
1329
  });
1330
1330
  }
1331
1331
  },
1332
- children: [e, /* @__PURE__ */ c(me, { portals: t })]
1332
+ children: [e, /* @__PURE__ */ l(he, { portals: t })]
1333
1333
  });
1334
- }, me = ({ portals: t }) => typeof document < "u" ? null : /* @__PURE__ */ c(s, { children: Array.from(t.entries()).map(([t, n]) => /* @__PURE__ */ c(e.Fragment, { children: n }, t)) }), G = ({ children: e }) => {
1335
- let t = n(fe), [i] = o(() => Math.random().toString(36).substr(2, 9));
1336
- if (r(() => {
1337
- if (!(typeof document < "u" || !t))
1334
+ }, he = ({ portals: t }) => typeof document < "u" ? null : /* @__PURE__ */ l(c, { children: Array.from(t.entries()).map(([t, n]) => /* @__PURE__ */ l(e.Fragment, { children: n }, t)) }), G = ({ children: e }) => {
1335
+ let t = r(pe), [n] = s(() => Math.random().toString(36).substr(2, 9));
1336
+ if (i(() => {
1337
+ if (typeof document > "u" && t)
1338
1338
  /* v8 ignore next */
1339
- return () => t.unregister(i);
1340
- }, [t, i]), r(() => {
1339
+ return () => t.unregister(n);
1340
+ }, [t, n]), i(() => {
1341
1341
  /* v8 ignore start */
1342
- typeof document > "u" && t && t.register(i, e);
1342
+ typeof document > "u" && t && t.register(n, e);
1343
1343
  /* v8 ignore stop */
1344
1344
  }), typeof document < "u") {
1345
1345
  let t = document.getElementById("portal-root");
1346
1346
  t || (t = document.createElement("div"), t.id = "portal-root", document.body.appendChild(t));
1347
1347
  let n = document.documentElement.className;
1348
- return t.className !== n && (t.className = n), y.createPortal(e, t);
1348
+ return t.className !== n && (t.className = n), b.createPortal(e, t);
1349
1349
  }
1350
1350
  /* v8 ignore next */
1351
1351
  return null;
1352
- }, he = {
1352
+ }, ge = {
1353
1353
  sm: 400,
1354
1354
  md: 600,
1355
1355
  lg: 900,
1356
1356
  xl: 1200
1357
- }, ge = ({ isOpen: e, onClose: t, title: n, footer: r, size: i = "md", children: a }) => e ? /* @__PURE__ */ c(G, { children: /* @__PURE__ */ l(j, {
1357
+ }, _e = ({ isOpen: e, onClose: t, title: n, footer: r, size: i = "md", children: a }) => e ? /* @__PURE__ */ l(G, { children: /* @__PURE__ */ u(M, {
1358
1358
  position: "absolute",
1359
1359
  top: 0,
1360
1360
  left: 0,
@@ -1365,7 +1365,7 @@ var fe = t(null), pe = ({ children: e }) => {
1365
1365
  zIndex: 99999,
1366
1366
  alignItems: "center",
1367
1367
  justifyContent: "center",
1368
- children: [/* @__PURE__ */ c(A, {
1368
+ children: [/* @__PURE__ */ l(j, {
1369
1369
  position: "absolute",
1370
1370
  top: 0,
1371
1371
  left: 0,
@@ -1374,8 +1374,8 @@ var fe = t(null), pe = ({ children: e }) => {
1374
1374
  backgroundColor: "$shadowColor",
1375
1375
  onPress: t,
1376
1376
  zIndex: 10
1377
- }), /* @__PURE__ */ l(V, {
1378
- width: he[i],
1377
+ }), /* @__PURE__ */ u(V, {
1378
+ width: ge[i],
1379
1379
  maxWidth: "95%",
1380
1380
  maxHeight: "90vh",
1381
1381
  backgroundColor: "$background",
@@ -1387,33 +1387,33 @@ var fe = t(null), pe = ({ children: e }) => {
1387
1387
  borderColor: "$borderColor",
1388
1388
  zIndex: 100,
1389
1389
  children: [
1390
- /* @__PURE__ */ l(k, {
1390
+ /* @__PURE__ */ u(A, {
1391
1391
  padding: "$4",
1392
1392
  borderBottomWidth: 1,
1393
1393
  borderBottomColor: "$borderColor",
1394
1394
  justifyContent: "space-between",
1395
1395
  alignItems: "center",
1396
1396
  backgroundColor: "$backgroundSecondary",
1397
- children: [/* @__PURE__ */ c(N, {
1397
+ children: [/* @__PURE__ */ l(P, {
1398
1398
  fontWeight: "700",
1399
1399
  size: "lg",
1400
1400
  children: n
1401
- }), /* @__PURE__ */ c(B, {
1401
+ }), /* @__PURE__ */ l(B, {
1402
1402
  size: "sm",
1403
1403
  variant: "ghost",
1404
1404
  onPress: t,
1405
1405
  padding: "$2",
1406
- children: /* @__PURE__ */ c(N, { children: "✕" })
1406
+ children: /* @__PURE__ */ l(P, { children: "✕" })
1407
1407
  })]
1408
1408
  }),
1409
- /* @__PURE__ */ c(A, {
1409
+ /* @__PURE__ */ l(j, {
1410
1410
  flex: 1,
1411
1411
  overflow: "scroll",
1412
1412
  minHeight: 300,
1413
1413
  backgroundColor: "$background",
1414
1414
  children: a
1415
1415
  }),
1416
- r && /* @__PURE__ */ c(k, {
1416
+ r && /* @__PURE__ */ l(A, {
1417
1417
  padding: "$4",
1418
1418
  borderTopWidth: 1,
1419
1419
  borderTopColor: "$borderColor",
@@ -1427,8 +1427,8 @@ var fe = t(null), pe = ({ children: e }) => {
1427
1427
  }) }) : null;
1428
1428
  //#endregion
1429
1429
  //#region src/components/Drawer.tsx
1430
- function _e({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, footer: a }) {
1431
- return e ? /* @__PURE__ */ c(G, { children: /* @__PURE__ */ l(j, {
1430
+ function ve({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, footer: a }) {
1431
+ return e ? /* @__PURE__ */ l(G, { children: /* @__PURE__ */ u(M, {
1432
1432
  position: "absolute",
1433
1433
  top: 0,
1434
1434
  left: 0,
@@ -1437,7 +1437,7 @@ function _e({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
1437
1437
  width: "100%",
1438
1438
  height: "100%",
1439
1439
  zIndex: 1e5,
1440
- children: [/* @__PURE__ */ c(A, {
1440
+ children: [/* @__PURE__ */ l(j, {
1441
1441
  position: "absolute",
1442
1442
  top: 0,
1443
1443
  left: 0,
@@ -1446,7 +1446,7 @@ function _e({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
1446
1446
  backgroundColor: "$shadowColor",
1447
1447
  onPress: t,
1448
1448
  zIndex: 10
1449
- }), /* @__PURE__ */ l(V, {
1449
+ }), /* @__PURE__ */ u(V, {
1450
1450
  style: {
1451
1451
  position: "fixed",
1452
1452
  top: 0,
@@ -1469,31 +1469,31 @@ function _e({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
1469
1469
  elevated: !1,
1470
1470
  zIndex: 100,
1471
1471
  children: [
1472
- /* @__PURE__ */ l(k, {
1472
+ /* @__PURE__ */ u(A, {
1473
1473
  padding: "$md",
1474
1474
  borderBottomWidth: 1,
1475
1475
  borderColor: "$borderColor",
1476
1476
  justifyContent: "space-between",
1477
1477
  alignItems: "center",
1478
1478
  backgroundColor: "$backgroundSecondary",
1479
- children: [/* @__PURE__ */ c(N, {
1479
+ children: [/* @__PURE__ */ l(P, {
1480
1480
  fontWeight: "700",
1481
1481
  size: "$md",
1482
1482
  children: n
1483
- }), /* @__PURE__ */ c(B, {
1483
+ }), /* @__PURE__ */ l(B, {
1484
1484
  size: "sm",
1485
1485
  variant: "ghost",
1486
1486
  onPress: t,
1487
1487
  children: "✕"
1488
1488
  })]
1489
1489
  }),
1490
- /* @__PURE__ */ c(A, {
1490
+ /* @__PURE__ */ l(j, {
1491
1491
  flex: 1,
1492
1492
  padding: "$md",
1493
1493
  style: { overflowY: "auto" },
1494
1494
  children: i
1495
1495
  }),
1496
- a && /* @__PURE__ */ c(k, {
1496
+ a && /* @__PURE__ */ l(A, {
1497
1497
  padding: "$md",
1498
1498
  borderTopWidth: 1,
1499
1499
  borderColor: "$borderColor",
@@ -1508,15 +1508,15 @@ function _e({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
1508
1508
  }
1509
1509
  //#endregion
1510
1510
  //#region src/components/Avatar.tsx
1511
- var ve = {
1511
+ var ye = {
1512
1512
  $sm: 24,
1513
1513
  $md: 32,
1514
1514
  $lg: 40,
1515
1515
  $xl: 48
1516
1516
  };
1517
- function ye({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidth: i, borderColor: a }) {
1518
- let [s, l] = o(!1), u = typeof n == "number" ? n : ve[n] || 32;
1519
- return /* @__PURE__ */ c(A, {
1517
+ function be({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidth: i, borderColor: a }) {
1518
+ let [o, c] = s(!1), u = typeof n == "number" ? n : ye[n] || 32;
1519
+ return /* @__PURE__ */ l(j, {
1520
1520
  width: u,
1521
1521
  height: u,
1522
1522
  borderRadius: r ? u / 2 : "$sm",
@@ -1526,7 +1526,7 @@ function ye({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
1526
1526
  overflow: "hidden",
1527
1527
  borderWidth: i,
1528
1528
  borderColor: a,
1529
- children: e && !s ? /* @__PURE__ */ c(b, {
1529
+ children: e && !o ? /* @__PURE__ */ l(x, {
1530
1530
  source: {
1531
1531
  uri: e,
1532
1532
  width: u,
@@ -1534,8 +1534,8 @@ function ye({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
1534
1534
  },
1535
1535
  width: "100%",
1536
1536
  height: "100%",
1537
- onError: () => l(!0)
1538
- }) : typeof t == "string" ? /* @__PURE__ */ c(N, {
1537
+ onError: () => c(!0)
1538
+ }) : typeof t == "string" ? /* @__PURE__ */ l(P, {
1539
1539
  color: "$colorMuted",
1540
1540
  size: "$sm",
1541
1541
  fontWeight: "600",
@@ -1545,8 +1545,8 @@ function ye({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
1545
1545
  }
1546
1546
  //#endregion
1547
1547
  //#region src/components/Separator.tsx
1548
- function be({ vertical: e }) {
1549
- return /* @__PURE__ */ c(A, {
1548
+ function xe({ vertical: e }) {
1549
+ return /* @__PURE__ */ l(j, {
1550
1550
  width: e ? 1 : "100%",
1551
1551
  height: e ? "100%" : 1,
1552
1552
  backgroundColor: "$borderColor"
@@ -1554,12 +1554,12 @@ function be({ vertical: e }) {
1554
1554
  }
1555
1555
  //#endregion
1556
1556
  //#region src/components/Icon.tsx
1557
- function xe(e) {
1557
+ function Se(e) {
1558
1558
  return e.replace(/[-_](.)/g, (e, t) => t.toUpperCase()).replace(/^(.)/, (e) => e.toUpperCase());
1559
1559
  }
1560
1560
  function K({ name: e, size: t, color: n, strokeWidth: r, ...i }) {
1561
- let a = xe(e), o = a in x ? x[a] : x.Box;
1562
- return /* @__PURE__ */ c(o, {
1561
+ let a = Se(e), o = a in S ? S[a] : S.Box;
1562
+ return /* @__PURE__ */ l(o, {
1563
1563
  size: t,
1564
1564
  color: n,
1565
1565
  strokeWidth: r,
@@ -1567,21 +1567,424 @@ function K({ name: e, size: t, color: n, strokeWidth: r, ...i }) {
1567
1567
  });
1568
1568
  }
1569
1569
  //#endregion
1570
+ //#region src/components/EmptyState.tsx
1571
+ function Ce({ icon: e = "inbox", customIcon: t, title: n, description: r, action: i, children: a, compact: o = !1, testID: s = "empty-state" }) {
1572
+ return /* @__PURE__ */ u(j, {
1573
+ alignItems: "center",
1574
+ justifyContent: "center",
1575
+ padding: o ? "$md" : "$xl",
1576
+ gap: "$sm",
1577
+ testID: s,
1578
+ width: "100%",
1579
+ children: [
1580
+ /* @__PURE__ */ l(j, {
1581
+ alignItems: "center",
1582
+ justifyContent: "center",
1583
+ width: o ? 40 : 56,
1584
+ height: o ? 40 : 56,
1585
+ borderRadius: "$round",
1586
+ backgroundColor: "$backgroundSecondary",
1587
+ marginBottom: "$xs",
1588
+ children: t || /* @__PURE__ */ l(K, {
1589
+ name: e,
1590
+ size: o ? 20 : 28,
1591
+ color: "var(--color-muted, #94a3b8)"
1592
+ })
1593
+ }),
1594
+ /* @__PURE__ */ l(R, {
1595
+ size: o ? "$xs" : "$sm",
1596
+ textAlign: "center",
1597
+ color: "$color",
1598
+ children: n
1599
+ }),
1600
+ r && /* @__PURE__ */ l(I, {
1601
+ size: "$xs",
1602
+ textAlign: "center",
1603
+ color: "$colorMuted",
1604
+ maxWidth: 380,
1605
+ children: r
1606
+ }),
1607
+ i && /* @__PURE__ */ l(j, {
1608
+ marginTop: "$sm",
1609
+ children: /* @__PURE__ */ u(B, {
1610
+ size: o ? "sm" : "md",
1611
+ variant: i.variant || "default",
1612
+ onPress: i.onPress,
1613
+ children: [i.icon && /* @__PURE__ */ l(K, {
1614
+ name: i.icon,
1615
+ size: 14,
1616
+ style: { marginRight: 6 }
1617
+ }), i.label]
1618
+ })
1619
+ }),
1620
+ a && /* @__PURE__ */ l(j, {
1621
+ marginTop: "$xs",
1622
+ children: a
1623
+ })
1624
+ ]
1625
+ });
1626
+ }
1627
+ //#endregion
1628
+ //#region src/components/TypePill.tsx
1629
+ var we = {
1630
+ default: {
1631
+ bg: "$backgroundSecondary",
1632
+ text: "$color",
1633
+ border: "$borderColor"
1634
+ },
1635
+ neutral: {
1636
+ bg: "$backgroundSecondary",
1637
+ text: "$colorMuted",
1638
+ border: "$borderColorMuted"
1639
+ },
1640
+ primary: {
1641
+ bg: "rgba(139, 92, 246, 0.12)",
1642
+ text: "$primary",
1643
+ border: "rgba(139, 92, 246, 0.25)"
1644
+ },
1645
+ secondary: {
1646
+ bg: "$backgroundTertiary",
1647
+ text: "$colorSecondary",
1648
+ border: "$borderColor"
1649
+ },
1650
+ success: {
1651
+ bg: "rgba(34, 197, 94, 0.12)",
1652
+ text: "#15803d",
1653
+ border: "rgba(34, 197, 94, 0.25)"
1654
+ },
1655
+ warning: {
1656
+ bg: "rgba(245, 158, 11, 0.12)",
1657
+ text: "#b45309",
1658
+ border: "rgba(245, 158, 11, 0.25)"
1659
+ },
1660
+ error: {
1661
+ bg: "rgba(239, 68, 68, 0.12)",
1662
+ text: "#b91c1c",
1663
+ border: "rgba(239, 68, 68, 0.25)"
1664
+ },
1665
+ info: {
1666
+ bg: "rgba(59, 130, 246, 0.12)",
1667
+ text: "#1d4ed8",
1668
+ border: "rgba(59, 130, 246, 0.25)"
1669
+ }
1670
+ };
1671
+ function Te({ label: e, variant: t = "default", icon: n, size: r = "sm", onRemove: i, testID: a = "type-pill", className: o, style: s }) {
1672
+ let c = we[t] || we.default, d = r === "sm";
1673
+ return /* @__PURE__ */ u(A, {
1674
+ testID: a,
1675
+ className: o,
1676
+ alignItems: "center",
1677
+ backgroundColor: c.bg,
1678
+ borderWidth: 1,
1679
+ borderColor: c.border || "transparent",
1680
+ borderRadius: "$round",
1681
+ paddingHorizontal: d ? "$xs" : "$sm",
1682
+ paddingVertical: d ? 2 : "$xs",
1683
+ gap: d ? 4 : 6,
1684
+ style: {
1685
+ display: "inline-flex",
1686
+ alignSelf: "flex-start",
1687
+ ...s
1688
+ },
1689
+ children: [
1690
+ n && /* @__PURE__ */ l(K, {
1691
+ name: n,
1692
+ size: d ? 12 : 14,
1693
+ color: c.text
1694
+ }),
1695
+ /* @__PURE__ */ l(P, {
1696
+ fontSize: d ? "$xs" : "$sm",
1697
+ fontWeight: "500",
1698
+ color: c.text,
1699
+ lineHeight: d ? 16 : 20,
1700
+ children: e
1701
+ }),
1702
+ i && /* @__PURE__ */ l(A, {
1703
+ testID: `${a}-remove`,
1704
+ role: "button",
1705
+ cursor: "pointer",
1706
+ onPress: (e) => {
1707
+ e?.stopPropagation?.(), i();
1708
+ },
1709
+ opacity: .7,
1710
+ hoverStyle: { opacity: 1 },
1711
+ marginLeft: 2,
1712
+ children: /* @__PURE__ */ l(K, {
1713
+ name: "x",
1714
+ size: d ? 12 : 14,
1715
+ color: c.text
1716
+ })
1717
+ })
1718
+ ]
1719
+ });
1720
+ }
1721
+ //#endregion
1722
+ //#region src/components/DetailGrid.tsx
1723
+ function Ee({ label: e, value: t, span: n = 1, testID: r, children: i, style: a }) {
1724
+ return /* @__PURE__ */ u(j, {
1725
+ testID: r,
1726
+ gap: 4,
1727
+ flex: n,
1728
+ minWidth: n > 1 ? "100%" : 160,
1729
+ style: a,
1730
+ children: [/* @__PURE__ */ l(P, {
1731
+ fontSize: "$xs",
1732
+ fontWeight: "600",
1733
+ color: "$colorMuted",
1734
+ textTransform: "uppercase",
1735
+ letterSpacing: .5,
1736
+ children: e
1737
+ }), /* @__PURE__ */ l(j, { children: i ?? (typeof t == "string" || typeof t == "number" ? /* @__PURE__ */ l(I, {
1738
+ fontSize: "$sm",
1739
+ color: "$color",
1740
+ fontWeight: "400",
1741
+ children: t
1742
+ }) : t) })]
1743
+ });
1744
+ }
1745
+ function De({ items: e, columns: t = 2, children: n, gap: r = "$md", testID: i = "detail-grid", style: a }) {
1746
+ let o = t === 1 ? "100%" : t === 2 ? "45%" : t === 3 ? "30%" : "22%";
1747
+ return /* @__PURE__ */ l(A, {
1748
+ testID: i,
1749
+ flexWrap: "wrap",
1750
+ gap: r,
1751
+ alignItems: "flex-start",
1752
+ width: "100%",
1753
+ style: a,
1754
+ children: e ? e.map((e, n) => {
1755
+ let r = e.span || 1;
1756
+ return /* @__PURE__ */ u(j, {
1757
+ gap: 4,
1758
+ flex: r,
1759
+ minWidth: r >= t ? "100%" : o,
1760
+ children: [/* @__PURE__ */ l(P, {
1761
+ fontSize: "$xs",
1762
+ fontWeight: "600",
1763
+ color: "$colorMuted",
1764
+ textTransform: "uppercase",
1765
+ letterSpacing: .5,
1766
+ children: e.label
1767
+ }), /* @__PURE__ */ l(j, { children: typeof e.value == "string" || typeof e.value == "number" ? /* @__PURE__ */ l(I, {
1768
+ fontSize: "$sm",
1769
+ color: "$color",
1770
+ fontWeight: "400",
1771
+ children: e.value
1772
+ }) : e.value })]
1773
+ }, e.key || `${e.label}-${n}`);
1774
+ }) : n
1775
+ });
1776
+ }
1777
+ De.Item = Ee;
1778
+ //#endregion
1779
+ //#region src/components/FileUpload.tsx
1780
+ function q(e) {
1781
+ if (!e || e <= 0) return "0 B";
1782
+ let t = 1024, n = [
1783
+ "B",
1784
+ "KB",
1785
+ "MB",
1786
+ "GB"
1787
+ ], r = Math.floor(Math.log(e) / Math.log(t));
1788
+ return `${parseFloat((e / t ** r).toFixed(1))} ${n[r]}`;
1789
+ }
1790
+ function Oe(e) {
1791
+ let t = e.split(".");
1792
+ return t.length > 1 ? t.pop().toUpperCase() : "FILE";
1793
+ }
1794
+ function ke({ multiple: e = !1, accept: t, maxSize: r, files: i = [], onFilesSelected: a, onRemoveFile: c, disabled: d = !1, progress: f, title: p = "Drop files here, or browse", helperText: m, testID: h = "file-upload", style: g }) {
1795
+ let _ = o(null), [v, y] = s(!1), [b, x] = s(null), S = n((t) => {
1796
+ if (!t || t.length === 0 || d) return;
1797
+ x(null);
1798
+ let n = Array.from(t), i = [];
1799
+ for (let e of n) {
1800
+ if (r && e.size > r) {
1801
+ x(`File "${e.name}" exceeds maximum allowed size (${q(r)})`);
1802
+ return;
1803
+ }
1804
+ i.push(e);
1805
+ }
1806
+ i.length > 0 && a && a(e ? i : [i[0]]);
1807
+ }, [
1808
+ d,
1809
+ r,
1810
+ e,
1811
+ a
1812
+ ]), C = n((e) => {
1813
+ e.preventDefault(), e.stopPropagation(), !d && !v && y(!0);
1814
+ }, [d, v]), w = n((e) => {
1815
+ e.preventDefault(), e.stopPropagation(), v && y(!1);
1816
+ }, [v]), T = n((e) => {
1817
+ e.preventDefault(), e.stopPropagation(), y(!1), !d && e.dataTransfer && e.dataTransfer.files && S(e.dataTransfer.files);
1818
+ }, [d, S]), E = n((e) => {
1819
+ S(e.target.files), _.current && (_.current.value = "");
1820
+ }, [S]), D = n(() => {
1821
+ !d && _.current && _.current.click();
1822
+ }, [d]);
1823
+ return /* @__PURE__ */ u(j, {
1824
+ gap: "$sm",
1825
+ width: "100%",
1826
+ testID: h,
1827
+ style: g,
1828
+ children: [
1829
+ /* @__PURE__ */ l(H, {
1830
+ type: "file",
1831
+ ref: _,
1832
+ multiple: e,
1833
+ accept: t,
1834
+ "data-testid": `${h}-input`,
1835
+ style: { display: "none" },
1836
+ onChange: E,
1837
+ disabled: d
1838
+ }),
1839
+ /* @__PURE__ */ u(j, {
1840
+ testID: `${h}-dropzone`,
1841
+ borderWidth: 2,
1842
+ borderStyle: "dashed",
1843
+ borderColor: v ? "$primary" : "$borderColor",
1844
+ backgroundColor: v ? "rgba(139, 92, 246, 0.06)" : d ? "$backgroundTertiary" : "$backgroundSecondary",
1845
+ borderRadius: "$md",
1846
+ padding: "$lg",
1847
+ alignItems: "center",
1848
+ justifyContent: "center",
1849
+ cursor: d ? "not-allowed" : "pointer",
1850
+ opacity: d ? .6 : 1,
1851
+ onPress: D,
1852
+ onDragOver: C,
1853
+ onDragLeave: w,
1854
+ onDrop: T,
1855
+ style: {
1856
+ transition: "all 0.15s ease",
1857
+ minHeight: 120
1858
+ },
1859
+ children: [
1860
+ /* @__PURE__ */ l(j, {
1861
+ width: 40,
1862
+ height: 40,
1863
+ borderRadius: "$round",
1864
+ backgroundColor: "$background",
1865
+ alignItems: "center",
1866
+ justifyContent: "center",
1867
+ marginBottom: "$xs",
1868
+ children: /* @__PURE__ */ l(K, {
1869
+ name: "upload-cloud",
1870
+ size: 22,
1871
+ color: v ? "var(--color-primary, #8b5cf6)" : "var(--color-muted, #94a3b8)"
1872
+ })
1873
+ }),
1874
+ /* @__PURE__ */ l(P, {
1875
+ fontSize: "$sm",
1876
+ fontWeight: "500",
1877
+ color: "$color",
1878
+ textAlign: "center",
1879
+ children: p
1880
+ }),
1881
+ m && /* @__PURE__ */ l(I, {
1882
+ fontSize: "$xs",
1883
+ color: "$colorMuted",
1884
+ textAlign: "center",
1885
+ marginTop: 2,
1886
+ children: m
1887
+ })
1888
+ ]
1889
+ }),
1890
+ b && /* @__PURE__ */ l(P, {
1891
+ testID: `${h}-error`,
1892
+ fontSize: "$xs",
1893
+ color: "$error",
1894
+ fontWeight: "500",
1895
+ children: b
1896
+ }),
1897
+ f !== void 0 && f >= 0 && /* @__PURE__ */ l(j, {
1898
+ height: 4,
1899
+ borderRadius: 2,
1900
+ backgroundColor: "$borderColor",
1901
+ overflow: "hidden",
1902
+ width: "100%",
1903
+ children: /* @__PURE__ */ l(j, {
1904
+ height: "100%",
1905
+ width: `${Math.min(100, Math.max(0, f))}%`,
1906
+ backgroundColor: "$primary",
1907
+ style: { transition: "width 0.2s ease" }
1908
+ })
1909
+ }),
1910
+ i.length > 0 && /* @__PURE__ */ l(j, {
1911
+ gap: "$xs",
1912
+ marginTop: "$xs",
1913
+ testID: `${h}-files`,
1914
+ children: i.map((e, t) => {
1915
+ let n = Oe(e.name);
1916
+ return /* @__PURE__ */ u(A, {
1917
+ justifyContent: "space-between",
1918
+ alignItems: "center",
1919
+ paddingHorizontal: "$sm",
1920
+ paddingVertical: "$xs",
1921
+ backgroundColor: "$backgroundSecondary",
1922
+ borderWidth: 1,
1923
+ borderColor: "$borderColorMuted",
1924
+ borderRadius: "$sm",
1925
+ children: [/* @__PURE__ */ u(A, {
1926
+ alignItems: "center",
1927
+ gap: "$sm",
1928
+ flex: 1,
1929
+ children: [/* @__PURE__ */ l(j, {
1930
+ paddingHorizontal: 6,
1931
+ paddingVertical: 2,
1932
+ borderRadius: 4,
1933
+ backgroundColor: "$backgroundTertiary",
1934
+ children: /* @__PURE__ */ l(P, {
1935
+ fontSize: "$xs",
1936
+ fontWeight: "700",
1937
+ color: "$colorSecondary",
1938
+ children: n
1939
+ })
1940
+ }), /* @__PURE__ */ u(j, {
1941
+ flex: 1,
1942
+ children: [/* @__PURE__ */ l(P, {
1943
+ fontSize: "$xs",
1944
+ fontWeight: "500",
1945
+ color: "$color",
1946
+ numberOfLines: 1,
1947
+ children: e.name
1948
+ }), /* @__PURE__ */ l(I, {
1949
+ fontSize: "$xs",
1950
+ color: "$colorMuted",
1951
+ children: q(e.size)
1952
+ })]
1953
+ })]
1954
+ }), c && /* @__PURE__ */ l(B, {
1955
+ size: "sm",
1956
+ variant: "ghost",
1957
+ testID: `${h}-remove-${t}`,
1958
+ onPress: () => c(t, e),
1959
+ disabled: d,
1960
+ children: /* @__PURE__ */ l(K, {
1961
+ name: "x",
1962
+ size: 14,
1963
+ color: "var(--color-muted, #94a3b8)"
1964
+ })
1965
+ })]
1966
+ }, e.id || `${e.name}-${t}`);
1967
+ })
1968
+ })
1969
+ ]
1970
+ });
1971
+ }
1972
+ //#endregion
1570
1973
  //#region src/theme/ThemeToggle.tsx
1571
- function Se() {
1572
- let { theme: e, toggleTheme: t } = D();
1573
- return /* @__PURE__ */ c(B, {
1974
+ function Ae() {
1975
+ let { theme: e, toggleTheme: t } = O();
1976
+ return /* @__PURE__ */ l(B, {
1574
1977
  variant: "ghost",
1575
1978
  onPress: t,
1576
1979
  "aria-label": `Switch to ${e === "light" ? "dark" : "light"} mode`,
1577
1980
  title: `Current theme: ${e}`,
1578
- children: /* @__PURE__ */ c(K, {
1981
+ children: /* @__PURE__ */ l(K, {
1579
1982
  name: e === "light" ? "moon" : "sun",
1580
1983
  size: 20
1581
1984
  })
1582
1985
  });
1583
1986
  }
1584
- var q = {
1987
+ var J = {
1585
1988
  brand: {
1586
1989
  violet: {
1587
1990
  50: "#F5F3FF",
@@ -1664,7 +2067,7 @@ var q = {
1664
2067
  borderColorMuted: "rgba(30, 51, 88, 0.4)"
1665
2068
  }
1666
2069
  }
1667
- }, J = {
2070
+ }, Y = {
1668
2071
  fontFamily: {
1669
2072
  sans: "'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
1670
2073
  mono: "'JetBrains Mono', 'Fira Code', monospace"
@@ -1690,7 +2093,7 @@ var q = {
1690
2093
  normal: 1.5,
1691
2094
  relaxed: 1.6
1692
2095
  }
1693
- }, Y = {
2096
+ }, X = {
1694
2097
  spacing: {
1695
2098
  xs: "0.25rem",
1696
2099
  sm: "0.5rem",
@@ -1714,24 +2117,24 @@ var q = {
1714
2117
  };
1715
2118
  //#endregion
1716
2119
  //#region src/tokens/config.ts
1717
- function Ce() {
2120
+ function je() {
1718
2121
  return {
1719
- primary: q.semantic.light.primary,
1720
- secondary: q.semantic.light.secondary,
2122
+ primary: J.semantic.light.primary,
2123
+ secondary: J.semantic.light.secondary,
1721
2124
  white: "#ffffff",
1722
2125
  black: "#000000",
1723
2126
  transparent: "transparent"
1724
2127
  };
1725
2128
  }
1726
- function we() {
2129
+ function Me() {
1727
2130
  let e = {};
1728
- return Object.entries(J.fontSize).forEach(([t, n]) => {
2131
+ return Object.entries(Y.fontSize).forEach(([t, n]) => {
1729
2132
  let r = parseFloat(n.toString());
1730
2133
  e[t] = isNaN(r) ? 16 : r * 16;
1731
2134
  }), e;
1732
2135
  }
1733
- function Te(e) {
1734
- let t = q.semantic[e];
2136
+ function Ne(e) {
2137
+ let t = J.semantic[e];
1735
2138
  return {
1736
2139
  background: t.bg,
1737
2140
  backgroundSecondary: t.bgSecondary,
@@ -1749,33 +2152,39 @@ function Te(e) {
1749
2152
  warning: t.warning,
1750
2153
  error: t.error,
1751
2154
  shadowColor: e === "light" ? "rgba(0,0,0,0.12)" : "rgba(0,0,0,0.4)",
2155
+ surface: t.bgSecondary || (e === "light" ? "#ffffff" : "#1e293b"),
2156
+ surfaceSubtle: t.bgTertiary || (e === "light" ? "#f1f5f9" : "#0f172a"),
2157
+ surfaceElevated: e === "light" ? "#ffffff" : "#334155",
2158
+ surfaceOverlay: e === "light" ? "#ffffff" : "#1e293b",
2159
+ surfaceHover: e === "light" ? "#f8fafc" : "#334155",
2160
+ surfaceActive: e === "light" ? "#f1f5f9" : "#475569",
1752
2161
  ...Object.entries(t).reduce((e, [t, n]) => {
1753
2162
  let r = t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1754
2163
  return e[r] = n, e;
1755
2164
  }, {})
1756
2165
  };
1757
2166
  }
1758
- function Ee() {
2167
+ function Pe() {
1759
2168
  let e = {};
1760
- return Object.entries(Y.spacing).forEach(([t, n]) => {
2169
+ return Object.entries(X.spacing).forEach(([t, n]) => {
1761
2170
  let r = parseFloat(n.toString());
1762
2171
  e[t] = isNaN(r) ? 0 : r * 16;
1763
2172
  }), e;
1764
2173
  }
1765
- function De() {
2174
+ function Fe() {
1766
2175
  let e = {};
1767
- return Object.entries(Y.borderRadius).forEach(([t, n]) => {
2176
+ return Object.entries(X.borderRadius).forEach(([t, n]) => {
1768
2177
  let r = parseFloat(n.toString());
1769
2178
  e[t] = isNaN(r) ? 0 : r;
1770
2179
  }), e.full = 9999, e.pill = 9999, e.round = 8, e;
1771
2180
  }
1772
- function Oe() {
2181
+ function Ie() {
1773
2182
  return {
1774
2183
  tokens: {
1775
- color: Ce(),
1776
- space: Ee(),
1777
- size: we(),
1778
- radius: De(),
2184
+ color: je(),
2185
+ space: Pe(),
2186
+ size: Me(),
2187
+ radius: Fe(),
1779
2188
  zIndex: {
1780
2189
  base: 0,
1781
2190
  dropdown: 100,
@@ -1784,27 +2193,27 @@ function Oe() {
1784
2193
  }
1785
2194
  },
1786
2195
  themes: {
1787
- light: Te("light"),
1788
- dark: Te("dark")
2196
+ light: Ne("light"),
2197
+ dark: Ne("dark")
1789
2198
  }
1790
2199
  };
1791
2200
  }
1792
2201
  //#endregion
1793
2202
  //#region src/theme/mThemeConfig.ts
1794
- function ke(e, t) {
2203
+ function Z(e, t) {
1795
2204
  let n = { ...e };
1796
2205
  for (let [e, r] of Object.entries(t ?? {})) r !== void 0 && (n[e] = r);
1797
2206
  return n;
1798
2207
  }
1799
- var X = Oe(), Z = {
1800
- color: X.tokens.color,
1801
- space: X.tokens.space,
1802
- size: X.tokens.size,
1803
- radius: X.tokens.radius,
1804
- zIndex: X.tokens.zIndex
1805
- }, Ae = h(Z), je = p({
1806
- family: J.fontFamily.sans,
1807
- size: X.tokens.size,
2208
+ var Q = Ie(), $ = {
2209
+ color: Q.tokens.color,
2210
+ space: Q.tokens.space,
2211
+ size: Q.tokens.size,
2212
+ radius: Q.tokens.radius,
2213
+ zIndex: Q.tokens.zIndex
2214
+ }, Le = g($), Re = m({
2215
+ family: Y.fontFamily.sans,
2216
+ size: Q.tokens.size,
1808
2217
  lineHeight: {
1809
2218
  tight: 1.3,
1810
2219
  normal: 1.5
@@ -1819,9 +2228,9 @@ var X = Oe(), Z = {
1819
2228
  base: 0,
1820
2229
  lg: -.2
1821
2230
  }
1822
- }), Me = p({
1823
- family: J.fontFamily.sans,
1824
- size: X.tokens.size,
2231
+ }), ze = m({
2232
+ family: Y.fontFamily.sans,
2233
+ size: Q.tokens.size,
1825
2234
  lineHeight: {
1826
2235
  tight: 1.3,
1827
2236
  normal: 1.5
@@ -1832,7 +2241,7 @@ var X = Oe(), Z = {
1832
2241
  semibold: "600",
1833
2242
  bold: "700"
1834
2243
  }
1835
- }), Ne = {
2244
+ }), Be = {
1836
2245
  xs: { maxWidth: 659 },
1837
2246
  sm: { maxWidth: 800 },
1838
2247
  md: { maxWidth: 1024 },
@@ -1847,63 +2256,112 @@ var X = Oe(), Z = {
1847
2256
  hoverNone: { hover: "none" },
1848
2257
  pointerCoarse: { pointer: "coarse" }
1849
2258
  };
1850
- function Q(e) {
1851
- let t = e?.tokens ? h({
2259
+ function Ve(e) {
2260
+ let t = e?.tokens?.fontFamily?.sans ?? e?.tokens?.fontFamily?.body ?? Y.fontFamily.sans, n = e?.tokens?.fontFamily?.heading ?? t, r = e?.tokens?.fontFamily ? m({
2261
+ family: n,
2262
+ size: Q.tokens.size,
2263
+ lineHeight: {
2264
+ tight: 1.3,
2265
+ normal: 1.5
2266
+ },
2267
+ weight: {
2268
+ normal: "400",
2269
+ medium: "500",
2270
+ semibold: "600",
2271
+ bold: "700"
2272
+ },
2273
+ letterSpacing: {
2274
+ base: 0,
2275
+ lg: -.2
2276
+ }
2277
+ }) : Re, i = e?.tokens?.fontFamily ? m({
2278
+ family: t,
2279
+ size: Q.tokens.size,
2280
+ lineHeight: {
2281
+ tight: 1.3,
2282
+ normal: 1.5
2283
+ },
2284
+ weight: {
2285
+ normal: "400",
2286
+ medium: "500",
2287
+ semibold: "600",
2288
+ bold: "700"
2289
+ }
2290
+ }) : ze, a = e?.tokens ? g({
1852
2291
  color: {
1853
- ...Z.color,
2292
+ ...$.color,
1854
2293
  ...e.tokens.color ?? {}
1855
2294
  },
1856
2295
  space: {
1857
- ...Z.space,
2296
+ ...$.space,
1858
2297
  ...e.tokens.space ?? {}
1859
2298
  },
1860
2299
  size: {
1861
- ...Z.size,
2300
+ ...$.size,
1862
2301
  ...e.tokens.size ?? {}
1863
2302
  },
1864
2303
  radius: {
1865
- ...Z.radius,
2304
+ ...$.radius,
1866
2305
  ...e.tokens.radius ?? {}
1867
2306
  },
1868
2307
  zIndex: {
1869
- ...Z.zIndex,
2308
+ ...$.zIndex,
1870
2309
  ...e.tokens.zIndex ?? {}
1871
2310
  }
1872
- }) : Ae, n = {
1873
- light: ke(X.themes.light, e?.themes?.light),
1874
- dark: ke(X.themes.dark, e?.themes?.dark)
2311
+ }) : Le, o = {};
2312
+ if (e?.tokens) {
2313
+ if (e.tokens.density !== void 0 && (o.density = e.tokens.density), e.tokens.borderStyle && (o.borderStyle = e.tokens.borderStyle), e.tokens.borderWidth) for (let [t, n] of Object.entries(e.tokens.borderWidth)) n !== void 0 && (o[`border-width-${t}`] = n);
2314
+ if (e.tokens.shadow) for (let [t, n] of Object.entries(e.tokens.shadow)) n?.boxShadow && (o[`shadow-${t}`] = n.boxShadow);
2315
+ if (e.tokens.opacity) for (let [t, n] of Object.entries(e.tokens.opacity)) n !== void 0 && (o[`opacity-${t}`] = n);
2316
+ if (e.tokens.lineHeight) for (let [t, n] of Object.entries(e.tokens.lineHeight)) n !== void 0 && (o[`line-height-${t}`] = n);
2317
+ if (e.tokens.letterSpacing) for (let [t, n] of Object.entries(e.tokens.letterSpacing)) n !== void 0 && (o[`letter-spacing-${t}`] = n);
2318
+ if (e.tokens.focus && (e.tokens.focus.ringColor && (o["focus-ring-color"] = e.tokens.focus.ringColor), e.tokens.focus.ringWidth !== void 0 && (o["focus-ring-width"] = e.tokens.focus.ringWidth), e.tokens.focus.ringOffset !== void 0 && (o["focus-ring-offset"] = e.tokens.focus.ringOffset), e.tokens.focus.ringStyle && (o["focus-ring-style"] = e.tokens.focus.ringStyle)), e.tokens.gradient) for (let [t, n] of Object.entries(e.tokens.gradient)) n !== void 0 && (o[`gradient-${t}`] = n);
2319
+ if (e.tokens.content) for (let [t, n] of Object.entries(e.tokens.content)) n !== void 0 && (o[`content-${t}`] = n);
2320
+ if (e.tokens.backdropBlur) for (let [t, n] of Object.entries(e.tokens.backdropBlur)) n !== void 0 && (o[`backdrop-blur-${t}`] = n);
2321
+ }
2322
+ let s = {
2323
+ light: Z(Z(Q.themes.light, o), e?.themes?.light),
2324
+ dark: Z(Z(Q.themes.dark, o), e?.themes?.dark)
2325
+ }, c = (e) => {
2326
+ let t = {};
2327
+ for (let [n, r] of Object.entries(e)) if (typeof r == "string" || typeof r == "number") t[n] = r;
2328
+ else if (r && typeof r == "object" && !Array.isArray(r)) for (let [e, i] of Object.entries(r)) (typeof i == "string" || typeof i == "number") && (t[`${n}-${e}`] = i);
2329
+ return t;
1875
2330
  };
1876
- return m({
1877
- tokens: t,
1878
- themes: n,
2331
+ return h({
2332
+ tokens: a,
2333
+ themes: {
2334
+ light: c(s.light),
2335
+ dark: c(s.dark)
2336
+ },
1879
2337
  fonts: {
1880
- heading: je,
1881
- body: Me
2338
+ heading: r,
2339
+ body: i
1882
2340
  },
1883
2341
  defaultTheme: "light",
1884
- media: Ne
2342
+ media: Be
1885
2343
  });
1886
2344
  }
1887
- var Pe = Q();
2345
+ var He = Ve();
1888
2346
  //#endregion
1889
2347
  //#region src/theme/MProvider.tsx
1890
- function $({ children: e, preset: t, defaultTheme: r }) {
1891
- let a = n(S)?.theme ?? r ?? "light", o = i(() => t ? Q(t) : Pe, [t]);
1892
- return /* @__PURE__ */ c(u, {
2348
+ function Ue({ children: e, preset: t, defaultTheme: n }) {
2349
+ let i = r(C)?.theme ?? n ?? "light", o = a(() => t ? Ve(t) : He, [t]);
2350
+ return /* @__PURE__ */ l(d, {
1893
2351
  config: o,
1894
- defaultTheme: a,
1895
- children: /* @__PURE__ */ c(pe, { children: e })
2352
+ defaultTheme: i,
2353
+ children: /* @__PURE__ */ l(me, { children: e })
1896
2354
  });
1897
2355
  }
1898
- function Fe(e) {
1899
- return n(S) ? /* @__PURE__ */ c($, { ...e }) : /* @__PURE__ */ c(E, {
2356
+ function We(e) {
2357
+ return r(C) ? /* @__PURE__ */ l(Ue, { ...e }) : /* @__PURE__ */ l(D, {
1900
2358
  defaultTheme: e.defaultTheme,
1901
- children: /* @__PURE__ */ c($, { ...e })
2359
+ children: /* @__PURE__ */ l(Ue, { ...e })
1902
2360
  });
1903
2361
  }
1904
2362
  //#endregion
1905
2363
  //#region src/theme/presets/frappePreset.ts
1906
- var Ie = {
2364
+ var Ge = {
1907
2365
  name: "frappe",
1908
2366
  tokens: {
1909
2367
  color: {
@@ -2050,6 +2508,6 @@ var Ie = {
2050
2508
  }
2051
2509
  };
2052
2510
  //#endregion
2053
- export { ye as Avatar, B as Button, V as Card, ce as DatePicker, _e as Drawer, L as Heading, K as Icon, H as Input, re as LocaleSwitcher, Fe as MProvider, O as MStack, N as MText, ge as Modal, F as Paragraph, U as Popover, G as Portal, me as PortalHost, pe as PortalProvider, W as Select, be as Separator, ie as Skeleton, te as StateBadge, E as ThemeProvider, Se as ThemeToggle, ue as Toast, de as ToastContainer, k as XStack, A as YStack, j as ZStack, Q as buildMThemeConfig, q as colors, Ie as frappePreset, Oe as generateMDesignConfig, Pe as mThemeConfig, Y as spacing, J as typography, D as useTheme };
2511
+ export { be as Avatar, B as Button, V as Card, le as DatePicker, De as DetailGrid, Ee as DetailItem, ve as Drawer, Ce as EmptyState, ke as FileUpload, R as Heading, K as Icon, H as Input, re as LocaleSwitcher, We as MProvider, k as MStack, P as MText, _e as Modal, I as Paragraph, U as Popover, G as Portal, he as PortalHost, me as PortalProvider, W as Select, xe as Separator, ae as Skeleton, te as StateBadge, D as ThemeProvider, Ae as ThemeToggle, de as Toast, fe as ToastContainer, Te as TypePill, A as XStack, j as YStack, M as ZStack, Ve as buildMThemeConfig, J as colors, q as formatBytes, Ge as frappePreset, Ie as generateMDesignConfig, Oe as getFileExtension, He as mThemeConfig, X as spacing, Y as typography, O as useTheme };
2054
2512
 
2055
2513
  //# sourceMappingURL=index.js.map