@databiosphere/findable-ui 8.0.3 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Export/components/ExportToTerra/components/ExportToTerraReady/exportToTerraReady.js +2 -2
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/AcceptTerraTOS/acceptTerraTOS.js +2 -2
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/ConnectTerraToNIHAccount/connectTerraToNIHAccount.js +2 -2
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/CreateTerraAccount/createTerraAccount.js +2 -2
- package/lib/components/Filter/components/Filter/filter.js +2 -3
- package/lib/components/Filter/components/Filter/filter.styles.d.ts +3 -0
- package/lib/components/Filter/components/Filter/filter.styles.js +8 -1
- package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
- package/lib/components/Index/components/AzulFileDownload/azulFileDownload.js +5 -5
- package/lib/components/Index/components/AzulFileDownload/azulFileDownload.styles.d.ts +3 -0
- package/lib/components/Index/components/AzulFileDownload/azulFileDownload.styles.js +5 -0
- package/lib/components/Layout/components/ContentLayout/contentLayout.js +5 -3
- package/lib/components/Layout/components/ContentLayout/contentLayout.styles.d.ts +4 -0
- package/lib/components/Layout/components/ContentLayout/contentLayout.styles.js +7 -2
- package/lib/components/Layout/components/Footer/footer.js +1 -2
- package/lib/components/Layout/components/Footer/footer.styles.js +6 -1
- package/lib/components/Layout/components/Header/common/entities.d.ts +4 -0
- package/lib/components/Layout/components/Header/common/entities.js +5 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/constants.d.ts +4 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/constants.js +4 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/utils.d.ts +8 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/utils.js +12 -0
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.js +23 -7
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.js +4 -3
- package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.styles.js +1 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/common/utils.d.ts +9 -1
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/common/utils.js +13 -1
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationButtonLabel/navigationButtonLabel.d.ts +5 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationButtonLabel/navigationButtonLabel.js +5 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.js +3 -4
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.styles.d.ts +3 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.styles.js +23 -2
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/common/constants.d.ts +4 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/common/constants.js +19 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.d.ts +2 -1
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.js +20 -19
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.styles.d.ts +30 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.styles.js +16 -1
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.js +12 -7
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.d.ts +2 -0
- package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.js +9 -7
- package/lib/components/Layout/components/Header/header.styles.js +1 -0
- package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.js +2 -3
- package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.d.ts +3 -0
- package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.js +8 -1
- package/lib/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.styles.js +1 -1
- package/lib/components/Layout/components/Sidebar/sidebar.styles.js +2 -1
- package/lib/components/Links/common/entities.d.ts +4 -0
- package/lib/components/Links/common/entities.js +5 -0
- package/lib/components/Links/common/utils.js +1 -1
- package/lib/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.js +2 -2
- package/lib/components/Links/components/Link/link.d.ts +1 -1
- package/lib/components/Links/components/Link/link.js +5 -5
- package/lib/components/Table/components/Pagination/pagination.js +3 -3
- package/lib/components/common/Button/components/CallToActionButton/callToActionButton.js +2 -2
- package/lib/components/common/Button/components/HelpIconButton/helpIconButton.js +3 -3
- package/lib/components/common/Card/components/CardActionArea/cardActionArea.js +2 -2
- package/lib/components/common/IconButton/iconButton.styles.d.ts +0 -15
- package/lib/components/common/IconButton/iconButton.styles.js +0 -82
- package/lib/components/common/Socials/socials.d.ts +1 -1
- package/lib/components/common/Socials/socials.js +4 -5
- package/lib/components/common/Socials/socials.styles.d.ts +1 -0
- package/lib/components/common/Socials/socials.styles.js +9 -0
- package/lib/hooks/useMenuWithPosition.d.ts +14 -0
- package/lib/hooks/useMenuWithPosition.js +33 -0
- package/lib/theme/common/components.js +59 -1
- package/package.json +1 -1
- package/src/components/Export/components/ExportToTerra/components/ExportToTerraReady/exportToTerraReady.tsx +9 -2
- package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/AcceptTerraTOS/acceptTerraTOS.tsx +9 -2
- package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/ConnectTerraToNIHAccount/connectTerraToNIHAccount.tsx +5 -2
- package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/CreateTerraAccount/createTerraAccount.tsx +9 -2
- package/src/components/Filter/components/Filter/filter.styles.ts +9 -1
- package/src/components/Filter/components/Filter/filter.tsx +2 -3
- package/src/components/Index/components/AzulFileDownload/azulFileDownload.styles.ts +6 -0
- package/src/components/Index/components/AzulFileDownload/azulFileDownload.tsx +13 -12
- package/src/components/Layout/components/ContentLayout/contentLayout.styles.ts +9 -6
- package/src/components/Layout/components/ContentLayout/contentLayout.tsx +9 -4
- package/src/components/Layout/components/Footer/footer.styles.ts +6 -1
- package/src/components/Layout/components/Footer/footer.tsx +1 -8
- package/src/components/Layout/components/Header/common/entities.ts +5 -0
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/constants.ts +4 -0
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/utils.ts +17 -0
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.ts +7 -3
- package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.tsx +41 -16
- package/src/components/Layout/components/Header/components/Content/components/Logo/logo.styles.ts +1 -0
- package/src/components/Layout/components/Header/components/Content/components/Navigation/common/utils.ts +15 -1
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationButtonLabel/navigationButtonLabel.tsx +22 -0
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.styles.ts +27 -2
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.tsx +8 -5
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/common/constants.ts +23 -0
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.styles.ts +17 -1
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.tsx +25 -23
- package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.tsx +25 -5
- package/src/components/Layout/components/Header/components/Content/components/Navigation/navigation.tsx +24 -6
- package/src/components/Layout/components/Header/header.styles.ts +1 -0
- package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.ts +12 -1
- package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.tsx +2 -7
- package/src/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.styles.ts +1 -1
- package/src/components/Layout/components/Sidebar/sidebar.styles.ts +2 -1
- package/src/components/Links/common/entities.ts +5 -0
- package/src/components/Links/common/utils.ts +1 -1
- package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +2 -1
- package/src/components/Links/components/Link/link.tsx +12 -4
- package/src/components/Table/components/Pagination/pagination.tsx +5 -3
- package/src/components/common/Button/components/CallToActionButton/callToActionButton.tsx +6 -3
- package/src/components/common/Button/components/HelpIconButton/helpIconButton.tsx +6 -3
- package/src/components/common/Card/components/CardActionArea/cardActionArea.tsx +9 -2
- package/src/components/common/IconButton/iconButton.styles.ts +0 -88
- package/src/components/common/Socials/socials.styles.ts +10 -0
- package/src/components/common/Socials/socials.tsx +12 -10
- package/src/hooks/useMenuWithPosition.ts +49 -0
- package/src/theme/common/components.ts +59 -0
- package/types/data-explorer-ui.d.ts +1 -0
- package/src/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.tsx +0 -15
- package/src/components/common/IconButton/components/LoadingIconButton/loadingIconButton.tsx +0 -15
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Typography } from "@mui/material";
|
|
2
|
+
import React, { Fragment, ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
export interface NavigationButtonLabelProps {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const NavigationButtonLabel = ({
|
|
9
|
+
label,
|
|
10
|
+
}: NavigationButtonLabelProps): JSX.Element => {
|
|
11
|
+
return (
|
|
12
|
+
<Fragment>
|
|
13
|
+
{typeof label === "string" ? (
|
|
14
|
+
<Typography component="span" noWrap>
|
|
15
|
+
{label}
|
|
16
|
+
</Typography>
|
|
17
|
+
) : (
|
|
18
|
+
label
|
|
19
|
+
)}
|
|
20
|
+
</Fragment>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -1,7 +1,33 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
-
import {
|
|
2
|
+
import { Dialog as MDialog } from "@mui/material";
|
|
3
|
+
import { inkLight } from "../../../../../../../../../../styles/common/mixins/colors";
|
|
4
|
+
import {
|
|
5
|
+
textBody400,
|
|
6
|
+
textUppercase500,
|
|
7
|
+
} from "../../../../../../../../../../styles/common/mixins/fonts";
|
|
3
8
|
import { Button as DXButton } from "../../../../../../../../../common/Button/button";
|
|
4
9
|
|
|
10
|
+
export const Dialog = styled(MDialog)`
|
|
11
|
+
+ .MuiDialog-root {
|
|
12
|
+
.MuiButton-activeNav,
|
|
13
|
+
.MuiButton-nav {
|
|
14
|
+
${textBody400};
|
|
15
|
+
padding: 6px 48px;
|
|
16
|
+
|
|
17
|
+
&.Mui-disabled {
|
|
18
|
+
${textUppercase500};
|
|
19
|
+
color: ${inkLight};
|
|
20
|
+
margin-top: 20px;
|
|
21
|
+
opacity: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:first-of-type {
|
|
25
|
+
margin-top: 10px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
5
31
|
export const Content = styled.div`
|
|
6
32
|
padding: 16px 0;
|
|
7
33
|
overflow-x: hidden;
|
|
@@ -9,7 +35,6 @@ export const Content = styled.div`
|
|
|
9
35
|
`;
|
|
10
36
|
|
|
11
37
|
export const Button = styled(DXButton)`
|
|
12
|
-
${textHeadingSmall};
|
|
13
38
|
gap: 8px;
|
|
14
39
|
justify-content: flex-start;
|
|
15
40
|
padding: 12px 24px;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ArrowDropDownRoundedIcon from "@mui/icons-material/ArrowDropDownRounded";
|
|
2
|
-
import { Dialog as MDialog } from "@mui/material";
|
|
3
2
|
import React, { ReactNode, useState } from "react";
|
|
4
3
|
import { Button } from "../../../../../../../../../common/Button/button";
|
|
5
4
|
import { BackArrowIcon } from "../../../../../../../../../common/CustomIcon/components/BackArrowIcon/backArrowIcon";
|
|
@@ -9,7 +8,11 @@ import { DrawerNavigation as Navigation } from "../../../Actions/components/Menu
|
|
|
9
8
|
import { Toolbar } from "../../../Actions/components/Menu/components/Toolbar/toolbar";
|
|
10
9
|
import { MenuItem } from "../NavigationMenuItems/navigationMenuItems";
|
|
11
10
|
import { Slide } from "./components/Slide/slide";
|
|
12
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
Button as BackButton,
|
|
13
|
+
Content,
|
|
14
|
+
Dialog,
|
|
15
|
+
} from "./navigationDrawer.styles";
|
|
13
16
|
|
|
14
17
|
export interface NavigationDrawerProps {
|
|
15
18
|
closeAncestor?: () => void;
|
|
@@ -46,7 +49,7 @@ export const NavigationDrawer = ({
|
|
|
46
49
|
>
|
|
47
50
|
{menuLabel}
|
|
48
51
|
</Button>
|
|
49
|
-
<
|
|
52
|
+
<Dialog
|
|
50
53
|
disableScrollLock
|
|
51
54
|
fullScreen
|
|
52
55
|
hideBackdrop
|
|
@@ -65,7 +68,7 @@ export const NavigationDrawer = ({
|
|
|
65
68
|
fullWidth
|
|
66
69
|
onClick={closeDrawer}
|
|
67
70
|
StartIcon={BackArrowIcon}
|
|
68
|
-
variant="
|
|
71
|
+
variant="backNav"
|
|
69
72
|
>
|
|
70
73
|
{menuLabel}
|
|
71
74
|
</BackButton>
|
|
@@ -76,7 +79,7 @@ export const NavigationDrawer = ({
|
|
|
76
79
|
pathname={pathname}
|
|
77
80
|
/>
|
|
78
81
|
</Content>
|
|
79
|
-
</
|
|
82
|
+
</Dialog>
|
|
80
83
|
</>
|
|
81
84
|
);
|
|
82
85
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MenuProps as MMenuProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const MENU_ANCHOR_ORIGIN_LEFT_BOTTOM: MMenuProps["anchorOrigin"] = {
|
|
4
|
+
horizontal: "left",
|
|
5
|
+
vertical: "bottom",
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const MENU_ANCHOR_ORIGIN_RIGHT_TOP: MMenuProps["anchorOrigin"] = {
|
|
9
|
+
horizontal: "right",
|
|
10
|
+
vertical: "top",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const MENU_PROPS: Partial<MMenuProps> = {
|
|
14
|
+
slotProps: {
|
|
15
|
+
paper: {
|
|
16
|
+
variant: "menu",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
transformOrigin: {
|
|
20
|
+
horizontal: "left",
|
|
21
|
+
vertical: "top",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css } from "@emotion/react";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
|
-
import { Menu as MMenu } from "@mui/material";
|
|
3
|
+
import { Menu as MMenu, MenuItem as MMenuItem } from "@mui/material";
|
|
4
4
|
import {
|
|
5
5
|
inkLight,
|
|
6
6
|
smokeLight,
|
|
@@ -33,11 +33,13 @@ export const Menu = styled(MMenu)`
|
|
|
33
33
|
.MuiListItemText-root {
|
|
34
34
|
display: grid;
|
|
35
35
|
gap: 4px;
|
|
36
|
+
white-space: normal;
|
|
36
37
|
|
|
37
38
|
.MuiListItemText-primary {
|
|
38
39
|
align-items: center;
|
|
39
40
|
display: flex;
|
|
40
41
|
gap: 4px;
|
|
42
|
+
min-width: 0;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
.MuiListItemText-secondary {
|
|
@@ -46,6 +48,11 @@ export const Menu = styled(MMenu)`
|
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
|
|
51
|
+
&.Mui-disabled {
|
|
52
|
+
color: ${inkLight};
|
|
53
|
+
opacity: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
&.Mui-selected {
|
|
50
57
|
background-color: ${smokeLight};
|
|
51
58
|
}
|
|
@@ -67,6 +74,11 @@ export const Menu = styled(MMenu)`
|
|
|
67
74
|
margin: 8px 0;
|
|
68
75
|
}
|
|
69
76
|
}
|
|
77
|
+
|
|
78
|
+
.MuiPopover-root {
|
|
79
|
+
cursor: default;
|
|
80
|
+
z-index: -1;
|
|
81
|
+
}
|
|
70
82
|
`;
|
|
71
83
|
|
|
72
84
|
export const Button = styled(DXButton, {
|
|
@@ -79,3 +91,7 @@ export const Button = styled(DXButton, {
|
|
|
79
91
|
background-color: ${smokeLight(props)};
|
|
80
92
|
`};
|
|
81
93
|
`;
|
|
94
|
+
|
|
95
|
+
export const StyledMenuItem = styled(MMenuItem)`
|
|
96
|
+
padding: 0;
|
|
97
|
+
`;
|
|
@@ -1,65 +1,67 @@
|
|
|
1
1
|
import ArrowDropDownRoundedIcon from "@mui/icons-material/ArrowDropDownRounded";
|
|
2
2
|
import { MenuProps as MMenuProps } from "@mui/material";
|
|
3
|
-
import React, {
|
|
3
|
+
import React, { Fragment, ReactNode } from "react";
|
|
4
4
|
import { useBreakpoint } from "../../../../../../../../../../hooks/useBreakpoint";
|
|
5
|
+
import { useMenuWithPosition } from "../../../../../../../../../../hooks/useMenuWithPosition";
|
|
6
|
+
import { NavigationButtonLabel } from "../NavigationButtonLabel/navigationButtonLabel";
|
|
5
7
|
import {
|
|
6
8
|
MenuItem,
|
|
7
9
|
NavigationMenuItems,
|
|
8
10
|
} from "../NavigationMenuItems/navigationMenuItems";
|
|
9
|
-
import {
|
|
11
|
+
import { MENU_ANCHOR_ORIGIN_LEFT_BOTTOM, MENU_PROPS } from "./common/constants";
|
|
12
|
+
import { Button, Menu, StyledMenuItem } from "./navigationMenu.styles";
|
|
10
13
|
|
|
11
14
|
export interface NavLinkMenuProps {
|
|
12
15
|
anchorOrigin?: MMenuProps["anchorOrigin"];
|
|
13
16
|
closeAncestor?: () => void;
|
|
17
|
+
disablePortal?: boolean;
|
|
14
18
|
menuItems: MenuItem[];
|
|
15
19
|
menuLabel: ReactNode;
|
|
16
20
|
pathname?: string;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
export const NavigationMenu = ({
|
|
20
|
-
anchorOrigin =
|
|
24
|
+
anchorOrigin = MENU_ANCHOR_ORIGIN_LEFT_BOTTOM,
|
|
21
25
|
closeAncestor,
|
|
26
|
+
disablePortal,
|
|
22
27
|
menuItems,
|
|
23
28
|
menuLabel,
|
|
24
29
|
pathname,
|
|
25
30
|
}: NavLinkMenuProps): JSX.Element => {
|
|
26
31
|
const { mdUp } = useBreakpoint();
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
setAnchorEl(event.currentTarget);
|
|
31
|
-
};
|
|
32
|
-
const closeMenu = (): void => {
|
|
33
|
-
closeAncestor?.();
|
|
34
|
-
setAnchorEl(null);
|
|
35
|
-
};
|
|
32
|
+
const { anchorEl, onClose, onToggleOpen, open } = useMenuWithPosition();
|
|
33
|
+
const MenuItem = disablePortal ? StyledMenuItem : Fragment;
|
|
34
|
+
const menuItemProps = disablePortal ? { onMouseLeave: onClose } : {};
|
|
36
35
|
return (
|
|
37
|
-
|
|
36
|
+
<MenuItem {...menuItemProps}>
|
|
38
37
|
<Button
|
|
39
38
|
EndIcon={ArrowDropDownRoundedIcon}
|
|
40
39
|
isActive={open}
|
|
41
|
-
onClick={
|
|
40
|
+
onClick={onToggleOpen}
|
|
42
41
|
variant="nav"
|
|
43
42
|
>
|
|
44
|
-
{menuLabel}
|
|
43
|
+
<NavigationButtonLabel label={menuLabel} />
|
|
45
44
|
</Button>
|
|
46
45
|
<Menu
|
|
46
|
+
{...MENU_PROPS}
|
|
47
47
|
anchorEl={anchorEl}
|
|
48
48
|
anchorOrigin={anchorOrigin}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
horizontal: "left",
|
|
54
|
-
vertical: "top",
|
|
49
|
+
disablePortal={disablePortal}
|
|
50
|
+
onClose={(): void => {
|
|
51
|
+
onClose();
|
|
52
|
+
closeAncestor?.();
|
|
55
53
|
}}
|
|
54
|
+
open={mdUp && open}
|
|
56
55
|
>
|
|
57
56
|
<NavigationMenuItems
|
|
58
|
-
closeMenu={
|
|
57
|
+
closeMenu={(): void => {
|
|
58
|
+
onClose();
|
|
59
|
+
closeAncestor?.();
|
|
60
|
+
}}
|
|
59
61
|
menuItems={menuItems}
|
|
60
62
|
pathname={pathname}
|
|
61
63
|
/>
|
|
62
64
|
</Menu>
|
|
63
|
-
|
|
65
|
+
</MenuItem>
|
|
64
66
|
);
|
|
65
67
|
};
|
|
@@ -10,11 +10,16 @@ import {
|
|
|
10
10
|
TEXT_BODY_400,
|
|
11
11
|
TEXT_BODY_500,
|
|
12
12
|
TEXT_BODY_SMALL_400_2_LINES,
|
|
13
|
+
TEXT_UPPERCASE_500,
|
|
13
14
|
} from "../../../../../../../../../../theme/common/typography";
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
ANCHOR_TARGET,
|
|
17
|
+
REL_ATTRIBUTE,
|
|
18
|
+
} from "../../../../../../../../../Links/common/entities";
|
|
15
19
|
import { isClientSideNavigation } from "../../../../../../../../../Links/common/utils";
|
|
16
20
|
import { isNavigationLinkSelected } from "../../common/utils";
|
|
17
21
|
import { NavLinkItem } from "../../navigation";
|
|
22
|
+
import { MENU_ANCHOR_ORIGIN_RIGHT_TOP } from "../NavigationMenu/common/constants";
|
|
18
23
|
import { NavigationMenu } from "../NavigationMenu/navigationMenu";
|
|
19
24
|
|
|
20
25
|
export interface MenuItem extends NavLinkItem {
|
|
@@ -44,6 +49,7 @@ export const NavigationMenuItems = ({
|
|
|
44
49
|
icon,
|
|
45
50
|
label,
|
|
46
51
|
menuItems: nestedMenuItems,
|
|
52
|
+
selectedMatch,
|
|
47
53
|
target = ANCHOR_TARGET.SELF,
|
|
48
54
|
url,
|
|
49
55
|
},
|
|
@@ -52,8 +58,9 @@ export const NavigationMenuItems = ({
|
|
|
52
58
|
nestedMenuItems ? (
|
|
53
59
|
<NavigationMenu
|
|
54
60
|
key={i}
|
|
55
|
-
anchorOrigin={
|
|
61
|
+
anchorOrigin={MENU_ANCHOR_ORIGIN_RIGHT_TOP}
|
|
56
62
|
closeAncestor={closeMenu}
|
|
63
|
+
disablePortal
|
|
57
64
|
menuItems={nestedMenuItems}
|
|
58
65
|
menuLabel={label}
|
|
59
66
|
pathname={pathname}
|
|
@@ -61,19 +68,32 @@ export const NavigationMenuItems = ({
|
|
|
61
68
|
) : (
|
|
62
69
|
<Fragment key={i}>
|
|
63
70
|
<MMenuItem
|
|
71
|
+
disabled={!url}
|
|
64
72
|
onClick={(): void => {
|
|
65
73
|
closeMenu();
|
|
66
74
|
isClientSideNavigation(url)
|
|
67
75
|
? router.push(url)
|
|
68
|
-
: window.open(
|
|
76
|
+
: window.open(
|
|
77
|
+
url,
|
|
78
|
+
target,
|
|
79
|
+
REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
80
|
+
);
|
|
69
81
|
}}
|
|
70
|
-
selected={isNavigationLinkSelected(
|
|
82
|
+
selected={isNavigationLinkSelected(
|
|
83
|
+
url,
|
|
84
|
+
pathname,
|
|
85
|
+
selectedMatch
|
|
86
|
+
)}
|
|
71
87
|
>
|
|
72
88
|
{icon && <ListItemIcon>{icon}</ListItemIcon>}
|
|
73
89
|
<ListItemText
|
|
74
90
|
primary={label}
|
|
75
91
|
primaryTypographyProps={{
|
|
76
|
-
variant:
|
|
92
|
+
variant: url
|
|
93
|
+
? description
|
|
94
|
+
? TEXT_BODY_500
|
|
95
|
+
: TEXT_BODY_400
|
|
96
|
+
: TEXT_UPPERCASE_500,
|
|
77
97
|
}}
|
|
78
98
|
secondary={description}
|
|
79
99
|
secondaryTypographyProps={{
|
|
@@ -3,10 +3,15 @@ import { useRouter } from "next/router";
|
|
|
3
3
|
import React, { CSSProperties, forwardRef, Fragment, ReactNode } from "react";
|
|
4
4
|
import { useBreakpoint } from "../../../../../../../../hooks/useBreakpoint";
|
|
5
5
|
import { BreakpointKey } from "../../../../../../../../hooks/useBreakpointHelper";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
ANCHOR_TARGET,
|
|
8
|
+
REL_ATTRIBUTE,
|
|
9
|
+
} from "../../../../../../../Links/common/entities";
|
|
7
10
|
import { isClientSideNavigation } from "../../../../../../../Links/common/utils";
|
|
11
|
+
import { SELECTED_MATCH } from "../../../../common/entities";
|
|
8
12
|
import { HeaderProps } from "../../../../header";
|
|
9
13
|
import { isNavigationLinkSelected } from "./common/utils";
|
|
14
|
+
import { NavigationButtonLabel } from "./components/NavigationButtonLabel/navigationButtonLabel";
|
|
10
15
|
import { NavigationDrawer } from "./components/NavigationDrawer/navigationDrawer";
|
|
11
16
|
import { NavigationMenu } from "./components/NavigationMenu/navigationMenu";
|
|
12
17
|
import { MenuItem } from "./components/NavigationMenuItems/navigationMenuItems";
|
|
@@ -17,6 +22,7 @@ export interface NavLinkItem {
|
|
|
17
22
|
flatten?: Partial<Record<BreakpointKey, boolean>>;
|
|
18
23
|
label: ReactNode;
|
|
19
24
|
menuItems?: MenuItem[];
|
|
25
|
+
selectedMatch?: SELECTED_MATCH;
|
|
20
26
|
target?: ANCHOR_TARGET;
|
|
21
27
|
url: string;
|
|
22
28
|
visible?: Partial<Record<BreakpointKey, boolean>>;
|
|
@@ -49,7 +55,14 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
|
|
|
49
55
|
<Links ref={ref} className={className} style={style}>
|
|
50
56
|
{links.map(
|
|
51
57
|
(
|
|
52
|
-
{
|
|
58
|
+
{
|
|
59
|
+
divider,
|
|
60
|
+
label,
|
|
61
|
+
menuItems,
|
|
62
|
+
selectedMatch,
|
|
63
|
+
target = ANCHOR_TARGET.SELF,
|
|
64
|
+
url,
|
|
65
|
+
},
|
|
53
66
|
i
|
|
54
67
|
) =>
|
|
55
68
|
menuItems ? (
|
|
@@ -75,19 +88,24 @@ export const Navigation = forwardRef<HTMLDivElement, NavigationProps>(
|
|
|
75
88
|
) : (
|
|
76
89
|
<Fragment key={i}>
|
|
77
90
|
<Button
|
|
91
|
+
disabled={!url}
|
|
78
92
|
onClick={(): void => {
|
|
93
|
+
closeAncestor?.();
|
|
79
94
|
isClientSideNavigation(url)
|
|
80
95
|
? router.push(url)
|
|
81
|
-
: window.open(
|
|
82
|
-
|
|
96
|
+
: window.open(
|
|
97
|
+
url,
|
|
98
|
+
target,
|
|
99
|
+
REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
100
|
+
);
|
|
83
101
|
}}
|
|
84
102
|
variant={
|
|
85
|
-
isNavigationLinkSelected(url, pathname)
|
|
103
|
+
isNavigationLinkSelected(url, pathname, selectedMatch)
|
|
86
104
|
? "activeNav"
|
|
87
105
|
: "nav"
|
|
88
106
|
}
|
|
89
107
|
>
|
|
90
|
-
{label}
|
|
108
|
+
<NavigationButtonLabel label={label} />
|
|
91
109
|
</Button>
|
|
92
110
|
{divider && <Divider />}
|
|
93
111
|
</Fragment>
|
package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Popover as MPopover } from "@mui/material";
|
|
3
3
|
import { mediaDesktopSmallDown } from "../../../../../../styles/common/mixins/breakpoints";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
smokeLight,
|
|
6
|
+
white,
|
|
7
|
+
} from "../../../../../../styles/common/mixins/colors";
|
|
8
|
+
import { IconButton as DXIconButton } from "../../../../../common/IconButton/iconButton";
|
|
5
9
|
|
|
6
10
|
export const TemporarySidebar = styled(MPopover)`
|
|
7
11
|
&.MuiPopover-root {
|
|
@@ -17,3 +21,10 @@ export const TemporarySidebar = styled(MPopover)`
|
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
`;
|
|
24
|
+
|
|
25
|
+
export const IconButton = styled(DXIconButton)`
|
|
26
|
+
color: ${white};
|
|
27
|
+
left: calc(100% + 4px);
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 4px;
|
|
30
|
+
`;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CloseRounded } from "@mui/icons-material";
|
|
2
2
|
import { PopoverPosition, PopoverProps } from "@mui/material";
|
|
3
3
|
import React, { ReactNode } from "react";
|
|
4
|
-
import { CloseDrawerIconButton } from "../../../../../common/IconButton/iconButton.styles";
|
|
5
4
|
import { DrawerTransition } from "../../../../../Filter/components/Filter/components/DrawerTransition/drawerTransition";
|
|
6
|
-
import { TemporarySidebar } from "./sidebarDrawer.styles";
|
|
5
|
+
import { IconButton, TemporarySidebar } from "./sidebarDrawer.styles";
|
|
7
6
|
|
|
8
7
|
const DEFAULT_POSITION: PopoverPosition = { left: 0, top: 0 };
|
|
9
8
|
const DRAWER_SLOT_PROPS: PopoverProps["slotProps"] = {
|
|
@@ -34,11 +33,7 @@ export const SidebarDrawer = ({
|
|
|
34
33
|
TransitionComponent={DrawerTransition}
|
|
35
34
|
transitionDuration={drawerOpen ? 250 : 300}
|
|
36
35
|
>
|
|
37
|
-
<
|
|
38
|
-
Icon={CloseRounded}
|
|
39
|
-
onClick={onDrawerClose}
|
|
40
|
-
size="medium"
|
|
41
|
-
/>
|
|
36
|
+
<IconButton Icon={CloseRounded} onClick={onDrawerClose} size="medium" />
|
|
42
37
|
{children}
|
|
43
38
|
</TemporarySidebar>
|
|
44
39
|
);
|
|
@@ -11,7 +11,7 @@ export const SidebarPositioner = styled("div")<Props>`
|
|
|
11
11
|
padding: 16px 0;
|
|
12
12
|
|
|
13
13
|
${mediaDesktopSmallUp} {
|
|
14
|
-
height:
|
|
14
|
+
max-height: 100vh;
|
|
15
15
|
overflow: auto;
|
|
16
16
|
padding: ${({ headerHeight }) => headerHeight}px 0 0;
|
|
17
17
|
position: sticky;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
+
import { smokeMain } from "../../../../styles/common/mixins/colors";
|
|
2
3
|
|
|
3
4
|
export const Sidebar = styled.div`
|
|
4
5
|
align-self: stretch;
|
|
5
|
-
border-right: 1px solid ${
|
|
6
|
+
border-right: 1px solid ${smokeMain};
|
|
6
7
|
box-sizing: content-box;
|
|
7
8
|
width: 264px;
|
|
8
9
|
`;
|
|
@@ -5,6 +5,11 @@ export enum ANCHOR_TARGET {
|
|
|
5
5
|
SELF = "_self",
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
export enum REL_ATTRIBUTE {
|
|
9
|
+
NO_OPENER = "noopener",
|
|
10
|
+
NO_OPENER_NO_REFERRER = "noopener noreferrer",
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
export type StrictUrlObject = Omit<UrlObject, "href" | "query"> & {
|
|
9
14
|
href: string;
|
|
10
15
|
query: string;
|
|
@@ -7,7 +7,7 @@ import { Url, UrlObjectWithHrefAndQuery } from "./entities";
|
|
|
7
7
|
* @returns true if the given link is an internal link.
|
|
8
8
|
*/
|
|
9
9
|
export function isClientSideNavigation(link: string): boolean {
|
|
10
|
-
return /^\/(?!\/)
|
|
10
|
+
return /^\/(?!\/)|^#/.test(link);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from "../../../../../../providers/exploreState";
|
|
11
11
|
import {
|
|
12
12
|
ANCHOR_TARGET,
|
|
13
|
+
REL_ATTRIBUTE,
|
|
13
14
|
UrlObjectWithHrefAndQuery,
|
|
14
15
|
} from "../../../../common/entities";
|
|
15
16
|
import { LinkProps } from "../../link";
|
|
@@ -51,7 +52,7 @@ export const ExploreViewLink = ({
|
|
|
51
52
|
className={className}
|
|
52
53
|
href={url.href}
|
|
53
54
|
onClick={onNavigate}
|
|
54
|
-
rel=
|
|
55
|
+
rel={REL_ATTRIBUTE.NO_OPENER}
|
|
55
56
|
target={target}
|
|
56
57
|
>
|
|
57
58
|
{label}
|
|
@@ -8,7 +8,7 @@ import React, { ReactNode } from "react";
|
|
|
8
8
|
import { isValidUrl } from "../../../../common/utils";
|
|
9
9
|
import { CopyToClipboard } from "../../../common/CopyToClipboard/copyToClipboard";
|
|
10
10
|
import { TypographyProps } from "../../../common/Typography/common/entities";
|
|
11
|
-
import { ANCHOR_TARGET, Url } from "../../common/entities";
|
|
11
|
+
import { ANCHOR_TARGET, REL_ATTRIBUTE, Url } from "../../common/entities";
|
|
12
12
|
import {
|
|
13
13
|
isClientSideNavigation,
|
|
14
14
|
isURLObjectWithHrefAndQuery,
|
|
@@ -36,6 +36,7 @@ export const Link = ({
|
|
|
36
36
|
target,
|
|
37
37
|
TypographyProps,
|
|
38
38
|
url,
|
|
39
|
+
...props /* Spread props to allow for specific MuiLink prop overrides. */
|
|
39
40
|
}: LinkProps): JSX.Element => {
|
|
40
41
|
if (isURLObjectWithHrefAndQuery(url)) {
|
|
41
42
|
/* Internal navigation - explore link */
|
|
@@ -57,11 +58,12 @@ export const Link = ({
|
|
|
57
58
|
<NLink href={url} legacyBehavior passHref>
|
|
58
59
|
<MLink
|
|
59
60
|
className={className}
|
|
60
|
-
rel=
|
|
61
|
+
rel={REL_ATTRIBUTE.NO_OPENER}
|
|
61
62
|
noWrap={noWrap}
|
|
62
63
|
target={target || ANCHOR_TARGET.SELF}
|
|
63
64
|
onClick={onClick}
|
|
64
65
|
{...TypographyProps}
|
|
66
|
+
{...props}
|
|
65
67
|
>
|
|
66
68
|
{label}
|
|
67
69
|
</MLink>
|
|
@@ -79,9 +81,10 @@ export const Link = ({
|
|
|
79
81
|
href={url}
|
|
80
82
|
noWrap={noWrap}
|
|
81
83
|
onClick={onClick}
|
|
82
|
-
rel=
|
|
84
|
+
rel={REL_ATTRIBUTE.NO_OPENER_NO_REFERRER}
|
|
83
85
|
target={target || ANCHOR_TARGET.BLANK}
|
|
84
86
|
{...TypographyProps}
|
|
87
|
+
{...props}
|
|
85
88
|
>
|
|
86
89
|
{label}
|
|
87
90
|
</MLink>
|
|
@@ -92,7 +95,12 @@ export const Link = ({
|
|
|
92
95
|
}
|
|
93
96
|
/* Invalid URL */
|
|
94
97
|
return (
|
|
95
|
-
<MTypography
|
|
98
|
+
<MTypography
|
|
99
|
+
component="span"
|
|
100
|
+
variant="inherit"
|
|
101
|
+
{...TypographyProps}
|
|
102
|
+
{...props}
|
|
103
|
+
>
|
|
96
104
|
{label}
|
|
97
105
|
</MTypography>
|
|
98
106
|
);
|
|
@@ -2,7 +2,7 @@ import EastRoundedIcon from "@mui/icons-material/EastRounded";
|
|
|
2
2
|
import WestRoundedIcon from "@mui/icons-material/WestRounded";
|
|
3
3
|
import { Typography } from "@mui/material";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { IconButton } from "../../../common/IconButton/iconButton";
|
|
6
6
|
import { Stack } from "../../../common/Stack/stack";
|
|
7
7
|
import { Pagination as TablePagination } from "./pagination.styles";
|
|
8
8
|
|
|
@@ -32,12 +32,14 @@ export const Pagination = ({
|
|
|
32
32
|
</Typography>
|
|
33
33
|
</div>
|
|
34
34
|
<Stack direction="row" gap={2}>
|
|
35
|
-
<
|
|
35
|
+
<IconButton
|
|
36
|
+
color="secondary"
|
|
36
37
|
disabled={!canPreviousPage}
|
|
37
38
|
Icon={WestRoundedIcon}
|
|
38
39
|
onClick={onPreviousPage}
|
|
39
40
|
/>
|
|
40
|
-
<
|
|
41
|
+
<IconButton
|
|
42
|
+
color="secondary"
|
|
41
43
|
disabled={!canNextPage}
|
|
42
44
|
Icon={EastRoundedIcon}
|
|
43
45
|
onClick={onNextPage}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import NLink from "next/link";
|
|
2
2
|
import React, { ElementType } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
ANCHOR_TARGET,
|
|
5
|
+
REL_ATTRIBUTE,
|
|
6
|
+
} from "../../../../Links/common/entities";
|
|
4
7
|
import { isClientSideNavigation } from "../../../../Links/common/utils";
|
|
5
8
|
import { ButtonPrimary } from "../ButtonPrimary/buttonPrimary";
|
|
6
9
|
|
|
@@ -31,7 +34,7 @@ export const CallToActionButton = ({
|
|
|
31
34
|
className={className}
|
|
32
35
|
disabled={disabled}
|
|
33
36
|
href="passHref"
|
|
34
|
-
rel=
|
|
37
|
+
rel={REL_ATTRIBUTE.NO_OPENER}
|
|
35
38
|
target={target || ANCHOR_TARGET.SELF}
|
|
36
39
|
>
|
|
37
40
|
{label}
|
|
@@ -42,7 +45,7 @@ export const CallToActionButton = ({
|
|
|
42
45
|
className={className}
|
|
43
46
|
disabled={disabled}
|
|
44
47
|
href={url}
|
|
45
|
-
rel=
|
|
48
|
+
rel={REL_ATTRIBUTE.NO_OPENER_NO_REFERRER}
|
|
46
49
|
target={target || ANCHOR_TARGET.BLANK}
|
|
47
50
|
>
|
|
48
51
|
{label}
|