@elevasis/ui 1.4.0 → 1.6.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 (56) hide show
  1. package/dist/{CoreAuthKitInner-3J4RVQO6.js → CoreAuthKitInner-Y6LQYIPX.js} +1 -0
  2. package/dist/api/index.js +1 -0
  3. package/dist/auth/context.js +1 -0
  4. package/dist/auth/index.js +1 -0
  5. package/dist/charts/index.d.ts +96 -0
  6. package/dist/charts/index.js +384 -0
  7. package/dist/chunk-54S7KNJV.js +112 -0
  8. package/dist/{chunk-6IX5JZEH.js → chunk-G4TAF3T6.js} +166 -1
  9. package/dist/{chunk-Y2I5JJ3N.js → chunk-K3YVC5RW.js} +2 -2
  10. package/dist/chunk-KB5NKPTN.js +1455 -0
  11. package/dist/chunk-MLKGABMK.js +7 -0
  12. package/dist/{chunk-GIFAF5ZS.js → chunk-MS45MNFM.js} +6 -1
  13. package/dist/chunk-R56VC63S.js +129 -0
  14. package/dist/chunk-TYV5NJV2.js +1 -0
  15. package/dist/{chunk-JQLT6HBI.js → chunk-YJFTZUJJ.js} +22 -2
  16. package/dist/components/index.css +486 -0
  17. package/dist/components/index.d.ts +2047 -1
  18. package/dist/components/index.js +3350 -0
  19. package/dist/components/navigation/index.js +1 -0
  20. package/dist/execution/index.d.ts +15 -3
  21. package/dist/execution/index.js +2 -1
  22. package/dist/graph/index.js +2 -1
  23. package/dist/hooks/index.d.ts +270 -0
  24. package/dist/hooks/index.js +3 -2
  25. package/dist/hooks/published.d.ts +546 -2
  26. package/dist/hooks/published.js +3 -2
  27. package/dist/index.css +62 -0
  28. package/dist/index.d.ts +351 -4
  29. package/dist/index.js +12 -1038
  30. package/dist/initialization/index.d.ts +270 -0
  31. package/dist/initialization/index.js +1 -0
  32. package/dist/layout/index.css +44 -0
  33. package/dist/layout/index.d.ts +330 -0
  34. package/dist/layout/index.js +1440 -0
  35. package/dist/organization/index.js +1 -0
  36. package/dist/profile/index.d.ts +270 -0
  37. package/dist/profile/index.js +1 -0
  38. package/dist/provider/index.css +61 -0
  39. package/dist/provider/index.d.ts +54 -2
  40. package/dist/provider/index.js +5 -3
  41. package/dist/provider/published.d.ts +6 -0
  42. package/dist/provider/published.js +3 -2
  43. package/dist/router/context.js +1 -0
  44. package/dist/router/index.js +1 -0
  45. package/dist/sse/index.js +1 -1
  46. package/dist/supabase/index.d.ts +525 -0
  47. package/dist/supabase/index.js +1 -0
  48. package/dist/theme/index.d.ts +107 -0
  49. package/dist/theme/index.js +3 -0
  50. package/dist/typeform/index.js +1 -0
  51. package/dist/typeform/schemas.js +1 -0
  52. package/dist/types/index.d.ts +3636 -368
  53. package/dist/utils/index.js +1 -0
  54. package/package.json +96 -3
  55. package/dist/chunk-XXDDMASA.js +0 -170
  56. /package/dist/{chunk-BUZONXAW.js → chunk-ARQRKA6J.js} +0 -0
@@ -0,0 +1,1440 @@
1
+ import { NavigationButton, ElevasisLoader } from '../chunk-R56VC63S.js';
2
+ import '../chunk-LHQTTUL2.js';
3
+ import { useRouterContext } from '../chunk-Q7DJKLEN.js';
4
+ import '../chunk-MLKGABMK.js';
5
+ import { Collapse, HoverCard, Stack, Group, Text, UnstyledButton, Tooltip, ScrollArea, Menu, Avatar, useComputedColorScheme, Container, Loader, Title, Button, Box, Center, useMantineColorScheme, Switch, Code } from '@mantine/core';
6
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
+ import { IconLayoutSidebarLeftExpand, IconLayoutSidebarLeftCollapse, IconUser, IconLogout, IconAlertCircle, IconChevronDown, IconChevronRight, IconMoonStars, IconSun } from '@tabler/icons-react';
8
+ import { createContext, memo, useEffect, createElement, useContext, useState } from 'react';
9
+
10
+ // src/components/layout/constants.ts
11
+ var sidebarWidth = 240;
12
+ var sidebarCollapsedWidth = 72;
13
+ var sidebarTransitionDuration = 200;
14
+ var sidebarHoverDelay = 100;
15
+ var topbarHeight = 54;
16
+ var KEYFRAMES = `
17
+ @keyframes elevasis-grain-shift {
18
+ 0%, 100% { transform: translate(0, 0); }
19
+ 10% { transform: translate(-2%, -3%); }
20
+ 20% { transform: translate(3%, 1%); }
21
+ 30% { transform: translate(-1%, 4%); }
22
+ 40% { transform: translate(4%, -2%); }
23
+ 50% { transform: translate(-3%, 2%); }
24
+ 60% { transform: translate(2%, -4%); }
25
+ 70% { transform: translate(-4%, 1%); }
26
+ 80% { transform: translate(1%, 3%); }
27
+ 90% { transform: translate(3%, -1%); }
28
+ }
29
+ `;
30
+ function FilmGrain({ darkOpacity = 0.02, lightOpacity = 0.06, className }) {
31
+ const colorScheme = useComputedColorScheme();
32
+ const opacity = colorScheme === "dark" ? darkOpacity : lightOpacity;
33
+ return /* @__PURE__ */ jsxs(
34
+ "div",
35
+ {
36
+ className,
37
+ style: {
38
+ position: "absolute",
39
+ inset: 0,
40
+ pointerEvents: "none",
41
+ overflow: "clip",
42
+ opacity,
43
+ mixBlendMode: colorScheme === "dark" ? "screen" : "multiply"
44
+ },
45
+ children: [
46
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
47
+ /* @__PURE__ */ jsx("svg", { style: { position: "absolute", width: 0, height: 0 }, children: /* @__PURE__ */ jsx("filter", { id: "elevasis-grain", children: /* @__PURE__ */ jsx("feTurbulence", { type: "fractalNoise", baseFrequency: "0.65", numOctaves: "3", stitchTiles: "stitch" }) }) }),
48
+ /* @__PURE__ */ jsx(
49
+ "div",
50
+ {
51
+ style: {
52
+ position: "absolute",
53
+ inset: "-50%",
54
+ width: "200%",
55
+ height: "200%",
56
+ filter: "url(#elevasis-grain)",
57
+ animation: "elevasis-grain-shift 0.8s steps(4) infinite",
58
+ willChange: "transform"
59
+ }
60
+ }
61
+ )
62
+ ]
63
+ }
64
+ );
65
+ }
66
+ var KEYFRAMES2 = `
67
+ @keyframes elevasis-orb-float-0 {
68
+ 0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
69
+ 25% { transform: translate(12vw, -8vh) scale(1.2); opacity: 0.8; }
70
+ 50% { transform: translate(-5vw, -15vh) scale(0.9); opacity: 0.4; }
71
+ 75% { transform: translate(8vw, 5vh) scale(1.1); opacity: 0.7; }
72
+ }
73
+ @keyframes elevasis-orb-float-1 {
74
+ 0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
75
+ 30% { transform: translate(-10vw, 6vh) scale(0.85); opacity: 0.3; }
76
+ 60% { transform: translate(7vw, 12vh) scale(1.15); opacity: 0.7; }
77
+ }
78
+ @keyframes elevasis-orb-float-2 {
79
+ 0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
80
+ 20% { transform: translate(6vw, 10vh) scale(1.3); opacity: 0.7; }
81
+ 50% { transform: translate(-8vw, -4vh) scale(0.8); opacity: 0.3; }
82
+ 80% { transform: translate(3vw, -12vh) scale(1.1); opacity: 0.6; }
83
+ }
84
+ `;
85
+ var ORB_CONFIGS = [
86
+ { top: "10%", left: "15%", size: "25vw", anim: "elevasis-orb-float-0", dur: "22s" },
87
+ { top: "60%", left: "70%", size: "30vw", anim: "elevasis-orb-float-1", dur: "28s" },
88
+ { top: "30%", left: "50%", size: "20vw", anim: "elevasis-orb-float-2", dur: "32s" },
89
+ { top: "75%", left: "20%", size: "22vw", anim: "elevasis-orb-float-0", dur: "26s" },
90
+ { top: "5%", left: "75%", size: "18vw", anim: "elevasis-orb-float-1", dur: "30s" },
91
+ { top: "45%", left: "5%", size: "24vw", anim: "elevasis-orb-float-2", dur: "24s" }
92
+ ];
93
+ function FloatingOrbs({
94
+ color = "var(--color-primary)",
95
+ count = 6,
96
+ className
97
+ }) {
98
+ const orbs = ORB_CONFIGS.slice(0, count);
99
+ return /* @__PURE__ */ jsxs(
100
+ "div",
101
+ {
102
+ className,
103
+ style: {
104
+ position: "absolute",
105
+ inset: 0,
106
+ pointerEvents: "none",
107
+ overflow: "clip"
108
+ },
109
+ children: [
110
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES2 }),
111
+ orbs.map((orb, i) => /* @__PURE__ */ jsx(
112
+ "div",
113
+ {
114
+ style: {
115
+ position: "absolute",
116
+ top: orb.top,
117
+ left: orb.left,
118
+ width: orb.size,
119
+ height: orb.size,
120
+ borderRadius: "50%",
121
+ background: `radial-gradient(circle at center, color-mix(in srgb, ${color} 3%, transparent) 0%, transparent 70%)`,
122
+ filter: "blur(40px)",
123
+ animation: `${orb.anim} ${orb.dur} ease-in-out infinite`,
124
+ willChange: "transform, opacity"
125
+ }
126
+ },
127
+ i
128
+ ))
129
+ ]
130
+ }
131
+ );
132
+ }
133
+ function PerspectiveGrid({
134
+ glowColor = "rgba(123, 123, 123, 0.1)",
135
+ className
136
+ }) {
137
+ const colorScheme = useComputedColorScheme();
138
+ const lineColor = colorScheme === "dark" ? "rgba(90, 90, 90, 0.1)" : "rgba(120, 120, 120, 0.1)";
139
+ return /* @__PURE__ */ jsxs(
140
+ "div",
141
+ {
142
+ className,
143
+ style: {
144
+ position: "absolute",
145
+ inset: 0,
146
+ pointerEvents: "none",
147
+ overflow: "hidden",
148
+ perspective: "500px"
149
+ },
150
+ children: [
151
+ /* @__PURE__ */ jsx(
152
+ "div",
153
+ {
154
+ style: {
155
+ position: "absolute",
156
+ bottom: 0,
157
+ left: "50%",
158
+ transform: "translateX(-50%)",
159
+ width: "100%",
160
+ height: "60%",
161
+ background: `radial-gradient(ellipse 90% 75% at 50% 112%, ${glowColor} -15%, transparent 45%)`,
162
+ pointerEvents: "none"
163
+ }
164
+ }
165
+ ),
166
+ /* @__PURE__ */ jsx(
167
+ "div",
168
+ {
169
+ style: {
170
+ position: "absolute",
171
+ left: "-50%",
172
+ right: "-50%",
173
+ bottom: 0,
174
+ height: "70%",
175
+ backgroundImage: `
176
+ linear-gradient(${lineColor} 2px, transparent 1px),
177
+ linear-gradient(90deg, ${lineColor} 2px, transparent 1px)
178
+ `,
179
+ backgroundSize: "120px 100px",
180
+ transform: "rotateX(60deg)",
181
+ transformOrigin: "bottom center",
182
+ maskImage: "linear-gradient(to bottom, transparent 0%, black 100%, black 100%, transparent 100%)",
183
+ WebkitMaskImage: "linear-gradient(to bottom, transparent 0%, black 100%, black 100%, transparent 100%)"
184
+ }
185
+ }
186
+ )
187
+ ]
188
+ }
189
+ );
190
+ }
191
+ var KEYFRAMES3 = `
192
+ @keyframes elevasis-glow-drift {
193
+ 0% { transform: translateY(0) scale(1); opacity: 1; }
194
+ 20% { transform: translateY(-8%) scale(1.12); opacity: 0.7; }
195
+ 40% { transform: translateY(3%) scale(0.92); opacity: 1; }
196
+ 60% { transform: translateY(5%) scale(1.08); opacity: 0.8; }
197
+ 80% { transform: translateY(-4%) scale(0.95); opacity: 0.9; }
198
+ 100% { transform: translateY(0) scale(1); opacity: 1; }
199
+ }
200
+ @keyframes elevasis-glow-drift-alt {
201
+ 0% { transform: translateY(0) scale(1); opacity: 0.8; }
202
+ 25% { transform: translateY(6%) scale(0.9); opacity: 1; }
203
+ 50% { transform: translateY(-7%) scale(1.15); opacity: 0.7; }
204
+ 75% { transform: translateY(-5%) scale(1.05); opacity: 0.9; }
205
+ 100% { transform: translateY(0) scale(1); opacity: 0.8; }
206
+ }
207
+ @keyframes elevasis-glow-drift-slow {
208
+ 0% { transform: translateY(0) scale(1); opacity: 0.9; }
209
+ 33% { transform: translateY(-4%) scale(1.1); opacity: 0.6; }
210
+ 66% { transform: translateY(6%) scale(0.88); opacity: 1; }
211
+ 100% { transform: translateY(0) scale(1); opacity: 0.9; }
212
+ }
213
+ `;
214
+ function RadiantGlow({
215
+ color = "var(--color-primary)",
216
+ opacity = 1,
217
+ className
218
+ }) {
219
+ return /* @__PURE__ */ jsxs(
220
+ "div",
221
+ {
222
+ className,
223
+ style: {
224
+ position: "absolute",
225
+ inset: 0,
226
+ pointerEvents: "none",
227
+ overflow: "clip",
228
+ opacity
229
+ },
230
+ children: [
231
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES3 }),
232
+ /* @__PURE__ */ jsx(
233
+ "div",
234
+ {
235
+ style: {
236
+ position: "absolute",
237
+ top: "-80%",
238
+ left: "50%",
239
+ transform: "translateX(-50%)",
240
+ width: "200%",
241
+ height: "200%",
242
+ background: `radial-gradient(ellipse at center, color-mix(in srgb, ${color} 0.8%, transparent) 0%, transparent 70%)`,
243
+ animation: "elevasis-glow-drift 20s ease-in-out infinite",
244
+ willChange: "transform"
245
+ }
246
+ }
247
+ ),
248
+ /* @__PURE__ */ jsx(
249
+ "div",
250
+ {
251
+ style: {
252
+ position: "absolute",
253
+ bottom: "-70%",
254
+ left: "50%",
255
+ transform: "translateX(-50%)",
256
+ width: "180%",
257
+ height: "180%",
258
+ background: `radial-gradient(ellipse at center, color-mix(in srgb, ${color} 0.6%, transparent) 0%, transparent 65%)`,
259
+ animation: "elevasis-glow-drift-alt 24s ease-in-out infinite",
260
+ willChange: "transform"
261
+ }
262
+ }
263
+ ),
264
+ /* @__PURE__ */ jsx(
265
+ "div",
266
+ {
267
+ style: {
268
+ position: "absolute",
269
+ top: "-20%",
270
+ left: "50%",
271
+ transform: "translateX(-50%)",
272
+ width: "120%",
273
+ height: "120%",
274
+ background: `radial-gradient(ellipse at center, color-mix(in srgb, ${color} 0.6%, transparent) 0%, transparent 60%)`,
275
+ animation: "elevasis-glow-drift-slow 28s ease-in-out infinite",
276
+ willChange: "transform"
277
+ }
278
+ }
279
+ )
280
+ ]
281
+ }
282
+ );
283
+ }
284
+ function Vignette({ strength = 0.35, className }) {
285
+ return /* @__PURE__ */ jsx(
286
+ "div",
287
+ {
288
+ className,
289
+ style: {
290
+ position: "absolute",
291
+ inset: 0,
292
+ pointerEvents: "none",
293
+ background: `radial-gradient(ellipse 80% 70% at 50% 50%, transparent 50%, rgba(0, 0, 0, ${strength}) 100%)`
294
+ }
295
+ }
296
+ );
297
+ }
298
+ var AppShellContainer = ({ children }) => {
299
+ return /* @__PURE__ */ jsxs(
300
+ "div",
301
+ {
302
+ style: {
303
+ height: "100vh",
304
+ display: "flex",
305
+ backgroundColor: "var(--color-background)",
306
+ position: "relative"
307
+ },
308
+ children: [
309
+ /* @__PURE__ */ jsx(PerspectiveGrid, {}),
310
+ /* @__PURE__ */ jsx(RadiantGlow, {}),
311
+ /* @__PURE__ */ jsx(FloatingOrbs, {}),
312
+ /* @__PURE__ */ jsx(FilmGrain, {}),
313
+ children
314
+ ]
315
+ }
316
+ );
317
+ };
318
+ var AppShellRightSideContainer = ({ children }) => {
319
+ return /* @__PURE__ */ jsx(
320
+ "main",
321
+ {
322
+ style: {
323
+ flex: 1,
324
+ minWidth: 0,
325
+ color: "var(--color-text)",
326
+ display: "flex",
327
+ flexDirection: "column",
328
+ minHeight: "100vh"
329
+ },
330
+ children
331
+ }
332
+ );
333
+ };
334
+ var AppShellRightSideOuterContainer = ({ children }) => {
335
+ return /* @__PURE__ */ jsx(
336
+ "div",
337
+ {
338
+ style: {
339
+ flex: 1,
340
+ overflow: "auto",
341
+ minWidth: 0,
342
+ minHeight: "100vh"
343
+ },
344
+ children
345
+ }
346
+ );
347
+ };
348
+ var AppShellContentContainer = ({ children }) => {
349
+ return /* @__PURE__ */ jsx(
350
+ "div",
351
+ {
352
+ style: {
353
+ height: "100%",
354
+ padding: "var(--mantine-spacing-md)"
355
+ },
356
+ children
357
+ }
358
+ );
359
+ };
360
+ var PageContainer = ({ children }) => {
361
+ return (
362
+ // Add padding to the top of the container to adjust for the topbar height
363
+ /* @__PURE__ */ jsx(Container, { size: "xl", p: 0, w: "100%", children: /* @__PURE__ */ jsx(Stack, { children }) })
364
+ );
365
+ };
366
+ var AppTopbarAdjusterWrapper = ({ children }) => {
367
+ const padding = `${topbarHeight}px`;
368
+ return /* @__PURE__ */ jsx("div", { style: { paddingTop: padding }, children });
369
+ };
370
+ var standardMdSpacing = 16;
371
+ var topAndBottomSpacing = standardMdSpacing * 2;
372
+ var AppShellCenteredContainer = ({ children }) => {
373
+ return /* @__PURE__ */ jsx(
374
+ "div",
375
+ {
376
+ style: {
377
+ display: "flex",
378
+ alignItems: "center",
379
+ justifyContent: "center",
380
+ margin: "auto auto",
381
+ height: `calc(100vh - ${topbarHeight + topAndBottomSpacing}px)`,
382
+ textAlign: "center"
383
+ },
384
+ children
385
+ }
386
+ );
387
+ };
388
+ var AppShellLoader = () => {
389
+ return /* @__PURE__ */ jsx(AppShellCenteredContainer, { children: /* @__PURE__ */ jsx(Loader, { size: "xl", loaders: { elevasis: ElevasisLoader }, type: "elevasis" }) });
390
+ };
391
+ var AppShellError = ({ message, retry }) => {
392
+ return /* @__PURE__ */ jsxs(AppShellCenteredContainer, { children: [
393
+ /* @__PURE__ */ jsx(IconAlertCircle, { size: 48, color: "var(--color-error)" }),
394
+ /* @__PURE__ */ jsx(Title, { order: 3, c: "dimmed", children: message }),
395
+ retry && /* @__PURE__ */ jsx(Button, { onClick: retry, children: "Retry" })
396
+ ] });
397
+ };
398
+ var SidebarContext = createContext(void 0);
399
+ var SIDEBAR_COLLAPSED_KEY = "sidebar-collapsed";
400
+ var SidebarProvider = ({ children }) => {
401
+ const [expandedGroups, setExpandedGroups] = useState({});
402
+ const [isInitialized, setIsInitialized] = useState(false);
403
+ const [isCollapsed, setIsCollapsed] = useState(() => {
404
+ if (typeof window !== "undefined" && window.innerWidth < 1024) {
405
+ return true;
406
+ }
407
+ const stored = localStorage.getItem(SIDEBAR_COLLAPSED_KEY);
408
+ return stored === "true";
409
+ });
410
+ const toggleGroup = (groupLabel) => {
411
+ setExpandedGroups((prev) => ({
412
+ ...prev,
413
+ [groupLabel]: !prev[groupLabel]
414
+ }));
415
+ };
416
+ const initializeGroups = (groups) => {
417
+ if (!isInitialized) {
418
+ const initialState = {};
419
+ groups.forEach((group) => {
420
+ initialState[group.label] = group.initiallyOpened || false;
421
+ });
422
+ setExpandedGroups(initialState);
423
+ setIsInitialized(true);
424
+ }
425
+ };
426
+ const toggleCollapsed = () => {
427
+ setIsCollapsed((prev) => {
428
+ const newValue = !prev;
429
+ localStorage.setItem(SIDEBAR_COLLAPSED_KEY, String(newValue));
430
+ return newValue;
431
+ });
432
+ };
433
+ const setCollapsed = (value) => {
434
+ setIsCollapsed(value);
435
+ localStorage.setItem(SIDEBAR_COLLAPSED_KEY, String(value));
436
+ };
437
+ useEffect(() => {
438
+ const handleStorageChange = (e) => {
439
+ if (e.key === SIDEBAR_COLLAPSED_KEY && e.newValue !== null) {
440
+ setIsCollapsed(e.newValue === "true");
441
+ }
442
+ };
443
+ window.addEventListener("storage", handleStorageChange);
444
+ return () => window.removeEventListener("storage", handleStorageChange);
445
+ }, []);
446
+ return /* @__PURE__ */ jsx(
447
+ SidebarContext.Provider,
448
+ {
449
+ value: {
450
+ expandedGroups,
451
+ toggleGroup,
452
+ initializeGroups,
453
+ isCollapsed,
454
+ toggleCollapsed,
455
+ setCollapsed
456
+ },
457
+ children
458
+ }
459
+ );
460
+ };
461
+ var useSidebar = () => {
462
+ const context = useContext(SidebarContext);
463
+ if (context === void 0) {
464
+ throw new Error("useSidebar must be used within a SidebarProvider");
465
+ }
466
+ return context;
467
+ };
468
+
469
+ // src/components/layout/sidebar/components/link-group-components/utils.ts
470
+ var isPathActive = (linkPath, currentPath) => {
471
+ if (!currentPath || !linkPath) return false;
472
+ if (currentPath === linkPath) return true;
473
+ const linkSegments = linkPath.split("/").filter(Boolean);
474
+ const currentSegments = currentPath.split("/").filter(Boolean);
475
+ if (currentSegments.length < linkSegments.length) return false;
476
+ for (let i = 0; i < linkSegments.length; i++) {
477
+ if (linkSegments[i] !== currentSegments[i]) return false;
478
+ }
479
+ return true;
480
+ };
481
+ var isOverviewLink = (label, link) => {
482
+ return label === "Overview" && (link === "/admin" || link === "/operations" || link === "/monitoring" || link === "/settings" || link === "/execution-engine" || link === "/acquisition");
483
+ };
484
+ var SubLinkItem = ({ linkItem, currentPath }) => {
485
+ const { Link } = useRouterContext();
486
+ const isActive = isOverviewLink(linkItem.label, linkItem.link) ? currentPath === linkItem.link : isPathActive(linkItem.link, currentPath);
487
+ const activeColor3 = "var(--color-primary)";
488
+ const activeColorBg = "color-mix(in srgb, var(--color-primary) 10%, transparent)";
489
+ const defaultColor2 = "var(--color-text-subtle)";
490
+ const hoverColor2 = "var(--color-text)";
491
+ return /* @__PURE__ */ jsx(
492
+ Link,
493
+ {
494
+ to: linkItem.link,
495
+ onClick: linkItem.onClick,
496
+ style: {
497
+ display: "block",
498
+ textDecoration: "none",
499
+ fontFamily: "var(--elevasis-font-family-subtitle)",
500
+ fontSize: "var(--mantine-font-size-sm)",
501
+ color: isActive ? activeColor3 : defaultColor2,
502
+ backgroundColor: isActive ? activeColorBg : "transparent",
503
+ padding: `var(--mantine-spacing-xs) var(--mantine-spacing-xs) var(--mantine-spacing-xs) 50px`,
504
+ borderRadius: "var(--mantine-radius-xs)",
505
+ transition: `all var(--duration-fast) var(--easing)`,
506
+ fontWeight: isActive ? 600 : 400
507
+ },
508
+ onMouseEnter: (e) => {
509
+ if (!isActive) {
510
+ e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
511
+ e.currentTarget.style.color = hoverColor2;
512
+ }
513
+ },
514
+ onMouseLeave: (e) => {
515
+ if (!isActive) {
516
+ e.currentTarget.style.backgroundColor = "transparent";
517
+ e.currentTarget.style.color = defaultColor2;
518
+ }
519
+ },
520
+ children: linkItem.label
521
+ }
522
+ );
523
+ };
524
+ var MainButton = ({
525
+ icon,
526
+ label,
527
+ isCollapsed,
528
+ hasLinks,
529
+ opened,
530
+ isIconTextActive,
531
+ isBackgroundActive,
532
+ onClick,
533
+ link,
534
+ noWrapper = false
535
+ }) => {
536
+ const { Link } = useRouterContext();
537
+ const button = /* @__PURE__ */ jsx(
538
+ NavigationButton,
539
+ {
540
+ icon,
541
+ label,
542
+ isCollapsed,
543
+ hasSubItems: hasLinks,
544
+ isExpanded: opened,
545
+ isActive: isIconTextActive,
546
+ hasActiveBackground: isBackgroundActive,
547
+ onClick,
548
+ transitionDuration: sidebarTransitionDuration
549
+ }
550
+ );
551
+ const wrapperStyle = { marginBottom: "4px" };
552
+ if (noWrapper) {
553
+ return button;
554
+ }
555
+ if (!hasLinks && link) {
556
+ return /* @__PURE__ */ jsx("div", { style: wrapperStyle, children: /* @__PURE__ */ jsx(Link, { to: link, style: { textDecoration: "none" }, children: button }) });
557
+ }
558
+ return /* @__PURE__ */ jsx("div", { style: wrapperStyle, children: button });
559
+ };
560
+ var CollapsedWithTooltip = ({ label, children }) => {
561
+ return /* @__PURE__ */ jsx(Tooltip, { label, position: "right", offset: 12, children });
562
+ };
563
+ var CollapsedWithHoverCard = ({
564
+ label,
565
+ icon: Icon,
566
+ links,
567
+ currentPath,
568
+ children
569
+ }) => {
570
+ const { Link } = useRouterContext();
571
+ return /* @__PURE__ */ jsxs(
572
+ HoverCard,
573
+ {
574
+ width: 200,
575
+ position: "right-start",
576
+ shadow: "md",
577
+ withinPortal: true,
578
+ offset: 12,
579
+ openDelay: sidebarHoverDelay,
580
+ closeDelay: 150,
581
+ zIndex: 9999,
582
+ children: [
583
+ /* @__PURE__ */ jsx(HoverCard.Target, { children: /* @__PURE__ */ jsx("div", { style: { display: "inline-block", width: "100%" }, children }) }),
584
+ /* @__PURE__ */ jsx(
585
+ HoverCard.Dropdown,
586
+ {
587
+ style: {
588
+ padding: "var(--mantine-spacing-sm)",
589
+ background: "var(--glass-background)",
590
+ backdropFilter: "var(--glass-blur)"
591
+ },
592
+ children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
593
+ /* @__PURE__ */ jsxs(
594
+ Group,
595
+ {
596
+ gap: "xs",
597
+ style: {
598
+ paddingBottom: "8px",
599
+ borderBottom: "1px solid var(--color-border)",
600
+ marginBottom: "4px"
601
+ },
602
+ children: [
603
+ Icon && /* @__PURE__ */ jsx(Icon, { size: 16, stroke: 2 }),
604
+ /* @__PURE__ */ jsx(
605
+ Text,
606
+ {
607
+ size: "sm",
608
+ fw: 600,
609
+ c: "var(--color-text)",
610
+ style: { fontFamily: "var(--mantine-font-family-headings)" },
611
+ children: label
612
+ }
613
+ )
614
+ ]
615
+ }
616
+ ),
617
+ links.map((linkItem) => {
618
+ const isActive = currentPath === linkItem.link;
619
+ return /* @__PURE__ */ jsx(Link, { to: linkItem.link, style: { textDecoration: "none" }, onClick: () => {
620
+ }, children: /* @__PURE__ */ jsx(
621
+ UnstyledButton,
622
+ {
623
+ style: {
624
+ width: "100%",
625
+ padding: "8px 12px",
626
+ backgroundColor: isActive ? "color-mix(in srgb, var(--color-primary) 10%, transparent)" : "transparent",
627
+ color: isActive ? "var(--color-primary)" : "var(--color-text)",
628
+ transition: "all var(--duration-fast) var(--easing)"
629
+ },
630
+ onMouseEnter: (e) => {
631
+ if (!isActive) {
632
+ e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
633
+ }
634
+ },
635
+ onMouseLeave: (e) => {
636
+ e.currentTarget.style.backgroundColor = isActive ? "color-mix(in srgb, var(--color-primary) 10%, transparent)" : "transparent";
637
+ },
638
+ children: /* @__PURE__ */ jsx(Text, { size: "sm", style: { lineHeight: 1.2 }, children: linkItem.label })
639
+ }
640
+ ) }, linkItem.link);
641
+ })
642
+ ] })
643
+ }
644
+ )
645
+ ]
646
+ }
647
+ );
648
+ };
649
+ var LinksGroup = memo(function LinksGroup2({
650
+ icon: Icon,
651
+ label,
652
+ links = [],
653
+ link,
654
+ onClick,
655
+ currentPath = "",
656
+ opened = false,
657
+ onToggle
658
+ }) {
659
+ const hasLinks = links.length > 0;
660
+ const { navigate } = useRouterContext();
661
+ const { isCollapsed } = useSidebar();
662
+ useEffect(() => {
663
+ if (isCollapsed && opened && onToggle) {
664
+ onToggle();
665
+ }
666
+ }, [isCollapsed, opened, onToggle]);
667
+ const hasActiveChild = hasLinks && links.some((item) => isPathActive(item.link, currentPath));
668
+ const isParentActive = !hasLinks && (link === "/" ? currentPath === "/" : isPathActive(link || "", currentPath));
669
+ const isIconTextActive = isParentActive || hasActiveChild;
670
+ const isBackgroundActive = isParentActive || hasActiveChild && !opened;
671
+ const handleMainClick = () => {
672
+ if (hasLinks && !isCollapsed) {
673
+ onToggle?.();
674
+ } else if (!hasLinks) {
675
+ if (link) {
676
+ navigate(link);
677
+ }
678
+ onClick?.();
679
+ }
680
+ };
681
+ const items = links.map((item) => /* @__PURE__ */ jsx(SubLinkItem, { linkItem: item, currentPath }, item.label));
682
+ const mainButton = /* @__PURE__ */ jsx(
683
+ MainButton,
684
+ {
685
+ icon: Icon,
686
+ label,
687
+ isCollapsed,
688
+ hasLinks,
689
+ opened,
690
+ isIconTextActive,
691
+ isBackgroundActive,
692
+ onClick: handleMainClick,
693
+ link
694
+ }
695
+ );
696
+ if (isCollapsed && hasLinks) {
697
+ const mainButtonNoWrapper = /* @__PURE__ */ jsx(
698
+ MainButton,
699
+ {
700
+ icon: Icon,
701
+ label,
702
+ isCollapsed,
703
+ hasLinks,
704
+ opened,
705
+ isIconTextActive,
706
+ isBackgroundActive,
707
+ onClick: handleMainClick,
708
+ link,
709
+ noWrapper: true
710
+ }
711
+ );
712
+ return /* @__PURE__ */ jsx("div", { style: { marginBottom: "4px" }, children: /* @__PURE__ */ jsx(CollapsedWithHoverCard, { label, icon: Icon, links, currentPath, children: mainButtonNoWrapper }) });
713
+ }
714
+ if (isCollapsed && !hasLinks) {
715
+ const mainButtonNoWrapper = /* @__PURE__ */ jsx(
716
+ MainButton,
717
+ {
718
+ icon: Icon,
719
+ label,
720
+ isCollapsed,
721
+ hasLinks,
722
+ opened,
723
+ isIconTextActive,
724
+ isBackgroundActive,
725
+ onClick: handleMainClick,
726
+ link,
727
+ noWrapper: true
728
+ }
729
+ );
730
+ return /* @__PURE__ */ jsx("div", { style: { marginBottom: "4px" }, children: /* @__PURE__ */ jsx(CollapsedWithTooltip, { label, children: mainButtonNoWrapper }) });
731
+ }
732
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
733
+ mainButton,
734
+ hasLinks && /* @__PURE__ */ jsx(Collapse, { in: opened && !isCollapsed, children: /* @__PURE__ */ jsx("div", { style: { paddingLeft: "0px" }, children: items }) })
735
+ ] });
736
+ });
737
+ var useSidebarCollapse = () => {
738
+ const { isCollapsed, toggleCollapsed, setCollapsed } = useSidebar();
739
+ useEffect(() => {
740
+ const handleKeyDown = (e) => {
741
+ if ((e.metaKey || e.ctrlKey) && e.key === "b") {
742
+ e.preventDefault();
743
+ toggleCollapsed();
744
+ }
745
+ };
746
+ window.addEventListener("keydown", handleKeyDown);
747
+ return () => window.removeEventListener("keydown", handleKeyDown);
748
+ }, [toggleCollapsed]);
749
+ useEffect(() => {
750
+ const handleResize = () => {
751
+ if (window.innerWidth < 1024) {
752
+ setCollapsed(true);
753
+ }
754
+ };
755
+ handleResize();
756
+ window.addEventListener("resize", handleResize);
757
+ return () => window.removeEventListener("resize", handleResize);
758
+ }, [setCollapsed]);
759
+ return {
760
+ isCollapsed,
761
+ toggleCollapsed,
762
+ setCollapsed
763
+ };
764
+ };
765
+ var SidebarContainer = ({ children, className }) => {
766
+ const { isCollapsed } = useSidebar();
767
+ return /* @__PURE__ */ jsx(
768
+ "nav",
769
+ {
770
+ className,
771
+ style: {
772
+ height: "100vh",
773
+ width: isCollapsed ? `${sidebarCollapsedWidth}px` : `${sidebarWidth}px`,
774
+ flexShrink: 0,
775
+ display: "flex",
776
+ flexDirection: "column",
777
+ backgroundColor: "var(--glass-background)",
778
+ backdropFilter: "var(--glass-blur)",
779
+ WebkitBackdropFilter: "var(--glass-blur)",
780
+ borderRight: "1px solid var(--color-border)",
781
+ boxShadow: "var(--card-shadow)",
782
+ transition: `width ${sidebarTransitionDuration}ms var(--easing)`,
783
+ overflow: "hidden",
784
+ position: "relative",
785
+ fontFamily: "var(--mantine-font-family-headings)"
786
+ },
787
+ children
788
+ }
789
+ );
790
+ };
791
+ var SidebarTopSection = ({ logo }) => {
792
+ const { isCollapsed, toggleCollapsed } = useSidebar();
793
+ return /* @__PURE__ */ jsxs(
794
+ "div",
795
+ {
796
+ style: {
797
+ padding: "var(--mantine-spacing-sm)",
798
+ borderBottom: "1px solid var(--color-border)",
799
+ height: `${topbarHeight}px`,
800
+ display: "flex",
801
+ alignItems: "center",
802
+ justifyContent: "space-between"
803
+ },
804
+ children: [
805
+ !isCollapsed && logo ? /* @__PURE__ */ jsx(
806
+ "img",
807
+ {
808
+ src: logo,
809
+ alt: "Logo",
810
+ style: {
811
+ marginLeft: 12,
812
+ width: "auto",
813
+ height: "30px",
814
+ transition: `opacity ${sidebarTransitionDuration}ms var(--easing)`,
815
+ opacity: isCollapsed ? 0 : 1
816
+ }
817
+ }
818
+ ) : /* @__PURE__ */ jsx("div", {}),
819
+ /* @__PURE__ */ jsx(
820
+ UnstyledButton,
821
+ {
822
+ onClick: toggleCollapsed,
823
+ style: {
824
+ padding: "6px",
825
+ display: "flex",
826
+ alignItems: "center",
827
+ justifyContent: "center",
828
+ color: "var(--color-text-subtle)",
829
+ paddingRight: 6,
830
+ marginRight: isCollapsed ? 6 : 0,
831
+ transition: "all var(--duration-fast) var(--easing)",
832
+ ":hover": {
833
+ backgroundColor: "var(--color-surface-hover)",
834
+ color: "var(--color-text)"
835
+ }
836
+ },
837
+ onMouseEnter: (e) => {
838
+ e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
839
+ e.currentTarget.style.color = "var(--color-text)";
840
+ },
841
+ onMouseLeave: (e) => {
842
+ e.currentTarget.style.backgroundColor = "transparent";
843
+ e.currentTarget.style.color = "var(--color-text-subtle)";
844
+ },
845
+ children: isCollapsed ? /* @__PURE__ */ jsx(
846
+ IconLayoutSidebarLeftExpand,
847
+ {
848
+ size: 20,
849
+ stroke: 1.5,
850
+ style: {
851
+ transition: `transform ${sidebarTransitionDuration}ms var(--easing)`
852
+ }
853
+ }
854
+ ) : /* @__PURE__ */ jsx(
855
+ IconLayoutSidebarLeftCollapse,
856
+ {
857
+ size: 20,
858
+ stroke: 1.5,
859
+ style: {
860
+ transition: `transform ${sidebarTransitionDuration}ms var(--easing)`
861
+ }
862
+ }
863
+ )
864
+ }
865
+ )
866
+ ]
867
+ }
868
+ );
869
+ };
870
+ var SidebarBottomSection = ({ user, onLogout }) => {
871
+ const { isCollapsed } = useSidebar();
872
+ if (!user) {
873
+ return null;
874
+ }
875
+ return /* @__PURE__ */ jsx(
876
+ "div",
877
+ {
878
+ style: {
879
+ padding: "var(--mantine-spacing-sm)",
880
+ borderTop: "1px solid var(--color-border)",
881
+ transition: `padding ${sidebarTransitionDuration}ms var(--easing)`
882
+ },
883
+ children: /* @__PURE__ */ jsxs(Menu, { shadow: "md", width: 200, position: "top-start", offset: 8, children: [
884
+ /* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(
885
+ "div",
886
+ {
887
+ style: {
888
+ borderRadius: "var(--mantine-radius-xs)",
889
+ padding: "4px",
890
+ transition: "background-color var(--duration-fast)",
891
+ display: "flex",
892
+ justifyContent: "flex-start",
893
+ cursor: "pointer"
894
+ },
895
+ onMouseEnter: (e) => {
896
+ e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
897
+ },
898
+ onMouseLeave: (e) => {
899
+ e.currentTarget.style.backgroundColor = "transparent";
900
+ },
901
+ children: /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "nowrap", children: [
902
+ /* @__PURE__ */ jsx(
903
+ Tooltip,
904
+ {
905
+ label: isCollapsed ? /* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
906
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 500 }, children: [user.firstName, user.lastName].filter(Boolean).join(" ") || user.email }),
907
+ /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", opacity: 0.8 }, children: user.email })
908
+ ] }) : null,
909
+ position: "right",
910
+ offset: 12,
911
+ disabled: !isCollapsed,
912
+ children: /* @__PURE__ */ jsx(
913
+ Avatar,
914
+ {
915
+ src: user.profilePictureUrl || void 0,
916
+ radius: "xl",
917
+ size: isCollapsed ? "sm" : "md",
918
+ alt: `${user.firstName || ""} ${user.lastName || ""}`.trim(),
919
+ style: {
920
+ marginLeft: isCollapsed ? 8 : 0,
921
+ transition: `all ${sidebarTransitionDuration}ms var(--easing)`,
922
+ cursor: "pointer"
923
+ },
924
+ children: (user.firstName || user.email).charAt(0).toUpperCase()
925
+ }
926
+ )
927
+ }
928
+ ),
929
+ /* @__PURE__ */ jsxs(
930
+ Stack,
931
+ {
932
+ gap: 2,
933
+ style: {
934
+ flex: 1,
935
+ minWidth: 0,
936
+ opacity: isCollapsed ? 0 : 1,
937
+ width: isCollapsed ? 0 : "auto",
938
+ overflow: "hidden",
939
+ transition: `opacity ${sidebarTransitionDuration}ms var(--easing), width ${sidebarTransitionDuration}ms var(--easing)`
940
+ },
941
+ children: [
942
+ /* @__PURE__ */ jsx(
943
+ Text,
944
+ {
945
+ size: "sm",
946
+ fw: 500,
947
+ style: {
948
+ color: "var(--color-text)",
949
+ lineHeight: 1.2,
950
+ overflow: "hidden",
951
+ textOverflow: "ellipsis",
952
+ whiteSpace: "nowrap"
953
+ },
954
+ children: [user.firstName, user.lastName].filter(Boolean).join(" ") || user.email
955
+ }
956
+ ),
957
+ /* @__PURE__ */ jsx(
958
+ Text,
959
+ {
960
+ size: "xs",
961
+ style: {
962
+ color: "var(--color-text-subtle)",
963
+ lineHeight: 1.2,
964
+ overflow: "hidden",
965
+ textOverflow: "ellipsis",
966
+ whiteSpace: "nowrap"
967
+ },
968
+ children: user.email
969
+ }
970
+ )
971
+ ]
972
+ }
973
+ )
974
+ ] })
975
+ }
976
+ ) }),
977
+ /* @__PURE__ */ jsxs(Menu.Dropdown, { children: [
978
+ /* @__PURE__ */ jsx(Menu.Item, { leftSection: /* @__PURE__ */ jsx(IconUser, { size: 14 }), children: "Account" }),
979
+ onLogout && /* @__PURE__ */ jsx(Menu.Item, { leftSection: /* @__PURE__ */ jsx(IconLogout, { size: 14 }), onClick: onLogout, children: "Logout" })
980
+ ] })
981
+ ] })
982
+ }
983
+ );
984
+ };
985
+ var SidebarMiddleSection = ({ linkElements }) => {
986
+ return /* @__PURE__ */ jsx(
987
+ ScrollArea,
988
+ {
989
+ style: {
990
+ flex: 1,
991
+ padding: "var(--mantine-spacing-sm)",
992
+ transition: `padding ${sidebarTransitionDuration}ms var(--easing)`
993
+ },
994
+ children: /* @__PURE__ */ jsx("div", { style: { paddingBottom: "var(--mantine-spacing-sm)" }, children: linkElements })
995
+ }
996
+ );
997
+ };
998
+ var Sidebar = memo(function Sidebar2({
999
+ links = [],
1000
+ user,
1001
+ onLogout,
1002
+ className = "",
1003
+ logo
1004
+ }) {
1005
+ const { currentPath } = useRouterContext();
1006
+ const { expandedGroups, toggleGroup, initializeGroups } = useSidebar();
1007
+ useSidebarCollapse();
1008
+ useEffect(() => {
1009
+ initializeGroups(links);
1010
+ }, [links, initializeGroups]);
1011
+ const linkElements = links.map((item) => {
1012
+ const isOpened = expandedGroups[item.label] || false;
1013
+ const linkGroup = /* @__PURE__ */ createElement(
1014
+ LinksGroup,
1015
+ {
1016
+ ...item,
1017
+ key: item.label,
1018
+ currentPath,
1019
+ opened: isOpened,
1020
+ onToggle: () => toggleGroup(item.label)
1021
+ }
1022
+ );
1023
+ if (item.dataOnboardingTourId) {
1024
+ return /* @__PURE__ */ jsx("div", { "data-onboarding-tour-id": item.dataOnboardingTourId, children: linkGroup }, item.label);
1025
+ }
1026
+ return linkGroup;
1027
+ });
1028
+ return /* @__PURE__ */ jsxs(SidebarContainer, { className, children: [
1029
+ /* @__PURE__ */ jsx(SidebarTopSection, { logo }),
1030
+ /* @__PURE__ */ jsx(SidebarMiddleSection, { linkElements }),
1031
+ /* @__PURE__ */ jsx(SidebarBottomSection, { user, onLogout })
1032
+ ] });
1033
+ });
1034
+ var activeColor = "var(--color-primary)";
1035
+ var defaultTextColor = "var(--color-text)";
1036
+ var subtleColor = "var(--color-text-subtle)";
1037
+ var activeBg = `color-mix(in srgb, ${activeColor} 10%, transparent)`;
1038
+ var CollapsibleSidebarGroup = ({
1039
+ icon: Icon,
1040
+ label,
1041
+ isExpanded,
1042
+ onToggle,
1043
+ isActive = false,
1044
+ badge,
1045
+ children,
1046
+ onLabelClick,
1047
+ emptyMessage = "No items",
1048
+ isEmpty = false,
1049
+ isLoading = false,
1050
+ loadingComponent
1051
+ }) => {
1052
+ const showActiveStyle = !isExpanded && isActive;
1053
+ const iconColor = showActiveStyle ? activeColor : subtleColor;
1054
+ const textColor = showActiveStyle ? activeColor : defaultTextColor;
1055
+ const fontWeight = showActiveStyle ? 600 : 500;
1056
+ const handleLabelClick = (e) => {
1057
+ if (onLabelClick) {
1058
+ e.stopPropagation();
1059
+ onLabelClick();
1060
+ }
1061
+ };
1062
+ return /* @__PURE__ */ jsxs(Box, { children: [
1063
+ /* @__PURE__ */ jsx(
1064
+ UnstyledButton,
1065
+ {
1066
+ onClick: onToggle,
1067
+ style: {
1068
+ display: "flex",
1069
+ alignItems: "center",
1070
+ width: "100%",
1071
+ padding: "var(--mantine-spacing-xs)",
1072
+ color: textColor,
1073
+ backgroundColor: showActiveStyle ? activeBg : "transparent",
1074
+ transition: `all var(--duration-fast) var(--easing)`,
1075
+ cursor: "pointer",
1076
+ overflow: "hidden"
1077
+ },
1078
+ onMouseEnter: (e) => {
1079
+ if (!showActiveStyle) {
1080
+ e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
1081
+ }
1082
+ },
1083
+ onMouseLeave: (e) => {
1084
+ if (!showActiveStyle) {
1085
+ e.currentTarget.style.backgroundColor = "transparent";
1086
+ }
1087
+ },
1088
+ children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { width: "100%" }, children: [
1089
+ /* @__PURE__ */ jsx(Box, { style: { flexShrink: 0, color: iconColor }, children: isExpanded ? /* @__PURE__ */ jsx(IconChevronDown, { size: 14 }) : /* @__PURE__ */ jsx(IconChevronRight, { size: 14 }) }),
1090
+ /* @__PURE__ */ jsx(
1091
+ Box,
1092
+ {
1093
+ style: { flexShrink: 0, color: iconColor, cursor: onLabelClick ? "pointer" : "inherit" },
1094
+ onClick: onLabelClick ? handleLabelClick : void 0,
1095
+ children: /* @__PURE__ */ jsx(Icon, { size: 18, color: activeColor })
1096
+ }
1097
+ ),
1098
+ /* @__PURE__ */ jsx(
1099
+ Text,
1100
+ {
1101
+ size: "sm",
1102
+ fw: fontWeight,
1103
+ style: {
1104
+ fontFamily: "var(--elevasis-font-family-subtitle)",
1105
+ color: textColor,
1106
+ transition: `color var(--duration-fast) var(--easing)`,
1107
+ overflow: "hidden",
1108
+ textOverflow: "ellipsis",
1109
+ whiteSpace: "nowrap",
1110
+ flex: 1,
1111
+ cursor: onLabelClick ? "pointer" : "inherit"
1112
+ },
1113
+ onClick: onLabelClick ? handleLabelClick : void 0,
1114
+ children: label
1115
+ }
1116
+ ),
1117
+ badge && /* @__PURE__ */ jsx(Box, { style: { flexShrink: 0 }, children: badge })
1118
+ ] })
1119
+ }
1120
+ ),
1121
+ /* @__PURE__ */ jsx(Collapse, { in: isExpanded, children: /* @__PURE__ */ jsx(
1122
+ Stack,
1123
+ {
1124
+ gap: 0,
1125
+ mt: "xs",
1126
+ ml: "xs",
1127
+ style: {
1128
+ borderLeft: `1px solid color-mix(in srgb, var(--color-primary) 40%, transparent)`,
1129
+ marginLeft: "calc(var(--mantine-spacing-xs) + 6px)",
1130
+ paddingLeft: "calc(var(--mantine-spacing-xs) - 2px)"
1131
+ },
1132
+ children: isLoading ? loadingComponent : isEmpty ? /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { padding: "6px 8px" }, children: emptyMessage }) : children
1133
+ }
1134
+ ) })
1135
+ ] });
1136
+ };
1137
+ var activeColor2 = "var(--color-primary)";
1138
+ var defaultColor = "var(--color-text-subtle)";
1139
+ var hoverColor = "var(--color-text)";
1140
+ var activeBg2 = `color-mix(in srgb, ${activeColor2} 10%, transparent)`;
1141
+ var SidebarListItem = ({
1142
+ icon: Icon,
1143
+ label,
1144
+ isActive = false,
1145
+ onClick,
1146
+ description,
1147
+ badge,
1148
+ disabled = false
1149
+ }) => {
1150
+ return /* @__PURE__ */ jsx(
1151
+ UnstyledButton,
1152
+ {
1153
+ onClick: disabled ? void 0 : onClick,
1154
+ disabled,
1155
+ style: {
1156
+ width: "100%",
1157
+ padding: "var(--mantine-spacing-xs)",
1158
+ backgroundColor: isActive ? activeBg2 : "transparent",
1159
+ borderRadius: "var(--mantine-radius-xs)",
1160
+ transition: `all var(--duration-fast) var(--easing)`,
1161
+ cursor: disabled ? "not-allowed" : "pointer",
1162
+ opacity: disabled ? 0.5 : 1
1163
+ },
1164
+ onMouseEnter: (e) => {
1165
+ if (!isActive && !disabled) {
1166
+ e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
1167
+ const textElements = e.currentTarget.querySelectorAll("[data-text-element]");
1168
+ textElements.forEach((el) => {
1169
+ el.style.color = hoverColor;
1170
+ });
1171
+ }
1172
+ },
1173
+ onMouseLeave: (e) => {
1174
+ if (!isActive && !disabled) {
1175
+ e.currentTarget.style.backgroundColor = "transparent";
1176
+ const textElements = e.currentTarget.querySelectorAll("[data-text-element]");
1177
+ textElements.forEach((el) => {
1178
+ el.style.color = defaultColor;
1179
+ });
1180
+ }
1181
+ },
1182
+ children: /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
1183
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
1184
+ /* @__PURE__ */ jsx(
1185
+ Icon,
1186
+ {
1187
+ size: 14,
1188
+ style: {
1189
+ flexShrink: 0,
1190
+ opacity: isActive ? 1 : 0.6,
1191
+ color: isActive ? activeColor2 : defaultColor
1192
+ }
1193
+ }
1194
+ ),
1195
+ /* @__PURE__ */ jsx(
1196
+ Text,
1197
+ {
1198
+ size: "sm",
1199
+ fw: isActive ? 600 : 400,
1200
+ style: {
1201
+ overflow: "hidden",
1202
+ textOverflow: "ellipsis",
1203
+ whiteSpace: "nowrap",
1204
+ flex: 1,
1205
+ fontFamily: "var(--elevasis-font-family-subtitle)",
1206
+ color: isActive ? activeColor2 : defaultColor,
1207
+ transition: `color var(--duration-fast) var(--easing)`
1208
+ },
1209
+ "data-text-element": true,
1210
+ children: label
1211
+ }
1212
+ ),
1213
+ badge && /* @__PURE__ */ jsx("div", { style: { flexShrink: 0 }, children: badge })
1214
+ ] }),
1215
+ description && /* @__PURE__ */ jsx(
1216
+ Text,
1217
+ {
1218
+ size: "xs",
1219
+ c: "dimmed",
1220
+ style: {
1221
+ paddingLeft: "22px",
1222
+ lineHeight: 1.2,
1223
+ color: isActive ? activeColor2 : defaultColor,
1224
+ opacity: isActive ? 0.8 : 0.6,
1225
+ transition: `all var(--duration-fast) var(--easing)`,
1226
+ display: "-webkit-box",
1227
+ WebkitLineClamp: 2,
1228
+ WebkitBoxOrient: "vertical",
1229
+ overflow: "hidden",
1230
+ textOverflow: "ellipsis"
1231
+ },
1232
+ "data-text-element": true,
1233
+ children: description
1234
+ }
1235
+ )
1236
+ ] })
1237
+ }
1238
+ );
1239
+ };
1240
+ var SubshellContainer = ({ children, className }) => {
1241
+ return /* @__PURE__ */ jsx(
1242
+ "div",
1243
+ {
1244
+ className,
1245
+ style: {
1246
+ display: "flex",
1247
+ height: "100%",
1248
+ width: "100%",
1249
+ position: "relative"
1250
+ },
1251
+ children
1252
+ }
1253
+ );
1254
+ };
1255
+ var SubshellRightSideContainer = ({ children, className }) => {
1256
+ return /* @__PURE__ */ jsx(
1257
+ "div",
1258
+ {
1259
+ className,
1260
+ style: {
1261
+ flex: 1,
1262
+ minWidth: 0,
1263
+ display: "flex",
1264
+ flexDirection: "column",
1265
+ overflow: "hidden"
1266
+ },
1267
+ children
1268
+ }
1269
+ );
1270
+ };
1271
+ var mdSpacing = 16;
1272
+ var SubshellContentContainer = ({ children, className }) => {
1273
+ return /* @__PURE__ */ jsx(
1274
+ "div",
1275
+ {
1276
+ className,
1277
+ style: {
1278
+ display: "flex",
1279
+ flexDirection: "column",
1280
+ flex: 1,
1281
+ overflowX: "clip",
1282
+ overflowY: "auto",
1283
+ minWidth: 0,
1284
+ minHeight: 0,
1285
+ padding: "var(--mantine-spacing-md)",
1286
+ paddingTop: `${topbarHeight + mdSpacing}px`
1287
+ },
1288
+ children
1289
+ }
1290
+ );
1291
+ };
1292
+ var SubshellSidebar = ({ children, className, width }) => {
1293
+ return /* @__PURE__ */ jsx(
1294
+ "aside",
1295
+ {
1296
+ className,
1297
+ style: {
1298
+ width: `${width}px`,
1299
+ flexShrink: 0,
1300
+ display: "flex",
1301
+ flexDirection: "column",
1302
+ backgroundColor: "var(--glass-background)",
1303
+ backdropFilter: "var(--glass-blur)",
1304
+ WebkitBackdropFilter: "var(--glass-blur)",
1305
+ borderRight: "1px solid var(--color-border)",
1306
+ minHeight: `calc(100vh - ${topbarHeight}px)`,
1307
+ marginTop: `${topbarHeight}px`,
1308
+ fontFamily: "var(--elevasis-font-family-subtitle)"
1309
+ },
1310
+ children
1311
+ }
1312
+ );
1313
+ };
1314
+ var SubshellSidebarSection = ({
1315
+ icon: Icon,
1316
+ label,
1317
+ rightSection,
1318
+ withTopBorder = false
1319
+ }) => {
1320
+ return /* @__PURE__ */ jsx(
1321
+ Box,
1322
+ {
1323
+ p: "sm",
1324
+ style: {
1325
+ borderTop: withTopBorder ? "1px solid var(--color-border)" : void 0,
1326
+ borderBottom: "1px solid var(--color-border)"
1327
+ },
1328
+ children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1329
+ /* @__PURE__ */ jsx(Icon, { size: 16, color: "var(--color-text-subtle)" }),
1330
+ /* @__PURE__ */ jsx(
1331
+ Text,
1332
+ {
1333
+ size: "sm",
1334
+ fw: 600,
1335
+ c: "var(--color-text-subtle)",
1336
+ style: { fontFamily: "var(--mantine-font-family-headings)", flex: 1 },
1337
+ children: label
1338
+ }
1339
+ ),
1340
+ rightSection
1341
+ ] })
1342
+ }
1343
+ );
1344
+ };
1345
+
1346
+ // src/components/layout/sub-shell/constants.ts
1347
+ var subsidebarWidth = 200;
1348
+ function SubshellLoader() {
1349
+ return /* @__PURE__ */ jsx(Center, { mih: "calc(100vh - 70px)", children: /* @__PURE__ */ jsx(Loader, { size: "lg", loaders: { elevasis: ElevasisLoader }, type: "elevasis" }) });
1350
+ }
1351
+ var TopbarContainer = ({ children }) => {
1352
+ const { isCollapsed } = useSidebar();
1353
+ const actualSidebarWidth = isCollapsed ? sidebarCollapsedWidth : sidebarWidth;
1354
+ return /* @__PURE__ */ jsx(
1355
+ "div",
1356
+ {
1357
+ style: {
1358
+ position: "fixed",
1359
+ top: 0,
1360
+ left: `${actualSidebarWidth}px`,
1361
+ height: `${topbarHeight}px`,
1362
+ width: `calc(100% - ${actualSidebarWidth}px)`,
1363
+ backgroundColor: "var(--glass-background)",
1364
+ backdropFilter: "var(--glass-blur)",
1365
+ WebkitBackdropFilter: "var(--glass-blur)",
1366
+ borderBottom: "1px solid var(--color-border)",
1367
+ boxShadow: "var(--card-shadow)",
1368
+ padding: "var(--mantine-spacing-sm)",
1369
+ display: "flex",
1370
+ alignItems: "center",
1371
+ justifyContent: "space-between",
1372
+ zIndex: 100,
1373
+ // Add transition to match sidebar animation
1374
+ transition: `left ${sidebarTransitionDuration}ms var(--easing), width ${sidebarTransitionDuration}ms var(--easing)`
1375
+ },
1376
+ children
1377
+ }
1378
+ );
1379
+ };
1380
+ var Topbar = ({ version, leftContent, children }) => {
1381
+ const { colorScheme, toggleColorScheme } = useMantineColorScheme();
1382
+ const isDark = colorScheme === "dark";
1383
+ const [switchChecked, setSwitchChecked] = useState(isDark);
1384
+ const [isToggling, setIsToggling] = useState(false);
1385
+ useEffect(() => {
1386
+ if (!isToggling) {
1387
+ setSwitchChecked(isDark);
1388
+ }
1389
+ }, [isDark, isToggling]);
1390
+ const handleSwitchToggle = (event) => {
1391
+ const checked = event.currentTarget.checked;
1392
+ setIsToggling(true);
1393
+ toggleColorScheme();
1394
+ setTimeout(() => {
1395
+ setSwitchChecked(checked);
1396
+ setTimeout(() => {
1397
+ setIsToggling(false);
1398
+ }, 200);
1399
+ }, 10);
1400
+ };
1401
+ return /* @__PURE__ */ jsxs(TopbarContainer, { children: [
1402
+ leftContent,
1403
+ /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
1404
+ children,
1405
+ /* @__PURE__ */ jsx(
1406
+ Switch,
1407
+ {
1408
+ size: "md",
1409
+ checked: switchChecked,
1410
+ onChange: handleSwitchToggle,
1411
+ onLabel: /* @__PURE__ */ jsx(IconSun, { size: 16, stroke: 2.5, color: "var(--mantine-color-yellow-4)" }),
1412
+ offLabel: /* @__PURE__ */ jsx(IconMoonStars, { size: 16, stroke: 2.5, color: "var(--mantine-color-blue-6)" }),
1413
+ styles: {
1414
+ track: {
1415
+ backgroundColor: "var(--color-surface-hover)",
1416
+ borderColor: "var(--color-border)"
1417
+ }
1418
+ }
1419
+ }
1420
+ ),
1421
+ /* @__PURE__ */ jsx(
1422
+ Code,
1423
+ {
1424
+ style: {
1425
+ backgroundColor: "var(--color-surface)",
1426
+ color: "var(--color-text)",
1427
+ fontSize: "var(--mantine-font-size-xs)",
1428
+ fontWeight: 700,
1429
+ padding: "2px 6px",
1430
+ borderRadius: "var(--mantine-radius-xs)",
1431
+ border: "1px solid var(--color-border)"
1432
+ },
1433
+ children: version
1434
+ }
1435
+ )
1436
+ ] })
1437
+ ] });
1438
+ };
1439
+
1440
+ export { AppShellCenteredContainer, AppShellContainer, AppShellContentContainer, AppShellError, AppShellLoader, AppShellRightSideContainer, AppShellRightSideOuterContainer, AppTopbarAdjusterWrapper, CollapsibleSidebarGroup, FilmGrain, FloatingOrbs, LinksGroup, PageContainer, PerspectiveGrid, RadiantGlow, Sidebar, SidebarListItem, SidebarProvider, SubshellContainer, SubshellContentContainer, SubshellLoader, SubshellRightSideContainer, SubshellSidebar, SubshellSidebarSection, Topbar, TopbarContainer, Vignette, sidebarCollapsedWidth, sidebarHoverDelay, sidebarTransitionDuration, sidebarWidth, subsidebarWidth, topbarHeight, useSidebar, useSidebarCollapse };