@framework-m/ui 0.10.3 → 0.11.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,35 +1,35 @@
1
1
  import e, { createContext as t, useContext as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
2
2
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
3
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 ee } from "react-i18next";
5
- import { ScrollView as _ } from "@tamagui/scroll-view";
6
- import v from "react-dom";
7
- import { Image as y } from "@tamagui/image";
8
- import * as b from "@tamagui/lucide-icons-2";
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";
9
9
  //#region src/theme/ThemeContext.tsx
10
- var x = t(null), S = "framework-m-theme";
11
- function C() {
12
- let e = localStorage.getItem(S);
10
+ var S = t(null), C = "framework-m-theme";
11
+ function w() {
12
+ let e = localStorage.getItem(C);
13
13
  return e === "light" || e === "dark" ? e : window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
14
14
  }
15
- function w(e) {
15
+ function T(e) {
16
16
  let t = document.documentElement;
17
17
  e === "dark" ? t.classList.add("dark") : t.classList.remove("dark");
18
18
  }
19
- function T({ children: e, defaultTheme: t }) {
20
- let [n, i] = o(t || C);
19
+ function E({ children: e, defaultTheme: t }) {
20
+ let [n, i] = o(t || w);
21
21
  r(() => {
22
- w(n);
22
+ T(n);
23
23
  }, [n]), r(() => {
24
24
  t && i(t);
25
25
  }, [t]), r(() => {
26
26
  let e = window.matchMedia("(prefers-color-scheme: dark)"), t = (e) => {
27
- localStorage.getItem(S) || i(e.matches ? "dark" : "light");
27
+ localStorage.getItem(C) || i(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(S, e), w(e);
32
+ i(e), localStorage.setItem(C, e), T(e);
33
33
  }, s = {
34
34
  theme: n,
35
35
  setTheme: a,
@@ -37,19 +37,19 @@ function T({ children: e, defaultTheme: t }) {
37
37
  a(n === "light" ? "dark" : "light");
38
38
  }
39
39
  };
40
- return /* @__PURE__ */ c(x.Provider, {
40
+ return /* @__PURE__ */ c(S.Provider, {
41
41
  value: s,
42
42
  children: e
43
43
  });
44
44
  }
45
- function E() {
46
- let e = n(x);
45
+ function D() {
46
+ let e = n(S);
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 D = g(f, {
52
+ var O = g(f, {
53
53
  name: "MStack",
54
54
  display: "flex",
55
55
  flexDirection: "column",
@@ -63,7 +63,7 @@ var D = g(f, {
63
63
  height: "100%",
64
64
  zIndex: 0
65
65
  } } }
66
- }), O = g(f, {
66
+ }), k = g(f, {
67
67
  name: "XStack",
68
68
  display: "flex",
69
69
  flexDirection: "row",
@@ -77,7 +77,7 @@ var D = g(f, {
77
77
  height: "100%",
78
78
  zIndex: 0
79
79
  } } }
80
- }), k = g(f, {
80
+ }), A = g(f, {
81
81
  name: "YStack",
82
82
  display: "flex",
83
83
  flexDirection: "column",
@@ -91,7 +91,7 @@ var D = g(f, {
91
91
  height: "100%",
92
92
  zIndex: 0
93
93
  } } }
94
- }), A = g(f, {
94
+ }), j = g(f, {
95
95
  name: "ZStack",
96
96
  display: "flex",
97
97
  position: "relative",
@@ -105,7 +105,7 @@ var D = g(f, {
105
105
  height: "100%",
106
106
  zIndex: 0
107
107
  } } }
108
- }), j = g(d, {
108
+ }), M = g(d, {
109
109
  name: "MText",
110
110
  fontFamily: "$body",
111
111
  display: "inline-flex",
@@ -118,11 +118,11 @@ var D = g(f, {
118
118
  $xl: { fontSize: "$xl" },
119
119
  $xxl: { fontSize: "$xxl" }
120
120
  } }
121
- }), M = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(j, {
121
+ }), N = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(M, {
122
122
  ref: r,
123
123
  ...n,
124
124
  style: [t, { textAlign: e === "start" ? "left" : e === "end" ? "right" : e }]
125
- })), N = g(d, {
125
+ })), P = g(d, {
126
126
  name: "Paragraph",
127
127
  fontFamily: "$body",
128
128
  display: "inline-flex",
@@ -135,11 +135,11 @@ var D = g(f, {
135
135
  $xl: { fontSize: "$xl" },
136
136
  $xxl: { fontSize: "$xxl" }
137
137
  } }
138
- }), P = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(N, {
138
+ }), F = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(P, {
139
139
  ref: r,
140
140
  ...n,
141
141
  style: [t, { textAlign: e === "start" ? "left" : e === "end" ? "right" : e }]
142
- })), F = g(d, {
142
+ })), I = g(d, {
143
143
  name: "Heading",
144
144
  fontFamily: "$body",
145
145
  fontWeight: "800",
@@ -153,56 +153,56 @@ var D = g(f, {
153
153
  $xl: { fontSize: "$xl" },
154
154
  $xxl: { fontSize: "$xxl" }
155
155
  } }
156
- }), I = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(F, {
156
+ }), L = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(I, {
157
157
  ref: r,
158
158
  ...n,
159
159
  style: [t, { textAlign: e === "start" ? "left" : e === "end" ? "right" : e }]
160
- })), L = {
160
+ })), R = {
161
161
  draft: {
162
- bg: "#e0e0e0",
163
- text: "#333"
162
+ bg: "$backgroundActive",
163
+ text: "$colorMuted"
164
164
  },
165
165
  pending: {
166
- bg: "#fff3cd",
167
- text: "#856404"
166
+ bg: "$warningBackground",
167
+ text: "$warning"
168
168
  },
169
169
  submitted: {
170
- bg: "#cce5ff",
171
- text: "#004085"
170
+ bg: "$infoBackground",
171
+ text: "$info"
172
172
  },
173
173
  approved: {
174
- bg: "#d4edda",
175
- text: "#155724"
174
+ bg: "$successBackground",
175
+ text: "$success"
176
176
  },
177
177
  rejected: {
178
- bg: "#f8d7da",
179
- text: "#721c24"
178
+ bg: "$errorBackground",
179
+ text: "$error"
180
180
  },
181
181
  cancelled: {
182
- bg: "#f5f5f5",
183
- text: "#666"
182
+ bg: "$backgroundActive",
183
+ text: "$colorMuted"
184
184
  },
185
185
  completed: {
186
- bg: "#d4edda",
187
- text: "#155724"
186
+ bg: "$successBackground",
187
+ text: "$success"
188
188
  },
189
189
  on_hold: {
190
- bg: "#fff3cd",
191
- text: "#856404"
190
+ bg: "$warningBackground",
191
+ text: "$warning"
192
192
  },
193
193
  default: {
194
- bg: "#e9ecef",
195
- text: "#495057"
194
+ bg: "$backgroundActive",
195
+ text: "$colorMuted"
196
196
  }
197
197
  };
198
- function te(e) {
199
- return L[e.toLowerCase().replace(/\s+/g, "_")] ?? L.default;
198
+ function ee(e) {
199
+ return R[e.toLowerCase().replace(/\s+/g, "_")] ?? R.default;
200
200
  }
201
- function R({ state: e, docstatus: t, className: n, style: r }) {
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
- let a = te(i);
205
- return /* @__PURE__ */ c(M, {
204
+ let a = ee(i);
205
+ return /* @__PURE__ */ c(N, {
206
206
  className: n,
207
207
  style: {
208
208
  display: "inline-flex",
@@ -250,20 +250,20 @@ var ne = [
250
250
  label: "اردو"
251
251
  }
252
252
  ];
253
- function z({ language: e, onChangeLanguage: t, locales: n = ne, placement: r }) {
254
- return /* @__PURE__ */ l(O, {
253
+ function re({ language: e, onChangeLanguage: t, locales: n = ne, placement: r }) {
254
+ return /* @__PURE__ */ l(k, {
255
255
  alignItems: "center",
256
256
  gap: "$xs",
257
257
  width: "auto",
258
258
  style: { verticalAlign: "middle" },
259
- children: [/* @__PURE__ */ c(M, {
259
+ children: [/* @__PURE__ */ c(N, {
260
260
  size: "$sm",
261
261
  style: { lineHeight: 1 },
262
- children: /* @__PURE__ */ c(Y, {
262
+ children: /* @__PURE__ */ c(K, {
263
263
  name: "globe",
264
264
  size: 15
265
265
  })
266
- }), /* @__PURE__ */ c(K, {
266
+ }), /* @__PURE__ */ c(W, {
267
267
  value: e,
268
268
  onValueChange: t,
269
269
  options: n.map((e) => ({
@@ -278,7 +278,7 @@ function z({ language: e, onChangeLanguage: t, locales: n = ne, placement: r })
278
278
  }
279
279
  //#endregion
280
280
  //#region src/components/Skeleton.tsx
281
- var B = g(f, {
281
+ var z = g(f, {
282
282
  name: "Skeleton",
283
283
  backgroundColor: "$colorBgTertiary",
284
284
  borderRadius: "$md",
@@ -311,23 +311,23 @@ var B = g(f, {
311
311
  }
312
312
  } },
313
313
  defaultVariants: { variant: "text" }
314
- }), re = ({ count: e = 1, className: t = "", ...n }) => {
314
+ }), ie = ({ count: e = 1, className: t = "", ...n }) => {
315
315
  let r = `skeleton ${t}`.trim();
316
316
  return e > 1 ? /* @__PURE__ */ c(f, {
317
317
  "aria-busy": !0,
318
318
  "aria-label": "Loading content",
319
- children: Array.from({ length: e }, (t, i) => /* @__PURE__ */ c(B, {
319
+ children: Array.from({ length: e }, (t, i) => /* @__PURE__ */ c(z, {
320
320
  className: r,
321
321
  ...n,
322
322
  ...i === e - 1 && n.variant === "text" ? { width: "60%" } : {}
323
323
  }, i))
324
- }) : /* @__PURE__ */ c(B, {
324
+ }) : /* @__PURE__ */ c(z, {
325
325
  className: r,
326
326
  "aria-busy": !0,
327
327
  "aria-label": "Loading",
328
328
  ...n
329
329
  });
330
- }, ie = g(f, {
330
+ }, ae = g(f, {
331
331
  name: "Button",
332
332
  flexDirection: "row",
333
333
  alignItems: "center",
@@ -414,14 +414,14 @@ var B = g(f, {
414
414
  variant: "default",
415
415
  size: "md"
416
416
  }
417
- }), ae = (e) => typeof e == "string" || typeof e == "number", V = e.forwardRef(({ children: t, variant: n = "default", size: r = "md", loading: i, disabled: a, tag: o = "button", ...s }, l) => {
418
- let u = ie, d = s.color || (n === "primary" || n === "danger" ? "$white" : "$color"), f = (e, t) => /* @__PURE__ */ c(M, {
417
+ }), 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) => {
418
+ let u = ae, d = s.color || (n === "primary" ? "$primaryColor" : n === "danger" ? "$white" : "$color"), f = (e, t) => /* @__PURE__ */ c(N, {
419
419
  color: d,
420
420
  fontWeight: "600",
421
421
  fontSize: r === "sm" ? "$xs" : "$sm",
422
422
  pointerEvents: "none",
423
423
  children: e
424
- }, t), p = i ? f("...") : e.Children.map(t, (e, t) => ae(e) ? f(e, t) : e);
424
+ }, t), p = i ? f("...") : e.Children.map(t, (e, t) => oe(e) ? f(e, t) : e);
425
425
  return /* @__PURE__ */ c(u, {
426
426
  ref: l,
427
427
  tag: o,
@@ -430,13 +430,27 @@ var B = g(f, {
430
430
  size: r,
431
431
  disabled: a || i,
432
432
  tabIndex: a || i ? -1 : 0,
433
+ ...(s.onPress || a || i) && { onPress: (e) => {
434
+ if (a || i) {
435
+ e?.stopPropagation && e.stopPropagation();
436
+ return;
437
+ }
438
+ s.onPress && s.onPress(e);
439
+ } },
440
+ ...(s.onClick || a || i) && { onClick: (e) => {
441
+ if (a || i) {
442
+ e?.stopPropagation && e.stopPropagation();
443
+ return;
444
+ }
445
+ s.onClick && s.onClick(e);
446
+ } },
433
447
  onKeyDown: (e) => {
434
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), s.onPress ? s.onPress(e) : s.onClick && s.onClick(e)), s.onKeyDown && s.onKeyDown(e);
448
+ a || i || ((e.key === "Enter" || e.key === " ") && (e.preventDefault(), s.onPress ? s.onPress(e) : s.onClick && s.onClick(e)), s.onKeyDown && s.onKeyDown(e));
435
449
  },
436
450
  ...s,
437
451
  children: p
438
452
  });
439
- }), H = g(f, {
453
+ }), V = g(f, {
440
454
  name: "Card",
441
455
  flexDirection: "column",
442
456
  backgroundColor: "$background",
@@ -471,7 +485,7 @@ var B = g(f, {
471
485
  elevated: !0,
472
486
  padded: "md"
473
487
  }
474
- }), oe = g("input", {
488
+ }), se = g("input", {
475
489
  name: "Input",
476
490
  backgroundColor: "$backgroundSecondary",
477
491
  borderRadius: "$round",
@@ -520,9 +534,9 @@ var B = g(f, {
520
534
  } }
521
535
  },
522
536
  defaultVariants: { size: "md" }
523
- }), U = e.forwardRef(({ onChange: e, onChangeText: t, value: n, textAlign: r, style: i, ...a }, o) => {
537
+ }), H = e.forwardRef(({ onChange: e, onChangeText: t, value: n, textAlign: r, style: i, ...a }, o) => {
524
538
  let s = n !== void 0;
525
- return /* @__PURE__ */ c(oe, {
539
+ return /* @__PURE__ */ c(se, {
526
540
  ref: o,
527
541
  tabIndex: a.disabled ? -1 : 0,
528
542
  ...s ? { value: n } : {},
@@ -536,10 +550,10 @@ var B = g(f, {
536
550
  ...a
537
551
  });
538
552
  });
539
- U.displayName = "Input";
553
+ H.displayName = "Input";
540
554
  //#endregion
541
555
  //#region src/components/Popover.tsx
542
- function W({ trigger: e, content: t, placement: n = "bottom-start", open: i, onOpenChange: s }) {
556
+ function U({ trigger: e, content: t, placement: n = "bottom-start", open: i, onOpenChange: s }) {
543
557
  let [u, d] = o(!1), f = i === void 0 ? u : i, [p, m] = o(n), h = (e) => {
544
558
  d(e), s?.(e);
545
559
  }, g = a(null);
@@ -557,11 +571,13 @@ function W({ trigger: e, content: t, placement: n = "bottom-start", open: i, onO
557
571
  g.current && !g.current.contains(e.target) && h(!1);
558
572
  };
559
573
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
560
- }, [g]), /* @__PURE__ */ l(k, {
574
+ }, [g]), /* @__PURE__ */ l(A, {
561
575
  position: "relative",
562
576
  ref: g,
563
- children: [/* @__PURE__ */ c(O, {
577
+ zIndex: f ? 1e4 : 1,
578
+ children: [/* @__PURE__ */ c(k, {
564
579
  onPress: () => h(!f),
580
+ onClick: () => h(!f),
565
581
  style: { cursor: "pointer" },
566
582
  tabIndex: 0,
567
583
  role: "button",
@@ -571,7 +587,7 @@ function W({ trigger: e, content: t, placement: n = "bottom-start", open: i, onO
571
587
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), h(!f));
572
588
  },
573
589
  children: e
574
- }), f && /* @__PURE__ */ c(A, {
590
+ }), f && /* @__PURE__ */ c(j, {
575
591
  position: "absolute",
576
592
  zIndex: 1e3,
577
593
  ...(() => {
@@ -625,7 +641,7 @@ function W({ trigger: e, content: t, placement: n = "bottom-start", open: i, onO
625
641
  },
626
642
  shadowOpacity: .1,
627
643
  shadowRadius: 10,
628
- children: /* @__PURE__ */ c(H, {
644
+ children: /* @__PURE__ */ c(V, {
629
645
  elevated: !0,
630
646
  padding: "$sm",
631
647
  minWidth: 200,
@@ -638,45 +654,45 @@ function W({ trigger: e, content: t, placement: n = "bottom-start", open: i, onO
638
654
  }
639
655
  //#endregion
640
656
  //#region src/components/DatePicker.tsx
641
- var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date", placeholder: s, popoverPlacement: u = "bottom-start", ...d }, p) => {
642
- let { t: m } = ee("ui"), [h, g] = o(!1), [_, v] = o(!1), [y, b] = o(!1), x = a === "datetime-local" || d.field?.format === "date-time" ? "datetime-local" : "date", S = (e) => {
657
+ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date", placeholder: s, popoverPlacement: u = "bottom-start", ...d }, p) => {
658
+ 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) => {
643
659
  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());
644
- return x === "date" ? `${n}-${r}-${i}` : `${n}-${r}-${i}T${a}:${o}:${s}`;
645
- }, C = i(() => {
660
+ return S === "date" ? `${n}-${r}-${i}` : `${n}-${r}-${i}T${a}:${o}:${s}`;
661
+ }, w = i(() => {
646
662
  if (!e) return /* @__PURE__ */ new Date();
647
663
  let t = new Date(e);
648
664
  return isNaN(t.getTime()) ? /* @__PURE__ */ new Date() : t;
649
- }, [e]), w = i(() => {
665
+ }, [e]), T = i(() => {
650
666
  if (!e) return "";
651
667
  let t = new Date(e);
652
- return isNaN(t.getTime()) ? String(e) : x === "date" ? t.toLocaleDateString() : t.toLocaleString();
653
- }, [e, x]), [T, E] = o(new Date(C)), A = () => {
668
+ return isNaN(t.getTime()) ? String(e) : S === "date" ? t.toLocaleDateString() : t.toLocaleString();
669
+ }, [e, S]), [E, D] = o(new Date(w)), j = () => {
654
670
  g(!0);
655
671
  };
656
672
  r(() => {
657
- E(new Date(C));
658
- }, [C]);
659
- let j = (e) => {
660
- let r = S(e);
673
+ D(new Date(w));
674
+ }, [w]);
675
+ let M = (e) => {
676
+ let r = C(e);
661
677
  t?.(r), n?.(r);
662
- }, N = (e) => {
663
- let t = new Date(T);
664
- t.setDate(e), t.setHours(C.getHours()), t.setMinutes(C.getMinutes()), t.setSeconds(C.getSeconds()), j(t), x === "date" && g(!1);
665
- }, P = (e, t, n = 0) => {
666
- let r = new Date(C);
667
- r.setHours(r.getHours() + e), r.setMinutes(r.getMinutes() + t), r.setSeconds(r.getSeconds() + n), j(r);
668
- }, F = () => {
669
- let e = new Date(C), t = e.getHours();
670
- e.setHours(t >= 12 ? t - 12 : t + 12), j(e);
678
+ }, P = (e) => {
679
+ let t = new Date(E);
680
+ t.setDate(e), t.setHours(w.getHours()), t.setMinutes(w.getMinutes()), t.setSeconds(w.getSeconds()), M(t), S === "date" && g(!1);
681
+ }, F = (e, t, n = 0) => {
682
+ let r = new Date(w);
683
+ r.setHours(r.getHours() + e), r.setMinutes(r.getMinutes() + t), r.setSeconds(r.getSeconds() + n), M(r);
671
684
  }, I = () => {
685
+ let e = new Date(w), t = e.getHours();
686
+ e.setHours(t >= 12 ? t - 12 : t + 12), M(e);
687
+ }, L = () => {
672
688
  let e = /* @__PURE__ */ new Date();
673
- j(e), E(new Date(e));
674
- }, L = (e, t) => new Date(t, e + 1, 0).getDate(), te = (e, t) => new Date(t, e, 1).getDay(), R = i(() => {
675
- let e = L(T.getMonth(), T.getFullYear()), t = te(T.getMonth(), T.getFullYear()), n = [];
689
+ M(e), D(new Date(e));
690
+ }, R = (e, t) => new Date(t, e + 1, 0).getDate(), ee = (e, t) => new Date(t, e, 1).getDay(), te = i(() => {
691
+ let e = R(E.getMonth(), E.getFullYear()), t = ee(E.getMonth(), E.getFullYear()), n = [];
676
692
  for (let e = 0; e < t; e++) n.push(null);
677
693
  for (let t = 1; t <= e; t++) n.push(t);
678
694
  return n;
679
- }, [T]), ne = [
695
+ }, [E]), ne = [
680
696
  m("January"),
681
697
  m("February"),
682
698
  m("March"),
@@ -689,29 +705,29 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
689
705
  m("October"),
690
706
  m("November"),
691
707
  m("December")
692
- ], z = /* @__PURE__ */ l(O, {
708
+ ], re = /* @__PURE__ */ l(k, {
693
709
  alignItems: "center",
694
710
  position: "relative",
695
711
  width: "100%",
696
- children: [/* @__PURE__ */ c(U, {
712
+ children: [/* @__PURE__ */ c(H, {
697
713
  ref: p,
698
- value: w,
714
+ value: T,
699
715
  readOnly: !0,
700
- placeholder: s || m(x === "date" ? "Select Date..." : "Select Date & Time..."),
716
+ placeholder: s || m(S === "date" ? "Select Date..." : "Select Date & Time..."),
701
717
  paddingRight: 40,
702
718
  ...d,
703
719
  type: "text",
704
720
  onPressIn: (e) => {
705
- d.onPressIn?.(e), A();
721
+ d.onPressIn?.(e), j();
706
722
  },
707
723
  onClick: (e) => {
708
- d.onClick?.(e), A();
724
+ d.onClick?.(e), j();
709
725
  },
710
726
  onFocus: (e) => {
711
- d.onFocus?.(e), A();
727
+ d.onFocus?.(e), j();
712
728
  },
713
729
  cursor: "pointer"
714
- }), /* @__PURE__ */ c(O, {
730
+ }), /* @__PURE__ */ c(k, {
715
731
  position: "absolute",
716
732
  right: 12,
717
733
  pointerEvents: "none",
@@ -756,88 +772,88 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
756
772
  ]
757
773
  })
758
774
  })]
759
- }), B = /* @__PURE__ */ l(k, {
775
+ }), z = /* @__PURE__ */ l(A, {
760
776
  width: 304,
761
777
  children: [
762
- /* @__PURE__ */ l(O, {
778
+ /* @__PURE__ */ l(k, {
763
779
  justifyContent: "space-between",
764
780
  alignItems: "center",
765
781
  marginBottom: "$3",
766
782
  children: [
767
- /* @__PURE__ */ c(V, {
783
+ /* @__PURE__ */ c(B, {
768
784
  type: "button",
769
785
  size: "sm",
770
786
  borderRadius: 100,
771
787
  width: 28,
772
788
  height: 28,
773
789
  padding: 0,
774
- onPress: () => E(new Date(T.setMonth(T.getMonth() - 1))),
775
- children: /* @__PURE__ */ c(M, {
790
+ onPress: () => D(new Date(E.setMonth(E.getMonth() - 1))),
791
+ children: /* @__PURE__ */ c(N, {
776
792
  fontSize: 12,
777
793
  position: "relative",
778
794
  left: -1,
779
795
  children: "<"
780
796
  })
781
797
  }),
782
- /* @__PURE__ */ l(O, {
798
+ /* @__PURE__ */ l(k, {
783
799
  alignItems: "center",
784
800
  cursor: "pointer",
785
801
  children: [
786
- /* @__PURE__ */ c(k, {
787
- onDoubleClick: () => b(!0),
788
- children: y ? /* @__PURE__ */ c(U, {
802
+ /* @__PURE__ */ c(A, {
803
+ onDoubleClick: () => x(!0),
804
+ children: b ? /* @__PURE__ */ c(H, {
789
805
  size: "sm",
790
806
  width: 100,
791
807
  style: { textAlign: "center" },
792
808
  paddingHorizontal: 4,
793
- defaultValue: T.getMonth() + 1,
809
+ defaultValue: E.getMonth() + 1,
794
810
  onKeyDown: (e) => {
795
811
  e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
796
812
  },
797
813
  onBlur: (e) => {
798
814
  let t = parseInt(e.target.value);
799
- !isNaN(t) && t > 0 && t <= 12 && E(new Date(T.setMonth(t - 1))), b(!1);
815
+ !isNaN(t) && t > 0 && t <= 12 && D(new Date(E.setMonth(t - 1))), x(!1);
800
816
  }
801
- }) : /* @__PURE__ */ c(M, {
817
+ }) : /* @__PURE__ */ c(N, {
802
818
  fontSize: 12,
803
819
  fontWeight: "700",
804
820
  color: "$primary",
805
- children: ne[T.getMonth()]
821
+ children: ne[E.getMonth()]
806
822
  })
807
823
  }),
808
824
  /* @__PURE__ */ c(f, { width: 12 }),
809
- /* @__PURE__ */ c(k, {
810
- onDoubleClick: () => v(!0),
811
- children: _ ? /* @__PURE__ */ c(U, {
825
+ /* @__PURE__ */ c(A, {
826
+ onDoubleClick: () => y(!0),
827
+ children: v ? /* @__PURE__ */ c(H, {
812
828
  size: "sm",
813
829
  width: 60,
814
830
  style: { textAlign: "center" },
815
831
  paddingHorizontal: 4,
816
- defaultValue: T.getFullYear().toString(),
832
+ defaultValue: E.getFullYear().toString(),
817
833
  onKeyDown: (e) => {
818
834
  e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
819
835
  },
820
836
  onBlur: (e) => {
821
837
  let t = parseInt(e.target.value);
822
- isNaN(t) || E(new Date(T.setFullYear(t))), v(!1);
838
+ isNaN(t) || D(new Date(E.setFullYear(t))), y(!1);
823
839
  }
824
- }) : /* @__PURE__ */ c(M, {
840
+ }) : /* @__PURE__ */ c(N, {
825
841
  fontWeight: "700",
826
842
  color: "$primary",
827
- children: T.getFullYear()
843
+ children: E.getFullYear()
828
844
  })
829
845
  })
830
846
  ]
831
847
  }),
832
- /* @__PURE__ */ c(V, {
848
+ /* @__PURE__ */ c(B, {
833
849
  type: "button",
834
850
  size: "sm",
835
851
  borderRadius: 100,
836
852
  width: 28,
837
853
  height: 28,
838
854
  padding: 0,
839
- onPress: () => E(new Date(T.setMonth(T.getMonth() + 1))),
840
- children: /* @__PURE__ */ c(M, {
855
+ onPress: () => D(new Date(E.setMonth(E.getMonth() + 1))),
856
+ children: /* @__PURE__ */ c(N, {
841
857
  fontSize: 12,
842
858
  position: "relative",
843
859
  left: 1,
@@ -846,11 +862,11 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
846
862
  })
847
863
  ]
848
864
  }),
849
- /* @__PURE__ */ l(O, {
865
+ /* @__PURE__ */ l(k, {
850
866
  flexWrap: "wrap",
851
867
  gap: 2,
852
868
  marginBottom: "$2",
853
- children: [/* @__PURE__ */ c(O, {
869
+ children: [/* @__PURE__ */ c(k, {
854
870
  width: "100%",
855
871
  justifyContent: "space-around",
856
872
  children: [
@@ -861,19 +877,19 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
861
877
  m("Th"),
862
878
  m("Fr"),
863
879
  m("Sa")
864
- ].map((e) => /* @__PURE__ */ c(D, {
880
+ ].map((e) => /* @__PURE__ */ c(O, {
865
881
  width: 36,
866
882
  alignItems: "center",
867
- children: /* @__PURE__ */ c(M, {
883
+ children: /* @__PURE__ */ c(N, {
868
884
  fontSize: 10,
869
885
  color: "muted",
870
886
  fontWeight: "600",
871
887
  children: e
872
888
  })
873
889
  }, e))
874
- }), R.map((e, t) => {
875
- let n = e === C.getDate() && T.getMonth() === C.getMonth() && T.getFullYear() === C.getFullYear();
876
- return /* @__PURE__ */ c(D, {
890
+ }), te.map((e, t) => {
891
+ let n = e === w.getDate() && E.getMonth() === w.getMonth() && E.getFullYear() === w.getFullYear();
892
+ return /* @__PURE__ */ c(O, {
877
893
  width: 36,
878
894
  height: 36,
879
895
  alignItems: "center",
@@ -882,9 +898,9 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
882
898
  cursor: e ? "pointer" : "default",
883
899
  backgroundColor: n ? "$primary" : "transparent",
884
900
  hoverStyle: e ? { backgroundColor: n ? "$primary" : "$backgroundHover" } : {},
885
- onPress: () => e && N(e),
886
- children: /* @__PURE__ */ c(M, {
887
- color: n ? "#fff" : "$color",
901
+ onPress: () => e && P(e),
902
+ children: /* @__PURE__ */ c(N, {
903
+ color: n ? "$primaryColor" : "$color",
888
904
  fontSize: 12,
889
905
  fontWeight: n ? "700" : "400",
890
906
  children: e || ""
@@ -892,32 +908,32 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
892
908
  }, t);
893
909
  })]
894
910
  }),
895
- x === "datetime-local" && /* @__PURE__ */ l(k, {
911
+ S === "datetime-local" && /* @__PURE__ */ l(A, {
896
912
  marginTop: "$2",
897
913
  paddingTop: "$3",
898
914
  borderTopWidth: 1,
899
915
  borderColor: "$borderColor",
900
916
  gap: "$2",
901
- children: [/* @__PURE__ */ l(O, {
917
+ children: [/* @__PURE__ */ l(k, {
902
918
  justifyContent: "space-around",
903
919
  alignItems: "center",
904
920
  children: [
905
- /* @__PURE__ */ l(k, {
921
+ /* @__PURE__ */ l(A, {
906
922
  alignItems: "center",
907
923
  gap: "$1",
908
924
  children: [
909
- /* @__PURE__ */ c(V, {
925
+ /* @__PURE__ */ c(B, {
910
926
  type: "button",
911
927
  size: "sm",
912
928
  variant: "ghost",
913
929
  padding: 0,
914
- onPress: () => P(1, 0, 0),
915
- children: /* @__PURE__ */ c(M, {
930
+ onPress: () => F(1, 0, 0),
931
+ children: /* @__PURE__ */ c(N, {
916
932
  fontSize: 16,
917
933
  children: "+"
918
934
  })
919
935
  }),
920
- /* @__PURE__ */ c(U, {
936
+ /* @__PURE__ */ c(H, {
921
937
  size: "sm",
922
938
  width: 52,
923
939
  style: { textAlign: "center" },
@@ -925,30 +941,30 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
925
941
  onKeyDown: (e) => {
926
942
  e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
927
943
  },
928
- value: (C.getHours() % 12 || 12).toString(),
944
+ value: (w.getHours() % 12 || 12).toString(),
929
945
  onChangeText: (e) => {
930
946
  let t = parseInt(e);
931
947
  if (!isNaN(t)) {
932
948
  t === 12 && (t = 0);
933
- let e = new Date(C), n = e.getHours() >= 12;
934
- e.setHours(n ? t + 12 : t), j(e);
949
+ let e = new Date(w), n = e.getHours() >= 12;
950
+ e.setHours(n ? t + 12 : t), M(e);
935
951
  }
936
952
  }
937
953
  }),
938
- /* @__PURE__ */ c(V, {
954
+ /* @__PURE__ */ c(B, {
939
955
  type: "button",
940
956
  size: "sm",
941
957
  variant: "ghost",
942
958
  padding: 0,
943
- onPress: () => P(-1, 0, 0),
944
- children: /* @__PURE__ */ c(M, {
959
+ onPress: () => F(-1, 0, 0),
960
+ children: /* @__PURE__ */ c(N, {
945
961
  fontSize: 16,
946
962
  children: "-"
947
963
  })
948
964
  })
949
965
  ]
950
966
  }),
951
- /* @__PURE__ */ c(M, {
967
+ /* @__PURE__ */ c(N, {
952
968
  fontSize: 16,
953
969
  color: "muted",
954
970
  marginTop: 10,
@@ -956,22 +972,22 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
956
972
  top: -2,
957
973
  children: ":"
958
974
  }),
959
- /* @__PURE__ */ l(k, {
975
+ /* @__PURE__ */ l(A, {
960
976
  alignItems: "center",
961
977
  gap: "$1",
962
978
  children: [
963
- /* @__PURE__ */ c(V, {
979
+ /* @__PURE__ */ c(B, {
964
980
  type: "button",
965
981
  size: "sm",
966
982
  variant: "ghost",
967
983
  padding: 0,
968
- onPress: () => P(0, 1, 0),
969
- children: /* @__PURE__ */ c(M, {
984
+ onPress: () => F(0, 1, 0),
985
+ children: /* @__PURE__ */ c(N, {
970
986
  fontSize: 16,
971
987
  children: "+"
972
988
  })
973
989
  }),
974
- /* @__PURE__ */ c(U, {
990
+ /* @__PURE__ */ c(H, {
975
991
  size: "sm",
976
992
  width: 52,
977
993
  style: { textAlign: "center" },
@@ -979,29 +995,29 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
979
995
  onKeyDown: (e) => {
980
996
  e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
981
997
  },
982
- value: C.getMinutes().toString().padStart(2, "0"),
998
+ value: w.getMinutes().toString().padStart(2, "0"),
983
999
  onChangeText: (e) => {
984
1000
  let t = parseInt(e);
985
1001
  if (!isNaN(t) && t >= 0 && t < 60) {
986
- let e = new Date(C);
987
- e.setMinutes(t), j(e);
1002
+ let e = new Date(w);
1003
+ e.setMinutes(t), M(e);
988
1004
  }
989
1005
  }
990
1006
  }),
991
- /* @__PURE__ */ c(V, {
1007
+ /* @__PURE__ */ c(B, {
992
1008
  type: "button",
993
1009
  size: "sm",
994
1010
  variant: "ghost",
995
1011
  padding: 0,
996
- onPress: () => P(0, -1, 0),
997
- children: /* @__PURE__ */ c(M, {
1012
+ onPress: () => F(0, -1, 0),
1013
+ children: /* @__PURE__ */ c(N, {
998
1014
  fontSize: 16,
999
1015
  children: "-"
1000
1016
  })
1001
1017
  })
1002
1018
  ]
1003
1019
  }),
1004
- /* @__PURE__ */ c(M, {
1020
+ /* @__PURE__ */ c(N, {
1005
1021
  fontSize: 16,
1006
1022
  color: "muted",
1007
1023
  marginTop: 10,
@@ -1009,22 +1025,22 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
1009
1025
  top: -2,
1010
1026
  children: ":"
1011
1027
  }),
1012
- /* @__PURE__ */ l(k, {
1028
+ /* @__PURE__ */ l(A, {
1013
1029
  alignItems: "center",
1014
1030
  gap: "$1",
1015
1031
  children: [
1016
- /* @__PURE__ */ c(V, {
1032
+ /* @__PURE__ */ c(B, {
1017
1033
  type: "button",
1018
1034
  size: "sm",
1019
1035
  variant: "ghost",
1020
1036
  padding: 0,
1021
- onPress: () => P(0, 0, 1),
1022
- children: /* @__PURE__ */ c(M, {
1037
+ onPress: () => F(0, 0, 1),
1038
+ children: /* @__PURE__ */ c(N, {
1023
1039
  fontSize: 16,
1024
1040
  children: "+"
1025
1041
  })
1026
1042
  }),
1027
- /* @__PURE__ */ c(U, {
1043
+ /* @__PURE__ */ c(H, {
1028
1044
  size: "sm",
1029
1045
  width: 52,
1030
1046
  style: { textAlign: "center" },
@@ -1032,64 +1048,64 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
1032
1048
  onKeyDown: (e) => {
1033
1049
  e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
1034
1050
  },
1035
- value: C.getSeconds().toString().padStart(2, "0"),
1051
+ value: w.getSeconds().toString().padStart(2, "0"),
1036
1052
  onChangeText: (e) => {
1037
1053
  let t = parseInt(e);
1038
1054
  if (!isNaN(t) && t >= 0 && t < 60) {
1039
- let e = new Date(C);
1040
- e.setSeconds(t), j(e);
1055
+ let e = new Date(w);
1056
+ e.setSeconds(t), M(e);
1041
1057
  }
1042
1058
  }
1043
1059
  }),
1044
- /* @__PURE__ */ c(V, {
1060
+ /* @__PURE__ */ c(B, {
1045
1061
  type: "button",
1046
1062
  size: "sm",
1047
1063
  variant: "ghost",
1048
1064
  padding: 0,
1049
- onPress: () => P(0, 0, -1),
1050
- children: /* @__PURE__ */ c(M, {
1065
+ onPress: () => F(0, 0, -1),
1066
+ children: /* @__PURE__ */ c(N, {
1051
1067
  fontSize: 16,
1052
1068
  children: "-"
1053
1069
  })
1054
1070
  })
1055
1071
  ]
1056
1072
  }),
1057
- /* @__PURE__ */ c(k, {
1073
+ /* @__PURE__ */ c(A, {
1058
1074
  justifyContent: "center",
1059
1075
  marginTop: 10,
1060
1076
  position: "relative",
1061
1077
  top: -2,
1062
- children: /* @__PURE__ */ c(V, {
1078
+ children: /* @__PURE__ */ c(B, {
1063
1079
  type: "button",
1064
1080
  size: "sm",
1065
1081
  variant: "primary",
1066
1082
  paddingHorizontal: "$2",
1067
- onPress: F,
1083
+ onPress: I,
1068
1084
  borderRadius: "$2",
1069
1085
  minWidth: 46,
1070
1086
  backgroundColor: "$primary",
1071
- children: /* @__PURE__ */ c(M, {
1087
+ children: /* @__PURE__ */ c(N, {
1072
1088
  fontSize: 10,
1073
1089
  fontWeight: "900",
1074
- color: "#fff",
1075
- children: C.getHours() >= 12 ? "PM" : "AM"
1090
+ color: "$primaryColor",
1091
+ children: w.getHours() >= 12 ? "PM" : "AM"
1076
1092
  })
1077
1093
  })
1078
1094
  })
1079
1095
  ]
1080
- }), /* @__PURE__ */ l(O, {
1096
+ }), /* @__PURE__ */ l(k, {
1081
1097
  marginTop: "$1",
1082
1098
  children: [
1083
- /* @__PURE__ */ c(V, {
1099
+ /* @__PURE__ */ c(B, {
1084
1100
  type: "button",
1085
1101
  variant: "default",
1086
1102
  size: "sm",
1087
- onPress: I,
1103
+ onPress: L,
1088
1104
  flex: 1,
1089
1105
  children: m("Now")
1090
1106
  }),
1091
1107
  /* @__PURE__ */ c(f, { width: 8 }),
1092
- /* @__PURE__ */ c(V, {
1108
+ /* @__PURE__ */ c(B, {
1093
1109
  type: "button",
1094
1110
  variant: "primary",
1095
1111
  size: "sm",
@@ -1102,50 +1118,51 @@ var G = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date"
1102
1118
  })
1103
1119
  ]
1104
1120
  });
1105
- return /* @__PURE__ */ c(k, {
1121
+ return /* @__PURE__ */ c(A, {
1106
1122
  position: "relative",
1107
1123
  width: d.width ?? "100%",
1108
- children: /* @__PURE__ */ c(W, {
1109
- trigger: z,
1110
- content: B,
1124
+ zIndex: h ? 1e4 : 1,
1125
+ children: /* @__PURE__ */ c(U, {
1126
+ trigger: re,
1127
+ content: z,
1111
1128
  placement: u,
1112
1129
  open: h,
1113
1130
  onOpenChange: g
1114
1131
  })
1115
1132
  });
1116
1133
  });
1117
- G.displayName = "DatePicker";
1134
+ ce.displayName = "DatePicker";
1118
1135
  //#endregion
1119
1136
  //#region src/components/Select.tsx
1120
- var K = 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: v, borderWidth: y, borderColor: b, borderRadius: x, paddingHorizontal: S, ...C }, w) => {
1121
- let { t: T } = ee("ui"), E = s.find((e) => e.value === r), D = E ? E.label : u || "Select an option...", [O, A] = o(!1), j = (e) => {
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) => {
1122
1139
  a?.(e), i && i({ target: {
1123
1140
  value: e,
1124
1141
  name: f || ""
1125
- } }), A(!1);
1126
- }, M = /* @__PURE__ */ l(V, {
1127
- ref: w,
1142
+ } }), j(!1);
1143
+ }, N = /* @__PURE__ */ l(B, {
1144
+ ref: T,
1128
1145
  disabled: d,
1129
1146
  tabIndex: -1,
1130
1147
  size: n,
1131
1148
  variant: "ghost",
1132
1149
  width: "100%",
1133
1150
  justifyContent: "space-between",
1134
- borderWidth: y ?? 1,
1135
- borderColor: t ? "$error" : b ?? "$borderColor",
1136
- backgroundColor: v ?? "$backgroundSecondary",
1137
- borderRadius: x ?? "$round",
1138
- paddingHorizontal: S,
1151
+ borderWidth: b ?? 1,
1152
+ borderColor: t ? "$error" : x ?? "$borderColor",
1153
+ backgroundColor: y ?? "$backgroundSecondary",
1154
+ borderRadius: S ?? "$round",
1155
+ paddingHorizontal: C,
1139
1156
  hoverStyle: { backgroundColor: "$backgroundHover" },
1140
1157
  pointerEvents: "none",
1141
- children: [/* @__PURE__ */ c(P, {
1158
+ children: [/* @__PURE__ */ c(F, {
1142
1159
  fontSize: n === "sm" ? "$xs" : "$sm",
1143
- color: E ? "$color" : "$colorMuted",
1160
+ color: D ? "$color" : "$colorMuted",
1144
1161
  numberOfLines: 1,
1145
1162
  flex: 1,
1146
1163
  overflow: "hidden",
1147
- children: D
1148
- }), /* @__PURE__ */ c(k, {
1164
+ children: O
1165
+ }), /* @__PURE__ */ c(A, {
1149
1166
  width: 0,
1150
1167
  height: 0,
1151
1168
  borderLeftWidth: 5,
@@ -1156,47 +1173,47 @@ var K = e.forwardRef(({ error: t, size: n = "md", value: r, onChange: i, onValue
1156
1173
  borderTopColor: "$colorMuted",
1157
1174
  opacity: .6
1158
1175
  })]
1159
- }), [N, F] = o(""), I = s.filter((e) => e.label.toLowerCase().includes(N.toLowerCase())), L = /* @__PURE__ */ l(k, { children: [s.length > 5 && /* @__PURE__ */ c(k, {
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, {
1160
1177
  padding: "$xs",
1161
1178
  paddingBottom: 0,
1162
- children: /* @__PURE__ */ c(U, {
1179
+ children: /* @__PURE__ */ c(H, {
1163
1180
  size: "sm",
1164
- placeholder: T("search", { defaultValue: "Search..." }),
1165
- value: N,
1166
- onChangeText: F,
1181
+ placeholder: E("search", { defaultValue: "Search..." }),
1182
+ value: P,
1183
+ onChangeText: I,
1167
1184
  onKeyDown: (e) => e.stopPropagation()
1168
1185
  })
1169
- }), /* @__PURE__ */ c(_, {
1186
+ }), /* @__PURE__ */ c(v, {
1170
1187
  maxHeight: 250,
1171
- children: /* @__PURE__ */ l(k, {
1188
+ children: /* @__PURE__ */ l(A, {
1172
1189
  gap: "$xs",
1173
1190
  padding: "$xs",
1174
1191
  children: [
1175
- u && /* @__PURE__ */ c(V, {
1192
+ u && /* @__PURE__ */ c(B, {
1176
1193
  variant: "ghost",
1177
1194
  size: "sm",
1178
1195
  justifyContent: "flex-start",
1179
- onPress: () => j(""),
1180
- children: /* @__PURE__ */ c(P, {
1196
+ onPress: () => M(""),
1197
+ children: /* @__PURE__ */ c(F, {
1181
1198
  fontSize: "$sm",
1182
1199
  color: "$colorMuted",
1183
1200
  children: u
1184
1201
  })
1185
1202
  }),
1186
- I.length === 0 && /* @__PURE__ */ c(P, {
1203
+ L.length === 0 && /* @__PURE__ */ c(F, {
1187
1204
  fontSize: "$sm",
1188
1205
  color: "$colorMuted",
1189
1206
  padding: "$sm",
1190
1207
  textAlign: "center",
1191
- children: T("no_options_found", { defaultValue: "No options found" })
1208
+ children: E("no_options_found", { defaultValue: "No options found" })
1192
1209
  }),
1193
- I.map((e) => /* @__PURE__ */ c(V, {
1210
+ L.map((e) => /* @__PURE__ */ c(B, {
1194
1211
  variant: "ghost",
1195
1212
  size: "sm",
1196
1213
  justifyContent: "flex-start",
1197
- onPress: () => j(e.value),
1214
+ onPress: () => M(e.value),
1198
1215
  backgroundColor: e.value === r ? "$primary1" : "transparent",
1199
- children: /* @__PURE__ */ c(P, {
1216
+ children: /* @__PURE__ */ c(F, {
1200
1217
  fontSize: "$sm",
1201
1218
  children: e.label
1202
1219
  })
@@ -1205,37 +1222,37 @@ var K = e.forwardRef(({ error: t, size: n = "md", value: r, onChange: i, onValue
1205
1222
  })
1206
1223
  })] });
1207
1224
  return e.useEffect(() => {
1208
- O || F("");
1209
- }, [O]), /* @__PURE__ */ c(k, {
1225
+ k || I("");
1226
+ }, [k]), /* @__PURE__ */ c(A, {
1210
1227
  position: "relative",
1211
- width: C.width || "100%",
1212
- minWidth: C.minWidth,
1213
- ...C,
1214
- children: /* @__PURE__ */ c(W, {
1215
- trigger: M,
1216
- content: L,
1228
+ width: w.width || "100%",
1229
+ minWidth: w.minWidth,
1230
+ ...w,
1231
+ children: /* @__PURE__ */ c(U, {
1232
+ trigger: N,
1233
+ content: R,
1217
1234
  placement: g || "bottom-start",
1218
- open: O,
1219
- onOpenChange: A
1235
+ open: k,
1236
+ onOpenChange: j
1220
1237
  })
1221
1238
  });
1222
1239
  });
1223
- K.displayName = "Select";
1240
+ W.displayName = "Select";
1224
1241
  //#endregion
1225
1242
  //#region src/components/Toast.tsx
1226
- var se = {
1243
+ var le = {
1227
1244
  success: "✓",
1228
1245
  error: "✕",
1229
1246
  warning: "⚠",
1230
1247
  info: "ℹ"
1231
1248
  };
1232
- function q({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }) {
1249
+ function ue({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }) {
1233
1250
  return r(() => {
1234
1251
  if (n > 0 && i) {
1235
1252
  let e = setTimeout(i, n);
1236
1253
  return () => clearTimeout(e);
1237
1254
  }
1238
- }, [n, i]), /* @__PURE__ */ c(k, {
1255
+ }, [n, i]), /* @__PURE__ */ c(A, {
1239
1256
  className: `toast toast-${t}`,
1240
1257
  role: "alert",
1241
1258
  "aria-live": "assertive",
@@ -1251,19 +1268,19 @@ function q({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i })
1251
1268
  width: 0,
1252
1269
  height: 4
1253
1270
  },
1254
- children: /* @__PURE__ */ l(O, {
1271
+ children: /* @__PURE__ */ l(k, {
1255
1272
  alignItems: "center",
1256
1273
  gap: "$sm",
1257
1274
  children: [
1258
- /* @__PURE__ */ c(M, {
1275
+ /* @__PURE__ */ c(N, {
1259
1276
  fontWeight: "600",
1260
- children: se[t]
1277
+ children: le[t]
1261
1278
  }),
1262
- /* @__PURE__ */ c(M, {
1279
+ /* @__PURE__ */ c(N, {
1263
1280
  flex: 1,
1264
1281
  children: e
1265
1282
  }),
1266
- i && /* @__PURE__ */ c(V, {
1283
+ i && /* @__PURE__ */ c(B, {
1267
1284
  variant: "ghost",
1268
1285
  size: "sm",
1269
1286
  onPress: i,
@@ -1274,8 +1291,8 @@ function q({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i })
1274
1291
  })
1275
1292
  });
1276
1293
  }
1277
- function ce({ toasts: e, onDismiss: t }) {
1278
- return /* @__PURE__ */ c(k, {
1294
+ function de({ toasts: e, onDismiss: t }) {
1295
+ return /* @__PURE__ */ c(A, {
1279
1296
  "aria-label": "Notifications",
1280
1297
  position: "fixed",
1281
1298
  bottom: "$lg",
@@ -1283,9 +1300,9 @@ function ce({ toasts: e, onDismiss: t }) {
1283
1300
  zIndex: 60,
1284
1301
  gap: "$sm",
1285
1302
  pointerEvents: "none",
1286
- children: e.map((e) => /* @__PURE__ */ c(k, {
1303
+ children: e.map((e) => /* @__PURE__ */ c(A, {
1287
1304
  pointerEvents: "auto",
1288
- children: /* @__PURE__ */ c(q, {
1305
+ children: /* @__PURE__ */ c(ue, {
1289
1306
  ...e,
1290
1307
  onDismiss: () => t(e.id)
1291
1308
  })
@@ -1294,10 +1311,10 @@ function ce({ toasts: e, onDismiss: t }) {
1294
1311
  }
1295
1312
  //#endregion
1296
1313
  //#region src/components/Portal.tsx
1297
- var le = t(null), ue = ({ children: e }) => {
1314
+ var fe = t(null), pe = ({ children: e }) => {
1298
1315
  let [t, n] = o(/* @__PURE__ */ new Map());
1299
1316
  /* v8 ignore stop */
1300
- return /* @__PURE__ */ l(le.Provider, {
1317
+ return /* @__PURE__ */ l(fe.Provider, {
1301
1318
  value: {
1302
1319
  register: (e, t) => {
1303
1320
  n((n) => {
@@ -1312,10 +1329,10 @@ var le = t(null), ue = ({ children: e }) => {
1312
1329
  });
1313
1330
  }
1314
1331
  },
1315
- children: [e, /* @__PURE__ */ c(de, { portals: t })]
1332
+ children: [e, /* @__PURE__ */ c(me, { portals: t })]
1316
1333
  });
1317
- }, de = ({ portals: t }) => typeof document < "u" ? null : /* @__PURE__ */ c(s, { children: Array.from(t.entries()).map(([t, n]) => /* @__PURE__ */ c(e.Fragment, { children: n }, t)) }), J = ({ children: e }) => {
1318
- let t = n(le), [i] = o(() => Math.random().toString(36).substr(2, 9));
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));
1319
1336
  if (r(() => {
1320
1337
  if (!(typeof document < "u" || !t))
1321
1338
  /* v8 ignore next */
@@ -1328,16 +1345,16 @@ var le = t(null), ue = ({ children: e }) => {
1328
1345
  let t = document.getElementById("portal-root");
1329
1346
  t || (t = document.createElement("div"), t.id = "portal-root", document.body.appendChild(t));
1330
1347
  let n = document.documentElement.className;
1331
- return t.className !== n && (t.className = n), v.createPortal(e, t);
1348
+ return t.className !== n && (t.className = n), y.createPortal(e, t);
1332
1349
  }
1333
1350
  /* v8 ignore next */
1334
1351
  return null;
1335
- }, fe = {
1352
+ }, he = {
1336
1353
  sm: 400,
1337
1354
  md: 600,
1338
1355
  lg: 900,
1339
1356
  xl: 1200
1340
- }, pe = ({ isOpen: e, onClose: t, title: n, footer: r, size: i = "md", children: a }) => e ? /* @__PURE__ */ c(J, { children: /* @__PURE__ */ l(A, {
1357
+ }, ge = ({ isOpen: e, onClose: t, title: n, footer: r, size: i = "md", children: a }) => e ? /* @__PURE__ */ c(G, { children: /* @__PURE__ */ l(j, {
1341
1358
  position: "absolute",
1342
1359
  top: 0,
1343
1360
  left: 0,
@@ -1348,7 +1365,7 @@ var le = t(null), ue = ({ children: e }) => {
1348
1365
  zIndex: 99999,
1349
1366
  alignItems: "center",
1350
1367
  justifyContent: "center",
1351
- children: [/* @__PURE__ */ c(k, {
1368
+ children: [/* @__PURE__ */ c(A, {
1352
1369
  position: "absolute",
1353
1370
  top: 0,
1354
1371
  left: 0,
@@ -1357,8 +1374,8 @@ var le = t(null), ue = ({ children: e }) => {
1357
1374
  backgroundColor: "rgba(0,0,0,0.6)",
1358
1375
  onPress: t,
1359
1376
  zIndex: 10
1360
- }), /* @__PURE__ */ l(H, {
1361
- width: fe[i],
1377
+ }), /* @__PURE__ */ l(V, {
1378
+ width: he[i],
1362
1379
  maxWidth: "95%",
1363
1380
  maxHeight: "90vh",
1364
1381
  backgroundColor: "$background",
@@ -1370,33 +1387,33 @@ var le = t(null), ue = ({ children: e }) => {
1370
1387
  borderColor: "$borderColor",
1371
1388
  zIndex: 100,
1372
1389
  children: [
1373
- /* @__PURE__ */ l(O, {
1390
+ /* @__PURE__ */ l(k, {
1374
1391
  padding: "$4",
1375
1392
  borderBottomWidth: 1,
1376
1393
  borderBottomColor: "$borderColor",
1377
1394
  justifyContent: "space-between",
1378
1395
  alignItems: "center",
1379
1396
  backgroundColor: "$backgroundSecondary",
1380
- children: [/* @__PURE__ */ c(M, {
1397
+ children: [/* @__PURE__ */ c(N, {
1381
1398
  fontWeight: "700",
1382
1399
  size: "lg",
1383
1400
  children: n
1384
- }), /* @__PURE__ */ c(V, {
1401
+ }), /* @__PURE__ */ c(B, {
1385
1402
  size: "sm",
1386
1403
  variant: "ghost",
1387
1404
  onPress: t,
1388
1405
  padding: "$2",
1389
- children: /* @__PURE__ */ c(M, { children: "✕" })
1406
+ children: /* @__PURE__ */ c(N, { children: "✕" })
1390
1407
  })]
1391
1408
  }),
1392
- /* @__PURE__ */ c(k, {
1409
+ /* @__PURE__ */ c(A, {
1393
1410
  flex: 1,
1394
1411
  overflow: "scroll",
1395
- minHeight: 250,
1412
+ minHeight: 300,
1396
1413
  backgroundColor: "$background",
1397
1414
  children: a
1398
1415
  }),
1399
- r && /* @__PURE__ */ c(O, {
1416
+ r && /* @__PURE__ */ c(k, {
1400
1417
  padding: "$4",
1401
1418
  borderTopWidth: 1,
1402
1419
  borderTopColor: "$borderColor",
@@ -1410,8 +1427,8 @@ var le = t(null), ue = ({ children: e }) => {
1410
1427
  }) }) : null;
1411
1428
  //#endregion
1412
1429
  //#region src/components/Drawer.tsx
1413
- function me({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, footer: a }) {
1414
- return e ? /* @__PURE__ */ c(J, { children: /* @__PURE__ */ l(A, {
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, {
1415
1432
  position: "absolute",
1416
1433
  top: 0,
1417
1434
  left: 0,
@@ -1420,7 +1437,7 @@ function me({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
1420
1437
  width: "100%",
1421
1438
  height: "100%",
1422
1439
  zIndex: 1e5,
1423
- children: [/* @__PURE__ */ c(k, {
1440
+ children: [/* @__PURE__ */ c(A, {
1424
1441
  position: "absolute",
1425
1442
  top: 0,
1426
1443
  left: 0,
@@ -1429,7 +1446,7 @@ function me({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
1429
1446
  backgroundColor: "rgba(0,0,0,0.45)",
1430
1447
  onPress: t,
1431
1448
  zIndex: 10
1432
- }), /* @__PURE__ */ l(H, {
1449
+ }), /* @__PURE__ */ l(V, {
1433
1450
  style: {
1434
1451
  position: "fixed",
1435
1452
  top: 0,
@@ -1452,31 +1469,31 @@ function me({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
1452
1469
  elevated: !1,
1453
1470
  zIndex: 100,
1454
1471
  children: [
1455
- /* @__PURE__ */ l(O, {
1472
+ /* @__PURE__ */ l(k, {
1456
1473
  padding: "$md",
1457
1474
  borderBottomWidth: 1,
1458
1475
  borderColor: "$borderColor",
1459
1476
  justifyContent: "space-between",
1460
1477
  alignItems: "center",
1461
1478
  backgroundColor: "$backgroundSecondary",
1462
- children: [/* @__PURE__ */ c(M, {
1479
+ children: [/* @__PURE__ */ c(N, {
1463
1480
  fontWeight: "700",
1464
1481
  size: "$md",
1465
1482
  children: n
1466
- }), /* @__PURE__ */ c(V, {
1483
+ }), /* @__PURE__ */ c(B, {
1467
1484
  size: "sm",
1468
1485
  variant: "ghost",
1469
1486
  onPress: t,
1470
1487
  children: "✕"
1471
1488
  })]
1472
1489
  }),
1473
- /* @__PURE__ */ c(k, {
1490
+ /* @__PURE__ */ c(A, {
1474
1491
  flex: 1,
1475
1492
  padding: "$md",
1476
1493
  style: { overflowY: "auto" },
1477
1494
  children: i
1478
1495
  }),
1479
- a && /* @__PURE__ */ c(O, {
1496
+ a && /* @__PURE__ */ c(k, {
1480
1497
  padding: "$md",
1481
1498
  borderTopWidth: 1,
1482
1499
  borderColor: "$borderColor",
@@ -1491,15 +1508,15 @@ function me({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
1491
1508
  }
1492
1509
  //#endregion
1493
1510
  //#region src/components/Avatar.tsx
1494
- var he = {
1511
+ var ve = {
1495
1512
  $sm: 24,
1496
1513
  $md: 32,
1497
1514
  $lg: 40,
1498
1515
  $xl: 48
1499
1516
  };
1500
- function ge({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidth: i, borderColor: a }) {
1501
- let [s, l] = o(!1), u = typeof n == "number" ? n : he[n] || 32;
1502
- return /* @__PURE__ */ c(k, {
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, {
1503
1520
  width: u,
1504
1521
  height: u,
1505
1522
  borderRadius: r ? u / 2 : "$sm",
@@ -1509,7 +1526,7 @@ function ge({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
1509
1526
  overflow: "hidden",
1510
1527
  borderWidth: i,
1511
1528
  borderColor: a,
1512
- children: e && !s ? /* @__PURE__ */ c(y, {
1529
+ children: e && !s ? /* @__PURE__ */ c(b, {
1513
1530
  source: {
1514
1531
  uri: e,
1515
1532
  width: u,
@@ -1518,7 +1535,7 @@ function ge({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
1518
1535
  width: "100%",
1519
1536
  height: "100%",
1520
1537
  onError: () => l(!0)
1521
- }) : typeof t == "string" ? /* @__PURE__ */ c(M, {
1538
+ }) : typeof t == "string" ? /* @__PURE__ */ c(N, {
1522
1539
  color: "$colorMuted",
1523
1540
  size: "$sm",
1524
1541
  fontWeight: "600",
@@ -1528,8 +1545,8 @@ function ge({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
1528
1545
  }
1529
1546
  //#endregion
1530
1547
  //#region src/components/Separator.tsx
1531
- function _e({ vertical: e }) {
1532
- return /* @__PURE__ */ c(k, {
1548
+ function be({ vertical: e }) {
1549
+ return /* @__PURE__ */ c(A, {
1533
1550
  width: e ? 1 : "100%",
1534
1551
  height: e ? "100%" : 1,
1535
1552
  backgroundColor: "$borderColor"
@@ -1537,12 +1554,12 @@ function _e({ vertical: e }) {
1537
1554
  }
1538
1555
  //#endregion
1539
1556
  //#region src/components/Icon.tsx
1540
- function ve(e) {
1557
+ function xe(e) {
1541
1558
  return e.replace(/[-_](.)/g, (e, t) => t.toUpperCase()).replace(/^(.)/, (e) => e.toUpperCase());
1542
1559
  }
1543
- function Y({ name: e, size: t, color: n, strokeWidth: r, ...i }) {
1544
- let a = ve(e);
1545
- return /* @__PURE__ */ c(a in b ? b[a] : b.Box, {
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, {
1546
1563
  size: t,
1547
1564
  color: n,
1548
1565
  strokeWidth: r,
@@ -1551,20 +1568,20 @@ function Y({ name: e, size: t, color: n, strokeWidth: r, ...i }) {
1551
1568
  }
1552
1569
  //#endregion
1553
1570
  //#region src/theme/ThemeToggle.tsx
1554
- function ye() {
1555
- let { theme: e, toggleTheme: t } = E();
1556
- return /* @__PURE__ */ c(V, {
1571
+ function Se() {
1572
+ let { theme: e, toggleTheme: t } = D();
1573
+ return /* @__PURE__ */ c(B, {
1557
1574
  variant: "ghost",
1558
1575
  onPress: t,
1559
1576
  "aria-label": `Switch to ${e === "light" ? "dark" : "light"} mode`,
1560
1577
  title: `Current theme: ${e}`,
1561
- children: /* @__PURE__ */ c(Y, {
1578
+ children: /* @__PURE__ */ c(K, {
1562
1579
  name: e === "light" ? "moon" : "sun",
1563
1580
  size: 20
1564
1581
  })
1565
1582
  });
1566
1583
  }
1567
- var X = {
1584
+ var q = {
1568
1585
  brand: {
1569
1586
  violet: {
1570
1587
  50: "#F5F3FF",
@@ -1647,7 +1664,7 @@ var X = {
1647
1664
  borderColorMuted: "rgba(30, 51, 88, 0.4)"
1648
1665
  }
1649
1666
  }
1650
- }, Z = {
1667
+ }, J = {
1651
1668
  fontFamily: {
1652
1669
  sans: "'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
1653
1670
  mono: "'JetBrains Mono', 'Fira Code', monospace"
@@ -1673,7 +1690,7 @@ var X = {
1673
1690
  normal: 1.5,
1674
1691
  relaxed: 1.6
1675
1692
  }
1676
- }, Q = {
1693
+ }, Y = {
1677
1694
  spacing: {
1678
1695
  xs: "0.25rem",
1679
1696
  sm: "0.5rem",
@@ -1697,24 +1714,24 @@ var X = {
1697
1714
  };
1698
1715
  //#endregion
1699
1716
  //#region src/tokens/config.ts
1700
- function be() {
1717
+ function Ce() {
1701
1718
  return {
1702
- primary: X.semantic.light.primary,
1703
- secondary: X.semantic.light.secondary,
1719
+ primary: q.semantic.light.primary,
1720
+ secondary: q.semantic.light.secondary,
1704
1721
  white: "#ffffff",
1705
1722
  black: "#000000",
1706
1723
  transparent: "transparent"
1707
1724
  };
1708
1725
  }
1709
- function xe() {
1726
+ function we() {
1710
1727
  let e = {};
1711
- return Object.entries(Z.fontSize).forEach(([t, n]) => {
1728
+ return Object.entries(J.fontSize).forEach(([t, n]) => {
1712
1729
  let r = parseFloat(n.toString());
1713
1730
  e[t] = isNaN(r) ? 16 : r * 16;
1714
1731
  }), e;
1715
1732
  }
1716
- function Se(e) {
1717
- let t = X.semantic[e];
1733
+ function Te(e) {
1734
+ let t = q.semantic[e];
1718
1735
  return {
1719
1736
  background: t.bg,
1720
1737
  backgroundSecondary: t.bgSecondary,
@@ -1726,6 +1743,7 @@ function Se(e) {
1726
1743
  borderColorMuted: t.borderColorMuted || t.border,
1727
1744
  placeholderColor: t.textMuted || "#94a3b8",
1728
1745
  primary: t.primary,
1746
+ primaryColor: e === "light" ? "#ffffff" : "#0f172a",
1729
1747
  secondary: t.secondary,
1730
1748
  success: t.success,
1731
1749
  warning: t.warning,
@@ -1737,27 +1755,27 @@ function Se(e) {
1737
1755
  }, {})
1738
1756
  };
1739
1757
  }
1740
- function Ce() {
1758
+ function Ee() {
1741
1759
  let e = {};
1742
- return Object.entries(Q.spacing).forEach(([t, n]) => {
1760
+ return Object.entries(Y.spacing).forEach(([t, n]) => {
1743
1761
  let r = parseFloat(n.toString());
1744
1762
  e[t] = isNaN(r) ? 0 : r * 16;
1745
1763
  }), e;
1746
1764
  }
1747
- function we() {
1765
+ function De() {
1748
1766
  let e = {};
1749
- return Object.entries(Q.borderRadius).forEach(([t, n]) => {
1767
+ return Object.entries(Y.borderRadius).forEach(([t, n]) => {
1750
1768
  let r = parseFloat(n.toString());
1751
1769
  e[t] = isNaN(r) ? 0 : r;
1752
1770
  }), e.full = 9999, e.pill = 9999, e.round = 8, e;
1753
1771
  }
1754
- function Te() {
1772
+ function Oe() {
1755
1773
  return {
1756
1774
  tokens: {
1757
- color: be(),
1758
- space: Ce(),
1759
- size: xe(),
1760
- radius: we(),
1775
+ color: Ce(),
1776
+ space: Ee(),
1777
+ size: we(),
1778
+ radius: De(),
1761
1779
  zIndex: {
1762
1780
  base: 0,
1763
1781
  dropdown: 100,
@@ -1766,22 +1784,27 @@ function Te() {
1766
1784
  }
1767
1785
  },
1768
1786
  themes: {
1769
- light: Se("light"),
1770
- dark: Se("dark")
1787
+ light: Te("light"),
1788
+ dark: Te("dark")
1771
1789
  }
1772
1790
  };
1773
1791
  }
1774
1792
  //#endregion
1775
1793
  //#region src/theme/mThemeConfig.ts
1776
- var $ = Te(), Ee = h({
1777
- color: $.tokens.color,
1778
- space: $.tokens.space,
1779
- size: $.tokens.size,
1780
- radius: $.tokens.radius,
1781
- zIndex: $.tokens.zIndex
1782
- }), De = p({
1783
- family: Z.fontFamily.sans,
1784
- size: $.tokens.size,
1794
+ function ke(e, t) {
1795
+ let n = { ...e };
1796
+ for (let [e, r] of Object.entries(t ?? {})) r !== void 0 && (n[e] = r);
1797
+ return n;
1798
+ }
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,
1785
1808
  lineHeight: {
1786
1809
  tight: 1.3,
1787
1810
  normal: 1.5
@@ -1796,9 +1819,9 @@ var $ = Te(), Ee = h({
1796
1819
  base: 0,
1797
1820
  lg: -.2
1798
1821
  }
1799
- }), Oe = p({
1800
- family: Z.fontFamily.sans,
1801
- size: $.tokens.size,
1822
+ }), Me = p({
1823
+ family: J.fontFamily.sans,
1824
+ size: X.tokens.size,
1802
1825
  lineHeight: {
1803
1826
  tight: 1.3,
1804
1827
  normal: 1.5
@@ -1809,41 +1832,218 @@ var $ = Te(), Ee = h({
1809
1832
  semibold: "600",
1810
1833
  bold: "700"
1811
1834
  }
1812
- }), ke = m({
1813
- tokens: Ee,
1814
- themes: $.themes,
1815
- fonts: {
1816
- heading: De,
1817
- body: Oe
1818
- },
1819
- defaultTheme: "light",
1820
- media: {
1821
- xs: { maxWidth: 659 },
1822
- sm: { maxWidth: 800 },
1823
- md: { maxWidth: 1024 },
1824
- lg: { maxWidth: 1280 },
1825
- xl: { maxWidth: 1420 },
1826
- gtXs: { minWidth: 660 },
1827
- gtSm: { minWidth: 801 },
1828
- gtMd: { minWidth: 1025 },
1829
- gtLg: { minWidth: 1281 },
1830
- short: { maxHeight: 820 },
1831
- tall: { minHeight: 821 },
1832
- hoverNone: { hover: "none" },
1833
- pointerCoarse: { pointer: "coarse" }
1834
- }
1835
- });
1835
+ }), Ne = {
1836
+ xs: { maxWidth: 659 },
1837
+ sm: { maxWidth: 800 },
1838
+ md: { maxWidth: 1024 },
1839
+ lg: { maxWidth: 1280 },
1840
+ xl: { maxWidth: 1420 },
1841
+ gtXs: { minWidth: 660 },
1842
+ gtSm: { minWidth: 801 },
1843
+ gtMd: { minWidth: 1025 },
1844
+ gtLg: { minWidth: 1281 },
1845
+ short: { maxHeight: 820 },
1846
+ tall: { minHeight: 821 },
1847
+ hoverNone: { hover: "none" },
1848
+ pointerCoarse: { pointer: "coarse" }
1849
+ };
1850
+ function Q(e) {
1851
+ let t = e?.tokens ? h({
1852
+ color: {
1853
+ ...Z.color,
1854
+ ...e.tokens.color ?? {}
1855
+ },
1856
+ space: {
1857
+ ...Z.space,
1858
+ ...e.tokens.space ?? {}
1859
+ },
1860
+ size: {
1861
+ ...Z.size,
1862
+ ...e.tokens.size ?? {}
1863
+ },
1864
+ radius: {
1865
+ ...Z.radius,
1866
+ ...e.tokens.radius ?? {}
1867
+ },
1868
+ zIndex: {
1869
+ ...Z.zIndex,
1870
+ ...e.tokens.zIndex ?? {}
1871
+ }
1872
+ }) : Ae, n = {
1873
+ light: ke(X.themes.light, e?.themes?.light),
1874
+ dark: ke(X.themes.dark, e?.themes?.dark)
1875
+ };
1876
+ return m({
1877
+ tokens: t,
1878
+ themes: n,
1879
+ fonts: {
1880
+ heading: je,
1881
+ body: Me
1882
+ },
1883
+ defaultTheme: "light",
1884
+ media: Ne
1885
+ });
1886
+ }
1887
+ var Pe = Q();
1836
1888
  //#endregion
1837
1889
  //#region src/theme/MProvider.tsx
1838
- function Ae({ children: e }) {
1839
- let { theme: t } = E();
1890
+ function $({ children: e, preset: t, defaultTheme: r }) {
1891
+ let a = n(S)?.theme ?? r ?? "light", o = i(() => t ? Q(t) : Pe, [t]);
1840
1892
  return /* @__PURE__ */ c(u, {
1841
- config: ke,
1842
- defaultTheme: t,
1843
- children: /* @__PURE__ */ c(ue, { children: e })
1893
+ config: o,
1894
+ defaultTheme: a,
1895
+ children: /* @__PURE__ */ c(pe, { children: e })
1844
1896
  });
1845
1897
  }
1898
+ function Fe(e) {
1899
+ return n(S) ? /* @__PURE__ */ c($, { ...e }) : /* @__PURE__ */ c(E, {
1900
+ defaultTheme: e.defaultTheme,
1901
+ children: /* @__PURE__ */ c($, { ...e })
1902
+ });
1903
+ }
1904
+ //#endregion
1905
+ //#region src/theme/presets/frappePreset.ts
1906
+ var Ie = {
1907
+ name: "frappe",
1908
+ tokens: {
1909
+ color: {
1910
+ primary: "#111827",
1911
+ primaryHover: "#1f2937",
1912
+ gray50: "#f8fafc",
1913
+ gray100: "#f1f5f9",
1914
+ gray200: "#e2e8f0",
1915
+ gray300: "#cbd5e1",
1916
+ gray400: "#94a3b8",
1917
+ gray500: "#64748b",
1918
+ gray600: "#475569",
1919
+ gray700: "#334155",
1920
+ gray800: "#1e293b",
1921
+ gray900: "#0f172a"
1922
+ },
1923
+ radius: {
1924
+ xs: 2,
1925
+ sm: 4,
1926
+ md: 6,
1927
+ lg: 8,
1928
+ xl: 12,
1929
+ full: 9999
1930
+ },
1931
+ size: {
1932
+ xs: 10,
1933
+ sm: 12,
1934
+ base: 13,
1935
+ md: 14,
1936
+ lg: 16,
1937
+ xl: 18,
1938
+ "2xl": 24
1939
+ },
1940
+ space: {
1941
+ 1: 4,
1942
+ 2: 8,
1943
+ 3: 12,
1944
+ 4: 16,
1945
+ 5: 20,
1946
+ 6: 24,
1947
+ 8: 32,
1948
+ 10: 40
1949
+ }
1950
+ },
1951
+ themes: {
1952
+ light: {
1953
+ background: "#f8fafc",
1954
+ backgroundSecondary: "#ffffff",
1955
+ backgroundTertiary: "#f1f5f9",
1956
+ backgroundHover: "#f1f5f9",
1957
+ backgroundActive: "#e2e8f0",
1958
+ backgroundFocus: "#ffffff",
1959
+ color: "#0f172a",
1960
+ colorSecondary: "#475569",
1961
+ colorMuted: "#64748b",
1962
+ colorDisabled: "#94a3b8",
1963
+ placeholderColor: "#94a3b8",
1964
+ borderColor: "#e2e8f0",
1965
+ borderColorHover: "#cbd5e1",
1966
+ borderColorFocus: "#2490ef",
1967
+ borderColorMuted: "rgba(226, 232, 240, 0.6)",
1968
+ primary: "#111827",
1969
+ primaryColor: "#ffffff",
1970
+ primaryHover: "#1f2937",
1971
+ primaryActive: "#000000",
1972
+ secondary: "#f1f5f9",
1973
+ focusRing: "rgba(17, 24, 39, 0.25)",
1974
+ "focus-ring": "rgba(17, 24, 39, 0.25)",
1975
+ sidebarBg: "#f8fafc",
1976
+ sidebarText: "#111827",
1977
+ sidebarTextMuted: "#6b7280",
1978
+ sidebarHover: "#f1f5f9",
1979
+ sidebarSearchBg: "#f1f5f9",
1980
+ sidebarItemActiveBg: "#ffffff",
1981
+ "sidebar-bg": "#f8fafc",
1982
+ "sidebar-text": "#111827",
1983
+ "sidebar-text-muted": "#6b7280",
1984
+ "sidebar-hover": "#f1f5f9",
1985
+ "sidebar-search-bg": "#f1f5f9",
1986
+ "sidebar-item-active-bg": "#ffffff",
1987
+ success: "#10b981",
1988
+ successBackground: "#ecfdf5",
1989
+ warning: "#f59e0b",
1990
+ warningBackground: "#fffbeb",
1991
+ error: "#ef4444",
1992
+ errorBackground: "#fef2f2",
1993
+ info: "#0284c7",
1994
+ infoBackground: "#f0f9ff",
1995
+ shadowColor: "rgba(15, 23, 42, 0.06)",
1996
+ shadowColorHover: "rgba(15, 23, 42, 0.12)"
1997
+ },
1998
+ dark: {
1999
+ background: "#121212",
2000
+ backgroundSecondary: "#18181b",
2001
+ backgroundTertiary: "#27272a",
2002
+ backgroundHover: "#27272a",
2003
+ backgroundActive: "#3f3f46",
2004
+ backgroundFocus: "#18181b",
2005
+ color: "#f4f4f5",
2006
+ colorSecondary: "#a1a1aa",
2007
+ colorMuted: "#71717a",
2008
+ colorDisabled: "#52525b",
2009
+ placeholderColor: "#71717a",
2010
+ borderColor: "#27272a",
2011
+ borderColorHover: "#3f3f46",
2012
+ borderColorFocus: "#fafafa",
2013
+ borderColorMuted: "rgba(39, 39, 42, 0.6)",
2014
+ primary: "#fafafa",
2015
+ primaryColor: "#121212",
2016
+ primaryHover: "#e4e4e7",
2017
+ primaryActive: "#d4d4d8",
2018
+ secondary: "#18181b",
2019
+ focusRing: "rgba(250, 250, 250, 0.25)",
2020
+ "focus-ring": "rgba(250, 250, 250, 0.25)",
2021
+ sidebarBg: "#121212",
2022
+ sidebarText: "#f4f4f5",
2023
+ sidebarTextMuted: "#a1a1aa",
2024
+ sidebarHover: "#18181b",
2025
+ sidebarSearchBg: "#18181b",
2026
+ sidebarItemActiveBg: "#27272a",
2027
+ "sidebar-bg": "#121212",
2028
+ "sidebar-text": "#f4f4f5",
2029
+ "sidebar-text-muted": "#a1a1aa",
2030
+ "sidebar-hover": "#18181b",
2031
+ "sidebar-search-bg": "#18181b",
2032
+ "sidebar-item-active-bg": "#27272a",
2033
+ success: "#34d399",
2034
+ successBackground: "rgba(16, 185, 129, 0.15)",
2035
+ warning: "#fbbf24",
2036
+ warningBackground: "rgba(245, 158, 11, 0.15)",
2037
+ error: "#f87171",
2038
+ errorBackground: "rgba(239, 68, 68, 0.15)",
2039
+ info: "#38bdf8",
2040
+ infoBackground: "rgba(2, 132, 199, 0.15)",
2041
+ shadowColor: "rgba(0, 0, 0, 0.8)",
2042
+ shadowColorHover: "rgba(0, 0, 0, 0.95)"
2043
+ }
2044
+ }
2045
+ };
1846
2046
  //#endregion
1847
- export { ge as Avatar, V as Button, H as Card, G as DatePicker, me as Drawer, I as Heading, Y as Icon, U as Input, z as LocaleSwitcher, Ae as MProvider, D as MStack, M as MText, pe as Modal, P as Paragraph, W as Popover, J as Portal, de as PortalHost, ue as PortalProvider, K as Select, _e as Separator, re as Skeleton, R as StateBadge, T as ThemeProvider, ye as ThemeToggle, q as Toast, ce as ToastContainer, O as XStack, k as YStack, A as ZStack, X as colors, Te as generateMDesignConfig, ke as mThemeConfig, Q as spacing, Z as typography, E as useTheme };
2047
+ 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 };
1848
2048
 
1849
2049
  //# sourceMappingURL=index.js.map