@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,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgAdd } from "../Svgs";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type AddActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const AddAction = (props: AddActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="Add">
|
|
12
|
+
<SvgAdd />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgCalendar } from "../Svgs";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type CalendarActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const CalendarAction = (props: CalendarActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton sx={{ color: "#4C5D70" }} {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="Calendar">
|
|
12
|
+
<SvgCalendar />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgConfigure } from "../Svgs";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type ConfigureActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const ConfigureAction = (props: ConfigureActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="Configure">
|
|
12
|
+
<SvgConfigure />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgDelete } from "../Svgs/SvgDelete";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type DeleteActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const DeleteAction = (props: DeleteActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="Delete">
|
|
12
|
+
<SvgDelete />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgDownload } from "../Svgs";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type DownloadActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const DownloadAction = (props: DownloadActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="Download">
|
|
12
|
+
<SvgDownload />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgsEdit } from "../Svgs/SvgsEdit";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type EditActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const EditAction = (props: EditActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="Edit">
|
|
12
|
+
<SvgsEdit />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgExport } from "../Svgs";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type ExportActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const ExportAction = (props: ExportActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="Export">
|
|
12
|
+
<SvgExport />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgFilterList } from "../Svgs/SvgFilterList";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type FilterActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const FilterAction = (props: FilterActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="Filter">
|
|
12
|
+
<SvgFilterList />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgsHistory } from "../Svgs/SvgsHistory";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type HistoryActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const HistoryAction = (props: HistoryActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="History">
|
|
12
|
+
<SvgsHistory />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgImport } from "../Svgs";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type ImportActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const ImportAction = (props: ImportActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="Import">
|
|
12
|
+
<SvgImport />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconButtonProps } from "@mui/material";
|
|
2
|
+
import { IconButton } from "@mui/material";
|
|
3
|
+
import { SvgView } from "../Svgs";
|
|
4
|
+
import { Tooltip } from "../Tooltip";
|
|
5
|
+
|
|
6
|
+
export type ViewActionProps = IconButtonProps;
|
|
7
|
+
|
|
8
|
+
export const ViewAction = (props: ViewActionProps) => {
|
|
9
|
+
return (
|
|
10
|
+
<IconButton {...props}>
|
|
11
|
+
<Tooltip toolTipLabel="View">
|
|
12
|
+
<SvgView />
|
|
13
|
+
</Tooltip>
|
|
14
|
+
</IconButton>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./AddAction";
|
|
2
|
+
export * from "./CalendarAction";
|
|
3
|
+
export * from "./ConfigureAction";
|
|
4
|
+
export * from "./DeleteAction";
|
|
5
|
+
export * from "./DownloadAction";
|
|
6
|
+
export * from "./EditAction";
|
|
7
|
+
export * from "./ExportAction";
|
|
8
|
+
export * from "./FilterAction";
|
|
9
|
+
export * from "./HistoryAction";
|
|
10
|
+
export * from "./ImportAction";
|
|
11
|
+
export * from "./ViewAction";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import MoreVertIcon from "@mui/icons-material/MoreVert";
|
|
2
|
+
import { Box, IconButton, ListItemButton, Stack } from "@mui/material";
|
|
3
|
+
import { type MouseEvent, useState } from "react";
|
|
4
|
+
import { PadBox } from "../../PadBox";
|
|
5
|
+
import { Popover } from "./Popover";
|
|
6
|
+
|
|
7
|
+
type AgGridActionColumn = {
|
|
8
|
+
title: string;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type ActionColumnProps = {
|
|
13
|
+
items: AgGridActionColumn[];
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
};
|
|
16
|
+
export const ActionCell = ({ items, disabled }: ActionColumnProps) => {
|
|
17
|
+
const [anchorEl, setAnchorEl] = useState<HTMLDivElement | null>(null);
|
|
18
|
+
|
|
19
|
+
const HandleClose = () => {
|
|
20
|
+
setAnchorEl(null);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const HandleClick = (event: MouseEvent<HTMLDivElement>) => {
|
|
24
|
+
setAnchorEl(event.currentTarget);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Box sx={{ width: "100%" }}>
|
|
29
|
+
<IconButton
|
|
30
|
+
component="div"
|
|
31
|
+
sx={{ cursor: "pointer", alignItems: "center", width: "100%" }}
|
|
32
|
+
onClick={HandleClick}
|
|
33
|
+
disabled={disabled}
|
|
34
|
+
>
|
|
35
|
+
<MoreVertIcon />
|
|
36
|
+
</IconButton>
|
|
37
|
+
{!!anchorEl && (
|
|
38
|
+
<Popover open={true} anchorEl={anchorEl} onClose={HandleClose}>
|
|
39
|
+
<PadBox padding={{ padding: "2px" }}>
|
|
40
|
+
{items.map((item) => {
|
|
41
|
+
return (
|
|
42
|
+
<Stack key={item.title}>
|
|
43
|
+
<ListItemButton
|
|
44
|
+
sx={{ width: "100%", textAlign: "center" }}
|
|
45
|
+
onClick={() => item?.onClick()}
|
|
46
|
+
>
|
|
47
|
+
{item.title}
|
|
48
|
+
</ListItemButton>
|
|
49
|
+
</Stack>
|
|
50
|
+
);
|
|
51
|
+
})}
|
|
52
|
+
</PadBox>
|
|
53
|
+
</Popover>
|
|
54
|
+
)}
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PopoverProps } from "@mui/material";
|
|
2
|
+
import { Popover as MuiPopover } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
export const Popover = ({
|
|
5
|
+
open,
|
|
6
|
+
anchorEl,
|
|
7
|
+
children,
|
|
8
|
+
onClose,
|
|
9
|
+
}: PopoverProps) => {
|
|
10
|
+
return (
|
|
11
|
+
<MuiPopover
|
|
12
|
+
open={open}
|
|
13
|
+
anchorEl={anchorEl}
|
|
14
|
+
onClose={onClose}
|
|
15
|
+
anchorOrigin={{
|
|
16
|
+
vertical: "bottom",
|
|
17
|
+
horizontal: "center",
|
|
18
|
+
}}
|
|
19
|
+
transformOrigin={{
|
|
20
|
+
vertical: "top",
|
|
21
|
+
horizontal: "right",
|
|
22
|
+
}}
|
|
23
|
+
sx={{
|
|
24
|
+
"& .MuiPaper-root": {
|
|
25
|
+
width: "auto",
|
|
26
|
+
},
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</MuiPopover>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Box, Typography, useTheme } from "@mui/material";
|
|
2
|
+
import type { AgGridReactProps } from "ag-grid-react";
|
|
3
|
+
import { AgGridReact } from "ag-grid-react";
|
|
4
|
+
import type { Ref } from "react";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
|
|
7
|
+
export const defaultPageSize = 50;
|
|
8
|
+
|
|
9
|
+
export const pageSizeOptions = [20, 50, 100, 200];
|
|
10
|
+
|
|
11
|
+
//TODO: jaydip, fix unknown type
|
|
12
|
+
export type AgGridProps<T = unknown> = AgGridReactProps<T> & {
|
|
13
|
+
height?: string;
|
|
14
|
+
ref?: Ref<AgGridReact<T>>;
|
|
15
|
+
totalRecords?: number;
|
|
16
|
+
overlayNoRowsTemplate?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type AgGridType = React.ForwardRefExoticComponent<AgGridProps> &
|
|
20
|
+
(<GenericType>(props: AgGridProps<GenericType>) => JSX.Element);
|
|
21
|
+
|
|
22
|
+
export const AgGrid = forwardRef(
|
|
23
|
+
<T,>(props: AgGridProps<T>, ref: Ref<AgGridReact<T>>) => {
|
|
24
|
+
const {
|
|
25
|
+
cacheBlockSize = defaultPageSize,
|
|
26
|
+
defaultColDef = {
|
|
27
|
+
flex: 1,
|
|
28
|
+
floatingFilter: false,
|
|
29
|
+
filterParams: {
|
|
30
|
+
buttons: ["apply", "reset"],
|
|
31
|
+
closeOnApply: true,
|
|
32
|
+
contains: false,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
height = "597px",
|
|
36
|
+
rowHeight = 50,
|
|
37
|
+
rowModelType = "infinite",
|
|
38
|
+
rowBuffer = 5,
|
|
39
|
+
totalRecords,
|
|
40
|
+
// eslint-disable-next-line quotes
|
|
41
|
+
overlayNoRowsTemplate = '<span class="ag-overlay-no-rows-center">No Data Found</span>',
|
|
42
|
+
infiniteInitialRowCount = defaultPageSize,
|
|
43
|
+
pagination = false,
|
|
44
|
+
...rest
|
|
45
|
+
} = props;
|
|
46
|
+
|
|
47
|
+
const {
|
|
48
|
+
palette: {
|
|
49
|
+
app: { color },
|
|
50
|
+
},
|
|
51
|
+
} = useTheme();
|
|
52
|
+
|
|
53
|
+
if (totalRecords === 0) {
|
|
54
|
+
return (
|
|
55
|
+
<Box
|
|
56
|
+
sx={{
|
|
57
|
+
borderRadius: "4px",
|
|
58
|
+
margin: "20px",
|
|
59
|
+
display: "flex",
|
|
60
|
+
justifyContent: "center",
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
height: "300px",
|
|
63
|
+
textAlign: "center",
|
|
64
|
+
backgroundColor: color.butterflyBlue[700],
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
<Typography variant="h6">No result found</Typography>
|
|
68
|
+
</Box>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<div className="ag-theme-quartz " style={{ width: "100%", height }}>
|
|
74
|
+
<AgGridReact<T>
|
|
75
|
+
ref={ref}
|
|
76
|
+
cacheBlockSize={cacheBlockSize}
|
|
77
|
+
defaultColDef={defaultColDef}
|
|
78
|
+
rowHeight={rowHeight}
|
|
79
|
+
rowModelType={rowModelType}
|
|
80
|
+
rowBuffer={rowBuffer}
|
|
81
|
+
infiniteInitialRowCount={infiniteInitialRowCount}
|
|
82
|
+
overlayNoRowsTemplate={overlayNoRowsTemplate}
|
|
83
|
+
pagination={pagination}
|
|
84
|
+
{...(pagination ? { paginationPageSize: defaultPageSize } : {})}
|
|
85
|
+
paginationPageSizeSelector={pagination ? pageSizeOptions : false}
|
|
86
|
+
{...rest}
|
|
87
|
+
/>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
) as AgGridType;
|
|
92
|
+
|
|
93
|
+
AgGrid.displayName = "AgGrid";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { styled } from "@mui/material";
|
|
2
|
+
import type { AppBarProps as MuiAppBarProps } from "@mui/material/AppBar";
|
|
3
|
+
import MuiAppBar from "@mui/material/AppBar";
|
|
4
|
+
import type { ComponentType } from "react";
|
|
5
|
+
|
|
6
|
+
type StyledAppBarProps = {
|
|
7
|
+
open?: boolean;
|
|
8
|
+
} & MuiAppBarProps;
|
|
9
|
+
|
|
10
|
+
export const StyledAppBar: ComponentType<StyledAppBarProps> = styled(
|
|
11
|
+
MuiAppBar,
|
|
12
|
+
{
|
|
13
|
+
shouldForwardProp: (prop) => prop !== "open",
|
|
14
|
+
}
|
|
15
|
+
)<StyledAppBarProps>(({ theme, open }) => ({
|
|
16
|
+
background: theme.palette.app.color.iron[600],
|
|
17
|
+
boxShadow: "unset",
|
|
18
|
+
zIndex: theme.zIndex.drawer + 1,
|
|
19
|
+
transition: theme.transitions.create(["width", "margin"], {
|
|
20
|
+
easing: theme.transitions.easing.sharp,
|
|
21
|
+
duration: theme.transitions.duration.leavingScreen,
|
|
22
|
+
}),
|
|
23
|
+
marginLeft: "80px",
|
|
24
|
+
width: "calc(100% - 80px)",
|
|
25
|
+
...(open && {
|
|
26
|
+
marginLeft: "300px",
|
|
27
|
+
width: "calc(100% - 300px)",
|
|
28
|
+
transition: theme.transitions.create(["width", "margin"], {
|
|
29
|
+
easing: theme.transitions.easing.sharp,
|
|
30
|
+
duration: theme.transitions.duration.enteringScreen,
|
|
31
|
+
}),
|
|
32
|
+
}),
|
|
33
|
+
}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Toolbar } from "@mui/material";
|
|
4
|
+
import type { PropsWithChildren } from "react";
|
|
5
|
+
import { StyledAppBar } from "./AppBar.styled";
|
|
6
|
+
|
|
7
|
+
export type AppBarProps = {
|
|
8
|
+
drawerOpen: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const AppBar = ({
|
|
12
|
+
drawerOpen,
|
|
13
|
+
children,
|
|
14
|
+
}: PropsWithChildren<AppBarProps>) => {
|
|
15
|
+
return (
|
|
16
|
+
<StyledAppBar position="fixed" open={drawerOpen}>
|
|
17
|
+
<Toolbar>{children}</Toolbar>
|
|
18
|
+
</StyledAppBar>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AppBar } from "./AppBar";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
IconButton,
|
|
4
|
+
Link,
|
|
5
|
+
Breadcrumbs as MuiBreadcrumbs,
|
|
6
|
+
Typography,
|
|
7
|
+
useTheme,
|
|
8
|
+
} from "@mui/material";
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
import { v4 as uuidv4 } from "uuid";
|
|
11
|
+
|
|
12
|
+
type BreadcrumbItem = {
|
|
13
|
+
icon?: ReactNode;
|
|
14
|
+
text?: string;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type BreadcrumbProps = {
|
|
19
|
+
items: BreadcrumbItem[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Breadcrumbs = ({ items }: BreadcrumbProps) => {
|
|
23
|
+
const theme = useTheme();
|
|
24
|
+
|
|
25
|
+
const { butterflyBlue } = theme.palette.app.color;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<MuiBreadcrumbs>
|
|
29
|
+
{items.map((item) => {
|
|
30
|
+
const { icon, text, onClick } = item;
|
|
31
|
+
|
|
32
|
+
if (onClick) {
|
|
33
|
+
return (
|
|
34
|
+
<Link
|
|
35
|
+
key={uuidv4()}
|
|
36
|
+
underline="hover"
|
|
37
|
+
sx={{ display: "flex", alignItems: "center" }}
|
|
38
|
+
onClick={(e) => {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
|
|
41
|
+
onClick();
|
|
42
|
+
}}
|
|
43
|
+
href="#"
|
|
44
|
+
>
|
|
45
|
+
{icon && (
|
|
46
|
+
<IconButton
|
|
47
|
+
sx={{
|
|
48
|
+
color: butterflyBlue[900],
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{icon}
|
|
52
|
+
</IconButton>
|
|
53
|
+
)}
|
|
54
|
+
{text && <Typography>{text}</Typography>}
|
|
55
|
+
</Link>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Box key={uuidv4()}>
|
|
61
|
+
{icon && (
|
|
62
|
+
<IconButton
|
|
63
|
+
sx={{
|
|
64
|
+
color: butterflyBlue[900],
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
{icon}
|
|
68
|
+
</IconButton>
|
|
69
|
+
)}
|
|
70
|
+
{text && <Typography>{text}</Typography>}
|
|
71
|
+
</Box>
|
|
72
|
+
);
|
|
73
|
+
})}
|
|
74
|
+
</MuiBreadcrumbs>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Breadcrumbs";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import ExpandMoreRoundedIcon from "@mui/icons-material/ExpandMoreRounded";
|
|
2
|
+
import type { ButtonProps as MuiButtonProps } from "@mui/material";
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
CircularProgress,
|
|
6
|
+
Divider,
|
|
7
|
+
Stack,
|
|
8
|
+
useTheme,
|
|
9
|
+
} from "@mui/material";
|
|
10
|
+
export type ActionButtonProps = MuiButtonProps & {
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const ActionButton = ({
|
|
15
|
+
loading = false,
|
|
16
|
+
children,
|
|
17
|
+
...rest
|
|
18
|
+
}: ActionButtonProps) => {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
|
|
21
|
+
const { lightBlue } = theme.palette.app.color;
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Button {...rest}>
|
|
25
|
+
<Stack gap="10px" flexDirection="row" alignItems="center">
|
|
26
|
+
{loading ? <CircularProgress size={28} /> : children}
|
|
27
|
+
<Divider
|
|
28
|
+
orientation="vertical"
|
|
29
|
+
sx={{
|
|
30
|
+
borderColor: lightBlue[100],
|
|
31
|
+
height: "22px",
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
<ExpandMoreRoundedIcon fontSize="small" />
|
|
35
|
+
</Stack>
|
|
36
|
+
</Button>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ButtonProps as MuiButtonProps } from "@mui/material";
|
|
2
|
+
import { CircularProgress, Button as MuiButton } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
export type ButtonProps = MuiButtonProps & {
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Button = ({
|
|
9
|
+
loading = false,
|
|
10
|
+
children,
|
|
11
|
+
disabled = false,
|
|
12
|
+
...rest
|
|
13
|
+
}: ButtonProps) => {
|
|
14
|
+
return (
|
|
15
|
+
<MuiButton disabled={loading || disabled} {...rest}>
|
|
16
|
+
{loading ? <CircularProgress size={28} /> : children}
|
|
17
|
+
</MuiButton>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ButtonGroup as MuiButtonGroup } from "@mui/material";
|
|
2
|
+
import { isFunction } from "lodash";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { Button } from "./Button";
|
|
5
|
+
|
|
6
|
+
type ButtonObject = {
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
selected: boolean;
|
|
11
|
+
onClick: (value: string) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type ButtonGroupProps = {
|
|
15
|
+
renderButtons: ButtonObject[];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const ButtonGroup = ({ renderButtons }: ButtonGroupProps) => {
|
|
19
|
+
return (
|
|
20
|
+
<MuiButtonGroup sx={{ boxShadow: "none" }} aria-label="Basic button group">
|
|
21
|
+
{renderButtons?.map(({ icon, value, label, selected, onClick }) => (
|
|
22
|
+
<Button
|
|
23
|
+
variant={!selected ? "outlined" : "contained"}
|
|
24
|
+
key={value}
|
|
25
|
+
onClick={() => {
|
|
26
|
+
if (isFunction(onClick)) {
|
|
27
|
+
onClick(value);
|
|
28
|
+
}
|
|
29
|
+
}}
|
|
30
|
+
startIcon={icon}
|
|
31
|
+
>
|
|
32
|
+
{label}
|
|
33
|
+
</Button>
|
|
34
|
+
))}
|
|
35
|
+
</MuiButtonGroup>
|
|
36
|
+
);
|
|
37
|
+
};
|