@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
|
@@ -26,15 +26,29 @@ export const Primary: Story = {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export const Secondary: Story = {
|
|
29
|
-
args: {
|
|
29
|
+
args: {
|
|
30
|
+
...Primary.args,
|
|
31
|
+
label: 'Date Picker (Full Month Text)',
|
|
32
|
+
format: 'dd MMMM yyyy',
|
|
33
|
+
},
|
|
30
34
|
};
|
|
31
35
|
|
|
32
36
|
export const Tertiary: Story = {
|
|
33
|
-
args: {
|
|
37
|
+
args: {
|
|
38
|
+
...Primary.args,
|
|
39
|
+
label: 'Just Month Year',
|
|
40
|
+
format: 'MMMM yyyy',
|
|
41
|
+
views: ['month', 'year'],
|
|
42
|
+
},
|
|
34
43
|
};
|
|
35
44
|
|
|
36
45
|
export const Quaternary: Story = {
|
|
37
|
-
args: {
|
|
46
|
+
args: {
|
|
47
|
+
...Primary.args,
|
|
48
|
+
label: 'Just Year',
|
|
49
|
+
format: 'yyyy',
|
|
50
|
+
views: ['year'],
|
|
51
|
+
},
|
|
38
52
|
};
|
|
39
53
|
|
|
40
54
|
export const WithShortcuts: Story = {
|
|
@@ -65,7 +79,12 @@ export const WithShortcuts: Story = {
|
|
|
65
79
|
};
|
|
66
80
|
|
|
67
81
|
export const WithDefaultValue: Story = {
|
|
68
|
-
args: {
|
|
82
|
+
args: {
|
|
83
|
+
...Primary.args,
|
|
84
|
+
label: 'With Default Value',
|
|
85
|
+
required: false,
|
|
86
|
+
value: new Date('2024/9/15'),
|
|
87
|
+
},
|
|
69
88
|
};
|
|
70
89
|
|
|
71
90
|
export const WithMinMaxDate: Story = {
|
|
@@ -79,7 +98,12 @@ export const WithMinMaxDate: Story = {
|
|
|
79
98
|
};
|
|
80
99
|
|
|
81
100
|
export const WithCustomIcon: Story = {
|
|
82
|
-
args: {
|
|
101
|
+
args: {
|
|
102
|
+
...Primary.args,
|
|
103
|
+
label: 'With Custom Icon',
|
|
104
|
+
required: false,
|
|
105
|
+
openPickerIcon: Icons.CareerIcon,
|
|
106
|
+
},
|
|
83
107
|
};
|
|
84
108
|
|
|
85
109
|
export const WithPlaceHolderHelperText: Story = {
|
|
@@ -93,11 +117,21 @@ export const WithPlaceHolderHelperText: Story = {
|
|
|
93
117
|
};
|
|
94
118
|
|
|
95
119
|
export const DisablePast: Story = {
|
|
96
|
-
args: {
|
|
120
|
+
args: {
|
|
121
|
+
...Primary.args,
|
|
122
|
+
label: 'Disable Past Dates',
|
|
123
|
+
required: false,
|
|
124
|
+
disablePast: true,
|
|
125
|
+
},
|
|
97
126
|
};
|
|
98
127
|
|
|
99
128
|
export const DisableFuture: Story = {
|
|
100
|
-
args: {
|
|
129
|
+
args: {
|
|
130
|
+
...Primary.args,
|
|
131
|
+
label: 'Disable Future Dates',
|
|
132
|
+
required: false,
|
|
133
|
+
disableFuture: true,
|
|
134
|
+
},
|
|
101
135
|
};
|
|
102
136
|
|
|
103
137
|
export const DisableSpecificDate: Story = {
|
|
@@ -134,5 +168,11 @@ export const DisableSpecificYear: Story = {
|
|
|
134
168
|
};
|
|
135
169
|
|
|
136
170
|
export const ReadOnly = {
|
|
137
|
-
args: {
|
|
171
|
+
args: {
|
|
172
|
+
...Primary.args,
|
|
173
|
+
label: 'Read Only',
|
|
174
|
+
required: false,
|
|
175
|
+
disabled: true,
|
|
176
|
+
value: new Date('2024/9/15'),
|
|
177
|
+
},
|
|
138
178
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Stack } from
|
|
2
|
-
import { Meta, StoryObj } from
|
|
3
|
-
import { IconButtons } from
|
|
1
|
+
import { Stack } from '@mui/material';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react/*';
|
|
3
|
+
import { IconButtons } from '../../components/Input/IconButtons/IconButtons';
|
|
4
4
|
|
|
5
5
|
const IconButtonsStory = () => {
|
|
6
6
|
return (
|
|
7
|
-
<Stack gap={2} direction={
|
|
7
|
+
<Stack gap={2} direction={'row'}>
|
|
8
8
|
{Object.values(IconButtons).map((IconButton) => (
|
|
9
9
|
<IconButton />
|
|
10
10
|
))}
|
|
@@ -13,9 +13,9 @@ const IconButtonsStory = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
|
-
title:
|
|
16
|
+
title: 'Input/IconButtons',
|
|
17
17
|
component: IconButtonsStory,
|
|
18
|
-
tags: [
|
|
18
|
+
tags: ['autodocs'],
|
|
19
19
|
argTypes: {},
|
|
20
20
|
} as Meta<typeof IconButtonsStory>;
|
|
21
21
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Meta, StoryFn } from
|
|
2
|
-
import { useState } from
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
MultiCheckBox,
|
|
5
5
|
MultiCheckboxProps,
|
|
6
|
-
} from
|
|
6
|
+
} from '../../components/Input/MultiCheckBox/MultiCheckBox';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
|
-
title:
|
|
9
|
+
title: 'Input/MultiCheckBox',
|
|
10
10
|
component: MultiCheckBox,
|
|
11
|
-
tags: [
|
|
11
|
+
tags: ['autodocs'],
|
|
12
12
|
argTypes: {},
|
|
13
13
|
} as Meta<typeof MultiCheckBox>;
|
|
14
14
|
|
|
@@ -27,23 +27,23 @@ const MultiCheckBoxStory: StoryFn<MultiCheckboxProps> = (args) => {
|
|
|
27
27
|
|
|
28
28
|
export const Default = MultiCheckBoxStory.bind({});
|
|
29
29
|
Default.args = {
|
|
30
|
-
label:
|
|
31
|
-
name:
|
|
30
|
+
label: 'First Name',
|
|
31
|
+
name: 'firstName',
|
|
32
32
|
options: [
|
|
33
33
|
{
|
|
34
|
-
label:
|
|
35
|
-
value:
|
|
34
|
+
label: 'Option 1',
|
|
35
|
+
value: 'value1',
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
label:
|
|
39
|
-
value:
|
|
38
|
+
label: 'Option 2',
|
|
39
|
+
value: 'value2',
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
label:
|
|
43
|
-
value:
|
|
42
|
+
label: 'Option 3',
|
|
43
|
+
value: 'value3',
|
|
44
44
|
},
|
|
45
45
|
],
|
|
46
46
|
required: true,
|
|
47
|
-
direction:
|
|
48
|
-
values: [
|
|
47
|
+
direction: 'row',
|
|
48
|
+
values: ['value2'],
|
|
49
49
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Meta } from
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
2
|
import OtpInput, {
|
|
3
3
|
OtpInputProps,
|
|
4
|
-
} from
|
|
4
|
+
} from '../../components/Input/OtpInput/OtpInput';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title:
|
|
7
|
+
title: 'Input/OtpInput',
|
|
8
8
|
component: OtpInput,
|
|
9
|
-
tags: [
|
|
9
|
+
tags: ['autodocs'],
|
|
10
10
|
argTypes: {},
|
|
11
11
|
} as Meta<typeof OtpInput>;
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ export const Default = {
|
|
|
15
15
|
args: {
|
|
16
16
|
length: 6,
|
|
17
17
|
onChangeOtp: (otp: string) => {
|
|
18
|
-
console.log(
|
|
18
|
+
console.log('OTP Value:', otp);
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { Meta } from
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
2
|
import {
|
|
3
3
|
PasswordField,
|
|
4
4
|
PasswordFieldProps,
|
|
5
|
-
} from
|
|
5
|
+
} from '../../components/Input/PasswordField/PasswordField';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
|
-
title:
|
|
8
|
+
title: 'Input/PasswordField',
|
|
9
9
|
component: PasswordField,
|
|
10
|
-
tags: [
|
|
10
|
+
tags: ['autodocs'],
|
|
11
11
|
argTypes: {},
|
|
12
12
|
} as Meta<typeof PasswordField>;
|
|
13
13
|
|
|
14
14
|
export const Default = {
|
|
15
15
|
render: (args: PasswordFieldProps) => <PasswordField {...args} />,
|
|
16
16
|
args: {
|
|
17
|
-
label:
|
|
17
|
+
label: 'Password',
|
|
18
18
|
required: true,
|
|
19
|
-
value:
|
|
20
|
-
helperText:
|
|
19
|
+
value: 'KAHPS9888B',
|
|
20
|
+
helperText: 'Password should be alpha-numeric with special character',
|
|
21
21
|
},
|
|
22
22
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// Import React and other necessary elements
|
|
2
2
|
|
|
3
|
-
import { Meta } from
|
|
3
|
+
import { Meta } from '@storybook/react';
|
|
4
4
|
import {
|
|
5
5
|
RadioGroup,
|
|
6
6
|
RadioGroupProps,
|
|
7
|
-
} from
|
|
7
|
+
} from '../../components/Input/RadioGroup/RadioGroup';
|
|
8
8
|
|
|
9
9
|
// Define the default export with Meta type including the component type
|
|
10
10
|
export default {
|
|
11
|
-
title:
|
|
11
|
+
title: 'Input/RadioGroup',
|
|
12
12
|
component: RadioGroup,
|
|
13
|
-
tags: [
|
|
13
|
+
tags: ['autodocs'],
|
|
14
14
|
argTypes: {},
|
|
15
15
|
} as Meta<typeof RadioGroup>;
|
|
16
16
|
|
|
@@ -18,27 +18,27 @@ export default {
|
|
|
18
18
|
export const Default = {
|
|
19
19
|
render: (args: RadioGroupProps) => <RadioGroup {...args} />,
|
|
20
20
|
args: {
|
|
21
|
-
label:
|
|
21
|
+
label: 'Radio',
|
|
22
22
|
options: [
|
|
23
23
|
{
|
|
24
|
-
label:
|
|
25
|
-
value:
|
|
24
|
+
label: 'Option 1',
|
|
25
|
+
value: '1',
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
label:
|
|
29
|
-
value:
|
|
28
|
+
label: 'Option 2',
|
|
29
|
+
value: '2',
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
label:
|
|
33
|
-
value:
|
|
32
|
+
label: 'Option 3',
|
|
33
|
+
value: '3',
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
label:
|
|
37
|
-
value:
|
|
36
|
+
label: 'Option 4',
|
|
37
|
+
value: '4',
|
|
38
38
|
},
|
|
39
39
|
],
|
|
40
40
|
onChange: (event: any, value: any) => {},
|
|
41
41
|
row: true,
|
|
42
|
-
defaultValue:
|
|
42
|
+
defaultValue: '3',
|
|
43
43
|
},
|
|
44
44
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Meta, StoryObj } from
|
|
2
|
-
import { SearchBar } from
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react/*';
|
|
2
|
+
import { SearchBar } from '../../components/Input/SearchBar/SearchBar';
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof SearchBar> = {
|
|
5
|
-
title:
|
|
5
|
+
title: 'Input/SearchBar',
|
|
6
6
|
component: SearchBar,
|
|
7
7
|
argTypes: {
|
|
8
8
|
placeholder: {
|
|
9
|
-
description:
|
|
9
|
+
description: 'The placeholder text',
|
|
10
10
|
},
|
|
11
11
|
label: {
|
|
12
|
-
description:
|
|
12
|
+
description: 'Can be a ReactNode or String',
|
|
13
13
|
},
|
|
14
14
|
value: {
|
|
15
|
-
description:
|
|
15
|
+
description: 'Current value of the search input.',
|
|
16
16
|
},
|
|
17
17
|
onSearch: {
|
|
18
|
-
description:
|
|
18
|
+
description: 'Function to handle search',
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
};
|
|
@@ -32,20 +32,20 @@ export const Primary: Story = {
|
|
|
32
32
|
export const WithPlaceHolder: Story = {
|
|
33
33
|
args: {
|
|
34
34
|
...Primary.args,
|
|
35
|
-
placeholder:
|
|
35
|
+
placeholder: 'Search By Name/Email',
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
export const WithLabel: Story = {
|
|
40
40
|
args: {
|
|
41
41
|
...Primary.args,
|
|
42
|
-
label:
|
|
42
|
+
label: 'Searching Students',
|
|
43
43
|
},
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
export const WithValue: Story = {
|
|
47
47
|
args: {
|
|
48
48
|
...WithLabel.args,
|
|
49
|
-
value:
|
|
49
|
+
value: 'Chrome',
|
|
50
50
|
},
|
|
51
51
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Meta, StoryFn } from
|
|
2
|
-
import { useState } from
|
|
1
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
CheckboxProps,
|
|
5
5
|
SingleCheckBox,
|
|
6
|
-
} from
|
|
6
|
+
} from '../../components/Input/SingleCheckBox/SIngleCheckBox';
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
|
-
title:
|
|
9
|
+
title: 'Input/SingleCheckBox',
|
|
10
10
|
component: SingleCheckBox,
|
|
11
|
-
tags: [
|
|
11
|
+
tags: ['autodocs'],
|
|
12
12
|
argTypes: {},
|
|
13
13
|
} as Meta<typeof SingleCheckBox>;
|
|
14
14
|
|
|
@@ -27,8 +27,8 @@ const SingleCheckBoxStory: StoryFn<CheckboxProps> = (args) => {
|
|
|
27
27
|
|
|
28
28
|
export const Default = SingleCheckBoxStory.bind({});
|
|
29
29
|
Default.args = {
|
|
30
|
-
label:
|
|
30
|
+
label: 'First Name',
|
|
31
31
|
required: true,
|
|
32
|
-
value:
|
|
32
|
+
value: 'ok',
|
|
33
33
|
onChange: (event: any) => {},
|
|
34
34
|
};
|
|
@@ -1,81 +1,81 @@
|
|
|
1
1
|
// Import React and other necessary elements
|
|
2
|
-
import { Meta } from
|
|
2
|
+
import { Meta } from '@storybook/react';
|
|
3
3
|
import {
|
|
4
4
|
SingleSelect,
|
|
5
5
|
SingleSelectProps,
|
|
6
|
-
} from
|
|
6
|
+
} from '../../components/Input/SingleSelect/SingleSelect';
|
|
7
7
|
|
|
8
8
|
// Make sure your TextField import is correct
|
|
9
9
|
|
|
10
10
|
const topFilms = [
|
|
11
|
-
{ label:
|
|
12
|
-
{ label:
|
|
13
|
-
{ label:
|
|
14
|
-
{ label:
|
|
15
|
-
{ label:
|
|
11
|
+
{ label: 'The Shawshank Redemption', value: 1994 },
|
|
12
|
+
{ label: 'The Godfather', value: 1972 },
|
|
13
|
+
{ label: 'The Godfather: Part II', value: 1974 },
|
|
14
|
+
{ label: 'The Dark Knight', value: 2008 },
|
|
15
|
+
{ label: '12 Angry Men', value: 1957 },
|
|
16
16
|
{ label: "Schindler's List", value: 1993 },
|
|
17
|
-
{ label:
|
|
17
|
+
{ label: 'Pulp Fiction', value: 1994 },
|
|
18
18
|
{
|
|
19
|
-
label:
|
|
19
|
+
label: 'The Lord of the Rings: The Return of the King',
|
|
20
20
|
value: 2003,
|
|
21
21
|
},
|
|
22
|
-
{ label:
|
|
23
|
-
{ label:
|
|
22
|
+
{ label: 'The Good, the Bad and the Ugly', value: 1966 },
|
|
23
|
+
{ label: 'Fight Club', value: 1999 },
|
|
24
24
|
{
|
|
25
|
-
label:
|
|
25
|
+
label: 'The Lord of the Rings: The Fellowship of the Ring',
|
|
26
26
|
value: 2001,
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
label:
|
|
29
|
+
label: 'Star Wars: Episode V - The Empire Strikes Back',
|
|
30
30
|
value: 1980,
|
|
31
31
|
},
|
|
32
|
-
{ label:
|
|
33
|
-
{ label:
|
|
32
|
+
{ label: 'Forrest Gump', value: 1994 },
|
|
33
|
+
{ label: 'Inception', value: 2010 },
|
|
34
34
|
{
|
|
35
|
-
label:
|
|
35
|
+
label: 'The Lord of the Rings: The Two Towers',
|
|
36
36
|
value: 2002,
|
|
37
37
|
},
|
|
38
38
|
{ label: "One Flew Over the Cuckoo's Nest", value: 1975 },
|
|
39
|
-
{ label:
|
|
40
|
-
{ label:
|
|
41
|
-
{ label:
|
|
39
|
+
{ label: 'Goodfellas', value: 1990 },
|
|
40
|
+
{ label: 'The Matrix', value: 1999 },
|
|
41
|
+
{ label: 'Seven Samurai', value: 1954 },
|
|
42
42
|
{
|
|
43
|
-
label:
|
|
43
|
+
label: 'Star Wars: Episode IV - A New Hope',
|
|
44
44
|
value: 1977,
|
|
45
45
|
},
|
|
46
|
-
{ label:
|
|
47
|
-
{ label:
|
|
48
|
-
{ label:
|
|
46
|
+
{ label: 'City of God', value: 2002 },
|
|
47
|
+
{ label: 'Se7en', value: 1995 },
|
|
48
|
+
{ label: 'The Silence of the Lambs', value: 1991 },
|
|
49
49
|
{ label: "It's a Wonderful Life", value: 1946 },
|
|
50
|
-
{ label:
|
|
51
|
-
{ label:
|
|
52
|
-
{ label:
|
|
53
|
-
{ label:
|
|
54
|
-
{ label:
|
|
55
|
-
{ label:
|
|
56
|
-
{ label:
|
|
57
|
-
{ label:
|
|
50
|
+
{ label: 'Life Is Beautiful', value: 1997 },
|
|
51
|
+
{ label: 'The Usual Suspects', value: 1995 },
|
|
52
|
+
{ label: 'Léon: The Professional', value: 1994 },
|
|
53
|
+
{ label: 'Spirited Away', value: 2001 },
|
|
54
|
+
{ label: 'Saving Private Ryan', value: 1998 },
|
|
55
|
+
{ label: 'Once Upon a Time in the West', value: 1968 },
|
|
56
|
+
{ label: 'American History X', value: 1998 },
|
|
57
|
+
{ label: 'Interstellar', value: 2014 },
|
|
58
58
|
];
|
|
59
59
|
// Define the default export with Meta type including the component type
|
|
60
60
|
export default {
|
|
61
|
-
title:
|
|
61
|
+
title: 'Input/SingleSelect',
|
|
62
62
|
component: SingleSelect,
|
|
63
63
|
argTypes: {
|
|
64
64
|
label: {
|
|
65
|
-
control:
|
|
66
|
-
description:
|
|
65
|
+
control: 'text',
|
|
66
|
+
description: 'Label of the field',
|
|
67
67
|
},
|
|
68
68
|
required: {
|
|
69
|
-
control:
|
|
70
|
-
description:
|
|
69
|
+
control: 'boolean',
|
|
70
|
+
description: 'Required property of the field',
|
|
71
71
|
},
|
|
72
72
|
optionsApiEndPoint: {
|
|
73
|
-
control:
|
|
74
|
-
description:
|
|
73
|
+
control: 'text',
|
|
74
|
+
description: 'API end point for options',
|
|
75
75
|
},
|
|
76
76
|
useCampxAxios: {
|
|
77
|
-
control:
|
|
78
|
-
description:
|
|
77
|
+
control: 'boolean',
|
|
78
|
+
description: 'Boolean to use campx axios',
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
81
|
} as Meta<typeof SingleSelect>;
|
|
@@ -84,14 +84,14 @@ export const Default = {
|
|
|
84
84
|
render: (args: SingleSelectProps) => <SingleSelect {...args} />,
|
|
85
85
|
args: {
|
|
86
86
|
required: true,
|
|
87
|
-
label:
|
|
87
|
+
label: 'Single Select',
|
|
88
88
|
},
|
|
89
89
|
};
|
|
90
90
|
export const Primary = {
|
|
91
91
|
render: (args: SingleSelectProps) => <SingleSelect {...args} />,
|
|
92
92
|
args: {
|
|
93
93
|
options: topFilms,
|
|
94
|
-
label:
|
|
94
|
+
label: 'Single Select',
|
|
95
95
|
required: false,
|
|
96
96
|
},
|
|
97
97
|
};
|
|
@@ -99,8 +99,8 @@ export const Primary = {
|
|
|
99
99
|
export const WithAPIEndPoint = {
|
|
100
100
|
render: (args: SingleSelectProps) => <SingleSelect {...args} />,
|
|
101
101
|
args: {
|
|
102
|
-
optionsApiEndPoint:
|
|
103
|
-
label:
|
|
102
|
+
optionsApiEndPoint: 'dropdowns/classrooms',
|
|
103
|
+
label: 'Select Classroom',
|
|
104
104
|
required: false,
|
|
105
105
|
},
|
|
106
106
|
};
|
|
@@ -108,7 +108,7 @@ export const WithAPIEndPoint = {
|
|
|
108
108
|
export const SingleSelectWithValue = {
|
|
109
109
|
render: (args: SingleSelectProps) => <SingleSelect {...args} />,
|
|
110
110
|
args: {
|
|
111
|
-
label:
|
|
111
|
+
label: 'Select Select',
|
|
112
112
|
options: topFilms,
|
|
113
113
|
required: true,
|
|
114
114
|
value: 1994,
|
|
@@ -118,8 +118,8 @@ export const SingleSelectWithValue = {
|
|
|
118
118
|
export const SingleSelectWithValueAndApi = {
|
|
119
119
|
render: (args: SingleSelectProps) => <SingleSelect {...args} />,
|
|
120
120
|
args: {
|
|
121
|
-
optionsApiEndPoint:
|
|
122
|
-
label:
|
|
121
|
+
optionsApiEndPoint: 'dropdowns/classrooms',
|
|
122
|
+
label: 'Select Classroom',
|
|
123
123
|
required: true,
|
|
124
124
|
value: 1,
|
|
125
125
|
},
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
// Import React and other necessary elements
|
|
2
|
-
import { Meta } from
|
|
3
|
-
import { Switch, SwitchProps } from
|
|
2
|
+
import { Meta } from '@storybook/react';
|
|
3
|
+
import { Switch, SwitchProps } from '../../components/Input/Switch/Switch';
|
|
4
4
|
|
|
5
5
|
// Make sure your TextField import is correct
|
|
6
6
|
|
|
7
7
|
// Define the default export with Meta type including the component type
|
|
8
8
|
export default {
|
|
9
|
-
title:
|
|
9
|
+
title: 'Input/Switch',
|
|
10
10
|
component: Switch,
|
|
11
|
-
tags: [
|
|
11
|
+
tags: ['autodocs'],
|
|
12
12
|
argTypes: {
|
|
13
13
|
variant: {
|
|
14
|
-
control:
|
|
15
|
-
options: [
|
|
16
|
-
description:
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['contained', 'outlined', 'text', 'string'],
|
|
16
|
+
description: 'The Switch Variant to use',
|
|
17
17
|
},
|
|
18
18
|
children: {
|
|
19
|
-
control:
|
|
20
|
-
description:
|
|
19
|
+
control: 'text',
|
|
20
|
+
description: 'text in Switch',
|
|
21
21
|
},
|
|
22
22
|
color: {
|
|
23
|
-
control:
|
|
24
|
-
options: [
|
|
25
|
-
description:
|
|
23
|
+
control: 'select',
|
|
24
|
+
options: ['primary', 'secondary'],
|
|
25
|
+
description: 'The Switch Variant to use',
|
|
26
26
|
},
|
|
27
27
|
disabled: {
|
|
28
|
-
control:
|
|
29
|
-
description:
|
|
28
|
+
control: 'boolean',
|
|
29
|
+
description: 'Disabled Switch',
|
|
30
30
|
defaultValue: false,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
@@ -36,18 +36,18 @@ export default {
|
|
|
36
36
|
export const Primary = {
|
|
37
37
|
render: (args: SwitchProps) => <Switch {...args} />,
|
|
38
38
|
args: {
|
|
39
|
-
color:
|
|
40
|
-
variant:
|
|
41
|
-
children:
|
|
39
|
+
color: 'primary',
|
|
40
|
+
variant: 'contained',
|
|
41
|
+
children: 'Primary Switch',
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
export const Secondary = {
|
|
46
46
|
render: (args: SwitchProps) => <Switch {...args} />,
|
|
47
47
|
args: {
|
|
48
|
-
color:
|
|
49
|
-
variant:
|
|
50
|
-
children:
|
|
48
|
+
color: 'secondary',
|
|
49
|
+
variant: 'contained',
|
|
50
|
+
children: 'Secondary Switch',
|
|
51
51
|
},
|
|
52
52
|
};
|
|
53
53
|
|
|
@@ -55,7 +55,7 @@ export const Disabled = {
|
|
|
55
55
|
render: (args: SwitchProps) => <Switch {...args} />,
|
|
56
56
|
args: {
|
|
57
57
|
disabled: true,
|
|
58
|
-
variant:
|
|
59
|
-
children:
|
|
58
|
+
variant: 'contained',
|
|
59
|
+
children: 'Disabled Switch',
|
|
60
60
|
},
|
|
61
61
|
};
|