@learningpool/ui 1.6.0-beta.2 → 1.6.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/assets/Images.d.ts +9 -0
  2. package/assets/Images.js +4 -1
  3. package/components/navigation/MobileNavigation/MobileNavigation.d.ts +39 -0
  4. package/components/navigation/MobileNavigation/MobileNavigation.js +188 -0
  5. package/components/navigation/MobileNavigation/MobileNavigationAvatar.d.ts +28 -0
  6. package/components/navigation/MobileNavigation/MobileNavigationAvatar.js +124 -0
  7. package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +827 -0
  8. package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +33 -0
  9. package/components/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +24 -0
  10. package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +148 -0
  11. package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +392 -0
  12. package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +44 -0
  13. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +19 -0
  14. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +91 -0
  15. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.d.ts +15 -0
  16. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +26 -0
  17. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.d.ts +112 -0
  18. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +66 -0
  19. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.d.ts +126 -0
  20. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +71 -0
  21. package/components/navigation/MobileNavigation/MobileNavigationMotion.d.ts +141 -0
  22. package/components/navigation/MobileNavigation/MobileNavigationMotion.js +109 -0
  23. package/components/navigation/MobileNavigation/MobileNavigationSearch.d.ts +10 -0
  24. package/components/navigation/MobileNavigation/MobileNavigationSearch.js +52 -0
  25. package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +257 -0
  26. package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.js +20 -0
  27. package/components/navigation/MobileNavigation/MobileNavigationStyles.d.ts +405 -0
  28. package/components/navigation/MobileNavigation/MobileNavigationStyles.js +104 -0
  29. package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.d.ts +2 -0
  30. package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +32 -0
  31. package/components/navigation/MobileNavigation/MobileNavigationToggleX.d.ts +2 -0
  32. package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +26 -0
  33. package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.d.ts +36 -0
  34. package/components/navigation/MobileNavigation/MobileNavigationToggleXStyles.js +10 -0
  35. package/components/navigation/VerticalNavigation/AvatarPanel.d.ts +8 -0
  36. package/components/navigation/VerticalNavigation/AvatarPanel.js +97 -0
  37. package/components/navigation/VerticalNavigation/VerticalNavigation.d.ts +8 -10
  38. package/components/navigation/VerticalNavigation/VerticalNavigation.js +156 -93
  39. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.d.ts +18 -0
  40. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +91 -0
  41. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +15 -0
  42. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +29 -0
  43. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.d.ts +112 -0
  44. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +66 -0
  45. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.d.ts +126 -0
  46. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +71 -0
  47. package/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +31 -90
  48. package/components/navigation/VerticalNavigation/VerticalNavigationStyles.js +71 -258
  49. package/index.d.ts +1 -0
  50. package/index.js +1 -0
  51. package/package.json +3 -2
  52. package/utils/constants.d.ts +5 -0
  53. package/utils/constants.js +5 -0
  54. package/utils/helpers.d.ts +6 -0
  55. package/utils/helpers.js +17 -0
  56. package/utils/hooks.d.ts +1 -0
  57. package/utils/hooks.js +29 -0
  58. package/utils/theme.d.ts +4 -0
  59. package/utils/theme.js +4 -0
@@ -1,16 +1,9 @@
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);
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;
11
4
  };
12
- import { ListItem as SSListItem, ListItemButton as SSListItemButton, ListItemText as SSListItemText, ListItemIcon as SSListItemIcon, IconButton } from '../../../index';
13
- import { Box } from '@mui/material';
5
+ import Drawer from '@mui/material/Drawer';
6
+ import { Box, IconButton } from '../../../index';
14
7
  import { styled } from '@mui/material/styles';
15
8
  import { motion } from '../../../utils/theme';
16
9
  export var DRAWER_WIDTH = {
@@ -21,255 +14,75 @@ var ICON = {
21
14
  Height: 40,
22
15
  Width: 57
23
16
  };
24
- export var paperStyles = function (theme) { return ({
25
- background: 'transparent none',
26
- border: 0,
27
- boxShadow: 'none',
28
- color: theme.palette.mode === 'dark'
29
- ? theme.palette.primary.contrastText
30
- : theme.palette.getContrastText(theme.palette.background.paper),
31
- overflow: 'visible !important',
32
- transform: 'translateX(0) !important',
33
- transition: "width 225ms ".concat(motion.easeInOut, " 0ms !important"),
34
- visibility: 'visible'
35
- }); };
36
- export var openedMixin = function () { return ({
37
- boxShadow: 'none',
38
- overflowX: 'visible',
39
- transition: "width 225ms ".concat(motion.easeInOut, " 0ms !important"),
40
- width: DRAWER_WIDTH.Expanded
41
- }); };
42
- export var closedMixin = function (theme) {
43
- var _a;
44
- return (_a = {
45
- boxShadow: theme.shadows[1],
46
- overflowX: 'visible',
47
- transition: "width 225ms ".concat(motion.easeInOut, " 0ms !important"),
48
- width: "calc(".concat(theme.spacing(7), " + 1px)")
49
- },
50
- _a[theme.breakpoints.up('sm')] = {
51
- width: "calc(".concat(theme.spacing(8), " + 1px)")
52
- },
53
- _a);
54
- };
55
- export var DrawerHeader = styled('div')(function (_a) {
56
- var _b;
57
- var theme = _a.theme;
58
- return (__assign(__assign({ alignItems: 'center', display: 'flex', justifyContent: 'flex-start', overflow: 'hidden', padding: "".concat(theme.spacing(1), " 10px 0") }, theme.mixins.toolbar), (_b = { backgroundColor: theme.palette.mode === 'dark'
59
- ? theme.palette.primary.main
60
- : theme.palette.background.paper, minHeight: '56px !important' }, _b[theme.breakpoints.up('sm')] = {
61
- minHeight: '64px !important'
62
- }, _b)));
63
- });
64
- export var ListItem = styled(SSListItem)(function (_a) {
65
- var theme = _a.theme;
66
- return ({
67
- alignItems: 'flex-start',
68
- color: theme.palette.mode === 'dark'
69
- ? theme.palette.primary.contrastText
70
- : theme.palette.getContrastText(theme.palette.background.paper),
71
- overflow: 'hidden',
72
- minHeight: 48,
73
- '& .MuiListItemIcon-root': {
74
- marginTop: theme.spacing(0.5)
75
- },
76
- '& .MuiListItemText-root .MuiTypography-root': {
77
- whiteSpace: 'normal'
78
- }
79
- });
80
- });
81
- export var ListItemButton = styled(SSListItemButton, {
17
+ export var DrawerHeader = styled('div', {
82
18
  shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen'; }
83
- })(function (_a) {
84
- var _b;
85
- var theme = _a.theme, isDrawerOpen = _a.isDrawerOpen;
86
- return (_b = {
87
- alignItems: 'flex-start',
88
- color: theme.palette.mode === 'dark'
89
- ? theme.palette.primary.contrastText
90
- : theme.palette.getContrastText(theme.palette.background.paper),
91
- display: 'flex',
92
- minHeight: 48,
93
- maxHeight: isDrawerOpen ? '200px' : ICON.Height + 8,
94
- textDecoration: 'none',
95
- textTransform: 'none',
96
- transition: "max-height 225ms ".concat(motion.easeInOut, " 0ms !important"),
97
- padding: 0,
98
- width: '100%'
99
- },
100
- _b[theme.breakpoints.up('sm')] = {
101
- maxHeight: isDrawerOpen ? '200px' : ICON.Height + 8
102
- },
103
- _b);
19
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n display: flex;\n flex: 1 auto;\n justify-content: flex-start;\n overflow: hidden;\n min-height: 56px !important;\n padding: ", " 10px 0;\n /* necessary for content to be below app bar */\n /* ...props.theme.mixins.toolbar */\n transition: width 225ms ", " ", ";\n\n /* Testing secondary nav fix ups */\n width: ", ";\n\n @media (min-width: ", ") {\n min-height: 64px !important;\n width: ", ";\n };\n\n .MuiListItemIcon-root {\n margin: ", " 0 0;\n }\n\n .MuiListItemText-root {\n align-items: center !important;\n color: ", ";\n display: flex;\n min-height: ", "px;\n max-height: ", ";\n text-decoration: none;\n text-dransform: none;\n transition: max-height 225ms ", " 0ms !important;\n padding: 0;\n width: 100%;\n\n [theme.breakpoints.up('sm')] {\n max-height: ", ";\n }\n }\n\n .MuiListItemText-root .MuiTypography-root {\n white-space: normal;\n }\n"], ["\n align-items: center;\n background-color: ", ";\n display: flex;\n flex: 1 auto;\n justify-content: flex-start;\n overflow: hidden;\n min-height: 56px !important;\n padding: ", " 10px 0;\n /* necessary for content to be below app bar */\n /* ...props.theme.mixins.toolbar */\n transition: width 225ms ", " ", ";\n\n /* Testing secondary nav fix ups */\n width: ", ";\n\n @media (min-width: ", ") {\n min-height: 64px !important;\n width: ", ";\n };\n\n .MuiListItemIcon-root {\n margin: ", " 0 0;\n }\n\n .MuiListItemText-root {\n align-items: center !important;\n color: ", ";\n display: flex;\n min-height: ", "px;\n max-height: ", ";\n text-decoration: none;\n text-dransform: none;\n transition: max-height 225ms ", " 0ms !important;\n padding: 0;\n width: 100%;\n\n [theme.breakpoints.up('sm')] {\n max-height: ", ";\n }\n }\n\n .MuiListItemText-root .MuiTypography-root {\n white-space: normal;\n }\n"])), function (props) { return props.theme.palette.mode === 'dark'
20
+ ? props.theme.palette.primary.main
21
+ : props.theme.palette.background.paper; }, function (props) { return props.theme.spacing(1); }, motion.easeInOut, function (props) { return props.isDrawerOpen ? 0 : '250ms'; }, function (props) { return props.isDrawerOpen ? DRAWER_WIDTH.Expanded : "calc(".concat(props.theme.spacing(7), " + 1px)"); }, function (props) { return props.theme.breakpoints.values.sm; }, function (props) { return props.isDrawerOpen ? DRAWER_WIDTH.Expanded : "calc(".concat(props.theme.spacing(8), " + 1px)"); }, function (props) { return props.theme.spacing(0.5); }, function (props) {
22
+ return props.theme.palette.mode === 'dark'
23
+ ? props.theme.palette.primary.contrastText
24
+ : props.theme.palette.getContrastText(props.theme.palette.background.paper);
25
+ }, ICON.Height + 8, function (props) { return props.isDrawerOpen ? '200px' : "".concat(ICON.Height + 8, "px"); }, motion.easeInOut, function (props) { return props.isDrawerOpen ? '200px' : "".concat(ICON.Height + 8, "px"); });
26
+ export var DrawerToggle = styled(IconButton)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: transparent;\n height: 44px;\n padding: 0 ", " !important;\n position: absolute;\n transform: translate(22px, calc(50% - 5.5px));\n transition: all 225ms ", " 0ms !important;\n width: 44px;\n z-index: 10;\n\n @media (min-width: ", ") {\n padding: 0 ", " !important;\n }\n"], ["\n background: transparent;\n height: 44px;\n padding: 0 ", " !important;\n position: absolute;\n transform: translate(22px, calc(50% - 5.5px));\n transition: all 225ms ", " 0ms !important;\n width: 44px;\n z-index: 10;\n\n @media (min-width: ", ") {\n padding: 0 ", " !important;\n }\n"])), function (props) { return props.theme.spacing(2); }, motion.easeInOut, function (props) { return props.theme.breakpoints.values.sm; }, function (props) { return props.theme.spacing(2.5); });
27
+ export var DrawerToggleHitboxContent = styled('span')(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: 50%;\n box-shadow: 5px 0 15px 0 rgb(0 0 0 / 10%);\n box-sizing: content-box;\n height: 1.75rem;\n padding: ", ";\n width: 1.75rem;\n"], ["\n background-color: ", ";\n border-radius: 50%;\n box-shadow: 5px 0 15px 0 rgb(0 0 0 / 10%);\n box-sizing: content-box;\n height: 1.75rem;\n padding: ", ";\n width: 1.75rem;\n"])), function (props) { return props.theme.palette.mode === 'dark'
28
+ ? props.theme.palette.primary.main
29
+ : props.theme.palette.background.paper; }, function (props) { return props.theme.spacing(0.5); });
30
+ export var StyledAside = styled('aside')(templateObject_4 || (templateObject_4 = __makeTemplateObject([""], [""])));
31
+ export var StyledNav = styled('nav')(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background-color: ", ";\n display: flex;\n flex: 1 auto;\n flex-direction: column;\n justify-content: flex-start;\n margin-top: -1px;\n overflow-x: hidden;\n overflow-y: auto;\n\n // Firefox and future scrollbars\n * & {\n scrollbar-width: thin;\n scrollbar-color: ", ";\n transition: backgroundColor 225ms ", ";\n }\n\n * &:hover {\n scrollbar-color: ", ";\n }\n\n // Webkit and fall back scrollbars\n ::-webkit-scrollbar {\n width: 8px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 55px;\n transition: background-color 225ms ", ";\n }\n\n ::-webkit-scrollbar-thumb:hover {\n background-color: ", ";\n }\n"], ["\n background-color: ", ";\n display: flex;\n flex: 1 auto;\n flex-direction: column;\n justify-content: flex-start;\n margin-top: -1px;\n overflow-x: hidden;\n overflow-y: auto;\n\n // Firefox and future scrollbars\n * & {\n scrollbar-width: thin;\n scrollbar-color: ", ";\n transition: backgroundColor 225ms ", ";\n }\n\n * &:hover {\n scrollbar-color: ", ";\n }\n\n // Webkit and fall back scrollbars\n ::-webkit-scrollbar {\n width: 8px;\n }\n\n ::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n border-radius: 55px;\n transition: background-color 225ms ", ";\n }\n\n ::-webkit-scrollbar-thumb:hover {\n background-color: ", ";\n }\n"])), function (props) { return props.theme.palette.mode === 'dark'
32
+ ? props.theme.palette.primary.main
33
+ : props.theme.palette.background.paper; }, function (props) {
34
+ return props.theme.palette.mode === 'dark'
35
+ ? 'rgba(255, 255, 255, 0.12) transparent'
36
+ : 'rgba(0, 0, 0, 0.12) transparent';
37
+ }, motion.easeIn, function (props) {
38
+ return props.theme.palette.mode === 'dark'
39
+ ? 'rgba(255, 255, 255, 0.24) transparent'
40
+ : 'rgba(0, 0, 0, 0.24) transparent';
41
+ }, function (props) {
42
+ return props.theme.palette.mode === 'dark'
43
+ ? 'rgba(255, 255, 255, 0.12)'
44
+ : 'rgba(0, 0, 0, 0.12)';
45
+ }, motion.easeIn, function (props) {
46
+ return props.theme.palette.mode === 'dark'
47
+ ? 'rgba(255, 255, 255, 0.24)'
48
+ : 'rgba(0, 0, 0, 0.24)';
104
49
  });
105
- export var ListItemAvatar = styled(ListItemButton, {
50
+ export var StyledNavSecondary = styled('nav')(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n display: flex;\n flex: 1 auto;\n flex-direction: column;\n justify-content: flex-end;\n margin-top: auto;\n overflow: hidden;\n"], ["\n background-color: ", ";\n display: flex;\n flex: 1 auto;\n flex-direction: column;\n justify-content: flex-end;\n margin-top: auto;\n overflow: hidden;\n"])), function (props) { return props.theme.palette.mode === 'dark'
51
+ ? props.theme.palette.primary.main
52
+ : props.theme.palette.background.paper; });
53
+ export var StyledDivider = styled('div', {
106
54
  shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen'; }
107
- })(function (_a) {
108
- var isDrawerOpen = _a.isDrawerOpen;
109
- return ({
110
- alignItems: 'center',
111
- minHeight: 52,
112
- maxHeight: isDrawerOpen ? '200px' : '48px',
113
- transition: "max-height 225ms ".concat(motion.easeInOut, " 0ms !important"),
114
- '& .MuiListItemIcon-root': {
115
- justifyContent: 'center',
116
- minWidth: 0,
117
- margin: 0
118
- },
119
- '& .MuiAvatar-root': {
120
- height: 32,
121
- width: 32
122
- }
123
- });
124
- });
125
- export var ListItemIcon = styled(SSListItemIcon)(function (_a) {
126
- var _b;
127
- var theme = _a.theme;
128
- return (_b = {
129
- alignItems: 'center',
130
- color: theme.palette.mode === 'dark'
131
- ? theme.palette.primary.contrastText
132
- : theme.palette.getContrastText(theme.palette.background.paper),
133
- height: ICON.Height + 8,
134
- justifyContent: 'center',
135
- marginTop: '0 !important',
136
- minWidth: ICON.Width,
137
- width: ICON.Width
138
- },
139
- _b[theme.breakpoints.up('sm')] = {
140
- minWidth: ICON.Width + 8,
141
- width: ICON.Width + 8
142
- },
143
- _b);
144
- });
145
- export var ListItemText = styled(SSListItemText, {
146
- shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen' && prop !== 'index'; }
147
- })(function (_a) {
148
- var isDrawerOpen = _a.isDrawerOpen, index = _a.index;
149
- return ({
150
- opacity: isDrawerOpen ? 1 : 0,
151
- padding: '0.5rem',
152
- transition: "opacity 225ms ".concat(motion.easeInOut, " ").concat(index !== undefined ? index / 50 : 0.02, "s !important")
153
- });
154
- });
155
- export var DrawerToggle = styled(IconButton)(function (_a) {
156
- var _b;
157
- var theme = _a.theme;
158
- return (_b = {
159
- background: 'transparent',
160
- height: '44px',
161
- paddingLeft: theme.spacing(2),
162
- paddingRight: theme.spacing(2),
163
- position: 'fixed',
164
- top: '80.5px',
165
- transition: "all 225ms ".concat(motion.easeInOut, " 0ms !important"),
166
- width: '44px',
167
- zIndex: theme.zIndex.drawer + 1
168
- },
169
- _b[theme.breakpoints.up('sm')] = {
170
- paddingLeft: theme.spacing(2.5),
171
- paddingRight: theme.spacing(2.5),
172
- top: '88.5px'
173
- },
174
- _b);
175
- });
176
- export var DrawerToggleHitboxContent = styled('span')(function (_a) {
177
- var theme = _a.theme;
178
- return ({
179
- backgroundColor: theme.palette.mode === 'dark'
180
- ? theme.palette.primary.main
181
- : theme.palette.background.paper,
182
- borderRadius: '50%',
183
- boxShadow: '5px 0 15px 0 rgb(0 0 0 / 10%)',
184
- height: '1.75rem',
185
- padding: theme.spacing(0.5),
186
- width: '1.75rem'
187
- });
188
- });
189
- export var StyledAside = styled('aside')(function () { return ({}); });
190
- export var StyledNav = styled('nav')(function (_a) {
191
- var theme = _a.theme;
192
- return ({
193
- backgroundColor: theme.palette.mode === 'dark'
194
- ? theme.palette.primary.main
195
- : theme.palette.background.paper,
196
- display: 'flex',
197
- flex: '1 auto',
198
- flexDirection: 'column',
199
- justifyContent: 'flex-start',
200
- marginTop: '-1px',
201
- overflow: 'hidden'
202
- });
203
- });
55
+ })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n\n :before {\n background-color: ", ";\n border-radius: 55px;\n content: '';\n display: block;\n height: 2px;\n margin: auto;\n transition: all 225ms ", ";\n width: 66%;\n }\n"], ["\n background-color: ", ";\n\n :before {\n background-color: ", ";\n border-radius: 55px;\n content: '';\n display: block;\n height: 2px;\n margin: auto;\n transition: all 225ms ", ";\n width: 66%;\n }\n"])), function (props) { return props.theme.palette.mode === 'dark'
56
+ ? props.theme.palette.primary.main
57
+ : props.theme.palette.background.paper; }, function (props) {
58
+ return props.theme.palette.mode === 'dark'
59
+ ? 'rgba(255, 255, 255, 0.075)'
60
+ : 'rgba(0, 0, 0, 0.075)';
61
+ }, motion.easeIn);
204
62
  export var DrawerShadow = styled(Box, {
205
63
  shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen'; }
206
- })(function (_a) {
207
- var _b;
208
- var theme = _a.theme, isDrawerOpen = _a.isDrawerOpen;
209
- return (_b = {
210
- background: 'rgba(0,0,0,0.125)',
211
- content: '""',
212
- display: 'block',
213
- filter: 'blur(13px)',
214
- height: '100%',
215
- left: isDrawerOpen ? "".concat(DRAWER_WIDTH.Expanded - 38, "px") : "".concat(DRAWER_WIDTH.Collapsed - 41, "px"),
216
- position: 'fixed',
217
- top: '0',
218
- transition: "left 225ms ".concat(motion.easeInOut, " 0ms"),
219
- visibility: 'visible',
220
- width: '40px'
221
- },
222
- _b[theme.breakpoints.up('sm')] = {
223
- left: isDrawerOpen ? "".concat(DRAWER_WIDTH.Expanded - 38, "px") : "".concat(DRAWER_WIDTH.Collapsed - 33, "px")
224
- },
225
- _b);
226
- });
227
- export var NotchContainer = styled(Box)(function (_a) {
228
- var theme = _a.theme;
229
- return ({
230
- display: 'flex',
231
- justifyContent: 'flex-end',
232
- height: 'auto',
233
- marginTop: "-".concat(theme.spacing(0.5)),
234
- position: 'relative',
235
- transition: "width 225ms ".concat(motion.easeInOut, " 0ms !important"),
236
- width: '100%',
237
- zIndex: '-1'
238
- });
239
- });
240
- export var NotchBackground = styled(Box)(function (_a) {
241
- var theme = _a.theme;
242
- return ({
243
- backgroundColor: theme.palette.mode === 'dark'
244
- ? theme.palette.primary.main
245
- : theme.palette.background.paper,
246
- flex: '1',
247
- height: 'auto',
248
- width: 'auto'
249
- });
250
- });
251
- export var NotchBackgroundClip = styled(Box)(function (_a) {
252
- var theme = _a.theme;
253
- return ({
254
- backgroundColor: theme.palette.mode === 'dark'
255
- ? theme.palette.primary.main
256
- : theme.palette.background.paper,
257
- clipPath: 'url("#notch")',
258
- display: 'flex',
259
- height: '85px',
260
- width: '45px'
261
- });
262
- });
263
- export var NotchSeemMask = styled(Box)(function (_a) {
264
- var theme = _a.theme;
265
- return ({
266
- backgroundColor: theme.palette.mode === 'dark'
267
- ? theme.palette.primary.main
268
- : theme.palette.background.paper,
269
- height: '90px',
270
- position: 'absolute',
271
- right: '25px',
272
- top: '-2px',
273
- width: 'calc(100% - 25px)'
274
- });
64
+ })(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: rgba(0,0,0,0.125);\n content: '';\n display: block;\n filter: blur(13px);\n height: 100%;\n left: ", ";\n position: fixed;\n top: 0;\n transition: left 225ms ", " 0ms;\n visibility: visible;\n width: 40px;\n\n @media (min-width: ", ") {\n left: ", ";\n }\n"], ["\n background: rgba(0,0,0,0.125);\n content: '';\n display: block;\n filter: blur(13px);\n height: 100%;\n left: ", ";\n position: fixed;\n top: 0;\n transition: left 225ms ", " 0ms;\n visibility: visible;\n width: 40px;\n\n @media (min-width: ", ") {\n left: ", ";\n }\n"])), function (props) { return props.isDrawerOpen
65
+ ? "".concat(DRAWER_WIDTH.Expanded - 38, "px")
66
+ : "".concat(DRAWER_WIDTH.Collapsed - 41, "px"); }, motion.easeInOut, function (props) { return props.theme.breakpoints.values.sm; }, function (props) {
67
+ return props.isDrawerOpen
68
+ ? "".concat(DRAWER_WIDTH.Expanded - 38, "px")
69
+ : "".concat(DRAWER_WIDTH.Collapsed - 33, "px");
275
70
  });
71
+ export var NotchContainer = styled(Box)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n justify-content: flex-end;\n height: auto;\n margin-top: -", ";\n position: relative;\n transition: width 225ms ", " 0ms !important;\n width: 100%;\n z-index: 9;\n"], ["\n display: flex;\n justify-content: flex-end;\n height: auto;\n margin-top: -", ";\n position: relative;\n transition: width 225ms ", " 0ms !important;\n width: 100%;\n z-index: 9;\n"])), function (props) { return props.theme.spacing(0.5); }, motion.easeInOut);
72
+ export var NotchBackground = styled(Box)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background-color: ", ";\n flex: 1;\n height: auto;\n width: auto;\n"], ["\n background-color: ", ";\n flex: 1;\n height: auto;\n width: auto;\n"])), function (props) { return props.theme.palette.mode === 'dark'
73
+ ? props.theme.palette.primary.main
74
+ : props.theme.palette.background.paper; });
75
+ export var NotchBackgroundClip = styled(Box)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n background-color: ", ";\n clip-path: url(\"#notch\");\n display: flex;\n height: 85px;\n width: 45px;\n"], ["\n background-color: ", ";\n clip-path: url(\"#notch\");\n display: flex;\n height: 85px;\n width: 45px;\n"])), function (props) { return props.theme.palette.mode === 'dark'
76
+ ? props.theme.palette.primary.main
77
+ : props.theme.palette.background.paper; });
78
+ export var NotchSeemMask = styled(Box)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n background-color: ", ";\n height: 90px;\n position: absolute;\n right: 25px;\n top: -2px;\n width: calc(100% - 25px);\n"], ["\n background-color: ", ";\n height: 90px;\n position: absolute;\n right: 25px;\n top: -2px;\n width: calc(100% - 25px);\n"])), function (props) { return props.theme.palette.mode === 'dark'
79
+ ? props.theme.palette.primary.main
80
+ : props.theme.palette.background.paper; });
81
+ export var StyledDrawer = styled(Drawer, {
82
+ shouldForwardProp: function (prop) { return prop !== 'open'; }
83
+ })(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n box-shadow: none;\n box-sizing: border-box;\n flexshrink: 0;\n overflow-x: visible;\n transition: width 225ms ", " 0ms !important;\n white-space: nowrap;\n width: ", ";\n\n @media (min-width: ", ") {\n width: ", ";\n }\n\n .MuiDrawer-paper {\n background: transparent none;\n border: 0;\n box-shadow: none;\n color: ", ";\n overflow: visible !important;\n overflow-x: visible;\n transform: translateX(0) !important;\n transition: width 225ms ", " 0ms !important;\n visibility: visible;\n width: ", ";\n [theme.breakpoints.up('sm')] {\n width: ", ";\n }\n }\n"], ["\n box-shadow: none;\n box-sizing: border-box;\n flexshrink: 0;\n overflow-x: visible;\n transition: width 225ms ", " 0ms !important;\n white-space: nowrap;\n width: ", ";\n\n @media (min-width: ", ") {\n width: ", ";\n }\n\n .MuiDrawer-paper {\n background: transparent none;\n border: 0;\n box-shadow: none;\n color: ", ";\n overflow: visible !important;\n overflow-x: visible;\n transform: translateX(0) !important;\n transition: width 225ms ", " 0ms !important;\n visibility: visible;\n width: ", ";\n [theme.breakpoints.up('sm')] {\n width: ", ";\n }\n }\n"])), motion.easeInOut, function (props) { return !props.open ? "calc(".concat(props.theme.spacing(7), " + 1px)") : "".concat(DRAWER_WIDTH.Expanded, "px"); }, function (props) { return props.theme.breakpoints.values.sm; }, function (props) { return !props.open ? "calc(".concat(props.theme.spacing(8), " + 1px)") : "".concat(DRAWER_WIDTH.Expanded, "px"); }, function (props) {
84
+ return props.theme.palette.mode === 'dark'
85
+ ? props.theme.palette.primary.contrastText
86
+ : props.theme.palette.getContrastText(props.theme.palette.background.paper);
87
+ }, motion.easeInOut, function (props) { return !props.open ? "calc(".concat(props.theme.spacing(7), " + 1px)") : "".concat(DRAWER_WIDTH.Expanded, "px"); }, function (props) { return !props.open ? "calc(".concat(props.theme.spacing(8), " + 1px)") : "".concat(DRAWER_WIDTH.Expanded, "px"); });
88
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
package/index.d.ts CHANGED
@@ -128,4 +128,5 @@ export { default as List } from './components/datadisplay/List/List';
128
128
  export { default as Tooltip } from './components/datadisplay/Tooltip/Tooltip';
129
129
  export { default as SideInSide } from './components/pages/SideInSide/SideInSide';
130
130
  export { default as ErrorPage } from './components/pages/ErrorPage/ErrorPage';
131
+ export { default as MobileNavigation } from './components/navigation/MobileNavigation/MobileNavigation';
131
132
  export { default as VerticalNavigation } from './components/navigation/VerticalNavigation/VerticalNavigation';
package/index.js CHANGED
@@ -140,4 +140,5 @@ export { default as Tooltip } from './components/datadisplay/Tooltip/Tooltip';
140
140
  export { default as SideInSide } from './components/pages/SideInSide/SideInSide';
141
141
  export { default as ErrorPage } from './components/pages/ErrorPage/ErrorPage';
142
142
  // Stream Suite components
143
+ export { default as MobileNavigation } from './components/navigation/MobileNavigation/MobileNavigation';
143
144
  export { default as VerticalNavigation } from './components/navigation/VerticalNavigation/VerticalNavigation';
package/package.json CHANGED
@@ -9,14 +9,14 @@
9
9
  "components",
10
10
  "ui"
11
11
  ],
12
- "version": "1.6.0-beta.2",
12
+ "version": "1.6.0-beta.4",
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
- "@learningpool/app-switcher": "1.1.0-beta.2",
19
+ "@learningpool/app-switcher": "1.1.0-beta.4",
20
20
  "@mui/icons-material": "^5.8.4",
21
21
  "@mui/material": "^5.8.5",
22
22
  "@mui/x-data-grid": "^5.12.3",
@@ -28,6 +28,7 @@
28
28
  "anysort": "^2.0.0",
29
29
  "eslint-plugin-n": "^15.2.4",
30
30
  "focus-trap-react": "^8.11.0",
31
+ "framer-motion": "^6.5.1",
31
32
  "tss-react": "^3.3.6",
32
33
  "typescript": "^4.6.2",
33
34
  "web-vitals": "^2.1.4"
@@ -0,0 +1,5 @@
1
+ export declare const MOBILE_NAV_PANEL_TYPES: {
2
+ DRAWER: string;
3
+ SEARCH: string;
4
+ AVATAR: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ export var MOBILE_NAV_PANEL_TYPES = {
2
+ DRAWER: 'drawer',
3
+ SEARCH: 'search',
4
+ AVATAR: 'avatar'
5
+ };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Accepts a string and returns 2 characters (max) as initials e.g. AN from Avatar Name
3
+ * @param avatarName string - Expected full name but accepts any string
4
+ * @returns string
5
+ */
6
+ export declare const handleAvatarInitials: (avatarName: string) => string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Accepts a string and returns 2 characters (max) as initials e.g. AN from Avatar Name
3
+ * @param avatarName string - Expected full name but accepts any string
4
+ * @returns string
5
+ */
6
+ export var handleAvatarInitials = function (avatarName) {
7
+ var _a, _b;
8
+ var firstInitial = avatarName.split('')[0] || '';
9
+ var secondInitial = '';
10
+ if (((_a = avatarName.split(' ')) === null || _a === void 0 ? void 0 : _a.length) > 1) {
11
+ firstInitial = avatarName.split(' ')[0][0];
12
+ if (((_b = avatarName.split(' ')[1]) === null || _b === void 0 ? void 0 : _b.length) > 0) {
13
+ secondInitial = avatarName === null || avatarName === void 0 ? void 0 : avatarName.split(' ')[1][0];
14
+ }
15
+ }
16
+ return "".concat(firstInitial).concat(secondInitial);
17
+ };
@@ -0,0 +1 @@
1
+ export declare const useCurrentWidth: () => number;
package/utils/hooks.js ADDED
@@ -0,0 +1,29 @@
1
+ import { useState, useEffect } from 'react';
2
+ var getWidth = function () {
3
+ var _a, _b;
4
+ return (_b = (_a = window.innerWidth) !== null && _a !== void 0 ? _a : document.documentElement.clientWidth) !== null && _b !== void 0 ? _b : document.body.clientWidth;
5
+ };
6
+ export var useCurrentWidth = function () {
7
+ // save current window width in the state object
8
+ var _a = useState(getWidth()), width = _a[0], setWidth = _a[1];
9
+ // in this case useEffect will execute only once because
10
+ // it does not have any dependencies.
11
+ useEffect(function () {
12
+ // timeoutId for debounce mechanism
13
+ var timeoutId;
14
+ var resizeListener = function () {
15
+ // prevent execution of previous setTimeout
16
+ clearTimeout(timeoutId);
17
+ // change width from the state object after 150 milliseconds
18
+ timeoutId = setTimeout(function () { return setWidth(getWidth()); }, 150);
19
+ };
20
+ // set resize listener
21
+ window.addEventListener('resize', resizeListener);
22
+ // clean up function
23
+ return function () {
24
+ // remove resize listener
25
+ window.removeEventListener('resize', resizeListener);
26
+ };
27
+ }, []);
28
+ return width;
29
+ };
package/utils/theme.d.ts CHANGED
@@ -87,3 +87,7 @@ export declare const motion: {
87
87
  easeIn: string;
88
88
  easeInOut: string;
89
89
  };
90
+ export declare const tooltipDelay: {
91
+ start: number;
92
+ end: number;
93
+ };
package/utils/theme.js CHANGED
@@ -59,3 +59,7 @@ export var motion = {
59
59
  easeIn: 'cubic-bezier(0.4, 0.0, 1, 1)',
60
60
  easeInOut: 'cubic-bezier(0.4, 0.0, 0.6, 1)'
61
61
  };
62
+ export var tooltipDelay = {
63
+ start: 500,
64
+ end: 200
65
+ };