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