@databiosphere/findable-ui 13.0.1 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/release-please.yml +3 -6
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +43 -0
- package/lib/common/analytics/entities.d.ts +18 -7
- package/lib/common/analytics/entities.js +5 -3
- package/lib/components/Export/common/tracking.d.ts +19 -3
- package/lib/components/Export/common/tracking.js +37 -12
- package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.js +3 -17
- package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.js +6 -3
- package/lib/components/Export/components/ExportToTerra/exportToTerra.d.ts +1 -1
- package/lib/components/Export/components/ExportToTerra/exportToTerra.js +11 -3
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.d.ts +1 -1
- package/lib/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.js +2 -2
- package/lib/components/Export/components/ManifestDownload/manifestDownload.d.ts +1 -1
- package/lib/components/Export/components/ManifestDownload/manifestDownload.js +9 -3
- package/lib/components/Filter/components/FilterTag/filterTag.styles.d.ts +1 -1
- package/lib/components/Index/components/AzulFileDownload/azulFileDownload.d.ts +4 -1
- package/lib/components/Index/components/AzulFileDownload/azulFileDownload.js +3 -1
- package/lib/components/Layout/components/Footer/components/VersionInfo/components/Tooltip/components/Title/constants.d.ts +2 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/components/Tooltip/components/Title/constants.js +3 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/components/Tooltip/components/Title/title.d.ts +2 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/components/Tooltip/components/Title/title.js +27 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/components/Tooltip/components/Title/utils.d.ts +15 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/components/Tooltip/components/Title/utils.js +26 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/constants.d.ts +3 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/constants.js +27 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/types.d.ts +12 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/types.js +1 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/utils.d.ts +19 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/utils.js +29 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/versionInfo.d.ts +3 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/versionInfo.js +10 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/versionInfo.styles.d.ts +5 -0
- package/lib/components/Layout/components/Footer/components/VersionInfo/versionInfo.styles.js +9 -0
- package/lib/components/Layout/components/Footer/footer.d.ts +3 -2
- package/lib/components/Layout/components/Footer/footer.js +4 -3
- package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.d.ts +2 -2
- package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.js +1 -1
- package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.styles.js +0 -1
- package/lib/components/Layout/components/Outline/components/ContentsTab/contentsTab.styles.d.ts +1 -1
- package/lib/components/Layout/components/Outline/outline.styles.d.ts +1 -1
- package/lib/components/Links/components/Link/link.d.ts +2 -3
- package/lib/components/Links/components/Link/link.js +1 -2
- package/lib/components/Support/components/SupportRequest/components/Dialog/dialog.styles.js +5 -0
- package/lib/components/Support/components/ViewSupport/viewSupport.styles.js +5 -0
- package/lib/components/Table/common/utils.js +0 -1
- package/lib/components/common/Alert/alert.d.ts +4 -12
- package/lib/components/common/Alert/alert.js +5 -7
- package/lib/components/common/Alert/alert.styles.d.ts +1 -11
- package/lib/components/common/Alert/alert.styles.js +18 -24
- package/lib/components/common/Alert/constants.d.ts +2 -0
- package/lib/components/common/Alert/constants.js +27 -0
- package/lib/components/common/Alert/hooks/useTransition/types.d.ts +5 -0
- package/lib/components/common/Alert/hooks/useTransition/types.js +1 -0
- package/lib/components/common/Alert/hooks/useTransition/useTransition.d.ts +7 -0
- package/lib/components/common/Alert/hooks/useTransition/useTransition.js +20 -0
- package/lib/components/common/Banner/banner.d.ts +4 -7
- package/lib/components/common/Banner/banner.js +4 -3
- package/lib/components/common/Banner/banner.styles.d.ts +3 -0
- package/lib/components/common/Banner/banner.styles.js +28 -0
- package/lib/components/common/Banner/components/CookieBanner/constants.d.ts +2 -0
- package/lib/components/common/Banner/components/CookieBanner/constants.js +7 -0
- package/lib/components/common/Banner/components/CookieBanner/cookieBanner.d.ts +3 -3
- package/lib/components/common/Banner/components/CookieBanner/cookieBanner.js +17 -31
- package/lib/components/common/Banner/components/CookieBanner/cookieBanner.styles.d.ts +1 -1
- package/lib/components/common/Banner/components/CookieBanner/cookieBanner.styles.js +2 -16
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.d.ts +3 -7
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.js +6 -4
- package/lib/components/common/Banner/components/SystemIndexing/systemIndexing.d.ts +3 -8
- package/lib/components/common/Banner/components/SystemIndexing/systemIndexing.js +6 -8
- package/lib/components/common/Banner/components/SystemStatus/systemStatus.d.ts +3 -8
- package/lib/components/common/Banner/components/SystemStatus/systemStatus.js +6 -8
- package/lib/components/common/Banner/constants.d.ts +2 -0
- package/lib/components/common/Banner/constants.js +9 -0
- package/lib/components/common/Breadcrumbs/breadcrumbs.d.ts +2 -2
- package/lib/components/common/Breadcrumbs/breadcrumbs.js +3 -4
- package/lib/components/common/Paper/paper.styles.js +18 -12
- package/lib/components/common/Tabs/tabs.styles.d.ts +1 -1
- package/lib/components/types.d.ts +10 -0
- package/lib/components/types.js +1 -0
- package/lib/config/entities.d.ts +1 -0
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.d.ts +1 -1
- package/lib/hooks/useFileManifest/common/buildFileManifestRequestURL.js +3 -2
- package/lib/hooks/useFileManifest/common/entities.d.ts +5 -5
- package/lib/hooks/useFileManifest/common/entities.js +7 -6
- package/lib/hooks/useFileManifest/useRequestFileManifest.d.ts +3 -1
- package/lib/hooks/useFileManifest/useRequestFileManifest.js +4 -1
- package/lib/hooks/useLocalStorage/useLocalStorage.d.ts +1 -1
- package/lib/hooks/useLocalStorage/useLocalStorage.js +1 -1
- package/lib/providers/fileManifestState/actions.d.ts +9 -0
- package/lib/providers/fileManifestState/actions.js +19 -0
- package/lib/providers/fileManifestState/constants.d.ts +4 -0
- package/lib/providers/fileManifestState/constants.js +25 -0
- package/lib/providers/fileManifestState/utils.d.ts +34 -0
- package/lib/providers/fileManifestState/utils.js +80 -0
- package/lib/providers/fileManifestState.d.ts +5 -19
- package/lib/providers/fileManifestState.js +17 -37
- package/lib/styles/common/constants/size.d.ts +5 -0
- package/lib/styles/common/constants/size.js +6 -0
- package/lib/styles/common/mui/alert.d.ts +4 -0
- package/lib/styles/common/mui/alert.js +20 -0
- package/lib/styles/common/mui/chip.d.ts +11 -0
- package/lib/styles/common/mui/chip.js +25 -0
- package/lib/styles/common/mui/icon.d.ts +2 -0
- package/lib/styles/common/mui/icon.js +6 -0
- package/lib/theme/common/components.d.ts +0 -12
- package/lib/theme/common/components.js +33 -157
- package/lib/theme/components/index.d.ts +2 -0
- package/lib/theme/components/index.js +2 -0
- package/lib/theme/components/muiAlert.d.ts +2 -0
- package/lib/theme/components/muiAlert.js +121 -0
- package/lib/theme/components/muiAlertTitle.d.ts +2 -0
- package/lib/theme/components/muiAlertTitle.js +12 -0
- package/lib/theme/theme.js +3 -2
- package/lib/views/ExportView/exportView.js +1 -1
- package/package.json +4 -4
- package/release-please-config.json +23 -0
- package/src/common/analytics/entities.ts +17 -6
- package/src/common/analytics/readme-analytics.md +9 -7
- package/src/components/Export/common/tracking.ts +46 -16
- package/src/components/Export/components/DownloadCurlCommand/downloadCurlCommand.tsx +4 -30
- package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.tsx +16 -18
- package/src/components/Export/components/ExportToTerra/exportToTerra.tsx +18 -2
- package/src/components/Export/components/ManifestDownload/components/ManifestDownloadEntity/manifestDownloadEntity.tsx +7 -1
- package/src/components/Export/components/ManifestDownload/manifestDownload.tsx +11 -1
- package/src/components/Index/components/AzulFileDownload/azulFileDownload.tsx +8 -0
- package/src/components/Layout/components/Footer/components/VersionInfo/components/Tooltip/components/Title/constants.ts +5 -0
- package/src/components/Layout/components/Footer/components/VersionInfo/components/Tooltip/components/Title/title.tsx +53 -0
- package/src/components/Layout/components/Footer/components/VersionInfo/components/Tooltip/components/Title/utils.ts +31 -0
- package/src/components/Layout/components/Footer/components/VersionInfo/constants.ts +30 -0
- package/src/components/Layout/components/Footer/components/VersionInfo/types.ts +14 -0
- package/src/components/Layout/components/Footer/components/VersionInfo/utils.ts +32 -0
- package/src/components/Layout/components/Footer/components/VersionInfo/versionInfo.styles.ts +10 -0
- package/src/components/Layout/components/Footer/components/VersionInfo/versionInfo.tsx +31 -0
- package/src/components/Layout/components/Footer/footer.tsx +5 -2
- package/src/components/Layout/components/Header/components/Content/components/Logo/logo.styles.ts +0 -1
- package/src/components/Layout/components/Header/components/Content/components/Logo/logo.tsx +3 -2
- package/src/components/Links/components/Link/link.tsx +17 -16
- package/src/components/Support/components/SupportRequest/components/Dialog/dialog.styles.ts +5 -0
- package/src/components/Support/components/ViewSupport/viewSupport.styles.ts +5 -0
- package/src/components/Table/common/utils.ts +0 -1
- package/src/components/common/Alert/alert.styles.ts +22 -25
- package/src/components/common/Alert/alert.tsx +14 -35
- package/src/components/common/Alert/constants.ts +29 -0
- package/src/components/common/Alert/hooks/useTransition/types.ts +5 -0
- package/src/components/common/Alert/hooks/useTransition/useTransition.ts +25 -0
- package/src/components/common/Banner/banner.styles.ts +29 -0
- package/src/components/common/Banner/banner.tsx +11 -18
- package/src/components/common/Banner/components/CookieBanner/constants.ts +9 -0
- package/src/components/common/Banner/components/CookieBanner/cookieBanner.styles.ts +2 -16
- package/src/components/common/Banner/components/CookieBanner/cookieBanner.tsx +36 -64
- package/src/components/common/Banner/components/SessionTimeout/sessionTimeout.tsx +12 -17
- package/src/components/common/Banner/components/SystemIndexing/systemIndexing.tsx +11 -22
- package/src/components/common/Banner/components/SystemStatus/systemStatus.tsx +11 -22
- package/src/components/common/Banner/constants.ts +11 -0
- package/src/components/common/Breadcrumbs/breadcrumbs.tsx +6 -10
- package/src/components/common/Paper/paper.styles.ts +18 -12
- package/src/components/types.ts +13 -0
- package/src/config/entities.ts +1 -0
- package/src/hooks/useFileManifest/common/buildFileManifestRequestURL.ts +3 -4
- package/src/hooks/useFileManifest/common/entities.ts +5 -6
- package/src/hooks/useFileManifest/useRequestFileManifest.ts +5 -0
- package/src/hooks/useLocalStorage/useLocalStorage.ts +2 -2
- package/src/providers/fileManifestState/actions.ts +34 -0
- package/src/providers/fileManifestState/constants.ts +31 -0
- package/src/providers/fileManifestState/utils.ts +108 -0
- package/src/providers/fileManifestState.tsx +30 -58
- package/src/styles/common/constants/size.ts +5 -0
- package/src/styles/common/mui/alert.ts +24 -0
- package/src/styles/common/mui/chip.ts +36 -0
- package/src/styles/common/mui/icon.ts +8 -0
- package/src/theme/common/components.ts +32 -159
- package/src/theme/components/index.ts +2 -0
- package/src/theme/components/muiAlert.ts +123 -0
- package/src/theme/components/muiAlertTitle.ts +14 -0
- package/src/theme/theme.ts +3 -2
- package/src/views/ExportView/exportView.tsx +1 -1
- package/tests/azulFileDownload.test.tsx +11 -6
- package/tests/fileManifestRequestFilters.test.ts +160 -0
- package/tests/updateFilesFacetsStatus.test.ts +84 -0
- package/types/data-explorer-ui.d.ts +6 -5
- package/lib/components/Index/components/TitleCell/titleCell.d.ts +0 -6
- package/lib/components/Index/components/TitleCell/titleCell.js +0 -10
- package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +0 -3
- package/lib/components/Index/components/TitleCell/titleCell.styles.js +0 -6
- package/lib/components/common/Alert/alert.stories.d.ts +0 -6
- package/lib/components/common/Alert/alert.stories.js +0 -36
- package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +0 -4
- package/lib/components/common/Alert/components/AlertText/alertText.styles.js +0 -19
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +0 -7
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +0 -5
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +0 -3
- package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +0 -19
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +0 -10
- package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +0 -16
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +0 -3
- package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +0 -21
- package/src/components/Index/components/TitleCell/titleCell.styles.ts +0 -7
- package/src/components/Index/components/TitleCell/titleCell.tsx +0 -22
- package/src/components/common/Alert/alert.stories.tsx +0 -41
- package/src/components/common/Alert/components/AlertText/alertText.styles.ts +0 -20
- package/src/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.ts +0 -20
- package/src/components/common/Banner/components/BannerPrimary/bannerPrimary.tsx +0 -27
- package/src/components/common/Banner/components/DismissibleBanner/dismissibleBanner.tsx +0 -44
- package/src/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.ts +0 -22
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { Chip } from "@mui/material";
|
|
3
|
+
import { inkLight } from "../../../../../../styles/common/mixins/colors";
|
|
4
|
+
|
|
5
|
+
export const StyledChip = styled(Chip)`
|
|
6
|
+
border-radius: 4px;
|
|
7
|
+
.MuiChip-label {
|
|
8
|
+
color: ${inkLight};
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Tooltip } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BaseComponentProps } from "../../../../../types";
|
|
4
|
+
import { Title } from "./components/Tooltip/components/Title/title";
|
|
5
|
+
import { CHIP_PROPS, TOOLTIP_PROPS } from "./constants";
|
|
6
|
+
import { VersionInfoProps } from "./types";
|
|
7
|
+
|
|
8
|
+
import { getLabel } from "./utils";
|
|
9
|
+
import { StyledChip } from "./versionInfo.styles";
|
|
10
|
+
|
|
11
|
+
export const VersionInfo = ({
|
|
12
|
+
chipProps,
|
|
13
|
+
className,
|
|
14
|
+
tooltipProps,
|
|
15
|
+
versionInfo,
|
|
16
|
+
}: BaseComponentProps & VersionInfoProps): JSX.Element | null => {
|
|
17
|
+
return (
|
|
18
|
+
<Tooltip
|
|
19
|
+
{...TOOLTIP_PROPS}
|
|
20
|
+
title={<Title versionInfo={versionInfo} />}
|
|
21
|
+
{...tooltipProps}
|
|
22
|
+
>
|
|
23
|
+
<StyledChip
|
|
24
|
+
{...CHIP_PROPS}
|
|
25
|
+
className={className}
|
|
26
|
+
label={getLabel(versionInfo)}
|
|
27
|
+
{...chipProps}
|
|
28
|
+
/>
|
|
29
|
+
</Tooltip>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -6,10 +6,11 @@ import { NavLinkItem } from "../Header/components/Content/components/Navigation/
|
|
|
6
6
|
import { AppBar, Link, Links, Socials } from "./footer.styles";
|
|
7
7
|
|
|
8
8
|
export interface FooterProps {
|
|
9
|
-
Branding
|
|
9
|
+
Branding?: ReactNode;
|
|
10
10
|
className?: string;
|
|
11
11
|
navLinks?: NavLinkItem[];
|
|
12
12
|
socials?: Social[];
|
|
13
|
+
versionInfo?: ReactNode;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
export const Footer = ({
|
|
@@ -17,6 +18,7 @@ export const Footer = ({
|
|
|
17
18
|
className,
|
|
18
19
|
navLinks,
|
|
19
20
|
socials,
|
|
21
|
+
versionInfo,
|
|
20
22
|
}: FooterProps): JSX.Element => {
|
|
21
23
|
return (
|
|
22
24
|
<AppBar
|
|
@@ -27,7 +29,7 @@ export const Footer = ({
|
|
|
27
29
|
>
|
|
28
30
|
<Toolbar variant="dense">
|
|
29
31
|
{Branding}
|
|
30
|
-
{(navLinks || socials) && (
|
|
32
|
+
{(navLinks || socials || versionInfo) && (
|
|
31
33
|
<Links>
|
|
32
34
|
{navLinks &&
|
|
33
35
|
navLinks.map(({ label, target = ANCHOR_TARGET.SELF, url }, i) => (
|
|
@@ -39,6 +41,7 @@ export const Footer = ({
|
|
|
39
41
|
/>
|
|
40
42
|
))}
|
|
41
43
|
{socials && <Socials buttonSize="small" socials={socials} />}
|
|
44
|
+
{versionInfo}
|
|
42
45
|
</Links>
|
|
43
46
|
)}
|
|
44
47
|
</Toolbar>
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
StaticImage,
|
|
5
5
|
} from "../../../../../../../common/StaticImage/staticImage";
|
|
6
6
|
import { ANCHOR_TARGET } from "../../../../../../../Links/common/entities";
|
|
7
|
+
import { BaseComponentProps } from "../../../../../../../types";
|
|
7
8
|
import { StyledLink } from "./logo.styles";
|
|
8
9
|
|
|
9
|
-
export interface LogoProps {
|
|
10
|
+
export interface LogoProps extends BaseComponentProps {
|
|
10
11
|
alt: string;
|
|
11
|
-
className?: string;
|
|
12
12
|
height?: number;
|
|
13
13
|
link: string;
|
|
14
14
|
src: ImageSrc;
|
|
@@ -30,6 +30,7 @@ export const Logo = ({
|
|
|
30
30
|
className={className}
|
|
31
31
|
label={<StaticImage alt={alt} height={height} src={src} width={width} />}
|
|
32
32
|
target={target}
|
|
33
|
+
underline="none"
|
|
33
34
|
url={link}
|
|
34
35
|
/>
|
|
35
36
|
);
|
|
@@ -8,6 +8,7 @@ import React, { ReactNode } from "react";
|
|
|
8
8
|
import { isValidUrl } from "../../../../common/utils";
|
|
9
9
|
import { CopyToClipboard } from "../../../common/CopyToClipboard/copyToClipboard";
|
|
10
10
|
import { TypographyProps } from "../../../common/Typography/common/entities";
|
|
11
|
+
import { BaseComponentProps } from "../../../types";
|
|
11
12
|
import { ANCHOR_TARGET, REL_ATTRIBUTE, Url } from "../../common/entities";
|
|
12
13
|
import {
|
|
13
14
|
isClientSideNavigation,
|
|
@@ -16,11 +17,11 @@ import {
|
|
|
16
17
|
} from "../../common/utils";
|
|
17
18
|
import { ExploreViewLink } from "./components/ExploreViewLink/exploreViewLink";
|
|
18
19
|
|
|
19
|
-
export interface LinkProps
|
|
20
|
-
|
|
20
|
+
export interface LinkProps
|
|
21
|
+
extends BaseComponentProps,
|
|
22
|
+
Omit<MLinkProps, "children" | "component"> {
|
|
21
23
|
copyable?: boolean;
|
|
22
24
|
label: ReactNode /* link label may be an element */;
|
|
23
|
-
noWrap?: MLinkProps["noWrap"];
|
|
24
25
|
onClick?: () => void;
|
|
25
26
|
target?: ANCHOR_TARGET;
|
|
26
27
|
TypographyProps?: TypographyProps;
|
|
@@ -55,19 +56,19 @@ export const Link = ({
|
|
|
55
56
|
/* Client-side navigation */
|
|
56
57
|
return (
|
|
57
58
|
<>
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</
|
|
59
|
+
<MLink
|
|
60
|
+
className={className}
|
|
61
|
+
component={NLink}
|
|
62
|
+
href={url}
|
|
63
|
+
noWrap={noWrap}
|
|
64
|
+
onClick={onClick}
|
|
65
|
+
rel={REL_ATTRIBUTE.NO_OPENER}
|
|
66
|
+
target={target || ANCHOR_TARGET.SELF}
|
|
67
|
+
{...TypographyProps}
|
|
68
|
+
{...props}
|
|
69
|
+
>
|
|
70
|
+
{label}
|
|
71
|
+
</MLink>
|
|
71
72
|
{copyable && <CopyToClipboard copyStr={url} />}
|
|
72
73
|
</>
|
|
73
74
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
2
|
import { Fab as MFab, Popover as MPopover } from "@mui/material";
|
|
3
|
+
import { mediaTabletUp } from "../../../../../../styles/common/mixins/breakpoints";
|
|
3
4
|
import { smokeMain } from "../../../../../../styles/common/mixins/colors";
|
|
4
5
|
import { shadows02 } from "../../../../../../styles/common/mixins/shadows";
|
|
5
6
|
import { tabletUp } from "../../../../../../theme/common/breakpoints";
|
|
@@ -15,6 +16,10 @@ export const Fab = styled(MFab)<Props>`
|
|
|
15
16
|
position: fixed;
|
|
16
17
|
right: 16px;
|
|
17
18
|
z-index: ${({ open }) => (open ? 1350 : 1050)}; // Above backdrop component.
|
|
19
|
+
|
|
20
|
+
${mediaTabletUp} {
|
|
21
|
+
bottom: 72px;
|
|
22
|
+
}
|
|
18
23
|
`;
|
|
19
24
|
|
|
20
25
|
export const Popover = styled(MPopover)`
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
+
import { mediaTabletUp } from "../../../../styles/common/mixins/breakpoints";
|
|
2
3
|
import {
|
|
3
4
|
primaryDark,
|
|
4
5
|
primaryMain,
|
|
@@ -27,4 +28,8 @@ export const Fab = styled("a")`
|
|
|
27
28
|
&:hover {
|
|
28
29
|
background-color: ${primaryDark};
|
|
29
30
|
}
|
|
31
|
+
|
|
32
|
+
${mediaTabletUp} {
|
|
33
|
+
bottom: 72px;
|
|
34
|
+
}
|
|
30
35
|
`;
|
|
@@ -344,7 +344,6 @@ export function getTableStatePagination(
|
|
|
344
344
|
* @returns list of headers.
|
|
345
345
|
*/
|
|
346
346
|
function getHeadersTableData<T extends RowData>(rows: Row<T>[]): TableData[] {
|
|
347
|
-
console.log(rows[0].getAllCells());
|
|
348
347
|
return rows[0]
|
|
349
348
|
.getAllCells()
|
|
350
349
|
.filter((cell) => cell.column.id !== ACCESSOR_KEYS.SELECT)
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
+
import { css } from "@emotion/react";
|
|
1
2
|
import styled from "@emotion/styled";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { Alert } from "@mui/material";
|
|
4
|
+
import { SIZE } from "../../../styles/common/constants/size";
|
|
5
|
+
import {
|
|
6
|
+
textBody4002Lines,
|
|
7
|
+
textBodyLarge500,
|
|
8
|
+
} from "../../../styles/common/mixins/fonts";
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/* eslint-enable valid-jsdoc -- disable require param */
|
|
21
|
-
export const FluidAlert = styled(Alert)`
|
|
22
|
-
${({ theme }) => theme.breakpoints.down(TABLET)} {
|
|
23
|
-
border-left: none;
|
|
24
|
-
border-radius: 0;
|
|
25
|
-
border-right: none;
|
|
26
|
-
box-shadow: none;
|
|
27
|
-
}
|
|
10
|
+
export const StyledAlert = styled(Alert)`
|
|
11
|
+
${(props) =>
|
|
12
|
+
props.size === SIZE.LARGE &&
|
|
13
|
+
css`
|
|
14
|
+
padding: 20px;
|
|
15
|
+
.MuiAlert-icon {
|
|
16
|
+
padding: 2px 0;
|
|
17
|
+
}
|
|
18
|
+
.MuiAlert-message {
|
|
19
|
+
${textBody4002Lines(props)};
|
|
20
|
+
.MuiAlertTitle-root {
|
|
21
|
+
${textBodyLarge500(props)};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
`}
|
|
28
25
|
`;
|
|
@@ -1,39 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "@mui/material";
|
|
6
|
-
import React, { ReactNode } from "react";
|
|
1
|
+
import { AlertProps } from "@mui/material";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { BaseComponentProps } from "../../types";
|
|
4
|
+
import { StyledAlert } from "./alert.styles";
|
|
7
5
|
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
variant?: MAlertProps["variant"];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const Alert = ({
|
|
19
|
-
children,
|
|
20
|
-
className,
|
|
21
|
-
color,
|
|
22
|
-
icon,
|
|
23
|
-
severity,
|
|
24
|
-
title,
|
|
25
|
-
variant = "standard",
|
|
26
|
-
}: AlertProps): JSX.Element => {
|
|
6
|
+
export const Alert = forwardRef<
|
|
7
|
+
HTMLDivElement,
|
|
8
|
+
AlertProps & BaseComponentProps
|
|
9
|
+
>(function Alert(
|
|
10
|
+
{ children, className, ...props }: AlertProps & BaseComponentProps,
|
|
11
|
+
ref
|
|
12
|
+
): JSX.Element {
|
|
27
13
|
return (
|
|
28
|
-
<
|
|
29
|
-
className={className}
|
|
30
|
-
color={color}
|
|
31
|
-
icon={icon}
|
|
32
|
-
severity={severity}
|
|
33
|
-
variant={variant}
|
|
34
|
-
>
|
|
35
|
-
{title && <AlertTitle>{title}</AlertTitle>}
|
|
14
|
+
<StyledAlert className={className} ref={ref} {...props}>
|
|
36
15
|
{children}
|
|
37
|
-
</
|
|
16
|
+
</StyledAlert>
|
|
38
17
|
);
|
|
39
|
-
};
|
|
18
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AlertProps } from "@mui/material";
|
|
2
|
+
import { COLOR, SEVERITY, VARIANT } from "../../../styles/common/mui/alert";
|
|
3
|
+
|
|
4
|
+
export const ALERT_PROPS: Record<string, Partial<AlertProps>> = {
|
|
5
|
+
FILLED_INK: {
|
|
6
|
+
color: COLOR.INK,
|
|
7
|
+
variant: VARIANT.FILLED,
|
|
8
|
+
},
|
|
9
|
+
FILLED_PRIMARY: {
|
|
10
|
+
color: COLOR.PRIMARY,
|
|
11
|
+
variant: VARIANT.FILLED,
|
|
12
|
+
},
|
|
13
|
+
FILLED_SMOKE: {
|
|
14
|
+
color: COLOR.SMOKE,
|
|
15
|
+
variant: VARIANT.FILLED,
|
|
16
|
+
},
|
|
17
|
+
STANDARD_ERROR: {
|
|
18
|
+
severity: SEVERITY.ERROR,
|
|
19
|
+
},
|
|
20
|
+
STANDARD_INFO: {
|
|
21
|
+
severity: SEVERITY.INFO,
|
|
22
|
+
},
|
|
23
|
+
STANDARD_SUCCESS: {
|
|
24
|
+
severity: SEVERITY.SUCCESS,
|
|
25
|
+
},
|
|
26
|
+
STANDARD_WARNING: {
|
|
27
|
+
severity: SEVERITY.WARNING,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
import { UseTransition } from "./types";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hook to manage transition state for alert component wrapped in a transition component.
|
|
6
|
+
* @param initialState - Initial state of the transition.
|
|
7
|
+
* @returns transition state and handlers.
|
|
8
|
+
*/
|
|
9
|
+
export const useTransition = (initialState?: boolean): UseTransition => {
|
|
10
|
+
const [isIn, setIsIn] = useState<boolean>(initialState || false);
|
|
11
|
+
|
|
12
|
+
const onEnter = useCallback((): void => {
|
|
13
|
+
setIsIn(true);
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
const onExit = useCallback((): void => {
|
|
17
|
+
setIsIn(false);
|
|
18
|
+
}, []);
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
isIn,
|
|
22
|
+
onEnter,
|
|
23
|
+
onExit,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { Alert } from "@mui/material";
|
|
3
|
+
import { mediaDesktopUp } from "../../../styles/common/mixins/breakpoints";
|
|
4
|
+
import { textBodySmall400 } from "../../../styles/common/mixins/fonts";
|
|
5
|
+
|
|
6
|
+
export const StyledAlert = styled(Alert)`
|
|
7
|
+
justify-content: center;
|
|
8
|
+
padding: 8px 12px;
|
|
9
|
+
text-align: center;
|
|
10
|
+
|
|
11
|
+
.MuiAlert-message {
|
|
12
|
+
${textBodySmall400};
|
|
13
|
+
align-self: center;
|
|
14
|
+
flex: 1;
|
|
15
|
+
|
|
16
|
+
.MuiLink-root {
|
|
17
|
+
color: inherit;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.MuiAlert-action {
|
|
22
|
+
margin: -8px;
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
${mediaDesktopUp} {
|
|
27
|
+
padding: 8px 16px;
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
@@ -1,22 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { forwardRef
|
|
1
|
+
import { AlertProps } from "@mui/material";
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
|
+
import { BaseComponentProps } from "../../types";
|
|
4
|
+
import { StyledAlert } from "./banner.styles";
|
|
5
|
+
import { ALERT_PROPS } from "./constants";
|
|
3
6
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export const Banner = forwardRef<HTMLDivElement, BannerProps>(function Banner(
|
|
10
|
-
{
|
|
11
|
-
children,
|
|
12
|
-
className,
|
|
13
|
-
...props /* Spread props to allow for Mui AlertProps specific prop overrides. */
|
|
14
|
-
}: BannerProps,
|
|
7
|
+
export const Banner = forwardRef<
|
|
8
|
+
HTMLDivElement,
|
|
9
|
+
AlertProps & BaseComponentProps
|
|
10
|
+
>(function Alert(
|
|
11
|
+
{ ...props }: AlertProps & BaseComponentProps,
|
|
15
12
|
ref
|
|
16
13
|
): JSX.Element {
|
|
17
|
-
return
|
|
18
|
-
<MAlert className={className} ref={ref} {...props}>
|
|
19
|
-
{children}
|
|
20
|
-
</MAlert>
|
|
21
|
-
);
|
|
14
|
+
return <StyledAlert {...ALERT_PROPS} ref={ref} {...props} />;
|
|
22
15
|
});
|
|
@@ -1,34 +1,20 @@
|
|
|
1
1
|
import styled from "@emotion/styled";
|
|
2
|
+
import { Alert } from "@mui/material";
|
|
2
3
|
import { mediaTabletUp } from "../../../../../styles/common/mixins/breakpoints";
|
|
3
|
-
import { white } from "../../../../../styles/common/mixins/colors";
|
|
4
4
|
import { textBody400 } from "../../../../../styles/common/mixins/fonts";
|
|
5
|
-
import { shadows02 } from "../../../../../styles/common/mixins/shadows";
|
|
6
|
-
import { Banner } from "../../banner";
|
|
7
5
|
|
|
8
|
-
export const
|
|
6
|
+
export const StyledAlert = styled(Alert)`
|
|
9
7
|
bottom: 0;
|
|
10
|
-
box-shadow: ${shadows02};
|
|
11
|
-
color: ${white};
|
|
12
8
|
flex-direction: column;
|
|
13
9
|
gap: 16px;
|
|
14
10
|
left: 0;
|
|
15
11
|
margin: 8px;
|
|
16
|
-
padding: 16px;
|
|
17
12
|
position: fixed;
|
|
18
13
|
width: calc(100vw - 16px);
|
|
19
14
|
z-index: 1100; // Above support fab, below support form.
|
|
20
15
|
|
|
21
16
|
.MuiAlert-message {
|
|
22
17
|
${textBody400};
|
|
23
|
-
|
|
24
|
-
.MuiLink-root {
|
|
25
|
-
color: inherit;
|
|
26
|
-
text-decoration: underline;
|
|
27
|
-
|
|
28
|
-
&:hover {
|
|
29
|
-
text-decoration: none;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
18
|
}
|
|
33
19
|
|
|
34
20
|
.MuiAlert-action {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, {
|
|
1
|
+
import { AlertProps, Button, Fade } from "@mui/material";
|
|
2
|
+
import React, { Fragment, ReactNode, useEffect } from "react";
|
|
3
3
|
import { FLAG } from "../../../../../hooks/useFeatureFlag/common/entities";
|
|
4
4
|
import { setLocalStorage } from "../../../../../hooks/useLocalStorage/common/utils";
|
|
5
5
|
import { useLocalStorage } from "../../../../../hooks/useLocalStorage/useLocalStorage";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { BaseComponentProps } from "../../../../types";
|
|
7
|
+
import { useTransition } from "../../../Alert/hooks/useTransition/useTransition";
|
|
8
|
+
import { ALERT_PROPS } from "./constants";
|
|
9
|
+
import { StyledAlert } from "./cookieBanner.styles";
|
|
9
10
|
|
|
10
|
-
export interface CookieBannerProps
|
|
11
|
-
|
|
11
|
+
export interface CookieBannerProps
|
|
12
|
+
extends Omit<AlertProps, "children">,
|
|
13
|
+
BaseComponentProps {
|
|
12
14
|
localStorageKey: string;
|
|
13
15
|
message?: ReactNode;
|
|
14
16
|
secondaryAction?: ReactNode;
|
|
@@ -20,66 +22,36 @@ export const CookieBanner = ({
|
|
|
20
22
|
message,
|
|
21
23
|
secondaryAction,
|
|
22
24
|
}: CookieBannerProps): JSX.Element => {
|
|
25
|
+
const { isIn, onEnter, onExit } = useTransition();
|
|
23
26
|
const localStorage = useLocalStorage(localStorageKey);
|
|
24
|
-
const isCookieAccepted = localStorage === FLAG.TRUE;
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (localStorage === null) onEnter();
|
|
30
|
+
}, [localStorage, onEnter]);
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
<Fade in={isIn} unmountOnExit>
|
|
34
|
+
<StyledAlert
|
|
35
|
+
{...ALERT_PROPS}
|
|
36
|
+
action={
|
|
37
|
+
<Fragment>
|
|
38
|
+
<Button
|
|
39
|
+
color="primary"
|
|
40
|
+
onClick={(): void => {
|
|
41
|
+
setLocalStorage(localStorageKey, FLAG.TRUE);
|
|
42
|
+
onExit();
|
|
43
|
+
}}
|
|
44
|
+
variant="contained"
|
|
45
|
+
>
|
|
46
|
+
Ok, Got It
|
|
47
|
+
</Button>
|
|
48
|
+
{secondaryAction}
|
|
49
|
+
</Fragment>
|
|
50
|
+
}
|
|
51
|
+
className={className}
|
|
52
|
+
>
|
|
53
|
+
{message}
|
|
54
|
+
</StyledAlert>
|
|
55
|
+
</Fade>
|
|
43
56
|
);
|
|
44
57
|
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Return the cookie banner alert.
|
|
48
|
-
* @param props - Alert props e.g. "onClick" to close banner.
|
|
49
|
-
* @returns alert element.
|
|
50
|
-
*/
|
|
51
|
-
const Alert = forwardRef<HTMLDivElement, MAlertProps>(function Alert(
|
|
52
|
-
{ ...props },
|
|
53
|
-
ref
|
|
54
|
-
): JSX.Element {
|
|
55
|
-
return (
|
|
56
|
-
<Banner
|
|
57
|
-
color="ink"
|
|
58
|
-
elevation={2}
|
|
59
|
-
icon={false}
|
|
60
|
-
ref={ref}
|
|
61
|
-
variant="filled"
|
|
62
|
-
{...props}
|
|
63
|
-
>
|
|
64
|
-
{props.children}
|
|
65
|
-
</Banner>
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Returns the close action component(s).
|
|
71
|
-
* @param buttonProps - Button props e.g. "onClick" to close banner.
|
|
72
|
-
* @param secondaryAction - Secondary action component.
|
|
73
|
-
* @returns close button element(s).
|
|
74
|
-
*/
|
|
75
|
-
function renderCloseButton(
|
|
76
|
-
buttonProps: ButtonProps,
|
|
77
|
-
secondaryAction?: ReactNode
|
|
78
|
-
): JSX.Element {
|
|
79
|
-
return (
|
|
80
|
-
<Fragment>
|
|
81
|
-
<ButtonPrimary onClick={buttonProps.onClick}>Ok, Got It</ButtonPrimary>
|
|
82
|
-
{secondaryAction}
|
|
83
|
-
</Fragment>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
import { AlertProps
|
|
2
|
-
import React
|
|
1
|
+
import { AlertProps, Fade } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
3
|
import { useSessionTimeout } from "../../../../../hooks/useSessionTimeout";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export interface SessionTimeoutProps extends Omit<MAlertProps, "title"> {
|
|
7
|
-
className?: string;
|
|
8
|
-
title?: ReactNode;
|
|
9
|
-
}
|
|
4
|
+
import { BaseComponentProps, ContentProps } from "../../../../types";
|
|
5
|
+
import { Banner } from "../../banner";
|
|
10
6
|
|
|
11
7
|
export const SessionTimeout = ({
|
|
8
|
+
children,
|
|
12
9
|
className,
|
|
13
|
-
|
|
10
|
+
content,
|
|
14
11
|
...props
|
|
15
|
-
}:
|
|
12
|
+
}: AlertProps & BaseComponentProps & ContentProps): JSX.Element => {
|
|
16
13
|
const { clearSessionTimeout, isSessionTimeout } = useSessionTimeout();
|
|
17
14
|
return (
|
|
18
|
-
<
|
|
19
|
-
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
)}
|
|
24
|
-
</Fragment>
|
|
15
|
+
<Fade in={isSessionTimeout} unmountOnExit>
|
|
16
|
+
<Banner className={className} onClose={clearSessionTimeout} {...props}>
|
|
17
|
+
{content || children}
|
|
18
|
+
</Banner>
|
|
19
|
+
</Fade>
|
|
25
20
|
);
|
|
26
21
|
};
|