@codezee/sixtify-brahma 0.0.0
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/.github/workflows/check-build.yml +41 -0
- package/.github/workflows/deploy-on-npm.yml +43 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +6 -0
- package/.lintstagedrc +5 -0
- package/.prettierignore +12 -0
- package/.prettierrc +22 -0
- package/.vscode/extensions.json +22 -0
- package/.vscode/settings.json +17 -0
- package/README.md +90 -0
- package/apps/docs/.eslintrc.cjs +9 -0
- package/apps/docs/.storybook/main.ts +23 -0
- package/apps/docs/.storybook/manager.ts +6 -0
- package/apps/docs/.storybook/preview.tsx +27 -0
- package/apps/docs/.storybook/theme.ts +8 -0
- package/apps/docs/next-env.d.ts +5 -0
- package/apps/docs/next.config.mjs +4 -0
- package/apps/docs/package.json +43 -0
- package/apps/docs/public/globals.css +26 -0
- package/apps/docs/stories/Actions/Actions.stories.tsx +49 -0
- package/apps/docs/stories/AgGrid/AgGrid.stories.tsx +70 -0
- package/apps/docs/stories/AppBar/AppBar.stories.tsx +39 -0
- package/apps/docs/stories/Breadcrumbs/Breadcrumbs.stories.tsx +37 -0
- package/apps/docs/stories/Button/ButtonGroup.stories.tsx +120 -0
- package/apps/docs/stories/Button/button.stories.tsx +99 -0
- package/apps/docs/stories/Card/AttendanceCard.stories.tsx +36 -0
- package/apps/docs/stories/Card/Card.stories.tsx +39 -0
- package/apps/docs/stories/Charts/PieChart.stories.tsx +265 -0
- package/apps/docs/stories/Chips/Chip.stories.tsx +141 -0
- package/apps/docs/stories/Chips/ChipWithBorder.stories.tsx +18 -0
- package/apps/docs/stories/Chips/FilterPill.stories.tsx +24 -0
- package/apps/docs/stories/Color/Color.stories.tsx +14 -0
- package/apps/docs/stories/Dialog/ButtomDialog.stories.tsx +48 -0
- package/apps/docs/stories/Dialog/DeleteDialog.stories.tsx +32 -0
- package/apps/docs/stories/Dialog/Dialog.stories.tsx +48 -0
- package/apps/docs/stories/Drawer/Drawer.stories.tsx +94 -0
- package/apps/docs/stories/FilterList/FilterList.stories.tsx +88 -0
- package/apps/docs/stories/FilterList/FilterListV2.stories.tsx +92 -0
- package/apps/docs/stories/FormFields/AutoComplete.stories.tsx +90 -0
- package/apps/docs/stories/FormFields/CheckBox.stories.tsx +64 -0
- package/apps/docs/stories/FormFields/DatePicker.stories.tsx +100 -0
- package/apps/docs/stories/FormFields/DateRangePicker.stories.tsx +39 -0
- package/apps/docs/stories/FormFields/DateTimePicker.stories.tsx +39 -0
- package/apps/docs/stories/FormFields/FileUpload.stories.tsx +83 -0
- package/apps/docs/stories/FormFields/ImageUpload.stories.tsx +69 -0
- package/apps/docs/stories/FormFields/ListItemButton.stories.tsx +59 -0
- package/apps/docs/stories/FormFields/PhoneInputField.stories.tsx +84 -0
- package/apps/docs/stories/FormFields/RadioGroupField.stories.tsx +172 -0
- package/apps/docs/stories/FormFields/SearchField.stories.tsx +74 -0
- package/apps/docs/stories/FormFields/TextField.stories.tsx +141 -0
- package/apps/docs/stories/FormFields/TimeField.stories.tsx +84 -0
- package/apps/docs/stories/FormFields/TimePicker.stories.tsx +84 -0
- package/apps/docs/stories/Indicator/Indicator.stories.tsx +33 -0
- package/apps/docs/stories/Indicator/SeverityIndicator.stories.tsx +27 -0
- package/apps/docs/stories/Layouts/FormRow.stories.tsx +45 -0
- package/apps/docs/stories/PadBox/PadBox.stories.tsx +49 -0
- package/apps/docs/stories/Stepper/Stepper.stories.tsx +110 -0
- package/apps/docs/stories/Stepper/StepperV2.stories.tsx +44 -0
- package/apps/docs/stories/Timeline/AttendanceStatus.stories.tsx +29 -0
- package/apps/docs/stories/Timeline/Timeline.stories.tsx +38 -0
- package/apps/docs/stories/Tooltip/Tooltip.stories.tsx +28 -0
- package/apps/docs/stories/UserProfileMenu/UserProfileMenu.stories.tsx +112 -0
- package/apps/docs/tsconfig.json +19 -0
- package/commitlint.config.cjs +6 -0
- package/index.ts +1 -0
- package/package.json +85 -0
- package/packages/eslint-config/README.md +3 -0
- package/packages/eslint-config/library.js +88 -0
- package/packages/eslint-config/next.js +85 -0
- package/packages/eslint-config/package.json +19 -0
- package/packages/eslint-config/react-internal.js +89 -0
- package/packages/shared-components/.eslintrc.js +10 -0
- package/packages/shared-components/package.json +51 -0
- package/packages/shared-components/src/Actions/AddAction.tsx +16 -0
- package/packages/shared-components/src/Actions/CalendarAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ConfigureAction.tsx +16 -0
- package/packages/shared-components/src/Actions/DeleteAction.tsx +16 -0
- package/packages/shared-components/src/Actions/DownloadAction.tsx +16 -0
- package/packages/shared-components/src/Actions/EditAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ExportAction.tsx +16 -0
- package/packages/shared-components/src/Actions/FilterAction.tsx +16 -0
- package/packages/shared-components/src/Actions/HistoryAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ImportAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ViewAction.tsx +16 -0
- package/packages/shared-components/src/Actions/index.ts +11 -0
- package/packages/shared-components/src/AgGrid/ActionCell/ActionCell.tsx +57 -0
- package/packages/shared-components/src/AgGrid/ActionCell/Popover.tsx +32 -0
- package/packages/shared-components/src/AgGrid/AgGrid.tsx +93 -0
- package/packages/shared-components/src/AgGrid/LoadingCell.tsx +5 -0
- package/packages/shared-components/src/AgGrid/index.ts +3 -0
- package/packages/shared-components/src/AppBar/AppBar.styled.tsx +33 -0
- package/packages/shared-components/src/AppBar/AppBar.tsx +20 -0
- package/packages/shared-components/src/AppBar/index.ts +1 -0
- package/packages/shared-components/src/Breadcrumbs/Breadcrumbs.tsx +76 -0
- package/packages/shared-components/src/Breadcrumbs/index.ts +1 -0
- package/packages/shared-components/src/Button/ActionButton.tsx +38 -0
- package/packages/shared-components/src/Button/Button.tsx +19 -0
- package/packages/shared-components/src/Button/ButtonGroup.tsx +37 -0
- package/packages/shared-components/src/Button/index.ts +3 -0
- package/packages/shared-components/src/Card/AttendanceCard.tsx +51 -0
- package/packages/shared-components/src/Card/Card.tsx +34 -0
- package/packages/shared-components/src/Card/CardItem/CardItem.tsx +33 -0
- package/packages/shared-components/src/Card/CardItem/CardItemValue.tsx +98 -0
- package/packages/shared-components/src/Card/CardItem/index.ts +2 -0
- package/packages/shared-components/src/Card/ProfileCard/ProfileCard.tsx +40 -0
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardBody.tsx +53 -0
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.tsx +94 -0
- package/packages/shared-components/src/Card/index.ts +6 -0
- package/packages/shared-components/src/Charts/PieChart.tsx +81 -0
- package/packages/shared-components/src/Charts/Skeleton.tsx +36 -0
- package/packages/shared-components/src/Charts/index.ts +1 -0
- package/packages/shared-components/src/Chips/Chip.tsx +26 -0
- package/packages/shared-components/src/Chips/ChipWithBorder.tsx +39 -0
- package/packages/shared-components/src/Chips/FilterPill.tsx +47 -0
- package/packages/shared-components/src/Chips/index.ts +3 -0
- package/packages/shared-components/src/Dialog/BottomDialog.styled.tsx +28 -0
- package/packages/shared-components/src/Dialog/BottomDialog.tsx +37 -0
- package/packages/shared-components/src/Dialog/DeleteDialog.tsx +48 -0
- package/packages/shared-components/src/Dialog/Dialog.tsx +61 -0
- package/packages/shared-components/src/Dialog/index.ts +3 -0
- package/packages/shared-components/src/Drawer/Bullet.tsx +12 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItem.tsx +57 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItemList.tsx +109 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.tsx +128 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/Popover.tsx +45 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/Popper.tsx +43 -0
- package/packages/shared-components/src/Drawer/Drawer.styled.tsx +63 -0
- package/packages/shared-components/src/Drawer/Drawer.tsx +56 -0
- package/packages/shared-components/src/Drawer/MenuItem.tsx +75 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerCollapse.tsx +13 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItem.tsx +48 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItemList.tsx +232 -0
- package/packages/shared-components/src/Drawer/index.ts +1 -0
- package/packages/shared-components/src/FilterList/DateRangePickerPopUp.tsx +123 -0
- package/packages/shared-components/src/FilterList/FilterList.tsx +180 -0
- package/packages/shared-components/src/FilterList/FilterListV2.tsx +661 -0
- package/packages/shared-components/src/FilterList/FilterPopup.tsx +165 -0
- package/packages/shared-components/src/FilterList/FilterPopupWrapper.tsx +110 -0
- package/packages/shared-components/src/FilterList/FilterTypeWrapper.tsx +60 -0
- package/packages/shared-components/src/FilterList/GetFilterPopupComponent.tsx +76 -0
- package/packages/shared-components/src/FilterList/getFormData.ts +29 -0
- package/packages/shared-components/src/FilterList/index.ts +6 -0
- package/packages/shared-components/src/FormFields/Autocomplete/Autocomplete.tsx +509 -0
- package/packages/shared-components/src/FormFields/Autocomplete/Skeleton.tsx +26 -0
- package/packages/shared-components/src/FormFields/Autocomplete/index.ts +1 -0
- package/packages/shared-components/src/FormFields/CheckBox/CheckBox.styled.tsx +76 -0
- package/packages/shared-components/src/FormFields/CheckBox/CheckBox.tsx +44 -0
- package/packages/shared-components/src/FormFields/CheckBox/Skeleton.tsx +12 -0
- package/packages/shared-components/src/FormFields/CheckBox/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DatePicker/DatePicker.tsx +217 -0
- package/packages/shared-components/src/FormFields/DatePicker/Skeleton.tsx +28 -0
- package/packages/shared-components/src/FormFields/DatePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/DateRangePicker.tsx +97 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/Skeleton.tsx +38 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DateTimePicker/DateTimePicker.tsx +253 -0
- package/packages/shared-components/src/FormFields/DateTimePicker/Skeleton.tsx +24 -0
- package/packages/shared-components/src/FormFields/DateTimePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileNames.tsx +32 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.styled.tsx +31 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.tsx +160 -0
- package/packages/shared-components/src/FormFields/FileUpload/Skeleton.tsx +21 -0
- package/packages/shared-components/src/FormFields/FileUpload/index.ts +2 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.styled.tsx +20 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.tsx +181 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUploadView.tsx +65 -0
- package/packages/shared-components/src/FormFields/ImageUpload/PhotoCaptureDialog.tsx +74 -0
- package/packages/shared-components/src/FormFields/ImageUpload/Skeleton.tsx +31 -0
- package/packages/shared-components/src/FormFields/ImageUpload/index.ts +2 -0
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.styled.tsx +25 -0
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.tsx +52 -0
- package/packages/shared-components/src/FormFields/ListItemButton/index.ts +1 -0
- package/packages/shared-components/src/FormFields/PasswordField/PasswordField.tsx +50 -0
- package/packages/shared-components/src/FormFields/PasswordField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/PhoneInputField/PhoneInputField.tsx +108 -0
- package/packages/shared-components/src/FormFields/PhoneInputField/Skeleton.tsx +31 -0
- package/packages/shared-components/src/FormFields/PhoneInputField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/RadioGroupField/RadioGroupField.tsx +105 -0
- package/packages/shared-components/src/FormFields/RadioGroupField/Skeleton.tsx +26 -0
- package/packages/shared-components/src/FormFields/RadioGroupField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/SearchField/SearchField.tsx +21 -0
- package/packages/shared-components/src/FormFields/SearchField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/Switch/Skeleton.tsx +12 -0
- package/packages/shared-components/src/FormFields/Switch/Switch.tsx +33 -0
- package/packages/shared-components/src/FormFields/Switch/index.ts +1 -0
- package/packages/shared-components/src/FormFields/TextField/Skeleton.tsx +31 -0
- package/packages/shared-components/src/FormFields/TextField/TextField.tsx +167 -0
- package/packages/shared-components/src/FormFields/TextField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/TimeField/Skeleton.tsx +24 -0
- package/packages/shared-components/src/FormFields/TimeField/TimeField.tsx +120 -0
- package/packages/shared-components/src/FormFields/TimeField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/TimePicker/Skeleton.tsx +24 -0
- package/packages/shared-components/src/FormFields/TimePicker/TimePicker.tsx +168 -0
- package/packages/shared-components/src/FormFields/TimePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/index.ts +16 -0
- package/packages/shared-components/src/Indicator/Indicator.tsx +18 -0
- package/packages/shared-components/src/Indicator/SeverityIndicator.tsx +34 -0
- package/packages/shared-components/src/Indicator/index.ts +2 -0
- package/packages/shared-components/src/Layouts/FormContainer.tsx +6 -0
- package/packages/shared-components/src/Layouts/FormGridLayout.tsx +27 -0
- package/packages/shared-components/src/Layouts/FormRow/FormRow.styled.tsx +47 -0
- package/packages/shared-components/src/Layouts/FormRow/FormRow.tsx +20 -0
- package/packages/shared-components/src/Layouts/FormRow/index.ts +1 -0
- package/packages/shared-components/src/Layouts/FormSection.tsx +22 -0
- package/packages/shared-components/src/Layouts/index.ts +4 -0
- package/packages/shared-components/src/Loader/FacebookCircularProgress.tsx +41 -0
- package/packages/shared-components/src/Loader/index.ts +1 -0
- package/packages/shared-components/src/PadBox/PadBox.tsx +21 -0
- package/packages/shared-components/src/PadBox/index.ts +1 -0
- package/packages/shared-components/src/Pagination/Pagination.tsx +42 -0
- package/packages/shared-components/src/Pagination/index.ts +1 -0
- package/packages/shared-components/src/Stepper/Stepper.tsx +88 -0
- package/packages/shared-components/src/Stepper/StepperV2.tsx +115 -0
- package/packages/shared-components/src/Stepper/StepperV3.tsx +72 -0
- package/packages/shared-components/src/Stepper/index.ts +3 -0
- package/packages/shared-components/src/Svgs/AppLogo/AppLogoMedium.tsx +65 -0
- package/packages/shared-components/src/Svgs/AppLogo/AppLogoSmall.tsx +48 -0
- package/packages/shared-components/src/Svgs/ArrowUp.tsx +11 -0
- package/packages/shared-components/src/Svgs/Company/CompanyBanner.tsx +480 -0
- package/packages/shared-components/src/Svgs/Company/index.ts +1 -0
- package/packages/shared-components/src/Svgs/Drawer/SettingIcon.tsx +31 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgBankConfig.tsx +36 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgConfiguration.tsx +16 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgPayroll.tsx +32 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgsEmployees.tsx +25 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgsOrganization.tsx +36 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgsTransaction.tsx +81 -0
- package/packages/shared-components/src/Svgs/Drawer/index.ts +7 -0
- package/packages/shared-components/src/Svgs/FormAction.tsx +118 -0
- package/packages/shared-components/src/Svgs/ImportExcelSuccessIcon.tsx +54 -0
- package/packages/shared-components/src/Svgs/LogoIcon.tsx +74 -0
- package/packages/shared-components/src/Svgs/SvgAdd.tsx +28 -0
- package/packages/shared-components/src/Svgs/SvgCalendar.tsx +89 -0
- package/packages/shared-components/src/Svgs/SvgConfigure.tsx +51 -0
- package/packages/shared-components/src/Svgs/SvgDelete.tsx +55 -0
- package/packages/shared-components/src/Svgs/SvgDownload.tsx +20 -0
- package/packages/shared-components/src/Svgs/SvgEmail.tsx +27 -0
- package/packages/shared-components/src/Svgs/SvgExport.tsx +33 -0
- package/packages/shared-components/src/Svgs/SvgFilterList.tsx +22 -0
- package/packages/shared-components/src/Svgs/SvgImport.tsx +43 -0
- package/packages/shared-components/src/Svgs/SvgNoLogo.tsx +66 -0
- package/packages/shared-components/src/Svgs/SvgNoSign.tsx +28 -0
- package/packages/shared-components/src/Svgs/SvgPhone.tsx +19 -0
- package/packages/shared-components/src/Svgs/SvgProfile.tsx +33 -0
- package/packages/shared-components/src/Svgs/SvgView.tsx +16 -0
- package/packages/shared-components/src/Svgs/SvgsDrop.tsx +44 -0
- package/packages/shared-components/src/Svgs/SvgsEdit.tsx +42 -0
- package/packages/shared-components/src/Svgs/SvgsHistory.tsx +40 -0
- package/packages/shared-components/src/Svgs/SvgsHome.tsx +18 -0
- package/packages/shared-components/src/Svgs/SvgsIndicator.tsx +24 -0
- package/packages/shared-components/src/Svgs/index.ts +18 -0
- package/packages/shared-components/src/Tab/Skeleton.tsx +15 -0
- package/packages/shared-components/src/Tab/Tabs.tsx +64 -0
- package/packages/shared-components/src/Tab/index.ts +1 -0
- package/packages/shared-components/src/Timeline/AttendanceStatus.tsx +56 -0
- package/packages/shared-components/src/Timeline/Timeline.tsx +159 -0
- package/packages/shared-components/src/Timeline/TimelineTrackSegments.tsx +130 -0
- package/packages/shared-components/src/Timeline/index.ts +2 -0
- package/packages/shared-components/src/Toast/Toast.tsx +59 -0
- package/packages/shared-components/src/Toast/ToastBody.tsx +26 -0
- package/packages/shared-components/src/Toast/ToastFooterLink.tsx +19 -0
- package/packages/shared-components/src/Toast/Toaster.styled.tsx +80 -0
- package/packages/shared-components/src/Toast/Toaster.tsx +21 -0
- package/packages/shared-components/src/Toast/index.ts +3 -0
- package/packages/shared-components/src/Toast/toasts.tsx +28 -0
- package/packages/shared-components/src/Toast/types.ts +13 -0
- package/packages/shared-components/src/Tooltip/Tooltip.tsx +36 -0
- package/packages/shared-components/src/Tooltip/index.ts +1 -0
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.styled.tsx +42 -0
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.tsx +168 -0
- package/packages/shared-components/src/UserProfileMenu/index.ts +1 -0
- package/packages/shared-components/src/index.ts +25 -0
- package/packages/shared-components/src/utils/colorVariant.ts +162 -0
- package/packages/shared-components/src/utils/date.ts +25 -0
- package/packages/shared-components/src/utils/file.ts +22 -0
- package/packages/shared-components/src/utils/index.ts +11 -0
- package/packages/shared-components/src/utils/theme/colorPalette.ts +112 -0
- package/packages/shared-components/src/utils/theme/colorPaletteUI.tsx +44 -0
- package/packages/shared-components/src/utils/theme/paletteDark.ts +10 -0
- package/packages/shared-components/src/utils/theme/paletteLight.ts +31 -0
- package/packages/shared-components/src/utils/theme/theme.ts +297 -0
- package/packages/shared-components/src/utils/theme/types.ts +18 -0
- package/packages/shared-components/src/utils/theme/typography.ts +52 -0
- package/packages/shared-components/src/utils/urlToNestedObject.ts +9 -0
- package/packages/shared-components/tsconfig.json +8 -0
- package/packages/shared-components/tsconfig.lint.json +8 -0
- package/packages/shared-components/webpack/cjs.js +20 -0
- package/packages/shared-components/webpack/common.js +36 -0
- package/packages/typescript-config/base.json +20 -0
- package/packages/typescript-config/nextjs.json +13 -0
- package/packages/typescript-config/package.json +9 -0
- package/packages/typescript-config/react-library.json +8 -0
- package/pnpm-workspace.yaml +3 -0
- package/turbo.json +42 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
2
|
+
import { AdapterLuxon } from "@mui/x-date-pickers/AdapterLuxon";
|
|
3
|
+
import { DatePicker, dateFormats } from "@repo/shared-components";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { DateTime } from "luxon";
|
|
6
|
+
import type { FieldValues } from "react-hook-form";
|
|
7
|
+
import { useForm } from "react-hook-form";
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof DatePicker> = {
|
|
10
|
+
title: "shared-component/FormFields/DatePicker",
|
|
11
|
+
component: DatePicker,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<LocalizationProvider dateAdapter={AdapterLuxon}>
|
|
16
|
+
<Story />
|
|
17
|
+
</LocalizationProvider>
|
|
18
|
+
),
|
|
19
|
+
],
|
|
20
|
+
argTypes: {
|
|
21
|
+
label: { control: "text" },
|
|
22
|
+
required: { control: "boolean" },
|
|
23
|
+
disabled: { control: "boolean" },
|
|
24
|
+
readOnly: { control: "boolean" },
|
|
25
|
+
error: { control: "boolean" },
|
|
26
|
+
helperText: { control: "text" },
|
|
27
|
+
loading: { control: "boolean" },
|
|
28
|
+
format: {
|
|
29
|
+
options: [dateFormats.dateWithISO8601, dateFormats.dateWithEuropean],
|
|
30
|
+
control: { type: "select" },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
render: (args) => {
|
|
34
|
+
const { control } = useForm<FieldValues>({
|
|
35
|
+
defaultValues: {
|
|
36
|
+
dateField: DateTime.now().toISODate(),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return <DatePicker {...args} name="dateField" control={control} />;
|
|
41
|
+
},
|
|
42
|
+
args: {
|
|
43
|
+
label: "Select Date",
|
|
44
|
+
required: false,
|
|
45
|
+
disabled: false,
|
|
46
|
+
readOnly: false,
|
|
47
|
+
error: false,
|
|
48
|
+
helperText: "",
|
|
49
|
+
loading: false,
|
|
50
|
+
format: dateFormats.dateWithEuropean,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default meta;
|
|
55
|
+
|
|
56
|
+
type Story = StoryObj<typeof DatePicker>;
|
|
57
|
+
|
|
58
|
+
export const DefaultDatePicker: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
label: "Select Date",
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const RequiredDatePicker: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
label: "Required Date",
|
|
67
|
+
required: true,
|
|
68
|
+
helperText: "This field is required",
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const DisabledDatePicker: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
label: "Disabled Date",
|
|
75
|
+
disabled: true,
|
|
76
|
+
helperText: "This field is disabled",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const LoadingDatePicker: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
label: "Loading Date Picker",
|
|
83
|
+
loading: true,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const ErrorDatePicker: Story = {
|
|
88
|
+
args: {
|
|
89
|
+
label: "Error Date Picker",
|
|
90
|
+
error: true,
|
|
91
|
+
helperText: "Invalid date",
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const ReadOnlyDatePicker: Story = {
|
|
96
|
+
args: {
|
|
97
|
+
label: "Read-Only Date Picker",
|
|
98
|
+
readOnly: true,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
2
|
+
import { AdapterLuxon } from "@mui/x-date-pickers/AdapterLuxon";
|
|
3
|
+
import { DateRangePicker } from "@repo/shared-components";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { DateTime } from "luxon";
|
|
6
|
+
import type { FieldValues } from "react-hook-form";
|
|
7
|
+
import { useForm } from "react-hook-form";
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof DateRangePicker> = {
|
|
10
|
+
title: "shared-component/FormFields/DateRangePicker",
|
|
11
|
+
component: DateRangePicker,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<LocalizationProvider dateAdapter={AdapterLuxon}>
|
|
16
|
+
<Story />
|
|
17
|
+
</LocalizationProvider>
|
|
18
|
+
),
|
|
19
|
+
],
|
|
20
|
+
render: (args) => {
|
|
21
|
+
const { control } = useForm<FieldValues>({
|
|
22
|
+
defaultValues: {
|
|
23
|
+
dateField: DateTime.now().toISODate(),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return <DateRangePicker {...args} name="dateField" control={control} />;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
|
|
33
|
+
type Story = StoryObj<typeof DateRangePicker>;
|
|
34
|
+
|
|
35
|
+
export const DefaultDateRangerPicker: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
label: "Select Date",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
2
|
+
import { AdapterLuxon } from "@mui/x-date-pickers/AdapterLuxon";
|
|
3
|
+
import { DateTimePicker } from "@repo/shared-components";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { DateTime } from "luxon";
|
|
6
|
+
import type { FieldValues } from "react-hook-form";
|
|
7
|
+
import { useForm } from "react-hook-form";
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof DateTimePicker> = {
|
|
10
|
+
title: "shared-component/FormFields/DateTimePicker",
|
|
11
|
+
component: DateTimePicker,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<LocalizationProvider dateAdapter={AdapterLuxon}>
|
|
16
|
+
<Story />
|
|
17
|
+
</LocalizationProvider>
|
|
18
|
+
),
|
|
19
|
+
],
|
|
20
|
+
render: (args) => {
|
|
21
|
+
const { control } = useForm<FieldValues>({
|
|
22
|
+
defaultValues: {
|
|
23
|
+
dateField: DateTime.now().toISODate(),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return <DateTimePicker {...args} name="dateTimeField" control={control} />;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
|
|
33
|
+
type Story = StoryObj<typeof DateTimePicker>;
|
|
34
|
+
|
|
35
|
+
export const DefaultDateTimePicker: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
label: "Select Date and Time",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { FileUpload } from "@repo/shared-components";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import type { FieldValues } from "react-hook-form";
|
|
4
|
+
import { useForm } from "react-hook-form";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof FileUpload> = {
|
|
7
|
+
title: "shared-component/FormFields/FileUpload",
|
|
8
|
+
component: FileUpload,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
label: { control: "text" },
|
|
12
|
+
multiple: { control: "boolean" },
|
|
13
|
+
loading: { control: "boolean" },
|
|
14
|
+
isDisabled: { control: "boolean" },
|
|
15
|
+
error: { control: "boolean" },
|
|
16
|
+
helperText: { control: "text" },
|
|
17
|
+
size: { control: "number" },
|
|
18
|
+
accept: { control: "text" },
|
|
19
|
+
},
|
|
20
|
+
render: (args) => {
|
|
21
|
+
const { control, setError } = useForm<FieldValues>();
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<FileUpload
|
|
25
|
+
{...args}
|
|
26
|
+
control={control}
|
|
27
|
+
name="fileUpload"
|
|
28
|
+
setError={setError}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
args: {
|
|
33
|
+
label: "Upload Your Files",
|
|
34
|
+
multiple: false,
|
|
35
|
+
size: 10,
|
|
36
|
+
accept: ".png,.jpg,.jpeg,.pdf",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
|
|
42
|
+
type Story = StoryObj<typeof FileUpload>;
|
|
43
|
+
|
|
44
|
+
export const DefaultFileUpload: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
label: "Upload Files",
|
|
47
|
+
isDisabled: false,
|
|
48
|
+
error: false,
|
|
49
|
+
helperText: "",
|
|
50
|
+
multiple: false,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const MultipleFileUpload: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
label: "Upload Multiple Files",
|
|
57
|
+
isDisabled: false,
|
|
58
|
+
multiple: true,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const DisabledFileUpload: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
label: "File Upload (Disabled)",
|
|
65
|
+
isDisabled: true,
|
|
66
|
+
multiple: false,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const LoadingFileUpload: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
label: "File Upload (Loading)",
|
|
73
|
+
loading: true,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const FileUploadWithError: Story = {
|
|
78
|
+
args: {
|
|
79
|
+
label: "File Upload with Error",
|
|
80
|
+
error: true,
|
|
81
|
+
helperText: "File size exceeded or invalid file type",
|
|
82
|
+
},
|
|
83
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { ImageUpload } from "@repo/shared-components";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof ImageUpload> = {
|
|
5
|
+
title: "shared-component/FormFields/ImageUpload",
|
|
6
|
+
component: ImageUpload,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
label: { control: "text" },
|
|
10
|
+
isUploading: { control: "boolean" },
|
|
11
|
+
variant: {
|
|
12
|
+
control: { type: "select" },
|
|
13
|
+
options: ["square", "circle"],
|
|
14
|
+
},
|
|
15
|
+
isCapture: { control: "boolean" },
|
|
16
|
+
loading: { control: "boolean" },
|
|
17
|
+
subTitle: { control: "text" },
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
label: "Profile Picture",
|
|
21
|
+
subTitle: "PNG, JPEG under 5 MB",
|
|
22
|
+
isUploading: false,
|
|
23
|
+
variant: "square",
|
|
24
|
+
isCapture: false,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof ImageUpload>;
|
|
31
|
+
|
|
32
|
+
export const DefaultImageUpload: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
label: "Upload Profile Picture",
|
|
35
|
+
isUploading: false,
|
|
36
|
+
variant: "square",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const LoadingImageUpload: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
label: "Uploading Profile Picture",
|
|
43
|
+
isUploading: true,
|
|
44
|
+
loading: true,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const CircularImageUpload: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
label: "Upload Circular Profile Picture",
|
|
51
|
+
variant: "circle",
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const ImageUploadWithCapture: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
label: "Upload Profile Picture with Capture",
|
|
58
|
+
isCapture: true,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const ImageUploadWithDefaultImage: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
label: "Edit Profile Picture",
|
|
65
|
+
defaultValue:
|
|
66
|
+
"https://fps.cdnpk.net/images/home/subhome-ai.webp?w=649&h=649",
|
|
67
|
+
isCapture: true,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Stack } from "@mui/material";
|
|
2
|
+
import {
|
|
3
|
+
DeleteAction,
|
|
4
|
+
EditAction,
|
|
5
|
+
ListItemButton,
|
|
6
|
+
} from "@repo/shared-components";
|
|
7
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof ListItemButton> = {
|
|
10
|
+
title: "shared-component/FormFields/ListItemButton",
|
|
11
|
+
component: ListItemButton,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
argTypes: {
|
|
14
|
+
label: { control: "text" },
|
|
15
|
+
selected: { control: "boolean" },
|
|
16
|
+
actions: { control: "object" },
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
label: "List Item",
|
|
20
|
+
selected: false,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof ListItemButton>;
|
|
27
|
+
|
|
28
|
+
export const DefaultListItemButton: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
label: "Default List Item",
|
|
31
|
+
selected: false,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const SelectedListItemButton: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
label: "Selected List Item",
|
|
38
|
+
selected: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const ListItemButtonWithActions: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
label: "List Item with Actions",
|
|
45
|
+
actions: (
|
|
46
|
+
<Stack direction="row">
|
|
47
|
+
<EditAction />
|
|
48
|
+
<DeleteAction />
|
|
49
|
+
</Stack>
|
|
50
|
+
),
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const ListItemButtonWithLongLabel: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
label:
|
|
57
|
+
"This is a list item with a very long label that should be truncated or shown in a tooltip",
|
|
58
|
+
},
|
|
59
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { PhoneInputField } from "@repo/shared-components";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import type { FieldValues } from "react-hook-form";
|
|
4
|
+
import { useForm } from "react-hook-form";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof PhoneInputField> = {
|
|
7
|
+
title: "shared-component/FormFields/PhoneInputField",
|
|
8
|
+
component: PhoneInputField,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
label: {
|
|
12
|
+
control: "text",
|
|
13
|
+
},
|
|
14
|
+
placeholder: {
|
|
15
|
+
control: "text",
|
|
16
|
+
},
|
|
17
|
+
loading: {
|
|
18
|
+
control: "boolean",
|
|
19
|
+
},
|
|
20
|
+
required: {
|
|
21
|
+
control: "boolean",
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
control: "boolean",
|
|
25
|
+
},
|
|
26
|
+
error: {
|
|
27
|
+
control: "boolean",
|
|
28
|
+
},
|
|
29
|
+
helperText: {
|
|
30
|
+
control: "text",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
render: (args) => {
|
|
34
|
+
const { control } = useForm<FieldValues>({
|
|
35
|
+
defaultValues: {
|
|
36
|
+
phone: "",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return <PhoneInputField {...args} name="phone" control={control} />;
|
|
41
|
+
},
|
|
42
|
+
args: {
|
|
43
|
+
placeholder: "Enter phone number...",
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default meta;
|
|
48
|
+
|
|
49
|
+
type Story = StoryObj<typeof PhoneInputField>;
|
|
50
|
+
|
|
51
|
+
export const DefaultPhoneInput: Story = {
|
|
52
|
+
args: {
|
|
53
|
+
label: "Phone Number",
|
|
54
|
+
required: false,
|
|
55
|
+
disabled: false,
|
|
56
|
+
error: false,
|
|
57
|
+
helperText: "",
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const DisabledPhoneInput: Story = {
|
|
62
|
+
args: {
|
|
63
|
+
label: "Disabled Phone Input",
|
|
64
|
+
required: false,
|
|
65
|
+
disabled: true,
|
|
66
|
+
error: false,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const LoadingPhoneInput: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
label: "Loading State",
|
|
73
|
+
loading: true,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const ErrorPhoneInput: Story = {
|
|
78
|
+
args: {
|
|
79
|
+
label: "Phone Number with Error",
|
|
80
|
+
required: true,
|
|
81
|
+
error: true,
|
|
82
|
+
helperText: "Invalid phone number",
|
|
83
|
+
},
|
|
84
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Stack, Typography } from "@mui/material";
|
|
2
|
+
import { RadioGroupField, TextField } from "@repo/shared-components";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
import type { FieldValues } from "react-hook-form";
|
|
5
|
+
import { useForm } from "react-hook-form";
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof RadioGroupField> = {
|
|
8
|
+
title: "shared-component/FormFields/RadioGroupField",
|
|
9
|
+
component: RadioGroupField,
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
argTypes: {
|
|
12
|
+
label: {
|
|
13
|
+
control: "text",
|
|
14
|
+
},
|
|
15
|
+
options: {
|
|
16
|
+
control: "object",
|
|
17
|
+
},
|
|
18
|
+
loading: {
|
|
19
|
+
control: "boolean",
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
options: ["small", "medium"],
|
|
23
|
+
control: { type: "select" },
|
|
24
|
+
},
|
|
25
|
+
direction: {
|
|
26
|
+
options: ["row", "column"],
|
|
27
|
+
control: { type: "select" },
|
|
28
|
+
},
|
|
29
|
+
color: {
|
|
30
|
+
options: ["primary", "secondary"],
|
|
31
|
+
control: { type: "select" },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
render: (args) => {
|
|
35
|
+
const { control } = useForm<FieldValues>({
|
|
36
|
+
defaultValues: {
|
|
37
|
+
radioOption: "",
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return <RadioGroupField {...args} control={control} name="radioOption" />;
|
|
42
|
+
},
|
|
43
|
+
args: {
|
|
44
|
+
label: "Choose an option",
|
|
45
|
+
options: [
|
|
46
|
+
{ values: "option1", label: "Option 1", disabled: false },
|
|
47
|
+
{ values: "option2", label: "Option 2", disabled: false },
|
|
48
|
+
{ values: "option3", label: "Option 3", disabled: false },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default meta;
|
|
54
|
+
|
|
55
|
+
type Story = StoryObj<typeof RadioGroupField>;
|
|
56
|
+
|
|
57
|
+
export const DefaultRadioGroupField: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
label: "Default Radio Group",
|
|
60
|
+
size: "small",
|
|
61
|
+
color: "secondary",
|
|
62
|
+
loading: false,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const DisabledRadioOptions: Story = {
|
|
67
|
+
args: {
|
|
68
|
+
label: "Radio Group with Disabled Option",
|
|
69
|
+
size: "small",
|
|
70
|
+
color: "primary",
|
|
71
|
+
options: [
|
|
72
|
+
{ values: "option1", label: "Option 1", disabled: true },
|
|
73
|
+
{ values: "option2", label: "Option 2", disabled: true },
|
|
74
|
+
{ values: "option3", label: "Option 3", disabled: true },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const LoadingRadioGroupField: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
label: "Loading Radio Group",
|
|
82
|
+
loading: true,
|
|
83
|
+
size: "small",
|
|
84
|
+
color: "secondary",
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const RequiredRadioGroupField: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
label: "Required Radio Group",
|
|
91
|
+
size: "medium",
|
|
92
|
+
color: "primary",
|
|
93
|
+
required: true,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const RadioGroupFieldColumnDirection: Story = {
|
|
98
|
+
args: {
|
|
99
|
+
label: "Required Radio Group",
|
|
100
|
+
size: "medium",
|
|
101
|
+
color: "primary",
|
|
102
|
+
required: true,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const RadioGroupFieldWithReactNodeOptions: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
size: "medium",
|
|
109
|
+
color: "primary",
|
|
110
|
+
label: "",
|
|
111
|
+
options: [
|
|
112
|
+
{
|
|
113
|
+
values: "option1",
|
|
114
|
+
label: (
|
|
115
|
+
<Typography variant="body1">Radio Button with TextField</Typography>
|
|
116
|
+
),
|
|
117
|
+
disabled: false,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
render: (args) => {
|
|
122
|
+
const { control } = useForm<FieldValues>({
|
|
123
|
+
defaultValues: {
|
|
124
|
+
textFieldValue: "",
|
|
125
|
+
radioOption: "",
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<Stack gap="10px" direction="row">
|
|
131
|
+
<RadioGroupField {...args} control={control} name="radioOption" />
|
|
132
|
+
<TextField
|
|
133
|
+
name="textFieldValue"
|
|
134
|
+
control={control}
|
|
135
|
+
variant="outlined"
|
|
136
|
+
placeholder="Enter additional details"
|
|
137
|
+
/>
|
|
138
|
+
</Stack>
|
|
139
|
+
);
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const RadioGroupFieldPropsWithLabelDescription: Story = {
|
|
144
|
+
args: {
|
|
145
|
+
size: "medium",
|
|
146
|
+
color: "primary",
|
|
147
|
+
label: "",
|
|
148
|
+
options: [
|
|
149
|
+
{
|
|
150
|
+
values: "option1",
|
|
151
|
+
label: (
|
|
152
|
+
<Stack gap="5px">
|
|
153
|
+
<Typography variant="body1">
|
|
154
|
+
Radio Button with Description
|
|
155
|
+
</Typography>
|
|
156
|
+
<Typography variant="body2">Additional details</Typography>
|
|
157
|
+
</Stack>
|
|
158
|
+
),
|
|
159
|
+
disabled: false,
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
render: (args) => {
|
|
164
|
+
const { control } = useForm<FieldValues>({
|
|
165
|
+
defaultValues: {
|
|
166
|
+
example: "",
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
return <RadioGroupField {...args} name="example" control={control} />;
|
|
171
|
+
},
|
|
172
|
+
};
|