@campxdev/react-blueprint 1.0.4 → 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.
Files changed (51) hide show
  1. package/package.json +6 -2
  2. package/public/index.html +3 -4
  3. package/src/App.tsx +8 -1
  4. package/src/AppContent.tsx +38 -0
  5. package/src/assets/images/svg/Emptylistmage.svg +9 -0
  6. package/src/assets/images/svg/Internalserverimage.svg +9 -0
  7. package/src/assets/images/svg/error-cactus.svg +9 -0
  8. package/src/assets/images/svg/index.ts +10 -0
  9. package/src/assets/images/svg/no-connection.svg +9 -0
  10. package/src/assets/images/svg/unauthorized.svg +9 -0
  11. package/src/components/Assets/ErrorPages/InternalServerError.tsx +31 -0
  12. package/src/components/Assets/ErrorPages/NoInternetConnection.tsx +33 -0
  13. package/src/components/Assets/ErrorPages/NoItemFound.tsx +33 -0
  14. package/src/components/Assets/ErrorPages/PageNotFound.tsx +33 -0
  15. package/src/components/Assets/ErrorPages/UnAuthorized.tsx +25 -0
  16. package/src/components/Assets/ErrorPages/styles.tsx +29 -0
  17. package/src/components/Assets/Icons/IconComponents/CompletedStateIcon.tsx +35 -0
  18. package/src/components/Assets/Icons/IconComponents/SaveIcon.tsx +42 -0
  19. package/src/components/Assets/Icons/IconComponents/ShareIcon.tsx +61 -0
  20. package/src/components/Assets/Icons/Icons.tsx +6 -0
  21. package/src/components/Assets/export.ts +5 -0
  22. package/src/components/Charts/BarChart/BarChart.tsx +160 -0
  23. package/src/components/Charts/LineChart/LineChart.tsx +119 -0
  24. package/src/components/Charts/PieChart/PieChart.tsx +95 -0
  25. package/src/components/Charts/TreeMap/TreeMap.tsx +151 -0
  26. package/src/components/Charts/types/types.ts +43 -0
  27. package/src/components/DataDisplay/Accordion/Accordion.tsx +55 -0
  28. package/src/components/DataDisplay/Accordion/utils/StandardImageList.tsx +70 -0
  29. package/src/components/DataDisplay/export.ts +4 -1
  30. package/src/components/Input/components/FetchingOptionsLoader.tsx +7 -7
  31. package/src/components/Input/export.ts +1 -0
  32. package/src/components/Layout/TabsLayout/Tabs.tsx +67 -0
  33. package/src/components/Layout/TabsLayout/TabsLayout.tsx +56 -0
  34. package/src/components/Layout/exports.ts +4 -0
  35. package/src/components/Navigation/Breadcrumbs/Breadcrumbs.tsx +40 -0
  36. package/src/components/Navigation/Sidebar/styles.tsx +1 -1
  37. package/src/components/Navigation/Stepper/Stepper.tsx +59 -0
  38. package/src/components/Navigation/Stepper/StepperComponents.tsx +72 -0
  39. package/src/components/Navigation/exports.ts +4 -0
  40. package/src/components/export.ts +3 -3
  41. package/src/stories/Charts/BarChart.stories.tsx +142 -0
  42. package/src/stories/Charts/LineChart.stories.tsx +112 -0
  43. package/src/stories/Charts/PieChart.stories.tsx +137 -0
  44. package/src/stories/Charts/Treemap.stories.tsx +224 -0
  45. package/src/stories/DataDisplay/Accordion.stories.tsx +62 -0
  46. package/src/stories/DesignSystem/typography.stories.tsx +1 -1
  47. package/src/stories/Layout/TabsLayout.stories.tsx +53 -0
  48. package/src/stories/Navigation/Breadcrumbs.stories.tsx +34 -0
  49. package/src/stories/Navigation/Stepper.stories.tsx +51 -0
  50. package/src/themes/commonTheme.ts +47 -1
  51. package/types/theme.d.ts +1 -1
@@ -0,0 +1,72 @@
1
+ import {
2
+ StepConnector,
3
+ stepConnectorClasses,
4
+ StepContent,
5
+ StepIconProps,
6
+ styled,
7
+ } from "@mui/material";
8
+ import { CheckedRadioIcon } from "../../Assets/Icons/IconComponents/CheckedRadioIcon";
9
+ import { CompletedStateIcon } from "../../Assets/Icons/IconComponents/CompletedStateIcon";
10
+ import { UnCheckedRadioIcon } from "../../Assets/Icons/IconComponents/UncheckedRadioIcon";
11
+
12
+ interface StepContentProps {
13
+ isVertical: boolean;
14
+ activeStep: boolean;
15
+ isLastStep: boolean;
16
+ }
17
+
18
+ export const StyledStepContent = styled(StepContent)<StepContentProps>(
19
+ ({ theme, isVertical, activeStep, isLastStep }) => ({
20
+ ...(isVertical &&
21
+ activeStep &&
22
+ !isLastStep && {
23
+ borderLeft: `2px solid ${theme.palette.primary.light}`,
24
+ }),
25
+ ...(!isVertical && {
26
+ borderLeft: "none",
27
+ paddingLeft: "20px",
28
+ margin: "20px 0px 0px 20px",
29
+ }),
30
+ })
31
+ );
32
+
33
+ interface ConnectorProps {
34
+ isVertical: boolean;
35
+ }
36
+
37
+ export const Connector = styled(StepConnector)<ConnectorProps>(
38
+ ({ theme, isVertical }) => ({
39
+ [`&.${stepConnectorClasses.active}`]: {
40
+ [`& .${stepConnectorClasses.line}`]: {
41
+ [isVertical ? "borderLeft" : "border"]:
42
+ `2px solid ${theme.palette.primary.light}`,
43
+ },
44
+ },
45
+ [`&.${stepConnectorClasses.completed}`]: {
46
+ [`& .${stepConnectorClasses.line}`]: {
47
+ [isVertical ? "borderLeft" : "border"]:
48
+ `2px solid ${theme.palette.primary.light}`,
49
+ },
50
+ },
51
+ })
52
+ );
53
+
54
+ export function StepIcon(props: StepIconProps) {
55
+ const { active, completed, className } = props;
56
+
57
+ const getIcon = () => {
58
+ if (completed) return <CompletedStateIcon />;
59
+ if (active) return <CheckedRadioIcon />;
60
+ return <UnCheckedRadioIcon />;
61
+ };
62
+
63
+ return <StepIconRoot className={className}>{getIcon()}</StepIconRoot>;
64
+ }
65
+
66
+ const StepIconRoot = styled("div")<{}>(({ theme }) => ({
67
+ width: 20,
68
+ height: 20,
69
+ display: "flex",
70
+ justifyContent: "center",
71
+ alignItems: "center",
72
+ }));
@@ -1,17 +1,21 @@
1
+ import { Breadcrumbs } from "./Breadcrumbs/Breadcrumbs";
1
2
  import { CustomDialog } from "./DialogButton/DialogButton";
2
3
  import { DropDownButton } from "./DropDownMenu/DropDownButton";
3
4
  import { DropDownIcon } from "./DropDownMenu/DropDownIcon";
4
5
  import { DropdownMenu } from "./DropDownMenu/DropDownMenu";
5
6
  import { DropdownMenuItem } from "./DropDownMenu/DropdownMenuItem";
6
7
  import { Sidebar } from "./Sidebar/Sidebar";
8
+ import { Stepper } from "./Stepper/Stepper";
7
9
  import { TabsContainer } from "./TabsContainer/TabsContainer";
8
10
 
9
11
  export {
12
+ Breadcrumbs,
10
13
  CustomDialog,
11
14
  DropDownButton,
12
15
  DropDownIcon,
13
16
  DropdownMenu,
14
17
  DropdownMenuItem,
15
18
  Sidebar,
19
+ Stepper,
16
20
  TabsContainer,
17
21
  };
@@ -1,7 +1,7 @@
1
1
  export * from "./Assets/export";
2
2
  export * from "./DataDisplay/export";
3
- export * from "./Input/export";
4
- export * from "./Layout/AppHeader/AppHeader";
5
-
6
3
  export * from "./Feedback/exports";
4
+ export * from "./Input/export";
5
+ export * from "./Layout/exports";
7
6
  export * from "./Navigation/exports";
7
+
@@ -0,0 +1,142 @@
1
+ import { Meta } from "@storybook/react";
2
+ import {
3
+ BarChart,
4
+ BarChartProps,
5
+ } from "../../components/Charts/BarChart/BarChart";
6
+
7
+ const data = [
8
+ {
9
+ name: "Page A",
10
+ uv: 4000,
11
+ pv: 2400,
12
+ amt: 2400,
13
+ },
14
+ {
15
+ name: "Page B",
16
+ uv: 3000,
17
+ pv: 1398,
18
+ amt: 2210,
19
+ },
20
+ {
21
+ name: "Page C",
22
+ uv: 2000,
23
+ pv: 9800,
24
+ amt: 2290,
25
+ },
26
+ ];
27
+
28
+ const bars = [
29
+ { dataKey: "uv", stackId: "a", fill: "#0088FE" },
30
+ { dataKey: "pv", stackId: "a", fill: "#00C49F" },
31
+ { dataKey: "amt", stackId: "b", fill: "#FFBB28" },
32
+ ];
33
+
34
+ export default {
35
+ title: "Charts/BarChart",
36
+ component: BarChart,
37
+ argTypes: {
38
+ title: {
39
+ control: "text",
40
+ description: "Title of the chart",
41
+ },
42
+ titleSx: {
43
+ control: "object",
44
+ description: "Styling for the title",
45
+ },
46
+ width: {
47
+ control: "number",
48
+ description: "Width of the chart",
49
+ },
50
+ height: {
51
+ control: "number",
52
+ description: "Height of the chart",
53
+ },
54
+ margin: {
55
+ control: "object",
56
+ description: "Margin around the chart",
57
+ },
58
+ showToolTip: {
59
+ control: "boolean",
60
+ description: "Toggle tooltip visibility",
61
+ },
62
+ showLegend: {
63
+ control: "boolean",
64
+ description: "Toggle legend visibility",
65
+ },
66
+ legendSx: {
67
+ control: "object",
68
+ description: "Styling for the legend",
69
+ },
70
+ containerSx: {
71
+ control: "object",
72
+ description: "Styling for the container",
73
+ },
74
+ dataKey: {
75
+ control: "text",
76
+ description: "Key for the X axis",
77
+ },
78
+ data: {
79
+ control: "object",
80
+ description: "Data for the chart",
81
+ },
82
+ bars: {
83
+ control: "object",
84
+ description: "Bars configuration",
85
+ },
86
+ cartesianGrid: {
87
+ control: "object",
88
+ description: "Configuration for the Cartesian grid",
89
+ },
90
+ axisLabelProps: {
91
+ control: "object",
92
+ description: "Labels for the axes",
93
+ },
94
+ axisStroke: {
95
+ control: "color",
96
+ description: "Stroke color for the axes",
97
+ },
98
+ barGap: {
99
+ control: "number",
100
+ description: "Gap between bars",
101
+ },
102
+ barSize: {
103
+ control: "number",
104
+ description: "Size of the bars",
105
+ },
106
+ barChartStyle: {
107
+ control: "object",
108
+ description: "Styling for the bar chart",
109
+ },
110
+ layout: {
111
+ control: {
112
+ type: "radio",
113
+ options: ["horizontal", "vertical"],
114
+ },
115
+ description: "Layout of the chart",
116
+ },
117
+ },
118
+ } as Meta<typeof BarChart>;
119
+
120
+ export const Default = {
121
+ render: (args: BarChartProps) => <BarChart {...args} />,
122
+ args: {
123
+ data: data,
124
+ bars: bars,
125
+ dataKey: "name",
126
+ containerSx: { width: "800px", height: "800px" },
127
+ cartesianGrid: { showCartesianGrid: true, size: 5 },
128
+ axisLabelProps: {
129
+ xLabel: { value: "X-Axis", dy: 20 },
130
+ yLabel: { value: "Y-Axis", dx: -20, angle: -90 },
131
+ },
132
+ legendSx: {
133
+ width: 150,
134
+ height: 150,
135
+ layout: "vertical",
136
+ align: "right",
137
+ verticalAlign: "top",
138
+ iconType: "line",
139
+ },
140
+ margin: { top: 20, left: 30, bottom: 20, right: 30 },
141
+ },
142
+ };
@@ -0,0 +1,112 @@
1
+ import { Meta } from "@storybook/react";
2
+ import {
3
+ LineChart,
4
+ LineChartProps,
5
+ } from "../../components/Charts/LineChart/LineChart";
6
+
7
+ const data = [
8
+ { name: "Page A", uv: 4000, pv: 2400, amt: 2400 },
9
+ { name: "Page B", uv: 3000, pv: 1398, amt: 2210 },
10
+ { name: "Page C", uv: 2000, pv: 9800, amt: 2290 },
11
+ { name: "Page D", uv: 2780, pv: 3908, amt: 2000 },
12
+ { name: "Page E", uv: 1890, pv: 4800, amt: 2181 },
13
+ { name: "Page F", uv: 2390, pv: 3800, amt: 2500 },
14
+ { name: "Page G", uv: 3490, pv: 4300, amt: 2100 },
15
+ ];
16
+
17
+ const lines = [
18
+ { type: "monotone", dataKey: "uv", stroke: "#8884d8" },
19
+ { type: "monotone", dataKey: "pv", stroke: "#82ca9d" },
20
+ ];
21
+
22
+ export default {
23
+ title: "Charts/LineChart",
24
+ component: LineChart,
25
+ argTypes: {
26
+ title: {
27
+ control: "text",
28
+ description: "Title of the chart",
29
+ },
30
+ titleSx: {
31
+ control: "object",
32
+ description: "Styling for the title",
33
+ },
34
+ width: {
35
+ control: "number",
36
+ description: "Width of the chart",
37
+ },
38
+ height: {
39
+ control: "number",
40
+ description: "Height of the chart",
41
+ },
42
+ margin: {
43
+ control: "object",
44
+ description: "Margin around the chart",
45
+ },
46
+ showToolTip: {
47
+ control: "boolean",
48
+ description: "Toggle tooltip visibility",
49
+ },
50
+ showLegend: {
51
+ control: "boolean",
52
+ description: "Toggle legend visibility",
53
+ },
54
+ legendSx: {
55
+ control: "object",
56
+ description: "Styling for the legend",
57
+ },
58
+ containerSx: {
59
+ control: "object",
60
+ description: "Styling for the container",
61
+ },
62
+ dataKey: {
63
+ control: "text",
64
+ description: "Key for the X axis",
65
+ },
66
+ data: {
67
+ control: "object",
68
+ description: "Data for the chart",
69
+ },
70
+ lines: {
71
+ control: "object",
72
+ description: "Lines configuration",
73
+ },
74
+ cartesianGrid: {
75
+ control: "object",
76
+ description: "Configuration for the Cartesian grid",
77
+ },
78
+ axisLabelProps: {
79
+ control: "object",
80
+ description: "Labels for the axes",
81
+ },
82
+ lineChartStyle: {
83
+ control: "object",
84
+ description: "Styling for the bar chart",
85
+ },
86
+ },
87
+ } as Meta<typeof LineChart>;
88
+
89
+ export const Default = {
90
+ render: (args: LineChartProps) => <LineChart {...args} />,
91
+ args: {
92
+ title: "Line Chart Example",
93
+ width: 700,
94
+ height: 500,
95
+ showToolTip: true,
96
+ showLegend: true,
97
+ dataKey: "name",
98
+ data: data,
99
+ lines: lines,
100
+ cartesianGrid: { showCartesianGrid: true, size: 3 },
101
+ axisLabelProps: {
102
+ xLabel: { value: "Pages", dy: 20 },
103
+ yLabel: { value: "Values", dx: -10, angle: -90 },
104
+ },
105
+ legendSx: {
106
+ layout: "horizontal",
107
+ align: "center",
108
+ verticalAlign: "top",
109
+ },
110
+ margin: { top: 30, right: 20, bottom: 30, left: 20 },
111
+ },
112
+ };
@@ -0,0 +1,137 @@
1
+ import { Meta } from "@storybook/react";
2
+ import {
3
+ PieChart,
4
+ PieChartProps,
5
+ } from "../../components/Charts/PieChart/PieChart";
6
+
7
+ const pieData1 = [
8
+ { name: "Group A", value: 400 },
9
+ { name: "Group B", value: 300 },
10
+ { name: "Group C", value: 300 },
11
+ { name: "Group D", value: 200 },
12
+ ];
13
+
14
+ const pieData2 = [
15
+ { name: "Group A", value: 2400 },
16
+ { name: "Group B", value: 4567 },
17
+ { name: "Group C", value: 1398 },
18
+ { name: "Group D", value: 9800 },
19
+ ];
20
+
21
+ const colors1 = ["#0088FE", "#00C49F", "#FFBB28", "#FF8042"];
22
+ const colors2 = ["#721C24", "#D33F6A", "#FFC0CB", "#341F97"];
23
+
24
+ export default {
25
+ title: "Charts/PieChart",
26
+ component: PieChart,
27
+ argTypes: {
28
+ title: {
29
+ control: "text",
30
+ description: "Title of the chart",
31
+ },
32
+ titleSx: {
33
+ control: "object",
34
+ description: "Styling for the title",
35
+ },
36
+ width: {
37
+ control: "number",
38
+ description: "Width of the chart",
39
+ },
40
+ height: {
41
+ control: "number",
42
+ description: "Height of the chart",
43
+ },
44
+ margin: {
45
+ control: "object",
46
+ description: "Margin around the chart",
47
+ },
48
+ showToolTip: {
49
+ control: "boolean",
50
+ description: "Toggle tooltip visibility",
51
+ },
52
+ showLegend: {
53
+ control: "boolean",
54
+ description: "Toggle legend visibility",
55
+ },
56
+ legendSx: {
57
+ control: "object",
58
+ description: "Styling for the legend",
59
+ },
60
+ containerSx: {
61
+ control: "object",
62
+ description: "Styling for the container",
63
+ },
64
+ pie1: {
65
+ control: "object",
66
+ description: "Configuration for the first pie",
67
+ },
68
+ pie2: {
69
+ control: "object",
70
+ description: "Configuration for the second pie",
71
+ },
72
+ pieChartStyle: {
73
+ control: "object",
74
+ description: "Styling for the bar chart",
75
+ },
76
+ },
77
+ } as Meta<typeof PieChart>;
78
+
79
+ export const Default = {
80
+ render: (args: PieChartProps) => <PieChart {...args} />,
81
+ args: {
82
+ title: "Pie Chart Example",
83
+ width: 500,
84
+ height: 500,
85
+ showToolTip: true,
86
+ showLegend: true,
87
+ pie1: {
88
+ data: pieData1,
89
+ dataKey: "value",
90
+ outerRadius: 80,
91
+ fill: "#8884d8",
92
+ colors: colors1,
93
+ },
94
+ pie2: {
95
+ data: pieData2,
96
+ dataKey: "value",
97
+ innerRadius: 90,
98
+ outerRadius: 120,
99
+ fill: "#82ca9d",
100
+ label: true,
101
+ colors: colors2,
102
+ },
103
+ legendSx: {
104
+ layout: "horizontal",
105
+ align: "center",
106
+ verticalAlign: "bottom",
107
+ },
108
+ containerSx: { padding: 2 },
109
+ margin: { top: 20, right: 20, bottom: 20, left: 20 },
110
+ },
111
+ };
112
+
113
+ export const SinglePie = {
114
+ render: (args: PieChartProps) => <PieChart {...args} />,
115
+ args: {
116
+ title: "Single Pie Chart Example",
117
+ width: 500,
118
+ height: 500,
119
+ showToolTip: true,
120
+ showLegend: true,
121
+ pie1: {
122
+ data: pieData1,
123
+ dataKey: "value",
124
+ outerRadius: 100,
125
+ fill: "#8884d8",
126
+ label: true,
127
+ colors: ["#8884d8", "#83a6ed", "#8dd1e1", "#82ca9d"],
128
+ },
129
+ legendSx: {
130
+ layout: "horizontal",
131
+ align: "center",
132
+ verticalAlign: "bottom",
133
+ },
134
+ containerSx: { border: "1px solid black", padding: 2 },
135
+ margin: { top: 20, right: 20, bottom: 20, left: 20 },
136
+ },
137
+ };