@campxdev/react-blueprint 1.0.13 → 1.0.15
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 +1 -1
- package/src/components/Assets/Icons/IconComponents/AlertFilledIcon.tsx +21 -0
- package/src/components/Assets/Icons/IconComponents/CrossIcon2.tsx +16 -0
- package/src/components/Assets/Icons/IconComponents/InfoFilledIcon.tsx +31 -0
- package/src/components/Assets/Icons/IconComponents/SuccessFilledIcon.tsx +21 -0
- package/src/components/Assets/Icons/IconComponents/WarningFilledIcon.tsx +33 -0
- package/src/components/Assets/Icons/Icons.tsx +12 -2
- package/src/components/DataDisplay/export.ts +4 -5
- package/src/components/Feedback/Snackbar/Snackbar.tsx +108 -0
- package/src/components/Feedback/exports.ts +1 -0
- package/src/stories/Feedback/Snackbar.stories.tsx +29 -0
- package/src/themes/commonTheme.ts +19 -0
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const AlertFilledIcon = () => {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
width="20"
|
|
5
|
+
height="21"
|
|
6
|
+
viewBox="0 0 20 21"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
style={{
|
|
10
|
+
marginTop: "4px",
|
|
11
|
+
}}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill-rule="evenodd"
|
|
15
|
+
clip-rule="evenodd"
|
|
16
|
+
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="#F2353C"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const CrossIcon2 = () => {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
width="12"
|
|
5
|
+
height="13"
|
|
6
|
+
viewBox="0 0 12 13"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
d="M7.05767 6.76985L11.7713 11.4836C11.8429 11.5527 11.8999 11.6354 11.9392 11.7268C11.9784 11.8182 11.9991 11.9165 12 12.0159C12.0008 12.1154 11.9819 12.214 11.9442 12.3061C11.9066 12.3981 11.8509 12.4818 11.7806 12.5521C11.7103 12.6224 11.6266 12.678 11.5346 12.7157C11.4425 12.7534 11.3439 12.7723 11.2444 12.7715C11.145 12.7706 11.0467 12.7499 10.9553 12.7107C10.8639 12.6714 10.7812 12.6143 10.7121 12.5428L5.99831 7.8292L1.28467 12.5428C1.14368 12.6807 0.953997 12.7574 0.756788 12.7563C0.55958 12.7553 0.370757 12.6764 0.231295 12.537C0.0918334 12.3976 0.0129869 12.2088 0.011866 12.0116C0.010745 11.8143 0.0874404 11.6247 0.225308 11.4836L4.93914 6.76985L0.225308 2.05605C0.154479 1.98678 0.098096 1.90414 0.0594234 1.81293C0.0207508 1.72171 0.000556967 1.62374 1.13598e-05 1.52466C-0.000534247 1.42559 0.0185792 1.3274 0.0562448 1.23577C0.0939104 1.14413 0.14938 1.06088 0.219441 0.990831C0.289503 0.920783 0.372765 0.865328 0.464406 0.827679C0.556047 0.79003 0.654246 0.770933 0.753318 0.771496C0.85239 0.772058 0.950365 0.792271 1.04157 0.830959C1.13278 0.869648 1.21541 0.926044 1.28467 0.996885L5.99831 5.7105L10.7121 0.996885C10.8584 0.850633 11.0502 0.777412 11.2417 0.777412C11.4333 0.777412 11.6253 0.850633 11.7713 0.996885C11.9117 1.13735 11.9906 1.32784 11.9906 1.52647C11.9906 1.72509 11.9117 1.91558 11.7713 2.05605L7.05767 6.76985Z"
|
|
12
|
+
fill="#121212"
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const InfoFilledIcon = () => {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
width="20"
|
|
5
|
+
height="21"
|
|
6
|
+
viewBox="0 0 20 21"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
style={{
|
|
10
|
+
marginTop: "4px",
|
|
11
|
+
}}
|
|
12
|
+
>
|
|
13
|
+
<mask
|
|
14
|
+
id="mask0_194_1775"
|
|
15
|
+
maskUnits="userSpaceOnUse"
|
|
16
|
+
x="0"
|
|
17
|
+
y="0"
|
|
18
|
+
width="20"
|
|
19
|
+
height="21"
|
|
20
|
+
>
|
|
21
|
+
<path d="M20 0.5H0V20.5H20V0.5Z" fill="white" />
|
|
22
|
+
</mask>
|
|
23
|
+
<g mask="url(#mask0_194_1775)">
|
|
24
|
+
<path
|
|
25
|
+
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="#4BAABE"
|
|
27
|
+
/>
|
|
28
|
+
</g>
|
|
29
|
+
</svg>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const SuccessFilledIcon = () => {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
width="20"
|
|
5
|
+
height="21"
|
|
6
|
+
viewBox="0 0 20 21"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
style={{
|
|
10
|
+
marginTop: "4px",
|
|
11
|
+
}}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill-rule="evenodd"
|
|
15
|
+
clip-rule="evenodd"
|
|
16
|
+
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="#88B053"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export const WarningFilledIcon = () => {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
width="20"
|
|
5
|
+
height="21"
|
|
6
|
+
viewBox="0 0 20 21"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
style={{
|
|
10
|
+
marginTop: "4px",
|
|
11
|
+
}}
|
|
12
|
+
>
|
|
13
|
+
<mask
|
|
14
|
+
id="mask0_194_1734"
|
|
15
|
+
maskUnits="userSpaceOnUse"
|
|
16
|
+
x="0"
|
|
17
|
+
y="0"
|
|
18
|
+
width="20"
|
|
19
|
+
height="21"
|
|
20
|
+
>
|
|
21
|
+
<path d="M20 0.5H0V20.5H20V0.5Z" fill="white" />
|
|
22
|
+
</mask>
|
|
23
|
+
<g mask="url(#mask0_194_1734)">
|
|
24
|
+
<path
|
|
25
|
+
fill-rule="evenodd"
|
|
26
|
+
clip-rule="evenodd"
|
|
27
|
+
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="#ED9035"
|
|
29
|
+
/>
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -30,17 +30,22 @@ import { NotificationIcon } from "./IconComponents/NotificationIcon";
|
|
|
30
30
|
import { PayxIcon } from "./IconComponents/PayxIcon";
|
|
31
31
|
|
|
32
32
|
import { AdminIcon } from "./IconComponents/AdminIcon";
|
|
33
|
+
import { AlertFilledIcon } from "./IconComponents/AlertFilledIcon";
|
|
33
34
|
import { CampxFullLogoIcon } from "./IconComponents/CampxFullLogoIcon";
|
|
35
|
+
import { CrossIcon2 } from "./IconComponents/CrossIcon2";
|
|
36
|
+
import { InfoFilledIcon } from "./IconComponents/InfoFilledIcon";
|
|
34
37
|
import { PeoplexIcon } from "./IconComponents/PeoplexIcon";
|
|
35
38
|
import { ProductFeaturesIcon } from "./IconComponents/ProductFeaturesIcon";
|
|
36
39
|
import { ProfileIcon } from "./IconComponents/ProfileIcon";
|
|
37
40
|
import { RightIcon } from "./IconComponents/RightIcon";
|
|
41
|
+
import { SaveIcon } from "./IconComponents/SaveIcon";
|
|
42
|
+
import { ShareIcon } from "./IconComponents/ShareIcon";
|
|
43
|
+
import { SuccessFilledIcon } from "./IconComponents/SuccessFilledIcon";
|
|
38
44
|
import { TicketsIcon } from "./IconComponents/TicketsIcon";
|
|
39
45
|
import { UmsIcon } from "./IconComponents/UmsIcon";
|
|
40
46
|
import { UnCheckedCheckboxIcon } from "./IconComponents/UncheckCheckBoxIcon";
|
|
41
47
|
import { UnCheckedRadioIcon } from "./IconComponents/UncheckedRadioIcon";
|
|
42
|
-
import {
|
|
43
|
-
import { SaveIcon } from "./IconComponents/SaveIcon";
|
|
48
|
+
import { WarningFilledIcon } from "./IconComponents/WarningFilledIcon";
|
|
44
49
|
|
|
45
50
|
export const Icons = {
|
|
46
51
|
AppsIcon,
|
|
@@ -53,6 +58,11 @@ export const Icons = {
|
|
|
53
58
|
ExamResultIcon,
|
|
54
59
|
NotificationIcon,
|
|
55
60
|
RightIcon,
|
|
61
|
+
SuccessFilledIcon,
|
|
62
|
+
InfoFilledIcon,
|
|
63
|
+
WarningFilledIcon,
|
|
64
|
+
AlertFilledIcon,
|
|
65
|
+
CrossIcon2,
|
|
56
66
|
LogoutIcon,
|
|
57
67
|
TicketsIcon,
|
|
58
68
|
FilterIcon,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { DataTable } from "./DataTable/DataTable";
|
|
3
|
-
|
|
4
|
-
export * from "./Card/Card";
|
|
1
|
+
export * from "./Accordion/Accordion";
|
|
5
2
|
export * from "./Avatar/Avatar";
|
|
6
|
-
export
|
|
3
|
+
export * from "./Card/Card";
|
|
4
|
+
export * from "./DataTable/DataTable";
|
|
5
|
+
export * from "./Typography/Typography";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
IconButton,
|
|
4
|
+
Snackbar as MuiSnackbar,
|
|
5
|
+
SnackbarProps as MuiSnackbarProps,
|
|
6
|
+
Stack,
|
|
7
|
+
useTheme,
|
|
8
|
+
} from "@mui/material";
|
|
9
|
+
import { Typography } from "../../DataDisplay/Typography/Typography";
|
|
10
|
+
import { Icons } from "../../export";
|
|
11
|
+
|
|
12
|
+
export type Variant = "success" | "info" | "warning" | "alert";
|
|
13
|
+
|
|
14
|
+
export type SnackbarProps = {
|
|
15
|
+
variant: Variant;
|
|
16
|
+
message: string;
|
|
17
|
+
} & MuiSnackbarProps;
|
|
18
|
+
|
|
19
|
+
export const Snackbar = ({ ...props }: SnackbarProps) => {
|
|
20
|
+
const theme = useTheme();
|
|
21
|
+
const getColor = (variant: Variant) => {
|
|
22
|
+
switch (variant) {
|
|
23
|
+
case "success":
|
|
24
|
+
return theme.palette.highlight.highlightGreen;
|
|
25
|
+
case "alert":
|
|
26
|
+
return theme.palette.highlight.highlightRed;
|
|
27
|
+
case "info":
|
|
28
|
+
return theme.palette.highlight.highlightBlue;
|
|
29
|
+
case "warning":
|
|
30
|
+
return theme.palette.highlight.highlightOrange;
|
|
31
|
+
default:
|
|
32
|
+
return theme.palette.highlight.highlightGreen;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const getBackGroundColor = (variant: Variant) => {
|
|
36
|
+
switch (variant) {
|
|
37
|
+
case "success":
|
|
38
|
+
return theme.palette.highlight.greenBackground;
|
|
39
|
+
case "alert":
|
|
40
|
+
return theme.palette.highlight.redBackground;
|
|
41
|
+
case "info":
|
|
42
|
+
return theme.palette.highlight.blueBackground;
|
|
43
|
+
case "warning":
|
|
44
|
+
return theme.palette.highlight.orangeBackground;
|
|
45
|
+
default:
|
|
46
|
+
return theme.palette.highlight.greenBackground;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const getIcon = (variant: Variant) => {
|
|
51
|
+
switch (variant) {
|
|
52
|
+
case "success":
|
|
53
|
+
return <Icons.SuccessFilledIcon />;
|
|
54
|
+
case "alert":
|
|
55
|
+
return <Icons.AlertFilledIcon />;
|
|
56
|
+
case "info":
|
|
57
|
+
return <Icons.InfoFilledIcon />;
|
|
58
|
+
case "warning":
|
|
59
|
+
return <Icons.WarningFilledIcon />;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const handleClose = (event: React.SyntheticEvent<any> | Event) => {
|
|
64
|
+
if (props.onClose) {
|
|
65
|
+
props.onClose(event, "clickaway");
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<MuiSnackbar open={props.open} onClose={props.onClose} {...props}>
|
|
71
|
+
<Stack
|
|
72
|
+
direction="row"
|
|
73
|
+
borderRadius="5px"
|
|
74
|
+
justifyContent="space-between"
|
|
75
|
+
alignItems="flex-start"
|
|
76
|
+
gap={1}
|
|
77
|
+
sx={{
|
|
78
|
+
height: "90px",
|
|
79
|
+
width: "480px",
|
|
80
|
+
backgroundColor: getBackGroundColor(props.variant),
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
<Box
|
|
84
|
+
sx={{
|
|
85
|
+
width: "10px",
|
|
86
|
+
height: "100%",
|
|
87
|
+
backgroundColor: getColor(props.variant),
|
|
88
|
+
borderRadius: "5px 0px 0px 5px",
|
|
89
|
+
}}
|
|
90
|
+
/>
|
|
91
|
+
<Stack width="100%" height="100%" direction={"row"} alignItems="center">
|
|
92
|
+
<Stack direction="row" gap={1} justifyContent="space-evenly">
|
|
93
|
+
{getIcon(props.variant)}
|
|
94
|
+
<Stack direction={"column"}>
|
|
95
|
+
<Typography variant="subtitle2">
|
|
96
|
+
{props.variant.toUpperCase()}
|
|
97
|
+
</Typography>
|
|
98
|
+
<Typography variant="body2">{props.message}</Typography>
|
|
99
|
+
</Stack>
|
|
100
|
+
</Stack>
|
|
101
|
+
</Stack>
|
|
102
|
+
<IconButton sx={{ margin: "5px" }} onClick={handleClose}>
|
|
103
|
+
<Icons.CrossIcon2 />
|
|
104
|
+
</IconButton>
|
|
105
|
+
</Stack>
|
|
106
|
+
</MuiSnackbar>
|
|
107
|
+
);
|
|
108
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
import { Snackbar } from "../../components/Feedback/Snackbar/Snackbar";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Feedback/Snackbar",
|
|
7
|
+
component: Snackbar,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
severity: {
|
|
11
|
+
control: {
|
|
12
|
+
type: "select",
|
|
13
|
+
options: ["success", "info", "warning", "error"],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
message: { control: "text" },
|
|
17
|
+
open: { control: "boolean" },
|
|
18
|
+
onClose: { action: "closed" },
|
|
19
|
+
},
|
|
20
|
+
} as Meta<typeof Snackbar>;
|
|
21
|
+
|
|
22
|
+
export const SnackbarSuccess: StoryObj<typeof Snackbar> = {
|
|
23
|
+
render: (args) => <Snackbar {...args} />,
|
|
24
|
+
args: {
|
|
25
|
+
variant: "success",
|
|
26
|
+
message: "Success or error or info or warning",
|
|
27
|
+
open: true,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -196,6 +196,7 @@ export const getCommonTheme = (mode: Theme) => {
|
|
|
196
196
|
fontSize: "14px ",
|
|
197
197
|
fontFamily: "Poppins",
|
|
198
198
|
fontWeight: 600,
|
|
199
|
+
maxWidth: "350px",
|
|
199
200
|
"&:hover": {
|
|
200
201
|
boxShadow: "none ",
|
|
201
202
|
"@media (hover: none )": {
|
|
@@ -210,6 +211,12 @@ export const getCommonTheme = (mode: Theme) => {
|
|
|
210
211
|
},
|
|
211
212
|
"&$disabled": { boxShadow: "none" },
|
|
212
213
|
},
|
|
214
|
+
text: {
|
|
215
|
+
padding: "0px",
|
|
216
|
+
"&:hover": {
|
|
217
|
+
backgroundColor: "transparent",
|
|
218
|
+
},
|
|
219
|
+
},
|
|
213
220
|
},
|
|
214
221
|
},
|
|
215
222
|
MuiTextField: {
|
|
@@ -228,7 +235,11 @@ export const getCommonTheme = (mode: Theme) => {
|
|
|
228
235
|
display: "none",
|
|
229
236
|
},
|
|
230
237
|
},
|
|
238
|
+
"& input:-webkit-autofill": {
|
|
239
|
+
height: "7px",
|
|
240
|
+
},
|
|
231
241
|
minWidth: "200px",
|
|
242
|
+
width: "350px",
|
|
232
243
|
margin: "5px 0px",
|
|
233
244
|
},
|
|
234
245
|
},
|
|
@@ -296,6 +307,14 @@ export const getCommonTheme = (mode: Theme) => {
|
|
|
296
307
|
},
|
|
297
308
|
},
|
|
298
309
|
},
|
|
310
|
+
MuiSnackbar: {
|
|
311
|
+
defaultProps: {
|
|
312
|
+
anchorOrigin: {
|
|
313
|
+
vertical: "bottom",
|
|
314
|
+
horizontal: "right",
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
},
|
|
299
318
|
MuiAutocomplete: {
|
|
300
319
|
styleOverrides: {
|
|
301
320
|
root: {
|