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