@databiosphere/findable-ui 8.0.2 → 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.
Files changed (126) hide show
  1. package/lib/components/Export/components/ExportToTerra/components/ExportToTerraReady/exportToTerraReady.js +2 -2
  2. package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/AcceptTerraTOS/acceptTerraTOS.js +2 -2
  3. package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/ConnectTerraToNIHAccount/connectTerraToNIHAccount.js +2 -2
  4. package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/CreateTerraAccount/createTerraAccount.js +2 -2
  5. package/lib/components/Filter/components/Filter/filter.js +2 -3
  6. package/lib/components/Filter/components/Filter/filter.styles.d.ts +3 -0
  7. package/lib/components/Filter/components/Filter/filter.styles.js +8 -1
  8. package/lib/components/Filter/components/FilterLabel/filterLabel.styles.d.ts +1 -1
  9. package/lib/components/Index/components/AzulFileDownload/azulFileDownload.js +5 -5
  10. package/lib/components/Index/components/AzulFileDownload/azulFileDownload.styles.d.ts +3 -0
  11. package/lib/components/Index/components/AzulFileDownload/azulFileDownload.styles.js +5 -0
  12. package/lib/components/Layout/components/ContentLayout/contentLayout.js +5 -3
  13. package/lib/components/Layout/components/ContentLayout/contentLayout.styles.d.ts +4 -0
  14. package/lib/components/Layout/components/ContentLayout/contentLayout.styles.js +7 -2
  15. package/lib/components/Layout/components/Footer/footer.js +1 -2
  16. package/lib/components/Layout/components/Footer/footer.styles.js +6 -1
  17. package/lib/components/Layout/components/Header/common/entities.d.ts +4 -0
  18. package/lib/components/Layout/components/Header/common/entities.js +5 -1
  19. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Authentication/components/RequestAuthentication/requestAuthentication.styles.d.ts +1 -1
  20. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Menu/components/Toolbar/toolbar.js +9 -7
  21. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/constants.d.ts +4 -0
  22. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/constants.js +4 -0
  23. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/utils.d.ts +8 -0
  24. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/utils.js +12 -0
  25. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.js +23 -7
  26. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.js +4 -3
  27. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +1 -1
  28. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.js +2 -5
  29. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.styles.d.ts +3 -0
  30. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.styles.js +11 -0
  31. package/lib/components/Layout/components/Header/components/Content/components/Navigation/common/utils.d.ts +15 -0
  32. package/lib/components/Layout/components/Header/components/Content/components/Navigation/common/utils.js +23 -0
  33. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationButtonLabel/navigationButtonLabel.d.ts +5 -0
  34. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationButtonLabel/navigationButtonLabel.js +5 -0
  35. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.js +3 -4
  36. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.styles.d.ts +3 -0
  37. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.styles.js +23 -2
  38. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/common/constants.d.ts +4 -0
  39. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/common/constants.js +19 -0
  40. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.d.ts +2 -1
  41. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.js +20 -19
  42. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.styles.d.ts +30 -0
  43. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.styles.js +16 -1
  44. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.js +13 -7
  45. package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.d.ts +2 -0
  46. package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.js +11 -6
  47. package/lib/components/Layout/components/Header/components/Content/components/Slogan/slogan.styles.js +3 -1
  48. package/lib/components/Layout/components/Header/header.styles.js +7 -0
  49. package/lib/components/Layout/components/Nav/nav.styles.js +6 -0
  50. package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.js +2 -3
  51. package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.d.ts +3 -0
  52. package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.js +8 -1
  53. package/lib/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.styles.js +1 -1
  54. package/lib/components/Layout/components/Sidebar/sidebar.styles.js +2 -1
  55. package/lib/components/Links/common/entities.d.ts +4 -0
  56. package/lib/components/Links/common/entities.js +5 -0
  57. package/lib/components/Links/common/utils.js +1 -1
  58. package/lib/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.js +2 -2
  59. package/lib/components/Links/components/Link/link.d.ts +1 -1
  60. package/lib/components/Links/components/Link/link.js +5 -5
  61. package/lib/components/Table/components/Pagination/pagination.js +3 -3
  62. package/lib/components/common/Button/components/CallToActionButton/callToActionButton.js +2 -2
  63. package/lib/components/common/Button/components/HelpIconButton/helpIconButton.js +3 -3
  64. package/lib/components/common/Card/components/CardActionArea/cardActionArea.js +2 -2
  65. package/lib/components/common/IconButton/iconButton.styles.d.ts +0 -15
  66. package/lib/components/common/IconButton/iconButton.styles.js +0 -82
  67. package/lib/components/common/Socials/socials.d.ts +1 -1
  68. package/lib/components/common/Socials/socials.js +4 -5
  69. package/lib/components/common/Socials/socials.styles.d.ts +1 -0
  70. package/lib/components/common/Socials/socials.styles.js +9 -0
  71. package/lib/hooks/useMenuWithPosition.d.ts +14 -0
  72. package/lib/hooks/useMenuWithPosition.js +33 -0
  73. package/lib/theme/common/components.js +59 -1
  74. package/package.json +1 -1
  75. package/src/components/Export/components/ExportToTerra/components/ExportToTerraReady/exportToTerraReady.tsx +9 -2
  76. package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/AcceptTerraTOS/acceptTerraTOS.tsx +9 -2
  77. package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/ConnectTerraToNIHAccount/connectTerraToNIHAccount.tsx +5 -2
  78. package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/CreateTerraAccount/createTerraAccount.tsx +9 -2
  79. package/src/components/Filter/components/Filter/filter.styles.ts +9 -1
  80. package/src/components/Filter/components/Filter/filter.tsx +2 -3
  81. package/src/components/Index/components/AzulFileDownload/azulFileDownload.styles.ts +6 -0
  82. package/src/components/Index/components/AzulFileDownload/azulFileDownload.tsx +13 -12
  83. package/src/components/Layout/components/ContentLayout/contentLayout.styles.ts +9 -6
  84. package/src/components/Layout/components/ContentLayout/contentLayout.tsx +9 -4
  85. package/src/components/Layout/components/Footer/footer.styles.ts +6 -1
  86. package/src/components/Layout/components/Footer/footer.tsx +1 -8
  87. package/src/components/Layout/components/Header/common/entities.ts +5 -0
  88. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Menu/components/Toolbar/toolbar.tsx +23 -20
  89. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/constants.ts +4 -0
  90. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/utils.ts +17 -0
  91. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.ts +7 -3
  92. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.tsx +41 -16
  93. package/src/components/Layout/components/Header/components/Content/components/Logo/logo.styles.ts +12 -0
  94. package/src/components/Layout/components/Header/components/Content/components/Logo/logo.tsx +6 -18
  95. package/src/components/Layout/components/Header/components/Content/components/Navigation/common/utils.ts +27 -0
  96. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationButtonLabel/navigationButtonLabel.tsx +22 -0
  97. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.styles.ts +27 -2
  98. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.tsx +8 -5
  99. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/common/constants.ts +23 -0
  100. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.styles.ts +17 -1
  101. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.tsx +25 -23
  102. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.tsx +26 -5
  103. package/src/components/Layout/components/Header/components/Content/components/Navigation/navigation.tsx +29 -6
  104. package/src/components/Layout/components/Header/components/Content/components/Slogan/slogan.styles.ts +3 -1
  105. package/src/components/Layout/components/Header/header.styles.ts +7 -0
  106. package/src/components/Layout/components/Nav/nav.styles.ts +6 -0
  107. package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.ts +12 -1
  108. package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.tsx +2 -7
  109. package/src/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.styles.ts +1 -1
  110. package/src/components/Layout/components/Sidebar/sidebar.styles.ts +2 -1
  111. package/src/components/Links/common/entities.ts +5 -0
  112. package/src/components/Links/common/utils.ts +1 -1
  113. package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +2 -1
  114. package/src/components/Links/components/Link/link.tsx +12 -4
  115. package/src/components/Table/components/Pagination/pagination.tsx +5 -3
  116. package/src/components/common/Button/components/CallToActionButton/callToActionButton.tsx +6 -3
  117. package/src/components/common/Button/components/HelpIconButton/helpIconButton.tsx +6 -3
  118. package/src/components/common/Card/components/CardActionArea/cardActionArea.tsx +9 -2
  119. package/src/components/common/IconButton/iconButton.styles.ts +0 -88
  120. package/src/components/common/Socials/socials.styles.ts +10 -0
  121. package/src/components/common/Socials/socials.tsx +12 -10
  122. package/src/hooks/useMenuWithPosition.ts +49 -0
  123. package/src/theme/common/components.ts +59 -0
  124. package/types/data-explorer-ui.d.ts +1 -0
  125. package/src/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.tsx +0 -15
  126. package/src/components/common/IconButton/components/LoadingIconButton/loadingIconButton.tsx +0 -15
@@ -2,7 +2,6 @@ import { css } from "@emotion/react";
2
2
  import styled from "@emotion/styled";
3
3
  import { IconButton as MIconButton } from "@mui/material";
4
4
  import { smokeLightest } from "../../../styles/common/mixins/colors";
5
- import { IconButton } from "./iconButton";
6
5
  export const Button = styled(MIconButton, {
7
6
  shouldForwardProp: (prop) => prop !== "open",
8
7
  }) `
@@ -13,84 +12,3 @@ export const Button = styled(MIconButton, {
13
12
  }
14
13
  `}
15
14
  `;
16
- // Primary icon button.
17
- export const IconButtonPrimary = styled(IconButton) `
18
- background-color: ${({ theme }) => theme.palette.primary.main};
19
- box-shadow: 0 1px 0 0 ${({ theme }) => theme.palette.primary.dark};
20
- color: ${({ theme }) => theme.palette.common.white};
21
-
22
- // Medium sized primary icon button.
23
- &.MuiIconButton-sizeMedium {
24
- padding: 6px 8px; // Overrides medium sized button theme top and bottom padding.
25
- }
26
-
27
- &:active,
28
- &:hover {
29
- background-color: ${({ theme }) => theme.palette.primary.dark};
30
- }
31
-
32
- &:active {
33
- box-shadow: none;
34
- }
35
-
36
- &.Mui-disabled {
37
- background-color: ${({ theme }) => theme.palette.primary.main};
38
- color: ${({ theme }) => theme.palette.common.white};
39
- opacity: 0.5;
40
- }
41
- `;
42
- // Secondary icon button.
43
- export const IconButtonSecondary = styled(IconButton) `
44
- background-color: ${({ theme }) => theme.palette.common.white};
45
- box-shadow: inset 0 0 0 1px ${({ theme }) => theme.palette.smoke.dark},
46
- 0px 1px 0px 0px rgba(0, 0, 0, 0.08);
47
- color: ${({ theme }) => theme.palette.ink.main};
48
-
49
- &:active, &:hover {
50
- background-color: ${({ theme }) => theme.palette.smoke.lightest};
51
- }
52
-
53
- &:active {
54
- box-shadow: inset 0 0 0 1px ${({ theme }) => theme.palette.smoke.dark};
55
- }
56
-
57
- &:disabled {
58
- color: inherit;
59
- opacity: 0.5;
60
- }
61
- }
62
- `;
63
- // Mock icon button.
64
- export const MockIconButtonPrimary = styled.span `
65
- background-color: ${({ theme }) => theme.palette.primary.main};
66
- border-radius: 4px;
67
- box-shadow: 0 1px 0 0 ${({ theme }) => theme.palette.primary.dark};
68
- color: ${({ theme }) => theme.palette.common.white};
69
- display: flex;
70
- flex: none;
71
- height: 32px;
72
- padding: 6px 8px;
73
- `;
74
- // Drawer backdrop close icon button.
75
- export const CloseDrawerIconButton = styled(IconButton) `
76
- color: ${({ theme }) => theme.palette.common.white};
77
- left: calc(100% + 4px);
78
- position: absolute;
79
- top: 4px;
80
- `;
81
- // Socials icon button.
82
- export const IconButtonSocials = styled(MIconButton) `
83
- color: ${({ theme }) => theme.palette.ink.light};
84
-
85
- &:hover {
86
- background-color: ${({ theme }) => theme.palette.smoke.light};
87
- }
88
- `;
89
- // Socials icon button - footer component.
90
- export const IconButtonSocialsFooter = styled(MIconButton) `
91
- color: ${({ theme }) => theme.palette.ink.light};
92
-
93
- &:hover {
94
- background-color: ${({ theme }) => theme.palette.smoke.main};
95
- }
96
- `;
@@ -8,7 +8,7 @@ export interface Social {
8
8
  export interface SocialsProps {
9
9
  buttonSize?: MIconButtonProps["size"];
10
10
  className?: string;
11
- IconButtonElType?: ElementType;
11
+ IconButton?: ElementType;
12
12
  socials: Social[];
13
13
  style?: CSSProperties;
14
14
  }
@@ -1,8 +1,7 @@
1
1
  import React, { forwardRef, } from "react";
2
- import { ANCHOR_TARGET } from "../../Links/common/entities";
3
- import { IconButtonSocials } from "../IconButton/iconButton.styles";
4
- import { Socials as IconButtons } from "./socials.styles";
5
- export const Socials = forwardRef(function Socials({ buttonSize = "medium", className, IconButtonElType = IconButtonSocials, socials, style, }, ref) {
6
- return (React.createElement(IconButtons, { className: className, ref: ref, style: style }, socials.map(({ Icon, url }, i) => (React.createElement(IconButtonElType, { key: i, href: url, rel: "noopener noreferrer", size: buttonSize, target: ANCHOR_TARGET.BLANK },
2
+ import { ANCHOR_TARGET, REL_ATTRIBUTE } from "../../Links/common/entities";
3
+ import { IconButton as StyledIconButton, Socials as StyledSocials, } from "./socials.styles";
4
+ export const Socials = forwardRef(function Socials({ buttonSize = "medium", className, IconButton = StyledIconButton, socials, style, }, ref) {
5
+ return (React.createElement(StyledSocials, { className: className, ref: ref, style: style }, socials.map(({ Icon, url }, i) => (React.createElement(IconButton, { key: i, href: url, rel: REL_ATTRIBUTE.NO_OPENER_NO_REFERRER, size: buttonSize, target: ANCHOR_TARGET.BLANK },
7
6
  React.createElement(Icon, { fontSize: "small" }))))));
8
7
  });
@@ -3,3 +3,4 @@ export declare const Socials: import("@emotion/styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
4
  as?: import("react").ElementType<any> | undefined;
5
5
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
+ export declare const IconButton: import("@mui/material").ExtendButtonBase<import("@mui/material").IconButtonTypeMap<{}, "button">>;
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@databiosphere/findable-ui",
3
- "version": "8.0.2",
3
+ "version": "9.0.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -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 { ANCHOR_TARGET } from "../../../../../Links/common/entities";
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(exportURL, ANCHOR_TARGET.BLANK, "noopener noreferrer");
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 { ANCHOR_TARGET } from "../../../../../../../../../Links/common/entities";
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(exportToTerraUrl, ANCHOR_TARGET.BLANK, "noopener noreferrer");
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 { ANCHOR_TARGET } from "../../../../../../../../../Links/common/entities";
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
- "noopener noreferrer"
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 { ANCHOR_TARGET } from "../../../../../../../../../Links/common/entities";
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(exportToTerraUrl, ANCHOR_TARGET.BLANK, "noopener noreferrer");
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
- <CloseDrawerIconButton
96
+ <IconButton
98
97
  Icon={CloseRounded}
99
98
  onClick={onCloseFilters}
100
99
  size="medium"
@@ -0,0 +1,6 @@
1
+ import styled from "@emotion/styled";
2
+ import { IconButton as DXIconButton } from "../../../common/IconButton/iconButton";
3
+
4
+ export const StyledIconButton = styled(DXIconButton)`
5
+ pointer-events: none;
6
+ `;
@@ -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 { LoadingIconButton } from "../../../common/IconButton/components/LoadingIconButton/loadingIconButton";
8
- import { IconButtonPrimary } from "../../../common/IconButton/iconButton.styles";
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
- const realButton = (
46
- <IconButtonPrimary
47
- disabled={!url}
48
- Icon={isLoading ? LoadingIcon : DownloadIcon}
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
- {isDownloading ? mockButton : realButton}
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
- max-height: calc(100vh - ${headerHeight}px);
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 as NavigationPositioner,
9
+ Navigation,
10
10
  NavigationGrid,
11
- Outline as OutlinePositioner,
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
- <NavigationPositioner>{navigation}</NavigationPositioner>
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
- <OutlinePositioner>{outline}</OutlinePositioner>
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[];
@@ -2,6 +2,7 @@ import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
2
2
  import { IconButton, Toolbar as MToolbar } from "@mui/material";
3
3
  import React, { Fragment, ReactNode } from "react";
4
4
  import { ComponentsConfig } from "../../../../../../../../../../../../config/entities";
5
+ import { Left, Right } from "../../../../../../../../header.styles";
5
6
  import { Announcements } from "../../../../../../../Announcements/announcements";
6
7
  import { Actions } from "../../../../actions";
7
8
  import { Authentication } from "../../../Authentication/authentication";
@@ -30,26 +31,28 @@ export const Toolbar = ({
30
31
  <Fragment>
31
32
  <Announcements announcements={announcements} />
32
33
  <MToolbar>
33
- {logo}
34
- <Actions>
35
- {/* Search */}
36
- <Search
37
- closeMenu={onClose}
38
- searchEnabled={searchEnabled}
39
- searchURL={searchURL}
40
- />
41
- {/* Authentication */}
42
- <Authentication
43
- authenticationEnabled={authenticationEnabled}
44
- closeMenu={onClose}
45
- />
46
- {/* Additional actions i.e. call-to-action button */}
47
- {actions}
48
- {/* Close menu */}
49
- <IconButton color="ink" onClick={onClose}>
50
- <CloseRoundedIcon />
51
- </IconButton>
52
- </Actions>
34
+ <Left>{logo}</Left>
35
+ <Right>
36
+ <Actions>
37
+ {/* Search */}
38
+ <Search
39
+ closeMenu={onClose}
40
+ searchEnabled={searchEnabled}
41
+ searchURL={searchURL}
42
+ />
43
+ {/* Authentication */}
44
+ <Authentication
45
+ authenticationEnabled={authenticationEnabled}
46
+ closeMenu={onClose}
47
+ />
48
+ {/* Additional actions i.e. call-to-action button */}
49
+ {actions}
50
+ {/* Close menu */}
51
+ <IconButton color="ink" onClick={onClose}>
52
+ <CloseRoundedIcon />
53
+ </IconButton>
54
+ </Actions>
55
+ </Right>
53
56
  </MToolbar>
54
57
  </Fragment>
55
58
  );