@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
package/utils/hooks.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export var useCurrentWidth = function () {
|
|
2
|
+
const getWidth = () => window.innerWidth ??
|
|
3
|
+
document.documentElement.clientWidth ??
|
|
4
|
+
document.body.clientWidth;
|
|
5
|
+
export const useCurrentWidth = () => {
|
|
7
6
|
// save current window width in the state object
|
|
8
|
-
|
|
7
|
+
const [width, setWidth] = useState(getWidth());
|
|
9
8
|
// in this case useEffect will execute only once because
|
|
10
9
|
// it does not have any dependencies.
|
|
11
|
-
useEffect(
|
|
10
|
+
useEffect(() => {
|
|
12
11
|
// timeoutId for debounce mechanism
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
let timeoutId;
|
|
13
|
+
const resizeListener = () => {
|
|
15
14
|
// prevent execution of previous setTimeout
|
|
16
15
|
clearTimeout(timeoutId);
|
|
17
16
|
// change width from the state object after 150 milliseconds
|
|
18
|
-
timeoutId = setTimeout(
|
|
17
|
+
timeoutId = setTimeout(() => setWidth(getWidth()), 150);
|
|
19
18
|
};
|
|
20
19
|
// set resize listener
|
|
21
20
|
window.addEventListener('resize', resizeListener);
|
|
22
21
|
// clean up function
|
|
23
|
-
return
|
|
22
|
+
return () => {
|
|
24
23
|
// remove resize listener
|
|
25
24
|
window.removeEventListener('resize', resizeListener);
|
|
26
25
|
};
|
package/utils/theme.js
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
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 { amber, blue } from '@mui/material/colors';
|
|
13
|
-
|
|
2
|
+
const DEFAULT_HEADER_TYPOGRAPHY = {
|
|
14
3
|
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif'
|
|
15
4
|
};
|
|
16
|
-
|
|
5
|
+
const DEFAULT_BODY_TYPOGRAPHY = {
|
|
17
6
|
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif'
|
|
18
7
|
};
|
|
19
8
|
// @TODO: Discuss this with the experience design team, according to the UUI Figma
|
|
20
|
-
export
|
|
21
|
-
typography:
|
|
9
|
+
export const defaultTheme = {
|
|
10
|
+
typography: {
|
|
11
|
+
...DEFAULT_BODY_TYPOGRAPHY,
|
|
12
|
+
h1: DEFAULT_HEADER_TYPOGRAPHY,
|
|
13
|
+
h2: DEFAULT_HEADER_TYPOGRAPHY,
|
|
14
|
+
h3: DEFAULT_HEADER_TYPOGRAPHY,
|
|
15
|
+
h4: DEFAULT_HEADER_TYPOGRAPHY,
|
|
16
|
+
h5: DEFAULT_HEADER_TYPOGRAPHY,
|
|
17
|
+
h6: DEFAULT_HEADER_TYPOGRAPHY,
|
|
18
|
+
subtitle1: DEFAULT_BODY_TYPOGRAPHY,
|
|
19
|
+
subtitle2: DEFAULT_BODY_TYPOGRAPHY,
|
|
20
|
+
body1: DEFAULT_BODY_TYPOGRAPHY,
|
|
21
|
+
body2: DEFAULT_BODY_TYPOGRAPHY,
|
|
22
|
+
button: {
|
|
23
|
+
...DEFAULT_BODY_TYPOGRAPHY,
|
|
24
|
+
fontWeight: 700
|
|
25
|
+
},
|
|
26
|
+
caption: DEFAULT_BODY_TYPOGRAPHY,
|
|
27
|
+
overline: DEFAULT_BODY_TYPOGRAPHY
|
|
28
|
+
}
|
|
22
29
|
// overrides: {
|
|
23
30
|
// MuiCssBaseline: {
|
|
24
31
|
// '@global': {
|
|
@@ -30,7 +37,7 @@ export var defaultTheme = {
|
|
|
30
37
|
// }
|
|
31
38
|
// }
|
|
32
39
|
};
|
|
33
|
-
export
|
|
40
|
+
export const lightTheme = {
|
|
34
41
|
palette: {
|
|
35
42
|
primary: {
|
|
36
43
|
main: '#0077cc'
|
|
@@ -48,7 +55,7 @@ export var lightTheme = {
|
|
|
48
55
|
contrastThreshold: 4.5
|
|
49
56
|
}
|
|
50
57
|
};
|
|
51
|
-
export
|
|
58
|
+
export const darkTheme = {
|
|
52
59
|
palette: {
|
|
53
60
|
primary: amber,
|
|
54
61
|
divider: 'rgba(255, 255, 255, 0.075)',
|
|
@@ -61,13 +68,13 @@ export var darkTheme = {
|
|
|
61
68
|
contrastThreshold: 4.5
|
|
62
69
|
}
|
|
63
70
|
};
|
|
64
|
-
export
|
|
71
|
+
export const motion = {
|
|
65
72
|
ease: 'cubic-bezier(0.4, 0.0, 0.2, 1)',
|
|
66
73
|
easeOut: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
|
|
67
74
|
easeIn: 'cubic-bezier(0.4, 0.0, 1, 1)',
|
|
68
75
|
easeInOut: 'cubic-bezier(0.4, 0.0, 0.6, 1)'
|
|
69
76
|
};
|
|
70
|
-
export
|
|
77
|
+
export const tooltipDelay = {
|
|
71
78
|
start: 500,
|
|
72
79
|
end: 200
|
|
73
80
|
};
|