@verifiedinc-public/shared-ui-elements 1.3.0 → 1.3.2

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.
@@ -1,2 +1,3 @@
1
1
  export * from './colors';
2
2
  export * from './theme';
3
+ export * from './shadows';
@@ -0,0 +1,3 @@
1
+ export declare const shadows: {
2
+ bottomSheet: string;
3
+ };
@@ -1,21 +1,34 @@
1
+ declare module '@mui/material/Button' {
2
+ interface ButtonPropsColorOverrides {
3
+ neutralContrast: true;
4
+ warningContrast: true;
5
+ infoContrast: true;
6
+ }
7
+ }
1
8
  declare module '@mui/material/styles' {
2
9
  interface Palette {
3
10
  neutral: Palette['primary'];
4
11
  neutralContrast: Palette['primary'];
12
+ warningContrast: Palette['primary'];
13
+ infoContrast: Palette['primary'];
5
14
  }
6
15
  interface PaletteOptions {
7
16
  neutral: PaletteOptions['primary'];
8
17
  neutralContrast: PaletteOptions['primary'];
18
+ warningContrast: PaletteOptions['primary'];
19
+ infoContrast: PaletteOptions['primary'];
9
20
  }
10
21
  }
11
22
  declare module '@mui/material' {
12
23
  interface ButtonPropsColorOverrides {
13
24
  neutral: true;
14
25
  neutralContrast: true;
26
+ warningContrast: true;
15
27
  }
16
28
  interface SvgIconPropsColorOverrides {
17
29
  neutral: true;
18
30
  neutralContrast: true;
31
+ warningContrast: true;
19
32
  }
20
33
  }
21
34
  interface ThemeOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verifiedinc-public/shared-ui-elements",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "A set of UI components, utilities that is shareable with the core apps.",
5
5
  "private": false,
6
6
  "keywords": [],
@@ -1,2 +1,3 @@
1
1
  export * from './colors';
2
2
  export * from './theme';
3
+ export * from './shadows';
@@ -0,0 +1,6 @@
1
+ const bottomSheet =
2
+ '0px -2px 4px -1px rgba(0,0,0,0.2), 0px -4px 5px 0px rgba(0,0,0,0.14), 0px -1px 10px 0px rgba(0,0,0,0.12)';
3
+
4
+ export const shadows = {
5
+ bottomSheet,
6
+ };
@@ -2,16 +2,28 @@ import { createTheme } from '@mui/material';
2
2
  import { colors } from './colors';
3
3
  import { typography } from './typography';
4
4
 
5
+ declare module '@mui/material/Button' {
6
+ interface ButtonPropsColorOverrides {
7
+ neutralContrast: true;
8
+ warningContrast: true;
9
+ infoContrast: true;
10
+ }
11
+ }
12
+
5
13
  declare module '@mui/material/styles' {
6
14
  // custom palette
7
15
  interface Palette {
8
16
  neutral: Palette['primary'];
9
17
  neutralContrast: Palette['primary'];
18
+ warningContrast: Palette['primary'];
19
+ infoContrast: Palette['primary'];
10
20
  }
11
21
 
12
22
  interface PaletteOptions {
13
23
  neutral: PaletteOptions['primary'];
14
24
  neutralContrast: PaletteOptions['primary'];
25
+ warningContrast: PaletteOptions['primary'];
26
+ infoContrast: PaletteOptions['primary'];
15
27
  }
16
28
  }
17
29
 
@@ -20,10 +32,12 @@ declare module '@mui/material' {
20
32
  interface ButtonPropsColorOverrides {
21
33
  neutral: true;
22
34
  neutralContrast: true;
35
+ warningContrast: true;
23
36
  }
24
37
  interface SvgIconPropsColorOverrides {
25
38
  neutral: true;
26
39
  neutralContrast: true;
40
+ warningContrast: true;
27
41
  }
28
42
  }
29
43
 
@@ -96,8 +110,40 @@ export const theme = ({ primaryFontFace }: ThemeOptions) =>
96
110
  light: colors.lightGreyContrast,
97
111
  dark: colors.darkGreyContrast,
98
112
  },
113
+ // We can register custom color to our palette with the augmentColor method.
114
+ warningContrast: {
115
+ main: colors.warningContrast,
116
+ },
117
+ infoContrast: {
118
+ main: colors.infoContrast,
119
+ },
99
120
  },
100
121
  components: {
122
+ MuiAlert: {
123
+ styleOverrides: {
124
+ action: {
125
+ // the action wrapper is pretty narrow (only fits about 5 characters of text) and the default is to wrap the text, which looks really bad
126
+ overflowWrap: 'normal',
127
+ // we want the action text, element, etc to be vertically centered if there are multiple lines of text in the alert body
128
+ display: 'flex',
129
+ alignItems: 'center',
130
+ padding: '8px 0',
131
+ marginRight: 0,
132
+ '& button, & a': {
133
+ lineHeight: '0',
134
+ },
135
+ },
136
+ },
137
+ },
138
+ MuiAlertTitle: {
139
+ styleOverrides: {
140
+ root: {
141
+ ...typography.body2,
142
+ fontSize: '1.1rem',
143
+ fontWeight: 700,
144
+ },
145
+ },
146
+ },
101
147
  MuiListItemIcon: {
102
148
  styleOverrides: {
103
149
  root: {
@@ -177,21 +223,6 @@ export const theme = ({ primaryFontFace }: ThemeOptions) =>
177
223
  },
178
224
  },
179
225
  },
180
- MuiAlert: {
181
- styleOverrides: {
182
- root: {
183
- maxWidth: '339px',
184
- },
185
- action: {
186
- padding: '8px 0',
187
- marginRight: 0,
188
- alignItems: 'center',
189
- '& button, & a': {
190
- lineHeight: '0',
191
- },
192
- },
193
- },
194
- },
195
226
  MuiRadio: {
196
227
  styleOverrides: {
197
228
  root: {