@framework-m/ui 0.12.4 → 0.13.1
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.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +356 -301
- package/dist/index.js.map +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/mThemeConfig.d.ts +4 -5
- package/dist/theme/mThemeConfig.d.ts.map +1 -1
- package/dist/theme/types.d.ts +85 -0
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/tokens/config.d.ts +12 -2
- package/dist/tokens/config.d.ts.map +1 -1
- package/package.json +19 -19
package/dist/index.js
CHANGED
|
@@ -2,34 +2,34 @@ import e, { createContext as t, useContext as n, useEffect as r, useMemo as i, u
|
|
|
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
4
|
import { useTranslation as _ } from "react-i18next";
|
|
5
|
-
import { ScrollView as
|
|
6
|
-
import
|
|
7
|
-
import { Image as
|
|
8
|
-
import * as
|
|
5
|
+
import { ScrollView as ee } 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";
|
|
9
9
|
//#region src/theme/ThemeContext.tsx
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
let e = localStorage.getItem(
|
|
10
|
+
var x = t(null), S = "framework-m-theme";
|
|
11
|
+
function C() {
|
|
12
|
+
let e = localStorage.getItem(S);
|
|
13
13
|
return e === "light" || e === "dark" ? e : window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function w(e) {
|
|
16
16
|
let t = document.documentElement;
|
|
17
17
|
e === "dark" ? t.classList.add("dark") : t.classList.remove("dark");
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let [n, i] = o(t ||
|
|
19
|
+
function T({ children: e, defaultTheme: t }) {
|
|
20
|
+
let [n, i] = o(t || C);
|
|
21
21
|
r(() => {
|
|
22
|
-
|
|
22
|
+
w(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(
|
|
27
|
+
localStorage.getItem(S) || 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(
|
|
32
|
+
i(e), localStorage.setItem(S, e), w(e);
|
|
33
33
|
}, s = {
|
|
34
34
|
theme: n,
|
|
35
35
|
setTheme: a,
|
|
@@ -37,19 +37,19 @@ function E({ children: e, defaultTheme: t }) {
|
|
|
37
37
|
a(n === "light" ? "dark" : "light");
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
return /* @__PURE__ */ c(
|
|
40
|
+
return /* @__PURE__ */ c(x.Provider, {
|
|
41
41
|
value: s,
|
|
42
42
|
children: e
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
let e = n(
|
|
45
|
+
function E() {
|
|
46
|
+
let e = n(x);
|
|
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
|
|
52
|
+
var D = g(f, {
|
|
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
|
-
}),
|
|
66
|
+
}), O = g(f, {
|
|
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
|
-
}),
|
|
80
|
+
}), k = g(f, {
|
|
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
|
-
}),
|
|
94
|
+
}), A = g(f, {
|
|
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
|
-
}),
|
|
108
|
+
}), j = g(d, {
|
|
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
|
-
}),
|
|
121
|
+
}), M = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(j, {
|
|
122
122
|
ref: r,
|
|
123
123
|
...n,
|
|
124
124
|
style: [t, { textAlign: e === "start" ? "left" : e === "end" ? "right" : e }]
|
|
125
|
-
})),
|
|
125
|
+
})), N = g(d, {
|
|
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
|
-
}),
|
|
138
|
+
}), P = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(N, {
|
|
139
139
|
ref: r,
|
|
140
140
|
...n,
|
|
141
141
|
style: [t, { textAlign: e === "start" ? "left" : e === "end" ? "right" : e }]
|
|
142
|
-
})),
|
|
142
|
+
})), F = g(d, {
|
|
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
|
-
}),
|
|
156
|
+
}), I = e.forwardRef(({ textAlign: e, style: t, ...n }, r) => /* @__PURE__ */ c(F, {
|
|
157
157
|
ref: r,
|
|
158
158
|
...n,
|
|
159
159
|
style: [t, { textAlign: e === "start" ? "left" : e === "end" ? "right" : e }]
|
|
160
|
-
})),
|
|
160
|
+
})), L = {
|
|
161
161
|
draft: {
|
|
162
162
|
bg: "$backgroundActive",
|
|
163
163
|
text: "$colorMuted"
|
|
@@ -195,14 +195,14 @@ var O = g(f, {
|
|
|
195
195
|
text: "$colorMuted"
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
|
-
function
|
|
199
|
-
return
|
|
198
|
+
function te(e) {
|
|
199
|
+
return L[e.toLowerCase().replace(/\s+/g, "_")] ?? L.default;
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function ne({ 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 =
|
|
205
|
-
return /* @__PURE__ */ c(
|
|
204
|
+
let a = te(i);
|
|
205
|
+
return /* @__PURE__ */ c(M, {
|
|
206
206
|
className: n,
|
|
207
207
|
backgroundColor: a.bg,
|
|
208
208
|
color: a.text,
|
|
@@ -219,7 +219,7 @@ function te({ state: e, docstatus: t, className: n, style: r }) {
|
|
|
219
219
|
}
|
|
220
220
|
//#endregion
|
|
221
221
|
//#region src/components/LocaleSwitcher.tsx
|
|
222
|
-
var
|
|
222
|
+
var re = [
|
|
223
223
|
{
|
|
224
224
|
code: "en",
|
|
225
225
|
label: "English"
|
|
@@ -249,20 +249,20 @@ var ne = [
|
|
|
249
249
|
label: "اردو"
|
|
250
250
|
}
|
|
251
251
|
];
|
|
252
|
-
function
|
|
253
|
-
return /* @__PURE__ */ l(
|
|
252
|
+
function ie({ language: e, onChangeLanguage: t, locales: n = re, placement: r }) {
|
|
253
|
+
return /* @__PURE__ */ l(O, {
|
|
254
254
|
alignItems: "center",
|
|
255
255
|
gap: "$xs",
|
|
256
256
|
width: "auto",
|
|
257
257
|
style: { verticalAlign: "middle" },
|
|
258
|
-
children: [/* @__PURE__ */ c(
|
|
258
|
+
children: [/* @__PURE__ */ c(M, {
|
|
259
259
|
size: "$sm",
|
|
260
260
|
style: { lineHeight: 1 },
|
|
261
|
-
children: /* @__PURE__ */ c(
|
|
261
|
+
children: /* @__PURE__ */ c(G, {
|
|
262
262
|
name: "globe",
|
|
263
263
|
size: 15
|
|
264
264
|
})
|
|
265
|
-
}), /* @__PURE__ */ c(
|
|
265
|
+
}), /* @__PURE__ */ c(U, {
|
|
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
|
|
280
|
+
var R = g(f, {
|
|
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
|
-
}),
|
|
313
|
+
}), ae = ({ count: e = 1, className: t = "", ...n }) => {
|
|
314
314
|
let r = `skeleton ${t}`.trim();
|
|
315
315
|
return e > 1 ? /* @__PURE__ */ c(f, {
|
|
316
316
|
"aria-busy": !0,
|
|
317
317
|
"aria-label": "Loading content",
|
|
318
|
-
children: Array.from({ length: e }, (t, i) => /* @__PURE__ */ c(
|
|
318
|
+
children: Array.from({ length: e }, (t, i) => /* @__PURE__ */ c(R, {
|
|
319
319
|
className: r,
|
|
320
320
|
...n,
|
|
321
321
|
...i === e - 1 && n.variant === "text" ? { width: "60%" } : {}
|
|
322
322
|
}, i))
|
|
323
|
-
}) : /* @__PURE__ */ c(
|
|
323
|
+
}) : /* @__PURE__ */ c(R, {
|
|
324
324
|
className: r,
|
|
325
325
|
"aria-busy": !0,
|
|
326
326
|
"aria-label": "Loading",
|
|
327
327
|
...n
|
|
328
328
|
});
|
|
329
|
-
},
|
|
329
|
+
}, oe = g(f, {
|
|
330
330
|
name: "Button",
|
|
331
331
|
flexDirection: "row",
|
|
332
332
|
alignItems: "center",
|
|
@@ -413,14 +413,14 @@ var z = g(f, {
|
|
|
413
413
|
variant: "default",
|
|
414
414
|
size: "md"
|
|
415
415
|
}
|
|
416
|
-
}),
|
|
417
|
-
let u =
|
|
416
|
+
}), se = (e) => typeof e == "string" || typeof e == "number", z = e.forwardRef(({ children: t, variant: n = "default", size: r = "md", loading: i, disabled: a, tag: o = "button", ...s }, l) => {
|
|
417
|
+
let u = oe, d = s.color || (n === "primary" || n === "danger" ? "$primaryColor" : "$color"), f = (e, t) => /* @__PURE__ */ c(M, {
|
|
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) =>
|
|
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
424
|
return /* @__PURE__ */ c(u, {
|
|
425
425
|
ref: l,
|
|
426
426
|
tag: o,
|
|
@@ -449,7 +449,7 @@ var z = g(f, {
|
|
|
449
449
|
},
|
|
450
450
|
children: p
|
|
451
451
|
});
|
|
452
|
-
}),
|
|
452
|
+
}), B = g(f, {
|
|
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
|
-
}),
|
|
487
|
+
}), ce = g("input", {
|
|
488
488
|
name: "Input",
|
|
489
489
|
backgroundColor: "$backgroundSecondary",
|
|
490
490
|
borderRadius: "$round",
|
|
@@ -533,9 +533,9 @@ var z = g(f, {
|
|
|
533
533
|
} }
|
|
534
534
|
},
|
|
535
535
|
defaultVariants: { size: "md" }
|
|
536
|
-
}),
|
|
536
|
+
}), V = 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(
|
|
538
|
+
return /* @__PURE__ */ c(ce, {
|
|
539
539
|
ref: o,
|
|
540
540
|
tabIndex: a.disabled ? -1 : 0,
|
|
541
541
|
...s ? { value: n } : {},
|
|
@@ -549,10 +549,10 @@ var z = g(f, {
|
|
|
549
549
|
...a
|
|
550
550
|
});
|
|
551
551
|
});
|
|
552
|
-
|
|
552
|
+
V.displayName = "Input";
|
|
553
553
|
//#endregion
|
|
554
554
|
//#region src/components/Popover.tsx
|
|
555
|
-
function
|
|
555
|
+
function H({ trigger: e, content: t, placement: n = "bottom-start", open: i, onOpenChange: s }) {
|
|
556
556
|
let [u, d] = o(!1), f = i === void 0 ? u : i, [p, m] = o(n), h = (e) => {
|
|
557
557
|
d(e), s?.(e);
|
|
558
558
|
}, g = a(null);
|
|
@@ -570,11 +570,11 @@ function U({ trigger: e, content: t, placement: n = "bottom-start", open: i, onO
|
|
|
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(
|
|
573
|
+
}, [g]), /* @__PURE__ */ l(k, {
|
|
574
574
|
position: "relative",
|
|
575
575
|
ref: g,
|
|
576
576
|
zIndex: f ? 1e4 : 1,
|
|
577
|
-
children: [/* @__PURE__ */ c(
|
|
577
|
+
children: [/* @__PURE__ */ c(O, {
|
|
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(
|
|
589
|
+
}), f && /* @__PURE__ */ c(A, {
|
|
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(
|
|
643
|
+
children: /* @__PURE__ */ c(B, {
|
|
644
644
|
elevated: !0,
|
|
645
645
|
padding: "$sm",
|
|
646
646
|
minWidth: 200,
|
|
@@ -653,45 +653,45 @@ 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
|
|
657
|
-
let { t: m } = _("ui"), [h, g] = o(!1), [
|
|
656
|
+
var le = 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), [ee, v] = o(!1), [y, b] = o(!1), x = a === "datetime-local" || d.field?.format === "date-time" ? "datetime-local" : "date", S = (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
|
-
return
|
|
660
|
-
},
|
|
659
|
+
return x === "date" ? `${n}-${r}-${i}` : `${n}-${r}-${i}T${a}:${o}:${s}`;
|
|
660
|
+
}, C = i(() => {
|
|
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]),
|
|
664
|
+
}, [e]), w = i(() => {
|
|
665
665
|
if (!e) return "";
|
|
666
666
|
let t = new Date(e);
|
|
667
|
-
return isNaN(t.getTime()) ? String(e) :
|
|
668
|
-
}, [e,
|
|
667
|
+
return isNaN(t.getTime()) ? String(e) : x === "date" ? t.toLocaleDateString() : t.toLocaleString();
|
|
668
|
+
}, [e, x]), [T, E] = o(new Date(C)), A = () => {
|
|
669
669
|
g(!0);
|
|
670
670
|
};
|
|
671
671
|
r(() => {
|
|
672
|
-
|
|
673
|
-
}, [
|
|
674
|
-
let
|
|
675
|
-
let r =
|
|
672
|
+
E(new Date(C));
|
|
673
|
+
}, [C]);
|
|
674
|
+
let j = (e) => {
|
|
675
|
+
let r = S(e);
|
|
676
676
|
t?.(r), n?.(r);
|
|
677
|
-
},
|
|
678
|
-
let t = new Date(
|
|
679
|
-
t.setDate(e), t.setHours(
|
|
680
|
-
},
|
|
681
|
-
let r = new Date(
|
|
682
|
-
r.setHours(r.getHours() + e), r.setMinutes(r.getMinutes() + t), r.setSeconds(r.getSeconds() + n),
|
|
677
|
+
}, N = (e) => {
|
|
678
|
+
let t = new Date(T);
|
|
679
|
+
t.setDate(e), t.setHours(C.getHours()), t.setMinutes(C.getMinutes()), t.setSeconds(C.getSeconds()), j(t), x === "date" && g(!1);
|
|
680
|
+
}, P = (e, t, n = 0) => {
|
|
681
|
+
let r = new Date(C);
|
|
682
|
+
r.setHours(r.getHours() + e), r.setMinutes(r.getMinutes() + t), r.setSeconds(r.getSeconds() + n), j(r);
|
|
683
|
+
}, F = () => {
|
|
684
|
+
let e = new Date(C), t = e.getHours();
|
|
685
|
+
e.setHours(t >= 12 ? t - 12 : t + 12), j(e);
|
|
683
686
|
}, I = () => {
|
|
684
|
-
let e = new Date(w), t = e.getHours();
|
|
685
|
-
e.setHours(t >= 12 ? t - 12 : t + 12), M(e);
|
|
686
|
-
}, L = () => {
|
|
687
687
|
let e = /* @__PURE__ */ new Date();
|
|
688
|
-
|
|
689
|
-
},
|
|
690
|
-
let e =
|
|
688
|
+
j(e), E(new Date(e));
|
|
689
|
+
}, L = (e, t) => new Date(t, e + 1, 0).getDate(), te = (e, t) => new Date(t, e, 1).getDay(), ne = i(() => {
|
|
690
|
+
let e = L(T.getMonth(), T.getFullYear()), t = te(T.getMonth(), T.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
|
-
}, [
|
|
694
|
+
}, [T]), re = [
|
|
695
695
|
m("January"),
|
|
696
696
|
m("February"),
|
|
697
697
|
m("March"),
|
|
@@ -704,29 +704,29 @@ 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
|
-
],
|
|
707
|
+
], ie = /* @__PURE__ */ l(O, {
|
|
708
708
|
alignItems: "center",
|
|
709
709
|
position: "relative",
|
|
710
710
|
width: "100%",
|
|
711
|
-
children: [/* @__PURE__ */ c(
|
|
711
|
+
children: [/* @__PURE__ */ c(V, {
|
|
712
712
|
ref: p,
|
|
713
|
-
value:
|
|
713
|
+
value: w,
|
|
714
714
|
readOnly: !0,
|
|
715
|
-
placeholder: s || m(
|
|
715
|
+
placeholder: s || m(x === "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),
|
|
720
|
+
d.onPressIn?.(e), A();
|
|
721
721
|
},
|
|
722
722
|
onClick: (e) => {
|
|
723
|
-
d.onClick?.(e),
|
|
723
|
+
d.onClick?.(e), A();
|
|
724
724
|
},
|
|
725
725
|
onFocus: (e) => {
|
|
726
|
-
d.onFocus?.(e),
|
|
726
|
+
d.onFocus?.(e), A();
|
|
727
727
|
},
|
|
728
728
|
cursor: "pointer"
|
|
729
|
-
}), /* @__PURE__ */ c(
|
|
729
|
+
}), /* @__PURE__ */ c(O, {
|
|
730
730
|
position: "absolute",
|
|
731
731
|
right: 12,
|
|
732
732
|
pointerEvents: "none",
|
|
@@ -771,88 +771,88 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
|
|
|
771
771
|
]
|
|
772
772
|
})
|
|
773
773
|
})]
|
|
774
|
-
}),
|
|
774
|
+
}), R = /* @__PURE__ */ l(k, {
|
|
775
775
|
width: 304,
|
|
776
776
|
children: [
|
|
777
|
-
/* @__PURE__ */ l(
|
|
777
|
+
/* @__PURE__ */ l(O, {
|
|
778
778
|
justifyContent: "space-between",
|
|
779
779
|
alignItems: "center",
|
|
780
780
|
marginBottom: "$3",
|
|
781
781
|
children: [
|
|
782
|
-
/* @__PURE__ */ c(
|
|
782
|
+
/* @__PURE__ */ c(z, {
|
|
783
783
|
type: "button",
|
|
784
784
|
size: "sm",
|
|
785
785
|
borderRadius: 100,
|
|
786
786
|
width: 28,
|
|
787
787
|
height: 28,
|
|
788
788
|
padding: 0,
|
|
789
|
-
onPress: () =>
|
|
790
|
-
children: /* @__PURE__ */ c(
|
|
789
|
+
onPress: () => E(new Date(T.setMonth(T.getMonth() - 1))),
|
|
790
|
+
children: /* @__PURE__ */ c(M, {
|
|
791
791
|
fontSize: 12,
|
|
792
792
|
position: "relative",
|
|
793
793
|
left: -1,
|
|
794
794
|
children: "<"
|
|
795
795
|
})
|
|
796
796
|
}),
|
|
797
|
-
/* @__PURE__ */ l(
|
|
797
|
+
/* @__PURE__ */ l(O, {
|
|
798
798
|
alignItems: "center",
|
|
799
799
|
cursor: "pointer",
|
|
800
800
|
children: [
|
|
801
|
-
/* @__PURE__ */ c(
|
|
802
|
-
onDoubleClick: () =>
|
|
803
|
-
children:
|
|
801
|
+
/* @__PURE__ */ c(k, {
|
|
802
|
+
onDoubleClick: () => b(!0),
|
|
803
|
+
children: y ? /* @__PURE__ */ c(V, {
|
|
804
804
|
size: "sm",
|
|
805
805
|
width: 100,
|
|
806
806
|
style: { textAlign: "center" },
|
|
807
807
|
paddingHorizontal: 4,
|
|
808
|
-
defaultValue:
|
|
808
|
+
defaultValue: T.getMonth() + 1,
|
|
809
809
|
onKeyDown: (e) => {
|
|
810
810
|
e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
|
|
811
811
|
},
|
|
812
812
|
onBlur: (e) => {
|
|
813
813
|
let t = parseInt(e.target.value);
|
|
814
|
-
!isNaN(t) && t > 0 && t <= 12 &&
|
|
814
|
+
!isNaN(t) && t > 0 && t <= 12 && E(new Date(T.setMonth(t - 1))), b(!1);
|
|
815
815
|
}
|
|
816
|
-
}) : /* @__PURE__ */ c(
|
|
816
|
+
}) : /* @__PURE__ */ c(M, {
|
|
817
817
|
fontSize: 12,
|
|
818
818
|
fontWeight: "700",
|
|
819
819
|
color: "$primary",
|
|
820
|
-
children:
|
|
820
|
+
children: re[T.getMonth()]
|
|
821
821
|
})
|
|
822
822
|
}),
|
|
823
823
|
/* @__PURE__ */ c(f, { width: 12 }),
|
|
824
|
-
/* @__PURE__ */ c(
|
|
825
|
-
onDoubleClick: () =>
|
|
826
|
-
children:
|
|
824
|
+
/* @__PURE__ */ c(k, {
|
|
825
|
+
onDoubleClick: () => v(!0),
|
|
826
|
+
children: ee ? /* @__PURE__ */ c(V, {
|
|
827
827
|
size: "sm",
|
|
828
828
|
width: 60,
|
|
829
829
|
style: { textAlign: "center" },
|
|
830
830
|
paddingHorizontal: 4,
|
|
831
|
-
defaultValue:
|
|
831
|
+
defaultValue: T.getFullYear().toString(),
|
|
832
832
|
onKeyDown: (e) => {
|
|
833
833
|
e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
|
|
834
834
|
},
|
|
835
835
|
onBlur: (e) => {
|
|
836
836
|
let t = parseInt(e.target.value);
|
|
837
|
-
isNaN(t) ||
|
|
837
|
+
isNaN(t) || E(new Date(T.setFullYear(t))), v(!1);
|
|
838
838
|
}
|
|
839
|
-
}) : /* @__PURE__ */ c(
|
|
839
|
+
}) : /* @__PURE__ */ c(M, {
|
|
840
840
|
fontWeight: "700",
|
|
841
841
|
color: "$primary",
|
|
842
|
-
children:
|
|
842
|
+
children: T.getFullYear()
|
|
843
843
|
})
|
|
844
844
|
})
|
|
845
845
|
]
|
|
846
846
|
}),
|
|
847
|
-
/* @__PURE__ */ c(
|
|
847
|
+
/* @__PURE__ */ c(z, {
|
|
848
848
|
type: "button",
|
|
849
849
|
size: "sm",
|
|
850
850
|
borderRadius: 100,
|
|
851
851
|
width: 28,
|
|
852
852
|
height: 28,
|
|
853
853
|
padding: 0,
|
|
854
|
-
onPress: () =>
|
|
855
|
-
children: /* @__PURE__ */ c(
|
|
854
|
+
onPress: () => E(new Date(T.setMonth(T.getMonth() + 1))),
|
|
855
|
+
children: /* @__PURE__ */ c(M, {
|
|
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(
|
|
864
|
+
/* @__PURE__ */ l(O, {
|
|
865
865
|
flexWrap: "wrap",
|
|
866
866
|
gap: 2,
|
|
867
867
|
marginBottom: "$2",
|
|
868
|
-
children: [/* @__PURE__ */ c(
|
|
868
|
+
children: [/* @__PURE__ */ c(O, {
|
|
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(
|
|
879
|
+
].map((e) => /* @__PURE__ */ c(D, {
|
|
880
880
|
width: 36,
|
|
881
881
|
alignItems: "center",
|
|
882
|
-
children: /* @__PURE__ */ c(
|
|
882
|
+
children: /* @__PURE__ */ c(M, {
|
|
883
883
|
fontSize: 10,
|
|
884
884
|
color: "muted",
|
|
885
885
|
fontWeight: "600",
|
|
886
886
|
children: e
|
|
887
887
|
})
|
|
888
888
|
}, e))
|
|
889
|
-
}),
|
|
890
|
-
let n = e ===
|
|
891
|
-
return /* @__PURE__ */ c(
|
|
889
|
+
}), ne.map((e, t) => {
|
|
890
|
+
let n = e === C.getDate() && T.getMonth() === C.getMonth() && T.getFullYear() === C.getFullYear();
|
|
891
|
+
return /* @__PURE__ */ c(D, {
|
|
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 &&
|
|
901
|
-
children: /* @__PURE__ */ c(
|
|
900
|
+
onPress: () => e && N(e),
|
|
901
|
+
children: /* @__PURE__ */ c(M, {
|
|
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
|
-
|
|
910
|
+
x === "datetime-local" && /* @__PURE__ */ l(k, {
|
|
911
911
|
marginTop: "$2",
|
|
912
912
|
paddingTop: "$3",
|
|
913
913
|
borderTopWidth: 1,
|
|
914
914
|
borderColor: "$borderColor",
|
|
915
915
|
gap: "$2",
|
|
916
|
-
children: [/* @__PURE__ */ l(
|
|
916
|
+
children: [/* @__PURE__ */ l(O, {
|
|
917
917
|
justifyContent: "space-around",
|
|
918
918
|
alignItems: "center",
|
|
919
919
|
children: [
|
|
920
|
-
/* @__PURE__ */ l(
|
|
920
|
+
/* @__PURE__ */ l(k, {
|
|
921
921
|
alignItems: "center",
|
|
922
922
|
gap: "$1",
|
|
923
923
|
children: [
|
|
924
|
-
/* @__PURE__ */ c(
|
|
924
|
+
/* @__PURE__ */ c(z, {
|
|
925
925
|
type: "button",
|
|
926
926
|
size: "sm",
|
|
927
927
|
variant: "ghost",
|
|
928
928
|
padding: 0,
|
|
929
|
-
onPress: () =>
|
|
930
|
-
children: /* @__PURE__ */ c(
|
|
929
|
+
onPress: () => P(1, 0, 0),
|
|
930
|
+
children: /* @__PURE__ */ c(M, {
|
|
931
931
|
fontSize: 16,
|
|
932
932
|
children: "+"
|
|
933
933
|
})
|
|
934
934
|
}),
|
|
935
|
-
/* @__PURE__ */ c(
|
|
935
|
+
/* @__PURE__ */ c(V, {
|
|
936
936
|
size: "sm",
|
|
937
937
|
width: 52,
|
|
938
938
|
style: { textAlign: "center" },
|
|
@@ -940,30 +940,30 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
|
|
|
940
940
|
onKeyDown: (e) => {
|
|
941
941
|
e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
|
|
942
942
|
},
|
|
943
|
-
value: (
|
|
943
|
+
value: (C.getHours() % 12 || 12).toString(),
|
|
944
944
|
onChangeText: (e) => {
|
|
945
945
|
let t = parseInt(e);
|
|
946
946
|
if (!isNaN(t)) {
|
|
947
947
|
t === 12 && (t = 0);
|
|
948
|
-
let e = new Date(
|
|
949
|
-
e.setHours(n ? t + 12 : t),
|
|
948
|
+
let e = new Date(C), n = e.getHours() >= 12;
|
|
949
|
+
e.setHours(n ? t + 12 : t), j(e);
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
}),
|
|
953
|
-
/* @__PURE__ */ c(
|
|
953
|
+
/* @__PURE__ */ c(z, {
|
|
954
954
|
type: "button",
|
|
955
955
|
size: "sm",
|
|
956
956
|
variant: "ghost",
|
|
957
957
|
padding: 0,
|
|
958
|
-
onPress: () =>
|
|
959
|
-
children: /* @__PURE__ */ c(
|
|
958
|
+
onPress: () => P(-1, 0, 0),
|
|
959
|
+
children: /* @__PURE__ */ c(M, {
|
|
960
960
|
fontSize: 16,
|
|
961
961
|
children: "-"
|
|
962
962
|
})
|
|
963
963
|
})
|
|
964
964
|
]
|
|
965
965
|
}),
|
|
966
|
-
/* @__PURE__ */ c(
|
|
966
|
+
/* @__PURE__ */ c(M, {
|
|
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(
|
|
974
|
+
/* @__PURE__ */ l(k, {
|
|
975
975
|
alignItems: "center",
|
|
976
976
|
gap: "$1",
|
|
977
977
|
children: [
|
|
978
|
-
/* @__PURE__ */ c(
|
|
978
|
+
/* @__PURE__ */ c(z, {
|
|
979
979
|
type: "button",
|
|
980
980
|
size: "sm",
|
|
981
981
|
variant: "ghost",
|
|
982
982
|
padding: 0,
|
|
983
|
-
onPress: () =>
|
|
984
|
-
children: /* @__PURE__ */ c(
|
|
983
|
+
onPress: () => P(0, 1, 0),
|
|
984
|
+
children: /* @__PURE__ */ c(M, {
|
|
985
985
|
fontSize: 16,
|
|
986
986
|
children: "+"
|
|
987
987
|
})
|
|
988
988
|
}),
|
|
989
|
-
/* @__PURE__ */ c(
|
|
989
|
+
/* @__PURE__ */ c(V, {
|
|
990
990
|
size: "sm",
|
|
991
991
|
width: 52,
|
|
992
992
|
style: { textAlign: "center" },
|
|
@@ -994,29 +994,29 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
|
|
|
994
994
|
onKeyDown: (e) => {
|
|
995
995
|
e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
|
|
996
996
|
},
|
|
997
|
-
value:
|
|
997
|
+
value: C.getMinutes().toString().padStart(2, "0"),
|
|
998
998
|
onChangeText: (e) => {
|
|
999
999
|
let t = parseInt(e);
|
|
1000
1000
|
if (!isNaN(t) && t >= 0 && t < 60) {
|
|
1001
|
-
let e = new Date(
|
|
1002
|
-
e.setMinutes(t),
|
|
1001
|
+
let e = new Date(C);
|
|
1002
|
+
e.setMinutes(t), j(e);
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
1005
|
}),
|
|
1006
|
-
/* @__PURE__ */ c(
|
|
1006
|
+
/* @__PURE__ */ c(z, {
|
|
1007
1007
|
type: "button",
|
|
1008
1008
|
size: "sm",
|
|
1009
1009
|
variant: "ghost",
|
|
1010
1010
|
padding: 0,
|
|
1011
|
-
onPress: () =>
|
|
1012
|
-
children: /* @__PURE__ */ c(
|
|
1011
|
+
onPress: () => P(0, -1, 0),
|
|
1012
|
+
children: /* @__PURE__ */ c(M, {
|
|
1013
1013
|
fontSize: 16,
|
|
1014
1014
|
children: "-"
|
|
1015
1015
|
})
|
|
1016
1016
|
})
|
|
1017
1017
|
]
|
|
1018
1018
|
}),
|
|
1019
|
-
/* @__PURE__ */ c(
|
|
1019
|
+
/* @__PURE__ */ c(M, {
|
|
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(
|
|
1027
|
+
/* @__PURE__ */ l(k, {
|
|
1028
1028
|
alignItems: "center",
|
|
1029
1029
|
gap: "$1",
|
|
1030
1030
|
children: [
|
|
1031
|
-
/* @__PURE__ */ c(
|
|
1031
|
+
/* @__PURE__ */ c(z, {
|
|
1032
1032
|
type: "button",
|
|
1033
1033
|
size: "sm",
|
|
1034
1034
|
variant: "ghost",
|
|
1035
1035
|
padding: 0,
|
|
1036
|
-
onPress: () =>
|
|
1037
|
-
children: /* @__PURE__ */ c(
|
|
1036
|
+
onPress: () => P(0, 0, 1),
|
|
1037
|
+
children: /* @__PURE__ */ c(M, {
|
|
1038
1038
|
fontSize: 16,
|
|
1039
1039
|
children: "+"
|
|
1040
1040
|
})
|
|
1041
1041
|
}),
|
|
1042
|
-
/* @__PURE__ */ c(
|
|
1042
|
+
/* @__PURE__ */ c(V, {
|
|
1043
1043
|
size: "sm",
|
|
1044
1044
|
width: 52,
|
|
1045
1045
|
style: { textAlign: "center" },
|
|
@@ -1047,64 +1047,64 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
|
|
|
1047
1047
|
onKeyDown: (e) => {
|
|
1048
1048
|
e.key === "Enter" && (e.preventDefault(), e.currentTarget.blur());
|
|
1049
1049
|
},
|
|
1050
|
-
value:
|
|
1050
|
+
value: C.getSeconds().toString().padStart(2, "0"),
|
|
1051
1051
|
onChangeText: (e) => {
|
|
1052
1052
|
let t = parseInt(e);
|
|
1053
1053
|
if (!isNaN(t) && t >= 0 && t < 60) {
|
|
1054
|
-
let e = new Date(
|
|
1055
|
-
e.setSeconds(t),
|
|
1054
|
+
let e = new Date(C);
|
|
1055
|
+
e.setSeconds(t), j(e);
|
|
1056
1056
|
}
|
|
1057
1057
|
}
|
|
1058
1058
|
}),
|
|
1059
|
-
/* @__PURE__ */ c(
|
|
1059
|
+
/* @__PURE__ */ c(z, {
|
|
1060
1060
|
type: "button",
|
|
1061
1061
|
size: "sm",
|
|
1062
1062
|
variant: "ghost",
|
|
1063
1063
|
padding: 0,
|
|
1064
|
-
onPress: () =>
|
|
1065
|
-
children: /* @__PURE__ */ c(
|
|
1064
|
+
onPress: () => P(0, 0, -1),
|
|
1065
|
+
children: /* @__PURE__ */ c(M, {
|
|
1066
1066
|
fontSize: 16,
|
|
1067
1067
|
children: "-"
|
|
1068
1068
|
})
|
|
1069
1069
|
})
|
|
1070
1070
|
]
|
|
1071
1071
|
}),
|
|
1072
|
-
/* @__PURE__ */ c(
|
|
1072
|
+
/* @__PURE__ */ c(k, {
|
|
1073
1073
|
justifyContent: "center",
|
|
1074
1074
|
marginTop: 10,
|
|
1075
1075
|
position: "relative",
|
|
1076
1076
|
top: -2,
|
|
1077
|
-
children: /* @__PURE__ */ c(
|
|
1077
|
+
children: /* @__PURE__ */ c(z, {
|
|
1078
1078
|
type: "button",
|
|
1079
1079
|
size: "sm",
|
|
1080
1080
|
variant: "primary",
|
|
1081
1081
|
paddingHorizontal: "$2",
|
|
1082
|
-
onPress:
|
|
1082
|
+
onPress: F,
|
|
1083
1083
|
borderRadius: "$2",
|
|
1084
1084
|
minWidth: 46,
|
|
1085
1085
|
backgroundColor: "$primary",
|
|
1086
|
-
children: /* @__PURE__ */ c(
|
|
1086
|
+
children: /* @__PURE__ */ c(M, {
|
|
1087
1087
|
fontSize: 10,
|
|
1088
1088
|
fontWeight: "900",
|
|
1089
1089
|
color: "$primaryColor",
|
|
1090
|
-
children:
|
|
1090
|
+
children: C.getHours() >= 12 ? "PM" : "AM"
|
|
1091
1091
|
})
|
|
1092
1092
|
})
|
|
1093
1093
|
})
|
|
1094
1094
|
]
|
|
1095
|
-
}), /* @__PURE__ */ l(
|
|
1095
|
+
}), /* @__PURE__ */ l(O, {
|
|
1096
1096
|
marginTop: "$1",
|
|
1097
1097
|
children: [
|
|
1098
|
-
/* @__PURE__ */ c(
|
|
1098
|
+
/* @__PURE__ */ c(z, {
|
|
1099
1099
|
type: "button",
|
|
1100
1100
|
variant: "default",
|
|
1101
1101
|
size: "sm",
|
|
1102
|
-
onPress:
|
|
1102
|
+
onPress: I,
|
|
1103
1103
|
flex: 1,
|
|
1104
1104
|
children: m("Now")
|
|
1105
1105
|
}),
|
|
1106
1106
|
/* @__PURE__ */ c(f, { width: 8 }),
|
|
1107
|
-
/* @__PURE__ */ c(
|
|
1107
|
+
/* @__PURE__ */ c(z, {
|
|
1108
1108
|
type: "button",
|
|
1109
1109
|
variant: "primary",
|
|
1110
1110
|
size: "sm",
|
|
@@ -1117,52 +1117,52 @@ var ce = e.forwardRef(({ value: e, onChange: t, onChangeText: n, type: a = "date
|
|
|
1117
1117
|
})
|
|
1118
1118
|
]
|
|
1119
1119
|
});
|
|
1120
|
-
return /* @__PURE__ */ c(
|
|
1120
|
+
return /* @__PURE__ */ c(k, {
|
|
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(
|
|
1126
|
-
trigger:
|
|
1127
|
-
content:
|
|
1125
|
+
children: /* @__PURE__ */ c(H, {
|
|
1126
|
+
trigger: ie,
|
|
1127
|
+
content: R,
|
|
1128
1128
|
placement: u,
|
|
1129
1129
|
open: h,
|
|
1130
1130
|
onOpenChange: g
|
|
1131
1131
|
})
|
|
1132
1132
|
});
|
|
1133
1133
|
});
|
|
1134
|
-
|
|
1134
|
+
le.displayName = "DatePicker";
|
|
1135
1135
|
//#endregion
|
|
1136
1136
|
//#region src/components/Select.tsx
|
|
1137
|
-
var
|
|
1138
|
-
let { t:
|
|
1137
|
+
var U = 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) => {
|
|
1138
|
+
let { t: T } = _("ui"), E = (s || []).find((e) => e.value === r), D = E ? E.label : u || "Select an option...", [O, A] = o(!1), j = (e) => {
|
|
1139
1139
|
a?.(e), i && i({ target: {
|
|
1140
1140
|
value: e,
|
|
1141
1141
|
name: f || ""
|
|
1142
|
-
} }),
|
|
1143
|
-
},
|
|
1144
|
-
ref:
|
|
1142
|
+
} }), A(!1);
|
|
1143
|
+
}, M = /* @__PURE__ */ l(z, {
|
|
1144
|
+
ref: w,
|
|
1145
1145
|
disabled: d,
|
|
1146
1146
|
tabIndex: -1,
|
|
1147
1147
|
size: n,
|
|
1148
1148
|
variant: "ghost",
|
|
1149
1149
|
width: "100%",
|
|
1150
1150
|
justifyContent: "space-between",
|
|
1151
|
-
borderWidth:
|
|
1152
|
-
borderColor: t ? "$error" :
|
|
1153
|
-
backgroundColor:
|
|
1154
|
-
borderRadius:
|
|
1155
|
-
paddingHorizontal:
|
|
1151
|
+
borderWidth: y ?? 1,
|
|
1152
|
+
borderColor: t ? "$error" : b ?? "$borderColor",
|
|
1153
|
+
backgroundColor: v ?? "$backgroundSecondary",
|
|
1154
|
+
borderRadius: x ?? "$round",
|
|
1155
|
+
paddingHorizontal: S,
|
|
1156
1156
|
hoverStyle: { backgroundColor: "$backgroundHover" },
|
|
1157
1157
|
pointerEvents: "none",
|
|
1158
|
-
children: [/* @__PURE__ */ c(
|
|
1158
|
+
children: [/* @__PURE__ */ c(P, {
|
|
1159
1159
|
fontSize: n === "sm" ? "$xs" : "$sm",
|
|
1160
|
-
color:
|
|
1160
|
+
color: E ? "$color" : "$colorMuted",
|
|
1161
1161
|
numberOfLines: 1,
|
|
1162
1162
|
flex: 1,
|
|
1163
1163
|
overflow: "hidden",
|
|
1164
|
-
children:
|
|
1165
|
-
}), /* @__PURE__ */ c(
|
|
1164
|
+
children: D
|
|
1165
|
+
}), /* @__PURE__ */ c(k, {
|
|
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
|
-
}), [
|
|
1176
|
+
}), [N, F] = o(""), I = (s || []).filter((e) => e.label.toLowerCase().includes(N.toLowerCase())), L = /* @__PURE__ */ l(k, { children: [(s || []).length > 5 && /* @__PURE__ */ c(k, {
|
|
1177
1177
|
padding: "$xs",
|
|
1178
1178
|
paddingBottom: 0,
|
|
1179
|
-
children: /* @__PURE__ */ c(
|
|
1179
|
+
children: /* @__PURE__ */ c(V, {
|
|
1180
1180
|
size: "sm",
|
|
1181
|
-
placeholder:
|
|
1182
|
-
value:
|
|
1183
|
-
onChangeText:
|
|
1181
|
+
placeholder: T("search", { defaultValue: "Search..." }),
|
|
1182
|
+
value: N,
|
|
1183
|
+
onChangeText: F,
|
|
1184
1184
|
onKeyDown: (e) => e.stopPropagation()
|
|
1185
1185
|
})
|
|
1186
|
-
}), /* @__PURE__ */ c(
|
|
1186
|
+
}), /* @__PURE__ */ c(ee, {
|
|
1187
1187
|
maxHeight: 250,
|
|
1188
|
-
children: /* @__PURE__ */ l(
|
|
1188
|
+
children: /* @__PURE__ */ l(k, {
|
|
1189
1189
|
gap: "$xs",
|
|
1190
1190
|
padding: "$xs",
|
|
1191
1191
|
children: [
|
|
1192
|
-
u && /* @__PURE__ */ c(
|
|
1192
|
+
u && /* @__PURE__ */ c(z, {
|
|
1193
1193
|
variant: "ghost",
|
|
1194
1194
|
size: "sm",
|
|
1195
1195
|
justifyContent: "flex-start",
|
|
1196
|
-
onPress: () =>
|
|
1197
|
-
children: /* @__PURE__ */ c(
|
|
1196
|
+
onPress: () => j(""),
|
|
1197
|
+
children: /* @__PURE__ */ c(P, {
|
|
1198
1198
|
fontSize: "$sm",
|
|
1199
1199
|
color: "$colorMuted",
|
|
1200
1200
|
children: u
|
|
1201
1201
|
})
|
|
1202
1202
|
}),
|
|
1203
|
-
|
|
1203
|
+
I.length === 0 && /* @__PURE__ */ c(P, {
|
|
1204
1204
|
fontSize: "$sm",
|
|
1205
1205
|
color: "$colorMuted",
|
|
1206
1206
|
padding: "$sm",
|
|
1207
1207
|
textAlign: "center",
|
|
1208
|
-
children:
|
|
1208
|
+
children: T("no_options_found", { defaultValue: "No options found" })
|
|
1209
1209
|
}),
|
|
1210
|
-
|
|
1210
|
+
I.map((e) => /* @__PURE__ */ c(z, {
|
|
1211
1211
|
variant: "ghost",
|
|
1212
1212
|
size: "sm",
|
|
1213
1213
|
justifyContent: "flex-start",
|
|
1214
|
-
onPress: () =>
|
|
1214
|
+
onPress: () => j(e.value),
|
|
1215
1215
|
backgroundColor: e.value === r ? "$backgroundActive" : "transparent",
|
|
1216
|
-
children: /* @__PURE__ */ c(
|
|
1216
|
+
children: /* @__PURE__ */ c(P, {
|
|
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
|
-
|
|
1226
|
-
}, [
|
|
1225
|
+
O || F("");
|
|
1226
|
+
}, [O]), /* @__PURE__ */ c(k, {
|
|
1227
1227
|
position: "relative",
|
|
1228
|
-
width:
|
|
1229
|
-
minWidth:
|
|
1230
|
-
...
|
|
1231
|
-
children: /* @__PURE__ */ c(
|
|
1232
|
-
trigger:
|
|
1233
|
-
content:
|
|
1228
|
+
width: C.width || "100%",
|
|
1229
|
+
minWidth: C.minWidth,
|
|
1230
|
+
...C,
|
|
1231
|
+
children: /* @__PURE__ */ c(H, {
|
|
1232
|
+
trigger: M,
|
|
1233
|
+
content: L,
|
|
1234
1234
|
placement: g || "bottom-start",
|
|
1235
|
-
open:
|
|
1236
|
-
onOpenChange:
|
|
1235
|
+
open: O,
|
|
1236
|
+
onOpenChange: A
|
|
1237
1237
|
})
|
|
1238
1238
|
});
|
|
1239
1239
|
});
|
|
1240
|
-
|
|
1240
|
+
U.displayName = "Select";
|
|
1241
1241
|
//#endregion
|
|
1242
1242
|
//#region src/components/Toast.tsx
|
|
1243
|
-
var
|
|
1243
|
+
var ue = {
|
|
1244
1244
|
success: "✓",
|
|
1245
1245
|
error: "✕",
|
|
1246
1246
|
warning: "⚠",
|
|
1247
1247
|
info: "ℹ"
|
|
1248
1248
|
};
|
|
1249
|
-
function
|
|
1249
|
+
function de({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }) {
|
|
1250
1250
|
return r(() => {
|
|
1251
1251
|
if (n > 0 && i) {
|
|
1252
1252
|
let e = setTimeout(i, n);
|
|
1253
1253
|
return () => clearTimeout(e);
|
|
1254
1254
|
}
|
|
1255
|
-
}, [n, i]), /* @__PURE__ */ c(
|
|
1255
|
+
}, [n, i]), /* @__PURE__ */ c(k, {
|
|
1256
1256
|
className: `toast toast-${t}`,
|
|
1257
1257
|
role: "alert",
|
|
1258
1258
|
"aria-live": "assertive",
|
|
@@ -1268,19 +1268,19 @@ 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(
|
|
1271
|
+
children: /* @__PURE__ */ l(O, {
|
|
1272
1272
|
alignItems: "center",
|
|
1273
1273
|
gap: "$sm",
|
|
1274
1274
|
children: [
|
|
1275
|
-
/* @__PURE__ */ c(
|
|
1275
|
+
/* @__PURE__ */ c(M, {
|
|
1276
1276
|
fontWeight: "600",
|
|
1277
|
-
children:
|
|
1277
|
+
children: ue[t]
|
|
1278
1278
|
}),
|
|
1279
|
-
/* @__PURE__ */ c(
|
|
1279
|
+
/* @__PURE__ */ c(M, {
|
|
1280
1280
|
flex: 1,
|
|
1281
1281
|
children: e
|
|
1282
1282
|
}),
|
|
1283
|
-
i && /* @__PURE__ */ c(
|
|
1283
|
+
i && /* @__PURE__ */ c(z, {
|
|
1284
1284
|
variant: "ghost",
|
|
1285
1285
|
size: "sm",
|
|
1286
1286
|
onPress: i,
|
|
@@ -1291,8 +1291,8 @@ function ue({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }
|
|
|
1291
1291
|
})
|
|
1292
1292
|
});
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1295
|
-
return /* @__PURE__ */ c(
|
|
1294
|
+
function fe({ toasts: e, onDismiss: t }) {
|
|
1295
|
+
return /* @__PURE__ */ c(k, {
|
|
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(
|
|
1303
|
+
children: e.map((e) => /* @__PURE__ */ c(k, {
|
|
1304
1304
|
pointerEvents: "auto",
|
|
1305
|
-
children: /* @__PURE__ */ c(
|
|
1305
|
+
children: /* @__PURE__ */ c(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
|
|
1314
|
+
var pe = t(null), me = ({ children: e }) => {
|
|
1315
1315
|
let [t, n] = o(/* @__PURE__ */ new Map());
|
|
1316
1316
|
/* v8 ignore stop */
|
|
1317
|
-
return /* @__PURE__ */ l(
|
|
1317
|
+
return /* @__PURE__ */ l(pe.Provider, {
|
|
1318
1318
|
value: {
|
|
1319
1319
|
register: (e, t) => {
|
|
1320
1320
|
n((n) => {
|
|
@@ -1329,10 +1329,10 @@ var fe = t(null), pe = ({ children: e }) => {
|
|
|
1329
1329
|
});
|
|
1330
1330
|
}
|
|
1331
1331
|
},
|
|
1332
|
-
children: [e, /* @__PURE__ */ c(
|
|
1332
|
+
children: [e, /* @__PURE__ */ c(he, { portals: t })]
|
|
1333
1333
|
});
|
|
1334
|
-
},
|
|
1335
|
-
let t = n(
|
|
1334
|
+
}, he = ({ portals: t }) => typeof document < "u" ? null : /* @__PURE__ */ c(s, { children: Array.from(t.entries()).map(([t, n]) => /* @__PURE__ */ c(e.Fragment, { children: n }, t)) }), W = ({ children: e }) => {
|
|
1335
|
+
let t = n(pe), [i] = o(() => Math.random().toString(36).substr(2, 9));
|
|
1336
1336
|
if (r(() => {
|
|
1337
1337
|
if (!(typeof document < "u" || !t))
|
|
1338
1338
|
/* v8 ignore next */
|
|
@@ -1345,16 +1345,16 @@ var fe = t(null), pe = ({ children: e }) => {
|
|
|
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),
|
|
1348
|
+
return t.className !== n && (t.className = n), v.createPortal(e, t);
|
|
1349
1349
|
}
|
|
1350
1350
|
/* v8 ignore next */
|
|
1351
1351
|
return null;
|
|
1352
|
-
},
|
|
1352
|
+
}, ge = {
|
|
1353
1353
|
sm: 400,
|
|
1354
1354
|
md: 600,
|
|
1355
1355
|
lg: 900,
|
|
1356
1356
|
xl: 1200
|
|
1357
|
-
},
|
|
1357
|
+
}, _e = ({ isOpen: e, onClose: t, title: n, footer: r, size: i = "md", children: a }) => e ? /* @__PURE__ */ c(W, { children: /* @__PURE__ */ l(A, {
|
|
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(
|
|
1368
|
+
children: [/* @__PURE__ */ c(k, {
|
|
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(
|
|
1378
|
-
width:
|
|
1377
|
+
}), /* @__PURE__ */ l(B, {
|
|
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(
|
|
1390
|
+
/* @__PURE__ */ l(O, {
|
|
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(
|
|
1397
|
+
children: [/* @__PURE__ */ c(M, {
|
|
1398
1398
|
fontWeight: "700",
|
|
1399
1399
|
size: "lg",
|
|
1400
1400
|
children: n
|
|
1401
|
-
}), /* @__PURE__ */ c(
|
|
1401
|
+
}), /* @__PURE__ */ c(z, {
|
|
1402
1402
|
size: "sm",
|
|
1403
1403
|
variant: "ghost",
|
|
1404
1404
|
onPress: t,
|
|
1405
1405
|
padding: "$2",
|
|
1406
|
-
children: /* @__PURE__ */ c(
|
|
1406
|
+
children: /* @__PURE__ */ c(M, { children: "✕" })
|
|
1407
1407
|
})]
|
|
1408
1408
|
}),
|
|
1409
|
-
/* @__PURE__ */ c(
|
|
1409
|
+
/* @__PURE__ */ c(k, {
|
|
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(
|
|
1416
|
+
r && /* @__PURE__ */ c(O, {
|
|
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
|
|
1431
|
-
return e ? /* @__PURE__ */ c(
|
|
1430
|
+
function ve({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, footer: a }) {
|
|
1431
|
+
return e ? /* @__PURE__ */ c(W, { children: /* @__PURE__ */ l(A, {
|
|
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(
|
|
1440
|
+
children: [/* @__PURE__ */ c(k, {
|
|
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(
|
|
1449
|
+
}), /* @__PURE__ */ l(B, {
|
|
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(
|
|
1472
|
+
/* @__PURE__ */ l(O, {
|
|
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(
|
|
1479
|
+
children: [/* @__PURE__ */ c(M, {
|
|
1480
1480
|
fontWeight: "700",
|
|
1481
1481
|
size: "$md",
|
|
1482
1482
|
children: n
|
|
1483
|
-
}), /* @__PURE__ */ c(
|
|
1483
|
+
}), /* @__PURE__ */ c(z, {
|
|
1484
1484
|
size: "sm",
|
|
1485
1485
|
variant: "ghost",
|
|
1486
1486
|
onPress: t,
|
|
1487
1487
|
children: "✕"
|
|
1488
1488
|
})]
|
|
1489
1489
|
}),
|
|
1490
|
-
/* @__PURE__ */ c(
|
|
1490
|
+
/* @__PURE__ */ c(k, {
|
|
1491
1491
|
flex: 1,
|
|
1492
1492
|
padding: "$md",
|
|
1493
1493
|
style: { overflowY: "auto" },
|
|
1494
1494
|
children: i
|
|
1495
1495
|
}),
|
|
1496
|
-
a && /* @__PURE__ */ c(
|
|
1496
|
+
a && /* @__PURE__ */ c(O, {
|
|
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
|
|
1511
|
+
var ye = {
|
|
1512
1512
|
$sm: 24,
|
|
1513
1513
|
$md: 32,
|
|
1514
1514
|
$lg: 40,
|
|
1515
1515
|
$xl: 48
|
|
1516
1516
|
};
|
|
1517
|
-
function
|
|
1518
|
-
let [s, l] = o(!1), u = typeof n == "number" ? n :
|
|
1519
|
-
return /* @__PURE__ */ c(
|
|
1517
|
+
function be({ 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 : ye[n] || 32;
|
|
1519
|
+
return /* @__PURE__ */ c(k, {
|
|
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(
|
|
1529
|
+
children: e && !s ? /* @__PURE__ */ c(y, {
|
|
1530
1530
|
source: {
|
|
1531
1531
|
uri: e,
|
|
1532
1532
|
width: u,
|
|
@@ -1535,7 +1535,7 @@ function ye({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
|
|
|
1535
1535
|
width: "100%",
|
|
1536
1536
|
height: "100%",
|
|
1537
1537
|
onError: () => l(!0)
|
|
1538
|
-
}) : typeof t == "string" ? /* @__PURE__ */ c(
|
|
1538
|
+
}) : typeof t == "string" ? /* @__PURE__ */ c(M, {
|
|
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
|
|
1549
|
-
return /* @__PURE__ */ c(
|
|
1548
|
+
function xe({ vertical: e }) {
|
|
1549
|
+
return /* @__PURE__ */ c(k, {
|
|
1550
1550
|
width: e ? 1 : "100%",
|
|
1551
1551
|
height: e ? "100%" : 1,
|
|
1552
1552
|
backgroundColor: "$borderColor"
|
|
@@ -1554,11 +1554,11 @@ function be({ vertical: e }) {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
//#endregion
|
|
1556
1556
|
//#region src/components/Icon.tsx
|
|
1557
|
-
function
|
|
1557
|
+
function Se(e) {
|
|
1558
1558
|
return e.replace(/[-_](.)/g, (e, t) => t.toUpperCase()).replace(/^(.)/, (e) => e.toUpperCase());
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1561
|
-
let a =
|
|
1560
|
+
function G({ name: e, size: t, color: n, strokeWidth: r, ...i }) {
|
|
1561
|
+
let a = Se(e), o = a in b ? b[a] : b.Box;
|
|
1562
1562
|
return /* @__PURE__ */ c(o, {
|
|
1563
1563
|
size: t,
|
|
1564
1564
|
color: n,
|
|
@@ -1568,20 +1568,20 @@ function K({ name: e, size: t, color: n, strokeWidth: r, ...i }) {
|
|
|
1568
1568
|
}
|
|
1569
1569
|
//#endregion
|
|
1570
1570
|
//#region src/theme/ThemeToggle.tsx
|
|
1571
|
-
function
|
|
1572
|
-
let { theme: e, toggleTheme: t } =
|
|
1573
|
-
return /* @__PURE__ */ c(
|
|
1571
|
+
function Ce() {
|
|
1572
|
+
let { theme: e, toggleTheme: t } = E();
|
|
1573
|
+
return /* @__PURE__ */ c(z, {
|
|
1574
1574
|
variant: "ghost",
|
|
1575
1575
|
onPress: t,
|
|
1576
1576
|
"aria-label": `Switch to ${e === "light" ? "dark" : "light"} mode`,
|
|
1577
1577
|
title: `Current theme: ${e}`,
|
|
1578
|
-
children: /* @__PURE__ */ c(
|
|
1578
|
+
children: /* @__PURE__ */ c(G, {
|
|
1579
1579
|
name: e === "light" ? "moon" : "sun",
|
|
1580
1580
|
size: 20
|
|
1581
1581
|
})
|
|
1582
1582
|
});
|
|
1583
1583
|
}
|
|
1584
|
-
var
|
|
1584
|
+
var K = {
|
|
1585
1585
|
brand: {
|
|
1586
1586
|
violet: {
|
|
1587
1587
|
50: "#F5F3FF",
|
|
@@ -1664,7 +1664,7 @@ var q = {
|
|
|
1664
1664
|
borderColorMuted: "rgba(30, 51, 88, 0.4)"
|
|
1665
1665
|
}
|
|
1666
1666
|
}
|
|
1667
|
-
},
|
|
1667
|
+
}, q = {
|
|
1668
1668
|
fontFamily: {
|
|
1669
1669
|
sans: "'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
1670
1670
|
mono: "'JetBrains Mono', 'Fira Code', monospace"
|
|
@@ -1690,7 +1690,7 @@ var q = {
|
|
|
1690
1690
|
normal: 1.5,
|
|
1691
1691
|
relaxed: 1.6
|
|
1692
1692
|
}
|
|
1693
|
-
},
|
|
1693
|
+
}, J = {
|
|
1694
1694
|
spacing: {
|
|
1695
1695
|
xs: "0.25rem",
|
|
1696
1696
|
sm: "0.5rem",
|
|
@@ -1714,24 +1714,24 @@ var q = {
|
|
|
1714
1714
|
};
|
|
1715
1715
|
//#endregion
|
|
1716
1716
|
//#region src/tokens/config.ts
|
|
1717
|
-
function
|
|
1717
|
+
function we() {
|
|
1718
1718
|
return {
|
|
1719
|
-
primary:
|
|
1720
|
-
secondary:
|
|
1719
|
+
primary: K.semantic.light.primary,
|
|
1720
|
+
secondary: K.semantic.light.secondary,
|
|
1721
1721
|
white: "#ffffff",
|
|
1722
1722
|
black: "#000000",
|
|
1723
1723
|
transparent: "transparent"
|
|
1724
1724
|
};
|
|
1725
1725
|
}
|
|
1726
|
-
function
|
|
1726
|
+
function Te() {
|
|
1727
1727
|
let e = {};
|
|
1728
|
-
return Object.entries(
|
|
1728
|
+
return Object.entries(q.fontSize).forEach(([t, n]) => {
|
|
1729
1729
|
let r = parseFloat(n.toString());
|
|
1730
1730
|
e[t] = isNaN(r) ? 16 : r * 16;
|
|
1731
1731
|
}), e;
|
|
1732
1732
|
}
|
|
1733
|
-
function
|
|
1734
|
-
let t =
|
|
1733
|
+
function Ee(e) {
|
|
1734
|
+
let t = K.semantic[e];
|
|
1735
1735
|
return {
|
|
1736
1736
|
background: t.bg,
|
|
1737
1737
|
backgroundSecondary: t.bgSecondary,
|
|
@@ -1749,33 +1749,39 @@ function Te(e) {
|
|
|
1749
1749
|
warning: t.warning,
|
|
1750
1750
|
error: t.error,
|
|
1751
1751
|
shadowColor: e === "light" ? "rgba(0,0,0,0.12)" : "rgba(0,0,0,0.4)",
|
|
1752
|
+
surface: t.bgSecondary || (e === "light" ? "#ffffff" : "#1e293b"),
|
|
1753
|
+
surfaceSubtle: t.bgTertiary || (e === "light" ? "#f1f5f9" : "#0f172a"),
|
|
1754
|
+
surfaceElevated: e === "light" ? "#ffffff" : "#334155",
|
|
1755
|
+
surfaceOverlay: e === "light" ? "#ffffff" : "#1e293b",
|
|
1756
|
+
surfaceHover: e === "light" ? "#f8fafc" : "#334155",
|
|
1757
|
+
surfaceActive: e === "light" ? "#f1f5f9" : "#475569",
|
|
1752
1758
|
...Object.entries(t).reduce((e, [t, n]) => {
|
|
1753
1759
|
let r = t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1754
1760
|
return e[r] = n, e;
|
|
1755
1761
|
}, {})
|
|
1756
1762
|
};
|
|
1757
1763
|
}
|
|
1758
|
-
function
|
|
1764
|
+
function De() {
|
|
1759
1765
|
let e = {};
|
|
1760
|
-
return Object.entries(
|
|
1766
|
+
return Object.entries(J.spacing).forEach(([t, n]) => {
|
|
1761
1767
|
let r = parseFloat(n.toString());
|
|
1762
1768
|
e[t] = isNaN(r) ? 0 : r * 16;
|
|
1763
1769
|
}), e;
|
|
1764
1770
|
}
|
|
1765
|
-
function
|
|
1771
|
+
function Oe() {
|
|
1766
1772
|
let e = {};
|
|
1767
|
-
return Object.entries(
|
|
1773
|
+
return Object.entries(J.borderRadius).forEach(([t, n]) => {
|
|
1768
1774
|
let r = parseFloat(n.toString());
|
|
1769
1775
|
e[t] = isNaN(r) ? 0 : r;
|
|
1770
1776
|
}), e.full = 9999, e.pill = 9999, e.round = 8, e;
|
|
1771
1777
|
}
|
|
1772
|
-
function
|
|
1778
|
+
function ke() {
|
|
1773
1779
|
return {
|
|
1774
1780
|
tokens: {
|
|
1775
|
-
color:
|
|
1776
|
-
space:
|
|
1777
|
-
size:
|
|
1778
|
-
radius:
|
|
1781
|
+
color: we(),
|
|
1782
|
+
space: De(),
|
|
1783
|
+
size: Te(),
|
|
1784
|
+
radius: Oe(),
|
|
1779
1785
|
zIndex: {
|
|
1780
1786
|
base: 0,
|
|
1781
1787
|
dropdown: 100,
|
|
@@ -1784,26 +1790,26 @@ function Oe() {
|
|
|
1784
1790
|
}
|
|
1785
1791
|
},
|
|
1786
1792
|
themes: {
|
|
1787
|
-
light:
|
|
1788
|
-
dark:
|
|
1793
|
+
light: Ee("light"),
|
|
1794
|
+
dark: Ee("dark")
|
|
1789
1795
|
}
|
|
1790
1796
|
};
|
|
1791
1797
|
}
|
|
1792
1798
|
//#endregion
|
|
1793
1799
|
//#region src/theme/mThemeConfig.ts
|
|
1794
|
-
function
|
|
1800
|
+
function Y(e, t) {
|
|
1795
1801
|
let n = { ...e };
|
|
1796
1802
|
for (let [e, r] of Object.entries(t ?? {})) r !== void 0 && (n[e] = r);
|
|
1797
1803
|
return n;
|
|
1798
1804
|
}
|
|
1799
|
-
var X =
|
|
1805
|
+
var X = ke(), Z = {
|
|
1800
1806
|
color: X.tokens.color,
|
|
1801
1807
|
space: X.tokens.space,
|
|
1802
1808
|
size: X.tokens.size,
|
|
1803
1809
|
radius: X.tokens.radius,
|
|
1804
1810
|
zIndex: X.tokens.zIndex
|
|
1805
1811
|
}, Ae = h(Z), je = p({
|
|
1806
|
-
family:
|
|
1812
|
+
family: q.fontFamily.sans,
|
|
1807
1813
|
size: X.tokens.size,
|
|
1808
1814
|
lineHeight: {
|
|
1809
1815
|
tight: 1.3,
|
|
@@ -1820,7 +1826,7 @@ var X = Oe(), Z = {
|
|
|
1820
1826
|
lg: -.2
|
|
1821
1827
|
}
|
|
1822
1828
|
}), Me = p({
|
|
1823
|
-
family:
|
|
1829
|
+
family: q.fontFamily.sans,
|
|
1824
1830
|
size: X.tokens.size,
|
|
1825
1831
|
lineHeight: {
|
|
1826
1832
|
tight: 1.3,
|
|
@@ -1848,7 +1854,37 @@ var X = Oe(), Z = {
|
|
|
1848
1854
|
pointerCoarse: { pointer: "coarse" }
|
|
1849
1855
|
};
|
|
1850
1856
|
function Q(e) {
|
|
1851
|
-
let t = e?.tokens ?
|
|
1857
|
+
let t = e?.tokens?.fontFamily?.sans ?? e?.tokens?.fontFamily?.body ?? q.fontFamily.sans, n = e?.tokens?.fontFamily?.heading ?? t, r = e?.tokens?.fontFamily ? p({
|
|
1858
|
+
family: n,
|
|
1859
|
+
size: X.tokens.size,
|
|
1860
|
+
lineHeight: {
|
|
1861
|
+
tight: 1.3,
|
|
1862
|
+
normal: 1.5
|
|
1863
|
+
},
|
|
1864
|
+
weight: {
|
|
1865
|
+
normal: "400",
|
|
1866
|
+
medium: "500",
|
|
1867
|
+
semibold: "600",
|
|
1868
|
+
bold: "700"
|
|
1869
|
+
},
|
|
1870
|
+
letterSpacing: {
|
|
1871
|
+
base: 0,
|
|
1872
|
+
lg: -.2
|
|
1873
|
+
}
|
|
1874
|
+
}) : je, i = e?.tokens?.fontFamily ? p({
|
|
1875
|
+
family: t,
|
|
1876
|
+
size: X.tokens.size,
|
|
1877
|
+
lineHeight: {
|
|
1878
|
+
tight: 1.3,
|
|
1879
|
+
normal: 1.5
|
|
1880
|
+
},
|
|
1881
|
+
weight: {
|
|
1882
|
+
normal: "400",
|
|
1883
|
+
medium: "500",
|
|
1884
|
+
semibold: "600",
|
|
1885
|
+
bold: "700"
|
|
1886
|
+
}
|
|
1887
|
+
}) : Me, a = e?.tokens ? h({
|
|
1852
1888
|
color: {
|
|
1853
1889
|
...Z.color,
|
|
1854
1890
|
...e.tokens.color ?? {}
|
|
@@ -1869,16 +1905,35 @@ function Q(e) {
|
|
|
1869
1905
|
...Z.zIndex,
|
|
1870
1906
|
...e.tokens.zIndex ?? {}
|
|
1871
1907
|
}
|
|
1872
|
-
}) : Ae,
|
|
1873
|
-
|
|
1874
|
-
|
|
1908
|
+
}) : Ae, o = {};
|
|
1909
|
+
if (e?.tokens) {
|
|
1910
|
+
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);
|
|
1911
|
+
if (e.tokens.shadow) for (let [t, n] of Object.entries(e.tokens.shadow)) n?.boxShadow && (o[`shadow-${t}`] = n.boxShadow);
|
|
1912
|
+
if (e.tokens.opacity) for (let [t, n] of Object.entries(e.tokens.opacity)) n !== void 0 && (o[`opacity-${t}`] = n);
|
|
1913
|
+
if (e.tokens.lineHeight) for (let [t, n] of Object.entries(e.tokens.lineHeight)) n !== void 0 && (o[`line-height-${t}`] = n);
|
|
1914
|
+
if (e.tokens.letterSpacing) for (let [t, n] of Object.entries(e.tokens.letterSpacing)) n !== void 0 && (o[`letter-spacing-${t}`] = n);
|
|
1915
|
+
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);
|
|
1916
|
+
if (e.tokens.content) for (let [t, n] of Object.entries(e.tokens.content)) n !== void 0 && (o[`content-${t}`] = n);
|
|
1917
|
+
if (e.tokens.backdropBlur) for (let [t, n] of Object.entries(e.tokens.backdropBlur)) n !== void 0 && (o[`backdrop-blur-${t}`] = n);
|
|
1918
|
+
}
|
|
1919
|
+
let s = {
|
|
1920
|
+
light: Y(Y(X.themes.light, o), e?.themes?.light),
|
|
1921
|
+
dark: Y(Y(X.themes.dark, o), e?.themes?.dark)
|
|
1922
|
+
}, c = (e) => {
|
|
1923
|
+
let t = {};
|
|
1924
|
+
for (let [n, r] of Object.entries(e)) if (typeof r == "string" || typeof r == "number") t[n] = r;
|
|
1925
|
+
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);
|
|
1926
|
+
return t;
|
|
1875
1927
|
};
|
|
1876
1928
|
return m({
|
|
1877
|
-
tokens:
|
|
1878
|
-
themes:
|
|
1929
|
+
tokens: a,
|
|
1930
|
+
themes: {
|
|
1931
|
+
light: c(s.light),
|
|
1932
|
+
dark: c(s.dark)
|
|
1933
|
+
},
|
|
1879
1934
|
fonts: {
|
|
1880
|
-
heading:
|
|
1881
|
-
body:
|
|
1935
|
+
heading: r,
|
|
1936
|
+
body: i
|
|
1882
1937
|
},
|
|
1883
1938
|
defaultTheme: "light",
|
|
1884
1939
|
media: Ne
|
|
@@ -1888,15 +1943,15 @@ var Pe = Q();
|
|
|
1888
1943
|
//#endregion
|
|
1889
1944
|
//#region src/theme/MProvider.tsx
|
|
1890
1945
|
function $({ children: e, preset: t, defaultTheme: r }) {
|
|
1891
|
-
let a = n(
|
|
1946
|
+
let a = n(x)?.theme ?? r ?? "light", o = i(() => t ? Q(t) : Pe, [t]);
|
|
1892
1947
|
return /* @__PURE__ */ c(u, {
|
|
1893
1948
|
config: o,
|
|
1894
1949
|
defaultTheme: a,
|
|
1895
|
-
children: /* @__PURE__ */ c(
|
|
1950
|
+
children: /* @__PURE__ */ c(me, { children: e })
|
|
1896
1951
|
});
|
|
1897
1952
|
}
|
|
1898
1953
|
function Fe(e) {
|
|
1899
|
-
return n(
|
|
1954
|
+
return n(x) ? /* @__PURE__ */ c($, { ...e }) : /* @__PURE__ */ c(T, {
|
|
1900
1955
|
defaultTheme: e.defaultTheme,
|
|
1901
1956
|
children: /* @__PURE__ */ c($, { ...e })
|
|
1902
1957
|
});
|
|
@@ -2050,6 +2105,6 @@ var Ie = {
|
|
|
2050
2105
|
}
|
|
2051
2106
|
};
|
|
2052
2107
|
//#endregion
|
|
2053
|
-
export {
|
|
2108
|
+
export { be as Avatar, z as Button, B as Card, le as DatePicker, ve as Drawer, I as Heading, G as Icon, V as Input, ie as LocaleSwitcher, Fe as MProvider, D as MStack, M as MText, _e as Modal, P as Paragraph, H as Popover, W as Portal, he as PortalHost, me as PortalProvider, U as Select, xe as Separator, ae as Skeleton, ne as StateBadge, T as ThemeProvider, Ce as ThemeToggle, de as Toast, fe as ToastContainer, O as XStack, k as YStack, A as ZStack, Q as buildMThemeConfig, K as colors, Ie as frappePreset, ke as generateMDesignConfig, Pe as mThemeConfig, J as spacing, q as typography, E as useTheme };
|
|
2054
2109
|
|
|
2055
2110
|
//# sourceMappingURL=index.js.map
|