@framework-m/ui 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +1 -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 +10 -10
  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 +1020 -1141
  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 +16 -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 l, Fragment as xe } from "react/jsx-runtime";
2
+ import B, { createContext as q, useState as v, useEffect as k, useContext as ee, useRef as te, useMemo as U } from "react";
3
+ import { styled as S, View as C, Text as _, createTokens as we, createFont as re, createTamagui as Se, TamaguiProvider as Ce } 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);
16
+ function pt({ children: r, defaultTheme: t }) {
17
+ const [n, i] = v(t || ze);
18
18
  k(() => {
19
- K(n);
19
+ X(n);
20
20
  }, [n]), k(() => {
21
21
  t && i(t);
22
22
  }, [t]), k(() => {
23
- const u = window.matchMedia("(prefers-color-scheme: dark)"), h = (F) => {
24
- localStorage.getItem(L) || i(F.matches ? "dark" : "light");
23
+ const h = window.matchMedia("(prefers-color-scheme: dark)"), m = (P) => {
24
+ localStorage.getItem(O) || i(P.matches ? "dark" : "light");
25
25
  };
26
- return u.addEventListener("change", h), () => u.removeEventListener("change", h);
26
+ return h.addEventListener("change", m), () => h.removeEventListener("change", m);
27
27
  }, []);
28
- const d = (u) => {
29
- i(u), localStorage.setItem(L, u), K(u);
28
+ const d = (h) => {
29
+ i(h), localStorage.setItem(O, h), X(h);
30
30
  }, c = { 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: c, 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 = S(C, {
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 = S(C, {
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 = S(C, {
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, Me = S(C, {
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 = Me, Ee = S(_, {
545
114
  name: "MText",
546
115
  fontFamily: "$body",
547
116
  display: "inline-flex",
@@ -560,7 +129,7 @@ const U = w(v, {
560
129
  muted: { color: "$colorMuted" }
561
130
  }
562
131
  }
563
- }), m = Ge, Qe = w(O, {
132
+ }), u = Ee, Te = S(_, {
564
133
  name: "Paragraph",
565
134
  fontFamily: "$body",
566
135
  display: "inline-flex",
@@ -575,7 +144,7 @@ const U = w(v, {
575
144
  $xxl: { fontSize: "$xxl" }
576
145
  }
577
146
  }
578
- }), vt = Qe, qe = w(O, {
147
+ }), L = Te, Ie = S(_, {
579
148
  name: "Heading",
580
149
  fontFamily: "$body",
581
150
  fontWeight: "800",
@@ -591,7 +160,127 @@ const U = w(v, {
591
160
  $xxl: { fontSize: "$xxl" }
592
161
  }
593
162
  }
594
- }), Ct = qe, et = w(v, {
163
+ }), $t = Ie, Z = {
164
+ draft: { bg: "#e0e0e0", text: "#333" },
165
+ pending: { bg: "#fff3cd", text: "#856404" },
166
+ submitted: { bg: "#cce5ff", text: "#004085" },
167
+ approved: { bg: "#d4edda", text: "#155724" },
168
+ rejected: { bg: "#f8d7da", text: "#721c24" },
169
+ cancelled: { bg: "#f5f5f5", text: "#666" },
170
+ completed: { bg: "#d4edda", text: "#155724" },
171
+ on_hold: { bg: "#fff3cd", text: "#856404" },
172
+ default: { bg: "#e9ecef", text: "#495057" }
173
+ };
174
+ function We(r) {
175
+ const t = r.toLowerCase().replace(/\s+/g, "_");
176
+ return Z[t] ?? Z.default;
177
+ }
178
+ function yt({ state: r, docstatus: t, className: n, style: i }) {
179
+ const d = r ?? (t === 0 ? "Draft" : t === 1 ? "Submitted" : t === 2 ? "Cancelled" : void 0);
180
+ if (!d) return null;
181
+ const s = We(d);
182
+ return /* @__PURE__ */ e(
183
+ u,
184
+ {
185
+ className: n,
186
+ style: {
187
+ display: "inline-flex",
188
+ padding: "0.25rem 0.75rem",
189
+ borderRadius: "9999px",
190
+ fontSize: "0.75rem",
191
+ fontWeight: 500,
192
+ textTransform: "capitalize",
193
+ backgroundColor: s.bg,
194
+ color: s.text,
195
+ ...i
196
+ },
197
+ children: d
198
+ }
199
+ );
200
+ }
201
+ const Be = [
202
+ { code: "en", label: "English" },
203
+ { code: "hi", label: "हिन्दी" },
204
+ { code: "ta", label: "தமிழ்" },
205
+ { code: "es", label: "Español" },
206
+ { code: "fr", label: "Français" }
207
+ ];
208
+ function xt({
209
+ language: r,
210
+ onChangeLanguage: t,
211
+ locales: n = Be
212
+ }) {
213
+ return /* @__PURE__ */ l(x, { alignItems: "center", gap: "$xs", width: "auto", children: [
214
+ /* @__PURE__ */ e(u, { size: "$sm", children: "🌐" }),
215
+ /* @__PURE__ */ e(
216
+ ie,
217
+ {
218
+ value: r,
219
+ onValueChange: t,
220
+ options: n.map((i) => ({ value: i.code, label: i.label })),
221
+ width: "auto",
222
+ size: "sm"
223
+ }
224
+ )
225
+ ] });
226
+ }
227
+ const G = S(C, {
228
+ name: "Skeleton",
229
+ backgroundColor: "$colorBgTertiary",
230
+ borderRadius: "$md",
231
+ display: "flex",
232
+ variants: {
233
+ variant: {
234
+ text: {
235
+ height: 14,
236
+ width: "80%",
237
+ marginBottom: "$sm"
238
+ },
239
+ "text-short": {
240
+ height: 14,
241
+ width: "40%",
242
+ marginBottom: "$sm"
243
+ },
244
+ heading: {
245
+ height: 24,
246
+ width: "60%",
247
+ marginBottom: "$md"
248
+ },
249
+ avatar: {
250
+ width: 40,
251
+ height: 40,
252
+ borderRadius: 1e3
253
+ },
254
+ button: {
255
+ height: 36,
256
+ width: 100,
257
+ borderRadius: "$md"
258
+ }
259
+ }
260
+ },
261
+ defaultVariants: {
262
+ variant: "text"
263
+ }
264
+ }), wt = ({ count: r = 1, className: t = "", ...n }) => {
265
+ const i = `skeleton ${t}`.trim();
266
+ return r > 1 ? /* @__PURE__ */ e(C, { "aria-busy": !0, "aria-label": "Loading content", children: Array.from({ length: r }, (d, s) => /* @__PURE__ */ e(
267
+ G,
268
+ {
269
+ className: i,
270
+ ...n,
271
+ ...s === r - 1 && n.variant === "text" ? { width: "60%" } : {}
272
+ },
273
+ s
274
+ )) }) : /* @__PURE__ */ e(
275
+ G,
276
+ {
277
+ className: i,
278
+ "aria-busy": !0,
279
+ "aria-label": "Loading",
280
+ ...n
281
+ }
282
+ );
283
+ }, Pe = S(C, {
595
284
  name: "Button",
596
285
  flexDirection: "row",
597
286
  alignItems: "center",
@@ -674,19 +363,11 @@ const U = w(v, {
674
363
  variant: "default",
675
364
  size: "md"
676
365
  }
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,
366
+ }), y = B.forwardRef(
367
+ ({ children: r, variant: t = "default", size: n = "md", loading: i, disabled: d, tag: s = "button", ...c }, h) => /* @__PURE__ */ e(
368
+ Pe,
689
369
  {
370
+ ref: h,
690
371
  tag: s,
691
372
  type: c.type,
692
373
  variant: t,
@@ -694,9 +375,9 @@ function x({
694
375
  disabled: d || i,
695
376
  ...c,
696
377
  children: /* @__PURE__ */ e(
697
- m,
378
+ u,
698
379
  {
699
- color: t === "primary" || t === "danger" ? "$white" : "$color",
380
+ color: c.color || (t === "primary" || t === "danger" ? "$white" : "$color"),
700
381
  fontWeight: "600",
701
382
  fontSize: n === "sm" ? "$xs" : "$sm",
702
383
  pointerEvents: "none",
@@ -704,9 +385,8 @@ function x({
704
385
  }
705
386
  )
706
387
  }
707
- );
708
- }
709
- const tt = w(v, {
388
+ )
389
+ ), Ae = S(C, {
710
390
  name: "Card",
711
391
  flexDirection: "column",
712
392
  backgroundColor: "$background",
@@ -742,488 +422,592 @@ const tt = w(v, {
742
422
  elevated: !0,
743
423
  padded: "md"
744
424
  }
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",
425
+ }), R = Ae, Re = S(
426
+ "input",
427
+ {
428
+ name: "Input",
764
429
  backgroundColor: "$backgroundSecondary",
430
+ borderRadius: "$round",
431
+ borderWidth: 1,
432
+ borderStyle: "solid",
433
+ borderColor: "$borderColor",
434
+ paddingLeft: "$md",
435
+ paddingRight: "$md",
436
+ fontSize: "$sm",
437
+ color: "$color",
438
+ width: "100%",
765
439
  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" }
440
+ // @ts-ignore
441
+ cursor: "text",
442
+ // @ts-ignore
443
+ userSelect: "text",
444
+ focusStyle: {
445
+ borderColor: "$primary",
446
+ backgroundColor: "$backgroundSecondary",
447
+ outlineWidth: 0,
448
+ shadowColor: "$primary",
449
+ shadowRadius: 15,
450
+ shadowOpacity: 0.3,
451
+ borderWidth: 2
780
452
  },
781
- error: {
782
- true: {
783
- borderColor: "$error",
784
- focusStyle: {
785
- borderColor: "$error"
453
+ hoverStyle: {
454
+ borderColor: "$primary",
455
+ backgroundColor: "$background"
456
+ },
457
+ variants: {
458
+ size: {
459
+ sm: { height: 32, fontSize: "$xs" },
460
+ md: { height: 40, fontSize: "$sm" },
461
+ lg: { height: 52, fontSize: "$md" }
462
+ },
463
+ error: {
464
+ true: {
465
+ borderColor: "$error",
466
+ focusStyle: {
467
+ borderColor: "$error"
468
+ }
786
469
  }
787
470
  }
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
471
  },
806
- ...i
472
+ defaultVariants: {
473
+ size: "md"
474
+ }
807
475
  }
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,
476
+ ), E = B.forwardRef(
477
+ ({ onChange: r, onChangeText: t, value: n, ...i }, d) => /* @__PURE__ */ e(
478
+ Re,
857
479
  {
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,
480
+ ref: d,
481
+ ...n !== void 0 ? { value: n } : {},
482
+ onChange: (c) => {
483
+ r == null || r(c), t == null || t(c.target.value);
484
+ },
485
+ ...i
486
+ }
487
+ )
488
+ );
489
+ E.displayName = "Input";
490
+ const He = B.forwardRef(
491
+ ({ value: r, onChange: t, onChangeText: n, type: i = "date", placeholder: d, ...s }, c) => {
492
+ const [h, m] = v(!1), [P, I] = v(!1), [A, W] = v(!1), M = te(null), H = (o) => {
493
+ const a = (ye) => ye.toString().padStart(2, "0"), g = o.getFullYear(), $ = a(o.getMonth() + 1), K = a(o.getDate()), be = a(o.getHours()), pe = a(o.getMinutes()), $e = a(o.getSeconds());
494
+ return i === "date" ? `${g}-${$}-${K}` : `${g}-${$}-${K}T${be}:${pe}:${$e}`;
495
+ }, f = U(() => {
496
+ if (!r) return /* @__PURE__ */ new Date();
497
+ const o = new Date(r);
498
+ return isNaN(o.getTime()) ? /* @__PURE__ */ new Date() : o;
499
+ }, [r]), [p, z] = v(new Date(f)), w = () => {
500
+ m(!0);
501
+ };
502
+ k(() => {
503
+ z(new Date(f));
504
+ }, [f]), k(() => {
505
+ const o = (a) => {
506
+ M.current && !M.current.contains(a.target) && (m(!1), I(!1), W(!1));
507
+ };
508
+ return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
509
+ }, []);
510
+ const F = (o) => {
511
+ const a = H(o);
512
+ t == null || t(a), n == null || n(a);
513
+ }, le = (o) => {
514
+ const a = new Date(p);
515
+ a.setDate(o), a.setHours(f.getHours()), a.setMinutes(f.getMinutes()), a.setSeconds(f.getSeconds()), F(a), i === "date" && m(!1);
516
+ }, T = (o, a, g = 0) => {
517
+ const $ = new Date(f);
518
+ $.setHours($.getHours() + o), $.setMinutes($.getMinutes() + a), $.setSeconds($.getSeconds() + g), F($);
519
+ }, ce = () => {
520
+ const o = new Date(f), a = o.getHours();
521
+ o.setHours(a >= 12 ? a - 12 : a + 12), F(o);
522
+ }, ue = () => {
523
+ const o = /* @__PURE__ */ new Date();
524
+ F(o), z(new Date(o));
525
+ }, ge = (o, a) => new Date(a, o + 1, 0).getDate(), he = (o, a) => new Date(a, o, 1).getDay(), me = U(() => {
526
+ const o = ge(p.getMonth(), p.getFullYear()), a = he(p.getMonth(), p.getFullYear()), g = [];
527
+ for (let $ = 0; $ < a; $++) g.push(null);
528
+ for (let $ = 1; $ <= o; $++) g.push($);
529
+ return g;
530
+ }, [p]), fe = [
531
+ "January",
532
+ "February",
533
+ "March",
534
+ "April",
535
+ "May",
536
+ "June",
537
+ "July",
538
+ "August",
539
+ "September",
540
+ "October",
541
+ "November",
542
+ "December"
543
+ ];
544
+ return /* @__PURE__ */ l(b, { ref: M, position: "relative", width: "100%", children: [
545
+ /* @__PURE__ */ l(x, { alignItems: "center", position: "relative", children: [
546
+ /* @__PURE__ */ e(
547
+ E,
893
548
  {
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,
549
+ ref: c,
550
+ value: r,
551
+ readOnly: !0,
552
+ placeholder: d || (i === "date" ? "Select Date..." : "Select Date & Time..."),
553
+ paddingRight: 40,
554
+ ...s,
555
+ onPressIn: (o) => {
556
+ var a;
557
+ (a = s.onPressIn) == null || a.call(s, o), w();
558
+ },
559
+ onClick: (o) => {
560
+ var a;
561
+ (a = s.onClick) == null || a.call(s, o), w();
562
+ },
563
+ onFocus: (o) => {
564
+ var a;
565
+ (a = s.onFocus) == null || a.call(s, o), w();
566
+ },
567
+ cursor: "pointer"
568
+ }
569
+ ),
570
+ /* @__PURE__ */ e(x, { position: "absolute", right: 12, pointerEvents: "none", opacity: 0.6, children: /* @__PURE__ */ l(
571
+ "svg",
572
+ {
573
+ viewBox: "0 0 24 24",
574
+ width: "18",
575
+ height: "18",
576
+ fill: "none",
577
+ stroke: "currentColor",
578
+ strokeWidth: "2",
579
+ strokeLinecap: "round",
580
+ strokeLinejoin: "round",
581
+ style: { color: "var(--primary)" },
905
582
  children: [
906
- /* @__PURE__ */ l($, { justifyContent: "space-between", alignItems: "center", marginBottom: "$3", children: [
907
- /* @__PURE__ */ e(
908
- x,
583
+ /* @__PURE__ */ e("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
584
+ /* @__PURE__ */ e("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
585
+ /* @__PURE__ */ e("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
586
+ /* @__PURE__ */ e("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
587
+ ]
588
+ }
589
+ ) })
590
+ ] }),
591
+ h && /* @__PURE__ */ l(
592
+ R,
593
+ {
594
+ elevated: !0,
595
+ position: "absolute",
596
+ top: "100%",
597
+ left: 0,
598
+ marginTop: "$2",
599
+ zIndex: 1e3,
600
+ width: 320,
601
+ padding: "$3",
602
+ backgroundColor: "$background",
603
+ borderColor: "$borderColor",
604
+ borderWidth: 1,
605
+ children: [
606
+ /* @__PURE__ */ l(x, { justifyContent: "space-between", alignItems: "center", marginBottom: "$3", children: [
607
+ /* @__PURE__ */ e(
608
+ y,
609
+ {
610
+ size: "sm",
611
+ borderRadius: 100,
612
+ width: 28,
613
+ height: 28,
614
+ padding: 0,
615
+ onPress: () => z(new Date(p.setMonth(p.getMonth() - 1))),
616
+ children: /* @__PURE__ */ e(u, { fontSize: 12, position: "relative", left: -1, children: "<" })
617
+ }
618
+ ),
619
+ /* @__PURE__ */ l(x, { alignItems: "center", cursor: "pointer", children: [
620
+ /* @__PURE__ */ e(b, { onDoubleClick: () => W(!0), children: A ? /* @__PURE__ */ e(
621
+ E,
909
622
  {
910
623
  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
- }
624
+ autoFocus: !0,
625
+ width: 100,
626
+ style: { textAlign: "center" },
627
+ paddingHorizontal: 4,
628
+ defaultValue: p.getMonth() + 1,
629
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
630
+ onBlur: (o) => {
631
+ const a = parseInt(o.target.value);
632
+ !isNaN(a) && a > 0 && a <= 12 && z(new Date(p.setMonth(a - 1))), W(!1);
951
633
  }
952
- ) : /* @__PURE__ */ e(m, { fontWeight: "700", color: "$primary", children: b.getFullYear() }) })
953
- ] }),
954
- /* @__PURE__ */ e(
955
- x,
634
+ }
635
+ ) : /* @__PURE__ */ e(u, { fontSize: 12, fontWeight: "700", color: "$primary", children: fe[p.getMonth()] }) }),
636
+ /* @__PURE__ */ e(C, { width: 12 }),
637
+ /* @__PURE__ */ e(b, { onDoubleClick: () => I(!0), children: P ? /* @__PURE__ */ e(
638
+ E,
956
639
  {
957
640
  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: ">" })
641
+ autoFocus: !0,
642
+ width: 60,
643
+ style: { textAlign: "center" },
644
+ paddingHorizontal: 4,
645
+ defaultValue: p.getFullYear().toString(),
646
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
647
+ onBlur: (o) => {
648
+ const a = parseInt(o.target.value);
649
+ isNaN(a) || z(new Date(p.setFullYear(a))), I(!1);
650
+ }
964
651
  }
965
- )
652
+ ) : /* @__PURE__ */ e(u, { fontWeight: "700", color: "$primary", children: p.getFullYear() }) })
966
653
  ] }),
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
- })
988
- ] }),
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,
654
+ /* @__PURE__ */ e(
655
+ y,
656
+ {
657
+ size: "sm",
658
+ borderRadius: 100,
659
+ width: 28,
660
+ height: 28,
661
+ padding: 0,
662
+ onPress: () => z(new Date(p.setMonth(p.getMonth() + 1))),
663
+ children: /* @__PURE__ */ e(u, { fontSize: 12, position: "relative", left: 1, children: ">" })
664
+ }
665
+ )
666
+ ] }),
667
+ /* @__PURE__ */ l(x, { flexWrap: "wrap", gap: 2, marginBottom: "$2", children: [
668
+ /* @__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)) }),
669
+ me.map((o, a) => {
670
+ const g = o === f.getDate() && p.getMonth() === f.getMonth() && p.getFullYear() === f.getFullYear();
671
+ return /* @__PURE__ */ e(
672
+ J,
673
+ {
674
+ width: 36,
675
+ height: 36,
676
+ alignItems: "center",
677
+ justifyContent: "center",
678
+ borderRadius: "$2",
679
+ cursor: o ? "pointer" : "default",
680
+ backgroundColor: g ? "$primary" : "transparent",
681
+ hoverStyle: o ? {
682
+ backgroundColor: g ? "$primary" : "$backgroundHover"
683
+ } : {},
684
+ onPress: () => o && le(o),
685
+ children: /* @__PURE__ */ e(
686
+ u,
995
687
  {
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);
688
+ color: g ? "#fff" : "$color",
689
+ fontSize: 12,
690
+ fontWeight: g ? "700" : "400",
691
+ children: o || ""
692
+ }
693
+ )
694
+ },
695
+ a
696
+ );
697
+ })
698
+ ] }),
699
+ i === "datetime-local" && /* @__PURE__ */ l(
700
+ b,
701
+ {
702
+ marginTop: "$2",
703
+ paddingTop: "$3",
704
+ borderTopWidth: 1,
705
+ borderColor: "$borderColor",
706
+ gap: "$2",
707
+ children: [
708
+ /* @__PURE__ */ l(x, { justifyContent: "space-around", alignItems: "center", children: [
709
+ /* @__PURE__ */ l(b, { alignItems: "center", gap: "$1", children: [
710
+ /* @__PURE__ */ e(
711
+ y,
712
+ {
713
+ size: "sm",
714
+ variant: "ghost",
715
+ padding: 0,
716
+ onPress: () => T(1, 0, 0),
717
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "+" })
718
+ }
719
+ ),
720
+ /* @__PURE__ */ e(
721
+ E,
722
+ {
723
+ size: "sm",
724
+ width: 52,
725
+ style: { textAlign: "center" },
726
+ paddingHorizontal: 4,
727
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
728
+ value: (f.getHours() % 12 || 12).toString(),
729
+ onChangeText: (o) => {
730
+ let a = parseInt(o);
731
+ if (!isNaN(a)) {
732
+ a === 12 && (a = 0);
733
+ const g = new Date(f), $ = g.getHours() >= 12;
734
+ g.setHours($ ? a + 12 : a), F(g);
735
+ }
1008
736
  }
1009
737
  }
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);
738
+ ),
739
+ /* @__PURE__ */ e(
740
+ y,
741
+ {
742
+ size: "sm",
743
+ variant: "ghost",
744
+ padding: 0,
745
+ onPress: () => T(-1, 0, 0),
746
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "-" })
747
+ }
748
+ )
749
+ ] }),
750
+ /* @__PURE__ */ e(u, { fontSize: 16, color: "muted", marginTop: 10, position: "relative", top: -2, children: ":" }),
751
+ /* @__PURE__ */ l(b, { alignItems: "center", gap: "$1", children: [
752
+ /* @__PURE__ */ e(
753
+ y,
754
+ {
755
+ size: "sm",
756
+ variant: "ghost",
757
+ padding: 0,
758
+ onPress: () => T(0, 5, 0),
759
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "+" })
760
+ }
761
+ ),
762
+ /* @__PURE__ */ e(
763
+ E,
764
+ {
765
+ size: "sm",
766
+ width: 52,
767
+ style: { textAlign: "center" },
768
+ paddingHorizontal: 4,
769
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
770
+ value: f.getMinutes().toString().padStart(2, "0"),
771
+ onChangeText: (o) => {
772
+ const a = parseInt(o);
773
+ if (!isNaN(a) && a >= 0 && a < 60) {
774
+ const g = new Date(f);
775
+ g.setMinutes(a), F(g);
776
+ }
1031
777
  }
1032
778
  }
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);
779
+ ),
780
+ /* @__PURE__ */ e(
781
+ y,
782
+ {
783
+ size: "sm",
784
+ variant: "ghost",
785
+ padding: 0,
786
+ onPress: () => T(0, -5, 0),
787
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "-" })
788
+ }
789
+ )
790
+ ] }),
791
+ /* @__PURE__ */ e(u, { fontSize: 16, color: "muted", marginTop: 10, position: "relative", top: -2, children: ":" }),
792
+ /* @__PURE__ */ l(b, { alignItems: "center", gap: "$1", children: [
793
+ /* @__PURE__ */ e(
794
+ y,
795
+ {
796
+ size: "sm",
797
+ variant: "ghost",
798
+ padding: 0,
799
+ onPress: () => T(0, 0, 10),
800
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "+" })
801
+ }
802
+ ),
803
+ /* @__PURE__ */ e(
804
+ E,
805
+ {
806
+ size: "sm",
807
+ width: 52,
808
+ style: { textAlign: "center" },
809
+ paddingHorizontal: 4,
810
+ onKeyDown: (o) => o.key === "Enter" && o.currentTarget.blur(),
811
+ value: f.getSeconds().toString().padStart(2, "0"),
812
+ onChangeText: (o) => {
813
+ const a = parseInt(o);
814
+ if (!isNaN(a) && a >= 0 && a < 60) {
815
+ const g = new Date(f);
816
+ g.setSeconds(a), F(g);
817
+ }
1054
818
  }
1055
819
  }
820
+ ),
821
+ /* @__PURE__ */ e(
822
+ y,
823
+ {
824
+ size: "sm",
825
+ variant: "ghost",
826
+ padding: 0,
827
+ onPress: () => T(0, 0, -10),
828
+ children: /* @__PURE__ */ e(u, { fontSize: 16, children: "-" })
829
+ }
830
+ )
831
+ ] }),
832
+ /* @__PURE__ */ e(b, { justifyContent: "center", marginTop: 10, position: "relative", top: -2, children: /* @__PURE__ */ e(
833
+ y,
834
+ {
835
+ size: "sm",
836
+ variant: "primary",
837
+ paddingHorizontal: "$2",
838
+ onPress: ce,
839
+ borderRadius: "$2",
840
+ minWidth: 46,
841
+ backgroundColor: "$primary",
842
+ children: /* @__PURE__ */ e(u, { fontSize: 10, fontWeight: "900", color: "#fff", children: f.getHours() >= 12 ? "PM" : "AM" })
1056
843
  }
1057
- ),
1058
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", padding: 0, onPress: () => I(0, 0, -10), children: /* @__PURE__ */ e(m, { fontSize: 16, children: "-" }) })
844
+ ) })
1059
845
  ] }),
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
- ]
1099
- }
1100
- )
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"
846
+ /* @__PURE__ */ l(x, { marginTop: "$1", children: [
847
+ /* @__PURE__ */ e(y, { variant: "default", size: "sm", onPress: ue, flex: 1, children: "Now" }),
848
+ /* @__PURE__ */ e(C, { width: 8 }),
849
+ /* @__PURE__ */ e(y, { variant: "primary", size: "sm", onPress: () => m(!1), flex: 2, children: "Apply Selection" })
850
+ ] })
851
+ ]
852
+ }
853
+ )
854
+ ]
1144
855
  }
1145
- }
1146
- }
1147
- },
1148
- defaultVariants: {
1149
- size: "md"
856
+ )
857
+ ] });
1150
858
  }
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
- ]
859
+ );
860
+ He.displayName = "DatePicker";
861
+ function Ne({ trigger: r, content: t, placement: n = "bottom-start" }) {
862
+ const [i, d] = v(!1), s = te(null);
863
+ return k(() => {
864
+ if (typeof document > "u") return;
865
+ const h = (m) => {
866
+ s.current && !s.current.contains(m.target) && d(!1);
867
+ };
868
+ return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
869
+ }, []), /* @__PURE__ */ l(b, { position: "relative", ref: s, children: [
870
+ /* @__PURE__ */ e(x, { onPress: () => d(!i), style: { cursor: "pointer" }, children: r }),
871
+ i && /* @__PURE__ */ e(
872
+ Y,
873
+ {
874
+ position: "absolute",
875
+ zIndex: 1e3,
876
+ ...(() => {
877
+ switch (n) {
878
+ case "bottom-end":
879
+ return { top: "100%", right: 0, marginTop: 4 };
880
+ case "right-start":
881
+ return { top: 0, left: "100%", marginLeft: 4 };
882
+ case "right-end":
883
+ return { bottom: 0, left: "100%", marginLeft: 4 };
884
+ case "top-start":
885
+ return { bottom: "100%", left: 0, marginBottom: 4 };
886
+ case "top-end":
887
+ return { bottom: "100%", right: 0, marginBottom: 4 };
888
+ case "bottom-start":
889
+ default:
890
+ return { top: "100%", left: 0, marginTop: 4 };
1189
891
  }
1190
- ),
1191
- /* @__PURE__ */ e(
1192
- y,
892
+ })(),
893
+ shadowColor: "$shadowColor",
894
+ shadowOffset: { width: 0, height: 4 },
895
+ shadowOpacity: 0.1,
896
+ shadowRadius: 10,
897
+ children: /* @__PURE__ */ e(
898
+ R,
1193
899
  {
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
900
+ elevated: !0,
901
+ padding: "$sm",
902
+ minWidth: 200,
903
+ borderWidth: 1,
904
+ borderColor: "$borderColor",
905
+ children: t
1208
906
  }
1209
907
  )
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 = {
908
+ }
909
+ )
910
+ ] });
911
+ }
912
+ const ie = B.forwardRef(
913
+ ({
914
+ error: r,
915
+ size: t = "md",
916
+ value: n,
917
+ onChange: i,
918
+ onValueChange: d,
919
+ options: s,
920
+ placeholder: c,
921
+ disabled: h,
922
+ name: m,
923
+ onBlur: P,
924
+ onFocus: I,
925
+ ...A
926
+ }, W) => {
927
+ const M = s.find((w) => w.value === n), H = M ? M.label : c || "Select an option...", f = (w) => {
928
+ d == null || d(w), i && i({
929
+ target: { value: w, name: m || "" }
930
+ });
931
+ }, p = /* @__PURE__ */ l(
932
+ y,
933
+ {
934
+ ref: W,
935
+ disabled: h,
936
+ size: t,
937
+ variant: r ? "ghost" : "default",
938
+ width: "100%",
939
+ justifyContent: "space-between",
940
+ borderWidth: 1,
941
+ borderColor: r ? "$error" : "$borderColor",
942
+ children: [
943
+ /* @__PURE__ */ e(
944
+ L,
945
+ {
946
+ fontSize: t === "sm" ? "$xs" : "$sm",
947
+ color: M ? "$color" : "$colorMuted",
948
+ children: H
949
+ }
950
+ ),
951
+ /* @__PURE__ */ e(
952
+ b,
953
+ {
954
+ width: 0,
955
+ height: 0,
956
+ borderLeftWidth: 5,
957
+ borderLeftColor: "transparent",
958
+ borderRightWidth: 5,
959
+ borderRightColor: "transparent",
960
+ borderTopWidth: 6,
961
+ borderTopColor: "$colorMuted",
962
+ opacity: 0.6
963
+ }
964
+ )
965
+ ]
966
+ }
967
+ ), z = /* @__PURE__ */ l(b, { gap: "$xs", children: [
968
+ c && /* @__PURE__ */ e(
969
+ y,
970
+ {
971
+ variant: "ghost",
972
+ size: "sm",
973
+ justifyContent: "flex-start",
974
+ onPress: () => f(""),
975
+ children: /* @__PURE__ */ e(L, { fontSize: "$sm", color: "$colorMuted", children: c })
976
+ }
977
+ ),
978
+ s.map((w) => /* @__PURE__ */ e(
979
+ y,
980
+ {
981
+ variant: "ghost",
982
+ size: "sm",
983
+ justifyContent: "flex-start",
984
+ onPress: () => f(w.value),
985
+ backgroundColor: w.value === n ? "$primary1" : "transparent",
986
+ children: /* @__PURE__ */ e(L, { fontSize: "$sm", children: w.label })
987
+ },
988
+ w.value
989
+ ))
990
+ ] });
991
+ return /* @__PURE__ */ e(
992
+ b,
993
+ {
994
+ position: "relative",
995
+ width: A.width || "100%",
996
+ minWidth: A.minWidth,
997
+ pointerEvents: "box-none",
998
+ children: /* @__PURE__ */ e(Ne, { trigger: p, content: z, placement: "bottom-start" })
999
+ }
1000
+ );
1001
+ }
1002
+ );
1003
+ ie.displayName = "Select";
1004
+ const Le = {
1221
1005
  success: "✓",
1222
1006
  error: "✕",
1223
1007
  warning: "⚠",
1224
1008
  info: "ℹ"
1225
1009
  };
1226
- function st({
1010
+ function Oe({
1227
1011
  message: r,
1228
1012
  variant: t = "info",
1229
1013
  duration: n = 4e3,
@@ -1235,83 +1019,80 @@ function st({
1235
1019
  return () => clearTimeout(d);
1236
1020
  }
1237
1021
  }, [n, i]), /* @__PURE__ */ e(
1238
- "div",
1022
+ b,
1239
1023
  {
1240
1024
  className: `toast toast-${t}`,
1241
1025
  role: "alert",
1242
1026
  "aria-live": "assertive",
1243
1027
  "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
- )
1028
+ borderLeftWidth: 3,
1029
+ borderLeftColor: `$${t === "info" ? "primary" : t}`,
1030
+ backgroundColor: "$background",
1031
+ padding: "$sm",
1032
+ borderRadius: "$round",
1033
+ shadowColor: "$shadowColor",
1034
+ shadowRadius: 10,
1035
+ shadowOffset: { width: 0, height: 4 },
1036
+ children: /* @__PURE__ */ l(x, { alignItems: "center", gap: "$sm", children: [
1037
+ /* @__PURE__ */ e(u, { fontWeight: "600", children: Le[t] }),
1038
+ /* @__PURE__ */ e(u, { flex: 1, children: r }),
1039
+ i && /* @__PURE__ */ e(y, { variant: "ghost", size: "sm", onPress: i, "aria-label": "Dismiss notification", children: "✕" })
1040
+ ] })
1276
1041
  }
1277
1042
  );
1278
1043
  }
1279
- function kt({
1280
- toasts: r,
1281
- onDismiss: t
1282
- }) {
1044
+ function St({ toasts: r, onDismiss: t }) {
1283
1045
  return /* @__PURE__ */ e(
1284
- "div",
1046
+ b,
1285
1047
  {
1286
1048
  "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))
1049
+ position: "fixed",
1050
+ bottom: "$lg",
1051
+ right: "$lg",
1052
+ zIndex: 60,
1053
+ gap: "$sm",
1054
+ pointerEvents: "none",
1055
+ children: r.map((n) => /* @__PURE__ */ e(b, { pointerEvents: "auto", children: /* @__PURE__ */ e(Oe, { ...n, onDismiss: () => t(n.id) }) }, n.id))
1298
1056
  }
1299
1057
  );
1300
1058
  }
1301
- const lt = {
1059
+ const ae = q(null), je = ({ children: r }) => {
1060
+ const [t, n] = v(/* @__PURE__ */ new Map()), i = (s, c) => {
1061
+ n((h) => {
1062
+ const m = new Map(h);
1063
+ return m.set(s, c), m;
1064
+ });
1065
+ }, d = (s) => {
1066
+ n((c) => {
1067
+ const h = new Map(c);
1068
+ return h.delete(s), h;
1069
+ });
1070
+ };
1071
+ return /* @__PURE__ */ l(ae.Provider, { value: { register: i, unregister: d }, children: [
1072
+ r,
1073
+ /* @__PURE__ */ e(_e, { portals: t })
1074
+ ] });
1075
+ }, _e = ({ portals: r }) => typeof document < "u" ? null : /* @__PURE__ */ e(xe, { children: Array.from(r.entries()).map(([t, n]) => /* @__PURE__ */ e(B.Fragment, { children: n }, t)) }), se = ({ children: r }) => {
1076
+ const t = ee(ae), [n] = v(() => Math.random().toString(36).substr(2, 9));
1077
+ if (k(() => {
1078
+ if (!(typeof document < "u" || !t))
1079
+ return () => t.unregister(n);
1080
+ }, [t, n]), k(() => {
1081
+ typeof document > "u" && t && t.register(n, r);
1082
+ }), typeof document < "u") {
1083
+ let i = document.getElementById("portal-root");
1084
+ i || (i = document.createElement("div"), i.id = "portal-root", document.body.appendChild(i));
1085
+ const d = document.documentElement.className;
1086
+ return i.className !== d && (i.className = d), ve.createPortal(r, i);
1087
+ }
1088
+ return null;
1089
+ }, Ye = {
1302
1090
  sm: 400,
1303
1091
  md: 600,
1304
1092
  lg: 900,
1305
1093
  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
- _,
1094
+ }, Ct = ({ isOpen: r, onClose: t, title: n, footer: i, size: d = "md", children: s }) => r ? /* @__PURE__ */ e(se, { children: /* @__PURE__ */ l(
1095
+ Y,
1315
1096
  {
1316
1097
  position: "absolute",
1317
1098
  top: 0,
@@ -1325,7 +1106,7 @@ const lt = {
1325
1106
  justifyContent: "center",
1326
1107
  children: [
1327
1108
  /* @__PURE__ */ e(
1328
- y,
1109
+ b,
1329
1110
  {
1330
1111
  position: "absolute",
1331
1112
  top: 0,
@@ -1338,9 +1119,9 @@ const lt = {
1338
1119
  }
1339
1120
  ),
1340
1121
  /* @__PURE__ */ l(
1341
- B,
1122
+ R,
1342
1123
  {
1343
- width: lt[d],
1124
+ width: Ye[d],
1344
1125
  maxWidth: "95%",
1345
1126
  maxHeight: "90vh",
1346
1127
  backgroundColor: "$background",
@@ -1353,7 +1134,7 @@ const lt = {
1353
1134
  zIndex: 100,
1354
1135
  children: [
1355
1136
  /* @__PURE__ */ l(
1356
- $,
1137
+ x,
1357
1138
  {
1358
1139
  padding: "$4",
1359
1140
  borderBottomWidth: 1,
@@ -1362,23 +1143,14 @@ const lt = {
1362
1143
  alignItems: "center",
1363
1144
  backgroundColor: "$backgroundSecondary",
1364
1145
  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: "✕" }) })
1146
+ /* @__PURE__ */ e(u, { fontWeight: "700", size: "lg", children: n }),
1147
+ /* @__PURE__ */ e(y, { size: "sm", variant: "ghost", onPress: t, padding: "$2", children: /* @__PURE__ */ e(u, { children: "✕" }) })
1367
1148
  ]
1368
1149
  }
1369
1150
  ),
1370
- /* @__PURE__ */ e(
1371
- y,
1372
- {
1373
- flex: 1,
1374
- overflow: "scroll",
1375
- minHeight: 250,
1376
- backgroundColor: "$background",
1377
- children: s
1378
- }
1379
- ),
1151
+ /* @__PURE__ */ e(b, { flex: 1, overflow: "scroll", minHeight: 250, backgroundColor: "$background", children: s }),
1380
1152
  i && /* @__PURE__ */ e(
1381
- $,
1153
+ x,
1382
1154
  {
1383
1155
  padding: "$4",
1384
1156
  borderTopWidth: 1,
@@ -1395,31 +1167,9 @@ const lt = {
1395
1167
  ]
1396
1168
  }
1397
1169
  ) }) : 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
- _,
1170
+ function vt({ isOpen: r, onClose: t, title: n, width: i = 420, children: d, footer: s }) {
1171
+ return r ? /* @__PURE__ */ e(se, { children: /* @__PURE__ */ l(
1172
+ Y,
1423
1173
  {
1424
1174
  position: "absolute",
1425
1175
  top: 0,
@@ -1431,7 +1181,7 @@ function Ft({
1431
1181
  zIndex: 99998,
1432
1182
  children: [
1433
1183
  /* @__PURE__ */ e(
1434
- y,
1184
+ b,
1435
1185
  {
1436
1186
  position: "absolute",
1437
1187
  top: 0,
@@ -1444,9 +1194,23 @@ function Ft({
1444
1194
  }
1445
1195
  ),
1446
1196
  /* @__PURE__ */ l(
1447
- B,
1197
+ R,
1448
1198
  {
1449
- style: c,
1199
+ style: {
1200
+ position: "fixed",
1201
+ top: 0,
1202
+ right: 0,
1203
+ bottom: 0,
1204
+ width: i,
1205
+ maxWidth: "95vw",
1206
+ zIndex: 100,
1207
+ display: "flex",
1208
+ flexDirection: "column",
1209
+ boxShadow: "-8px 0 32px rgba(0,0,0,0.18)",
1210
+ transform: "translateX(0)",
1211
+ // Drawer unmounts completely when closed, making the ternary dead code
1212
+ transition: "transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)"
1213
+ },
1450
1214
  backgroundColor: "$background",
1451
1215
  borderRadius: 0,
1452
1216
  borderLeftWidth: 1,
@@ -1456,7 +1220,7 @@ function Ft({
1456
1220
  zIndex: 100,
1457
1221
  children: [
1458
1222
  /* @__PURE__ */ l(
1459
- $,
1223
+ x,
1460
1224
  {
1461
1225
  padding: "$md",
1462
1226
  borderBottomWidth: 1,
@@ -1465,22 +1229,14 @@ function Ft({
1465
1229
  alignItems: "center",
1466
1230
  backgroundColor: "$backgroundSecondary",
1467
1231
  children: [
1468
- /* @__PURE__ */ e(m, { fontWeight: "700", size: "$md", children: n }),
1469
- /* @__PURE__ */ e(x, { size: "sm", variant: "ghost", onPress: t, children: "✕" })
1232
+ /* @__PURE__ */ e(u, { fontWeight: "700", size: "$md", children: n }),
1233
+ /* @__PURE__ */ e(y, { size: "sm", variant: "ghost", onPress: t, children: "✕" })
1470
1234
  ]
1471
1235
  }
1472
1236
  ),
1473
- /* @__PURE__ */ e(
1474
- y,
1475
- {
1476
- flex: 1,
1477
- padding: "$md",
1478
- style: { overflowY: "auto" },
1479
- children: d
1480
- }
1481
- ),
1237
+ /* @__PURE__ */ e(b, { flex: 1, padding: "$md", style: { overflowY: "auto" }, children: d }),
1482
1238
  s && /* @__PURE__ */ e(
1483
- $,
1239
+ x,
1484
1240
  {
1485
1241
  padding: "$md",
1486
1242
  borderTopWidth: 1,
@@ -1496,22 +1252,29 @@ function Ft({
1496
1252
  )
1497
1253
  ]
1498
1254
  }
1499
- ) });
1255
+ ) }) : null;
1500
1256
  }
1501
- const ct = {
1257
+ const Ve = {
1502
1258
  $sm: 24,
1503
1259
  $md: 32,
1504
1260
  $lg: 40,
1505
1261
  $xl: 48
1506
1262
  };
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;
1263
+ function kt({
1264
+ src: r,
1265
+ fallback: t,
1266
+ size: n = "$md",
1267
+ circular: i = !0,
1268
+ borderWidth: d,
1269
+ borderColor: s
1270
+ }) {
1271
+ const [c, h] = v(!1), m = typeof n == "number" ? n : Ve[n] || 32;
1509
1272
  return /* @__PURE__ */ e(
1510
- y,
1273
+ b,
1511
1274
  {
1512
- width: h,
1513
- height: h,
1514
- borderRadius: i ? h / 2 : "$sm",
1275
+ width: m,
1276
+ height: m,
1277
+ borderRadius: i ? m / 2 : "$sm",
1515
1278
  backgroundColor: "$bgTertiary",
1516
1279
  alignItems: "center",
1517
1280
  justifyContent: "center",
@@ -1519,71 +1282,20 @@ function Dt({ src: r, fallback: t, size: n = "$md", circular: i = !0, borderWidt
1519
1282
  borderWidth: d,
1520
1283
  borderColor: s,
1521
1284
  children: r && !c ? /* @__PURE__ */ e(
1522
- Se,
1285
+ ke,
1523
1286
  {
1524
- source: { uri: r, width: h, height: h },
1287
+ source: { uri: r, width: m, height: m },
1525
1288
  width: "100%",
1526
1289
  height: "100%",
1527
- onError: () => u(!0)
1290
+ onError: () => h(!0)
1528
1291
  }
1529
- ) : typeof t == "string" ? /* @__PURE__ */ e(m, { color: "$colorMuted", size: "$sm", fontWeight: "600", children: t.slice(0, 2).toUpperCase() }) : t
1292
+ ) : typeof t == "string" ? /* @__PURE__ */ e(u, { color: "$colorMuted", size: "$sm", fontWeight: "600", children: t.slice(0, 2).toUpperCase() }) : t
1530
1293
  }
1531
1294
  );
1532
1295
  }
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 }) {
1296
+ function zt({ vertical: r }) {
1585
1297
  return /* @__PURE__ */ e(
1586
- y,
1298
+ b,
1587
1299
  {
1588
1300
  width: r ? 1 : "100%",
1589
1301
  height: r ? "100%" : 1,
@@ -1591,48 +1303,215 @@ function Et({ vertical: r }) {
1591
1303
  }
1592
1304
  );
1593
1305
  }
1594
- function gt(r) {
1306
+ function Ke(r) {
1595
1307
  return r.replace(/[-_](.)/g, (t, n) => n.toUpperCase()).replace(/^(.)/, (t) => t.toUpperCase());
1596
1308
  }
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;
1309
+ function Ue({ name: r, size: t, color: n, strokeWidth: i, ...d }) {
1310
+ const s = Ke(r), c = s in N ? N[s] : N.Box;
1599
1311
  return /* @__PURE__ */ e(c, { size: t, color: n, strokeWidth: i, ...d });
1600
1312
  }
1313
+ function Ft() {
1314
+ const { theme: r, toggleTheme: t } = ne();
1315
+ return /* @__PURE__ */ e(
1316
+ y,
1317
+ {
1318
+ variant: "ghost",
1319
+ onPress: t,
1320
+ "aria-label": `Switch to ${r === "light" ? "dark" : "light"} mode`,
1321
+ title: `Current theme: ${r}`,
1322
+ children: /* @__PURE__ */ e(Ue, { name: r === "light" ? "moon" : "sun", size: 20 })
1323
+ }
1324
+ );
1325
+ }
1326
+ const Xe = { 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" } }, Je = { 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 = {
1327
+ brand: Xe,
1328
+ semantic: Je
1329
+ }, Ze = { sans: "'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif", mono: "'JetBrains Mono', 'Fira Code', monospace" }, Ge = { 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 }, qe = { tight: 1.3, normal: 1.5, relaxed: 1.6 }, V = {
1330
+ fontFamily: Ze,
1331
+ fontSize: Ge,
1332
+ fontWeight: Qe,
1333
+ lineHeight: qe
1334
+ }, et = { xs: "0.25rem", sm: "0.5rem", md: "1rem", lg: "1.5rem", xl: "2rem", "2xl": "3rem" }, tt = { sm: "4px", md: "6px", lg: "8px", xl: "12px", full: "9999px" }, rt = { 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 = {
1335
+ spacing: et,
1336
+ borderRadius: tt,
1337
+ shadow: rt
1338
+ };
1339
+ function ot() {
1340
+ return {
1341
+ primary: j.semantic.light.primary,
1342
+ secondary: j.semantic.light.secondary,
1343
+ white: "#ffffff",
1344
+ black: "#000000",
1345
+ transparent: "transparent"
1346
+ };
1347
+ }
1348
+ function nt() {
1349
+ const r = {};
1350
+ return Object.entries(V.fontSize).forEach(([t, n]) => {
1351
+ const i = parseFloat(n.toString());
1352
+ r[t] = isNaN(i) ? 16 : i * 16;
1353
+ }), r;
1354
+ }
1355
+ function Q(r) {
1356
+ const t = j.semantic[r];
1357
+ return {
1358
+ background: t.bg,
1359
+ backgroundSecondary: t.bgSecondary,
1360
+ backgroundTertiary: t.bgTertiary,
1361
+ color: t.text,
1362
+ colorSecondary: t.textSecondary || t.secondary,
1363
+ colorMuted: t.textMuted || "#94a3b8",
1364
+ borderColor: t.border,
1365
+ borderColorMuted: t.borderColorMuted || t.border,
1366
+ placeholderColor: t.textMuted || "#94a3b8",
1367
+ primary: t.primary,
1368
+ secondary: t.secondary,
1369
+ success: t.success,
1370
+ warning: t.warning,
1371
+ error: t.error,
1372
+ shadowColor: r === "light" ? "rgba(0,0,0,0.12)" : "rgba(0,0,0,0.4)",
1373
+ ...Object.entries(t).reduce(
1374
+ (n, [i, d]) => {
1375
+ const s = i.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1376
+ return n[s] = d, n;
1377
+ },
1378
+ {}
1379
+ )
1380
+ };
1381
+ }
1382
+ function it() {
1383
+ const r = {};
1384
+ return Object.entries(de.spacing).forEach(([t, n]) => {
1385
+ const i = parseFloat(n.toString());
1386
+ r[t] = isNaN(i) ? 0 : i * 16;
1387
+ }), r;
1388
+ }
1389
+ function at() {
1390
+ const r = {};
1391
+ return Object.entries(de.borderRadius).forEach(([t, n]) => {
1392
+ const i = parseFloat(n.toString());
1393
+ r[t] = isNaN(i) ? 0 : i;
1394
+ }), r.full = 9999, r.pill = 9999, r.round = 8, r;
1395
+ }
1396
+ function st() {
1397
+ return {
1398
+ tokens: {
1399
+ color: ot(),
1400
+ space: it(),
1401
+ size: nt(),
1402
+ radius: at(),
1403
+ zIndex: {
1404
+ base: 0,
1405
+ dropdown: 100,
1406
+ modal: 1200,
1407
+ toast: 1400
1408
+ }
1409
+ },
1410
+ themes: {
1411
+ light: Q("light"),
1412
+ dark: Q("dark")
1413
+ }
1414
+ };
1415
+ }
1416
+ const D = st(), dt = we({
1417
+ color: D.tokens.color,
1418
+ space: D.tokens.space,
1419
+ size: D.tokens.size,
1420
+ radius: D.tokens.radius,
1421
+ zIndex: D.tokens.zIndex
1422
+ }), lt = re({
1423
+ family: V.fontFamily.sans,
1424
+ size: D.tokens.size,
1425
+ lineHeight: {
1426
+ tight: 1.3,
1427
+ normal: 1.5
1428
+ },
1429
+ weight: {
1430
+ normal: "400",
1431
+ medium: "500",
1432
+ semibold: "600",
1433
+ bold: "700"
1434
+ },
1435
+ letterSpacing: {
1436
+ base: 0,
1437
+ lg: -0.2
1438
+ }
1439
+ }), ct = re({
1440
+ family: V.fontFamily.sans,
1441
+ size: D.tokens.size,
1442
+ lineHeight: {
1443
+ tight: 1.3,
1444
+ normal: 1.5
1445
+ },
1446
+ weight: {
1447
+ normal: "400",
1448
+ medium: "500",
1449
+ semibold: "600",
1450
+ bold: "700"
1451
+ }
1452
+ }), ut = Se({
1453
+ tokens: dt,
1454
+ themes: D.themes,
1455
+ fonts: {
1456
+ heading: lt,
1457
+ body: ct
1458
+ },
1459
+ defaultTheme: "light",
1460
+ media: {
1461
+ xs: { maxWidth: 659 },
1462
+ sm: { maxWidth: 800 },
1463
+ md: { maxWidth: 1024 },
1464
+ lg: { maxWidth: 1280 },
1465
+ xl: { maxWidth: 1420 },
1466
+ gtXs: { minWidth: 660 },
1467
+ gtSm: { minWidth: 801 },
1468
+ gtMd: { minWidth: 1025 },
1469
+ gtLg: { minWidth: 1281 },
1470
+ short: { maxHeight: 820 },
1471
+ tall: { minHeight: 821 },
1472
+ hoverNone: { hover: "none" },
1473
+ pointerCoarse: { pointer: "coarse" }
1474
+ }
1475
+ });
1476
+ function Dt({ children: r }) {
1477
+ const { theme: t } = ne();
1478
+ return /* @__PURE__ */ e(Ce, { config: ut, defaultTheme: t, children: /* @__PURE__ */ e(je, { children: r }) });
1479
+ }
1601
1480
  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,
1610
- wt as LocaleSwitcher,
1611
- xt as MProvider,
1481
+ kt as Avatar,
1482
+ y as Button,
1483
+ R as Card,
1484
+ He as DatePicker,
1485
+ vt as Drawer,
1486
+ $t as Heading,
1487
+ Ue as Icon,
1488
+ E as Input,
1489
+ xt as LocaleSwitcher,
1490
+ Dt as MProvider,
1612
1491
  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
1492
+ u as MText,
1493
+ Ct as Modal,
1494
+ L as Paragraph,
1495
+ Ne as Popover,
1496
+ se as Portal,
1497
+ _e as PortalHost,
1498
+ je as PortalProvider,
1499
+ ie as Select,
1500
+ zt as Separator,
1501
+ wt as Skeleton,
1502
+ yt as StateBadge,
1503
+ pt as ThemeProvider,
1504
+ Ft as ThemeToggle,
1505
+ Oe as Toast,
1506
+ St as ToastContainer,
1507
+ x as XStack,
1508
+ b as YStack,
1509
+ Y as ZStack,
1510
+ j as colors,
1511
+ st as generateMDesignConfig,
1512
+ ut as mThemeConfig,
1513
+ de as spacing,
1514
+ V as typography,
1515
+ ne as useTheme
1637
1516
  };
1638
1517
  //# sourceMappingURL=index.js.map