@campxdev/react-blueprint 1.0.15 → 1.0.17
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 +15 -15
- package/src/components/Assets/Icons/IconComponents/AlertFilledIcon.tsx +14 -7
- package/src/components/Assets/Icons/IconComponents/InfoFilledIcon.tsx +14 -7
- package/src/components/Assets/Icons/IconComponents/SuccessFilledIcon.tsx +17 -9
- package/src/components/Assets/Icons/IconComponents/WarningFilledIcon.tsx +14 -7
- package/src/components/Assets/Icons/Icons.tsx +2 -2
- package/src/components/Feedback/Alert/Alert.tsx +28 -0
- package/src/components/Feedback/Snackbar/Snackbar.tsx +14 -13
- package/src/components/Feedback/exports.ts +1 -0
- package/src/components/Input/TextField/TextField.tsx +4 -0
- package/src/components/Navigation/exports.ts +8 -21
- package/src/stories/Feedback/Alert.stories.tsx +25 -0
- package/src/stories/Feedback/Snackbar.stories.tsx +2 -3
- package/src/stories/Feedback/Spinner.stories.tsx +1 -1
- package/src/stories/Feedback/Tooltip.stories.tsx +4 -5
- package/src/stories/Feedback/Tutorial.stories.tsx +1 -3
- package/src/themes/commonTheme.ts +24 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/react-blueprint",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"main": "./export.ts",
|
|
5
5
|
"private": false,
|
|
6
6
|
"dependencies": {
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"@mui/icons-material": "^5.15.20",
|
|
11
11
|
"@mui/material": "^5.15.20",
|
|
12
12
|
"@mui/x-data-grid": "^7.5.1",
|
|
13
|
-
"@storybook/addon-backgrounds": "^8.
|
|
14
|
-
"@storybook/addon-designs": "^8.0.
|
|
13
|
+
"@storybook/addon-backgrounds": "^8.2.6",
|
|
14
|
+
"@storybook/addon-designs": "^8.0.3",
|
|
15
15
|
"@testing-library/jest-dom": "^5.14.1",
|
|
16
16
|
"@testing-library/react": "^13.0.0",
|
|
17
17
|
"@testing-library/user-event": "^13.2.1",
|
|
@@ -68,21 +68,21 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
71
|
-
"@chromatic-com/storybook": "^1.
|
|
72
|
-
"@storybook/addon-essentials": "^8.
|
|
73
|
-
"@storybook/addon-interactions": "^8.
|
|
74
|
-
"@storybook/addon-links": "^8.
|
|
75
|
-
"@storybook/addon-mdx-gfm": "^8.
|
|
76
|
-
"@storybook/addon-onboarding": "^8.
|
|
77
|
-
"@storybook/blocks": "^8.
|
|
78
|
-
"@storybook/preset-create-react-app": "^8.
|
|
79
|
-
"@storybook/react": "^8.
|
|
80
|
-
"@storybook/react-webpack5": "^8.
|
|
81
|
-
"@storybook/test": "^8.
|
|
71
|
+
"@chromatic-com/storybook": "^1.6.1",
|
|
72
|
+
"@storybook/addon-essentials": "^8.2.6",
|
|
73
|
+
"@storybook/addon-interactions": "^8.2.6",
|
|
74
|
+
"@storybook/addon-links": "^8.2.6",
|
|
75
|
+
"@storybook/addon-mdx-gfm": "^8.2.6",
|
|
76
|
+
"@storybook/addon-onboarding": "^8.2.6",
|
|
77
|
+
"@storybook/blocks": "^8.2.6",
|
|
78
|
+
"@storybook/preset-create-react-app": "^8.2.6",
|
|
79
|
+
"@storybook/react": "^8.2.6",
|
|
80
|
+
"@storybook/react-webpack5": "^8.2.6",
|
|
81
|
+
"@storybook/test": "^8.2.6",
|
|
82
82
|
"@types/js-cookie": "^3.0.5",
|
|
83
83
|
"eslint-plugin-storybook": "^0.8.0",
|
|
84
84
|
"prop-types": "^15.8.1",
|
|
85
|
-
"storybook": "^8.
|
|
85
|
+
"storybook": "^8.2.6",
|
|
86
86
|
"webpack": "^5.91.0"
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { useTheme } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const ErrorFilledIcon = ({
|
|
4
|
+
size = 16,
|
|
5
|
+
backgroundColor,
|
|
6
|
+
}: {
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
}) => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const color = theme.palette.tertiary.main;
|
|
2
12
|
return (
|
|
3
13
|
<svg
|
|
4
|
-
width=
|
|
5
|
-
height=
|
|
14
|
+
width={size}
|
|
15
|
+
height={size}
|
|
6
16
|
viewBox="0 0 20 21"
|
|
7
17
|
fill="none"
|
|
8
18
|
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
style={{
|
|
10
|
-
marginTop: "4px",
|
|
11
|
-
}}
|
|
12
19
|
>
|
|
13
20
|
<path
|
|
14
21
|
fill-rule="evenodd"
|
|
15
22
|
clip-rule="evenodd"
|
|
16
23
|
d="M18.6663 10.5202C18.6663 15.3067 14.7861 19.1868 9.99967 19.1868C5.21321 19.1868 1.33301 15.3067 1.33301 10.5202C1.33301 5.73371 5.21321 1.85352 9.99967 1.85352C14.7861 1.85352 18.6663 5.73371 18.6663 10.5202ZM13.8747 15.3643C14.1319 15.3643 14.3789 15.2633 14.5624 15.083C14.7428 14.8996 14.8439 14.6526 14.8439 14.3954C14.8439 14.1381 14.7428 13.8911 14.5624 13.7077L11.375 10.5204L14.5624 7.33303C14.6527 7.24272 14.7243 7.13551 14.7732 7.01752C14.822 6.89953 14.8472 6.77307 14.8472 6.64536C14.8472 6.51765 14.822 6.39119 14.7732 6.2732C14.7243 6.15521 14.6527 6.048 14.5624 5.95769C14.4721 5.86739 14.3648 5.79575 14.2469 5.74688C14.1289 5.69801 14.0024 5.67285 13.8747 5.67285C13.747 5.67285 13.6205 5.69801 13.5025 5.74688C13.3845 5.79575 13.2773 5.86739 13.187 5.95769L9.99969 9.14503L6.81236 5.95769C6.62998 5.77531 6.38261 5.67285 6.12469 5.67285C5.86676 5.67285 5.6194 5.77531 5.43702 5.95769C5.25464 6.14007 5.15218 6.38743 5.15218 6.64536C5.15218 6.90329 5.25464 7.15065 5.43702 7.33303L8.62436 10.5204L5.43702 13.7077C5.34672 13.798 5.27508 13.9052 5.22621 14.0232C5.17734 14.1412 5.15218 14.2677 5.15218 14.3954C5.15218 14.5231 5.17734 14.6495 5.22621 14.7675C5.27508 14.8855 5.34672 14.9927 5.43702 15.083C5.52733 15.1733 5.63454 15.245 5.75253 15.2938C5.87052 15.3427 5.99698 15.3679 6.12469 15.3679C6.2524 15.3679 6.37886 15.3427 6.49685 15.2938C6.61484 15.245 6.72205 15.1733 6.81236 15.083L9.99969 11.8957L13.187 15.083C13.3705 15.2633 13.6175 15.3643 13.8747 15.3643Z"
|
|
17
|
-
fill=
|
|
24
|
+
fill={backgroundColor ?? color}
|
|
18
25
|
/>
|
|
19
26
|
</svg>
|
|
20
27
|
);
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { useTheme } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const InfoFilledIcon = ({
|
|
4
|
+
backgroundColor,
|
|
5
|
+
size = 16,
|
|
6
|
+
}: {
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
}) => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const color = theme.palette.highlight.highlightBlue;
|
|
2
12
|
return (
|
|
3
13
|
<svg
|
|
4
|
-
width=
|
|
5
|
-
height=
|
|
14
|
+
width={size}
|
|
15
|
+
height={size}
|
|
6
16
|
viewBox="0 0 20 21"
|
|
7
17
|
fill="none"
|
|
8
18
|
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
style={{
|
|
10
|
-
marginTop: "4px",
|
|
11
|
-
}}
|
|
12
19
|
>
|
|
13
20
|
<mask
|
|
14
21
|
id="mask0_194_1775"
|
|
@@ -23,7 +30,7 @@ export const InfoFilledIcon = () => {
|
|
|
23
30
|
<g mask="url(#mask0_194_1775)">
|
|
24
31
|
<path
|
|
25
32
|
d="M10.1517 1.83301C8.40751 1.83301 6.70251 2.35021 5.25229 3.31922C3.80207 4.28823 2.67176 5.66552 2.00429 7.27692C1.33683 8.88832 1.16219 10.6615 1.50246 12.3721C1.84273 14.0828 2.68263 15.6541 3.91594 16.8874C5.14925 18.1207 6.72059 18.9606 8.43124 19.3009C10.1419 19.6412 11.915 19.4665 13.5264 18.7991C15.1378 18.1316 16.5151 17.0013 17.4841 15.5511C18.4531 14.1008 18.9703 12.3958 18.9703 10.6517C18.9703 8.31282 18.0412 6.06976 16.3874 4.41594C14.7336 2.76211 12.4905 1.83301 10.1517 1.83301ZM10.1517 6.24234C10.3698 6.24234 10.583 6.30701 10.7643 6.42817C10.9456 6.54934 11.087 6.72155 11.1704 6.92304C11.2539 7.12452 11.2757 7.34623 11.2332 7.56013C11.1906 7.77402 11.0856 7.9705 10.9314 8.12471C10.7772 8.27892 10.5807 8.38394 10.3668 8.42649C10.1529 8.46903 9.93119 8.4472 9.72971 8.36374C9.52822 8.28028 9.35601 8.13895 9.23484 7.95762C9.11368 7.77628 9.04901 7.56309 9.04901 7.34501C9.04901 7.05256 9.16518 6.7721 9.37197 6.5653C9.57876 6.35851 9.85923 6.24234 10.1517 6.24234ZM11.805 15.061H8.49835C8.35212 15.061 8.21189 15.0029 8.10849 14.8995C8.0051 14.7961 7.94701 14.6559 7.94701 14.5097C7.94701 14.3635 8.0051 14.2232 8.10849 14.1198C8.21189 14.0164 8.35212 13.9583 8.49835 13.9583H9.04968V10.6517H8.49835C8.35212 10.6517 8.21189 10.5936 8.10849 10.4902C8.0051 10.3868 7.94701 10.2466 7.94701 10.1003C7.94701 9.95412 8.0051 9.81389 8.10849 9.71049C8.21189 9.6071 8.35212 9.54901 8.49835 9.54901H10.703C10.8492 9.54901 10.9895 9.6071 11.0929 9.71049C11.1963 9.81389 11.2543 9.95412 11.2543 10.1003V13.9583H11.8057C11.9519 13.9583 12.0921 14.0164 12.1955 14.1198C12.2989 14.2232 12.357 14.3635 12.357 14.5097C12.357 14.6559 12.2989 14.7961 12.1955 14.8995C12.0921 15.0029 11.9512 15.061 11.805 15.061Z"
|
|
26
|
-
fill=
|
|
33
|
+
fill={backgroundColor ?? color}
|
|
27
34
|
/>
|
|
28
35
|
</g>
|
|
29
36
|
</svg>
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
import { useTheme } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const SuccessFilledIcon = ({
|
|
4
|
+
backgroundColor,
|
|
5
|
+
size = 16,
|
|
6
|
+
}: {
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
}) => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const color = theme.palette.highlight.highlightGreen;
|
|
12
|
+
|
|
2
13
|
return (
|
|
3
14
|
<svg
|
|
4
|
-
width=
|
|
5
|
-
height=
|
|
15
|
+
width={size}
|
|
16
|
+
height={size}
|
|
6
17
|
viewBox="0 0 20 21"
|
|
7
18
|
fill="none"
|
|
8
19
|
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
style={{
|
|
10
|
-
marginTop: "4px",
|
|
11
|
-
}}
|
|
12
20
|
>
|
|
13
21
|
<path
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
fillRule="evenodd"
|
|
23
|
+
clipRule="evenodd"
|
|
16
24
|
d="M10.0039 1.69824C11.7457 1.69824 13.4484 2.21474 14.8967 3.18243C16.3449 4.15012 17.4737 5.52554 18.1402 7.13474C18.8068 8.74395 18.9812 10.5147 18.6414 12.223C18.3016 13.9313 17.4628 15.5005 16.2312 16.7322C14.9996 17.9638 13.4304 18.8025 11.722 19.1424C10.0137 19.4822 8.24297 19.3078 6.63377 18.6412C5.02456 17.9747 3.64915 16.8459 2.68146 15.3976C1.71377 13.9494 1.19727 12.2467 1.19727 10.5049C1.19762 8.16934 2.12558 5.92954 3.77707 4.27805C5.42856 2.62655 7.66837 1.6986 10.0039 1.69824ZM8.17527 13.3649L6.0186 11.2076C5.85141 11.0288 5.76022 10.7921 5.7643 10.5474C5.76838 10.3027 5.8674 10.0692 6.04046 9.89611C6.21352 9.72305 6.44707 9.62402 6.69178 9.61994C6.93648 9.61586 7.1732 9.70705 7.35193 9.87424L8.87193 11.3956L12.6526 7.61291C12.8313 7.44571 13.068 7.35453 13.3128 7.35861C13.5575 7.36269 13.791 7.46172 13.9641 7.63477C14.1371 7.80783 14.2362 8.04138 14.2402 8.28609C14.2443 8.53079 14.1531 8.76751 13.9859 8.94624L9.53927 13.3969C9.36204 13.5729 9.12239 13.6717 8.8726 13.6717C8.62281 13.6717 8.38315 13.5729 8.20593 13.3969L8.17593 13.3656L8.17527 13.3649Z"
|
|
17
|
-
fill=
|
|
25
|
+
fill={backgroundColor ?? color}
|
|
18
26
|
/>
|
|
19
27
|
</svg>
|
|
20
28
|
);
|
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import { useTheme } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const WarningFilledIcon = ({
|
|
4
|
+
size = 16,
|
|
5
|
+
backgroundColor,
|
|
6
|
+
}: {
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
size?: number;
|
|
9
|
+
}) => {
|
|
10
|
+
const theme = useTheme();
|
|
11
|
+
const color = theme.palette.highlight.highlightOrange;
|
|
2
12
|
return (
|
|
3
13
|
<svg
|
|
4
|
-
width=
|
|
5
|
-
height=
|
|
14
|
+
width={size}
|
|
15
|
+
height={size}
|
|
6
16
|
viewBox="0 0 20 21"
|
|
7
17
|
fill="none"
|
|
8
18
|
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
style={{
|
|
10
|
-
marginTop: "4px",
|
|
11
|
-
}}
|
|
12
19
|
>
|
|
13
20
|
<mask
|
|
14
21
|
id="mask0_194_1734"
|
|
@@ -25,7 +32,7 @@ export const WarningFilledIcon = () => {
|
|
|
25
32
|
fill-rule="evenodd"
|
|
26
33
|
clip-rule="evenodd"
|
|
27
34
|
d="M8.67604 2.57149L0.492704 16.7448C0.344646 17.0009 0.266662 17.2914 0.266602 17.5871C0.266542 17.8829 0.344408 18.1735 0.492362 18.4296C0.640315 18.6857 0.853133 18.8983 1.10938 19.0459C1.36564 19.1936 1.65628 19.2712 1.95204 19.2708H18.3167C18.6123 19.2709 18.9026 19.1931 19.1586 19.0454C19.4146 18.8976 19.6271 18.6851 19.7749 18.4292C19.9227 18.1732 20.0005 17.8828 20.0004 17.5873C20.0004 17.2917 19.9225 17.0014 19.7747 16.7455L11.592 2.57149C11.4443 2.3155 11.2318 2.10292 10.9759 1.95511C10.7199 1.80731 10.4296 1.72949 10.134 1.72949C9.83849 1.72949 9.54814 1.80731 9.29221 1.95511C9.03627 2.10292 8.82376 2.3155 8.67604 2.57149ZM11.1914 7.10489C11.1914 6.52021 10.7175 6.04622 10.133 6.04622C9.54854 6.04622 9.07471 6.52021 9.07471 7.10489V11.4396C9.07471 12.0242 9.54854 12.4982 10.133 12.4982C10.7175 12.4982 11.1914 12.0242 11.1914 11.4396V7.10489ZM11.192 15.0476C11.192 15.6323 10.7181 16.1063 10.1334 16.1063C9.54869 16.1063 9.07471 15.6323 9.07471 15.0476C9.07471 14.4629 9.54869 13.9889 10.1334 13.9889C10.7181 13.9889 11.192 14.4629 11.192 15.0476Z"
|
|
28
|
-
fill=
|
|
35
|
+
fill={backgroundColor ?? color}
|
|
29
36
|
/>
|
|
30
37
|
</g>
|
|
31
38
|
</svg>
|
|
@@ -30,7 +30,7 @@ import { NotificationIcon } from "./IconComponents/NotificationIcon";
|
|
|
30
30
|
import { PayxIcon } from "./IconComponents/PayxIcon";
|
|
31
31
|
|
|
32
32
|
import { AdminIcon } from "./IconComponents/AdminIcon";
|
|
33
|
-
import {
|
|
33
|
+
import { ErrorFilledIcon } from "./IconComponents/AlertFilledIcon";
|
|
34
34
|
import { CampxFullLogoIcon } from "./IconComponents/CampxFullLogoIcon";
|
|
35
35
|
import { CrossIcon2 } from "./IconComponents/CrossIcon2";
|
|
36
36
|
import { InfoFilledIcon } from "./IconComponents/InfoFilledIcon";
|
|
@@ -61,7 +61,7 @@ export const Icons = {
|
|
|
61
61
|
SuccessFilledIcon,
|
|
62
62
|
InfoFilledIcon,
|
|
63
63
|
WarningFilledIcon,
|
|
64
|
-
AlertFilledIcon,
|
|
64
|
+
AlertFilledIcon: ErrorFilledIcon,
|
|
65
65
|
CrossIcon2,
|
|
66
66
|
LogoutIcon,
|
|
67
67
|
TicketsIcon,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Alert as MuiAlert, AlertProps as MuiAlertProps } from "@mui/material";
|
|
2
|
+
import { Icons } from "../../export";
|
|
3
|
+
|
|
4
|
+
export type AlertProps = {
|
|
5
|
+
message: string;
|
|
6
|
+
severity: MuiAlertProps["severity"];
|
|
7
|
+
} & MuiAlertProps;
|
|
8
|
+
|
|
9
|
+
const getIcon = (severity: MuiAlertProps["severity"]) => {
|
|
10
|
+
switch (severity) {
|
|
11
|
+
case "success":
|
|
12
|
+
return <Icons.SuccessFilledIcon size={20} />;
|
|
13
|
+
case "error":
|
|
14
|
+
return <Icons.AlertFilledIcon size={20} />;
|
|
15
|
+
case "info":
|
|
16
|
+
return <Icons.InfoFilledIcon size={20} />;
|
|
17
|
+
case "warning":
|
|
18
|
+
return <Icons.WarningFilledIcon size={20} />;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Alert = ({ severity, message }: AlertProps) => {
|
|
23
|
+
return (
|
|
24
|
+
<MuiAlert severity={severity} icon={getIcon(severity)}>
|
|
25
|
+
{message}
|
|
26
|
+
</MuiAlert>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -9,20 +9,20 @@ import {
|
|
|
9
9
|
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
10
10
|
import { Icons } from "../../export";
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type Severity = "success" | "info" | "warning" | "error";
|
|
13
13
|
|
|
14
14
|
export type SnackbarProps = {
|
|
15
|
-
|
|
15
|
+
severity: Severity;
|
|
16
16
|
message: string;
|
|
17
17
|
} & MuiSnackbarProps;
|
|
18
18
|
|
|
19
19
|
export const Snackbar = ({ ...props }: SnackbarProps) => {
|
|
20
20
|
const theme = useTheme();
|
|
21
|
-
const getColor = (variant:
|
|
21
|
+
const getColor = (variant: Severity) => {
|
|
22
22
|
switch (variant) {
|
|
23
23
|
case "success":
|
|
24
24
|
return theme.palette.highlight.highlightGreen;
|
|
25
|
-
case "
|
|
25
|
+
case "error":
|
|
26
26
|
return theme.palette.highlight.highlightRed;
|
|
27
27
|
case "info":
|
|
28
28
|
return theme.palette.highlight.highlightBlue;
|
|
@@ -32,11 +32,11 @@ export const Snackbar = ({ ...props }: SnackbarProps) => {
|
|
|
32
32
|
return theme.palette.highlight.highlightGreen;
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
const getBackGroundColor = (variant:
|
|
35
|
+
const getBackGroundColor = (variant: Severity) => {
|
|
36
36
|
switch (variant) {
|
|
37
37
|
case "success":
|
|
38
38
|
return theme.palette.highlight.greenBackground;
|
|
39
|
-
case "
|
|
39
|
+
case "error":
|
|
40
40
|
return theme.palette.highlight.redBackground;
|
|
41
41
|
case "info":
|
|
42
42
|
return theme.palette.highlight.blueBackground;
|
|
@@ -47,11 +47,11 @@ export const Snackbar = ({ ...props }: SnackbarProps) => {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
const getIcon = (variant:
|
|
50
|
+
const getIcon = (variant: Severity) => {
|
|
51
51
|
switch (variant) {
|
|
52
52
|
case "success":
|
|
53
53
|
return <Icons.SuccessFilledIcon />;
|
|
54
|
-
case "
|
|
54
|
+
case "error":
|
|
55
55
|
return <Icons.AlertFilledIcon />;
|
|
56
56
|
case "info":
|
|
57
57
|
return <Icons.InfoFilledIcon />;
|
|
@@ -77,29 +77,30 @@ export const Snackbar = ({ ...props }: SnackbarProps) => {
|
|
|
77
77
|
sx={{
|
|
78
78
|
height: "90px",
|
|
79
79
|
width: "480px",
|
|
80
|
-
backgroundColor: getBackGroundColor(props.
|
|
80
|
+
backgroundColor: getBackGroundColor(props.severity),
|
|
81
81
|
}}
|
|
82
82
|
>
|
|
83
83
|
<Box
|
|
84
84
|
sx={{
|
|
85
85
|
width: "10px",
|
|
86
86
|
height: "100%",
|
|
87
|
-
backgroundColor: getColor(props.
|
|
87
|
+
backgroundColor: getColor(props.severity),
|
|
88
88
|
borderRadius: "5px 0px 0px 5px",
|
|
89
89
|
}}
|
|
90
90
|
/>
|
|
91
91
|
<Stack width="100%" height="100%" direction={"row"} alignItems="center">
|
|
92
92
|
<Stack direction="row" gap={1} justifyContent="space-evenly">
|
|
93
|
-
{getIcon(props.
|
|
93
|
+
<Box sx={{ marginTop: "2px" }}>{getIcon(props.severity)}</Box>
|
|
94
94
|
<Stack direction={"column"}>
|
|
95
95
|
<Typography variant="subtitle2">
|
|
96
|
-
{props.
|
|
96
|
+
{props.severity.toUpperCase()}
|
|
97
97
|
</Typography>
|
|
98
98
|
<Typography variant="body2">{props.message}</Typography>
|
|
99
99
|
</Stack>
|
|
100
100
|
</Stack>
|
|
101
101
|
</Stack>
|
|
102
|
-
|
|
102
|
+
|
|
103
|
+
<IconButton sx={{ margin: "25px" }} onClick={handleClose}>
|
|
103
104
|
<Icons.CrossIcon2 />
|
|
104
105
|
</IconButton>
|
|
105
106
|
</Stack>
|
|
@@ -3,10 +3,12 @@ import {
|
|
|
3
3
|
TextFieldProps as MuiTextFieldProps,
|
|
4
4
|
StackProps,
|
|
5
5
|
} from "@mui/material";
|
|
6
|
+
import { Typography } from "../../export";
|
|
6
7
|
import { LabelWrapper } from "../LabelWrapper/LabelWrapper";
|
|
7
8
|
|
|
8
9
|
export type TextFieldProps = {
|
|
9
10
|
containerProps?: StackProps;
|
|
11
|
+
description?: string;
|
|
10
12
|
} & MuiTextFieldProps;
|
|
11
13
|
|
|
12
14
|
export const TextField = ({
|
|
@@ -16,6 +18,7 @@ export const TextField = ({
|
|
|
16
18
|
onChange,
|
|
17
19
|
required = false,
|
|
18
20
|
containerProps,
|
|
21
|
+
description,
|
|
19
22
|
...rest
|
|
20
23
|
}: TextFieldProps) => {
|
|
21
24
|
return (
|
|
@@ -34,6 +37,7 @@ export const TextField = ({
|
|
|
34
37
|
onChange={onChange}
|
|
35
38
|
{...rest}
|
|
36
39
|
/>
|
|
40
|
+
<Typography variant="caption">{description}</Typography>
|
|
37
41
|
</LabelWrapper>
|
|
38
42
|
);
|
|
39
43
|
};
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { TabsContainer } from "./TabsContainer/TabsContainer";
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
Breadcrumbs,
|
|
13
|
-
CustomDialog,
|
|
14
|
-
DropDownButton,
|
|
15
|
-
DropDownIcon,
|
|
16
|
-
DropdownMenu,
|
|
17
|
-
DropdownMenuItem,
|
|
18
|
-
Sidebar,
|
|
19
|
-
Stepper,
|
|
20
|
-
TabsContainer,
|
|
21
|
-
};
|
|
1
|
+
export * from "./DialogButton/DialogButton";
|
|
2
|
+
export * from "./DropDownMenu/DropDownButton";
|
|
3
|
+
export * from "./DropDownMenu/DropDownIcon";
|
|
4
|
+
export * from "./DropDownMenu/DropDownMenu";
|
|
5
|
+
export * from "./DropDownMenu/DropdownMenuItem";
|
|
6
|
+
export * from "./Sidebar/Sidebar";
|
|
7
|
+
export * from "./Stepper/Stepper";
|
|
8
|
+
export * from "./TabsContainer/TabsContainer";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Alert } from "../../components/export";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Feedback/Alert",
|
|
6
|
+
component: Alert,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
severity: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "select",
|
|
12
|
+
options: ["success", "info", "warning", "error"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
message: { control: "text" },
|
|
16
|
+
},
|
|
17
|
+
} as Meta<typeof Alert>;
|
|
18
|
+
|
|
19
|
+
export const AlertSuccess: StoryObj<typeof Alert> = {
|
|
20
|
+
render: (args) => <Alert {...args} />,
|
|
21
|
+
args: {
|
|
22
|
+
severity: "success",
|
|
23
|
+
message: "Success Message Comes Here",
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
|
|
3
|
-
import { Snackbar } from "../../components/Feedback/Snackbar/Snackbar";
|
|
2
|
+
import { Snackbar } from "../../components/export";
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
5
|
title: "Feedback/Snackbar",
|
|
@@ -22,7 +21,7 @@ export default {
|
|
|
22
21
|
export const SnackbarSuccess: StoryObj<typeof Snackbar> = {
|
|
23
22
|
render: (args) => <Snackbar {...args} />,
|
|
24
23
|
args: {
|
|
25
|
-
|
|
24
|
+
severity: "success",
|
|
26
25
|
message: "Success or error or info or warning",
|
|
27
26
|
open: true,
|
|
28
27
|
},
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
|
|
3
|
-
import { Icons } from "../../components/Assets/Icons/Icons";
|
|
4
2
|
import {
|
|
5
|
-
|
|
3
|
+
Button,
|
|
4
|
+
Icons,
|
|
6
5
|
Tooltip,
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
ToolTipContent,
|
|
7
|
+
} from "../../components/export";
|
|
9
8
|
|
|
10
9
|
export default {
|
|
11
10
|
title: "Feedback/Tooltip",
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Tutorial } from "../../components/
|
|
3
|
-
import { Typography } from "../../components/DataDisplay/Typography/Typography";
|
|
4
|
-
import { useTheme } from "@mui/material";
|
|
2
|
+
import { Tutorial, Typography } from "../../components/export";
|
|
5
3
|
|
|
6
4
|
export default {
|
|
7
5
|
title: "Feedback/Tutorial",
|
|
@@ -56,6 +56,29 @@ export const getCommonTheme = (mode: Theme) => {
|
|
|
56
56
|
},
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
|
+
MuiAlert: {
|
|
60
|
+
styleOverrides: {
|
|
61
|
+
root: {
|
|
62
|
+
maxWidth: "400px",
|
|
63
|
+
fontFamily: "Poppins",
|
|
64
|
+
fontWeight: 500,
|
|
65
|
+
fontSize: "14px",
|
|
66
|
+
color: ColorTokens.text.primary,
|
|
67
|
+
},
|
|
68
|
+
standardSuccess: {
|
|
69
|
+
backgroundColor: ColorTokens.highlight.greenBackground,
|
|
70
|
+
},
|
|
71
|
+
standardInfo: {
|
|
72
|
+
backgroundColor: ColorTokens.highlight.blueBackground,
|
|
73
|
+
},
|
|
74
|
+
standardWarning: {
|
|
75
|
+
backgroundColor: ColorTokens.highlight.orangeBackground,
|
|
76
|
+
},
|
|
77
|
+
standardError: {
|
|
78
|
+
backgroundColor: ColorTokens.highlight.redBackground,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
},
|
|
59
82
|
MuiIconButton: {
|
|
60
83
|
defaultProps: {
|
|
61
84
|
disableRipple: true,
|
|
@@ -196,7 +219,7 @@ export const getCommonTheme = (mode: Theme) => {
|
|
|
196
219
|
fontSize: "14px ",
|
|
197
220
|
fontFamily: "Poppins",
|
|
198
221
|
fontWeight: 600,
|
|
199
|
-
|
|
222
|
+
width: "350px",
|
|
200
223
|
"&:hover": {
|
|
201
224
|
boxShadow: "none ",
|
|
202
225
|
"@media (hover: none )": {
|