@databiosphere/findable-ui 13.0.1 → 14.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 (127) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/lib/common/analytics/entities.d.ts +10 -7
  3. package/lib/common/analytics/entities.js +2 -3
  4. package/lib/components/Export/common/tracking.d.ts +12 -3
  5. package/lib/components/Export/common/tracking.js +23 -12
  6. package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.d.ts +1 -1
  7. package/lib/components/Export/components/DownloadCurlCommand/downloadCurlCommand.js +2 -16
  8. package/lib/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.js +6 -3
  9. package/lib/components/Export/components/ExportToTerra/exportToTerra.js +9 -1
  10. package/lib/components/Export/components/ManifestDownload/manifestDownload.js +7 -1
  11. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.d.ts +2 -2
  12. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.js +1 -1
  13. package/lib/components/Layout/components/Header/components/Content/components/Logo/logo.styles.js +0 -1
  14. package/lib/components/Links/components/Link/link.d.ts +2 -3
  15. package/lib/components/Links/components/Link/link.js +1 -2
  16. package/lib/components/common/Alert/alert.d.ts +4 -12
  17. package/lib/components/common/Alert/alert.js +5 -7
  18. package/lib/components/common/Alert/alert.styles.d.ts +1 -11
  19. package/lib/components/common/Alert/alert.styles.js +18 -24
  20. package/lib/components/common/Alert/constants.d.ts +2 -0
  21. package/lib/components/common/Alert/constants.js +27 -0
  22. package/lib/components/common/Alert/hooks/useTransition/types.d.ts +5 -0
  23. package/lib/components/common/Alert/hooks/useTransition/types.js +1 -0
  24. package/lib/components/common/Alert/hooks/useTransition/useTransition.d.ts +7 -0
  25. package/lib/components/common/Alert/hooks/useTransition/useTransition.js +20 -0
  26. package/lib/components/common/Banner/banner.d.ts +4 -7
  27. package/lib/components/common/Banner/banner.js +4 -3
  28. package/lib/components/common/Banner/banner.styles.d.ts +3 -0
  29. package/lib/components/common/Banner/banner.styles.js +28 -0
  30. package/lib/components/common/Banner/components/CookieBanner/constants.d.ts +2 -0
  31. package/lib/components/common/Banner/components/CookieBanner/constants.js +7 -0
  32. package/lib/components/common/Banner/components/CookieBanner/cookieBanner.d.ts +3 -3
  33. package/lib/components/common/Banner/components/CookieBanner/cookieBanner.js +17 -31
  34. package/lib/components/common/Banner/components/CookieBanner/cookieBanner.styles.d.ts +1 -1
  35. package/lib/components/common/Banner/components/CookieBanner/cookieBanner.styles.js +2 -16
  36. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.d.ts +3 -7
  37. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.js +6 -4
  38. package/lib/components/common/Banner/components/SystemIndexing/systemIndexing.d.ts +3 -8
  39. package/lib/components/common/Banner/components/SystemIndexing/systemIndexing.js +6 -8
  40. package/lib/components/common/Banner/components/SystemStatus/systemStatus.d.ts +3 -8
  41. package/lib/components/common/Banner/components/SystemStatus/systemStatus.js +6 -8
  42. package/lib/components/common/Banner/constants.d.ts +2 -0
  43. package/lib/components/common/Banner/constants.js +9 -0
  44. package/lib/components/common/Breadcrumbs/breadcrumbs.d.ts +2 -2
  45. package/lib/components/common/Breadcrumbs/breadcrumbs.js +3 -4
  46. package/lib/components/common/Paper/paper.styles.js +18 -12
  47. package/lib/components/types.d.ts +10 -0
  48. package/lib/components/types.js +1 -0
  49. package/lib/hooks/useLocalStorage/useLocalStorage.d.ts +1 -1
  50. package/lib/hooks/useLocalStorage/useLocalStorage.js +1 -1
  51. package/lib/styles/common/constants/size.d.ts +5 -0
  52. package/lib/styles/common/constants/size.js +6 -0
  53. package/lib/styles/common/mui/alert.d.ts +4 -0
  54. package/lib/styles/common/mui/alert.js +20 -0
  55. package/lib/styles/common/mui/icon.d.ts +2 -0
  56. package/lib/styles/common/mui/icon.js +6 -0
  57. package/lib/theme/common/components.d.ts +0 -12
  58. package/lib/theme/common/components.js +17 -157
  59. package/lib/theme/components/index.d.ts +2 -0
  60. package/lib/theme/components/index.js +2 -0
  61. package/lib/theme/components/muiAlert.d.ts +2 -0
  62. package/lib/theme/components/muiAlert.js +121 -0
  63. package/lib/theme/components/muiAlertTitle.d.ts +2 -0
  64. package/lib/theme/components/muiAlertTitle.js +12 -0
  65. package/lib/theme/theme.js +3 -2
  66. package/package.json +4 -4
  67. package/src/common/analytics/entities.ts +9 -6
  68. package/src/common/analytics/readme-analytics.md +9 -7
  69. package/src/components/Export/common/tracking.ts +26 -15
  70. package/src/components/Export/components/DownloadCurlCommand/downloadCurlCommand.tsx +2 -30
  71. package/src/components/Export/components/ExportToTerra/components/TerraSetUpForm/components/NIHAccountExpiryWarning/nihAccountExpiryWarning.tsx +16 -18
  72. package/src/components/Export/components/ExportToTerra/exportToTerra.tsx +11 -1
  73. package/src/components/Export/components/ManifestDownload/manifestDownload.tsx +9 -1
  74. package/src/components/Layout/components/Header/components/Content/components/Logo/logo.styles.ts +0 -1
  75. package/src/components/Layout/components/Header/components/Content/components/Logo/logo.tsx +3 -2
  76. package/src/components/Links/components/Link/link.tsx +17 -16
  77. package/src/components/common/Alert/alert.styles.ts +22 -25
  78. package/src/components/common/Alert/alert.tsx +14 -35
  79. package/src/components/common/Alert/constants.ts +29 -0
  80. package/src/components/common/Alert/hooks/useTransition/types.ts +5 -0
  81. package/src/components/common/Alert/hooks/useTransition/useTransition.ts +25 -0
  82. package/src/components/common/Banner/banner.styles.ts +29 -0
  83. package/src/components/common/Banner/banner.tsx +11 -18
  84. package/src/components/common/Banner/components/CookieBanner/constants.ts +9 -0
  85. package/src/components/common/Banner/components/CookieBanner/cookieBanner.styles.ts +2 -16
  86. package/src/components/common/Banner/components/CookieBanner/cookieBanner.tsx +36 -64
  87. package/src/components/common/Banner/components/SessionTimeout/sessionTimeout.tsx +12 -17
  88. package/src/components/common/Banner/components/SystemIndexing/systemIndexing.tsx +11 -22
  89. package/src/components/common/Banner/components/SystemStatus/systemStatus.tsx +11 -22
  90. package/src/components/common/Banner/constants.ts +11 -0
  91. package/src/components/common/Breadcrumbs/breadcrumbs.tsx +6 -10
  92. package/src/components/common/Paper/paper.styles.ts +18 -12
  93. package/src/components/types.ts +13 -0
  94. package/src/hooks/useLocalStorage/useLocalStorage.ts +2 -2
  95. package/src/styles/common/constants/size.ts +5 -0
  96. package/src/styles/common/mui/alert.ts +24 -0
  97. package/src/styles/common/mui/icon.ts +8 -0
  98. package/src/theme/common/components.ts +16 -159
  99. package/src/theme/components/index.ts +2 -0
  100. package/src/theme/components/muiAlert.ts +123 -0
  101. package/src/theme/components/muiAlertTitle.ts +14 -0
  102. package/src/theme/theme.ts +3 -2
  103. package/types/data-explorer-ui.d.ts +6 -5
  104. package/lib/components/Index/components/TitleCell/titleCell.d.ts +0 -6
  105. package/lib/components/Index/components/TitleCell/titleCell.js +0 -10
  106. package/lib/components/Index/components/TitleCell/titleCell.styles.d.ts +0 -3
  107. package/lib/components/Index/components/TitleCell/titleCell.styles.js +0 -6
  108. package/lib/components/common/Alert/alert.stories.d.ts +0 -6
  109. package/lib/components/common/Alert/alert.stories.js +0 -36
  110. package/lib/components/common/Alert/components/AlertText/alertText.styles.d.ts +0 -4
  111. package/lib/components/common/Alert/components/AlertText/alertText.styles.js +0 -19
  112. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.d.ts +0 -7
  113. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.js +0 -5
  114. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.d.ts +0 -3
  115. package/lib/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.js +0 -19
  116. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.d.ts +0 -10
  117. package/lib/components/common/Banner/components/DismissibleBanner/dismissibleBanner.js +0 -16
  118. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.d.ts +0 -3
  119. package/lib/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.js +0 -21
  120. package/src/components/Index/components/TitleCell/titleCell.styles.ts +0 -7
  121. package/src/components/Index/components/TitleCell/titleCell.tsx +0 -22
  122. package/src/components/common/Alert/alert.stories.tsx +0 -41
  123. package/src/components/common/Alert/components/AlertText/alertText.styles.ts +0 -20
  124. package/src/components/common/Banner/components/BannerPrimary/bannerPrimary.styles.ts +0 -20
  125. package/src/components/common/Banner/components/BannerPrimary/bannerPrimary.tsx +0 -27
  126. package/src/components/common/Banner/components/DismissibleBanner/dismissibleBanner.tsx +0 -44
  127. package/src/components/common/Banner/components/SessionTimeout/sessionTimeout.styles.ts +0 -22
@@ -1,8 +1,4 @@
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";
7
3
  import { desktopUp, mobileUp, tabletUp } from "./breakpoints";
8
4
  import {
@@ -19,7 +15,6 @@ import {
19
15
  TEXT_BODY_400,
20
16
  TEXT_BODY_400_2_LINES,
21
17
  TEXT_BODY_500,
22
- TEXT_BODY_LARGE_500,
23
18
  TEXT_BODY_SMALL_400,
24
19
  TEXT_BODY_SMALL_500,
25
20
  TEXT_HEADING,
@@ -85,159 +80,6 @@ export const MuiAccordionSummary: Components["MuiAccordionSummary"] = {
85
80
  },
86
81
  };
87
82
 
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
83
  /**
242
84
  * MuiAppBar Component
243
85
  */
@@ -1047,11 +889,14 @@ export const MuiInputBase = (theme: Theme): Components["MuiInputBase"] => {
1047
889
  */
1048
890
  export const MuiLink: Components["MuiLink"] = {
1049
891
  defaultProps: {
1050
- underline: "hover",
892
+ underline: "always",
1051
893
  },
1052
894
  styleOverrides: {
1053
895
  root: {
1054
896
  cursor: "pointer",
897
+ textDecorationColor: "currentColor",
898
+ textDecorationSkipInk: "none",
899
+ textUnderlinePosition: "from-font",
1055
900
  },
1056
901
  },
1057
902
  };
@@ -1211,6 +1056,18 @@ export const MuiOutlinedInput = (
1211
1056
  export const MuiPaper = (theme: Theme): Components["MuiPaper"] => {
1212
1057
  return {
1213
1058
  variants: [
1059
+ {
1060
+ props: { elevation: 1 },
1061
+ style: {
1062
+ boxShadow: theme.shadows[1], // elevation01
1063
+ },
1064
+ },
1065
+ {
1066
+ props: { elevation: 2 },
1067
+ style: {
1068
+ boxShadow: theme.shadows[2], // elevation02
1069
+ },
1070
+ },
1214
1071
  {
1215
1072
  props: { variant: "footer" },
1216
1073
  style: {
@@ -0,0 +1,2 @@
1
+ export { MuiAlert } from "./muiAlert";
2
+ export { MuiAlertTitle } from "./muiAlertTitle";
@@ -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
+ };
@@ -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: C.MuiAlert(theme),
75
- MuiAlertTitle: C.MuiAlertTitle(theme),
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),
@@ -25,19 +25,20 @@ import {
25
25
  CustomFeatureTableState,
26
26
  } from "../src/components/Table/features/entities";
27
27
  import { GridTrackSize } from "../src/config/entities";
28
+ import { SIZE } from "../src/styles/common/constants/size";
28
29
 
29
30
  /**
30
31
  * Alert prop options.
31
32
  */
32
33
  declare module "@mui/material/Alert" {
34
+ interface AlertProps {
35
+ size?: SIZE.MEDIUM | SIZE.LARGE;
36
+ }
37
+
33
38
  interface AlertPropsColorOverrides {
34
39
  ink: true;
35
40
  primary: true;
36
- }
37
-
38
- interface AlertPropsVariantOverrides {
39
- banner: true; // Single line alert.
40
- neutral: true;
41
+ smoke: true;
41
42
  }
42
43
  }
43
44
 
@@ -1,6 +0,0 @@
1
- import { ReactNode } from "react";
2
- import { LinkProps } from "../../../Links/components/Link/link";
3
- export interface TitleCellProps extends LinkProps {
4
- title: ReactNode;
5
- }
6
- export declare const TitleCell: ({ title, ...props }: TitleCellProps) => JSX.Element;
@@ -1,10 +0,0 @@
1
- import { Typography } from "@mui/material";
2
- import React from "react";
3
- import { TEXT_BODY_400 } from "../../../../theme/common/typography";
4
- import { Link } from "../../../Links/components/Link/link";
5
- import { TitleCell as Cell } from "./titleCell.styles";
6
- export const TitleCell = ({ title, ...props }) => {
7
- return (React.createElement(Cell, { gridSx: { gap: 1 } },
8
- typeof title === "string" ? (React.createElement(Typography, { variant: TEXT_BODY_400 }, title)) : (title),
9
- React.createElement(Link, { ...props })));
10
- };
@@ -1,3 +0,0 @@
1
- export declare const TitleCell: import("@emotion/styled").StyledComponent<import("../../../common/Grid/grid").GridProps & {
2
- theme?: import("@emotion/react").Theme;
3
- }, {}, {}>;
@@ -1,6 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import { textBodySmall400 } from "../../../../styles/common/mixins/fonts";
3
- import { Grid } from "../../../common/Grid/grid";
4
- export const TitleCell = styled(Grid) `
5
- ${textBodySmall400};
6
- `;
@@ -1,6 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { Alert } from "./alert";
3
- declare const _default: Meta<typeof Alert>;
4
- export default _default;
5
- type Story = StoryObj<typeof Alert>;
6
- export declare const AlertStory: Story;
@@ -1,36 +0,0 @@
1
- import { Alert } from "./alert";
2
- export default {
3
- argTypes: {
4
- children: {
5
- control: "text",
6
- description: "Inner text",
7
- },
8
- color: {
9
- description: "Color of alert",
10
- },
11
- icon: {
12
- control: "text",
13
- description: "Top left icon. If provided will replace severity.",
14
- },
15
- severity: {
16
- description: "Top left predefined icon. Combine with color.",
17
- },
18
- title: {
19
- control: "text",
20
- description: "Highlighted text",
21
- },
22
- variant: {
23
- description: "Type of the alert",
24
- },
25
- },
26
- component: Alert,
27
- title: "Components/Common/Alert",
28
- };
29
- export const AlertStory = {
30
- args: {
31
- children: "Something certainly happened",
32
- color: "warning",
33
- severity: "warning",
34
- title: "Ouch!",
35
- },
36
- };
@@ -1,4 +0,0 @@
1
- export declare const AlertText: import("@emotion/styled").StyledComponent<{
2
- theme?: import("@emotion/react").Theme;
3
- as?: React.ElementType;
4
- }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,19 +0,0 @@
1
- import styled from "@emotion/styled";
2
- export const AlertText = styled.div `
3
- ul {
4
- padding-left: 24px;
5
- margin: 8px 0;
6
-
7
- li {
8
- margin: 4px 0;
9
-
10
- &:last-child {
11
- margin-bottom: 0;
12
- }
13
- }
14
- }
15
-
16
- *:last-child {
17
- margin-bottom: 0;
18
- }
19
- `;
@@ -1,7 +0,0 @@
1
- import { AlertProps as MAlertProps } from "@mui/material";
2
- import { ReactNode } from "react";
3
- export interface BannerPrimaryProps extends MAlertProps {
4
- children: ReactNode;
5
- className?: string;
6
- }
7
- export declare const BannerPrimary: ({ children, className, ...props }: BannerPrimaryProps) => JSX.Element;
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import { Alert } from "./bannerPrimary.styles";
3
- export const BannerPrimary = ({ children, className, ...props /* Spread props to allow for Mui AlertProps specific prop overrides. */ }) => {
4
- return (React.createElement(Alert, { className: className, color: "primary", elevation: 0, icon: false, variant: "standard", ...props }, children));
5
- };
@@ -1,3 +0,0 @@
1
- export declare const Alert: import("@emotion/styled").StyledComponent<import("@mui/material").AlertProps & {
2
- theme?: import("@emotion/react").Theme;
3
- }, {}, {}>;
@@ -1,19 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import { Alert as MAlert } from "@mui/material";
3
- import { primaryMain, white } from "../../../../../styles/common/mixins/colors";
4
- import { textBodySmall400 } from "../../../../../styles/common/mixins/fonts";
5
- export const Alert = styled(MAlert) `
6
- border-radius: 0;
7
- justify-content: center;
8
- padding: 8px;
9
-
10
- &.MuiAlert-standardPrimary {
11
- background-color: ${primaryMain};
12
- color: ${white};
13
- }
14
-
15
- .MuiAlert-message {
16
- ${textBodySmall400};
17
- text-align: center;
18
- }
19
- `;
@@ -1,10 +0,0 @@
1
- import { AlertProps as MAlertProps } from "@mui/material";
2
- import { ElementType, ReactNode } from "react";
3
- export interface CookieBannerProps extends MAlertProps {
4
- Alert?: ElementType;
5
- children: ReactNode;
6
- className?: string;
7
- onDismiss?: () => void;
8
- open: boolean;
9
- }
10
- export declare const DismissibleBanner: ({ Alert, className, children, onDismiss, open, ...props }: CookieBannerProps) => JSX.Element;
@@ -1,16 +0,0 @@
1
- import { Fade, Alert as MAlert, } from "@mui/material";
2
- import React, { useEffect, useState } from "react";
3
- export const DismissibleBanner = ({ Alert = MAlert /* Requires forwardRef to be used as a child of Fade. */, className, children, onDismiss, open, ...props /* Spread props to allow for Mui AlertProps specific prop overrides. */ }) => {
4
- const [isIn, setIsIn] = useState(false);
5
- // Callback fired when the component requests to be closed.
6
- const onClose = () => {
7
- onDismiss?.();
8
- setIsIn(false);
9
- };
10
- // Sets the open state.
11
- useEffect(() => {
12
- setIsIn(open);
13
- }, [open]);
14
- return (React.createElement(Fade, { in: isIn, unmountOnExit: true },
15
- React.createElement(Alert, { className: className, onClose: onClose, ...props }, children)));
16
- };
@@ -1,3 +0,0 @@
1
- export declare const Banner: import("@emotion/styled").StyledComponent<import("../BannerPrimary/bannerPrimary").BannerPrimaryProps & {
2
- theme?: import("@emotion/react").Theme;
3
- }, {}, {}>;
@@ -1,21 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import { mediaDesktopUp } from "../../../../../styles/common/mixins/breakpoints";
3
- import { BannerPrimary } from "../BannerPrimary/bannerPrimary";
4
- export const Banner = styled(BannerPrimary) `
5
- gap: 12px;
6
- padding: 8px 12px;
7
-
8
- ${mediaDesktopUp} {
9
- padding: 8px 16px;
10
- }
11
-
12
- .MuiAlert-message {
13
- align-self: center;
14
- flex: 1;
15
- }
16
-
17
- .MuiAlert-action {
18
- margin: -8px;
19
- padding: 0;
20
- }
21
- `;
@@ -1,7 +0,0 @@
1
- import styled from "@emotion/styled";
2
- import { textBodySmall400 } from "../../../../styles/common/mixins/fonts";
3
- import { Grid } from "../../../common/Grid/grid";
4
-
5
- export const TitleCell = styled(Grid)`
6
- ${textBodySmall400};
7
- `;
@@ -1,22 +0,0 @@
1
- import { Typography } from "@mui/material";
2
- import React, { ReactNode } from "react";
3
- import { TEXT_BODY_400 } from "../../../../theme/common/typography";
4
- import { Link, LinkProps } from "../../../Links/components/Link/link";
5
- import { TitleCell as Cell } from "./titleCell.styles";
6
-
7
- export interface TitleCellProps extends LinkProps {
8
- title: ReactNode;
9
- }
10
-
11
- export const TitleCell = ({ title, ...props }: TitleCellProps): JSX.Element => {
12
- return (
13
- <Cell gridSx={{ gap: 1 }}>
14
- {typeof title === "string" ? (
15
- <Typography variant={TEXT_BODY_400}>{title}</Typography>
16
- ) : (
17
- title
18
- )}
19
- <Link {...props} />
20
- </Cell>
21
- );
22
- };
@@ -1,41 +0,0 @@
1
- import { Meta, StoryObj } from "@storybook/react";
2
- import { Alert } from "./alert";
3
-
4
- export default {
5
- argTypes: {
6
- children: {
7
- control: "text",
8
- description: "Inner text",
9
- },
10
- color: {
11
- description: "Color of alert",
12
- },
13
- icon: {
14
- control: "text",
15
- description: "Top left icon. If provided will replace severity.",
16
- },
17
- severity: {
18
- description: "Top left predefined icon. Combine with color.",
19
- },
20
- title: {
21
- control: "text",
22
- description: "Highlighted text",
23
- },
24
- variant: {
25
- description: "Type of the alert",
26
- },
27
- },
28
- component: Alert,
29
- title: "Components/Common/Alert",
30
- } as Meta<typeof Alert>;
31
-
32
- type Story = StoryObj<typeof Alert>;
33
-
34
- export const AlertStory: Story = {
35
- args: {
36
- children: "Something certainly happened",
37
- color: "warning",
38
- severity: "warning",
39
- title: "Ouch!",
40
- },
41
- };