@evoke-platform/ui-components 1.0.0-dev.203 → 1.0.0-dev.204
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/dist/published/components/custom/ErrorComponent/ErrorComponent.d.ts +9 -0
- package/dist/published/components/custom/ErrorComponent/ErrorComponent.js +59 -0
- package/dist/published/components/custom/ErrorComponent/index.d.ts +3 -0
- package/dist/published/components/custom/ErrorComponent/index.js +3 -0
- package/dist/published/components/custom/index.d.ts +1 -0
- package/dist/published/components/custom/index.js +1 -0
- package/dist/published/index.d.ts +1 -1
- package/dist/published/index.js +1 -1
- package/package.json +1 -1
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { GridSize } from '@mui/material';
|
3
|
+
export declare type ErrorComponentProps = {
|
4
|
+
code?: 'AccessDenied' | 'NotFound' | 'Misconfigured';
|
5
|
+
message?: string;
|
6
|
+
colspan?: GridSize;
|
7
|
+
styles?: React.CSSProperties;
|
8
|
+
};
|
9
|
+
export default function ErrorComponent(props: ErrorComponentProps): JSX.Element;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Box, Typography, Grid } from '@mui/material';
|
3
|
+
import { LockRounded, ErrorRounded, WarningRounded, BuildRounded } from '@mui/icons-material';
|
4
|
+
export default function ErrorComponent(props) {
|
5
|
+
const { code, message, colspan, styles } = props;
|
6
|
+
const getTitle = () => {
|
7
|
+
switch (code) {
|
8
|
+
case 'AccessDenied':
|
9
|
+
return 'Access Denied';
|
10
|
+
case 'NotFound':
|
11
|
+
return 'Not Found';
|
12
|
+
case 'Misconfigured':
|
13
|
+
return 'Configuration Error';
|
14
|
+
default:
|
15
|
+
return 'Hmm. Something went wrong.';
|
16
|
+
}
|
17
|
+
};
|
18
|
+
const getSubtitle = () => {
|
19
|
+
if (message)
|
20
|
+
return message;
|
21
|
+
switch (code) {
|
22
|
+
case 'AccessDenied':
|
23
|
+
return 'You do not have permission to view this content.';
|
24
|
+
case 'NotFound':
|
25
|
+
return 'The requested content could not be found.';
|
26
|
+
case 'Misconfigured':
|
27
|
+
return `It looks like something is missing.`;
|
28
|
+
default:
|
29
|
+
return 'There was an error while loading.';
|
30
|
+
}
|
31
|
+
};
|
32
|
+
const getIcon = () => {
|
33
|
+
switch (code) {
|
34
|
+
case 'AccessDenied':
|
35
|
+
return React.createElement(LockRounded, { sx: { color: '#0075A7' } });
|
36
|
+
case 'NotFound':
|
37
|
+
return React.createElement(ErrorRounded, { sx: { color: '#A12723' } });
|
38
|
+
case 'Misconfigured':
|
39
|
+
return React.createElement(BuildRounded, { sx: { color: '#ef8228' } });
|
40
|
+
default:
|
41
|
+
return React.createElement(WarningRounded, { sx: { color: '#ef8228' } });
|
42
|
+
}
|
43
|
+
};
|
44
|
+
return (React.createElement(Grid, { item: true, xs: colspan !== null && colspan !== void 0 ? colspan : 12, sm: 12, sx: Object.assign({ background: 'white', display: 'flex', justifyContent: 'center', alignItems: 'center', flexDirection: 'column', boxShadow: '0px 8px 16px 0px rgba(145, 158, 171, 0.12)', borderRadius: '6px', height: 200 }, styles) },
|
45
|
+
React.createElement(Box, { sx: {
|
46
|
+
padding: '8px',
|
47
|
+
height: '36px',
|
48
|
+
width: '36px',
|
49
|
+
borderRadius: '8px',
|
50
|
+
backgroundColor: '#F9FAFB',
|
51
|
+
boxShadow: '0px 1px 2px 0px rgba(0, 0, 0, 0.12)',
|
52
|
+
display: 'flex',
|
53
|
+
justifyContent: 'center',
|
54
|
+
alignItems: 'center',
|
55
|
+
marginBottom: '16px',
|
56
|
+
} }, getIcon()),
|
57
|
+
React.createElement(Typography, { sx: { fontWeight: 700, fontSize: '18px' } }, getTitle()),
|
58
|
+
React.createElement(Typography, { sx: { marginTop: '4px' } }, getSubtitle())));
|
59
|
+
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export { BuilderGrid } from './BuilderGrid';
|
2
2
|
export { CriteriaBuilder } from './CriteriaBuilder';
|
3
3
|
export { DataGrid } from './DataGrid';
|
4
|
+
export { ErrorComponent } from './ErrorComponent';
|
4
5
|
export { FormField } from './FormField';
|
5
6
|
export { MenuBar } from './Menubar';
|
6
7
|
export { MultiSelect } from './MultiSelect';
|
@@ -1,6 +1,7 @@
|
|
1
1
|
export { BuilderGrid } from './BuilderGrid';
|
2
2
|
export { CriteriaBuilder } from './CriteriaBuilder';
|
3
3
|
export { DataGrid } from './DataGrid';
|
4
|
+
export { ErrorComponent } from './ErrorComponent';
|
4
5
|
export { FormField } from './FormField';
|
5
6
|
export { MenuBar } from './Menubar';
|
6
7
|
export { MultiSelect } from './MultiSelect';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
export { ClickAwayListener, Toolbar, createTheme, styled } from '@mui/material';
|
2
2
|
export { CalendarPicker, DateTimePicker, MonthPicker, PickersDay, StaticDateTimePicker, StaticTimePicker, TimePicker, YearPicker, } from '@mui/x-date-pickers';
|
3
3
|
export * from './components/core';
|
4
|
-
export { BuilderGrid, CriteriaBuilder, DataGrid, FormField, MenuBar, MultiSelect, RepeatableField, UserAvatar, } from './components/custom';
|
4
|
+
export { BuilderGrid, CriteriaBuilder, DataGrid, ErrorComponent, FormField, MenuBar, MultiSelect, RepeatableField, UserAvatar, } from './components/custom';
|
5
5
|
export { Box, Container, Grid, Stack } from './components/layout';
|
6
6
|
export * from './util';
|
7
7
|
export * as EVOKE_TYPES from './types';
|
package/dist/published/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
export { ClickAwayListener, Toolbar, createTheme, styled } from '@mui/material';
|
2
2
|
export { CalendarPicker, DateTimePicker, MonthPicker, PickersDay, StaticDateTimePicker, StaticTimePicker, TimePicker, YearPicker, } from '@mui/x-date-pickers';
|
3
3
|
export * from './components/core';
|
4
|
-
export { BuilderGrid, CriteriaBuilder, DataGrid, FormField, MenuBar, MultiSelect, RepeatableField, UserAvatar, } from './components/custom';
|
4
|
+
export { BuilderGrid, CriteriaBuilder, DataGrid, ErrorComponent, FormField, MenuBar, MultiSelect, RepeatableField, UserAvatar, } from './components/custom';
|
5
5
|
export { Box, Container, Grid, Stack } from './components/layout';
|
6
6
|
export * from './util';
|
7
7
|
export * as EVOKE_TYPES from './types';
|