@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,75 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ListItemButton,
|
|
3
|
-
ListItemText,
|
|
4
|
-
Stack,
|
|
5
|
-
useTheme,
|
|
6
|
-
type ListItemButtonProps,
|
|
7
|
-
type SxProps,
|
|
8
|
-
type Theme,
|
|
9
|
-
} from "@mui/material";
|
|
10
|
-
import type { HTMLAttributeAnchorTarget, ReactNode } from "react";
|
|
11
|
-
import { Bullet } from "./Bullet";
|
|
12
|
-
|
|
13
|
-
export type MenuItemProps = Omit<ListItemButtonProps, "onClick"> & {
|
|
14
|
-
icon?: ReactNode;
|
|
15
|
-
endAdornment?: ReactNode;
|
|
16
|
-
title?: string;
|
|
17
|
-
sx?: SxProps<Theme>;
|
|
18
|
-
onClick: (target?: HTMLAttributeAnchorTarget) => void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const MenuItem = ({
|
|
22
|
-
selected = false,
|
|
23
|
-
icon = <Bullet />,
|
|
24
|
-
title,
|
|
25
|
-
endAdornment,
|
|
26
|
-
sx,
|
|
27
|
-
onClick,
|
|
28
|
-
...props
|
|
29
|
-
}: MenuItemProps) => {
|
|
30
|
-
const theme = useTheme();
|
|
31
|
-
|
|
32
|
-
const { butterflyBlue, iron } = theme.palette.app.color;
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<ListItemButton
|
|
36
|
-
{...props}
|
|
37
|
-
onClick={(e) => onClick(e.ctrlKey ? "_blank" : "_self")}
|
|
38
|
-
onMouseDown={(e) => {
|
|
39
|
-
e.preventDefault();
|
|
40
|
-
|
|
41
|
-
if (e.button === 1) {
|
|
42
|
-
onClick("_blank");
|
|
43
|
-
}
|
|
44
|
-
}}
|
|
45
|
-
sx={{
|
|
46
|
-
...sx,
|
|
47
|
-
color: selected ? iron[600] : theme.palette.primary.light,
|
|
48
|
-
":hover": {
|
|
49
|
-
color: iron[600],
|
|
50
|
-
".bullet-hover": {
|
|
51
|
-
color: selected ? "" : butterflyBlue[900],
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
<Stack
|
|
57
|
-
alignItems="center"
|
|
58
|
-
direction="row"
|
|
59
|
-
flex={1}
|
|
60
|
-
gap="10px"
|
|
61
|
-
justifyContent="center"
|
|
62
|
-
>
|
|
63
|
-
{icon}
|
|
64
|
-
{title && (
|
|
65
|
-
<ListItemText
|
|
66
|
-
primary={title}
|
|
67
|
-
disableTypography={true}
|
|
68
|
-
sx={{ ...sx, padding: "0" }}
|
|
69
|
-
/>
|
|
70
|
-
)}
|
|
71
|
-
</Stack>
|
|
72
|
-
{endAdornment}
|
|
73
|
-
</ListItemButton>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Collapse, type CollapseProps } from "@mui/material";
|
|
2
|
-
import type { PropsWithChildren } from "react";
|
|
3
|
-
|
|
4
|
-
export const OpenDrawerCollapse = ({
|
|
5
|
-
children,
|
|
6
|
-
...rest
|
|
7
|
-
}: PropsWithChildren<CollapseProps>) => {
|
|
8
|
-
return (
|
|
9
|
-
<Collapse timeout="auto" unmountOnExit {...rest}>
|
|
10
|
-
{children}
|
|
11
|
-
</Collapse>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ExpandLess, ExpandMore } from "@mui/icons-material";
|
|
2
|
-
import type { SxProps, Theme } from "@mui/material";
|
|
3
|
-
import { Box, useTheme } from "@mui/material";
|
|
4
|
-
import { Bullet } from "../Bullet";
|
|
5
|
-
import { MenuItem, type MenuItemProps } from "../MenuItem";
|
|
6
|
-
|
|
7
|
-
type OpenDrawerMenuItemProps = {
|
|
8
|
-
icon?: MenuItemProps["icon"];
|
|
9
|
-
title: MenuItemProps["title"];
|
|
10
|
-
isShowEndAdornment?: boolean;
|
|
11
|
-
selected?: MenuItemProps["selected"];
|
|
12
|
-
onClick: MenuItemProps["onClick"];
|
|
13
|
-
sx?: SxProps<Theme>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const OpenDrawerMenuItem = ({
|
|
17
|
-
icon = <Bullet />,
|
|
18
|
-
title,
|
|
19
|
-
isShowEndAdornment = false,
|
|
20
|
-
selected = false,
|
|
21
|
-
onClick,
|
|
22
|
-
sx,
|
|
23
|
-
}: OpenDrawerMenuItemProps) => {
|
|
24
|
-
const theme = useTheme();
|
|
25
|
-
|
|
26
|
-
const { butterflyBlue } = theme.palette.app.color;
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<Box
|
|
30
|
-
sx={{
|
|
31
|
-
bgcolor: selected && !isShowEndAdornment ? butterflyBlue[900] : "",
|
|
32
|
-
}}
|
|
33
|
-
>
|
|
34
|
-
<MenuItem
|
|
35
|
-
sx={sx}
|
|
36
|
-
title={title}
|
|
37
|
-
icon={icon}
|
|
38
|
-
onClick={onClick}
|
|
39
|
-
selected={selected}
|
|
40
|
-
endAdornment={
|
|
41
|
-
isShowEndAdornment && (selected ? <ExpandLess /> : <ExpandMore />)
|
|
42
|
-
}
|
|
43
|
-
/>
|
|
44
|
-
</Box>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Box, List, useTheme } from "@mui/material";
|
|
4
|
-
import { isEmpty as _isEmpty } from "lodash";
|
|
5
|
-
import { type HTMLAttributeAnchorTarget, useEffect, useState } from "react";
|
|
6
|
-
import { urlToNestedObject } from "../../utils/urlToNestedObject";
|
|
7
|
-
import type { MenuItem } from "../Drawer";
|
|
8
|
-
import { OpenDrawerCollapse } from "./OpenDrawerCollapse";
|
|
9
|
-
import { OpenDrawerMenuItem } from "./OpenDrawerMenuItem";
|
|
10
|
-
|
|
11
|
-
type OpenDrawerMenuItemListProps = {
|
|
12
|
-
menuItems: MenuItem[];
|
|
13
|
-
currentPathname: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type NestedMenuState = {
|
|
17
|
-
[K in MenuItem["key"]]?:
|
|
18
|
-
| boolean
|
|
19
|
-
| {
|
|
20
|
-
[SubK in MenuItem["key"]]?: boolean | NestedMenuState;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
type MenuItemRecursiveProps = {
|
|
25
|
-
menuItem: MenuItem;
|
|
26
|
-
level?: number;
|
|
27
|
-
parentPath?: string;
|
|
28
|
-
subMenusOpen: NestedMenuState;
|
|
29
|
-
setSubMenusOpen: (
|
|
30
|
-
value: NestedMenuState | ((prev: NestedMenuState) => NestedMenuState)
|
|
31
|
-
) => void;
|
|
32
|
-
currentPathMenuOpen: NestedMenuState;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const getNestedMenuState = (state: NestedMenuState, path: string[]) => {
|
|
36
|
-
if (path.length === 0) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (typeof state !== "object") {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const first = path[0];
|
|
45
|
-
|
|
46
|
-
if (!first) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const rest = path.slice(1);
|
|
51
|
-
|
|
52
|
-
const nextState = state[first];
|
|
53
|
-
|
|
54
|
-
if (rest.length === 0) {
|
|
55
|
-
return Boolean(nextState);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return getNestedMenuState(nextState as NestedMenuState, rest);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const isMenuOpen = (state: NestedMenuState, path: string[]) => {
|
|
62
|
-
const value = getNestedMenuState(state, path);
|
|
63
|
-
|
|
64
|
-
return Boolean(value);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const MenuItemRecursive = ({
|
|
68
|
-
menuItem,
|
|
69
|
-
level = 0,
|
|
70
|
-
parentPath = "",
|
|
71
|
-
subMenusOpen,
|
|
72
|
-
setSubMenusOpen,
|
|
73
|
-
currentPathMenuOpen,
|
|
74
|
-
}: MenuItemRecursiveProps) => {
|
|
75
|
-
const theme = useTheme();
|
|
76
|
-
|
|
77
|
-
if (level === 3) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const { butterflyBlue, slate } = theme.palette.app.color;
|
|
82
|
-
|
|
83
|
-
const { key, icon, title, onClick, menuItems = [] } = menuItem;
|
|
84
|
-
|
|
85
|
-
const currentPath = parentPath ? `${parentPath}/${key}` : key;
|
|
86
|
-
|
|
87
|
-
const pathArray = currentPath.split("/");
|
|
88
|
-
|
|
89
|
-
const isMenuSelected = isMenuOpen(subMenusOpen, pathArray);
|
|
90
|
-
|
|
91
|
-
const dynamicPadding = level * 3 + 1.5;
|
|
92
|
-
|
|
93
|
-
const handleClick = (target?: HTMLAttributeAnchorTarget) => {
|
|
94
|
-
if (menuItems.length > 0) {
|
|
95
|
-
setSubMenusOpen((prev) => {
|
|
96
|
-
const newState = { ...prev };
|
|
97
|
-
|
|
98
|
-
let current = newState;
|
|
99
|
-
|
|
100
|
-
for (let i = 0; i < pathArray.length - 1; i++) {
|
|
101
|
-
const segment = pathArray[i];
|
|
102
|
-
|
|
103
|
-
if (!segment) {
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
current[segment] =
|
|
108
|
-
typeof current[segment] === "object" ? current[segment] : {};
|
|
109
|
-
current = current[segment] as NestedMenuState;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const lastSegment = pathArray[pathArray.length - 1];
|
|
113
|
-
|
|
114
|
-
if (lastSegment) {
|
|
115
|
-
current[lastSegment] = !isMenuSelected;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return newState;
|
|
119
|
-
});
|
|
120
|
-
} else if (onClick && !isMenuSelected) {
|
|
121
|
-
const path = key === "home" ? "/" : `/${currentPath}`;
|
|
122
|
-
|
|
123
|
-
onClick(path, target);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<Box key={key}>
|
|
129
|
-
<OpenDrawerMenuItem
|
|
130
|
-
sx={{
|
|
131
|
-
paddingLeft: dynamicPadding,
|
|
132
|
-
":focus-visible": {
|
|
133
|
-
border: `1px solid ${butterflyBlue[900]}`,
|
|
134
|
-
backgroundColor: slate[900],
|
|
135
|
-
},
|
|
136
|
-
}}
|
|
137
|
-
onClick={handleClick}
|
|
138
|
-
icon={level === 0 ? icon : undefined}
|
|
139
|
-
title={title}
|
|
140
|
-
isShowEndAdornment={menuItems.length > 0 && level < 2}
|
|
141
|
-
selected={isMenuSelected}
|
|
142
|
-
/>
|
|
143
|
-
|
|
144
|
-
{menuItems.length > 0 && (
|
|
145
|
-
<OpenDrawerCollapse in={isMenuSelected}>
|
|
146
|
-
<List component="div" disablePadding>
|
|
147
|
-
{menuItems.map((subMenuItem) => (
|
|
148
|
-
<MenuItemRecursive
|
|
149
|
-
key={subMenuItem.key}
|
|
150
|
-
menuItem={subMenuItem}
|
|
151
|
-
level={level + 1}
|
|
152
|
-
parentPath={currentPath}
|
|
153
|
-
subMenusOpen={subMenusOpen}
|
|
154
|
-
setSubMenusOpen={setSubMenusOpen}
|
|
155
|
-
currentPathMenuOpen={currentPathMenuOpen}
|
|
156
|
-
/>
|
|
157
|
-
))}
|
|
158
|
-
</List>
|
|
159
|
-
</OpenDrawerCollapse>
|
|
160
|
-
)}
|
|
161
|
-
</Box>
|
|
162
|
-
);
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
export const OpenDrawerMenuItemList = ({
|
|
166
|
-
menuItems,
|
|
167
|
-
currentPathname,
|
|
168
|
-
}: OpenDrawerMenuItemListProps) => {
|
|
169
|
-
const [subMenusOpen, setSubMenusOpen] = useState<NestedMenuState>({});
|
|
170
|
-
|
|
171
|
-
const [currentPathMenuOpen, setCurrentPathMenuOpen] =
|
|
172
|
-
useState<NestedMenuState>({});
|
|
173
|
-
|
|
174
|
-
useEffect(() => {
|
|
175
|
-
const obj = urlToNestedObject(currentPathname);
|
|
176
|
-
|
|
177
|
-
if (_isEmpty(obj)) {
|
|
178
|
-
setSubMenusOpen({ home: true });
|
|
179
|
-
setCurrentPathMenuOpen({ home: true });
|
|
180
|
-
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
setSubMenusOpen(obj);
|
|
185
|
-
setCurrentPathMenuOpen(obj);
|
|
186
|
-
}, [currentPathname]);
|
|
187
|
-
|
|
188
|
-
return menuItems.map((menuItem) => (
|
|
189
|
-
<MenuItemRecursive
|
|
190
|
-
key={menuItem.key}
|
|
191
|
-
menuItem={menuItem}
|
|
192
|
-
subMenusOpen={subMenusOpen}
|
|
193
|
-
setSubMenusOpen={setSubMenusOpen}
|
|
194
|
-
currentPathMenuOpen={currentPathMenuOpen}
|
|
195
|
-
/>
|
|
196
|
-
));
|
|
197
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Drawer";
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useState } from "react";
|
|
2
|
-
import { Box, IconButton, Stack } from "@mui/material";
|
|
3
|
-
import type { FilterListType } from "./FilterTypeWrapper";
|
|
4
|
-
import { FilterTypeWrapper } from "./FilterTypeWrapper";
|
|
5
|
-
import { FilterPopup } from "./FilterPopup";
|
|
6
|
-
import { FilterPopupWrapper } from "./FilterPopupWrapper";
|
|
7
|
-
import type { FieldValues } from "react-hook-form";
|
|
8
|
-
import { useForm } from "react-hook-form";
|
|
9
|
-
import { SvgFilterList } from "../Svgs/SvgFilterList";
|
|
10
|
-
import { Button } from "../Button";
|
|
11
|
-
import { Tooltip } from "../Tooltip";
|
|
12
|
-
import { FilterPill } from "../Chips/FilterPill";
|
|
13
|
-
import { getFormValue } from "./getFormData";
|
|
14
|
-
|
|
15
|
-
export type FilterListProps = {
|
|
16
|
-
filterListItems: FilterListType[];
|
|
17
|
-
};
|
|
18
|
-
export const FilterList = ({ filterListItems }: FilterListProps) => {
|
|
19
|
-
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);
|
|
20
|
-
|
|
21
|
-
const filterPopupAnchorElm = useRef<HTMLDivElement | null>(null);
|
|
22
|
-
|
|
23
|
-
const [openFilterPopup, setOpenFilterPopup] = useState(false);
|
|
24
|
-
|
|
25
|
-
const [filterListData, setFilterListData] = useState<FieldValues>();
|
|
26
|
-
|
|
27
|
-
const [currentFilter, setCurrentFilter] = useState<null | FilterListType>(
|
|
28
|
-
null
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const { control, handleSubmit, setValue, reset, watch } = useForm();
|
|
32
|
-
|
|
33
|
-
const handleClose = () => {
|
|
34
|
-
setAnchorEl(null);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const onSubmit = (data: FieldValues) => {
|
|
38
|
-
setOpenFilterPopup(false);
|
|
39
|
-
setCurrentFilter(null);
|
|
40
|
-
handleClose();
|
|
41
|
-
|
|
42
|
-
setFilterListData(data);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
46
|
-
setAnchorEl(event.currentTarget);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const handleCloseFilterPopup = () => {
|
|
50
|
-
setOpenFilterPopup(false);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const handleFilterItemClick = (filter: FilterListType) => {
|
|
54
|
-
setOpenFilterPopup(true);
|
|
55
|
-
setAnchorEl(null);
|
|
56
|
-
setCurrentFilter(filter);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const handlerReset = () => {
|
|
60
|
-
reset();
|
|
61
|
-
setFilterListData(undefined);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const handleDelete = (key: string) => {
|
|
65
|
-
setValue(`${key}`, null);
|
|
66
|
-
setFilterListData((prevData) => {
|
|
67
|
-
const newData = { ...prevData };
|
|
68
|
-
|
|
69
|
-
delete newData[key];
|
|
70
|
-
|
|
71
|
-
return newData;
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const getFilterItem = (key: string) => {
|
|
76
|
-
return filterListItems.find((item) => item.key === key);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const currentFilterValue = currentFilter?.key
|
|
80
|
-
? watch(currentFilter.key)
|
|
81
|
-
: null;
|
|
82
|
-
|
|
83
|
-
const open = Boolean(anchorEl);
|
|
84
|
-
|
|
85
|
-
const renderChips = (data: FieldValues) => {
|
|
86
|
-
return Object.entries(data).map(([key, value]) => {
|
|
87
|
-
if (!value) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const item = getFilterItem(key);
|
|
92
|
-
|
|
93
|
-
const keyValue = item && getFormValue(value, item);
|
|
94
|
-
|
|
95
|
-
return (
|
|
96
|
-
<FilterPill
|
|
97
|
-
ref={filterPopupAnchorElm}
|
|
98
|
-
key={key}
|
|
99
|
-
label={
|
|
100
|
-
<Tooltip
|
|
101
|
-
toolTipLabel={`${keyValue}`}
|
|
102
|
-
>{`${item?.label}: ${keyValue}`}</Tooltip>
|
|
103
|
-
}
|
|
104
|
-
onDelete={() => handleDelete(key)}
|
|
105
|
-
onClick={(e: { currentTarget: HTMLDivElement | null }) => {
|
|
106
|
-
setOpenFilterPopup(true);
|
|
107
|
-
filterPopupAnchorElm.current = e.currentTarget;
|
|
108
|
-
|
|
109
|
-
const item = getFilterItem(key);
|
|
110
|
-
|
|
111
|
-
if (item) {
|
|
112
|
-
setCurrentFilter(item);
|
|
113
|
-
handleFilterItemClick(item);
|
|
114
|
-
}
|
|
115
|
-
}}
|
|
116
|
-
/>
|
|
117
|
-
);
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<Stack>
|
|
123
|
-
<Stack direction="row" spacing={1} alignItems="center">
|
|
124
|
-
{filterListData && renderChips(filterListData)}
|
|
125
|
-
<IconButton
|
|
126
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
127
|
-
ref={filterPopupAnchorElm as any}
|
|
128
|
-
onClick={handleClick}
|
|
129
|
-
sx={{ height: "40px" }}
|
|
130
|
-
>
|
|
131
|
-
<SvgFilterList />
|
|
132
|
-
</IconButton>
|
|
133
|
-
<Button onClick={() => handlerReset()} variant="text">
|
|
134
|
-
Clear Filter
|
|
135
|
-
</Button>
|
|
136
|
-
</Stack>
|
|
137
|
-
<FilterPopup
|
|
138
|
-
open={open}
|
|
139
|
-
anchorEl={anchorEl}
|
|
140
|
-
onClose={handleClose}
|
|
141
|
-
onApply={() => {
|
|
142
|
-
handleSubmit(onSubmit)();
|
|
143
|
-
}}
|
|
144
|
-
>
|
|
145
|
-
{filterListItems.map((filter) => (
|
|
146
|
-
<Box
|
|
147
|
-
key={filter.key}
|
|
148
|
-
onClick={() =>
|
|
149
|
-
filter.type !== "switch" && handleFilterItemClick(filter)
|
|
150
|
-
}
|
|
151
|
-
>
|
|
152
|
-
<FilterTypeWrapper filter={filter} control={control} />
|
|
153
|
-
</Box>
|
|
154
|
-
))}
|
|
155
|
-
</FilterPopup>
|
|
156
|
-
|
|
157
|
-
{currentFilter && currentFilter.type !== "switch" && (
|
|
158
|
-
<FilterPopupWrapper
|
|
159
|
-
open={openFilterPopup}
|
|
160
|
-
onClose={handleCloseFilterPopup}
|
|
161
|
-
onApply={() => {
|
|
162
|
-
handleSubmit(onSubmit)();
|
|
163
|
-
}}
|
|
164
|
-
control={control}
|
|
165
|
-
currentFilterValue={currentFilterValue}
|
|
166
|
-
anchorEl={filterPopupAnchorElm.current}
|
|
167
|
-
filterItem={currentFilter}
|
|
168
|
-
/>
|
|
169
|
-
)}
|
|
170
|
-
</Stack>
|
|
171
|
-
);
|
|
172
|
-
};
|