@framework-m/ui 0.12.0 → 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/components/Button.d.ts +3 -3
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/DatePicker.d.ts +1 -2
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/Input.d.ts +1 -2
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Select.d.ts +1 -2
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Skeleton.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +357 -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 +6 -7
- 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 +21 -21
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,51 +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
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1124
|
+
"data-fieldname": d.name,
|
|
1125
|
+
children: /* @__PURE__ */ c(H, {
|
|
1126
|
+
trigger: ie,
|
|
1127
|
+
content: R,
|
|
1127
1128
|
placement: u,
|
|
1128
1129
|
open: h,
|
|
1129
1130
|
onOpenChange: g
|
|
1130
1131
|
})
|
|
1131
1132
|
});
|
|
1132
1133
|
});
|
|
1133
|
-
|
|
1134
|
+
le.displayName = "DatePicker";
|
|
1134
1135
|
//#endregion
|
|
1135
1136
|
//#region src/components/Select.tsx
|
|
1136
|
-
var
|
|
1137
|
-
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) => {
|
|
1138
1139
|
a?.(e), i && i({ target: {
|
|
1139
1140
|
value: e,
|
|
1140
1141
|
name: f || ""
|
|
1141
|
-
} }),
|
|
1142
|
-
},
|
|
1143
|
-
ref:
|
|
1142
|
+
} }), A(!1);
|
|
1143
|
+
}, M = /* @__PURE__ */ l(z, {
|
|
1144
|
+
ref: w,
|
|
1144
1145
|
disabled: d,
|
|
1145
1146
|
tabIndex: -1,
|
|
1146
1147
|
size: n,
|
|
1147
1148
|
variant: "ghost",
|
|
1148
1149
|
width: "100%",
|
|
1149
1150
|
justifyContent: "space-between",
|
|
1150
|
-
borderWidth:
|
|
1151
|
-
borderColor: t ? "$error" :
|
|
1152
|
-
backgroundColor:
|
|
1153
|
-
borderRadius:
|
|
1154
|
-
paddingHorizontal:
|
|
1151
|
+
borderWidth: y ?? 1,
|
|
1152
|
+
borderColor: t ? "$error" : b ?? "$borderColor",
|
|
1153
|
+
backgroundColor: v ?? "$backgroundSecondary",
|
|
1154
|
+
borderRadius: x ?? "$round",
|
|
1155
|
+
paddingHorizontal: S,
|
|
1155
1156
|
hoverStyle: { backgroundColor: "$backgroundHover" },
|
|
1156
1157
|
pointerEvents: "none",
|
|
1157
|
-
children: [/* @__PURE__ */ c(
|
|
1158
|
+
children: [/* @__PURE__ */ c(P, {
|
|
1158
1159
|
fontSize: n === "sm" ? "$xs" : "$sm",
|
|
1159
|
-
color:
|
|
1160
|
+
color: E ? "$color" : "$colorMuted",
|
|
1160
1161
|
numberOfLines: 1,
|
|
1161
1162
|
flex: 1,
|
|
1162
1163
|
overflow: "hidden",
|
|
1163
|
-
children:
|
|
1164
|
-
}), /* @__PURE__ */ c(
|
|
1164
|
+
children: D
|
|
1165
|
+
}), /* @__PURE__ */ c(k, {
|
|
1165
1166
|
width: 0,
|
|
1166
1167
|
height: 0,
|
|
1167
1168
|
borderLeftWidth: 5,
|
|
@@ -1172,47 +1173,47 @@ var W = e.forwardRef(({ error: t, size: n = "md", value: r, onChange: i, onValue
|
|
|
1172
1173
|
borderTopColor: "$colorMuted",
|
|
1173
1174
|
opacity: .6
|
|
1174
1175
|
})]
|
|
1175
|
-
}), [
|
|
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, {
|
|
1176
1177
|
padding: "$xs",
|
|
1177
1178
|
paddingBottom: 0,
|
|
1178
|
-
children: /* @__PURE__ */ c(
|
|
1179
|
+
children: /* @__PURE__ */ c(V, {
|
|
1179
1180
|
size: "sm",
|
|
1180
|
-
placeholder:
|
|
1181
|
-
value:
|
|
1182
|
-
onChangeText:
|
|
1181
|
+
placeholder: T("search", { defaultValue: "Search..." }),
|
|
1182
|
+
value: N,
|
|
1183
|
+
onChangeText: F,
|
|
1183
1184
|
onKeyDown: (e) => e.stopPropagation()
|
|
1184
1185
|
})
|
|
1185
|
-
}), /* @__PURE__ */ c(
|
|
1186
|
+
}), /* @__PURE__ */ c(ee, {
|
|
1186
1187
|
maxHeight: 250,
|
|
1187
|
-
children: /* @__PURE__ */ l(
|
|
1188
|
+
children: /* @__PURE__ */ l(k, {
|
|
1188
1189
|
gap: "$xs",
|
|
1189
1190
|
padding: "$xs",
|
|
1190
1191
|
children: [
|
|
1191
|
-
u && /* @__PURE__ */ c(
|
|
1192
|
+
u && /* @__PURE__ */ c(z, {
|
|
1192
1193
|
variant: "ghost",
|
|
1193
1194
|
size: "sm",
|
|
1194
1195
|
justifyContent: "flex-start",
|
|
1195
|
-
onPress: () =>
|
|
1196
|
-
children: /* @__PURE__ */ c(
|
|
1196
|
+
onPress: () => j(""),
|
|
1197
|
+
children: /* @__PURE__ */ c(P, {
|
|
1197
1198
|
fontSize: "$sm",
|
|
1198
1199
|
color: "$colorMuted",
|
|
1199
1200
|
children: u
|
|
1200
1201
|
})
|
|
1201
1202
|
}),
|
|
1202
|
-
|
|
1203
|
+
I.length === 0 && /* @__PURE__ */ c(P, {
|
|
1203
1204
|
fontSize: "$sm",
|
|
1204
1205
|
color: "$colorMuted",
|
|
1205
1206
|
padding: "$sm",
|
|
1206
1207
|
textAlign: "center",
|
|
1207
|
-
children:
|
|
1208
|
+
children: T("no_options_found", { defaultValue: "No options found" })
|
|
1208
1209
|
}),
|
|
1209
|
-
|
|
1210
|
+
I.map((e) => /* @__PURE__ */ c(z, {
|
|
1210
1211
|
variant: "ghost",
|
|
1211
1212
|
size: "sm",
|
|
1212
1213
|
justifyContent: "flex-start",
|
|
1213
|
-
onPress: () =>
|
|
1214
|
+
onPress: () => j(e.value),
|
|
1214
1215
|
backgroundColor: e.value === r ? "$backgroundActive" : "transparent",
|
|
1215
|
-
children: /* @__PURE__ */ c(
|
|
1216
|
+
children: /* @__PURE__ */ c(P, {
|
|
1216
1217
|
fontSize: "$sm",
|
|
1217
1218
|
children: e.label
|
|
1218
1219
|
})
|
|
@@ -1221,37 +1222,37 @@ var W = e.forwardRef(({ error: t, size: n = "md", value: r, onChange: i, onValue
|
|
|
1221
1222
|
})
|
|
1222
1223
|
})] });
|
|
1223
1224
|
return e.useEffect(() => {
|
|
1224
|
-
|
|
1225
|
-
}, [
|
|
1225
|
+
O || F("");
|
|
1226
|
+
}, [O]), /* @__PURE__ */ c(k, {
|
|
1226
1227
|
position: "relative",
|
|
1227
|
-
width:
|
|
1228
|
-
minWidth:
|
|
1229
|
-
...
|
|
1230
|
-
children: /* @__PURE__ */ c(
|
|
1231
|
-
trigger:
|
|
1232
|
-
content:
|
|
1228
|
+
width: C.width || "100%",
|
|
1229
|
+
minWidth: C.minWidth,
|
|
1230
|
+
...C,
|
|
1231
|
+
children: /* @__PURE__ */ c(H, {
|
|
1232
|
+
trigger: M,
|
|
1233
|
+
content: L,
|
|
1233
1234
|
placement: g || "bottom-start",
|
|
1234
|
-
open:
|
|
1235
|
-
onOpenChange:
|
|
1235
|
+
open: O,
|
|
1236
|
+
onOpenChange: A
|
|
1236
1237
|
})
|
|
1237
1238
|
});
|
|
1238
1239
|
});
|
|
1239
|
-
|
|
1240
|
+
U.displayName = "Select";
|
|
1240
1241
|
//#endregion
|
|
1241
1242
|
//#region src/components/Toast.tsx
|
|
1242
|
-
var
|
|
1243
|
+
var ue = {
|
|
1243
1244
|
success: "✓",
|
|
1244
1245
|
error: "✕",
|
|
1245
1246
|
warning: "⚠",
|
|
1246
1247
|
info: "ℹ"
|
|
1247
1248
|
};
|
|
1248
|
-
function
|
|
1249
|
+
function de({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }) {
|
|
1249
1250
|
return r(() => {
|
|
1250
1251
|
if (n > 0 && i) {
|
|
1251
1252
|
let e = setTimeout(i, n);
|
|
1252
1253
|
return () => clearTimeout(e);
|
|
1253
1254
|
}
|
|
1254
|
-
}, [n, i]), /* @__PURE__ */ c(
|
|
1255
|
+
}, [n, i]), /* @__PURE__ */ c(k, {
|
|
1255
1256
|
className: `toast toast-${t}`,
|
|
1256
1257
|
role: "alert",
|
|
1257
1258
|
"aria-live": "assertive",
|
|
@@ -1267,19 +1268,19 @@ function ue({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }
|
|
|
1267
1268
|
width: 0,
|
|
1268
1269
|
height: 4
|
|
1269
1270
|
},
|
|
1270
|
-
children: /* @__PURE__ */ l(
|
|
1271
|
+
children: /* @__PURE__ */ l(O, {
|
|
1271
1272
|
alignItems: "center",
|
|
1272
1273
|
gap: "$sm",
|
|
1273
1274
|
children: [
|
|
1274
|
-
/* @__PURE__ */ c(
|
|
1275
|
+
/* @__PURE__ */ c(M, {
|
|
1275
1276
|
fontWeight: "600",
|
|
1276
|
-
children:
|
|
1277
|
+
children: ue[t]
|
|
1277
1278
|
}),
|
|
1278
|
-
/* @__PURE__ */ c(
|
|
1279
|
+
/* @__PURE__ */ c(M, {
|
|
1279
1280
|
flex: 1,
|
|
1280
1281
|
children: e
|
|
1281
1282
|
}),
|
|
1282
|
-
i && /* @__PURE__ */ c(
|
|
1283
|
+
i && /* @__PURE__ */ c(z, {
|
|
1283
1284
|
variant: "ghost",
|
|
1284
1285
|
size: "sm",
|
|
1285
1286
|
onPress: i,
|
|
@@ -1290,8 +1291,8 @@ function ue({ message: e, variant: t = "info", duration: n = 4e3, onDismiss: i }
|
|
|
1290
1291
|
})
|
|
1291
1292
|
});
|
|
1292
1293
|
}
|
|
1293
|
-
function
|
|
1294
|
-
return /* @__PURE__ */ c(
|
|
1294
|
+
function fe({ toasts: e, onDismiss: t }) {
|
|
1295
|
+
return /* @__PURE__ */ c(k, {
|
|
1295
1296
|
"aria-label": "Notifications",
|
|
1296
1297
|
position: "fixed",
|
|
1297
1298
|
bottom: "$lg",
|
|
@@ -1299,9 +1300,9 @@ function de({ toasts: e, onDismiss: t }) {
|
|
|
1299
1300
|
zIndex: 60,
|
|
1300
1301
|
gap: "$sm",
|
|
1301
1302
|
pointerEvents: "none",
|
|
1302
|
-
children: e.map((e) => /* @__PURE__ */ c(
|
|
1303
|
+
children: e.map((e) => /* @__PURE__ */ c(k, {
|
|
1303
1304
|
pointerEvents: "auto",
|
|
1304
|
-
children: /* @__PURE__ */ c(
|
|
1305
|
+
children: /* @__PURE__ */ c(de, {
|
|
1305
1306
|
...e,
|
|
1306
1307
|
onDismiss: () => t(e.id)
|
|
1307
1308
|
})
|
|
@@ -1310,10 +1311,10 @@ function de({ toasts: e, onDismiss: t }) {
|
|
|
1310
1311
|
}
|
|
1311
1312
|
//#endregion
|
|
1312
1313
|
//#region src/components/Portal.tsx
|
|
1313
|
-
var
|
|
1314
|
+
var pe = t(null), me = ({ children: e }) => {
|
|
1314
1315
|
let [t, n] = o(/* @__PURE__ */ new Map());
|
|
1315
1316
|
/* v8 ignore stop */
|
|
1316
|
-
return /* @__PURE__ */ l(
|
|
1317
|
+
return /* @__PURE__ */ l(pe.Provider, {
|
|
1317
1318
|
value: {
|
|
1318
1319
|
register: (e, t) => {
|
|
1319
1320
|
n((n) => {
|
|
@@ -1328,10 +1329,10 @@ var fe = t(null), pe = ({ children: e }) => {
|
|
|
1328
1329
|
});
|
|
1329
1330
|
}
|
|
1330
1331
|
},
|
|
1331
|
-
children: [e, /* @__PURE__ */ c(
|
|
1332
|
+
children: [e, /* @__PURE__ */ c(he, { portals: t })]
|
|
1332
1333
|
});
|
|
1333
|
-
},
|
|
1334
|
-
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));
|
|
1335
1336
|
if (r(() => {
|
|
1336
1337
|
if (!(typeof document < "u" || !t))
|
|
1337
1338
|
/* v8 ignore next */
|
|
@@ -1344,16 +1345,16 @@ var fe = t(null), pe = ({ children: e }) => {
|
|
|
1344
1345
|
let t = document.getElementById("portal-root");
|
|
1345
1346
|
t || (t = document.createElement("div"), t.id = "portal-root", document.body.appendChild(t));
|
|
1346
1347
|
let n = document.documentElement.className;
|
|
1347
|
-
return t.className !== n && (t.className = n),
|
|
1348
|
+
return t.className !== n && (t.className = n), v.createPortal(e, t);
|
|
1348
1349
|
}
|
|
1349
1350
|
/* v8 ignore next */
|
|
1350
1351
|
return null;
|
|
1351
|
-
},
|
|
1352
|
+
}, ge = {
|
|
1352
1353
|
sm: 400,
|
|
1353
1354
|
md: 600,
|
|
1354
1355
|
lg: 900,
|
|
1355
1356
|
xl: 1200
|
|
1356
|
-
},
|
|
1357
|
+
}, _e = ({ isOpen: e, onClose: t, title: n, footer: r, size: i = "md", children: a }) => e ? /* @__PURE__ */ c(W, { children: /* @__PURE__ */ l(A, {
|
|
1357
1358
|
position: "absolute",
|
|
1358
1359
|
top: 0,
|
|
1359
1360
|
left: 0,
|
|
@@ -1364,7 +1365,7 @@ var fe = t(null), pe = ({ children: e }) => {
|
|
|
1364
1365
|
zIndex: 99999,
|
|
1365
1366
|
alignItems: "center",
|
|
1366
1367
|
justifyContent: "center",
|
|
1367
|
-
children: [/* @__PURE__ */ c(
|
|
1368
|
+
children: [/* @__PURE__ */ c(k, {
|
|
1368
1369
|
position: "absolute",
|
|
1369
1370
|
top: 0,
|
|
1370
1371
|
left: 0,
|
|
@@ -1373,8 +1374,8 @@ var fe = t(null), pe = ({ children: e }) => {
|
|
|
1373
1374
|
backgroundColor: "$shadowColor",
|
|
1374
1375
|
onPress: t,
|
|
1375
1376
|
zIndex: 10
|
|
1376
|
-
}), /* @__PURE__ */ l(
|
|
1377
|
-
width:
|
|
1377
|
+
}), /* @__PURE__ */ l(B, {
|
|
1378
|
+
width: ge[i],
|
|
1378
1379
|
maxWidth: "95%",
|
|
1379
1380
|
maxHeight: "90vh",
|
|
1380
1381
|
backgroundColor: "$background",
|
|
@@ -1386,33 +1387,33 @@ var fe = t(null), pe = ({ children: e }) => {
|
|
|
1386
1387
|
borderColor: "$borderColor",
|
|
1387
1388
|
zIndex: 100,
|
|
1388
1389
|
children: [
|
|
1389
|
-
/* @__PURE__ */ l(
|
|
1390
|
+
/* @__PURE__ */ l(O, {
|
|
1390
1391
|
padding: "$4",
|
|
1391
1392
|
borderBottomWidth: 1,
|
|
1392
1393
|
borderBottomColor: "$borderColor",
|
|
1393
1394
|
justifyContent: "space-between",
|
|
1394
1395
|
alignItems: "center",
|
|
1395
1396
|
backgroundColor: "$backgroundSecondary",
|
|
1396
|
-
children: [/* @__PURE__ */ c(
|
|
1397
|
+
children: [/* @__PURE__ */ c(M, {
|
|
1397
1398
|
fontWeight: "700",
|
|
1398
1399
|
size: "lg",
|
|
1399
1400
|
children: n
|
|
1400
|
-
}), /* @__PURE__ */ c(
|
|
1401
|
+
}), /* @__PURE__ */ c(z, {
|
|
1401
1402
|
size: "sm",
|
|
1402
1403
|
variant: "ghost",
|
|
1403
1404
|
onPress: t,
|
|
1404
1405
|
padding: "$2",
|
|
1405
|
-
children: /* @__PURE__ */ c(
|
|
1406
|
+
children: /* @__PURE__ */ c(M, { children: "✕" })
|
|
1406
1407
|
})]
|
|
1407
1408
|
}),
|
|
1408
|
-
/* @__PURE__ */ c(
|
|
1409
|
+
/* @__PURE__ */ c(k, {
|
|
1409
1410
|
flex: 1,
|
|
1410
1411
|
overflow: "scroll",
|
|
1411
1412
|
minHeight: 300,
|
|
1412
1413
|
backgroundColor: "$background",
|
|
1413
1414
|
children: a
|
|
1414
1415
|
}),
|
|
1415
|
-
r && /* @__PURE__ */ c(
|
|
1416
|
+
r && /* @__PURE__ */ c(O, {
|
|
1416
1417
|
padding: "$4",
|
|
1417
1418
|
borderTopWidth: 1,
|
|
1418
1419
|
borderTopColor: "$borderColor",
|
|
@@ -1426,8 +1427,8 @@ var fe = t(null), pe = ({ children: e }) => {
|
|
|
1426
1427
|
}) }) : null;
|
|
1427
1428
|
//#endregion
|
|
1428
1429
|
//#region src/components/Drawer.tsx
|
|
1429
|
-
function
|
|
1430
|
-
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, {
|
|
1431
1432
|
position: "absolute",
|
|
1432
1433
|
top: 0,
|
|
1433
1434
|
left: 0,
|
|
@@ -1436,7 +1437,7 @@ function _e({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
|
|
|
1436
1437
|
width: "100%",
|
|
1437
1438
|
height: "100%",
|
|
1438
1439
|
zIndex: 1e5,
|
|
1439
|
-
children: [/* @__PURE__ */ c(
|
|
1440
|
+
children: [/* @__PURE__ */ c(k, {
|
|
1440
1441
|
position: "absolute",
|
|
1441
1442
|
top: 0,
|
|
1442
1443
|
left: 0,
|
|
@@ -1445,7 +1446,7 @@ function _e({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
|
|
|
1445
1446
|
backgroundColor: "$shadowColor",
|
|
1446
1447
|
onPress: t,
|
|
1447
1448
|
zIndex: 10
|
|
1448
|
-
}), /* @__PURE__ */ l(
|
|
1449
|
+
}), /* @__PURE__ */ l(B, {
|
|
1449
1450
|
style: {
|
|
1450
1451
|
position: "fixed",
|
|
1451
1452
|
top: 0,
|
|
@@ -1468,31 +1469,31 @@ function _e({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
|
|
|
1468
1469
|
elevated: !1,
|
|
1469
1470
|
zIndex: 100,
|
|
1470
1471
|
children: [
|
|
1471
|
-
/* @__PURE__ */ l(
|
|
1472
|
+
/* @__PURE__ */ l(O, {
|
|
1472
1473
|
padding: "$md",
|
|
1473
1474
|
borderBottomWidth: 1,
|
|
1474
1475
|
borderColor: "$borderColor",
|
|
1475
1476
|
justifyContent: "space-between",
|
|
1476
1477
|
alignItems: "center",
|
|
1477
1478
|
backgroundColor: "$backgroundSecondary",
|
|
1478
|
-
children: [/* @__PURE__ */ c(
|
|
1479
|
+
children: [/* @__PURE__ */ c(M, {
|
|
1479
1480
|
fontWeight: "700",
|
|
1480
1481
|
size: "$md",
|
|
1481
1482
|
children: n
|
|
1482
|
-
}), /* @__PURE__ */ c(
|
|
1483
|
+
}), /* @__PURE__ */ c(z, {
|
|
1483
1484
|
size: "sm",
|
|
1484
1485
|
variant: "ghost",
|
|
1485
1486
|
onPress: t,
|
|
1486
1487
|
children: "✕"
|
|
1487
1488
|
})]
|
|
1488
1489
|
}),
|
|
1489
|
-
/* @__PURE__ */ c(
|
|
1490
|
+
/* @__PURE__ */ c(k, {
|
|
1490
1491
|
flex: 1,
|
|
1491
1492
|
padding: "$md",
|
|
1492
1493
|
style: { overflowY: "auto" },
|
|
1493
1494
|
children: i
|
|
1494
1495
|
}),
|
|
1495
|
-
a && /* @__PURE__ */ c(
|
|
1496
|
+
a && /* @__PURE__ */ c(O, {
|
|
1496
1497
|
padding: "$md",
|
|
1497
1498
|
borderTopWidth: 1,
|
|
1498
1499
|
borderColor: "$borderColor",
|
|
@@ -1507,15 +1508,15 @@ function _e({ isOpen: e, onClose: t, title: n, width: r = 420, children: i, foot
|
|
|
1507
1508
|
}
|
|
1508
1509
|
//#endregion
|
|
1509
1510
|
//#region src/components/Avatar.tsx
|
|
1510
|
-
var
|
|
1511
|
+
var ye = {
|
|
1511
1512
|
$sm: 24,
|
|
1512
1513
|
$md: 32,
|
|
1513
1514
|
$lg: 40,
|
|
1514
1515
|
$xl: 48
|
|
1515
1516
|
};
|
|
1516
|
-
function
|
|
1517
|
-
let [s, l] = o(!1), u = typeof n == "number" ? n :
|
|
1518
|
-
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, {
|
|
1519
1520
|
width: u,
|
|
1520
1521
|
height: u,
|
|
1521
1522
|
borderRadius: r ? u / 2 : "$sm",
|
|
@@ -1525,7 +1526,7 @@ function ye({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
|
|
|
1525
1526
|
overflow: "hidden",
|
|
1526
1527
|
borderWidth: i,
|
|
1527
1528
|
borderColor: a,
|
|
1528
|
-
children: e && !s ? /* @__PURE__ */ c(
|
|
1529
|
+
children: e && !s ? /* @__PURE__ */ c(y, {
|
|
1529
1530
|
source: {
|
|
1530
1531
|
uri: e,
|
|
1531
1532
|
width: u,
|
|
@@ -1534,7 +1535,7 @@ function ye({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
|
|
|
1534
1535
|
width: "100%",
|
|
1535
1536
|
height: "100%",
|
|
1536
1537
|
onError: () => l(!0)
|
|
1537
|
-
}) : typeof t == "string" ? /* @__PURE__ */ c(
|
|
1538
|
+
}) : typeof t == "string" ? /* @__PURE__ */ c(M, {
|
|
1538
1539
|
color: "$colorMuted",
|
|
1539
1540
|
size: "$sm",
|
|
1540
1541
|
fontWeight: "600",
|
|
@@ -1544,8 +1545,8 @@ function ye({ src: e, fallback: t, size: n = "$md", circular: r = !0, borderWidt
|
|
|
1544
1545
|
}
|
|
1545
1546
|
//#endregion
|
|
1546
1547
|
//#region src/components/Separator.tsx
|
|
1547
|
-
function
|
|
1548
|
-
return /* @__PURE__ */ c(
|
|
1548
|
+
function xe({ vertical: e }) {
|
|
1549
|
+
return /* @__PURE__ */ c(k, {
|
|
1549
1550
|
width: e ? 1 : "100%",
|
|
1550
1551
|
height: e ? "100%" : 1,
|
|
1551
1552
|
backgroundColor: "$borderColor"
|
|
@@ -1553,11 +1554,11 @@ function be({ vertical: e }) {
|
|
|
1553
1554
|
}
|
|
1554
1555
|
//#endregion
|
|
1555
1556
|
//#region src/components/Icon.tsx
|
|
1556
|
-
function
|
|
1557
|
+
function Se(e) {
|
|
1557
1558
|
return e.replace(/[-_](.)/g, (e, t) => t.toUpperCase()).replace(/^(.)/, (e) => e.toUpperCase());
|
|
1558
1559
|
}
|
|
1559
|
-
function
|
|
1560
|
-
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;
|
|
1561
1562
|
return /* @__PURE__ */ c(o, {
|
|
1562
1563
|
size: t,
|
|
1563
1564
|
color: n,
|
|
@@ -1567,20 +1568,20 @@ function K({ name: e, size: t, color: n, strokeWidth: r, ...i }) {
|
|
|
1567
1568
|
}
|
|
1568
1569
|
//#endregion
|
|
1569
1570
|
//#region src/theme/ThemeToggle.tsx
|
|
1570
|
-
function
|
|
1571
|
-
let { theme: e, toggleTheme: t } =
|
|
1572
|
-
return /* @__PURE__ */ c(
|
|
1571
|
+
function Ce() {
|
|
1572
|
+
let { theme: e, toggleTheme: t } = E();
|
|
1573
|
+
return /* @__PURE__ */ c(z, {
|
|
1573
1574
|
variant: "ghost",
|
|
1574
1575
|
onPress: t,
|
|
1575
1576
|
"aria-label": `Switch to ${e === "light" ? "dark" : "light"} mode`,
|
|
1576
1577
|
title: `Current theme: ${e}`,
|
|
1577
|
-
children: /* @__PURE__ */ c(
|
|
1578
|
+
children: /* @__PURE__ */ c(G, {
|
|
1578
1579
|
name: e === "light" ? "moon" : "sun",
|
|
1579
1580
|
size: 20
|
|
1580
1581
|
})
|
|
1581
1582
|
});
|
|
1582
1583
|
}
|
|
1583
|
-
var
|
|
1584
|
+
var K = {
|
|
1584
1585
|
brand: {
|
|
1585
1586
|
violet: {
|
|
1586
1587
|
50: "#F5F3FF",
|
|
@@ -1663,7 +1664,7 @@ var q = {
|
|
|
1663
1664
|
borderColorMuted: "rgba(30, 51, 88, 0.4)"
|
|
1664
1665
|
}
|
|
1665
1666
|
}
|
|
1666
|
-
},
|
|
1667
|
+
}, q = {
|
|
1667
1668
|
fontFamily: {
|
|
1668
1669
|
sans: "'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
1669
1670
|
mono: "'JetBrains Mono', 'Fira Code', monospace"
|
|
@@ -1689,7 +1690,7 @@ var q = {
|
|
|
1689
1690
|
normal: 1.5,
|
|
1690
1691
|
relaxed: 1.6
|
|
1691
1692
|
}
|
|
1692
|
-
},
|
|
1693
|
+
}, J = {
|
|
1693
1694
|
spacing: {
|
|
1694
1695
|
xs: "0.25rem",
|
|
1695
1696
|
sm: "0.5rem",
|
|
@@ -1713,24 +1714,24 @@ var q = {
|
|
|
1713
1714
|
};
|
|
1714
1715
|
//#endregion
|
|
1715
1716
|
//#region src/tokens/config.ts
|
|
1716
|
-
function
|
|
1717
|
+
function we() {
|
|
1717
1718
|
return {
|
|
1718
|
-
primary:
|
|
1719
|
-
secondary:
|
|
1719
|
+
primary: K.semantic.light.primary,
|
|
1720
|
+
secondary: K.semantic.light.secondary,
|
|
1720
1721
|
white: "#ffffff",
|
|
1721
1722
|
black: "#000000",
|
|
1722
1723
|
transparent: "transparent"
|
|
1723
1724
|
};
|
|
1724
1725
|
}
|
|
1725
|
-
function
|
|
1726
|
+
function Te() {
|
|
1726
1727
|
let e = {};
|
|
1727
|
-
return Object.entries(
|
|
1728
|
+
return Object.entries(q.fontSize).forEach(([t, n]) => {
|
|
1728
1729
|
let r = parseFloat(n.toString());
|
|
1729
1730
|
e[t] = isNaN(r) ? 16 : r * 16;
|
|
1730
1731
|
}), e;
|
|
1731
1732
|
}
|
|
1732
|
-
function
|
|
1733
|
-
let t =
|
|
1733
|
+
function Ee(e) {
|
|
1734
|
+
let t = K.semantic[e];
|
|
1734
1735
|
return {
|
|
1735
1736
|
background: t.bg,
|
|
1736
1737
|
backgroundSecondary: t.bgSecondary,
|
|
@@ -1748,33 +1749,39 @@ function Te(e) {
|
|
|
1748
1749
|
warning: t.warning,
|
|
1749
1750
|
error: t.error,
|
|
1750
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",
|
|
1751
1758
|
...Object.entries(t).reduce((e, [t, n]) => {
|
|
1752
1759
|
let r = t.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1753
1760
|
return e[r] = n, e;
|
|
1754
1761
|
}, {})
|
|
1755
1762
|
};
|
|
1756
1763
|
}
|
|
1757
|
-
function
|
|
1764
|
+
function De() {
|
|
1758
1765
|
let e = {};
|
|
1759
|
-
return Object.entries(
|
|
1766
|
+
return Object.entries(J.spacing).forEach(([t, n]) => {
|
|
1760
1767
|
let r = parseFloat(n.toString());
|
|
1761
1768
|
e[t] = isNaN(r) ? 0 : r * 16;
|
|
1762
1769
|
}), e;
|
|
1763
1770
|
}
|
|
1764
|
-
function
|
|
1771
|
+
function Oe() {
|
|
1765
1772
|
let e = {};
|
|
1766
|
-
return Object.entries(
|
|
1773
|
+
return Object.entries(J.borderRadius).forEach(([t, n]) => {
|
|
1767
1774
|
let r = parseFloat(n.toString());
|
|
1768
1775
|
e[t] = isNaN(r) ? 0 : r;
|
|
1769
1776
|
}), e.full = 9999, e.pill = 9999, e.round = 8, e;
|
|
1770
1777
|
}
|
|
1771
|
-
function
|
|
1778
|
+
function ke() {
|
|
1772
1779
|
return {
|
|
1773
1780
|
tokens: {
|
|
1774
|
-
color:
|
|
1775
|
-
space:
|
|
1776
|
-
size:
|
|
1777
|
-
radius:
|
|
1781
|
+
color: we(),
|
|
1782
|
+
space: De(),
|
|
1783
|
+
size: Te(),
|
|
1784
|
+
radius: Oe(),
|
|
1778
1785
|
zIndex: {
|
|
1779
1786
|
base: 0,
|
|
1780
1787
|
dropdown: 100,
|
|
@@ -1783,26 +1790,26 @@ function Oe() {
|
|
|
1783
1790
|
}
|
|
1784
1791
|
},
|
|
1785
1792
|
themes: {
|
|
1786
|
-
light:
|
|
1787
|
-
dark:
|
|
1793
|
+
light: Ee("light"),
|
|
1794
|
+
dark: Ee("dark")
|
|
1788
1795
|
}
|
|
1789
1796
|
};
|
|
1790
1797
|
}
|
|
1791
1798
|
//#endregion
|
|
1792
1799
|
//#region src/theme/mThemeConfig.ts
|
|
1793
|
-
function
|
|
1800
|
+
function Y(e, t) {
|
|
1794
1801
|
let n = { ...e };
|
|
1795
1802
|
for (let [e, r] of Object.entries(t ?? {})) r !== void 0 && (n[e] = r);
|
|
1796
1803
|
return n;
|
|
1797
1804
|
}
|
|
1798
|
-
var X =
|
|
1805
|
+
var X = ke(), Z = {
|
|
1799
1806
|
color: X.tokens.color,
|
|
1800
1807
|
space: X.tokens.space,
|
|
1801
1808
|
size: X.tokens.size,
|
|
1802
1809
|
radius: X.tokens.radius,
|
|
1803
1810
|
zIndex: X.tokens.zIndex
|
|
1804
1811
|
}, Ae = h(Z), je = p({
|
|
1805
|
-
family:
|
|
1812
|
+
family: q.fontFamily.sans,
|
|
1806
1813
|
size: X.tokens.size,
|
|
1807
1814
|
lineHeight: {
|
|
1808
1815
|
tight: 1.3,
|
|
@@ -1819,7 +1826,7 @@ var X = Oe(), Z = {
|
|
|
1819
1826
|
lg: -.2
|
|
1820
1827
|
}
|
|
1821
1828
|
}), Me = p({
|
|
1822
|
-
family:
|
|
1829
|
+
family: q.fontFamily.sans,
|
|
1823
1830
|
size: X.tokens.size,
|
|
1824
1831
|
lineHeight: {
|
|
1825
1832
|
tight: 1.3,
|
|
@@ -1847,7 +1854,37 @@ var X = Oe(), Z = {
|
|
|
1847
1854
|
pointerCoarse: { pointer: "coarse" }
|
|
1848
1855
|
};
|
|
1849
1856
|
function Q(e) {
|
|
1850
|
-
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({
|
|
1851
1888
|
color: {
|
|
1852
1889
|
...Z.color,
|
|
1853
1890
|
...e.tokens.color ?? {}
|
|
@@ -1868,16 +1905,35 @@ function Q(e) {
|
|
|
1868
1905
|
...Z.zIndex,
|
|
1869
1906
|
...e.tokens.zIndex ?? {}
|
|
1870
1907
|
}
|
|
1871
|
-
}) : Ae,
|
|
1872
|
-
|
|
1873
|
-
|
|
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;
|
|
1874
1927
|
};
|
|
1875
1928
|
return m({
|
|
1876
|
-
tokens:
|
|
1877
|
-
themes:
|
|
1929
|
+
tokens: a,
|
|
1930
|
+
themes: {
|
|
1931
|
+
light: c(s.light),
|
|
1932
|
+
dark: c(s.dark)
|
|
1933
|
+
},
|
|
1878
1934
|
fonts: {
|
|
1879
|
-
heading:
|
|
1880
|
-
body:
|
|
1935
|
+
heading: r,
|
|
1936
|
+
body: i
|
|
1881
1937
|
},
|
|
1882
1938
|
defaultTheme: "light",
|
|
1883
1939
|
media: Ne
|
|
@@ -1887,15 +1943,15 @@ var Pe = Q();
|
|
|
1887
1943
|
//#endregion
|
|
1888
1944
|
//#region src/theme/MProvider.tsx
|
|
1889
1945
|
function $({ children: e, preset: t, defaultTheme: r }) {
|
|
1890
|
-
let a = n(
|
|
1946
|
+
let a = n(x)?.theme ?? r ?? "light", o = i(() => t ? Q(t) : Pe, [t]);
|
|
1891
1947
|
return /* @__PURE__ */ c(u, {
|
|
1892
1948
|
config: o,
|
|
1893
1949
|
defaultTheme: a,
|
|
1894
|
-
children: /* @__PURE__ */ c(
|
|
1950
|
+
children: /* @__PURE__ */ c(me, { children: e })
|
|
1895
1951
|
});
|
|
1896
1952
|
}
|
|
1897
1953
|
function Fe(e) {
|
|
1898
|
-
return n(
|
|
1954
|
+
return n(x) ? /* @__PURE__ */ c($, { ...e }) : /* @__PURE__ */ c(T, {
|
|
1899
1955
|
defaultTheme: e.defaultTheme,
|
|
1900
1956
|
children: /* @__PURE__ */ c($, { ...e })
|
|
1901
1957
|
});
|
|
@@ -2049,6 +2105,6 @@ var Ie = {
|
|
|
2049
2105
|
}
|
|
2050
2106
|
};
|
|
2051
2107
|
//#endregion
|
|
2052
|
-
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 };
|
|
2053
2109
|
|
|
2054
2110
|
//# sourceMappingURL=index.js.map
|