@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,22 +1,256 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
1
|
import styled from 'styled-components';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
export const AppSwitcherPanel = styled.div `
|
|
3
|
+
background-color: #fff;
|
|
4
|
+
border-radius: 4px;
|
|
5
|
+
box-shadow: rgb(0 0 0 / 20%) 0px 5px 5px -3px, rgb(0 0 0 / 14%) 0px 8px 10px 1px, rgb(0 0 0 / 12%) 0px 3px 14px 2px;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
height: 450px;
|
|
8
|
+
padding: 1rem 1.5rem;
|
|
9
|
+
position: absolute;
|
|
10
|
+
width: 360px;
|
|
11
|
+
`;
|
|
12
|
+
export const List = styled.ul `
|
|
13
|
+
`;
|
|
14
|
+
export const MenuContent = styled.div `
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
flex-direction: row;
|
|
17
|
+
flex-wrap: wrap;
|
|
18
|
+
justify-content: flex-start;
|
|
19
|
+
margin-top: 1rem;
|
|
20
|
+
`;
|
|
21
|
+
export const SearchContent = styled.div `
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
justify-content: flex-start;
|
|
26
|
+
padding: 1rem 1rem 2rem;
|
|
27
|
+
`;
|
|
28
|
+
export const AppListHeader = styled.p `
|
|
29
|
+
align-items: center;
|
|
30
|
+
color: #757575;
|
|
31
|
+
display: flex;
|
|
32
|
+
font-weight: normal;
|
|
33
|
+
justify-content: flex-start;
|
|
34
|
+
padding: 0.5rem 1.25rem 0;
|
|
35
|
+
text-transform: uppercase;
|
|
36
|
+
|
|
37
|
+
& svg {
|
|
38
|
+
height: 24px;
|
|
39
|
+
margin-right: 0.5rem;
|
|
40
|
+
width: 24px;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
export const AppListItem = styled.div `
|
|
44
|
+
align-items: center;
|
|
45
|
+
align-self: stretch;
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
flex: 0 0 ${100 / 3}%;
|
|
49
|
+
overflow: visible;
|
|
50
|
+
padding: 0.25rem;
|
|
51
|
+
position: relative;
|
|
52
|
+
|
|
53
|
+
&:hover {
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
export const AppLink = styled.a `
|
|
58
|
+
align-items: center;
|
|
59
|
+
border-radius: 4px;
|
|
60
|
+
box-shadow: none;
|
|
61
|
+
box-sizing: border-box;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
font-size: 0.85rem;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
padding: 1rem 0 0.5rem;
|
|
68
|
+
position: relative;
|
|
69
|
+
text-align: center;
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
transition: all 200ms ease;
|
|
72
|
+
width: 100%;
|
|
73
|
+
|
|
74
|
+
& .MuiTouchRipple-rippleVisible {
|
|
75
|
+
color: #004071;
|
|
76
|
+
opacity: 0.25;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:hover,
|
|
80
|
+
&:focus {
|
|
81
|
+
background-color: #ecf4fb;
|
|
82
|
+
text-decoration: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:active {
|
|
86
|
+
background-color: #f1f1f1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
& svg {
|
|
90
|
+
height: 60px;
|
|
91
|
+
width: 60px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:hover + span,
|
|
95
|
+
&:focus + span {
|
|
96
|
+
opacity: 1;
|
|
97
|
+
}
|
|
98
|
+
`;
|
|
99
|
+
export const BackButton = styled.button `
|
|
100
|
+
align-items: center;
|
|
101
|
+
background: transparent;
|
|
102
|
+
border: 0;
|
|
103
|
+
color: #aaa;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
display: flex;
|
|
106
|
+
padding: 0.25rem 0;
|
|
107
|
+
text-align: left;
|
|
108
|
+
width: 100%;
|
|
109
|
+
|
|
110
|
+
&:focus,
|
|
111
|
+
&:hover {
|
|
112
|
+
background-color: #eee;
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
export const SearchBox = styled.input `
|
|
116
|
+
background: #f4f4f4;
|
|
117
|
+
border: thin solid #888;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
color: #777;
|
|
120
|
+
padding: 0.5rem;
|
|
121
|
+
width: 100%;
|
|
122
|
+
|
|
123
|
+
&:hover .MuiOutlinedInput-notchedOutline {
|
|
124
|
+
border-color: #888;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
& .MuiOutlinedInput-root {
|
|
128
|
+
border-radius: 0;
|
|
129
|
+
color: #777;
|
|
130
|
+
padding: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
& .MuiOutlinedInput-input {
|
|
134
|
+
padding: 0.5rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
& ::placeholder {
|
|
138
|
+
opacity: 0.75;
|
|
139
|
+
}
|
|
140
|
+
`;
|
|
141
|
+
export const AppName = styled.p `
|
|
142
|
+
color: #00497D;
|
|
143
|
+
font-weight: normal;
|
|
144
|
+
margin: 0.5rem 0 0;
|
|
145
|
+
white-space: nowrap;
|
|
146
|
+
`;
|
|
147
|
+
export const AppOrganisationCount = styled.span `
|
|
148
|
+
background: #00497D;
|
|
149
|
+
border-color: #616161;
|
|
150
|
+
border-radius: 4px;
|
|
151
|
+
border: none;
|
|
152
|
+
color: white;
|
|
153
|
+
font-size: 1rem;
|
|
154
|
+
font-weight: bold;
|
|
155
|
+
height: 50px;
|
|
156
|
+
left: 50%;
|
|
157
|
+
line-height: 50px;
|
|
158
|
+
margin-top: 0;
|
|
159
|
+
opacity: 0;
|
|
160
|
+
pointer-events: none;
|
|
161
|
+
position: absolute;
|
|
162
|
+
top: 43%;
|
|
163
|
+
transform: translate(-50%, -50%);
|
|
164
|
+
width: 50px;
|
|
165
|
+
z-index: 1;
|
|
166
|
+
`;
|
|
167
|
+
export const SelectedOrganisation = styled.div `
|
|
168
|
+
align-items: center;
|
|
169
|
+
color: #757575;
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-direction: row;
|
|
172
|
+
justify-content: flex-start;
|
|
173
|
+
padding: 1.5rem 0;
|
|
174
|
+
text-transform: uppercase;
|
|
175
|
+
width: 100%;
|
|
176
|
+
|
|
177
|
+
& svg,
|
|
178
|
+
& svg image {
|
|
179
|
+
height: 24px;
|
|
180
|
+
width: 24px;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
& h6 {
|
|
184
|
+
font-size: 1.2rem;
|
|
185
|
+
font-weight: 600;
|
|
186
|
+
margin: 0 0 0 1rem;
|
|
187
|
+
}
|
|
188
|
+
`;
|
|
189
|
+
export const StyledSVG = styled.svg `
|
|
190
|
+
box-sizing: content-box;
|
|
191
|
+
display: inline-block;
|
|
192
|
+
fill: currentcolor;
|
|
193
|
+
flex-shrink: 0;
|
|
194
|
+
font-size: 1.5rem;
|
|
195
|
+
height: 1em;
|
|
196
|
+
margin: 4px;
|
|
197
|
+
padding: 0;
|
|
198
|
+
user-select: none;
|
|
199
|
+
width: 1em;
|
|
200
|
+
`;
|
|
201
|
+
export const StyledLogoSVG = styled.svg `
|
|
202
|
+
background-color: #E6EAF0;
|
|
203
|
+
border: thin solid #E6EAF0;
|
|
204
|
+
position: relative;
|
|
205
|
+
z-index: 1;
|
|
206
|
+
`;
|
|
207
|
+
export const OrganisationList = styled.div `
|
|
208
|
+
height: 300px;
|
|
209
|
+
overflow: auto;
|
|
210
|
+
padding-top: 0.5rem;
|
|
211
|
+
width: 100%;
|
|
212
|
+
`;
|
|
213
|
+
export const OrganisationLink = styled.a `
|
|
214
|
+
align-items: center;
|
|
215
|
+
border-radius: 4px;
|
|
216
|
+
box-shadow: none;
|
|
217
|
+
color: #777;
|
|
218
|
+
display: flex;
|
|
219
|
+
font-size: 1rem;
|
|
220
|
+
justify-content: space-between;
|
|
221
|
+
margin: 0 0.125rem;
|
|
222
|
+
padding: 0.5rem;
|
|
223
|
+
text-decoration: none;
|
|
224
|
+
transition: all 200ms ease;
|
|
225
|
+
|
|
226
|
+
& .MuiTouchRipple-rippleVisible {
|
|
227
|
+
color: #004071;
|
|
228
|
+
opacity: 0.25;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&:focus,
|
|
232
|
+
&:hover {
|
|
233
|
+
background-color: #f5f5f5;
|
|
234
|
+
|
|
235
|
+
& svg {
|
|
236
|
+
visibility: visible;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
&:active {
|
|
241
|
+
background-color: #f1f1f1;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
& .MuiLink-root {
|
|
245
|
+
align-items: center;
|
|
246
|
+
color: #777;
|
|
247
|
+
display: flex;
|
|
248
|
+
justify-content: space-between;
|
|
249
|
+
text-decoration: none;
|
|
250
|
+
width: 100%;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
& svg {
|
|
254
|
+
visibility: hidden;
|
|
255
|
+
}
|
|
256
|
+
`;
|
|
@@ -1,22 +1,10 @@
|
|
|
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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
13
2
|
import { CardMedia } from '@mui/material';
|
|
14
3
|
import { useState } from 'react';
|
|
15
4
|
import { PromotionalCampaignCardStyled, PromotionalCampaignCardActionArea } from './AppSwitcherStyles';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var handleImageError = function () {
|
|
5
|
+
const PromotionalCampaignItem = ({ imageUrl, altText, linkUrl, onImageError }) => {
|
|
6
|
+
const [imageLoaded, setImageLoaded] = useState(true);
|
|
7
|
+
const handleImageError = () => {
|
|
20
8
|
setImageLoaded(false);
|
|
21
9
|
if (onImageError) {
|
|
22
10
|
onImageError();
|
|
@@ -24,11 +12,11 @@ var PromotionalCampaignItem = function (_a) {
|
|
|
24
12
|
};
|
|
25
13
|
if (!imageLoaded)
|
|
26
14
|
return null;
|
|
27
|
-
return (_jsx(PromotionalCampaignCardStyled, { children: _jsx(PromotionalCampaignCardActionArea,
|
|
15
|
+
return (_jsx(PromotionalCampaignCardStyled, { children: _jsx(PromotionalCampaignCardActionArea, { onClick: () => window.open(linkUrl, '_blank'), children: _jsx(CardMedia, { component: "div", sx: {
|
|
28
16
|
width: '100%',
|
|
29
17
|
height: '100%',
|
|
30
18
|
position: 'relative'
|
|
31
|
-
}
|
|
19
|
+
}, children: _jsx("img", { src: imageUrl, alt: altText, onError: handleImageError, style: {
|
|
32
20
|
width: '100%',
|
|
33
21
|
height: '100%',
|
|
34
22
|
objectFit: 'cover',
|
|
@@ -36,6 +24,6 @@ var PromotionalCampaignItem = function (_a) {
|
|
|
36
24
|
position: 'absolute',
|
|
37
25
|
top: 0,
|
|
38
26
|
left: 0
|
|
39
|
-
} }) })
|
|
27
|
+
} }) }) }) }));
|
|
40
28
|
};
|
|
41
29
|
export default PromotionalCampaignItem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const Constants = Object.freeze({
|
|
2
2
|
LocalStorageKey: {
|
|
3
3
|
Token: 'lp-home-access-token',
|
|
4
4
|
Applications: 'lp-home-applications',
|
|
@@ -31,7 +31,8 @@ export var Constants = Object.freeze({
|
|
|
31
31
|
open: 'Open',
|
|
32
32
|
'select-org': 'Organisation',
|
|
33
33
|
'open-in-new-window': 'opens in a new window',
|
|
34
|
-
'stream-hub-welcome': 'Welcome to Stream Home'
|
|
34
|
+
'stream-hub-welcome': 'Welcome to Stream Home',
|
|
35
|
+
'app-switcher-alt-text': 'App Switcher image'
|
|
35
36
|
},
|
|
36
37
|
DrawerWidth: {
|
|
37
38
|
Collapsed: 60,
|
|
@@ -39,7 +40,7 @@ export var Constants = Object.freeze({
|
|
|
39
40
|
},
|
|
40
41
|
DefaultStreamHomeUrl: 'https://home.learningpool.com'
|
|
41
42
|
});
|
|
42
|
-
export
|
|
43
|
+
export const applications = [
|
|
43
44
|
{ applicationId: 1, applicationName: 'Stream LXP', shortName: 'LXP', internalName: 'stream', url: 'https://learningpool.com' },
|
|
44
45
|
{ applicationId: 2, applicationName: 'Stream Analytics', shortName: 'Long Wrapping Test Stream Analytics', internalName: 'analytics', url: 'https://learningpool.com?Analytics' },
|
|
45
46
|
{ applicationId: 3, applicationName: 'Stream Automation', shortName: 'Event Management', internalName: 'automation', customName: 'Waves 1', url: 'https://learningpool.com?AutomationEventManagement' },
|
|
@@ -48,14 +49,14 @@ export var applications = [
|
|
|
48
49
|
{ applicationId: 4, applicationName: 'Stream Authoring', shortName: 'Authoring', internalName: 'authoring', url: 'https://learningpool.com?Authoring' },
|
|
49
50
|
{ applicationId: 8, applicationName: 'IQ', shortName: 'IQ', internalName: 'iq', url: 'https://data.applications.com?IQ' }
|
|
50
51
|
];
|
|
51
|
-
export
|
|
52
|
+
export const promotionalContent = [
|
|
52
53
|
{
|
|
53
54
|
id: 1,
|
|
54
55
|
name: 'AIC campaign',
|
|
55
56
|
appSwitcherImageUrl: 'https://uuicdn.learningpool.com/promotionalcampaigns/appswitcheradvert/latest/300x150.png',
|
|
56
57
|
hubImageUrl: 'https://uuicdn.learningpool.com/promotionalcampaigns/banner/latest/1000x138.png',
|
|
57
58
|
altText: 'AIC',
|
|
58
|
-
basePromoUrl: 'https://aic.
|
|
59
|
+
basePromoUrl: 'https://aic.design-system.com',
|
|
59
60
|
isActive: true
|
|
60
61
|
}
|
|
61
62
|
];
|
package/lang/en-us.d.ts
CHANGED
package/lang/en-us.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export const defaultMessages = {
|
|
2
2
|
// App Switcher
|
|
3
3
|
'app-switcher': 'App Switcher',
|
|
4
4
|
'your-apps': 'Your Apps',
|
|
@@ -13,6 +13,7 @@ export var defaultMessages = {
|
|
|
13
13
|
'select-org': 'Organisation',
|
|
14
14
|
'open-in-new-window': 'opens in a new window',
|
|
15
15
|
'stream-hub-welcome': 'Welcome to Stream Home',
|
|
16
|
+
'banner-image-alt-text': 'Banner Image advert',
|
|
16
17
|
// Navigation
|
|
17
18
|
'site-navigation': 'Site navigation',
|
|
18
19
|
'open-navigation': 'Open navigation',
|
package/package.json
CHANGED
|
@@ -9,30 +9,35 @@
|
|
|
9
9
|
"components",
|
|
10
10
|
"ui"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.
|
|
12
|
+
"version": "1.16.0",
|
|
13
13
|
"private": false,
|
|
14
14
|
"main": "index.js",
|
|
15
15
|
"module": "index.js",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@emotion/react": "^11.7.1",
|
|
18
18
|
"@emotion/styled": "^11.6.0",
|
|
19
|
+
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
19
20
|
"@learningpool/design-tokens": "^1.1.0-beta.7",
|
|
20
21
|
"@mui/icons-material": "^5.14.15",
|
|
21
22
|
"@mui/material": "5.10.6",
|
|
22
23
|
"@mui/x-data-grid": "^5.12.3",
|
|
23
24
|
"@react-spring/web": "^9.7.3",
|
|
24
25
|
"@types/jest": "^27.4.0",
|
|
25
|
-
"@types/node": "^
|
|
26
|
+
"@types/node": "^18.19.15",
|
|
26
27
|
"@types/react": "^17.0.69",
|
|
27
28
|
"@types/react-dom": "^17.0.22",
|
|
28
29
|
"@typescript-eslint/parser": "^5.31.0",
|
|
29
30
|
"anysort": "^2.0.0",
|
|
31
|
+
"babel-plugin-formatjs": "^10.5.13",
|
|
32
|
+
"crypto-browserify": "^3.12.0",
|
|
30
33
|
"eslint-plugin-n": "^15.2.4",
|
|
31
34
|
"focus-trap-react": "^8.11.0",
|
|
32
35
|
"jwt-decode": "^3.1.2",
|
|
36
|
+
"path-browserify": "^1.0.1",
|
|
33
37
|
"polished": "^4.2.2",
|
|
34
38
|
"postcss": "^8.4.31",
|
|
35
39
|
"query-string": "^7.1.1",
|
|
40
|
+
"stream-browserify": "^3.0.0",
|
|
36
41
|
"styled-components": "^5.3.6",
|
|
37
42
|
"tss-react": "^3.3.6",
|
|
38
43
|
"typescript": "^4.9.5",
|
package/utils/constants.d.ts
CHANGED
|
@@ -9,3 +9,10 @@ export declare const VERTNAV_COLORS: {
|
|
|
9
9
|
DARKEN_AMOUNT: number;
|
|
10
10
|
};
|
|
11
11
|
export declare const DEFAULT_MAX_CHARACTERS_PER_LINE = 50;
|
|
12
|
+
export declare const EVENT_KEYS: {
|
|
13
|
+
Tab: string;
|
|
14
|
+
Enter: string;
|
|
15
|
+
Shift: string;
|
|
16
|
+
Escape: string;
|
|
17
|
+
Keydown: string;
|
|
18
|
+
};
|
package/utils/constants.js
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export const DEFAULT_REACT_APP_ID = 'root';
|
|
2
|
+
export const MOBILE_NAV_PANEL_TYPES = {
|
|
3
3
|
DRAWER: 'drawer',
|
|
4
4
|
SEARCH: 'search',
|
|
5
5
|
AVATAR: 'avatar'
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export const VERTNAV_COLORS = {
|
|
8
8
|
LIGHTEN_AMOUNT: 0.1,
|
|
9
9
|
DARKEN_AMOUNT: 0.1
|
|
10
10
|
};
|
|
11
11
|
// 50 seems a reasonable default limit
|
|
12
12
|
// https://m2.material.io/design/typography/understanding-typography.html#readability
|
|
13
|
-
export
|
|
13
|
+
export const DEFAULT_MAX_CHARACTERS_PER_LINE = 50;
|
|
14
|
+
export const EVENT_KEYS = {
|
|
15
|
+
Tab: 'Tab',
|
|
16
|
+
Enter: 'Enter',
|
|
17
|
+
Shift: 'Shift',
|
|
18
|
+
Escape: 'Escape',
|
|
19
|
+
Keydown: 'Keydown'
|
|
20
|
+
};
|
package/utils/dataAttributes.js
CHANGED
package/utils/helpers.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
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
1
|
import { useEffect, useRef } from 'react';
|
|
13
2
|
import { useSpring, config } from '@react-spring/web';
|
|
14
3
|
/**
|
|
@@ -16,34 +5,33 @@ import { useSpring, config } from '@react-spring/web';
|
|
|
16
5
|
* @param avatarName string - Expected full name but accepts any string
|
|
17
6
|
* @returns string
|
|
18
7
|
*/
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (((_a = avatarName.split(' ')) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
|
8
|
+
export const handleAvatarInitials = (avatarName) => {
|
|
9
|
+
let firstInitial = avatarName.split('')[0] || '';
|
|
10
|
+
let secondInitial = '';
|
|
11
|
+
if (avatarName.split(' ')?.length > 1) {
|
|
24
12
|
firstInitial = avatarName.split(' ')[0][0];
|
|
25
|
-
if (
|
|
26
|
-
secondInitial = avatarName
|
|
13
|
+
if (avatarName.split(' ')[1]?.length > 0) {
|
|
14
|
+
secondInitial = avatarName?.split(' ')[1][0];
|
|
27
15
|
}
|
|
28
16
|
}
|
|
29
|
-
return
|
|
17
|
+
return `${firstInitial}${secondInitial}`;
|
|
30
18
|
};
|
|
31
19
|
/**
|
|
32
20
|
* Accepts a string and returns a color hex code e.g. #000000
|
|
33
21
|
* @param string string - Accepts any string
|
|
34
22
|
* @returns string
|
|
35
23
|
*/
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
export const stringToColor = (string) => {
|
|
25
|
+
let hash = 0;
|
|
26
|
+
let i;
|
|
39
27
|
/* eslint-disable no-bitwise */
|
|
40
28
|
for (i = 0; i < string.length; i += 1) {
|
|
41
29
|
hash = string.charCodeAt(i) + ((hash << 5) - hash);
|
|
42
30
|
}
|
|
43
|
-
|
|
31
|
+
let color = '#';
|
|
44
32
|
for (i = 0; i < 3; i += 1) {
|
|
45
|
-
|
|
46
|
-
color +=
|
|
33
|
+
const value = (hash >> (i * 8)) & 0xff;
|
|
34
|
+
color += `00${value.toString(16)}`.slice(-2);
|
|
47
35
|
}
|
|
48
36
|
/* eslint-enable no-bitwise */
|
|
49
37
|
return color;
|
|
@@ -53,7 +41,7 @@ export var stringToColor = function (string) {
|
|
|
53
41
|
* @param string string - Accepts any string
|
|
54
42
|
* @returns string
|
|
55
43
|
*/
|
|
56
|
-
export
|
|
44
|
+
export const stringAvatar = (name) => {
|
|
57
45
|
return {
|
|
58
46
|
sx: {
|
|
59
47
|
bgcolor: stringToColor(name)
|
|
@@ -61,7 +49,7 @@ export var stringAvatar = function (name) {
|
|
|
61
49
|
children: handleAvatarInitials(name)
|
|
62
50
|
};
|
|
63
51
|
};
|
|
64
|
-
|
|
52
|
+
const STAGGER_ITEMS_DELAY = 70;
|
|
65
53
|
/**
|
|
66
54
|
* Accepts an order, optional in/out toggle and returns
|
|
67
55
|
* a react-spring style object from useSpring based on the
|
|
@@ -71,14 +59,21 @@ var STAGGER_ITEMS_DELAY = 70;
|
|
|
71
59
|
* @param reverse boolean - Toggles the direction of the animation
|
|
72
60
|
* @returns Object
|
|
73
61
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
reverse
|
|
77
|
-
config:
|
|
62
|
+
const useStaggerIn = (animationConfig, delayOrder, reverse) => {
|
|
63
|
+
const defaultAnimationConfig = {
|
|
64
|
+
reverse,
|
|
65
|
+
config: {
|
|
66
|
+
...config.default,
|
|
67
|
+
mass: 1
|
|
68
|
+
}
|
|
78
69
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
const animationCountRef = useRef(0);
|
|
71
|
+
const staggerInAnimation = useSpring({
|
|
72
|
+
...defaultAnimationConfig,
|
|
73
|
+
...animationConfig,
|
|
74
|
+
delay: STAGGER_ITEMS_DELAY * delayOrder
|
|
75
|
+
});
|
|
76
|
+
useEffect(() => {
|
|
82
77
|
animationCountRef.current += 1;
|
|
83
78
|
});
|
|
84
79
|
return staggerInAnimation;
|
|
@@ -91,9 +86,8 @@ var useStaggerIn = function (animationConfig, delayOrder, reverse) {
|
|
|
91
86
|
* @param reverse boolean - Toggles the direction of the animation
|
|
92
87
|
* @returns Object
|
|
93
88
|
*/
|
|
94
|
-
export
|
|
95
|
-
|
|
96
|
-
var animationConfig = {
|
|
89
|
+
export const useFadeIn = (delayOrder, reverse = false) => {
|
|
90
|
+
const animationConfig = {
|
|
97
91
|
from: { opacity: 0 },
|
|
98
92
|
to: { opacity: 1 }
|
|
99
93
|
};
|
|
@@ -107,9 +101,8 @@ export var useFadeIn = function (delayOrder, reverse) {
|
|
|
107
101
|
* @param reverse boolean - Toggles the direction of the animation
|
|
108
102
|
* @returns Object
|
|
109
103
|
*/
|
|
110
|
-
export
|
|
111
|
-
|
|
112
|
-
var animationConfig = {
|
|
104
|
+
export const useFadeAndMoveIn = (delayOrder, reverse = false) => {
|
|
105
|
+
const animationConfig = {
|
|
113
106
|
from: { opacity: 0, y: 10 },
|
|
114
107
|
to: { opacity: 1, y: 0 }
|
|
115
108
|
};
|