@elevasis/ui 1.20.1 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts/index.js +3 -2
- package/dist/chunk-3KMDHCAR.js +52 -0
- package/dist/{chunk-4SY4EQSK.js → chunk-5266RV46.js} +3 -3
- package/dist/{chunk-UMFPUM7Q.js → chunk-7TLPKXC2.js} +12 -12
- package/dist/{chunk-OFAXUZPZ.js → chunk-AJPFSMEH.js} +528 -336
- package/dist/chunk-AWT255UH.js +255 -0
- package/dist/{chunk-EMN755L5.js → chunk-CTF6FS2M.js} +10 -216
- package/dist/{chunk-C7AD6N23.js → chunk-DLI3F5IV.js} +364 -364
- package/dist/{chunk-AQ5MQDSS.js → chunk-EDAYKRPJ.js} +404 -2
- package/dist/{chunk-XOTN3X3Z.js → chunk-FATKFO7X.js} +3 -54
- package/dist/{chunk-JZEXFQ6N.js → chunk-HOYZWSNV.js} +91 -80
- package/dist/{chunk-AWMZCYKH.js → chunk-IAZT3VO6.js} +158 -82
- package/dist/{chunk-ERVB3QJQ.js → chunk-N5SDJP44.js} +1 -1
- package/dist/{chunk-3DIU726S.js → chunk-NVSKJG3L.js} +25 -4
- package/dist/{chunk-VLTVZXP6.js → chunk-QZS5FOIR.js} +2 -2
- package/dist/chunk-ROSMICXG.js +668 -0
- package/dist/{chunk-JIABC3AE.js → chunk-WAEKXBP3.js} +516 -266
- package/dist/{chunk-COTI2QPO.js → chunk-ZHJGTOXP.js} +4 -3
- package/dist/components/chat/index.d.ts +202 -0
- package/dist/components/chat/index.js +2 -0
- package/dist/components/index.css +0 -3
- package/dist/components/index.d.ts +37 -37
- package/dist/components/index.js +2652 -2902
- package/dist/features/auth/index.css +0 -3
- package/dist/features/dashboard/index.css +0 -3
- package/dist/features/dashboard/index.js +9 -9
- package/dist/features/monitoring/index.css +0 -3
- package/dist/features/monitoring/index.js +10 -10
- package/dist/features/operations/index.css +0 -3
- package/dist/features/operations/index.d.ts +245 -10
- package/dist/features/operations/index.js +1115 -170
- package/dist/features/settings/index.css +0 -3
- package/dist/features/settings/index.js +9 -9
- package/dist/hooks/index.css +68 -3
- package/dist/hooks/index.d.ts +1165 -4
- package/dist/hooks/index.js +5 -6
- package/dist/hooks/published.css +68 -3
- package/dist/hooks/published.d.ts +1165 -4
- package/dist/hooks/published.js +4 -5
- package/dist/index.css +68 -3
- package/dist/index.d.ts +1166 -5
- package/dist/index.js +6 -7
- package/dist/layout/index.d.ts +4 -4
- package/dist/layout/index.js +3 -4
- package/dist/provider/index.css +0 -3
- package/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.js +3 -4
- package/dist/provider/published.d.ts +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.js +3 -3
- package/dist/types/index.d.ts +1 -1
- package/package.json +7 -2
- package/dist/chunk-JFRG2JJE.js +0 -47
- package/dist/chunk-R3R367QY.js +0 -14
- package/dist/theme/presets/__tests__/getPreset.test.d.ts +0 -2
- package/dist/theme/presets/__tests__/getPreset.test.d.ts.map +0 -1
- package/dist/theme/presets/__tests__/getPreset.test.js +0 -92
- package/dist/theme/presets/cyber-volt.d.ts +0 -12
- package/dist/theme/presets/cyber-volt.d.ts.map +0 -1
- package/dist/theme/presets/cyber-volt.js +0 -70
- package/dist/theme/presets/regal.d.ts +0 -8
- package/dist/theme/presets/regal.d.ts.map +0 -1
- package/dist/theme/presets/regal.js +0 -69
- package/dist/theme/presets/rose-gold.d.ts +0 -12
- package/dist/theme/presets/rose-gold.d.ts.map +0 -1
- package/dist/theme/presets/rose-gold.js +0 -76
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { sidebarGroupChevronSize, sidebarIconInnerSize, sidebarListItemIconSize } from './chunk-QJ2S46NI.js';
|
|
2
|
+
import { useAppearance } from './chunk-QJ2KCHKX.js';
|
|
3
|
+
import { Container, Stack, Box, UnstyledButton, Group, Text, Collapse, Center } from '@mantine/core';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
import { IconChevronDown, IconChevronRight } from '@tabler/icons-react';
|
|
6
|
+
|
|
7
|
+
var PageContainer = ({ children }) => {
|
|
8
|
+
return (
|
|
9
|
+
// Add padding to the top of the container to adjust for the topbar height
|
|
10
|
+
/* @__PURE__ */ jsx(Container, { size: "xl", p: 0, w: "100%", children: /* @__PURE__ */ jsx(Stack, { gap: "lg", children }) })
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
var activeColor = "var(--color-primary)";
|
|
14
|
+
var defaultTextColor = "var(--color-text)";
|
|
15
|
+
var subtleColor = "var(--color-text-subtle)";
|
|
16
|
+
var activeBg = `color-mix(in srgb, ${activeColor} 10%, transparent)`;
|
|
17
|
+
var CollapsibleSidebarGroup = ({
|
|
18
|
+
icon: Icon,
|
|
19
|
+
label,
|
|
20
|
+
isExpanded,
|
|
21
|
+
onToggle,
|
|
22
|
+
isActive = false,
|
|
23
|
+
badge,
|
|
24
|
+
children,
|
|
25
|
+
onLabelClick,
|
|
26
|
+
emptyMessage = "No items",
|
|
27
|
+
isEmpty = false,
|
|
28
|
+
isLoading = false,
|
|
29
|
+
loadingComponent
|
|
30
|
+
}) => {
|
|
31
|
+
const showActiveStyle = !isExpanded && isActive;
|
|
32
|
+
const iconColor = showActiveStyle ? activeColor : subtleColor;
|
|
33
|
+
const textColor = showActiveStyle ? activeColor : defaultTextColor;
|
|
34
|
+
const fontWeight = showActiveStyle ? 600 : 500;
|
|
35
|
+
const handleLabelClick = (e) => {
|
|
36
|
+
if (onLabelClick) {
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
onLabelClick();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
UnstyledButton,
|
|
44
|
+
{
|
|
45
|
+
onClick: onToggle,
|
|
46
|
+
style: {
|
|
47
|
+
display: "flex",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
width: "100%",
|
|
50
|
+
padding: "var(--mantine-spacing-xs)",
|
|
51
|
+
color: textColor,
|
|
52
|
+
backgroundColor: showActiveStyle ? activeBg : "transparent",
|
|
53
|
+
transition: `all var(--duration-fast) var(--easing)`,
|
|
54
|
+
cursor: "pointer",
|
|
55
|
+
overflow: "hidden"
|
|
56
|
+
},
|
|
57
|
+
onMouseEnter: (e) => {
|
|
58
|
+
if (!showActiveStyle) {
|
|
59
|
+
e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
onMouseLeave: (e) => {
|
|
63
|
+
if (!showActiveStyle) {
|
|
64
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { width: "100%" }, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(Box, { style: { flexShrink: 0, color: iconColor }, children: isExpanded ? /* @__PURE__ */ jsx(IconChevronDown, { size: sidebarGroupChevronSize }) : /* @__PURE__ */ jsx(IconChevronRight, { size: sidebarGroupChevronSize }) }),
|
|
69
|
+
/* @__PURE__ */ jsx(
|
|
70
|
+
Box,
|
|
71
|
+
{
|
|
72
|
+
style: { flexShrink: 0, color: iconColor, cursor: onLabelClick ? "pointer" : "inherit" },
|
|
73
|
+
onClick: onLabelClick ? handleLabelClick : void 0,
|
|
74
|
+
children: /* @__PURE__ */ jsx(Icon, { size: sidebarIconInnerSize, color: activeColor })
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
Text,
|
|
79
|
+
{
|
|
80
|
+
size: "sm",
|
|
81
|
+
fw: fontWeight,
|
|
82
|
+
style: {
|
|
83
|
+
fontFamily: "var(--elevasis-font-family-subtitle)",
|
|
84
|
+
color: textColor,
|
|
85
|
+
transition: `color var(--duration-fast) var(--easing)`,
|
|
86
|
+
overflow: "hidden",
|
|
87
|
+
textOverflow: "ellipsis",
|
|
88
|
+
whiteSpace: "nowrap",
|
|
89
|
+
flex: 1,
|
|
90
|
+
cursor: onLabelClick ? "pointer" : "inherit"
|
|
91
|
+
},
|
|
92
|
+
onClick: onLabelClick ? handleLabelClick : void 0,
|
|
93
|
+
children: label
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
badge && /* @__PURE__ */ jsx(Box, { style: { flexShrink: 0 }, children: badge })
|
|
97
|
+
] })
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ jsx(Collapse, { in: isExpanded, children: /* @__PURE__ */ jsx(
|
|
101
|
+
Stack,
|
|
102
|
+
{
|
|
103
|
+
gap: 0,
|
|
104
|
+
mt: "xs",
|
|
105
|
+
ml: "xs",
|
|
106
|
+
style: {
|
|
107
|
+
borderLeft: `1px solid color-mix(in srgb, var(--color-primary) 40%, transparent)`,
|
|
108
|
+
marginLeft: "calc(var(--mantine-spacing-xs) + 6px)",
|
|
109
|
+
paddingLeft: "calc(var(--mantine-spacing-xs) - 2px)"
|
|
110
|
+
},
|
|
111
|
+
children: isLoading ? loadingComponent : isEmpty ? /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { padding: "6px 8px" }, children: emptyMessage }) : children
|
|
112
|
+
}
|
|
113
|
+
) })
|
|
114
|
+
] });
|
|
115
|
+
};
|
|
116
|
+
var activeColor2 = "var(--color-primary)";
|
|
117
|
+
var defaultColor = "var(--color-text-subtle)";
|
|
118
|
+
var hoverColor = "var(--color-text)";
|
|
119
|
+
var activeBg2 = `color-mix(in srgb, ${activeColor2} 10%, transparent)`;
|
|
120
|
+
var SidebarListItem = ({
|
|
121
|
+
icon: Icon,
|
|
122
|
+
label,
|
|
123
|
+
isActive = false,
|
|
124
|
+
onClick,
|
|
125
|
+
description,
|
|
126
|
+
badge,
|
|
127
|
+
disabled = false
|
|
128
|
+
}) => {
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
UnstyledButton,
|
|
131
|
+
{
|
|
132
|
+
onClick: disabled ? void 0 : onClick,
|
|
133
|
+
disabled,
|
|
134
|
+
style: {
|
|
135
|
+
width: "100%",
|
|
136
|
+
padding: "var(--mantine-spacing-xs)",
|
|
137
|
+
backgroundColor: isActive ? activeBg2 : "transparent",
|
|
138
|
+
borderRadius: "var(--mantine-radius-default)",
|
|
139
|
+
transition: `all var(--duration-fast) var(--easing)`,
|
|
140
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
141
|
+
opacity: disabled ? 0.5 : 1
|
|
142
|
+
},
|
|
143
|
+
onMouseEnter: (e) => {
|
|
144
|
+
if (!isActive && !disabled) {
|
|
145
|
+
e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
|
|
146
|
+
const textElements = e.currentTarget.querySelectorAll("[data-text-element]");
|
|
147
|
+
textElements.forEach((el) => {
|
|
148
|
+
el.style.color = hoverColor;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
onMouseLeave: (e) => {
|
|
153
|
+
if (!isActive && !disabled) {
|
|
154
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
155
|
+
const textElements = e.currentTarget.querySelectorAll("[data-text-element]");
|
|
156
|
+
textElements.forEach((el) => {
|
|
157
|
+
el.style.color = defaultColor;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
|
|
162
|
+
/* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
Icon,
|
|
165
|
+
{
|
|
166
|
+
size: sidebarListItemIconSize,
|
|
167
|
+
style: {
|
|
168
|
+
flexShrink: 0,
|
|
169
|
+
opacity: isActive ? 1 : 0.6,
|
|
170
|
+
color: isActive ? activeColor2 : defaultColor
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
Text,
|
|
176
|
+
{
|
|
177
|
+
size: "sm",
|
|
178
|
+
fw: isActive ? 600 : 400,
|
|
179
|
+
style: {
|
|
180
|
+
overflow: "hidden",
|
|
181
|
+
textOverflow: "ellipsis",
|
|
182
|
+
whiteSpace: "nowrap",
|
|
183
|
+
flex: 1,
|
|
184
|
+
fontFamily: "var(--elevasis-font-family-subtitle)",
|
|
185
|
+
color: isActive ? activeColor2 : defaultColor,
|
|
186
|
+
transition: `color var(--duration-fast) var(--easing)`
|
|
187
|
+
},
|
|
188
|
+
"data-text-element": true,
|
|
189
|
+
children: label
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
badge && /* @__PURE__ */ jsx("div", { style: { flexShrink: 0 }, children: badge })
|
|
193
|
+
] }),
|
|
194
|
+
description && /* @__PURE__ */ jsx(
|
|
195
|
+
Text,
|
|
196
|
+
{
|
|
197
|
+
size: "xs",
|
|
198
|
+
c: "dimmed",
|
|
199
|
+
style: {
|
|
200
|
+
paddingLeft: "22px",
|
|
201
|
+
lineHeight: 1.2,
|
|
202
|
+
color: isActive ? activeColor2 : defaultColor,
|
|
203
|
+
opacity: isActive ? 0.8 : 0.6,
|
|
204
|
+
transition: `all var(--duration-fast) var(--easing)`,
|
|
205
|
+
display: "-webkit-box",
|
|
206
|
+
WebkitLineClamp: 2,
|
|
207
|
+
WebkitBoxOrient: "vertical",
|
|
208
|
+
overflow: "hidden",
|
|
209
|
+
textOverflow: "ellipsis"
|
|
210
|
+
},
|
|
211
|
+
"data-text-element": true,
|
|
212
|
+
children: description
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
] })
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
};
|
|
219
|
+
var SubshellSidebarSection = ({
|
|
220
|
+
icon: Icon,
|
|
221
|
+
label,
|
|
222
|
+
rightSection,
|
|
223
|
+
withTopBorder = false
|
|
224
|
+
}) => {
|
|
225
|
+
return /* @__PURE__ */ jsx(
|
|
226
|
+
Box,
|
|
227
|
+
{
|
|
228
|
+
p: "sm",
|
|
229
|
+
style: {
|
|
230
|
+
borderTop: withTopBorder ? "1px solid var(--color-border)" : void 0,
|
|
231
|
+
borderBottom: "1px solid var(--color-border)"
|
|
232
|
+
},
|
|
233
|
+
children: /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
|
|
234
|
+
/* @__PURE__ */ jsx(Icon, { size: 16, color: "var(--color-text-subtle)" }),
|
|
235
|
+
/* @__PURE__ */ jsx(
|
|
236
|
+
Text,
|
|
237
|
+
{
|
|
238
|
+
size: "sm",
|
|
239
|
+
fw: 600,
|
|
240
|
+
c: "var(--color-text-subtle)",
|
|
241
|
+
style: { fontFamily: "var(--mantine-font-family-headings)", flex: 1 },
|
|
242
|
+
children: label
|
|
243
|
+
}
|
|
244
|
+
),
|
|
245
|
+
rightSection
|
|
246
|
+
] })
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
};
|
|
250
|
+
function SubshellLoader() {
|
|
251
|
+
const { loader } = useAppearance();
|
|
252
|
+
return /* @__PURE__ */ jsx(Center, { mih: "calc(100vh - 70px)", children: loader });
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export { CollapsibleSidebarGroup, PageContainer, SidebarListItem, SubshellLoader, SubshellSidebarSection };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NavigationButton } from './chunk-NNKKBSJN.js';
|
|
2
|
-
import { sidebarItemGap, sidebarSubLinkPaddingY, sidebarSubLinkPaddingX, sidebarSubLinkIndent, sidebarHoverDelay, sidebarTransitionDuration, sidebarCollapsedWidth, sidebarWidth, topbarHeight, sidebarToggleIconSize, sidebarSectionPadding,
|
|
2
|
+
import { sidebarItemGap, sidebarSubLinkPaddingY, sidebarSubLinkPaddingX, sidebarSubLinkIndent, sidebarHoverDelay, sidebarTransitionDuration, sidebarCollapsedWidth, sidebarWidth, topbarHeight, sidebarToggleIconSize, sidebarSectionPadding, sidebarBottomSectionHeight } from './chunk-QJ2S46NI.js';
|
|
3
3
|
import { useAppearance } from './chunk-QJ2KCHKX.js';
|
|
4
4
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import { createContext, memo, useEffect, createElement, useContext, useRef, useLayoutEffect, useState } from 'react';
|
|
7
|
-
import { Collapse, HoverCard, Stack, Group, Text, UnstyledButton, Tooltip, ScrollArea, Menu, Avatar,
|
|
8
|
-
import { IconLayoutSidebarLeftExpand, IconLayoutSidebarLeftCollapse, IconUser, IconLogout,
|
|
7
|
+
import { Collapse, HoverCard, Stack, Group, Text, UnstyledButton, Tooltip, ScrollArea, Menu, Avatar, useMantineColorScheme, Switch, Code } from '@mantine/core';
|
|
8
|
+
import { IconLayoutSidebarLeftExpand, IconLayoutSidebarLeftCollapse, IconUser, IconLogout, IconMoonStars, IconSun } from '@tabler/icons-react';
|
|
9
9
|
|
|
10
10
|
function Vignette({ strength = 0.35, className }) {
|
|
11
11
|
return /* @__PURE__ */ jsx(
|
|
@@ -174,10 +174,10 @@ var isOverviewLink = (label, link) => {
|
|
|
174
174
|
var SubLinkItem = ({ linkItem, currentPath }) => {
|
|
175
175
|
const { Link } = useRouterContext();
|
|
176
176
|
const isActive = isOverviewLink(linkItem.label, linkItem.link) ? currentPath === linkItem.link : isPathActive(linkItem.link, currentPath);
|
|
177
|
-
const
|
|
177
|
+
const activeColor = "var(--color-primary)";
|
|
178
178
|
const activeColorBg = "color-mix(in srgb, var(--color-primary) 10%, transparent)";
|
|
179
|
-
const
|
|
180
|
-
const
|
|
179
|
+
const defaultColor = "var(--color-text-subtle)";
|
|
180
|
+
const hoverColor = "var(--color-text)";
|
|
181
181
|
return /* @__PURE__ */ jsx(
|
|
182
182
|
Link,
|
|
183
183
|
{
|
|
@@ -188,7 +188,7 @@ var SubLinkItem = ({ linkItem, currentPath }) => {
|
|
|
188
188
|
textDecoration: "none",
|
|
189
189
|
fontFamily: "var(--elevasis-font-family-subtitle)",
|
|
190
190
|
fontSize: "var(--mantine-font-size-sm)",
|
|
191
|
-
color: isActive ?
|
|
191
|
+
color: isActive ? activeColor : defaultColor,
|
|
192
192
|
backgroundColor: isActive ? activeColorBg : "transparent",
|
|
193
193
|
padding: `${sidebarSubLinkPaddingY}px ${sidebarSubLinkPaddingX}px ${sidebarSubLinkPaddingY}px ${sidebarSubLinkIndent}px`,
|
|
194
194
|
borderRadius: "var(--mantine-radius-default)",
|
|
@@ -198,13 +198,13 @@ var SubLinkItem = ({ linkItem, currentPath }) => {
|
|
|
198
198
|
onMouseEnter: (e) => {
|
|
199
199
|
if (!isActive) {
|
|
200
200
|
e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
|
|
201
|
-
e.currentTarget.style.color =
|
|
201
|
+
e.currentTarget.style.color = hoverColor;
|
|
202
202
|
}
|
|
203
203
|
},
|
|
204
204
|
onMouseLeave: (e) => {
|
|
205
205
|
if (!isActive) {
|
|
206
206
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
207
|
-
e.currentTarget.style.color =
|
|
207
|
+
e.currentTarget.style.color = defaultColor;
|
|
208
208
|
}
|
|
209
209
|
},
|
|
210
210
|
children: linkItem.label
|
|
@@ -749,212 +749,6 @@ var Sidebar = memo(function Sidebar2({
|
|
|
749
749
|
/* @__PURE__ */ jsx(SidebarBottomSection, { user, onLogout, onAccountClick })
|
|
750
750
|
] });
|
|
751
751
|
});
|
|
752
|
-
var activeColor = "var(--color-primary)";
|
|
753
|
-
var defaultTextColor = "var(--color-text)";
|
|
754
|
-
var subtleColor = "var(--color-text-subtle)";
|
|
755
|
-
var activeBg = `color-mix(in srgb, ${activeColor} 10%, transparent)`;
|
|
756
|
-
var CollapsibleSidebarGroup = ({
|
|
757
|
-
icon: Icon,
|
|
758
|
-
label,
|
|
759
|
-
isExpanded,
|
|
760
|
-
onToggle,
|
|
761
|
-
isActive = false,
|
|
762
|
-
badge,
|
|
763
|
-
children,
|
|
764
|
-
onLabelClick,
|
|
765
|
-
emptyMessage = "No items",
|
|
766
|
-
isEmpty = false,
|
|
767
|
-
isLoading = false,
|
|
768
|
-
loadingComponent
|
|
769
|
-
}) => {
|
|
770
|
-
const showActiveStyle = !isExpanded && isActive;
|
|
771
|
-
const iconColor = showActiveStyle ? activeColor : subtleColor;
|
|
772
|
-
const textColor = showActiveStyle ? activeColor : defaultTextColor;
|
|
773
|
-
const fontWeight = showActiveStyle ? 600 : 500;
|
|
774
|
-
const handleLabelClick = (e) => {
|
|
775
|
-
if (onLabelClick) {
|
|
776
|
-
e.stopPropagation();
|
|
777
|
-
onLabelClick();
|
|
778
|
-
}
|
|
779
|
-
};
|
|
780
|
-
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
781
|
-
/* @__PURE__ */ jsx(
|
|
782
|
-
UnstyledButton,
|
|
783
|
-
{
|
|
784
|
-
onClick: onToggle,
|
|
785
|
-
style: {
|
|
786
|
-
display: "flex",
|
|
787
|
-
alignItems: "center",
|
|
788
|
-
width: "100%",
|
|
789
|
-
padding: "var(--mantine-spacing-xs)",
|
|
790
|
-
color: textColor,
|
|
791
|
-
backgroundColor: showActiveStyle ? activeBg : "transparent",
|
|
792
|
-
transition: `all var(--duration-fast) var(--easing)`,
|
|
793
|
-
cursor: "pointer",
|
|
794
|
-
overflow: "hidden"
|
|
795
|
-
},
|
|
796
|
-
onMouseEnter: (e) => {
|
|
797
|
-
if (!showActiveStyle) {
|
|
798
|
-
e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
|
|
799
|
-
}
|
|
800
|
-
},
|
|
801
|
-
onMouseLeave: (e) => {
|
|
802
|
-
if (!showActiveStyle) {
|
|
803
|
-
e.currentTarget.style.backgroundColor = "transparent";
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", style: { width: "100%" }, children: [
|
|
807
|
-
/* @__PURE__ */ jsx(Box, { style: { flexShrink: 0, color: iconColor }, children: isExpanded ? /* @__PURE__ */ jsx(IconChevronDown, { size: sidebarGroupChevronSize }) : /* @__PURE__ */ jsx(IconChevronRight, { size: sidebarGroupChevronSize }) }),
|
|
808
|
-
/* @__PURE__ */ jsx(
|
|
809
|
-
Box,
|
|
810
|
-
{
|
|
811
|
-
style: { flexShrink: 0, color: iconColor, cursor: onLabelClick ? "pointer" : "inherit" },
|
|
812
|
-
onClick: onLabelClick ? handleLabelClick : void 0,
|
|
813
|
-
children: /* @__PURE__ */ jsx(Icon, { size: sidebarIconInnerSize, color: activeColor })
|
|
814
|
-
}
|
|
815
|
-
),
|
|
816
|
-
/* @__PURE__ */ jsx(
|
|
817
|
-
Text,
|
|
818
|
-
{
|
|
819
|
-
size: "sm",
|
|
820
|
-
fw: fontWeight,
|
|
821
|
-
style: {
|
|
822
|
-
fontFamily: "var(--elevasis-font-family-subtitle)",
|
|
823
|
-
color: textColor,
|
|
824
|
-
transition: `color var(--duration-fast) var(--easing)`,
|
|
825
|
-
overflow: "hidden",
|
|
826
|
-
textOverflow: "ellipsis",
|
|
827
|
-
whiteSpace: "nowrap",
|
|
828
|
-
flex: 1,
|
|
829
|
-
cursor: onLabelClick ? "pointer" : "inherit"
|
|
830
|
-
},
|
|
831
|
-
onClick: onLabelClick ? handleLabelClick : void 0,
|
|
832
|
-
children: label
|
|
833
|
-
}
|
|
834
|
-
),
|
|
835
|
-
badge && /* @__PURE__ */ jsx(Box, { style: { flexShrink: 0 }, children: badge })
|
|
836
|
-
] })
|
|
837
|
-
}
|
|
838
|
-
),
|
|
839
|
-
/* @__PURE__ */ jsx(Collapse, { in: isExpanded, children: /* @__PURE__ */ jsx(
|
|
840
|
-
Stack,
|
|
841
|
-
{
|
|
842
|
-
gap: 0,
|
|
843
|
-
mt: "xs",
|
|
844
|
-
ml: "xs",
|
|
845
|
-
style: {
|
|
846
|
-
borderLeft: `1px solid color-mix(in srgb, var(--color-primary) 40%, transparent)`,
|
|
847
|
-
marginLeft: "calc(var(--mantine-spacing-xs) + 6px)",
|
|
848
|
-
paddingLeft: "calc(var(--mantine-spacing-xs) - 2px)"
|
|
849
|
-
},
|
|
850
|
-
children: isLoading ? loadingComponent : isEmpty ? /* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", style: { padding: "6px 8px" }, children: emptyMessage }) : children
|
|
851
|
-
}
|
|
852
|
-
) })
|
|
853
|
-
] });
|
|
854
|
-
};
|
|
855
|
-
var activeColor2 = "var(--color-primary)";
|
|
856
|
-
var defaultColor = "var(--color-text-subtle)";
|
|
857
|
-
var hoverColor = "var(--color-text)";
|
|
858
|
-
var activeBg2 = `color-mix(in srgb, ${activeColor2} 10%, transparent)`;
|
|
859
|
-
var SidebarListItem = ({
|
|
860
|
-
icon: Icon,
|
|
861
|
-
label,
|
|
862
|
-
isActive = false,
|
|
863
|
-
onClick,
|
|
864
|
-
description,
|
|
865
|
-
badge,
|
|
866
|
-
disabled = false
|
|
867
|
-
}) => {
|
|
868
|
-
return /* @__PURE__ */ jsx(
|
|
869
|
-
UnstyledButton,
|
|
870
|
-
{
|
|
871
|
-
onClick: disabled ? void 0 : onClick,
|
|
872
|
-
disabled,
|
|
873
|
-
style: {
|
|
874
|
-
width: "100%",
|
|
875
|
-
padding: "var(--mantine-spacing-xs)",
|
|
876
|
-
backgroundColor: isActive ? activeBg2 : "transparent",
|
|
877
|
-
borderRadius: "var(--mantine-radius-default)",
|
|
878
|
-
transition: `all var(--duration-fast) var(--easing)`,
|
|
879
|
-
cursor: disabled ? "not-allowed" : "pointer",
|
|
880
|
-
opacity: disabled ? 0.5 : 1
|
|
881
|
-
},
|
|
882
|
-
onMouseEnter: (e) => {
|
|
883
|
-
if (!isActive && !disabled) {
|
|
884
|
-
e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
|
|
885
|
-
const textElements = e.currentTarget.querySelectorAll("[data-text-element]");
|
|
886
|
-
textElements.forEach((el) => {
|
|
887
|
-
el.style.color = hoverColor;
|
|
888
|
-
});
|
|
889
|
-
}
|
|
890
|
-
},
|
|
891
|
-
onMouseLeave: (e) => {
|
|
892
|
-
if (!isActive && !disabled) {
|
|
893
|
-
e.currentTarget.style.backgroundColor = "transparent";
|
|
894
|
-
const textElements = e.currentTarget.querySelectorAll("[data-text-element]");
|
|
895
|
-
textElements.forEach((el) => {
|
|
896
|
-
el.style.color = defaultColor;
|
|
897
|
-
});
|
|
898
|
-
}
|
|
899
|
-
},
|
|
900
|
-
children: /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
|
|
901
|
-
/* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
|
|
902
|
-
/* @__PURE__ */ jsx(
|
|
903
|
-
Icon,
|
|
904
|
-
{
|
|
905
|
-
size: sidebarListItemIconSize,
|
|
906
|
-
style: {
|
|
907
|
-
flexShrink: 0,
|
|
908
|
-
opacity: isActive ? 1 : 0.6,
|
|
909
|
-
color: isActive ? activeColor2 : defaultColor
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
),
|
|
913
|
-
/* @__PURE__ */ jsx(
|
|
914
|
-
Text,
|
|
915
|
-
{
|
|
916
|
-
size: "sm",
|
|
917
|
-
fw: isActive ? 600 : 400,
|
|
918
|
-
style: {
|
|
919
|
-
overflow: "hidden",
|
|
920
|
-
textOverflow: "ellipsis",
|
|
921
|
-
whiteSpace: "nowrap",
|
|
922
|
-
flex: 1,
|
|
923
|
-
fontFamily: "var(--elevasis-font-family-subtitle)",
|
|
924
|
-
color: isActive ? activeColor2 : defaultColor,
|
|
925
|
-
transition: `color var(--duration-fast) var(--easing)`
|
|
926
|
-
},
|
|
927
|
-
"data-text-element": true,
|
|
928
|
-
children: label
|
|
929
|
-
}
|
|
930
|
-
),
|
|
931
|
-
badge && /* @__PURE__ */ jsx("div", { style: { flexShrink: 0 }, children: badge })
|
|
932
|
-
] }),
|
|
933
|
-
description && /* @__PURE__ */ jsx(
|
|
934
|
-
Text,
|
|
935
|
-
{
|
|
936
|
-
size: "xs",
|
|
937
|
-
c: "dimmed",
|
|
938
|
-
style: {
|
|
939
|
-
paddingLeft: "22px",
|
|
940
|
-
lineHeight: 1.2,
|
|
941
|
-
color: isActive ? activeColor2 : defaultColor,
|
|
942
|
-
opacity: isActive ? 0.8 : 0.6,
|
|
943
|
-
transition: `all var(--duration-fast) var(--easing)`,
|
|
944
|
-
display: "-webkit-box",
|
|
945
|
-
WebkitLineClamp: 2,
|
|
946
|
-
WebkitBoxOrient: "vertical",
|
|
947
|
-
overflow: "hidden",
|
|
948
|
-
textOverflow: "ellipsis"
|
|
949
|
-
},
|
|
950
|
-
"data-text-element": true,
|
|
951
|
-
children: description
|
|
952
|
-
}
|
|
953
|
-
)
|
|
954
|
-
] })
|
|
955
|
-
}
|
|
956
|
-
);
|
|
957
|
-
};
|
|
958
752
|
var SubshellContainer = ({ children, className }) => {
|
|
959
753
|
return /* @__PURE__ */ jsx(
|
|
960
754
|
"div",
|
|
@@ -1238,4 +1032,4 @@ var Topbar = ({ version, leftContent, children }) => {
|
|
|
1238
1032
|
] });
|
|
1239
1033
|
};
|
|
1240
1034
|
|
|
1241
|
-
export { AppShellContainer, AppShellContentContainer, AppShellRightSideContainer, AppShellRightSideOuterContainer, AppTopbarAdjusterWrapper,
|
|
1035
|
+
export { AppShellContainer, AppShellContentContainer, AppShellRightSideContainer, AppShellRightSideOuterContainer, AppTopbarAdjusterWrapper, LinksGroup, Sidebar, SidebarContext, SidebarProvider, SubshellContainer, SubshellContentContainer, SubshellRightSideContainer, SubshellSidebar, Topbar, TopbarContainer, Vignette, subsidebarWidth, useSidebar, useSidebarCollapse };
|