@codezee/sixtify-brahma 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -2
- package/.github/workflows/deploy-storybook.yml +0 -40
- package/.husky/commit-msg +0 -4
- package/.husky/pre-commit +0 -4
- package/.husky/pre-push +0 -4
- package/.lintstagedrc +0 -5
- package/.prettierignore +0 -11
- package/.prettierrc +0 -22
- package/.vscode/extensions.json +0 -22
- package/.vscode/settings.json +0 -17
- package/apps/docs/.eslintrc.cjs +0 -4
- package/apps/docs/.eslintrc.js +0 -9
- package/apps/docs/.storybook/main.ts +0 -23
- package/apps/docs/.storybook/preview.tsx +0 -27
- package/apps/docs/next-env.d.ts +0 -5
- package/apps/docs/next.config.mjs +0 -4
- package/apps/docs/package.json +0 -38
- package/apps/docs/public/globals.css +0 -25
- package/apps/docs/stories/AgGrid/AgGrid.stories.tsx +0 -69
- package/apps/docs/stories/AppBar/AppBar.stories.tsx +0 -39
- package/apps/docs/stories/Breadcrumbs/Breadcrumbs.stories.tsx +0 -37
- package/apps/docs/stories/Button/ButtonGroup.stories.tsx +0 -99
- package/apps/docs/stories/Button/button.stories.tsx +0 -99
- package/apps/docs/stories/Card/AttendanceCard.stories.tsx +0 -37
- package/apps/docs/stories/Card/Card.stories.tsx +0 -39
- package/apps/docs/stories/Charts/PieChart.stories.tsx +0 -264
- package/apps/docs/stories/Chips/Chip.stories.tsx +0 -141
- package/apps/docs/stories/Chips/ChipWithBorder.stories.tsx +0 -18
- package/apps/docs/stories/Chips/FilterPill.stories.tsx +0 -24
- package/apps/docs/stories/Color/Color.stories.tsx +0 -14
- package/apps/docs/stories/Dialog/ButtomDialog.stories.tsx +0 -47
- package/apps/docs/stories/Dialog/DeleteDialog.stories.tsx +0 -31
- package/apps/docs/stories/Dialog/Dialog.stories.tsx +0 -47
- package/apps/docs/stories/Drawer/Drawer.stories.tsx +0 -94
- package/apps/docs/stories/FilterList/FilterList.stories.tsx +0 -88
- package/apps/docs/stories/FilterList/FilterListV2.stories.tsx +0 -92
- package/apps/docs/stories/FormFields/AutoComplete.stories.tsx +0 -87
- package/apps/docs/stories/FormFields/CheckBox.stories.tsx +0 -61
- package/apps/docs/stories/FormFields/DatePicker.stories.tsx +0 -98
- package/apps/docs/stories/FormFields/DateRangePicker.stories.tsx +0 -37
- package/apps/docs/stories/FormFields/FileUpload.stories.tsx +0 -83
- package/apps/docs/stories/FormFields/ImageUpload.stories.tsx +0 -69
- package/apps/docs/stories/FormFields/ListItemButton.stories.tsx +0 -59
- package/apps/docs/stories/FormFields/RadioGroupField.stories.tsx +0 -170
- package/apps/docs/stories/FormFields/SearchField.stories.tsx +0 -72
- package/apps/docs/stories/FormFields/TextField.stories.tsx +0 -111
- package/apps/docs/stories/FormFields/TimeField.stories.tsx +0 -82
- package/apps/docs/stories/FormFields/TimePicker.stories.tsx +0 -82
- package/apps/docs/stories/Indicator/Indicator.stories.tsx +0 -33
- package/apps/docs/stories/Indicator/SeverityIndicator.stories.tsx +0 -27
- package/apps/docs/stories/Layouts/FormRow.stories.tsx +0 -45
- package/apps/docs/stories/PadBox/PadBox.stories.tsx +0 -49
- package/apps/docs/stories/Stepper/Stepper.stories.tsx +0 -75
- package/apps/docs/stories/Stepper/StepperV2.stories.tsx +0 -44
- package/apps/docs/stories/Timeline/AttendanceStatus.stories.tsx +0 -29
- package/apps/docs/stories/Timeline/Timeline.stories.tsx +0 -38
- package/apps/docs/stories/Tooltip/Tooltip.stories.tsx +0 -30
- package/apps/docs/stories/UserProfileMenu/UserProfileMenu.stories.tsx +0 -112
- package/apps/docs/tsconfig.json +0 -19
- package/commitlint.config.cjs +0 -6
- package/index.ts +0 -1
- package/packages/eslint-config/README.md +0 -3
- package/packages/eslint-config/library.js +0 -88
- package/packages/eslint-config/next.js +0 -85
- package/packages/eslint-config/package.json +0 -19
- package/packages/eslint-config/react-internal.js +0 -89
- package/packages/shared-components/.eslintrc.js +0 -10
- package/packages/shared-components/package.json +0 -22
- package/packages/shared-components/src/Actions/AddAction.tsx +0 -13
- package/packages/shared-components/src/Actions/CalendarAction.tsx +0 -13
- package/packages/shared-components/src/Actions/ConfigureAction.tsx +0 -13
- package/packages/shared-components/src/Actions/DeleteAction.tsx +0 -13
- package/packages/shared-components/src/Actions/DownloadAction.tsx +0 -13
- package/packages/shared-components/src/Actions/EditAction.tsx +0 -13
- package/packages/shared-components/src/Actions/HistoryAction.tsx +0 -13
- package/packages/shared-components/src/Actions/index.ts +0 -7
- package/packages/shared-components/src/AgGrid/ActionCell/ActionCell.tsx +0 -57
- package/packages/shared-components/src/AgGrid/ActionCell/Popover.tsx +0 -32
- package/packages/shared-components/src/AgGrid/AgGrid.tsx +0 -93
- package/packages/shared-components/src/AgGrid/LoadingCell.tsx +0 -5
- package/packages/shared-components/src/AgGrid/index.ts +0 -3
- package/packages/shared-components/src/AppBar/AppBar.styled.tsx +0 -25
- package/packages/shared-components/src/AppBar/AppBar.tsx +0 -20
- package/packages/shared-components/src/AppBar/index.ts +0 -1
- package/packages/shared-components/src/Breadcrumbs/Breadcrumbs.tsx +0 -76
- package/packages/shared-components/src/Breadcrumbs/index.ts +0 -1
- package/packages/shared-components/src/Button/ActionButton.tsx +0 -38
- package/packages/shared-components/src/Button/Button.tsx +0 -19
- package/packages/shared-components/src/Button/ButtonGroup.tsx +0 -37
- package/packages/shared-components/src/Button/index.ts +0 -3
- package/packages/shared-components/src/Card/AttendanceCard.tsx +0 -51
- package/packages/shared-components/src/Card/Card.tsx +0 -34
- package/packages/shared-components/src/Card/CardItem/CardItem.tsx +0 -33
- package/packages/shared-components/src/Card/CardItem/CardItemValue.tsx +0 -98
- package/packages/shared-components/src/Card/CardItem/index.ts +0 -2
- package/packages/shared-components/src/Card/ProfileCard/ProfileCard.tsx +0 -40
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardBody.tsx +0 -53
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.tsx +0 -96
- package/packages/shared-components/src/Card/index.ts +0 -6
- package/packages/shared-components/src/Charts/PieChart.tsx +0 -81
- package/packages/shared-components/src/Charts/Skeleton.tsx +0 -36
- package/packages/shared-components/src/Charts/index.ts +0 -1
- package/packages/shared-components/src/Chips/Chip.tsx +0 -26
- package/packages/shared-components/src/Chips/ChipWithBorder.tsx +0 -39
- package/packages/shared-components/src/Chips/FilterPill.tsx +0 -47
- package/packages/shared-components/src/Chips/index.ts +0 -3
- package/packages/shared-components/src/Dialog/BottomDialog.styled.tsx +0 -28
- package/packages/shared-components/src/Dialog/BottomDialog.tsx +0 -37
- package/packages/shared-components/src/Dialog/DeleteDialog.tsx +0 -48
- package/packages/shared-components/src/Dialog/Dialog.tsx +0 -61
- package/packages/shared-components/src/Dialog/index.ts +0 -3
- package/packages/shared-components/src/Drawer/Bullet.tsx +0 -12
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItem.tsx +0 -57
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItemList.tsx +0 -109
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.tsx +0 -124
- package/packages/shared-components/src/Drawer/CloseDrawer/MenuItem.tsx +0 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/Popover.tsx +0 -45
- package/packages/shared-components/src/Drawer/CloseDrawer/Popper.tsx +0 -43
- package/packages/shared-components/src/Drawer/Drawer.styled.tsx +0 -51
- package/packages/shared-components/src/Drawer/Drawer.tsx +0 -55
- package/packages/shared-components/src/Drawer/MenuItem.tsx +0 -75
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerCollapse.tsx +0 -13
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItem.tsx +0 -46
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItemList.tsx +0 -197
- package/packages/shared-components/src/Drawer/index.ts +0 -1
- package/packages/shared-components/src/FilterList/FilterList.tsx +0 -172
- package/packages/shared-components/src/FilterList/FilterListV2.tsx +0 -515
- package/packages/shared-components/src/FilterList/FilterPopup.tsx +0 -148
- package/packages/shared-components/src/FilterList/FilterPopupWrapper.tsx +0 -113
- package/packages/shared-components/src/FilterList/FilterTypeWrapper.tsx +0 -58
- package/packages/shared-components/src/FilterList/getFormData.ts +0 -29
- package/packages/shared-components/src/FilterList/index.ts +0 -5
- package/packages/shared-components/src/FormFields/Autocomplete/Autocomplete.tsx +0 -510
- package/packages/shared-components/src/FormFields/Autocomplete/Skeleton.tsx +0 -26
- package/packages/shared-components/src/FormFields/Autocomplete/index.ts +0 -1
- package/packages/shared-components/src/FormFields/CheckBox/CheckBox.styled.tsx +0 -67
- package/packages/shared-components/src/FormFields/CheckBox/CheckBox.tsx +0 -44
- package/packages/shared-components/src/FormFields/CheckBox/Skeleton.tsx +0 -12
- package/packages/shared-components/src/FormFields/CheckBox/index.ts +0 -1
- package/packages/shared-components/src/FormFields/DatePicker/DatePicker.tsx +0 -217
- package/packages/shared-components/src/FormFields/DatePicker/Skeleton.tsx +0 -28
- package/packages/shared-components/src/FormFields/DatePicker/index.ts +0 -1
- package/packages/shared-components/src/FormFields/DateRangePicker/DateRangePicker.tsx +0 -96
- package/packages/shared-components/src/FormFields/DateRangePicker/Skeleton.tsx +0 -38
- package/packages/shared-components/src/FormFields/DateRangePicker/index.ts +0 -1
- package/packages/shared-components/src/FormFields/DateTimePicker/DateTimePicker.tsx +0 -250
- package/packages/shared-components/src/FormFields/DateTimePicker/Skeleton.tsx +0 -24
- package/packages/shared-components/src/FormFields/DateTimePicker/index.ts +0 -1
- package/packages/shared-components/src/FormFields/FileUpload/FileNames.tsx +0 -32
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.styled.tsx +0 -22
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.tsx +0 -157
- package/packages/shared-components/src/FormFields/FileUpload/Skeleton.tsx +0 -21
- package/packages/shared-components/src/FormFields/FileUpload/UploadedFileName.tsx +0 -27
- package/packages/shared-components/src/FormFields/FileUpload/index.ts +0 -2
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.styled.tsx +0 -16
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.tsx +0 -181
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUploadView.tsx +0 -65
- package/packages/shared-components/src/FormFields/ImageUpload/PhotoCaptureDialog.tsx +0 -74
- package/packages/shared-components/src/FormFields/ImageUpload/Skeleton.tsx +0 -31
- package/packages/shared-components/src/FormFields/ImageUpload/index.ts +0 -2
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.styled.tsx +0 -22
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.tsx +0 -52
- package/packages/shared-components/src/FormFields/ListItemButton/index.ts +0 -1
- package/packages/shared-components/src/FormFields/PasswordField/PasswordField.tsx +0 -50
- package/packages/shared-components/src/FormFields/PasswordField/index.ts +0 -1
- package/packages/shared-components/src/FormFields/RadioGroupField/RadioGroupField.tsx +0 -105
- package/packages/shared-components/src/FormFields/RadioGroupField/Skeleton.tsx +0 -26
- package/packages/shared-components/src/FormFields/RadioGroupField/index.ts +0 -1
- package/packages/shared-components/src/FormFields/SearchField/SearchField.tsx +0 -21
- package/packages/shared-components/src/FormFields/SearchField/index.ts +0 -1
- package/packages/shared-components/src/FormFields/Switch/Skeleton.tsx +0 -12
- package/packages/shared-components/src/FormFields/Switch/Switch.tsx +0 -33
- package/packages/shared-components/src/FormFields/Switch/index.ts +0 -1
- package/packages/shared-components/src/FormFields/TextField/Skeleton.tsx +0 -31
- package/packages/shared-components/src/FormFields/TextField/TextField.tsx +0 -92
- package/packages/shared-components/src/FormFields/TextField/index.ts +0 -1
- package/packages/shared-components/src/FormFields/TimeField/Skeleton.tsx +0 -24
- package/packages/shared-components/src/FormFields/TimeField/TimeField.tsx +0 -120
- package/packages/shared-components/src/FormFields/TimeField/index.ts +0 -1
- package/packages/shared-components/src/FormFields/TimePicker/Skeleton.tsx +0 -24
- package/packages/shared-components/src/FormFields/TimePicker/TimePicker.tsx +0 -168
- package/packages/shared-components/src/FormFields/TimePicker/index.ts +0 -1
- package/packages/shared-components/src/FormFields/index.ts +0 -13
- package/packages/shared-components/src/Indicator/Indicator.tsx +0 -18
- package/packages/shared-components/src/Indicator/SeverityIndicator.tsx +0 -34
- package/packages/shared-components/src/Indicator/index.ts +0 -2
- package/packages/shared-components/src/Layouts/FormContainer.tsx +0 -6
- package/packages/shared-components/src/Layouts/FormGridLayout.tsx +0 -27
- package/packages/shared-components/src/Layouts/FormRow/FormRow.styled.tsx +0 -39
- package/packages/shared-components/src/Layouts/FormRow/FormRow.tsx +0 -20
- package/packages/shared-components/src/Layouts/FormRow/index.ts +0 -1
- package/packages/shared-components/src/Layouts/FormSection.tsx +0 -22
- package/packages/shared-components/src/Layouts/index.ts +0 -4
- package/packages/shared-components/src/Loader/FacebookCircularProgress.tsx +0 -41
- package/packages/shared-components/src/Loader/index.ts +0 -1
- package/packages/shared-components/src/PadBox/PadBox.tsx +0 -21
- package/packages/shared-components/src/PadBox/index.ts +0 -1
- package/packages/shared-components/src/Pagination/Pagination.tsx +0 -42
- package/packages/shared-components/src/Pagination/index.ts +0 -1
- package/packages/shared-components/src/Stepper/Stepper.tsx +0 -54
- package/packages/shared-components/src/Stepper/StepperV2.tsx +0 -115
- package/packages/shared-components/src/Stepper/StepperV3.tsx +0 -72
- package/packages/shared-components/src/Stepper/index.ts +0 -3
- package/packages/shared-components/src/Svgs/AppLogo/AppLogoMedium.tsx +0 -65
- package/packages/shared-components/src/Svgs/AppLogo/AppLogoSmall.tsx +0 -48
- package/packages/shared-components/src/Svgs/ArrowUp.tsx +0 -11
- package/packages/shared-components/src/Svgs/Company/CompanyBanner.tsx +0 -480
- package/packages/shared-components/src/Svgs/Company/index.ts +0 -1
- package/packages/shared-components/src/Svgs/Drawer/SettingIcon.tsx +0 -31
- package/packages/shared-components/src/Svgs/Drawer/SvgBankConfig.tsx +0 -36
- package/packages/shared-components/src/Svgs/Drawer/SvgConfiguration.tsx +0 -16
- package/packages/shared-components/src/Svgs/Drawer/SvgPayroll.tsx +0 -32
- package/packages/shared-components/src/Svgs/Drawer/SvgsEmployees.tsx +0 -25
- package/packages/shared-components/src/Svgs/Drawer/SvgsOrganization.tsx +0 -36
- package/packages/shared-components/src/Svgs/Drawer/SvgsTransaction.tsx +0 -81
- package/packages/shared-components/src/Svgs/Drawer/index.ts +0 -7
- package/packages/shared-components/src/Svgs/FormAction.tsx +0 -118
- package/packages/shared-components/src/Svgs/ImportExcelSuccessIcon.tsx +0 -54
- package/packages/shared-components/src/Svgs/LogoIcon.tsx +0 -74
- package/packages/shared-components/src/Svgs/SvgAdd.tsx +0 -28
- package/packages/shared-components/src/Svgs/SvgCalendar.tsx +0 -89
- package/packages/shared-components/src/Svgs/SvgConfigure.tsx +0 -51
- package/packages/shared-components/src/Svgs/SvgDelete.tsx +0 -55
- package/packages/shared-components/src/Svgs/SvgDownload.tsx +0 -20
- package/packages/shared-components/src/Svgs/SvgEmail.tsx +0 -24
- package/packages/shared-components/src/Svgs/SvgFilterList.tsx +0 -19
- package/packages/shared-components/src/Svgs/SvgNoLogo.tsx +0 -66
- package/packages/shared-components/src/Svgs/SvgNoSign.tsx +0 -28
- package/packages/shared-components/src/Svgs/SvgPhone.tsx +0 -16
- package/packages/shared-components/src/Svgs/SvgsDrop.tsx +0 -44
- package/packages/shared-components/src/Svgs/SvgsEdit.tsx +0 -42
- package/packages/shared-components/src/Svgs/SvgsHistory.tsx +0 -40
- package/packages/shared-components/src/Svgs/SvgsHome.tsx +0 -18
- package/packages/shared-components/src/Svgs/SvgsIndicator.tsx +0 -24
- package/packages/shared-components/src/Svgs/index.ts +0 -14
- package/packages/shared-components/src/Tab/Skeleton.tsx +0 -15
- package/packages/shared-components/src/Tab/Tabs.tsx +0 -64
- package/packages/shared-components/src/Tab/index.ts +0 -1
- package/packages/shared-components/src/Timeline/AttendanceStatus.tsx +0 -56
- package/packages/shared-components/src/Timeline/Timeline.tsx +0 -171
- package/packages/shared-components/src/Timeline/TimelineTrackSegments.tsx +0 -130
- package/packages/shared-components/src/Timeline/index.ts +0 -2
- package/packages/shared-components/src/Toast/Toast.tsx +0 -59
- package/packages/shared-components/src/Toast/ToastBody.tsx +0 -26
- package/packages/shared-components/src/Toast/ToastFooterLink.tsx +0 -19
- package/packages/shared-components/src/Toast/Toaster.styled.tsx +0 -76
- package/packages/shared-components/src/Toast/Toaster.tsx +0 -21
- package/packages/shared-components/src/Toast/index.ts +0 -3
- package/packages/shared-components/src/Toast/toasts.tsx +0 -28
- package/packages/shared-components/src/Toast/types.ts +0 -13
- package/packages/shared-components/src/Tooltip/Tooltip.tsx +0 -36
- package/packages/shared-components/src/Tooltip/index.ts +0 -1
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.styled.tsx +0 -33
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.tsx +0 -168
- package/packages/shared-components/src/UserProfileMenu/index.ts +0 -1
- package/packages/shared-components/src/index.ts +0 -25
- package/packages/shared-components/src/utils/colorVariant.ts +0 -162
- package/packages/shared-components/src/utils/date.ts +0 -25
- package/packages/shared-components/src/utils/file.ts +0 -20
- package/packages/shared-components/src/utils/fileSizeValidate.ts +0 -5
- package/packages/shared-components/src/utils/index.ts +0 -9
- package/packages/shared-components/src/utils/theme/colorPalette.ts +0 -112
- package/packages/shared-components/src/utils/theme/colorPaletteUI.tsx +0 -44
- package/packages/shared-components/src/utils/theme/paletteDark.ts +0 -10
- package/packages/shared-components/src/utils/theme/paletteLight.ts +0 -31
- package/packages/shared-components/src/utils/theme/theme.ts +0 -297
- package/packages/shared-components/src/utils/theme/types.ts +0 -18
- package/packages/shared-components/src/utils/theme/typography.ts +0 -52
- package/packages/shared-components/src/utils/urlToNestedObject.ts +0 -9
- package/packages/shared-components/tsconfig.json +0 -8
- package/packages/shared-components/tsconfig.lint.json +0 -8
- package/packages/shared-components/turbo/generators/config.ts +0 -33
- package/packages/shared-components/turbo/generators/templates/component.hbs +0 -8
- package/packages/typescript-config/base.json +0 -20
- package/packages/typescript-config/nextjs.json +0 -13
- package/packages/typescript-config/package.json +0 -9
- package/packages/typescript-config/react-library.json +0 -8
- package/pnpm-workspace.yaml +0 -3
- package/turbo.json +0 -44
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { BottomDialogBody, BottomDialogStyled } from "./BottomDialog.styled";
|
|
2
|
-
|
|
3
|
-
import type { DialogProps } from ".";
|
|
4
|
-
import { PadBox } from "../PadBox";
|
|
5
|
-
|
|
6
|
-
export type BottomDialogProps = Omit<DialogProps, "title"> & {
|
|
7
|
-
title?: string;
|
|
8
|
-
open?: boolean;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export function BottomDialog({
|
|
13
|
-
children,
|
|
14
|
-
title,
|
|
15
|
-
open = false,
|
|
16
|
-
onClose,
|
|
17
|
-
...rest
|
|
18
|
-
}: BottomDialogProps) {
|
|
19
|
-
return (
|
|
20
|
-
<BottomDialogStyled
|
|
21
|
-
fullScreen
|
|
22
|
-
title={title}
|
|
23
|
-
{...rest}
|
|
24
|
-
open={open}
|
|
25
|
-
onClose={onClose}
|
|
26
|
-
PaperProps={{
|
|
27
|
-
sx: {
|
|
28
|
-
animation: open ? "slideUp 0.2s cubic-bezier(0.25, 0.8, 0.5, 1)" : "",
|
|
29
|
-
},
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
<BottomDialogBody direction="row" overflow="hidden">
|
|
33
|
-
<PadBox padding={{ padding: "1rem" }}>{children}</PadBox>
|
|
34
|
-
</BottomDialogBody>
|
|
35
|
-
</BottomDialogStyled>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import InfoTwoToneIcon from "@mui/icons-material/InfoTwoTone";
|
|
2
|
-
import { Stack, Typography } from "@mui/material";
|
|
3
|
-
import { Button } from "../Button";
|
|
4
|
-
import { Dialog } from "./Dialog";
|
|
5
|
-
|
|
6
|
-
export type DeleteDialogProps = {
|
|
7
|
-
title: string;
|
|
8
|
-
open: boolean;
|
|
9
|
-
isDeleteLoading: boolean;
|
|
10
|
-
onDelete: () => void;
|
|
11
|
-
onClose: () => void;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const DeleteDialog = ({
|
|
15
|
-
title,
|
|
16
|
-
open,
|
|
17
|
-
isDeleteLoading,
|
|
18
|
-
onDelete,
|
|
19
|
-
onClose,
|
|
20
|
-
}: DeleteDialogProps) => {
|
|
21
|
-
return (
|
|
22
|
-
<Dialog
|
|
23
|
-
maxWidth="xs"
|
|
24
|
-
isHideCloseIcon={true}
|
|
25
|
-
isHideDividers={true}
|
|
26
|
-
open={open}
|
|
27
|
-
actions={
|
|
28
|
-
<Stack direction="row" gap="5px">
|
|
29
|
-
<Button onClick={onClose} variant="outlined">
|
|
30
|
-
Cancel
|
|
31
|
-
</Button>
|
|
32
|
-
|
|
33
|
-
<Button onClick={onDelete} color="error" loading={isDeleteLoading}>
|
|
34
|
-
Delete
|
|
35
|
-
</Button>
|
|
36
|
-
</Stack>
|
|
37
|
-
}
|
|
38
|
-
>
|
|
39
|
-
<Stack gap="10px" direction="row">
|
|
40
|
-
<InfoTwoToneIcon color="error" sx={{ mt: "1px" }} />
|
|
41
|
-
|
|
42
|
-
<Typography variant="subtitle1" fontWeight={700}>
|
|
43
|
-
{title}
|
|
44
|
-
</Typography>
|
|
45
|
-
</Stack>
|
|
46
|
-
</Dialog>
|
|
47
|
-
);
|
|
48
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import HighlightOffIcon from "@mui/icons-material/HighlightOff";
|
|
2
|
-
import {
|
|
3
|
-
DialogActions,
|
|
4
|
-
DialogContent,
|
|
5
|
-
DialogTitle,
|
|
6
|
-
IconButton,
|
|
7
|
-
Dialog as MuiDialog,
|
|
8
|
-
Stack,
|
|
9
|
-
Typography,
|
|
10
|
-
type DialogProps as MuiDialogProps,
|
|
11
|
-
} from "@mui/material";
|
|
12
|
-
import type { PropsWithChildren, ReactNode } from "react";
|
|
13
|
-
import { PadBox } from "../PadBox";
|
|
14
|
-
|
|
15
|
-
export type DialogProps = PropsWithChildren<
|
|
16
|
-
MuiDialogProps & {
|
|
17
|
-
isHideCloseIcon?: boolean;
|
|
18
|
-
title?: string;
|
|
19
|
-
actions?: ReactNode;
|
|
20
|
-
isHideDividers?: boolean;
|
|
21
|
-
}
|
|
22
|
-
>;
|
|
23
|
-
|
|
24
|
-
export const Dialog = ({
|
|
25
|
-
title,
|
|
26
|
-
isHideCloseIcon = false,
|
|
27
|
-
isHideDividers = false,
|
|
28
|
-
children,
|
|
29
|
-
onClose,
|
|
30
|
-
actions,
|
|
31
|
-
...props
|
|
32
|
-
}: DialogProps) => {
|
|
33
|
-
return (
|
|
34
|
-
<MuiDialog fullWidth {...props}>
|
|
35
|
-
<DialogTitle textAlign="center">
|
|
36
|
-
<Stack direction="row" alignItems="center">
|
|
37
|
-
<Typography variant="h5" fontWeight={500} flex={1}>
|
|
38
|
-
{title}
|
|
39
|
-
</Typography>
|
|
40
|
-
|
|
41
|
-
{!isHideCloseIcon && (
|
|
42
|
-
<IconButton
|
|
43
|
-
onClick={(event) => onClose && onClose(event, "escapeKeyDown")}
|
|
44
|
-
color="secondary"
|
|
45
|
-
>
|
|
46
|
-
<HighlightOffIcon fontSize="large" />
|
|
47
|
-
</IconButton>
|
|
48
|
-
)}
|
|
49
|
-
</Stack>
|
|
50
|
-
</DialogTitle>
|
|
51
|
-
|
|
52
|
-
<DialogContent dividers={!isHideDividers}>
|
|
53
|
-
<PadBox padding={{ padding: "10px" }}>{children}</PadBox>
|
|
54
|
-
</DialogContent>
|
|
55
|
-
|
|
56
|
-
{actions && (
|
|
57
|
-
<DialogActions sx={{ py: "16px", px: "24px" }}>{actions}</DialogActions>
|
|
58
|
-
)}
|
|
59
|
-
</MuiDialog>
|
|
60
|
-
);
|
|
61
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { ChevronRight } from "@mui/icons-material";
|
|
2
|
-
import { Box, useTheme } from "@mui/material";
|
|
3
|
-
import { Bullet } from "../Bullet";
|
|
4
|
-
import { MenuItem, type MenuItemProps } from "../MenuItem";
|
|
5
|
-
|
|
6
|
-
type CloseDrawerMenuItemProps = {
|
|
7
|
-
icon?: MenuItemProps["icon"];
|
|
8
|
-
title?: MenuItemProps["title"];
|
|
9
|
-
isShowEndAdornment?: boolean;
|
|
10
|
-
onClick: MenuItemProps["onClick"];
|
|
11
|
-
selected?: MenuItemProps["selected"];
|
|
12
|
-
onMouseEnter?: MenuItemProps["onMouseEnter"];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const CloseDrawerMenuItem = ({
|
|
16
|
-
icon = <Bullet />,
|
|
17
|
-
title,
|
|
18
|
-
isShowEndAdornment = false,
|
|
19
|
-
onClick,
|
|
20
|
-
selected = false,
|
|
21
|
-
onMouseEnter,
|
|
22
|
-
}: CloseDrawerMenuItemProps) => {
|
|
23
|
-
const theme = useTheme();
|
|
24
|
-
|
|
25
|
-
const { butterflyBlue, slate } = theme.palette.app.color;
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Box
|
|
29
|
-
component="li"
|
|
30
|
-
sx={{
|
|
31
|
-
bgcolor: selected && !isShowEndAdornment ? butterflyBlue[900] : "",
|
|
32
|
-
padding: !title ? "2.5px 0" : "0px",
|
|
33
|
-
wordBreak: "break-word",
|
|
34
|
-
}}
|
|
35
|
-
>
|
|
36
|
-
<MenuItem
|
|
37
|
-
sx={{
|
|
38
|
-
fontSize: "14px",
|
|
39
|
-
padding: "9.5px 16px",
|
|
40
|
-
":focus-visible": {
|
|
41
|
-
border: `1px solid ${butterflyBlue[900]}`,
|
|
42
|
-
backgroundColor: slate[900],
|
|
43
|
-
},
|
|
44
|
-
margin: "0",
|
|
45
|
-
}}
|
|
46
|
-
selected={selected}
|
|
47
|
-
title={title}
|
|
48
|
-
icon={icon}
|
|
49
|
-
onClick={onClick}
|
|
50
|
-
onMouseEnter={onMouseEnter}
|
|
51
|
-
endAdornment={
|
|
52
|
-
isShowEndAdornment && <ChevronRight sx={{ fontSize: "16px" }} />
|
|
53
|
-
}
|
|
54
|
-
/>
|
|
55
|
-
</Box>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { Box } from "@mui/material";
|
|
2
|
-
import { isEmpty as _isEmpty } from "lodash";
|
|
3
|
-
import {
|
|
4
|
-
type HTMLAttributeAnchorTarget,
|
|
5
|
-
type MouseEvent,
|
|
6
|
-
useMemo,
|
|
7
|
-
useState,
|
|
8
|
-
} from "react";
|
|
9
|
-
import { v4 as uuidv4 } from "uuid";
|
|
10
|
-
import { urlToNestedObject } from "../../utils/urlToNestedObject";
|
|
11
|
-
import type { MenuItem } from "../Drawer";
|
|
12
|
-
import { CloseDrawerMenuItem } from "./CloseDrawerMenuItem";
|
|
13
|
-
import {
|
|
14
|
-
CloseDrawerSubMenuItemList,
|
|
15
|
-
type MenuOpenState,
|
|
16
|
-
} from "./CloseDrawerSubMenuItemList";
|
|
17
|
-
import { Popper } from "./Popper";
|
|
18
|
-
|
|
19
|
-
type CloseDrawerMenuItemListProps = {
|
|
20
|
-
menuItems: MenuItem[];
|
|
21
|
-
currentPathname: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const CloseDrawerMenuItemList = ({
|
|
25
|
-
menuItems,
|
|
26
|
-
currentPathname,
|
|
27
|
-
}: CloseDrawerMenuItemListProps) => {
|
|
28
|
-
const [anchorEl, setAnchorEl] = useState<HTMLDivElement | null>(null);
|
|
29
|
-
|
|
30
|
-
const [currentMenuItem, setCurrentMenuItem] = useState<MenuItem>();
|
|
31
|
-
|
|
32
|
-
const [currentMenuIndex, setCurrentMenuIndex] = useState<number>(0);
|
|
33
|
-
|
|
34
|
-
const [currentPathMenuOpen, setCurrentPathMenuOpen] = useState<MenuOpenState>(
|
|
35
|
-
{}
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
useMemo(() => {
|
|
39
|
-
const obj = urlToNestedObject(currentPathname);
|
|
40
|
-
|
|
41
|
-
if (_isEmpty(obj)) {
|
|
42
|
-
return setCurrentPathMenuOpen({ home: true });
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
setCurrentPathMenuOpen(obj);
|
|
46
|
-
}, [currentPathname]);
|
|
47
|
-
|
|
48
|
-
const handleClose = () => {
|
|
49
|
-
setAnchorEl(null);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<>
|
|
54
|
-
{menuItems.map((menuItem, i) => {
|
|
55
|
-
const { onClick, key: key1, icon, menuItems = [] } = menuItem;
|
|
56
|
-
|
|
57
|
-
const handleClick = (target?: HTMLAttributeAnchorTarget) => {
|
|
58
|
-
if (onClick) {
|
|
59
|
-
if (key1 === "home") {
|
|
60
|
-
onClick("/", target);
|
|
61
|
-
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
onClick(`/${key1}`, target);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const onMouseEnter = (event: MouseEvent<HTMLDivElement>) => {
|
|
70
|
-
if (menuItems.length > 0) {
|
|
71
|
-
setAnchorEl(event.currentTarget);
|
|
72
|
-
setCurrentMenuItem(menuItem);
|
|
73
|
-
setCurrentMenuIndex(i);
|
|
74
|
-
} else {
|
|
75
|
-
handleClose();
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const isMenuSelected = !!currentPathMenuOpen?.[key1];
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<CloseDrawerMenuItem
|
|
83
|
-
key={uuidv4()}
|
|
84
|
-
onClick={handleClick}
|
|
85
|
-
onMouseEnter={onMouseEnter}
|
|
86
|
-
icon={icon}
|
|
87
|
-
selected={isMenuSelected}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
})}
|
|
91
|
-
|
|
92
|
-
{!!anchorEl && (
|
|
93
|
-
<Box onMouseLeave={handleClose}>
|
|
94
|
-
<Popper
|
|
95
|
-
open={true}
|
|
96
|
-
anchorEl={anchorEl}
|
|
97
|
-
currentMenuIndex={currentMenuIndex}
|
|
98
|
-
>
|
|
99
|
-
<CloseDrawerSubMenuItemList
|
|
100
|
-
currentMenuItem={currentMenuItem}
|
|
101
|
-
currentPathMenuOpen={currentPathMenuOpen}
|
|
102
|
-
onCloseMenuPopover={handleClose}
|
|
103
|
-
/>
|
|
104
|
-
</Popper>
|
|
105
|
-
</Box>
|
|
106
|
-
)}
|
|
107
|
-
</>
|
|
108
|
-
);
|
|
109
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Box, List } from "@mui/material";
|
|
2
|
-
import {
|
|
3
|
-
useState,
|
|
4
|
-
type HTMLAttributeAnchorTarget,
|
|
5
|
-
type MouseEvent,
|
|
6
|
-
} from "react";
|
|
7
|
-
import { type MenuItem } from "../Drawer";
|
|
8
|
-
import { CloseDrawerMenuItem } from "./CloseDrawerMenuItem";
|
|
9
|
-
import { Popper } from "./Popper";
|
|
10
|
-
|
|
11
|
-
export type MenuOpenState = {
|
|
12
|
-
[key: string]: MenuOpenState | boolean;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type RecursiveMenuItemProps = {
|
|
16
|
-
item: MenuItem;
|
|
17
|
-
parentPath: string;
|
|
18
|
-
currentPathMenuOpen: MenuOpenState;
|
|
19
|
-
onCloseMenuPopover: () => void;
|
|
20
|
-
level?: number;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const RecursiveMenuItem = ({
|
|
24
|
-
item,
|
|
25
|
-
parentPath,
|
|
26
|
-
currentPathMenuOpen,
|
|
27
|
-
onCloseMenuPopover,
|
|
28
|
-
level = 0,
|
|
29
|
-
}: RecursiveMenuItemProps) => {
|
|
30
|
-
const [anchorEl, setAnchorEl] = useState<HTMLDivElement | null>(null);
|
|
31
|
-
|
|
32
|
-
const isOpen = Boolean(anchorEl);
|
|
33
|
-
|
|
34
|
-
const handlePopoverOpen = (event: MouseEvent<HTMLDivElement>) => {
|
|
35
|
-
if (item.menuItems?.length) {
|
|
36
|
-
setAnchorEl(event.currentTarget);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const handleClose = () => {
|
|
41
|
-
setAnchorEl(null);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const handleClick = (target: HTMLAttributeAnchorTarget = "_self") => {
|
|
45
|
-
const fullPath = `${parentPath}/${item.key}`;
|
|
46
|
-
|
|
47
|
-
if (item.onClick) {
|
|
48
|
-
item.onClick(fullPath, target);
|
|
49
|
-
|
|
50
|
-
if (target !== "_blank") {
|
|
51
|
-
handleClose();
|
|
52
|
-
onCloseMenuPopover();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const isSelected = Boolean(currentPathMenuOpen[item.key]);
|
|
58
|
-
|
|
59
|
-
const currentPath = `${parentPath}/${item.key}`;
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<Box onMouseLeave={handleClose}>
|
|
63
|
-
<CloseDrawerMenuItem
|
|
64
|
-
onClick={handleClick}
|
|
65
|
-
title={item.title}
|
|
66
|
-
icon={item.icon}
|
|
67
|
-
isShowEndAdornment={Boolean(item.menuItems?.length)}
|
|
68
|
-
selected={isSelected}
|
|
69
|
-
onMouseEnter={handlePopoverOpen}
|
|
70
|
-
/>
|
|
71
|
-
|
|
72
|
-
{item.menuItems?.length && isOpen && (
|
|
73
|
-
<Popper open={true} anchorEl={anchorEl} currentMenuIndex={level}>
|
|
74
|
-
<List disablePadding>
|
|
75
|
-
{item.menuItems.map((subItem) => (
|
|
76
|
-
<RecursiveMenuItem
|
|
77
|
-
key={subItem.key}
|
|
78
|
-
item={subItem}
|
|
79
|
-
parentPath={currentPath}
|
|
80
|
-
currentPathMenuOpen={
|
|
81
|
-
(currentPathMenuOpen[item.key] as MenuOpenState) ?? {}
|
|
82
|
-
}
|
|
83
|
-
onCloseMenuPopover={onCloseMenuPopover}
|
|
84
|
-
level={level + 1}
|
|
85
|
-
/>
|
|
86
|
-
))}
|
|
87
|
-
</List>
|
|
88
|
-
</Popper>
|
|
89
|
-
)}
|
|
90
|
-
</Box>
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
type CloseDrawerSubMenuItemListProps = {
|
|
95
|
-
currentPathMenuOpen: MenuOpenState;
|
|
96
|
-
currentMenuItem?: MenuItem;
|
|
97
|
-
onCloseMenuPopover: () => void;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const CloseDrawerSubMenuItemList = ({
|
|
101
|
-
currentPathMenuOpen,
|
|
102
|
-
currentMenuItem,
|
|
103
|
-
onCloseMenuPopover,
|
|
104
|
-
}: CloseDrawerSubMenuItemListProps) => {
|
|
105
|
-
if (!currentMenuItem) {
|
|
106
|
-
return <>Loading...</>;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<List disablePadding>
|
|
111
|
-
{currentMenuItem.menuItems?.map((item) => (
|
|
112
|
-
<RecursiveMenuItem
|
|
113
|
-
key={item.key}
|
|
114
|
-
item={item}
|
|
115
|
-
parentPath={`/${currentMenuItem.key}`}
|
|
116
|
-
currentPathMenuOpen={
|
|
117
|
-
(currentPathMenuOpen[currentMenuItem.key] as MenuOpenState) ?? {}
|
|
118
|
-
}
|
|
119
|
-
onCloseMenuPopover={onCloseMenuPopover}
|
|
120
|
-
/>
|
|
121
|
-
))}
|
|
122
|
-
</List>
|
|
123
|
-
);
|
|
124
|
-
};
|
|
File without changes
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Popover as MuiPopover,
|
|
3
|
-
useTheme,
|
|
4
|
-
type PopoverProps,
|
|
5
|
-
} from "@mui/material";
|
|
6
|
-
import type { PropsWithChildren } from "react";
|
|
7
|
-
|
|
8
|
-
type ExtendedPopoverProps = {
|
|
9
|
-
currentMenuIndex: number; // **Added Prop**
|
|
10
|
-
} & PropsWithChildren<PopoverProps>;
|
|
11
|
-
|
|
12
|
-
export const Popover = ({
|
|
13
|
-
open,
|
|
14
|
-
anchorEl,
|
|
15
|
-
onClose,
|
|
16
|
-
children,
|
|
17
|
-
currentMenuIndex,
|
|
18
|
-
}: ExtendedPopoverProps) => {
|
|
19
|
-
const theme = useTheme();
|
|
20
|
-
|
|
21
|
-
const { mirage } = theme.palette.app.color;
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<MuiPopover
|
|
25
|
-
open={open}
|
|
26
|
-
anchorEl={anchorEl}
|
|
27
|
-
anchorOrigin={{
|
|
28
|
-
vertical: "top",
|
|
29
|
-
horizontal: "right",
|
|
30
|
-
}}
|
|
31
|
-
onClose={onClose}
|
|
32
|
-
sx={{
|
|
33
|
-
"& .MuiPaper-root": {
|
|
34
|
-
background: mirage[900],
|
|
35
|
-
width: "200px",
|
|
36
|
-
// eslint-disable-next-line sonarjs/no-all-duplicated-branches
|
|
37
|
-
marginLeft: currentMenuIndex ? "64px" : "0px",
|
|
38
|
-
marginTop: currentMenuIndex ? currentMenuIndex * 3.6 + 6.2 : "10px",
|
|
39
|
-
},
|
|
40
|
-
}}
|
|
41
|
-
>
|
|
42
|
-
{children}
|
|
43
|
-
</MuiPopover>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Popper as MuiPopper, useTheme, type PopperProps } from "@mui/material";
|
|
2
|
-
import type { PropsWithChildren } from "react";
|
|
3
|
-
|
|
4
|
-
type ExtendedPopoverProps = {
|
|
5
|
-
currentMenuIndex: number;
|
|
6
|
-
} & PropsWithChildren<PopperProps>;
|
|
7
|
-
|
|
8
|
-
export const Popper = ({
|
|
9
|
-
open,
|
|
10
|
-
anchorEl,
|
|
11
|
-
children,
|
|
12
|
-
currentMenuIndex,
|
|
13
|
-
}: ExtendedPopoverProps) => {
|
|
14
|
-
const theme = useTheme();
|
|
15
|
-
|
|
16
|
-
const { mirage } = theme.palette.app.color;
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<MuiPopper
|
|
20
|
-
open={open}
|
|
21
|
-
anchorEl={anchorEl}
|
|
22
|
-
placement="bottom-end"
|
|
23
|
-
modifiers={[
|
|
24
|
-
{
|
|
25
|
-
name: "offset",
|
|
26
|
-
options: {
|
|
27
|
-
offset: [
|
|
28
|
-
currentMenuIndex ? 79 : 203,
|
|
29
|
-
currentMenuIndex ? currentMenuIndex * 43.5 + 82 : -40,
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
]}
|
|
34
|
-
sx={{
|
|
35
|
-
background: mirage[900],
|
|
36
|
-
width: "203px",
|
|
37
|
-
zIndex: 1300,
|
|
38
|
-
}}
|
|
39
|
-
>
|
|
40
|
-
{children}
|
|
41
|
-
</MuiPopper>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { CSSObject, Theme } from "@mui/material";
|
|
2
|
-
import { Box, Drawer as MuiDrawer, styled } from "@mui/material";
|
|
3
|
-
|
|
4
|
-
export const Bullet = styled(Box)(({ theme }) => ({
|
|
5
|
-
width: 7,
|
|
6
|
-
height: 7,
|
|
7
|
-
borderRadius: "50%",
|
|
8
|
-
background: theme.palette.app.color.butterflyBlue[400],
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
|
-
const drawerWidth = 300;
|
|
12
|
-
|
|
13
|
-
const openedMixin = (theme: Theme): CSSObject => ({
|
|
14
|
-
width: drawerWidth,
|
|
15
|
-
transition: theme.transitions.create("width", {
|
|
16
|
-
easing: theme.transitions.easing.sharp,
|
|
17
|
-
duration: theme.transitions.duration.enteringScreen,
|
|
18
|
-
}),
|
|
19
|
-
overflowX: "hidden",
|
|
20
|
-
backgroundColor: theme.palette.app.color.mirage[900],
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const closedMixin = (theme: Theme): CSSObject => ({
|
|
24
|
-
transition: theme.transitions.create("width", {
|
|
25
|
-
easing: theme.transitions.easing.sharp,
|
|
26
|
-
duration: theme.transitions.duration.leavingScreen,
|
|
27
|
-
}),
|
|
28
|
-
overflowX: "hidden",
|
|
29
|
-
width: "80px",
|
|
30
|
-
[theme.breakpoints.up("sm")]: {
|
|
31
|
-
width: "80px",
|
|
32
|
-
},
|
|
33
|
-
backgroundColor: theme.palette.app.color.mirage[900],
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
export const StyledDrawer = styled(MuiDrawer, {
|
|
37
|
-
shouldForwardProp: (prop) => prop !== "open",
|
|
38
|
-
})(({ theme, open }) => ({
|
|
39
|
-
width: drawerWidth,
|
|
40
|
-
flexShrink: 0,
|
|
41
|
-
whiteSpace: "nowrap",
|
|
42
|
-
boxSizing: "border-box",
|
|
43
|
-
...(open && {
|
|
44
|
-
...openedMixin(theme),
|
|
45
|
-
"& .MuiDrawer-paper": openedMixin(theme),
|
|
46
|
-
}),
|
|
47
|
-
...(!open && {
|
|
48
|
-
...closedMixin(theme),
|
|
49
|
-
"& .MuiDrawer-paper": closedMixin(theme),
|
|
50
|
-
}),
|
|
51
|
-
}));
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Box } from "@mui/material";
|
|
4
|
-
import List from "@mui/material/List";
|
|
5
|
-
import type { HTMLAttributeAnchorTarget, ReactNode } from "react";
|
|
6
|
-
import { PadBox } from "../PadBox";
|
|
7
|
-
import { AppLogoMedium } from "../Svgs/AppLogo/AppLogoMedium";
|
|
8
|
-
import { AppLogoSmall } from "../Svgs/AppLogo/AppLogoSmall";
|
|
9
|
-
import { CloseDrawerMenuItemList } from "./CloseDrawer/CloseDrawerMenuItemList";
|
|
10
|
-
import { StyledDrawer } from "./Drawer.styled";
|
|
11
|
-
import { OpenDrawerMenuItemList } from "./OpenDrawer/OpenDrawerMenuItemList";
|
|
12
|
-
|
|
13
|
-
export type MenuItem = {
|
|
14
|
-
key: string; // this key should be unique in list
|
|
15
|
-
icon?: ReactNode;
|
|
16
|
-
title: string;
|
|
17
|
-
onClick?: (href: string, target?: HTMLAttributeAnchorTarget) => void;
|
|
18
|
-
menuItems?: MenuItem[];
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export type DrawerProps = {
|
|
22
|
-
menuItems?: MenuItem[];
|
|
23
|
-
open: boolean;
|
|
24
|
-
currentPathname: string;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const Drawer = ({
|
|
28
|
-
menuItems = [],
|
|
29
|
-
open,
|
|
30
|
-
currentPathname,
|
|
31
|
-
}: DrawerProps) => {
|
|
32
|
-
return (
|
|
33
|
-
<StyledDrawer variant="permanent" open={open}>
|
|
34
|
-
<Box textAlign="center">
|
|
35
|
-
<PadBox padding={{ paddingTop: "1.5rem" }}>
|
|
36
|
-
{open ? <AppLogoMedium /> : <AppLogoSmall />}
|
|
37
|
-
</PadBox>
|
|
38
|
-
</Box>
|
|
39
|
-
|
|
40
|
-
<List component="nav">
|
|
41
|
-
{open ? (
|
|
42
|
-
<OpenDrawerMenuItemList
|
|
43
|
-
menuItems={menuItems}
|
|
44
|
-
currentPathname={currentPathname}
|
|
45
|
-
/>
|
|
46
|
-
) : (
|
|
47
|
-
<CloseDrawerMenuItemList
|
|
48
|
-
menuItems={menuItems}
|
|
49
|
-
currentPathname={currentPathname}
|
|
50
|
-
/>
|
|
51
|
-
)}
|
|
52
|
-
</List>
|
|
53
|
-
</StyledDrawer>
|
|
54
|
-
);
|
|
55
|
-
};
|