@codezee/sixtify-brahma 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/check-build.yml +41 -0
- package/.github/workflows/deploy-on-npm.yml +43 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +6 -0
- package/.lintstagedrc +5 -0
- package/.prettierignore +12 -0
- package/.prettierrc +22 -0
- package/.vscode/extensions.json +22 -0
- package/.vscode/settings.json +17 -0
- package/README.md +90 -0
- package/apps/docs/.eslintrc.cjs +9 -0
- package/apps/docs/.storybook/main.ts +23 -0
- package/apps/docs/.storybook/manager.ts +6 -0
- package/apps/docs/.storybook/preview.tsx +27 -0
- package/apps/docs/.storybook/theme.ts +8 -0
- package/apps/docs/next-env.d.ts +5 -0
- package/apps/docs/next.config.mjs +4 -0
- package/apps/docs/package.json +43 -0
- package/apps/docs/public/globals.css +26 -0
- package/apps/docs/stories/Actions/Actions.stories.tsx +49 -0
- package/apps/docs/stories/AgGrid/AgGrid.stories.tsx +70 -0
- package/apps/docs/stories/AppBar/AppBar.stories.tsx +39 -0
- package/apps/docs/stories/Breadcrumbs/Breadcrumbs.stories.tsx +37 -0
- package/apps/docs/stories/Button/ButtonGroup.stories.tsx +120 -0
- package/apps/docs/stories/Button/button.stories.tsx +99 -0
- package/apps/docs/stories/Card/AttendanceCard.stories.tsx +36 -0
- package/apps/docs/stories/Card/Card.stories.tsx +39 -0
- package/apps/docs/stories/Charts/PieChart.stories.tsx +265 -0
- package/apps/docs/stories/Chips/Chip.stories.tsx +141 -0
- package/apps/docs/stories/Chips/ChipWithBorder.stories.tsx +18 -0
- package/apps/docs/stories/Chips/FilterPill.stories.tsx +24 -0
- package/apps/docs/stories/Color/Color.stories.tsx +14 -0
- package/apps/docs/stories/Dialog/ButtomDialog.stories.tsx +48 -0
- package/apps/docs/stories/Dialog/DeleteDialog.stories.tsx +32 -0
- package/apps/docs/stories/Dialog/Dialog.stories.tsx +48 -0
- package/apps/docs/stories/Drawer/Drawer.stories.tsx +94 -0
- package/apps/docs/stories/FilterList/FilterList.stories.tsx +88 -0
- package/apps/docs/stories/FilterList/FilterListV2.stories.tsx +92 -0
- package/apps/docs/stories/FormFields/AutoComplete.stories.tsx +90 -0
- package/apps/docs/stories/FormFields/CheckBox.stories.tsx +64 -0
- package/apps/docs/stories/FormFields/DatePicker.stories.tsx +100 -0
- package/apps/docs/stories/FormFields/DateRangePicker.stories.tsx +39 -0
- package/apps/docs/stories/FormFields/DateTimePicker.stories.tsx +39 -0
- package/apps/docs/stories/FormFields/FileUpload.stories.tsx +83 -0
- package/apps/docs/stories/FormFields/ImageUpload.stories.tsx +69 -0
- package/apps/docs/stories/FormFields/ListItemButton.stories.tsx +59 -0
- package/apps/docs/stories/FormFields/PhoneInputField.stories.tsx +84 -0
- package/apps/docs/stories/FormFields/RadioGroupField.stories.tsx +172 -0
- package/apps/docs/stories/FormFields/SearchField.stories.tsx +74 -0
- package/apps/docs/stories/FormFields/TextField.stories.tsx +141 -0
- package/apps/docs/stories/FormFields/TimeField.stories.tsx +84 -0
- package/apps/docs/stories/FormFields/TimePicker.stories.tsx +84 -0
- package/apps/docs/stories/Indicator/Indicator.stories.tsx +33 -0
- package/apps/docs/stories/Indicator/SeverityIndicator.stories.tsx +27 -0
- package/apps/docs/stories/Layouts/FormRow.stories.tsx +45 -0
- package/apps/docs/stories/PadBox/PadBox.stories.tsx +49 -0
- package/apps/docs/stories/Stepper/Stepper.stories.tsx +110 -0
- package/apps/docs/stories/Stepper/StepperV2.stories.tsx +44 -0
- package/apps/docs/stories/Timeline/AttendanceStatus.stories.tsx +29 -0
- package/apps/docs/stories/Timeline/Timeline.stories.tsx +38 -0
- package/apps/docs/stories/Tooltip/Tooltip.stories.tsx +28 -0
- package/apps/docs/stories/UserProfileMenu/UserProfileMenu.stories.tsx +112 -0
- package/apps/docs/tsconfig.json +19 -0
- package/commitlint.config.cjs +6 -0
- package/index.ts +1 -0
- package/package.json +85 -0
- package/packages/eslint-config/README.md +3 -0
- package/packages/eslint-config/library.js +88 -0
- package/packages/eslint-config/next.js +85 -0
- package/packages/eslint-config/package.json +19 -0
- package/packages/eslint-config/react-internal.js +89 -0
- package/packages/shared-components/.eslintrc.js +10 -0
- package/packages/shared-components/package.json +51 -0
- package/packages/shared-components/src/Actions/AddAction.tsx +16 -0
- package/packages/shared-components/src/Actions/CalendarAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ConfigureAction.tsx +16 -0
- package/packages/shared-components/src/Actions/DeleteAction.tsx +16 -0
- package/packages/shared-components/src/Actions/DownloadAction.tsx +16 -0
- package/packages/shared-components/src/Actions/EditAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ExportAction.tsx +16 -0
- package/packages/shared-components/src/Actions/FilterAction.tsx +16 -0
- package/packages/shared-components/src/Actions/HistoryAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ImportAction.tsx +16 -0
- package/packages/shared-components/src/Actions/ViewAction.tsx +16 -0
- package/packages/shared-components/src/Actions/index.ts +11 -0
- package/packages/shared-components/src/AgGrid/ActionCell/ActionCell.tsx +57 -0
- package/packages/shared-components/src/AgGrid/ActionCell/Popover.tsx +32 -0
- package/packages/shared-components/src/AgGrid/AgGrid.tsx +93 -0
- package/packages/shared-components/src/AgGrid/LoadingCell.tsx +5 -0
- package/packages/shared-components/src/AgGrid/index.ts +3 -0
- package/packages/shared-components/src/AppBar/AppBar.styled.tsx +33 -0
- package/packages/shared-components/src/AppBar/AppBar.tsx +20 -0
- package/packages/shared-components/src/AppBar/index.ts +1 -0
- package/packages/shared-components/src/Breadcrumbs/Breadcrumbs.tsx +76 -0
- package/packages/shared-components/src/Breadcrumbs/index.ts +1 -0
- package/packages/shared-components/src/Button/ActionButton.tsx +38 -0
- package/packages/shared-components/src/Button/Button.tsx +19 -0
- package/packages/shared-components/src/Button/ButtonGroup.tsx +37 -0
- package/packages/shared-components/src/Button/index.ts +3 -0
- package/packages/shared-components/src/Card/AttendanceCard.tsx +51 -0
- package/packages/shared-components/src/Card/Card.tsx +34 -0
- package/packages/shared-components/src/Card/CardItem/CardItem.tsx +33 -0
- package/packages/shared-components/src/Card/CardItem/CardItemValue.tsx +98 -0
- package/packages/shared-components/src/Card/CardItem/index.ts +2 -0
- package/packages/shared-components/src/Card/ProfileCard/ProfileCard.tsx +40 -0
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardBody.tsx +53 -0
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.tsx +94 -0
- package/packages/shared-components/src/Card/index.ts +6 -0
- package/packages/shared-components/src/Charts/PieChart.tsx +81 -0
- package/packages/shared-components/src/Charts/Skeleton.tsx +36 -0
- package/packages/shared-components/src/Charts/index.ts +1 -0
- package/packages/shared-components/src/Chips/Chip.tsx +26 -0
- package/packages/shared-components/src/Chips/ChipWithBorder.tsx +39 -0
- package/packages/shared-components/src/Chips/FilterPill.tsx +47 -0
- package/packages/shared-components/src/Chips/index.ts +3 -0
- package/packages/shared-components/src/Dialog/BottomDialog.styled.tsx +28 -0
- package/packages/shared-components/src/Dialog/BottomDialog.tsx +37 -0
- package/packages/shared-components/src/Dialog/DeleteDialog.tsx +48 -0
- package/packages/shared-components/src/Dialog/Dialog.tsx +61 -0
- package/packages/shared-components/src/Dialog/index.ts +3 -0
- package/packages/shared-components/src/Drawer/Bullet.tsx +12 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItem.tsx +57 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItemList.tsx +109 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.tsx +128 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/Popover.tsx +45 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/Popper.tsx +43 -0
- package/packages/shared-components/src/Drawer/Drawer.styled.tsx +63 -0
- package/packages/shared-components/src/Drawer/Drawer.tsx +56 -0
- package/packages/shared-components/src/Drawer/MenuItem.tsx +75 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerCollapse.tsx +13 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItem.tsx +48 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItemList.tsx +232 -0
- package/packages/shared-components/src/Drawer/index.ts +1 -0
- package/packages/shared-components/src/FilterList/DateRangePickerPopUp.tsx +123 -0
- package/packages/shared-components/src/FilterList/FilterList.tsx +180 -0
- package/packages/shared-components/src/FilterList/FilterListV2.tsx +661 -0
- package/packages/shared-components/src/FilterList/FilterPopup.tsx +165 -0
- package/packages/shared-components/src/FilterList/FilterPopupWrapper.tsx +110 -0
- package/packages/shared-components/src/FilterList/FilterTypeWrapper.tsx +60 -0
- package/packages/shared-components/src/FilterList/GetFilterPopupComponent.tsx +76 -0
- package/packages/shared-components/src/FilterList/getFormData.ts +29 -0
- package/packages/shared-components/src/FilterList/index.ts +6 -0
- package/packages/shared-components/src/FormFields/Autocomplete/Autocomplete.tsx +509 -0
- package/packages/shared-components/src/FormFields/Autocomplete/Skeleton.tsx +26 -0
- package/packages/shared-components/src/FormFields/Autocomplete/index.ts +1 -0
- package/packages/shared-components/src/FormFields/CheckBox/CheckBox.styled.tsx +76 -0
- package/packages/shared-components/src/FormFields/CheckBox/CheckBox.tsx +44 -0
- package/packages/shared-components/src/FormFields/CheckBox/Skeleton.tsx +12 -0
- package/packages/shared-components/src/FormFields/CheckBox/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DatePicker/DatePicker.tsx +217 -0
- package/packages/shared-components/src/FormFields/DatePicker/Skeleton.tsx +28 -0
- package/packages/shared-components/src/FormFields/DatePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/DateRangePicker.tsx +97 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/Skeleton.tsx +38 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DateTimePicker/DateTimePicker.tsx +253 -0
- package/packages/shared-components/src/FormFields/DateTimePicker/Skeleton.tsx +24 -0
- package/packages/shared-components/src/FormFields/DateTimePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileNames.tsx +32 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.styled.tsx +31 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.tsx +160 -0
- package/packages/shared-components/src/FormFields/FileUpload/Skeleton.tsx +21 -0
- package/packages/shared-components/src/FormFields/FileUpload/index.ts +2 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.styled.tsx +20 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.tsx +181 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUploadView.tsx +65 -0
- package/packages/shared-components/src/FormFields/ImageUpload/PhotoCaptureDialog.tsx +74 -0
- package/packages/shared-components/src/FormFields/ImageUpload/Skeleton.tsx +31 -0
- package/packages/shared-components/src/FormFields/ImageUpload/index.ts +2 -0
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.styled.tsx +25 -0
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.tsx +52 -0
- package/packages/shared-components/src/FormFields/ListItemButton/index.ts +1 -0
- package/packages/shared-components/src/FormFields/PasswordField/PasswordField.tsx +50 -0
- package/packages/shared-components/src/FormFields/PasswordField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/PhoneInputField/PhoneInputField.tsx +108 -0
- package/packages/shared-components/src/FormFields/PhoneInputField/Skeleton.tsx +31 -0
- package/packages/shared-components/src/FormFields/PhoneInputField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/RadioGroupField/RadioGroupField.tsx +105 -0
- package/packages/shared-components/src/FormFields/RadioGroupField/Skeleton.tsx +26 -0
- package/packages/shared-components/src/FormFields/RadioGroupField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/SearchField/SearchField.tsx +21 -0
- package/packages/shared-components/src/FormFields/SearchField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/Switch/Skeleton.tsx +12 -0
- package/packages/shared-components/src/FormFields/Switch/Switch.tsx +33 -0
- package/packages/shared-components/src/FormFields/Switch/index.ts +1 -0
- package/packages/shared-components/src/FormFields/TextField/Skeleton.tsx +31 -0
- package/packages/shared-components/src/FormFields/TextField/TextField.tsx +167 -0
- package/packages/shared-components/src/FormFields/TextField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/TimeField/Skeleton.tsx +24 -0
- package/packages/shared-components/src/FormFields/TimeField/TimeField.tsx +120 -0
- package/packages/shared-components/src/FormFields/TimeField/index.ts +1 -0
- package/packages/shared-components/src/FormFields/TimePicker/Skeleton.tsx +24 -0
- package/packages/shared-components/src/FormFields/TimePicker/TimePicker.tsx +168 -0
- package/packages/shared-components/src/FormFields/TimePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/index.ts +16 -0
- package/packages/shared-components/src/Indicator/Indicator.tsx +18 -0
- package/packages/shared-components/src/Indicator/SeverityIndicator.tsx +34 -0
- package/packages/shared-components/src/Indicator/index.ts +2 -0
- package/packages/shared-components/src/Layouts/FormContainer.tsx +6 -0
- package/packages/shared-components/src/Layouts/FormGridLayout.tsx +27 -0
- package/packages/shared-components/src/Layouts/FormRow/FormRow.styled.tsx +47 -0
- package/packages/shared-components/src/Layouts/FormRow/FormRow.tsx +20 -0
- package/packages/shared-components/src/Layouts/FormRow/index.ts +1 -0
- package/packages/shared-components/src/Layouts/FormSection.tsx +22 -0
- package/packages/shared-components/src/Layouts/index.ts +4 -0
- package/packages/shared-components/src/Loader/FacebookCircularProgress.tsx +41 -0
- package/packages/shared-components/src/Loader/index.ts +1 -0
- package/packages/shared-components/src/PadBox/PadBox.tsx +21 -0
- package/packages/shared-components/src/PadBox/index.ts +1 -0
- package/packages/shared-components/src/Pagination/Pagination.tsx +42 -0
- package/packages/shared-components/src/Pagination/index.ts +1 -0
- package/packages/shared-components/src/Stepper/Stepper.tsx +88 -0
- package/packages/shared-components/src/Stepper/StepperV2.tsx +115 -0
- package/packages/shared-components/src/Stepper/StepperV3.tsx +72 -0
- package/packages/shared-components/src/Stepper/index.ts +3 -0
- package/packages/shared-components/src/Svgs/AppLogo/AppLogoMedium.tsx +65 -0
- package/packages/shared-components/src/Svgs/AppLogo/AppLogoSmall.tsx +48 -0
- package/packages/shared-components/src/Svgs/ArrowUp.tsx +11 -0
- package/packages/shared-components/src/Svgs/Company/CompanyBanner.tsx +480 -0
- package/packages/shared-components/src/Svgs/Company/index.ts +1 -0
- package/packages/shared-components/src/Svgs/Drawer/SettingIcon.tsx +31 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgBankConfig.tsx +36 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgConfiguration.tsx +16 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgPayroll.tsx +32 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgsEmployees.tsx +25 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgsOrganization.tsx +36 -0
- package/packages/shared-components/src/Svgs/Drawer/SvgsTransaction.tsx +81 -0
- package/packages/shared-components/src/Svgs/Drawer/index.ts +7 -0
- package/packages/shared-components/src/Svgs/FormAction.tsx +118 -0
- package/packages/shared-components/src/Svgs/ImportExcelSuccessIcon.tsx +54 -0
- package/packages/shared-components/src/Svgs/LogoIcon.tsx +74 -0
- package/packages/shared-components/src/Svgs/SvgAdd.tsx +28 -0
- package/packages/shared-components/src/Svgs/SvgCalendar.tsx +89 -0
- package/packages/shared-components/src/Svgs/SvgConfigure.tsx +51 -0
- package/packages/shared-components/src/Svgs/SvgDelete.tsx +55 -0
- package/packages/shared-components/src/Svgs/SvgDownload.tsx +20 -0
- package/packages/shared-components/src/Svgs/SvgEmail.tsx +27 -0
- package/packages/shared-components/src/Svgs/SvgExport.tsx +33 -0
- package/packages/shared-components/src/Svgs/SvgFilterList.tsx +22 -0
- package/packages/shared-components/src/Svgs/SvgImport.tsx +43 -0
- package/packages/shared-components/src/Svgs/SvgNoLogo.tsx +66 -0
- package/packages/shared-components/src/Svgs/SvgNoSign.tsx +28 -0
- package/packages/shared-components/src/Svgs/SvgPhone.tsx +19 -0
- package/packages/shared-components/src/Svgs/SvgProfile.tsx +33 -0
- package/packages/shared-components/src/Svgs/SvgView.tsx +16 -0
- package/packages/shared-components/src/Svgs/SvgsDrop.tsx +44 -0
- package/packages/shared-components/src/Svgs/SvgsEdit.tsx +42 -0
- package/packages/shared-components/src/Svgs/SvgsHistory.tsx +40 -0
- package/packages/shared-components/src/Svgs/SvgsHome.tsx +18 -0
- package/packages/shared-components/src/Svgs/SvgsIndicator.tsx +24 -0
- package/packages/shared-components/src/Svgs/index.ts +18 -0
- package/packages/shared-components/src/Tab/Skeleton.tsx +15 -0
- package/packages/shared-components/src/Tab/Tabs.tsx +64 -0
- package/packages/shared-components/src/Tab/index.ts +1 -0
- package/packages/shared-components/src/Timeline/AttendanceStatus.tsx +56 -0
- package/packages/shared-components/src/Timeline/Timeline.tsx +159 -0
- package/packages/shared-components/src/Timeline/TimelineTrackSegments.tsx +130 -0
- package/packages/shared-components/src/Timeline/index.ts +2 -0
- package/packages/shared-components/src/Toast/Toast.tsx +59 -0
- package/packages/shared-components/src/Toast/ToastBody.tsx +26 -0
- package/packages/shared-components/src/Toast/ToastFooterLink.tsx +19 -0
- package/packages/shared-components/src/Toast/Toaster.styled.tsx +80 -0
- package/packages/shared-components/src/Toast/Toaster.tsx +21 -0
- package/packages/shared-components/src/Toast/index.ts +3 -0
- package/packages/shared-components/src/Toast/toasts.tsx +28 -0
- package/packages/shared-components/src/Toast/types.ts +13 -0
- package/packages/shared-components/src/Tooltip/Tooltip.tsx +36 -0
- package/packages/shared-components/src/Tooltip/index.ts +1 -0
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.styled.tsx +42 -0
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.tsx +168 -0
- package/packages/shared-components/src/UserProfileMenu/index.ts +1 -0
- package/packages/shared-components/src/index.ts +25 -0
- package/packages/shared-components/src/utils/colorVariant.ts +162 -0
- package/packages/shared-components/src/utils/date.ts +25 -0
- package/packages/shared-components/src/utils/file.ts +22 -0
- package/packages/shared-components/src/utils/index.ts +11 -0
- package/packages/shared-components/src/utils/theme/colorPalette.ts +112 -0
- package/packages/shared-components/src/utils/theme/colorPaletteUI.tsx +44 -0
- package/packages/shared-components/src/utils/theme/paletteDark.ts +10 -0
- package/packages/shared-components/src/utils/theme/paletteLight.ts +31 -0
- package/packages/shared-components/src/utils/theme/theme.ts +297 -0
- package/packages/shared-components/src/utils/theme/types.ts +18 -0
- package/packages/shared-components/src/utils/theme/typography.ts +52 -0
- package/packages/shared-components/src/utils/urlToNestedObject.ts +9 -0
- package/packages/shared-components/tsconfig.json +8 -0
- package/packages/shared-components/tsconfig.lint.json +8 -0
- package/packages/shared-components/webpack/cjs.js +20 -0
- package/packages/shared-components/webpack/common.js +36 -0
- package/packages/typescript-config/base.json +20 -0
- package/packages/typescript-config/nextjs.json +13 -0
- package/packages/typescript-config/package.json +9 -0
- package/packages/typescript-config/react-library.json +8 -0
- package/pnpm-workspace.yaml +3 -0
- package/turbo.json +42 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Box, Slider, Stack, Tooltip } from "@mui/material";
|
|
2
|
+
import { DateTime } from "luxon";
|
|
3
|
+
import { ArrowUp } from "../Svgs/ArrowUp";
|
|
4
|
+
import { type WorkDayType } from "../utils/colorVariant";
|
|
5
|
+
import { getTimeInHHmm } from "../utils/date";
|
|
6
|
+
import { TimelineTrackSegments } from "./TimelineTrackSegments";
|
|
7
|
+
|
|
8
|
+
export type HighlightedInterval = {
|
|
9
|
+
in_time: string;
|
|
10
|
+
out_time: string;
|
|
11
|
+
status_type: WorkDayType;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type TimelineProps = {
|
|
15
|
+
totalDots: number;
|
|
16
|
+
highlightedIntervals: HighlightedInterval[];
|
|
17
|
+
startTimeline: string;
|
|
18
|
+
shiftStartTime: string;
|
|
19
|
+
shiftEndTime: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const getArrowValue = (date: string) => {
|
|
23
|
+
const time = DateTime.fromFormat(date, "HH:mm");
|
|
24
|
+
|
|
25
|
+
const hour = time.hour;
|
|
26
|
+
|
|
27
|
+
const minute = time.minute;
|
|
28
|
+
|
|
29
|
+
return hour + minute / 60;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Timeline = ({
|
|
33
|
+
totalDots,
|
|
34
|
+
highlightedIntervals,
|
|
35
|
+
shiftStartTime,
|
|
36
|
+
shiftEndTime,
|
|
37
|
+
startTimeline = "2024-11-17T18:30:04.000Z",
|
|
38
|
+
}: TimelineProps) => {
|
|
39
|
+
const slotStartTime = parseFloat(getTimeInHHmm(startTimeline));
|
|
40
|
+
|
|
41
|
+
const getArrowPosition = (
|
|
42
|
+
shiftStartTime: string,
|
|
43
|
+
shiftEndTime: string,
|
|
44
|
+
type: "END" | "START"
|
|
45
|
+
) => {
|
|
46
|
+
const shiftStart = getTimeInHHmm(shiftStartTime);
|
|
47
|
+
|
|
48
|
+
const shiftEnd = getTimeInHHmm(shiftEndTime);
|
|
49
|
+
|
|
50
|
+
let shiftStartValue = getArrowValue(shiftStart);
|
|
51
|
+
|
|
52
|
+
let shiftEndValue = getArrowValue(shiftEnd);
|
|
53
|
+
|
|
54
|
+
shiftStartValue =
|
|
55
|
+
shiftStartValue < slotStartTime
|
|
56
|
+
? shiftStartValue + totalDots
|
|
57
|
+
: shiftStartValue;
|
|
58
|
+
|
|
59
|
+
shiftEndValue =
|
|
60
|
+
shiftEndValue < shiftStartValue
|
|
61
|
+
? shiftEndValue + totalDots
|
|
62
|
+
: shiftEndValue;
|
|
63
|
+
|
|
64
|
+
return type === "END" ? shiftEndValue : shiftStartValue;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const isHighlighted = (index: number) => {
|
|
68
|
+
const wrappedValue = (index + slotStartTime) % totalDots;
|
|
69
|
+
|
|
70
|
+
return highlightedIntervals.some(
|
|
71
|
+
(interval) =>
|
|
72
|
+
wrappedValue >= parseFloat(getTimeInHHmm(interval.in_time)) &&
|
|
73
|
+
wrappedValue <= parseFloat(getTimeInHHmm(interval.out_time))
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const marks = Array.from({ length: totalDots }, (_, index) => ({
|
|
78
|
+
value: (index + slotStartTime) % totalDots,
|
|
79
|
+
label: "",
|
|
80
|
+
highlighted: isHighlighted((index + slotStartTime) % totalDots),
|
|
81
|
+
}));
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<Stack sx={{ position: "relative", width: "100%" }}>
|
|
85
|
+
<TimelineTrackSegments
|
|
86
|
+
totalDots={totalDots}
|
|
87
|
+
intervals={highlightedIntervals}
|
|
88
|
+
startTimeline={slotStartTime}
|
|
89
|
+
/>
|
|
90
|
+
<Tooltip
|
|
91
|
+
title={`Shift Start: ${getTimeInHHmm(shiftStartTime)}`}
|
|
92
|
+
arrow
|
|
93
|
+
placement="top"
|
|
94
|
+
>
|
|
95
|
+
<Box
|
|
96
|
+
sx={{
|
|
97
|
+
cursor: "pointer",
|
|
98
|
+
position: "absolute",
|
|
99
|
+
top: "12px",
|
|
100
|
+
zIndex: 2,
|
|
101
|
+
left: `${(((getArrowPosition(shiftStartTime, shiftEndTime, "START") - slotStartTime) % totalDots) / (totalDots + 0.5)) * 100}%`,
|
|
102
|
+
}}
|
|
103
|
+
>
|
|
104
|
+
<ArrowUp />
|
|
105
|
+
</Box>
|
|
106
|
+
</Tooltip>
|
|
107
|
+
<Tooltip
|
|
108
|
+
title={`Shift End: ${getTimeInHHmm(shiftEndTime)}`}
|
|
109
|
+
arrow
|
|
110
|
+
placement="top"
|
|
111
|
+
>
|
|
112
|
+
<Box
|
|
113
|
+
sx={{
|
|
114
|
+
cursor: "pointer",
|
|
115
|
+
position: "absolute",
|
|
116
|
+
top: "12px",
|
|
117
|
+
zIndex: 2,
|
|
118
|
+
left: `${(((getArrowPosition(shiftStartTime, shiftEndTime, "END") - slotStartTime) % totalDots) / (totalDots - 0.5)) * 100}%`,
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
<ArrowUp />
|
|
122
|
+
</Box>
|
|
123
|
+
</Tooltip>
|
|
124
|
+
<Slider
|
|
125
|
+
valueLabelDisplay="off"
|
|
126
|
+
marks={marks}
|
|
127
|
+
max={totalDots - 1}
|
|
128
|
+
step={1}
|
|
129
|
+
value={[]}
|
|
130
|
+
sx={{
|
|
131
|
+
zIndex: 1,
|
|
132
|
+
"& .MuiSlider-track": {
|
|
133
|
+
background: "transparent",
|
|
134
|
+
height: 1,
|
|
135
|
+
border: "none",
|
|
136
|
+
},
|
|
137
|
+
"& .MuiSlider-mark": {
|
|
138
|
+
backgroundColor: "gray",
|
|
139
|
+
height: 4,
|
|
140
|
+
width: 4,
|
|
141
|
+
borderRadius: "50%",
|
|
142
|
+
},
|
|
143
|
+
"& .MuiSlider-markActive": {
|
|
144
|
+
backgroundColor: "transparent",
|
|
145
|
+
height: 5,
|
|
146
|
+
width: 5,
|
|
147
|
+
},
|
|
148
|
+
"& .MuiSlider-rail": {
|
|
149
|
+
height: 2,
|
|
150
|
+
backgroundColor: "#929292",
|
|
151
|
+
},
|
|
152
|
+
"& .MuiSlider-thumb": {
|
|
153
|
+
display: "none",
|
|
154
|
+
},
|
|
155
|
+
}}
|
|
156
|
+
/>
|
|
157
|
+
</Stack>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Box, Stack, Tooltip } from "@mui/material";
|
|
2
|
+
import { DateTime } from "luxon";
|
|
3
|
+
import { getColorByVariant } from "../utils/colorVariant";
|
|
4
|
+
import { getTimeInHHmm } from "../utils/date";
|
|
5
|
+
import { getArrowValue, type HighlightedInterval } from "./Timeline";
|
|
6
|
+
|
|
7
|
+
type TimelineTrackSegmentsProps = {
|
|
8
|
+
totalDots: number;
|
|
9
|
+
intervals: HighlightedInterval[];
|
|
10
|
+
startTimeline: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const TimelineTrackSegments = ({
|
|
14
|
+
totalDots,
|
|
15
|
+
intervals,
|
|
16
|
+
startTimeline,
|
|
17
|
+
}: TimelineTrackSegmentsProps) => {
|
|
18
|
+
return (
|
|
19
|
+
<Box sx={{ position: "relative", width: "100%", height: 4 }}>
|
|
20
|
+
{intervals?.map((interval, index) => {
|
|
21
|
+
const inTime = getTimeInHHmm(interval.in_time);
|
|
22
|
+
|
|
23
|
+
const outTime = getTimeInHHmm(interval.out_time);
|
|
24
|
+
|
|
25
|
+
const intervalInTime = DateTime.fromISO(interval.in_time);
|
|
26
|
+
|
|
27
|
+
const intervalOutTime = DateTime.fromISO(interval.out_time);
|
|
28
|
+
|
|
29
|
+
const shiftHours = intervalOutTime
|
|
30
|
+
.diff(intervalInTime, ["hours", "minutes"])
|
|
31
|
+
.toFormat("hh:mm");
|
|
32
|
+
|
|
33
|
+
let in_time = getArrowValue(inTime);
|
|
34
|
+
|
|
35
|
+
in_time = in_time < startTimeline ? in_time + totalDots : in_time;
|
|
36
|
+
|
|
37
|
+
let out_time = getArrowValue(outTime);
|
|
38
|
+
|
|
39
|
+
out_time = out_time < in_time ? out_time + totalDots : out_time;
|
|
40
|
+
|
|
41
|
+
const isValidInTime = !isNaN(in_time);
|
|
42
|
+
|
|
43
|
+
const isValidOutTime = !isNaN(out_time);
|
|
44
|
+
|
|
45
|
+
let inTimeLabel = "";
|
|
46
|
+
|
|
47
|
+
let outTimeLabel = "";
|
|
48
|
+
|
|
49
|
+
if (isValidInTime) {
|
|
50
|
+
inTimeLabel = `In time : ${inTime} ${!isValidOutTime ? " / Missing punch" : ""}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (isValidOutTime) {
|
|
54
|
+
outTimeLabel = `Out time : ${outTime} ${!isValidInTime ? "/ Missing punch" : ""}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const startPercent =
|
|
58
|
+
(((in_time - startTimeline) % totalDots) / (totalDots - 1)) * 100;
|
|
59
|
+
|
|
60
|
+
const endPercent =
|
|
61
|
+
(((out_time - startTimeline) % totalDots) / (totalDots - 1)) * 100;
|
|
62
|
+
|
|
63
|
+
const labelText = `In/Out: ${getTimeInHHmm(interval.in_time)} - ${getTimeInHHmm(
|
|
64
|
+
interval.out_time
|
|
65
|
+
)} (${shiftHours})`;
|
|
66
|
+
|
|
67
|
+
const color = getColorByVariant(interval.status_type);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
// eslint-disable-next-line sonarjs/no-array-index-key
|
|
71
|
+
<Stack direction="row" key={index}>
|
|
72
|
+
{isValidInTime && (
|
|
73
|
+
<Tooltip arrow title={inTimeLabel} placement="top">
|
|
74
|
+
<Box
|
|
75
|
+
sx={{
|
|
76
|
+
height: 8,
|
|
77
|
+
width: 8,
|
|
78
|
+
position: "absolute",
|
|
79
|
+
left: `${startPercent}%`,
|
|
80
|
+
boxShadow: "none",
|
|
81
|
+
backgroundColor: color,
|
|
82
|
+
borderRadius: "50%",
|
|
83
|
+
top: "15px",
|
|
84
|
+
zIndex: 3,
|
|
85
|
+
"&:focus, &:hover, &:active": {
|
|
86
|
+
boxShadow: "none",
|
|
87
|
+
},
|
|
88
|
+
}}
|
|
89
|
+
/>
|
|
90
|
+
</Tooltip>
|
|
91
|
+
)}
|
|
92
|
+
<Tooltip arrow title={labelText} placement="top">
|
|
93
|
+
<Box
|
|
94
|
+
sx={{
|
|
95
|
+
position: "absolute",
|
|
96
|
+
left: `${startPercent}%`,
|
|
97
|
+
width: `${endPercent - startPercent}%`,
|
|
98
|
+
height: 3.5,
|
|
99
|
+
top: "17.5px",
|
|
100
|
+
backgroundColor: color,
|
|
101
|
+
zIndex: 2,
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
</Tooltip>
|
|
105
|
+
{isValidOutTime && (
|
|
106
|
+
<Tooltip arrow title={outTimeLabel} placement="top">
|
|
107
|
+
<Box
|
|
108
|
+
sx={{
|
|
109
|
+
height: 8,
|
|
110
|
+
width: 8,
|
|
111
|
+
position: "absolute",
|
|
112
|
+
right: `${100 - endPercent}%`,
|
|
113
|
+
boxShadow: "none",
|
|
114
|
+
backgroundColor: color,
|
|
115
|
+
borderRadius: "50%",
|
|
116
|
+
top: "15px",
|
|
117
|
+
zIndex: 3,
|
|
118
|
+
"&:focus, &:hover, &:active": {
|
|
119
|
+
boxShadow: "none",
|
|
120
|
+
},
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
</Tooltip>
|
|
124
|
+
)}
|
|
125
|
+
</Stack>
|
|
126
|
+
);
|
|
127
|
+
})}
|
|
128
|
+
</Box>
|
|
129
|
+
);
|
|
130
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AddCircleOutline,
|
|
3
|
+
CheckCircleOutline,
|
|
4
|
+
Close,
|
|
5
|
+
ErrorOutline,
|
|
6
|
+
HighlightOff,
|
|
7
|
+
} from "@mui/icons-material";
|
|
8
|
+
import { IconButton, Stack } from "@mui/material";
|
|
9
|
+
import type { ReactNode } from "react";
|
|
10
|
+
import { PadBox } from "../PadBox";
|
|
11
|
+
import type { ToastBodyProps } from "./ToastBody";
|
|
12
|
+
import { ToastBody } from "./ToastBody";
|
|
13
|
+
import type { ToastFooterLinkProps } from "./ToastFooterLink";
|
|
14
|
+
import { ToastFooterLink } from "./ToastFooterLink";
|
|
15
|
+
import type { ToastType } from "./types";
|
|
16
|
+
|
|
17
|
+
export type ToastProps = ToastBodyProps &
|
|
18
|
+
ToastFooterLinkProps & {
|
|
19
|
+
closeToast?: () => void;
|
|
20
|
+
type: ToastType;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type ToastIcon = {
|
|
24
|
+
[K in ToastType]: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Toast = ({
|
|
28
|
+
closeToast,
|
|
29
|
+
type,
|
|
30
|
+
title,
|
|
31
|
+
description,
|
|
32
|
+
href,
|
|
33
|
+
linkText,
|
|
34
|
+
}: ToastProps) => {
|
|
35
|
+
const toastIcons: ToastIcon = {
|
|
36
|
+
info: <AddCircleOutline color="info" fontSize="large" />,
|
|
37
|
+
success: <CheckCircleOutline color="success" fontSize="large" />,
|
|
38
|
+
warning: <ErrorOutline color="warning" fontSize="large" />,
|
|
39
|
+
error: <HighlightOff color="error" fontSize="large" />,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<PadBox padding={{ p: "20px", pl: "16px" }}>
|
|
44
|
+
<Stack direction="row" gap="16px" alignItems="center">
|
|
45
|
+
{toastIcons[type]}
|
|
46
|
+
|
|
47
|
+
<Stack alignItems="flex-start" gap="1.2rem" flexGrow={1}>
|
|
48
|
+
<ToastBody title={title} description={description} />
|
|
49
|
+
|
|
50
|
+
{href && <ToastFooterLink href={href} linkText={linkText} />}
|
|
51
|
+
</Stack>
|
|
52
|
+
|
|
53
|
+
<IconButton onClick={closeToast} disableRipple>
|
|
54
|
+
<Close />
|
|
55
|
+
</IconButton>
|
|
56
|
+
</Stack>
|
|
57
|
+
</PadBox>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Stack, Typography, useTheme } from "@mui/material";
|
|
2
|
+
import type { ToastBody as ToastBodyType } from "./types";
|
|
3
|
+
|
|
4
|
+
export type ToastBodyProps = Readonly<ToastBodyType>;
|
|
5
|
+
|
|
6
|
+
export function ToastBody({ title, description }: ToastBodyProps) {
|
|
7
|
+
const {
|
|
8
|
+
palette: {
|
|
9
|
+
app: { color },
|
|
10
|
+
},
|
|
11
|
+
} = useTheme();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Stack gap="4px">
|
|
15
|
+
<Typography fontWeight={500} color="black" variant="body1">
|
|
16
|
+
{title}
|
|
17
|
+
</Typography>
|
|
18
|
+
|
|
19
|
+
{description && (
|
|
20
|
+
<Typography color={color.slate[900]} variant="body2">
|
|
21
|
+
{description}
|
|
22
|
+
</Typography>
|
|
23
|
+
)}
|
|
24
|
+
</Stack>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Link, Typography } from "@mui/material";
|
|
2
|
+
import { HoverBox } from "./Toaster.styled";
|
|
3
|
+
import type { ToastLink } from "./types";
|
|
4
|
+
|
|
5
|
+
export type ToastFooterLinkProps = Readonly<ToastLink>;
|
|
6
|
+
|
|
7
|
+
export function ToastFooterLink({ href, linkText }: ToastFooterLinkProps) {
|
|
8
|
+
return (
|
|
9
|
+
<Link
|
|
10
|
+
href={href}
|
|
11
|
+
underline="none"
|
|
12
|
+
target={href?.startsWith("http") ? "_blank" : "_self"}
|
|
13
|
+
>
|
|
14
|
+
<HoverBox>
|
|
15
|
+
<Typography>{linkText ?? href}</Typography>
|
|
16
|
+
</HoverBox>
|
|
17
|
+
</Link>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { Box, styled, type BoxProps, type CSSObject } from "@mui/material";
|
|
3
|
+
import type { ComponentType } from "react";
|
|
4
|
+
import { ToastContainer, type ToastContainerProps } from "react-toastify";
|
|
5
|
+
|
|
6
|
+
export const ToasterStyled: ComponentType<ToastContainerProps> = styled(
|
|
7
|
+
ToastContainer as any
|
|
8
|
+
)<ToastContainerProps>(({
|
|
9
|
+
theme: {
|
|
10
|
+
palette: {
|
|
11
|
+
app: { color },
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}) => {
|
|
15
|
+
const toastBody: CSSObject = {
|
|
16
|
+
"& .Toastify__toast-container": {
|
|
17
|
+
padding: "0px",
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"& .Toastify__toast": {
|
|
21
|
+
padding: "0px",
|
|
22
|
+
inlineSize: "400px",
|
|
23
|
+
marginLeft: "-80px",
|
|
24
|
+
borderRadius: "8px",
|
|
25
|
+
border: `2px solid ${color.iron[700]}`,
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
"& .Toastify__toast-body": {
|
|
29
|
+
padding: "0px",
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const toastSuccess: CSSObject = {
|
|
34
|
+
"& .Toastify__toast-theme--light.Toastify__toast--success": {
|
|
35
|
+
"& .Toastify__toast-body": {
|
|
36
|
+
borderInlineStart: `6px solid ${color.darkMint[900]}`,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const toastError: CSSObject = {
|
|
42
|
+
"& .Toastify__toast-theme--light.Toastify__toast--error": {
|
|
43
|
+
"& .Toastify__toast-body": {
|
|
44
|
+
borderInlineStart: `6px solid ${color.red[900]}`,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const toastWarning: CSSObject = {
|
|
50
|
+
"& .Toastify__toast-theme--light.Toastify__toast--warning": {
|
|
51
|
+
"& .Toastify__toast-body": {
|
|
52
|
+
borderInlineStart: `6px solid ${color.darkOrange[900]}`,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const toastInfo: CSSObject = {
|
|
58
|
+
"& .Toastify__toast-theme--light.Toastify__toast--info": {
|
|
59
|
+
"& .Toastify__toast-body": {
|
|
60
|
+
borderInlineStart: `6px solid ${color.slate[900]}`,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
...toastBody,
|
|
67
|
+
...toastSuccess,
|
|
68
|
+
...toastError,
|
|
69
|
+
...toastWarning,
|
|
70
|
+
...toastInfo,
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export const HoverBox: ComponentType<BoxProps> = styled(Box)(({ theme }) => ({
|
|
75
|
+
color: theme.palette.app.color.slate[900],
|
|
76
|
+
|
|
77
|
+
"&:hover": {
|
|
78
|
+
color: theme.palette.app.color.butterflyBlue[900],
|
|
79
|
+
},
|
|
80
|
+
}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Slide } from "react-toastify";
|
|
2
|
+
|
|
3
|
+
import { ToasterStyled } from "./Toaster.styled";
|
|
4
|
+
|
|
5
|
+
export const Toaster = () => {
|
|
6
|
+
return (
|
|
7
|
+
<ToasterStyled
|
|
8
|
+
position="top-right"
|
|
9
|
+
autoClose={5000}
|
|
10
|
+
hideProgressBar
|
|
11
|
+
newestOnTop
|
|
12
|
+
closeButton={false}
|
|
13
|
+
closeOnClick={false}
|
|
14
|
+
rtl={false}
|
|
15
|
+
draggable
|
|
16
|
+
pauseOnHover
|
|
17
|
+
transition={Slide}
|
|
18
|
+
limit={5}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { toast as reactToast, type ToastOptions } from "react-toastify";
|
|
2
|
+
import { Toast } from "./Toast";
|
|
3
|
+
import type { ToastArgs, ToastsTypeFunctions, ToastType } from "./types";
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line sonarjs/function-return-type
|
|
6
|
+
function createToast(
|
|
7
|
+
{ title, description, href, linkText }: ToastArgs,
|
|
8
|
+
type: ToastType,
|
|
9
|
+
options?: ToastOptions
|
|
10
|
+
) {
|
|
11
|
+
return reactToast(
|
|
12
|
+
<Toast
|
|
13
|
+
title={title}
|
|
14
|
+
description={description}
|
|
15
|
+
href={href}
|
|
16
|
+
linkText={linkText}
|
|
17
|
+
type={type}
|
|
18
|
+
/>,
|
|
19
|
+
{ ...options, icon: false, type }
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const toasts: ToastsTypeFunctions = {
|
|
24
|
+
info: (toast, options?) => createToast(toast, "info", options),
|
|
25
|
+
success: (toast, options?) => createToast(toast, "success", options),
|
|
26
|
+
warning: (toast, options?) => createToast(toast, "warning", options),
|
|
27
|
+
error: (toast, options?) => createToast(toast, "error", options),
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ToastOptions, TypeOptions } from "react-toastify";
|
|
2
|
+
|
|
3
|
+
export type ToastType = Exclude<TypeOptions, "default">;
|
|
4
|
+
export type ToastBody = { title: string; description?: string };
|
|
5
|
+
export type ToastLink = { href?: string; linkText?: string };
|
|
6
|
+
export type ToastArgs = ToastBody & ToastLink;
|
|
7
|
+
|
|
8
|
+
export type ToastsTypeFunctions = {
|
|
9
|
+
[K in ToastType]: (
|
|
10
|
+
_toast: ToastArgs,
|
|
11
|
+
_options?: Omit<ToastOptions, "type">
|
|
12
|
+
) => string | number;
|
|
13
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TooltipProps as MuiTooltipProps } from "@mui/material";
|
|
2
|
+
import { Box, Tooltip as MuiTooltip, Typography } from "@mui/material";
|
|
3
|
+
import type { PropsWithChildren, ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
type TooltipProps = PropsWithChildren<{
|
|
6
|
+
toolTipLabel: ReactNode;
|
|
7
|
+
placement?: MuiTooltipProps["placement"];
|
|
8
|
+
}>;
|
|
9
|
+
|
|
10
|
+
export const Tooltip = ({
|
|
11
|
+
toolTipLabel,
|
|
12
|
+
children,
|
|
13
|
+
placement = "top-start",
|
|
14
|
+
...rest
|
|
15
|
+
}: TooltipProps) => {
|
|
16
|
+
return (
|
|
17
|
+
<MuiTooltip arrow placement={placement} title={toolTipLabel} {...rest}>
|
|
18
|
+
{typeof children === "string" ? (
|
|
19
|
+
<Typography
|
|
20
|
+
variant="body2"
|
|
21
|
+
fontWeight={500}
|
|
22
|
+
sx={{
|
|
23
|
+
maxWidth: "150px",
|
|
24
|
+
overflow: "hidden",
|
|
25
|
+
textOverflow: "ellipsis",
|
|
26
|
+
whiteSpace: "nowrap",
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</Typography>
|
|
31
|
+
) : (
|
|
32
|
+
<Box>{children}</Box>
|
|
33
|
+
)}
|
|
34
|
+
</MuiTooltip>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tooltip";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { CSSObject, IconButtonProps, MenuProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
import { IconButton, Menu, menuClasses } from "@mui/material";
|
|
4
|
+
|
|
5
|
+
import { styled } from "@mui/material/styles";
|
|
6
|
+
import type { ComponentType } from "react";
|
|
7
|
+
|
|
8
|
+
export const MenuStyled: ComponentType<MenuProps> = styled(Menu)(({
|
|
9
|
+
theme,
|
|
10
|
+
}) => {
|
|
11
|
+
const style: CSSObject = {
|
|
12
|
+
[`& .${menuClasses.paper}`]: {
|
|
13
|
+
boxShadow: theme.palette.app.paperBoxShadow,
|
|
14
|
+
minWidth: "29rem",
|
|
15
|
+
width: "auto",
|
|
16
|
+
margin: "0 0.5rem",
|
|
17
|
+
borderRadius: "8px",
|
|
18
|
+
overflow: "visible",
|
|
19
|
+
"& .MuiList-root": {
|
|
20
|
+
padding: "0",
|
|
21
|
+
overflow: "visible",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return style;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const IconButtonStyled: ComponentType<IconButtonProps> = styled(
|
|
30
|
+
IconButton,
|
|
31
|
+
{
|
|
32
|
+
shouldForwardProp: (prop) => prop !== "isOpened",
|
|
33
|
+
}
|
|
34
|
+
)<{ isOpened?: boolean }>(() => {
|
|
35
|
+
const style: CSSObject = {
|
|
36
|
+
paddingInline: "0.3rem",
|
|
37
|
+
paddingBlock: "0.2rem",
|
|
38
|
+
borderRadius: "8px",
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return style;
|
|
42
|
+
});
|