@learningpool/ui 1.15.5 → 1.16.1

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 (84) hide show
  1. package/assets/Images.js +7 -18
  2. package/components/atoms/Autocomplete/Autocomplete.js +3 -14
  3. package/components/atoms/Button/Button.js +2 -13
  4. package/components/atoms/Checkbox/Checkbox.js +3 -26
  5. package/components/atoms/IconButton/IconButton.js +2 -13
  6. package/components/atoms/Radio/Radio.js +3 -26
  7. package/components/atoms/Select/Select.js +3 -26
  8. package/components/atoms/Slider/Slider.js +3 -26
  9. package/components/atoms/Switch/Switch.js +3 -26
  10. package/components/atoms/TextField/TextField.js +2 -13
  11. package/components/atoms/ToggleButton/ToggleButton.js +3 -26
  12. package/components/datadisplay/Avatar/Avatar.js +13 -28
  13. package/components/datadisplay/Chip/Chip.js +3 -26
  14. package/components/datadisplay/List/List.js +2 -13
  15. package/components/feedback/Alert/Alert.js +3 -26
  16. package/components/landmarks/Header/Header.js +15 -41
  17. package/components/landmarks/Header/HeaderActionButtons.d.ts +1 -2
  18. package/components/landmarks/Header/HeaderActionButtons.js +22 -33
  19. package/components/landmarks/Header/HeaderStyles.js +54 -11
  20. package/components/navigation/Drawer/Drawer.js +5 -31
  21. package/components/navigation/MobileNavigation/MobileNavigation.js +70 -82
  22. package/components/navigation/MobileNavigation/MobileNavigationAvatar.js +75 -83
  23. package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.d.ts +102 -52
  24. package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +71 -13
  25. package/components/navigation/MobileNavigation/MobileNavigationDrawer.d.ts +1 -1
  26. package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +41 -68
  27. package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +34 -18
  28. package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +133 -20
  29. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +22 -45
  30. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenu.js +8 -19
  31. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemFlyoutMenuStyles.js +151 -52
  32. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +171 -50
  33. package/components/navigation/MobileNavigation/MobileNavigationMotion.js +11 -11
  34. package/components/navigation/MobileNavigation/MobileNavigationNotchIndicator.js +11 -15
  35. package/components/navigation/MobileNavigation/MobileNavigationSearch.d.ts +1 -2
  36. package/components/navigation/MobileNavigation/MobileNavigationSearch.js +25 -34
  37. package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.d.ts +34 -18
  38. package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.js +47 -9
  39. package/components/navigation/MobileNavigation/MobileNavigationStyles.js +262 -66
  40. package/components/navigation/MobileNavigation/MobileNavigationToggleSearchX.js +21 -20
  41. package/components/navigation/MobileNavigation/MobileNavigationToggleX.js +21 -20
  42. package/components/navigation/VerticalNavigation/VerticalNavigation.js +150 -185
  43. package/components/navigation/VerticalNavigation/VerticalNavigationAvatar.js +50 -61
  44. package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.d.ts +102 -52
  45. package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +86 -14
  46. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +27 -51
  47. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +15 -28
  48. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +135 -39
  49. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +167 -29
  50. package/components/navigation/VerticalNavigation/VerticalNavigationMotion.js +11 -11
  51. package/components/navigation/VerticalNavigation/VerticalNavigationStyles.d.ts +34 -18
  52. package/components/navigation/VerticalNavigation/VerticalNavigationStyles.js +236 -42
  53. package/components/navigation/helpers.d.ts +1 -2
  54. package/components/navigation/helpers.js +28 -32
  55. package/components/pages/ErrorPage/ErrorPage.js +6 -17
  56. package/components/pages/ErrorPage/ErrorPageStyles.js +13 -18
  57. package/components/pages/SideInSide/SideInSide.js +12 -23
  58. package/components/pages/SideInSide/SideInSideStyles.js +6 -6
  59. package/components/stream/AppHub/AppHub.js +13 -42
  60. package/components/stream/AppHub/AppHubAdvertStyles.js +24 -8
  61. package/components/stream/AppHub/AppHubBannerAdvert.d.ts +1 -2
  62. package/components/stream/AppHub/AppHubBannerAdvert.js +9 -20
  63. package/components/stream/AppHub/AppHubCustom.js +8 -19
  64. package/components/stream/AppHub/AppHubCustomStyles.d.ts +1 -1
  65. package/components/stream/AppHub/AppHubCustomStyles.js +78 -18
  66. package/components/stream/AppHub/AppHubProduct.js +26 -48
  67. package/components/stream/AppHub/AppHubProductStyles.js +104 -19
  68. package/components/stream/AppHub/AppHubStyles.js +31 -11
  69. package/components/stream/AppHub/constants.d.ts +1 -2
  70. package/components/stream/AppHub/constants.js +14 -14
  71. package/components/stream/AppSwitcher/AppSwitcher.js +225 -316
  72. package/components/stream/AppSwitcher/AppSwitcherItem.js +11 -22
  73. package/components/stream/AppSwitcher/AppSwitcherStyles.js +337 -42
  74. package/components/stream/AppSwitcher/AppSwitcherStylesStandalone.js +255 -21
  75. package/components/stream/AppSwitcher/PromotionalCampaignItem.js +7 -19
  76. package/components/stream/AppSwitcher/constants.js +3 -3
  77. package/lang/en-us.js +1 -1
  78. package/package.json +7 -2
  79. package/utils/constants.d.ts +7 -0
  80. package/utils/constants.js +11 -4
  81. package/utils/dataAttributes.js +1 -1
  82. package/utils/helpers.js +33 -40
  83. package/utils/hooks.js +10 -11
  84. package/utils/theme.js +26 -19
@@ -1,20 +1,92 @@
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 { Avatar, Button, ButtonGroup, ListItemButton, Typography } from '../../../index';
7
3
  import Drawer from '@mui/material/Drawer';
8
4
  import { styled } from '@mui/material/styles';
9
5
  import { animated } from '@react-spring/web';
10
6
  import { getNavigationBackground, getNavigationContrastText, getOffsetNavigationBackground, getOffsetNavigationContrastText } from '../helpers';
11
- export var StyledSwipeableAvatar = styled(Drawer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .MuiPaper-root {\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"], ["\n .MuiPaper-root {\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"])));
12
- export var StyledButton = styled(Button)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n /* Fix for RTL issue */\n .MuiButton-startIcon {\n margin-inline-start: -", ";\n margin-inline-end: ", ";\n }\n\n .MuiButton-endIcon {\n margin-inline-start: ", ";\n margin-inline-end: -", ";\n }\n"], ["\n /* Fix for RTL issue */\n .MuiButton-startIcon {\n margin-inline-start: -", ";\n margin-inline-end: ", ";\n }\n\n .MuiButton-endIcon {\n margin-inline-start: ", ";\n margin-inline-end: -", ";\n }\n"])), function (props) { return props.theme.spacing(0.5); }, function (props) { return props.theme.spacing(1); }, function (props) { return props.theme.spacing(1); }, function (props) { return props.theme.spacing(0.5); });
13
- export var StyledBox = styled(animated.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n align-items: center;\n background-color: ", ";\n color: ", ";\n display: flex;\n flex-direction: column;\n font-family: ", ";\n height: 100%;\n justify-content: flex-start;\n overflow: auto;\n padding: 15vh ", ";\n position: relative;\n"], ["\n align-items: center;\n background-color: ", ";\n color: ", ";\n display: flex;\n flex-direction: column;\n font-family: ", ";\n height: 100%;\n justify-content: flex-start;\n overflow: auto;\n padding: 15vh ", ";\n position: relative;\n"])), function (props) { return getOffsetNavigationBackground(props.theme); }, function (props) { var _a; return ((_a = props.theme.palette.navigation) === null || _a === void 0 ? void 0 : _a.contrastText) || getOffsetNavigationContrastText(props.theme); }, function (props) { return props.theme.typography.fontFamily; }, function (props) { return props.theme.spacing(2); });
14
- export var StyledBoxProfile = styled(animated.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 2rem;\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 2rem;\n"])));
15
- export var StyledBoxProfileEdit = styled(animated.div)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
16
- export var StyledAvatarName = styled(Typography)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-size: 1.75rem;\n"], ["\n font-size: 1.75rem;\n"])));
17
- export var StyledButtonGroup = styled(ButtonGroup)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n /* Fix for RTL issue */\n .MuiButtonGroup-grouped:not(:first-of-type) {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n }\n\n .MuiButtonGroup-grouped:not(:last-of-type) {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n border-style: solid;\n }\n"], ["\n /* Fix for RTL issue */\n .MuiButtonGroup-grouped:not(:first-of-type) {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n }\n\n .MuiButtonGroup-grouped:not(:last-of-type) {\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n border-style: solid;\n }\n"])), function (props) { return props.theme.direction === 'ltr' ? 0 : "".concat(props.theme.shape.borderRadius, "px"); }, function (props) { return props.theme.direction === 'ltr' ? "".concat(props.theme.shape.borderRadius, "px") : 0; }, function (props) { return props.theme.direction === 'ltr' ? 0 : "".concat(props.theme.shape.borderRadius, "px"); }, function (props) { return props.theme.direction === 'ltr' ? "".concat(props.theme.shape.borderRadius, "px") : 0; }, function (props) { return props.theme.direction === 'ltr' ? "".concat(props.theme.shape.borderRadius, "px") : 0; }, function (props) { return props.theme.direction === 'ltr' ? 0 : "".concat(props.theme.shape.borderRadius, "px"); }, function (props) { return props.theme.direction === 'ltr' ? "".concat(props.theme.shape.borderRadius, "px") : 0; }, function (props) { return props.theme.direction === 'ltr' ? 0 : "".concat(props.theme.shape.borderRadius, "px"); });
18
- export var StyledAvatar = styled(Avatar)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n font-size: 0.85rem;\n"], ["\n background-color: ", ";\n color: ", ";\n font-size: 0.85rem;\n"])), function (props) { return getNavigationBackground(props.theme); }, function (props) { return getNavigationContrastText(props.theme); });
19
- export var StyledListItemButton = styled(ListItemButton)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n border-radius: 50px;\n white-space: normal;\n box-shadow: 0 0 0 0 transparent;\n transition: all 0.2s ease;\n\n & .MuiListItemIcon-root {\n color: ", ";\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n }\n\n :focus-visible {\n background-color: ", ";\n box-shadow: 0 0 0 3px ", ";\n }\n"], ["\n border-radius: 50px;\n white-space: normal;\n box-shadow: 0 0 0 0 transparent;\n transition: all 0.2s ease;\n\n & .MuiListItemIcon-root {\n color: ", ";\n }\n\n :hover {\n color: ", ";\n background-color: ", ";\n }\n\n :focus-visible {\n background-color: ", ";\n box-shadow: 0 0 0 3px ", ";\n }\n"])), function (props) { var _a; return ((_a = props.theme.palette.navigation) === null || _a === void 0 ? void 0 : _a.contrastText) || getOffsetNavigationContrastText(props.theme); }, function (props) { return getOffsetNavigationContrastText(props.theme, 0.15); }, function (props) { return getOffsetNavigationBackground(props.theme, 0.15); }, function (props) { return getOffsetNavigationBackground(props.theme, 0.133); }, function (props) { return getOffsetNavigationContrastText(props.theme, 0.133); });
20
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
7
+ export const StyledSwipeableAvatar = styled(Drawer) `
8
+ .MuiPaper-root {
9
+ height: 100vh;
10
+ border: none;
11
+ z-index: 1;
12
+ }
13
+ `;
14
+ export const StyledButton = styled(Button) `
15
+ /* Fix for RTL issue */
16
+ .MuiButton-startIcon {
17
+ margin-inline-start: -${props => props.theme.spacing(0.5)};
18
+ margin-inline-end: ${props => props.theme.spacing(1)};
19
+ }
20
+
21
+ .MuiButton-endIcon {
22
+ margin-inline-start: ${props => props.theme.spacing(1)};
23
+ margin-inline-end: -${props => props.theme.spacing(0.5)};
24
+ }
25
+ `;
26
+ export const StyledBox = styled(animated.div) `
27
+ align-items: center;
28
+ background-color: ${props => getOffsetNavigationBackground(props.theme)};
29
+ color: ${props => props.theme.palette.navigation?.contrastText || getOffsetNavigationContrastText(props.theme)};
30
+ display: flex;
31
+ flex-direction: column;
32
+ font-family: ${props => props.theme.typography.fontFamily};
33
+ height: 100%;
34
+ justify-content: flex-start;
35
+ overflow: auto;
36
+ padding: 15vh ${props => props.theme.spacing(2)};
37
+ position: relative;
38
+ `;
39
+ export const StyledBoxProfile = styled(animated.div) `
40
+ display: flex;
41
+ flex-direction: row;
42
+ align-items: center;
43
+ margin-bottom: 2rem;
44
+ `;
45
+ export const StyledBoxProfileEdit = styled(animated.div) `
46
+ display: flex;
47
+ `;
48
+ export const StyledAvatarName = styled(Typography) `
49
+ font-size: 1.75rem;
50
+ `;
51
+ export const StyledButtonGroup = styled(ButtonGroup) `
52
+ /* Fix for RTL issue */
53
+ .MuiButtonGroup-grouped:not(:first-of-type) {
54
+ border-bottom-left-radius: ${props => props.theme.direction === 'ltr' ? 0 : `${props.theme.shape.borderRadius}px`};
55
+ border-bottom-right-radius: ${props => props.theme.direction === 'ltr' ? `${props.theme.shape.borderRadius}px` : 0};
56
+ border-top-left-radius: ${props => props.theme.direction === 'ltr' ? 0 : `${props.theme.shape.borderRadius}px`};
57
+ border-top-right-radius: ${props => props.theme.direction === 'ltr' ? `${props.theme.shape.borderRadius}px` : 0};
58
+ }
59
+
60
+ .MuiButtonGroup-grouped:not(:last-of-type) {
61
+ border-bottom-left-radius: ${props => props.theme.direction === 'ltr' ? `${props.theme.shape.borderRadius}px` : 0};
62
+ border-bottom-right-radius: ${props => props.theme.direction === 'ltr' ? 0 : `${props.theme.shape.borderRadius}px`};
63
+ border-top-left-radius: ${props => props.theme.direction === 'ltr' ? `${props.theme.shape.borderRadius}px` : 0};
64
+ border-top-right-radius: ${props => props.theme.direction === 'ltr' ? 0 : `${props.theme.shape.borderRadius}px`};
65
+ border-style: solid;
66
+ }
67
+ `;
68
+ export const StyledAvatar = styled(Avatar) `
69
+ background-color: ${props => getNavigationBackground(props.theme)};
70
+ color: ${props => getNavigationContrastText(props.theme)};
71
+ font-size: 0.85rem;
72
+ `;
73
+ export const StyledListItemButton = styled(ListItemButton) `
74
+ border-radius: 50px;
75
+ white-space: normal;
76
+ box-shadow: 0 0 0 0 transparent;
77
+ transition: all 0.2s ease;
78
+
79
+ & .MuiListItemIcon-root {
80
+ color: ${props => props.theme.palette.navigation?.contrastText || getOffsetNavigationContrastText(props.theme)};
81
+ }
82
+
83
+ :hover {
84
+ color: ${props => getOffsetNavigationContrastText(props.theme, 0.15)};
85
+ background-color: ${props => getOffsetNavigationBackground(props.theme, 0.15)};
86
+ }
87
+
88
+ :focus-visible {
89
+ background-color: ${props => getOffsetNavigationBackground(props.theme, 0.133)};
90
+ box-shadow: 0 0 0 3px ${props => getOffsetNavigationContrastText(props.theme, 0.133)};
91
+ }
92
+ `;
@@ -1,26 +1,4 @@
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
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
24
2
  import React, { useEffect } from 'react';
25
3
  import { useTheme } from '@mui/material/styles';
26
4
  import { Link, List, Tooltip, Collapse } from '../../../../index';
@@ -29,31 +7,30 @@ import { ListItem, ListItemButton, ListItemButtonChild, ListItemIcon, ListItemTe
29
7
  import { tooltipDelay } from '../../../../utils/theme';
30
8
  import VerticalNavigationItemFlyoutMenu from './VerticalNavigationItemFlyoutMenu';
31
9
  import { animated } from '@react-spring/web';
32
- var VerticalNavigationItem = function (props) {
33
- var _a, _b, _c;
34
- var theme = useTheme();
35
- var label = props.label, icon = props.icon, onClick = props.onClick, isActive = props.isActive, children = props.children, isDrawerOpen = props.isDrawerOpen, index = props.index, hasFlyout = props.hasFlyout, fullHeightFlyout = props.fullHeightFlyout, isSecondary = props.isSecondary, isContentOpen = props.isContentOpen, content = props.content, style = props.style, hasCustomContent = props.hasCustomContent, id = props.id, rest = __rest(props, ["label", "icon", "onClick", "isActive", "children", "isDrawerOpen", "index", "hasFlyout", "fullHeightFlyout", "isSecondary", "isContentOpen", "content", "style", "hasCustomContent", "id"]);
36
- var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
37
- var _e = React.useState(false), isFlyoutHovered = _e[0], setIsFlyoutHovered = _e[1];
38
- var open = isFlyoutHovered || Boolean(anchorEl);
39
- useEffect(function () {
10
+ const VerticalNavigationItem = (props) => {
11
+ const theme = useTheme();
12
+ const { label, icon, onClick, isActive, children, isDrawerOpen, index, hasFlyout, fullHeightFlyout, isSecondary, isContentOpen, content, style, hasCustomContent, id, ...rest } = props;
13
+ const [anchorEl, setAnchorEl] = React.useState(null);
14
+ const [isFlyoutHovered, setIsFlyoutHovered] = React.useState(false);
15
+ const open = isFlyoutHovered || Boolean(anchorEl);
16
+ useEffect(() => {
40
17
  if (!isContentOpen && open) {
41
18
  handlePopoverClose();
42
19
  }
43
20
  }, [isContentOpen]);
44
- var handlePopoverOpen = function (event) {
21
+ const handlePopoverOpen = (event) => {
45
22
  if (open) {
46
23
  handlePopoverClose();
47
24
  return;
48
25
  }
49
26
  if (!isDrawerOpen || fullHeightFlyout) {
50
- setAnchorEl(event === null || event === void 0 ? void 0 : event.currentTarget);
27
+ setAnchorEl(event?.currentTarget);
51
28
  }
52
29
  };
53
- var handlePopoverClose = function () {
30
+ const handlePopoverClose = () => {
54
31
  setAnchorEl(null);
55
32
  };
56
- var handleClick = function (event) {
33
+ const handleClick = (event) => {
57
34
  if ((children && children.length > 0) || fullHeightFlyout || hasCustomContent) {
58
35
  handlePopoverOpen(event);
59
36
  onClick && onClick(event);
@@ -70,7 +47,7 @@ var VerticalNavigationItem = function (props) {
70
47
  // Set open to false / Close sub menu
71
48
  setAnchorEl(null);
72
49
  };
73
- var handleChildItemClick = function (event, item) {
50
+ const handleChildItemClick = (event, item) => {
74
51
  if (!event) {
75
52
  return;
76
53
  }
@@ -79,20 +56,19 @@ var VerticalNavigationItem = function (props) {
79
56
  item.onClick(event);
80
57
  }
81
58
  };
82
- var ref = React.useRef(null);
83
- var flyoutRef = React.useRef(null);
84
- var handleKeyDown = function (event) {
59
+ const ref = React.useRef(null);
60
+ const flyoutRef = React.useRef(null);
61
+ const handleKeyDown = (event) => {
85
62
  if (!event) {
86
63
  return;
87
64
  }
88
65
  // This should only be triggered for items with a sub nav
89
66
  if (flyoutRef && flyoutRef.current) {
90
- var CLOSE_SUBMENU_DELAY = 200;
67
+ const CLOSE_SUBMENU_DELAY = 200;
91
68
  if (event.type === 'blur') {
92
- setTimeout(function () {
93
- var _a;
69
+ setTimeout(() => {
94
70
  // @ts-expect-error
95
- var isMenuFocus = ((_a = flyoutRef.current) === null || _a === void 0 ? void 0 : _a.contains(window.document.activeElement)) || ref.current === window.document.activeElement;
71
+ const isMenuFocus = flyoutRef.current?.contains(window.document.activeElement) || ref.current === window.document.activeElement;
96
72
  if (!isMenuFocus) {
97
73
  handlePopoverClose();
98
74
  }
@@ -100,22 +76,22 @@ var VerticalNavigationItem = function (props) {
100
76
  }
101
77
  }
102
78
  };
103
- return (_jsxs(ListItem, __assign({ disablePadding: true,
79
+ return (_jsxs(ListItem, { disablePadding: true,
104
80
  // @ts-expect-error
105
- component: animated.li, style: style }, rest, { isDrawerOpen: isDrawerOpen }, { children: [_jsxs(ListItemButton, __assign({ ref: ref, id: id,
81
+ component: animated.li, style: style, ...rest, isDrawerOpen: isDrawerOpen, children: [_jsxs(ListItemButton, { ref: ref, id: id,
106
82
  // @ts-expect-error
107
- component: Link, onClick: handleClick, isDrawerOpen: isDrawerOpen, onMouseEnter: function (event) { return (hasCustomContent || fullHeightFlyout || isDrawerOpen)
83
+ component: Link, onClick: handleClick, isDrawerOpen: isDrawerOpen, onMouseEnter: event => (hasCustomContent || fullHeightFlyout || isDrawerOpen)
108
84
  ? null
109
- : handlePopoverOpen(event); }, onMouseLeave: function () { return (hasCustomContent || fullHeightFlyout || isDrawerOpen)
85
+ : handlePopoverOpen(event), onMouseLeave: () => (hasCustomContent || fullHeightFlyout || isDrawerOpen)
110
86
  ? null
111
- : handlePopoverClose(); }, onFocus: function (event) { return handleKeyDown(event); }, onBlur: function (event) { return handleKeyDown(event); }, "aria-current": isActive ? 'page' : null, "aria-expanded": (children && children.length > 0) || fullHeightFlyout || hasCustomContent ? open : null, role: (children && children.length > 0) || fullHeightFlyout || hasCustomContent ? 'button' : 'link' }, { children: [_jsx(Tooltip, __assign({ disableHoverListener: (_a = (children && children.length > 0)) !== null && _a !== void 0 ? _a : isDrawerOpen, disableFocusListener: (_b = (children && children.length > 0)) !== null && _b !== void 0 ? _b : isDrawerOpen, disableTouchListener: (_c = (children && children.length > 0)) !== null && _c !== void 0 ? _c : isDrawerOpen, title: label, placement: theme.direction === 'rtl' ? 'left' : 'right', enterDelay: tooltipDelay.start, leaveDelay: tooltipDelay.end }, { children: _jsx(ListItemIcon, __assign({ "aria-hidden": true }, { children: icon !== null && icon !== void 0 ? icon : _jsx(MailIcon, {}) })) })), _jsx(ListItemText, { primary: label, isDrawerOpen: isDrawerOpen, index: index })] }), label), children && children.length > 0 && isDrawerOpen && (_jsx(Collapse, __assign({ component: 'div', in: isDrawerOpen }, { children: _jsx(List, __assign({ "aria-label": label, disablePadding: true }, { children: children.map(function (childItem, index) { return (_jsx(ListItem, __assign({ disablePadding: true, isDrawerOpen: isDrawerOpen }, { children: _jsxs(ListItemButtonChild
87
+ : handlePopoverClose(), onFocus: event => handleKeyDown(event), onBlur: event => handleKeyDown(event), "aria-current": isActive ? 'page' : null, "aria-expanded": (children && children.length > 0) || fullHeightFlyout || hasCustomContent ? open : null, role: (children && children.length > 0) || fullHeightFlyout || hasCustomContent ? 'button' : 'link', children: [_jsx(Tooltip, { disableHoverListener: (children && children.length > 0) ?? isDrawerOpen, disableFocusListener: (children && children.length > 0) ?? isDrawerOpen, disableTouchListener: (children && children.length > 0) ?? isDrawerOpen, title: label, placement: theme.direction === 'rtl' ? 'left' : 'right', enterDelay: tooltipDelay.start, leaveDelay: tooltipDelay.end, children: _jsx(ListItemIcon, { "aria-hidden": true, children: icon ?? _jsx(MailIcon, {}) }) }), _jsx(ListItemText, { primary: label, isDrawerOpen: isDrawerOpen, index: index })] }, label), children && children.length > 0 && isDrawerOpen && (_jsx(Collapse, { component: 'div', in: isDrawerOpen, children: _jsx(List, { "aria-label": label, disablePadding: true, children: children.map((childItem, index) => (_jsx(ListItem, { disablePadding: true, isDrawerOpen: isDrawerOpen, children: _jsxs(ListItemButtonChild
112
88
  // @ts-expect-error
113
- , __assign({
89
+ , {
114
90
  // @ts-expect-error
115
- component: Link, role: 'link', index: index, isDrawerOpen: isDrawerOpen, onClick: function (event) { return handleChildItemClick(event, childItem); } }, { children: [_jsx(ListItemIcon, { children: childItem.icon }), _jsx(ListItemText, { primary: childItem.label, isDrawerOpen: isDrawerOpen, sx: {
91
+ component: Link, role: 'link', index: index, isDrawerOpen: isDrawerOpen, onClick: event => handleChildItemClick(event, childItem), children: [_jsx(ListItemIcon, { children: childItem.icon }), _jsx(ListItemText, { primary: childItem.label, isDrawerOpen: isDrawerOpen, sx: {
116
92
  '& .MuiTypography-root': {
117
93
  fontSize: '14px !important'
118
94
  }
119
- } })] }), label) }), "".concat(childItem.label, " - ").concat(index))); }) })) }))), hasCustomContent && content, !fullHeightFlyout && children && children.length > 0 && !isDrawerOpen && (_jsx(VerticalNavigationItemFlyoutMenu, { ref: flyoutRef, isDrawerOpen: isDrawerOpen, anchorEl: anchorEl, setAnchorEl: setAnchorEl, parentItemRef: ref.current, open: open, children: children, label: label, setIsFlyoutHovered: setIsFlyoutHovered })), fullHeightFlyout && content && (_jsx(VerticalNavigationItemFlyoutMenu, { isDrawerOpen: isDrawerOpen, fullHeightFlyout: true, anchorEl: anchorEl, open: open, content: content }))] })));
95
+ } })] }, label) }, `${childItem.label} - ${index}`))) }) })), hasCustomContent && content, !fullHeightFlyout && children && children.length > 0 && !isDrawerOpen && (_jsx(VerticalNavigationItemFlyoutMenu, { ref: flyoutRef, isDrawerOpen: isDrawerOpen, anchorEl: anchorEl, setAnchorEl: setAnchorEl, parentItemRef: ref.current, open: open, children: children, label: label, setIsFlyoutHovered: setIsFlyoutHovered })), fullHeightFlyout && content && (_jsx(VerticalNavigationItemFlyoutMenu, { isDrawerOpen: isDrawerOpen, fullHeightFlyout: true, anchorEl: anchorEl, open: open, content: content }))] }));
120
96
  };
121
97
  export default VerticalNavigationItem;
@@ -1,51 +1,38 @@
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
- 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 { forwardRef } from 'react';
14
3
  import { Link } from '../../../../index';
15
4
  import { FullHeightFlyoutMenuPaper, FullHeightFlyoutMenuWrapper, FlyoutNotchMask, NotchMini, FlyoutMenuHeader, FlyoutMenuPaper, FlyoutMenuWrap, FlyoutMenuList, FlyoutMenuButton, FlyoutMenuItem, FlyoutMenuItemText } from './VerticalNavigationItemFlyoutMenuStyles';
16
5
  import { defaultAttributes } from '../../../../utils/dataAttributes';
17
- var VerticalNavigationItemFlyoutMenu = forwardRef(function (props, ref) {
18
- var _a;
19
- var label = props.label, children = props.children, isDrawerOpen = props.isDrawerOpen, fullHeightFlyout = props.fullHeightFlyout, open = props.open, parentItemRef = props.parentItemRef, dataAttributes = props.dataAttributes, content = props.content, anchorEl = props.anchorEl, setAnchorEl = props.setAnchorEl, setIsFlyoutHovered = props.setIsFlyoutHovered;
20
- var dataIds = __assign(__assign({}, defaultAttributes), dataAttributes);
6
+ const VerticalNavigationItemFlyoutMenu = forwardRef((props, ref) => {
7
+ const { label, children, isDrawerOpen, fullHeightFlyout, open, parentItemRef, dataAttributes, content, anchorEl, setAnchorEl, setIsFlyoutHovered } = props;
8
+ const dataIds = { ...defaultAttributes, ...dataAttributes };
21
9
  if (fullHeightFlyout && content) {
22
- return (_jsx(FullHeightFlyoutMenuPaper, __assign({ isDrawerOpen: isDrawerOpen, open: open, id: "avatar-panel", "data-id": dataIds.VerticalNavigationAvatarPanel }, { children: _jsxs(FullHeightFlyoutMenuWrapper, __assign({ open: open }, { children: [_jsx(FlyoutNotchMask, {}), _jsx(NotchMini, { tabIndex: -1, style: { bottom: '24px' } }), content] })) })));
10
+ return (_jsx(FullHeightFlyoutMenuPaper, { isDrawerOpen: isDrawerOpen, open: open, id: "avatar-panel", "data-id": dataIds.VerticalNavigationAvatarPanel, children: _jsxs(FullHeightFlyoutMenuWrapper, { open: open, children: [_jsx(FlyoutNotchMask, {}), _jsx(NotchMini, { tabIndex: -1, style: { bottom: '24px' } }), content] }) }));
23
11
  }
24
- var handleKeyDown = function (event) {
12
+ const handleKeyDown = (event) => {
25
13
  if (!event) {
26
14
  return;
27
15
  }
28
- var CLOSE_SUBMENU_DELAY = 200;
16
+ const CLOSE_SUBMENU_DELAY = 200;
29
17
  if (event.type === 'blur') {
30
- setTimeout(function () {
31
- var _a;
32
- var isMenuFocus = ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(window.document.activeElement)) || parentItemRef.current === window.document.activeElement;
18
+ setTimeout(() => {
19
+ const isMenuFocus = ref?.current?.contains(window.document.activeElement) || parentItemRef.current === window.document.activeElement;
33
20
  if (!isMenuFocus) {
34
21
  setAnchorEl(null);
35
22
  }
36
23
  }, CLOSE_SUBMENU_DELAY);
37
24
  }
38
25
  };
39
- var isBottomHalfOfScreen = ((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().y) > window.innerHeight / 2;
40
- return (_jsx(FlyoutMenuPaper, __assign({ ref: ref, "data-id": dataIds.VerticalNavigationFlyout, isDrawerOpen: isDrawerOpen, open: open, anchorEl: anchorEl !== null && anchorEl !== void 0 ? anchorEl : undefined, onMouseEnter: function () { return setIsFlyoutHovered(true); }, onMouseLeave: function () { return setIsFlyoutHovered(false); }, onFocus: function () { return setIsFlyoutHovered(true); }, onBlur: function () { return setIsFlyoutHovered(false); }, sx: {
26
+ const isBottomHalfOfScreen = ref?.current?.getBoundingClientRect().y > window.innerHeight / 2;
27
+ return (_jsx(FlyoutMenuPaper, { ref: ref, "data-id": dataIds.VerticalNavigationFlyout, isDrawerOpen: isDrawerOpen, open: open, anchorEl: anchorEl ?? undefined, onMouseEnter: () => setIsFlyoutHovered(true), onMouseLeave: () => setIsFlyoutHovered(false), onFocus: () => setIsFlyoutHovered(true), onBlur: () => setIsFlyoutHovered(false), sx: {
41
28
  transform: isBottomHalfOfScreen ? 'translateY(calc(-100% + 48px))' : ''
42
- } }, { children: _jsxs(FlyoutMenuWrap, __assign({ open: open }, { children: [_jsx(NotchMini, { sx: {
29
+ }, children: _jsxs(FlyoutMenuWrap, { open: open, children: [_jsx(NotchMini, { sx: {
43
30
  bottom: isBottomHalfOfScreen ? '12px' : 'auto',
44
31
  top: isBottomHalfOfScreen ? 'auto' : '12px'
45
- } }), _jsx(FlyoutMenuHeader, { children: label }), _jsx(FlyoutMenuList, __assign({ "data-id": dataIds.VerticalNavigationFlyoutList, "aria-label": label, open: open }, { children: children === null || children === void 0 ? void 0 : children.map(function (childItem, index) { return (_jsx(FlyoutMenuItem, __assign({ "data-id": dataIds.VerticalNavigationFlyoutListItem }, { children: _jsx(FlyoutMenuButton
32
+ } }), _jsx(FlyoutMenuHeader, { children: label }), _jsx(FlyoutMenuList, { "data-id": dataIds.VerticalNavigationFlyoutList, "aria-label": label, open: open, children: children?.map((childItem, index) => (_jsx(FlyoutMenuItem, { "data-id": dataIds.VerticalNavigationFlyoutListItem, children: _jsx(FlyoutMenuButton
46
33
  // @ts-expect-error
47
- , __assign({
34
+ , {
48
35
  // @ts-expect-error
49
- component: Link, role: 'link', onClick: childItem.onClick, onFocus: function (event) { return handleKeyDown(event); }, onBlur: function (event) { return handleKeyDown(event); } }, { children: _jsx(FlyoutMenuItemText, { primary: childItem.label }) }), childItem.label) }), "".concat(childItem.label, " - ").concat(index))); }) }))] })) })));
36
+ component: Link, role: 'link', onClick: childItem.onClick, onFocus: event => handleKeyDown(event), onBlur: event => handleKeyDown(event), children: _jsx(FlyoutMenuItemText, { primary: childItem.label }) }, childItem.label) }, `${childItem.label} - ${index}`))) })] }) }));
50
37
  });
51
38
  export default VerticalNavigationItemFlyoutMenu;
@@ -1,48 +1,144 @@
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 { List, ListItem, ListItemButton as SSListItemButton, Paper, Typography, ListItemText } from '../../../../index';
7
3
  import { styled } from '@mui/material/styles';
8
4
  import { NotchMiniSVG } from '../../../../assets/Images';
9
5
  import { getOffsetNavigationBackground, getOffsetNavigationContrastText } from '../../helpers';
10
- export var DRAWER_WIDTH = {
6
+ export const DRAWER_WIDTH = {
11
7
  Collapsed: 60,
12
8
  Expanded: 300
13
9
  };
14
- export var FlyoutMenuPaper = styled(Paper, {
15
- shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen' && prop !== 'open' && prop !== 'anchorEl'; }
16
- })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: transparent none;\n box-shadow: none;\n left: ", ";\n right: ", ";\n perspective: 800px;\n pointer-events: ", ";\n position: fixed;\n /* Check against height of browser should be top or bottom positioned */\n top: ", ";\n min-width: 200px;\n z-index: 2;\n"], ["\n background: transparent none;\n box-shadow: none;\n left: ", ";\n right: ", ";\n perspective: 800px;\n pointer-events: ", ";\n position: fixed;\n /* Check against height of browser should be top or bottom positioned */\n top: ", ";\n min-width: 200px;\n z-index: 2;\n"])), function (props) { return props.theme.direction === 'ltr' ? props.isDrawerOpen ? "".concat(DRAWER_WIDTH.Expanded, "px") : "".concat(DRAWER_WIDTH.Collapsed - 3, "px") : 'auto'; }, function (props) { return props.theme.direction === 'rtl' ? props.isDrawerOpen ? "".concat(DRAWER_WIDTH.Expanded, "px") : "".concat(DRAWER_WIDTH.Collapsed - 3, "px") : 'auto'; }, function (props) { return props.open ? 'auto' : 'none'; }, function (props) { return props.anchorEl
17
- ? "".concat(props.anchorEl.getBoundingClientRect().top, "px")
18
- : 'auto'; });
19
- export var FlyoutMenuWrap = styled('div', {
20
- shouldForwardProp: function (prop) { return prop !== 'open'; }
21
- })(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n border-radius: 0 8px 8px 0;\n box-shadow: 5px 7px 8px -10px rgb(0 0 0 / 20%), 5px 12px 17px -10px rgb(0 0 0 / 14%), 5px 5px 22px -10px rgb(0 0 0 / 12%);\n opacity: ", ";\n visibility: ", ";\n transform: ", ";\n transform-origin: left center;\n transition: ", ";\n"], ["\n background-color: ", ";\n color: ", ";\n border-radius: 0 8px 8px 0;\n box-shadow: 5px 7px 8px -10px rgb(0 0 0 / 20%), 5px 12px 17px -10px rgb(0 0 0 / 14%), 5px 5px 22px -10px rgb(0 0 0 / 12%);\n opacity: ", ";\n visibility: ", ";\n transform: ", ";\n transform-origin: left center;\n transition: ", ";\n"])), function (props) { return getOffsetNavigationBackground(props.theme); }, function (props) { var _a; return ((_a = props.theme.palette.navigation) === null || _a === void 0 ? void 0 : _a.contrastText) || getOffsetNavigationContrastText(props.theme); }, function (props) { return props.open ? 1 : 0; }, function (props) { return props.open ? 'visible' : 'hidden'; }, function (props) { return props.open ? 'rotateY(0deg) scale(1)' : 'rotateY(15deg) scale(.97)'; }, function (props) { return props.open
22
- ? "all ".concat(props.theme.transitions.duration.enteringScreen, "ms ").concat(props.theme.transitions.easing.easeOut)
23
- : "all ".concat(props.theme.transitions.duration.leavingScreen, "ms ").concat(props.theme.transitions.easing.easeIn); });
24
- export var FlyoutMenuList = styled(List, {
25
- shouldForwardProp: function (prop) { return prop !== 'open'; }
26
- })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: ", ";\n pointer-events: ", ";\n"], ["\n padding: ", ";\n pointer-events: ", ";\n"])), function (props) { return props.theme.spacing(1, 2); }, function (props) { return props.open ? 'auto' : 'none'; });
27
- export var FlyoutMenuHeader = styled(Typography)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-weight: bold;\n padding: 12px 0 0;\n padding-inline-end: ", ";\n padding-inline-start: ", ";\n text-align: ", ";\n"], ["\n font-weight: bold;\n padding: 12px 0 0;\n padding-inline-end: ", ";\n padding-inline-start: ", ";\n text-align: ", ";\n"])), function (props) { return props.theme.spacing(2); }, function (props) { return props.theme.spacing(3); }, function (props) { return props.theme.direction === 'ltr' ? 'left' : 'right'; });
28
- export var FlyoutMenuItem = styled(ListItem)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: transparent !important;\n font-size: 14px;\n padding: 0;\n white-space: normal;\n"], ["\n background: transparent !important;\n font-size: 14px;\n padding: 0;\n white-space: normal;\n"])));
29
- export var FlyoutMenuItemText = styled(ListItemText)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n text-align: ", ";\n"], ["\n color: ", ";\n text-align: ", ";\n"])), function (props) { var _a; return ((_a = props.theme.palette.navigation) === null || _a === void 0 ? void 0 : _a.contrastText) || getOffsetNavigationContrastText(props.theme); }, function (props) { return props.theme.direction === 'ltr' ? 'left' : 'right'; });
30
- export var FlyoutMenuButton = styled(SSListItemButton, {
31
- shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen' && prop !== 'isExpanded'; }
32
- })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n align-items: flex-start;\n background-color: transparent;\n border-radius: 5px;\n display: flex;\n flex-wrap: wrap;\n text-decoration: none;\n text-transform: none;\n transition: all ", "ms ", ";\n padding: ", ";\n width: 100%;\n\n :hover {\n color: ", ";\n background-color: ", ";\n }\n\n :focus-visible {\n background-color: ", ";\n box-shadow: 0 0 0 3px ", ";\n }\n"], ["\n align-items: flex-start;\n background-color: transparent;\n border-radius: 5px;\n display: flex;\n flex-wrap: wrap;\n text-decoration: none;\n text-transform: none;\n transition: all ", "ms ", ";\n padding: ", ";\n width: 100%;\n\n :hover {\n color: ", ";\n background-color: ", ";\n }\n\n :focus-visible {\n background-color: ", ";\n box-shadow: 0 0 0 3px ", ";\n }\n"
33
- // FullHeight
34
- ])), function (props) { return props.theme.transitions.duration.enteringScreen; }, function (props) { return props.theme.transitions.easing.easeOut; }, function (props) { return props.theme.spacing(1, 2); }, function (props) { return getOffsetNavigationContrastText(props.theme, 0.15); }, function (props) { return getOffsetNavigationBackground(props.theme, 0.15); }, function (props) { return getOffsetNavigationBackground(props.theme, 0.133); }, function (props) { return getOffsetNavigationContrastText(props.theme, 0.133); });
10
+ export const FlyoutMenuPaper = styled(Paper, {
11
+ shouldForwardProp: (prop) => prop !== 'isDrawerOpen' && prop !== 'open' && prop !== 'anchorEl'
12
+ }) `
13
+ background: transparent none;
14
+ box-shadow: none;
15
+ left: ${props => props.theme.direction === 'ltr' ? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded}px` : `${DRAWER_WIDTH.Collapsed - 3}px` : 'auto'};
16
+ right: ${props => props.theme.direction === 'rtl' ? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded}px` : `${DRAWER_WIDTH.Collapsed - 3}px` : 'auto'};
17
+ perspective: 800px;
18
+ pointer-events: ${props => props.open ? 'auto' : 'none'};
19
+ position: fixed;
20
+ /* Check against height of browser should be top or bottom positioned */
21
+ top: ${props => props.anchorEl
22
+ ? `${props.anchorEl.getBoundingClientRect().top}px`
23
+ : 'auto'};
24
+ min-width: 200px;
25
+ z-index: 2;
26
+ `;
27
+ export const FlyoutMenuWrap = styled('div', {
28
+ shouldForwardProp: (prop) => prop !== 'open'
29
+ }) `
30
+ background-color: ${props => getOffsetNavigationBackground(props.theme)};
31
+ color: ${props => props.theme.palette.navigation?.contrastText || getOffsetNavigationContrastText(props.theme)};
32
+ border-radius: 0 8px 8px 0;
33
+ box-shadow: 5px 7px 8px -10px rgb(0 0 0 / 20%), 5px 12px 17px -10px rgb(0 0 0 / 14%), 5px 5px 22px -10px rgb(0 0 0 / 12%);
34
+ opacity: ${props => props.open ? 1 : 0};
35
+ visibility: ${props => props.open ? 'visible' : 'hidden'};
36
+ transform: ${props => props.open ? 'rotateY(0deg) scale(1)' : 'rotateY(15deg) scale(.97)'};
37
+ transform-origin: left center;
38
+ transition: ${props => props.open
39
+ ? `all ${props.theme.transitions.duration.enteringScreen}ms ${props.theme.transitions.easing.easeOut}`
40
+ : `all ${props.theme.transitions.duration.leavingScreen}ms ${props.theme.transitions.easing.easeIn}`};
41
+ `;
42
+ export const FlyoutMenuList = styled(List, {
43
+ shouldForwardProp: (prop) => prop !== 'open'
44
+ }) `
45
+ padding: ${props => props.theme.spacing(1, 2)};
46
+ pointer-events: ${props => props.open ? 'auto' : 'none'};
47
+ `;
48
+ export const FlyoutMenuHeader = styled(Typography) `
49
+ font-weight: bold;
50
+ padding: 12px 0 0;
51
+ padding-inline-end: ${props => props.theme.spacing(2)};
52
+ padding-inline-start: ${props => props.theme.spacing(3)};
53
+ text-align: ${props => props.theme.direction === 'ltr' ? 'left' : 'right'};
54
+ `;
55
+ export const FlyoutMenuItem = styled(ListItem) `
56
+ background: transparent !important;
57
+ font-size: 14px;
58
+ padding: 0;
59
+ white-space: normal;
60
+ `;
61
+ export const FlyoutMenuItemText = styled(ListItemText) `
62
+ color: ${props => props.theme.palette.navigation?.contrastText || getOffsetNavigationContrastText(props.theme)};
63
+ text-align: ${props => props.theme.direction === 'ltr' ? 'left' : 'right'};
64
+ `;
65
+ export const FlyoutMenuButton = styled(SSListItemButton, {
66
+ shouldForwardProp: (prop) => prop !== 'isDrawerOpen' && prop !== 'isExpanded'
67
+ }) `
68
+ align-items: flex-start;
69
+ background-color: transparent;
70
+ border-radius: 5px;
71
+ display: flex;
72
+ flex-wrap: wrap;
73
+ text-decoration: none;
74
+ text-transform: none;
75
+ transition: all ${props => props.theme.transitions.duration.enteringScreen}ms ${props => props.theme.transitions.easing.easeOut};
76
+ padding: ${props => props.theme.spacing(1, 2)};
77
+ width: 100%;
78
+
79
+ :hover {
80
+ color: ${props => getOffsetNavigationContrastText(props.theme, 0.15)};
81
+ background-color: ${props => getOffsetNavigationBackground(props.theme, 0.15)};
82
+ }
83
+
84
+ :focus-visible {
85
+ background-color: ${props => getOffsetNavigationBackground(props.theme, 0.133)};
86
+ box-shadow: 0 0 0 3px ${props => getOffsetNavigationContrastText(props.theme, 0.133)};
87
+ }
88
+ `;
35
89
  // FullHeight
36
- export var FullHeightFlyoutMenuPaper = styled(Paper, {
37
- shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen' && prop !== 'open'; }
38
- })(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: transparent none;\n box-shadow: none;\n height: 100%;\n left: ", ";\n right: ", ";\n perspective: 800px;\n pointer-events: ", ";\n position: fixed;\n top: 0;\n transition: ", ";\n z-index: 1;\n"], ["\n background: transparent none;\n box-shadow: none;\n height: 100%;\n left: ", ";\n right: ", ";\n perspective: 800px;\n pointer-events: ", ";\n position: fixed;\n top: 0;\n transition: ", ";\n z-index: 1;\n"])), function (props) { return props.theme.direction === 'ltr' ? props.isDrawerOpen ? "".concat(DRAWER_WIDTH.Expanded, "px") : "".concat(DRAWER_WIDTH.Collapsed - 3, "px") : 'auto'; }, function (props) { return props.theme.direction === 'rtl' ? props.isDrawerOpen ? "".concat(DRAWER_WIDTH.Expanded, "px") : "".concat(DRAWER_WIDTH.Collapsed - 3, "px") : 'auto'; }, function (props) { return props.open ? 'auto' : 'none'; }, function (props) { return props.open
39
- ? "all ".concat(props.theme.transitions.duration.enteringScreen, "ms ").concat(props.theme.transitions.easing.easeOut)
40
- : "all ".concat(props.theme.transitions.duration.leavingScreen, "ms ").concat(props.theme.transitions.easing.easeIn); });
41
- export var FullHeightFlyoutMenuWrapper = styled('div', {
42
- shouldForwardProp: function (prop) { return prop !== 'open'; }
43
- })(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n box-shadow: ", " 0 15px 0 rgb(0 0 0 / 10%);\n height: 100%;\n max-width: 300px;\n min-width: 300px;\n opacity: ", ";\n pointer-events: ", ";\n transform: ", ";\n transform-origin: left center;\n transition: ", ";\n visibility: ", ";\n width: ", ";\n"], ["\n background-color: ", ";\n color: ", ";\n box-shadow: ", " 0 15px 0 rgb(0 0 0 / 10%);\n height: 100%;\n max-width: 300px;\n min-width: 300px;\n opacity: ", ";\n pointer-events: ", ";\n transform: ", ";\n transform-origin: left center;\n transition: ", ";\n visibility: ", ";\n width: ", ";\n"])), function (props) { return getOffsetNavigationBackground(props.theme); }, function (props) { var _a; return ((_a = props.theme.palette.navigation) === null || _a === void 0 ? void 0 : _a.contrastText) || getOffsetNavigationContrastText(props.theme); }, function (props) { return props.theme.direction === 'ltr' ? '35px' : '-35px'; }, function (props) { return props.open ? 1 : 0; }, function (props) { return props.open ? 'auto' : 'none'; }, function (props) { return props.open ? 'rotateY(0deg) scale(1)' : 'rotateY(8deg) scale(.98)'; }, function (props) { return props.open
44
- ? "all ".concat(props.theme.transitions.duration.enteringScreen, "ms ").concat(props.theme.transitions.easing.easeOut)
45
- : "all ".concat(props.theme.transitions.duration.leavingScreen, "ms ").concat(props.theme.transitions.easing.easeIn); }, function (props) { return props.open ? 'visible' : 'hidden'; }, function (props) { return props.open ? '300' : 0; });
46
- export var FlyoutNotchMask = styled('div')(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background-color: ", ";\n content: '';\n display: block;\n height: 82px;\n left: ", ";\n right: ", ";\n position: absolute;\n top: 63px;\n width: 80px;\n z-index: -1;\n"], ["\n background-color: ", ";\n content: '';\n display: block;\n height: 82px;\n left: ", ";\n right: ", ";\n position: absolute;\n top: 63px;\n width: 80px;\n z-index: -1;\n"])), function (props) { return getOffsetNavigationBackground(props.theme); }, function (props) { return props.theme.direction === 'ltr' ? '-40px' : 'auto'; }, function (props) { return props.theme.direction === 'rtl' ? '-40px' : 'auto'; });
47
- export var NotchMini = styled(NotchMiniSVG)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n fill: ", ";\n left: ", ";\n right: ", ";\n pointer-events: none;\n position: absolute;\n"], ["\n fill: ", ";\n left: ", ";\n right: ", ";\n pointer-events: none;\n position: absolute;\n"])), function (props) { return getOffsetNavigationBackground(props.theme); }, function (props) { return props.theme.direction === 'ltr' ? '-12px' : 0; }, function (props) { return props.theme.direction === 'rtl' ? '-12px' : 0; });
48
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
90
+ export const FullHeightFlyoutMenuPaper = styled(Paper, {
91
+ shouldForwardProp: (prop) => prop !== 'isDrawerOpen' && prop !== 'open'
92
+ }) `
93
+ background: transparent none;
94
+ box-shadow: none;
95
+ height: 100%;
96
+ left: ${props => props.theme.direction === 'ltr' ? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded}px` : `${DRAWER_WIDTH.Collapsed - 3}px` : 'auto'};
97
+ right: ${props => props.theme.direction === 'rtl' ? props.isDrawerOpen ? `${DRAWER_WIDTH.Expanded}px` : `${DRAWER_WIDTH.Collapsed - 3}px` : 'auto'};
98
+ perspective: 800px;
99
+ pointer-events: ${props => props.open ? 'auto' : 'none'};
100
+ position: fixed;
101
+ top: 0;
102
+ transition: ${props => props.open
103
+ ? `all ${props.theme.transitions.duration.enteringScreen}ms ${props.theme.transitions.easing.easeOut}`
104
+ : `all ${props.theme.transitions.duration.leavingScreen}ms ${props.theme.transitions.easing.easeIn}`};
105
+ z-index: 1;
106
+ `;
107
+ export const FullHeightFlyoutMenuWrapper = styled('div', {
108
+ shouldForwardProp: (prop) => prop !== 'open'
109
+ }) `
110
+ background-color: ${props => getOffsetNavigationBackground(props.theme)};
111
+ color: ${props => props.theme.palette.navigation?.contrastText || getOffsetNavigationContrastText(props.theme)};
112
+ box-shadow: ${props => props.theme.direction === 'ltr' ? '35px' : '-35px'} 0 15px 0 rgb(0 0 0 / 10%);
113
+ height: 100%;
114
+ max-width: 300px;
115
+ min-width: 300px;
116
+ opacity: ${props => props.open ? 1 : 0};
117
+ pointer-events: ${props => props.open ? 'auto' : 'none'};
118
+ transform: ${props => props.open ? 'rotateY(0deg) scale(1)' : 'rotateY(8deg) scale(.98)'};
119
+ transform-origin: left center;
120
+ transition: ${props => props.open
121
+ ? `all ${props.theme.transitions.duration.enteringScreen}ms ${props.theme.transitions.easing.easeOut}`
122
+ : `all ${props.theme.transitions.duration.leavingScreen}ms ${props.theme.transitions.easing.easeIn}`};
123
+ visibility: ${props => props.open ? 'visible' : 'hidden'};
124
+ width: ${props => props.open ? '300' : 0};
125
+ `;
126
+ export const FlyoutNotchMask = styled('div') `
127
+ background-color: ${props => getOffsetNavigationBackground(props.theme)};
128
+ content: '';
129
+ display: block;
130
+ height: 82px;
131
+ left: ${props => props.theme.direction === 'ltr' ? '-40px' : 'auto'};
132
+ right: ${props => props.theme.direction === 'rtl' ? '-40px' : 'auto'};
133
+ position: absolute;
134
+ top: 63px;
135
+ width: 80px;
136
+ z-index: -1;
137
+ `;
138
+ export const NotchMini = styled(NotchMiniSVG) `
139
+ fill: ${props => getOffsetNavigationBackground(props.theme)};
140
+ left: ${props => props.theme.direction === 'ltr' ? '-12px' : 0};
141
+ right: ${props => props.theme.direction === 'rtl' ? '-12px' : 0};
142
+ pointer-events: none;
143
+ position: absolute;
144
+ `;