@wallarm-org/design-system 1.27.1-rc-fix-remote-shell-breadcrumb-transition.2 → 1.28.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/components/AppShell/story-content/_storyAccountDropdown.d.ts +11 -0
- package/dist/components/AppShell/story-content/_storyAccountDropdown.js +242 -0
- package/dist/components/AppShell/story-content/_storyConfigRenderer.d.ts +12 -0
- package/dist/components/AppShell/story-content/_storyConfigRenderer.js +81 -0
- package/dist/components/AppShell/story-content/_storyHeaderActions.d.ts +1 -0
- package/dist/components/AppShell/story-content/_storyHeaderActions.js +59 -0
- package/dist/components/AppShell/story-content/_storyHomeContent.d.ts +2 -0
- package/dist/components/AppShell/story-content/_storyHomeContent.js +15 -0
- package/dist/components/AppShell/story-content/_storyLib.d.ts +9 -0
- package/dist/components/AppShell/story-content/_storyLib.js +39 -0
- package/dist/components/AppShell/story-content/_storyNavConfigs.d.ts +6 -0
- package/dist/components/AppShell/story-content/_storyNavConfigs.js +772 -0
- package/dist/components/AppShell/story-content/_storyNavRailFooter.d.ts +13 -0
- package/dist/components/AppShell/story-content/_storyNavRailFooter.js +26 -0
- package/dist/components/AppShell/story-content/_storyProductNavItems.d.ts +7 -0
- package/dist/components/AppShell/story-content/_storyProductNavItems.js +49 -0
- package/dist/components/AppShell/story-content/_storyQuickHelpDropdown.d.ts +1 -0
- package/dist/components/AppShell/story-content/_storyQuickHelpDropdown.js +144 -0
- package/dist/components/AppShell/story-content/_storyRecentDropdown.d.ts +1 -0
- package/dist/components/AppShell/story-content/_storyRecentDropdown.js +89 -0
- package/dist/components/AppShell/story-content/_storySearchModal.d.ts +1 -0
- package/dist/components/AppShell/story-content/_storySearchModal.js +252 -0
- package/dist/components/AppShell/story-content/_storyWallarmLogo.d.ts +1 -0
- package/dist/components/AppShell/story-content/_storyWallarmLogo.js +21 -0
- package/dist/components/AppShell/story-content/index.d.ts +11 -0
- package/dist/components/AppShell/story-content/index.js +11 -0
- package/dist/components/RemoteShell/NavPanelContent.d.ts +0 -5
- package/dist/components/RemoteShell/NavPanelContent.js +4 -6
- package/dist/components/RemoteShell/RemoteShell.d.ts +1 -30
- package/dist/components/RemoteShell/RemoteShell.js +18 -35
- package/dist/components/RemoteShell/RemoteShellPanel.js +4 -10
- package/dist/components/RemoteShell/model/index.d.ts +1 -1
- package/dist/components/RemoteShell/model/index.js +1 -1
- package/dist/components/RemoteShell/model/useDrillTransition.d.ts +1 -12
- package/dist/components/RemoteShell/model/useDrillTransition.js +12 -24
- package/dist/components/RemoteShell/model/useLocationPathname.d.ts +0 -2
- package/dist/components/RemoteShell/model/useLocationPathname.js +1 -4
- package/dist/metadata/components.json +6 -24
- package/package.json +1 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type NavRailMode } from '../../NavRail';
|
|
2
|
+
import { type Theme } from '../../ThemeProvider';
|
|
3
|
+
export type SidebarMode = 'adaptive' | 'expanded' | 'collapsed' | 'compact';
|
|
4
|
+
/** Adaptive collapses the rail inside a product and expands it on Home; the other modes pin it. */
|
|
5
|
+
export declare const railModeFor: (mode: SidebarMode, onHome: boolean) => NavRailMode;
|
|
6
|
+
export declare const AccountDropdown: ({ sidebarMode, onSidebarModeChange, theme, onThemeChange, }: {
|
|
7
|
+
sidebarMode: SidebarMode;
|
|
8
|
+
onSidebarModeChange: (mode: SidebarMode) => void;
|
|
9
|
+
theme: Theme;
|
|
10
|
+
onThemeChange: (theme: Theme) => void;
|
|
11
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { LogOut, PanelLeftDashed, PencilRuler, Settings, User, UserRound } from "../../../icons/index.js";
|
|
4
|
+
import { cn } from "../../../utils/cn.js";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuTriggerItem } from "../../DropdownMenu/index.js";
|
|
6
|
+
import { NavRailItem } from "../../NavRail/index.js";
|
|
7
|
+
import { HStack, VStack } from "../../Stack/index.js";
|
|
8
|
+
import { Text } from "../../Text/index.js";
|
|
9
|
+
import { useTheme } from "../../ThemeProvider/index.js";
|
|
10
|
+
const railModeFor = (mode, onHome)=>{
|
|
11
|
+
if ('adaptive' === mode) return onHome ? 'expanded' : 'collapsed';
|
|
12
|
+
return mode;
|
|
13
|
+
};
|
|
14
|
+
const USER_NAME = 'Meow Meow';
|
|
15
|
+
const USER_EMAIL = 'meow@meow.com';
|
|
16
|
+
const THEMES = [
|
|
17
|
+
'light',
|
|
18
|
+
'dark'
|
|
19
|
+
];
|
|
20
|
+
const SIDEBAR_MODE_GROUPS = [
|
|
21
|
+
[
|
|
22
|
+
'adaptive'
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
'expanded',
|
|
26
|
+
'collapsed'
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
'compact'
|
|
30
|
+
]
|
|
31
|
+
];
|
|
32
|
+
const SIDEBAR_MODES = SIDEBAR_MODE_GROUPS.flat();
|
|
33
|
+
const THEME_LABELS = {
|
|
34
|
+
light: 'Light',
|
|
35
|
+
dark: 'Dark'
|
|
36
|
+
};
|
|
37
|
+
const FRAME_STYLES = [
|
|
38
|
+
'neutral',
|
|
39
|
+
'branded'
|
|
40
|
+
];
|
|
41
|
+
const FRAME_STYLE_LABELS = {
|
|
42
|
+
neutral: 'Neutral',
|
|
43
|
+
branded: 'Branded'
|
|
44
|
+
};
|
|
45
|
+
const FRAME_STYLE_SWATCH = {
|
|
46
|
+
neutral: 'bg-icon-secondary',
|
|
47
|
+
branded: 'bg-icon-brand'
|
|
48
|
+
};
|
|
49
|
+
const SIDEBAR_MODE_LABELS = {
|
|
50
|
+
adaptive: 'Adaptive',
|
|
51
|
+
expanded: 'Always expanded',
|
|
52
|
+
collapsed: 'Always collapsed',
|
|
53
|
+
compact: 'Compact'
|
|
54
|
+
};
|
|
55
|
+
const AccountDropdown = ({ sidebarMode, onSidebarModeChange, theme, onThemeChange })=>{
|
|
56
|
+
const { frameStyle, setFrameStyle } = useTheme();
|
|
57
|
+
return /*#__PURE__*/ jsxs(DropdownMenu, {
|
|
58
|
+
positioning: {
|
|
59
|
+
placement: 'right-end',
|
|
60
|
+
gutter: 6,
|
|
61
|
+
offset: {
|
|
62
|
+
crossAxis: 12
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
children: [
|
|
66
|
+
/*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
67
|
+
children: /*#__PURE__*/ jsx(NavRailItem, {
|
|
68
|
+
icon: UserRound,
|
|
69
|
+
label: USER_NAME,
|
|
70
|
+
avatar: true
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ jsxs(DropdownMenuContent, {
|
|
74
|
+
className: "w-256",
|
|
75
|
+
children: [
|
|
76
|
+
/*#__PURE__*/ jsx("div", {
|
|
77
|
+
className: "rounded-6 border border-border-primary-light bg-states-primary-hover px-8 py-8 mb-4",
|
|
78
|
+
children: /*#__PURE__*/ jsxs(HStack, {
|
|
79
|
+
gap: 8,
|
|
80
|
+
align: "start",
|
|
81
|
+
children: [
|
|
82
|
+
/*#__PURE__*/ jsx("div", {
|
|
83
|
+
children: /*#__PURE__*/ jsx(User, {})
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ jsxs(VStack, {
|
|
86
|
+
gap: 0,
|
|
87
|
+
children: [
|
|
88
|
+
/*#__PURE__*/ jsx(Text, {
|
|
89
|
+
size: "sm",
|
|
90
|
+
color: "primary",
|
|
91
|
+
children: USER_NAME
|
|
92
|
+
}),
|
|
93
|
+
/*#__PURE__*/ jsx(Text, {
|
|
94
|
+
size: "xs",
|
|
95
|
+
color: "secondary",
|
|
96
|
+
children: USER_EMAIL
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
})
|
|
102
|
+
}),
|
|
103
|
+
/*#__PURE__*/ jsxs(DropdownMenuItem, {
|
|
104
|
+
children: [
|
|
105
|
+
/*#__PURE__*/ jsx(DropdownMenuItemIcon, {
|
|
106
|
+
children: /*#__PURE__*/ jsx(Settings, {})
|
|
107
|
+
}),
|
|
108
|
+
/*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
109
|
+
children: "Profile settings"
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
/*#__PURE__*/ jsxs(DropdownMenu, {
|
|
114
|
+
children: [
|
|
115
|
+
/*#__PURE__*/ jsxs(DropdownMenuTriggerItem, {
|
|
116
|
+
children: [
|
|
117
|
+
/*#__PURE__*/ jsx(DropdownMenuItemIcon, {
|
|
118
|
+
children: /*#__PURE__*/ jsx(PencilRuler, {})
|
|
119
|
+
}),
|
|
120
|
+
/*#__PURE__*/ jsxs(DropdownMenuItemContent, {
|
|
121
|
+
children: [
|
|
122
|
+
/*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
123
|
+
children: "Appearance"
|
|
124
|
+
}),
|
|
125
|
+
/*#__PURE__*/ jsxs(Text, {
|
|
126
|
+
size: "xs",
|
|
127
|
+
color: "secondary",
|
|
128
|
+
children: [
|
|
129
|
+
THEME_LABELS[theme],
|
|
130
|
+
" and ",
|
|
131
|
+
FRAME_STYLE_LABELS[frameStyle].toLowerCase()
|
|
132
|
+
]
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
}),
|
|
138
|
+
/*#__PURE__*/ jsxs(DropdownMenuContent, {
|
|
139
|
+
className: "w-132",
|
|
140
|
+
children: [
|
|
141
|
+
/*#__PURE__*/ jsx(DropdownMenuRadioGroup, {
|
|
142
|
+
value: theme,
|
|
143
|
+
onValueChange: ({ value })=>{
|
|
144
|
+
const next = THEMES.find((t)=>t === value);
|
|
145
|
+
if (next) onThemeChange(next);
|
|
146
|
+
},
|
|
147
|
+
children: THEMES.map((t)=>/*#__PURE__*/ jsx(DropdownMenuRadioItem, {
|
|
148
|
+
value: t,
|
|
149
|
+
children: /*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
150
|
+
children: THEME_LABELS[t]
|
|
151
|
+
})
|
|
152
|
+
}, t))
|
|
153
|
+
}),
|
|
154
|
+
/*#__PURE__*/ jsx(DropdownMenuSeparator, {}),
|
|
155
|
+
/*#__PURE__*/ jsx(DropdownMenuRadioGroup, {
|
|
156
|
+
value: frameStyle,
|
|
157
|
+
onValueChange: ({ value })=>{
|
|
158
|
+
const next = FRAME_STYLES.find((s)=>s === value);
|
|
159
|
+
if (next) setFrameStyle(next);
|
|
160
|
+
},
|
|
161
|
+
children: FRAME_STYLES.map((s)=>/*#__PURE__*/ jsxs(DropdownMenuRadioItem, {
|
|
162
|
+
value: s,
|
|
163
|
+
children: [
|
|
164
|
+
/*#__PURE__*/ jsx(DropdownMenuItemIcon, {
|
|
165
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
166
|
+
className: "flex size-16 items-center justify-center",
|
|
167
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
168
|
+
className: cn('size-8 rounded-full', FRAME_STYLE_SWATCH[s])
|
|
169
|
+
})
|
|
170
|
+
})
|
|
171
|
+
}),
|
|
172
|
+
/*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
173
|
+
children: FRAME_STYLE_LABELS[s]
|
|
174
|
+
})
|
|
175
|
+
]
|
|
176
|
+
}, s))
|
|
177
|
+
})
|
|
178
|
+
]
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
}),
|
|
182
|
+
/*#__PURE__*/ jsxs(DropdownMenu, {
|
|
183
|
+
children: [
|
|
184
|
+
/*#__PURE__*/ jsxs(DropdownMenuTriggerItem, {
|
|
185
|
+
children: [
|
|
186
|
+
/*#__PURE__*/ jsx(DropdownMenuItemIcon, {
|
|
187
|
+
children: /*#__PURE__*/ jsx(PanelLeftDashed, {})
|
|
188
|
+
}),
|
|
189
|
+
/*#__PURE__*/ jsxs(DropdownMenuItemContent, {
|
|
190
|
+
children: [
|
|
191
|
+
/*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
192
|
+
children: "Sidebar mode"
|
|
193
|
+
}),
|
|
194
|
+
/*#__PURE__*/ jsx(Text, {
|
|
195
|
+
size: "xs",
|
|
196
|
+
color: "secondary",
|
|
197
|
+
children: SIDEBAR_MODE_LABELS[sidebarMode]
|
|
198
|
+
})
|
|
199
|
+
]
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
}),
|
|
203
|
+
/*#__PURE__*/ jsx(DropdownMenuContent, {
|
|
204
|
+
className: "w-200",
|
|
205
|
+
children: /*#__PURE__*/ jsx(DropdownMenuRadioGroup, {
|
|
206
|
+
value: sidebarMode,
|
|
207
|
+
onValueChange: ({ value })=>{
|
|
208
|
+
const next = SIDEBAR_MODES.find((m)=>m === value);
|
|
209
|
+
if (next) onSidebarModeChange(next);
|
|
210
|
+
},
|
|
211
|
+
children: SIDEBAR_MODE_GROUPS.map((group, index)=>/*#__PURE__*/ jsxs(Fragment, {
|
|
212
|
+
children: [
|
|
213
|
+
index > 0 && /*#__PURE__*/ jsx(DropdownMenuSeparator, {}),
|
|
214
|
+
group.map((m)=>/*#__PURE__*/ jsx(DropdownMenuRadioItem, {
|
|
215
|
+
value: m,
|
|
216
|
+
children: /*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
217
|
+
children: SIDEBAR_MODE_LABELS[m]
|
|
218
|
+
})
|
|
219
|
+
}, m))
|
|
220
|
+
]
|
|
221
|
+
}, group.join('-')))
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
}),
|
|
226
|
+
/*#__PURE__*/ jsx(DropdownMenuSeparator, {}),
|
|
227
|
+
/*#__PURE__*/ jsxs(DropdownMenuItem, {
|
|
228
|
+
children: [
|
|
229
|
+
/*#__PURE__*/ jsx(DropdownMenuItemIcon, {
|
|
230
|
+
children: /*#__PURE__*/ jsx(LogOut, {})
|
|
231
|
+
}),
|
|
232
|
+
/*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
233
|
+
children: "Sign out"
|
|
234
|
+
})
|
|
235
|
+
]
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
})
|
|
239
|
+
]
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
export { AccountDropdown, railModeFor };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type NavConfig } from '../../RemoteShell';
|
|
2
|
+
import { type Product } from './_storyLib';
|
|
3
|
+
export interface ConfigRemoteProps {
|
|
4
|
+
config: NavConfig;
|
|
5
|
+
basePath?: string;
|
|
6
|
+
/** Fake a 2s load whenever the product changes, to show the panel and content skeletons. */
|
|
7
|
+
simulateLoading?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const RemoteForProduct: ({ product, simulateLoading, }: {
|
|
10
|
+
product: Product;
|
|
11
|
+
simulateLoading?: boolean;
|
|
12
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { Page, PageContent, PageHeader, PageTitle } from "../../Page/index.js";
|
|
4
|
+
import { RemoteShell, RemoteShellBreadcrumb, RemoteShellContent, RemoteShellPanel, useRemoteShellContext } from "../../RemoteShell/index.js";
|
|
5
|
+
import { HomeContent } from "./_storyHomeContent.js";
|
|
6
|
+
import { PRODUCT_CONFIGS } from "./_storyLib.js";
|
|
7
|
+
const RemotePageContent = ()=>{
|
|
8
|
+
const { breadcrumbSegments } = useRemoteShellContext();
|
|
9
|
+
const lastSegment = breadcrumbSegments[breadcrumbSegments.length - 1];
|
|
10
|
+
const pageTitle = lastSegment?.label ?? '';
|
|
11
|
+
const fullPath = breadcrumbSegments.map((s)=>s.label).join(' / ');
|
|
12
|
+
return /*#__PURE__*/ jsxs(Page, {
|
|
13
|
+
title: pageTitle,
|
|
14
|
+
fixedHeight: true,
|
|
15
|
+
children: [
|
|
16
|
+
/*#__PURE__*/ jsx(PageHeader, {
|
|
17
|
+
children: /*#__PURE__*/ jsx(PageTitle, {
|
|
18
|
+
children: pageTitle
|
|
19
|
+
})
|
|
20
|
+
}),
|
|
21
|
+
/*#__PURE__*/ jsx(PageContent, {
|
|
22
|
+
children: /*#__PURE__*/ jsxs("p", {
|
|
23
|
+
className: "text-sm text-text-secondary",
|
|
24
|
+
children: [
|
|
25
|
+
"Placeholder page for ",
|
|
26
|
+
fullPath,
|
|
27
|
+
"."
|
|
28
|
+
]
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
const ConfigRemote = ({ config, basePath, simulateLoading = true })=>{
|
|
35
|
+
const [loading, setLoading] = useState(simulateLoading);
|
|
36
|
+
useEffect(()=>{
|
|
37
|
+
if (!simulateLoading) return;
|
|
38
|
+
setLoading(true);
|
|
39
|
+
const timer = setTimeout(()=>{
|
|
40
|
+
setLoading(false);
|
|
41
|
+
}, 2000);
|
|
42
|
+
return ()=>clearTimeout(timer);
|
|
43
|
+
}, [
|
|
44
|
+
config.productLabel,
|
|
45
|
+
simulateLoading
|
|
46
|
+
]);
|
|
47
|
+
return /*#__PURE__*/ jsx(RemoteShell, {
|
|
48
|
+
config: config,
|
|
49
|
+
basePath: basePath,
|
|
50
|
+
children: loading ? /*#__PURE__*/ jsxs(Fragment, {
|
|
51
|
+
children: [
|
|
52
|
+
/*#__PURE__*/ jsx(RemoteShellPanel, {
|
|
53
|
+
isLoading: true
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ jsx(RemoteShellContent, {
|
|
56
|
+
isLoading: true
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
60
|
+
children: [
|
|
61
|
+
/*#__PURE__*/ jsx(RemoteShellPanel, {
|
|
62
|
+
resizable: true
|
|
63
|
+
}),
|
|
64
|
+
/*#__PURE__*/ jsx(RemoteShellBreadcrumb, {}),
|
|
65
|
+
/*#__PURE__*/ jsx(RemoteShellContent, {
|
|
66
|
+
children: /*#__PURE__*/ jsx(RemotePageContent, {})
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
const RemoteForProduct = ({ product, simulateLoading = true })=>{
|
|
73
|
+
if ('home' === product) return /*#__PURE__*/ jsx(HomeContent, {});
|
|
74
|
+
const { config } = PRODUCT_CONFIGS[product];
|
|
75
|
+
return /*#__PURE__*/ jsx(ConfigRemote, {
|
|
76
|
+
config: config,
|
|
77
|
+
basePath: `/${product}`,
|
|
78
|
+
simulateLoading: simulateLoading
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
export { RemoteForProduct };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HeaderActions: () => import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Bell, ChevronUpDown } from "../../../icons/index.js";
|
|
3
|
+
import { Button } from "../../Button/index.js";
|
|
4
|
+
import { Code } from "../../Code/index.js";
|
|
5
|
+
import { Text } from "../../Text/index.js";
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../../Tooltip/index.js";
|
|
7
|
+
import { TopHeaderSeparator } from "../../TopHeader/index.js";
|
|
8
|
+
import { QuickHelpDropdown } from "./_storyQuickHelpDropdown.js";
|
|
9
|
+
import { StorySearchModal } from "./_storySearchModal.js";
|
|
10
|
+
const HeaderActions = ()=>/*#__PURE__*/ jsxs(Fragment, {
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx(StorySearchModal, {}),
|
|
13
|
+
/*#__PURE__*/ jsx(TopHeaderSeparator, {}),
|
|
14
|
+
/*#__PURE__*/ jsxs(Button, {
|
|
15
|
+
variant: "ghost",
|
|
16
|
+
size: "small",
|
|
17
|
+
color: "neutral",
|
|
18
|
+
className: "py-4 rounded-6",
|
|
19
|
+
children: [
|
|
20
|
+
/*#__PURE__*/ jsx(Text, {
|
|
21
|
+
size: "xs",
|
|
22
|
+
weight: "medium",
|
|
23
|
+
children: "Tenant Name"
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ jsx("span", {
|
|
26
|
+
className: "text-text-tertiary mx-[-2px]",
|
|
27
|
+
children: "•"
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ jsx(Code, {
|
|
30
|
+
size: "s",
|
|
31
|
+
color: "secondary",
|
|
32
|
+
children: "12345"
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ jsx(ChevronUpDown, {
|
|
35
|
+
className: "!icon-sm"
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ jsxs(Tooltip, {
|
|
40
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
42
|
+
asChild: true,
|
|
43
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
44
|
+
variant: "ghost",
|
|
45
|
+
size: "small",
|
|
46
|
+
color: "neutral",
|
|
47
|
+
"aria-label": "Wallarm Updates",
|
|
48
|
+
children: /*#__PURE__*/ jsx(Bell, {})
|
|
49
|
+
})
|
|
50
|
+
}),
|
|
51
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
52
|
+
children: "Wallarm updates"
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ jsx(QuickHelpDropdown, {})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
export { HeaderActions };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
const HomeContent = ()=>/*#__PURE__*/ jsxs("div", {
|
|
3
|
+
className: "p-24",
|
|
4
|
+
children: [
|
|
5
|
+
/*#__PURE__*/ jsx("h1", {
|
|
6
|
+
className: "text-xl font-semibold text-text-primary",
|
|
7
|
+
children: "Home"
|
|
8
|
+
}),
|
|
9
|
+
/*#__PURE__*/ jsx("p", {
|
|
10
|
+
className: "mt-4 text-sm text-text-secondary",
|
|
11
|
+
children: "Cross-product summary. Click any product in the rail to drill into it."
|
|
12
|
+
})
|
|
13
|
+
]
|
|
14
|
+
});
|
|
15
|
+
export { HomeContent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { edgeNavConfig } from './_storyNavConfigs';
|
|
2
|
+
declare const KNOWN_PRODUCTS: readonly ['home', 'edge', 'ai-hypervisor', 'infra-discovery', 'security-testing', 'settings'];
|
|
3
|
+
export type Product = (typeof KNOWN_PRODUCTS)[number];
|
|
4
|
+
export declare const PRODUCT_CONFIGS: Record<Exclude<Product, 'home'>, {
|
|
5
|
+
config: typeof edgeNavConfig;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function deriveProduct(pathname: string): Product;
|
|
8
|
+
export declare function navigateToProduct(product: Product): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { findFirstLinkPath, pushPathname } from "../../RemoteShell/index.js";
|
|
2
|
+
import { aiHypervisorNavConfig, edgeNavConfig, infraDiscoveryNavConfig, securityTestingNavConfig, settingsNavConfig } from "./_storyNavConfigs.js";
|
|
3
|
+
const KNOWN_PRODUCTS = [
|
|
4
|
+
'home',
|
|
5
|
+
'edge',
|
|
6
|
+
'ai-hypervisor',
|
|
7
|
+
'infra-discovery',
|
|
8
|
+
'security-testing',
|
|
9
|
+
'settings'
|
|
10
|
+
];
|
|
11
|
+
const PRODUCT_CONFIGS = {
|
|
12
|
+
edge: {
|
|
13
|
+
config: edgeNavConfig
|
|
14
|
+
},
|
|
15
|
+
'ai-hypervisor': {
|
|
16
|
+
config: aiHypervisorNavConfig
|
|
17
|
+
},
|
|
18
|
+
'infra-discovery': {
|
|
19
|
+
config: infraDiscoveryNavConfig
|
|
20
|
+
},
|
|
21
|
+
'security-testing': {
|
|
22
|
+
config: securityTestingNavConfig
|
|
23
|
+
},
|
|
24
|
+
settings: {
|
|
25
|
+
config: settingsNavConfig
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
function deriveProduct(pathname) {
|
|
29
|
+
const segment = pathname.split('/').filter(Boolean)[0];
|
|
30
|
+
if (segment && KNOWN_PRODUCTS.includes(segment)) return segment;
|
|
31
|
+
return 'home';
|
|
32
|
+
}
|
|
33
|
+
function navigateToProduct(product) {
|
|
34
|
+
if ('home' === product) return void pushPathname('/home');
|
|
35
|
+
const { config } = PRODUCT_CONFIGS[product];
|
|
36
|
+
const firstPath = findFirstLinkPath(config.items) ?? '';
|
|
37
|
+
pushPathname(`/${product}/${firstPath}`);
|
|
38
|
+
}
|
|
39
|
+
export { PRODUCT_CONFIGS, deriveProduct, navigateToProduct };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NavConfig } from '../../RemoteShell';
|
|
2
|
+
export declare const edgeNavConfig: NavConfig;
|
|
3
|
+
export declare const aiHypervisorNavConfig: NavConfig;
|
|
4
|
+
export declare const infraDiscoveryNavConfig: NavConfig;
|
|
5
|
+
export declare const securityTestingNavConfig: NavConfig;
|
|
6
|
+
export declare const settingsNavConfig: NavConfig;
|