@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,24 @@
|
|
|
1
|
+
import { AlertProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const COLOR: Record<string, AlertProps["color"]> = {
|
|
4
|
+
ERROR: "error",
|
|
5
|
+
INFO: "info",
|
|
6
|
+
INK: "ink",
|
|
7
|
+
PRIMARY: "primary",
|
|
8
|
+
SMOKE: "smoke",
|
|
9
|
+
SUCCESS: "success",
|
|
10
|
+
WARNING: "warning",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const SEVERITY: Record<string, AlertProps["severity"]> = {
|
|
14
|
+
ERROR: "error",
|
|
15
|
+
INFO: "info",
|
|
16
|
+
SUCCESS: "success",
|
|
17
|
+
WARNING: "warning",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const VARIANT: Record<string, AlertProps["variant"]> = {
|
|
21
|
+
FILLED: "filled",
|
|
22
|
+
OUTLINED: "outlined",
|
|
23
|
+
STANDARD: "standard",
|
|
24
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ChipProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
type ChipPropsOptions = {
|
|
4
|
+
COLOR: typeof COLOR;
|
|
5
|
+
SIZE: typeof SIZE;
|
|
6
|
+
VARIANT: typeof VARIANT;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const COLOR: Record<string, ChipProps["color"]> = {
|
|
10
|
+
DEFAULT: "default",
|
|
11
|
+
ERROR: "error",
|
|
12
|
+
INFO: "info",
|
|
13
|
+
PRIMARY: "primary",
|
|
14
|
+
SECONDARY: "secondary",
|
|
15
|
+
SUCCESS: "success",
|
|
16
|
+
WARNING: "warning",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const SIZE: Record<string, ChipProps["size"]> = {
|
|
20
|
+
MEDIUM: "medium",
|
|
21
|
+
SMALL: "small",
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const VARIANT: Record<string, ChipProps["variant"]> = {
|
|
25
|
+
FILLED: "filled",
|
|
26
|
+
FILTER_TAG: "filterTag",
|
|
27
|
+
N_TAG: "ntag",
|
|
28
|
+
OUTLINED: "outlined",
|
|
29
|
+
STATUS: "status",
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const CHIP_PROPS: ChipPropsOptions = {
|
|
33
|
+
COLOR,
|
|
34
|
+
SIZE,
|
|
35
|
+
VARIANT,
|
|
36
|
+
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Components, Theme } from "@mui/material";
|
|
2
|
-
import { ErrorIcon } from "../../components/common/CustomIcon/components/ErrorIcon/errorIcon";
|
|
3
|
-
import { InfoIcon } from "../../components/common/CustomIcon/components/InfoIcon/infoIcon";
|
|
4
|
-
import { SuccessIcon } from "../../components/common/CustomIcon/components/SuccessIcon/successIcon";
|
|
5
|
-
import { WarningIcon } from "../../components/common/CustomIcon/components/WarningIcon/warningIcon";
|
|
6
2
|
import { DropDownIcon } from "../../components/common/Form/components/Select/components/DropDownIcon/dropDownIcon";
|
|
3
|
+
import { CHIP_PROPS } from "../../styles/common/mui/chip";
|
|
7
4
|
import { desktopUp, mobileUp, tabletUp } from "./breakpoints";
|
|
8
5
|
import {
|
|
9
6
|
alpha32,
|
|
@@ -19,7 +16,6 @@ import {
|
|
|
19
16
|
TEXT_BODY_400,
|
|
20
17
|
TEXT_BODY_400_2_LINES,
|
|
21
18
|
TEXT_BODY_500,
|
|
22
|
-
TEXT_BODY_LARGE_500,
|
|
23
19
|
TEXT_BODY_SMALL_400,
|
|
24
20
|
TEXT_BODY_SMALL_500,
|
|
25
21
|
TEXT_HEADING,
|
|
@@ -85,159 +81,6 @@ export const MuiAccordionSummary: Components["MuiAccordionSummary"] = {
|
|
|
85
81
|
},
|
|
86
82
|
};
|
|
87
83
|
|
|
88
|
-
/**
|
|
89
|
-
* MuiAlert Component
|
|
90
|
-
* @param theme - Theme.
|
|
91
|
-
* @returns MuiAlert component theme styles.
|
|
92
|
-
*/
|
|
93
|
-
export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
|
|
94
|
-
return {
|
|
95
|
-
defaultProps: {
|
|
96
|
-
iconMapping: {
|
|
97
|
-
error: ErrorIcon({ fontSize: "small" }),
|
|
98
|
-
info: InfoIcon({ fontSize: "small" }),
|
|
99
|
-
success: SuccessIcon({ fontSize: "small" }),
|
|
100
|
-
warning: WarningIcon({ fontSize: "small" }),
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
styleOverrides: {
|
|
104
|
-
icon: {
|
|
105
|
-
opacity: 1,
|
|
106
|
-
padding: "2px 0",
|
|
107
|
-
},
|
|
108
|
-
message: {
|
|
109
|
-
display: "grid",
|
|
110
|
-
gap: 4,
|
|
111
|
-
padding: 0,
|
|
112
|
-
},
|
|
113
|
-
root: {
|
|
114
|
-
...theme.typography[TEXT_BODY_400_2_LINES],
|
|
115
|
-
borderRadius: 8,
|
|
116
|
-
boxShadow: theme.shadows[1], // elevation01
|
|
117
|
-
color: theme.palette.ink.main,
|
|
118
|
-
},
|
|
119
|
-
standard: {
|
|
120
|
-
alignItems: FLEX_START,
|
|
121
|
-
padding: 20,
|
|
122
|
-
},
|
|
123
|
-
standardError: {
|
|
124
|
-
backgroundColor: theme.palette.alert.lightest,
|
|
125
|
-
border: `1px solid ${theme.palette.alert.main}${alpha32}`,
|
|
126
|
-
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
127
|
-
"& .MuiAlert-icon": {
|
|
128
|
-
color: theme.palette.alert.main,
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
standardInfo: {
|
|
132
|
-
backgroundColor: theme.palette.info.lightest,
|
|
133
|
-
border: `1px solid ${theme.palette.info.main}${alpha32}`,
|
|
134
|
-
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
135
|
-
"& .MuiAlert-icon": {
|
|
136
|
-
color: theme.palette.info.main,
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
standardSuccess: {
|
|
140
|
-
backgroundColor: theme.palette.success.lightest,
|
|
141
|
-
border: `1px solid ${theme.palette.success.main}${alpha32}`,
|
|
142
|
-
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
143
|
-
"& .MuiAlert-icon": {
|
|
144
|
-
color: theme.palette.success.main,
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
standardWarning: {
|
|
148
|
-
backgroundColor: theme.palette.warning.lightest,
|
|
149
|
-
border: `1px solid ${theme.palette.warning.main}${alpha32}`,
|
|
150
|
-
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
151
|
-
"& .MuiAlert-icon": {
|
|
152
|
-
color: theme.palette.warning.main,
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
variants: [
|
|
157
|
-
{
|
|
158
|
-
props: { severity: "info", variant: "neutral" },
|
|
159
|
-
style: {
|
|
160
|
-
backgroundColor: theme.palette.smoke.light,
|
|
161
|
-
padding: 16,
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
props: { variant: "banner" },
|
|
166
|
-
style: {
|
|
167
|
-
padding: 16,
|
|
168
|
-
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
169
|
-
"& .MuiAlert-icon": {
|
|
170
|
-
padding: 0,
|
|
171
|
-
},
|
|
172
|
-
"& .MuiAlertTitle-root": {
|
|
173
|
-
...theme.typography[TEXT_BODY_500],
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
props: { severity: "error", variant: "banner" },
|
|
179
|
-
style: {
|
|
180
|
-
backgroundColor: theme.palette.alert.lightest,
|
|
181
|
-
border: `1px solid ${theme.palette.alert.main}${alpha32}`,
|
|
182
|
-
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
183
|
-
"& .MuiAlert-icon": {
|
|
184
|
-
color: theme.palette.alert.main,
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
props: { severity: "info", variant: "banner" },
|
|
190
|
-
style: {
|
|
191
|
-
backgroundColor: theme.palette.info.lightest,
|
|
192
|
-
border: `1px solid ${theme.palette.info.main}${alpha32}`,
|
|
193
|
-
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
194
|
-
"& .MuiAlert-icon": {
|
|
195
|
-
color: theme.palette.info.main,
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
props: { severity: "success", variant: "banner" },
|
|
201
|
-
style: {
|
|
202
|
-
backgroundColor: theme.palette.success.lightest,
|
|
203
|
-
border: `1px solid ${theme.palette.success.main}${alpha32}`,
|
|
204
|
-
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
205
|
-
"& .MuiAlert-icon": {
|
|
206
|
-
color: theme.palette.success.main,
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
props: { severity: "warning", variant: "banner" },
|
|
212
|
-
style: {
|
|
213
|
-
backgroundColor: theme.palette.warning.lightest,
|
|
214
|
-
border: `1px solid ${theme.palette.warning.main}${alpha32}`,
|
|
215
|
-
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
216
|
-
"& .MuiAlert-icon": {
|
|
217
|
-
color: theme.palette.warning.main,
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
};
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* MuiAlertTitle Component
|
|
227
|
-
* @param theme - Theme.
|
|
228
|
-
* @returns MuiAlertTitle component theme styles.
|
|
229
|
-
*/
|
|
230
|
-
export const MuiAlertTitle = (theme: Theme): Components["MuiAlertTitle"] => {
|
|
231
|
-
return {
|
|
232
|
-
styleOverrides: {
|
|
233
|
-
root: {
|
|
234
|
-
...theme.typography[TEXT_BODY_LARGE_500],
|
|
235
|
-
margin: 0,
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
};
|
|
239
|
-
};
|
|
240
|
-
|
|
241
84
|
/**
|
|
242
85
|
* MuiAppBar Component
|
|
243
86
|
*/
|
|
@@ -575,8 +418,23 @@ export const MuiChip = (theme: Theme): Components["MuiChip"] => {
|
|
|
575
418
|
color: "inherit",
|
|
576
419
|
margin: "0 -2px 0 0",
|
|
577
420
|
},
|
|
421
|
+
label: {
|
|
422
|
+
...theme.typography[TEXT_BODY_SMALL_400],
|
|
423
|
+
},
|
|
578
424
|
},
|
|
579
425
|
variants: [
|
|
426
|
+
{
|
|
427
|
+
props: { size: CHIP_PROPS.SIZE.SMALL },
|
|
428
|
+
style: {
|
|
429
|
+
height: 20,
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
props: { size: CHIP_PROPS.SIZE.MEDIUM },
|
|
434
|
+
style: {
|
|
435
|
+
height: 24,
|
|
436
|
+
},
|
|
437
|
+
},
|
|
580
438
|
{
|
|
581
439
|
props: { color: "default" },
|
|
582
440
|
style: {
|
|
@@ -1047,11 +905,14 @@ export const MuiInputBase = (theme: Theme): Components["MuiInputBase"] => {
|
|
|
1047
905
|
*/
|
|
1048
906
|
export const MuiLink: Components["MuiLink"] = {
|
|
1049
907
|
defaultProps: {
|
|
1050
|
-
underline: "
|
|
908
|
+
underline: "always",
|
|
1051
909
|
},
|
|
1052
910
|
styleOverrides: {
|
|
1053
911
|
root: {
|
|
1054
912
|
cursor: "pointer",
|
|
913
|
+
textDecorationColor: "currentColor",
|
|
914
|
+
textDecorationSkipInk: "none",
|
|
915
|
+
textUnderlinePosition: "from-font",
|
|
1055
916
|
},
|
|
1056
917
|
},
|
|
1057
918
|
};
|
|
@@ -1211,6 +1072,18 @@ export const MuiOutlinedInput = (
|
|
|
1211
1072
|
export const MuiPaper = (theme: Theme): Components["MuiPaper"] => {
|
|
1212
1073
|
return {
|
|
1213
1074
|
variants: [
|
|
1075
|
+
{
|
|
1076
|
+
props: { elevation: 1 },
|
|
1077
|
+
style: {
|
|
1078
|
+
boxShadow: theme.shadows[1], // elevation01
|
|
1079
|
+
},
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
props: { elevation: 2 },
|
|
1083
|
+
style: {
|
|
1084
|
+
boxShadow: theme.shadows[2], // elevation02
|
|
1085
|
+
},
|
|
1086
|
+
},
|
|
1214
1087
|
{
|
|
1215
1088
|
props: { variant: "footer" },
|
|
1216
1089
|
style: {
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Components, Theme } from "@mui/material";
|
|
2
|
+
import { ErrorIcon } from "../../components/common/CustomIcon/components/ErrorIcon/errorIcon";
|
|
3
|
+
import { InfoIcon } from "../../components/common/CustomIcon/components/InfoIcon/infoIcon";
|
|
4
|
+
import { SuccessIcon } from "../../components/common/CustomIcon/components/SuccessIcon/successIcon";
|
|
5
|
+
import { WarningIcon } from "../../components/common/CustomIcon/components/WarningIcon/warningIcon";
|
|
6
|
+
import { SIZE } from "../../styles/common/constants/size";
|
|
7
|
+
import { COLOR, SEVERITY, VARIANT } from "../../styles/common/mui/alert";
|
|
8
|
+
import { FONT_SIZE } from "../../styles/common/mui/icon";
|
|
9
|
+
import { alpha32 } from "../common/palette";
|
|
10
|
+
import { TEXT_BODY_500 } from "../common/typography";
|
|
11
|
+
|
|
12
|
+
export const MuiAlert = (theme: Theme): Components["MuiAlert"] => {
|
|
13
|
+
return {
|
|
14
|
+
defaultProps: {
|
|
15
|
+
elevation: 1,
|
|
16
|
+
iconMapping: {
|
|
17
|
+
error: ErrorIcon({ fontSize: FONT_SIZE.SMALL }),
|
|
18
|
+
info: InfoIcon({ fontSize: FONT_SIZE.SMALL }),
|
|
19
|
+
success: SuccessIcon({ fontSize: FONT_SIZE.SMALL }),
|
|
20
|
+
warning: WarningIcon({ fontSize: FONT_SIZE.SMALL }),
|
|
21
|
+
},
|
|
22
|
+
size: SIZE.MEDIUM,
|
|
23
|
+
},
|
|
24
|
+
styleOverrides: {
|
|
25
|
+
icon: {
|
|
26
|
+
opacity: 1,
|
|
27
|
+
padding: 0,
|
|
28
|
+
},
|
|
29
|
+
message: {
|
|
30
|
+
...theme.typography[TEXT_BODY_500], // default size - "medium"
|
|
31
|
+
display: "grid",
|
|
32
|
+
gap: 4,
|
|
33
|
+
padding: 0,
|
|
34
|
+
},
|
|
35
|
+
root: {
|
|
36
|
+
alignItems: "flex-start",
|
|
37
|
+
borderRadius: 8,
|
|
38
|
+
color: theme.palette.ink.main,
|
|
39
|
+
padding: 16,
|
|
40
|
+
variants: [
|
|
41
|
+
{
|
|
42
|
+
props: { severity: SEVERITY.ERROR },
|
|
43
|
+
style: {
|
|
44
|
+
backgroundColor: theme.palette.alert.lightest,
|
|
45
|
+
border: `1px solid ${theme.palette.alert.main}${alpha32}`,
|
|
46
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
47
|
+
"& .MuiAlert-icon": {
|
|
48
|
+
color: theme.palette.alert.main,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
props: { severity: SEVERITY.INFO },
|
|
54
|
+
style: {
|
|
55
|
+
backgroundColor: theme.palette.info.lightest,
|
|
56
|
+
border: `1px solid ${theme.palette.info.main}${alpha32}`,
|
|
57
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
58
|
+
"& .MuiAlert-icon": {
|
|
59
|
+
color: theme.palette.info.main,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
props: { severity: SEVERITY.SUCCESS },
|
|
65
|
+
style: {
|
|
66
|
+
backgroundColor: theme.palette.success.lightest,
|
|
67
|
+
border: `1px solid ${theme.palette.success.main}${alpha32}`,
|
|
68
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
69
|
+
"& .MuiAlert-icon": {
|
|
70
|
+
color: theme.palette.success.main,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
props: { severity: SEVERITY.WARNING },
|
|
76
|
+
style: {
|
|
77
|
+
backgroundColor: theme.palette.warning.lightest,
|
|
78
|
+
border: `1px solid ${theme.palette.warning.main}${alpha32}`,
|
|
79
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
80
|
+
"& .MuiAlert-icon": {
|
|
81
|
+
color: theme.palette.warning.main,
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
props: { color: COLOR.INK },
|
|
87
|
+
style: {
|
|
88
|
+
backgroundColor: theme.palette.ink.main,
|
|
89
|
+
color: theme.palette.common.white,
|
|
90
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
91
|
+
".MuiLink-root": {
|
|
92
|
+
color: theme.palette.common.white,
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
props: { color: COLOR.PRIMARY },
|
|
98
|
+
style: {
|
|
99
|
+
backgroundColor: theme.palette.primary.main,
|
|
100
|
+
color: theme.palette.common.white,
|
|
101
|
+
// eslint-disable-next-line sort-keys -- disabling key order for readability
|
|
102
|
+
".MuiLink-root": {
|
|
103
|
+
color: theme.palette.common.white,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
props: { color: COLOR.SMOKE },
|
|
109
|
+
style: {
|
|
110
|
+
backgroundColor: theme.palette.smoke.light,
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
props: { variant: VARIANT.FILLED },
|
|
115
|
+
style: {
|
|
116
|
+
border: "none",
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Components } from "@mui/material";
|
|
2
|
+
import { TEXT_BODY_500 } from "../common/typography";
|
|
3
|
+
|
|
4
|
+
export const MuiAlertTitle: Components["MuiAlertTitle"] = {
|
|
5
|
+
defaultProps: {
|
|
6
|
+
gutterBottom: false,
|
|
7
|
+
variant: TEXT_BODY_500,
|
|
8
|
+
},
|
|
9
|
+
styleOverrides: {
|
|
10
|
+
root: {
|
|
11
|
+
margin: 0,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
package/src/theme/theme.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as C from "./common/components";
|
|
|
4
4
|
import * as P from "./common/palette";
|
|
5
5
|
import { shadows } from "./common/shadows";
|
|
6
6
|
import * as T from "./common/typography";
|
|
7
|
+
import * as M from "./components";
|
|
7
8
|
|
|
8
9
|
export interface ThemeProps {
|
|
9
10
|
theme: Theme;
|
|
@@ -71,8 +72,8 @@ export function createAppTheme(customOptions?: ThemeOptions): Theme {
|
|
|
71
72
|
MuiAccordion: C.MuiAccordion(theme),
|
|
72
73
|
MuiAccordionDetails: C.MuiAccordionDetails,
|
|
73
74
|
MuiAccordionSummary: C.MuiAccordionSummary,
|
|
74
|
-
MuiAlert:
|
|
75
|
-
MuiAlertTitle:
|
|
75
|
+
MuiAlert: M.MuiAlert(theme),
|
|
76
|
+
MuiAlertTitle: M.MuiAlertTitle,
|
|
76
77
|
MuiAppBar: C.MuiAppBar,
|
|
77
78
|
MuiBackdrop: C.MuiBackdrop(theme),
|
|
78
79
|
MuiBreadcrumbs: C.MuiBreadcrumbs(theme),
|
|
@@ -14,7 +14,7 @@ export const ExportView = (props: ExportViewProps): JSX.Element => {
|
|
|
14
14
|
exploreState: { filterState },
|
|
15
15
|
} = useExploreState();
|
|
16
16
|
useUpdateURLSearchParams();
|
|
17
|
-
useRequestFileManifest(undefined, filterState, undefined);
|
|
17
|
+
useRequestFileManifest(undefined, undefined, filterState, undefined);
|
|
18
18
|
const { tabs, top } = useExportConfig();
|
|
19
19
|
const currentTab = tabs[0];
|
|
20
20
|
const { mainColumn, sideColumn } = currentTab;
|
|
@@ -21,6 +21,11 @@ describe("AzulFileDownload", () => {
|
|
|
21
21
|
const FILE_URL = "https://example.com/storage/file";
|
|
22
22
|
const MOCK_RUN = jest.fn();
|
|
23
23
|
const URL = "https://example.com/repository/file";
|
|
24
|
+
const TRACKING_PARAMETERS = {
|
|
25
|
+
entityName: "filename.extension",
|
|
26
|
+
relatedEntityId: "id",
|
|
27
|
+
relatedEntityName: "name",
|
|
28
|
+
};
|
|
24
29
|
beforeEach(() => {
|
|
25
30
|
(useFileLocation as jest.Mock).mockReturnValue({
|
|
26
31
|
fileUrl: undefined,
|
|
@@ -33,24 +38,24 @@ describe("AzulFileDownload", () => {
|
|
|
33
38
|
});
|
|
34
39
|
describe("download button", () => {
|
|
35
40
|
test("should render the download button", () => {
|
|
36
|
-
render(<AzulFileDownload url={URL} />);
|
|
41
|
+
render(<AzulFileDownload {...TRACKING_PARAMETERS} url={URL} />);
|
|
37
42
|
const buttonEl = getButtonById(AZUL_FILE_REQUEST_DOWNLOAD_TEST_ID);
|
|
38
43
|
expect(buttonEl).not.toBeNull();
|
|
39
44
|
});
|
|
40
45
|
test("should disable the download button if URL is undefined", () => {
|
|
41
|
-
render(<AzulFileDownload />);
|
|
46
|
+
render(<AzulFileDownload {...TRACKING_PARAMETERS} />);
|
|
42
47
|
const buttonEl = getButtonById(AZUL_FILE_REQUEST_DOWNLOAD_TEST_ID);
|
|
43
48
|
expect(buttonEl.disabled).toBe(true);
|
|
44
49
|
});
|
|
45
50
|
test("should enable the download button if a URL is provided", () => {
|
|
46
|
-
render(<AzulFileDownload url={URL} />);
|
|
51
|
+
render(<AzulFileDownload {...TRACKING_PARAMETERS} url={URL} />);
|
|
47
52
|
const buttonEl = getButtonById(AZUL_FILE_REQUEST_DOWNLOAD_TEST_ID);
|
|
48
53
|
expect(buttonEl.disabled).toBe(false);
|
|
49
54
|
});
|
|
50
55
|
});
|
|
51
56
|
describe("download functionality", () => {
|
|
52
57
|
test("should call the run function when the button is clicked", () => {
|
|
53
|
-
render(<AzulFileDownload url={URL} />);
|
|
58
|
+
render(<AzulFileDownload {...TRACKING_PARAMETERS} url={URL} />);
|
|
54
59
|
const buttonEl = getButtonById(AZUL_FILE_REQUEST_DOWNLOAD_TEST_ID);
|
|
55
60
|
fireEvent.click(buttonEl);
|
|
56
61
|
expect(MOCK_RUN).toHaveBeenCalled();
|
|
@@ -61,7 +66,7 @@ describe("AzulFileDownload", () => {
|
|
|
61
66
|
isLoading: false,
|
|
62
67
|
run: MOCK_RUN,
|
|
63
68
|
});
|
|
64
|
-
render(<AzulFileDownload url={URL} />);
|
|
69
|
+
render(<AzulFileDownload {...TRACKING_PARAMETERS} url={URL} />);
|
|
65
70
|
const buttonEl = getButtonById(AZUL_FILE_REQUEST_DOWNLOAD_TEST_ID);
|
|
66
71
|
fireEvent.click(buttonEl);
|
|
67
72
|
await waitFor(() => {
|
|
@@ -80,7 +85,7 @@ describe("AzulFileDownload", () => {
|
|
|
80
85
|
isLoading: false,
|
|
81
86
|
run: MOCK_RUN,
|
|
82
87
|
});
|
|
83
|
-
render(<AzulFileDownload url={URL} />);
|
|
88
|
+
render(<AzulFileDownload {...TRACKING_PARAMETERS} url={URL} />);
|
|
84
89
|
const buttonEl = getButtonById(AZUL_FILE_REQUEST_DOWNLOAD_TEST_ID);
|
|
85
90
|
const anchorEl = getAnchorEl(AZUL_FILE_DOWNLOAD_TEST_ID);
|
|
86
91
|
fireEvent.click(buttonEl);
|