@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
@@ -1,11 +1,11 @@
1
1
  import React 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 { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../../Links/common/entities";
5
5
  import { Section, SectionActions, SectionContent, } from "../../../../export.styles";
6
6
  export const ExportToTerraReady = ({ ExportToTerraSuccess, exportURL, }) => {
7
7
  const onOpenTerra = () => {
8
- window.open(exportURL, ANCHOR_TARGET.BLANK, "noopener noreferrer");
8
+ window.open(exportURL, ANCHOR_TARGET.BLANK, REL_ATTRIBUTE.NO_OPENER_NO_REFERRER);
9
9
  };
10
10
  return (React.createElement(FluidPaper, null,
11
11
  React.createElement(Section, null,
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import { useAuthentication } from "../../../../../../../../../../hooks/useAuthentication/useAuthentication";
3
3
  import { useConfig } from "../../../../../../../../../../hooks/useConfig";
4
4
  import { ButtonPrimary } from "../../../../../../../../../common/Button/components/ButtonPrimary/buttonPrimary";
5
- import { ANCHOR_TARGET } from "../../../../../../../../../Links/common/entities";
5
+ import { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../../../../../../Links/common/entities";
6
6
  import { FormStep } from "../../formStep";
7
7
  export const AcceptTerraTOS = ({ active, completed, step, }) => {
8
8
  const { config } = useConfig();
@@ -11,7 +11,7 @@ export const AcceptTerraTOS = ({ active, completed, step, }) => {
11
11
  const isTOSAccepted = isTermsOfServiceAccepted(terraProfileLoginStatus);
12
12
  const onOpenTerra = () => {
13
13
  if (exportToTerraUrl) {
14
- window.open(exportToTerraUrl, ANCHOR_TARGET.BLANK, "noopener noreferrer");
14
+ window.open(exportToTerraUrl, ANCHOR_TARGET.BLANK, REL_ATTRIBUTE.NO_OPENER_NO_REFERRER);
15
15
  }
16
16
  };
17
17
  return (React.createElement(FormStep, { action: React.createElement(ButtonPrimary, { onClick: onOpenTerra }, "Go to Terra"), active: active, completed: completed, step: step, text: isTOSAccepted ? (React.createElement("p", null, "Terra's terms of service have changed. Please login to Terra to accept the updated terms of service.")) : (React.createElement("p", null, "For full access to the Data Explorer, please sign in to Terra and review and accept the Terra terms of service when prompted.")), title: "Accept the Terra terms of service" }));
@@ -1,10 +1,10 @@
1
1
  import React from "react";
2
2
  import { ButtonPrimary } from "../../../../../../../../../common/Button/components/ButtonPrimary/buttonPrimary";
3
- import { ANCHOR_TARGET } from "../../../../../../../../../Links/common/entities";
3
+ import { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../../../../../../Links/common/entities";
4
4
  import { FormStep } from "../../formStep";
5
5
  export const ConnectTerraToNIHAccount = ({ active, completed, step, }) => {
6
6
  const onGotoTutorial = () => {
7
- window.open("https://support.terra.bio/hc/en-us/articles/360038086332-Linking-authorization-accessing-controlled-data-on-external-servers", ANCHOR_TARGET.BLANK, "noopener noreferrer");
7
+ window.open("https://support.terra.bio/hc/en-us/articles/360038086332-Linking-authorization-accessing-controlled-data-on-external-servers", ANCHOR_TARGET.BLANK, REL_ATTRIBUTE.NO_OPENER_NO_REFERRER);
8
8
  };
9
9
  return (React.createElement(FormStep, { action: React.createElement(ButtonPrimary, { onClick: onGotoTutorial }, "Go to Tutorial"), active: active, completed: completed, step: step, text: React.createElement("p", null, "Next, connect your Terra account to your NIH account by following the tutorial below."), title: "Connect Terra to your NIH account" }));
10
10
  };
@@ -1,14 +1,14 @@
1
1
  import React 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 { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../../../../../../Links/common/entities";
5
5
  import { FormStep } from "../../formStep";
6
6
  export const CreateTerraAccount = ({ active, completed, step, }) => {
7
7
  const { config } = useConfig();
8
8
  const { exportToTerraUrl } = config;
9
9
  const onOpenTerra = () => {
10
10
  if (exportToTerraUrl) {
11
- window.open(exportToTerraUrl, ANCHOR_TARGET.BLANK, "noopener noreferrer");
11
+ window.open(exportToTerraUrl, ANCHOR_TARGET.BLANK, REL_ATTRIBUTE.NO_OPENER_NO_REFERRER);
12
12
  }
13
13
  };
14
14
  return (React.createElement(FormStep, { action: React.createElement(ButtonPrimary, { onClick: onOpenTerra }, "Go to Terra"), active: active, completed: completed, step: step, text: React.createElement("p", null, "Create a Terra account using the same email that you used to log in to data explorer."), title: "Create a Terra account" }));
@@ -1,11 +1,10 @@
1
1
  import { CloseRounded } from "@mui/icons-material";
2
2
  import { Grow } from "@mui/material";
3
3
  import React, { useState } from "react";
4
- import { CloseDrawerIconButton } from "../../../common/IconButton/iconButton.styles";
5
4
  import { FilterLabel } from "../FilterLabel/filterLabel";
6
5
  import { FilterMenu } from "../FilterMenu/filterMenu";
7
6
  import { DrawerTransition } from "./components/DrawerTransition/drawerTransition";
8
- import { FilterPopover } from "./filter.styles";
7
+ import { FilterPopover, IconButton } from "./filter.styles";
9
8
  const DEFAULT_POSITION = { left: 0, top: 0 };
10
9
  const DEFAULT_SLOT_PROPS = {
11
10
  paper: { variant: "menu" },
@@ -51,7 +50,7 @@ export const Filter = ({ categorySection, categoryView, closeAncestor, isFilterD
51
50
  return (React.createElement(React.Fragment, null,
52
51
  React.createElement(FilterLabel, { count: categoryView.values.length, disabled: categoryView.isDisabled, label: categoryView.label, onClick: onOpenFilter }),
53
52
  React.createElement(FilterPopover, { anchorPosition: anchorPosition, anchorReference: "anchorPosition", marginThreshold: 0, onClose: onCloseFilters, open: isOpen, slotProps: slotProps, TransitionComponent: TransitionComponent, transitionDuration: TransitionDuration },
54
- isOpen && isFilterDrawer && (React.createElement(CloseDrawerIconButton, { Icon: CloseRounded, onClick: onCloseFilters, size: "medium" })),
53
+ isOpen && isFilterDrawer && (React.createElement(IconButton, { Icon: CloseRounded, onClick: onCloseFilters, size: "medium" })),
55
54
  React.createElement(FilterMenu, { categorySection: categorySection, categoryKey: categoryView.key, categoryLabel: categoryView.label, isFilterDrawer: isFilterDrawer, onFilter: onFilter, onCloseFilter: onCloseFilter, values: categoryView.values })),
56
55
  tags));
57
56
  };
@@ -1,3 +1,6 @@
1
1
  export declare const FilterPopover: import("@emotion/styled").StyledComponent<import("@mui/material").PopoverProps & {
2
2
  theme?: import("@emotion/react").Theme | undefined;
3
3
  }, {}, {}>;
4
+ export declare const IconButton: import("@emotion/styled").StyledComponent<import("../../../common/IconButton/iconButton").IconButtonProps & {
5
+ theme?: import("@emotion/react").Theme | undefined;
6
+ }, {}, {}>;
@@ -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
  export const FilterPopover = styled(Popover) `
6
7
  .MuiPaper-menu {
7
8
  margin: 0;
@@ -16,3 +17,9 @@ export const FilterPopover = styled(Popover) `
16
17
  }
17
18
  }
18
19
  `;
20
+ export const IconButton = styled(DXIconButton) `
21
+ color: ${white};
22
+ left: calc(100% + 4px);
23
+ position: absolute;
24
+ top: 4px;
25
+ `;
@@ -12,7 +12,7 @@ export declare const FilterLabel: import("@emotion/styled").StyledComponent<{
12
12
  size?: "large" | "medium" | "small" | undefined;
13
13
  startIcon?: import("react").ReactNode;
14
14
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
15
- variant?: "nav" | "text" | "outlined" | "contained" | "activeNav" | undefined;
15
+ variant?: "nav" | "text" | "outlined" | "contained" | "activeNav" | "backNav" | undefined;
16
16
  } & Omit<{
17
17
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
18
18
  centerRipple?: boolean | undefined;
@@ -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
  export const AzulFileDownload = ({ url, }) => {
10
10
  const downloadRef = useRef(null);
11
11
  // Used to prevent the download button from being clicked twice
@@ -31,10 +31,10 @@ export const AzulFileDownload = ({ url, }) => {
31
31
  setIsDownloading(true);
32
32
  run();
33
33
  };
34
- const realButton = (React.createElement(IconButtonPrimary, { disabled: !url, Icon: isLoading ? LoadingIcon : DownloadIcon, onClick: onFileLocationRequested, size: "medium" }));
35
- const mockButton = React.createElement(LoadingIconButton, null);
34
+ if (isDownloading)
35
+ return (React.createElement(StyledIconButton, { color: "primary", Icon: LoadingIcon, size: "medium" }));
36
36
  return (React.createElement(React.Fragment, null,
37
- isDownloading ? mockButton : realButton,
37
+ React.createElement(IconButton, { color: "primary", disabled: !url, Icon: isLoading ? LoadingIcon : DownloadIcon, onClick: onFileLocationRequested, size: "medium" }),
38
38
  React.createElement(Box, { component: "a", download: true, ref: downloadRef, sx: { display: "none" } })));
39
39
  };
40
40
  /**
@@ -0,0 +1,3 @@
1
+ export declare const StyledIconButton: import("@emotion/styled").StyledComponent<import("../../../common/IconButton/iconButton").IconButtonProps & {
2
+ theme?: import("@emotion/react").Theme | undefined;
3
+ }, {}, {}>;
@@ -0,0 +1,5 @@
1
+ import styled from "@emotion/styled";
2
+ import { IconButton as DXIconButton } from "../../../common/IconButton/iconButton";
3
+ export const StyledIconButton = styled(DXIconButton) `
4
+ pointer-events: none;
5
+ `;
@@ -1,17 +1,19 @@
1
1
  import { useRouter } from "next/router";
2
2
  import React from "react";
3
3
  import { useLayoutState } from "../../../../hooks/useLayoutState";
4
- import { Content, ContentGrid, ContentLayout as Layout, Navigation as NavigationPositioner, NavigationGrid, Outline as OutlinePositioner, OutlineGrid, } from "./contentLayout.styles";
4
+ import { Content, ContentGrid, ContentLayout as Layout, Navigation, NavigationGrid, Outline, OutlineGrid, Positioner, } from "./contentLayout.styles";
5
5
  export const ContentLayout = ({ className, content, layoutStyle, navigation, outline, }) => {
6
6
  const { asPath } = useRouter();
7
7
  const { layoutState: { headerHeight }, } = useLayoutState();
8
8
  return (React.createElement(Layout, { className: className, panelColor: layoutStyle?.content },
9
9
  navigation && (React.createElement(NavigationGrid, { headerHeight: headerHeight, panelColor: layoutStyle?.navigation },
10
- React.createElement(NavigationPositioner, null, navigation))),
10
+ React.createElement(Positioner, { headerHeight: headerHeight },
11
+ React.createElement(Navigation, null, navigation)))),
11
12
  React.createElement(ContentGrid, { headerHeight: headerHeight, panelColor: layoutStyle?.content },
12
13
  React.createElement(Content, null, content)),
13
14
  outline && (React.createElement(OutlineGrid, { key: getOutlineKey(asPath), headerHeight: headerHeight, panelColor: layoutStyle?.outline },
14
- React.createElement(OutlinePositioner, null, outline)))));
15
+ React.createElement(Positioner, { headerHeight: headerHeight },
16
+ React.createElement(Outline, null, outline))))));
15
17
  };
16
18
  /**
17
19
  * Returns outline key.
@@ -23,6 +23,10 @@ export declare const OutlineGrid: import("@emotion/styled").StyledComponent<{
23
23
  theme?: import("@emotion/react").Theme | undefined;
24
24
  as?: import("react").ElementType<any> | undefined;
25
25
  } & GridProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
+ export declare const Positioner: import("@emotion/styled").StyledComponent<{
27
+ theme?: import("@emotion/react").Theme | undefined;
28
+ as?: import("react").ElementType<any> | undefined;
29
+ } & GridProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
26
30
  export declare const Navigation: import("@emotion/styled").StyledComponent<{
27
31
  theme?: import("@emotion/react").Theme | undefined;
28
32
  as?: import("react").ElementType<any> | undefined;
@@ -40,9 +40,11 @@ const content = ({ headerHeight, panelColor, theme, }) => css `
40
40
  background-color: ${getPanelBackgroundColor(theme, panelColor)};
41
41
  padding-top: ${headerHeight}px;
42
42
  `;
43
- const navigation = ({ headerHeight, panelColor, theme, }) => css `
43
+ const navigation = ({ panelColor, theme }) => css `
44
44
  background-color: ${getPanelBackgroundColor(theme, panelColor)};
45
- max-height: calc(100vh - ${headerHeight}px);
45
+ `;
46
+ const positioner = ({ headerHeight }) => css `
47
+ max-height: 100vh;
46
48
  overflow: auto;
47
49
  padding-top: ${headerHeight}px;
48
50
  position: sticky;
@@ -72,6 +74,9 @@ export const OutlineGrid = styled("div") `
72
74
  display: block;
73
75
  }
74
76
  `;
77
+ export const Positioner = styled.div `
78
+ ${positioner};
79
+ `;
75
80
  export const Navigation = styled.div `
76
81
  box-sizing: content-box;
77
82
  margin-left: auto;
@@ -1,6 +1,5 @@
1
1
  import { Toolbar } from "@mui/material";
2
2
  import React from "react";
3
- import { IconButtonSocialsFooter } from "../../../common/IconButton/iconButton.styles";
4
3
  import { ANCHOR_TARGET } from "../../../Links/common/entities";
5
4
  import { AppBar, Link, Links, Socials } from "./footer.styles";
6
5
  export const Footer = ({ Branding, className, navLinks, socials, }) => {
@@ -10,5 +9,5 @@ export const Footer = ({ Branding, className, navLinks, socials, }) => {
10
9
  (navLinks || socials) && (React.createElement(Links, null,
11
10
  navLinks &&
12
11
  navLinks.map(({ label, target = ANCHOR_TARGET.SELF, url }, i) => (React.createElement(Link, { key: `${url}${i}`, label: label, target: target, url: url }))),
13
- socials && (React.createElement(Socials, { buttonSize: "small", IconButtonElType: IconButtonSocialsFooter, socials: socials })))))));
12
+ socials && React.createElement(Socials, { buttonSize: "small", socials: socials }))))));
14
13
  };
@@ -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";
@@ -46,4 +46,9 @@ export const Link = styled(DXLink) `
46
46
  `;
47
47
  export const Socials = styled(DXSocials) `
48
48
  gap: 8px;
49
+ .MuiIconButton-root {
50
+ &:hover {
51
+ background-color: ${smokeMain};
52
+ }
53
+ }
49
54
  `;
@@ -6,6 +6,10 @@ export declare type Navigation = [
6
6
  NavLinkItem[] | undefined,
7
7
  NavLinkItem[] | undefined
8
8
  ];
9
+ export declare enum SELECTED_MATCH {
10
+ EQUALS = "EQUALS",
11
+ STARTS_WITH = "STARTS_WITH"
12
+ }
9
13
  export interface SocialMedia {
10
14
  label: ReactNode;
11
15
  socials: Social[];
@@ -1 +1,5 @@
1
- export {};
1
+ export var SELECTED_MATCH;
2
+ (function (SELECTED_MATCH) {
3
+ SELECTED_MATCH["EQUALS"] = "EQUALS";
4
+ SELECTED_MATCH["STARTS_WITH"] = "STARTS_WITH";
5
+ })(SELECTED_MATCH || (SELECTED_MATCH = {}));
@@ -12,7 +12,7 @@ export declare const Button: import("@emotion/styled").StyledComponent<{
12
12
  size?: "large" | "medium" | "small" | undefined;
13
13
  startIcon?: import("react").ReactNode;
14
14
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
15
- variant?: "nav" | "text" | "outlined" | "contained" | "activeNav" | undefined;
15
+ variant?: "nav" | "text" | "outlined" | "contained" | "activeNav" | "backNav" | undefined;
16
16
  } & Omit<{
17
17
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
18
18
  centerRipple?: boolean | undefined;
@@ -1,6 +1,7 @@
1
1
  import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
2
2
  import { IconButton, Toolbar as MToolbar } from "@mui/material";
3
3
  import React, { Fragment } from "react";
4
+ import { Left, Right } from "../../../../../../../../header.styles";
4
5
  import { Announcements } from "../../../../../../../Announcements/announcements";
5
6
  import { Actions } from "../../../../actions";
6
7
  import { Authentication } from "../../../Authentication/authentication";
@@ -9,11 +10,12 @@ export const Toolbar = ({ actions, announcements, authenticationEnabled, logo, o
9
10
  return (React.createElement(Fragment, null,
10
11
  React.createElement(Announcements, { announcements: announcements }),
11
12
  React.createElement(MToolbar, null,
12
- logo,
13
- React.createElement(Actions, null,
14
- React.createElement(Search, { closeMenu: onClose, searchEnabled: searchEnabled, searchURL: searchURL }),
15
- React.createElement(Authentication, { authenticationEnabled: authenticationEnabled, closeMenu: onClose }),
16
- actions,
17
- React.createElement(IconButton, { color: "ink", onClick: onClose },
18
- React.createElement(CloseRoundedIcon, null))))));
13
+ React.createElement(Left, null, logo),
14
+ React.createElement(Right, null,
15
+ React.createElement(Actions, null,
16
+ React.createElement(Search, { closeMenu: onClose, searchEnabled: searchEnabled, searchURL: searchURL }),
17
+ React.createElement(Authentication, { authenticationEnabled: authenticationEnabled, closeMenu: onClose }),
18
+ actions,
19
+ React.createElement(IconButton, { color: "ink", onClick: onClose },
20
+ React.createElement(CloseRoundedIcon, null)))))));
19
21
  };
@@ -0,0 +1,4 @@
1
+ export declare const SEARCH_PARAMETERS: {
2
+ CATEGORY: string;
3
+ QUERY: string;
4
+ };
@@ -0,0 +1,4 @@
1
+ export const SEARCH_PARAMETERS = {
2
+ CATEGORY: "category",
3
+ QUERY: "q",
4
+ };
@@ -0,0 +1,8 @@
1
+ import { ReadonlyURLSearchParams } from "next/navigation";
2
+ /**
3
+ * Return the search params, for the given search string.
4
+ * @param searchParams - Current search params.
5
+ * @param searchStr - Search string.
6
+ * @returns updated search params.
7
+ */
8
+ export declare function getSearchParams(searchParams: ReadonlyURLSearchParams, searchStr: string): URLSearchParams;
@@ -0,0 +1,12 @@
1
+ import { SEARCH_PARAMETERS } from "./constants";
2
+ /**
3
+ * Return the search params, for the given search string.
4
+ * @param searchParams - Current search params.
5
+ * @param searchStr - Search string.
6
+ * @returns updated search params.
7
+ */
8
+ export function getSearchParams(searchParams, searchStr) {
9
+ const params = new URLSearchParams(searchParams.toString());
10
+ params.set(SEARCH_PARAMETERS.QUERY, searchStr);
11
+ return params;
12
+ }
@@ -1,10 +1,16 @@
1
1
  import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
2
- import React, { useRef, useState } from "react";
2
+ import { useSearchParams } from "next/navigation";
3
+ import Router from "next/router";
4
+ import React, { useCallback, useRef, useState, } from "react";
5
+ import { isValidUrl } from "../../../../../../../../../../../../common/utils";
3
6
  import { ButtonPrimary } from "../../../../../../../../../../../common/Button/components/ButtonPrimary/buttonPrimary";
4
7
  import { SearchIcon } from "../../../../../../../../../../../common/CustomIcon/components/SearchIcon/searchIcon";
8
+ import { isClientSideNavigation } from "../../../../../../../../../../../Links/common/utils";
9
+ import { getSearchParams } from "./common/utils";
5
10
  import { ClearButton, SearchBar as SearchDialog, SearchForm, SearchInput, } from "./searchBar.styles";
6
11
  export default function SearchBar({ closeMenu, closeSearch, searchOpen, searchURL, }) {
7
12
  const inputRef = useRef(null);
13
+ const searchParams = useSearchParams();
8
14
  const [searchTerm, setSearchTerm] = useState("");
9
15
  /**
10
16
  * Clears search term and refocuses input.
@@ -34,17 +40,27 @@ export default function SearchBar({ closeMenu, closeSearch, searchOpen, searchUR
34
40
  * @param searchStr - Current search string.
35
41
  * @param url - Current configured search path.
36
42
  */
37
- const handleSubmit = (formEvent, searchStr, url) => {
43
+ const handleSubmit = useCallback((formEvent, searchStr, url) => {
38
44
  formEvent.preventDefault();
39
45
  if (searchStr && url) {
40
46
  closeMenu();
41
47
  closeSearch();
42
- // Build search URL and redirect to it.
43
- const location = new URL(url);
44
- location.searchParams.set("q", searchStr);
45
- window.location.href = location.href;
48
+ if (isClientSideNavigation(url)) {
49
+ Router.push({
50
+ pathname: url,
51
+ search: getSearchParams(searchParams, searchStr).toString(),
52
+ });
53
+ return;
54
+ }
55
+ if (isValidUrl(url)) {
56
+ // Build search URL and redirect to it.
57
+ const location = new URL(url);
58
+ location.search = getSearchParams(searchParams, searchStr).toString();
59
+ window.location.href = location.href;
60
+ }
61
+ throw new Error("Invalid search URL.");
46
62
  }
47
- };
63
+ }, [closeMenu, closeSearch, searchParams]);
48
64
  return (React.createElement(SearchDialog, { fullWidth: true, hideBackdrop: true, maxWidth: false, onClose: closeSearch, open: searchOpen, PaperProps: { variant: "searchbar" }, TransitionProps: { onExited: handleExited } },
49
65
  React.createElement(SearchForm, { onSubmit: (e) => handleSubmit(e, searchTerm, searchURL) },
50
66
  React.createElement(SearchIcon, { fontSize: "small" }),
@@ -1,5 +1,6 @@
1
1
  import styled from "@emotion/styled";
2
2
  import { Dialog, Input } from "@mui/material";
3
+ import { inkLight, smokeMain, } from "../../../../../../../../../../../../styles/common/mixins/colors";
3
4
  import { IconButton } from "../../../../../../../../../../../common/IconButton/iconButton";
4
5
  import { HEADER_HEIGHT } from "../../../../../../../../common/constants";
5
6
  export const SearchBar = styled(Dialog) `
@@ -19,15 +20,15 @@ export const SearchForm = styled.form `
19
20
  padding: 12px 16px;
20
21
  `;
21
22
  export const SearchInput = styled(Input) `
22
- border-bottom: 1px solid ${({ theme }) => theme.palette.smoke.main};
23
+ border-bottom: 1px solid ${smokeMain};
23
24
  height: 40px;
24
25
  padding: 0;
25
26
 
26
27
  &&.Mui-focused ::placeholder {
27
- color: ${({ theme }) => theme.palette.ink.light};
28
+ color: ${inkLight};
28
29
  opacity: 1;
29
30
  }
30
31
  `;
31
32
  export const ClearButton = styled(IconButton) `
32
- color: ${({ theme }) => theme.palette.ink.light};
33
+ color: ${inkLight};
33
34
  `;
@@ -12,7 +12,7 @@ export declare const Button: import("@emotion/styled").StyledComponent<{
12
12
  size?: "large" | "medium" | "small" | undefined;
13
13
  startIcon?: import("react").ReactNode;
14
14
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
15
- variant?: "nav" | "text" | "outlined" | "contained" | "activeNav" | undefined;
15
+ variant?: "nav" | "text" | "outlined" | "contained" | "activeNav" | "backNav" | undefined;
16
16
  } & Omit<{
17
17
  action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
18
18
  centerRipple?: boolean | undefined;
@@ -1,10 +1,7 @@
1
- import Link from "next/link";
2
1
  import React from "react";
3
2
  import { StaticImage, } from "../../../../../../../common/StaticImage/staticImage";
4
3
  import { ANCHOR_TARGET } from "../../../../../../../Links/common/entities";
5
- import { isClientSideNavigation } from "../../../../../../../Links/common/utils";
4
+ import { StyledLink } from "./logo.styles";
6
5
  export const Logo = ({ alt, className, height, link, src, target = ANCHOR_TARGET.SELF, width, }) => {
7
- const logo = (React.createElement(StaticImage, { alt: alt, height: height, src: src, width: width }));
8
- return isClientSideNavigation(link) ? (React.createElement(Link, { href: link, legacyBehavior: true, passHref: true },
9
- React.createElement("a", { className: className, href: "passHref", rel: "noopener", target: target }, logo))) : (React.createElement("a", { className: className, href: link, rel: "noopener noreferrer", target: target }, logo));
6
+ return (React.createElement(StyledLink, { className: className, label: React.createElement(StaticImage, { alt: alt, height: height, src: src, width: width }), target: target, url: link }));
10
7
  };
@@ -0,0 +1,3 @@
1
+ export declare const StyledLink: import("@emotion/styled").StyledComponent<import("../../../../../../../Links/components/Link/link").LinkProps & {
2
+ theme?: import("@emotion/react").Theme | undefined;
3
+ }, {}, {}>;
@@ -0,0 +1,11 @@
1
+ import styled from "@emotion/styled";
2
+ import { Link } from "../../../../../../../Links/components/Link/link";
3
+ export const StyledLink = styled(Link) `
4
+ &.MuiLink-root {
5
+ flex: none;
6
+ text-decoration: none !important;
7
+ img {
8
+ margin: 0;
9
+ }
10
+ }
11
+ `;
@@ -0,0 +1,15 @@
1
+ import { SELECTED_MATCH } from "../../../../../common/entities";
2
+ /**
3
+ * Returns true if the navigation link is selected.
4
+ * @param url - The URL of the navigation link.
5
+ * @param pathname - The current pathname.
6
+ * @param selectedMatch - The selected match type.
7
+ * @returns true if the navigation link is selected.
8
+ */
9
+ export declare function isNavigationLinkSelected(url: string, pathname?: string, selectedMatch?: SELECTED_MATCH): boolean;
10
+ /**
11
+ * Returns true if the selected match type is "EQUAL".
12
+ * @param selectedMatch - The selected match type.
13
+ * @returns True if the selected match type is "EQUAL".
14
+ */
15
+ export declare function isSelectedMatchEqual(selectedMatch: SELECTED_MATCH): boolean;
@@ -0,0 +1,23 @@
1
+ import { SELECTED_MATCH } from "../../../../../common/entities";
2
+ /**
3
+ * Returns true if the navigation link is selected.
4
+ * @param url - The URL of the navigation link.
5
+ * @param pathname - The current pathname.
6
+ * @param selectedMatch - The selected match type.
7
+ * @returns true if the navigation link is selected.
8
+ */
9
+ export function isNavigationLinkSelected(url, pathname, selectedMatch = SELECTED_MATCH.STARTS_WITH) {
10
+ if (!pathname)
11
+ return false;
12
+ if (isSelectedMatchEqual(selectedMatch))
13
+ return url === pathname;
14
+ return pathname.startsWith(url);
15
+ }
16
+ /**
17
+ * Returns true if the selected match type is "EQUAL".
18
+ * @param selectedMatch - The selected match type.
19
+ * @returns True if the selected match type is "EQUAL".
20
+ */
21
+ export function isSelectedMatchEqual(selectedMatch) {
22
+ return selectedMatch === SELECTED_MATCH.EQUALS;
23
+ }
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from "react";
2
+ export interface NavigationButtonLabelProps {
3
+ label: ReactNode;
4
+ }
5
+ export declare const NavigationButtonLabel: ({ label, }: NavigationButtonLabelProps) => JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { Typography } from "@mui/material";
2
+ import React, { Fragment } from "react";
3
+ export const NavigationButtonLabel = ({ label, }) => {
4
+ return (React.createElement(Fragment, null, typeof label === "string" ? (React.createElement(Typography, { component: "span", noWrap: true }, label)) : (label)));
5
+ };
@@ -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, { useState } from "react";
4
3
  import { Button } from "../../../../../../../../../common/Button/button";
5
4
  import { BackArrowIcon } from "../../../../../../../../../common/CustomIcon/components/BackArrowIcon/backArrowIcon";
@@ -7,7 +6,7 @@ import { AppBar } from "../../../../../../header.styles";
7
6
  import { DrawerNavigation as Navigation } from "../../../Actions/components/Menu/components/Content/components/Navigation/navigation.styles";
8
7
  import { Toolbar } from "../../../Actions/components/Menu/components/Toolbar/toolbar";
9
8
  import { Slide } from "./components/Slide/slide";
10
- import { Button as BackButton, Content } from "./navigationDrawer.styles";
9
+ import { Button as BackButton, Content, Dialog, } from "./navigationDrawer.styles";
11
10
  export const NavigationDrawer = ({ closeAncestor, headerProps, menuItems, menuLabel, pathname, }) => {
12
11
  const [drawerOpen, setDrawerOpen] = useState(false);
13
12
  const openDrawer = () => {
@@ -22,10 +21,10 @@ export const NavigationDrawer = ({ closeAncestor, headerProps, menuItems, menuLa
22
21
  };
23
22
  return (React.createElement(React.Fragment, null,
24
23
  React.createElement(Button, { EndIcon: ArrowDropDownRoundedIcon, onClick: openDrawer, variant: "nav" }, menuLabel),
25
- React.createElement(MDialog, { disableScrollLock: true, fullScreen: true, hideBackdrop: true, keepMounted: false, onClose: closeDrawers, open: drawerOpen, PaperProps: { elevation: 0 }, TransitionComponent: Slide, transitionDuration: 300 },
24
+ React.createElement(Dialog, { disableScrollLock: true, fullScreen: true, hideBackdrop: true, keepMounted: false, onClose: closeDrawers, open: drawerOpen, PaperProps: { elevation: 0 }, TransitionComponent: Slide, transitionDuration: 300 },
26
25
  React.createElement(AppBar, { component: "div", elevation: 1 },
27
26
  React.createElement(Toolbar, { onClose: closeDrawers, ...headerProps })),
28
27
  React.createElement(Content, null,
29
- React.createElement(BackButton, { fullWidth: true, onClick: closeDrawer, StartIcon: BackArrowIcon, variant: "nav" }, menuLabel),
28
+ React.createElement(BackButton, { fullWidth: true, onClick: closeDrawer, StartIcon: BackArrowIcon, variant: "backNav" }, menuLabel),
30
29
  React.createElement(Navigation, { closeAncestor: closeDrawers, headerProps: headerProps, links: menuItems, pathname: pathname })))));
31
30
  };
@@ -1,4 +1,7 @@
1
1
  /// <reference types="react" />
2
+ export declare const Dialog: import("@emotion/styled").StyledComponent<import("@mui/material").DialogProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ }, {}, {}>;
2
5
  export declare const Content: import("@emotion/styled").StyledComponent<{
3
6
  theme?: import("@emotion/react").Theme | undefined;
4
7
  as?: import("react").ElementType<any> | undefined;