@framework-m/ui 0.6.0 → 0.7.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.
Files changed (44) hide show
  1. package/dist/components/Avatar.d.ts +1 -1
  2. package/dist/components/Avatar.d.ts.map +1 -1
  3. package/dist/components/Button.d.ts +6 -3
  4. package/dist/components/Button.d.ts.map +1 -1
  5. package/dist/components/Card.d.ts +1 -1
  6. package/dist/components/Card.d.ts.map +1 -1
  7. package/dist/components/DatePicker.d.ts +1 -1
  8. package/dist/components/DatePicker.d.ts.map +1 -1
  9. package/dist/components/Drawer.d.ts +1 -1
  10. package/dist/components/Drawer.d.ts.map +1 -1
  11. package/dist/components/Icon.d.ts.map +1 -1
  12. package/dist/components/Input.d.ts +2 -1
  13. package/dist/components/Input.d.ts.map +1 -1
  14. package/dist/components/LocaleSwitcher.d.ts.map +1 -1
  15. package/dist/components/Modal.d.ts.map +1 -1
  16. package/dist/components/Popover.d.ts.map +1 -1
  17. package/dist/components/Portal.d.ts.map +1 -1
  18. package/dist/components/Primitives.d.ts +12 -12
  19. package/dist/components/Primitives.d.ts.map +1 -1
  20. package/dist/components/Select.d.ts +3 -6
  21. package/dist/components/Select.d.ts.map +1 -1
  22. package/dist/components/Skeleton.d.ts +1 -1
  23. package/dist/components/Skeleton.d.ts.map +1 -1
  24. package/dist/components/StateBadge.d.ts +1 -1
  25. package/dist/components/StateBadge.d.ts.map +1 -1
  26. package/dist/components/Toast.d.ts +1 -14
  27. package/dist/components/Toast.d.ts.map +1 -1
  28. package/dist/components/index.d.ts.map +1 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +1090 -1172
  31. package/dist/index.js.map +1 -1
  32. package/dist/stories/Toast.stories.d.ts.map +1 -1
  33. package/dist/theme/MProvider.d.ts.map +1 -1
  34. package/dist/theme/ThemeContext.d.ts.map +1 -1
  35. package/dist/theme/ThemeToggle.d.ts +0 -11
  36. package/dist/theme/ThemeToggle.d.ts.map +1 -1
  37. package/dist/theme/index.d.ts +1 -1
  38. package/dist/theme/index.d.ts.map +1 -1
  39. package/dist/theme/mThemeConfig.d.ts +1 -1
  40. package/dist/tokens/config.d.ts.map +1 -1
  41. package/dist/tokens/index.d.ts +1 -1
  42. package/dist/tokens/index.d.ts.map +1 -1
  43. package/dist/ui.css +1 -1
  44. package/package.json +17 -3
package/dist/index.js CHANGED
@@ -1,475 +1,44 @@
1
- import { jsx as e, jsxs as l, Fragment as be } from "react/jsx-runtime";
2
- import W, { createContext as Z, useState as C, useEffect as k, useContext as G, useRef as Q, useMemo as V } from "react";
3
- import { createTokens as ye, createFont as q, createTamagui as xe, TamaguiProvider as $e, styled as w, View as v, Text as O } from "@tamagui/core";
4
- import we from "react-dom";
5
- import { Image as Se } from "@tamagui/image";
6
- import * as P from "@tamagui/lucide-icons-2";
7
- const ee = Z(null), L = "framework-m-theme";
8
- function ve() {
9
- const r = localStorage.getItem(L);
1
+ import { jsx as e, jsxs as c, Fragment as xe } from "react/jsx-runtime";
2
+ import D, { createContext as q, useState as z, useEffect as F, useContext as ee, useRef as te, useMemo as U } from "react";
3
+ import { styled as v, View as k, Text as _, createTokens as we, createFont as re, createTamagui as Ce, TamaguiProvider as Se } from "@tamagui/core";
4
+ import ve from "react-dom";
5
+ import { Image as ke } from "@tamagui/image";
6
+ import * as N from "@tamagui/lucide-icons-2";
7
+ const oe = q(null), O = "framework-m-theme";
8
+ function ze() {
9
+ const r = localStorage.getItem(O);
10
10
  return r === "light" || r === "dark" ? r : window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
11
11
  }
12
- function K(r) {
12
+ function X(r) {
13
13
  const t = document.documentElement;
14
14
  r === "dark" ? t.classList.add("dark") : t.classList.remove("dark");
15
15
  }
16
- function bt({ children: r, defaultTheme: t }) {
17
- const [n, i] = C(t || ve);
18
- k(() => {
19
- K(n);
20
- }, [n]), k(() => {
16
+ function yt({ children: r, defaultTheme: t }) {
17
+ const [n, i] = z(t || ze);
18
+ F(() => {
19
+ X(n);
20
+ }, [n]), F(() => {
21
21
  t && i(t);
22
- }, [t]), k(() => {
23
- const u = window.matchMedia("(prefers-color-scheme: dark)"), h = (F) => {
24
- localStorage.getItem(L) || i(F.matches ? "dark" : "light");
22
+ }, [t]), F(() => {
23
+ const h = window.matchMedia("(prefers-color-scheme: dark)"), l = (B) => {
24
+ localStorage.getItem(O) || i(B.matches ? "dark" : "light");
25
25
  };
26
- return u.addEventListener("change", h), () => u.removeEventListener("change", h);
26
+ return h.addEventListener("change", l), () => h.removeEventListener("change", l);
27
27
  }, []);
28
- const d = (u) => {
29
- i(u), localStorage.setItem(L, u), K(u);
30
- }, c = { theme: n, setTheme: d, toggleTheme: () => {
28
+ const d = (h) => {
29
+ i(h), localStorage.setItem(O, h), X(h);
30
+ }, g = { theme: n, setTheme: d, toggleTheme: () => {
31
31
  d(n === "light" ? "dark" : "light");
32
32
  } };
33
- return /* @__PURE__ */ e(ee.Provider, { value: c, children: r });
33
+ return /* @__PURE__ */ e(oe.Provider, { value: g, children: r });
34
34
  }
35
- function te() {
36
- const r = G(ee);
35
+ function ne() {
36
+ const r = ee(oe);
37
37
  if (!r)
38
38
  throw new Error("useTheme must be used within ThemeProvider");
39
39
  return r;
40
40
  }
41
- function Ce() {
42
- return /* @__PURE__ */ l(
43
- "svg",
44
- {
45
- xmlns: "http://www.w3.org/2000/svg",
46
- width: "20",
47
- height: "20",
48
- viewBox: "0 0 24 24",
49
- fill: "none",
50
- stroke: "currentColor",
51
- strokeWidth: "2",
52
- strokeLinecap: "round",
53
- strokeLinejoin: "round",
54
- children: [
55
- /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "5" }),
56
- /* @__PURE__ */ e("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
57
- /* @__PURE__ */ e("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
58
- /* @__PURE__ */ e("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
59
- /* @__PURE__ */ e("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
60
- /* @__PURE__ */ e("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
61
- /* @__PURE__ */ e("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
62
- /* @__PURE__ */ e("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
63
- /* @__PURE__ */ e("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
64
- ]
65
- }
66
- );
67
- }
68
- function ke() {
69
- return /* @__PURE__ */ e(
70
- "svg",
71
- {
72
- xmlns: "http://www.w3.org/2000/svg",
73
- width: "20",
74
- height: "20",
75
- viewBox: "0 0 24 24",
76
- fill: "none",
77
- stroke: "currentColor",
78
- strokeWidth: "2",
79
- strokeLinecap: "round",
80
- strokeLinejoin: "round",
81
- children: /* @__PURE__ */ e("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
82
- }
83
- );
84
- }
85
- function yt() {
86
- const { theme: r, toggleTheme: t } = te();
87
- return /* @__PURE__ */ l(
88
- "button",
89
- {
90
- onClick: t,
91
- className: "theme-toggle",
92
- "aria-label": `Switch to ${r === "light" ? "dark" : "light"} mode`,
93
- title: `Current theme: ${r}`,
94
- type: "button",
95
- children: [
96
- r === "light" ? /* @__PURE__ */ e(ke, {}) : /* @__PURE__ */ e(Ce, {}),
97
- /* @__PURE__ */ e("style", { children: `
98
- .theme-toggle {
99
- display: flex;
100
- align-items: center;
101
- justify-content: center;
102
- width: 40px;
103
- height: 40px;
104
- border: none;
105
- background: transparent;
106
- cursor: pointer;
107
- border-radius: 8px;
108
- color: var(--text-color, #333);
109
- transition: all 0.2s ease;
110
- }
111
-
112
- .theme-toggle:hover {
113
- background: var(--hover-bg, rgba(0, 0, 0, 0.05));
114
- }
115
-
116
- .theme-toggle:active {
117
- transform: scale(0.95);
118
- }
119
-
120
- .theme-toggle:focus-visible {
121
- outline: 2px solid var(--primary-color, #3b82f6);
122
- outline-offset: 2px;
123
- }
124
-
125
- .dark .theme-toggle {
126
- color: var(--text-color-dark, #e5e7eb);
127
- }
128
-
129
- .dark .theme-toggle:hover {
130
- background: var(--hover-bg-dark, rgba(255, 255, 255, 0.1));
131
- }
132
- ` })
133
- ]
134
- }
135
- );
136
- }
137
- const ze = { violet: { 50: "#F5F3FF", 100: "#EDE9FE", 200: "#DDD6FE", 300: "#C4B5FD", 400: "#A78BFA", 500: "#8B5CF6", 600: "#7C3AED", 700: "#6D28D9", 800: "#5B21B6", 900: "#4C1D95", 950: "#2E1065" }, navy: { 50: "#E8EDF4", 100: "#C5D0E0", 200: "#9EAFCA", 300: "#778EB4", 400: "#5975A3", 500: "#3B5C93", 600: "#2F4A78", 700: "#1E3358", 800: "#0F1F3A", 900: "#021526", 950: "#01101E" } }, Fe = { light: { primary: "#8B5CF6", primaryHover: "#7C3AED", primaryActive: "#6D28D9", bg: "#FFFFFF", bgSecondary: "#F8FAFC", bgTertiary: "#F1F5F9", border: "#E2E8F0", text: "#0F172A", textSecondary: "#64748B", textMuted: "#94A3B8", sidebarBg: "#021526", sidebarText: "#E2E8F0", sidebarTextMuted: "rgba(255, 255, 255, 0.65)", sidebarHover: "rgba(139, 92, 246, 0.15)", sidebarSearchBg: "rgba(255, 255, 255, 0.1)", sidebarItemActiveBg: "rgba(139, 92, 246, 0.3)", success: "#22C55E", warning: "#F59E0B", error: "#EF4444", errorBg: "#FFF2F0", errorBorder: "#FFCCC7", focusRing: "rgba(139, 92, 246, 0.25)", secondary: "#0F172A", borderColorMuted: "rgba(226, 232, 240, 0.4)" }, dark: { primary: "#A78BFA", primaryHover: "#8B5CF6", primaryActive: "#7C3AED", bg: "#01101E", bgSecondary: "#021526", bgTertiary: "#0F1F3A", border: "#1E3358", text: "#F1F5F9", textSecondary: "#CBD5E1", textMuted: "#94A3B8", sidebarBg: "#00050A", sidebarText: "#E2E8F0", sidebarTextMuted: "#94A3B8", sidebarHover: "rgba(167, 139, 250, 0.15)", sidebarSearchBg: "rgba(255, 255, 255, 0.05)", sidebarItemActiveBg: "rgba(167, 139, 250, 0.2)", success: "#22C55E", warning: "#F59E0B", error: "#EF4444", errorBg: "rgba(239, 68, 68, 0.1)", errorBorder: "rgba(239, 68, 68, 0.3)", focusRing: "rgba(167, 139, 250, 0.3)", secondary: "#F1F5F9", borderColorMuted: "rgba(30, 51, 88, 0.4)" } }, N = {
138
- brand: ze,
139
- semantic: Fe
140
- }, De = { sans: "'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", mono: "'JetBrains Mono', 'Fira Code', monospace" }, Te = { xs: "0.75rem", sm: "0.875rem", base: "0.875rem", md: "1rem", lg: "1.125rem", xl: "1.375rem", "2xl": "1.75rem", "3xl": "2rem" }, Ee = { normal: 400, medium: 500, semibold: 600, bold: 700 }, Me = { tight: 1.3, normal: 1.5, relaxed: 1.6 }, j = {
141
- fontFamily: De,
142
- fontSize: Te,
143
- fontWeight: Ee,
144
- lineHeight: Me
145
- }, Ie = { xs: "0.25rem", sm: "0.5rem", md: "1rem", lg: "1.5rem", xl: "2rem", "2xl": "3rem" }, We = { sm: "4px", md: "6px", lg: "8px", xl: "12px", full: "9999px" }, Be = { sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)", md: "0 4px 6px -1px rgb(0 0 0 / 0.1)", lg: "0 10px 15px -3px rgb(0 0 0 / 0.1)" }, re = {
146
- spacing: Ie,
147
- borderRadius: We,
148
- shadow: Be
149
- };
150
- function Ae() {
151
- return {
152
- primary: N.semantic.light.primary,
153
- secondary: N.semantic.light.secondary,
154
- white: "#ffffff",
155
- black: "#000000",
156
- transparent: "transparent"
157
- };
158
- }
159
- function Re() {
160
- const r = {};
161
- return Object.entries(j.fontSize).forEach(([t, n]) => {
162
- const i = parseFloat(n.toString());
163
- r[t] = isNaN(i) ? 16 : i * 16;
164
- }), r;
165
- }
166
- function X(r) {
167
- const t = N.semantic[r];
168
- return {
169
- background: t.bg,
170
- backgroundSecondary: t.bgSecondary,
171
- backgroundTertiary: t.bgTertiary,
172
- color: t.text,
173
- colorSecondary: t.textSecondary || t.secondary,
174
- colorMuted: t.textMuted || "#94a3b8",
175
- borderColor: t.border,
176
- borderColorMuted: t.borderColorMuted || t.border,
177
- placeholderColor: t.textMuted || "#94a3b8",
178
- primary: t.primary,
179
- secondary: t.secondary,
180
- success: t.success,
181
- warning: t.warning,
182
- error: t.error,
183
- shadowColor: r === "light" ? "rgba(0,0,0,0.12)" : "rgba(0,0,0,0.4)",
184
- ...Object.entries(t).reduce((n, [i, d]) => {
185
- const s = i.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
186
- return n[s] = d, n;
187
- }, {})
188
- };
189
- }
190
- function Pe() {
191
- const r = {};
192
- return Object.entries(re.spacing).forEach(([t, n]) => {
193
- const i = parseFloat(n.toString());
194
- r[t] = isNaN(i) ? 0 : i * 16;
195
- }), r;
196
- }
197
- function He() {
198
- const r = {};
199
- return Object.entries(re.borderRadius).forEach(([t, n]) => {
200
- const i = parseFloat(n.toString());
201
- r[t] = isNaN(i) ? 0 : i;
202
- }), r.full = 9999, r.pill = 9999, r.round = 8, r;
203
- }
204
- function Le() {
205
- return {
206
- tokens: {
207
- color: Ae(),
208
- space: Pe(),
209
- size: Re(),
210
- radius: He(),
211
- zIndex: {
212
- base: 0,
213
- dropdown: 100,
214
- modal: 1200,
215
- toast: 1400
216
- }
217
- },
218
- themes: {
219
- light: X("light"),
220
- dark: X("dark")
221
- }
222
- };
223
- }
224
- const z = Le(), Ne = ye({
225
- color: z.tokens.color,
226
- space: z.tokens.space,
227
- size: z.tokens.size,
228
- radius: z.tokens.radius,
229
- zIndex: z.tokens.zIndex
230
- }), Oe = q({
231
- family: j.fontFamily.sans,
232
- size: z.tokens.size,
233
- lineHeight: {
234
- tight: 1.3,
235
- normal: 1.5
236
- },
237
- weight: {
238
- normal: "400",
239
- medium: "500",
240
- semibold: "600",
241
- bold: "700"
242
- },
243
- letterSpacing: {
244
- base: 0,
245
- lg: -0.2
246
- }
247
- }), je = q({
248
- family: j.fontFamily.sans,
249
- size: z.tokens.size,
250
- lineHeight: {
251
- tight: 1.3,
252
- normal: 1.5
253
- },
254
- weight: {
255
- normal: "400",
256
- medium: "500",
257
- semibold: "600",
258
- bold: "700"
259
- }
260
- }), _e = xe({
261
- tokens: Ne,
262
- themes: z.themes,
263
- fonts: {
264
- heading: Oe,
265
- body: je
266
- },
267
- defaultTheme: "light",
268
- media: {
269
- xs: { maxWidth: 659 },
270
- sm: { maxWidth: 800 },
271
- md: { maxWidth: 1024 },
272
- lg: { maxWidth: 1280 },
273
- xl: { maxWidth: 1420 },
274
- gtXs: { minWidth: 660 },
275
- gtSm: { minWidth: 801 },
276
- gtMd: { minWidth: 1025 },
277
- gtLg: { minWidth: 1281 },
278
- short: { maxHeight: 820 },
279
- tall: { minHeight: 821 },
280
- hoverNone: { hover: "none" },
281
- pointerCoarse: { pointer: "coarse" }
282
- }
283
- }), oe = Z(null), Ye = ({ children: r }) => {
284
- const [t, n] = C(/* @__PURE__ */ new Map()), i = (s, c) => {
285
- n((u) => {
286
- const h = new Map(u);
287
- return h.set(s, c), h;
288
- });
289
- }, d = (s) => {
290
- n((c) => {
291
- const u = new Map(c);
292
- return u.delete(s), u;
293
- });
294
- };
295
- return /* @__PURE__ */ l(oe.Provider, { value: { register: i, unregister: d }, children: [
296
- r,
297
- /* @__PURE__ */ e(Ve, { portals: t })
298
- ] });
299
- }, Ve = ({ portals: r }) => typeof document < "u" ? null : /* @__PURE__ */ e(be, { children: Array.from(r.entries()).map(([t, n]) => /* @__PURE__ */ e(W.Fragment, { children: n }, t)) }), ne = ({ children: r }) => {
300
- const t = G(oe), [n] = C(() => Math.random().toString(36).substr(2, 9));
301
- if (typeof document < "u") {
302
- let i = document.getElementById("portal-root");
303
- i || (i = document.createElement("div"), i.id = "portal-root", document.body.appendChild(i));
304
- const d = document.documentElement.className;
305
- return i.className !== d && (i.className = d), we.createPortal(r, i);
306
- }
307
- return k(() => {
308
- if (t)
309
- return () => t.unregister(n);
310
- }, [t, n]), k(() => {
311
- t && t.register(n, r);
312
- }), null;
313
- };
314
- function xt({ children: r }) {
315
- const { theme: t } = te();
316
- return /* @__PURE__ */ e(
317
- $e,
318
- {
319
- config: _e,
320
- defaultTheme: t,
321
- children: /* @__PURE__ */ e(Ye, { children: r })
322
- }
323
- );
324
- }
325
- const H = {
326
- draft: { bg: "#e0e0e0", text: "#333" },
327
- pending: { bg: "#fff3cd", text: "#856404" },
328
- submitted: { bg: "#cce5ff", text: "#004085" },
329
- approved: { bg: "#d4edda", text: "#155724" },
330
- rejected: { bg: "#f8d7da", text: "#721c24" },
331
- cancelled: { bg: "#f5f5f5", text: "#666" },
332
- completed: { bg: "#d4edda", text: "#155724" },
333
- on_hold: { bg: "#fff3cd", text: "#856404" },
334
- default: { bg: "#e9ecef", text: "#495057" }
335
- };
336
- function Ke(r) {
337
- if (!r) return H.default;
338
- const t = r.toLowerCase().replace(/\s+/g, "_");
339
- return H[t] ?? H.default;
340
- }
341
- function $t({
342
- state: r,
343
- docstatus: t,
344
- className: n,
345
- style: i
346
- }) {
347
- const d = r ?? (t === 0 ? "Draft" : t === 1 ? "Submitted" : t === 2 ? "Cancelled" : void 0);
348
- if (!d) return null;
349
- const s = Ke(d);
350
- return /* @__PURE__ */ e(
351
- "span",
352
- {
353
- className: n,
354
- style: {
355
- display: "inline-block",
356
- padding: "0.25rem 0.75rem",
357
- borderRadius: "9999px",
358
- fontSize: "0.75rem",
359
- fontWeight: 500,
360
- textTransform: "capitalize",
361
- backgroundColor: s.bg,
362
- color: s.text,
363
- ...i
364
- },
365
- children: d
366
- }
367
- );
368
- }
369
- const Xe = [
370
- { code: "en", label: "English" },
371
- { code: "hi", label: "हिन्दी" },
372
- { code: "ta", label: "தமிழ்" },
373
- { code: "es", label: "Español" },
374
- { code: "fr", label: "Français" }
375
- ];
376
- function wt({
377
- language: r,
378
- onChangeLanguage: t,
379
- locales: n = Xe
380
- }) {
381
- return /* @__PURE__ */ l("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
382
- /* @__PURE__ */ e(
383
- "label",
384
- {
385
- htmlFor: "locale-select",
386
- style: { fontSize: "14px", color: "var(--color-text)" },
387
- children: "🌐"
388
- }
389
- ),
390
- /* @__PURE__ */ e(
391
- "select",
392
- {
393
- id: "locale-select",
394
- value: r,
395
- onChange: async (d) => {
396
- await t(d.target.value);
397
- },
398
- style: {
399
- padding: "4px 8px",
400
- borderRadius: "4px",
401
- border: "1px solid var(--color-border)",
402
- backgroundColor: "var(--color-bg)",
403
- color: "var(--color-text)",
404
- cursor: "pointer",
405
- fontSize: "14px"
406
- },
407
- children: n.map((d) => /* @__PURE__ */ e("option", { value: d.code, children: d.label }, d.code))
408
- }
409
- )
410
- ] });
411
- }
412
- const U = w(v, {
413
- name: "Skeleton",
414
- backgroundColor: "$colorBgTertiary",
415
- borderRadius: "$md",
416
- display: "flex",
417
- variants: {
418
- variant: {
419
- text: {
420
- height: 14,
421
- width: "80%",
422
- marginBottom: "$sm"
423
- },
424
- "text-short": {
425
- height: 14,
426
- width: "40%",
427
- marginBottom: "$sm"
428
- },
429
- heading: {
430
- height: 24,
431
- width: "60%",
432
- marginBottom: "$md"
433
- },
434
- avatar: {
435
- width: 40,
436
- height: 40,
437
- borderRadius: 1e3
438
- },
439
- button: {
440
- height: 36,
441
- width: 100,
442
- borderRadius: "$md"
443
- }
444
- }
445
- },
446
- defaultVariants: {
447
- variant: "text"
448
- }
449
- }), St = ({
450
- count: r = 1,
451
- className: t = "",
452
- ...n
453
- }) => {
454
- const i = `skeleton ${t}`.trim();
455
- return r > 1 ? /* @__PURE__ */ e(v, { "aria-busy": !0, "aria-label": "Loading content", children: Array.from({ length: r }, (d, s) => /* @__PURE__ */ e(
456
- U,
457
- {
458
- className: i,
459
- ...n,
460
- ...s === r - 1 && n.variant === "text" ? { width: "60%" } : {}
461
- },
462
- s
463
- )) }) : /* @__PURE__ */ e(
464
- U,
465
- {
466
- className: i,
467
- "aria-busy": !0,
468
- "aria-label": "Loading",
469
- ...n
470
- }
471
- );
472
- }, J = w(v, {
41
+ const J = v(k, {
473
42
  name: "MStack",
474
43
  display: "flex",
475
44
  flexDirection: "column",
@@ -487,7 +56,7 @@ const U = w(v, {
487
56
  }
488
57
  }
489
58
  }
490
- }), Ue = w(v, {
59
+ }), Fe = v(k, {
491
60
  name: "XStack",
492
61
  display: "flex",
493
62
  flexDirection: "row",
@@ -505,7 +74,7 @@ const U = w(v, {
505
74
  }
506
75
  }
507
76
  }
508
- }), $ = Ue, Je = w(v, {
77
+ }), x = Fe, De = v(k, {
509
78
  name: "YStack",
510
79
  display: "flex",
511
80
  flexDirection: "column",
@@ -523,7 +92,7 @@ const U = w(v, {
523
92
  }
524
93
  }
525
94
  }
526
- }), y = Je, Ze = w(v, {
95
+ }), b = De, Te = v(k, {
527
96
  name: "ZStack",
528
97
  display: "flex",
529
98
  position: "relative",
@@ -541,7 +110,7 @@ const U = w(v, {
541
110
  }
542
111
  }
543
112
  }
544
- }), _ = Ze, Ge = w(O, {
113
+ }), Y = Te, Me = v(_, {
545
114
  name: "MText",
546
115
  fontFamily: "$body",
547
116
  display: "inline-flex",
@@ -554,13 +123,19 @@ const U = w(v, {
554
123
  $lg: { fontSize: "$lg" },
555
124
  $xl: { fontSize: "$xl" },
556
125
  $xxl: { fontSize: "$xxl" }
557
- },
558
- color: {
559
- secondary: { color: "$colorSecondary" },
560
- muted: { color: "$colorMuted" }
561
126
  }
562
127
  }
563
- }), m = Ge, Qe = w(O, {
128
+ }), u = D.forwardRef(({ textAlign: r, style: t, ...n }, i) => /* @__PURE__ */ e(
129
+ Me,
130
+ {
131
+ ref: i,
132
+ ...n,
133
+ style: [
134
+ t,
135
+ { textAlign: r === "start" ? "left" : r === "end" ? "right" : r }
136
+ ]
137
+ }
138
+ )), Ee = v(_, {
564
139
  name: "Paragraph",
565
140
  fontFamily: "$body",
566
141
  display: "inline-flex",
@@ -575,7 +150,19 @@ const U = w(v, {
575
150
  $xxl: { fontSize: "$xxl" }
576
151
  }
577
152
  }
578
- }), vt = Qe, qe = w(O, {
153
+ }), L = D.forwardRef(
154
+ ({ textAlign: r, style: t, ...n }, i) => /* @__PURE__ */ e(
155
+ Ee,
156
+ {
157
+ ref: i,
158
+ ...n,
159
+ style: [
160
+ t,
161
+ { textAlign: r === "start" ? "left" : r === "end" ? "right" : r }
162
+ ]
163
+ }
164
+ )
165
+ ), Ie = v(_, {
579
166
  name: "Heading",
580
167
  fontFamily: "$body",
581
168
  fontWeight: "800",
@@ -591,7 +178,137 @@ const U = w(v, {
591
178
  $xxl: { fontSize: "$xxl" }
592
179
  }
593
180
  }
594
- }), Ct = qe, et = w(v, {
181
+ }), $t = D.forwardRef(({ textAlign: r, style: t, ...n }, i) => /* @__PURE__ */ e(
182
+ Ie,
183
+ {
184
+ ref: i,
185
+ ...n,
186
+ style: [
187
+ t,
188
+ { textAlign: r === "start" ? "left" : r === "end" ? "right" : r }
189
+ ]
190
+ }
191
+ )), Z = {
192
+ draft: { bg: "#e0e0e0", text: "#333" },
193
+ pending: { bg: "#fff3cd", text: "#856404" },
194
+ submitted: { bg: "#cce5ff", text: "#004085" },
195
+ approved: { bg: "#d4edda", text: "#155724" },
196
+ rejected: { bg: "#f8d7da", text: "#721c24" },
197
+ cancelled: { bg: "#f5f5f5", text: "#666" },
198
+ completed: { bg: "#d4edda", text: "#155724" },
199
+ on_hold: { bg: "#fff3cd", text: "#856404" },
200
+ default: { bg: "#e9ecef", text: "#495057" }
201
+ };
202
+ function We(r) {
203
+ const t = r.toLowerCase().replace(/\s+/g, "_");
204
+ return Z[t] ?? Z.default;
205
+ }
206
+ function xt({ state: r, docstatus: t, className: n, style: i }) {
207
+ const d = r ?? (t === 0 ? "Draft" : t === 1 ? "Submitted" : t === 2 ? "Cancelled" : void 0);
208
+ if (!d) return null;
209
+ const s = We(d);
210
+ return /* @__PURE__ */ e(
211
+ u,
212
+ {
213
+ className: n,
214
+ style: {
215
+ display: "inline-flex",
216
+ padding: "0.25rem 0.75rem",
217
+ borderRadius: "9999px",
218
+ fontSize: "0.75rem",
219
+ fontWeight: 500,
220
+ textTransform: "capitalize",
221
+ backgroundColor: s.bg,
222
+ color: s.text,
223
+ ...i
224
+ },
225
+ children: d
226
+ }
227
+ );
228
+ }
229
+ const Be = [
230
+ { code: "en", label: "English" },
231
+ { code: "hi", label: "हिन्दी" },
232
+ { code: "ta", label: "தமிழ்" },
233
+ { code: "es", label: "Español" },
234
+ { code: "fr", label: "Français" }
235
+ ];
236
+ function wt({
237
+ language: r,
238
+ onChangeLanguage: t,
239
+ locales: n = Be
240
+ }) {
241
+ return /* @__PURE__ */ c(x, { alignItems: "center", gap: "$xs", width: "auto", children: [
242
+ /* @__PURE__ */ e(u, { size: "$sm", children: "🌐" }),
243
+ /* @__PURE__ */ e(
244
+ ie,
245
+ {
246
+ value: r,
247
+ onValueChange: t,
248
+ options: n.map((i) => ({ value: i.code, label: i.label })),
249
+ width: "auto",
250
+ size: "sm"
251
+ }
252
+ )
253
+ ] });
254
+ }
255
+ const G = v(k, {
256
+ name: "Skeleton",
257
+ backgroundColor: "$colorBgTertiary",
258
+ borderRadius: "$md",
259
+ display: "flex",
260
+ variants: {
261
+ variant: {
262
+ text: {
263
+ height: 14,
264
+ width: "80%",
265
+ marginBottom: "$sm"
266
+ },
267
+ "text-short": {
268
+ height: 14,
269
+ width: "40%",
270
+ marginBottom: "$sm"
271
+ },
272
+ heading: {
273
+ height: 24,
274
+ width: "60%",
275
+ marginBottom: "$md"
276
+ },
277
+ avatar: {
278
+ width: 40,
279
+ height: 40,
280
+ borderRadius: 1e3
281
+ },
282
+ button: {
283
+ height: 36,
284
+ width: 100,
285
+ borderRadius: "$md"
286
+ }
287
+ }
288
+ },
289
+ defaultVariants: {
290
+ variant: "text"
291
+ }
292
+ }), Ct = ({ count: r = 1, className: t = "", ...n }) => {
293
+ const i = `skeleton ${t}`.trim();
294
+ return r > 1 ? /* @__PURE__ */ e(k, { "aria-busy": !0, "aria-label": "Loading content", children: Array.from({ length: r }, (d, s) => /* @__PURE__ */ e(
295
+ G,
296
+ {
297
+ className: i,
298
+ ...n,
299
+ ...s === r - 1 && n.variant === "text" ? { width: "60%" } : {}
300
+ },
301
+ s
302
+ )) }) : /* @__PURE__ */ e(
303
+ G,
304
+ {
305
+ className: i,
306
+ "aria-busy": !0,
307
+ "aria-label": "Loading",
308
+ ...n
309
+ }
310
+ );
311
+ }, Pe = v(k, {
595
312
  name: "Button",
596
313
  flexDirection: "row",
597
314
  alignItems: "center",
@@ -674,39 +391,37 @@ const U = w(v, {
674
391
  variant: "default",
675
392
  size: "md"
676
393
  }
677
- });
678
- function x({
679
- children: r,
680
- variant: t = "default",
681
- size: n = "md",
682
- loading: i,
683
- disabled: d,
684
- tag: s = "button",
685
- ...c
686
- }) {
687
- return /* @__PURE__ */ e(
688
- et,
689
- {
690
- tag: s,
691
- type: c.type,
692
- variant: t,
693
- size: n,
694
- disabled: d || i,
695
- ...c,
696
- children: /* @__PURE__ */ e(
697
- m,
698
- {
699
- color: t === "primary" || t === "danger" ? "$white" : "$color",
700
- fontWeight: "600",
701
- fontSize: n === "sm" ? "$xs" : "$sm",
702
- pointerEvents: "none",
703
- children: i ? "..." : r
704
- }
705
- )
706
- }
707
- );
708
- }
709
- const tt = w(v, {
394
+ }), Re = (r) => typeof r == "string" || typeof r == "number", $ = D.forwardRef(
395
+ ({ children: r, variant: t = "default", size: n = "md", loading: i, disabled: d, tag: s = "button", ...g }, h) => {
396
+ const l = Pe, B = g.color || (t === "primary" || t === "danger" ? "$white" : "$color"), T = (C, S) => /* @__PURE__ */ e(
397
+ u,
398
+ {
399
+ color: B,
400
+ fontWeight: "600",
401
+ fontSize: n === "sm" ? "$xs" : "$sm",
402
+ pointerEvents: "none",
403
+ children: C
404
+ },
405
+ S
406
+ ), P = i ? T("...") : D.Children.map(
407
+ r,
408
+ (C, S) => Re(C) ? T(C, S) : C
409
+ );
410
+ return /* @__PURE__ */ e(
411
+ l,
412
+ {
413
+ ref: h,
414
+ tag: s,
415
+ type: g.type,
416
+ variant: t,
417
+ size: n,
418
+ disabled: d || i,
419
+ ...g,
420
+ children: P
421
+ }
422
+ );
423
+ }
424
+ ), Ae = v(k, {
710
425
  name: "Card",
711
426
  flexDirection: "column",
712
427
  backgroundColor: "$background",
@@ -742,576 +457,681 @@ const tt = w(v, {
742
457
  elevated: !0,
743
458
  padded: "md"
744
459
  }
745
- }), B = tt, rt = w("input", {
746
- name: "Input",
747
- backgroundColor: "$backgroundSecondary",
748
- borderRadius: "$round",
749
- borderWidth: 1,
750
- borderStyle: "solid",
751
- borderColor: "$borderColor",
752
- paddingLeft: "$md",
753
- paddingRight: "$md",
754
- fontSize: "$sm",
755
- color: "$color",
756
- width: "100%",
757
- outlineWidth: 0,
758
- // @ts-ignore
759
- cursor: "text",
760
- // @ts-ignore
761
- userSelect: "text",
762
- focusStyle: {
763
- borderColor: "$primary",
460
+ }), A = Ae, He = v(
461
+ "input",
462
+ {
463
+ name: "Input",
764
464
  backgroundColor: "$backgroundSecondary",
465
+ borderRadius: "$round",
466
+ borderWidth: 1,
467
+ borderStyle: "solid",
468
+ borderColor: "$borderColor",
469
+ paddingLeft: "$md",
470
+ paddingRight: "$md",
471
+ fontSize: "$sm",
472
+ color: "$color",
473
+ width: "100%",
765
474
  outlineWidth: 0,
766
- shadowColor: "$primary",
767
- shadowRadius: 15,
768
- shadowOpacity: 0.3,
769
- borderWidth: 2
770
- },
771
- hoverStyle: {
772
- borderColor: "$primary",
773
- backgroundColor: "$background"
774
- },
775
- variants: {
776
- size: {
777
- sm: { height: 32, fontSize: "$xs" },
778
- md: { height: 40, fontSize: "$sm" },
779
- lg: { height: 52, fontSize: "$md" }
475
+ // @ts-ignore
476
+ cursor: "text",
477
+ // @ts-ignore
478
+ userSelect: "text",
479
+ focusStyle: {
480
+ borderColor: "$primary",
481
+ backgroundColor: "$backgroundSecondary",
482
+ outlineWidth: 0,
483
+ shadowColor: "$primary",
484
+ shadowRadius: 15,
485
+ shadowOpacity: 0.3,
486
+ borderWidth: 2
780
487
  },
781
- error: {
782
- true: {
783
- borderColor: "$error",
784
- focusStyle: {
785
- borderColor: "$error"
488
+ hoverStyle: {
489
+ borderColor: "$primary",
490
+ backgroundColor: "$background"
491
+ },
492
+ variants: {
493
+ size: {
494
+ sm: { height: 32, fontSize: "$xs" },
495
+ md: { height: 40, fontSize: "$sm" },
496
+ lg: { height: 52, fontSize: "$md" }
497
+ },
498
+ error: {
499
+ true: {
500
+ borderColor: "$error",
501
+ focusStyle: {
502
+ borderColor: "$error"
503
+ }
786
504
  }
787
505
  }
788
- }
789
- },
790
- defaultVariants: {
791
- size: "md"
792
- }
793
- }), T = W.forwardRef(({
794
- onChange: r,
795
- onChangeText: t,
796
- value: n,
797
- ...i
798
- }, d) => /* @__PURE__ */ e(
799
- rt,
800
- {
801
- ref: d,
802
- ...n !== void 0 ? { value: n } : {},
803
- onChange: (c) => {
804
- r == null || r(c), t == null || t(c.target.value);
805
506
  },
806
- ...i
507
+ defaultVariants: {
508
+ size: "md"
509
+ }
807
510
  }
808
- ));
809
- T.displayName = "Input";
810
- const ot = W.forwardRef(({
811
- value: r,
812
- onChange: t,
813
- onChangeText: n,
814
- type: i = "date",
815
- placeholder: d,
816
- ...s
817
- }, c) => {
818
- const [u, h] = C(!1), [F, E] = C(!1), [A, S] = C(!1), R = Q(null), ie = (o) => {
819
- const a = (fe) => fe.toString().padStart(2, "0"), g = o.getFullYear(), p = a(o.getMonth() + 1), Y = a(o.getDate()), he = a(o.getHours()), me = a(o.getMinutes()), pe = a(o.getSeconds());
820
- return i === "date" ? `${g}-${p}-${Y}` : `${g}-${p}-${Y}T${he}:${me}:${pe}`;
821
- }, f = V(() => {
822
- if (!r) return /* @__PURE__ */ new Date();
823
- const o = new Date(r);
824
- return isNaN(o.getTime()) ? /* @__PURE__ */ new Date() : o;
825
- }, [r]), [b, M] = C(new Date(f));
826
- k(() => {
827
- M(new Date(f));
828
- }, [f]), k(() => {
829
- const o = (a) => {
830
- R.current && !R.current.contains(a.target) && (h(!1), E(!1), S(!1));
831
- };
832
- return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
833
- }, []);
834
- const D = (o) => {
835
- const a = ie(o);
836
- t == null || t(a), n == null || n(a);
837
- }, ae = (o) => {
838
- const a = new Date(b);
839
- a.setDate(o), a.setHours(f.getHours()), a.setMinutes(f.getMinutes()), a.setSeconds(f.getSeconds()), D(a), i === "date" && h(!1);
840
- }, I = (o, a, g = 0) => {
841
- const p = new Date(f);
842
- p.setHours(p.getHours() + o), p.setMinutes(p.getMinutes() + a), p.setSeconds(p.getSeconds() + g), D(p);
843
- }, de = () => {
844
- const o = new Date(f), a = o.getHours();
845
- o.setHours(a >= 12 ? a - 12 : a + 12), D(o);
846
- }, se = () => {
847
- const o = /* @__PURE__ */ new Date();
848
- D(o), M(new Date(o)), i === "date" && h(!1);
849
- }, le = (o, a) => new Date(a, o + 1, 0).getDate(), ce = (o, a) => new Date(a, o, 1).getDay(), ge = V(() => {
850
- const o = le(b.getMonth(), b.getFullYear()), a = ce(b.getMonth(), b.getFullYear()), g = [];
851
- for (let p = 0; p < a; p++) g.push(null);
852
- for (let p = 1; p <= o; p++) g.push(p);
853
- return g;
854
- }, [b]), ue = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
855
- return /* @__PURE__ */ l(
856
- y,
511
+ ), W = D.forwardRef(
512
+ ({ onChange: r, onChangeText: t, value: n, textAlign: i, style: d, ...s }, g) => /* @__PURE__ */ e(
513
+ He,
857
514
  {
858
- ref: R,
859
- position: "relative",
860
- width: "100%",
861
- children: [
862
- /* @__PURE__ */ l($, { alignItems: "center", position: "relative", children: [
863
- /* @__PURE__ */ e(
864
- T,
865
- {
866
- ref: c,
867
- value: r,
868
- readOnly: !0,
869
- onPressIn: () => h(!u),
870
- placeholder: d || (i === "date" ? "Select Date..." : "Select Date & Time..."),
871
- paddingRight: 40,
872
- ...s
873
- }
874
- ),
875
- /* @__PURE__ */ e(
876
- $,
877
- {
878
- position: "absolute",
879
- right: 12,
880
- pointerEvents: "none",
881
- opacity: 0.6,
882
- children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", style: { color: "var(--primary)" }, children: [
883
- /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
884
- /* @__PURE__ */ e("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
885
- /* @__PURE__ */ e("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
886
- /* @__PURE__ */ e("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
887
- ] })
888
- }
889
- )
890
- ] }),
891
- u && /* @__PURE__ */ l(
892
- B,
515
+ ref: g,
516
+ ...n !== void 0 ? { value: n } : {},
517
+ style: {
518
+ textAlign: i === "start" ? "left" : i === "end" ? "right" : i,
519
+ ...d
520
+ },
521
+ onChange: (l) => {
522
+ r == null || r(l), t == null || t(l.target.value);
523
+ },
524
+ ...s
525
+ }
526
+ )
527
+ );
528
+ W.displayName = "Input";
529
+ const Ne = D.forwardRef(
530
+ ({ value: r, onChange: t, onChangeText: n, type: i = "date", placeholder: d, ...s }, g) => {
531
+ const [h, l] = z(!1), [B, T] = z(!1), [P, C] = z(!1), S = te(null), H = (o) => {
532
+ const a = ($e) => $e.toString().padStart(2, "0"), m = o.getFullYear(), y = a(o.getMonth() + 1), K = a(o.getDate()), be = a(o.getHours()), pe = a(o.getMinutes()), ye = a(o.getSeconds());
533
+ return i === "date" ? `${m}-${y}-${K}` : `${m}-${y}-${K}T${be}:${pe}:${ye}`;
534
+ }, f = U(() => {
535
+ if (!r) return /* @__PURE__ */ new Date();
536
+ const o = new Date(r);
537
+ return isNaN(o.getTime()) ? /* @__PURE__ */ new Date() : o;
538
+ }, [r]), [p, M] = z(new Date(f)), w = () => {
539
+ l(!0);
540
+ };
541
+ F(() => {
542
+ M(new Date(f));
543
+ }, [f]), F(() => {
544
+ const o = (a) => {
545
+ S.current && !S.current.contains(a.target) && (l(!1), T(!1), C(!1));
546
+ };
547
+ return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
548
+ }, []);
549
+ const E = (o) => {
550
+ const a = H(o);
551
+ t == null || t(a), n == null || n(a);
552
+ }, le = (o) => {
553
+ const a = new Date(p);
554
+ a.setDate(o), a.setHours(f.getHours()), a.setMinutes(f.getMinutes()), a.setSeconds(f.getSeconds()), E(a), i === "date" && l(!1);
555
+ }, R = (o, a, m = 0) => {
556
+ const y = new Date(f);
557
+ y.setHours(y.getHours() + o), y.setMinutes(y.getMinutes() + a), y.setSeconds(y.getSeconds() + m), E(y);
558
+ }, ce = () => {
559
+ const o = new Date(f), a = o.getHours();
560
+ o.setHours(a >= 12 ? a - 12 : a + 12), E(o);
561
+ }, ue = () => {
562
+ const o = /* @__PURE__ */ new Date();
563
+ E(o), M(new Date(o));
564
+ }, ge = (o, a) => new Date(a, o + 1, 0).getDate(), he = (o, a) => new Date(a, o, 1).getDay(), me = U(() => {
565
+ const o = ge(p.getMonth(), p.getFullYear()), a = he(p.getMonth(), p.getFullYear()), m = [];
566
+ for (let y = 0; y < a; y++) m.push(null);
567
+ for (let y = 1; y <= o; y++) m.push(y);
568
+ return m;
569
+ }, [p]), fe = [
570
+ "January",
571
+ "February",
572
+ "March",
573
+ "April",
574
+ "May",
575
+ "June",
576
+ "July",
577
+ "August",
578
+ "September",
579
+ "October",
580
+ "November",
581
+ "December"
582
+ ];
583
+ return /* @__PURE__ */ c(b, { ref: S, position: "relative", width: "100%", children: [
584
+ /* @__PURE__ */ c(x, { alignItems: "center", position: "relative", children: [
585
+ /* @__PURE__ */ e(
586
+ W,
893
587
  {
894
- elevated: !0,
895
- position: "absolute",
896
- top: "100%",
897
- left: 0,
898
- marginTop: "$2",
899
- zIndex: 1e3,
900
- width: 320,
901
- padding: "$3",
902
- backgroundColor: "$background",
903
- borderColor: "$borderColor",
904
- borderWidth: 1,
588
+ ref: g,
589
+ value: r,
590
+ readOnly: !0,
591
+ placeholder: d || (i === "date" ? "Select Date..." : "Select Date & Time..."),
592
+ paddingRight: 40,
593
+ ...s,
594
+ onPressIn: (o) => {
595
+ var a;
596
+ (a = s.onPressIn) == null || a.call(s, o), w();
597
+ },
598
+ onClick: (o) => {
599
+ var a;
600
+ (a = s.onClick) == null || a.call(s, o), w();
601
+ },
602
+ onFocus: (o) => {
603
+ var a;
604
+ (a = s.onFocus) == null || a.call(s, o), w();
605
+ },
606
+ cursor: "pointer"
607
+ }
608
+ ),
609
+ /* @__PURE__ */ e(x, { position: "absolute", right: 12, pointerEvents: "none", opacity: 0.6, children: /* @__PURE__ */ c(
610
+ "svg",
611
+ {
612
+ viewBox: "0 0 24 24",
613
+ width: "18",
614
+ height: "18",
615
+ fill: "none",
616
+ stroke: "currentColor",
617
+ strokeWidth: "2",
618
+ strokeLinecap: "round",
619
+ strokeLinejoin: "round",
620
+ style: { color: "var(--primary)" },
905
621
  children: [
906
- /* @__PURE__ */ l($, { justifyContent: "space-between", alignItems: "center", marginBottom: "$3", children: [
907
- /* @__PURE__ */ e(
908
- x,
622
+ /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
623
+ /* @__PURE__ */ e("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
624
+ /* @__PURE__ */ e("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
625
+ /* @__PURE__ */ e("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
626
+ ]
627
+ }
628
+ ) })
629
+ ] }),
630
+ h && /* @__PURE__ */ c(
631
+ A,
632
+ {
633
+ elevated: !0,
634
+ position: "absolute",
635
+ top: "100%",
636
+ left: 0,
637
+ marginTop: "$2",
638
+ zIndex: 1e3,
639
+ width: 320,
640
+ padding: "$3",
641
+ backgroundColor: "$background",
642
+ borderColor: "$borderColor",
643
+ borderWidth: 1,
644
+ children: [
645
+ /* @__PURE__ */ c(x, { justifyContent: "space-between", alignItems: "center", marginBottom: "$3", children: [
646
+ /* @__PURE__ */ e(
647
+ $,
648
+ {
649
+ size: "sm",
650
+ borderRadius: 100,
651
+ width: 28,
652
+ height: 28,
653
+ padding: 0,
654
+ onPress: () => M(new Date(p.setMonth(p.getMonth() - 1))),
655
+ children: /* @__PURE__ */ e(u, { fontSize: 12, position: "relative", left: -1, children: "<" })
656
+ }
657
+ ),
658
+ /* @__PURE__ */ c(x, { alignItems: "center", cursor: "pointer", children: [
659
+ /* @__PURE__ */ e(b, { onDoubleClick: () => C(!0), children: P ? /* @__PURE__ */ e(
660
+ W,
909
661
  {
910
662
  size: "sm",
911
- borderRadius: 100,
912
- width: 28,
913
- height: 28,
914
- padding: 0,
915
- onPress: () => M(new Date(b.setMonth(b.getMonth() - 1))),
916
- children: /* @__PURE__ */ e(m, { fontSize: 12, position: "relative", left: -1, children: "<" })
917
- }
918
- ),
919
- /* @__PURE__ */ l($, { alignItems: "center", cursor: "pointer", children: [
920
- /* @__PURE__ */ e(y, { onDoubleClick: () => S(!0), children: A ? /* @__PURE__ */ e(
921
- T,
922
- {
923
- size: "sm",
924
- autoFocus: !0,
925
- width: 100,
926
- textAlign: "center",
927
- paddingHorizontal: 4,
928
- defaultValue: b.getMonth() + 1,
929
- onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
930
- onBlur: (o) => {
931
- const a = parseInt(o.target.value);
932
- !isNaN(a) && a > 0 && a <= 12 && M(new Date(b.setMonth(a - 1))), S(!1);
933
- }
934
- }
935
- ) : /* @__PURE__ */ e(m, { fontSize: 12, fontWeight: "700", color: "$primary", children: ue[b.getMonth()] }) }),
936
- /* @__PURE__ */ e(v, { width: 12 }),
937
- /* @__PURE__ */ e(y, { onDoubleClick: () => E(!0), children: F ? /* @__PURE__ */ e(
938
- T,
939
- {
940
- size: "sm",
941
- autoFocus: !0,
942
- width: 60,
943
- textAlign: "center",
944
- paddingHorizontal: 4,
945
- defaultValue: b.getFullYear().toString(),
946
- onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
947
- onBlur: (o) => {
948
- const a = parseInt(o.target.value);
949
- isNaN(a) || M(new Date(b.setFullYear(a))), E(!1);
950
- }
663
+ autoFocus: !0,
664
+ width: 100,
665
+ style: { textAlign: "center" },
666
+ paddingHorizontal: 4,
667
+ defaultValue: p.getMonth() + 1,
668
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
669
+ onBlur: (o) => {
670
+ const a = parseInt(o.target.value);
671
+ !isNaN(a) && a > 0 && a <= 12 && M(new Date(p.setMonth(a - 1))), C(!1);
951
672
  }
952
- ) : /* @__PURE__ */ e(m, { fontWeight: "700", color: "$primary", children: b.getFullYear() }) })
953
- ] }),
954
- /* @__PURE__ */ e(
955
- x,
673
+ }
674
+ ) : /* @__PURE__ */ e(u, { fontSize: 12, fontWeight: "700", color: "$primary", children: fe[p.getMonth()] }) }),
675
+ /* @__PURE__ */ e(k, { width: 12 }),
676
+ /* @__PURE__ */ e(b, { onDoubleClick: () => T(!0), children: B ? /* @__PURE__ */ e(
677
+ W,
956
678
  {
957
679
  size: "sm",
958
- borderRadius: 100,
959
- width: 28,
960
- height: 28,
961
- padding: 0,
962
- onPress: () => M(new Date(b.setMonth(b.getMonth() + 1))),
963
- children: /* @__PURE__ */ e(m, { fontSize: 12, position: "relative", left: 1, children: ">" })
680
+ autoFocus: !0,
681
+ width: 60,
682
+ style: { textAlign: "center" },
683
+ paddingHorizontal: 4,
684
+ defaultValue: p.getFullYear().toString(),
685
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
686
+ onBlur: (o) => {
687
+ const a = parseInt(o.target.value);
688
+ isNaN(a) || M(new Date(p.setFullYear(a))), T(!1);
689
+ }
964
690
  }
965
- )
966
- ] }),
967
- /* @__PURE__ */ l($, { flexWrap: "wrap", gap: 2, marginBottom: "$2", children: [
968
- /* @__PURE__ */ e($, { width: "100%", justifyContent: "space-around", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((o) => /* @__PURE__ */ e(J, { width: 36, alignItems: "center", children: /* @__PURE__ */ e(m, { fontSize: 10, color: "muted", fontWeight: "600", children: o }) }, o)) }),
969
- ge.map((o, a) => {
970
- const g = o === f.getDate() && b.getMonth() === f.getMonth() && b.getFullYear() === f.getFullYear();
971
- return /* @__PURE__ */ e(
972
- J,
973
- {
974
- width: 36,
975
- height: 36,
976
- alignItems: "center",
977
- justifyContent: "center",
978
- borderRadius: "$2",
979
- cursor: o ? "pointer" : "default",
980
- backgroundColor: g ? "$primary" : "transparent",
981
- hoverStyle: o ? { backgroundColor: g ? "$primary" : "$backgroundHover" } : {},
982
- onPress: () => o && ae(o),
983
- children: /* @__PURE__ */ e(m, { color: g ? "#fff" : "$color", fontSize: 12, fontWeight: g ? "700" : "400", children: o || "" })
984
- },
985
- a
986
- );
987
- })
691
+ ) : /* @__PURE__ */ e(u, { fontWeight: "700", color: "$primary", children: p.getFullYear() }) })
988
692
  ] }),
989
- i === "datetime-local" && /* @__PURE__ */ l(y, { marginTop: "$2", paddingTop: "$3", borderTopWidth: 1, borderColor: "$borderColor", gap: "$2", children: [
990
- /* @__PURE__ */ l($, { justifyContent: "space-around", alignItems: "center", children: [
991
- /* @__PURE__ */ l(y, { alignItems: "center", gap: "$1", children: [
992
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", padding: 0, onPress: () => I(1, 0, 0), children: /* @__PURE__ */ e(m, { fontSize: 16, children: "+" }) }),
993
- /* @__PURE__ */ e(
994
- T,
693
+ /* @__PURE__ */ e(
694
+ $,
695
+ {
696
+ size: "sm",
697
+ borderRadius: 100,
698
+ width: 28,
699
+ height: 28,
700
+ padding: 0,
701
+ onPress: () => M(new Date(p.setMonth(p.getMonth() + 1))),
702
+ children: /* @__PURE__ */ e(u, { fontSize: 12, position: "relative", left: 1, children: ">" })
703
+ }
704
+ )
705
+ ] }),
706
+ /* @__PURE__ */ c(x, { flexWrap: "wrap", gap: 2, marginBottom: "$2", children: [
707
+ /* @__PURE__ */ e(x, { width: "100%", justifyContent: "space-around", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((o) => /* @__PURE__ */ e(J, { width: 36, alignItems: "center", children: /* @__PURE__ */ e(u, { fontSize: 10, color: "muted", fontWeight: "600", children: o }) }, o)) }),
708
+ me.map((o, a) => {
709
+ const m = o === f.getDate() && p.getMonth() === f.getMonth() && p.getFullYear() === f.getFullYear();
710
+ return /* @__PURE__ */ e(
711
+ J,
712
+ {
713
+ width: 36,
714
+ height: 36,
715
+ alignItems: "center",
716
+ justifyContent: "center",
717
+ borderRadius: "$2",
718
+ cursor: o ? "pointer" : "default",
719
+ backgroundColor: m ? "$primary" : "transparent",
720
+ hoverStyle: o ? {
721
+ backgroundColor: m ? "$primary" : "$backgroundHover"
722
+ } : {},
723
+ onPress: () => o && le(o),
724
+ children: /* @__PURE__ */ e(
725
+ u,
995
726
  {
996
- size: "sm",
997
- width: 52,
998
- textAlign: "center",
999
- paddingHorizontal: 4,
1000
- onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
1001
- value: (f.getHours() % 12 || 12).toString(),
1002
- onChangeText: (o) => {
1003
- let a = parseInt(o);
1004
- if (!isNaN(a)) {
1005
- a === 12 && (a = 0);
1006
- const g = new Date(f), p = g.getHours() >= 12;
1007
- g.setHours(p ? a + 12 : a), D(g);
727
+ color: m ? "#fff" : "$color",
728
+ fontSize: 12,
729
+ fontWeight: m ? "700" : "400",
730
+ children: o || ""
731
+ }
732
+ )
733
+ },
734
+ a
735
+ );
736
+ })
737
+ ] }),
738
+ i === "datetime-local" && /* @__PURE__ */ c(
739
+ b,
740
+ {
741
+ marginTop: "$2",
742
+ paddingTop: "$3",
743
+ borderTopWidth: 1,
744
+ borderColor: "$borderColor",
745
+ gap: "$2",
746
+ children: [
747
+ /* @__PURE__ */ c(x, { justifyContent: "space-around", alignItems: "center", children: [
748
+ /* @__PURE__ */ c(b, { alignItems: "center", gap: "$1", children: [
749
+ /* @__PURE__ */ e(
750
+ $,
751
+ {
752
+ size: "sm",
753
+ variant: "ghost",
754
+ padding: 0,
755
+ onPress: () => R(1, 0, 0),
756
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "+" })
757
+ }
758
+ ),
759
+ /* @__PURE__ */ e(
760
+ W,
761
+ {
762
+ size: "sm",
763
+ width: 52,
764
+ style: { textAlign: "center" },
765
+ paddingHorizontal: 4,
766
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
767
+ value: (f.getHours() % 12 || 12).toString(),
768
+ onChangeText: (o) => {
769
+ let a = parseInt(o);
770
+ if (!isNaN(a)) {
771
+ a === 12 && (a = 0);
772
+ const m = new Date(f), y = m.getHours() >= 12;
773
+ m.setHours(y ? a + 12 : a), E(m);
774
+ }
1008
775
  }
1009
776
  }
1010
- }
1011
- ),
1012
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", padding: 0, onPress: () => I(-1, 0, 0), children: /* @__PURE__ */ e(m, { fontSize: 16, children: "-" }) })
1013
- ] }),
1014
- /* @__PURE__ */ e(m, { fontSize: 16, color: "muted", marginTop: 10, position: "relative", top: -2, children: ":" }),
1015
- /* @__PURE__ */ l(y, { alignItems: "center", gap: "$1", children: [
1016
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", padding: 0, onPress: () => I(0, 5, 0), children: /* @__PURE__ */ e(m, { fontSize: 16, children: "+" }) }),
1017
- /* @__PURE__ */ e(
1018
- T,
1019
- {
1020
- size: "sm",
1021
- width: 52,
1022
- textAlign: "center",
1023
- paddingHorizontal: 4,
1024
- onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
1025
- value: f.getMinutes().toString().padStart(2, "0"),
1026
- onChangeText: (o) => {
1027
- const a = parseInt(o);
1028
- if (!isNaN(a) && a >= 0 && a < 60) {
1029
- const g = new Date(f);
1030
- g.setMinutes(a), D(g);
777
+ ),
778
+ /* @__PURE__ */ e(
779
+ $,
780
+ {
781
+ size: "sm",
782
+ variant: "ghost",
783
+ padding: 0,
784
+ onPress: () => R(-1, 0, 0),
785
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "-" })
786
+ }
787
+ )
788
+ ] }),
789
+ /* @__PURE__ */ e(u, { fontSize: 16, color: "muted", marginTop: 10, position: "relative", top: -2, children: ":" }),
790
+ /* @__PURE__ */ c(b, { alignItems: "center", gap: "$1", children: [
791
+ /* @__PURE__ */ e(
792
+ $,
793
+ {
794
+ size: "sm",
795
+ variant: "ghost",
796
+ padding: 0,
797
+ onPress: () => R(0, 5, 0),
798
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "+" })
799
+ }
800
+ ),
801
+ /* @__PURE__ */ e(
802
+ W,
803
+ {
804
+ size: "sm",
805
+ width: 52,
806
+ style: { textAlign: "center" },
807
+ paddingHorizontal: 4,
808
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
809
+ value: f.getMinutes().toString().padStart(2, "0"),
810
+ onChangeText: (o) => {
811
+ const a = parseInt(o);
812
+ if (!isNaN(a) && a >= 0 && a < 60) {
813
+ const m = new Date(f);
814
+ m.setMinutes(a), E(m);
815
+ }
1031
816
  }
1032
817
  }
1033
- }
1034
- ),
1035
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", padding: 0, onPress: () => I(0, -5, 0), children: /* @__PURE__ */ e(m, { fontSize: 16, children: "-" }) })
1036
- ] }),
1037
- /* @__PURE__ */ e(m, { fontSize: 16, color: "muted", marginTop: 10, position: "relative", top: -2, children: ":" }),
1038
- /* @__PURE__ */ l(y, { alignItems: "center", gap: "$1", children: [
1039
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", padding: 0, onPress: () => I(0, 0, 10), children: /* @__PURE__ */ e(m, { fontSize: 16, children: "+" }) }),
1040
- /* @__PURE__ */ e(
1041
- T,
1042
- {
1043
- size: "sm",
1044
- width: 52,
1045
- textAlign: "center",
1046
- paddingHorizontal: 4,
1047
- onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
1048
- value: f.getSeconds().toString().padStart(2, "0"),
1049
- onChangeText: (o) => {
1050
- const a = parseInt(o);
1051
- if (!isNaN(a) && a >= 0 && a < 60) {
1052
- const g = new Date(f);
1053
- g.setSeconds(a), D(g);
818
+ ),
819
+ /* @__PURE__ */ e(
820
+ $,
821
+ {
822
+ size: "sm",
823
+ variant: "ghost",
824
+ padding: 0,
825
+ onPress: () => R(0, -5, 0),
826
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "-" })
827
+ }
828
+ )
829
+ ] }),
830
+ /* @__PURE__ */ e(u, { fontSize: 16, color: "muted", marginTop: 10, position: "relative", top: -2, children: ":" }),
831
+ /* @__PURE__ */ c(b, { alignItems: "center", gap: "$1", children: [
832
+ /* @__PURE__ */ e(
833
+ $,
834
+ {
835
+ size: "sm",
836
+ variant: "ghost",
837
+ padding: 0,
838
+ onPress: () => R(0, 0, 10),
839
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "+" })
840
+ }
841
+ ),
842
+ /* @__PURE__ */ e(
843
+ W,
844
+ {
845
+ size: "sm",
846
+ width: 52,
847
+ style: { textAlign: "center" },
848
+ paddingHorizontal: 4,
849
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
850
+ value: f.getSeconds().toString().padStart(2, "0"),
851
+ onChangeText: (o) => {
852
+ const a = parseInt(o);
853
+ if (!isNaN(a) && a >= 0 && a < 60) {
854
+ const m = new Date(f);
855
+ m.setSeconds(a), E(m);
856
+ }
1054
857
  }
1055
858
  }
859
+ ),
860
+ /* @__PURE__ */ e(
861
+ $,
862
+ {
863
+ size: "sm",
864
+ variant: "ghost",
865
+ padding: 0,
866
+ onPress: () => R(0, 0, -10),
867
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "-" })
868
+ }
869
+ )
870
+ ] }),
871
+ /* @__PURE__ */ e(b, { justifyContent: "center", marginTop: 10, position: "relative", top: -2, children: /* @__PURE__ */ e(
872
+ $,
873
+ {
874
+ size: "sm",
875
+ variant: "primary",
876
+ paddingHorizontal: "$2",
877
+ onPress: ce,
878
+ borderRadius: "$2",
879
+ minWidth: 46,
880
+ backgroundColor: "$primary",
881
+ children: /* @__PURE__ */ e(u, { fontSize: 10, fontWeight: "900", color: "#fff", children: f.getHours() >= 12 ? "PM" : "AM" })
1056
882
  }
1057
- ),
1058
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", padding: 0, onPress: () => I(0, 0, -10), children: /* @__PURE__ */ e(m, { fontSize: 16, children: "-" }) })
883
+ ) })
1059
884
  ] }),
1060
- /* @__PURE__ */ e(y, { justifyContent: "center", marginTop: 10, position: "relative", top: -2, children: /* @__PURE__ */ e(
1061
- x,
1062
- {
1063
- size: "sm",
1064
- variant: "primary",
1065
- paddingHorizontal: "$2",
1066
- onPress: de,
1067
- borderRadius: "$2",
1068
- minWidth: 46,
1069
- backgroundColor: "$primary",
1070
- children: /* @__PURE__ */ e(m, { fontSize: 10, fontWeight: "900", color: "#fff", children: f.getHours() >= 12 ? "PM" : "AM" })
1071
- }
1072
- ) })
1073
- ] }),
1074
- /* @__PURE__ */ l($, { marginTop: "$1", children: [
1075
- /* @__PURE__ */ e(
1076
- x,
1077
- {
1078
- variant: "default",
1079
- size: "sm",
1080
- onPress: se,
1081
- flex: 1,
1082
- children: "Now"
1083
- }
1084
- ),
1085
- /* @__PURE__ */ e(v, { width: 8 }),
1086
- /* @__PURE__ */ e(
1087
- x,
1088
- {
1089
- variant: "primary",
1090
- size: "sm",
1091
- onPress: () => h(!1),
1092
- flex: 2,
1093
- children: "Apply Selection"
1094
- }
1095
- )
1096
- ] })
1097
- ] })
1098
- ]
885
+ /* @__PURE__ */ c(x, { marginTop: "$1", children: [
886
+ /* @__PURE__ */ e($, { variant: "default", size: "sm", onPress: ue, flex: 1, children: "Now" }),
887
+ /* @__PURE__ */ e(k, { width: 8 }),
888
+ /* @__PURE__ */ e($, { variant: "primary", size: "sm", onPress: () => l(!1), flex: 2, children: "Apply Selection" })
889
+ ] })
890
+ ]
891
+ }
892
+ )
893
+ ]
894
+ }
895
+ )
896
+ ] });
897
+ }
898
+ );
899
+ Ne.displayName = "DatePicker";
900
+ function Le({ trigger: r, content: t, placement: n = "bottom-start" }) {
901
+ const [i, d] = z(!1), s = te(null);
902
+ return F(() => {
903
+ if (typeof document > "u") return;
904
+ const h = (l) => {
905
+ s.current && !s.current.contains(l.target) && d(!1);
906
+ };
907
+ return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
908
+ }, []), /* @__PURE__ */ c(b, { position: "relative", ref: s, children: [
909
+ /* @__PURE__ */ e(x, { onPress: () => d(!i), style: { cursor: "pointer" }, children: r }),
910
+ i && /* @__PURE__ */ e(
911
+ Y,
912
+ {
913
+ position: "absolute",
914
+ zIndex: 1e3,
915
+ ...(() => {
916
+ switch (n) {
917
+ case "bottom-end":
918
+ return { top: "100%", right: 0, marginTop: 4 };
919
+ case "right-start":
920
+ return { top: 0, left: "100%", marginLeft: 4 };
921
+ case "right-end":
922
+ return { bottom: 0, left: "100%", marginLeft: 4 };
923
+ case "top-start":
924
+ return { bottom: "100%", left: 0, marginBottom: 4 };
925
+ case "top-end":
926
+ return { bottom: "100%", right: 0, marginBottom: 4 };
927
+ case "bottom-start":
928
+ default:
929
+ return { top: "100%", left: 0, marginTop: 4 };
930
+ }
931
+ })(),
932
+ shadowColor: "$shadowColor",
933
+ shadowOffset: { width: 0, height: 4 },
934
+ shadowOpacity: 0.1,
935
+ shadowRadius: 10,
936
+ children: /* @__PURE__ */ e(
937
+ A,
938
+ {
939
+ elevated: !0,
940
+ padding: "$sm",
941
+ minWidth: 200,
942
+ borderWidth: 1,
943
+ borderColor: "$borderColor",
944
+ children: t
1099
945
  }
1100
946
  )
1101
- ]
1102
- }
1103
- );
1104
- });
1105
- ot.displayName = "DatePicker";
1106
- const nt = w("select", {
1107
- name: "Select",
1108
- backgroundColor: "$backgroundSecondary",
1109
- borderRadius: "$round",
1110
- borderWidth: 1,
1111
- borderStyle: "solid",
1112
- borderColor: "$borderColor",
1113
- color: "$color",
1114
- paddingLeft: "$md",
1115
- paddingRight: 40,
1116
- // Space for arrow
1117
- fontSize: "$sm",
1118
- width: "100%",
1119
- outlineWidth: 0,
1120
- appearance: "none",
1121
- webkitappearance: "none",
1122
- mozappearance: "none",
1123
- cursor: "pointer",
1124
- focusStyle: {
1125
- borderColor: "$primary",
1126
- backgroundColor: "$background",
1127
- outlineWidth: 0
1128
- },
1129
- hoverStyle: {
1130
- borderColor: "$primary",
1131
- backgroundColor: "$background"
1132
- },
1133
- variants: {
1134
- size: {
1135
- sm: { height: 32, fontSize: "$xs" },
1136
- md: { height: 40, fontSize: "$sm" },
1137
- lg: { height: 52, fontSize: "$md" }
1138
- },
1139
- error: {
1140
- true: {
1141
- borderColor: "$error",
1142
- focusStyle: {
1143
- borderColor: "$error"
947
+ }
948
+ )
949
+ ] });
950
+ }
951
+ const ie = D.forwardRef(
952
+ ({
953
+ error: r,
954
+ size: t = "md",
955
+ value: n,
956
+ onChange: i,
957
+ onValueChange: d,
958
+ options: s,
959
+ placeholder: g,
960
+ disabled: h,
961
+ name: l,
962
+ onBlur: B,
963
+ onFocus: T,
964
+ ...P
965
+ }, C) => {
966
+ const S = s.find((w) => w.value === n), H = S ? S.label : g || "Select an option...", f = (w) => {
967
+ d == null || d(w), i && i({
968
+ target: { value: w, name: l || "" }
969
+ });
970
+ }, p = /* @__PURE__ */ c(
971
+ $,
972
+ {
973
+ ref: C,
974
+ disabled: h,
975
+ size: t,
976
+ variant: r ? "ghost" : "default",
977
+ width: "100%",
978
+ justifyContent: "space-between",
979
+ borderWidth: 1,
980
+ borderColor: r ? "$error" : "$borderColor",
981
+ children: [
982
+ /* @__PURE__ */ e(
983
+ L,
984
+ {
985
+ fontSize: t === "sm" ? "$xs" : "$sm",
986
+ color: S ? "$color" : "$colorMuted",
987
+ children: H
988
+ }
989
+ ),
990
+ /* @__PURE__ */ e(
991
+ b,
992
+ {
993
+ width: 0,
994
+ height: 0,
995
+ borderLeftWidth: 5,
996
+ borderLeftColor: "transparent",
997
+ borderRightWidth: 5,
998
+ borderRightColor: "transparent",
999
+ borderTopWidth: 6,
1000
+ borderTopColor: "$colorMuted",
1001
+ opacity: 0.6
1002
+ }
1003
+ )
1004
+ ]
1005
+ }
1006
+ ), M = /* @__PURE__ */ c(b, { gap: "$xs", children: [
1007
+ g && /* @__PURE__ */ e(
1008
+ $,
1009
+ {
1010
+ variant: "ghost",
1011
+ size: "sm",
1012
+ justifyContent: "flex-start",
1013
+ onPress: () => f(""),
1014
+ children: /* @__PURE__ */ e(L, { fontSize: "$sm", color: "$colorMuted", children: g })
1144
1015
  }
1016
+ ),
1017
+ s.map((w) => /* @__PURE__ */ e(
1018
+ $,
1019
+ {
1020
+ variant: "ghost",
1021
+ size: "sm",
1022
+ justifyContent: "flex-start",
1023
+ onPress: () => f(w.value),
1024
+ backgroundColor: w.value === n ? "$primary1" : "transparent",
1025
+ children: /* @__PURE__ */ e(L, { fontSize: "$sm", children: w.label })
1026
+ },
1027
+ w.value
1028
+ ))
1029
+ ] });
1030
+ return /* @__PURE__ */ e(
1031
+ b,
1032
+ {
1033
+ position: "relative",
1034
+ width: P.width || "100%",
1035
+ minWidth: P.minWidth,
1036
+ pointerEvents: "box-none",
1037
+ children: /* @__PURE__ */ e(Le, { trigger: p, content: M, placement: "bottom-start" })
1145
1038
  }
1146
- }
1147
- },
1148
- defaultVariants: {
1149
- size: "md"
1039
+ );
1150
1040
  }
1151
- }), it = W.forwardRef(({
1152
- error: r,
1153
- size: t = "md",
1154
- value: n,
1155
- onChange: i,
1156
- onValueChange: d,
1157
- options: s,
1158
- placeholder: c,
1159
- disabled: u,
1160
- name: h,
1161
- ...F
1162
- }, E) => {
1163
- const A = n !== void 0;
1164
- return /* @__PURE__ */ l(
1165
- y,
1166
- {
1167
- position: "relative",
1168
- width: F.width || "100%",
1169
- minWidth: F.minWidth,
1170
- pointerEvents: "box-none",
1171
- children: [
1172
- /* @__PURE__ */ l(
1173
- nt,
1174
- {
1175
- ref: E,
1176
- ...A ? { value: n } : {},
1177
- error: r,
1178
- size: t,
1179
- onChange: (S) => {
1180
- i == null || i(S), d == null || d(S.target.value);
1181
- },
1182
- disabled: u,
1183
- name: h,
1184
- ...F,
1185
- children: [
1186
- c && /* @__PURE__ */ e("option", { value: "", children: c }),
1187
- s.map((S) => /* @__PURE__ */ e("option", { value: S.value, children: S.label }, S.value))
1188
- ]
1189
- }
1190
- ),
1191
- /* @__PURE__ */ e(
1192
- y,
1193
- {
1194
- position: "absolute",
1195
- right: 12,
1196
- top: "50%",
1197
- marginTop: -3,
1198
- width: 0,
1199
- height: 0,
1200
- borderLeftWidth: 5,
1201
- borderLeftColor: "transparent",
1202
- borderRightWidth: 5,
1203
- borderRightColor: "transparent",
1204
- borderTopWidth: 6,
1205
- borderTopColor: "$colorMuted",
1206
- pointerEvents: "none",
1207
- opacity: 0.6
1208
- }
1209
- )
1210
- ]
1211
- }
1212
- );
1213
- });
1214
- it.displayName = "Select";
1215
- const at = {
1216
- success: { borderLeft: "3px solid var(--color-success)" },
1217
- error: { borderLeft: "3px solid var(--color-error)" },
1218
- warning: { borderLeft: "3px solid var(--color-warning)" },
1219
- info: { borderLeft: "3px solid var(--color-primary)" }
1220
- }, dt = {
1041
+ );
1042
+ ie.displayName = "Select";
1043
+ const Oe = {
1221
1044
  success: "✓",
1222
1045
  error: "✕",
1223
1046
  warning: "⚠",
1224
1047
  info: "ℹ"
1225
1048
  };
1226
- function st({
1049
+ function je({
1227
1050
  message: r,
1228
1051
  variant: t = "info",
1229
1052
  duration: n = 4e3,
1230
1053
  onDismiss: i
1231
1054
  }) {
1232
- return k(() => {
1055
+ return F(() => {
1233
1056
  if (n > 0 && i) {
1234
1057
  const d = setTimeout(i, n);
1235
1058
  return () => clearTimeout(d);
1236
1059
  }
1237
1060
  }, [n, i]), /* @__PURE__ */ e(
1238
- "div",
1061
+ b,
1239
1062
  {
1240
1063
  className: `toast toast-${t}`,
1241
1064
  role: "alert",
1242
1065
  "aria-live": "assertive",
1243
1066
  "aria-atomic": "true",
1244
- style: at[t],
1245
- children: /* @__PURE__ */ l(
1246
- "div",
1247
- {
1248
- style: {
1249
- display: "flex",
1250
- alignItems: "center",
1251
- gap: "var(--spacing-sm)"
1252
- },
1253
- children: [
1254
- /* @__PURE__ */ e("span", { "aria-hidden": "true", style: { fontWeight: 600 }, children: dt[t] }),
1255
- /* @__PURE__ */ e("span", { children: r }),
1256
- i && /* @__PURE__ */ e(
1257
- "button",
1258
- {
1259
- onClick: i,
1260
- "aria-label": "Dismiss notification",
1261
- style: {
1262
- marginLeft: "auto",
1263
- background: "none",
1264
- border: "none",
1265
- cursor: "pointer",
1266
- color: "var(--color-text-muted)",
1267
- fontSize: "1rem",
1268
- padding: "0 var(--spacing-xs)"
1269
- },
1270
- children: "✕"
1271
- }
1272
- )
1273
- ]
1274
- }
1275
- )
1067
+ borderLeftWidth: 3,
1068
+ borderLeftColor: `$${t === "info" ? "primary" : t}`,
1069
+ backgroundColor: "$background",
1070
+ padding: "$sm",
1071
+ borderRadius: "$round",
1072
+ shadowColor: "$shadowColor",
1073
+ shadowRadius: 10,
1074
+ shadowOffset: { width: 0, height: 4 },
1075
+ children: /* @__PURE__ */ c(x, { alignItems: "center", gap: "$sm", children: [
1076
+ /* @__PURE__ */ e(u, { fontWeight: "600", children: Oe[t] }),
1077
+ /* @__PURE__ */ e(u, { flex: 1, children: r }),
1078
+ i && /* @__PURE__ */ e($, { variant: "ghost", size: "sm", onPress: i, "aria-label": "Dismiss notification", children: "✕" })
1079
+ ] })
1276
1080
  }
1277
1081
  );
1278
1082
  }
1279
- function kt({
1280
- toasts: r,
1281
- onDismiss: t
1282
- }) {
1083
+ function St({ toasts: r, onDismiss: t }) {
1283
1084
  return /* @__PURE__ */ e(
1284
- "div",
1085
+ b,
1285
1086
  {
1286
1087
  "aria-label": "Notifications",
1287
- style: {
1288
- position: "fixed",
1289
- bottom: "var(--spacing-lg)",
1290
- right: "var(--spacing-lg)",
1291
- zIndex: 60,
1292
- display: "flex",
1293
- flexDirection: "column",
1294
- gap: "var(--spacing-sm)",
1295
- pointerEvents: "none"
1296
- },
1297
- children: r.map((n) => /* @__PURE__ */ e("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ e(st, { ...n, onDismiss: () => t(n.id) }) }, n.id))
1088
+ position: "fixed",
1089
+ bottom: "$lg",
1090
+ right: "$lg",
1091
+ zIndex: 60,
1092
+ gap: "$sm",
1093
+ pointerEvents: "none",
1094
+ children: r.map((n) => /* @__PURE__ */ e(b, { pointerEvents: "auto", children: /* @__PURE__ */ e(je, { ...n, onDismiss: () => t(n.id) }) }, n.id))
1298
1095
  }
1299
1096
  );
1300
1097
  }
1301
- const lt = {
1098
+ const ae = q(null), _e = ({ children: r }) => {
1099
+ const [t, n] = z(/* @__PURE__ */ new Map()), i = (s, g) => {
1100
+ n((h) => {
1101
+ const l = new Map(h);
1102
+ return l.set(s, g), l;
1103
+ });
1104
+ }, d = (s) => {
1105
+ n((g) => {
1106
+ const h = new Map(g);
1107
+ return h.delete(s), h;
1108
+ });
1109
+ };
1110
+ return /* @__PURE__ */ c(ae.Provider, { value: { register: i, unregister: d }, children: [
1111
+ r,
1112
+ /* @__PURE__ */ e(Ye, { portals: t })
1113
+ ] });
1114
+ }, Ye = ({ portals: r }) => typeof document < "u" ? null : /* @__PURE__ */ e(xe, { children: Array.from(r.entries()).map(([t, n]) => /* @__PURE__ */ e(D.Fragment, { children: n }, t)) }), se = ({ children: r }) => {
1115
+ const t = ee(ae), [n] = z(() => Math.random().toString(36).substr(2, 9));
1116
+ if (F(() => {
1117
+ if (!(typeof document < "u" || !t))
1118
+ return () => t.unregister(n);
1119
+ }, [t, n]), F(() => {
1120
+ typeof document > "u" && t && t.register(n, r);
1121
+ }), typeof document < "u") {
1122
+ let i = document.getElementById("portal-root");
1123
+ i || (i = document.createElement("div"), i.id = "portal-root", document.body.appendChild(i));
1124
+ const d = document.documentElement.className;
1125
+ return i.className !== d && (i.className = d), ve.createPortal(r, i);
1126
+ }
1127
+ return null;
1128
+ }, Ve = {
1302
1129
  sm: 400,
1303
1130
  md: 600,
1304
1131
  lg: 900,
1305
1132
  xl: 1200
1306
- }, zt = ({
1307
- isOpen: r,
1308
- onClose: t,
1309
- title: n,
1310
- footer: i,
1311
- size: d = "md",
1312
- children: s
1313
- }) => r ? /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ l(
1314
- _,
1133
+ }, vt = ({ isOpen: r, onClose: t, title: n, footer: i, size: d = "md", children: s }) => r ? /* @__PURE__ */ e(se, { children: /* @__PURE__ */ c(
1134
+ Y,
1315
1135
  {
1316
1136
  position: "absolute",
1317
1137
  top: 0,
@@ -1325,7 +1145,7 @@ const lt = {
1325
1145
  justifyContent: "center",
1326
1146
  children: [
1327
1147
  /* @__PURE__ */ e(
1328
- y,
1148
+ b,
1329
1149
  {
1330
1150
  position: "absolute",
1331
1151
  top: 0,
@@ -1337,10 +1157,10 @@ const lt = {
1337
1157
  zIndex: 10
1338
1158
  }
1339
1159
  ),
1340
- /* @__PURE__ */ l(
1341
- B,
1160
+ /* @__PURE__ */ c(
1161
+ A,
1342
1162
  {
1343
- width: lt[d],
1163
+ width: Ve[d],
1344
1164
  maxWidth: "95%",
1345
1165
  maxHeight: "90vh",
1346
1166
  backgroundColor: "$background",
@@ -1352,8 +1172,8 @@ const lt = {
1352
1172
  borderColor: "$borderColor",
1353
1173
  zIndex: 100,
1354
1174
  children: [
1355
- /* @__PURE__ */ l(
1356
- $,
1175
+ /* @__PURE__ */ c(
1176
+ x,
1357
1177
  {
1358
1178
  padding: "$4",
1359
1179
  borderBottomWidth: 1,
@@ -1362,23 +1182,14 @@ const lt = {
1362
1182
  alignItems: "center",
1363
1183
  backgroundColor: "$backgroundSecondary",
1364
1184
  children: [
1365
- /* @__PURE__ */ e(m, { fontWeight: "700", size: "lg", children: n }),
1366
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", onPress: t, padding: "$2", children: /* @__PURE__ */ e(m, { children: "✕" }) })
1185
+ /* @__PURE__ */ e(u, { fontWeight: "700", size: "lg", children: n }),
1186
+ /* @__PURE__ */ e($, { size: "sm", variant: "ghost", onPress: t, padding: "$2", children: /* @__PURE__ */ e(u, { children: "✕" }) })
1367
1187
  ]
1368
1188
  }
1369
1189
  ),
1370
- /* @__PURE__ */ e(
1371
- y,
1372
- {
1373
- flex: 1,
1374
- overflow: "scroll",
1375
- minHeight: 250,
1376
- backgroundColor: "$background",
1377
- children: s
1378
- }
1379
- ),
1190
+ /* @__PURE__ */ e(b, { flex: 1, overflow: "scroll", minHeight: 250, backgroundColor: "$background", children: s }),
1380
1191
  i && /* @__PURE__ */ e(
1381
- $,
1192
+ x,
1382
1193
  {
1383
1194
  padding: "$4",
1384
1195
  borderTopWidth: 1,
@@ -1395,31 +1206,9 @@ const lt = {
1395
1206
  ]
1396
1207
  }
1397
1208
  ) }) : null;
1398
- function Ft({
1399
- isOpen: r,
1400
- onClose: t,
1401
- title: n,
1402
- width: i = 420,
1403
- children: d,
1404
- footer: s
1405
- }) {
1406
- if (!r) return null;
1407
- const c = {
1408
- position: "fixed",
1409
- top: 0,
1410
- right: 0,
1411
- bottom: 0,
1412
- width: i,
1413
- maxWidth: "95vw",
1414
- zIndex: 100,
1415
- display: "flex",
1416
- flexDirection: "column",
1417
- boxShadow: "-8px 0 32px rgba(0,0,0,0.18)",
1418
- transform: r ? "translateX(0)" : `translateX(${i}px)`,
1419
- transition: "transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)"
1420
- };
1421
- return /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ l(
1422
- _,
1209
+ function kt({ isOpen: r, onClose: t, title: n, width: i = 420, children: d, footer: s }) {
1210
+ return r ? /* @__PURE__ */ e(se, { children: /* @__PURE__ */ c(
1211
+ Y,
1423
1212
  {
1424
1213
  position: "absolute",
1425
1214
  top: 0,
@@ -1431,7 +1220,7 @@ function Ft({
1431
1220
  zIndex: 99998,
1432
1221
  children: [
1433
1222
  /* @__PURE__ */ e(
1434
- y,
1223
+ b,
1435
1224
  {
1436
1225
  position: "absolute",
1437
1226
  top: 0,
@@ -1443,10 +1232,24 @@ function Ft({
1443
1232
  zIndex: 10
1444
1233
  }
1445
1234
  ),
1446
- /* @__PURE__ */ l(
1447
- B,
1235
+ /* @__PURE__ */ c(
1236
+ A,
1448
1237
  {
1449
- style: c,
1238
+ style: {
1239
+ position: "fixed",
1240
+ top: 0,
1241
+ right: 0,
1242
+ bottom: 0,
1243
+ width: i,
1244
+ maxWidth: "95vw",
1245
+ zIndex: 100,
1246
+ display: "flex",
1247
+ flexDirection: "column",
1248
+ boxShadow: "-8px 0 32px rgba(0,0,0,0.18)",
1249
+ transform: "translateX(0)",
1250
+ // Drawer unmounts completely when closed, making the ternary dead code
1251
+ transition: "transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)"
1252
+ },
1450
1253
  backgroundColor: "$background",
1451
1254
  borderRadius: 0,
1452
1255
  borderLeftWidth: 1,
@@ -1455,8 +1258,8 @@ function Ft({
1455
1258
  elevated: !1,
1456
1259
  zIndex: 100,
1457
1260
  children: [
1458
- /* @__PURE__ */ l(
1459
- $,
1261
+ /* @__PURE__ */ c(
1262
+ x,
1460
1263
  {
1461
1264
  padding: "$md",
1462
1265
  borderBottomWidth: 1,
@@ -1465,22 +1268,14 @@ function Ft({
1465
1268
  alignItems: "center",
1466
1269
  backgroundColor: "$backgroundSecondary",
1467
1270
  children: [
1468
- /* @__PURE__ */ e(m, { fontWeight: "700", size: "$md", children: n }),
1469
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", onPress: t, children: "✕" })
1271
+ /* @__PURE__ */ e(u, { fontWeight: "700", size: "$md", children: n }),
1272
+ /* @__PURE__ */ e($, { size: "sm", variant: "ghost", onPress: t, children: "✕" })
1470
1273
  ]
1471
1274
  }
1472
1275
  ),
1473
- /* @__PURE__ */ e(
1474
- y,
1475
- {
1476
- flex: 1,
1477
- padding: "$md",
1478
- style: { overflowY: "auto" },
1479
- children: d
1480
- }
1481
- ),
1276
+ /* @__PURE__ */ e(b, { flex: 1, padding: "$md", style: { overflowY: "auto" }, children: d }),
1482
1277
  s && /* @__PURE__ */ e(
1483
- $,
1278
+ x,
1484
1279
  {
1485
1280
  padding: "$md",
1486
1281
  borderTopWidth: 1,
@@ -1496,94 +1291,50 @@ function Ft({
1496
1291
  )
1497
1292
  ]
1498
1293
  }
1499
- ) });
1294
+ ) }) : null;
1500
1295
  }
1501
- const ct = {
1296
+ const Ke = {
1502
1297
  $sm: 24,
1503
1298
  $md: 32,
1504
1299
  $lg: 40,
1505
1300
  $xl: 48
1506
1301
  };
1507
- function Dt({ src: r, fallback: t, size: n = "$md", circular: i = !0, borderWidth: d, borderColor: s }) {
1508
- const [c, u] = C(!1), h = typeof n == "number" ? n : ct[n] || 32;
1302
+ function zt({
1303
+ src: r,
1304
+ fallback: t,
1305
+ size: n = "$md",
1306
+ circular: i = !0,
1307
+ borderWidth: d,
1308
+ borderColor: s
1309
+ }) {
1310
+ const [g, h] = z(!1), l = typeof n == "number" ? n : Ke[n] || 32;
1509
1311
  return /* @__PURE__ */ e(
1510
- y,
1312
+ b,
1511
1313
  {
1512
- width: h,
1513
- height: h,
1514
- borderRadius: i ? h / 2 : "$sm",
1314
+ width: l,
1315
+ height: l,
1316
+ borderRadius: i ? l / 2 : "$sm",
1515
1317
  backgroundColor: "$bgTertiary",
1516
1318
  alignItems: "center",
1517
1319
  justifyContent: "center",
1518
1320
  overflow: "hidden",
1519
1321
  borderWidth: d,
1520
1322
  borderColor: s,
1521
- children: r && !c ? /* @__PURE__ */ e(
1522
- Se,
1323
+ children: r && !g ? /* @__PURE__ */ e(
1324
+ ke,
1523
1325
  {
1524
- source: { uri: r, width: h, height: h },
1326
+ source: { uri: r, width: l, height: l },
1525
1327
  width: "100%",
1526
1328
  height: "100%",
1527
- onError: () => u(!0)
1329
+ onError: () => h(!0)
1528
1330
  }
1529
- ) : typeof t == "string" ? /* @__PURE__ */ e(m, { color: "$colorMuted", size: "$sm", fontWeight: "600", children: t.slice(0, 2).toUpperCase() }) : t
1331
+ ) : typeof t == "string" ? /* @__PURE__ */ e(u, { color: "$colorMuted", size: "$sm", fontWeight: "600", children: t.slice(0, 2).toUpperCase() }) : t
1530
1332
  }
1531
1333
  );
1532
1334
  }
1533
- function Tt({ trigger: r, content: t, placement: n = "bottom-start" }) {
1534
- const [i, d] = C(!1), s = Q(null);
1535
- return k(() => {
1536
- if (typeof document > "u") return;
1537
- const u = (h) => {
1538
- s.current && !s.current.contains(h.target) && d(!1);
1539
- };
1540
- return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
1541
- }, []), /* @__PURE__ */ l(y, { position: "relative", ref: s, children: [
1542
- /* @__PURE__ */ e($, { onPress: () => d(!i), style: { cursor: "pointer" }, children: r }),
1543
- i && /* @__PURE__ */ e(
1544
- _,
1545
- {
1546
- position: "absolute",
1547
- zIndex: 1e3,
1548
- ...(() => {
1549
- switch (n) {
1550
- case "bottom-end":
1551
- return { top: "100%", right: 0, marginTop: 4 };
1552
- case "right-start":
1553
- return { top: 0, left: "100%", marginLeft: 4 };
1554
- case "right-end":
1555
- return { bottom: 0, left: "100%", marginLeft: 4 };
1556
- case "top-start":
1557
- return { bottom: "100%", left: 0, marginBottom: 4 };
1558
- case "top-end":
1559
- return { bottom: "100%", right: 0, marginBottom: 4 };
1560
- case "bottom-start":
1561
- default:
1562
- return { top: "100%", left: 0, marginTop: 4 };
1563
- }
1564
- })(),
1565
- shadowColor: "$shadowColor",
1566
- shadowOffset: { width: 0, height: 4 },
1567
- shadowOpacity: 0.1,
1568
- shadowRadius: 10,
1569
- children: /* @__PURE__ */ e(
1570
- B,
1571
- {
1572
- elevated: !0,
1573
- padding: "$sm",
1574
- minWidth: 200,
1575
- borderWidth: 1,
1576
- borderColor: "$borderColor",
1577
- children: t
1578
- }
1579
- )
1580
- }
1581
- )
1582
- ] });
1583
- }
1584
- function Et({ vertical: r }) {
1335
+ function Ft({ vertical: r }) {
1585
1336
  return /* @__PURE__ */ e(
1586
- y,
1337
+ b,
1587
1338
  {
1588
1339
  width: r ? 1 : "100%",
1589
1340
  height: r ? "100%" : 1,
@@ -1591,48 +1342,215 @@ function Et({ vertical: r }) {
1591
1342
  }
1592
1343
  );
1593
1344
  }
1594
- function gt(r) {
1345
+ function Ue(r) {
1595
1346
  return r.replace(/[-_](.)/g, (t, n) => n.toUpperCase()).replace(/^(.)/, (t) => t.toUpperCase());
1596
1347
  }
1597
- function Mt({ name: r, size: t, color: n, strokeWidth: i, ...d }) {
1598
- const s = gt(r), c = s in P ? P[s] : P.Box;
1599
- return /* @__PURE__ */ e(c, { size: t, color: n, strokeWidth: i, ...d });
1348
+ function Xe({ name: r, size: t, color: n, strokeWidth: i, ...d }) {
1349
+ const s = Ue(r), g = s in N ? N[s] : N.Box;
1350
+ return /* @__PURE__ */ e(g, { size: t, color: n, strokeWidth: i, ...d });
1351
+ }
1352
+ function Dt() {
1353
+ const { theme: r, toggleTheme: t } = ne();
1354
+ return /* @__PURE__ */ e(
1355
+ $,
1356
+ {
1357
+ variant: "ghost",
1358
+ onPress: t,
1359
+ "aria-label": `Switch to ${r === "light" ? "dark" : "light"} mode`,
1360
+ title: `Current theme: ${r}`,
1361
+ children: /* @__PURE__ */ e(Xe, { name: r === "light" ? "moon" : "sun", size: 20 })
1362
+ }
1363
+ );
1364
+ }
1365
+ const Je = { violet: { 50: "#F5F3FF", 100: "#EDE9FE", 200: "#DDD6FE", 300: "#C4B5FD", 400: "#A78BFA", 500: "#8B5CF6", 600: "#7C3AED", 700: "#6D28D9", 800: "#5B21B6", 900: "#4C1D95", 950: "#2E1065" }, navy: { 50: "#E8EDF4", 100: "#C5D0E0", 200: "#9EAFCA", 300: "#778EB4", 400: "#5975A3", 500: "#3B5C93", 600: "#2F4A78", 700: "#1E3358", 800: "#0F1F3A", 900: "#021526", 950: "#01101E" } }, Ze = { light: { primary: "#8B5CF6", primaryHover: "#7C3AED", primaryActive: "#6D28D9", bg: "#FFFFFF", bgSecondary: "#F8FAFC", bgTertiary: "#F1F5F9", border: "#E2E8F0", text: "#0F172A", textSecondary: "#64748B", textMuted: "#94A3B8", sidebarBg: "#021526", sidebarText: "#E2E8F0", sidebarTextMuted: "rgba(255, 255, 255, 0.65)", sidebarHover: "rgba(139, 92, 246, 0.15)", sidebarSearchBg: "rgba(255, 255, 255, 0.1)", sidebarItemActiveBg: "rgba(139, 92, 246, 0.3)", success: "#22C55E", warning: "#F59E0B", error: "#EF4444", errorBg: "#FFF2F0", errorBorder: "#FFCCC7", focusRing: "rgba(139, 92, 246, 0.25)", secondary: "#0F172A", borderColorMuted: "rgba(226, 232, 240, 0.4)" }, dark: { primary: "#A78BFA", primaryHover: "#8B5CF6", primaryActive: "#7C3AED", bg: "#01101E", bgSecondary: "#021526", bgTertiary: "#0F1F3A", border: "#1E3358", text: "#F1F5F9", textSecondary: "#CBD5E1", textMuted: "#94A3B8", sidebarBg: "#00050A", sidebarText: "#E2E8F0", sidebarTextMuted: "#94A3B8", sidebarHover: "rgba(167, 139, 250, 0.15)", sidebarSearchBg: "rgba(255, 255, 255, 0.05)", sidebarItemActiveBg: "rgba(167, 139, 250, 0.2)", success: "#22C55E", warning: "#F59E0B", error: "#EF4444", errorBg: "rgba(239, 68, 68, 0.1)", errorBorder: "rgba(239, 68, 68, 0.3)", focusRing: "rgba(167, 139, 250, 0.3)", secondary: "#F1F5F9", borderColorMuted: "rgba(30, 51, 88, 0.4)" } }, j = {
1366
+ brand: Je,
1367
+ semantic: Ze
1368
+ }, Ge = { sans: "'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", mono: "'JetBrains Mono', 'Fira Code', monospace" }, Qe = { xs: "0.75rem", sm: "0.875rem", base: "0.875rem", md: "1rem", lg: "1.125rem", xl: "1.375rem", "2xl": "1.75rem", "3xl": "2rem" }, qe = { normal: 400, medium: 500, semibold: 600, bold: 700 }, et = { tight: 1.3, normal: 1.5, relaxed: 1.6 }, V = {
1369
+ fontFamily: Ge,
1370
+ fontSize: Qe,
1371
+ fontWeight: qe,
1372
+ lineHeight: et
1373
+ }, tt = { xs: "0.25rem", sm: "0.5rem", md: "1rem", lg: "1.5rem", xl: "2rem", "2xl": "3rem" }, rt = { sm: "4px", md: "6px", lg: "8px", xl: "12px", full: "9999px" }, ot = { sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)", md: "0 4px 6px -1px rgb(0 0 0 / 0.1)", lg: "0 10px 15px -3px rgb(0 0 0 / 0.1)" }, de = {
1374
+ spacing: tt,
1375
+ borderRadius: rt,
1376
+ shadow: ot
1377
+ };
1378
+ function nt() {
1379
+ return {
1380
+ primary: j.semantic.light.primary,
1381
+ secondary: j.semantic.light.secondary,
1382
+ white: "#ffffff",
1383
+ black: "#000000",
1384
+ transparent: "transparent"
1385
+ };
1386
+ }
1387
+ function it() {
1388
+ const r = {};
1389
+ return Object.entries(V.fontSize).forEach(([t, n]) => {
1390
+ const i = parseFloat(n.toString());
1391
+ r[t] = isNaN(i) ? 16 : i * 16;
1392
+ }), r;
1393
+ }
1394
+ function Q(r) {
1395
+ const t = j.semantic[r];
1396
+ return {
1397
+ background: t.bg,
1398
+ backgroundSecondary: t.bgSecondary,
1399
+ backgroundTertiary: t.bgTertiary,
1400
+ color: t.text,
1401
+ colorSecondary: t.textSecondary || t.secondary,
1402
+ colorMuted: t.textMuted || "#94a3b8",
1403
+ borderColor: t.border,
1404
+ borderColorMuted: t.borderColorMuted || t.border,
1405
+ placeholderColor: t.textMuted || "#94a3b8",
1406
+ primary: t.primary,
1407
+ secondary: t.secondary,
1408
+ success: t.success,
1409
+ warning: t.warning,
1410
+ error: t.error,
1411
+ shadowColor: r === "light" ? "rgba(0,0,0,0.12)" : "rgba(0,0,0,0.4)",
1412
+ ...Object.entries(t).reduce(
1413
+ (n, [i, d]) => {
1414
+ const s = i.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1415
+ return n[s] = d, n;
1416
+ },
1417
+ {}
1418
+ )
1419
+ };
1420
+ }
1421
+ function at() {
1422
+ const r = {};
1423
+ return Object.entries(de.spacing).forEach(([t, n]) => {
1424
+ const i = parseFloat(n.toString());
1425
+ r[t] = isNaN(i) ? 0 : i * 16;
1426
+ }), r;
1427
+ }
1428
+ function st() {
1429
+ const r = {};
1430
+ return Object.entries(de.borderRadius).forEach(([t, n]) => {
1431
+ const i = parseFloat(n.toString());
1432
+ r[t] = isNaN(i) ? 0 : i;
1433
+ }), r.full = 9999, r.pill = 9999, r.round = 8, r;
1434
+ }
1435
+ function dt() {
1436
+ return {
1437
+ tokens: {
1438
+ color: nt(),
1439
+ space: at(),
1440
+ size: it(),
1441
+ radius: st(),
1442
+ zIndex: {
1443
+ base: 0,
1444
+ dropdown: 100,
1445
+ modal: 1200,
1446
+ toast: 1400
1447
+ }
1448
+ },
1449
+ themes: {
1450
+ light: Q("light"),
1451
+ dark: Q("dark")
1452
+ }
1453
+ };
1454
+ }
1455
+ const I = dt(), lt = we({
1456
+ color: I.tokens.color,
1457
+ space: I.tokens.space,
1458
+ size: I.tokens.size,
1459
+ radius: I.tokens.radius,
1460
+ zIndex: I.tokens.zIndex
1461
+ }), ct = re({
1462
+ family: V.fontFamily.sans,
1463
+ size: I.tokens.size,
1464
+ lineHeight: {
1465
+ tight: 1.3,
1466
+ normal: 1.5
1467
+ },
1468
+ weight: {
1469
+ normal: "400",
1470
+ medium: "500",
1471
+ semibold: "600",
1472
+ bold: "700"
1473
+ },
1474
+ letterSpacing: {
1475
+ base: 0,
1476
+ lg: -0.2
1477
+ }
1478
+ }), ut = re({
1479
+ family: V.fontFamily.sans,
1480
+ size: I.tokens.size,
1481
+ lineHeight: {
1482
+ tight: 1.3,
1483
+ normal: 1.5
1484
+ },
1485
+ weight: {
1486
+ normal: "400",
1487
+ medium: "500",
1488
+ semibold: "600",
1489
+ bold: "700"
1490
+ }
1491
+ }), gt = Ce({
1492
+ tokens: lt,
1493
+ themes: I.themes,
1494
+ fonts: {
1495
+ heading: ct,
1496
+ body: ut
1497
+ },
1498
+ defaultTheme: "light",
1499
+ media: {
1500
+ xs: { maxWidth: 659 },
1501
+ sm: { maxWidth: 800 },
1502
+ md: { maxWidth: 1024 },
1503
+ lg: { maxWidth: 1280 },
1504
+ xl: { maxWidth: 1420 },
1505
+ gtXs: { minWidth: 660 },
1506
+ gtSm: { minWidth: 801 },
1507
+ gtMd: { minWidth: 1025 },
1508
+ gtLg: { minWidth: 1281 },
1509
+ short: { maxHeight: 820 },
1510
+ tall: { minHeight: 821 },
1511
+ hoverNone: { hover: "none" },
1512
+ pointerCoarse: { pointer: "coarse" }
1513
+ }
1514
+ });
1515
+ function Tt({ children: r }) {
1516
+ const { theme: t } = ne();
1517
+ return /* @__PURE__ */ e(Se, { config: gt, defaultTheme: t, children: /* @__PURE__ */ e(_e, { children: r }) });
1600
1518
  }
1601
1519
  export {
1602
- Dt as Avatar,
1603
- x as Button,
1604
- B as Card,
1605
- ot as DatePicker,
1606
- Ft as Drawer,
1607
- Ct as Heading,
1608
- Mt as Icon,
1609
- T as Input,
1520
+ zt as Avatar,
1521
+ $ as Button,
1522
+ A as Card,
1523
+ Ne as DatePicker,
1524
+ kt as Drawer,
1525
+ $t as Heading,
1526
+ Xe as Icon,
1527
+ W as Input,
1610
1528
  wt as LocaleSwitcher,
1611
- xt as MProvider,
1529
+ Tt as MProvider,
1612
1530
  J as MStack,
1613
- m as MText,
1614
- zt as Modal,
1615
- vt as Paragraph,
1616
- Tt as Popover,
1617
- ne as Portal,
1618
- Ve as PortalHost,
1619
- Ye as PortalProvider,
1620
- it as Select,
1621
- Et as Separator,
1622
- St as Skeleton,
1623
- $t as StateBadge,
1624
- bt as ThemeProvider,
1625
- yt as ThemeToggle,
1626
- st as Toast,
1627
- kt as ToastContainer,
1628
- $ as XStack,
1629
- y as YStack,
1630
- _ as ZStack,
1631
- N as colors,
1632
- Le as generateMDesignConfig,
1633
- _e as mThemeConfig,
1634
- re as spacing,
1635
- j as typography,
1636
- te as useTheme
1531
+ u as MText,
1532
+ vt as Modal,
1533
+ L as Paragraph,
1534
+ Le as Popover,
1535
+ se as Portal,
1536
+ Ye as PortalHost,
1537
+ _e as PortalProvider,
1538
+ ie as Select,
1539
+ Ft as Separator,
1540
+ Ct as Skeleton,
1541
+ xt as StateBadge,
1542
+ yt as ThemeProvider,
1543
+ Dt as ThemeToggle,
1544
+ je as Toast,
1545
+ St as ToastContainer,
1546
+ x as XStack,
1547
+ b as YStack,
1548
+ Y as ZStack,
1549
+ j as colors,
1550
+ dt as generateMDesignConfig,
1551
+ gt as mThemeConfig,
1552
+ de as spacing,
1553
+ V as typography,
1554
+ ne as useTheme
1637
1555
  };
1638
1556
  //# sourceMappingURL=index.js.map