@learningpool/ui 1.15.4 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/Images.js +7 -18
- package/components/atoms/Autocomplete/Autocomplete.js +3 -14
- package/components/atoms/Button/Button.js +2 -13
- package/components/atoms/Checkbox/Checkbox.js +3 -26
- package/components/atoms/IconButton/IconButton.js +2 -13
- package/components/atoms/Radio/Radio.js +3 -26
- package/components/atoms/Select/Select.js +3 -26
- package/components/atoms/Slider/Slider.js +3 -26
- package/components/atoms/Switch/Switch.js +3 -26
- package/components/atoms/TextField/TextField.js +2 -13
- package/components/atoms/ToggleButton/ToggleButton.js +3 -26
- package/components/datadisplay/Avatar/Avatar.js +13 -28
- package/components/datadisplay/Chip/Chip.js +3 -26
- package/components/datadisplay/List/List.js +2 -13
- package/components/feedback/Alert/Alert.js +3 -26
- package/components/landmarks/Header/Header.js +15 -41
- package/components/landmarks/Header/HeaderActionButtons.d.ts +1 -2
- package/components/landmarks/Header/HeaderActionButtons.js +22 -33
- package/components/landmarks/Header/HeaderStyles.js +54 -11
- package/components/navigation/Drawer/Drawer.js +5 -31
- package/components/navigation/MobileNavigation/MobileNavigation.js +70 -82
- package/components/navigation/MobileNavigation/MobileNavigationAvatar.js +75 -83
- package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +102 -52
- package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +71 -13
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +1 -1
- package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +41 -68
- package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +34 -18
- package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +133 -20
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +22 -45
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +8 -19
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +151 -52
- package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +171 -50
- package/components/navigation/MobileNavigation/MobileNavigationMotion.js +11 -11
- package/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +11 -15
- package/components/navigation/MobileNavigation/MobileNavigationSearch.d.ts +1 -2
- package/components/navigation/MobileNavigation/MobileNavigationSearch.js +25 -34
- package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +34 -18
- package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.js +47 -9
- package/components/navigation/MobileNavigation/MobileNavigationStyles.js +262 -66
- package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +21 -20
- package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +21 -20
- package/components/navigation/VerticalNavigation/VerticalNavigation.js +150 -185
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +50 -61
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +102 -52
- package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +86 -14
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +27 -51
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +15 -28
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +135 -39
- package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +167 -29
- package/components/navigation/VerticalNavigation/VerticalNavigationMotion.js +11 -11
- package/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +34 -18
- package/components/navigation/VerticalNavigation/VerticalNavigationStyles.js +236 -42
- package/components/navigation/helpers.d.ts +1 -2
- package/components/navigation/helpers.js +28 -32
- package/components/pages/ErrorPage/ErrorPage.js +6 -17
- package/components/pages/ErrorPage/ErrorPageStyles.js +13 -18
- package/components/pages/SideInSide/SideInSide.js +12 -23
- package/components/pages/SideInSide/SideInSideStyles.js +6 -6
- package/components/stream/AppHub/AppHub.js +13 -42
- package/components/stream/AppHub/AppHubAdvertStyles.js +24 -8
- package/components/stream/AppHub/AppHubBannerAdvert.d.ts +1 -2
- package/components/stream/AppHub/AppHubBannerAdvert.js +10 -20
- package/components/stream/AppHub/AppHubCustom.js +8 -19
- package/components/stream/AppHub/AppHubCustomStyles.d.ts +1 -1
- package/components/stream/AppHub/AppHubCustomStyles.js +78 -18
- package/components/stream/AppHub/AppHubProduct.js +26 -48
- package/components/stream/AppHub/AppHubProductStyles.js +104 -19
- package/components/stream/AppHub/AppHubStyles.js +31 -11
- package/components/stream/AppHub/constants.d.ts +1 -2
- package/components/stream/AppHub/constants.js +14 -14
- package/components/stream/AppSwitcher/AppSwitcher.js +225 -316
- package/components/stream/AppSwitcher/AppSwitcherItem.js +11 -22
- package/components/stream/AppSwitcher/AppSwitcherStyles.js +337 -42
- package/components/stream/AppSwitcher/AppSwitcherStylesStandalone.js +255 -21
- package/components/stream/AppSwitcher/PromotionalCampaignItem.js +7 -19
- package/components/stream/AppSwitcher/constants.d.ts +1 -0
- package/components/stream/AppSwitcher/constants.js +6 -5
- package/lang/en-us.d.ts +1 -0
- package/lang/en-us.js +2 -1
- package/package.json +7 -2
- package/utils/constants.d.ts +7 -0
- package/utils/constants.js +11 -4
- package/utils/dataAttributes.js +1 -1
- package/utils/helpers.js +33 -40
- package/utils/hooks.js +10 -11
- package/utils/theme.js +26 -19
|
@@ -1,36 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
|
-
if (ar || !(i in from)) {
|
|
26
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
27
|
-
ar[i] = from[i];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
-
};
|
|
32
|
-
import { createElement as _createElement } from "react";
|
|
33
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { createElement as _createElement } from "@emotion/react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
34
3
|
import React, { useEffect } from 'react';
|
|
35
4
|
import { useTheme } from '@mui/material/styles';
|
|
36
5
|
import { Avatar, List, Tooltip } from '../../../index';
|
|
@@ -48,30 +17,29 @@ import { ListItemText } from './VerticalNavigationItem/VerticalNavigationItemSty
|
|
|
48
17
|
import AvatarPanel from './VerticalNavigationAvatar';
|
|
49
18
|
import { motion } from '../../../utils/theme';
|
|
50
19
|
import { handleAvatarInitials, useFadeIn } from '../../../utils/helpers';
|
|
51
|
-
import { DEFAULT_REACT_APP_ID } from '../../../utils/constants';
|
|
20
|
+
import { DEFAULT_REACT_APP_ID, EVENT_KEYS } from '../../../utils/constants';
|
|
52
21
|
import { animated } from '@react-spring/web';
|
|
53
22
|
import { defaultMessages } from '../../../lang/en-us';
|
|
54
23
|
import { defaultAttributes } from '../../../utils/dataAttributes';
|
|
55
24
|
import { getDefaultSupportLinks, getNavigationBackground, getNavigationContrastText } from '../helpers';
|
|
56
25
|
import { Constants } from '../../stream/AppSwitcher/constants';
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var _d = React.useState(propIsPersistent !== null && propIsPersistent !== void 0 ? propIsPersistent : false), isPersistent = _d[0], setIsPersistent = _d[1];
|
|
26
|
+
const VerticalNavigation = (props) => {
|
|
27
|
+
const theme = useTheme();
|
|
28
|
+
const { items, secondaryItems, logo, logoText, logoOnClick, appRootID, hasStreamHome, hideStreamHomeButton, StreamHomeUrl, streamHomeApiKey, streamHomeBaseUrl, localization, streamHomeAccessToken, streamHomeApplications, avatarName, dataAttributes, showSupportLinks, hidePromotionalCampaign, avatarPanelShowHelpLinks, promotionalCampaigns, ...rest } = props;
|
|
29
|
+
const messages = { ...defaultMessages, ...localization };
|
|
30
|
+
const dataIds = { ...defaultAttributes, ...dataAttributes };
|
|
31
|
+
const propIsDrawerOpen = typeof props?.isDrawerOpen === 'boolean' ? props.isDrawerOpen : undefined;
|
|
32
|
+
const propIsPersistent = typeof props?.isPersistent === 'boolean' ? props.isPersistent : undefined;
|
|
33
|
+
const hasAvatar = props?.hasAvatar ?? true;
|
|
34
|
+
const [isDrawerOpen, setIsDrawerOpen] = React.useState(propIsDrawerOpen ?? false);
|
|
35
|
+
const [isAvatarOpen, setIsAvatarOpen] = React.useState(false);
|
|
36
|
+
const [isPersistent, setIsPersistent] = React.useState(propIsPersistent ?? false);
|
|
69
37
|
// Controls whether the application panel is open or not.
|
|
70
|
-
|
|
38
|
+
const [isAppSwitcherOpen, setIsAppSwitcherOpen] = React.useState(false);
|
|
71
39
|
/**
|
|
72
40
|
* Toggles display of the Stream suite application dialog.
|
|
73
41
|
*/
|
|
74
|
-
|
|
42
|
+
const handleToggleAppSwitcher = () => {
|
|
75
43
|
if (isAvatarOpen) {
|
|
76
44
|
setIsAvatarOpen(false);
|
|
77
45
|
}
|
|
@@ -80,17 +48,17 @@ var VerticalNavigation = function (props) {
|
|
|
80
48
|
/**
|
|
81
49
|
* Toggles display of the avatar dialog.
|
|
82
50
|
*/
|
|
83
|
-
|
|
51
|
+
const handleToggleAvatarPanel = () => {
|
|
84
52
|
if (isAppSwitcherOpen) {
|
|
85
53
|
setIsAppSwitcherOpen(false);
|
|
86
54
|
}
|
|
87
55
|
setIsAvatarOpen(!isAvatarOpen);
|
|
88
56
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
useEffect(
|
|
92
|
-
useEffect(
|
|
93
|
-
useEffect(
|
|
57
|
+
const logoHeight = 38;
|
|
58
|
+
const logoWidth = 38;
|
|
59
|
+
useEffect(() => setIsDrawerOpen(propIsDrawerOpen ?? false), [propIsDrawerOpen]);
|
|
60
|
+
useEffect(() => setIsDrawerOpen(propIsPersistent ?? false), [propIsPersistent]);
|
|
61
|
+
useEffect(() => {
|
|
94
62
|
if (!avatarName || !hasAvatar) {
|
|
95
63
|
setIsAvatarOpen(false);
|
|
96
64
|
}
|
|
@@ -101,33 +69,32 @@ var VerticalNavigation = function (props) {
|
|
|
101
69
|
// This fix just overrides the default aria-hidden attribute.
|
|
102
70
|
//
|
|
103
71
|
// https://github.com/mui/material-ui/issues/19450
|
|
104
|
-
useEffect(
|
|
72
|
+
useEffect(() => {
|
|
105
73
|
if (isDrawerOpen) {
|
|
106
|
-
|
|
107
|
-
root
|
|
74
|
+
const root = window.document.getElementById(appRootID ?? DEFAULT_REACT_APP_ID);
|
|
75
|
+
root?.removeAttribute('aria-hidden');
|
|
108
76
|
}
|
|
109
77
|
}, [isDrawerOpen]);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
setIsPersistent((_b = !propIsPersistent) !== null && _b !== void 0 ? _b : false);
|
|
78
|
+
const handleIsPersistent = () => {
|
|
79
|
+
if (props?.setIsPersistent) {
|
|
80
|
+
props.setIsPersistent(!propIsPersistent ?? false);
|
|
81
|
+
setIsPersistent(!propIsPersistent ?? false);
|
|
115
82
|
return;
|
|
116
83
|
}
|
|
117
|
-
setIsPersistent(propIsPersistent
|
|
84
|
+
setIsPersistent(propIsPersistent ?? false);
|
|
118
85
|
};
|
|
119
|
-
|
|
120
|
-
event
|
|
121
|
-
if (event.type ===
|
|
122
|
-
if (event.key ===
|
|
86
|
+
const toggleDrawer = (open) => (event) => {
|
|
87
|
+
event?.stopPropagation();
|
|
88
|
+
if (event.type === EVENT_KEYS.Keydown) {
|
|
89
|
+
if (event.key === EVENT_KEYS.Tab || event.key === EVENT_KEYS.Shift) {
|
|
123
90
|
return;
|
|
124
91
|
}
|
|
125
92
|
}
|
|
126
93
|
setIsAppSwitcherOpen(false);
|
|
127
|
-
setIsDrawerOpen(open
|
|
128
|
-
};
|
|
94
|
+
setIsDrawerOpen(open ?? !isDrawerOpen);
|
|
95
|
+
};
|
|
129
96
|
// Default support links, these can be toggled on/off via the showSupportLinks
|
|
130
|
-
|
|
97
|
+
const defaultSupportLinks = getDefaultSupportLinks(messages);
|
|
131
98
|
// Workaround to handle the react-spring calls without
|
|
132
99
|
// adding additional hook calls on prop or state changes
|
|
133
100
|
// --
|
|
@@ -135,123 +102,121 @@ var VerticalNavigation = function (props) {
|
|
|
135
102
|
// this way the number of hook calls never changes
|
|
136
103
|
// --
|
|
137
104
|
// First item starts at 70ms, see STAGGER_ITEMS_DELAY in helpers.js
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
105
|
+
const additionalItems = ['hasStreamHome', 'hasAvatar', 'avatarName'];
|
|
106
|
+
const totalItems = [...items ?? [], ...defaultSupportLinks ?? [], ...secondaryItems ?? [], ...additionalItems];
|
|
107
|
+
const animationRefs = React.useRef(totalItems && totalItems.map((item, index) => useFadeIn(index)));
|
|
108
|
+
const listContent = () => (_jsxs(Box, { sx: {
|
|
109
|
+
display: 'flex',
|
|
110
|
+
flex: '1 auto',
|
|
111
|
+
flexDirection: 'column',
|
|
112
|
+
justifyContent: 'flex-start',
|
|
113
|
+
'.wrapper': {
|
|
144
114
|
display: 'flex',
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
'
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
:
|
|
164
|
-
: (_jsx(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
115
|
+
position: 'relative'
|
|
116
|
+
},
|
|
117
|
+
'.wrapper > :not(:first-of-type)': {
|
|
118
|
+
position: 'absolute',
|
|
119
|
+
right: 0,
|
|
120
|
+
background: 'transparent',
|
|
121
|
+
fontSize: 0
|
|
122
|
+
}
|
|
123
|
+
}, className: 'grid-container', children: [_jsx("div", { className: 'wrapper', style: { backgroundColor: getNavigationBackground(theme) }, "data-id": dataIds.VerticalNavigationBrand, children: _jsxs(DrawerHeader, { onClick: logoOnClick ?? null, isDrawerOpen: isDrawerOpen || isPersistent, style: animationRefs.current[0], children: [_jsx(Tooltip, { disableHoverListener: isDrawerOpen || isPersistent, disableFocusListener: isDrawerOpen || isPersistent, disableTouchListener: isDrawerOpen || isPersistent, title: logoText ?? '', placement: theme.direction === 'rtl' ? 'left' : 'right', children: logo
|
|
124
|
+
? typeof logo === 'string'
|
|
125
|
+
? (_jsx("img", { src: logo, height: `${logoHeight}px`, width: `${logoWidth}px`, style: {
|
|
126
|
+
marginInlineEnd: '16px'
|
|
127
|
+
}, alt: logoText ?? messages['site-logo'] }))
|
|
128
|
+
: logo
|
|
129
|
+
: (_jsx(StreamSuiteLogo, { style: {
|
|
130
|
+
height: `${logoHeight}px`,
|
|
131
|
+
width: `${logoWidth}px`,
|
|
132
|
+
marginInlineEnd: '16px',
|
|
133
|
+
fill: getNavigationContrastText(theme)
|
|
134
|
+
} })) }), _jsx(ListItemText, { primary: logoText ?? '', isDrawerOpen: isDrawerOpen || isPersistent })] }) }), _jsxs("div", { className: 'wrapper', "data-id": dataIds.VerticalNavigationToggle, children: [_jsxs(NotchContainer, { sx: { height: '85px', position: 'relative !important' }, children: [_jsx(NotchBackground, {}), !isPersistent && _jsx(NotchBackgroundClip, {}), _jsx(NotchSeemMask, {})] }), !isPersistent && _jsx(DrawerToggle, { onClick: toggleDrawer(!isDrawerOpen), "aria-label": isDrawerOpen ? messages['close-navigation'] : messages['open-navigation'], "aria-expanded": isDrawerOpen ? 'true' : 'false', "aria-controls": "vertical-navigation", isDrawerOpen: isDrawerOpen,
|
|
135
|
+
// @ts-ignore
|
|
136
|
+
component: animated.button, style: animationRefs.current[0], children: _jsx(DrawerToggleHitboxContent, { children: isDrawerOpen
|
|
137
|
+
? (_jsx(ChevronLeftIcon, { style: {
|
|
138
|
+
fill: getNavigationContrastText(theme),
|
|
139
|
+
fontSize: '1.75rem',
|
|
140
|
+
height: '1.75rem',
|
|
141
|
+
width: '1.75rem'
|
|
142
|
+
} }))
|
|
143
|
+
: (_jsx(ChevronRightIcon, { style: {
|
|
144
|
+
fill: getNavigationContrastText(theme),
|
|
145
|
+
fontSize: '1.75rem',
|
|
146
|
+
height: '1.75rem',
|
|
147
|
+
width: '1.75rem'
|
|
148
|
+
} })) }) }), _jsx(Box, { style: {
|
|
149
|
+
borderRadius: '50%',
|
|
150
|
+
boxShadow: '5px 0 15px 0 rgb(0 0 0 / 10%)',
|
|
151
|
+
display: 'none',
|
|
152
|
+
height: '50px',
|
|
153
|
+
left: '12px',
|
|
154
|
+
position: 'fixed',
|
|
155
|
+
right: 'auto !important',
|
|
156
|
+
top: '50%',
|
|
157
|
+
transform: 'translate(50%, -50%)',
|
|
158
|
+
width: '50px'
|
|
159
|
+
} }), _jsxs(DrawerToggle, { onClick: handleIsPersistent, "aria-label": isDrawerOpen ? messages['close-navigation'] : messages['open-navigation'], "aria-expanded": isDrawerOpen ? 'true' : 'false', "aria-controls": "vertical-navigation", style: {
|
|
160
|
+
display: 'none',
|
|
161
|
+
position: 'fixed',
|
|
162
|
+
top: '50%',
|
|
163
|
+
transform: 'translate(50%, -50%)',
|
|
164
|
+
zIndex: 10
|
|
165
|
+
}, children: [_jsx(NotchExtendSVG, { style: {
|
|
166
|
+
display: 'block',
|
|
167
|
+
fill: getNavigationBackground(theme),
|
|
168
|
+
height: '165px',
|
|
169
|
+
left: '-12px',
|
|
170
|
+
padding: '0',
|
|
171
|
+
position: 'absolute',
|
|
172
|
+
top: '-61px',
|
|
173
|
+
transition: 'none',
|
|
174
|
+
width: '90px',
|
|
175
|
+
zIndex: '-1'
|
|
176
|
+
} }), _jsx(DrawerToggleHitboxContent, { style: {
|
|
177
|
+
background: 'transparent',
|
|
178
|
+
boxShadow: 'none',
|
|
179
|
+
fontSize: '1.3rem',
|
|
180
|
+
height: '1.3rem',
|
|
181
|
+
padding: theme.spacing(1),
|
|
182
|
+
width: '1.3rem'
|
|
183
|
+
}, children: isPersistent
|
|
184
|
+
? (_jsx(PushPinIcon, { style: {
|
|
185
|
+
fontSize: '1.3rem',
|
|
186
|
+
height: '1.3rem',
|
|
187
|
+
width: '1.3rem'
|
|
177
188
|
} }))
|
|
178
|
-
: (_jsx(
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
transition: 'none',
|
|
209
|
-
width: '90px',
|
|
210
|
-
zIndex: '-1'
|
|
211
|
-
} }), _jsx(DrawerToggleHitboxContent, __assign({ style: {
|
|
212
|
-
background: 'transparent',
|
|
213
|
-
boxShadow: 'none',
|
|
214
|
-
fontSize: '1.3rem',
|
|
215
|
-
height: '1.3rem',
|
|
216
|
-
padding: theme.spacing(1),
|
|
217
|
-
width: '1.3rem'
|
|
218
|
-
} }, { children: isPersistent
|
|
219
|
-
? (_jsx(PushPinIcon, { style: {
|
|
220
|
-
fontSize: '1.3rem',
|
|
221
|
-
height: '1.3rem',
|
|
222
|
-
width: '1.3rem'
|
|
223
|
-
} }))
|
|
224
|
-
: (_jsx(PushPinIcon, { style: {
|
|
225
|
-
fontSize: '1.3rem',
|
|
226
|
-
height: '1.3rem',
|
|
227
|
-
width: '1.3rem'
|
|
228
|
-
} })) }))] }))] })), _jsx(NotchSVG, { style: { height: '0', position: 'absolute', width: '0' } }), _jsx("div", __assign({ className: 'wrapper', "data-id": dataIds.VerticalNavigationPrimary, style: {
|
|
229
|
-
backgroundColor: getNavigationBackground(theme),
|
|
230
|
-
flex: '1 1px',
|
|
231
|
-
marginTop: '-1px',
|
|
232
|
-
overflow: 'auto',
|
|
233
|
-
position: 'relative',
|
|
234
|
-
zIndex: 10
|
|
235
|
-
} }, { children: _jsx(StyledNav, __assign({ tabIndex: -1, "aria-label": 'Primary' }, { children: _jsx(List, __assign({ "data-id": dataIds.VerticalNavigationPrimaryList, style: {
|
|
236
|
-
height: '100%',
|
|
237
|
-
width: DRAWER_WIDTH.Expanded,
|
|
238
|
-
marginTop: "-".concat(theme.spacing(0.5), " !important")
|
|
239
|
-
} }, { children: items && items.length > 0 && items.map(function (item, index) { return (_createElement(VerticalNavigationItem, __assign({}, item, { "data-id": dataIds.VerticalNavigationPrimaryListItem, key: "".concat(item.label, " - ").concat(index), index: index, isDrawerOpen: isDrawerOpen || isPersistent, style: animationRefs.current[index] }))); }) })) })) })), _jsx("div", __assign({ className: 'wrapper', "data-id": dataIds.VerticalNavigationSecondary, style: { backgroundColor: getNavigationBackground(theme) } }, { children: _jsxs(StyledNavSecondary, __assign({ "aria-label": 'Secondary' }, { children: [_jsx(StyledDivider, { isDrawerOpen: isDrawerOpen || isPersistent }), _jsxs(List, __assign({ "data-id": dataIds.VerticalNavigationSecondaryList, style: { width: DRAWER_WIDTH.Expanded } }, { children: [(showSupportLinks || avatarPanelShowHelpLinks) && defaultSupportLinks && defaultSupportLinks.length > 0 && defaultSupportLinks.map(function (item, index) {
|
|
240
|
-
var _a;
|
|
241
|
-
return (_createElement(VerticalNavigationItem, __assign({}, item, { "data-id": dataIds.VerticalNavigationSecondaryListItem, key: "".concat(item.label, " - ").concat(index), index: index, isDrawerOpen: isDrawerOpen || isPersistent, isSecondary: true, style: animationRefs.current[((_a = items === null || items === void 0 ? void 0 : items.length) !== null && _a !== void 0 ? _a : 0) + index + 1] })));
|
|
242
|
-
}), hasStreamHome
|
|
243
|
-
? (_jsx(VerticalNavigationItem, { id: dataIds.VerticalNavigationAppSwitcherToggle, "data-id": dataIds.VerticalNavigationAppSwitcherToggle, label: messages['app-switcher'], icon: _jsx(AppsIcon, {}), onClick: handleToggleAppSwitcher, content: (_jsx(AppSwitcher, { isAppSwitcherOpen: isAppSwitcherOpen, handleToggleAppSwitcher: handleToggleAppSwitcher, applications: streamHomeApplications, apiKey: streamHomeApiKey !== null && streamHomeApiKey !== void 0 ? streamHomeApiKey : '', baseUrl: streamHomeBaseUrl !== null && streamHomeBaseUrl !== void 0 ? streamHomeBaseUrl : '', token: streamHomeAccessToken !== null && streamHomeAccessToken !== void 0 ? streamHomeAccessToken : '', isDrawerOpen: isDrawerOpen, hideStreamHomeButton: hideStreamHomeButton || false, StreamHomeUrl: StreamHomeUrl !== null && StreamHomeUrl !== void 0 ? StreamHomeUrl : Constants.DefaultStreamHomeUrl, hidePromotionalCampaign: hidePromotionalCampaign !== null && hidePromotionalCampaign !== void 0 ? hidePromotionalCampaign : false, promotionalCampaigns: promotionalCampaigns })), isDrawerOpen: isDrawerOpen || isPersistent, isSecondary: true, hasCustomContent: true, style: animationRefs.current[((_a = items === null || items === void 0 ? void 0 : items.length) !== null && _a !== void 0 ? _a : 0) + ((_b = defaultSupportLinks === null || defaultSupportLinks === void 0 ? void 0 : defaultSupportLinks.length) !== null && _b !== void 0 ? _b : 0) + 1], isContentOpen: isAppSwitcherOpen }))
|
|
244
|
-
: null, secondaryItems && secondaryItems.length > 0 && secondaryItems.map(function (item, index) {
|
|
245
|
-
var _a, _b;
|
|
246
|
-
return (_createElement(VerticalNavigationItem, __assign({}, item, { "data-id": dataIds.VerticalNavigationSecondaryListItem, key: "".concat(item.label, " - ").concat(index), index: index, isDrawerOpen: isDrawerOpen || isPersistent, isSecondary: true, style: animationRefs.current[((_a = items === null || items === void 0 ? void 0 : items.length) !== null && _a !== void 0 ? _a : 0) + ((_b = defaultSupportLinks === null || defaultSupportLinks === void 0 ? void 0 : defaultSupportLinks.length) !== null && _b !== void 0 ? _b : 0) + index + 1] })));
|
|
247
|
-
}), hasAvatar && avatarName && (_jsx(VerticalNavigationItem, { label: avatarName, id: dataIds.VerticalNavigationAvatarToggle, "data-id": dataIds.VerticalNavigationAvatarToggle, "aria-controls": 'avatar-panel', icon: _jsx(Avatar, __assign({ style: {
|
|
248
|
-
fontSize: '0.75rem',
|
|
249
|
-
height: 32,
|
|
250
|
-
width: 32
|
|
251
|
-
} }, { children: handleAvatarInitials(avatarName) })), style: __assign({ maxHeight: isDrawerOpen ? '200px' : '48px', overflow: 'hidden', padding: 0, minHeight: 52, transition: "max-height 225ms ".concat(motion.easeInOut, " 0ms !important") }, animationRefs.current[((_c = items === null || items === void 0 ? void 0 : items.length) !== null && _c !== void 0 ? _c : 0) + ((_d = defaultSupportLinks === null || defaultSupportLinks === void 0 ? void 0 : defaultSupportLinks.length) !== null && _d !== void 0 ? _d : 0) + ((_e = secondaryItems === null || secondaryItems === void 0 ? void 0 : secondaryItems.length) !== null && _e !== void 0 ? _e : 0) + 2]), onClick: handleToggleAvatarPanel, hasFlyout: true, fullHeightFlyout: true, content: _jsx(AvatarPanel, __assign({ avatarName: avatarName, isAvatarOpen: isAvatarOpen, localization: localization, handleToggleAvatarPanel: handleToggleAvatarPanel }, rest)), isDrawerOpen: isDrawerOpen, isContentOpen: isAvatarOpen }))] }))] })) }))] })));
|
|
252
|
-
};
|
|
253
|
-
return (_jsxs(StyledAside, __assign({ "aria-label": messages['site-navigation'], "data-id": dataIds.VerticalNavigationContainer }, { children: [_jsx(DrawerShadow, { className: 'drawerShadow', "aria-hidden": 'true', isDrawerOpen: isDrawerOpen || isPersistent, style: {
|
|
189
|
+
: (_jsx(PushPinIcon, { style: {
|
|
190
|
+
fontSize: '1.3rem',
|
|
191
|
+
height: '1.3rem',
|
|
192
|
+
width: '1.3rem'
|
|
193
|
+
} })) })] })] }), _jsx(NotchSVG, { style: { height: '0', position: 'absolute', width: '0' } }), _jsx("div", { className: 'wrapper', "data-id": dataIds.VerticalNavigationPrimary, style: {
|
|
194
|
+
backgroundColor: getNavigationBackground(theme),
|
|
195
|
+
flex: '1 1px',
|
|
196
|
+
marginTop: '-1px',
|
|
197
|
+
overflow: 'auto',
|
|
198
|
+
position: 'relative',
|
|
199
|
+
zIndex: 10
|
|
200
|
+
}, children: _jsx(StyledNav, { tabIndex: -1, "aria-label": 'Primary', children: _jsx(List, { "data-id": dataIds.VerticalNavigationPrimaryList, style: {
|
|
201
|
+
height: '100%',
|
|
202
|
+
width: DRAWER_WIDTH.Expanded,
|
|
203
|
+
marginTop: `-${theme.spacing(0.5)} !important`
|
|
204
|
+
}, children: items && items.length > 0 && items.map((item, index) => (_createElement(VerticalNavigationItem, { ...item, "data-id": dataIds.VerticalNavigationPrimaryListItem, key: `${item.label} - ${index}`, index: index, isDrawerOpen: isDrawerOpen || isPersistent, style: animationRefs.current[index] }))) }) }) }), _jsx("div", { className: 'wrapper', "data-id": dataIds.VerticalNavigationSecondary, style: { backgroundColor: getNavigationBackground(theme) }, children: _jsxs(StyledNavSecondary, { "aria-label": 'Secondary', children: [_jsx(StyledDivider, { isDrawerOpen: isDrawerOpen || isPersistent }), _jsxs(List, { "data-id": dataIds.VerticalNavigationSecondaryList, style: { width: DRAWER_WIDTH.Expanded }, children: [(showSupportLinks || avatarPanelShowHelpLinks) && defaultSupportLinks && defaultSupportLinks.length > 0 && defaultSupportLinks.map((item, index) => (_createElement(VerticalNavigationItem, { ...item, "data-id": dataIds.VerticalNavigationSecondaryListItem, key: `${item.label} - ${index}`, index: index, isDrawerOpen: isDrawerOpen || isPersistent, isSecondary: true, style: animationRefs.current[(items?.length ?? 0) + index + 1] }))), hasStreamHome
|
|
205
|
+
? (_jsx(VerticalNavigationItem, { id: dataIds.VerticalNavigationAppSwitcherToggle, "data-id": dataIds.VerticalNavigationAppSwitcherToggle, label: messages['app-switcher'], icon: _jsx(AppsIcon, {}), onClick: handleToggleAppSwitcher, content: (_jsx(AppSwitcher, { isAppSwitcherOpen: isAppSwitcherOpen, handleToggleAppSwitcher: handleToggleAppSwitcher, applications: streamHomeApplications, apiKey: streamHomeApiKey ?? '', baseUrl: streamHomeBaseUrl ?? '', token: streamHomeAccessToken ?? '', isDrawerOpen: isDrawerOpen, hideStreamHomeButton: hideStreamHomeButton || false, StreamHomeUrl: StreamHomeUrl ?? Constants.DefaultStreamHomeUrl, hidePromotionalCampaign: hidePromotionalCampaign ?? false, promotionalCampaigns: promotionalCampaigns })), isDrawerOpen: isDrawerOpen || isPersistent, isSecondary: true, hasCustomContent: true, style: animationRefs.current[(items?.length ?? 0) + (defaultSupportLinks?.length ?? 0) + 1], isContentOpen: isAppSwitcherOpen }))
|
|
206
|
+
: null, secondaryItems && secondaryItems.length > 0 && secondaryItems.map((item, index) => (_createElement(VerticalNavigationItem, { ...item, "data-id": dataIds.VerticalNavigationSecondaryListItem, key: `${item.label} - ${index}`, index: index, isDrawerOpen: isDrawerOpen || isPersistent, isSecondary: true, style: animationRefs.current[(items?.length ?? 0) + (defaultSupportLinks?.length ?? 0) + index + 1] }))), hasAvatar && avatarName && (_jsx(VerticalNavigationItem, { label: avatarName, id: dataIds.VerticalNavigationAvatarToggle, "data-id": dataIds.VerticalNavigationAvatarToggle, "aria-controls": 'avatar-panel', icon: _jsx(Avatar, { style: {
|
|
207
|
+
fontSize: '0.75rem',
|
|
208
|
+
height: 32,
|
|
209
|
+
width: 32
|
|
210
|
+
}, children: handleAvatarInitials(avatarName) }), style: {
|
|
211
|
+
maxHeight: isDrawerOpen ? '200px' : '48px',
|
|
212
|
+
overflow: 'hidden',
|
|
213
|
+
padding: 0,
|
|
214
|
+
minHeight: 52,
|
|
215
|
+
transition: `max-height 225ms ${motion.easeInOut} 0ms !important`,
|
|
216
|
+
...animationRefs.current[(items?.length ?? 0) + (defaultSupportLinks?.length ?? 0) + (secondaryItems?.length ?? 0) + 2]
|
|
217
|
+
}, onClick: handleToggleAvatarPanel, hasFlyout: true, fullHeightFlyout: true, content: _jsx(AvatarPanel, { avatarName: avatarName, isAvatarOpen: isAvatarOpen, localization: localization, handleToggleAvatarPanel: handleToggleAvatarPanel, ...rest }), isDrawerOpen: isDrawerOpen, isContentOpen: isAvatarOpen }))] })] }) })] }));
|
|
218
|
+
return (_jsxs(StyledAside, { "aria-label": messages['site-navigation'], "data-id": dataIds.VerticalNavigationContainer, children: [_jsx(DrawerShadow, { className: 'drawerShadow', "aria-hidden": 'true', isDrawerOpen: isDrawerOpen || isPersistent, style: {
|
|
254
219
|
display: isPersistent ? 'none' : 'block'
|
|
255
|
-
} }), _jsx(Modal,
|
|
220
|
+
} }), _jsx(Modal, { "aria-hidden": false, keepMounted: true, disablePortal: true, open: isDrawerOpen, onClose: toggleDrawer(false), children: _jsx(StyledDrawer, { id: 'vertical-navigation', anchor: 'left', open: isDrawerOpen || isPersistent, onClose: toggleDrawer(false), variant: 'permanent', children: listContent() }) })] }));
|
|
256
221
|
};
|
|
257
222
|
export default VerticalNavigation;
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
22
2
|
import React, { useEffect } from 'react';
|
|
23
3
|
import { Box, Link, List, ListItem, ListItemIcon, ListItemText } from '../../../index';
|
|
24
4
|
import { StyledBox, StyledBoxProfile, StyledButton, StyledAvatarName, StyledAvatar, StyledBoxProfileEdit, StyledListItemButton, StyledButtonGroup } from './VerticalNavigationAvatarStyles';
|
|
@@ -32,33 +12,32 @@ import { animated } from '@react-spring/web';
|
|
|
32
12
|
import { FlyoutMenuItemText } from './VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles';
|
|
33
13
|
import { defaultMessages } from '../../../lang/en-us';
|
|
34
14
|
import { defaultAttributes } from '../../../utils/dataAttributes';
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var avatarPanelId = document.getElementById(defaultAttributes.VerticalNavigationAvatarToggle);
|
|
15
|
+
const AvatarPanel = (props) => {
|
|
16
|
+
const theme = useTheme();
|
|
17
|
+
const { avatarName, avatarPanelOnClickLogout, avatarPanelLogoutString, avatarPanelOnClickViewProfile, avatarPanelViewProfileString, avatarPanelOnClickEditProfile, avatarPanelEditProfileString, avatarPanelMenuItems, avatarPanelSettingItems, avatarPanelOnClickMainAction, avatarPanelMainActionString, avatarPanelFootnote, isAvatarOpen, localization, dataAttributes, handleToggleAvatarPanel } = props;
|
|
18
|
+
const messages = { ...defaultMessages, ...localization };
|
|
19
|
+
const dataIds = { ...defaultAttributes, ...dataAttributes };
|
|
20
|
+
const handleAvatarClick = (event) => {
|
|
21
|
+
const avatarPanelId = document.getElementById(defaultAttributes.VerticalNavigationAvatarToggle);
|
|
43
22
|
// Not allow the onClick to toggle event when clicking away from the ref
|
|
44
|
-
if (avatarPanelId
|
|
23
|
+
if (avatarPanelId?.contains(event.target)) {
|
|
45
24
|
return;
|
|
46
25
|
}
|
|
47
26
|
// Toggle the panel when you're clicking away from the ref
|
|
48
27
|
handleToggleAvatarPanel();
|
|
49
28
|
};
|
|
50
|
-
useEffect(
|
|
29
|
+
useEffect(() => {
|
|
51
30
|
setAvatarInitials(handleAvatarInitials(avatarName));
|
|
52
31
|
}, [avatarName]);
|
|
53
|
-
useEffect(
|
|
32
|
+
useEffect(() => {
|
|
54
33
|
if (isAvatarOpen) {
|
|
55
34
|
document.addEventListener('mousedown', handleAvatarClick);
|
|
56
35
|
}
|
|
57
|
-
return
|
|
36
|
+
return () => {
|
|
58
37
|
document.removeEventListener('mousedown', handleAvatarClick);
|
|
59
38
|
};
|
|
60
39
|
}, [isAvatarOpen]);
|
|
61
|
-
|
|
40
|
+
const [avatarInitials, setAvatarInitials] = React.useState(handleAvatarInitials(avatarName) ?? 'AN');
|
|
62
41
|
// Workaround to handle the react-spring calls without
|
|
63
42
|
// adding additional hook calls on prop or state changes
|
|
64
43
|
// --
|
|
@@ -66,53 +45,63 @@ var AvatarPanel = function (props) {
|
|
|
66
45
|
// this way the number of hook calls never changes
|
|
67
46
|
// --
|
|
68
47
|
// First item starts at 70ms, see STAGGER_ITEMS_DELAY in helpers.js
|
|
69
|
-
|
|
48
|
+
const additionalItems = [
|
|
70
49
|
'avatarPanelOnClickLogout',
|
|
71
50
|
'avatarName',
|
|
72
51
|
'avatarPanelOnClickViewProfile',
|
|
73
52
|
'avatarPanelOnClickMainAction',
|
|
74
53
|
'avatarPanelFootnote'
|
|
75
54
|
];
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
55
|
+
const totalItems = [
|
|
56
|
+
...avatarPanelMenuItems ?? [],
|
|
57
|
+
...avatarPanelSettingItems ?? [],
|
|
58
|
+
...additionalItems
|
|
59
|
+
];
|
|
60
|
+
const animationRefs = React.useRef(totalItems && totalItems.map((item, index) => useFadeIn(index, !isAvatarOpen)));
|
|
61
|
+
return (_jsxs(StyledBox, { onMouseDown: (event) => event.stopPropagation(), children: [avatarPanelOnClickLogout && (_jsx(StyledButton
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
, {
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
component: animated.button, style: {
|
|
66
|
+
left: theme.direction === 'rtl' ? theme.spacing(1) : 'auto',
|
|
67
|
+
position: 'absolute',
|
|
68
|
+
right: theme.direction === 'rtl' ? 'auto' : theme.spacing(1),
|
|
69
|
+
top: theme.spacing(1),
|
|
70
|
+
...animationRefs.current[0]
|
|
71
|
+
}, onClick: avatarPanelOnClickLogout, startIcon: _jsx(LogoutIcon, {}), variant: 'text', color: 'inherit', children: avatarPanelLogoutString ?? messages.logout })), _jsxs(Box, { "data-id": dataIds.VerticalNavigationAvatarProfile, style: {
|
|
83
72
|
alignItems: 'center',
|
|
84
73
|
display: 'flex',
|
|
85
74
|
flexDirection: 'column'
|
|
86
|
-
}
|
|
75
|
+
}, children: [_jsxs(StyledBoxProfile, { style: animationRefs.current[1], children: [_jsx(StyledAvatar, { style: { marginInlineEnd: '0.5rem' }, children: avatarInitials }), _jsxs(StyledAvatarName, { children: [_jsx("span", { style: { fontWeight: 300 }, children: messages.greeting }), " ", _jsx("strong", { children: avatarName.split(' ')[0] })] })] }), avatarPanelOnClickViewProfile && (_jsx(StyledBoxProfileEdit, { style: {
|
|
76
|
+
marginBottom: theme.spacing(2),
|
|
77
|
+
...animationRefs.current[2]
|
|
78
|
+
}, children: _jsxs(StyledButtonGroup, { variant: 'outlined', "aria-label": "split button", children: [_jsx(StyledButton, { variant: 'outlined', color: 'inherit', size: 'medium', onClick: avatarPanelOnClickViewProfile, startIcon: _jsx(PersonIcon, {}), children: avatarPanelViewProfileString ?? messages['view-profile'] }), avatarPanelOnClickEditProfile && (_jsx(StyledButton, { variant: 'outlined', color: 'inherit', size: 'medium', "aria-label": avatarPanelEditProfileString ?? messages['edit-profile'], onClick: avatarPanelOnClickEditProfile, children: _jsx(EditIcon, {}) }))] }) }))] }), _jsxs(Box, { style: {
|
|
87
79
|
alignItems: 'center',
|
|
88
80
|
display: 'flex',
|
|
89
81
|
flexDirection: 'column'
|
|
90
|
-
}
|
|
82
|
+
}, children: [avatarPanelMenuItems && avatarPanelMenuItems.length > 0 && (_jsx(List, { "data-id": dataIds.VerticalNavigationFlyoutList, style: {
|
|
91
83
|
marginBottom: theme.spacing(2),
|
|
92
84
|
maxWidth: '14rem'
|
|
93
|
-
}
|
|
85
|
+
}, children: avatarPanelMenuItems.map((avatarMenuItem, index) => (_jsx(ListItem, { "data-id": dataIds.VerticalNavigationFlyoutListItem, component: animated.div, style: animationRefs.current[index + 2], disablePadding: true, children: _jsxs(StyledListItemButton
|
|
94
86
|
// TODO: figure out if these are links or buttons
|
|
95
87
|
// @ts-expect-error
|
|
96
|
-
,
|
|
88
|
+
, {
|
|
97
89
|
// TODO: figure out if these are links or buttons
|
|
98
90
|
// @ts-expect-error
|
|
99
|
-
component: Link, role: 'link', onClick: avatarMenuItem.onClick
|
|
100
|
-
// @ts-
|
|
101
|
-
,
|
|
102
|
-
// @ts-
|
|
103
|
-
component: animated.button, style: animationRefs.current[(
|
|
91
|
+
component: Link, role: 'link', onClick: avatarMenuItem.onClick, children: [_jsx(ListItemIcon, { "aria-hidden": true, style: { minWidth: theme.spacing(5) }, children: avatarMenuItem.icon }), _jsx(FlyoutMenuItemText, { primary: avatarMenuItem.label })] }) }, `${avatarMenuItem.label} - ${index}`))) })), avatarPanelOnClickMainAction && _jsx(StyledButton
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
, {
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
component: animated.button, style: animationRefs.current[(avatarPanelMenuItems?.length ?? 0) + 3], variant: 'outlined', color: 'inherit', size: 'medium', onClick: avatarPanelOnClickMainAction, startIcon: _jsx(SettingsIcon, {}), children: avatarPanelMainActionString }), _jsx(List, { "data-id": dataIds.VerticalNavigationFlyoutList, style: { marginBottom: theme.spacing(2), marginTop: theme.spacing(2) }, children: avatarPanelSettingItems &&
|
|
104
96
|
avatarPanelSettingItems.length > 0 &&
|
|
105
|
-
avatarPanelSettingItems.map(
|
|
106
|
-
|
|
107
|
-
|
|
97
|
+
avatarPanelSettingItems.map((avatarMenuItem, index) => (_jsx(ListItem, { "data-id": dataIds.VerticalNavigationFlyoutListItem, component: animated.div, style: animationRefs.current[(avatarPanelMenuItems?.length ?? 0) + index + 3], disablePadding: true, children: _jsxs(StyledListItemButton
|
|
98
|
+
// TODO: figure out if these are links or buttons
|
|
99
|
+
// @ts-expect-error
|
|
100
|
+
, {
|
|
108
101
|
// TODO: figure out if these are links or buttons
|
|
109
102
|
// @ts-expect-error
|
|
110
|
-
,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
component: Link, role: 'link', onClick: avatarMenuItem.onClick }, { children: [_jsx(ListItemIcon, __assign({ "aria-hidden": true, style: {
|
|
114
|
-
minWidth: theme.spacing(5)
|
|
115
|
-
} }, { children: avatarMenuItem.icon })), _jsx(ListItemText, { primary: avatarMenuItem.label })] })) }), "".concat(avatarMenuItem.label, " - ").concat(index)));
|
|
116
|
-
}) }))] })), _jsx(Box, __assign({ "data-id": dataIds.VerticalNavigationFlyoutFootnote, className: 'avatar-panel-footnote', style: animationRefs.current[((_c = avatarPanelMenuItems === null || avatarPanelMenuItems === void 0 ? void 0 : avatarPanelMenuItems.length) !== null && _c !== void 0 ? _c : 0) + ((_d = avatarPanelSettingItems === null || avatarPanelSettingItems === void 0 ? void 0 : avatarPanelSettingItems.length) !== null && _d !== void 0 ? _d : 0) + 4] }, { children: avatarPanelFootnote && avatarPanelFootnote }))] })));
|
|
103
|
+
component: Link, role: 'link', onClick: avatarMenuItem.onClick, children: [_jsx(ListItemIcon, { "aria-hidden": true, style: {
|
|
104
|
+
minWidth: theme.spacing(5)
|
|
105
|
+
}, children: avatarMenuItem.icon }), _jsx(ListItemText, { primary: avatarMenuItem.label })] }) }, `${avatarMenuItem.label} - ${index}`))) })] }), _jsx(Box, { "data-id": dataIds.VerticalNavigationFlyoutFootnote, className: 'avatar-panel-footnote', style: animationRefs.current[(avatarPanelMenuItems?.length ?? 0) + (avatarPanelSettingItems?.length ?? 0) + 4], children: avatarPanelFootnote && avatarPanelFootnote })] }));
|
|
117
106
|
};
|
|
118
107
|
export default AvatarPanel;
|