@capillarytech/blaze-ui 6.1.5 → 6.1.6-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CapEmojiPicker/Picker/index.d.ts +6 -0
  2. package/CapEmojiPicker/Picker/index.d.ts.map +1 -0
  3. package/CapEmojiPicker/Picker/index.js +114 -0
  4. package/CapEmojiPicker/Picker/messages.d.ts +21 -0
  5. package/CapEmojiPicker/Picker/messages.d.ts.map +1 -0
  6. package/CapEmojiPicker/Picker/messages.js +24 -0
  7. package/CapEmojiPicker/TriggerButton/_triggerButton.scss +45 -0
  8. package/CapEmojiPicker/TriggerButton/index.d.ts +9 -0
  9. package/CapEmojiPicker/TriggerButton/index.d.ts.map +1 -0
  10. package/CapEmojiPicker/TriggerButton/index.js +35 -0
  11. package/CapEmojiPicker/Wrapper/index.d.ts +4 -0
  12. package/CapEmojiPicker/Wrapper/index.d.ts.map +1 -0
  13. package/CapEmojiPicker/Wrapper/index.js +166 -0
  14. package/CapEmojiPicker/Wrapper/messages.d.ts +13 -0
  15. package/CapEmojiPicker/Wrapper/messages.d.ts.map +1 -0
  16. package/CapEmojiPicker/Wrapper/messages.js +16 -0
  17. package/CapEmojiPicker/Wrapper/useEmojiTriggerPosition.d.ts +18 -0
  18. package/CapEmojiPicker/Wrapper/useEmojiTriggerPosition.d.ts.map +1 -0
  19. package/CapEmojiPicker/Wrapper/useEmojiTriggerPosition.js +108 -0
  20. package/CapEmojiPicker/_capEmojiPicker.css +231 -0
  21. package/CapEmojiPicker/_capEmojiPicker.scss +281 -0
  22. package/CapEmojiPicker/_config.scss +7 -0
  23. package/CapEmojiPicker/assets/sentiment-satsified.svg +3 -0
  24. package/CapEmojiPicker/assets/sentiment-satsified.svg.js +4 -0
  25. package/CapEmojiPicker/constants.d.ts +34 -0
  26. package/CapEmojiPicker/constants.d.ts.map +1 -0
  27. package/CapEmojiPicker/constants.js +18 -0
  28. package/CapEmojiPicker/index.d.ts +4 -0
  29. package/CapEmojiPicker/index.d.ts.map +1 -0
  30. package/CapEmojiPicker/index.js +11 -0
  31. package/CapEmojiPicker/utils.d.ts +20 -0
  32. package/CapEmojiPicker/utils.d.ts.map +1 -0
  33. package/CapEmojiPicker/utils.js +24 -0
  34. package/CapNavigationSPA/CapNavigationSPASidebar/index.d.ts +10 -0
  35. package/CapNavigationSPA/CapNavigationSPASidebar/index.d.ts.map +1 -0
  36. package/CapNavigationSPA/CapNavigationSPASidebar/index.js +603 -0
  37. package/CapNavigationSPA/CapNavigationSPASidebar/styles.css +350 -0
  38. package/CapNavigationSPA/CapNavigationSPASidebar/styles.module.scss.js +59 -0
  39. package/CapNavigationSPA/CapNavigationSPASidebar/styles.scss +422 -0
  40. package/CapNavigationSPA/CapNavigationSPASidebar/types.d.ts +31 -0
  41. package/CapNavigationSPA/CapNavigationSPASidebar/types.d.ts.map +1 -0
  42. package/CapNavigationSPA/CapNavigationSPASidebar/types.js +1 -0
  43. package/CapNavigationSPA/CapNavigationSPATopBar/index.d.ts +11 -0
  44. package/CapNavigationSPA/CapNavigationSPATopBar/index.d.ts.map +1 -0
  45. package/CapNavigationSPA/CapNavigationSPATopBar/index.js +95 -0
  46. package/CapNavigationSPA/CapNavigationSPATopBar/styles.css +147 -0
  47. package/CapNavigationSPA/CapNavigationSPATopBar/styles.module.scss.js +18 -0
  48. package/CapNavigationSPA/CapNavigationSPATopBar/styles.scss +173 -0
  49. package/CapNavigationSPA/CapNavigationSPATopBar/types.d.ts +24 -0
  50. package/CapNavigationSPA/CapNavigationSPATopBar/types.d.ts.map +1 -0
  51. package/CapNavigationSPA/CapNavigationSPATopBar/types.js +1 -0
  52. package/CapNavigationSPA/constants.d.ts +2 -0
  53. package/CapNavigationSPA/constants.d.ts.map +1 -0
  54. package/CapNavigationSPA/constants.js +4 -0
  55. package/CapNavigationSPA/index.d.ts +10 -0
  56. package/CapNavigationSPA/index.d.ts.map +1 -0
  57. package/CapNavigationSPA/index.js +436 -0
  58. package/CapNavigationSPA/messages.d.ts +13 -0
  59. package/CapNavigationSPA/messages.d.ts.map +1 -0
  60. package/CapNavigationSPA/messages.js +16 -0
  61. package/CapNavigationSPA/mockdata.d.ts +6 -0
  62. package/CapNavigationSPA/mockdata.d.ts.map +1 -0
  63. package/CapNavigationSPA/mockdata.js +4 -0
  64. package/CapNavigationSPA/styles.css +48 -0
  65. package/CapNavigationSPA/styles.module.scss.js +9 -0
  66. package/CapNavigationSPA/styles.scss +49 -0
  67. package/CapNavigationSPA/tests/CapNavigationSPA.mockData.d.ts +31 -0
  68. package/CapNavigationSPA/tests/CapNavigationSPA.mockData.d.ts.map +1 -0
  69. package/CapNavigationSPA/types.d.ts +39 -0
  70. package/CapNavigationSPA/types.d.ts.map +1 -0
  71. package/CapNavigationSPA/types.js +1 -0
  72. package/assets/icons/blocks.svg +9 -0
  73. package/assets/icons/closed-lock.svg +1 -0
  74. package/assets/icons/csv.svg +21 -0
  75. package/assets/icons/databricks.svg +7 -0
  76. package/assets/icons/four-join.svg +19 -0
  77. package/assets/icons/http.svg +18 -0
  78. package/assets/icons/kafka.svg +9 -0
  79. package/assets/icons/open-lock.svg +1 -0
  80. package/assets/icons/s3.svg +3 -0
  81. package/assets/icons/sftp.svg +32 -0
  82. package/assets/icons/split-json.svg +9 -0
  83. package/assets/icons/three-join.svg +17 -0
  84. package/assets/icons/two-join.svg +15 -0
  85. package/assets/icons/xml.svg +12 -0
  86. package/assets/svgIcons/Icons/AiraNav.js +23 -0
  87. package/assets/svgIcons/Icons/CreativesNav.js +22 -0
  88. package/assets/svgIcons/Icons/DataManagement.js +22 -0
  89. package/assets/svgIcons/Icons/EngageNav.js +23 -0
  90. package/assets/svgIcons/Icons/InsightsNav.js +22 -0
  91. package/assets/svgIcons/Icons/LoyaltyTag.js +22 -0
  92. package/assets/svgIcons/Icons/Members.js +22 -0
  93. package/assets/svgIcons/Icons/RewardsOutline.js +4 -6
  94. package/assets/svgIcons/Icons/SidebarCollapse.js +17 -0
  95. package/assets/svgIcons/Icons/SidebarExpand.js +22 -0
  96. package/assets/svgIcons/Icons/ThreeStars.js +36 -18
  97. package/assets/svgIcons/component.js +27 -0
  98. package/assets/svgIcons/index.js +612 -594
  99. package/index.d.ts +2 -0
  100. package/index.d.ts.map +1 -1
  101. package/index.js +195 -193
  102. package/package.json +2 -1
@@ -0,0 +1,436 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import classNames from "classnames";
3
+ import { isEmpty, forOwn } from "lodash";
4
+ import { useState, useRef, useEffect, useMemo } from "react";
5
+ import { injectIntl } from "react-intl";
6
+ import CapDropdown from "../CapDropdown/index.js";
7
+ import CapIcon from "../CapIcon/index.js";
8
+ import CapSecondaryTopBar from "../CapSecondaryTopBar/index.js";
9
+ import WrappedCapUserProfile from "../CapUserProfile/index.js";
10
+ import CapNavigationSPASidebar from "./CapNavigationSPASidebar/index.js";
11
+ import CapNavigationSPATopBar from "./CapNavigationSPATopBar/index.js";
12
+ import { USER_PROFILE_KEY } from "./constants.js";
13
+ import messages from "./messages.js";
14
+ import styles from "./styles.module.scss.js";
15
+ const DEFAULT_MODULE = "campaign";
16
+ const PRODUCT_MASTERS = "masters";
17
+ const CapNavigationSPA = (allProps) => {
18
+ var _a, _b, _c, _d;
19
+ const { config, children, intl: injectedIntl } = allProps;
20
+ const {
21
+ className,
22
+ userData = {},
23
+ topbarMenuData,
24
+ topbarSelectedMenuData,
25
+ dropdownMenuProps,
26
+ topbarIcons,
27
+ sidebarMenuData = [],
28
+ sidebarMenuItemsPosition,
29
+ loadStorageItem,
30
+ selectProduct,
31
+ selectOrganization,
32
+ organization,
33
+ noResultText,
34
+ settingsLabel,
35
+ defaultSelectedProduct,
36
+ showSecondaryTopBar = false,
37
+ secondaryTopBarActionHandler,
38
+ fixedOrg = false,
39
+ showDocumentationBot: _showDocumentationBot,
40
+ isLatestLeftNavigationEnabled: _isLatestLeftNavigationEnabled = false,
41
+ setLeftNavbarExpandedProp: _setLeftNavbarExpandedProp = () => {
42
+ },
43
+ defaultActiveKey = "",
44
+ sidebarCollapsed = false,
45
+ onSidebarCollapseExpand,
46
+ disableSidebarNavigation = false,
47
+ headerOverideCss: _headerOverideCss = {},
48
+ request: _request = async () => ({}),
49
+ getAPICallObject: _getAPICallObject = () => ({}),
50
+ changeOrgEntity,
51
+ sidebarMenuItemClick,
52
+ insights,
53
+ connectPlus
54
+ } = config;
55
+ const intl = injectedIntl ?? config.intl;
56
+ const safeDropdownMenuProps = dropdownMenuProps || [];
57
+ const formatMessage = (intl == null ? void 0 : intl.formatMessage) || ((msg) => msg.defaultMessage || msg.id);
58
+ const [showUserProfile, setShowUserProfile] = useState(false);
59
+ const componentWrapperRef = useRef(null);
60
+ const renderUserProfile = () => /* @__PURE__ */ jsx(
61
+ WrappedCapUserProfile,
62
+ {
63
+ show: showUserProfile,
64
+ setShowUserProfile,
65
+ onClose: () => setShowUserProfile(false),
66
+ userData
67
+ }
68
+ );
69
+ if (!safeDropdownMenuProps.find((item) => item.key === USER_PROFILE_KEY)) {
70
+ safeDropdownMenuProps.unshift({
71
+ label: formatMessage(messages.userProfile),
72
+ key: USER_PROFILE_KEY,
73
+ onClickHandler: () => setShowUserProfile(true)
74
+ });
75
+ }
76
+ const handleProductChange = (product) => {
77
+ updateSelectedProduct(product.value || "");
78
+ if (product.url && product.url !== window.location.pathname) {
79
+ window.location.pathname = product.url;
80
+ }
81
+ };
82
+ const handleOrgEntityChange = (orgID, _entityItem, ouId) => {
83
+ changeOrgEntity == null ? void 0 : changeOrgEntity(orgID, ouId);
84
+ };
85
+ const handleTopbarMenuChange = (option) => {
86
+ if (option == null ? void 0 : option.onClickHandler) {
87
+ option.onClickHandler(option);
88
+ } else if (option == null ? void 0 : option.link) {
89
+ window.location.pathname = option.link;
90
+ }
91
+ };
92
+ const handleSideBarLinkClick = (item) => {
93
+ updateSelectedSidebarMenuItem(item.key || "");
94
+ sidebarMenuItemClick == null ? void 0 : sidebarMenuItemClick(item);
95
+ };
96
+ const getDefaultSidebarMenuItem = () => {
97
+ const { pathname } = window.location;
98
+ let selectedMenuItem = defaultActiveKey || "";
99
+ sidebarMenuData.forEach((obj) => {
100
+ var _a2;
101
+ if (obj.link === pathname && obj.key) {
102
+ selectedMenuItem = obj.key;
103
+ }
104
+ (_a2 = obj.children) == null ? void 0 : _a2.forEach((child) => {
105
+ if (child.link === pathname && child.key) {
106
+ selectedMenuItem = child.key;
107
+ }
108
+ });
109
+ });
110
+ return selectedMenuItem;
111
+ };
112
+ const getProxyOrgList = () => {
113
+ var _a2, _b2;
114
+ const proxyOrgList2 = [];
115
+ if (userData && userData.user && typeof userData.user === "object") {
116
+ const { orgDetails = {}, user = {} } = userData;
117
+ const { name: selectedOrgName } = orgDetails;
118
+ let { org_id: selectedOrgId } = orgDetails;
119
+ const orgList = user.proxyOrgList || [];
120
+ const accessibleOUList = user.accessibleOUList;
121
+ if (!isEmpty(selectedOrgId)) {
122
+ selectedOrgId = Number(selectedOrgId);
123
+ const selectedOrg2 = {
124
+ label: selectedOrgName,
125
+ value: selectedOrgId,
126
+ key: selectedOrgId
127
+ };
128
+ if (!isEmpty(accessibleOUList)) {
129
+ selectedOrg2.accessibleOus = [];
130
+ forOwn(accessibleOUList, (ouId, ouName) => {
131
+ selectedOrg2.accessibleOus.push({
132
+ label: ouName,
133
+ value: ouId,
134
+ key: ouId
135
+ });
136
+ });
137
+ }
138
+ proxyOrgList2.push(selectedOrg2);
139
+ } else {
140
+ const defaultOrgName = (_a2 = userData == null ? void 0 : userData.user) == null ? void 0 : _a2.orgName;
141
+ const defaultOrgId = (_b2 = userData == null ? void 0 : userData.user) == null ? void 0 : _b2.orgID;
142
+ proxyOrgList2.push({
143
+ label: defaultOrgName,
144
+ value: defaultOrgId ?? 0,
145
+ key: defaultOrgId ?? 0
146
+ });
147
+ }
148
+ if (orgList == null ? void 0 : orgList.length) {
149
+ orgList.forEach((item) => {
150
+ const itemOrgId = typeof item.orgID === "string" ? parseInt(item.orgID, 10) : item.orgID;
151
+ const selectedOrgIdNum = typeof selectedOrgId === "string" ? parseInt(selectedOrgId, 10) : selectedOrgId;
152
+ if (itemOrgId !== selectedOrgIdNum) {
153
+ const id = item.orgID;
154
+ const name = item.orgName;
155
+ const orgObj = { label: name, value: id, key: id };
156
+ if (item.ouList) {
157
+ orgObj.accessibleOus = getOuList(item);
158
+ }
159
+ proxyOrgList2.push(orgObj);
160
+ }
161
+ });
162
+ }
163
+ }
164
+ return proxyOrgList2;
165
+ };
166
+ const getOuList = (orgItem) => {
167
+ const { ouList = [] } = orgItem;
168
+ const accessibleOus = [];
169
+ if (ouList == null ? void 0 : ouList.length) {
170
+ ouList.forEach((item) => {
171
+ accessibleOus.push({ label: item.ouName, value: item.ouID, key: item.ouID });
172
+ });
173
+ }
174
+ return accessibleOus;
175
+ };
176
+ const getProductList = () => {
177
+ const { currentOrgDetails = {} } = userData;
178
+ const { module_details: moduleDetails = [] } = currentOrgDetails;
179
+ const productsList2 = [];
180
+ if (!isEmpty(currentOrgDetails)) {
181
+ const props = config;
182
+ moduleDetails.forEach((module) => {
183
+ var _a2, _b2;
184
+ if (((_a2 = module.name) == null ? void 0 : _a2.toLowerCase()) !== PRODUCT_MASTERS) {
185
+ const productName = module.namespace;
186
+ const intlProductName = productName ? props[productName] : void 0;
187
+ const moduleName = intlProductName || ((_b2 = module.name) == null ? void 0 : _b2.toLowerCase());
188
+ productsList2.push({
189
+ value: moduleName,
190
+ url: module.url,
191
+ key: module.code
192
+ });
193
+ }
194
+ });
195
+ if (insights) {
196
+ productsList2.push({
197
+ value: insights,
198
+ url: "analytics/v2/",
199
+ key: "insights"
200
+ });
201
+ }
202
+ if (!productsList2.find((product) => product.key === "connect-plus/ui") && connectPlus) {
203
+ productsList2.push({
204
+ value: connectPlus,
205
+ url: "connect/ui",
206
+ key: "connectPlus"
207
+ });
208
+ }
209
+ }
210
+ return productsList2;
211
+ };
212
+ const renderSecondaryTopbar = (proxyOrgList2) => {
213
+ const selectedOrg2 = (loadStorageItem == null ? void 0 : loadStorageItem("orgID")) || null;
214
+ const selectedOrgObj2 = proxyOrgList2.find((o) => o.value == selectedOrg2);
215
+ return /* @__PURE__ */ jsx(
216
+ CapSecondaryTopBar,
217
+ {
218
+ primaryMenuItem: {
219
+ key: "primaryMenu",
220
+ label: selectedProduct || ""
221
+ },
222
+ secondaryMenuItem: {
223
+ key: "secondaryMenu",
224
+ label: (selectedOrgObj2 == null ? void 0 : selectedOrgObj2.label) || ""
225
+ },
226
+ menuActions: [{ key: "close-icon", iconType: "close" }],
227
+ menuActionHandler: secondaryTopBarActionHandler
228
+ }
229
+ );
230
+ };
231
+ const proxyOrgList = getProxyOrgList();
232
+ const productsList = getProductList();
233
+ const [selectedProduct, updateSelectedProduct] = useState(defaultSelectedProduct || "");
234
+ const orgIdRaw = (loadStorageItem == null ? void 0 : loadStorageItem("orgID")) || void 0;
235
+ const ouIdRaw = (loadStorageItem == null ? void 0 : loadStorageItem("ouId")) || void 0;
236
+ const [selectedOrg] = useState(orgIdRaw);
237
+ const [selectedOu] = useState(ouIdRaw);
238
+ const [selectedSidebarMenuItem, updateSelectedSidebarMenuItem] = useState(
239
+ getDefaultSidebarMenuItem()
240
+ );
241
+ const [breadcrumbs] = useState([]);
242
+ const [_leftNavbarExpanded, _setLeftNavbarExpanded] = useState(true);
243
+ const showSidebar = sidebarMenuData.length > 0 && sidebarMenuItemsPosition === "left";
244
+ useEffect(() => {
245
+ if (defaultSelectedProduct) {
246
+ updateSelectedProduct(defaultSelectedProduct);
247
+ }
248
+ }, [defaultSelectedProduct]);
249
+ const handleProductChangeWrapper = useMemo(
250
+ () => (product) => {
251
+ handleProductChange(product);
252
+ },
253
+ [handleProductChange]
254
+ );
255
+ const handleOrgEntityChangeWrapper = useMemo(
256
+ () => (value, item, ouValue) => {
257
+ if (value !== void 0) {
258
+ handleOrgEntityChange(value, item, ouValue);
259
+ }
260
+ },
261
+ [handleOrgEntityChange]
262
+ );
263
+ const handleMenuItemClick = useMemo(
264
+ () => (item) => {
265
+ const menuItem = topbarMenuData == null ? void 0 : topbarMenuData.find((m) => m.key === item.key);
266
+ if (menuItem) {
267
+ handleTopbarMenuChange({
268
+ onClickHandler: menuItem.onClickHandler ? (opt) => {
269
+ var _a2;
270
+ return (_a2 = menuItem.onClickHandler) == null ? void 0 : _a2.call(menuItem, opt);
271
+ } : void 0,
272
+ link: menuItem.link
273
+ });
274
+ }
275
+ },
276
+ [topbarMenuData, handleTopbarMenuChange]
277
+ );
278
+ useMemo(
279
+ () => ({
280
+ productsList,
281
+ selectedProduct,
282
+ handleProductChange: handleProductChangeWrapper,
283
+ title: selectProduct,
284
+ closable: false,
285
+ placement: "left",
286
+ width: 320
287
+ }),
288
+ [productsList, selectedProduct, handleProductChangeWrapper, selectProduct]
289
+ );
290
+ useMemo(
291
+ () => ({
292
+ items: proxyOrgList,
293
+ selectedItem: selectedOrg,
294
+ selectedOuItem: selectedOu,
295
+ handleItemChange: handleOrgEntityChangeWrapper,
296
+ selectPlaceholder: selectOrganization || formatMessage(messages.selectOrganization),
297
+ showSearch: true,
298
+ showHeader: false,
299
+ title: formatMessage(messages.selectOrganization),
300
+ placeholder: organization,
301
+ noResultText,
302
+ fixedOrg: fixedOrg || !proxyOrgList.length
303
+ }),
304
+ [
305
+ proxyOrgList,
306
+ selectedOrg,
307
+ selectedOu,
308
+ handleOrgEntityChangeWrapper,
309
+ selectOrganization,
310
+ formatMessage,
311
+ organization,
312
+ noResultText,
313
+ fixedOrg
314
+ ]
315
+ );
316
+ useMemo(
317
+ () => topbarMenuData ? {
318
+ items: topbarMenuData.map((item) => ({
319
+ key: item.key || "",
320
+ label: item.label || ""
321
+ })),
322
+ defaultSelectedKeys: topbarSelectedMenuData || [DEFAULT_MODULE],
323
+ selectedKeys: topbarSelectedMenuData || [DEFAULT_MODULE],
324
+ onMenuItemClick: handleMenuItemClick
325
+ } : void 0,
326
+ [topbarMenuData, topbarSelectedMenuData, handleMenuItemClick]
327
+ );
328
+ const normalizedDropdownMenuProps = useMemo(
329
+ () => safeDropdownMenuProps.map((item) => ({
330
+ key: item.key || "",
331
+ label: item.label || "",
332
+ onClickHandler: item.onClickHandler
333
+ })),
334
+ [safeDropdownMenuProps]
335
+ );
336
+ const normalizedTopbarIcons = useMemo(
337
+ () => topbarIcons == null ? void 0 : topbarIcons.map((icon) => ({
338
+ ...icon,
339
+ iconType: icon.iconType || icon.type || "help"
340
+ })),
341
+ [topbarIcons]
342
+ );
343
+ useMemo(
344
+ () => breadcrumbs.length > 0 ? breadcrumbs.join(" / ") : void 0,
345
+ [breadcrumbs]
346
+ );
347
+ const selectedOrgObj = useMemo(
348
+ () => proxyOrgList.find((o) => o.value == ((loadStorageItem == null ? void 0 : loadStorageItem("orgID")) ?? selectedOrg)),
349
+ [proxyOrgList, loadStorageItem, selectedOrg]
350
+ );
351
+ const orgDisplayName = organization || (selectedOrgObj == null ? void 0 : selectedOrgObj.label) || ((_a = userData == null ? void 0 : userData.orgDetails) == null ? void 0 : _a.name) || "";
352
+ const sidebarItems = useMemo(
353
+ () => sidebarMenuData.map((item) => {
354
+ var _a2;
355
+ return {
356
+ key: item.key || "",
357
+ title: item.label || item.key || "",
358
+ link: item.link,
359
+ target: item.target,
360
+ iconType: item.iconType,
361
+ children: (_a2 = item.children) == null ? void 0 : _a2.map((child) => ({
362
+ key: child.key || "",
363
+ title: child.label || child.key || "",
364
+ link: child.link,
365
+ target: child.target,
366
+ iconType: child.iconType
367
+ }))
368
+ };
369
+ }),
370
+ [sidebarMenuData]
371
+ );
372
+ const userMenuOverlay = useMemo(
373
+ () => normalizedDropdownMenuProps.length > 0 ? {
374
+ items: normalizedDropdownMenuProps.map((item) => ({
375
+ key: item.key,
376
+ label: item.label,
377
+ onClick: item.onClickHandler
378
+ }))
379
+ } : void 0,
380
+ [normalizedDropdownMenuProps]
381
+ );
382
+ return /* @__PURE__ */ jsxs("div", { className: classNames(styles["cap-navigation-spa"], className), ref: componentWrapperRef, children: [
383
+ showSidebar ? /* @__PURE__ */ jsx(
384
+ CapNavigationSPASidebar,
385
+ {
386
+ items: sidebarItems,
387
+ selectedKey: selectedSidebarMenuItem,
388
+ onItemClick: (item) => {
389
+ handleSideBarLinkClick({ key: item.key, label: item.title, link: item.link });
390
+ },
391
+ settingsLabel,
392
+ collapsed: sidebarCollapsed,
393
+ onCollapseExpand: onSidebarCollapseExpand,
394
+ navigateToLink: !disableSidebarNavigation
395
+ }
396
+ ) : null,
397
+ /* @__PURE__ */ jsxs("div", { className: styles["cap-navigation-spa__right"], children: [
398
+ showSecondaryTopBar ? renderSecondaryTopbar(proxyOrgList) : /* @__PURE__ */ jsx(
399
+ CapNavigationSPATopBar,
400
+ {
401
+ orgName: orgDisplayName,
402
+ environmentLabel: config.environmentLabel ?? "Production",
403
+ onOrgEnvClick: () => {
404
+ },
405
+ onAiraClick: (_b = normalizedTopbarIcons == null ? void 0 : normalizedTopbarIcons.find((i) => i.iconType === "aira-nav")) == null ? void 0 : _b.onClickHandler,
406
+ onNotificationClick: (_c = normalizedTopbarIcons == null ? void 0 : normalizedTopbarIcons.find((i) => i.iconType === "bell")) == null ? void 0 : _c.onClickHandler,
407
+ showNotificationBadge: false,
408
+ onHelpClick: (_d = normalizedTopbarIcons == null ? void 0 : normalizedTopbarIcons.find((i) => i.iconType === "question-circle")) == null ? void 0 : _d.onClickHandler,
409
+ onUserClick: void 0,
410
+ userDisplay: userMenuOverlay ? /* @__PURE__ */ jsx(CapDropdown, { menu: userMenuOverlay, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsx(
411
+ "button",
412
+ {
413
+ type: "button",
414
+ className: styles["cap-navigation-spa__user-trigger"],
415
+ "aria-label": "User menu",
416
+ children: /* @__PURE__ */ jsx(CapIcon, { type: "user", size: "s" })
417
+ }
418
+ ) }) : void 0
419
+ }
420
+ ),
421
+ /* @__PURE__ */ jsx(
422
+ "div",
423
+ {
424
+ className: styles["cap-navigation-spa__main"],
425
+ "data-testid": "cap-navigation-spa-nav-inner",
426
+ children
427
+ }
428
+ )
429
+ ] }),
430
+ showUserProfile && renderUserProfile()
431
+ ] });
432
+ };
433
+ const index = injectIntl(CapNavigationSPA);
434
+ export {
435
+ index as default
436
+ };
@@ -0,0 +1,13 @@
1
+ export declare const scope = "app.commonUtils.capUiLibrary.CapNavigationSPA.selectOrganization";
2
+ declare const _default: {
3
+ selectOrganization: {
4
+ id: string;
5
+ defaultMessage: string;
6
+ };
7
+ userProfile: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ };
11
+ };
12
+ export default _default;
13
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../components/CapNavigationSPA/messages.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,qEAAqE,CAAC;;;;;;;;;;;AAExF,wBASG"}
@@ -0,0 +1,16 @@
1
+ import { defineMessages } from "react-intl";
2
+ const scope = "app.commonUtils.capUiLibrary.CapNavigationSPA.selectOrganization";
3
+ const messages = defineMessages({
4
+ selectOrganization: {
5
+ id: `${scope}.selectOrganization`,
6
+ defaultMessage: "Select Organization"
7
+ },
8
+ userProfile: {
9
+ id: `${scope}.userProfile`,
10
+ defaultMessage: "User Profile"
11
+ }
12
+ });
13
+ export {
14
+ messages as default,
15
+ scope
16
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Re-use CapNavigation mock data for Storybook and demos.
3
+ * Same userData/org structure as CapNavigation for API consistency.
4
+ */
5
+ export { userData } from '../CapNavigation/mockdata';
6
+ //# sourceMappingURL=mockdata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockdata.d.ts","sourceRoot":"","sources":["../../components/CapNavigationSPA/mockdata.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { userData } from "../CapNavigation/mockdata.js";
2
+ export {
3
+ userData
4
+ };
@@ -0,0 +1,48 @@
1
+ /* Color Palette */
2
+ /* Fonts */
3
+ /* Backward Compatibility Aliases */
4
+ /* Component Heights */
5
+ /* Border Radius */
6
+ /* Border Width */
7
+ /* Transition */
8
+ /* Timezones Footer */
9
+ .cap-navigation-spa {
10
+ display: flex;
11
+ flex-direction: row;
12
+ width: 100%;
13
+ min-height: 100vh;
14
+ height: 100vh;
15
+ background-color: #ffffff;
16
+ }
17
+ .cap-navigation-spa__right {
18
+ display: flex;
19
+ flex-direction: column;
20
+ flex: 1 1 auto;
21
+ min-width: 0;
22
+ min-height: 0;
23
+ overflow: hidden;
24
+ }
25
+ .cap-navigation-spa__main {
26
+ flex: 1 1 auto;
27
+ min-height: 0;
28
+ overflow: auto;
29
+ background-color: #fafbfc;
30
+ }
31
+ .cap-navigation-spa__user-trigger {
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ width: 2.286rem;
36
+ height: 2.286rem;
37
+ min-width: 2.286rem;
38
+ min-height: 2.286rem;
39
+ padding: 0;
40
+ border: none;
41
+ background-color: #dfe2e7;
42
+ border-radius: 0.714rem;
43
+ cursor: pointer;
44
+ color: #091e42;
45
+ }
46
+ .cap-navigation-spa__user-trigger:hover {
47
+ background-color: #ebecf0;
48
+ }
@@ -0,0 +1,9 @@
1
+ import './styles.css';const styles = {
2
+ "cap-navigation-spa": "cap-navigation-spa",
3
+ "cap-navigation-spa__right": "cap-navigation-spa__right",
4
+ "cap-navigation-spa__main": "cap-navigation-spa__main",
5
+ "cap-navigation-spa__user-trigger": "cap-navigation-spa__user-trigger"
6
+ };
7
+ export {
8
+ styles as default
9
+ };
@@ -0,0 +1,49 @@
1
+ @import '../styles/_variables.scss';
2
+
3
+ // BEM: Block = cap-navigation-spa | Elements = __right, __main, __user-trigger, __user-avatar
4
+ // New navigation Figma: sidebar full height left (240px), then top bar + content right
5
+ .cap-navigation-spa {
6
+ display: flex;
7
+ flex-direction: row;
8
+ width: 100%;
9
+ min-height: 100vh;
10
+ height: 100vh;
11
+ background-color: $CAP_WHITE;
12
+ }
13
+
14
+ .cap-navigation-spa__right {
15
+ display: flex;
16
+ flex-direction: column;
17
+ flex: 1 1 auto;
18
+ min-width: 0;
19
+ min-height: 0;
20
+ overflow: hidden;
21
+ }
22
+
23
+ .cap-navigation-spa__main {
24
+ flex: 1 1 auto;
25
+ min-height: 0;
26
+ overflow: auto;
27
+ background-color: $CAP_G10; // #fafbfc – content area bg from Figma
28
+ }
29
+
30
+ // Figma 1206-154664: 32px squircle, #DFE2E7 bg (Neutral/4), icon #091E42
31
+ .cap-navigation-spa__user-trigger {
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ width: 2.286rem; // 32px
36
+ height: 2.286rem;
37
+ min-width: 2.286rem;
38
+ min-height: 2.286rem;
39
+ padding: 0;
40
+ border: none;
41
+ background-color: $CAP_G07; // #DFE2E7 – Figma Neutral/4
42
+ border-radius: 0.714rem; // 10px – squircle corners per Figma SVG path
43
+ cursor: pointer;
44
+ color: $CAP_G01; // #091E42
45
+
46
+ &:hover {
47
+ background-color: $CAP_G08;
48
+ }
49
+ }
@@ -0,0 +1,31 @@
1
+ import type { CapNavigationSPAConfig, UserData } from '../types';
2
+ export declare const mockLoadStorageItem: jest.Mock<string, [key: string], any>;
3
+ export declare const mockChangeOrgEntity: jest.Mock<any, any, any>;
4
+ export declare const mockSidebarMenuItemClick: jest.Mock<any, any, any>;
5
+ export declare const mockSecondaryTopBarActionHandler: jest.Mock<any, any, any>;
6
+ export declare const mockSetLeftNavbarExpandedProp: jest.Mock<any, any, any>;
7
+ export declare const mockHandleGTMDataPush: jest.Mock<any, any, any>;
8
+ export declare const mockRequest: jest.Mock<any, any, any>;
9
+ export declare const mockGetAPICallObject: jest.Mock<any, any, any>;
10
+ export declare const defaultConfig: Partial<CapNavigationSPAConfig>;
11
+ export declare const topbarMenuData: {
12
+ key: string;
13
+ label: string;
14
+ link: string;
15
+ }[];
16
+ export declare const sidebarMenuData: {
17
+ key: string;
18
+ label: string;
19
+ link: string;
20
+ }[];
21
+ export declare const dropdownMenuProps: {
22
+ key: string;
23
+ label: string;
24
+ onClickHandler: jest.Mock<any, any, any>;
25
+ }[];
26
+ export declare const userDataWithPreferredOrg: UserData;
27
+ export declare const userDataWithoutProxyOrg: UserData;
28
+ export declare const userDataWithConnectPlus: UserData;
29
+ /** UserData with proxyOrgList containing another org that has ouList (for getProxyOrgList + getOuList coverage) */
30
+ export declare const userDataWithProxyOrgAndOuList: UserData;
31
+ //# sourceMappingURL=CapNavigationSPA.mockData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CapNavigationSPA.mockData.d.ts","sourceRoot":"","sources":["../../../components/CapNavigationSPA/tests/CapNavigationSPA.mockData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEjE,eAAO,MAAM,mBAAmB,uCAM9B,CAAC;AAEH,eAAO,MAAM,mBAAmB,0BAAY,CAAC;AAC7C,eAAO,MAAM,wBAAwB,0BAAY,CAAC;AAClD,eAAO,MAAM,gCAAgC,0BAAY,CAAC;AAC1D,eAAO,MAAM,6BAA6B,0BAAY,CAAC;AACvD,eAAO,MAAM,qBAAqB,0BAAY,CAAC;AAC/C,eAAO,MAAM,WAAW,0BAAY,CAAC;AACrC,eAAO,MAAM,oBAAoB,0BAAY,CAAC;AAE9C,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,sBAAsB,CAgBzD,CAAC;AAEF,eAAO,MAAM,cAAc;;;;GAI1B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;GAI3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;GAG7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,QAUtC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAMrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,QAcrC,CAAC;AAEF,mHAAmH;AACnH,eAAO,MAAM,6BAA6B,EAAE,QAoB3C,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * CapNavigationSPA reuses the same data and integration types as CapNavigation.
3
+ */
4
+ import type React from 'react';
5
+ export type { User, OrgDetails, ModuleDetail, CurrentOrgDetails, UserData, TopbarMenuItem, DropdownMenuItem, SidebarMenuItem, TopbarIcon, BreadcrumbItem, CSSOverrides, OuItem, RawProxyOrgItem, ProductListItem, FormatMessageArg, ProductChangeParam, TopbarMenuChangeParam, SidebarLinkClickParam, ProxyOrgListItem, OrgItemWithOuList, MenuItemClickParam, NormalizedTopbarIcon, } from '../CapNavigation/types';
6
+ import type { CapNavigationProps, SidebarMenuItem } from '../CapNavigation/types';
7
+ export type { CapNavigationProps } from '../CapNavigation/types';
8
+ /**
9
+ * Sidebar menu item with optional nested children (L2 flyout).
10
+ * Defined in CapNavigationSPA only; CapNavigation uses base SidebarMenuItem.
11
+ */
12
+ export interface CapNavigationSPASidebarMenuItem extends SidebarMenuItem {
13
+ children?: CapNavigationSPASidebarMenuItem[];
14
+ }
15
+ /**
16
+ * SPA-only props (not in CapNavigation).
17
+ */
18
+ export interface CapNavigationSPAOnlyConfig {
19
+ /** When true, sidebar is collapsed (icons only). Used with onSidebarCollapseExpand for toggle. */
20
+ sidebarCollapsed?: boolean;
21
+ /** Callback when user clicks sidebar collapse/expand control. When provided, collapse button is shown. */
22
+ onSidebarCollapseExpand?: () => void;
23
+ /** When true, sidebar item click does not change window.location (e.g. for Storybook). Default false */
24
+ disableSidebarNavigation?: boolean;
25
+ /** Sidebar menu items (SPA type supports nested children). */
26
+ sidebarMenuData?: CapNavigationSPASidebarMenuItem[];
27
+ }
28
+ /**
29
+ * Single config object combining all navigation options (except children).
30
+ * Pass as the only data prop: <CapNavigationSPA config={...} />.
31
+ * Extends CapNavigation props with SPA-only options (sidebar collapse, nested sidebar items).
32
+ */
33
+ export type CapNavigationSPAConfig = Omit<CapNavigationProps, 'children'> & CapNavigationSPAOnlyConfig;
34
+ /** Props for CapNavigationSPA: single config object and optional children. */
35
+ export interface CapNavigationSPAProps {
36
+ config: CapNavigationSPAConfig;
37
+ children?: React.ReactNode;
38
+ }
39
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../components/CapNavigationSPA/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,YAAY,EACV,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,cAAc,EACd,YAAY,EACZ,MAAM,EACN,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAElF,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE;;;GAGG;AACH,MAAM,WAAW,+BAAgC,SAAQ,eAAe;IACtE,QAAQ,CAAC,EAAE,+BAA+B,EAAE,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,0GAA0G;IAC1G,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;IACrC,wGAAwG;IACxG,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,8DAA8D;IAC9D,eAAe,CAAC,EAAE,+BAA+B,EAAE,CAAC;CACrD;AAED;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GACvE,0BAA0B,CAAC;AAE7B,8EAA8E;AAC9E,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
@@ -0,0 +1 @@
1
+