@learningpool/ui 1.15.5 → 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 +9 -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.js +3 -3
- package/lang/en-us.js +1 -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,57 +1,251 @@
|
|
|
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
|
/* eslint-disable indent */
|
|
6
2
|
import Drawer from '@mui/material/Drawer';
|
|
7
3
|
import { Box, IconButton } from '../../../index';
|
|
8
4
|
import { styled } from '@mui/material/styles';
|
|
9
5
|
import { animated } from '@react-spring/web';
|
|
10
6
|
import { getNavigationBackground, getNavigationContrastText, getOffsetNavigationBackground } from '../helpers';
|
|
11
|
-
export
|
|
7
|
+
export const DRAWER_WIDTH = {
|
|
12
8
|
Collapsed: 60,
|
|
13
9
|
Expanded: 300
|
|
14
10
|
};
|
|
15
|
-
|
|
11
|
+
const ICON = {
|
|
16
12
|
Height: 40,
|
|
17
13
|
Width: 57
|
|
18
14
|
};
|
|
19
|
-
export
|
|
15
|
+
export const NOTCH = {
|
|
20
16
|
Width: 25
|
|
21
17
|
};
|
|
22
|
-
export
|
|
23
|
-
shouldForwardProp:
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
export const DrawerHeader = styled(animated.div, {
|
|
19
|
+
shouldForwardProp: (prop) => prop !== 'isDrawerOpen'
|
|
20
|
+
}) `
|
|
21
|
+
align-items: center;
|
|
22
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
23
|
+
display: flex;
|
|
24
|
+
flex: 1 auto;
|
|
25
|
+
justify-content: flex-start;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
min-height: 56px !important;
|
|
28
|
+
padding: ${(props) => props.theme.spacing(1)} 10px 0;
|
|
29
|
+
transition: ${(props) => props.isDrawerOpen
|
|
30
|
+
? `width ${props.theme.transitions.duration.enteringScreen}ms ${props.theme.transitions.easing.easeOut} 0`
|
|
31
|
+
: `width ${props.theme.transitions.duration.leavingScreen}ms ${props.theme.transitions.easing.easeIn}`} 250ms;
|
|
32
|
+
width: ${(props) => props.isDrawerOpen
|
|
27
33
|
? DRAWER_WIDTH.Expanded
|
|
28
|
-
:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
:
|
|
44
|
-
|
|
45
|
-
:
|
|
46
|
-
|
|
47
|
-
:
|
|
48
|
-
|
|
49
|
-
:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
34
|
+
: `calc(${props.theme.spacing(7)} + 1px)`};
|
|
35
|
+
|
|
36
|
+
@media (min-width: ${(props) => props.theme.breakpoints.values.sm}) {
|
|
37
|
+
min-height: 64px !important;
|
|
38
|
+
width: ${(props) => props.isDrawerOpen ? DRAWER_WIDTH.Expanded : `calc(${props.theme.spacing(8)} + 1px)`};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.MuiListItemIcon-root {
|
|
42
|
+
margin: ${(props) => props.theme.spacing(0.5)} 0 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.MuiListItemText-root {
|
|
46
|
+
align-items: center !important;
|
|
47
|
+
color: ${props => getNavigationContrastText(props.theme)};
|
|
48
|
+
display: flex;
|
|
49
|
+
min-height: ${ICON.Height + 8}px;
|
|
50
|
+
max-height: ${(props) => props.isDrawerOpen ? '200px' : `${ICON.Height + 8}px`};
|
|
51
|
+
text-decoration: none;
|
|
52
|
+
text-dransform: none;
|
|
53
|
+
transition: max-height ${(props) => props.theme.transitions.duration.enteringScreen}ms ${(props) => props.theme.transitions.easing.easeOut};
|
|
54
|
+
padding: 0;
|
|
55
|
+
width: 100%;
|
|
56
|
+
|
|
57
|
+
[theme.breakpoints.up('sm')] {
|
|
58
|
+
max-height: ${(props) => props.isDrawerOpen ? '200px' : `${ICON.Height + 8}px`};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.MuiListItemText-root .MuiTypography-root {
|
|
63
|
+
white-space: normal;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
export const DrawerToggle = styled(IconButton, {
|
|
67
|
+
shouldForwardProp: (prop) => prop !== 'isDrawerOpen'
|
|
68
|
+
}) `
|
|
69
|
+
background: transparent;
|
|
70
|
+
height: 44px;
|
|
71
|
+
padding: 0 ${(props) => props.theme.spacing(2)} !important;
|
|
72
|
+
position: absolute;
|
|
73
|
+
left: ${props => props.theme.direction === 'ltr' ? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded - 22}px !important` : '35px !important' : 'auto !important'};
|
|
74
|
+
right: ${props => props.theme.direction === 'rtl' ? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded - 22}px !important` : '35px !important' : 'auto !important'};
|
|
75
|
+
transform: translate(0, calc(50% - 4.5px)) rotate(${props => props.theme.direction === 'rtl' ? '180deg' : 0});
|
|
76
|
+
transition: all ${(props) => props.theme.transitions.duration.enteringScreen}ms ${(props) => props.theme.transitions.easing.easeOut};
|
|
77
|
+
width: 44px;
|
|
78
|
+
z-index: 10;
|
|
79
|
+
|
|
80
|
+
@media (min-width: ${(props) => props.theme.breakpoints.values.sm}) {
|
|
81
|
+
padding: 0 ${(props) => props.theme.spacing(2.5)} !important;
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
export const DrawerToggleHitboxContent = styled('span') `
|
|
85
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
box-shadow: 5px 0 15px 0 rgb(0 0 0 / 10%);
|
|
88
|
+
box-sizing: content-box;
|
|
89
|
+
height: 1.75rem;
|
|
90
|
+
padding: ${(props) => props.theme.spacing(0.5)};
|
|
91
|
+
width: 1.75rem;
|
|
92
|
+
`;
|
|
93
|
+
export const StyledAside = styled('aside') ``;
|
|
94
|
+
export const StyledNav = styled('nav') `
|
|
95
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
96
|
+
display: flex;
|
|
97
|
+
flex: 1 auto;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
justify-content: flex-start;
|
|
100
|
+
overflow-x: hidden;
|
|
101
|
+
overflow-y: auto;
|
|
102
|
+
|
|
103
|
+
// Firefox and future scrollbars
|
|
104
|
+
* & {
|
|
105
|
+
scrollbar-width: thin;
|
|
106
|
+
scrollbar-color: ${props => getOffsetNavigationBackground(props.theme, 0.2)};
|
|
107
|
+
transition: background-color ${props => props.theme.transitions.duration.enteringScreen}ms ${(props) => props.theme.transitions.easing.easeOut};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
* &:hover {
|
|
111
|
+
scrollbar-color: ${props => getOffsetNavigationBackground(props.theme, 0.3)};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Webkit and fall back scrollbars
|
|
115
|
+
::-webkit-scrollbar {
|
|
116
|
+
width: 8px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
::-webkit-scrollbar-track {
|
|
120
|
+
background-color: transparent;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
::-webkit-scrollbar-thumb {
|
|
124
|
+
background-color: ${props => getOffsetNavigationBackground(props.theme, 0.2)};
|
|
125
|
+
border-radius: 55px;
|
|
126
|
+
transition: background-color ${props => props.theme.transitions.duration.enteringScreen}ms ${(props) => props.theme.transitions.easing.easeOut};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
::-webkit-scrollbar-thumb:hover {
|
|
130
|
+
background-color: ${props => getOffsetNavigationBackground(props.theme, 0.3)};
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
133
|
+
export const StyledNavSecondary = styled('nav') `
|
|
134
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
135
|
+
display: flex;
|
|
136
|
+
flex: 1 auto;
|
|
137
|
+
flex-direction: column;
|
|
138
|
+
justify-content: flex-end;
|
|
139
|
+
margin-top: auto;
|
|
140
|
+
overflow: hidden;
|
|
141
|
+
`;
|
|
142
|
+
export const StyledDivider = styled('div', {
|
|
143
|
+
shouldForwardProp: (prop) => prop !== 'isDrawerOpen'
|
|
144
|
+
}) `
|
|
145
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
146
|
+
|
|
147
|
+
:before {
|
|
148
|
+
background-color: ${props => getOffsetNavigationBackground(props.theme, 0.05)};
|
|
149
|
+
border-radius: 55px;
|
|
150
|
+
content: "";
|
|
151
|
+
display: block;
|
|
152
|
+
height: 2px;
|
|
153
|
+
margin: auto;
|
|
154
|
+
transition: all ${(props) => props.theme.transitions.duration.enteringScreen}ms ${(props) => props.theme.transitions.easing.easeOut};
|
|
155
|
+
width: 66%;
|
|
156
|
+
}
|
|
157
|
+
`;
|
|
158
|
+
export const DrawerShadow = styled(Box, {
|
|
159
|
+
shouldForwardProp: (prop) => prop !== 'isDrawerOpen'
|
|
160
|
+
}) `
|
|
161
|
+
background: rgba(0, 0, 0, 0.125);
|
|
162
|
+
content: "";
|
|
163
|
+
display: block;
|
|
164
|
+
filter: blur(13px);
|
|
165
|
+
height: 100%;
|
|
166
|
+
left: ${(props) => props.theme.direction === 'ltr'
|
|
167
|
+
? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded - 38}px` : `${DRAWER_WIDTH.Collapsed - 41}px`
|
|
168
|
+
: 0};
|
|
169
|
+
right: ${(props) => props.theme.direction === 'rtl'
|
|
170
|
+
? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded - 38}px` : `${DRAWER_WIDTH.Collapsed - 41}px`
|
|
171
|
+
: 0};
|
|
172
|
+
position: fixed;
|
|
173
|
+
top: 0;
|
|
174
|
+
transition-duration: ${(props) => props.theme.transitions.duration.enteringScreen}ms;
|
|
175
|
+
transition-property: left right;
|
|
176
|
+
transition-timing-function: ${(props) => props.theme.transitions.easing.easeOut};
|
|
177
|
+
visibility: visible;
|
|
178
|
+
width: 40px;
|
|
179
|
+
|
|
180
|
+
@media (min-width: ${(props) => props.theme.breakpoints.values.sm}) {
|
|
181
|
+
left: ${(props) => props.theme.direction === 'ltr'
|
|
182
|
+
? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded - 38}px` : `${DRAWER_WIDTH.Collapsed - 33}px`
|
|
183
|
+
: 0};
|
|
184
|
+
right: ${(props) => props.theme.direction === 'rtl'
|
|
185
|
+
? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded - 38}px` : `${DRAWER_WIDTH.Collapsed - 33}px`
|
|
186
|
+
: 0};
|
|
187
|
+
}
|
|
188
|
+
`;
|
|
189
|
+
export const NotchContainer = styled(Box) `
|
|
190
|
+
display: flex;
|
|
191
|
+
justify-content: flex-end;
|
|
192
|
+
height: auto;
|
|
193
|
+
margin-top: -3px;
|
|
194
|
+
position: relative;
|
|
195
|
+
transition: width ${(props) => props.theme.transitions.duration.enteringScreen}ms ${(props) => props.theme.transitions.easing.easeOut};
|
|
196
|
+
width: 100%;
|
|
197
|
+
z-index: 9;
|
|
198
|
+
`;
|
|
199
|
+
export const NotchBackground = styled(Box) `
|
|
200
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
201
|
+
flex: 1;
|
|
202
|
+
height: auto;
|
|
203
|
+
width: auto;
|
|
204
|
+
`;
|
|
205
|
+
export const NotchBackgroundClip = styled(Box) `
|
|
206
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
207
|
+
clip-path: url("#notch");
|
|
208
|
+
display: flex;
|
|
209
|
+
height: 85px;
|
|
210
|
+
transform: rotate(${(props) => (props.theme.direction === 'rtl' ? '180deg' : 0)});
|
|
211
|
+
width: 45px;
|
|
212
|
+
`;
|
|
213
|
+
export const NotchSeemMask = styled(Box) `
|
|
214
|
+
background-color: ${props => getNavigationBackground(props.theme)};
|
|
215
|
+
height: 90px;
|
|
216
|
+
position: absolute;
|
|
217
|
+
left: ${(props) => props.theme.direction === 'rtl' ? `${NOTCH.Width}px` : 'auto'};
|
|
218
|
+
right: ${(props) => props.theme.direction === 'ltr' ? `${NOTCH.Width}px` : 'auto'};
|
|
219
|
+
top: -2px;
|
|
220
|
+
width: calc(100% - ${NOTCH.Width}px);
|
|
221
|
+
`;
|
|
222
|
+
export const StyledDrawer = styled(Drawer, {
|
|
223
|
+
shouldForwardProp: (prop) => prop !== 'open'
|
|
224
|
+
}) `
|
|
225
|
+
box-shadow: none;
|
|
226
|
+
box-sizing: border-box;
|
|
227
|
+
flexshrink: 0;
|
|
228
|
+
overflow-x: visible;
|
|
229
|
+
transition: width ${(props) => props.theme.transitions.duration.enteringScreen}ms ${(props) => props.theme.transitions.easing.easeOut};
|
|
230
|
+
white-space: nowrap;
|
|
231
|
+
width: ${(props) => !props.open ? `calc(${props.theme.spacing(7)} + 1px)` : `${DRAWER_WIDTH.Expanded}px`};
|
|
232
|
+
|
|
233
|
+
.MuiDrawer-paper {
|
|
234
|
+
background: transparent none;
|
|
235
|
+
border: 0;
|
|
236
|
+
box-shadow: none;
|
|
237
|
+
color: ${props => getNavigationContrastText(props.theme)};
|
|
238
|
+
left: ${(props) => (props.theme.direction === 'ltr' ? 0 : 'auto')};
|
|
239
|
+
right: ${(props) => (props.theme.direction === 'rtl' ? 0 : 'auto')};
|
|
240
|
+
overflow: visible !important;
|
|
241
|
+
overflow-x: visible;
|
|
242
|
+
transform: translateX(0) !important;
|
|
243
|
+
transition: width ${(props) => props.theme.transitions.duration.enteringScreen}ms ${(props) => props.theme.transitions.easing.easeOut};
|
|
244
|
+
visibility: visible !important;
|
|
245
|
+
width: ${(props) => !props.open ? `calc(${props.theme.spacing(7)} + 1px)` : `${DRAWER_WIDTH.Expanded}px`};
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.MuiTypography-root {
|
|
249
|
+
color: inherit;
|
|
250
|
+
}
|
|
251
|
+
`;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/**
|
|
3
2
|
* Return the background color for the navigation
|
|
4
3
|
* @returns string
|
|
@@ -23,7 +22,7 @@ export declare const getOffsetNavigationBackground: (theme: any, colorAdjustAmou
|
|
|
23
22
|
export declare const getOffsetNavigationContrastText: (theme: any, colorAdjustAmount?: number) => any;
|
|
24
23
|
export declare const getDefaultSupportLinks: (messages: Record<string, string>) => {
|
|
25
24
|
label: string;
|
|
26
|
-
icon: JSX.Element;
|
|
25
|
+
icon: import("@emotion/react/jsx-runtime").JSX.Element;
|
|
27
26
|
onClick: () => null;
|
|
28
27
|
children: {
|
|
29
28
|
label: string;
|
|
@@ -1,79 +1,75 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { darken, lighten, getLuminance } from 'polished';
|
|
3
3
|
import HelpOutlineIcon from '@mui/icons-material/HelpOutline';
|
|
4
|
-
|
|
4
|
+
const DEFAULT_COLOR_ADJUST_AMOUNT = 0.1;
|
|
5
5
|
// Luminance threshold for determining if we should lighten or darken the color
|
|
6
6
|
// .033 is the luminance value of #333333
|
|
7
|
-
|
|
7
|
+
const LUMINANCE_THRESHOLD = 0.033;
|
|
8
8
|
/**
|
|
9
9
|
* Return the background color for the navigation
|
|
10
10
|
* @returns string
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
return (_b = (_a = theme.palette.navigation) === null || _a === void 0 ? void 0 : _a.background) !== null && _b !== void 0 ? _b : theme.palette.background.paper;
|
|
12
|
+
export const getNavigationBackground = (theme) => {
|
|
13
|
+
return theme.palette.navigation?.background ?? theme.palette.background.paper;
|
|
15
14
|
};
|
|
16
15
|
/**
|
|
17
16
|
* Returns the contrast color for the navigation
|
|
18
17
|
* @returns string
|
|
19
18
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
var palette = theme.palette;
|
|
19
|
+
export const getNavigationContrastText = (theme) => {
|
|
20
|
+
const palette = theme.palette;
|
|
23
21
|
// Use background property if navigation properties arent set
|
|
24
|
-
if (!
|
|
22
|
+
if (!palette.navigation?.contrastText && !palette.navigation?.background) {
|
|
25
23
|
return palette.getContrastText(palette.background.paper);
|
|
26
24
|
}
|
|
27
|
-
return
|
|
25
|
+
return palette.navigation?.contrastText ?? palette.getContrastText(palette.navigation?.background);
|
|
28
26
|
};
|
|
29
27
|
/**
|
|
30
28
|
* Return a darkened or lightened background color for the navigation
|
|
31
29
|
* @param [colorAdjustAmount] number - Amount to lighten or darken the color
|
|
32
30
|
* @returns string
|
|
33
31
|
*/
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var adjustAmount = colorAdjustAmount || DEFAULT_COLOR_ADJUST_AMOUNT;
|
|
32
|
+
export const getOffsetNavigationBackground = (theme, colorAdjustAmount) => {
|
|
33
|
+
const palette = theme.palette;
|
|
34
|
+
const adjustAmount = colorAdjustAmount || DEFAULT_COLOR_ADJUST_AMOUNT;
|
|
38
35
|
// Use background property if navigation property isnt set
|
|
39
|
-
if (!
|
|
36
|
+
if (!palette.navigation?.background) {
|
|
40
37
|
return getLuminance(palette.background.paper) < LUMINANCE_THRESHOLD
|
|
41
38
|
? lighten(adjustAmount, palette.background.paper)
|
|
42
39
|
: darken(adjustAmount, palette.background.paper);
|
|
43
40
|
}
|
|
44
|
-
return getLuminance(
|
|
45
|
-
? lighten(adjustAmount,
|
|
46
|
-
: darken(adjustAmount,
|
|
41
|
+
return getLuminance(palette.navigation?.background) < LUMINANCE_THRESHOLD
|
|
42
|
+
? lighten(adjustAmount, palette.navigation?.background)
|
|
43
|
+
: darken(adjustAmount, palette.navigation?.background);
|
|
47
44
|
};
|
|
48
45
|
/**
|
|
49
46
|
* Return a darkened or lightened contrast color for the navigation
|
|
50
47
|
* @param [colorAdjustAmount] number - Amount to lighten or darken the color
|
|
51
48
|
* @returns string
|
|
52
49
|
*/
|
|
53
|
-
export
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var adjustAmount = colorAdjustAmount || DEFAULT_COLOR_ADJUST_AMOUNT;
|
|
50
|
+
export const getOffsetNavigationContrastText = (theme, colorAdjustAmount) => {
|
|
51
|
+
const palette = theme.palette;
|
|
52
|
+
const adjustAmount = colorAdjustAmount || DEFAULT_COLOR_ADJUST_AMOUNT;
|
|
57
53
|
// Use background property if navigation property isnt set
|
|
58
|
-
if (!
|
|
54
|
+
if (!palette.navigation?.background) {
|
|
59
55
|
return getLuminance(palette.background.paper) < LUMINANCE_THRESHOLD
|
|
60
56
|
? palette.getContrastText(lighten(adjustAmount, palette.background.paper))
|
|
61
57
|
: palette.getContrastText(darken(adjustAmount, palette.background.paper));
|
|
62
58
|
}
|
|
63
|
-
return getLuminance(
|
|
64
|
-
? palette.getContrastText(lighten(adjustAmount,
|
|
65
|
-
: palette.getContrastText(darken(adjustAmount,
|
|
59
|
+
return getLuminance(palette.navigation?.background) < LUMINANCE_THRESHOLD
|
|
60
|
+
? palette.getContrastText(lighten(adjustAmount, palette.navigation?.background))
|
|
61
|
+
: palette.getContrastText(darken(adjustAmount, palette.navigation?.background));
|
|
66
62
|
};
|
|
67
|
-
export
|
|
63
|
+
export const getDefaultSupportLinks = (messages) => {
|
|
68
64
|
return [
|
|
69
65
|
{
|
|
70
66
|
label: messages.support,
|
|
71
67
|
icon: _jsx(HelpOutlineIcon, {}),
|
|
72
|
-
onClick:
|
|
68
|
+
onClick: () => null,
|
|
73
69
|
children: [
|
|
74
|
-
{ label: messages['help-center'], onClick:
|
|
75
|
-
{ label: messages['submit-feedback'], onClick:
|
|
76
|
-
{ label: messages['contact-us'], onClick:
|
|
70
|
+
{ label: messages['help-center'], onClick: () => window.open('https://learningpool.zendesk.com/', '_blank') },
|
|
71
|
+
{ label: messages['submit-feedback'], onClick: () => window.open('https://learningpool.com/feature-request/', '_blank') },
|
|
72
|
+
{ label: messages['contact-us'], onClick: () => window.open('https://learningpool.com/support/', '_blank') }
|
|
77
73
|
]
|
|
78
74
|
}
|
|
79
75
|
];
|
|
@@ -1,27 +1,16 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
13
2
|
import { LearningPoolLogo } from '../../../assets/Images';
|
|
14
3
|
import CssBaseline from '@mui/material/CssBaseline';
|
|
15
4
|
import Typography from '@mui/material/Typography';
|
|
16
5
|
import { createTheme, ThemeProvider } from '@mui/material/styles';
|
|
17
6
|
import { StyledContainer, StyledBox, StyledLogoBox } from './ErrorPageStyles';
|
|
18
7
|
export default function ErrorPage(props) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return (_jsx(ThemeProvider,
|
|
8
|
+
const { errorCode, errorTitle, errorMessage } = props;
|
|
9
|
+
const theme = createTheme();
|
|
10
|
+
return (_jsx(ThemeProvider, { theme: theme, children: _jsxs(StyledContainer, { component: 'main', children: [_jsx(CssBaseline, {}), _jsxs(StyledBox, { children: [_jsxs(Typography, { component: 'h1', variant: 'h4', sx: {
|
|
22
11
|
mb: 2
|
|
23
|
-
}
|
|
12
|
+
}, children: [errorCode ? (_jsxs("span", { children: [errorCode, " | "] })) : '', _jsx("span", { children: errorTitle })] }), _jsx(Typography, { variant: 'body1', sx: {
|
|
24
13
|
color: 'text.secondary',
|
|
25
14
|
mb: 3
|
|
26
|
-
}
|
|
15
|
+
}, children: errorMessage })] }), _jsx(StyledLogoBox, { children: _jsx(LearningPoolLogo, { inheritViewBox: true, style: { width: '200px', height: '45px' } }) })] }) }));
|
|
27
16
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import Box from '@mui/material/Box';
|
|
2
2
|
import Container from '@mui/material/Container';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
|
-
export
|
|
4
|
+
export const StyledContainer = styled(Container)(() => ({
|
|
5
5
|
display: 'flex',
|
|
6
6
|
flexDirection: 'column',
|
|
7
7
|
height: '100vh',
|
|
8
8
|
textAlign: 'center'
|
|
9
|
-
})
|
|
10
|
-
export
|
|
9
|
+
}));
|
|
10
|
+
export const StyledBox = styled(Box)(() => ({
|
|
11
11
|
alignItems: 'center',
|
|
12
12
|
display: 'flex',
|
|
13
13
|
flex: '1',
|
|
@@ -15,18 +15,13 @@ export var StyledBox = styled(Box)(function () { return ({
|
|
|
15
15
|
height: '100%',
|
|
16
16
|
justifyContent: 'center',
|
|
17
17
|
overflow: 'hidden'
|
|
18
|
-
})
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
alignSelf: 'flex-end',
|
|
29
|
-
marginRight: theme.spacing(5)
|
|
30
|
-
},
|
|
31
|
-
_b);
|
|
32
|
-
});
|
|
18
|
+
}));
|
|
19
|
+
export const StyledLogoBox = styled(Box)(({ theme }) => ({
|
|
20
|
+
alignSelf: 'center',
|
|
21
|
+
marginRight: 0,
|
|
22
|
+
marginBottom: theme.spacing(5),
|
|
23
|
+
[theme.breakpoints.up('md')]: {
|
|
24
|
+
alignSelf: 'flex-end',
|
|
25
|
+
marginRight: theme.spacing(5)
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
@@ -1,15 +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
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
13
2
|
import { Button } from '../../../index';
|
|
14
3
|
import CssBaseline from '@mui/material/CssBaseline';
|
|
15
4
|
import Paper from '@mui/material/Paper';
|
|
@@ -22,18 +11,18 @@ import { SideInSideStyles } from './SideInSideStyles';
|
|
|
22
11
|
import { LearningPoolLogo, StreamSuiteLogo } from '../../../assets/Images';
|
|
23
12
|
import Link from '@mui/material/Link';
|
|
24
13
|
function Copyright(props) {
|
|
25
|
-
return (_jsxs(Typography,
|
|
14
|
+
return (_jsxs(Typography, { variant: "body2", color: "text.secondary", align: "center", ...props, children: ['Copyright © ', _jsx(Link, { color: "inherit", href: "https://learningpool.com/", children: "Learning Pool" }), ' ', new Date().getFullYear(), '.'] }));
|
|
26
15
|
}
|
|
27
|
-
|
|
16
|
+
const theme = createTheme();
|
|
28
17
|
export default function SideInSide(props) {
|
|
29
|
-
|
|
30
|
-
return (_jsx(ThemeProvider,
|
|
31
|
-
? (_jsx("img", { src:
|
|
32
|
-
: _jsx(StreamSuiteLogo, { style: { fill: '#fff', height: '200px', width: '200px' } }) })
|
|
33
|
-
? (_jsx("img", { src:
|
|
34
|
-
: _jsx(LearningPoolLogo, { inheritViewBox: true, style: { width: '250px', height: '60px' } }) })
|
|
35
|
-
? (_jsxs(_Fragment, { children: [_jsx(Divider,
|
|
18
|
+
const classes = SideInSideStyles(props).classes;
|
|
19
|
+
return (_jsx(ThemeProvider, { theme: theme, children: _jsxs(Grid, { container: true, component: "main", className: classes.root, style: props?.style, children: [_jsx(CssBaseline, {}), _jsx(Grid, { item: true, xs: false, sm: false, md: 6, lg: 7, xl: 8, className: classes.pageBackgroundContainer, children: _jsx(Box, { className: classes.pageBackgroundLogoContainer, children: props?.pageBackgroundLogo
|
|
20
|
+
? (_jsx("img", { src: `${String(props.pageBackgroundLogo)}`, alt: `${String(props.pageBackgroundLogoAlt)}`, className: classes.pageBackgroundLogo }))
|
|
21
|
+
: _jsx(StreamSuiteLogo, { style: { fill: '#fff', height: '200px', width: '200px' } }) }) }), _jsx(Grid, { item: true, xs: 12, sm: 12, md: 6, lg: 5, xl: 4, component: Paper, elevation: 6, square: true, children: _jsxs(Box, { className: classes.contentPanel, children: [_jsx(Box, { className: classes.contentPanelImageContainer, children: props?.formLogo
|
|
22
|
+
? (_jsx("img", { src: `${String(props.formLogo)}`, alt: `${String(props.formLogoAlt)}`, className: classes.contentPanelImage }))
|
|
23
|
+
: _jsx(LearningPoolLogo, { inheritViewBox: true, style: { width: '250px', height: '60px' } }) }), _jsx(Typography, { component: "h1", variant: "h6", children: props.welcomeMessage }), props?.children ? props.children : null, props?.isStreamHomeEnabled
|
|
24
|
+
? (_jsxs(_Fragment, { children: [_jsx(Divider, { sx: { mt: 1 }, children: "Or" }), _jsx(Button, { type: "submit", onClick: props?.handleStreamHomeLogin, fullWidth: true, className: classes.streamHomeButton, startIcon: props?.startIcon
|
|
36
25
|
? props.startIcon
|
|
37
|
-
: _jsx(StreamSuiteLogo, { style: { fill: '#fff', height: '25px', width: '25px' } })
|
|
38
|
-
: null, _jsx(Box,
|
|
26
|
+
: _jsx(StreamSuiteLogo, { style: { fill: '#fff', height: '25px', width: '25px' } }), children: "Log in with Stream Home" })] }))
|
|
27
|
+
: null, _jsx(Box, { className: classes.footerContent, children: props?.footerContent ? props.footerContent : _jsx(Copyright, {}) })] }) })] }) }));
|
|
39
28
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { makeStyles } from 'tss-react/mui';
|
|
2
|
-
export
|
|
2
|
+
export const SideInSideStyles = makeStyles()((theme, props) => ({
|
|
3
3
|
root: {
|
|
4
4
|
height: '100vh',
|
|
5
5
|
width: '100%'
|
|
6
6
|
},
|
|
7
7
|
pageBackgroundContainer: {
|
|
8
|
-
backgroundImage:
|
|
9
|
-
?
|
|
8
|
+
backgroundImage: props?.pageBackgroundImage
|
|
9
|
+
? `url(${String(props.pageBackgroundImage)})`
|
|
10
10
|
: 'url(https://source.unsplash.com/YWIOwHvRBvU)',
|
|
11
11
|
backgroundRepeat: 'no-repeat',
|
|
12
12
|
backgroundColor: theme.palette.mode === 'light' ? theme.palette.grey[50] : theme.palette.grey[900],
|
|
@@ -50,11 +50,11 @@ export var SideInSideStyles = makeStyles()(function (theme, props) { return ({
|
|
|
50
50
|
marginTop: theme.spacing(3)
|
|
51
51
|
},
|
|
52
52
|
streamHomeButton: {
|
|
53
|
-
marginBottom:
|
|
54
|
-
marginTop:
|
|
53
|
+
marginBottom: `${theme.spacing(5)} !important`,
|
|
54
|
+
marginTop: `${theme.spacing(3)} !important`
|
|
55
55
|
},
|
|
56
56
|
footerContent: {
|
|
57
57
|
marginTop: 'auto',
|
|
58
58
|
width: '100%'
|
|
59
59
|
}
|
|
60
|
-
})
|
|
60
|
+
}));
|