@campxdev/react-blueprint 1.0.16 → 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/Feedback/Alert/Alert.tsx +28 -0
- package/src/components/Feedback/exports.ts +1 -0
- package/src/components/Navigation/exports.ts +8 -21
- package/src/stories/Feedback/{Alerts.stories.tsx → Alert.stories.tsx} +1 -2
- package/src/stories/Feedback/Snackbar.stories.tsx +1 -2
- 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 +15 -2
- package/src/components/Feedback/Alerts/Alerts.tsx +0 -34
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
|
}
|
|
@@ -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
|
+
};
|
|
@@ -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";
|
|
@@ -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",
|
|
@@ -61,8 +61,21 @@ export const getCommonTheme = (mode: Theme) => {
|
|
|
61
61
|
root: {
|
|
62
62
|
maxWidth: "400px",
|
|
63
63
|
fontFamily: "Poppins",
|
|
64
|
-
fontWeight:
|
|
65
|
-
fontSize: "
|
|
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,
|
|
66
79
|
},
|
|
67
80
|
},
|
|
68
81
|
},
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Alert as MuiAlert,
|
|
3
|
-
AlertProps as MuiAlertProps,
|
|
4
|
-
useTheme,
|
|
5
|
-
} from "@mui/material";
|
|
6
|
-
import { Icons } from "../../export";
|
|
7
|
-
|
|
8
|
-
export type AlertProps = {
|
|
9
|
-
message: string;
|
|
10
|
-
severity: MuiAlertProps["severity"];
|
|
11
|
-
} & MuiAlertProps;
|
|
12
|
-
|
|
13
|
-
const getIcon = (severity: MuiAlertProps["severity"], theme: any) => {
|
|
14
|
-
switch (severity) {
|
|
15
|
-
case "success":
|
|
16
|
-
return <Icons.SuccessFilledIcon />;
|
|
17
|
-
case "error":
|
|
18
|
-
return <Icons.AlertFilledIcon />;
|
|
19
|
-
case "info":
|
|
20
|
-
return <Icons.InfoFilledIcon />;
|
|
21
|
-
case "warning":
|
|
22
|
-
return <Icons.WarningFilledIcon />;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const Alert = ({ severity, message }: AlertProps) => {
|
|
27
|
-
const theme = useTheme();
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<MuiAlert severity={severity} icon={getIcon(severity, theme)}>
|
|
31
|
-
{message}
|
|
32
|
-
</MuiAlert>
|
|
33
|
-
);
|
|
34
|
-
};
|