@pega/cosmos-react-wss 10.0.0-build.1.9 → 10.0.0-build.10.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.
Files changed (103) hide show
  1. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  2. package/lib/components/AppShell/AppShell.js +221 -46
  3. package/lib/components/AppShell/AppShell.js.map +1 -1
  4. package/lib/components/AppShell/AppShell.styles.d.ts +26 -3
  5. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  6. package/lib/components/AppShell/AppShell.styles.js +257 -116
  7. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  8. package/lib/components/AppShell/AppShell.types.d.ts +26 -19
  9. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  10. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  11. package/lib/components/AppShell/AppShell.utils.d.ts +10 -0
  12. package/lib/components/AppShell/AppShell.utils.d.ts.map +1 -0
  13. package/lib/components/AppShell/AppShell.utils.js +124 -0
  14. package/lib/components/AppShell/AppShell.utils.js.map +1 -0
  15. package/lib/components/AppShell/AppShellMenu.types.d.ts +143 -0
  16. package/lib/components/AppShell/AppShellMenu.types.d.ts.map +1 -0
  17. package/lib/components/AppShell/AppShellMenu.types.js +2 -0
  18. package/lib/components/AppShell/AppShellMenu.types.js.map +1 -0
  19. package/lib/components/AppShell/AppShellMenuControl.d.ts +4 -0
  20. package/lib/components/AppShell/AppShellMenuControl.d.ts.map +1 -0
  21. package/lib/components/AppShell/AppShellMenuControl.js +24 -0
  22. package/lib/components/AppShell/AppShellMenuControl.js.map +1 -0
  23. package/lib/components/AppShell/AppShellMenuControl.test-ids.d.ts +2 -0
  24. package/lib/components/AppShell/AppShellMenuControl.test-ids.d.ts.map +1 -0
  25. package/lib/components/AppShell/AppShellMenuControl.test-ids.js +3 -0
  26. package/lib/components/AppShell/AppShellMenuControl.test-ids.js.map +1 -0
  27. package/lib/components/AppShell/GroupedMenu.styles.d.ts +16 -0
  28. package/lib/components/AppShell/GroupedMenu.styles.d.ts.map +1 -0
  29. package/lib/components/AppShell/GroupedMenu.styles.js +84 -0
  30. package/lib/components/AppShell/GroupedMenu.styles.js.map +1 -0
  31. package/lib/components/AppShell/MegaMenu.d.ts +18 -0
  32. package/lib/components/AppShell/MegaMenu.d.ts.map +1 -0
  33. package/lib/components/AppShell/MegaMenu.js +187 -0
  34. package/lib/components/AppShell/MegaMenu.js.map +1 -0
  35. package/lib/components/AppShell/MegaMenu.styles.d.ts +199 -0
  36. package/lib/components/AppShell/MegaMenu.styles.d.ts.map +1 -0
  37. package/lib/components/AppShell/MegaMenu.styles.js +132 -0
  38. package/lib/components/AppShell/MegaMenu.styles.js.map +1 -0
  39. package/lib/components/AppShell/MobileHeaderContent.d.ts +2 -2
  40. package/lib/components/AppShell/MobileHeaderContent.d.ts.map +1 -1
  41. package/lib/components/AppShell/MobileHeaderContent.js +2 -2
  42. package/lib/components/AppShell/MobileHeaderContent.js.map +1 -1
  43. package/lib/components/AppShell/NavLinks.d.ts +2 -2
  44. package/lib/components/AppShell/NavLinks.d.ts.map +1 -1
  45. package/lib/components/AppShell/NavLinks.js +2 -2
  46. package/lib/components/AppShell/NavLinks.js.map +1 -1
  47. package/lib/components/AppShell/Notifications.d.ts.map +1 -1
  48. package/lib/components/AppShell/Notifications.js +16 -3
  49. package/lib/components/AppShell/Notifications.js.map +1 -1
  50. package/lib/components/AppShell/index.d.ts +2 -0
  51. package/lib/components/AppShell/index.d.ts.map +1 -1
  52. package/lib/components/AppShell/index.js +1 -0
  53. package/lib/components/AppShell/index.js.map +1 -1
  54. package/lib/components/CaseView/CaseView.d.ts.map +1 -1
  55. package/lib/components/CaseView/CaseView.js +57 -13
  56. package/lib/components/CaseView/CaseView.js.map +1 -1
  57. package/lib/components/CaseView/CaseView.styles.d.ts +7 -0
  58. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  59. package/lib/components/CaseView/CaseView.styles.js +81 -6
  60. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  61. package/lib/components/CaseView/CaseView.types.d.ts +15 -3
  62. package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
  63. package/lib/components/CaseView/CaseView.types.js.map +1 -1
  64. package/lib/components/Footer/Footer.d.ts +1 -1
  65. package/lib/components/Footer/Footer.d.ts.map +1 -1
  66. package/lib/components/Footer/Footer.js +47 -4
  67. package/lib/components/Footer/Footer.js.map +1 -1
  68. package/lib/components/Footer/Footer.styles.d.ts +207 -4
  69. package/lib/components/Footer/Footer.styles.d.ts.map +1 -1
  70. package/lib/components/Footer/Footer.styles.js +89 -6
  71. package/lib/components/Footer/Footer.styles.js.map +1 -1
  72. package/lib/components/Footer/Footer.types.d.ts +75 -2
  73. package/lib/components/Footer/Footer.types.d.ts.map +1 -1
  74. package/lib/components/Footer/Footer.types.js.map +1 -1
  75. package/lib/components/ModernCaseView/ModernCaseView.d.ts +6 -0
  76. package/lib/components/ModernCaseView/ModernCaseView.d.ts.map +1 -0
  77. package/lib/components/ModernCaseView/ModernCaseView.js +206 -0
  78. package/lib/components/ModernCaseView/ModernCaseView.js.map +1 -0
  79. package/lib/components/ModernCaseView/ModernCaseView.styles.d.ts +39 -0
  80. package/lib/components/ModernCaseView/ModernCaseView.styles.d.ts.map +1 -0
  81. package/lib/components/ModernCaseView/ModernCaseView.styles.js +245 -0
  82. package/lib/components/ModernCaseView/ModernCaseView.styles.js.map +1 -0
  83. package/lib/components/ModernCaseView/index.d.ts +2 -0
  84. package/lib/components/ModernCaseView/index.d.ts.map +1 -0
  85. package/lib/components/ModernCaseView/index.js +2 -0
  86. package/lib/components/ModernCaseView/index.js.map +1 -0
  87. package/lib/components/PageTemplates/BannerPage.d.ts +17 -5
  88. package/lib/components/PageTemplates/BannerPage.d.ts.map +1 -1
  89. package/lib/components/PageTemplates/BannerPage.js +141 -32
  90. package/lib/components/PageTemplates/BannerPage.js.map +1 -1
  91. package/lib/components/QuickCreate/QuickCreate.d.ts +17 -7
  92. package/lib/components/QuickCreate/QuickCreate.d.ts.map +1 -1
  93. package/lib/components/QuickCreate/QuickCreate.js +46 -39
  94. package/lib/components/QuickCreate/QuickCreate.js.map +1 -1
  95. package/lib/components/QuickCreate/QuickCreate.test-ids.d.ts +2 -0
  96. package/lib/components/QuickCreate/QuickCreate.test-ids.d.ts.map +1 -0
  97. package/lib/components/QuickCreate/QuickCreate.test-ids.js +6 -0
  98. package/lib/components/QuickCreate/QuickCreate.test-ids.js.map +1 -0
  99. package/lib/index.d.ts +1 -0
  100. package/lib/index.d.ts.map +1 -1
  101. package/lib/index.js +1 -0
  102. package/lib/index.js.map +1 -1
  103. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,+BAA+B,EAAkB,MAAM,yBAAyB,CAAC;AAS/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAgBtD,QAAA,MAAM,QAAQ,EAAE,+BAA+B,CAAC,aAAa,CA+Z3D,CAAC;AAEH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"AppShell.d.ts","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,+BAA+B,EAAkB,MAAM,yBAAyB,CAAC;AAc/F,OAAO,KAAK,EAAE,aAAa,EAAgD,MAAM,kBAAkB,CAAC;AAwBpG,QAAA,MAAM,QAAQ,EAAE,+BAA+B,CAAC,aAAa,CA0vB3D,CAAC;AAEH,eAAe,QAAQ,CAAC"}
@@ -1,36 +1,123 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
3
- import { Avatar, Backdrop, Button, ThemeOverride, ContextSwitcher, debounce, Drawer, Flex, Icon, Image, Popover, SkipLinks, Text, useBreakpoint, useConsolidatedRef, useDirection, useElement, useI18n, useOuterEvent, useTheme, VisuallyHiddenText, MenuButton, ThemeSwitcher } from '@pega/cosmos-react-core';
2
+ import { forwardRef, useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';
3
+ import { Avatar, Backdrop, Button, ThemeOverride, ContextSwitcher, debounce, Drawer, Flex, Icon, Image, Popover, registerIcon, SearchInput, SkipLinks, Text, useBreakpoint, useConsolidatedRef, useDirection, useElement, useEscape, useFocusWithin, useI18n, useOuterEvent, usePreviewManager, useTheme, VisuallyHiddenText, MenuButton, ThemeSwitcher } from '@pega/cosmos-react-core';
4
4
  import Operator from '@pega/cosmos-react-core/lib/components/AppShell/Operator';
5
- import { StyledAppHeaderOperator } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';
5
+ import { StyledAppHeaderOperator, StyledContextSwitcher } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';
6
6
  import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
7
+ import * as shareExternalIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/share-external.icon';
7
8
  import { getHeaderTheme } from '@pega/cosmos-react-core/lib/components/AppShell/style-utils';
8
9
  import useThemeMode from '@pega/cosmos-react-core/lib/hooks/useThemeMode';
9
10
  import Footer from '../Footer';
10
- import { StyledAppHeader, StyledCountIcon, StyledHamburgerMenu, StyledMain, StyledModernAppHeaderOperator, StyledNotificationCount, StyledPrimaryName, StyledEndNavBlock, StyledBannerRegion } from './AppShell.styles';
11
+ import { flattenMenuItems, toFooterMenuEntries } from './AppShell.utils';
12
+ import { WSSAppShellGlobalStyle, StyledAppHeader, StyledCountIcon, StyledHamburgerMenu, StyledMain, StyledNotificationCount, StyledMainMenuLink, StyledNav, StyledPrimaryName, StyledEndNavBlock, StyledBannerRegion, StyledShareButtonContent } from './AppShell.styles';
11
13
  import Notifications from './Notifications';
12
14
  import MobileHeaderContent from './MobileHeaderContent';
13
15
  import NavLinks from './NavLinks';
16
+ import AppShellMenuControl from './AppShellMenuControl';
17
+ import { MegaMenuPanel, MegaMenuTriggers, useMegaMenu } from './MegaMenu';
18
+ registerIcon(shareExternalIcon);
14
19
  const AppShell = forwardRef(function AppShell(props, ref) {
15
- const { main, banners, appInfo, navLinks, operator, notifications, contextSwitcher = {}, navAlignment = 'end', navPosition = 'inline', isDefaultWSS = true, helpMenu, footer } = props;
20
+ const { main, banners, appInfo, mainNav, navLinks: deprecatedNavLinks, appSwitcherMenu: configuredAppSwitcherMenu, operator, notifications, searchInput, contextSwitcher = {}, navAlignment = 'end', navPosition = 'inline', isDefaultWSS = true, helpMenu, shareApp, portalSwitcher, footer } = props;
21
+ const configuredMainMenu = Array.isArray(mainNav) ? undefined : mainNav;
22
+ let legacyNavLinks;
23
+ if (Array.isArray(mainNav)) {
24
+ legacyNavLinks = mainNav;
25
+ }
26
+ else if (mainNav !== undefined) {
27
+ legacyNavLinks = configuredMainMenu?.fallbackLinks ?? [];
28
+ }
29
+ else {
30
+ legacyNavLinks = deprecatedNavLinks ?? [];
31
+ }
32
+ const mainMenuVariant = configuredMainMenu?.variant ?? 'mega-menu';
33
+ const configuredFooterMenu = footer && !Array.isArray(footer) ? footer : undefined;
34
+ const footerLinks = Array.isArray(footer) ? footer : configuredFooterMenu?.fallbackLinks ?? [];
16
35
  const t = useI18n();
17
36
  const { contexts, onContextClick, label: contextSwitcherLabel = t('switch_to') } = contextSwitcher;
37
+ const appSwitcherMegaMenuItems = configuredAppSwitcherMenu?.variant === 'mega-menu' ? configuredAppSwitcherMenu.items : [];
38
+ const appSwitcherMegaMenuContent = useMemo(() => ({
39
+ id: 'app-switcher-menu',
40
+ label: contextSwitcherLabel,
41
+ items: appSwitcherMegaMenuItems.map(menu => ({
42
+ id: menu.id,
43
+ primary: menu.label,
44
+ ...(menu.items?.length ? { items: menu.items } : {}),
45
+ ...(menu.onClick ? { onClick: menu.onClick } : {}),
46
+ ...(menu.disabled ? { disabled: true } : {})
47
+ }))
48
+ }), [appSwitcherMegaMenuItems, contextSwitcherLabel]);
18
49
  const [backdropOpen, setBackdropOpen] = useState(false);
19
50
  const [drawerOpen, setDrawerOpen] = useState(false);
20
51
  const [drawerContent, setDrawerContent] = useState('');
21
52
  const [notificationsPopover, setNotificationsPopover] = useState(false);
53
+ const [searchExpanded, setSearchExpanded] = useState(false);
22
54
  const [linksCollapsed, setLinksCollapsed] = useState(false);
23
55
  const [hasMobileNav, setHasMobileNav] = useState(true);
24
56
  const [headerEl, setHeaderEl] = useElement();
25
57
  const [navSectionEl, setNavSectionEl] = useElement();
58
+ const [appSwitcherNavEl, setAppSwitcherNavEl] = useElement();
26
59
  const [popoverEl, setPopoverEl] = useElement();
27
60
  const [notificationsButtonEl, setNotificationsButtonEl] = useElement();
61
+ const [searchContainerEl, setSearchContainerEl] = useElement();
62
+ const [footerEl, setFooterEl] = useElement();
63
+ const [configuredFooterHeight, setConfiguredFooterHeight] = useState();
64
+ const searchInputRef = useRef(null);
28
65
  const minInlineWidth = useRef(0);
29
66
  const theme = useTheme();
67
+ const { previewActive } = usePreviewManager();
30
68
  const { themeMode, onThemeModeChange } = useThemeMode();
31
69
  const headerTheme = useMemo(() => getHeaderTheme(theme), [theme]);
32
70
  const headerRef = useConsolidatedRef(setHeaderEl, ref);
33
71
  const isSmallOrAbove = useBreakpoint('sm');
72
+ const configuredMainMenuItems = configuredMainMenu?.items;
73
+ const resolvedMainMenu = useMemo(() => configuredMainMenuItems?.filter(Boolean) ?? [], [configuredMainMenuItems]);
74
+ const resolvedFooterMenu = useMemo(() => {
75
+ if (!configuredFooterMenu?.items.length)
76
+ return undefined;
77
+ if (configuredFooterMenu.variant === 'fat-footer') {
78
+ const items = toFooterMenuEntries(configuredFooterMenu.items);
79
+ return items.length ? { variant: 'fat-footer', items } : undefined;
80
+ }
81
+ const items = flattenMenuItems(configuredFooterMenu.items).map(item => ({
82
+ type: 'link',
83
+ id: item.id,
84
+ label: item.text,
85
+ ...(item.onClick && { onClick: item.onClick })
86
+ }));
87
+ return items.length ? { variant: configuredFooterMenu.variant, items } : undefined;
88
+ }, [configuredFooterMenu]);
89
+ const hasConfiguredFooter = !!configuredFooterMenu;
90
+ useEffect(() => {
91
+ if (!footerEl || !hasConfiguredFooter) {
92
+ setConfiguredFooterHeight(undefined);
93
+ return undefined;
94
+ }
95
+ const measureFooter = () => {
96
+ const root = footerEl.ownerDocument.documentElement;
97
+ const rootFontSize = parseFloat(getComputedStyle(root).fontSize);
98
+ const height = footerEl.getBoundingClientRect().height;
99
+ if (rootFontSize > 0 && height > 0) {
100
+ setConfiguredFooterHeight(`${height / rootFontSize}rem`);
101
+ }
102
+ };
103
+ measureFooter();
104
+ const observer = new ResizeObserver(measureFooter);
105
+ observer.observe(footerEl);
106
+ return () => observer.disconnect();
107
+ }, [footerEl, hasConfiguredFooter]);
108
+ const activeNavItems = resolvedMainMenu.length ? resolvedMainMenu : legacyNavLinks;
109
+ const mainMenuPanelId = useId();
110
+ const appSwitcherPanelId = useId();
111
+ const megaMenu = useMegaMenu({
112
+ menus: resolvedMainMenu,
113
+ navElement: navSectionEl,
114
+ isMobile: hasMobileNav
115
+ });
116
+ const appSwitcherMegaMenu = useMegaMenu({
117
+ menus: [appSwitcherMegaMenuContent],
118
+ navElement: appSwitcherNavEl,
119
+ isMobile: hasMobileNav
120
+ });
34
121
  const { end } = useDirection();
35
122
  let appInfoAs = 'div';
36
123
  if (appInfo.href)
@@ -43,6 +130,13 @@ const AppShell = forwardRef(function AppShell(props, ref) {
43
130
  target: { ariaLabel: t('main_content'), selector: 'main' }
44
131
  }
45
132
  ], [t]);
133
+ const closeNotificationsPopover = useCallback(() => {
134
+ if (!notificationsPopover)
135
+ return;
136
+ setNotificationsPopover(false);
137
+ notifications?.onNotificationsClose?.();
138
+ notificationsButtonEl?.focus();
139
+ }, [notificationsPopover, notifications, notificationsButtonEl]);
46
140
  const closeDrawer = () => {
47
141
  setDrawerContent('');
48
142
  setBackdropOpen(false);
@@ -51,44 +145,67 @@ const AppShell = forwardRef(function AppShell(props, ref) {
51
145
  setDrawerContent(content);
52
146
  setBackdropOpen(true);
53
147
  };
54
- useOuterEvent('mousedown', [popoverEl, notificationsButtonEl], () => {
55
- setNotificationsPopover(false);
56
- notifications?.onNotificationsClose?.();
57
- });
148
+ useOuterEvent('mousedown', [popoverEl, notificationsButtonEl], closeNotificationsPopover);
149
+ useEscape(closeNotificationsPopover, popoverEl);
58
150
  const debouncedResize = debounce((entries) => {
59
151
  if (entries[0].contentRect.width > minInlineWidth.current) {
60
152
  setLinksCollapsed(false);
61
153
  }
62
154
  }, 100);
63
155
  useEffect(() => {
156
+ minInlineWidth.current = 0;
157
+ if (isSmallOrAbove) {
158
+ setLinksCollapsed(false);
159
+ }
160
+ }, [isSmallOrAbove, navAlignment, activeNavItems, mainMenuVariant, navPosition, isDefaultWSS]);
161
+ useEffect(() => {
162
+ if (!headerEl)
163
+ return undefined;
64
164
  const resizeObserver = new ResizeObserver(debouncedResize);
65
- const intersectionObserver = new IntersectionObserver(entries => {
66
- if (entries[0].intersectionRatio > 0 &&
67
- entries[0].intersectionRatio < 1 &&
68
- !linksCollapsed) {
69
- if (headerEl)
165
+ resizeObserver.observe(headerEl);
166
+ let intersectionObserver;
167
+ if (navSectionEl?.firstElementChild && navSectionEl?.lastElementChild) {
168
+ const firstNavItem = navSectionEl.firstElementChild;
169
+ const lastNavItem = navSectionEl.lastElementChild;
170
+ intersectionObserver = new IntersectionObserver(entries => {
171
+ if (entries.some(({ intersectionRatio }) => intersectionRatio < 1) && !linksCollapsed) {
70
172
  minInlineWidth.current = headerEl.clientWidth + 1;
71
- setLinksCollapsed(true);
173
+ setLinksCollapsed(true);
174
+ }
175
+ else {
176
+ navSectionEl.style.visibility = 'visible';
177
+ }
178
+ }, { root: navSectionEl, threshold: 1 });
179
+ intersectionObserver.observe(firstNavItem);
180
+ if (lastNavItem !== firstNavItem) {
181
+ intersectionObserver.observe(lastNavItem);
72
182
  }
73
- else if (navSectionEl)
74
- navSectionEl.style.visibility = 'visible';
75
- }, { root: navPosition === 'below' ? null : navSectionEl, threshold: 1 });
76
- if (headerEl && navSectionEl?.firstChild && navSectionEl?.lastChild) {
77
- intersectionObserver.observe(navAlignment === 'start'
78
- ? navSectionEl.lastChild
79
- : navSectionEl.firstChild);
80
- resizeObserver.observe(headerEl);
81
183
  }
82
184
  return () => {
83
- if (!headerEl) {
84
- intersectionObserver.disconnect();
85
- resizeObserver.disconnect();
86
- }
185
+ intersectionObserver?.disconnect();
186
+ resizeObserver.disconnect();
87
187
  };
88
- }, [headerEl, navSectionEl, navLinks]);
188
+ }, [
189
+ headerEl,
190
+ navSectionEl,
191
+ activeNavItems,
192
+ mainMenuVariant,
193
+ navAlignment,
194
+ navPosition,
195
+ linksCollapsed
196
+ ]);
89
197
  useEffect(() => {
90
198
  setHasMobileNav(!isSmallOrAbove || linksCollapsed);
91
199
  }, [isSmallOrAbove, linksCollapsed]);
200
+ useEffect(() => {
201
+ if (searchExpanded)
202
+ searchInputRef.current?.focus();
203
+ }, [searchExpanded]);
204
+ useFocusWithin([searchContainerEl], isFocused => {
205
+ if (!isFocused && searchExpanded && !searchInput?.value) {
206
+ setSearchExpanded(false);
207
+ }
208
+ });
92
209
  useEffect(() => {
93
210
  if (!hasMobileNav && drawerOpen) {
94
211
  if (drawerContent === 'notifications' && notifications) {
@@ -101,26 +218,84 @@ const AppShell = forwardRef(function AppShell(props, ref) {
101
218
  openDrawer('notifications');
102
219
  }
103
220
  }, [hasMobileNav, drawerOpen]);
104
- const hasFooter = !!footer?.length;
105
- return (_jsxs(_Fragment, { children: [_jsx(SkipLinks, { items: skipLinks }), _jsx(ThemeOverride, { theme: headerTheme, children: _jsxs(StyledAppHeader, { ref: headerRef, navPosition: navPosition, "$isDefaultWSS": isDefaultWSS, children: [_jsxs(Flex, { container: { alignItems: 'center', justify: 'between' }, children: [isDefaultWSS ? (_jsxs(_Fragment, { children: [contexts && onContextClick && contexts.length > 1 && (_jsx(ContextSwitcher, { contexts: contexts, onContextClick: onContextClick, label: contextSwitcherLabel, container: { justify: 'center', pad: [0, 0, 0, 1] } })), _jsxs(Flex, { as: appInfoAs, container: { alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }, href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: [_jsx(Image, { src: appInfo.imageSrc, alt: appInfo.appName }), !hasMobileNav && (_jsxs(Flex, { as: 'span', container: { direction: 'row', gap: 1, alignItems: 'end' }, children: [_jsx(Text, { as: appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName, variant: 'h1', children: appInfo.appName }), appInfo.portalName && (_jsx(Text, { variant: 'h2', as: 'span', children: appInfo.portalName }))] }))] }), !hasMobileNav && navPosition === 'inline' && (_jsx(NavLinks, { ref: setNavSectionEl, navLinks: navLinks, navAlignment: navAlignment, navPosition: navPosition, isDefaultWSS: true }))] })) : (_jsxs(Flex, { container: { alignItems: 'center' }, item: navPosition === 'inline' ? { grow: 1 } : undefined, children: [contexts && onContextClick && contexts.length > 1 && (_jsx(ContextSwitcher, { contexts: contexts, onContextClick: onContextClick, label: contextSwitcherLabel, container: { justify: 'center', pad: [0, 0, 0, 1] } })), navPosition !== 'below' && (_jsxs(Flex, { as: appInfoAs, container: { alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }, href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: [_jsx(Image, { src: appInfo.imageSrc, alt: appInfo.appName }), !hasMobileNav && (_jsxs(Flex, { as: 'span', container: { direction: 'row', gap: 1, alignItems: 'end' }, children: [_jsx(Text, { as: appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName, variant: 'h1', children: appInfo.appName }), appInfo.portalName && (_jsx(Text, { variant: 'h2', as: 'span', children: appInfo.portalName }))] }))] })), !hasMobileNav && navPosition === 'inline' && (_jsx(NavLinks, { ref: setNavSectionEl, navLinks: navLinks, navAlignment: navAlignment, navPosition: navPosition }))] })), _jsxs(Flex, { as: StyledEndNavBlock, container: { alignItems: 'center' }, mobile: hasMobileNav, children: [onThemeModeChange && (_jsx(ThemeSwitcher, { themeMode: themeMode, onThemeModeChange: onThemeModeChange })), notifications && (_jsxs(_Fragment, { children: [_jsx(Button, { ref: setNotificationsButtonEl, variant: 'simple', label: t('open_app_header_notifications'), icon: true, onClick: () => {
106
- if (!hasMobileNav) {
107
- if (notificationsPopover) {
108
- setNotificationsPopover(false);
109
- notifications.onNotificationsClose?.();
221
+ const hasFooter = !!(footerLinks.length || resolvedFooterMenu);
222
+ const useDefaultInlineLayout = isDefaultWSS || navPosition === 'inline';
223
+ const renderMainMenu = () => {
224
+ if (mainMenuVariant === 'individual-menus') {
225
+ return resolvedMainMenu.map(menu => (_jsx(StyledMainMenuLink, { as: AppShellMenuControl, menu: menu, "$isDefaultWSS": isDefaultWSS, "$navPosition": navPosition }, menu.id)));
226
+ }
227
+ return (_jsx(MegaMenuTriggers, { menus: resolvedMainMenu, openId: megaMenu.openMenuId, panelId: mainMenuPanelId, onOpenChange: id => {
228
+ appSwitcherMegaMenu.close();
229
+ megaMenu.onOpenChange(id);
230
+ }, onTriggerOpen: megaMenu.onTriggerOpen, isDefaultWSS: isDefaultWSS, navPosition: navPosition }));
231
+ };
232
+ const renderAppSwitcher = (allowLegacyContextSwitcher) => {
233
+ if (configuredAppSwitcherMenu?.variant === 'mega-menu' &&
234
+ configuredAppSwitcherMenu.items.length &&
235
+ !hasMobileNav) {
236
+ return (_jsx(Flex, { as: StyledContextSwitcher, ref: setAppSwitcherNavEl, container: { justify: 'center', pad: [0, 0, 0, isDefaultWSS ? 1 : 0] }, children: _jsx(Button, { variant: 'simple', icon: true, label: contextSwitcherLabel, "aria-label": contextSwitcherLabel, "aria-expanded": appSwitcherMegaMenu.openMenuId === appSwitcherMegaMenuContent.id, "aria-controls": appSwitcherMegaMenu.openMenuId === appSwitcherMegaMenuContent.id
237
+ ? appSwitcherPanelId
238
+ : undefined, onClick: (event) => {
239
+ const isOpen = appSwitcherMegaMenu.openMenuId === appSwitcherMegaMenuContent.id;
240
+ if (!isOpen) {
241
+ appSwitcherMegaMenu.onTriggerOpen(event.currentTarget, event.detail === 0);
242
+ }
243
+ megaMenu.close();
244
+ appSwitcherMegaMenu.onOpenChange(isOpen ? undefined : appSwitcherMegaMenuContent.id);
245
+ }, children: _jsx(Icon, { name: 'dot-9-solid' }) }) }));
246
+ }
247
+ const configuredCompactMenu = configuredAppSwitcherMenu?.variant === 'context-switcher' ||
248
+ (configuredAppSwitcherMenu?.variant === 'mega-menu' && hasMobileNav);
249
+ const shouldRenderContexts = configuredCompactMenu
250
+ ? !!contexts?.length
251
+ : allowLegacyContextSwitcher && (contexts?.length ?? 0) > 1;
252
+ if (contexts && onContextClick && shouldRenderContexts) {
253
+ return (_jsx(ContextSwitcher, { contexts: contexts, onContextClick: onContextClick, label: contextSwitcherLabel, container: { justify: 'center', pad: [0, 0, 0, isDefaultWSS ? 1 : 0] } }));
254
+ }
255
+ return null;
256
+ };
257
+ const shareLabel = shareApp?.label ?? t('app_shell_share');
258
+ let footerElement = null;
259
+ if (resolvedFooterMenu) {
260
+ footerElement = (_jsx(Footer, { source: 'menu', menu: resolvedFooterMenu, fallbackLinks: footerLinks, elementRef: setFooterEl }));
261
+ }
262
+ else if (footerLinks.length) {
263
+ footerElement = _jsx(Footer, { source: 'legacy', links: footerLinks, elementRef: setFooterEl });
264
+ }
265
+ return (_jsxs(_Fragment, { children: [_jsx(WSSAppShellGlobalStyle, { navPosition: navPosition, hasFooter: hasFooter, configuredFooterHeight: hasConfiguredFooter ? configuredFooterHeight : undefined, hasMobileNav: hasMobileNav, isDefaultWSS: useDefaultInlineLayout }), _jsx(SkipLinks, { items: skipLinks }), _jsxs(ThemeOverride, { theme: headerTheme, children: [_jsxs(StyledAppHeader, { ref: headerRef, navPosition: navPosition, "$isDefaultWSS": isDefaultWSS, "$hasMobileNav": hasMobileNav, children: [_jsxs(Flex, { container: {
266
+ alignItems: 'center',
267
+ justify: 'between',
268
+ pad: navPosition === 'below' ? [1, 0] : 0
269
+ }, children: [useDefaultInlineLayout ? (_jsxs(_Fragment, { children: [_jsxs(Flex, { container: { alignItems: 'center' }, children: [renderAppSwitcher(true), _jsxs(Flex, { as: appInfoAs, container: { alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }, href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: [_jsx(Image, { src: appInfo.imageSrc, alt: appInfo.appName }), !hasMobileNav && (_jsxs(Flex, { as: 'span', container: { direction: 'row', gap: 1, alignItems: 'end' }, children: [_jsx(Text, { as: appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName, variant: 'h1', children: appInfo.appName }), appInfo.portalName && (_jsx(Text, { variant: 'secondary', children: appInfo.portalName }))] }))] })] }), !hasMobileNav &&
270
+ navPosition === 'inline' &&
271
+ (resolvedMainMenu.length ? (_jsx(Flex, { as: StyledNav, ref: setNavSectionEl, item: { grow: 1, basis: '0' }, container: { alignItems: 'center', gap: 0.5, justify: navAlignment }, children: renderMainMenu() })) : (_jsx(NavLinks, { ref: setNavSectionEl, navLinks: legacyNavLinks, navAlignment: navAlignment, navPosition: navPosition, isDefaultWSS: true }))), !hasMobileNav && navPosition !== 'inline' && resolvedMainMenu.length === 0 && (_jsx(NavLinks, { ref: setNavSectionEl, navLinks: legacyNavLinks, navAlignment: navAlignment, navPosition: navPosition, isDefaultWSS: true }))] })) : (_jsxs(Flex, { container: { alignItems: 'center' }, children: [renderAppSwitcher(true), navPosition !== 'below' || hasMobileNav ? (_jsxs(Flex, { as: appInfoAs, container: { alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }, href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: [_jsx(Image, { src: appInfo.imageSrc, alt: appInfo.appName }), !hasMobileNav && (_jsxs(Flex, { as: 'span', container: { direction: 'row', gap: 1, alignItems: 'end' }, children: [_jsx(Text, { as: appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName, variant: 'h1', children: appInfo.appName }), appInfo.portalName && (_jsx(Text, { variant: 'secondary', children: appInfo.portalName }))] }))] })) : null] })), _jsxs(Flex, { as: StyledEndNavBlock, container: { alignItems: 'center', gap: 1 }, mobile: hasMobileNav, children: [!hasMobileNav && searchInput && (_jsx("div", { ref: setSearchContainerEl, role: 'search', "aria-label": t('search'), children: searchExpanded ? (_jsx(SearchInput, { ...searchInput, ref: searchInputRef, onSearchSubmit: searchInput.onSearchSubmit
272
+ ? value => {
273
+ searchInput.onSearchSubmit?.(value);
274
+ setSearchExpanded(false);
275
+ }
276
+ : undefined })) : (_jsx(Button, { icon: true, variant: 'simple', label: t('search'), "aria-label": t('expand_search'), onClick: () => setSearchExpanded(true), children: _jsx(Icon, { name: 'search' }) })) })), onThemeModeChange && (_jsx(ThemeSwitcher, { themeMode: themeMode, onThemeModeChange: onThemeModeChange })), notifications && (_jsxs(_Fragment, { children: [_jsx(Button, { ref: setNotificationsButtonEl, variant: 'simple', label: t('open_app_header_notifications'), icon: true, onClick: () => {
277
+ if (!hasMobileNav) {
278
+ if (notificationsPopover) {
279
+ setNotificationsPopover(false);
280
+ notifications.onNotificationsClose?.();
281
+ }
282
+ else {
283
+ setNotificationsPopover(true);
284
+ notifications.onNotificationsOpen?.();
285
+ }
110
286
  }
111
287
  else {
112
- setNotificationsPopover(true);
113
- notifications.onNotificationsOpen?.();
288
+ openDrawer('notifications');
114
289
  }
115
- }
116
- else {
117
- openDrawer('notifications');
118
- }
119
- }, children: _jsxs(StyledNotificationCount, { children: [_jsx(Icon, { name: 'bell' }), !!notifications.count && (_jsx(StyledCountIcon, { variant: 'urgent', children: notifications.count }))] }) }), _jsx(Popover, { ref: setPopoverEl, show: notificationsPopover, target: notificationsButtonEl, placement: 'bottom-end', children: _jsx(Notifications, { ...notifications, popover: true }) })] })), helpMenu && (_jsx(MenuButton, { variant: 'simple', icon: 'help', text: t('app_header_help'), iconOnly: true, menu: {
120
- items: helpMenu
121
- } })), !hasMobileNav && (_jsxs(Operator, { as: isDefaultWSS ? StyledAppHeaderOperator : StyledModernAppHeaderOperator, actions: operator.actions, popover: { placement: 'bottom-start' }, name: operator.avatar.name, children: [isDefaultWSS ? (_jsx(Avatar, { ...operator.avatar })) : (_jsx(Avatar, { ...operator.avatar, size: 's' })), !isDefaultWSS && operator.avatar.name && (_jsx(Text, { variant: 'secondary', children: t('hello_name', [operator.avatar.name]) }))] })), hasMobileNav && (_jsx(Button, { as: StyledHamburgerMenu, label: t('open_app_header_drawer'), variant: 'simple', icon: true, onClick: () => openDrawer('navigationOperator'), children: _jsx(Icon, { name: 'bars' }) }))] })] }), navPosition === 'below' &&
122
- !hasMobileNav &&
123
- (isDefaultWSS ? (_jsx(NavLinks, { ref: setNavSectionEl, navLinks: navLinks, navAlignment: navAlignment, navPosition: navPosition, isDefaultWSS: true })) : (_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsxs(Flex, { as: appInfoAs, container: { alignItems: 'center', gap: 1 }, href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: [_jsx(Image, { src: appInfo.imageSrc, alt: appInfo.appName }), _jsxs(Flex, { as: 'span', container: { direction: 'row', gap: 1, alignItems: 'end' }, children: [_jsx(Text, { as: appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName, variant: 'h1', children: appInfo.appName }), appInfo.portalName && (_jsx(Text, { variant: 'h2', as: 'span', children: appInfo.portalName }))] })] }), _jsx(NavLinks, { ref: setNavSectionEl, navLinks: navLinks, navAlignment: navAlignment, navPosition: 'below' })] })))] }) }), _jsxs(StyledMain, { navPosition: navPosition, "$isDefaultWSS": isDefaultWSS, "$hasFooter": hasFooter, children: [banners && _jsx(StyledBannerRegion, { children: banners }), main] }), footer && footer.length > 0 && _jsx(Footer, { links: footer }), _jsx(Backdrop, { open: backdropOpen, transitionSpeed: 'none', onAfterTransitionIn: () => setDrawerOpen(true), onBeforeTransitionOut: () => setDrawerOpen(false), onClick: e => {
290
+ }, children: _jsxs(StyledNotificationCount, { children: [_jsx(Icon, { name: 'bell' }), !!notifications.count && (_jsx(StyledCountIcon, { variant: 'urgent', children: notifications.count }))] }) }), _jsx(Popover, { ref: setPopoverEl, show: notificationsPopover, target: notificationsButtonEl, placement: 'bottom-end', children: _jsx(Notifications, { ...notifications, popover: true }) })] })), helpMenu && (_jsx(MenuButton, { variant: 'simple', icon: 'help', text: t('app_header_help'), iconOnly: true, menu: {
291
+ items: helpMenu
292
+ } })), portalSwitcher && _jsx(MenuButton, { ...portalSwitcher, iconOnly: hasMobileNav }), shareApp &&
293
+ (hasMobileNav ? (_jsx(Button, { variant: 'secondary', icon: true, label: shareLabel, onClick: shareApp.onClick, children: _jsx(StyledShareButtonContent, { name: 'share-external', set: 'budicon' }) })) : (_jsxs(Button, { variant: 'secondary', onClick: shareApp.onClick, children: [_jsx(StyledShareButtonContent, { name: 'share-external', set: 'budicon' }), _jsx("span", { children: shareLabel })] }))), !hasMobileNav && (_jsx(Operator, { as: StyledAppHeaderOperator, actions: operator.actions, popover: { placement: 'bottom-start' }, name: operator.avatar.name, children: _jsx(Avatar, { ...operator.avatar }) })), hasMobileNav && (_jsx(Button, { as: StyledHamburgerMenu, label: t('open_app_header_drawer'), variant: 'simple', icon: true, onClick: () => {
294
+ megaMenu.close();
295
+ openDrawer('navigationOperator');
296
+ }, children: _jsx(Icon, { name: 'bars' }) }))] })] }), navPosition === 'below' &&
297
+ !hasMobileNav &&
298
+ (useDefaultInlineLayout ? (_jsx(Flex, { container: { justify: navAlignment }, children: resolvedMainMenu.length ? (_jsx(Flex, { as: StyledNav, ref: setNavSectionEl, item: { grow: 1, basis: '0' }, container: { alignItems: 'center', gap: 0.5, justify: navAlignment }, children: renderMainMenu() })) : (_jsx(NavLinks, { ref: setNavSectionEl, navLinks: legacyNavLinks, navAlignment: navAlignment, navPosition: navPosition, isDefaultWSS: true })) })) : (_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [_jsxs(Flex, { as: appInfoAs, container: { alignItems: 'center', gap: 1 }, href: appInfo.href, onClick: appInfo.onClick, target: appInfo.target, children: [_jsx(Image, { src: appInfo.imageSrc, alt: appInfo.appName }), _jsxs(Flex, { as: 'span', container: { direction: 'row', gap: 1, alignItems: 'center' }, children: [_jsx(Text, { as: appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName, variant: 'h1', children: appInfo.appName }), appInfo.portalName && _jsx(Text, { variant: 'secondary', children: appInfo.portalName })] })] }), resolvedMainMenu.length ? (_jsx(Flex, { as: StyledNav, ref: setNavSectionEl, item: { grow: 1 }, container: { alignItems: 'center', gap: 0.5, justify: navAlignment }, children: renderMainMenu() })) : (_jsx(NavLinks, { ref: setNavSectionEl, navLinks: legacyNavLinks, navAlignment: navAlignment, navPosition: 'below', isDefaultWSS: isDefaultWSS }))] })))] }), !hasMobileNav && mainMenuVariant === 'mega-menu' && megaMenu.openMenu && (_jsx(MegaMenuPanel, { menu: megaMenu.openMenu, panelId: mainMenuPanelId, panelRef: megaMenu.panelRef, onClose: megaMenu.onClose, onTabForwardExit: megaMenu.onTabForwardExit, onActionClose: megaMenu.onActionClose, focusOnOpen: megaMenu.focusOnOpen })), !hasMobileNav && appSwitcherMegaMenuItems.length > 0 && appSwitcherMegaMenu.openMenu && (_jsx(MegaMenuPanel, { menu: appSwitcherMegaMenu.openMenu, panelId: appSwitcherPanelId, anchorElement: appSwitcherNavEl ?? undefined, panelRef: appSwitcherMegaMenu.panelRef, onClose: appSwitcherMegaMenu.onClose, onTabForwardExit: appSwitcherMegaMenu.onTabForwardExit, onActionClose: appSwitcherMegaMenu.onActionClose, focusOnOpen: appSwitcherMegaMenu.focusOnOpen }))] }), _jsxs(StyledMain, { navPosition: navPosition, "$isDefaultWSS": useDefaultInlineLayout, "$hasFooter": hasFooter, "$hasConfiguredFooter": hasConfiguredFooter, previewActive: previewActive, children: [banners && _jsx(StyledBannerRegion, { children: banners }), main] }), resolvedFooterMenu ? (_jsx(ThemeOverride, { theme: headerTheme, children: footerElement })) : (footerElement), _jsx(Backdrop, { open: backdropOpen, transitionSpeed: 'none', onAfterTransitionIn: () => setDrawerOpen(true), onBeforeTransitionOut: () => setDrawerOpen(false), onClick: e => {
124
299
  if (e.currentTarget === e.target)
125
300
  setDrawerOpen(false);
126
301
  }, children: _jsxs(Drawer, { open: drawerOpen, onAfterClose: () => {
@@ -132,7 +307,7 @@ const AppShell = forwardRef(function AppShell(props, ref) {
132
307
  if (drawerContent === 'notifications') {
133
308
  notifications?.onNotificationsOpen?.();
134
309
  }
135
- }, position: 'fixed', placement: end, size: 'min(26rem, calc(100vw - 5rem))', nullWhenClosed: true, children: [drawerContent === 'notifications' && notifications && (_jsx(Notifications, { ...notifications, onClose: () => setDrawerOpen(false) })), drawerContent === 'navigationOperator' && (_jsx(MobileHeaderContent, { appInfo: appInfo, navLinks: navLinks, operator: operator, onClose: () => setDrawerOpen(false) }))] }) })] }));
310
+ }, position: 'fixed', placement: end, size: 'min(26rem, calc(100vw - 5rem))', nullWhenClosed: true, children: [drawerContent === 'notifications' && notifications && (_jsx(Notifications, { ...notifications, onClose: () => setDrawerOpen(false) })), drawerContent === 'navigationOperator' && (_jsx(MobileHeaderContent, { appInfo: appInfo, navLinks: resolvedMainMenu.length ? flattenMenuItems(resolvedMainMenu) : legacyNavLinks, operator: operator, onClose: () => setDrawerOpen(false) }))] }) })] }));
136
311
  });
137
312
  export default AppShell;
138
313
  //# sourceMappingURL=AppShell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGzE,OAAO,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,eAAe,EACf,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,IAAI,EACJ,aAAa,EACb,kBAAkB,EAClB,YAAY,EAC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,EACtB,mBAAmB,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAC9C,qBAAqB,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EACjD,OAAO,EAAE,CAAC,CAAC,EAAE;oBACX,IAAI,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,MAAM;wBAAE,aAAa,CAAC,KAAK,CAAC,CAAC;gBACzD,CAAC,YAED,MAAC,MAAM,IACL,IAAI,EAAE,UAAU,EAChB,YAAY,EAAE,GAAG,EAAE;wBACjB,WAAW,EAAE,CAAC;wBACd,IAAI,aAAa,KAAK,eAAe,EAAE,CAAC;4BACtC,aAAa,EAAE,oBAAoB,EAAE,EAAE,CAAC;wBAC1C,CAAC;oBACH,CAAC,EACD,WAAW,EAAE,GAAG,EAAE;wBAChB,IAAI,aAAa,KAAK,eAAe,EAAE,CAAC;4BACtC,aAAa,EAAE,mBAAmB,EAAE,EAAE,CAAC;wBACzC,CAAC;oBACH,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAE,GAAG,EACd,IAAI,EAAC,gCAAgC,EACrC,cAAc,mBAEb,aAAa,KAAK,eAAe,IAAI,aAAa,IAAI,CACrD,KAAC,aAAa,OAAK,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GAAI,CAC1E,EACA,aAAa,KAAK,oBAAoB,IAAI,CACzC,KAAC,mBAAmB,IAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GACnC,CACH,IACM,GACA,IACV,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ElementType, PropsWithoutRef } from 'react';\n\nimport {\n Avatar,\n Backdrop,\n Button,\n ThemeOverride,\n ContextSwitcher,\n debounce,\n Drawer,\n Flex,\n Icon,\n Image,\n Popover,\n SkipLinks,\n Text,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useElement,\n useI18n,\n useOuterEvent,\n useTheme,\n VisuallyHiddenText,\n MenuButton,\n ThemeSwitcher\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent, SkipLinksProps } from '@pega/cosmos-react-core';\nimport Operator from '@pega/cosmos-react-core/lib/components/AppShell/Operator';\nimport { StyledAppHeaderOperator } from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { getHeaderTheme } from '@pega/cosmos-react-core/lib/components/AppShell/style-utils';\nimport useThemeMode from '@pega/cosmos-react-core/lib/hooks/useThemeMode';\n\nimport Footer from '../Footer';\n\nimport type { AppShellProps } from './AppShell.types';\nimport {\n StyledAppHeader,\n StyledCountIcon,\n StyledHamburgerMenu,\n StyledMain,\n StyledModernAppHeaderOperator,\n StyledNotificationCount,\n StyledPrimaryName,\n StyledEndNavBlock,\n StyledBannerRegion\n} from './AppShell.styles';\nimport Notifications from './Notifications';\nimport MobileHeaderContent from './MobileHeaderContent';\nimport NavLinks from './NavLinks';\n\nconst AppShell: ForwardRefForwardPropsComponent<AppShellProps> = forwardRef(function AppShell(\n props: PropsWithoutRef<AppShellProps>,\n ref: AppShellProps['ref']\n) {\n const {\n main,\n banners,\n appInfo,\n navLinks,\n operator,\n notifications,\n contextSwitcher = {},\n navAlignment = 'end',\n navPosition = 'inline',\n isDefaultWSS = true,\n helpMenu,\n footer\n } = props;\n const t = useI18n();\n const {\n contexts,\n onContextClick,\n label: contextSwitcherLabel = t('switch_to')\n } = contextSwitcher;\n const [backdropOpen, setBackdropOpen] = useState(false);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [drawerContent, setDrawerContent] = useState('');\n const [notificationsPopover, setNotificationsPopover] = useState(false);\n const [linksCollapsed, setLinksCollapsed] = useState(false);\n const [hasMobileNav, setHasMobileNav] = useState(true);\n\n const [headerEl, setHeaderEl] = useElement<HTMLElement>();\n const [navSectionEl, setNavSectionEl] = useElement<HTMLDivElement>();\n const [popoverEl, setPopoverEl] = useElement<HTMLDivElement>();\n const [notificationsButtonEl, setNotificationsButtonEl] = useElement<HTMLButtonElement>();\n const minInlineWidth = useRef(0);\n const theme = useTheme();\n const { themeMode, onThemeModeChange } = useThemeMode();\n const headerTheme = useMemo(() => getHeaderTheme(theme), [theme]);\n\n const headerRef = useConsolidatedRef(setHeaderEl, ref);\n\n const isSmallOrAbove = useBreakpoint('sm');\n const { end } = useDirection();\n\n let appInfoAs: ElementType = 'div';\n if (appInfo.href) appInfoAs = 'a';\n else if (appInfo.onClick) appInfoAs = BareButton;\n\n const skipLinks: SkipLinksProps['items'] = useMemo(\n () => [\n {\n label: t('go_to_main_content'),\n target: { ariaLabel: t('main_content'), selector: 'main' }\n }\n ],\n [t]\n );\n\n const closeDrawer = () => {\n setDrawerContent('');\n setBackdropOpen(false);\n };\n\n const openDrawer = (content: 'notifications' | 'navigationOperator') => {\n setDrawerContent(content);\n setBackdropOpen(true);\n };\n\n useOuterEvent('mousedown', [popoverEl, notificationsButtonEl], () => {\n setNotificationsPopover(false);\n notifications?.onNotificationsClose?.();\n });\n\n const debouncedResize = debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minInlineWidth.current) {\n setLinksCollapsed(false);\n }\n }, 100);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(debouncedResize);\n\n const intersectionObserver = new IntersectionObserver(\n entries => {\n if (\n entries[0].intersectionRatio > 0 &&\n entries[0].intersectionRatio < 1 &&\n !linksCollapsed\n ) {\n if (headerEl) minInlineWidth.current = headerEl.clientWidth + 1;\n setLinksCollapsed(true);\n } else if (navSectionEl) navSectionEl.style.visibility = 'visible';\n },\n { root: navPosition === 'below' ? null : navSectionEl, threshold: 1 }\n );\n\n if (headerEl && navSectionEl?.firstChild && navSectionEl?.lastChild) {\n intersectionObserver.observe(\n navAlignment === 'start'\n ? (navSectionEl.lastChild as Element)\n : (navSectionEl.firstChild as Element)\n );\n resizeObserver.observe(headerEl);\n }\n\n return () => {\n if (!headerEl) {\n intersectionObserver.disconnect();\n resizeObserver.disconnect();\n }\n };\n }, [headerEl, navSectionEl, navLinks]);\n\n useEffect(() => {\n setHasMobileNav(!isSmallOrAbove || linksCollapsed);\n }, [isSmallOrAbove, linksCollapsed]);\n\n useEffect(() => {\n if (!hasMobileNav && drawerOpen) {\n if (drawerContent === 'notifications' && notifications) {\n setNotificationsPopover(true);\n }\n setDrawerOpen(false);\n } else if (hasMobileNav && notificationsPopover) {\n setNotificationsPopover(false);\n openDrawer('notifications');\n }\n }, [hasMobileNav, drawerOpen]);\n\n const hasFooter = !!footer?.length;\n\n return (\n <>\n <SkipLinks items={skipLinks} />\n <ThemeOverride theme={headerTheme}>\n <StyledAppHeader ref={headerRef} navPosition={navPosition} $isDefaultWSS={isDefaultWSS}>\n <Flex container={{ alignItems: 'center', justify: 'between' }}>\n {isDefaultWSS ? (\n <>\n {contexts && onContextClick && contexts.length > 1 && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n container={{ justify: 'center', pad: [0, 0, 0, 1] }}\n />\n )}\n\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n {!hasMobileNav && (\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='h2' as='span'>\n {appInfo.portalName}\n </Text>\n )}\n </Flex>\n )}\n </Flex>\n\n {!hasMobileNav && navPosition === 'inline' && (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n isDefaultWSS\n />\n )}\n </>\n ) : (\n <Flex\n container={{ alignItems: 'center' }}\n item={navPosition === 'inline' ? { grow: 1 } : undefined}\n >\n {contexts && onContextClick && contexts.length > 1 && (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n container={{ justify: 'center', pad: [0, 0, 0, 1] }}\n />\n )}\n\n {navPosition !== 'below' && (\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n {!hasMobileNav && (\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='h2' as='span'>\n {appInfo.portalName}\n </Text>\n )}\n </Flex>\n )}\n </Flex>\n )}\n\n {!hasMobileNav && navPosition === 'inline' && (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n />\n )}\n </Flex>\n )}\n\n <Flex as={StyledEndNavBlock} container={{ alignItems: 'center' }} mobile={hasMobileNav}>\n {onThemeModeChange && (\n <ThemeSwitcher themeMode={themeMode} onThemeModeChange={onThemeModeChange} />\n )}\n {notifications && (\n <>\n <Button\n ref={setNotificationsButtonEl}\n variant='simple'\n label={t('open_app_header_notifications')}\n icon\n onClick={() => {\n if (!hasMobileNav) {\n if (notificationsPopover) {\n setNotificationsPopover(false);\n notifications.onNotificationsClose?.();\n } else {\n setNotificationsPopover(true);\n notifications.onNotificationsOpen?.();\n }\n } else {\n openDrawer('notifications');\n }\n }}\n >\n <StyledNotificationCount>\n <Icon name='bell' />\n {!!notifications.count && (\n <StyledCountIcon variant='urgent'>{notifications.count}</StyledCountIcon>\n )}\n </StyledNotificationCount>\n </Button>\n <Popover\n ref={setPopoverEl}\n show={notificationsPopover}\n target={notificationsButtonEl}\n placement='bottom-end'\n >\n <Notifications {...notifications} popover />\n </Popover>\n </>\n )}\n {helpMenu && (\n <MenuButton\n variant='simple'\n icon='help'\n text={t('app_header_help')}\n iconOnly\n menu={{\n items: helpMenu\n }}\n />\n )}\n {!hasMobileNav && (\n <Operator\n as={isDefaultWSS ? StyledAppHeaderOperator : StyledModernAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-start' }}\n name={operator.avatar.name}\n >\n {isDefaultWSS ? (\n <Avatar {...operator.avatar} />\n ) : (\n <Avatar {...operator.avatar} size='s' />\n )}\n {!isDefaultWSS && operator.avatar.name && (\n <Text variant='secondary'>{t('hello_name', [operator.avatar.name])}</Text>\n )}\n </Operator>\n )}\n\n {hasMobileNav && (\n <Button\n as={StyledHamburgerMenu}\n label={t('open_app_header_drawer')}\n variant='simple'\n icon\n onClick={() => openDrawer('navigationOperator')}\n >\n <Icon name='bars' />\n </Button>\n )}\n </Flex>\n </Flex>\n\n {navPosition === 'below' &&\n !hasMobileNav &&\n (isDefaultWSS ? (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n isDefaultWSS\n />\n ) : (\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='h2' as='span'>\n {appInfo.portalName}\n </Text>\n )}\n </Flex>\n </Flex>\n <NavLinks\n ref={setNavSectionEl}\n navLinks={navLinks}\n navAlignment={navAlignment}\n navPosition='below'\n />\n </Flex>\n ))}\n </StyledAppHeader>\n </ThemeOverride>\n\n <StyledMain navPosition={navPosition} $isDefaultWSS={isDefaultWSS} $hasFooter={hasFooter}>\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledMain>\n\n {footer && footer.length > 0 && <Footer links={footer} />}\n\n <Backdrop\n open={backdropOpen}\n transitionSpeed='none'\n onAfterTransitionIn={() => setDrawerOpen(true)}\n onBeforeTransitionOut={() => setDrawerOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setDrawerOpen(false);\n }}\n >\n <Drawer\n open={drawerOpen}\n onAfterClose={() => {\n closeDrawer();\n if (drawerContent === 'notifications') {\n notifications?.onNotificationsClose?.();\n }\n }}\n onAfterOpen={() => {\n if (drawerContent === 'notifications') {\n notifications?.onNotificationsOpen?.();\n }\n }}\n position='fixed'\n placement={end}\n size='min(26rem, calc(100vw - 5rem))'\n nullWhenClosed\n >\n {drawerContent === 'notifications' && notifications && (\n <Notifications {...notifications} onClose={() => setDrawerOpen(false)} />\n )}\n {drawerContent === 'navigationOperator' && (\n <MobileHeaderContent\n appInfo={appInfo}\n navLinks={navLinks}\n operator={operator}\n onClose={() => setDrawerOpen(false)}\n />\n )}\n </Drawer>\n </Backdrop>\n </>\n );\n});\n\nexport default AppShell;\n"]}
1
+ {"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../../src/components/AppShell/AppShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG7F,OAAO,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,eAAe,EACf,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,I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aAAa,EAAE,oBAAoB,EAAE,EAAE,CAAC;wBAC1C,CAAC;oBACH,CAAC,EACD,WAAW,EAAE,GAAG,EAAE;wBAChB,IAAI,aAAa,KAAK,eAAe,EAAE,CAAC;4BACtC,aAAa,EAAE,mBAAmB,EAAE,EAAE,CAAC;wBACzC,CAAC;oBACH,CAAC,EACD,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAE,GAAG,EACd,IAAI,EAAC,gCAAgC,EACrC,cAAc,mBAEb,aAAa,KAAK,eAAe,IAAI,aAAa,IAAI,CACrD,KAAC,aAAa,OAAK,aAAa,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GAAI,CAC1E,EACA,aAAa,KAAK,oBAAoB,IAAI,CACzC,KAAC,mBAAmB,IAClB,OAAO,EAAE,OAAO,EAChB,QAAQ,EACN,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,cAAc,EAE/E,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,GACnC,CACH,IACM,GACA,IACV,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,QAAQ,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useId, useMemo, useRef, useState } from 'react';\nimport type { ElementType, MouseEvent, PropsWithoutRef } from 'react';\n\nimport {\n Avatar,\n Backdrop,\n Button,\n ThemeOverride,\n ContextSwitcher,\n debounce,\n Drawer,\n Flex,\n Icon,\n Image,\n Popover,\n registerIcon,\n SearchInput,\n SkipLinks,\n Text,\n useBreakpoint,\n useConsolidatedRef,\n useDirection,\n useElement,\n useEscape,\n useFocusWithin,\n useI18n,\n useOuterEvent,\n usePreviewManager,\n useTheme,\n VisuallyHiddenText,\n MenuButton,\n ThemeSwitcher\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent, SkipLinksProps } from '@pega/cosmos-react-core';\nimport Operator from '@pega/cosmos-react-core/lib/components/AppShell/Operator';\nimport {\n StyledAppHeaderOperator,\n StyledContextSwitcher\n} from '@pega/cosmos-react-core/lib/components/AppShell/AppHeader.styles';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport * as shareExternalIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/share-external.icon';\nimport { getHeaderTheme } from '@pega/cosmos-react-core/lib/components/AppShell/style-utils';\nimport useThemeMode from '@pega/cosmos-react-core/lib/hooks/useThemeMode';\n\nimport Footer from '../Footer';\nimport type { FooterMenuProps } from '../Footer';\n\nimport type { AppShellProps, NavLinkProps, NavMenuItemProps, NavMenuProps } from './AppShell.types';\nimport { flattenMenuItems, toFooterMenuEntries } from './AppShell.utils';\nimport {\n WSSAppShellGlobalStyle,\n StyledAppHeader,\n StyledCountIcon,\n StyledHamburgerMenu,\n StyledMain,\n StyledNotificationCount,\n StyledMainMenuLink,\n StyledNav,\n StyledPrimaryName,\n StyledEndNavBlock,\n StyledBannerRegion,\n StyledShareButtonContent\n} from './AppShell.styles';\nimport Notifications from './Notifications';\nimport MobileHeaderContent from './MobileHeaderContent';\nimport NavLinks from './NavLinks';\nimport AppShellMenuControl from './AppShellMenuControl';\nimport { MegaMenuPanel, MegaMenuTriggers, useMegaMenu } from './MegaMenu';\n\nregisterIcon(shareExternalIcon);\n\nconst AppShell: ForwardRefForwardPropsComponent<AppShellProps> = forwardRef(function AppShell(\n props: PropsWithoutRef<AppShellProps>,\n ref: AppShellProps['ref']\n) {\n const {\n main,\n banners,\n appInfo,\n mainNav,\n navLinks: deprecatedNavLinks,\n appSwitcherMenu: configuredAppSwitcherMenu,\n operator,\n notifications,\n searchInput,\n contextSwitcher = {},\n navAlignment = 'end',\n navPosition = 'inline',\n isDefaultWSS = true,\n helpMenu,\n shareApp,\n portalSwitcher,\n footer\n } = props;\n const configuredMainMenu = Array.isArray(mainNav) ? undefined : mainNav;\n let legacyNavLinks: NavLinkProps[];\n if (Array.isArray(mainNav)) {\n legacyNavLinks = mainNav;\n } else if (mainNav !== undefined) {\n legacyNavLinks = configuredMainMenu?.fallbackLinks ?? [];\n } else {\n legacyNavLinks = deprecatedNavLinks ?? [];\n }\n const mainMenuVariant = configuredMainMenu?.variant ?? 'mega-menu';\n const configuredFooterMenu = footer && !Array.isArray(footer) ? footer : undefined;\n const footerLinks = Array.isArray(footer) ? footer : configuredFooterMenu?.fallbackLinks ?? [];\n const t = useI18n();\n const {\n contexts,\n onContextClick,\n label: contextSwitcherLabel = t('switch_to')\n } = contextSwitcher;\n const appSwitcherMegaMenuItems =\n configuredAppSwitcherMenu?.variant === 'mega-menu' ? configuredAppSwitcherMenu.items : [];\n const appSwitcherMegaMenuContent = useMemo<NavMenuProps>(\n () => ({\n id: 'app-switcher-menu',\n label: contextSwitcherLabel,\n items: appSwitcherMegaMenuItems.map<NavMenuItemProps>(menu => ({\n id: menu.id,\n primary: menu.label,\n ...(menu.items?.length ? { items: menu.items } : {}),\n ...(menu.onClick ? { onClick: menu.onClick } : {}),\n ...(menu.disabled ? { disabled: true } : {})\n }))\n }),\n [appSwitcherMegaMenuItems, contextSwitcherLabel]\n );\n const [backdropOpen, setBackdropOpen] = useState(false);\n const [drawerOpen, setDrawerOpen] = useState(false);\n const [drawerContent, setDrawerContent] = useState('');\n const [notificationsPopover, setNotificationsPopover] = useState(false);\n const [searchExpanded, setSearchExpanded] = useState(false);\n const [linksCollapsed, setLinksCollapsed] = useState(false);\n const [hasMobileNav, setHasMobileNav] = useState(true);\n\n const [headerEl, setHeaderEl] = useElement<HTMLElement>();\n const [navSectionEl, setNavSectionEl] = useElement<HTMLDivElement>();\n const [appSwitcherNavEl, setAppSwitcherNavEl] = useElement<HTMLDivElement>();\n const [popoverEl, setPopoverEl] = useElement<HTMLDivElement>();\n const [notificationsButtonEl, setNotificationsButtonEl] = useElement<HTMLButtonElement>();\n const [searchContainerEl, setSearchContainerEl] = useElement<HTMLDivElement>();\n const [footerEl, setFooterEl] = useElement<HTMLElement>();\n const [configuredFooterHeight, setConfiguredFooterHeight] = useState<string>();\n const searchInputRef = useRef<HTMLInputElement>(null);\n const minInlineWidth = useRef(0);\n const theme = useTheme();\n const { previewActive } = usePreviewManager();\n const { themeMode, onThemeModeChange } = useThemeMode();\n const headerTheme = useMemo(() => getHeaderTheme(theme), [theme]);\n\n const headerRef = useConsolidatedRef(setHeaderEl, ref);\n\n const isSmallOrAbove = useBreakpoint('sm');\n const configuredMainMenuItems = configuredMainMenu?.items;\n const resolvedMainMenu = useMemo(\n () => configuredMainMenuItems?.filter(Boolean) ?? [],\n [configuredMainMenuItems]\n );\n const resolvedFooterMenu = useMemo<FooterMenuProps | undefined>(() => {\n if (!configuredFooterMenu?.items.length) return undefined;\n if (configuredFooterMenu.variant === 'fat-footer') {\n const items = toFooterMenuEntries(configuredFooterMenu.items);\n return items.length ? { variant: 'fat-footer', items } : undefined;\n }\n\n const items = flattenMenuItems(configuredFooterMenu.items).map(item => ({\n type: 'link' as const,\n id: item.id,\n label: item.text,\n ...(item.onClick && { onClick: item.onClick })\n }));\n return items.length ? { variant: configuredFooterMenu.variant, items } : undefined;\n }, [configuredFooterMenu]);\n const hasConfiguredFooter = !!configuredFooterMenu;\n\n useEffect(() => {\n if (!footerEl || !hasConfiguredFooter) {\n setConfiguredFooterHeight(undefined);\n return undefined;\n }\n\n const measureFooter = () => {\n const root = footerEl.ownerDocument.documentElement;\n const rootFontSize = parseFloat(getComputedStyle(root).fontSize);\n const height = footerEl.getBoundingClientRect().height;\n if (rootFontSize > 0 && height > 0) {\n setConfiguredFooterHeight(`${height / rootFontSize}rem`);\n }\n };\n\n measureFooter();\n const observer = new ResizeObserver(measureFooter);\n observer.observe(footerEl);\n return () => observer.disconnect();\n }, [footerEl, hasConfiguredFooter]);\n\n const activeNavItems = resolvedMainMenu.length ? resolvedMainMenu : legacyNavLinks;\n const mainMenuPanelId = useId();\n const appSwitcherPanelId = useId();\n const megaMenu = useMegaMenu({\n menus: resolvedMainMenu,\n navElement: navSectionEl,\n isMobile: hasMobileNav\n });\n const appSwitcherMegaMenu = useMegaMenu({\n menus: [appSwitcherMegaMenuContent],\n navElement: appSwitcherNavEl,\n isMobile: hasMobileNav\n });\n const { end } = useDirection();\n\n let appInfoAs: ElementType = 'div';\n if (appInfo.href) appInfoAs = 'a';\n else if (appInfo.onClick) appInfoAs = BareButton;\n\n const skipLinks: SkipLinksProps['items'] = useMemo(\n () => [\n {\n label: t('go_to_main_content'),\n target: { ariaLabel: t('main_content'), selector: 'main' }\n }\n ],\n [t]\n );\n\n const closeNotificationsPopover = useCallback(() => {\n if (!notificationsPopover) return;\n\n setNotificationsPopover(false);\n notifications?.onNotificationsClose?.();\n\n notificationsButtonEl?.focus();\n }, [notificationsPopover, notifications, notificationsButtonEl]);\n\n const closeDrawer = () => {\n setDrawerContent('');\n setBackdropOpen(false);\n };\n\n const openDrawer = (content: 'notifications' | 'navigationOperator') => {\n setDrawerContent(content);\n setBackdropOpen(true);\n };\n\n useOuterEvent('mousedown', [popoverEl, notificationsButtonEl], closeNotificationsPopover);\n\n useEscape(closeNotificationsPopover, popoverEl);\n\n const debouncedResize = debounce((entries: ResizeObserverEntry[]) => {\n if (entries[0].contentRect.width > minInlineWidth.current) {\n setLinksCollapsed(false);\n }\n }, 100);\n\n useEffect(() => {\n minInlineWidth.current = 0;\n\n if (isSmallOrAbove) {\n setLinksCollapsed(false);\n }\n }, [isSmallOrAbove, navAlignment, activeNavItems, mainMenuVariant, navPosition, isDefaultWSS]);\n\n useEffect(() => {\n if (!headerEl) return undefined;\n\n const resizeObserver = new ResizeObserver(debouncedResize);\n resizeObserver.observe(headerEl);\n\n let intersectionObserver: IntersectionObserver | undefined;\n\n if (navSectionEl?.firstElementChild && navSectionEl?.lastElementChild) {\n const firstNavItem = navSectionEl.firstElementChild;\n const lastNavItem = navSectionEl.lastElementChild;\n\n intersectionObserver = new IntersectionObserver(\n entries => {\n if (entries.some(({ intersectionRatio }) => intersectionRatio < 1) && !linksCollapsed) {\n minInlineWidth.current = headerEl.clientWidth + 1;\n setLinksCollapsed(true);\n } else {\n navSectionEl.style.visibility = 'visible';\n }\n },\n { root: navSectionEl, threshold: 1 }\n );\n\n intersectionObserver.observe(firstNavItem);\n\n if (lastNavItem !== firstNavItem) {\n intersectionObserver.observe(lastNavItem);\n }\n }\n\n return () => {\n intersectionObserver?.disconnect();\n resizeObserver.disconnect();\n };\n }, [\n headerEl,\n navSectionEl,\n activeNavItems,\n mainMenuVariant,\n navAlignment,\n navPosition,\n linksCollapsed\n ]);\n\n useEffect(() => {\n setHasMobileNav(!isSmallOrAbove || linksCollapsed);\n }, [isSmallOrAbove, linksCollapsed]);\n\n useEffect(() => {\n if (searchExpanded) searchInputRef.current?.focus();\n }, [searchExpanded]);\n\n useFocusWithin([searchContainerEl], isFocused => {\n if (!isFocused && searchExpanded && !searchInput?.value) {\n setSearchExpanded(false);\n }\n });\n\n useEffect(() => {\n if (!hasMobileNav && drawerOpen) {\n if (drawerContent === 'notifications' && notifications) {\n setNotificationsPopover(true);\n }\n setDrawerOpen(false);\n } else if (hasMobileNav && notificationsPopover) {\n setNotificationsPopover(false);\n openDrawer('notifications');\n }\n }, [hasMobileNav, drawerOpen]);\n\n const hasFooter = !!(footerLinks.length || resolvedFooterMenu);\n const useDefaultInlineLayout = isDefaultWSS || navPosition === 'inline';\n const renderMainMenu = () => {\n if (mainMenuVariant === 'individual-menus') {\n return resolvedMainMenu.map(menu => (\n <StyledMainMenuLink\n as={AppShellMenuControl}\n key={menu.id}\n menu={menu}\n $isDefaultWSS={isDefaultWSS}\n $navPosition={navPosition}\n />\n ));\n }\n\n return (\n <MegaMenuTriggers\n menus={resolvedMainMenu}\n openId={megaMenu.openMenuId}\n panelId={mainMenuPanelId}\n onOpenChange={id => {\n appSwitcherMegaMenu.close();\n megaMenu.onOpenChange(id);\n }}\n onTriggerOpen={megaMenu.onTriggerOpen}\n isDefaultWSS={isDefaultWSS}\n navPosition={navPosition}\n />\n );\n };\n const renderAppSwitcher = (allowLegacyContextSwitcher: boolean) => {\n if (\n configuredAppSwitcherMenu?.variant === 'mega-menu' &&\n configuredAppSwitcherMenu.items.length &&\n !hasMobileNav\n ) {\n return (\n <Flex\n as={StyledContextSwitcher}\n ref={setAppSwitcherNavEl}\n container={{ justify: 'center', pad: [0, 0, 0, isDefaultWSS ? 1 : 0] }}\n >\n <Button\n variant='simple'\n icon\n label={contextSwitcherLabel}\n aria-label={contextSwitcherLabel}\n aria-expanded={appSwitcherMegaMenu.openMenuId === appSwitcherMegaMenuContent.id}\n aria-controls={\n appSwitcherMegaMenu.openMenuId === appSwitcherMegaMenuContent.id\n ? appSwitcherPanelId\n : undefined\n }\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n const isOpen = appSwitcherMegaMenu.openMenuId === appSwitcherMegaMenuContent.id;\n if (!isOpen) {\n appSwitcherMegaMenu.onTriggerOpen(event.currentTarget, event.detail === 0);\n }\n megaMenu.close();\n appSwitcherMegaMenu.onOpenChange(isOpen ? undefined : appSwitcherMegaMenuContent.id);\n }}\n >\n <Icon name='dot-9-solid' />\n </Button>\n </Flex>\n );\n }\n\n const configuredCompactMenu =\n configuredAppSwitcherMenu?.variant === 'context-switcher' ||\n (configuredAppSwitcherMenu?.variant === 'mega-menu' && hasMobileNav);\n const shouldRenderContexts = configuredCompactMenu\n ? !!contexts?.length\n : allowLegacyContextSwitcher && (contexts?.length ?? 0) > 1;\n\n if (contexts && onContextClick && shouldRenderContexts) {\n return (\n <ContextSwitcher\n contexts={contexts}\n onContextClick={onContextClick}\n label={contextSwitcherLabel}\n container={{ justify: 'center', pad: [0, 0, 0, isDefaultWSS ? 1 : 0] }}\n />\n );\n }\n\n return null;\n };\n const shareLabel = shareApp?.label ?? t('app_shell_share');\n let footerElement = null;\n if (resolvedFooterMenu) {\n footerElement = (\n <Footer\n source='menu'\n menu={resolvedFooterMenu}\n fallbackLinks={footerLinks}\n elementRef={setFooterEl}\n />\n );\n } else if (footerLinks.length) {\n footerElement = <Footer source='legacy' links={footerLinks} elementRef={setFooterEl} />;\n }\n\n return (\n <>\n <WSSAppShellGlobalStyle\n navPosition={navPosition}\n hasFooter={hasFooter}\n configuredFooterHeight={hasConfiguredFooter ? configuredFooterHeight : undefined}\n hasMobileNav={hasMobileNav}\n isDefaultWSS={useDefaultInlineLayout}\n />\n <SkipLinks items={skipLinks} />\n <ThemeOverride theme={headerTheme}>\n <StyledAppHeader\n ref={headerRef}\n navPosition={navPosition}\n $isDefaultWSS={isDefaultWSS}\n $hasMobileNav={hasMobileNav}\n >\n <Flex\n container={{\n alignItems: 'center',\n justify: 'between',\n pad: navPosition === 'below' ? [1, 0] : 0\n }}\n >\n {useDefaultInlineLayout ? (\n <>\n <Flex container={{ alignItems: 'center' }}>\n {renderAppSwitcher(true)}\n\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n {!hasMobileNav && (\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='secondary'>{appInfo.portalName}</Text>\n )}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {!hasMobileNav &&\n navPosition === 'inline' &&\n (resolvedMainMenu.length ? (\n <Flex\n as={StyledNav}\n ref={setNavSectionEl}\n item={{ grow: 1, basis: '0' }}\n container={{ alignItems: 'center', gap: 0.5, justify: navAlignment }}\n >\n {renderMainMenu()}\n </Flex>\n ) : (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={legacyNavLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n isDefaultWSS\n />\n ))}\n\n {!hasMobileNav && navPosition !== 'inline' && resolvedMainMenu.length === 0 && (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={legacyNavLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n isDefaultWSS\n />\n )}\n </>\n ) : (\n <Flex container={{ alignItems: 'center' }}>\n {renderAppSwitcher(true)}\n\n {navPosition !== 'below' || hasMobileNav ? (\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', pad: [1, 4, 1, 1], gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n {!hasMobileNav && (\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'end' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && (\n <Text variant='secondary'>{appInfo.portalName}</Text>\n )}\n </Flex>\n )}\n </Flex>\n ) : null}\n </Flex>\n )}\n\n <Flex\n as={StyledEndNavBlock}\n container={{ alignItems: 'center', gap: 1 }}\n mobile={hasMobileNav}\n >\n {!hasMobileNav && searchInput && (\n <div ref={setSearchContainerEl} role='search' aria-label={t('search')}>\n {searchExpanded ? (\n <SearchInput\n {...searchInput}\n ref={searchInputRef}\n onSearchSubmit={\n searchInput.onSearchSubmit\n ? value => {\n searchInput.onSearchSubmit?.(value);\n setSearchExpanded(false);\n }\n : undefined\n }\n />\n ) : (\n <Button\n icon\n variant='simple'\n label={t('search')}\n aria-label={t('expand_search')}\n onClick={() => setSearchExpanded(true)}\n >\n <Icon name='search' />\n </Button>\n )}\n </div>\n )}\n\n {onThemeModeChange && (\n <ThemeSwitcher themeMode={themeMode} onThemeModeChange={onThemeModeChange} />\n )}\n\n {notifications && (\n <>\n <Button\n ref={setNotificationsButtonEl}\n variant='simple'\n label={t('open_app_header_notifications')}\n icon\n onClick={() => {\n if (!hasMobileNav) {\n if (notificationsPopover) {\n setNotificationsPopover(false);\n notifications.onNotificationsClose?.();\n } else {\n setNotificationsPopover(true);\n notifications.onNotificationsOpen?.();\n }\n } else {\n openDrawer('notifications');\n }\n }}\n >\n <StyledNotificationCount>\n <Icon name='bell' />\n {!!notifications.count && (\n <StyledCountIcon variant='urgent'>{notifications.count}</StyledCountIcon>\n )}\n </StyledNotificationCount>\n </Button>\n <Popover\n ref={setPopoverEl}\n show={notificationsPopover}\n target={notificationsButtonEl}\n placement='bottom-end'\n >\n <Notifications {...notifications} popover />\n </Popover>\n </>\n )}\n\n {helpMenu && (\n <MenuButton\n variant='simple'\n icon='help'\n text={t('app_header_help')}\n iconOnly\n menu={{\n items: helpMenu\n }}\n />\n )}\n\n {portalSwitcher && <MenuButton {...portalSwitcher} iconOnly={hasMobileNav} />}\n\n {shareApp &&\n (hasMobileNav ? (\n <Button variant='secondary' icon label={shareLabel} onClick={shareApp.onClick}>\n <StyledShareButtonContent name='share-external' set='budicon' />\n </Button>\n ) : (\n <Button variant='secondary' onClick={shareApp.onClick}>\n <StyledShareButtonContent name='share-external' set='budicon' />\n <span>{shareLabel}</span>\n </Button>\n ))}\n\n {!hasMobileNav && (\n <Operator\n as={StyledAppHeaderOperator}\n actions={operator.actions}\n popover={{ placement: 'bottom-start' }}\n name={operator.avatar.name}\n >\n <Avatar {...operator.avatar} />\n </Operator>\n )}\n\n {hasMobileNav && (\n <Button\n as={StyledHamburgerMenu}\n label={t('open_app_header_drawer')}\n variant='simple'\n icon\n onClick={() => {\n megaMenu.close();\n openDrawer('navigationOperator');\n }}\n >\n <Icon name='bars' />\n </Button>\n )}\n </Flex>\n </Flex>\n\n {navPosition === 'below' &&\n !hasMobileNav &&\n (useDefaultInlineLayout ? (\n <Flex container={{ justify: navAlignment }}>\n {resolvedMainMenu.length ? (\n <Flex\n as={StyledNav}\n ref={setNavSectionEl}\n item={{ grow: 1, basis: '0' }}\n container={{ alignItems: 'center', gap: 0.5, justify: navAlignment }}\n >\n {renderMainMenu()}\n </Flex>\n ) : (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={legacyNavLinks}\n navAlignment={navAlignment}\n navPosition={navPosition}\n isDefaultWSS\n />\n )}\n </Flex>\n ) : (\n <Flex container={{ alignItems: 'center', gap: 1 }}>\n <Flex\n as={appInfoAs}\n container={{ alignItems: 'center', gap: 1 }}\n href={appInfo.href}\n onClick={appInfo.onClick}\n target={appInfo.target}\n >\n <Image src={appInfo.imageSrc} alt={appInfo.appName} />\n <Flex as='span' container={{ direction: 'row', gap: 1, alignItems: 'center' }}>\n <Text\n as={appInfo.appNameHidden ? VisuallyHiddenText : StyledPrimaryName}\n variant='h1'\n >\n {appInfo.appName}\n </Text>\n {appInfo.portalName && <Text variant='secondary'>{appInfo.portalName}</Text>}\n </Flex>\n </Flex>\n {resolvedMainMenu.length ? (\n <Flex\n as={StyledNav}\n ref={setNavSectionEl}\n item={{ grow: 1 }}\n container={{ alignItems: 'center', gap: 0.5, justify: navAlignment }}\n >\n {renderMainMenu()}\n </Flex>\n ) : (\n <NavLinks\n ref={setNavSectionEl}\n navLinks={legacyNavLinks}\n navAlignment={navAlignment}\n navPosition='below'\n isDefaultWSS={isDefaultWSS}\n />\n )}\n </Flex>\n ))}\n </StyledAppHeader>\n {!hasMobileNav && mainMenuVariant === 'mega-menu' && megaMenu.openMenu && (\n <MegaMenuPanel\n menu={megaMenu.openMenu}\n panelId={mainMenuPanelId}\n panelRef={megaMenu.panelRef}\n onClose={megaMenu.onClose}\n onTabForwardExit={megaMenu.onTabForwardExit}\n onActionClose={megaMenu.onActionClose}\n focusOnOpen={megaMenu.focusOnOpen}\n />\n )}\n {!hasMobileNav && appSwitcherMegaMenuItems.length > 0 && appSwitcherMegaMenu.openMenu && (\n <MegaMenuPanel\n menu={appSwitcherMegaMenu.openMenu}\n panelId={appSwitcherPanelId}\n anchorElement={appSwitcherNavEl ?? undefined}\n panelRef={appSwitcherMegaMenu.panelRef}\n onClose={appSwitcherMegaMenu.onClose}\n onTabForwardExit={appSwitcherMegaMenu.onTabForwardExit}\n onActionClose={appSwitcherMegaMenu.onActionClose}\n focusOnOpen={appSwitcherMegaMenu.focusOnOpen}\n />\n )}\n </ThemeOverride>\n\n <StyledMain\n navPosition={navPosition}\n $isDefaultWSS={useDefaultInlineLayout}\n $hasFooter={hasFooter}\n $hasConfiguredFooter={hasConfiguredFooter}\n previewActive={previewActive}\n >\n {banners && <StyledBannerRegion>{banners}</StyledBannerRegion>}\n {main}\n </StyledMain>\n\n {resolvedFooterMenu ? (\n <ThemeOverride theme={headerTheme}>{footerElement}</ThemeOverride>\n ) : (\n footerElement\n )}\n\n <Backdrop\n open={backdropOpen}\n transitionSpeed='none'\n onAfterTransitionIn={() => setDrawerOpen(true)}\n onBeforeTransitionOut={() => setDrawerOpen(false)}\n onClick={e => {\n if (e.currentTarget === e.target) setDrawerOpen(false);\n }}\n >\n <Drawer\n open={drawerOpen}\n onAfterClose={() => {\n closeDrawer();\n if (drawerContent === 'notifications') {\n notifications?.onNotificationsClose?.();\n }\n }}\n onAfterOpen={() => {\n if (drawerContent === 'notifications') {\n notifications?.onNotificationsOpen?.();\n }\n }}\n position='fixed'\n placement={end}\n size='min(26rem, calc(100vw - 5rem))'\n nullWhenClosed\n >\n {drawerContent === 'notifications' && notifications && (\n <Notifications {...notifications} onClose={() => setDrawerOpen(false)} />\n )}\n {drawerContent === 'navigationOperator' && (\n <MobileHeaderContent\n appInfo={appInfo}\n navLinks={\n resolvedMainMenu.length ? flattenMenuItems(resolvedMainMenu) : legacyNavLinks\n }\n operator={operator}\n onClose={() => setDrawerOpen(false)}\n />\n )}\n </Drawer>\n </Backdrop>\n </>\n );\n});\n\nexport default AppShell;\n"]}