@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
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
+
import { IconButton as MIconButton } from "@mui/material";
|
|
3
|
+
import { inkLight, smokeLight } from "../../../styles/common/mixins/colors";
|
|
2
4
|
export const Socials = styled.div `
|
|
3
5
|
display: flex;
|
|
4
6
|
`;
|
|
7
|
+
export const IconButton = styled(MIconButton) `
|
|
8
|
+
color: ${inkLight};
|
|
9
|
+
|
|
10
|
+
&:hover {
|
|
11
|
+
background-color: ${smokeLight};
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MenuProps as MMenuProps } from "@mui/material";
|
|
2
|
+
import { MouseEvent } from "react";
|
|
3
|
+
export interface UseMenuWithPosition {
|
|
4
|
+
anchorEl: MMenuProps["anchorEl"];
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onOpen: (event: MouseEvent<HTMLElement>) => void;
|
|
7
|
+
onToggleOpen: (event: MouseEvent<HTMLElement>) => void;
|
|
8
|
+
open: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Menu functionality for menu dropdown, with menu position.
|
|
12
|
+
* @returns menu functionality.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useMenuWithPosition: () => UseMenuWithPosition;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Menu functionality for menu dropdown, with menu position.
|
|
4
|
+
* @returns menu functionality.
|
|
5
|
+
*/
|
|
6
|
+
export const useMenuWithPosition = () => {
|
|
7
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
8
|
+
const open = useMemo(() => Boolean(anchorEl), [anchorEl]);
|
|
9
|
+
// Closes header menu.
|
|
10
|
+
const onClose = useCallback(() => {
|
|
11
|
+
setAnchorEl(null);
|
|
12
|
+
}, []);
|
|
13
|
+
// Opens header menu.
|
|
14
|
+
const onOpen = useCallback((event) => {
|
|
15
|
+
setAnchorEl(event.currentTarget);
|
|
16
|
+
}, []);
|
|
17
|
+
// Toggles menu open/close.
|
|
18
|
+
const onToggleOpen = useCallback((event) => {
|
|
19
|
+
if (open) {
|
|
20
|
+
setAnchorEl(null);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
setAnchorEl(event.currentTarget);
|
|
24
|
+
}
|
|
25
|
+
}, [open]);
|
|
26
|
+
return {
|
|
27
|
+
anchorEl,
|
|
28
|
+
onClose,
|
|
29
|
+
onOpen,
|
|
30
|
+
onToggleOpen,
|
|
31
|
+
open,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -6,7 +6,7 @@ import { DropDownIcon } from "../../components/common/Form/components/Select/com
|
|
|
6
6
|
import { desktopUp, mobileUp, tabletUp } from "./breakpoints";
|
|
7
7
|
import { alpha32, alpha60, alpha64, alpha80, black04, black08, white, } from "./palette";
|
|
8
8
|
import { strokeBottom, strokeTop } from "./shadows";
|
|
9
|
-
import { TEXT_BODY_400, TEXT_BODY_400_2_LINES, TEXT_BODY_500, TEXT_BODY_LARGE_500, TEXT_BODY_SMALL_400, TEXT_BODY_SMALL_500, TEXT_HEADING, } from "./typography";
|
|
9
|
+
import { TEXT_BODY_400, TEXT_BODY_400_2_LINES, TEXT_BODY_500, TEXT_BODY_LARGE_500, TEXT_BODY_SMALL_400, TEXT_BODY_SMALL_500, TEXT_HEADING, TEXT_HEADING_SMALL, } from "./typography";
|
|
10
10
|
// Constants
|
|
11
11
|
const FLEX_START = "flex-start";
|
|
12
12
|
/**
|
|
@@ -400,6 +400,22 @@ export const MuiButton = (theme) => {
|
|
|
400
400
|
},
|
|
401
401
|
},
|
|
402
402
|
},
|
|
403
|
+
{
|
|
404
|
+
props: {
|
|
405
|
+
variant: "backNav", // associated with "nav" variant.
|
|
406
|
+
},
|
|
407
|
+
style: {
|
|
408
|
+
...theme.typography[TEXT_HEADING_SMALL],
|
|
409
|
+
color: theme.palette.ink.main,
|
|
410
|
+
minWidth: 0,
|
|
411
|
+
textTransform: "capitalize",
|
|
412
|
+
whiteSpace: "nowrap",
|
|
413
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
414
|
+
"&:hover": {
|
|
415
|
+
backgroundColor: theme.palette.smoke.light,
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
},
|
|
403
419
|
{
|
|
404
420
|
props: {
|
|
405
421
|
variant: "nav",
|
|
@@ -822,12 +838,54 @@ export const MuiIconButton = (theme) => {
|
|
|
822
838
|
disableRipple: true,
|
|
823
839
|
},
|
|
824
840
|
styleOverrides: {
|
|
841
|
+
colorPrimary: {
|
|
842
|
+
backgroundColor: theme.palette.primary.main,
|
|
843
|
+
boxShadow: `0 1px 0 0 ${theme.palette.primary.dark}`,
|
|
844
|
+
color: theme.palette.common.white,
|
|
845
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
846
|
+
"&.Mui-disabled": {
|
|
847
|
+
backgroundColor: theme.palette.primary.main,
|
|
848
|
+
color: theme.palette.common.white,
|
|
849
|
+
opacity: 0.5,
|
|
850
|
+
},
|
|
851
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
852
|
+
"&:hover": {
|
|
853
|
+
backgroundColor: theme.palette.primary.dark,
|
|
854
|
+
},
|
|
855
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
856
|
+
"&:active": {
|
|
857
|
+
backgroundColor: theme.palette.primary.dark,
|
|
858
|
+
boxShadow: "none",
|
|
859
|
+
},
|
|
860
|
+
},
|
|
861
|
+
colorSecondary: {
|
|
862
|
+
backgroundColor: theme.palette.common.white,
|
|
863
|
+
boxShadow: `inset 0 0 0 1px ${theme.palette.smoke.dark}, 0 1px 0 0 ${black08}`,
|
|
864
|
+
color: theme.palette.ink.main,
|
|
865
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
866
|
+
"&.Mui-disabled": {
|
|
867
|
+
color: "inherit",
|
|
868
|
+
opacity: 0.5,
|
|
869
|
+
},
|
|
870
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
871
|
+
"&:hover": {
|
|
872
|
+
backgroundColor: theme.palette.smoke.lightest,
|
|
873
|
+
},
|
|
874
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
875
|
+
"&:active": {
|
|
876
|
+
backgroundColor: theme.palette.smoke.lightest,
|
|
877
|
+
boxShadow: `inset 0 0 0 1px ${theme.palette.smoke.dark}`,
|
|
878
|
+
},
|
|
879
|
+
},
|
|
825
880
|
root: {
|
|
826
881
|
borderRadius: 4,
|
|
827
882
|
},
|
|
828
883
|
sizeLarge: {
|
|
829
884
|
padding: 10,
|
|
830
885
|
},
|
|
886
|
+
sizeMedium: {
|
|
887
|
+
padding: "6px 8px",
|
|
888
|
+
},
|
|
831
889
|
sizeSmall: {
|
|
832
890
|
padding: 6,
|
|
833
891
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React, { ElementType } from "react";
|
|
2
2
|
import { ButtonPrimary } from "../../../../../common/Button/components/ButtonPrimary/buttonPrimary";
|
|
3
3
|
import { FluidPaper } from "../../../../../common/Paper/paper.styles";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ANCHOR_TARGET,
|
|
6
|
+
REL_ATTRIBUTE,
|
|
7
|
+
} from "../../../../../Links/common/entities";
|
|
5
8
|
import {
|
|
6
9
|
Section,
|
|
7
10
|
SectionActions,
|
|
@@ -18,7 +21,11 @@ export const ExportToTerraReady = ({
|
|
|
18
21
|
exportURL,
|
|
19
22
|
}: ExportToTerraReadyProps): JSX.Element => {
|
|
20
23
|
const onOpenTerra = (): void => {
|
|
21
|
-
window.open(
|
|
24
|
+
window.open(
|
|
25
|
+
exportURL,
|
|
26
|
+
ANCHOR_TARGET.BLANK,
|
|
27
|
+
REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
28
|
+
);
|
|
22
29
|
};
|
|
23
30
|
return (
|
|
24
31
|
<FluidPaper>
|
|
@@ -4,7 +4,10 @@ import { useAuthentication } from "../../../../../../../../../../hooks/useAuthen
|
|
|
4
4
|
import { TerraResponse } from "../../../../../../../../../../hooks/useAuthentication/useFetchTerraProfile";
|
|
5
5
|
import { useConfig } from "../../../../../../../../../../hooks/useConfig";
|
|
6
6
|
import { ButtonPrimary } from "../../../../../../../../../common/Button/components/ButtonPrimary/buttonPrimary";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
ANCHOR_TARGET,
|
|
9
|
+
REL_ATTRIBUTE,
|
|
10
|
+
} from "../../../../../../../../../Links/common/entities";
|
|
8
11
|
import { FormStep } from "../../formStep";
|
|
9
12
|
|
|
10
13
|
export interface AcceptTerraTOSProps {
|
|
@@ -25,7 +28,11 @@ export const AcceptTerraTOS = ({
|
|
|
25
28
|
|
|
26
29
|
const onOpenTerra = (): void => {
|
|
27
30
|
if (exportToTerraUrl) {
|
|
28
|
-
window.open(
|
|
31
|
+
window.open(
|
|
32
|
+
exportToTerraUrl,
|
|
33
|
+
ANCHOR_TARGET.BLANK,
|
|
34
|
+
REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
35
|
+
);
|
|
29
36
|
}
|
|
30
37
|
};
|
|
31
38
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import { ButtonPrimary } from "../../../../../../../../../common/Button/components/ButtonPrimary/buttonPrimary";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
ANCHOR_TARGET,
|
|
5
|
+
REL_ATTRIBUTE,
|
|
6
|
+
} from "../../../../../../../../../Links/common/entities";
|
|
4
7
|
import { FormStep } from "../../formStep";
|
|
5
8
|
|
|
6
9
|
export interface ConnectTerraToNIHAccountProps {
|
|
@@ -18,7 +21,7 @@ export const ConnectTerraToNIHAccount = ({
|
|
|
18
21
|
window.open(
|
|
19
22
|
"https://support.terra.bio/hc/en-us/articles/360038086332-Linking-authorization-accessing-controlled-data-on-external-servers",
|
|
20
23
|
ANCHOR_TARGET.BLANK,
|
|
21
|
-
|
|
24
|
+
REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
22
25
|
);
|
|
23
26
|
};
|
|
24
27
|
return (
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
import { useConfig } from "../../../../../../../../../../hooks/useConfig";
|
|
3
3
|
import { ButtonPrimary } from "../../../../../../../../../common/Button/components/ButtonPrimary/buttonPrimary";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ANCHOR_TARGET,
|
|
6
|
+
REL_ATTRIBUTE,
|
|
7
|
+
} from "../../../../../../../../../Links/common/entities";
|
|
5
8
|
import { FormStep } from "../../formStep";
|
|
6
9
|
|
|
7
10
|
export interface CreateTerraAccountProps {
|
|
@@ -20,7 +23,11 @@ export const CreateTerraAccount = ({
|
|
|
20
23
|
|
|
21
24
|
const onOpenTerra = (): void => {
|
|
22
25
|
if (exportToTerraUrl) {
|
|
23
|
-
window.open(
|
|
26
|
+
window.open(
|
|
27
|
+
exportToTerraUrl,
|
|
28
|
+
ANCHOR_TARGET.BLANK,
|
|
29
|
+
REL_ATTRIBUTE.NO_OPENER_NO_REFERRER
|
|
30
|
+
);
|
|
24
31
|
}
|
|
25
32
|
};
|
|
26
33
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Popover } from "@mui/material";
|
|
3
3
|
import { mediaDesktopSmallDown } from "../../../../styles/common/mixins/breakpoints";
|
|
4
|
-
import { smokeLight } from "../../../../styles/common/mixins/colors";
|
|
4
|
+
import { smokeLight, white } from "../../../../styles/common/mixins/colors";
|
|
5
|
+
import { IconButton as DXIconButton } from "../../../common/IconButton/iconButton";
|
|
5
6
|
|
|
6
7
|
export const FilterPopover = styled(Popover)`
|
|
7
8
|
.MuiPaper-menu {
|
|
@@ -17,3 +18,10 @@ export const FilterPopover = styled(Popover)`
|
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
`;
|
|
21
|
+
|
|
22
|
+
export const IconButton = styled(DXIconButton)`
|
|
23
|
+
color: ${white};
|
|
24
|
+
left: calc(100% + 4px);
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 4px;
|
|
27
|
+
`;
|
|
@@ -4,11 +4,10 @@ import React, { MouseEvent, ReactNode, useState } from "react";
|
|
|
4
4
|
import { SelectCategoryView } from "../../../../common/entities";
|
|
5
5
|
import { TrackFilterOpenedFunction } from "../../../../config/entities";
|
|
6
6
|
import { OnFilterFn } from "../../../../hooks/useCategoryFilter";
|
|
7
|
-
import { CloseDrawerIconButton } from "../../../common/IconButton/iconButton.styles";
|
|
8
7
|
import { FilterLabel } from "../FilterLabel/filterLabel";
|
|
9
8
|
import { FilterMenu } from "../FilterMenu/filterMenu";
|
|
10
9
|
import { DrawerTransition } from "./components/DrawerTransition/drawerTransition";
|
|
11
|
-
import { FilterPopover } from "./filter.styles";
|
|
10
|
+
import { FilterPopover, IconButton } from "./filter.styles";
|
|
12
11
|
|
|
13
12
|
const DEFAULT_POSITION: PopoverPosition = { left: 0, top: 0 };
|
|
14
13
|
const DEFAULT_SLOT_PROPS: PopoverProps["slotProps"] = {
|
|
@@ -94,7 +93,7 @@ export const Filter = ({
|
|
|
94
93
|
transitionDuration={TransitionDuration}
|
|
95
94
|
>
|
|
96
95
|
{isOpen && isFilterDrawer && (
|
|
97
|
-
<
|
|
96
|
+
<IconButton
|
|
98
97
|
Icon={CloseRounded}
|
|
99
98
|
onClick={onCloseFilters}
|
|
100
99
|
size="medium"
|
|
@@ -4,8 +4,8 @@ import { API_FILE_LOCATION_FETCH } from "../../../../apis/azul/common/constants"
|
|
|
4
4
|
import { useRequestFileLocation } from "../../../../hooks/useRequestFileLocation";
|
|
5
5
|
import { DownloadIcon } from "../../../common/CustomIcon/components/DownloadIcon/downloadIcon";
|
|
6
6
|
import { LoadingIcon } from "../../../common/CustomIcon/components/LoadingIcon/loadingIcon";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { IconButton } from "../../../common/IconButton/iconButton";
|
|
8
|
+
import { StyledIconButton } from "./azulFileDownload.styles";
|
|
9
9
|
|
|
10
10
|
export interface AzulFileDownloadProps {
|
|
11
11
|
url?: string; // Original "file fetch URL" as returned from Azul endpoint.
|
|
@@ -42,19 +42,20 @@ export const AzulFileDownload = ({
|
|
|
42
42
|
run();
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
onClick={onFileLocationRequested}
|
|
50
|
-
size="medium"
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
const mockButton = <LoadingIconButton />;
|
|
45
|
+
if (isDownloading)
|
|
46
|
+
return (
|
|
47
|
+
<StyledIconButton color="primary" Icon={LoadingIcon} size="medium" />
|
|
48
|
+
);
|
|
54
49
|
|
|
55
50
|
return (
|
|
56
51
|
<>
|
|
57
|
-
|
|
52
|
+
<IconButton
|
|
53
|
+
color="primary"
|
|
54
|
+
disabled={!url}
|
|
55
|
+
Icon={isLoading ? LoadingIcon : DownloadIcon}
|
|
56
|
+
onClick={onFileLocationRequested}
|
|
57
|
+
size="medium"
|
|
58
|
+
/>
|
|
58
59
|
<Box component="a" download ref={downloadRef} sx={{ display: "none" }} />
|
|
59
60
|
</>
|
|
60
61
|
);
|
|
@@ -73,13 +73,12 @@ const content = ({
|
|
|
73
73
|
padding-top: ${headerHeight}px;
|
|
74
74
|
`;
|
|
75
75
|
|
|
76
|
-
const navigation = ({
|
|
77
|
-
headerHeight,
|
|
78
|
-
panelColor,
|
|
79
|
-
theme,
|
|
80
|
-
}: GridProps & ThemeProps) => css`
|
|
76
|
+
const navigation = ({ panelColor, theme }: GridProps & ThemeProps) => css`
|
|
81
77
|
background-color: ${getPanelBackgroundColor(theme, panelColor)};
|
|
82
|
-
|
|
78
|
+
`;
|
|
79
|
+
|
|
80
|
+
const positioner = ({ headerHeight }: GridProps) => css`
|
|
81
|
+
max-height: 100vh;
|
|
83
82
|
overflow: auto;
|
|
84
83
|
padding-top: ${headerHeight}px;
|
|
85
84
|
position: sticky;
|
|
@@ -113,6 +112,10 @@ export const OutlineGrid = styled("div")<GridProps>`
|
|
|
113
112
|
}
|
|
114
113
|
`;
|
|
115
114
|
|
|
115
|
+
export const Positioner = styled.div<GridProps>`
|
|
116
|
+
${positioner};
|
|
117
|
+
`;
|
|
118
|
+
|
|
116
119
|
export const Navigation = styled.div`
|
|
117
120
|
box-sizing: content-box;
|
|
118
121
|
margin-left: auto;
|
|
@@ -6,10 +6,11 @@ import {
|
|
|
6
6
|
Content,
|
|
7
7
|
ContentGrid,
|
|
8
8
|
ContentLayout as Layout,
|
|
9
|
-
Navigation
|
|
9
|
+
Navigation,
|
|
10
10
|
NavigationGrid,
|
|
11
|
-
Outline
|
|
11
|
+
Outline,
|
|
12
12
|
OutlineGrid,
|
|
13
|
+
Positioner,
|
|
13
14
|
} from "./contentLayout.styles";
|
|
14
15
|
|
|
15
16
|
export interface ContentLayoutProps {
|
|
@@ -38,7 +39,9 @@ export const ContentLayout = ({
|
|
|
38
39
|
headerHeight={headerHeight}
|
|
39
40
|
panelColor={layoutStyle?.navigation}
|
|
40
41
|
>
|
|
41
|
-
<
|
|
42
|
+
<Positioner headerHeight={headerHeight}>
|
|
43
|
+
<Navigation>{navigation}</Navigation>
|
|
44
|
+
</Positioner>
|
|
42
45
|
</NavigationGrid>
|
|
43
46
|
)}
|
|
44
47
|
<ContentGrid
|
|
@@ -53,7 +56,9 @@ export const ContentLayout = ({
|
|
|
53
56
|
headerHeight={headerHeight}
|
|
54
57
|
panelColor={layoutStyle?.outline}
|
|
55
58
|
>
|
|
56
|
-
<
|
|
59
|
+
<Positioner headerHeight={headerHeight}>
|
|
60
|
+
<Outline>{outline}</Outline>
|
|
61
|
+
</Positioner>
|
|
57
62
|
</OutlineGrid>
|
|
58
63
|
)}
|
|
59
64
|
</Layout>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { AppBar as MAppBar } from "@mui/material";
|
|
3
3
|
import { mediaTabletUp } from "../../../../styles/common/mixins/breakpoints";
|
|
4
|
-
import { inkMain } from "../../../../styles/common/mixins/colors";
|
|
4
|
+
import { inkMain, smokeMain } from "../../../../styles/common/mixins/colors";
|
|
5
5
|
import { textBodySmall400 } from "../../../../styles/common/mixins/fonts";
|
|
6
6
|
import { Socials as DXSocials } from "../../../common/Socials/socials";
|
|
7
7
|
import { Link as DXLink } from "../../../Links/components/Link/link";
|
|
@@ -50,4 +50,9 @@ export const Link = styled(DXLink)`
|
|
|
50
50
|
|
|
51
51
|
export const Socials = styled(DXSocials)`
|
|
52
52
|
gap: 8px;
|
|
53
|
+
.MuiIconButton-root {
|
|
54
|
+
&:hover {
|
|
55
|
+
background-color: ${smokeMain};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
53
58
|
`;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Toolbar } from "@mui/material";
|
|
2
2
|
import React, { ReactNode } from "react";
|
|
3
|
-
import { IconButtonSocialsFooter } from "../../../common/IconButton/iconButton.styles";
|
|
4
3
|
import { Social } from "../../../common/Socials/socials";
|
|
5
4
|
import { ANCHOR_TARGET } from "../../../Links/common/entities";
|
|
6
5
|
import { NavLinkItem } from "../Header/components/Content/components/Navigation/navigation";
|
|
@@ -39,13 +38,7 @@ export const Footer = ({
|
|
|
39
38
|
url={url}
|
|
40
39
|
/>
|
|
41
40
|
))}
|
|
42
|
-
{socials &&
|
|
43
|
-
<Socials
|
|
44
|
-
buttonSize="small"
|
|
45
|
-
IconButtonElType={IconButtonSocialsFooter}
|
|
46
|
-
socials={socials}
|
|
47
|
-
/>
|
|
48
|
-
)}
|
|
41
|
+
{socials && <Socials buttonSize="small" socials={socials} />}
|
|
49
42
|
</Links>
|
|
50
43
|
)}
|
|
51
44
|
</Toolbar>
|
|
@@ -8,6 +8,11 @@ export type Navigation = [
|
|
|
8
8
|
NavLinkItem[] | undefined
|
|
9
9
|
]; // [LEFT, CENTER, RIGHT]
|
|
10
10
|
|
|
11
|
+
export enum SELECTED_MATCH {
|
|
12
|
+
EQUALS = "EQUALS",
|
|
13
|
+
STARTS_WITH = "STARTS_WITH", // Default value.
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
export interface SocialMedia {
|
|
12
17
|
label: ReactNode;
|
|
13
18
|
socials: Social[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReadonlyURLSearchParams } from "next/navigation";
|
|
2
|
+
import { SEARCH_PARAMETERS } from "./constants";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Return the search params, for the given search string.
|
|
6
|
+
* @param searchParams - Current search params.
|
|
7
|
+
* @param searchStr - Search string.
|
|
8
|
+
* @returns updated search params.
|
|
9
|
+
*/
|
|
10
|
+
export function getSearchParams(
|
|
11
|
+
searchParams: ReadonlyURLSearchParams,
|
|
12
|
+
searchStr: string
|
|
13
|
+
): URLSearchParams {
|
|
14
|
+
const params = new URLSearchParams(searchParams.toString());
|
|
15
|
+
params.set(SEARCH_PARAMETERS.QUERY, searchStr);
|
|
16
|
+
return params;
|
|
17
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Dialog, Input } from "@mui/material";
|
|
3
|
+
import {
|
|
4
|
+
inkLight,
|
|
5
|
+
smokeMain,
|
|
6
|
+
} from "../../../../../../../../../../../../styles/common/mixins/colors";
|
|
3
7
|
import { IconButton } from "../../../../../../../../../../../common/IconButton/iconButton";
|
|
4
8
|
import { HEADER_HEIGHT } from "../../../../../../../../common/constants";
|
|
5
9
|
|
|
@@ -22,16 +26,16 @@ export const SearchForm = styled.form`
|
|
|
22
26
|
`;
|
|
23
27
|
|
|
24
28
|
export const SearchInput = styled(Input)`
|
|
25
|
-
border-bottom: 1px solid ${
|
|
29
|
+
border-bottom: 1px solid ${smokeMain};
|
|
26
30
|
height: 40px;
|
|
27
31
|
padding: 0;
|
|
28
32
|
|
|
29
33
|
&&.Mui-focused ::placeholder {
|
|
30
|
-
color: ${
|
|
34
|
+
color: ${inkLight};
|
|
31
35
|
opacity: 1;
|
|
32
36
|
}
|
|
33
37
|
`;
|
|
34
38
|
|
|
35
39
|
export const ClearButton = styled(IconButton)`
|
|
36
|
-
color: ${
|
|
40
|
+
color: ${inkLight};
|
|
37
41
|
` as typeof IconButton;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
|
2
|
-
import
|
|
2
|
+
import { useSearchParams } from "next/navigation";
|
|
3
|
+
import Router from "next/router";
|
|
4
|
+
import React, {
|
|
5
|
+
ChangeEvent,
|
|
6
|
+
FormEvent,
|
|
7
|
+
useCallback,
|
|
8
|
+
useRef,
|
|
9
|
+
useState,
|
|
10
|
+
} from "react";
|
|
11
|
+
import { isValidUrl } from "../../../../../../../../../../../../common/utils";
|
|
3
12
|
import { ButtonPrimary } from "../../../../../../../../../../../common/Button/components/ButtonPrimary/buttonPrimary";
|
|
4
13
|
import { SearchIcon } from "../../../../../../../../../../../common/CustomIcon/components/SearchIcon/searchIcon";
|
|
14
|
+
import { isClientSideNavigation } from "../../../../../../../../../../../Links/common/utils";
|
|
15
|
+
import { getSearchParams } from "./common/utils";
|
|
5
16
|
import {
|
|
6
17
|
ClearButton,
|
|
7
18
|
SearchBar as SearchDialog,
|
|
@@ -23,6 +34,7 @@ export default function SearchBar({
|
|
|
23
34
|
searchURL,
|
|
24
35
|
}: Props): JSX.Element {
|
|
25
36
|
const inputRef = useRef<HTMLInputElement>(null);
|
|
37
|
+
const searchParams = useSearchParams();
|
|
26
38
|
const [searchTerm, setSearchTerm] = useState<string>("");
|
|
27
39
|
|
|
28
40
|
/**
|
|
@@ -58,21 +70,34 @@ export default function SearchBar({
|
|
|
58
70
|
* @param searchStr - Current search string.
|
|
59
71
|
* @param url - Current configured search path.
|
|
60
72
|
*/
|
|
61
|
-
const handleSubmit = (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
const handleSubmit = useCallback(
|
|
74
|
+
(
|
|
75
|
+
formEvent: FormEvent<HTMLFormElement>,
|
|
76
|
+
searchStr: string,
|
|
77
|
+
url?: string
|
|
78
|
+
): void => {
|
|
79
|
+
formEvent.preventDefault();
|
|
80
|
+
if (searchStr && url) {
|
|
81
|
+
closeMenu();
|
|
82
|
+
closeSearch();
|
|
83
|
+
if (isClientSideNavigation(url)) {
|
|
84
|
+
Router.push({
|
|
85
|
+
pathname: url,
|
|
86
|
+
search: getSearchParams(searchParams, searchStr).toString(),
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (isValidUrl(url)) {
|
|
91
|
+
// Build search URL and redirect to it.
|
|
92
|
+
const location = new URL(url);
|
|
93
|
+
location.search = getSearchParams(searchParams, searchStr).toString();
|
|
94
|
+
window.location.href = location.href;
|
|
95
|
+
}
|
|
96
|
+
throw new Error("Invalid search URL.");
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
[closeMenu, closeSearch, searchParams]
|
|
100
|
+
);
|
|
76
101
|
|
|
77
102
|
return (
|
|
78
103
|
<SearchDialog
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
+
import { SELECTED_MATCH } from "../../../../../common/entities";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Returns true if the navigation link is selected.
|
|
3
5
|
* @param url - The URL of the navigation link.
|
|
4
6
|
* @param pathname - The current pathname.
|
|
7
|
+
* @param selectedMatch - The selected match type.
|
|
5
8
|
* @returns true if the navigation link is selected.
|
|
6
9
|
*/
|
|
7
10
|
export function isNavigationLinkSelected(
|
|
8
11
|
url: string,
|
|
9
|
-
pathname?: string
|
|
12
|
+
pathname?: string,
|
|
13
|
+
selectedMatch: SELECTED_MATCH = SELECTED_MATCH.STARTS_WITH
|
|
10
14
|
): boolean {
|
|
11
15
|
if (!pathname) return false;
|
|
16
|
+
if (isSelectedMatchEqual(selectedMatch)) return url === pathname;
|
|
12
17
|
return pathname.startsWith(url);
|
|
13
18
|
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns true if the selected match type is "EQUAL".
|
|
22
|
+
* @param selectedMatch - The selected match type.
|
|
23
|
+
* @returns True if the selected match type is "EQUAL".
|
|
24
|
+
*/
|
|
25
|
+
export function isSelectedMatchEqual(selectedMatch: SELECTED_MATCH): boolean {
|
|
26
|
+
return selectedMatch === SELECTED_MATCH.EQUALS;
|
|
27
|
+
}
|