@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.
Files changed (117) 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/Search/components/SearchBar/common/constants.d.ts +4 -0
  21. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/constants.js +4 -0
  22. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/utils.d.ts +8 -0
  23. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/utils.js +12 -0
  24. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.js +23 -7
  25. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.js +4 -3
  26. package/lib/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchButton/searchButton.styles.d.ts +1 -1
  27. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.styles.js +1 -0
  28. package/lib/components/Layout/components/Header/components/Content/components/Navigation/common/utils.d.ts +9 -1
  29. package/lib/components/Layout/components/Header/components/Content/components/Navigation/common/utils.js +13 -1
  30. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationButtonLabel/navigationButtonLabel.d.ts +5 -0
  31. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationButtonLabel/navigationButtonLabel.js +5 -0
  32. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.js +3 -4
  33. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.styles.d.ts +3 -0
  34. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.styles.js +23 -2
  35. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/common/constants.d.ts +4 -0
  36. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/common/constants.js +19 -0
  37. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.d.ts +2 -1
  38. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.js +20 -19
  39. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.styles.d.ts +30 -0
  40. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.styles.js +16 -1
  41. package/lib/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.js +12 -7
  42. package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.d.ts +2 -0
  43. package/lib/components/Layout/components/Header/components/Content/components/Navigation/navigation.js +9 -7
  44. package/lib/components/Layout/components/Header/header.styles.js +1 -0
  45. package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.js +2 -3
  46. package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.d.ts +3 -0
  47. package/lib/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.js +8 -1
  48. package/lib/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.styles.js +1 -1
  49. package/lib/components/Layout/components/Sidebar/sidebar.styles.js +2 -1
  50. package/lib/components/Links/common/entities.d.ts +4 -0
  51. package/lib/components/Links/common/entities.js +5 -0
  52. package/lib/components/Links/common/utils.js +1 -1
  53. package/lib/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.js +2 -2
  54. package/lib/components/Links/components/Link/link.d.ts +1 -1
  55. package/lib/components/Links/components/Link/link.js +5 -5
  56. package/lib/components/Table/components/Pagination/pagination.js +3 -3
  57. package/lib/components/common/Button/components/CallToActionButton/callToActionButton.js +2 -2
  58. package/lib/components/common/Button/components/HelpIconButton/helpIconButton.js +3 -3
  59. package/lib/components/common/Card/components/CardActionArea/cardActionArea.js +2 -2
  60. package/lib/components/common/IconButton/iconButton.styles.d.ts +0 -15
  61. package/lib/components/common/IconButton/iconButton.styles.js +0 -82
  62. package/lib/components/common/Socials/socials.d.ts +1 -1
  63. package/lib/components/common/Socials/socials.js +4 -5
  64. package/lib/components/common/Socials/socials.styles.d.ts +1 -0
  65. package/lib/components/common/Socials/socials.styles.js +9 -0
  66. package/lib/hooks/useMenuWithPosition.d.ts +14 -0
  67. package/lib/hooks/useMenuWithPosition.js +33 -0
  68. package/lib/theme/common/components.js +59 -1
  69. package/package.json +1 -1
  70. package/src/components/Export/components/ExportToTerra/components/ExportToTerraReady/exportToTerraReady.tsx +9 -2
  71. package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/AcceptTerraTOS/acceptTerraTOS.tsx +9 -2
  72. package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/ConnectTerraToNIHAccount/connectTerraToNIHAccount.tsx +5 -2
  73. package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/FormStep/components/CreateTerraAccount/createTerraAccount.tsx +9 -2
  74. package/src/components/Filter/components/Filter/filter.styles.ts +9 -1
  75. package/src/components/Filter/components/Filter/filter.tsx +2 -3
  76. package/src/components/Index/components/AzulFileDownload/azulFileDownload.styles.ts +6 -0
  77. package/src/components/Index/components/AzulFileDownload/azulFileDownload.tsx +13 -12
  78. package/src/components/Layout/components/ContentLayout/contentLayout.styles.ts +9 -6
  79. package/src/components/Layout/components/ContentLayout/contentLayout.tsx +9 -4
  80. package/src/components/Layout/components/Footer/footer.styles.ts +6 -1
  81. package/src/components/Layout/components/Footer/footer.tsx +1 -8
  82. package/src/components/Layout/components/Header/common/entities.ts +5 -0
  83. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/constants.ts +4 -0
  84. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/common/utils.ts +17 -0
  85. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.styles.ts +7 -3
  86. package/src/components/Layout/components/Header/components/Content/components/Actions/components/Search/components/SearchBar/searchBar.tsx +41 -16
  87. package/src/components/Layout/components/Header/components/Content/components/Logo/logo.styles.ts +1 -0
  88. package/src/components/Layout/components/Header/components/Content/components/Navigation/common/utils.ts +15 -1
  89. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationButtonLabel/navigationButtonLabel.tsx +22 -0
  90. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.styles.ts +27 -2
  91. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationDrawer/navigationDrawer.tsx +8 -5
  92. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/common/constants.ts +23 -0
  93. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.styles.ts +17 -1
  94. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenu/navigationMenu.tsx +25 -23
  95. package/src/components/Layout/components/Header/components/Content/components/Navigation/components/NavigationMenuItems/navigationMenuItems.tsx +25 -5
  96. package/src/components/Layout/components/Header/components/Content/components/Navigation/navigation.tsx +24 -6
  97. package/src/components/Layout/components/Header/header.styles.ts +1 -0
  98. package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.styles.ts +12 -1
  99. package/src/components/Layout/components/Sidebar/components/SidebarDrawer/sidebarDrawer.tsx +2 -7
  100. package/src/components/Layout/components/Sidebar/components/SidebarPositioner/sidebarPositioner.styles.ts +1 -1
  101. package/src/components/Layout/components/Sidebar/sidebar.styles.ts +2 -1
  102. package/src/components/Links/common/entities.ts +5 -0
  103. package/src/components/Links/common/utils.ts +1 -1
  104. package/src/components/Links/components/Link/components/ExploreViewLink/exploreViewLink.tsx +2 -1
  105. package/src/components/Links/components/Link/link.tsx +12 -4
  106. package/src/components/Table/components/Pagination/pagination.tsx +5 -3
  107. package/src/components/common/Button/components/CallToActionButton/callToActionButton.tsx +6 -3
  108. package/src/components/common/Button/components/HelpIconButton/helpIconButton.tsx +6 -3
  109. package/src/components/common/Card/components/CardActionArea/cardActionArea.tsx +9 -2
  110. package/src/components/common/IconButton/iconButton.styles.ts +0 -88
  111. package/src/components/common/Socials/socials.styles.ts +10 -0
  112. package/src/components/common/Socials/socials.tsx +12 -10
  113. package/src/hooks/useMenuWithPosition.ts +49 -0
  114. package/src/theme/common/components.ts +59 -0
  115. package/types/data-explorer-ui.d.ts +1 -0
  116. package/src/components/common/IconButton/components/LoadingIconButton/loadingIconButton.stories.tsx +0 -15
  117. package/src/components/common/IconButton/components/LoadingIconButton/loadingIconButton.tsx +0 -15
@@ -1,24 +1,25 @@
1
1
  import ArrowDropDownRoundedIcon from "@mui/icons-material/ArrowDropDownRounded";
2
- import React, { useState } from "react";
2
+ import React, { Fragment } from "react";
3
3
  import { useBreakpoint } from "../../../../../../../../../../hooks/useBreakpoint";
4
+ import { useMenuWithPosition } from "../../../../../../../../../../hooks/useMenuWithPosition";
5
+ import { NavigationButtonLabel } from "../NavigationButtonLabel/navigationButtonLabel";
4
6
  import { NavigationMenuItems, } from "../NavigationMenuItems/navigationMenuItems";
5
- import { Button, Menu } from "./navigationMenu.styles";
6
- export const NavigationMenu = ({ anchorOrigin = { horizontal: "left", vertical: "bottom" }, closeAncestor, menuItems, menuLabel, pathname, }) => {
7
+ import { MENU_ANCHOR_ORIGIN_LEFT_BOTTOM, MENU_PROPS } from "./common/constants";
8
+ import { Button, Menu, StyledMenuItem } from "./navigationMenu.styles";
9
+ export const NavigationMenu = ({ anchorOrigin = MENU_ANCHOR_ORIGIN_LEFT_BOTTOM, closeAncestor, disablePortal, menuItems, menuLabel, pathname, }) => {
7
10
  const { mdUp } = useBreakpoint();
8
- const [anchorEl, setAnchorEl] = useState(null);
9
- const open = Boolean(anchorEl);
10
- const openMenu = (event) => {
11
- setAnchorEl(event.currentTarget);
12
- };
13
- const closeMenu = () => {
14
- closeAncestor?.();
15
- setAnchorEl(null);
16
- };
17
- return (React.createElement(React.Fragment, null,
18
- React.createElement(Button, { EndIcon: ArrowDropDownRoundedIcon, isActive: open, onClick: openMenu, variant: "nav" }, menuLabel),
19
- React.createElement(Menu, { anchorEl: anchorEl, anchorOrigin: anchorOrigin, onClose: closeMenu, open: mdUp && open, slotProps: { paper: { variant: "menu" } }, transformOrigin: {
20
- horizontal: "left",
21
- vertical: "top",
22
- } },
23
- React.createElement(NavigationMenuItems, { closeMenu: closeMenu, menuItems: menuItems, pathname: pathname }))));
11
+ const { anchorEl, onClose, onToggleOpen, open } = useMenuWithPosition();
12
+ const MenuItem = disablePortal ? StyledMenuItem : Fragment;
13
+ const menuItemProps = disablePortal ? { onMouseLeave: onClose } : {};
14
+ return (React.createElement(MenuItem, { ...menuItemProps },
15
+ React.createElement(Button, { EndIcon: ArrowDropDownRoundedIcon, isActive: open, onClick: onToggleOpen, variant: "nav" },
16
+ React.createElement(NavigationButtonLabel, { label: menuLabel })),
17
+ React.createElement(Menu, { ...MENU_PROPS, anchorEl: anchorEl, anchorOrigin: anchorOrigin, disablePortal: disablePortal, onClose: () => {
18
+ onClose();
19
+ closeAncestor?.();
20
+ }, open: mdUp && open },
21
+ React.createElement(NavigationMenuItems, { closeMenu: () => {
22
+ onClose();
23
+ closeAncestor?.();
24
+ }, menuItems: menuItems, pathname: pathname }))));
24
25
  };
@@ -8,4 +8,34 @@ export declare const Menu: import("@emotion/styled").StyledComponent<import("@mu
8
8
  export declare const Button: import("@emotion/styled").StyledComponent<Omit<import("../../../../../../../../../common/Button/button").ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement> & {
9
9
  theme?: import("@emotion/react").Theme | undefined;
10
10
  } & Props, {}, {}>;
11
+ export declare const StyledMenuItem: import("@emotion/styled").StyledComponent<{
12
+ autoFocus?: boolean | undefined;
13
+ classes?: Partial<import("@mui/material").MenuItemClasses> | undefined;
14
+ dense?: boolean | undefined;
15
+ disabled?: boolean | undefined;
16
+ disableGutters?: boolean | undefined;
17
+ divider?: boolean | undefined;
18
+ selected?: boolean | undefined;
19
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
20
+ } & Omit<{
21
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
22
+ centerRipple?: boolean | undefined;
23
+ children?: import("react").ReactNode;
24
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
25
+ disabled?: boolean | undefined;
26
+ disableRipple?: boolean | undefined;
27
+ disableTouchRipple?: boolean | undefined;
28
+ focusRipple?: boolean | undefined;
29
+ focusVisibleClassName?: string | undefined;
30
+ LinkComponent?: import("react").ElementType<any> | undefined;
31
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
32
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
33
+ tabIndex?: number | undefined;
34
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
35
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
36
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
37
+ ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
38
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "autoFocus" | "tabIndex" | "children" | "sx" | "disabled" | "action" | "selected" | "dense" | "disableGutters" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "divider"> & {
39
+ theme?: import("@emotion/react").Theme | undefined;
40
+ }, {}, {}>;
11
41
  export {};
@@ -1,6 +1,6 @@
1
1
  import { css } from "@emotion/react";
2
2
  import styled from "@emotion/styled";
3
- import { Menu as MMenu } from "@mui/material";
3
+ import { Menu as MMenu, MenuItem as MMenuItem } from "@mui/material";
4
4
  import { inkLight, smokeLight, smokeMain, } from "../../../../../../../../../../styles/common/mixins/colors";
5
5
  import { Button as DXButton } from "../../../../../../../../../common/Button/button";
6
6
  export const Menu = styled(MMenu) `
@@ -24,11 +24,13 @@ export const Menu = styled(MMenu) `
24
24
  .MuiListItemText-root {
25
25
  display: grid;
26
26
  gap: 4px;
27
+ white-space: normal;
27
28
 
28
29
  .MuiListItemText-primary {
29
30
  align-items: center;
30
31
  display: flex;
31
32
  gap: 4px;
33
+ min-width: 0;
32
34
  }
33
35
 
34
36
  .MuiListItemText-secondary {
@@ -37,6 +39,11 @@ export const Menu = styled(MMenu) `
37
39
  }
38
40
  }
39
41
 
42
+ &.Mui-disabled {
43
+ color: ${inkLight};
44
+ opacity: 1;
45
+ }
46
+
40
47
  &.Mui-selected {
41
48
  background-color: ${smokeLight};
42
49
  }
@@ -58,6 +65,11 @@ export const Menu = styled(MMenu) `
58
65
  margin: 8px 0;
59
66
  }
60
67
  }
68
+
69
+ .MuiPopover-root {
70
+ cursor: default;
71
+ z-index: -1;
72
+ }
61
73
  `;
62
74
  export const Button = styled(DXButton, {
63
75
  shouldForwardProp: (prop) => prop !== "isActive",
@@ -68,3 +80,6 @@ export const Button = styled(DXButton, {
68
80
  background-color: ${smokeLight(props)};
69
81
  `};
70
82
  `;
83
+ export const StyledMenuItem = styled(MMenuItem) `
84
+ padding: 0;
85
+ `;
@@ -1,23 +1,28 @@
1
1
  import { Divider, ListItemIcon, ListItemText, MenuItem as MMenuItem, } from "@mui/material";
2
2
  import { useRouter } from "next/router";
3
3
  import React, { Fragment } from "react";
4
- import { TEXT_BODY_400, TEXT_BODY_500, TEXT_BODY_SMALL_400_2_LINES, } from "../../../../../../../../../../theme/common/typography";
5
- import { ANCHOR_TARGET } from "../../../../../../../../../Links/common/entities";
4
+ import { TEXT_BODY_400, TEXT_BODY_500, TEXT_BODY_SMALL_400_2_LINES, TEXT_UPPERCASE_500, } from "../../../../../../../../../../theme/common/typography";
5
+ import { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../../../../../../Links/common/entities";
6
6
  import { isClientSideNavigation } from "../../../../../../../../../Links/common/utils";
7
7
  import { isNavigationLinkSelected } from "../../common/utils";
8
+ import { MENU_ANCHOR_ORIGIN_RIGHT_TOP } from "../NavigationMenu/common/constants";
8
9
  import { NavigationMenu } from "../NavigationMenu/navigationMenu";
9
10
  export const NavigationMenuItems = ({ closeMenu, menuItems, pathname, }) => {
10
11
  const router = useRouter();
11
- return (React.createElement(React.Fragment, null, menuItems.map(({ description, divider, icon, label, menuItems: nestedMenuItems, target = ANCHOR_TARGET.SELF, url, }, i) => nestedMenuItems ? (React.createElement(NavigationMenu, { key: i, anchorOrigin: { horizontal: "right", vertical: "top" }, closeAncestor: closeMenu, menuItems: nestedMenuItems, menuLabel: label, pathname: pathname })) : (React.createElement(Fragment, { key: i },
12
- React.createElement(MMenuItem, { onClick: () => {
12
+ return (React.createElement(React.Fragment, null, menuItems.map(({ description, divider, icon, label, menuItems: nestedMenuItems, selectedMatch, target = ANCHOR_TARGET.SELF, url, }, i) => nestedMenuItems ? (React.createElement(NavigationMenu, { key: i, anchorOrigin: MENU_ANCHOR_ORIGIN_RIGHT_TOP, closeAncestor: closeMenu, disablePortal: true, menuItems: nestedMenuItems, menuLabel: label, pathname: pathname })) : (React.createElement(Fragment, { key: i },
13
+ React.createElement(MMenuItem, { disabled: !url, onClick: () => {
13
14
  closeMenu();
14
15
  isClientSideNavigation(url)
15
16
  ? router.push(url)
16
- : window.open(url, target, "noopener noreferrer");
17
- }, selected: isNavigationLinkSelected(url, pathname) },
17
+ : window.open(url, target, REL_ATTRIBUTE.NO_OPENER_NO_REFERRER);
18
+ }, selected: isNavigationLinkSelected(url, pathname, selectedMatch) },
18
19
  icon && React.createElement(ListItemIcon, null, icon),
19
20
  React.createElement(ListItemText, { primary: label, primaryTypographyProps: {
20
- variant: description ? TEXT_BODY_500 : TEXT_BODY_400,
21
+ variant: url
22
+ ? description
23
+ ? TEXT_BODY_500
24
+ : TEXT_BODY_400
25
+ : TEXT_UPPERCASE_500,
21
26
  }, secondary: description, secondaryTypographyProps: {
22
27
  variant: TEXT_BODY_SMALL_400_2_LINES,
23
28
  } })),
@@ -1,6 +1,7 @@
1
1
  import React, { CSSProperties, ReactNode } from "react";
2
2
  import { BreakpointKey } from "../../../../../../../../hooks/useBreakpointHelper";
3
3
  import { ANCHOR_TARGET } from "../../../../../../../Links/common/entities";
4
+ import { SELECTED_MATCH } from "../../../../common/entities";
4
5
  import { HeaderProps } from "../../../../header";
5
6
  import { MenuItem } from "./components/NavigationMenuItems/navigationMenuItems";
6
7
  export interface NavLinkItem {
@@ -8,6 +9,7 @@ export interface NavLinkItem {
8
9
  flatten?: Partial<Record<BreakpointKey, boolean>>;
9
10
  label: ReactNode;
10
11
  menuItems?: MenuItem[];
12
+ selectedMatch?: SELECTED_MATCH;
11
13
  target?: ANCHOR_TARGET;
12
14
  url: string;
13
15
  visible?: Partial<Record<BreakpointKey, boolean>>;
@@ -2,25 +2,27 @@ import { Button, Divider } from "@mui/material";
2
2
  import { useRouter } from "next/router";
3
3
  import React, { forwardRef, Fragment } from "react";
4
4
  import { useBreakpoint } from "../../../../../../../../hooks/useBreakpoint";
5
- import { ANCHOR_TARGET } from "../../../../../../../Links/common/entities";
5
+ import { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../../../../Links/common/entities";
6
6
  import { isClientSideNavigation } from "../../../../../../../Links/common/utils";
7
7
  import { isNavigationLinkSelected } from "./common/utils";
8
+ import { NavigationButtonLabel } from "./components/NavigationButtonLabel/navigationButtonLabel";
8
9
  import { NavigationDrawer } from "./components/NavigationDrawer/navigationDrawer";
9
10
  import { NavigationMenu } from "./components/NavigationMenu/navigationMenu";
10
11
  import { Navigation as Links } from "./navigation.styles";
11
12
  export const Navigation = forwardRef(function Navigation({ className, closeAncestor, headerProps, links, pathname, style, }, ref) {
12
13
  const { mdUp } = useBreakpoint();
13
14
  const router = useRouter();
14
- return (React.createElement(Links, { ref: ref, className: className, style: style }, links.map(({ divider, label, menuItems, target = ANCHOR_TARGET.SELF, url }, i) => menuItems ? (React.createElement(Fragment, { key: i },
15
+ return (React.createElement(Links, { ref: ref, className: className, style: style }, links.map(({ divider, label, menuItems, selectedMatch, target = ANCHOR_TARGET.SELF, url, }, i) => menuItems ? (React.createElement(Fragment, { key: i },
15
16
  mdUp ? (React.createElement(NavigationMenu, { closeAncestor: closeAncestor, menuItems: menuItems, menuLabel: label, pathname: pathname })) : (React.createElement(NavigationDrawer, { closeAncestor: closeAncestor, headerProps: headerProps, menuItems: menuItems, menuLabel: label, pathname: pathname })),
16
17
  divider && React.createElement(Divider, null))) : (React.createElement(Fragment, { key: i },
17
- React.createElement(Button, { onClick: () => {
18
+ React.createElement(Button, { disabled: !url, onClick: () => {
19
+ closeAncestor?.();
18
20
  isClientSideNavigation(url)
19
21
  ? router.push(url)
20
- : window.open(url, target, "noopener noreferrer");
21
- closeAncestor?.();
22
- }, variant: isNavigationLinkSelected(url, pathname)
22
+ : window.open(url, target, REL_ATTRIBUTE.NO_OPENER_NO_REFERRER);
23
+ }, variant: isNavigationLinkSelected(url, pathname, selectedMatch)
23
24
  ? "activeNav"
24
- : "nav" }, label),
25
+ : "nav" },
26
+ React.createElement(NavigationButtonLabel, { label: label })),
25
27
  divider && React.createElement(Divider, null))))));
26
28
  });
@@ -42,6 +42,7 @@ export const Center = styled.div `
42
42
  `;
43
43
  export const Right = styled.div `
44
44
  ${group};
45
+ gap: 8px;
45
46
  grid-area: right;
46
47
  justify-content: flex-end;
47
48
  `;
@@ -1,8 +1,7 @@
1
1
  import { CloseRounded } from "@mui/icons-material";
2
2
  import React from "react";
3
- import { CloseDrawerIconButton } from "../../../../../common/IconButton/iconButton.styles";
4
3
  import { DrawerTransition } from "../../../../../Filter/components/Filter/components/DrawerTransition/drawerTransition";
5
- import { TemporarySidebar } from "./sidebarDrawer.styles";
4
+ import { IconButton, TemporarySidebar } from "./sidebarDrawer.styles";
6
5
  const DEFAULT_POSITION = { left: 0, top: 0 };
7
6
  const DRAWER_SLOT_PROPS = {
8
7
  paper: { square: true },
@@ -10,6 +9,6 @@ const DRAWER_SLOT_PROPS = {
10
9
  };
11
10
  export const SidebarDrawer = ({ children, drawerOpen = false, onDrawerClose, }) => {
12
11
  return (React.createElement(TemporarySidebar, { anchorPosition: DEFAULT_POSITION, anchorReference: "anchorPosition", hideBackdrop: false, marginThreshold: 0, onClose: onDrawerClose, open: drawerOpen, slotProps: DRAWER_SLOT_PROPS, TransitionComponent: DrawerTransition, transitionDuration: drawerOpen ? 250 : 300 },
13
- React.createElement(CloseDrawerIconButton, { Icon: CloseRounded, onClick: onDrawerClose, size: "medium" }),
12
+ React.createElement(IconButton, { Icon: CloseRounded, onClick: onDrawerClose, size: "medium" }),
14
13
  children));
15
14
  };
@@ -1,3 +1,6 @@
1
1
  export declare const TemporarySidebar: 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 as MPopover } 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 TemporarySidebar = styled(MPopover) `
6
7
  &.MuiPopover-root {
7
8
  ${mediaDesktopSmallDown} {
@@ -16,3 +17,9 @@ export const TemporarySidebar = styled(MPopover) `
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
+ `;
@@ -6,7 +6,7 @@ export const SidebarPositioner = styled("div") `
6
6
  padding: 16px 0;
7
7
 
8
8
  ${mediaDesktopSmallUp} {
9
- height: ${({ headerHeight }) => `calc(100vh - ${headerHeight}px)`};
9
+ max-height: 100vh;
10
10
  overflow: auto;
11
11
  padding: ${({ headerHeight }) => headerHeight}px 0 0;
12
12
  position: sticky;
@@ -1,7 +1,8 @@
1
1
  import styled from "@emotion/styled";
2
+ import { smokeMain } from "../../../../styles/common/mixins/colors";
2
3
  export const Sidebar = styled.div `
3
4
  align-self: stretch;
4
- border-right: 1px solid ${({ theme }) => theme.palette.smoke.main};
5
+ border-right: 1px solid ${smokeMain};
5
6
  box-sizing: content-box;
6
7
  width: 264px;
7
8
  `;
@@ -4,6 +4,10 @@ export declare enum ANCHOR_TARGET {
4
4
  BLANK = "_blank",
5
5
  SELF = "_self"
6
6
  }
7
+ export declare enum REL_ATTRIBUTE {
8
+ NO_OPENER = "noopener",
9
+ NO_OPENER_NO_REFERRER = "noopener noreferrer"
10
+ }
7
11
  export declare type StrictUrlObject = Omit<UrlObject, "href" | "query"> & {
8
12
  href: string;
9
13
  query: string;
@@ -3,3 +3,8 @@ export var ANCHOR_TARGET;
3
3
  ANCHOR_TARGET["BLANK"] = "_blank";
4
4
  ANCHOR_TARGET["SELF"] = "_self";
5
5
  })(ANCHOR_TARGET || (ANCHOR_TARGET = {}));
6
+ export var REL_ATTRIBUTE;
7
+ (function (REL_ATTRIBUTE) {
8
+ REL_ATTRIBUTE["NO_OPENER"] = "noopener";
9
+ REL_ATTRIBUTE["NO_OPENER_NO_REFERRER"] = "noopener noreferrer";
10
+ })(REL_ATTRIBUTE || (REL_ATTRIBUTE = {}));
@@ -5,7 +5,7 @@ import { URL_OBJECT_KEYS } from "./constants";
5
5
  * @returns true if the given link is an internal link.
6
6
  */
7
7
  export function isClientSideNavigation(link) {
8
- return /^\/(?!\/)/.test(link);
8
+ return /^\/(?!\/)|^#/.test(link);
9
9
  }
10
10
  /**
11
11
  * Returns true if the given url is a URL object with href and query.
@@ -2,7 +2,7 @@ import Link from "next/link";
2
2
  import React, { useCallback } from "react";
3
3
  import { useExploreState } from "../../../../../../hooks/useExploreState";
4
4
  import { ExploreActionKind, } from "../../../../../../providers/exploreState";
5
- import { ANCHOR_TARGET, } from "../../../../common/entities";
5
+ import { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../common/entities";
6
6
  const PARAM_FILTER = "filter";
7
7
  const PARAM_SORTING = "sorting";
8
8
  export const ExploreViewLink = ({ className, label, onClick, target = ANCHOR_TARGET.SELF, url, }) => {
@@ -20,7 +20,7 @@ export const ExploreViewLink = ({ className, label, onClick, target = ANCHOR_TAR
20
20
  });
21
21
  onClick?.();
22
22
  }, [exploreDispatch, onClick, url]);
23
- return (React.createElement(Link, { className: className, href: url.href, onClick: onNavigate, rel: "noopener", target: target }, label));
23
+ return (React.createElement(Link, { className: className, href: url.href, onClick: onNavigate, rel: REL_ATTRIBUTE.NO_OPENER, target: target }, label));
24
24
  };
25
25
  /**
26
26
  * Returns the entity list type "entityListType" inferred from the given href.
@@ -12,4 +12,4 @@ export interface LinkProps {
12
12
  TypographyProps?: TypographyProps;
13
13
  url: Url;
14
14
  }
15
- export declare const Link: ({ className, copyable, label, noWrap, onClick, target, TypographyProps, url, }: LinkProps) => JSX.Element;
15
+ export declare const Link: ({ className, copyable, label, noWrap, onClick, target, TypographyProps, url, ...props }: LinkProps) => JSX.Element;
@@ -3,10 +3,10 @@ import NLink from "next/link";
3
3
  import React from "react";
4
4
  import { isValidUrl } from "../../../../common/utils";
5
5
  import { CopyToClipboard } from "../../../common/CopyToClipboard/copyToClipboard";
6
- import { ANCHOR_TARGET } from "../../common/entities";
6
+ import { ANCHOR_TARGET, REL_ATTRIBUTE } from "../../common/entities";
7
7
  import { isClientSideNavigation, isURLObjectWithHrefAndQuery, isURLString, } from "../../common/utils";
8
8
  import { ExploreViewLink } from "./components/ExploreViewLink/exploreViewLink";
9
- export const Link = ({ className, copyable = false, label, noWrap = false, onClick, target, TypographyProps, url, }) => {
9
+ export const Link = ({ className, copyable = false, label, noWrap = false, onClick, target, TypographyProps, url, ...props /* Spread props to allow for specific MuiLink prop overrides. */ }) => {
10
10
  if (isURLObjectWithHrefAndQuery(url)) {
11
11
  /* Internal navigation - explore link */
12
12
  return (React.createElement(ExploreViewLink, { className: className, label: label, onClick: onClick, target: target, url: url }));
@@ -16,16 +16,16 @@ export const Link = ({ className, copyable = false, label, noWrap = false, onCli
16
16
  /* Client-side navigation */
17
17
  return (React.createElement(React.Fragment, null,
18
18
  React.createElement(NLink, { href: url, legacyBehavior: true, passHref: true },
19
- React.createElement(MLink, { className: className, rel: "noopener", noWrap: noWrap, target: target || ANCHOR_TARGET.SELF, onClick: onClick, ...TypographyProps }, label)),
19
+ React.createElement(MLink, { className: className, rel: REL_ATTRIBUTE.NO_OPENER, noWrap: noWrap, target: target || ANCHOR_TARGET.SELF, onClick: onClick, ...TypographyProps, ...props }, label)),
20
20
  copyable && React.createElement(CopyToClipboard, { copyStr: url })));
21
21
  }
22
22
  if (isValidUrl(url)) {
23
23
  /* External navigation */
24
24
  return (React.createElement(React.Fragment, null,
25
- React.createElement(MLink, { className: className, href: url, noWrap: noWrap, onClick: onClick, rel: "noopener noreferrer", target: target || ANCHOR_TARGET.BLANK, ...TypographyProps }, label),
25
+ React.createElement(MLink, { className: className, href: url, noWrap: noWrap, onClick: onClick, rel: REL_ATTRIBUTE.NO_OPENER_NO_REFERRER, target: target || ANCHOR_TARGET.BLANK, ...TypographyProps, ...props }, label),
26
26
  copyable && React.createElement(CopyToClipboard, { copyStr: url })));
27
27
  }
28
28
  }
29
29
  /* Invalid URL */
30
- return (React.createElement(MTypography, { component: "span", variant: "inherit", ...TypographyProps }, label));
30
+ return (React.createElement(MTypography, { component: "span", variant: "inherit", ...TypographyProps, ...props }, label));
31
31
  };
@@ -2,7 +2,7 @@ import EastRoundedIcon from "@mui/icons-material/EastRounded";
2
2
  import WestRoundedIcon from "@mui/icons-material/WestRounded";
3
3
  import { Typography } from "@mui/material";
4
4
  import React from "react";
5
- import { IconButtonSecondary } from "../../../common/IconButton/iconButton.styles";
5
+ import { IconButton } from "../../../common/IconButton/iconButton";
6
6
  import { Stack } from "../../../common/Stack/stack";
7
7
  import { Pagination as TablePagination } from "./pagination.styles";
8
8
  export const Pagination = ({ canNextPage = true, canPreviousPage = true, currentPage, onNextPage, onPreviousPage, totalPage, }) => {
@@ -14,6 +14,6 @@ export const Pagination = ({ canNextPage = true, canPreviousPage = true, current
14
14
  " of ",
15
15
  totalPage)),
16
16
  React.createElement(Stack, { direction: "row", gap: 2 },
17
- React.createElement(IconButtonSecondary, { disabled: !canPreviousPage, Icon: WestRoundedIcon, onClick: onPreviousPage }),
18
- React.createElement(IconButtonSecondary, { disabled: !canNextPage, Icon: EastRoundedIcon, onClick: onNextPage }))));
17
+ React.createElement(IconButton, { color: "secondary", disabled: !canPreviousPage, Icon: WestRoundedIcon, onClick: onPreviousPage }),
18
+ React.createElement(IconButton, { color: "secondary", disabled: !canNextPage, Icon: EastRoundedIcon, onClick: onNextPage }))));
19
19
  };
@@ -1,11 +1,11 @@
1
1
  import NLink from "next/link";
2
2
  import React from "react";
3
- import { ANCHOR_TARGET } from "../../../../Links/common/entities";
3
+ import { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../Links/common/entities";
4
4
  import { isClientSideNavigation } from "../../../../Links/common/utils";
5
5
  import { ButtonPrimary } from "../ButtonPrimary/buttonPrimary";
6
6
  export const CallToActionButton = ({ ButtonElType: Button = ButtonPrimary, callToAction, className, disabled = false, }) => {
7
7
  const { label, target, url } = callToAction;
8
8
  const isInternal = isClientSideNavigation(url);
9
9
  return isInternal ? (React.createElement(NLink, { href: url, legacyBehavior: true, passHref: true },
10
- React.createElement(Button, { className: className, disabled: disabled, href: "passHref", rel: "noopener", target: target || ANCHOR_TARGET.SELF }, label))) : (React.createElement(Button, { className: className, disabled: disabled, href: url, rel: "noopener noreferrer", target: target || ANCHOR_TARGET.BLANK }, label));
10
+ React.createElement(Button, { className: className, disabled: disabled, href: "passHref", rel: REL_ATTRIBUTE.NO_OPENER, target: target || ANCHOR_TARGET.SELF }, label))) : (React.createElement(Button, { className: className, disabled: disabled, href: url, rel: REL_ATTRIBUTE.NO_OPENER_NO_REFERRER, target: target || ANCHOR_TARGET.BLANK }, label));
11
11
  };
@@ -1,13 +1,13 @@
1
1
  import Link from "next/link";
2
2
  import React from "react";
3
- import { ANCHOR_TARGET } from "../../../../Links/common/entities";
3
+ import { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../Links/common/entities";
4
4
  import { isClientSideNavigation } from "../../../../Links/common/utils";
5
5
  import { HelpIcon } from "../../../CustomIcon/components/HelpIcon/helpIcon";
6
6
  import { HelpIconButton as Button } from "./helpIconButton.styles";
7
7
  export const HelpIconButton = ({ size = "small", target, url, }) => {
8
8
  const isInternal = isClientSideNavigation(url);
9
9
  return isInternal ? (React.createElement(Link, { href: url, legacyBehavior: true, passHref: true },
10
- React.createElement(Button, { href: "passHref", rel: "noopener", target: target || ANCHOR_TARGET.SELF },
11
- React.createElement(HelpIcon, { fontSize: size })))) : (React.createElement(Button, { href: url, rel: "noopener noreferrer", target: target || ANCHOR_TARGET.BLANK },
10
+ React.createElement(Button, { href: "passHref", rel: REL_ATTRIBUTE.NO_OPENER, target: target || ANCHOR_TARGET.SELF },
11
+ React.createElement(HelpIcon, { fontSize: size })))) : (React.createElement(Button, { href: url, rel: REL_ATTRIBUTE.NO_OPENER_NO_REFERRER, target: target || ANCHOR_TARGET.BLANK },
12
12
  React.createElement(HelpIcon, { fontSize: size })));
13
13
  };
@@ -1,7 +1,7 @@
1
1
  import { CardActionArea as MCardActionArea } from "@mui/material";
2
2
  import { useRouter } from "next/router";
3
3
  import React from "react";
4
- import { ANCHOR_TARGET } from "../../../../Links/common/entities";
4
+ import { ANCHOR_TARGET, REL_ATTRIBUTE, } from "../../../../Links/common/entities";
5
5
  import { isClientSideNavigation } from "../../../../Links/common/utils";
6
6
  export const CardActionArea = ({ cardUrl, children, }) => {
7
7
  const { push } = useRouter();
@@ -13,7 +13,7 @@ export const CardActionArea = ({ cardUrl, children, }) => {
13
13
  push(url);
14
14
  }
15
15
  else {
16
- window.open(url, ANCHOR_TARGET.BLANK, "noopener noreferrer");
16
+ window.open(url, ANCHOR_TARGET.BLANK, REL_ATTRIBUTE.NO_OPENER_NO_REFERRER);
17
17
  }
18
18
  }
19
19
  };
@@ -32,19 +32,4 @@ export declare const Button: import("@emotion/styled").StyledComponent<{
32
32
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "sx" | "disabled" | "action" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & {
33
33
  theme?: import("@emotion/react").Theme | undefined;
34
34
  } & Props, {}, {}>;
35
- export declare const IconButtonPrimary: import("@emotion/styled").StyledComponent<import("./iconButton").IconButtonProps & {
36
- theme?: import("@emotion/react").Theme | undefined;
37
- }, {}, {}>;
38
- export declare const IconButtonSecondary: import("@emotion/styled").StyledComponent<import("./iconButton").IconButtonProps & {
39
- theme?: import("@emotion/react").Theme | undefined;
40
- }, {}, {}>;
41
- export declare const MockIconButtonPrimary: import("@emotion/styled").StyledComponent<{
42
- theme?: import("@emotion/react").Theme | undefined;
43
- as?: import("react").ElementType<any> | undefined;
44
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
45
- export declare const CloseDrawerIconButton: import("@emotion/styled").StyledComponent<import("./iconButton").IconButtonProps & {
46
- theme?: import("@emotion/react").Theme | undefined;
47
- }, {}, {}>;
48
- export declare const IconButtonSocials: import("@mui/material").ExtendButtonBase<import("@mui/material").IconButtonTypeMap<{}, "button">>;
49
- export declare const IconButtonSocialsFooter: import("@mui/material").ExtendButtonBase<import("@mui/material").IconButtonTypeMap<{}, "button">>;
50
35
  export {};
@@ -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">>;