@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,26 +0,0 @@
|
|
|
1
|
-
import { Skeleton as MuiSkeleton, Stack } from "@mui/material";
|
|
2
|
-
|
|
3
|
-
type SkeletonProps = {
|
|
4
|
-
label?: string;
|
|
5
|
-
};
|
|
6
|
-
export const Skeleton = ({ label }: SkeletonProps) => {
|
|
7
|
-
return (
|
|
8
|
-
<Stack gap="10px">
|
|
9
|
-
{label && (
|
|
10
|
-
<MuiSkeleton
|
|
11
|
-
width={120}
|
|
12
|
-
height="23px"
|
|
13
|
-
sx={{
|
|
14
|
-
transform: "scale(1)",
|
|
15
|
-
}}
|
|
16
|
-
/>
|
|
17
|
-
)}
|
|
18
|
-
<MuiSkeleton
|
|
19
|
-
height="40px"
|
|
20
|
-
sx={{
|
|
21
|
-
transform: "scale(1)",
|
|
22
|
-
}}
|
|
23
|
-
/>
|
|
24
|
-
</Stack>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Autocomplete";
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Check } from "@mui/icons-material";
|
|
2
|
-
import type { CSSObject, CheckboxProps } from "@mui/material";
|
|
3
|
-
import { Box, styled } from "@mui/material";
|
|
4
|
-
|
|
5
|
-
export const BoxStyled = styled(Box)<{ size: CheckboxProps["size"] }>(({
|
|
6
|
-
theme,
|
|
7
|
-
size,
|
|
8
|
-
}) => {
|
|
9
|
-
const { color } = theme.palette.app;
|
|
10
|
-
|
|
11
|
-
const checkBoxSize =
|
|
12
|
-
size === "small"
|
|
13
|
-
? {
|
|
14
|
-
width: "14px",
|
|
15
|
-
height: "14px",
|
|
16
|
-
}
|
|
17
|
-
: {
|
|
18
|
-
width: "20px",
|
|
19
|
-
height: "20px",
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const style: CSSObject = {
|
|
23
|
-
...checkBoxSize,
|
|
24
|
-
borderRadius: "4px",
|
|
25
|
-
border: `2px solid ${color.iron[900]}`,
|
|
26
|
-
"input:hover ~ &": {
|
|
27
|
-
borderColor: color.butterflyBlue[900],
|
|
28
|
-
},
|
|
29
|
-
"input:disabled ~ &": {
|
|
30
|
-
borderColor: color.iron[800],
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
return style;
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export const CheckStyled = styled(Check)<{ size: CheckboxProps["size"] }>(({
|
|
38
|
-
theme,
|
|
39
|
-
size,
|
|
40
|
-
}) => {
|
|
41
|
-
const { color } = theme.palette.app;
|
|
42
|
-
|
|
43
|
-
const checkBoxSize =
|
|
44
|
-
size === "small"
|
|
45
|
-
? {
|
|
46
|
-
width: "14px",
|
|
47
|
-
height: "14px",
|
|
48
|
-
}
|
|
49
|
-
: {
|
|
50
|
-
width: "20px",
|
|
51
|
-
height: "20px",
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const style: CSSObject = {
|
|
55
|
-
...checkBoxSize,
|
|
56
|
-
border: `2px solid ${color.butterflyBlue[900]}`,
|
|
57
|
-
borderRadius: "4px",
|
|
58
|
-
color: color.iron[600],
|
|
59
|
-
backgroundColor: color.butterflyBlue[900],
|
|
60
|
-
"input:disabled ~ &": {
|
|
61
|
-
borderColor: color.iron[800],
|
|
62
|
-
backgroundColor: color.iron[800],
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
return style;
|
|
67
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import Checkbox, {
|
|
2
|
-
type CheckboxProps as MuiCheckboxProps,
|
|
3
|
-
} from "@mui/material/Checkbox";
|
|
4
|
-
import {
|
|
5
|
-
useController,
|
|
6
|
-
type ControllerRenderProps,
|
|
7
|
-
type FieldValues,
|
|
8
|
-
type UseControllerProps,
|
|
9
|
-
} from "react-hook-form";
|
|
10
|
-
import { BoxStyled, CheckStyled } from "./CheckBox.styled";
|
|
11
|
-
import { Skeleton } from "./Skeleton";
|
|
12
|
-
|
|
13
|
-
export type CheckBoxProps<P extends FieldValues> = UseControllerProps<P> &
|
|
14
|
-
Omit<Omit<MuiCheckboxProps, "checked">, keyof ControllerRenderProps<P>> & {
|
|
15
|
-
loading?: boolean;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function CheckBox<P extends FieldValues>({
|
|
19
|
-
name,
|
|
20
|
-
rules,
|
|
21
|
-
control,
|
|
22
|
-
defaultValue,
|
|
23
|
-
size,
|
|
24
|
-
loading = false,
|
|
25
|
-
...restCheckBoxProps
|
|
26
|
-
}: CheckBoxProps<P>) {
|
|
27
|
-
const {
|
|
28
|
-
field: { value = false, ...restField },
|
|
29
|
-
} = useController({ name, control, defaultValue, rules });
|
|
30
|
-
|
|
31
|
-
if (loading) {
|
|
32
|
-
return <Skeleton />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<Checkbox
|
|
37
|
-
icon={<BoxStyled size={size} />}
|
|
38
|
-
checkedIcon={<CheckStyled size={size} />}
|
|
39
|
-
checked={value}
|
|
40
|
-
{...restField}
|
|
41
|
-
{...restCheckBoxProps}
|
|
42
|
-
/>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./CheckBox";
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
2
|
-
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
3
|
-
import { InputLabel, Stack, useTheme } from "@mui/material";
|
|
4
|
-
import type { DatePickerProps as MuiDatePickerProps } from "@mui/x-date-pickers/DatePicker";
|
|
5
|
-
import { DatePicker as MuiDatePicker } from "@mui/x-date-pickers/DatePicker";
|
|
6
|
-
import type { PickerValidDate } from "@mui/x-date-pickers/models";
|
|
7
|
-
import { isFunction } from "lodash";
|
|
8
|
-
import { DateTime } from "luxon";
|
|
9
|
-
import React, { useState } from "react";
|
|
10
|
-
import type {
|
|
11
|
-
FieldError,
|
|
12
|
-
FieldValues,
|
|
13
|
-
UseControllerProps,
|
|
14
|
-
} from "react-hook-form";
|
|
15
|
-
import { useController } from "react-hook-form";
|
|
16
|
-
import { CalendarAction } from "../../Actions";
|
|
17
|
-
import { Skeleton } from "./Skeleton";
|
|
18
|
-
|
|
19
|
-
export type DatePickerProps<P extends FieldValues> = UseControllerProps<P> &
|
|
20
|
-
MuiDatePickerProps<PickerValidDate> &
|
|
21
|
-
Partial<{
|
|
22
|
-
label?: string;
|
|
23
|
-
required: boolean;
|
|
24
|
-
disabled: boolean;
|
|
25
|
-
format: string;
|
|
26
|
-
error: boolean;
|
|
27
|
-
helperText: string;
|
|
28
|
-
loading: boolean;
|
|
29
|
-
clearable?: boolean;
|
|
30
|
-
disableKeyboardInput?: boolean;
|
|
31
|
-
setError: (
|
|
32
|
-
name: keyof P,
|
|
33
|
-
error: FieldError | { type: string; message?: string }
|
|
34
|
-
) => void;
|
|
35
|
-
}>;
|
|
36
|
-
|
|
37
|
-
export const dateFormats = {
|
|
38
|
-
dateWithISO8601: "yyyy-MM-dd",
|
|
39
|
-
dateWithEuropean: "dd-MM-yyyy",
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const LeftArrowIcon: React.FC = () => {
|
|
43
|
-
const theme = useTheme();
|
|
44
|
-
|
|
45
|
-
const { iron } = theme.palette.app.color;
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<ChevronLeftIcon
|
|
49
|
-
sx={{
|
|
50
|
-
border: `1px solid ${iron[800]}`,
|
|
51
|
-
borderRadius: "5px",
|
|
52
|
-
p: "4px",
|
|
53
|
-
}}
|
|
54
|
-
/>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const RightArrowIcon: React.FC = () => {
|
|
59
|
-
const theme = useTheme();
|
|
60
|
-
|
|
61
|
-
const { iron } = theme.palette.app.color;
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<ChevronRightIcon
|
|
65
|
-
sx={{
|
|
66
|
-
border: `1px solid ${iron[800]}`,
|
|
67
|
-
borderRadius: "5px",
|
|
68
|
-
p: "4px",
|
|
69
|
-
}}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export function DatePicker<P extends FieldValues>({
|
|
75
|
-
setError,
|
|
76
|
-
control,
|
|
77
|
-
defaultValue,
|
|
78
|
-
disabled = false,
|
|
79
|
-
label,
|
|
80
|
-
readOnly = false,
|
|
81
|
-
name,
|
|
82
|
-
error = false,
|
|
83
|
-
helperText,
|
|
84
|
-
loading = false,
|
|
85
|
-
required = false,
|
|
86
|
-
clearable = true,
|
|
87
|
-
rules,
|
|
88
|
-
disableKeyboardInput = false,
|
|
89
|
-
format = dateFormats.dateWithEuropean,
|
|
90
|
-
...restProps
|
|
91
|
-
}: DatePickerProps<P>) {
|
|
92
|
-
const {
|
|
93
|
-
field: { value, onChange, ...restField },
|
|
94
|
-
} = useController({ name, control, defaultValue, rules });
|
|
95
|
-
|
|
96
|
-
const [open, setOpen] = useState(false);
|
|
97
|
-
|
|
98
|
-
const theme = useTheme();
|
|
99
|
-
|
|
100
|
-
const { iron, butterflyBlue, mirage } = theme.palette.app.color;
|
|
101
|
-
|
|
102
|
-
const finalValue = value ? DateTime.fromISO(value) : null;
|
|
103
|
-
|
|
104
|
-
if (loading) {
|
|
105
|
-
return <Skeleton label={label} />;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const EmptyIcon = () => null;
|
|
109
|
-
|
|
110
|
-
return (
|
|
111
|
-
<Stack gap="10px">
|
|
112
|
-
{label && <InputLabel required={required}>{label}</InputLabel>}
|
|
113
|
-
|
|
114
|
-
<MuiDatePicker<DateTime>
|
|
115
|
-
{...restField}
|
|
116
|
-
{...restProps}
|
|
117
|
-
disabled={disabled}
|
|
118
|
-
format={format}
|
|
119
|
-
value={finalValue}
|
|
120
|
-
readOnly={readOnly}
|
|
121
|
-
open={open && !readOnly}
|
|
122
|
-
onOpen={() => setOpen(true)}
|
|
123
|
-
onClose={() => setOpen(false)}
|
|
124
|
-
slotProps={{
|
|
125
|
-
field: {
|
|
126
|
-
clearable,
|
|
127
|
-
onClear: () => onChange(null),
|
|
128
|
-
readOnly: disableKeyboardInput,
|
|
129
|
-
},
|
|
130
|
-
clearButton: {
|
|
131
|
-
tabIndex: -1, // This will make the clear button skipped in the tab order
|
|
132
|
-
},
|
|
133
|
-
textField: {
|
|
134
|
-
disabled,
|
|
135
|
-
helperText,
|
|
136
|
-
error,
|
|
137
|
-
InputProps: {
|
|
138
|
-
endAdornment: (
|
|
139
|
-
<CalendarAction
|
|
140
|
-
disabled={disabled}
|
|
141
|
-
onClick={() => setOpen(true)}
|
|
142
|
-
/>
|
|
143
|
-
),
|
|
144
|
-
sx: {
|
|
145
|
-
"& .MuiInputAdornment-root": {
|
|
146
|
-
width: "30px",
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
onKeyDown: (event) => {
|
|
151
|
-
if (!clearable && event.key === "Backspace") {
|
|
152
|
-
event.preventDefault();
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
day: {
|
|
157
|
-
sx: {
|
|
158
|
-
"&.MuiPickersDay-root": {
|
|
159
|
-
borderRadius: "5px",
|
|
160
|
-
borderColor: butterflyBlue[900],
|
|
161
|
-
fontWeight: 500,
|
|
162
|
-
color: mirage[900],
|
|
163
|
-
},
|
|
164
|
-
"&.MuiPickersDay-root.Mui-selected": {
|
|
165
|
-
backgroundColor: butterflyBlue[900],
|
|
166
|
-
color: iron[600],
|
|
167
|
-
},
|
|
168
|
-
"&.MuiPickersDay-today": {
|
|
169
|
-
color: butterflyBlue[900],
|
|
170
|
-
backgroundColor: iron[600],
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
calendarHeader: {
|
|
175
|
-
sx: {
|
|
176
|
-
"& .MuiPickersCalendarHeader-label": {
|
|
177
|
-
fontWeight: "bold",
|
|
178
|
-
},
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
yearButton: {
|
|
182
|
-
sx: {
|
|
183
|
-
"&.MuiPickersYear-yearButton.Mui-selected": {
|
|
184
|
-
backgroundColor: butterflyBlue[900],
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
monthButton: {
|
|
189
|
-
sx: {
|
|
190
|
-
"&.MuiPickersMonth-monthButton.Mui-selected": {
|
|
191
|
-
backgroundColor: butterflyBlue[900],
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
}}
|
|
196
|
-
slots={{
|
|
197
|
-
leftArrowIcon: LeftArrowIcon,
|
|
198
|
-
rightArrowIcon: RightArrowIcon,
|
|
199
|
-
switchViewIcon: EmptyIcon,
|
|
200
|
-
}}
|
|
201
|
-
dayOfWeekFormatter={(weekday) => `${weekday.toFormat("ccc")}`}
|
|
202
|
-
onChange={(value, details) => {
|
|
203
|
-
if (details.validationError) {
|
|
204
|
-
if (isFunction(setError)) {
|
|
205
|
-
setError(name, {
|
|
206
|
-
type: "manual",
|
|
207
|
-
message: "common.date.invalid",
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
} else if (value) {
|
|
211
|
-
onChange(value.toISODate());
|
|
212
|
-
}
|
|
213
|
-
}}
|
|
214
|
-
/>
|
|
215
|
-
</Stack>
|
|
216
|
-
);
|
|
217
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Skeleton as MuiSkeleton, Stack } from "@mui/material";
|
|
2
|
-
|
|
3
|
-
type SkeletonProps = {
|
|
4
|
-
label?: string;
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export const Skeleton = ({ label }: SkeletonProps) => {
|
|
8
|
-
return (
|
|
9
|
-
<Stack gap="10px">
|
|
10
|
-
{label && (
|
|
11
|
-
<MuiSkeleton
|
|
12
|
-
width={120}
|
|
13
|
-
height="23px"
|
|
14
|
-
sx={{
|
|
15
|
-
transform: "scale(1)",
|
|
16
|
-
}}
|
|
17
|
-
/>
|
|
18
|
-
)}
|
|
19
|
-
|
|
20
|
-
<MuiSkeleton
|
|
21
|
-
height="40px"
|
|
22
|
-
sx={{
|
|
23
|
-
transform: "scale(1)",
|
|
24
|
-
}}
|
|
25
|
-
/>
|
|
26
|
-
</Stack>
|
|
27
|
-
);
|
|
28
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./DatePicker";
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { InputLabel, Stack } from "@mui/material";
|
|
2
|
-
import { DateRangePicker as RdrDateRangePicker } from "react-date-range";
|
|
3
|
-
import type { FieldValues, UseControllerProps } from "react-hook-form";
|
|
4
|
-
import { useController } from "react-hook-form";
|
|
5
|
-
import { Skeleton } from "./Skeleton";
|
|
6
|
-
import { useState } from "react";
|
|
7
|
-
|
|
8
|
-
export type DateRangePickerProps<P extends FieldValues> =
|
|
9
|
-
UseControllerProps<P> & {
|
|
10
|
-
label?: string;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
error?: boolean;
|
|
14
|
-
helperText?: string;
|
|
15
|
-
loading?: boolean;
|
|
16
|
-
minDate?: Date;
|
|
17
|
-
maxDate?: Date;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export function DateRangePicker<P extends FieldValues>({
|
|
21
|
-
control,
|
|
22
|
-
defaultValue,
|
|
23
|
-
disabled = false,
|
|
24
|
-
label,
|
|
25
|
-
name,
|
|
26
|
-
error = false,
|
|
27
|
-
helperText,
|
|
28
|
-
loading = false,
|
|
29
|
-
required = false,
|
|
30
|
-
rules,
|
|
31
|
-
}: DateRangePickerProps<P>) {
|
|
32
|
-
const {
|
|
33
|
-
field: { onChange },
|
|
34
|
-
} = useController({ name, control, defaultValue, rules });
|
|
35
|
-
|
|
36
|
-
const [range, setRange] = useState([
|
|
37
|
-
{
|
|
38
|
-
startDate: new Date(),
|
|
39
|
-
endDate: new Date(),
|
|
40
|
-
key: "selection",
|
|
41
|
-
},
|
|
42
|
-
]);
|
|
43
|
-
|
|
44
|
-
if (loading) {
|
|
45
|
-
return <Skeleton />;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<Stack gap="10px">
|
|
50
|
-
{label && (
|
|
51
|
-
<InputLabel required={required} disabled={disabled}>
|
|
52
|
-
{label}
|
|
53
|
-
</InputLabel>
|
|
54
|
-
)}
|
|
55
|
-
|
|
56
|
-
<RdrDateRangePicker
|
|
57
|
-
ranges={range}
|
|
58
|
-
onChange={(ranges) => {
|
|
59
|
-
const selectedRange = ranges.selection;
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
selectedRange?.endDate &&
|
|
63
|
-
selectedRange?.startDate &&
|
|
64
|
-
selectedRange?.key
|
|
65
|
-
) {
|
|
66
|
-
setRange([
|
|
67
|
-
{
|
|
68
|
-
startDate: selectedRange.startDate,
|
|
69
|
-
endDate: selectedRange.endDate,
|
|
70
|
-
key: selectedRange.key,
|
|
71
|
-
},
|
|
72
|
-
]);
|
|
73
|
-
|
|
74
|
-
const startDate = new Date(
|
|
75
|
-
selectedRange.startDate.toUTCString()
|
|
76
|
-
).toISOString();
|
|
77
|
-
|
|
78
|
-
const endDate = new Date(
|
|
79
|
-
selectedRange.endDate.toUTCString()
|
|
80
|
-
).toISOString();
|
|
81
|
-
|
|
82
|
-
onChange([startDate, endDate]);
|
|
83
|
-
}
|
|
84
|
-
}}
|
|
85
|
-
months={2}
|
|
86
|
-
direction="horizontal"
|
|
87
|
-
calendarFocus="backwards"
|
|
88
|
-
staticRanges={[]}
|
|
89
|
-
inputRanges={[]}
|
|
90
|
-
moveRangeOnFirstSelection={false}
|
|
91
|
-
preventSnapRefocus={true}
|
|
92
|
-
/>
|
|
93
|
-
{error && <span style={{ color: "red" }}>{helperText}</span>}
|
|
94
|
-
</Stack>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Skeleton as MuiSkeleton, Stack } from "@mui/material";
|
|
2
|
-
|
|
3
|
-
export const Skeleton = () => {
|
|
4
|
-
return (
|
|
5
|
-
<Stack direction="row" gap="10px">
|
|
6
|
-
<Stack gap="10px">
|
|
7
|
-
<MuiSkeleton
|
|
8
|
-
width={120}
|
|
9
|
-
height="23px"
|
|
10
|
-
sx={{
|
|
11
|
-
transform: "scale(1)",
|
|
12
|
-
}}
|
|
13
|
-
/>
|
|
14
|
-
<MuiSkeleton
|
|
15
|
-
height="40px"
|
|
16
|
-
sx={{
|
|
17
|
-
transform: "scale(1)",
|
|
18
|
-
}}
|
|
19
|
-
/>
|
|
20
|
-
</Stack>
|
|
21
|
-
<Stack gap="10px">
|
|
22
|
-
<MuiSkeleton
|
|
23
|
-
width={120}
|
|
24
|
-
height="23px"
|
|
25
|
-
sx={{
|
|
26
|
-
transform: "scale(1)",
|
|
27
|
-
}}
|
|
28
|
-
/>
|
|
29
|
-
<MuiSkeleton
|
|
30
|
-
height="40px"
|
|
31
|
-
sx={{
|
|
32
|
-
transform: "scale(1)",
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
</Stack>
|
|
36
|
-
</Stack>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./DateRangePicker";
|