@campxdev/react-blueprint 1.1.8 → 1.1.9
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 -2
- package/src/AppContent.tsx +6 -6
- package/src/assets/fonts/heebo/index.ts +2 -2
- package/src/assets/fonts/poppins/index.ts +5 -5
- package/src/assets/images/gif/index.ts +4 -0
- package/src/assets/images/gif/upload-file.gif +0 -0
- package/src/assets/images/gif/uploading-file.gif +0 -0
- package/src/components/Assets/ErrorPages/InternalServerError.tsx +7 -7
- package/src/components/Assets/ErrorPages/NoInternetConnection.tsx +7 -7
- package/src/components/Assets/ErrorPages/NoItemFound.tsx +7 -7
- package/src/components/Assets/ErrorPages/PageNotFound.tsx +5 -5
- package/src/components/Assets/ErrorPages/UnAuthorized.tsx +6 -6
- package/src/components/Assets/ErrorPages/styles.tsx +15 -15
- package/src/components/Assets/Icons/IconComponents/AcademicIcon.tsx +7 -1
- package/src/components/Assets/Icons/IconComponents/ActiveDevicesIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/AdminIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/AdministratorIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/AlertFilledIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ArrowBackIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/AttachmentIcon.tsx +32 -0
- package/src/components/Assets/Icons/IconComponents/BulbIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CampxFullLogoIcon.tsx +3 -3
- package/src/components/Assets/Icons/IconComponents/CampxIcon.tsx +2 -2
- package/src/components/Assets/Icons/IconComponents/CareerIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CheckedCheckBoxIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CheckedRadioIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ClogWheelIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CollapseIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/CrossIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/DashBoardIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/DeleteIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/DeviceIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/DocumentIcon.tsx +52 -0
- package/src/components/Assets/Icons/IconComponents/DownloadIcon.tsx +52 -0
- package/src/components/Assets/Icons/IconComponents/EditIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ExamResultIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ExcelIcon.tsx +56 -0
- package/src/components/Assets/Icons/IconComponents/ExpandIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ExportIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/FilterIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/HelpIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/HomeIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ImageIcon.tsx +44 -0
- package/src/components/Assets/Icons/IconComponents/InfoFilledIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/InfoIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/InstitutionsIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/LeftIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/LocationIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/LogoutIcon.tsx +2 -2
- package/src/components/Assets/Icons/IconComponents/NavigationIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/NoteIcon.tsx +7 -1
- package/src/components/Assets/Icons/IconComponents/NotificationIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/PdfIcon.tsx +52 -0
- package/src/components/Assets/Icons/IconComponents/ProductFeaturesIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ProfileIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/RedirectIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/RedoIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/RightIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/SaveIcon.tsx +39 -39
- package/src/components/Assets/Icons/IconComponents/SearchIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ShareIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/SuccessFilledIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/TicketsIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/UncheckCheckBoxIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/UncheckedRadioIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/ViewIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/VisibiityOffIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/VisibilityIcon.tsx +1 -1
- package/src/components/Assets/Icons/IconComponents/WarningFilledIcon.tsx +1 -1
- package/src/components/Assets/Icons/Icons.tsx +12 -0
- package/src/components/Assets/export.ts +6 -6
- package/src/components/Charts/BarChart/BarChart.tsx +17 -19
- package/src/components/Charts/LineChart/LineChart.tsx +12 -14
- package/src/components/Charts/PieChart/PieChart.tsx +8 -8
- package/src/components/Charts/TreeMap/TreeMap.tsx +15 -15
- package/src/components/Charts/export.ts +4 -4
- package/src/components/Charts/types/types.ts +3 -3
- package/src/components/DataDisplay/Accordion/Accordion.tsx +2 -0
- package/src/components/DataDisplay/Avatar/Avatar.tsx +14 -3
- package/src/components/DataDisplay/Card/Card.tsx +18 -18
- package/src/components/DataDisplay/Card/styles.tsx +24 -25
- package/src/components/DataDisplay/Chips/Chips.tsx +14 -14
- package/src/components/DataDisplay/DataTable/DataTable.tsx +4 -1
- package/src/components/DataDisplay/DataTable/TablePagination.tsx +10 -10
- package/src/components/DataDisplay/SidePanel/SidePanel.tsx +1 -1
- package/src/components/DataDisplay/Typography/Typography.tsx +1 -1
- package/src/components/Feedback/Alert/Alert.tsx +8 -8
- package/src/components/Feedback/Snackbar/Snackbar.tsx +27 -27
- package/src/components/Feedback/Spinner/Spinner.tsx +2 -2
- package/src/components/Feedback/Tooltip/Tooltip.tsx +6 -6
- package/src/components/Feedback/Tutorial/Tutorial.tsx +45 -45
- package/src/components/Feedback/export.ts +5 -0
- package/src/components/Image/Image.tsx +8 -8
- package/src/components/Input/Button/Button.tsx +2 -2
- package/src/components/Input/DatePicker/DatePicker.tsx +18 -4
- package/src/components/Input/FormActions/FormActions.tsx +15 -4
- package/src/components/Input/FormControlWrapper/FormControlWrapper.tsx +20 -5
- package/src/components/Input/HelpButton/HelpButton.stories.tsx +9 -9
- package/src/components/Input/HelpButton/HelpButton.tsx +4 -4
- package/src/components/Input/IconButtons/IconButtons/DeleteButton.tsx +2 -2
- package/src/components/Input/IconButtons/IconButtons/EditButton.tsx +2 -2
- package/src/components/Input/IconButtons/IconButtons/RedirectButton.tsx +2 -2
- package/src/components/Input/IconButtons/IconButtons/ViewButton.tsx +2 -2
- package/src/components/Input/LabelWrapper/LabelWrapper.tsx +5 -5
- package/src/components/Input/MultiCheckBox/MultiCheckBox.tsx +6 -6
- package/src/components/Input/OtpInput/OtpInput.tsx +17 -17
- package/src/components/Input/PasswordField/PasswordField.tsx +8 -8
- package/src/components/Input/RadioGroup/RadioGroup.tsx +5 -5
- package/src/components/Input/SearchBar/SearchBar.tsx +20 -20
- package/src/components/Input/SingleCheckBox/SIngleCheckBox.tsx +5 -5
- package/src/components/Input/SingleSelect/SingleSelect.tsx +39 -6
- package/src/components/Input/Switch/Switch.tsx +1 -1
- package/src/components/Input/TextField/TextField.tsx +3 -3
- package/src/components/Input/TimePicker/TimePicker.tsx +18 -4
- package/src/components/Input/components/FetchingOptionsLoader.tsx +3 -3
- package/src/components/Input/styles.tsx +6 -6
- package/src/components/Layout/AppHeader/AppHeader.tsx +10 -12
- package/src/components/Layout/AppHeader/AppHeaderActions/CogWheelMenu.tsx +5 -5
- package/src/components/Layout/AppHeader/AppHeaderActions/HeaderActions.tsx +6 -6
- package/src/components/Layout/AppHeader/AppHeaderActions/SwitchInstitution.tsx +37 -37
- package/src/components/Layout/AppHeader/AppHeaderActions/UserBox.tsx +28 -28
- package/src/components/Layout/AppHeader/styles/styles.tsx +24 -24
- package/src/components/Layout/PageHeader/PageHeader.tsx +8 -3
- package/src/components/Layout/TabsLayout/Tabs.tsx +16 -16
- package/src/components/Layout/TabsLayout/TabsLayout.tsx +6 -6
- package/src/components/Layout/export.ts +4 -0
- package/src/components/Navigation/Breadcrumbs/Breadcrumbs.tsx +35 -23
- package/src/components/Navigation/ConfirmDialog/ConfirmDialog.tsx +43 -48
- package/src/components/Navigation/Dialog/Dialog.tsx +33 -0
- package/src/components/Navigation/DialogButton/DialogButton.tsx +17 -81
- package/src/components/Navigation/DropDownMenu/DropDownButton.tsx +4 -4
- package/src/components/Navigation/DropDownMenu/DropDownIcon.tsx +4 -4
- package/src/components/Navigation/DropDownMenu/DropDownMenu.tsx +8 -8
- package/src/components/Navigation/DropDownMenu/DropdownMenuItem.tsx +3 -3
- package/src/components/Navigation/DropDownMenu/styles.tsx +13 -13
- package/src/components/Navigation/PreviewFiles/PreviewFiles.tsx +165 -0
- package/src/components/Navigation/Sidebar/Components.tsx +18 -18
- package/src/components/Navigation/Sidebar/MenuItem.tsx +1 -1
- package/src/components/Navigation/Sidebar/SubMenuItem.tsx +2 -1
- package/src/components/Navigation/Sidebar/interfaces.ts +1 -1
- package/src/components/Navigation/Sidebar/styles.tsx +64 -64
- package/src/components/Navigation/Stepper/Stepper.tsx +5 -5
- package/src/components/Navigation/Stepper/StepperComponents.tsx +15 -15
- package/src/components/Navigation/TabsContainer/TabsContainer.tsx +4 -4
- package/src/components/Navigation/UploadDialog/LoadingUploadDialogContainer.tsx +23 -0
- package/src/components/Navigation/UploadDialog/Styles.tsx +34 -0
- package/src/components/Navigation/UploadDialog/UploadDialog.tsx +143 -0
- package/src/components/Navigation/UploadDialog/UploadDialogContainer.tsx +82 -0
- package/src/components/Navigation/{exports.ts → export.ts} +4 -0
- package/src/components/export.ts +7 -7
- package/src/index.tsx +2 -2
- package/src/store/activeStore.ts +1 -1
- package/src/stories/Assets/Icons.stories.tsx +6 -6
- package/src/stories/Charts/BarChart.stories.tsx +56 -56
- package/src/stories/Charts/LineChart.stories.tsx +49 -49
- package/src/stories/Charts/PieChart.stories.tsx +53 -53
- package/src/stories/Charts/Treemap.stories.tsx +122 -122
- package/src/stories/DataDisplay/AccordionGroup.stories.tsx +11 -12
- package/src/stories/DataDisplay/Card.stories.tsx +34 -34
- package/src/stories/DataDisplay/Chips.stories.tsx +10 -10
- package/src/stories/DataDisplay/CircularAvatar.stories.tsx +6 -6
- package/src/stories/DataDisplay/DataTable.stories.tsx +32 -32
- package/src/stories/DataDisplay/SidePanel.stories.tsx +14 -14
- package/src/stories/DataDisplay/SquareAvatar.stories.tsx +15 -15
- package/src/stories/DesignSystem/colorTokens.stories.tsx +10 -10
- package/src/stories/DesignSystem/typography.stories.tsx +19 -19
- package/src/stories/Feedback/Alert.stories.tsx +9 -9
- package/src/stories/Feedback/Snackbar.stories.tsx +11 -11
- package/src/stories/Feedback/Spinner.stories.tsx +4 -4
- package/src/stories/Feedback/Tooltip.stories.tsx +5 -5
- package/src/stories/Feedback/Tutorial.stories.tsx +13 -13
- package/src/stories/Input/Button.stories.tsx +26 -26
- package/src/stories/Input/DatePicker.stories.tsx +48 -8
- package/src/stories/Input/IconButtons.stories.tsx +6 -6
- package/src/stories/Input/MultiCheckBox.stories.tsx +15 -15
- package/src/stories/Input/OtpInput.stories.tsx +5 -5
- package/src/stories/Input/Password.stories.tsx +7 -7
- package/src/stories/Input/RadioGroup.stories.tsx +14 -14
- package/src/stories/Input/SearchBar.stories.tsx +10 -10
- package/src/stories/Input/SingleCheckBox.stories.tsx +7 -7
- package/src/stories/Input/SingleSelect.stories.tsx +47 -47
- package/src/stories/Input/Switch.stories.tsx +22 -22
- package/src/stories/Input/TextField.stories.tsx +47 -47
- package/src/stories/Input/TimePicker.stories.tsx +44 -7
- package/src/stories/Layout/AppHeader.stories.tsx +13 -13
- package/src/stories/Layout/TabsLayout.stories.tsx +24 -24
- package/src/stories/Navigation/ConfirmDialog.stories.tsx +12 -2
- package/src/stories/Navigation/DialogButton.stories.tsx +38 -45
- package/src/stories/Navigation/DropDownMenu.stories.tsx +24 -24
- package/src/stories/Navigation/FloatingSidebar.stories.tsx +23 -23
- package/src/stories/Navigation/ImportDialog.stories.tsx +45 -0
- package/src/stories/Navigation/PreviewFiles.stories.tsx +80 -0
- package/src/stories/Navigation/Stepper.stories.tsx +15 -15
- package/src/stories/Navigation/TabsContainer.stories.tsx +11 -11
- package/src/themes/MuiThemeProvider.tsx +3 -3
- package/src/themes/colorTokens/colorPalette.tsx +38 -38
- package/src/themes/colorTokens/darkColorTokens.tsx +1 -1
- package/src/themes/colorTokens/lightColorTokens.ts +1 -1
- package/src/themes/commonTheme.ts +13 -3
- package/src/themes/customCssBaseline.ts +2 -2
- package/src/themes/darkTheme.ts +4 -4
- package/src/themes/export.ts +3 -3
- package/src/themes/lightTheme.ts +4 -4
- package/src/utils/constants.ts +5 -5
- package/src/utils/logout.ts +8 -8
- package/src/components/Feedback/exports.ts +0 -5
- package/src/components/Layout/exports.ts +0 -4
- package/src/stories/Navigation/Breadcrumbs.stories.tsx +0 -34
- package/src/utils/campxAxios.ts +0 -18
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Import React and other necessary elements
|
|
2
|
-
import { Stack } from
|
|
3
|
-
import { Meta, StoryObj } from
|
|
4
|
-
import { Icons } from
|
|
2
|
+
import { Stack } from '@mui/material';
|
|
3
|
+
import { Meta, StoryObj } from '@storybook/react/*';
|
|
4
|
+
import { Icons } from '../../components/Assets/Icons/Icons';
|
|
5
5
|
|
|
6
6
|
const IconsStory = () => {
|
|
7
7
|
return (
|
|
8
|
-
<Stack gap={2} direction={
|
|
8
|
+
<Stack gap={2} direction={'row'}>
|
|
9
9
|
{Object.values(Icons).map((Icon) => (
|
|
10
10
|
<Icon />
|
|
11
11
|
))}
|
|
@@ -14,9 +14,9 @@ const IconsStory = () => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
|
-
title:
|
|
17
|
+
title: 'Assets/Icons',
|
|
18
18
|
component: IconsStory,
|
|
19
|
-
tags: [
|
|
19
|
+
tags: ['autodocs'],
|
|
20
20
|
argTypes: {},
|
|
21
21
|
} as Meta<typeof IconsStory>;
|
|
22
22
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Meta } from
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
2
|
import {
|
|
3
3
|
BarChart,
|
|
4
4
|
BarChartProps,
|
|
5
|
-
} from
|
|
5
|
+
} from '../../components/Charts/BarChart/BarChart';
|
|
6
6
|
|
|
7
7
|
const data = [
|
|
8
8
|
{
|
|
9
|
-
name:
|
|
9
|
+
name: 'Page A',
|
|
10
10
|
uv: 4000,
|
|
11
11
|
pv: 2400,
|
|
12
12
|
amt: 2400,
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
|
-
name:
|
|
15
|
+
name: 'Page B',
|
|
16
16
|
uv: 3000,
|
|
17
17
|
pv: 1398,
|
|
18
18
|
amt: 2210,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
|
-
name:
|
|
21
|
+
name: 'Page C',
|
|
22
22
|
uv: 2000,
|
|
23
23
|
pv: 9800,
|
|
24
24
|
amt: 2290,
|
|
@@ -26,93 +26,93 @@ const data = [
|
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
const bars = [
|
|
29
|
-
{ dataKey:
|
|
30
|
-
{ dataKey:
|
|
31
|
-
{ dataKey:
|
|
29
|
+
{ dataKey: 'uv', stackId: 'a', fill: '#0088FE' },
|
|
30
|
+
{ dataKey: 'pv', stackId: 'a', fill: '#00C49F' },
|
|
31
|
+
{ dataKey: 'amt', stackId: 'b', fill: '#FFBB28' },
|
|
32
32
|
];
|
|
33
33
|
|
|
34
34
|
export default {
|
|
35
|
-
title:
|
|
35
|
+
title: 'Charts/BarChart',
|
|
36
36
|
component: BarChart,
|
|
37
37
|
argTypes: {
|
|
38
38
|
title: {
|
|
39
|
-
control:
|
|
40
|
-
description:
|
|
39
|
+
control: 'text',
|
|
40
|
+
description: 'Title of the chart',
|
|
41
41
|
},
|
|
42
42
|
titleSx: {
|
|
43
|
-
control:
|
|
44
|
-
description:
|
|
43
|
+
control: 'object',
|
|
44
|
+
description: 'Styling for the title',
|
|
45
45
|
},
|
|
46
46
|
width: {
|
|
47
|
-
control:
|
|
48
|
-
description:
|
|
47
|
+
control: 'number',
|
|
48
|
+
description: 'Width of the chart',
|
|
49
49
|
},
|
|
50
50
|
height: {
|
|
51
|
-
control:
|
|
52
|
-
description:
|
|
51
|
+
control: 'number',
|
|
52
|
+
description: 'Height of the chart',
|
|
53
53
|
},
|
|
54
54
|
margin: {
|
|
55
|
-
control:
|
|
56
|
-
description:
|
|
55
|
+
control: 'object',
|
|
56
|
+
description: 'Margin around the chart',
|
|
57
57
|
},
|
|
58
58
|
showToolTip: {
|
|
59
|
-
control:
|
|
60
|
-
description:
|
|
59
|
+
control: 'boolean',
|
|
60
|
+
description: 'Toggle tooltip visibility',
|
|
61
61
|
},
|
|
62
62
|
showLegend: {
|
|
63
|
-
control:
|
|
64
|
-
description:
|
|
63
|
+
control: 'boolean',
|
|
64
|
+
description: 'Toggle legend visibility',
|
|
65
65
|
},
|
|
66
66
|
legendSx: {
|
|
67
|
-
control:
|
|
68
|
-
description:
|
|
67
|
+
control: 'object',
|
|
68
|
+
description: 'Styling for the legend',
|
|
69
69
|
},
|
|
70
70
|
containerSx: {
|
|
71
|
-
control:
|
|
72
|
-
description:
|
|
71
|
+
control: 'object',
|
|
72
|
+
description: 'Styling for the container',
|
|
73
73
|
},
|
|
74
74
|
dataKey: {
|
|
75
|
-
control:
|
|
76
|
-
description:
|
|
75
|
+
control: 'text',
|
|
76
|
+
description: 'Key for the X axis',
|
|
77
77
|
},
|
|
78
78
|
data: {
|
|
79
|
-
control:
|
|
80
|
-
description:
|
|
79
|
+
control: 'object',
|
|
80
|
+
description: 'Data for the chart',
|
|
81
81
|
},
|
|
82
82
|
bars: {
|
|
83
|
-
control:
|
|
84
|
-
description:
|
|
83
|
+
control: 'object',
|
|
84
|
+
description: 'Bars configuration',
|
|
85
85
|
},
|
|
86
86
|
cartesianGrid: {
|
|
87
|
-
control:
|
|
88
|
-
description:
|
|
87
|
+
control: 'object',
|
|
88
|
+
description: 'Configuration for the Cartesian grid',
|
|
89
89
|
},
|
|
90
90
|
axisLabelProps: {
|
|
91
|
-
control:
|
|
92
|
-
description:
|
|
91
|
+
control: 'object',
|
|
92
|
+
description: 'Labels for the axes',
|
|
93
93
|
},
|
|
94
94
|
axisStroke: {
|
|
95
|
-
control:
|
|
96
|
-
description:
|
|
95
|
+
control: 'color',
|
|
96
|
+
description: 'Stroke color for the axes',
|
|
97
97
|
},
|
|
98
98
|
barGap: {
|
|
99
|
-
control:
|
|
100
|
-
description:
|
|
99
|
+
control: 'number',
|
|
100
|
+
description: 'Gap between bars',
|
|
101
101
|
},
|
|
102
102
|
barSize: {
|
|
103
|
-
control:
|
|
104
|
-
description:
|
|
103
|
+
control: 'number',
|
|
104
|
+
description: 'Size of the bars',
|
|
105
105
|
},
|
|
106
106
|
barChartStyle: {
|
|
107
|
-
control:
|
|
108
|
-
description:
|
|
107
|
+
control: 'object',
|
|
108
|
+
description: 'Styling for the bar chart',
|
|
109
109
|
},
|
|
110
110
|
layout: {
|
|
111
111
|
control: {
|
|
112
|
-
type:
|
|
113
|
-
options: [
|
|
112
|
+
type: 'radio',
|
|
113
|
+
options: ['horizontal', 'vertical'],
|
|
114
114
|
},
|
|
115
|
-
description:
|
|
115
|
+
description: 'Layout of the chart',
|
|
116
116
|
},
|
|
117
117
|
},
|
|
118
118
|
} as Meta<typeof BarChart>;
|
|
@@ -122,20 +122,20 @@ export const Default = {
|
|
|
122
122
|
args: {
|
|
123
123
|
data: data,
|
|
124
124
|
bars: bars,
|
|
125
|
-
dataKey:
|
|
126
|
-
containerSx: { width:
|
|
125
|
+
dataKey: 'name',
|
|
126
|
+
containerSx: { width: '800px', height: '800px' },
|
|
127
127
|
cartesianGrid: { showCartesianGrid: true, size: 5 },
|
|
128
128
|
axisLabelProps: {
|
|
129
|
-
xLabel: { value:
|
|
130
|
-
yLabel: { value:
|
|
129
|
+
xLabel: { value: 'X-Axis', dy: 20 },
|
|
130
|
+
yLabel: { value: 'Y-Axis', dx: -20, angle: -90 },
|
|
131
131
|
},
|
|
132
132
|
legendSx: {
|
|
133
133
|
width: 150,
|
|
134
134
|
height: 150,
|
|
135
|
-
layout:
|
|
136
|
-
align:
|
|
137
|
-
verticalAlign:
|
|
138
|
-
iconType:
|
|
135
|
+
layout: 'vertical',
|
|
136
|
+
align: 'right',
|
|
137
|
+
verticalAlign: 'top',
|
|
138
|
+
iconType: 'line',
|
|
139
139
|
},
|
|
140
140
|
margin: { top: 20, left: 30, bottom: 20, right: 30 },
|
|
141
141
|
},
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { Meta } from
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
2
|
import {
|
|
3
3
|
LineChart,
|
|
4
4
|
LineChartProps,
|
|
5
|
-
} from
|
|
5
|
+
} from '../../components/Charts/LineChart/LineChart';
|
|
6
6
|
|
|
7
7
|
const data = [
|
|
8
|
-
{ name:
|
|
9
|
-
{ name:
|
|
10
|
-
{ name:
|
|
11
|
-
{ name:
|
|
12
|
-
{ name:
|
|
13
|
-
{ name:
|
|
14
|
-
{ name:
|
|
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
15
|
];
|
|
16
16
|
|
|
17
17
|
const lines = [
|
|
18
|
-
{ type:
|
|
19
|
-
{ type:
|
|
18
|
+
{ type: 'monotone', dataKey: 'uv', stroke: '#8884d8' },
|
|
19
|
+
{ type: 'monotone', dataKey: 'pv', stroke: '#82ca9d' },
|
|
20
20
|
];
|
|
21
21
|
|
|
22
22
|
export default {
|
|
23
|
-
title:
|
|
23
|
+
title: 'Charts/LineChart',
|
|
24
24
|
component: LineChart,
|
|
25
25
|
argTypes: {
|
|
26
26
|
title: {
|
|
27
|
-
control:
|
|
28
|
-
description:
|
|
27
|
+
control: 'text',
|
|
28
|
+
description: 'Title of the chart',
|
|
29
29
|
},
|
|
30
30
|
titleSx: {
|
|
31
|
-
control:
|
|
32
|
-
description:
|
|
31
|
+
control: 'object',
|
|
32
|
+
description: 'Styling for the title',
|
|
33
33
|
},
|
|
34
34
|
width: {
|
|
35
|
-
control:
|
|
36
|
-
description:
|
|
35
|
+
control: 'number',
|
|
36
|
+
description: 'Width of the chart',
|
|
37
37
|
},
|
|
38
38
|
height: {
|
|
39
|
-
control:
|
|
40
|
-
description:
|
|
39
|
+
control: 'number',
|
|
40
|
+
description: 'Height of the chart',
|
|
41
41
|
},
|
|
42
42
|
margin: {
|
|
43
|
-
control:
|
|
44
|
-
description:
|
|
43
|
+
control: 'object',
|
|
44
|
+
description: 'Margin around the chart',
|
|
45
45
|
},
|
|
46
46
|
showToolTip: {
|
|
47
|
-
control:
|
|
48
|
-
description:
|
|
47
|
+
control: 'boolean',
|
|
48
|
+
description: 'Toggle tooltip visibility',
|
|
49
49
|
},
|
|
50
50
|
showLegend: {
|
|
51
|
-
control:
|
|
52
|
-
description:
|
|
51
|
+
control: 'boolean',
|
|
52
|
+
description: 'Toggle legend visibility',
|
|
53
53
|
},
|
|
54
54
|
legendSx: {
|
|
55
|
-
control:
|
|
56
|
-
description:
|
|
55
|
+
control: 'object',
|
|
56
|
+
description: 'Styling for the legend',
|
|
57
57
|
},
|
|
58
58
|
containerSx: {
|
|
59
|
-
control:
|
|
60
|
-
description:
|
|
59
|
+
control: 'object',
|
|
60
|
+
description: 'Styling for the container',
|
|
61
61
|
},
|
|
62
62
|
dataKey: {
|
|
63
|
-
control:
|
|
64
|
-
description:
|
|
63
|
+
control: 'text',
|
|
64
|
+
description: 'Key for the X axis',
|
|
65
65
|
},
|
|
66
66
|
data: {
|
|
67
|
-
control:
|
|
68
|
-
description:
|
|
67
|
+
control: 'object',
|
|
68
|
+
description: 'Data for the chart',
|
|
69
69
|
},
|
|
70
70
|
lines: {
|
|
71
|
-
control:
|
|
72
|
-
description:
|
|
71
|
+
control: 'object',
|
|
72
|
+
description: 'Lines configuration',
|
|
73
73
|
},
|
|
74
74
|
cartesianGrid: {
|
|
75
|
-
control:
|
|
76
|
-
description:
|
|
75
|
+
control: 'object',
|
|
76
|
+
description: 'Configuration for the Cartesian grid',
|
|
77
77
|
},
|
|
78
78
|
axisLabelProps: {
|
|
79
|
-
control:
|
|
80
|
-
description:
|
|
79
|
+
control: 'object',
|
|
80
|
+
description: 'Labels for the axes',
|
|
81
81
|
},
|
|
82
82
|
lineChartStyle: {
|
|
83
|
-
control:
|
|
84
|
-
description:
|
|
83
|
+
control: 'object',
|
|
84
|
+
description: 'Styling for the bar chart',
|
|
85
85
|
},
|
|
86
86
|
},
|
|
87
87
|
} as Meta<typeof LineChart>;
|
|
@@ -89,23 +89,23 @@ export default {
|
|
|
89
89
|
export const Default = {
|
|
90
90
|
render: (args: LineChartProps) => <LineChart {...args} />,
|
|
91
91
|
args: {
|
|
92
|
-
title:
|
|
92
|
+
title: 'Line Chart Example',
|
|
93
93
|
width: 700,
|
|
94
94
|
height: 500,
|
|
95
95
|
showToolTip: true,
|
|
96
96
|
showLegend: true,
|
|
97
|
-
dataKey:
|
|
97
|
+
dataKey: 'name',
|
|
98
98
|
data: data,
|
|
99
99
|
lines: lines,
|
|
100
100
|
cartesianGrid: { showCartesianGrid: true, size: 3 },
|
|
101
101
|
axisLabelProps: {
|
|
102
|
-
xLabel: { value:
|
|
103
|
-
yLabel: { value:
|
|
102
|
+
xLabel: { value: 'Pages', dy: 20 },
|
|
103
|
+
yLabel: { value: 'Values', dx: -10, angle: -90 },
|
|
104
104
|
},
|
|
105
105
|
legendSx: {
|
|
106
|
-
layout:
|
|
107
|
-
align:
|
|
108
|
-
verticalAlign:
|
|
106
|
+
layout: 'horizontal',
|
|
107
|
+
align: 'center',
|
|
108
|
+
verticalAlign: 'top',
|
|
109
109
|
},
|
|
110
110
|
margin: { top: 30, right: 20, bottom: 30, left: 20 },
|
|
111
111
|
},
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { Meta } from
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
2
|
import {
|
|
3
3
|
PieChart,
|
|
4
4
|
PieChartProps,
|
|
5
|
-
} from
|
|
5
|
+
} from '../../components/Charts/PieChart/PieChart';
|
|
6
6
|
|
|
7
7
|
const pieData1 = [
|
|
8
|
-
{ name:
|
|
9
|
-
{ name:
|
|
10
|
-
{ name:
|
|
11
|
-
{ name:
|
|
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
12
|
];
|
|
13
13
|
|
|
14
14
|
const pieData2 = [
|
|
15
|
-
{ name:
|
|
16
|
-
{ name:
|
|
17
|
-
{ name:
|
|
18
|
-
{ name:
|
|
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
19
|
];
|
|
20
20
|
|
|
21
|
-
const colors1 = [
|
|
22
|
-
const colors2 = [
|
|
21
|
+
const colors1 = ['#0088FE', '#00C49F', '#FFBB28', '#FF8042'];
|
|
22
|
+
const colors2 = ['#721C24', '#D33F6A', '#FFC0CB', '#341F97'];
|
|
23
23
|
|
|
24
24
|
export default {
|
|
25
|
-
title:
|
|
25
|
+
title: 'Charts/PieChart',
|
|
26
26
|
component: PieChart,
|
|
27
27
|
argTypes: {
|
|
28
28
|
title: {
|
|
29
|
-
control:
|
|
30
|
-
description:
|
|
29
|
+
control: 'text',
|
|
30
|
+
description: 'Title of the chart',
|
|
31
31
|
},
|
|
32
32
|
titleSx: {
|
|
33
|
-
control:
|
|
34
|
-
description:
|
|
33
|
+
control: 'object',
|
|
34
|
+
description: 'Styling for the title',
|
|
35
35
|
},
|
|
36
36
|
width: {
|
|
37
|
-
control:
|
|
38
|
-
description:
|
|
37
|
+
control: 'number',
|
|
38
|
+
description: 'Width of the chart',
|
|
39
39
|
},
|
|
40
40
|
height: {
|
|
41
|
-
control:
|
|
42
|
-
description:
|
|
41
|
+
control: 'number',
|
|
42
|
+
description: 'Height of the chart',
|
|
43
43
|
},
|
|
44
44
|
margin: {
|
|
45
|
-
control:
|
|
46
|
-
description:
|
|
45
|
+
control: 'object',
|
|
46
|
+
description: 'Margin around the chart',
|
|
47
47
|
},
|
|
48
48
|
showToolTip: {
|
|
49
|
-
control:
|
|
50
|
-
description:
|
|
49
|
+
control: 'boolean',
|
|
50
|
+
description: 'Toggle tooltip visibility',
|
|
51
51
|
},
|
|
52
52
|
showLegend: {
|
|
53
|
-
control:
|
|
54
|
-
description:
|
|
53
|
+
control: 'boolean',
|
|
54
|
+
description: 'Toggle legend visibility',
|
|
55
55
|
},
|
|
56
56
|
legendSx: {
|
|
57
|
-
control:
|
|
58
|
-
description:
|
|
57
|
+
control: 'object',
|
|
58
|
+
description: 'Styling for the legend',
|
|
59
59
|
},
|
|
60
60
|
containerSx: {
|
|
61
|
-
control:
|
|
62
|
-
description:
|
|
61
|
+
control: 'object',
|
|
62
|
+
description: 'Styling for the container',
|
|
63
63
|
},
|
|
64
64
|
pie1: {
|
|
65
|
-
control:
|
|
66
|
-
description:
|
|
65
|
+
control: 'object',
|
|
66
|
+
description: 'Configuration for the first pie',
|
|
67
67
|
},
|
|
68
68
|
pie2: {
|
|
69
|
-
control:
|
|
70
|
-
description:
|
|
69
|
+
control: 'object',
|
|
70
|
+
description: 'Configuration for the second pie',
|
|
71
71
|
},
|
|
72
72
|
pieChartStyle: {
|
|
73
|
-
control:
|
|
74
|
-
description:
|
|
73
|
+
control: 'object',
|
|
74
|
+
description: 'Styling for the bar chart',
|
|
75
75
|
},
|
|
76
76
|
},
|
|
77
77
|
} as Meta<typeof PieChart>;
|
|
@@ -79,31 +79,31 @@ export default {
|
|
|
79
79
|
export const Default = {
|
|
80
80
|
render: (args: PieChartProps) => <PieChart {...args} />,
|
|
81
81
|
args: {
|
|
82
|
-
title:
|
|
82
|
+
title: 'Pie Chart Example',
|
|
83
83
|
width: 500,
|
|
84
84
|
height: 500,
|
|
85
85
|
showToolTip: true,
|
|
86
86
|
showLegend: true,
|
|
87
87
|
pie1: {
|
|
88
88
|
data: pieData1,
|
|
89
|
-
dataKey:
|
|
89
|
+
dataKey: 'value',
|
|
90
90
|
outerRadius: 80,
|
|
91
|
-
fill:
|
|
91
|
+
fill: '#8884d8',
|
|
92
92
|
colors: colors1,
|
|
93
93
|
},
|
|
94
94
|
pie2: {
|
|
95
95
|
data: pieData2,
|
|
96
|
-
dataKey:
|
|
96
|
+
dataKey: 'value',
|
|
97
97
|
innerRadius: 90,
|
|
98
98
|
outerRadius: 120,
|
|
99
|
-
fill:
|
|
99
|
+
fill: '#82ca9d',
|
|
100
100
|
label: true,
|
|
101
101
|
colors: colors2,
|
|
102
102
|
},
|
|
103
103
|
legendSx: {
|
|
104
|
-
layout:
|
|
105
|
-
align:
|
|
106
|
-
verticalAlign:
|
|
104
|
+
layout: 'horizontal',
|
|
105
|
+
align: 'center',
|
|
106
|
+
verticalAlign: 'bottom',
|
|
107
107
|
},
|
|
108
108
|
containerSx: { padding: 2 },
|
|
109
109
|
margin: { top: 20, right: 20, bottom: 20, left: 20 },
|
|
@@ -113,25 +113,25 @@ export const Default = {
|
|
|
113
113
|
export const SinglePie = {
|
|
114
114
|
render: (args: PieChartProps) => <PieChart {...args} />,
|
|
115
115
|
args: {
|
|
116
|
-
title:
|
|
116
|
+
title: 'Single Pie Chart Example',
|
|
117
117
|
width: 500,
|
|
118
118
|
height: 500,
|
|
119
119
|
showToolTip: true,
|
|
120
120
|
showLegend: true,
|
|
121
121
|
pie1: {
|
|
122
122
|
data: pieData1,
|
|
123
|
-
dataKey:
|
|
123
|
+
dataKey: 'value',
|
|
124
124
|
outerRadius: 100,
|
|
125
|
-
fill:
|
|
125
|
+
fill: '#8884d8',
|
|
126
126
|
label: true,
|
|
127
|
-
colors: [
|
|
127
|
+
colors: ['#8884d8', '#83a6ed', '#8dd1e1', '#82ca9d'],
|
|
128
128
|
},
|
|
129
129
|
legendSx: {
|
|
130
|
-
layout:
|
|
131
|
-
align:
|
|
132
|
-
verticalAlign:
|
|
130
|
+
layout: 'horizontal',
|
|
131
|
+
align: 'center',
|
|
132
|
+
verticalAlign: 'bottom',
|
|
133
133
|
},
|
|
134
|
-
containerSx: { border:
|
|
134
|
+
containerSx: { border: '1px solid black', padding: 2 },
|
|
135
135
|
margin: { top: 20, right: 20, bottom: 20, left: 20 },
|
|
136
136
|
},
|
|
137
137
|
};
|