@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,74 @@
|
|
|
1
|
+
import { SearchField } 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 SearchField> = {
|
|
7
|
+
title: "shared-component/FormFields/SearchField",
|
|
8
|
+
component: SearchField,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
label: {
|
|
12
|
+
control: "text",
|
|
13
|
+
},
|
|
14
|
+
placeholder: {
|
|
15
|
+
control: "text",
|
|
16
|
+
},
|
|
17
|
+
required: {
|
|
18
|
+
control: "boolean",
|
|
19
|
+
},
|
|
20
|
+
loading: {
|
|
21
|
+
control: "boolean",
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
control: "boolean",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
render: (args) => {
|
|
28
|
+
const { control } = useForm<FieldValues>({
|
|
29
|
+
defaultValues: {
|
|
30
|
+
search: "",
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return <SearchField {...args} name="search" control={control} />;
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
placeholder: "Search...",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default meta;
|
|
42
|
+
|
|
43
|
+
type Story = StoryObj<typeof SearchField>;
|
|
44
|
+
|
|
45
|
+
export const DefaultSearchField: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
label: "Default Search",
|
|
48
|
+
required: false,
|
|
49
|
+
disabled: false,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const DisabledSearchField: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
label: "Disabled Search",
|
|
56
|
+
disabled: true,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const LoadingSearchField: Story = {
|
|
61
|
+
args: {
|
|
62
|
+
label: "Loading Search",
|
|
63
|
+
loading: true,
|
|
64
|
+
disabled: false,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const RequiredSearchField: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
label: "Required Search",
|
|
71
|
+
required: true,
|
|
72
|
+
disabled: false,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { TextField } 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 TextField> = {
|
|
7
|
+
title: "shared-component/FormFields/TextField",
|
|
8
|
+
component: TextField,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
argTypes: {
|
|
11
|
+
type: {
|
|
12
|
+
options: ["text", "number", "password"],
|
|
13
|
+
control: { type: "select" },
|
|
14
|
+
},
|
|
15
|
+
label: {
|
|
16
|
+
control: "text",
|
|
17
|
+
},
|
|
18
|
+
placeholder: {
|
|
19
|
+
control: "text",
|
|
20
|
+
},
|
|
21
|
+
loading: {
|
|
22
|
+
control: "boolean",
|
|
23
|
+
},
|
|
24
|
+
required: {
|
|
25
|
+
control: "boolean",
|
|
26
|
+
},
|
|
27
|
+
isCapitalize: {
|
|
28
|
+
control: "boolean",
|
|
29
|
+
},
|
|
30
|
+
isTrimStartDisabled: {
|
|
31
|
+
control: "boolean",
|
|
32
|
+
},
|
|
33
|
+
characterType: {
|
|
34
|
+
options: ["string", "string-number", "string-number-special"],
|
|
35
|
+
control: { type: "select" },
|
|
36
|
+
},
|
|
37
|
+
letterCase: {
|
|
38
|
+
options: ["uppercase", "lowercase", "mixed"],
|
|
39
|
+
control: { type: "select" },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
render: (args) => {
|
|
43
|
+
const { control, setError } = useForm<FieldValues>({
|
|
44
|
+
defaultValues: {
|
|
45
|
+
example: "",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<TextField
|
|
51
|
+
{...args}
|
|
52
|
+
name="example"
|
|
53
|
+
control={control}
|
|
54
|
+
setError={setError}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
args: {
|
|
59
|
+
placeholder: "Type here...",
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default meta;
|
|
64
|
+
|
|
65
|
+
type Story = StoryObj<typeof TextField>;
|
|
66
|
+
|
|
67
|
+
export const DefaultTextField: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
label: "Default Label",
|
|
70
|
+
type: "text",
|
|
71
|
+
isCapitalize: false,
|
|
72
|
+
isTrimStartDisabled: false,
|
|
73
|
+
required: false,
|
|
74
|
+
disabled: false,
|
|
75
|
+
characterType: "string-number",
|
|
76
|
+
letterCase: "lowercase",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const NumberField: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
label: "Number Field",
|
|
83
|
+
type: "number",
|
|
84
|
+
isCapitalize: false,
|
|
85
|
+
isTrimStartDisabled: true,
|
|
86
|
+
required: false,
|
|
87
|
+
disabled: false,
|
|
88
|
+
characterType: "string-number",
|
|
89
|
+
letterCase: "lowercase",
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const CapitalizedTextField: Story = {
|
|
94
|
+
args: {
|
|
95
|
+
label: "Capitalized Text Field",
|
|
96
|
+
type: "text",
|
|
97
|
+
isCapitalize: true,
|
|
98
|
+
isTrimStartDisabled: false,
|
|
99
|
+
required: false,
|
|
100
|
+
disabled: false,
|
|
101
|
+
characterType: "string-number",
|
|
102
|
+
letterCase: "uppercase",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const LoadingTextField: Story = {
|
|
107
|
+
args: {
|
|
108
|
+
label: "Loading State",
|
|
109
|
+
loading: true,
|
|
110
|
+
required: false,
|
|
111
|
+
disabled: true,
|
|
112
|
+
characterType: "string-number",
|
|
113
|
+
letterCase: "lowercase",
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const PasswordField: Story = {
|
|
118
|
+
args: {
|
|
119
|
+
label: "Password",
|
|
120
|
+
type: "password",
|
|
121
|
+
isCapitalize: false,
|
|
122
|
+
isTrimStartDisabled: false,
|
|
123
|
+
required: true,
|
|
124
|
+
characterType: "string-number-special",
|
|
125
|
+
letterCase: "mixed",
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const TextInputValidation: Story = {
|
|
130
|
+
args: {
|
|
131
|
+
label: "Text Input Validation",
|
|
132
|
+
type: "text",
|
|
133
|
+
isCapitalize: false,
|
|
134
|
+
isTrimStartDisabled: false,
|
|
135
|
+
required: true,
|
|
136
|
+
error: true,
|
|
137
|
+
helperText: "This field is required",
|
|
138
|
+
characterType: "string",
|
|
139
|
+
letterCase: "lowercase",
|
|
140
|
+
},
|
|
141
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { FieldValues } from "react-hook-form";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { DateTime } from "luxon";
|
|
5
|
+
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
6
|
+
import { AdapterLuxon } from "@mui/x-date-pickers/AdapterLuxon";
|
|
7
|
+
import { TimeField } from "@repo/shared-components";
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof TimeField> = {
|
|
10
|
+
title: "shared-component/FormFields/TimeField",
|
|
11
|
+
component: TimeField,
|
|
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: ["HH:mm", "hh:mm a"],
|
|
30
|
+
control: { type: "select" },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
render: (args) => {
|
|
34
|
+
const { control } = useForm<FieldValues>({
|
|
35
|
+
defaultValues: {
|
|
36
|
+
timeField: DateTime.now().toISOTime(),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return <TimeField {...args} name="timeField" control={control} />;
|
|
41
|
+
},
|
|
42
|
+
args: {
|
|
43
|
+
label: "Select Time",
|
|
44
|
+
required: false,
|
|
45
|
+
disabled: false,
|
|
46
|
+
readOnly: false,
|
|
47
|
+
error: false,
|
|
48
|
+
helperText: "",
|
|
49
|
+
loading: false,
|
|
50
|
+
format: "HH:mm",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default meta;
|
|
55
|
+
|
|
56
|
+
type Story = StoryObj<typeof TimeField>;
|
|
57
|
+
|
|
58
|
+
export const DefaultTimeField: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
label: "Select Time",
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const RequiredTimeField: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
label: "Required Time",
|
|
67
|
+
required: true,
|
|
68
|
+
helperText: "This field is required",
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const DisabledTimeField: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
label: "Disabled Time Picker",
|
|
75
|
+
disabled: true,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const ReadOnlyTimeField: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
label: "Read-Only Time Picker",
|
|
82
|
+
readOnly: true,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { FieldValues } from "react-hook-form";
|
|
3
|
+
import { useForm } from "react-hook-form";
|
|
4
|
+
import { DateTime } from "luxon";
|
|
5
|
+
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
6
|
+
import { AdapterLuxon } from "@mui/x-date-pickers/AdapterLuxon";
|
|
7
|
+
import { TimePicker } from "@repo/shared-components";
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof TimePicker> = {
|
|
10
|
+
title: "shared-component/FormFields/TimePicker",
|
|
11
|
+
component: TimePicker,
|
|
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: ["HH:mm", "hh:mm a"],
|
|
30
|
+
control: { type: "select" },
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
render: (args) => {
|
|
34
|
+
const { control } = useForm<FieldValues>({
|
|
35
|
+
defaultValues: {
|
|
36
|
+
timeField: DateTime.now().toISOTime(),
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
return <TimePicker {...args} name="timeField" control={control} />;
|
|
41
|
+
},
|
|
42
|
+
args: {
|
|
43
|
+
label: "Select Time",
|
|
44
|
+
required: false,
|
|
45
|
+
disabled: false,
|
|
46
|
+
readOnly: false,
|
|
47
|
+
error: false,
|
|
48
|
+
helperText: "",
|
|
49
|
+
loading: false,
|
|
50
|
+
format: "HH:mm",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default meta;
|
|
55
|
+
|
|
56
|
+
type Story = StoryObj<typeof TimePicker>;
|
|
57
|
+
|
|
58
|
+
export const DefaultTimePicker: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
label: "Select Time",
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const RequiredTimePicker: Story = {
|
|
65
|
+
args: {
|
|
66
|
+
label: "Required Time",
|
|
67
|
+
required: true,
|
|
68
|
+
helperText: "This field is required",
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const DisabledTimePicker: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
label: "Disabled Time Picker",
|
|
75
|
+
disabled: true,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const ReadOnlyTimePicker: Story = {
|
|
80
|
+
args: {
|
|
81
|
+
label: "Read-Only Time Picker",
|
|
82
|
+
readOnly: true,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Indicator } from "@repo/shared-components";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Indicator> = {
|
|
5
|
+
title: "shared-component/Indicator",
|
|
6
|
+
component: Indicator,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
variant: {
|
|
10
|
+
control: "select",
|
|
11
|
+
options: [
|
|
12
|
+
"holiday",
|
|
13
|
+
"weekly_off",
|
|
14
|
+
"paid_leave",
|
|
15
|
+
"absent",
|
|
16
|
+
"unpaid_leave",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
args: {
|
|
21
|
+
variant: "holiday",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
type Story = StoryObj<typeof Indicator>;
|
|
28
|
+
|
|
29
|
+
export const DefaultIndicator: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
label: "Holiday",
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SeverityIndicator } from "@repo/shared-components";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof SeverityIndicator> = {
|
|
5
|
+
title: "shared-component/Indicator/SeverityIndicator",
|
|
6
|
+
component: SeverityIndicator,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
isBackground: {
|
|
10
|
+
options: [true, false],
|
|
11
|
+
control: {
|
|
12
|
+
type: "select",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
label: "Present",
|
|
18
|
+
color: "hsla(136, 59%, 49%, 1)",
|
|
19
|
+
isBackground: false,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
|
|
25
|
+
type Story = StoryObj<typeof SeverityIndicator>;
|
|
26
|
+
|
|
27
|
+
export const DefaultSeverityIndicator: Story = {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Box, Typography } from "@mui/material";
|
|
2
|
+
import { FormRow } from "@repo/shared-components";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof FormRow> = {
|
|
6
|
+
title: "shared-component/Layouts/FormRow",
|
|
7
|
+
component: FormRow,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
argTypes: {
|
|
10
|
+
maxColumn: {
|
|
11
|
+
options: [1, 2, 3],
|
|
12
|
+
control: {
|
|
13
|
+
type: "select",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
render: (args) => {
|
|
18
|
+
const childrenArray = Array.from({ length: args.maxColumn ?? 1 });
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<FormRow {...args}>
|
|
22
|
+
{childrenArray.map((_, index) => (
|
|
23
|
+
<Box
|
|
24
|
+
sx={{ height: "50px", backgroundColor: "lightblue" }}
|
|
25
|
+
key={index + 1}
|
|
26
|
+
>
|
|
27
|
+
<Typography variant="caption">Item {index + 1}</Typography>
|
|
28
|
+
</Box>
|
|
29
|
+
))}
|
|
30
|
+
</FormRow>
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default meta;
|
|
36
|
+
|
|
37
|
+
type Story = StoryObj<typeof FormRow>;
|
|
38
|
+
|
|
39
|
+
export const DefaultFormRow: Story = {};
|
|
40
|
+
|
|
41
|
+
export const FullWidthFormRow: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
fullWidth: true,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Stack, Typography } from "@mui/material";
|
|
2
|
+
import { PadBox } from "@repo/shared-components";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof PadBox> = {
|
|
6
|
+
title: "shared-component/PadBox",
|
|
7
|
+
component: PadBox,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
render: (args) => {
|
|
10
|
+
return (
|
|
11
|
+
<PadBox {...args}>
|
|
12
|
+
<Stack
|
|
13
|
+
justifyContent="center"
|
|
14
|
+
alignItems="center"
|
|
15
|
+
sx={{ width: "100%", height: "50px", backgroundColor: "lightblue" }}
|
|
16
|
+
>
|
|
17
|
+
<Typography variant="caption">Content inside PadBox</Typography>
|
|
18
|
+
</Stack>
|
|
19
|
+
</PadBox>
|
|
20
|
+
);
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof PadBox>;
|
|
27
|
+
|
|
28
|
+
export const DefaultPadBox: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
padding: { padding: "20px" },
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const NoPaddingPadBox: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
padding: { padding: "0px" },
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const CustomPaddingPadBox: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
padding: {
|
|
43
|
+
paddingTop: "50px",
|
|
44
|
+
paddingBottom: "30px",
|
|
45
|
+
paddingLeft: "10px",
|
|
46
|
+
paddingRight: "10px",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Stepper } from "@repo/shared-components";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof Stepper> = {
|
|
5
|
+
title: "shared-component/Stepper/Stepper",
|
|
6
|
+
component: Stepper,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
activeStep: {
|
|
10
|
+
description: "Set the active step (zero-based index).",
|
|
11
|
+
control: { type: "number", min: -1 },
|
|
12
|
+
defaultValue: 0,
|
|
13
|
+
},
|
|
14
|
+
orientation: {
|
|
15
|
+
description: "The component orientation (layout flow direction).",
|
|
16
|
+
control: {
|
|
17
|
+
type: "select",
|
|
18
|
+
options: ["horizontal", "vertical"],
|
|
19
|
+
},
|
|
20
|
+
defaultValue: "horizontal",
|
|
21
|
+
},
|
|
22
|
+
alternativeLabel: {
|
|
23
|
+
description:
|
|
24
|
+
"If true and orientation is horizontal, step label will be under the icon.",
|
|
25
|
+
control: { type: "boolean" },
|
|
26
|
+
defaultValue: false,
|
|
27
|
+
},
|
|
28
|
+
stepLabelProps: {
|
|
29
|
+
description: "Props applied to the StepLabel component.",
|
|
30
|
+
control: { type: "object" },
|
|
31
|
+
defaultValue: {},
|
|
32
|
+
},
|
|
33
|
+
showActiveStepIcon: {
|
|
34
|
+
description: "Whether to show custom active step icon styling.",
|
|
35
|
+
control: { type: "boolean" },
|
|
36
|
+
defaultValue: false,
|
|
37
|
+
},
|
|
38
|
+
stepUrls: {
|
|
39
|
+
description:
|
|
40
|
+
"Array of URLs. On clicking a step, the user will be redirected to the corresponding URL.",
|
|
41
|
+
control: { type: "object" },
|
|
42
|
+
},
|
|
43
|
+
errorSteps: {
|
|
44
|
+
description: "Array of step indexes to highlight as errors (red color).",
|
|
45
|
+
control: { type: "object" },
|
|
46
|
+
},
|
|
47
|
+
onStepClick: {
|
|
48
|
+
description:
|
|
49
|
+
"Optional callback function to execute when a step is clicked. Overrides stepUrls if provided.",
|
|
50
|
+
control: false,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default meta;
|
|
56
|
+
|
|
57
|
+
type Story = StoryObj<typeof Stepper>;
|
|
58
|
+
|
|
59
|
+
export const DefaultStepper: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
steps: ["Step 1", "Step 2", "Step 3"],
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const HorizontalAlternativeLabel: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
steps: ["Step 1", "Step 2", "Step 3"],
|
|
68
|
+
orientation: "horizontal",
|
|
69
|
+
alternativeLabel: true,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const VerticalStepper: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
steps: ["Step 1", "Step 2", "Step 3"],
|
|
76
|
+
orientation: "vertical",
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const ErrorStep: Story = {
|
|
81
|
+
args: {
|
|
82
|
+
steps: ["Step 1", "Step 2 (Error)", "Step 3"],
|
|
83
|
+
activeStep: 1,
|
|
84
|
+
errorSteps: [1],
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const CustomActiveStepIcon: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
steps: ["Step 1", "Step 2", "Step 3"],
|
|
91
|
+
activeStep: 1,
|
|
92
|
+
showActiveStepIcon: true,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const StepWithUrls: Story = {
|
|
97
|
+
args: {
|
|
98
|
+
steps: ["Home", "Profile", "Settings"],
|
|
99
|
+
stepUrls: ["/home", "/profile", "/settings"],
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const StepWithErrorAndUrls: Story = {
|
|
104
|
+
args: {
|
|
105
|
+
steps: ["Step 1", "Step 2 (Error)", "Step 3"],
|
|
106
|
+
errorSteps: [1],
|
|
107
|
+
stepUrls: ["/step-1", "/step-2", "/step-3"],
|
|
108
|
+
activeStep: 0,
|
|
109
|
+
},
|
|
110
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { StepperV2 } from "@repo/shared-components";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof StepperV2> = {
|
|
5
|
+
title: "shared-component/Stepper/StepperV2",
|
|
6
|
+
component: StepperV2,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
activeStep: {
|
|
10
|
+
description: "Set the active step (zero-based index).",
|
|
11
|
+
control: { type: "number", min: -1 },
|
|
12
|
+
defaultValue: 0,
|
|
13
|
+
},
|
|
14
|
+
orientation: {
|
|
15
|
+
description: "The component orientation (layout flow direction).",
|
|
16
|
+
control: {
|
|
17
|
+
type: "select",
|
|
18
|
+
options: ["horizontal", "vertical"],
|
|
19
|
+
},
|
|
20
|
+
defaultValue: "horizontal",
|
|
21
|
+
},
|
|
22
|
+
alternativeLabel: {
|
|
23
|
+
description:
|
|
24
|
+
"If true and orientation is horizontal, step label will be under the icon.",
|
|
25
|
+
control: { type: "boolean" },
|
|
26
|
+
defaultValue: false,
|
|
27
|
+
},
|
|
28
|
+
stepLabelProps: {
|
|
29
|
+
description: "Props applied to the StepLabel component.",
|
|
30
|
+
control: { type: "object" },
|
|
31
|
+
defaultValue: {},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default meta;
|
|
37
|
+
|
|
38
|
+
type Story = StoryObj<typeof StepperV2>;
|
|
39
|
+
|
|
40
|
+
export const CustomizedSteppers: Story = {
|
|
41
|
+
args: {
|
|
42
|
+
steps: ["Step 1", "Step 2", "Step 3"],
|
|
43
|
+
},
|
|
44
|
+
};
|