@learningpool/ui 1.8.4 → 1.8.6

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 (19) hide show
  1. package/components/navigation/MobileNavigation/MobileNavigation.js +1 -2
  2. package/components/navigation/MobileNavigation/MobileNavigationAvatar.js +3 -4
  3. package/components/navigation/MobileNavigation/MobileNavigationAvatarStyles.js +7 -22
  4. package/components/navigation/MobileNavigation/MobileNavigationDrawer.js +2 -3
  5. package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.d.ts +1 -1
  6. package/components/navigation/MobileNavigation/MobileNavigationDrawerStyles.js +10 -29
  7. package/components/navigation/MobileNavigation/MobileNavigationItem/MobileNavigationItemStyles.js +2 -5
  8. package/components/navigation/MobileNavigation/MobileNavigationSearch.js +1 -1
  9. package/components/navigation/MobileNavigation/MobileNavigationSearchStyles.js +4 -11
  10. package/components/navigation/MobileNavigation/MobileNavigationStyles.d.ts +1 -0
  11. package/components/navigation/MobileNavigation/MobileNavigationStyles.js +13 -35
  12. package/components/navigation/VerticalNavigation/VerticalNavigationAvatarStyles.js +1 -1
  13. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItem.js +35 -14
  14. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.d.ts +4 -1
  15. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenu.js +20 -8
  16. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemFlyoutMenuStyles.js +2 -2
  17. package/components/navigation/VerticalNavigation/VerticalNavigationItem/VerticalNavigationItemStyles.js +1 -1
  18. package/components/navigation/helpers.js +15 -12
  19. package/package.json +1 -1
@@ -23,8 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
23
23
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
24
  import React, { useEffect } from 'react';
25
25
  import { Person } from '@mui/icons-material';
26
- import { StyledBottomNavigationAction, StyledPaper, StyledBottomNavigation } from './MobileNavigationStyles';
27
- import { StyledAvatar } from './MobileNavigationAvatarStyles';
26
+ import { StyledBottomNavigationAction, StyledPaper, StyledBottomNavigation, StyledAvatar } from './MobileNavigationStyles';
28
27
  import SwipeableTemporaryDrawer from './MobileNavigationDrawer';
29
28
  import SwipeableTemporarySearch from './MobileNavigationSearch';
30
29
  import SwipeableTemporaryAvatar from './MobileNavigationAvatar';
@@ -63,10 +63,10 @@ var SwipeableTemporaryAvatar = function (props) {
63
63
  alignItems: 'center',
64
64
  display: 'flex',
65
65
  flexDirection: 'column'
66
- } }, { children: [_jsxs(StyledBoxProfile, __assign({ style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount) }, { children: [_jsx(StyledAvatar, __assign({ style: { marginRight: '0.5rem' } }, { children: avatarInitials })), _jsxs(StyledAvatarName, { children: [_jsx("span", __assign({ style: { fontWeight: 300 } }, { children: "Hi," })), " ", _jsx("strong", { children: avatarName.split(' ')[0] })] })] })), avatarPanelOnClickViewProfile && (_jsx(StyledBoxProfileEdit, __assign({ style: __assign({ flexDirection: 'row', marginBottom: theme.spacing(1) }, useStaggerAnimation(isOpen, animationCount, incrementAnimationCount)) }, { children: _jsxs(ButtonGroup, __assign({ variant: "contained", "aria-label": "split button" }, { children: [_jsx(Button, __assign({ variant: 'contained', color: 'primary', size: 'medium', onClick: function () {
66
+ } }, { children: [_jsxs(StyledBoxProfile, __assign({ style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount) }, { children: [_jsx(StyledAvatar, __assign({ style: { marginRight: '0.5rem' } }, { children: avatarInitials })), _jsxs(StyledAvatarName, { children: [_jsx("span", __assign({ style: { fontWeight: 300 } }, { children: "Hi," })), " ", _jsx("strong", { children: avatarName.split(' ')[0] })] })] })), avatarPanelOnClickViewProfile && (_jsx(StyledBoxProfileEdit, __assign({ style: __assign({ flexDirection: 'row', marginBottom: theme.spacing(1) }, useStaggerAnimation(isOpen, animationCount, incrementAnimationCount)) }, { children: _jsxs(ButtonGroup, __assign({ variant: 'outlined', "aria-label": "split button" }, { children: [_jsx(StyledOutlineButton, __assign({ variant: 'outlined', color: 'inherit', size: 'medium', onClick: function () {
67
67
  handleOpenState(false);
68
68
  avatarPanelOnClickViewProfile();
69
- } }, { children: avatarPanelViewProfileString !== null && avatarPanelViewProfileString !== void 0 ? avatarPanelViewProfileString : 'View Profile' })), avatarPanelOnClickEditProfile && (_jsx(Button, __assign({ size: 'medium', "aria-label": avatarPanelEditProfileString !== null && avatarPanelEditProfileString !== void 0 ? avatarPanelEditProfileString : 'Edit Profile', onClick: function () {
69
+ } }, { children: avatarPanelViewProfileString !== null && avatarPanelViewProfileString !== void 0 ? avatarPanelViewProfileString : 'View Profile' })), avatarPanelOnClickEditProfile && (_jsx(StyledOutlineButton, __assign({ size: 'medium', variant: 'outlined', color: 'inherit', "aria-label": avatarPanelEditProfileString !== null && avatarPanelEditProfileString !== void 0 ? avatarPanelEditProfileString : 'Edit Profile', onClick: function () {
70
70
  handleOpenState(false);
71
71
  avatarPanelOnClickEditProfile();
72
72
  } }, { children: _jsx(EditIcon, {}) })))] })) })))] })), _jsxs(Box, __assign({ style: {
@@ -95,7 +95,7 @@ var SwipeableTemporaryAvatar = function (props) {
95
95
  // @ts-expect-error
96
96
  , __assign({
97
97
  // @ts-expect-error
98
- component: animated.button, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount), disablePadding: true, variant: 'outlined', color: 'primary', size: 'medium', onClick: function () {
98
+ component: animated.button, style: useStaggerAnimation(isOpen, animationCount, incrementAnimationCount), disablePadding: true, variant: 'outlined', color: 'inherit', size: 'medium', onClick: function () {
99
99
  handleOpenState(false);
100
100
  avatarPanelOnClickMainAction();
101
101
  } }, { children: avatarPanelMainActionString })), _jsxs(List, __assign({ style: { marginBottom: theme.spacing(2) } }, { children: [avatarPanelSettingItems &&
@@ -135,7 +135,6 @@ var SwipeableTemporaryAvatar = function (props) {
135
135
  } }))
136
136
  : (_jsx(ToggleOnIcon, { style: {
137
137
  boxSizing: 'border-box',
138
- color: 'green',
139
138
  height: '2em',
140
139
  padding: '0.15em',
141
140
  width: '2em'
@@ -3,31 +3,16 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import { Avatar, Button, ListItemButton, Typography } from '../../../index';
6
+ import { getNavigationBackground, getNavigationContrastText, getOffsetNavigationBackground, getOffsetNavigationContrastText } from '../helpers';
6
7
  import { Drawer } from '@mui/material';
7
8
  import { styled } from '@mui/material/styles';
8
9
  import { animated } from '@react-spring/web';
9
- export var StyledSwipeableAvatar = styled(Drawer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n color: ", ";\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"], ["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n color: ", ";\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"])), function (props) { return props.theme.zIndex.appBar - 1; }, function (props) { return props.theme.palette.mode === 'dark'
10
- ? props.theme.palette.primary.contrastText
11
- : props.theme.palette.text.primary; });
12
- export var StyledBox = styled(animated.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n background-image: ", ";\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n overflow: auto;\n padding: 15vh ", ";\n position: relative;\n"], ["\n background-color: ", ";\n background-image: ", ";\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n overflow: auto;\n padding: 15vh ", ";\n position: relative;\n"])), function (props) { return props.theme.palette.mode === 'dark'
13
- ? '#003366'
14
- : props.theme.palette.background.paper; }, function (props) { return props.theme.palette.mode === 'dark'
15
- ? 'none'
16
- : 'radial-gradient( circle farthest-corner at 10% 20%, #fdfbfb 0.1%, #ebedee 99.8% )'; }, function (props) { return props.theme.spacing(2); });
10
+ export var StyledSwipeableAvatar = styled(Drawer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"], ["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"])), function (props) { return props.theme.zIndex.appBar - 1; });
11
+ export var StyledBox = styled(animated.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n overflow: auto;\n padding: 15vh ", ";\n position: relative;\n"], ["\n background-color: ", ";\n color: ", ";\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n height: 100%;\n overflow: auto;\n padding: 15vh ", ";\n position: relative;\n"])), function (props) { return getOffsetNavigationBackground(props.theme); }, function (props) { return getOffsetNavigationContrastText(props.theme); }, function (props) { return props.theme.spacing(2); });
17
12
  export var StyledBoxProfile = styled(animated.div)(templateObject_3 || (templateObject_3 = __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"])));
18
13
  export var StyledBoxProfileEdit = styled(animated.div)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
19
- export var StyledAvatarName = styled(Typography)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n font-size: 1.75rem;\n"], ["\n color: ", ";\n font-size: 1.75rem;\n"])), function (props) { return props.theme.palette.mode === 'dark'
20
- ? props.theme.palette.primary.contrastText
21
- : props.theme.palette.text.primary; });
22
- export var StyledOutlineButton = styled(Button)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-color: ", ";\n color: ", ";\n"], ["\n border-color: ", ";\n color: ", ";\n"])), function (props) { return props.theme.palette.mode === 'dark'
23
- ? props.theme.palette.primary.contrastText
24
- : props.theme.palette.primary.main; }, function (props) { return props.theme.palette.mode === 'dark'
25
- ? props.theme.palette.primary.contrastText
26
- : props.theme.palette.primary.main; });
27
- export var StyledAvatar = styled(Avatar)(templateObject_7 || (templateObject_7 = __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 props.theme.palette.mode === 'dark'
28
- ? props.theme.palette.primary.contrastText
29
- : props.theme.palette.primary.main; }, function (props) { return props.theme.palette.mode === 'dark'
30
- ? props.theme.palette.primary.main
31
- : props.theme.palette.primary.contrastText; });
32
- export var StyledListItemButton = styled(ListItemButton)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n border-radius: 50px;\n margin-inline-end: 2rem;\n"], ["\n border-radius: 50px;\n margin-inline-end: 2rem;\n"])));
14
+ export var StyledAvatarName = styled(Typography)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n font-size: 1.75rem;\n"], ["\n font-size: 1.75rem;\n"])));
15
+ export var StyledOutlineButton = styled(Button)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-color: ", ";\n color: ", ";\n\n :hover,\n :focus-visible {\n background-color: ", ";\n border-color: ", ";\n }\n"], ["\n border-color: ", ";\n color: ", ";\n\n :hover,\n :focus-visible {\n background-color: ", ";\n border-color: ", ";\n }\n"])), function (props) { return getOffsetNavigationContrastText(props.theme); }, function (props) { return getOffsetNavigationContrastText(props.theme); }, function (props) { return getOffsetNavigationBackground(props.theme, 0.133); }, function (props) { return getOffsetNavigationContrastText(props.theme); });
16
+ export var StyledAvatar = styled(Avatar)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n font-size: 0.85rem;\n font-weight: bold;\n"], ["\n background-color: ", ";\n color: ", ";\n font-size: 0.85rem;\n font-weight: bold;\n"])), function (props) { return getNavigationBackground(props.theme); }, function (props) { return getNavigationContrastText(props.theme); });
17
+ export var StyledListItemButton = styled(ListItemButton)(templateObject_8 || (templateObject_8 = __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) { return getOffsetNavigationContrastText(props.theme); }, function (props) { return getOffsetNavigationContrastText(props.theme, 0.133); }, function (props) { return getOffsetNavigationBackground(props.theme, 0.133); }, function (props) { return getOffsetNavigationBackground(props.theme, 0.133); }, function (props) { return getOffsetNavigationContrastText(props.theme, 0.133); });
33
18
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
@@ -17,6 +17,7 @@ import { StyledSwipeableDrawer, StyledBox, StyledListItem, StyledDivider, Styled
17
17
  import { StreamSuiteLogo } from '../../../assets/Images';
18
18
  import { animated } from '@react-spring/web';
19
19
  import { useStaggerAnimation } from '../../../utils/helpers';
20
+ import { getOffsetNavigationContrastText } from '../helpers';
20
21
  export default function SwipeableTemporaryDrawer(props) {
21
22
  var isDrawerOpen = props.isDrawerOpen, setIsDrawerOpen = props.setIsDrawerOpen, items = props.items, secondaryItems = props.secondaryItems, logo = props.logo, logoText = props.logoText, logoOnClick = props.logoOnClick;
22
23
  var theme = useTheme();
@@ -45,9 +46,7 @@ export default function SwipeableTemporaryDrawer(props) {
45
46
  ? (_jsx("img", { height: 38, width: 38, src: logo, alt: logoText !== null && logoText !== void 0 ? logoText : 'Site Logo' }))
46
47
  : logo
47
48
  : (_jsx(StreamSuiteLogo, { style: {
48
- fill: theme.palette.mode === 'dark'
49
- ? theme.palette.primary.main
50
- : theme.palette.primary.main
49
+ fill: getOffsetNavigationContrastText(theme)
51
50
  } })), _jsx(StyledDrawerLogoText, __assign({ variant: 'body1' }, { children: logoText !== null && logoText !== void 0 ? logoText : 'Site Logo' }))] })), _jsx(List, { children: items && items.length > 0 && items.map(function (item, index) {
52
51
  var label = item.label, children = item.children;
53
52
  return (_jsxs(StyledListItem, __assign({ disablePadding: true,
@@ -1151,7 +1151,6 @@ export declare const StyledChildListItem: import("@emotion/styled").StyledCompon
1151
1151
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof import("react").LiHTMLAttributes<HTMLLIElement>> & {
1152
1152
  ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
1153
1153
  }, "className" | "style" | "classes" | "button" | "children" | "sx" | "alignItems" | "disabled" | "autoFocus" | "selected" | "dense" | "components" | "componentsProps" | "disablePadding" | "disableGutters" | "divider" | "ContainerComponent" | "ContainerProps" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
1154
- export declare const StyledChildListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
1155
1154
  export declare const StyledChildListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
1156
1155
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
1157
1156
  centerRipple?: boolean | undefined;
@@ -1171,6 +1170,7 @@ export declare const StyledChildListItemButton: import("@emotion/styled").Styled
1171
1170
  }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
1172
1171
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
1173
1172
  }, "className" | "style" | "classes" | "tabIndex" | "children" | "sx" | "alignItems" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "autoFocus" | "selected" | "dense" | "disableGutters" | "divider"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
1173
+ export declare const StyledChildListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
1174
1174
  export declare const StyledListSecondaryList: import("@emotion/styled").StyledComponent<{
1175
1175
  children?: import("react").ReactNode;
1176
1176
  classes?: Partial<import("@mui/material").ListClasses> | undefined;
@@ -3,42 +3,23 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import { Box, List, ListItem, ListItemText, ListItemButton, Typography } from '../../../index';
6
+ import { getNavigationBackground, getOffsetNavigationBackground, getOffsetNavigationContrastText } from '../helpers';
6
7
  import { Drawer } from '@mui/material';
7
8
  import { styled } from '@mui/material/styles';
8
9
  import { animated } from '@react-spring/web';
9
- export var StyledSwipeableDrawer = styled(Drawer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n background-color: ", ";\n background-image: ", ";\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"], ["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n background-color: ", ";\n background-image: ", ";\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"])), function (props) { return props.theme.zIndex.appBar - 1; }, function (props) { return props.theme.palette.mode === 'dark'
10
- ? '#003366'
11
- : props.theme.palette.background.paper; }, function (props) { return props.theme.palette.mode === 'dark'
12
- ? 'none'
13
- : 'radial-gradient( circle farthest-corner at 10% 20%, #fdfbfb 0.1%, #ebedee 99.8% )'; });
10
+ export var StyledSwipeableDrawer = styled(Drawer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n background-color: ", ";\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"], ["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n background-color: ", ";\n height: 100vh;\n border: none;\n z-index: 1;\n }\n"])), function (props) { return props.theme.zIndex.appBar - 1; }, function (props) { return getOffsetNavigationBackground(props.theme); });
14
11
  export var StyledBox = styled(Box)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 100%;\n overflow: auto;\n padding-bottom: 6rem;\n"], ["\n height: 100%;\n overflow: auto;\n padding-bottom: 6rem;\n"])));
15
12
  export var StyledDrawerLogo = styled(animated.div)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: transparent;\n display: flex;\n align-items: center;\n margin: 1.5rem 0 2.5rem 1.5rem;\n\n .MuiSvgIcon-root {\n width: 2rem;\n height: 2rem;\n }\n"], ["\n background-color: transparent;\n display: flex;\n align-items: center;\n margin: 1.5rem 0 2.5rem 1.5rem;\n\n .MuiSvgIcon-root {\n width: 2rem;\n height: 2rem;\n }\n"])));
16
- export var StyledDrawerLogoText = styled(Typography)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: 1.2rem;\n margin-left: .5rem;\n color: ", ";\n"], ["\n font-size: 1.2rem;\n margin-left: .5rem;\n color: ", ";\n"])), function (props) { return props.theme.palette.mode === 'dark'
17
- ? 'rgba(255,255,255,.9)'
18
- : '#555'; });
13
+ export var StyledDrawerLogoText = styled(Typography)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: 1.2rem;\n margin-left: .5rem;\n color: ", ";\n"], ["\n font-size: 1.2rem;\n margin-left: .5rem;\n color: ", ";\n"])), function (props) { return getOffsetNavigationContrastText(props.theme); });
19
14
  export var StyledListItem = styled(ListItem)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n flex-direction: column;\n align-items: flex-start;\n margin: 0 1rem;\n max-width: calc(100% - 2rem);\n\n > .MuiListItemButton-root {\n padding: .5rem 1.5rem;\n }\n"], ["\n flex-direction: column;\n align-items: flex-start;\n margin: 0 1rem;\n max-width: calc(100% - 2rem);\n\n > .MuiListItemButton-root {\n padding: .5rem 1.5rem;\n }\n"])));
20
- export var StyledListItemButton = styled(ListItemButton)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-radius: 50px;\n"], ["\n border-radius: 50px;\n"])));
21
- export var StyledListItemText = styled(ListItemText)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n > .MuiTypography-root {\n font-size: 1.5rem;\n font-weight: bold;\n color: ", ";\n &:hover,\n &:focus,\n &:active {\n color: ", ";\n }\n }\n"], ["\n > .MuiTypography-root {\n font-size: 1.5rem;\n font-weight: bold;\n color: ", ";\n &:hover,\n &:focus,\n &:active {\n color: ", ";\n }\n }\n"])), function (props) { return props.theme.palette.mode === 'dark'
22
- ? 'rgba(255,255,255,.85)'
23
- : '#555'; }, function (props) { return props.theme.palette.mode === 'dark'
24
- ? 'rgba(255,255,255,.97)'
25
- : '#333'; });
26
- export var StyledChildList = styled(List)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n margin: -.25rem 1rem 0 1.5rem;\n padding: 0;\n\n"], ["\n display: flex;\n flex-wrap: wrap;\n margin: -.25rem 1rem 0 1.5rem;\n padding: 0;\n\n"])));
15
+ export var StyledListItemButton = styled(ListItemButton)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-radius: 50px;\n color: ", ";\n box-shadow: 0 0 0 0 transparent;\n transition: all 0.2s ease;\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 color: ", ";\n box-shadow: 0 0 0 0 transparent;\n transition: all 0.2s ease;\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) { return 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); });
16
+ export var StyledListItemText = styled(ListItemText)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n > .MuiTypography-root {\n font-size: 1.5rem;\n font-weight: bold;\n }\n"], ["\n > .MuiTypography-root {\n font-size: 1.5rem;\n font-weight: bold;\n }\n"])));
17
+ export var StyledChildList = styled(List)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n margin: -.25rem 1rem 0 1.5rem;\n padding: 0;\n"], ["\n display: flex;\n flex-wrap: wrap;\n margin: -.25rem 1rem 0 1.5rem;\n padding: 0;\n"])));
27
18
  export var StyledChildListItem = styled(ListItem)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 0;\n"], ["\n display: flex;\n align-items: center;\n padding: 0;\n"])));
28
- export var StyledChildListItemText = styled(ListItemText)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n font-size: .9rem;\n color: ", ";\n"], ["\n font-size: .9rem;\n color: ", ";\n"])), function (props) { return props.theme.palette.mode === 'dark'
29
- ? 'rgba(255,255,255,.75)'
30
- : '#666'; });
31
- export var StyledChildListItemButton = styled(ListItemButton)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n border-radius: 50px;\n flex-grow: 0;\n"], ["\n border-radius: 50px;\n flex-grow: 0;\n"])));
19
+ export var StyledChildListItemButton = styled(ListItemButton)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n border-radius: 50px;\n flex-grow: 0;\n color: ", ";\n box-shadow: 0 0 0 0 transparent;\n transition: all 0.2s ease;\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 flex-grow: 0;\n color: ", ";\n box-shadow: 0 0 0 0 transparent;\n transition: all 0.2s ease;\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) { return 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
+ export var StyledChildListItemText = styled(ListItemText)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n font-size: .9rem;\n"], ["\n font-size: .9rem;\n"])));
32
21
  export var StyledListSecondaryList = styled(List)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n margin: 0 1rem;\n"], ["\n display: flex;\n flex-wrap: wrap;\n margin: 0 1rem;\n"])));
33
22
  export var StyledListSecondaryItem = styled(ListItem)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n flex: 1 0 50%;\n display: flex;\n align-items: center;\n"], ["\n flex: 1 0 50%;\n display: flex;\n align-items: center;\n"])));
34
- export var StyledListSecondaryButton = styled(ListItemButton)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n color: ", ";\n margin: 0.25rem 0.25rem 0.5rem;\n padding: 0.3rem 1rem;\n background: ", ";\n border-radius: 50px;\n box-shadow: ", ";\n"], ["\n color: ", ";\n margin: 0.25rem 0.25rem 0.5rem;\n padding: 0.3rem 1rem;\n background: ", ";\n border-radius: 50px;\n box-shadow: ", ";\n"])), function (props) { return props.theme.palette.mode === 'dark'
35
- ? 'rgba(255,255,255,.8)'
36
- : '#555'; }, function (props) { return props.theme.palette.mode === 'dark'
37
- ? 'rgba(255,255,255,.12)'
38
- : 'rgba(255,255,255,.6)'; }, function (props) { return props.theme.palette.mode === 'dark'
39
- ? '0 6px 15px rgb(36 37 38 / 16%)'
40
- : '0 6px 15px rgb(36 37 38 / 8%)'; });
41
- export var StyledDivider = styled('div')(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n background-color: ", ";\n width: 75%;\n height: 3px;\n border: none;\n border-radius: 3px;\n margin: 2rem auto;\n"], ["\n background-color: ", ";\n width: 75%;\n height: 3px;\n border: none;\n border-radius: 3px;\n margin: 2rem auto;\n"])), function (props) { return props.theme.palette.mode === 'dark'
42
- ? 'rgba(62, 106, 179, .5)'
43
- : 'rgba(0,0,0,.075)'; });
23
+ export var StyledListSecondaryButton = styled(ListItemButton)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n margin: 0.25rem 0.25rem 0.5rem;\n padding: 0.3rem 1rem;\n border-radius: 50px;\n box-shadow: 0 0 0 0 transparent;\n transition: all 0.2s ease;\n\n :hover {\n background-color: ", ";\n color: ", ";\n }\n\n :focus-visible {\n background-color: ", ";\n box-shadow: 0 0 0 3px ", ";\n }\n"], ["\n background-color: ", ";\n color: ", ";\n margin: 0.25rem 0.25rem 0.5rem;\n padding: 0.3rem 1rem;\n border-radius: 50px;\n box-shadow: 0 0 0 0 transparent;\n transition: all 0.2s ease;\n\n :hover {\n background-color: ", ";\n color: ", ";\n }\n\n :focus-visible {\n background-color: ", ";\n box-shadow: 0 0 0 3px ", ";\n }\n"])), function (props) { return getOffsetNavigationBackground(props.theme, 0.15); }, function (props) { return getOffsetNavigationContrastText(props.theme, 0.15); }, function (props) { return getOffsetNavigationBackground(props.theme, 0.185); }, function (props) { return getOffsetNavigationContrastText(props.theme, 0.185); }, function (props) { return getOffsetNavigationBackground(props.theme, 0.185); }, function (props) { return getOffsetNavigationContrastText(props.theme, 0.185); });
24
+ export var StyledDivider = styled('div')(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n background-color: ", ";\n width: 75%;\n height: 2px;\n border: none;\n border-radius: 3px;\n margin: 2rem auto;\n"], ["\n background-color: ", ";\n width: 75%;\n height: 2px;\n border: none;\n border-radius: 3px;\n margin: 2rem auto;\n"])), function (props) { return getNavigationBackground(props.theme); });
44
25
  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, templateObject_14, templateObject_15;
@@ -3,6 +3,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import { ListItem as SSListItem, ListItemButton as SSListItemButton, ListItemText as SSListItemText, ListItemIcon as SSListItemIcon } from '../../../../index';
6
+ import { getNavigationContrastText } from '../../helpers';
6
7
  import { styled } from '@mui/material/styles';
7
8
  import { motion } from '../../../../utils/theme';
8
9
  import { ArrowRight } from '@mui/icons-material';
@@ -25,11 +26,7 @@ export var ListItemButton = styled(SSListItemButton, {
25
26
  return props.theme.palette.mode === 'dark'
26
27
  ? props.theme.palette.primary.main
27
28
  : props.theme.palette.background.paper;
28
- }, function (props) {
29
- return props.theme.palette.mode === 'dark'
30
- ? props.theme.palette.primary.contrastText
31
- : props.theme.palette.getContrastText(props.theme.palette.background.paper);
32
- }, ICON.Height + 8, function (props) { return props.isDrawerOpen
29
+ }, function (props) { return getNavigationContrastText(props.theme); }, ICON.Height + 8, function (props) { return props.isDrawerOpen
33
30
  ? props.isExpanded
34
31
  ? 'auto'
35
32
  : '200px'
@@ -50,5 +50,5 @@ export default function SwipeableTemporarySearch(props) {
50
50
  delay: isSearchOpen ? 100 : 0,
51
51
  reverse: !isSearchOpen,
52
52
  config: __assign(__assign({}, config.default), { mass: 1 })
53
- }) }, { children: _jsxs(FormControl, __assign({ fullWidth: true, variant: 'outlined' }, { children: [_jsx(StyledOutlinedInputLabel, __assign({ htmlFor: 'mobile-nav-search' }, { children: searchPanelPlaceholder !== null && searchPanelPlaceholder !== void 0 ? searchPanelPlaceholder : 'Search' })), _jsx(StyledOutlinedInput, { label: searchPanelPlaceholder !== null && searchPanelPlaceholder !== void 0 ? searchPanelPlaceholder : 'Search', id: 'mobile-nav-search', endAdornment: _jsx(InputAdornment, __assign({ position: 'end' }, { children: _jsx(IconButton, __assign({ "aria-label": 'Search', edge: 'end', onClick: handleSearch }, { children: _jsx(Search, {}) })) })), onKeyDown: handleSearch, value: searchValue, onChange: function (event) { var _a; return setSearchValue((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value); } })] })) })) })) }) })));
53
+ }) }, { children: _jsxs(FormControl, __assign({ fullWidth: true, variant: 'outlined', color: 'secondary' }, { children: [_jsx(StyledOutlinedInputLabel, __assign({ htmlFor: 'mobile-nav-search' }, { children: searchPanelPlaceholder !== null && searchPanelPlaceholder !== void 0 ? searchPanelPlaceholder : 'Search' })), _jsx(StyledOutlinedInput, { label: searchPanelPlaceholder !== null && searchPanelPlaceholder !== void 0 ? searchPanelPlaceholder : 'Search', id: 'mobile-nav-search', endAdornment: _jsx(InputAdornment, __assign({ position: 'end' }, { children: _jsx(IconButton, __assign({ "aria-label": 'Search', edge: 'end', onClick: handleSearch }, { children: _jsx(Search, {}) })) })), onKeyDown: handleSearch, value: searchValue, onChange: function (event) { var _a; return setSearchValue((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.value); } })] })) })) })) }) })));
54
54
  }
@@ -3,18 +3,11 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import { SwipeableDrawer, OutlinedInput, InputLabel } from '../../../index';
6
+ import { getNavigationContrastText, getOffsetNavigationBackground, getOffsetNavigationContrastText } from '../helpers';
6
7
  import { styled } from '@mui/material/styles';
7
8
  import { animated } from '@react-spring/web';
8
9
  export var StyledSwipeableSearch = styled(SwipeableDrawer)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2),\n 0px 5px 8px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 14px 0px rgba(0, 0, 0, 0.12);\n border: none;\n border-radius: 20px 20px 0 0;\n z-index: 1;\n }\n"], ["\n // Override the MUI default z-index of the Drawer component\n // to ensure that the drawer is always below the AppBar.\n z-index: ", ";\n\n .MuiPaper-root {\n box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2),\n 0px 5px 8px 0px rgba(0, 0, 0, 0.14),\n 0px 1px 14px 0px rgba(0, 0, 0, 0.12);\n border: none;\n border-radius: 20px 20px 0 0;\n z-index: 1;\n }\n"])), function (props) { return props.theme.zIndex.appBar - 1; });
9
- export var StyledBox = styled(animated.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n background-image: ", ";\n padding: ", ";\n height: 100%;\n"], ["\n background-color: ", ";\n background-image: ", ";\n padding: ", ";\n height: 100%;\n"])), function (props) { return props.theme.palette.mode === 'dark'
10
- ? '#003366'
11
- : props.theme.palette.background.paper; }, function (props) { return props.theme.palette.mode === 'dark'
12
- ? 'none'
13
- : 'radial-gradient( circle farthest-corner at 10% 20%, #fdfbfb 0.1%, #ebedee 99.8% )'; }, function (props) { return props.theme.spacing(3, 2.5, '80px', 2.5); });
14
- export var StyledOutlinedInputLabel = styled(InputLabel)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &.Mui-focused {\n color: ", ";\n }\n"], ["\n &.Mui-focused {\n color: ", ";\n }\n"])), function (props) { return props.theme.palette.mode === 'dark' ? props.theme.palette.primary.contrastText : '#003366'; });
15
- export var StyledOutlinedInput = styled(OutlinedInput)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n\n &:hover .MuiOutlinedInput-notchedOutline,\n &.Mui-focused .MuiOutlinedInput-notchedOutline {\n border-color: ", ";\n }\n"], ["\n background-color: ", ";\n color: ", ";\n\n &:hover .MuiOutlinedInput-notchedOutline,\n &.Mui-focused .MuiOutlinedInput-notchedOutline {\n border-color: ", ";\n }\n"])), function (props) { return props.theme.palette.mode === 'dark'
16
- ? '#003366'
17
- : props.theme.palette.background.paper; }, function (props) { return props.theme.palette.mode === 'dark'
18
- ? props.theme.palette.primary.contrastText
19
- : props.theme.palette.text.primary; }, function (props) { return props.theme.palette.mode === 'dark' ? props.theme.palette.primary.contrastText : '#003366'; });
10
+ export var StyledBox = styled(animated.div)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n padding: ", ";\n height: 100%;\n"], ["\n background-color: ", ";\n padding: ", ";\n height: 100%;\n"])), function (props) { return getOffsetNavigationBackground(props.theme); }, function (props) { return props.theme.spacing(3, 2.5, '80px', 2.5); });
11
+ export var StyledOutlinedInputLabel = styled(InputLabel)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n\n &.MuiInputLabel-root.Mui-focused {\n color: ", ";\n }\n"], ["\n color: ", ";\n\n &.MuiInputLabel-root.Mui-focused {\n color: ", ";\n }\n"])), function (props) { return getOffsetNavigationContrastText(props.theme); }, function (props) { return getOffsetNavigationContrastText(props.theme); });
12
+ export var StyledOutlinedInput = styled(OutlinedInput)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n .MuiInputBase-input {\n color: ", ";\n }\n\n fieldset {\n border-color: ", " !important;\n transition: all 0.2s ease;\n }\n\n &.MuiOutlinedInput-root:hover fieldset,\n &.MuiOutlinedInput-root:focus fieldset {\n border-width: 2px;\n }\n\n .MuiIconButton-root {\n color: ", ";\n }\n"], ["\n .MuiInputBase-input {\n color: ", ";\n }\n\n fieldset {\n border-color: ", " !important;\n transition: all 0.2s ease;\n }\n\n &.MuiOutlinedInput-root:hover fieldset,\n &.MuiOutlinedInput-root:focus fieldset {\n border-width: 2px;\n }\n\n .MuiIconButton-root {\n color: ", ";\n }\n"])), function (props) { return getNavigationContrastText(props.theme); }, function (props) { return getOffsetNavigationContrastText(props.theme); }, function (props) { return getOffsetNavigationContrastText(props.theme); });
20
13
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -149,3 +149,4 @@ export declare const StyledNotchShadowMask: import("@emotion/styled").StyledComp
149
149
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
150
150
  ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
151
151
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "ref" | "children" | "sx" | "component" | ("p" | "color" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint")> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
152
+ export declare const StyledAvatar: import("@emotion/styled").StyledComponent<any, {}, {}>;
@@ -3,39 +3,24 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import Drawer from '@mui/material/Drawer';
6
- import { Box, IconButton, BottomNavigation, BottomNavigationAction, Paper } from '../../../index';
6
+ import { Box, IconButton, BottomNavigation, BottomNavigationAction, Paper, Avatar } from '../../../index';
7
+ import { getNavigationBackground, getNavigationContrastText, getOffsetNavigationBackground, getOffsetNavigationContrastText } from '../helpers';
7
8
  import { styled } from '@mui/material/styles';
8
9
  import { motion } from '../../../utils/theme';
9
10
  export var DRAWER_WIDTH = {
10
11
  Collapsed: 60,
11
12
  Expanded: 300
12
13
  };
13
- export var StyledPaper = styled(Paper)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n background-image: none;\n border-radius: 0;\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n z-index: ", ";\n"], ["\n background-color: ", ";\n background-image: none;\n border-radius: 0;\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n z-index: ", ";\n"])), function (props) { return props.theme.palette.mode === 'dark'
14
- ? props.theme.palette.primary.main
15
- : props.theme.palette.background.paper; }, function (props) { return props.theme.zIndex.appBar; });
14
+ export var StyledPaper = styled(Paper)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-image: none;\n border-radius: 0;\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n z-index: ", ";\n"], ["\n background-image: none;\n border-radius: 0;\n bottom: 0;\n left: 0;\n position: fixed;\n right: 0;\n z-index: ", ";\n"])), function (props) { return props.theme.zIndex.appBar; });
16
15
  export var StyledNotchSVG = styled('svg', {
17
16
  shouldForwardProp: function (prop) { return prop !== 'mobileNotchPosition'; }
18
- })(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n fill: ", ";\n height: 50px;\n left: 0;\n padding: 0;\n position: absolute;\n stroke: transparent;\n top: -29px;\n transform: rotate(270deg);\n width: 50px;\n z-index: -1;\n"], ["\n display: block;\n fill: ", ";\n height: 50px;\n left: 0;\n padding: 0;\n position: absolute;\n stroke: transparent;\n top: -29px;\n transform: rotate(270deg);\n width: 50px;\n z-index: -1;\n"])), function (props) { return props.theme.palette.mode === 'dark'
19
- ? props.theme.palette.primary.main
20
- : props.theme.palette.background.paper; });
21
- export var StyledBottomNavigation = styled(BottomNavigation)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n position: relative;\n"], ["\n background-color: ", ";\n position: relative;\n"])), function (props) { return props.theme.palette.mode === 'dark'
22
- ? props.theme.palette.primary.main
23
- : props.theme.palette.background.paper; });
24
- export var StyledBottomNavigationAction = styled(BottomNavigationAction)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n backgroundColor: ", ";\n color: ", ";\n flex: none;\n height: 56px;\n max-width: 168px;\n min-width: 80px;\n overflow: hidden;\n padding: 0;\n stroke: ", ";\n\n .MuiBottomNavigationAction-label {\n color: inherit;\n font-size: 0.65rem;\n\n // Handle long text string overflow\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n\n &.Mui-selected {\n color: ", ";\n font-size: 0.75rem;\n }\n }\n\n .MuiSvgIcon-root {\n fill: ", ";\n }\n"], ["\n backgroundColor: ", ";\n color: ", ";\n flex: none;\n height: 56px;\n max-width: 168px;\n min-width: 80px;\n overflow: hidden;\n padding: 0;\n stroke: ", ";\n\n .MuiBottomNavigationAction-label {\n color: inherit;\n font-size: 0.65rem;\n\n // Handle long text string overflow\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n\n &.Mui-selected {\n color: ", ";\n font-size: 0.75rem;\n }\n }\n\n .MuiSvgIcon-root {\n fill: ", ";\n }\n"])), function (props) { return props.theme.palette.mode === 'dark'
25
- ? props.theme.palette.primary.main
26
- : props.theme.palette.background.paper; }, function (props) { return props.theme.palette.mode === 'dark'
27
- ? props.theme.palette.primary.contrastText
28
- : props.theme.palette.getContrastText(props.theme.palette.background.paper); }, function (props) { return props.theme.palette.mode === 'dark'
29
- ? props.theme.palette.primary.contrastText
30
- : props.theme.palette.text.primary; }, function (props) {
31
- return props.theme.palette.mode === 'dark'
32
- ? props.theme.palette.primary.contrastText
33
- : props.theme.palette.getContrastText(props.theme.palette.background.paper);
34
- }, function (props) {
17
+ })(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n fill: ", ";\n height: 50px;\n left: 0;\n padding: 0;\n position: absolute;\n stroke: transparent;\n top: -29px;\n transform: rotate(270deg);\n width: 50px;\n z-index: -1;\n"], ["\n display: block;\n fill: ", ";\n height: 50px;\n left: 0;\n padding: 0;\n position: absolute;\n stroke: transparent;\n top: -29px;\n transform: rotate(270deg);\n width: 50px;\n z-index: -1;\n"])), function (props) { return getNavigationBackground(props.theme); });
18
+ export var StyledBottomNavigation = styled(BottomNavigation)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n position: relative;\n"], ["\n background-color: ", ";\n position: relative;\n"])), function (props) { return getNavigationBackground(props.theme); });
19
+ export var StyledBottomNavigationAction = styled(BottomNavigationAction)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n flex: none;\n height: 56px;\n max-width: 168px;\n min-width: 80px;\n overflow: hidden;\n padding: 0;\n stroke: ", ";\n\n .MuiBottomNavigationAction-label {\n color: inherit;\n font-size: 0.65rem;\n\n // Handle long text string overflow\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n\n &.Mui-selected {\n color: ", ";\n font-size: 0.75rem;\n }\n }\n\n .MuiSvgIcon-root {\n fill: ", ";\n }\n"], ["\n color: ", ";\n flex: none;\n height: 56px;\n max-width: 168px;\n min-width: 80px;\n overflow: hidden;\n padding: 0;\n stroke: ", ";\n\n .MuiBottomNavigationAction-label {\n color: inherit;\n font-size: 0.65rem;\n\n // Handle long text string overflow\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 100%;\n\n &.Mui-selected {\n color: ", ";\n font-size: 0.75rem;\n }\n }\n\n .MuiSvgIcon-root {\n fill: ", ";\n }\n"])), function (props) { return getNavigationContrastText(props.theme); }, function (props) { return getNavigationContrastText(props.theme); }, function (props) {
35
20
  return props.theme.palette.mode === 'dark'
36
21
  ? props.theme.palette.primary.contrastText
37
22
  : props.theme.palette.getContrastText(props.theme.palette.background.paper);
38
- });
23
+ }, function (props) { return getNavigationBackground(props.theme); });
39
24
  export var DrawerHeader = styled('div', {
40
25
  shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen'; }
41
26
  })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n"], ["\n"])));
@@ -76,15 +61,9 @@ export var DrawerShadow = styled(Box, {
76
61
  : "".concat(DRAWER_WIDTH.Collapsed - 33, "px");
77
62
  });
78
63
  export var NotchContainer = styled(Box)(templateObject_12 || (templateObject_12 = __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);
79
- export var NotchBackground = styled(Box)(templateObject_13 || (templateObject_13 = __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'
80
- ? props.theme.palette.primary.main
81
- : props.theme.palette.background.paper; });
82
- export var NotchBackgroundClip = styled(Box)(templateObject_14 || (templateObject_14 = __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'
83
- ? props.theme.palette.primary.main
84
- : props.theme.palette.background.paper; });
85
- export var NotchSeemMask = styled(Box)(templateObject_15 || (templateObject_15 = __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'
86
- ? props.theme.palette.primary.main
87
- : props.theme.palette.background.paper; });
64
+ export var NotchBackground = styled(Box)(templateObject_13 || (templateObject_13 = __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 getNavigationBackground(props.theme); });
65
+ export var NotchBackgroundClip = styled(Box)(templateObject_14 || (templateObject_14 = __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 getNavigationBackground(props.theme); });
66
+ export var NotchSeemMask = styled(Box)(templateObject_15 || (templateObject_15 = __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 getNavigationBackground(props.theme); });
88
67
  export var StyledDrawer = styled(Drawer, {
89
68
  shouldForwardProp: function (prop) { return prop !== 'open'; }
90
69
  })(templateObject_16 || (templateObject_16 = __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\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\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) {
@@ -93,7 +72,6 @@ export var StyledDrawer = styled(Drawer, {
93
72
  : props.theme.palette.getContrastText(props.theme.palette.background.paper);
94
73
  }, 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"); });
95
74
  export var StyledNotchShadow = styled(Box)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n border-radius: 50%;\n box-shadow: 0px -7px 10px -5px rgb(0 0 0 / 20%), 0px 2px 10px 0px rgb(0 0 0 / 14%), 0px 0px 8px 0px rgb(0 0 0 / 12%);\n height: 13px;\n left: 13px;\n position: absolute;\n top: -7px;\n width: 25px;\n z-index: -2;\n"], ["\n border-radius: 50%;\n box-shadow: 0px -7px 10px -5px rgb(0 0 0 / 20%), 0px 2px 10px 0px rgb(0 0 0 / 14%), 0px 0px 8px 0px rgb(0 0 0 / 12%);\n height: 13px;\n left: 13px;\n position: absolute;\n top: -7px;\n width: 25px;\n z-index: -2;\n"])));
96
- export var StyledNotchShadowMask = styled(Box)(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: 50%;\n height: 13px;\n left: 13px;\n position: absolute;\n top: -1px;\n width: 25px;\n z-index: -1;\n"], ["\n background-color: ", ";\n border-radius: 50%;\n height: 13px;\n left: 13px;\n position: absolute;\n top: -1px;\n width: 25px;\n z-index: -1;\n"])), function (props) { return props.theme.palette.mode === 'dark'
97
- ? props.theme.palette.primary.main
98
- : props.theme.palette.background.paper; });
99
- 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, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18;
75
+ export var StyledNotchShadowMask = styled(Box)(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n background-color: ", ";\n border-radius: 50%;\n height: 13px;\n left: 13px;\n position: absolute;\n top: -1px;\n width: 25px;\n z-index: -1;\n"], ["\n background-color: ", ";\n border-radius: 50%;\n height: 13px;\n left: 13px;\n position: absolute;\n top: -1px;\n width: 25px;\n z-index: -1;\n"])), function (props) { return getNavigationBackground(props.theme); });
76
+ export var StyledAvatar = styled(Avatar)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n font-weight: bold;\n"], ["\n background-color: ", ";\n color: ", ";\n font-weight: bold;\n"])), function (props) { return getOffsetNavigationBackground(props.theme); }, function (props) { return getOffsetNavigationContrastText(props.theme); });
77
+ 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, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19;
@@ -16,5 +16,5 @@ export var StyledBoxProfileEdit = styled(animated.div)(templateObject_5 || (temp
16
16
  export var StyledAvatarName = styled(Typography)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-size: 1.75rem;\n"], ["\n font-size: 1.75rem;\n"])));
17
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
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\n & .MuiListItemIcon-root {\n color: ", ";\n }\n"], ["\n border-radius: 50px;\n white-space: normal;\n\n & .MuiListItemIcon-root {\n color: ", ";\n }\n"])), function (props) { var _a; return ((_a = props.theme.palette.navigation) === null || _a === void 0 ? void 0 : _a.contrastText) || getOffsetNavigationContrastText(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
20
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
@@ -34,7 +34,8 @@ var VerticalNavigationItem = function (props) {
34
34
  var theme = useTheme();
35
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, content = props.content, style = props.style, hasCustomContent = props.hasCustomContent, rest = __rest(props, ["label", "icon", "onClick", "isActive", "children", "isDrawerOpen", "index", "hasFlyout", "fullHeightFlyout", "isSecondary", "content", "style", "hasCustomContent"]);
36
36
  var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
37
- var open = Boolean(anchorEl);
37
+ var _e = React.useState(false), isFlyoutHovered = _e[0], setIsFlyoutHovered = _e[1];
38
+ var open = isFlyoutHovered || Boolean(anchorEl);
38
39
  var handlePopoverOpen = function (event) {
39
40
  if (open) {
40
41
  handlePopoverClose();
@@ -46,7 +47,7 @@ var VerticalNavigationItem = function (props) {
46
47
  setAnchorEl(null);
47
48
  };
48
49
  var handleClick = function (event) {
49
- if (fullHeightFlyout) {
50
+ if ((children && children.length > 0) || fullHeightFlyout || hasCustomContent) {
50
51
  handlePopoverOpen(event);
51
52
  onClick && onClick(event);
52
53
  return;
@@ -54,6 +55,12 @@ var VerticalNavigationItem = function (props) {
54
55
  if (onClick) {
55
56
  onClick(event);
56
57
  }
58
+ // Set open to true / Open sub menu
59
+ if (!open) {
60
+ handlePopoverOpen(event);
61
+ return;
62
+ }
63
+ // Set open to false / Close sub menu
57
64
  setAnchorEl(null);
58
65
  };
59
66
  var handleChildItemClick = function (event, item) {
@@ -65,25 +72,39 @@ var VerticalNavigationItem = function (props) {
65
72
  item.onClick(event);
66
73
  }
67
74
  };
75
+ var ref = React.useRef(null);
76
+ var flyoutRef = React.useRef(null);
77
+ var handleKeyDown = function (event) {
78
+ if (!event) {
79
+ return;
80
+ }
81
+ // This should only be triggered for items with a sub nav
82
+ if (flyoutRef && flyoutRef.current) {
83
+ var CLOSE_SUBMENU_DELAY = 200;
84
+ if (event.type === 'blur') {
85
+ setTimeout(function () {
86
+ // @ts-expect-error
87
+ var isMenuFocus = flyoutRef.current.contains(window.document.activeElement) || ref === window.document.activeElement;
88
+ if (!isMenuFocus) {
89
+ handlePopoverClose();
90
+ }
91
+ }, CLOSE_SUBMENU_DELAY);
92
+ }
93
+ }
94
+ };
68
95
  return (_jsxs(ListItem, __assign({ disablePadding: true,
69
96
  // @ts-expect-error
70
- component: animated.li, style: style }, rest, { isDrawerOpen: isDrawerOpen }, { children: [_jsxs(ListItemButton
71
- // @ts-expect-error
72
- , __assign({
97
+ component: animated.li, style: style }, rest, { isDrawerOpen: isDrawerOpen }, { children: [_jsxs(ListItemButton, __assign({ ref: ref,
73
98
  // @ts-expect-error
74
- component: Link, onClick: handleClick, isDrawerOpen: isDrawerOpen, open: open, onMouseEnter: function (event) { return (fullHeightFlyout || isDrawerOpen)
75
- ? null
76
- : handlePopoverOpen(event); }, onMouseLeave: function () { return (fullHeightFlyout || isDrawerOpen)
77
- ? null
78
- : handlePopoverClose(); }, onFocus: function (event) { return (fullHeightFlyout || isDrawerOpen)
99
+ component: Link, onClick: handleClick, isDrawerOpen: isDrawerOpen, onMouseEnter: function (event) { return (hasCustomContent || fullHeightFlyout || isDrawerOpen)
79
100
  ? null
80
- : handlePopoverOpen(event); }, onBlur: function () { return (fullHeightFlyout || isDrawerOpen)
101
+ : handlePopoverOpen(event); }, onMouseLeave: function () { return (hasCustomContent || fullHeightFlyout || isDrawerOpen)
81
102
  ? null
82
- : handlePopoverClose(); }, "aria-expanded": fullHeightFlyout ? open : null, "aria-current": isActive ? 'page' : null, role: (children && children.length > 0) || fullHeightFlyout ? '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, sx: {
103
+ : 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, sx: {
83
104
  '& .MuiTypography-root': {
84
105
  fontSize: isSecondary ? '14px' : 'inherit'
85
106
  }
86
- } })] }), label), children && children.length > 0 && (_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
107
+ } })] }), 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
108
  // @ts-expect-error
88
109
  , __assign({
89
110
  // @ts-expect-error
@@ -91,6 +112,6 @@ var VerticalNavigationItem = function (props) {
91
112
  '& .MuiTypography-root': {
92
113
  fontSize: '14px !important'
93
114
  }
94
- } })] }), label) }), "".concat(childItem.label, " - ").concat(index))); }) })) }))), hasCustomContent && content, !fullHeightFlyout && children && children.length > 0 && !isDrawerOpen && (_jsx(VerticalNavigationItemFlyoutMenu, { isDrawerOpen: isDrawerOpen, anchorEl: anchorEl, open: open, children: children, label: label })), fullHeightFlyout && content && (_jsx(VerticalNavigationItemFlyoutMenu, { isDrawerOpen: isDrawerOpen, fullHeightFlyout: true, anchorEl: anchorEl, open: open, content: content }))] })));
115
+ } })] }), 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
116
  };
96
117
  export default VerticalNavigationItem;
@@ -10,6 +10,9 @@ export interface IVerticalNavigationItemFlyoutMenuProps {
10
10
  fullHeightFlyout?: boolean;
11
11
  anchorEl?: null | HTMLElement;
12
12
  open?: boolean;
13
+ setAnchorEl?: any;
14
+ parentItemRef?: any;
15
+ setIsFlyoutHovered?: any;
13
16
  }
14
- declare const VerticalNavigationItemFlyoutMenu: (props: IVerticalNavigationItemFlyoutMenuProps) => React.ReactElement;
17
+ declare const VerticalNavigationItemFlyoutMenu: React.ForwardRefExoticComponent<IVerticalNavigationItemFlyoutMenuProps & React.RefAttributes<unknown>>;
15
18
  export default VerticalNavigationItemFlyoutMenu;
@@ -10,20 +10,32 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import React from 'react';
13
+ import { forwardRef } from 'react';
14
14
  import { Link } from '../../../../index';
15
15
  import { FullHeightFlyoutMenuPaper, FullHeightFlyoutMenuWrapper, FlyoutNotchMask, NotchMini, FlyoutMenuHeader, FlyoutMenuPaper, FlyoutMenuWrap, FlyoutMenuList, FlyoutMenuButton, FlyoutMenuItem, FlyoutMenuItemText } from './VerticalNavigationItemFlyoutMenuStyles';
16
- var VerticalNavigationItemFlyoutMenu = function (props) {
17
- var label = props.label, children = props.children, isDrawerOpen = props.isDrawerOpen, fullHeightFlyout = props.fullHeightFlyout, content = props.content, anchorEl = props.anchorEl;
18
- var _a = React.useState(false), flyoutHovered = _a[0], setFlyoutHovered = _a[1];
19
- var open = flyoutHovered || (props === null || props === void 0 ? void 0 : props.open);
16
+ var VerticalNavigationItemFlyoutMenu = forwardRef(function (props, ref) {
17
+ var label = props.label, children = props.children, isDrawerOpen = props.isDrawerOpen, fullHeightFlyout = props.fullHeightFlyout, open = props.open, parentItemRef = props.parentItemRef, content = props.content, anchorEl = props.anchorEl, setAnchorEl = props.setAnchorEl, setIsFlyoutHovered = props.setIsFlyoutHovered;
20
18
  if (fullHeightFlyout && content) {
21
19
  return (_jsx(FullHeightFlyoutMenuPaper, __assign({ isDrawerOpen: isDrawerOpen, open: open, id: "avatar-panel" }, { children: _jsxs(FullHeightFlyoutMenuWrapper, __assign({ open: open }, { children: [_jsx(FlyoutNotchMask, {}), _jsx(NotchMini, { tabIndex: -1, style: { bottom: '24px' } }), content] })) })));
22
20
  }
23
- return (_jsx(FlyoutMenuPaper, __assign({ isDrawerOpen: isDrawerOpen, open: open, anchorEl: anchorEl !== null && anchorEl !== void 0 ? anchorEl : undefined, onMouseEnter: function () { return setFlyoutHovered(true); }, onMouseLeave: function () { return setFlyoutHovered(false); }, onFocus: function () { return setFlyoutHovered(true); }, onBlur: function () { return setFlyoutHovered(false); } }, { children: _jsxs(FlyoutMenuWrap, __assign({ open: open }, { children: [_jsx(NotchMini, { style: { top: '12px' } }), _jsx(FlyoutMenuHeader, { children: label }), _jsx(FlyoutMenuList, __assign({ "aria-label": label, open: open }, { children: children === null || children === void 0 ? void 0 : children.map(function (childItem, index) { return (_jsx(FlyoutMenuItem, { children: _jsx(FlyoutMenuButton
21
+ var handleKeyDown = function (event) {
22
+ if (!event) {
23
+ return;
24
+ }
25
+ var CLOSE_SUBMENU_DELAY = 200;
26
+ if (event.type === 'blur') {
27
+ setTimeout(function () {
28
+ var isMenuFocus = (ref === null || ref === void 0 ? void 0 : ref.current.contains(window.document.activeElement)) || parentItemRef === window.document.activeElement;
29
+ if (!isMenuFocus) {
30
+ setAnchorEl(null);
31
+ }
32
+ }, CLOSE_SUBMENU_DELAY);
33
+ }
34
+ };
35
+ return (_jsx(FlyoutMenuPaper, __assign({ ref: ref, 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); } }, { children: _jsxs(FlyoutMenuWrap, __assign({ open: open }, { children: [_jsx(NotchMini, { style: { top: '12px' } }), _jsx(FlyoutMenuHeader, { children: label }), _jsx(FlyoutMenuList, __assign({ "aria-label": label, open: open }, { children: children === null || children === void 0 ? void 0 : children.map(function (childItem, index) { return (_jsx(FlyoutMenuItem, { children: _jsx(FlyoutMenuButton
24
36
  // @ts-expect-error
25
37
  , __assign({
26
38
  // @ts-expect-error
27
- component: Link, role: 'link', onClick: childItem.onClick }, { children: _jsx(FlyoutMenuItemText, { primary: childItem.label }) }), childItem.label) }, "".concat(childItem.label, " - ").concat(index))); }) }))] })) })));
28
- };
39
+ 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))); }) }))] })) })));
40
+ });
29
41
  export default VerticalNavigationItemFlyoutMenu;
@@ -29,9 +29,9 @@ export var FlyoutMenuItem = styled(ListItem)(templateObject_5 || (templateObject
29
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
30
  export var FlyoutMenuButton = styled(SSListItemButton, {
31
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 background-color: rgba(0, 0, 0, .05);\n }\n\n :focus {\n background-color: ", ";\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 background-color: rgba(0, 0, 0, .05);\n }\n\n :focus {\n background-color: ", ";\n }\n"
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
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 getOffsetNavigationBackground(props.theme, 0.2); });
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); });
35
35
  // FullHeight
36
36
  export var FullHeightFlyoutMenuPaper = styled(Paper, {
37
37
  shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen' && prop !== 'open'; }
@@ -30,7 +30,7 @@ export var ListItemAvatar = styled(ListItemButton, {
30
30
  export var ListItemIcon = styled(SSListItemIcon)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n align-items: center;\n color: ", ";\n height: ", "px;\n justify-content: center;\n margin-top: 0 !important;\n min-width: ", ";\n width: ", ";\n\n [theme.breakpoints.up('sm')] {\n min-width: ", "px;\n width: ", "px;\n }\n"], ["\n align-items: center;\n color: ", ";\n height: ", "px;\n justify-content: center;\n margin-top: 0 !important;\n min-width: ", ";\n width: ", ";\n\n [theme.breakpoints.up('sm')] {\n min-width: ", "px;\n width: ", "px;\n }\n"])), function (props) { return getNavigationContrastText(props.theme); }, ICON.Height + 8, ICON.Width, ICON.Width, ICON.Width + 8, ICON.Width + 8);
31
31
  export var ListItemText = styled(SSListItemText, {
32
32
  shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen' && prop !== 'index'; }
33
- })(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n max-width: 210px;\n opacity: ", ";\n padding: 0.5rem;\n text-align: ", ";\n transition: opacity ", "ms ", " ", "s !important;\n white-space: normal;\n width: auto;\n"], ["\n color: ", ";\n max-width: 210px;\n opacity: ", ";\n padding: 0.5rem;\n text-align: ", ";\n transition: opacity ", "ms ", " ", "s !important;\n white-space: normal;\n width: auto;\n"])), function (props) { return getNavigationContrastText(props.theme); }, function (props) { return props.isDrawerOpen ? 1 : 0; }, function (props) { return props.theme.direction === 'rtl' ? 'right' : 'left'; }, function (props) { return props.theme.transitions.duration.enteringScreen; }, function (props) { return props.theme.transitions.easing.easeOut; }, function (props) { return props.index !== undefined ? props.index / 50 : 0.02; });
33
+ })(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n min-width: 210px;\n max-width: 210px;\n opacity: ", ";\n padding: 0.5rem;\n text-align: ", ";\n transition: opacity ", "ms ", " ", "s !important;\n white-space: normal;\n width: auto;\n"], ["\n color: ", ";\n min-width: 210px;\n max-width: 210px;\n opacity: ", ";\n padding: 0.5rem;\n text-align: ", ";\n transition: opacity ", "ms ", " ", "s !important;\n white-space: normal;\n width: auto;\n"])), function (props) { return getNavigationContrastText(props.theme); }, function (props) { return props.isDrawerOpen ? 1 : 0; }, function (props) { return props.theme.direction === 'rtl' ? 'right' : 'left'; }, function (props) { return props.theme.transitions.duration.enteringScreen; }, function (props) { return props.theme.transitions.easing.easeOut; }, function (props) { return props.index !== undefined ? props.index / 50 : 0.02; });
34
34
  export var StyledExpandLess = styled(ArrowRight, {
35
35
  shouldForwardProp: function (prop) { return prop !== 'isDrawerOpen'; }
36
36
  })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n align-self: center;\n font-size: 1.25rem;\n left: ", ";\n margin-right: ", ";\n opacity: 1;\n position: relative;\n transition: opacity ", "ms ", " 200ms !important;\n"], ["\n align-self: center;\n font-size: 1.25rem;\n left: ", ";\n margin-right: ", ";\n opacity: 1;\n position: relative;\n transition: opacity ", "ms ", " 200ms !important;\n"])), function (props) { return props.isDrawerOpen ? '20px' : '-40px'; }, function (props) { return props.theme.spacing(1); }, function (props) { return props.theme.transitions.duration.enteringScreen; }, function (props) { return props.theme.transitions.easing.easeOut; });
@@ -1,5 +1,8 @@
1
1
  import { darken, lighten, getLuminance } from 'polished';
2
2
  var DEFAULT_COLOR_ADJUST_AMOUNT = 0.1;
3
+ // Luminance threshold for determining if we should lighten or darken the color
4
+ // .033 is the luminance value of #333333
5
+ var LUMINANCE_THRESHOLD = 0.033;
3
6
  /**
4
7
  * Return the background color for the navigation
5
8
  * @returns string
@@ -32,13 +35,13 @@ export var getOffsetNavigationBackground = function (theme, colorAdjustAmount) {
32
35
  var adjustAmount = colorAdjustAmount || DEFAULT_COLOR_ADJUST_AMOUNT;
33
36
  // Use background property if navigation property isnt set
34
37
  if (!((_a = palette.navigation) === null || _a === void 0 ? void 0 : _a.background)) {
35
- return getLuminance(palette.background.paper) > 0.5
36
- ? darken(adjustAmount, palette.background.paper)
37
- : lighten(adjustAmount, palette.background.paper);
38
+ return getLuminance(palette.background.paper) < LUMINANCE_THRESHOLD
39
+ ? lighten(adjustAmount, palette.background.paper)
40
+ : darken(adjustAmount, palette.background.paper);
38
41
  }
39
- return getLuminance((_b = palette.navigation) === null || _b === void 0 ? void 0 : _b.background) > 0.5
40
- ? darken(adjustAmount, (_c = palette.navigation) === null || _c === void 0 ? void 0 : _c.background)
41
- : lighten(adjustAmount, (_d = palette.navigation) === null || _d === void 0 ? void 0 : _d.background);
42
+ return getLuminance((_b = palette.navigation) === null || _b === void 0 ? void 0 : _b.background) < LUMINANCE_THRESHOLD
43
+ ? lighten(adjustAmount, (_c = palette.navigation) === null || _c === void 0 ? void 0 : _c.background)
44
+ : darken(adjustAmount, (_d = palette.navigation) === null || _d === void 0 ? void 0 : _d.background);
42
45
  };
43
46
  /**
44
47
  * Return a darkened or lightened contrast color for the navigation
@@ -51,11 +54,11 @@ export var getOffsetNavigationContrastText = function (theme, colorAdjustAmount)
51
54
  var adjustAmount = colorAdjustAmount || DEFAULT_COLOR_ADJUST_AMOUNT;
52
55
  // Use background property if navigation property isnt set
53
56
  if (!((_a = palette.navigation) === null || _a === void 0 ? void 0 : _a.background)) {
54
- return getLuminance(palette.background.paper) > 0.5
55
- ? palette.getContrastText(darken(adjustAmount, palette.background.paper))
56
- : palette.getContrastText(lighten(adjustAmount, palette.background.paper));
57
+ return getLuminance(palette.background.paper) < LUMINANCE_THRESHOLD
58
+ ? palette.getContrastText(lighten(adjustAmount, palette.background.paper))
59
+ : palette.getContrastText(darken(adjustAmount, palette.background.paper));
57
60
  }
58
- return getLuminance((_b = palette.navigation) === null || _b === void 0 ? void 0 : _b.background) > 0.5
59
- ? palette.getContrastText(darken(adjustAmount, (_c = palette.navigation) === null || _c === void 0 ? void 0 : _c.background))
60
- : palette.getContrastText(lighten(adjustAmount, (_d = palette.navigation) === null || _d === void 0 ? void 0 : _d.background));
61
+ return getLuminance((_b = palette.navigation) === null || _b === void 0 ? void 0 : _b.background) < LUMINANCE_THRESHOLD
62
+ ? palette.getContrastText(lighten(adjustAmount, (_c = palette.navigation) === null || _c === void 0 ? void 0 : _c.background))
63
+ : palette.getContrastText(darken(adjustAmount, (_d = palette.navigation) === null || _d === void 0 ? void 0 : _d.background));
61
64
  };
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "components",
10
10
  "ui"
11
11
  ],
12
- "version": "1.8.4",
12
+ "version": "1.8.6",
13
13
  "private": false,
14
14
  "main": "index.js",
15
15
  "module": "index.js",