@campxdev/react-blueprint 1.0.5 → 1.0.6
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/package.json +2 -1
- package/src/App.tsx +8 -1
- package/src/AppContent.tsx +38 -0
- package/src/assets/images/svg/Emptylistmage.svg +9 -0
- package/src/assets/images/svg/Internalserverimage.svg +9 -0
- package/src/assets/images/svg/error-cactus.svg +9 -0
- package/src/assets/images/svg/index.ts +10 -0
- package/src/assets/images/svg/no-connection.svg +9 -0
- package/src/assets/images/svg/unauthorized.svg +9 -0
- package/src/components/Assets/ErrorPages/InternalServerError.tsx +31 -0
- package/src/components/Assets/ErrorPages/NoInternetConnection.tsx +33 -0
- package/src/components/Assets/ErrorPages/NoItemFound.tsx +33 -0
- package/src/components/Assets/ErrorPages/PageNotFound.tsx +33 -0
- package/src/components/Assets/ErrorPages/UnAuthorized.tsx +25 -0
- package/src/components/Assets/ErrorPages/styles.tsx +29 -0
- package/src/components/Assets/export.ts +5 -0
- package/src/components/Input/components/FetchingOptionsLoader.tsx +7 -7
- package/src/components/export.ts +2 -2
- package/src/stories/DesignSystem/typography.stories.tsx +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { internalServerError } from "../../../assets/images/svg";
|
|
2
|
+
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
3
|
+
import { Button } from "../../export";
|
|
4
|
+
import { StyledBox } from "./styles";
|
|
5
|
+
|
|
6
|
+
export const InternalServerError = ({ resetBoundary }: any) => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<StyledBox>
|
|
10
|
+
<img
|
|
11
|
+
src={internalServerError}
|
|
12
|
+
alt="page not found"
|
|
13
|
+
width={"350px"}
|
|
14
|
+
style={{ margin: "20px" }}
|
|
15
|
+
/>
|
|
16
|
+
<Typography variant="subtitle1">Internal Server Error</Typography>
|
|
17
|
+
<Typography variant="body2">
|
|
18
|
+
An unexpected error occurred on our server.
|
|
19
|
+
</Typography>
|
|
20
|
+
<Typography variant="body2">Please try again later.</Typography>
|
|
21
|
+
<Button
|
|
22
|
+
sx={{ marginTop: "20px" }}
|
|
23
|
+
variant="contained"
|
|
24
|
+
onClick={() => resetBoundary()}
|
|
25
|
+
>
|
|
26
|
+
Try Again
|
|
27
|
+
</Button>
|
|
28
|
+
</StyledBox>
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { noConnection } from "../../../assets/images/svg";
|
|
2
|
+
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
3
|
+
import { Button } from "../../export";
|
|
4
|
+
import { StyledBox } from "./styles";
|
|
5
|
+
|
|
6
|
+
export const NoInterneConnection = ({ resetBoundary }: any) => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<StyledBox>
|
|
10
|
+
<img
|
|
11
|
+
src={noConnection}
|
|
12
|
+
alt="page not found"
|
|
13
|
+
width={"350px"}
|
|
14
|
+
style={{ margin: "20px" }}
|
|
15
|
+
/>
|
|
16
|
+
<Typography variant="subtitle1">No Internet Connection</Typography>
|
|
17
|
+
<Typography variant="body2">
|
|
18
|
+
It seems you're offline. Please check your
|
|
19
|
+
</Typography>
|
|
20
|
+
<Typography variant="body2">
|
|
21
|
+
internet connection and try again.
|
|
22
|
+
</Typography>
|
|
23
|
+
<Button
|
|
24
|
+
sx={{ marginTop: "20px" }}
|
|
25
|
+
variant="contained"
|
|
26
|
+
onClick={() => resetBoundary()}
|
|
27
|
+
>
|
|
28
|
+
Try Again
|
|
29
|
+
</Button>
|
|
30
|
+
</StyledBox>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { emptyListImage } from "../../../assets/images/svg";
|
|
2
|
+
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
3
|
+
import { Button } from "../../export";
|
|
4
|
+
import { StyledBox } from "./styles";
|
|
5
|
+
|
|
6
|
+
export const NoItemFound = ({ resetBoundary }: any) => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<StyledBox>
|
|
10
|
+
<img
|
|
11
|
+
src={emptyListImage}
|
|
12
|
+
alt="page not found"
|
|
13
|
+
width={"350px"}
|
|
14
|
+
style={{ margin: "20px" }}
|
|
15
|
+
/>
|
|
16
|
+
<Typography variant="subtitle1">No Items Found</Typography>
|
|
17
|
+
<Typography variant="body2">
|
|
18
|
+
There are no items to display. Please add new
|
|
19
|
+
</Typography>
|
|
20
|
+
<Typography variant="body2">
|
|
21
|
+
items or adjust your filter criteria.
|
|
22
|
+
</Typography>
|
|
23
|
+
<Button
|
|
24
|
+
sx={{ marginTop: "20px" }}
|
|
25
|
+
variant="contained"
|
|
26
|
+
onClick={() => resetBoundary()}
|
|
27
|
+
>
|
|
28
|
+
Try Again
|
|
29
|
+
</Button>
|
|
30
|
+
</StyledBox>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { errorCactus } from "../../../assets/images/svg";
|
|
2
|
+
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
3
|
+
import { Button } from "../../export";
|
|
4
|
+
import { StyledBox } from "./styles";
|
|
5
|
+
|
|
6
|
+
export const PageNotFound = ({ resetBoundary }: any) => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<StyledBox>
|
|
10
|
+
<img
|
|
11
|
+
src={errorCactus}
|
|
12
|
+
alt="page not found"
|
|
13
|
+
width={"350px"}
|
|
14
|
+
style={{ margin: "20px" }}
|
|
15
|
+
/>
|
|
16
|
+
<Typography variant="subtitle1">Page Not Found.</Typography>
|
|
17
|
+
<Typography variant="body2">
|
|
18
|
+
Oops! The page you are looking for doesn't exist.
|
|
19
|
+
</Typography>
|
|
20
|
+
<Typography variant="body2">
|
|
21
|
+
Please check the URL or return to the homepage.
|
|
22
|
+
</Typography>
|
|
23
|
+
<Button
|
|
24
|
+
sx={{ marginTop: "20px" }}
|
|
25
|
+
variant="contained"
|
|
26
|
+
onClick={() => resetBoundary()}
|
|
27
|
+
>
|
|
28
|
+
Try Again
|
|
29
|
+
</Button>
|
|
30
|
+
</StyledBox>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { unAuthorized } from "../../../assets/images/svg";
|
|
3
|
+
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
4
|
+
import { StyledBox } from "./styles";
|
|
5
|
+
|
|
6
|
+
export const UnAuthorized = ({ component }: { component?: ReactNode }) => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<StyledBox>
|
|
10
|
+
<img
|
|
11
|
+
src={unAuthorized}
|
|
12
|
+
alt="page not found"
|
|
13
|
+
width={"350px"}
|
|
14
|
+
style={{ margin: "20px" }}
|
|
15
|
+
/>
|
|
16
|
+
<Typography variant="subtitle1">Unauthorized Access</Typography>
|
|
17
|
+
<Typography variant="body2">
|
|
18
|
+
You must be logged in to view this page.
|
|
19
|
+
</Typography>
|
|
20
|
+
<Typography variant="body2">Please log in to continue.</Typography>
|
|
21
|
+
{component}
|
|
22
|
+
</StyledBox>
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Alert, Box, styled } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const StyledAlert = styled(Alert)(({ theme }) => ({
|
|
4
|
+
height: "60px",
|
|
5
|
+
border: `1px solid ${theme.palette.error.main}`,
|
|
6
|
+
display: "flex",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
"& .MuiAlert-message": {
|
|
9
|
+
padding: 0,
|
|
10
|
+
},
|
|
11
|
+
"& .MuiTypography-root": {
|
|
12
|
+
margin: 0,
|
|
13
|
+
},
|
|
14
|
+
position: "relative",
|
|
15
|
+
"& .retryBtn": {
|
|
16
|
+
color: "#661b2a",
|
|
17
|
+
position: "absolute",
|
|
18
|
+
right: 8,
|
|
19
|
+
top: 8,
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
export const StyledBox = styled(Box)(({ theme }) => ({
|
|
24
|
+
width: "100%",
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "column",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
}));
|
|
@@ -3,12 +3,12 @@ import { Spinner } from "../../Feedback/Spinner/Spinner";
|
|
|
3
3
|
import { FetchingOptionsLoaderContainer } from "../styles";
|
|
4
4
|
|
|
5
5
|
export const FetchingOptionsLoader = ({ loading }: { loading: boolean }) => {
|
|
6
|
-
return (
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
return loading ? (
|
|
7
|
+
<FetchingOptionsLoaderContainer direction="row" alignItems="center">
|
|
8
|
+
<Spinner />
|
|
9
|
+
<Typography variant="caption">Fetching Options</Typography>
|
|
10
|
+
</FetchingOptionsLoaderContainer>
|
|
11
|
+
) : (
|
|
12
|
+
<></>
|
|
13
13
|
);
|
|
14
14
|
};
|
package/src/components/export.ts
CHANGED
|
@@ -47,7 +47,7 @@ export const TypographyStyles = () => (
|
|
|
47
47
|
text="Subtitle 2 (subtitle2) - Lorem ipsum dolor sit."
|
|
48
48
|
/>
|
|
49
49
|
<TypographyDisplay
|
|
50
|
-
variant="
|
|
50
|
+
variant="subtitle3"
|
|
51
51
|
fontInfo={{ family: "Poppins", weight: "400", size: "14px" }}
|
|
52
52
|
text="Subtitle 3 (subtitle3) - Lorem ipsum dolor sit."
|
|
53
53
|
/>
|