@elevasis/ui 2.40.1 → 2.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/api/index.js +4 -6
  2. package/dist/app/index.css +384 -0
  3. package/dist/app/index.d.ts +108 -0
  4. package/dist/app/index.js +17 -27
  5. package/dist/auth/index.css +659 -0
  6. package/dist/auth/index.js +19 -6
  7. package/dist/charts/index.css +533 -0
  8. package/dist/charts/index.js +18 -15
  9. package/dist/{chunk-RXH4D6TY.js → chunk-5M4HSHQ5.js} +631 -2
  10. package/dist/{chunk-TE4P6OSJ.js → chunk-7FJI76OH.js} +1 -1
  11. package/dist/chunk-GMXGDO3I.js +244 -0
  12. package/dist/{chunk-CXY7FMUM.js → chunk-GUKY77FJ.js} +50 -4
  13. package/dist/{chunk-5JYKCULK.js → chunk-NZ2F5RQ4.js} +44 -2
  14. package/dist/{chunk-WF7CONXF.js → chunk-OJJK27GC.js} +658 -6
  15. package/dist/{chunk-RX6RSKWC.js → chunk-QDXTIQT4.js} +29255 -18312
  16. package/dist/{chunk-73EWE2EW.js → chunk-V5HWC5EW.js} +1 -1
  17. package/dist/components/chat/index.js +1 -2
  18. package/dist/components/index.css +149 -149
  19. package/dist/components/index.js +13 -37
  20. package/dist/components/navigation/index.css +659 -0
  21. package/dist/components/navigation/index.js +25 -4
  22. package/dist/features/auth/index.js +14 -38
  23. package/dist/features/clients/index.css +149 -149
  24. package/dist/features/clients/index.js +13 -37
  25. package/dist/features/crm/index.js +13 -37
  26. package/dist/features/dashboard/index.js +13 -37
  27. package/dist/features/delivery/index.js +13 -37
  28. package/dist/features/knowledge/index.css +659 -0
  29. package/dist/features/knowledge/index.js +25 -248
  30. package/dist/features/lead-gen/index.d.ts +81 -0
  31. package/dist/features/lead-gen/index.js +13 -37
  32. package/dist/features/monitoring/index.js +13 -37
  33. package/dist/features/monitoring/requests/index.d.ts +69 -7
  34. package/dist/features/monitoring/requests/index.js +32 -41
  35. package/dist/features/operations/index.d.ts +79 -0
  36. package/dist/features/operations/index.js +13 -37
  37. package/dist/features/seo/index.js +1 -4
  38. package/dist/features/settings/index.js +13 -37
  39. package/dist/hooks/access/index.css +659 -0
  40. package/dist/hooks/access/index.js +19 -5
  41. package/dist/hooks/delivery/index.js +13 -37
  42. package/dist/hooks/index.d.ts +18 -6
  43. package/dist/hooks/index.js +13 -37
  44. package/dist/hooks/published.d.ts +18 -6
  45. package/dist/hooks/published.js +13 -37
  46. package/dist/index.d.ts +151 -7
  47. package/dist/index.js +14 -38
  48. package/dist/initialization/index.js +1 -1
  49. package/dist/knowledge/index.css +659 -0
  50. package/dist/knowledge/index.d.ts +81 -0
  51. package/dist/knowledge/index.js +25 -15
  52. package/dist/layout/index.css +659 -0
  53. package/dist/layout/index.d.ts +18 -2
  54. package/dist/layout/index.js +24 -7
  55. package/dist/organization/index.js +13 -37
  56. package/dist/provider/index.css +384 -0
  57. package/dist/provider/index.d.ts +120 -1
  58. package/dist/provider/index.js +18 -22
  59. package/dist/provider/published.css +533 -0
  60. package/dist/provider/published.d.ts +121 -2
  61. package/dist/provider/published.js +18 -17
  62. package/dist/test-utils/index.js +4 -6
  63. package/dist/theme/index.js +2 -5
  64. package/dist/theme/presets/index.js +1 -2
  65. package/dist/utils/index.js +1 -3
  66. package/package.json +3 -3
  67. package/dist/chunk-3KMDHCAR.js +0 -52
  68. package/dist/chunk-4DRI3G36.js +0 -1016
  69. package/dist/chunk-5EYJ2GIN.js +0 -122
  70. package/dist/chunk-66U7JOWV.js +0 -425
  71. package/dist/chunk-6D4LCJ52.js +0 -10
  72. package/dist/chunk-6EV47QQW.js +0 -340
  73. package/dist/chunk-6ROXVZ3L.js +0 -9
  74. package/dist/chunk-7MTWRSUZ.js +0 -357
  75. package/dist/chunk-7PHY5ONQ.js +0 -85
  76. package/dist/chunk-B2DZLPDL.js +0 -39
  77. package/dist/chunk-CLDCYJQT.js +0 -1
  78. package/dist/chunk-CTJBPF3Z.js +0 -734
  79. package/dist/chunk-DT3QYZVU.js +0 -23
  80. package/dist/chunk-IIMU5YAJ.js +0 -53
  81. package/dist/chunk-IUQAP4IO.js +0 -2131
  82. package/dist/chunk-J3FLIZY4.js +0 -423
  83. package/dist/chunk-K7GKKETO.js +0 -3157
  84. package/dist/chunk-L7GXUSCV.js +0 -215
  85. package/dist/chunk-LJDYY3XB.js +0 -133
  86. package/dist/chunk-NYBEU5TE.js +0 -118
  87. package/dist/chunk-RH5VWWSC.js +0 -624
  88. package/dist/chunk-SJNIOGVX.js +0 -112
  89. package/dist/chunk-TYRUKGGD.js +0 -46
  90. package/dist/chunk-WLOQ4IBG.js +0 -654
  91. package/dist/chunk-X4WBGKJQ.js +0 -138
  92. package/dist/chunk-X7D6SUKR.js +0 -1234
@@ -1,1234 +0,0 @@
1
- import { SubshellNavItem } from './chunk-X4WBGKJQ.js';
2
- import { useAppearance } from './chunk-L7GXUSCV.js';
3
- import { NavigationButton } from './chunk-NYBEU5TE.js';
4
- import { sidebarItemGap, sidebarSubLinkPaddingY, sidebarSubLinkPaddingX, sidebarSubLinkIndent, sidebarHoverDelay, sidebarTransitionDuration, sidebarCollapsedWidth, sidebarWidth, topbarHeight, sidebarToggleIconSize, sidebarSectionPadding, sidebarGroupChevronSize, sidebarIconInnerSize } from './chunk-DT3QYZVU.js';
5
- import { useRouterContext } from './chunk-Q7DJKLEN.js';
6
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
- import { Collapse, HoverCard, Stack, Group, Text, UnstyledButton, Tooltip, ScrollArea, Menu, Avatar, Container, Title, Button, Box, Center, useMantineColorScheme, Switch, Code } from '@mantine/core';
8
- import { IconLayoutSidebarLeftExpand, IconLayoutSidebarLeftCollapse, IconUser, IconLogout, IconAlertCircle, IconChevronDown, IconChevronRight, IconMoonStars, IconSun } from '@tabler/icons-react';
9
- import { createContext, memo, useEffect, useRef, createElement, useContext, useLayoutEffect, useState } from 'react';
10
-
11
- var randRange = (min, max) => min + Math.random() * (max - min);
12
- var FLUX_SPARKS = Array.from({ length: 30 }, () => {
13
- const duration = randRange(12, 70);
14
- const pulse = randRange(0.8, 2.2);
15
- return {
16
- left: randRange(0, 100),
17
- size: randRange(1.5, 4.2),
18
- duration,
19
- delay: -randRange(0, duration),
20
- drift: randRange(-35, 35),
21
- peak: randRange(0.18, 0.5),
22
- pulse,
23
- pulseDelay: -randRange(0, pulse)
24
- };
25
- });
26
- var FLUX_MOTES = Array.from({ length: 18 }, () => {
27
- const duration = randRange(18, 90);
28
- const pulse = randRange(1.6, 4);
29
- return {
30
- left: randRange(-2, 102),
31
- size: randRange(3.5, 10),
32
- duration,
33
- delay: -randRange(0, duration),
34
- drift: randRange(-55, 55),
35
- blur: randRange(1.5, 5),
36
- peak: randRange(0.22, 0.55),
37
- pulse,
38
- pulseDelay: -randRange(0, pulse)
39
- };
40
- });
41
- var FLUX_GLOWS = Array.from({ length: 10 }, () => {
42
- const duration = randRange(25, 130);
43
- const pulse = randRange(3.5, 7);
44
- return {
45
- left: randRange(-5, 105),
46
- size: randRange(3, 22),
47
- duration,
48
- delay: -randRange(0, duration),
49
- drift: randRange(-80, 80),
50
- blur: randRange(6, 16),
51
- opacity: randRange(0.18, 0.42),
52
- pulse,
53
- pulseDelay: -randRange(0, pulse)
54
- };
55
- });
56
- var KEYFRAMES = `
57
- @keyframes elevasis-cyber-spark-rise {
58
- 0% { transform: translate3d(0, 0, 0); opacity: 0; }
59
- 10% { opacity: var(--cy-peak, 1); }
60
- 85% { opacity: calc(var(--cy-peak, 1) * 0.9); }
61
- 100% { transform: translate3d(var(--cy-drift, 0px), -112vh, 0); opacity: 0; }
62
- }
63
- @keyframes elevasis-cyber-spark-pulse {
64
- 0%, 100% { filter: brightness(0.55); transform: scale(0.8); }
65
- 50% { filter: brightness(1.7); transform: scale(1.25); }
66
- }
67
- @keyframes elevasis-cyber-glow-pulse {
68
- 0%, 100% { transform: scale(0.85); }
69
- 50% { transform: scale(1.2); }
70
- }
71
- @media (prefers-reduced-motion: reduce) {
72
- .elevasis-cyber-spark,
73
- .elevasis-cyber-spark-inner,
74
- .elevasis-cyber-glow,
75
- .elevasis-cyber-glow-inner {
76
- animation: none !important;
77
- }
78
- .elevasis-cyber-spark,
79
- .elevasis-cyber-glow {
80
- opacity: 0 !important;
81
- }
82
- }
83
- `;
84
- function FluxGlows() {
85
- return /* @__PURE__ */ jsx(Fragment, { children: FLUX_GLOWS.map((g, i) => /* @__PURE__ */ jsx(
86
- "div",
87
- {
88
- className: "elevasis-cyber-glow",
89
- style: {
90
- position: "absolute",
91
- bottom: "-5%",
92
- left: `${g.left}%`,
93
- width: `${g.size}px`,
94
- height: `${g.size}px`,
95
- filter: `blur(${g.blur}px)`,
96
- animation: `elevasis-cyber-spark-rise ${g.duration}s linear infinite`,
97
- animationDelay: `${g.delay}s`,
98
- ["--cy-drift"]: `${g.drift}px`,
99
- ["--cy-peak"]: `${g.opacity}`,
100
- willChange: "transform, opacity"
101
- },
102
- children: /* @__PURE__ */ jsx(
103
- "div",
104
- {
105
- className: "elevasis-cyber-glow-inner",
106
- style: {
107
- width: "100%",
108
- height: "100%",
109
- borderRadius: "50%",
110
- background: `radial-gradient(circle, var(--color-primary) 0%, color-mix(in srgb, var(--color-primary) 60%, transparent) 45%, transparent 75%)`,
111
- animation: `elevasis-cyber-glow-pulse ${g.pulse}s ease-in-out infinite`,
112
- animationDelay: `${g.pulseDelay}s`,
113
- willChange: "transform"
114
- }
115
- }
116
- )
117
- },
118
- i
119
- )) });
120
- }
121
- function FluxMotes() {
122
- return /* @__PURE__ */ jsx(Fragment, { children: FLUX_MOTES.map((m, i) => /* @__PURE__ */ jsx(
123
- "div",
124
- {
125
- className: "elevasis-cyber-spark",
126
- style: {
127
- position: "absolute",
128
- bottom: "-3%",
129
- left: `${m.left}%`,
130
- width: `${m.size}px`,
131
- height: `${m.size}px`,
132
- filter: `blur(${m.blur}px)`,
133
- animation: `elevasis-cyber-spark-rise ${m.duration}s linear infinite`,
134
- animationDelay: `${m.delay}s`,
135
- ["--cy-drift"]: `${m.drift}px`,
136
- ["--cy-peak"]: `${m.peak}`,
137
- willChange: "transform, opacity"
138
- },
139
- children: /* @__PURE__ */ jsx(
140
- "div",
141
- {
142
- className: "elevasis-cyber-spark-inner",
143
- style: {
144
- width: "100%",
145
- height: "100%",
146
- borderRadius: "50%",
147
- background: `radial-gradient(circle, var(--color-primary) 0%, color-mix(in srgb, var(--color-primary) 70%, transparent) 55%, transparent 90%)`,
148
- boxShadow: `0 0 ${m.size * 1.2}px color-mix(in srgb, var(--color-primary) 40%, transparent)`,
149
- animation: `elevasis-cyber-spark-pulse ${m.pulse}s ease-in-out infinite`,
150
- animationDelay: `${m.pulseDelay}s`,
151
- willChange: "transform, filter"
152
- }
153
- }
154
- )
155
- },
156
- i
157
- )) });
158
- }
159
- function FluxSparks() {
160
- return /* @__PURE__ */ jsx(Fragment, { children: FLUX_SPARKS.map((s, i) => /* @__PURE__ */ jsx(
161
- "div",
162
- {
163
- className: "elevasis-cyber-spark",
164
- style: {
165
- position: "absolute",
166
- bottom: "-2%",
167
- left: `${s.left}%`,
168
- width: `${s.size}px`,
169
- height: `${s.size}px`,
170
- animation: `elevasis-cyber-spark-rise ${s.duration}s linear infinite`,
171
- animationDelay: `${s.delay}s`,
172
- ["--cy-drift"]: `${s.drift}px`,
173
- ["--cy-peak"]: `${s.peak}`,
174
- willChange: "transform, opacity"
175
- },
176
- children: /* @__PURE__ */ jsx(
177
- "div",
178
- {
179
- className: "elevasis-cyber-spark-inner",
180
- style: {
181
- width: "100%",
182
- height: "100%",
183
- borderRadius: "50%",
184
- background: "var(--color-primary)",
185
- boxShadow: `0 0 ${s.size * 2.5}px var(--color-primary), 0 0 ${s.size * 5}px color-mix(in srgb, var(--color-primary) 50%, transparent)`,
186
- animation: `elevasis-cyber-spark-pulse ${s.pulse}s ease-in-out infinite`,
187
- animationDelay: `${s.pulseDelay}s`,
188
- willChange: "transform, filter"
189
- }
190
- }
191
- )
192
- },
193
- i
194
- )) });
195
- }
196
- function CyberParticles({ variant: _variant, className }) {
197
- return /* @__PURE__ */ jsxs(
198
- "div",
199
- {
200
- className,
201
- "aria-hidden": "true",
202
- style: {
203
- position: "absolute",
204
- inset: 0,
205
- pointerEvents: "none",
206
- overflow: "hidden"
207
- },
208
- children: [
209
- /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
210
- /* @__PURE__ */ jsx(FluxGlows, {}),
211
- /* @__PURE__ */ jsx(FluxMotes, {}),
212
- /* @__PURE__ */ jsx(FluxSparks, {})
213
- ]
214
- }
215
- );
216
- }
217
- function Vignette({ strength = 0.35, className }) {
218
- return /* @__PURE__ */ jsx(
219
- "div",
220
- {
221
- className,
222
- style: {
223
- position: "absolute",
224
- inset: 0,
225
- pointerEvents: "none",
226
- background: `radial-gradient(ellipse 80% 70% at 50% 50%, transparent 50%, rgba(0, 0, 0, ${strength}) 100%)`
227
- }
228
- }
229
- );
230
- }
231
- var AppShellContainer = ({ children }) => {
232
- const { background } = useAppearance();
233
- return /* @__PURE__ */ jsxs(
234
- "div",
235
- {
236
- style: {
237
- height: "100vh",
238
- display: "flex",
239
- backgroundColor: "var(--color-background)",
240
- position: "relative"
241
- },
242
- children: [
243
- background,
244
- children
245
- ]
246
- }
247
- );
248
- };
249
- var AppShellRightSideContainer = ({ children }) => {
250
- return /* @__PURE__ */ jsx(
251
- "main",
252
- {
253
- style: {
254
- flex: 1,
255
- minWidth: 0,
256
- color: "var(--color-text)",
257
- display: "flex",
258
- flexDirection: "column",
259
- minHeight: "100vh"
260
- },
261
- children
262
- }
263
- );
264
- };
265
- var AppShellRightSideOuterContainer = ({ children }) => {
266
- return /* @__PURE__ */ jsx(
267
- "div",
268
- {
269
- style: {
270
- flex: 1,
271
- overflow: "auto",
272
- minWidth: 0,
273
- minHeight: "100vh"
274
- },
275
- children
276
- }
277
- );
278
- };
279
- var AppShellContentContainer = ({ children }) => {
280
- return /* @__PURE__ */ jsx(
281
- "div",
282
- {
283
- style: {
284
- height: "100%",
285
- padding: "var(--mantine-spacing-md)"
286
- },
287
- children
288
- }
289
- );
290
- };
291
- var PageContainer = ({ children }) => {
292
- return (
293
- // Add padding to the top of the container to adjust for the topbar height
294
- /* @__PURE__ */ jsx(Container, { size: "xl", p: 0, w: "100%", children: /* @__PURE__ */ jsx(Stack, { gap: "lg", children }) })
295
- );
296
- };
297
- var AppTopbarAdjusterWrapper = ({ children }) => {
298
- const padding = `${topbarHeight}px`;
299
- return /* @__PURE__ */ jsx("div", { style: { paddingTop: padding }, children });
300
- };
301
- var standardMdSpacing = 16;
302
- var topAndBottomSpacing = standardMdSpacing * 2;
303
- var AppShellCenteredContainer = ({ children }) => {
304
- return /* @__PURE__ */ jsx(
305
- "div",
306
- {
307
- style: {
308
- display: "flex",
309
- alignItems: "center",
310
- justifyContent: "center",
311
- margin: "auto auto",
312
- height: `calc(100vh - ${topbarHeight + topAndBottomSpacing}px)`,
313
- textAlign: "center"
314
- },
315
- children
316
- }
317
- );
318
- };
319
- var AppShellLoader = () => {
320
- const { loader } = useAppearance();
321
- return /* @__PURE__ */ jsx(AppShellCenteredContainer, { children: loader });
322
- };
323
- var AppShellError = ({ message, retry }) => {
324
- return /* @__PURE__ */ jsx(AppShellCenteredContainer, { children: /* @__PURE__ */ jsxs(Stack, { align: "center", gap: "md", children: [
325
- /* @__PURE__ */ jsx(IconAlertCircle, { size: 48, color: "var(--color-error)" }),
326
- /* @__PURE__ */ jsx(Title, { order: 3, c: "dimmed", children: message }),
327
- retry && /* @__PURE__ */ jsx(Button, { onClick: retry, children: "Retry" })
328
- ] }) });
329
- };
330
- var SidebarContext = createContext(void 0);
331
- var SIDEBAR_COLLAPSED_KEY = "sidebar-collapsed";
332
- var SidebarProvider = ({ children }) => {
333
- const [expandedGroups, setExpandedGroups] = useState({});
334
- const [isInitialized, setIsInitialized] = useState(false);
335
- const [isCollapsed, setIsCollapsed] = useState(() => {
336
- if (typeof window !== "undefined" && window.innerWidth < 1024) {
337
- return true;
338
- }
339
- const stored = localStorage.getItem(SIDEBAR_COLLAPSED_KEY);
340
- return stored === "true";
341
- });
342
- const toggleGroup = (groupLabel) => {
343
- setExpandedGroups((prev) => ({
344
- ...prev,
345
- [groupLabel]: !prev[groupLabel]
346
- }));
347
- };
348
- const initializeGroups = (groups) => {
349
- if (!isInitialized) {
350
- const initialState = {};
351
- groups.forEach((group) => {
352
- initialState[group.label] = group.initiallyOpened || false;
353
- });
354
- setExpandedGroups(initialState);
355
- setIsInitialized(true);
356
- }
357
- };
358
- const toggleCollapsed = () => {
359
- setIsCollapsed((prev) => {
360
- const newValue = !prev;
361
- localStorage.setItem(SIDEBAR_COLLAPSED_KEY, String(newValue));
362
- return newValue;
363
- });
364
- };
365
- const setCollapsed = (value) => {
366
- setIsCollapsed(value);
367
- localStorage.setItem(SIDEBAR_COLLAPSED_KEY, String(value));
368
- };
369
- useEffect(() => {
370
- const handleStorageChange = (e) => {
371
- if (e.key === SIDEBAR_COLLAPSED_KEY && e.newValue !== null) {
372
- setIsCollapsed(e.newValue === "true");
373
- }
374
- };
375
- window.addEventListener("storage", handleStorageChange);
376
- return () => window.removeEventListener("storage", handleStorageChange);
377
- }, []);
378
- return /* @__PURE__ */ jsx(
379
- SidebarContext.Provider,
380
- {
381
- value: {
382
- expandedGroups,
383
- toggleGroup,
384
- initializeGroups,
385
- isCollapsed,
386
- toggleCollapsed,
387
- setCollapsed
388
- },
389
- children
390
- }
391
- );
392
- };
393
- var useSidebar = () => {
394
- const context = useContext(SidebarContext);
395
- if (context === void 0) {
396
- throw new Error("useSidebar must be used within a SidebarProvider");
397
- }
398
- return context;
399
- };
400
-
401
- // src/components/layout/sidebar/components/link-group-components/utils.ts
402
- var isPathActive = (linkPath, currentPath) => {
403
- if (!currentPath || !linkPath) return false;
404
- if (currentPath === linkPath) return true;
405
- const linkSegments = linkPath.split("/").filter(Boolean);
406
- const currentSegments = currentPath.split("/").filter(Boolean);
407
- if (currentSegments.length < linkSegments.length) return false;
408
- for (let i = 0; i < linkSegments.length; i++) {
409
- if (linkSegments[i] !== currentSegments[i]) return false;
410
- }
411
- return true;
412
- };
413
- var isOverviewLink = (label, link) => {
414
- return label === "Overview" && (link === "/admin" || link === "/operations" || link === "/monitoring" || link === "/settings" || link === "/execution-engine" || link === "/acquisition");
415
- };
416
- var isLinkItemActive = (linkItem, currentPath) => {
417
- const isKnowledgeBaseActive = linkItem.link === "/knowledge" && currentPath.startsWith("/knowledge") && !currentPath.startsWith("/knowledge/command-view");
418
- const matchesExtraPath = linkItem.activeMatchPaths?.some((path) => isPathActive(path, currentPath)) ?? false;
419
- if (isKnowledgeBaseActive) return true;
420
- if (linkItem.exact || isOverviewLink(linkItem.label, linkItem.link)) {
421
- return currentPath === linkItem.link || matchesExtraPath;
422
- }
423
- return isPathActive(linkItem.link, currentPath) || matchesExtraPath;
424
- };
425
- var SubLinkItem = ({ linkItem, currentPath }) => {
426
- const { Link } = useRouterContext();
427
- const isActive = isLinkItemActive(linkItem, currentPath);
428
- const activeColor2 = "var(--color-primary)";
429
- const activeColorBg = "color-mix(in srgb, var(--color-primary) 10%, transparent)";
430
- const defaultColor = "var(--color-text-subtle)";
431
- const hoverColor = "var(--color-text)";
432
- return /* @__PURE__ */ jsx(
433
- Link,
434
- {
435
- to: linkItem.link,
436
- onClick: linkItem.onClick,
437
- "data-onboarding-tour-id": linkItem.dataOnboardingTourId,
438
- style: {
439
- display: "block",
440
- textDecoration: "none",
441
- fontFamily: "var(--elevasis-font-family-subtitle)",
442
- fontSize: "var(--mantine-font-size-sm)",
443
- color: isActive ? activeColor2 : defaultColor,
444
- backgroundColor: isActive ? activeColorBg : "transparent",
445
- padding: `${sidebarSubLinkPaddingY}px ${sidebarSubLinkPaddingX}px ${sidebarSubLinkPaddingY}px ${sidebarSubLinkIndent}px`,
446
- borderRadius: "var(--mantine-radius-default)",
447
- transition: `all var(--duration-fast) var(--easing)`,
448
- fontWeight: isActive ? 600 : 400
449
- },
450
- onMouseEnter: (e) => {
451
- if (!isActive) {
452
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
453
- e.currentTarget.style.color = hoverColor;
454
- }
455
- },
456
- onMouseLeave: (e) => {
457
- if (!isActive) {
458
- e.currentTarget.style.backgroundColor = "transparent";
459
- e.currentTarget.style.color = defaultColor;
460
- }
461
- },
462
- children: linkItem.label
463
- }
464
- );
465
- };
466
- var MainButton = ({
467
- icon,
468
- label,
469
- isCollapsed,
470
- hasLinks,
471
- opened,
472
- isIconTextActive,
473
- isBackgroundActive,
474
- onClick,
475
- link,
476
- noWrapper = false
477
- }) => {
478
- const { Link } = useRouterContext();
479
- const button = /* @__PURE__ */ jsx(
480
- NavigationButton,
481
- {
482
- icon,
483
- label,
484
- isCollapsed,
485
- hasSubItems: hasLinks,
486
- isExpanded: opened,
487
- isActive: isIconTextActive,
488
- hasActiveBackground: isBackgroundActive,
489
- onClick,
490
- transitionDuration: sidebarTransitionDuration
491
- }
492
- );
493
- const wrapperStyle = { marginBottom: `${sidebarItemGap}px` };
494
- if (noWrapper) {
495
- return button;
496
- }
497
- if (!hasLinks && link) {
498
- return /* @__PURE__ */ jsx("div", { style: wrapperStyle, children: /* @__PURE__ */ jsx(Link, { to: link, style: { textDecoration: "none" }, children: button }) });
499
- }
500
- return /* @__PURE__ */ jsx("div", { style: wrapperStyle, children: button });
501
- };
502
- var CollapsedWithTooltip = ({ label, children }) => {
503
- return /* @__PURE__ */ jsx(Tooltip, { label, position: "right", offset: 12, children });
504
- };
505
- var CollapsedWithHoverCard = ({
506
- label,
507
- icon: Icon,
508
- links,
509
- currentPath,
510
- children
511
- }) => {
512
- const { Link } = useRouterContext();
513
- return /* @__PURE__ */ jsxs(
514
- HoverCard,
515
- {
516
- width: 200,
517
- position: "right-start",
518
- shadow: "md",
519
- withinPortal: true,
520
- offset: 12,
521
- openDelay: sidebarHoverDelay,
522
- closeDelay: 150,
523
- zIndex: 9999,
524
- children: [
525
- /* @__PURE__ */ jsx(HoverCard.Target, { children: /* @__PURE__ */ jsx("div", { style: { display: "inline-block", width: "100%" }, children }) }),
526
- /* @__PURE__ */ jsx(
527
- HoverCard.Dropdown,
528
- {
529
- style: {
530
- padding: "var(--mantine-spacing-sm)",
531
- background: "var(--glass-background)",
532
- backdropFilter: "var(--glass-blur)"
533
- },
534
- children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
535
- /* @__PURE__ */ jsxs(
536
- Group,
537
- {
538
- gap: "xs",
539
- style: {
540
- paddingBottom: "8px",
541
- borderBottom: "1px solid var(--color-border)",
542
- marginBottom: "4px"
543
- },
544
- children: [
545
- Icon && /* @__PURE__ */ jsx(Icon, { size: 16, stroke: 2 }),
546
- /* @__PURE__ */ jsx(
547
- Text,
548
- {
549
- size: "sm",
550
- fw: 600,
551
- c: "var(--color-text)",
552
- style: { fontFamily: "var(--mantine-font-family-headings)" },
553
- children: label
554
- }
555
- )
556
- ]
557
- }
558
- ),
559
- links.map((linkItem) => {
560
- const isActive = currentPath === linkItem.link;
561
- return /* @__PURE__ */ jsx(Link, { to: linkItem.link, style: { textDecoration: "none" }, onClick: () => {
562
- }, children: /* @__PURE__ */ jsx(
563
- UnstyledButton,
564
- {
565
- style: {
566
- width: "100%",
567
- padding: "8px 12px",
568
- borderRadius: "var(--mantine-radius-default)",
569
- backgroundColor: isActive ? "color-mix(in srgb, var(--color-primary) 10%, transparent)" : "transparent",
570
- color: isActive ? "var(--color-primary)" : "var(--color-text)",
571
- transition: "all var(--duration-fast) var(--easing)"
572
- },
573
- onMouseEnter: (e) => {
574
- if (!isActive) {
575
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
576
- }
577
- },
578
- onMouseLeave: (e) => {
579
- e.currentTarget.style.backgroundColor = isActive ? "color-mix(in srgb, var(--color-primary) 10%, transparent)" : "transparent";
580
- },
581
- children: /* @__PURE__ */ jsx(Text, { size: "sm", style: { lineHeight: 1.2 }, children: linkItem.label })
582
- }
583
- ) }, linkItem.link);
584
- })
585
- ] })
586
- }
587
- )
588
- ]
589
- }
590
- );
591
- };
592
- var LinksGroup = memo(function LinksGroup2({
593
- icon: Icon,
594
- label,
595
- links = [],
596
- link,
597
- onClick,
598
- currentPath = "",
599
- opened = false,
600
- onToggle
601
- }) {
602
- const hasLinks = links.length > 0;
603
- const { navigate } = useRouterContext();
604
- const { isCollapsed } = useSidebar();
605
- useEffect(() => {
606
- if (isCollapsed && opened && onToggle) {
607
- onToggle();
608
- }
609
- }, [isCollapsed, opened, onToggle]);
610
- const hasActiveChild = hasLinks && links.some((item) => isLinkItemActive(item, currentPath));
611
- const isParentActive = !hasLinks && (link === "/" ? currentPath === "/" : isPathActive(link || "", currentPath));
612
- const isIconTextActive = isParentActive || hasActiveChild;
613
- const isBackgroundActive = isParentActive || hasActiveChild && !opened;
614
- const prevPathRef = useRef(null);
615
- useEffect(() => {
616
- const pathChanged = prevPathRef.current !== currentPath;
617
- prevPathRef.current = currentPath;
618
- if (pathChanged && !isCollapsed && hasActiveChild && !opened && onToggle) {
619
- onToggle();
620
- }
621
- }, [currentPath, hasActiveChild, isCollapsed, opened, onToggle]);
622
- const handleMainClick = () => {
623
- if (hasLinks && !isCollapsed) {
624
- onToggle?.();
625
- } else if (!hasLinks) {
626
- if (link) {
627
- navigate(link);
628
- }
629
- onClick?.();
630
- }
631
- };
632
- const items = links.map((item) => /* @__PURE__ */ jsx(SubLinkItem, { linkItem: item, currentPath }, item.label));
633
- const mainButton = /* @__PURE__ */ jsx(
634
- MainButton,
635
- {
636
- icon: Icon,
637
- label,
638
- isCollapsed,
639
- hasLinks,
640
- opened,
641
- isIconTextActive,
642
- isBackgroundActive,
643
- onClick: handleMainClick,
644
- link
645
- }
646
- );
647
- if (isCollapsed && hasLinks) {
648
- const mainButtonNoWrapper = /* @__PURE__ */ jsx(
649
- MainButton,
650
- {
651
- icon: Icon,
652
- label,
653
- isCollapsed,
654
- hasLinks,
655
- opened,
656
- isIconTextActive,
657
- isBackgroundActive,
658
- onClick: handleMainClick,
659
- link,
660
- noWrapper: true
661
- }
662
- );
663
- return /* @__PURE__ */ jsx("div", { style: { marginBottom: `${sidebarItemGap}px` }, children: /* @__PURE__ */ jsx(CollapsedWithHoverCard, { label, icon: Icon, links, currentPath, children: mainButtonNoWrapper }) });
664
- }
665
- if (isCollapsed && !hasLinks) {
666
- const mainButtonNoWrapper = /* @__PURE__ */ jsx(
667
- MainButton,
668
- {
669
- icon: Icon,
670
- label,
671
- isCollapsed,
672
- hasLinks,
673
- opened,
674
- isIconTextActive,
675
- isBackgroundActive,
676
- onClick: handleMainClick,
677
- link,
678
- noWrapper: true
679
- }
680
- );
681
- return /* @__PURE__ */ jsx("div", { style: { marginBottom: `${sidebarItemGap}px` }, children: /* @__PURE__ */ jsx(CollapsedWithTooltip, { label, children: mainButtonNoWrapper }) });
682
- }
683
- return /* @__PURE__ */ jsxs(Fragment, { children: [
684
- mainButton,
685
- hasLinks && /* @__PURE__ */ jsx(Collapse, { in: opened && !isCollapsed, children: /* @__PURE__ */ jsx("div", { style: { paddingLeft: "0px" }, children: items }) })
686
- ] });
687
- });
688
- var useSidebarCollapse = () => {
689
- const { isCollapsed, toggleCollapsed, setCollapsed } = useSidebar();
690
- useEffect(() => {
691
- const handleKeyDown = (e) => {
692
- if ((e.metaKey || e.ctrlKey) && e.key === "b") {
693
- e.preventDefault();
694
- toggleCollapsed();
695
- }
696
- };
697
- window.addEventListener("keydown", handleKeyDown);
698
- return () => window.removeEventListener("keydown", handleKeyDown);
699
- }, [toggleCollapsed]);
700
- useEffect(() => {
701
- const handleResize = () => {
702
- if (window.innerWidth < 1024) {
703
- setCollapsed(true);
704
- }
705
- };
706
- handleResize();
707
- window.addEventListener("resize", handleResize);
708
- return () => window.removeEventListener("resize", handleResize);
709
- }, [setCollapsed]);
710
- return {
711
- isCollapsed,
712
- toggleCollapsed,
713
- setCollapsed
714
- };
715
- };
716
- var SidebarContainer = ({ children, className }) => {
717
- const { isCollapsed } = useSidebar();
718
- return /* @__PURE__ */ jsx(
719
- "nav",
720
- {
721
- className,
722
- style: {
723
- height: "100vh",
724
- width: isCollapsed ? `${sidebarCollapsedWidth}px` : `${sidebarWidth}px`,
725
- flexShrink: 0,
726
- display: "flex",
727
- flexDirection: "column",
728
- backgroundColor: "var(--glass-background)",
729
- backdropFilter: "var(--glass-blur)",
730
- WebkitBackdropFilter: "var(--glass-blur)",
731
- borderRight: "1px solid var(--color-border)",
732
- boxShadow: "var(--card-shadow)",
733
- transition: `width ${sidebarTransitionDuration}ms var(--easing)`,
734
- overflow: "hidden",
735
- position: "relative",
736
- fontFamily: "var(--mantine-font-family-headings)"
737
- },
738
- children
739
- }
740
- );
741
- };
742
- var SidebarTopSection = ({ logo }) => {
743
- const { isCollapsed, toggleCollapsed } = useSidebar();
744
- return /* @__PURE__ */ jsxs(
745
- "div",
746
- {
747
- style: {
748
- padding: "var(--mantine-spacing-sm)",
749
- borderBottom: "1px solid var(--color-border)",
750
- height: `${topbarHeight}px`,
751
- display: "flex",
752
- alignItems: "center",
753
- justifyContent: "space-between"
754
- },
755
- children: [
756
- !isCollapsed && logo ? /* @__PURE__ */ jsx(
757
- "img",
758
- {
759
- src: logo,
760
- alt: "Logo",
761
- style: {
762
- marginLeft: 12,
763
- width: "auto",
764
- height: "30px",
765
- transition: `opacity ${sidebarTransitionDuration}ms var(--easing)`,
766
- opacity: isCollapsed ? 0 : 1
767
- }
768
- }
769
- ) : /* @__PURE__ */ jsx("div", {}),
770
- /* @__PURE__ */ jsx(
771
- UnstyledButton,
772
- {
773
- onClick: toggleCollapsed,
774
- style: {
775
- padding: "6px",
776
- display: "flex",
777
- alignItems: "center",
778
- justifyContent: "center",
779
- color: "var(--color-text-subtle)",
780
- paddingRight: 6,
781
- marginRight: isCollapsed ? 6 : 0,
782
- transition: "all var(--duration-fast) var(--easing)",
783
- ":hover": {
784
- backgroundColor: "var(--color-surface-hover)",
785
- color: "var(--color-text)"
786
- }
787
- },
788
- onMouseEnter: (e) => {
789
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
790
- e.currentTarget.style.color = "var(--color-text)";
791
- },
792
- onMouseLeave: (e) => {
793
- e.currentTarget.style.backgroundColor = "transparent";
794
- e.currentTarget.style.color = "var(--color-text-subtle)";
795
- },
796
- children: isCollapsed ? /* @__PURE__ */ jsx(
797
- IconLayoutSidebarLeftExpand,
798
- {
799
- size: sidebarToggleIconSize,
800
- stroke: 1.5,
801
- style: {
802
- transition: `transform ${sidebarTransitionDuration}ms var(--easing)`
803
- }
804
- }
805
- ) : /* @__PURE__ */ jsx(
806
- IconLayoutSidebarLeftCollapse,
807
- {
808
- size: sidebarToggleIconSize,
809
- stroke: 1.5,
810
- style: {
811
- transition: `transform ${sidebarTransitionDuration}ms var(--easing)`
812
- }
813
- }
814
- )
815
- }
816
- )
817
- ]
818
- }
819
- );
820
- };
821
- var BOTTOM_SECTION_HEIGHT_VAR = "--elevasis-sidebar-bottom-section-height";
822
- var SidebarBottomSection = ({ user, onLogout, onAccountClick }) => {
823
- const { isCollapsed } = useSidebar();
824
- const rootRef = useRef(null);
825
- useLayoutEffect(() => {
826
- const el = rootRef.current;
827
- if (!el) return;
828
- const update = () => {
829
- document.documentElement.style.setProperty(BOTTOM_SECTION_HEIGHT_VAR, `${el.offsetHeight}px`);
830
- };
831
- update();
832
- const observer = new ResizeObserver(update);
833
- observer.observe(el);
834
- return () => {
835
- observer.disconnect();
836
- document.documentElement.style.removeProperty(BOTTOM_SECTION_HEIGHT_VAR);
837
- };
838
- }, [user]);
839
- if (!user) {
840
- return null;
841
- }
842
- return /* @__PURE__ */ jsx(
843
- "div",
844
- {
845
- ref: rootRef,
846
- style: {
847
- padding: "var(--mantine-spacing-sm)",
848
- borderTop: "1px solid var(--color-border)",
849
- transition: `padding ${sidebarTransitionDuration}ms var(--easing)`
850
- },
851
- children: /* @__PURE__ */ jsxs(Menu, { shadow: "md", width: 200, position: "top-start", offset: 8, children: [
852
- /* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsx(
853
- "div",
854
- {
855
- style: {
856
- borderRadius: "var(--mantine-radius-xs)",
857
- padding: "4px",
858
- transition: "background-color var(--duration-fast)",
859
- display: "flex",
860
- justifyContent: "flex-start",
861
- cursor: "pointer"
862
- },
863
- onMouseEnter: (e) => {
864
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
865
- },
866
- onMouseLeave: (e) => {
867
- e.currentTarget.style.backgroundColor = "transparent";
868
- },
869
- children: /* @__PURE__ */ jsxs(Group, { gap: "sm", wrap: "nowrap", children: [
870
- /* @__PURE__ */ jsx(
871
- Tooltip,
872
- {
873
- label: isCollapsed ? /* @__PURE__ */ jsxs("div", { style: { textAlign: "center" }, children: [
874
- /* @__PURE__ */ jsx("div", { style: { fontWeight: 500 }, children: [user.firstName, user.lastName].filter(Boolean).join(" ") || user.email }),
875
- /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", opacity: 0.8 }, children: user.email })
876
- ] }) : null,
877
- position: "right",
878
- offset: 12,
879
- disabled: !isCollapsed,
880
- children: /* @__PURE__ */ jsx(
881
- Avatar,
882
- {
883
- src: user.profilePictureUrl || void 0,
884
- radius: "xl",
885
- size: isCollapsed ? "sm" : "md",
886
- alt: `${user.firstName || ""} ${user.lastName || ""}`.trim(),
887
- style: {
888
- marginLeft: isCollapsed ? 8 : 0,
889
- transition: `all ${sidebarTransitionDuration}ms var(--easing)`,
890
- cursor: "pointer"
891
- },
892
- children: (user.firstName || user.email).charAt(0).toUpperCase()
893
- }
894
- )
895
- }
896
- ),
897
- /* @__PURE__ */ jsxs(
898
- Stack,
899
- {
900
- gap: 2,
901
- style: {
902
- flex: 1,
903
- minWidth: 0,
904
- opacity: isCollapsed ? 0 : 1,
905
- width: isCollapsed ? 0 : "auto",
906
- overflow: "hidden",
907
- transition: `opacity ${sidebarTransitionDuration}ms var(--easing), width ${sidebarTransitionDuration}ms var(--easing)`
908
- },
909
- children: [
910
- /* @__PURE__ */ jsx(
911
- Text,
912
- {
913
- size: "sm",
914
- fw: 500,
915
- style: {
916
- color: "var(--color-text)",
917
- lineHeight: 1.2,
918
- overflow: "hidden",
919
- textOverflow: "ellipsis",
920
- whiteSpace: "nowrap"
921
- },
922
- children: [user.firstName, user.lastName].filter(Boolean).join(" ") || user.email
923
- }
924
- ),
925
- /* @__PURE__ */ jsx(
926
- Text,
927
- {
928
- size: "xs",
929
- style: {
930
- color: "var(--color-text-subtle)",
931
- lineHeight: 1.2,
932
- overflow: "hidden",
933
- textOverflow: "ellipsis",
934
- whiteSpace: "nowrap"
935
- },
936
- children: user.email
937
- }
938
- )
939
- ]
940
- }
941
- )
942
- ] })
943
- }
944
- ) }),
945
- /* @__PURE__ */ jsxs(
946
- Menu.Dropdown,
947
- {
948
- style: {
949
- background: "var(--glass-background)",
950
- backdropFilter: "var(--glass-blur)",
951
- WebkitBackdropFilter: "var(--glass-blur)"
952
- },
953
- children: [
954
- /* @__PURE__ */ jsx(Menu.Item, { leftSection: /* @__PURE__ */ jsx(IconUser, { size: 14 }), onClick: onAccountClick, children: "Account" }),
955
- onLogout && /* @__PURE__ */ jsx(Menu.Item, { leftSection: /* @__PURE__ */ jsx(IconLogout, { size: 14 }), onClick: onLogout, children: "Logout" })
956
- ]
957
- }
958
- )
959
- ] })
960
- }
961
- );
962
- };
963
- var SidebarMiddleSection = ({ linkElements }) => {
964
- return /* @__PURE__ */ jsx(
965
- ScrollArea,
966
- {
967
- style: {
968
- flex: 1,
969
- padding: sidebarSectionPadding,
970
- transition: `padding ${sidebarTransitionDuration}ms var(--easing)`
971
- },
972
- children: /* @__PURE__ */ jsx("div", { style: { paddingBottom: "var(--mantine-spacing-sm)" }, children: linkElements })
973
- }
974
- );
975
- };
976
- var Sidebar = memo(function Sidebar2({
977
- links = [],
978
- user,
979
- onLogout,
980
- onAccountClick,
981
- className = "",
982
- logo
983
- }) {
984
- const { currentPath } = useRouterContext();
985
- const { expandedGroups, toggleGroup, initializeGroups } = useSidebar();
986
- useSidebarCollapse();
987
- useEffect(() => {
988
- initializeGroups(links);
989
- }, [links, initializeGroups]);
990
- const linkElements = links.map((item) => {
991
- const isOpened = expandedGroups[item.label] || false;
992
- const linkGroup = /* @__PURE__ */ createElement(
993
- LinksGroup,
994
- {
995
- ...item,
996
- key: item.label,
997
- currentPath,
998
- opened: isOpened,
999
- onToggle: () => toggleGroup(item.label)
1000
- }
1001
- );
1002
- if (item.dataOnboardingTourId) {
1003
- return /* @__PURE__ */ jsx("div", { "data-onboarding-tour-id": item.dataOnboardingTourId, children: linkGroup }, item.label);
1004
- }
1005
- return linkGroup;
1006
- });
1007
- return /* @__PURE__ */ jsxs(SidebarContainer, { className, children: [
1008
- /* @__PURE__ */ jsx(SidebarTopSection, { logo }),
1009
- /* @__PURE__ */ jsx(SidebarMiddleSection, { linkElements }),
1010
- /* @__PURE__ */ jsx(SidebarBottomSection, { user, onLogout, onAccountClick })
1011
- ] });
1012
- });
1013
- var activeColor = "var(--color-primary)";
1014
- var defaultTextColor = "var(--color-text)";
1015
- var subtleColor = "var(--color-text-subtle)";
1016
- var activeBg = `color-mix(in srgb, ${activeColor} 10%, transparent)`;
1017
- var CollapsibleSidebarGroup = ({
1018
- icon: Icon,
1019
- label,
1020
- isExpanded,
1021
- onToggle,
1022
- isActive = false,
1023
- badge,
1024
- children,
1025
- onLabelClick,
1026
- emptyMessage = "No items",
1027
- isEmpty = false,
1028
- isLoading = false,
1029
- loadingComponent
1030
- }) => {
1031
- const showActiveStyle = !isExpanded && isActive;
1032
- const iconColor = showActiveStyle ? activeColor : subtleColor;
1033
- const textColor = showActiveStyle ? activeColor : defaultTextColor;
1034
- const fontWeight = showActiveStyle ? 600 : 500;
1035
- const handleLabelClick = (e) => {
1036
- if (onLabelClick) {
1037
- e.stopPropagation();
1038
- onLabelClick();
1039
- }
1040
- };
1041
- return /* @__PURE__ */ jsxs(Box, { children: [
1042
- /* @__PURE__ */ jsx(
1043
- UnstyledButton,
1044
- {
1045
- onClick: onToggle,
1046
- style: {
1047
- display: "flex",
1048
- alignItems: "center",
1049
- width: "100%",
1050
- padding: "var(--mantine-spacing-xs)",
1051
- color: textColor,
1052
- backgroundColor: showActiveStyle ? activeBg : "transparent",
1053
- transition: `all var(--duration-fast) var(--easing)`,
1054
- cursor: "pointer",
1055
- overflow: "hidden"
1056
- },
1057
- onMouseEnter: (e) => {
1058
- if (!showActiveStyle) {
1059
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
1060
- }
1061
- },
1062
- onMouseLeave: (e) => {
1063
- if (!showActiveStyle) {
1064
- e.currentTarget.style.backgroundColor = "transparent";
1065
- }
1066
- },
1067
- children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { width: "100%" }, children: [
1068
- /* @__PURE__ */ jsx(Box, { style: { flexShrink: 0, color: iconColor }, children: isExpanded ? /* @__PURE__ */ jsx(IconChevronDown, { size: sidebarGroupChevronSize }) : /* @__PURE__ */ jsx(IconChevronRight, { size: sidebarGroupChevronSize }) }),
1069
- /* @__PURE__ */ jsx(
1070
- Box,
1071
- {
1072
- style: { flexShrink: 0, color: iconColor, cursor: onLabelClick ? "pointer" : "inherit" },
1073
- onClick: onLabelClick ? handleLabelClick : void 0,
1074
- children: /* @__PURE__ */ jsx(Icon, { size: sidebarIconInnerSize, color: activeColor })
1075
- }
1076
- ),
1077
- /* @__PURE__ */ jsx(
1078
- Text,
1079
- {
1080
- size: "sm",
1081
- fw: fontWeight,
1082
- style: {
1083
- fontFamily: "var(--elevasis-font-family-subtitle)",
1084
- color: textColor,
1085
- transition: `color var(--duration-fast) var(--easing)`,
1086
- overflow: "hidden",
1087
- textOverflow: "ellipsis",
1088
- whiteSpace: "nowrap",
1089
- flex: 1,
1090
- cursor: onLabelClick ? "pointer" : "inherit"
1091
- },
1092
- onClick: onLabelClick ? handleLabelClick : void 0,
1093
- children: label
1094
- }
1095
- ),
1096
- badge && /* @__PURE__ */ jsx(Box, { style: { flexShrink: 0 }, children: badge })
1097
- ] })
1098
- }
1099
- ),
1100
- /* @__PURE__ */ jsx(Collapse, { in: isExpanded, children: /* @__PURE__ */ jsx(
1101
- Stack,
1102
- {
1103
- gap: 0,
1104
- mt: "xs",
1105
- ml: "xs",
1106
- style: {
1107
- borderLeft: `1px solid color-mix(in srgb, var(--color-primary) 40%, transparent)`,
1108
- marginLeft: "calc(var(--mantine-spacing-xs) + 6px)",
1109
- paddingLeft: "calc(var(--mantine-spacing-xs) - 2px)"
1110
- },
1111
- children: isLoading ? loadingComponent : isEmpty ? /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { padding: "6px 8px" }, children: emptyMessage }) : children
1112
- }
1113
- ) })
1114
- ] });
1115
- };
1116
- var SubshellNavList = ({ items }) => {
1117
- const { currentPath, navigate } = useRouterContext();
1118
- return /* @__PURE__ */ jsx(Fragment, { children: items.map((item) => {
1119
- const isActive = item.exact ? currentPath === item.to || currentPath === `${item.to}/` : currentPath.startsWith(item.to);
1120
- return /* @__PURE__ */ jsx(
1121
- SubshellNavItem,
1122
- {
1123
- icon: item.icon,
1124
- label: item.label,
1125
- isActive,
1126
- href: item.to,
1127
- onClick: () => navigate(item.to)
1128
- },
1129
- item.to
1130
- );
1131
- }) });
1132
- };
1133
-
1134
- // src/components/layout/sub-shell/constants.ts
1135
- var subsidebarWidth = 200;
1136
- function SubshellLoader() {
1137
- const { loader } = useAppearance();
1138
- return /* @__PURE__ */ jsx(Center, { mih: "calc(100vh - 70px)", children: loader });
1139
- }
1140
- function SubshellSidebarLoader({ padding = "sm" }) {
1141
- const { loader } = useAppearance();
1142
- return /* @__PURE__ */ jsx(Box, { style: { flex: 1, minHeight: 0, display: "flex" }, children: /* @__PURE__ */ jsx(Center, { p: padding, style: { flex: 1, minHeight: 0 }, children: loader }) });
1143
- }
1144
- var TopbarContainer = ({ children }) => {
1145
- const { isCollapsed } = useSidebar();
1146
- const actualSidebarWidth = isCollapsed ? sidebarCollapsedWidth : sidebarWidth;
1147
- return /* @__PURE__ */ jsx(
1148
- "div",
1149
- {
1150
- style: {
1151
- position: "fixed",
1152
- top: 0,
1153
- left: `${actualSidebarWidth}px`,
1154
- height: `${topbarHeight}px`,
1155
- width: `calc(100% - ${actualSidebarWidth}px)`,
1156
- backgroundColor: "var(--glass-background)",
1157
- backdropFilter: "var(--glass-blur)",
1158
- WebkitBackdropFilter: "var(--glass-blur)",
1159
- borderBottom: "1px solid var(--color-border)",
1160
- boxShadow: "var(--card-shadow)",
1161
- clipPath: "inset(-100px -100px -100px 0)",
1162
- padding: "var(--mantine-spacing-sm)",
1163
- display: "flex",
1164
- alignItems: "center",
1165
- justifyContent: "space-between",
1166
- zIndex: 100,
1167
- // Add transition to match sidebar animation
1168
- transition: `left ${sidebarTransitionDuration}ms var(--easing), width ${sidebarTransitionDuration}ms var(--easing)`
1169
- },
1170
- children
1171
- }
1172
- );
1173
- };
1174
- var Topbar = ({ version, leftContent, children }) => {
1175
- const { colorScheme, toggleColorScheme } = useMantineColorScheme();
1176
- const isDark = colorScheme === "dark";
1177
- const [switchChecked, setSwitchChecked] = useState(isDark);
1178
- const [isToggling, setIsToggling] = useState(false);
1179
- useEffect(() => {
1180
- if (!isToggling) {
1181
- setSwitchChecked(isDark);
1182
- }
1183
- }, [isDark, isToggling]);
1184
- const handleSwitchToggle = (event) => {
1185
- const checked = event.currentTarget.checked;
1186
- setIsToggling(true);
1187
- toggleColorScheme();
1188
- setTimeout(() => {
1189
- setSwitchChecked(checked);
1190
- setTimeout(() => {
1191
- setIsToggling(false);
1192
- }, 200);
1193
- }, 10);
1194
- };
1195
- return /* @__PURE__ */ jsxs(TopbarContainer, { children: [
1196
- leftContent,
1197
- /* @__PURE__ */ jsxs(Group, { gap: "sm", children: [
1198
- children,
1199
- /* @__PURE__ */ jsx(
1200
- Switch,
1201
- {
1202
- size: "md",
1203
- checked: switchChecked,
1204
- onChange: handleSwitchToggle,
1205
- onLabel: /* @__PURE__ */ jsx(IconSun, { size: 16, stroke: 2.5, color: "var(--mantine-color-yellow-4)" }),
1206
- offLabel: /* @__PURE__ */ jsx(IconMoonStars, { size: 16, stroke: 2.5, color: "var(--mantine-color-blue-6)" }),
1207
- styles: {
1208
- track: {
1209
- backgroundColor: "var(--color-surface-hover)",
1210
- borderColor: "var(--color-border)"
1211
- }
1212
- }
1213
- }
1214
- ),
1215
- /* @__PURE__ */ jsx(
1216
- Code,
1217
- {
1218
- style: {
1219
- backgroundColor: "var(--color-surface)",
1220
- color: "var(--color-text)",
1221
- fontSize: "var(--mantine-font-size-xs)",
1222
- fontWeight: 700,
1223
- padding: "2px 6px",
1224
- borderRadius: "var(--mantine-radius-xs)",
1225
- border: "1px solid var(--color-border)"
1226
- },
1227
- children: version
1228
- }
1229
- )
1230
- ] })
1231
- ] });
1232
- };
1233
-
1234
- export { AppShellCenteredContainer, AppShellContainer, AppShellContentContainer, AppShellError, AppShellLoader, AppShellRightSideContainer, AppShellRightSideOuterContainer, AppTopbarAdjusterWrapper, CollapsibleSidebarGroup, CyberParticles, LinksGroup, PageContainer, Sidebar, SidebarContext, SidebarProvider, SubshellLoader, SubshellNavList, SubshellSidebarLoader, Topbar, TopbarContainer, Vignette, subsidebarWidth, useSidebar, useSidebarCollapse };