@codezee/sixtify-brahma 0.1.1
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/deploy-storybook.yml +40 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +4 -0
- package/.lintstagedrc +5 -0
- package/.prettierignore +11 -0
- package/.prettierrc +22 -0
- package/.vscode/extensions.json +22 -0
- package/.vscode/settings.json +17 -0
- package/README.md +81 -0
- package/apps/docs/.eslintrc.cjs +4 -0
- package/apps/docs/.eslintrc.js +9 -0
- package/apps/docs/.storybook/main.ts +23 -0
- package/apps/docs/.storybook/preview.tsx +27 -0
- package/apps/docs/next-env.d.ts +5 -0
- package/apps/docs/next.config.mjs +4 -0
- package/apps/docs/package.json +38 -0
- package/apps/docs/public/globals.css +25 -0
- package/apps/docs/stories/AgGrid/AgGrid.stories.tsx +69 -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 +99 -0
- package/apps/docs/stories/Button/button.stories.tsx +99 -0
- package/apps/docs/stories/Card/AttendanceCard.stories.tsx +37 -0
- package/apps/docs/stories/Card/Card.stories.tsx +39 -0
- package/apps/docs/stories/Charts/PieChart.stories.tsx +264 -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 +47 -0
- package/apps/docs/stories/Dialog/DeleteDialog.stories.tsx +31 -0
- package/apps/docs/stories/Dialog/Dialog.stories.tsx +47 -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 +87 -0
- package/apps/docs/stories/FormFields/CheckBox.stories.tsx +61 -0
- package/apps/docs/stories/FormFields/DatePicker.stories.tsx +98 -0
- package/apps/docs/stories/FormFields/DateRangePicker.stories.tsx +37 -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/RadioGroupField.stories.tsx +170 -0
- package/apps/docs/stories/FormFields/SearchField.stories.tsx +72 -0
- package/apps/docs/stories/FormFields/TextField.stories.tsx +111 -0
- package/apps/docs/stories/FormFields/TimeField.stories.tsx +82 -0
- package/apps/docs/stories/FormFields/TimePicker.stories.tsx +82 -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 +75 -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 +30 -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 +74 -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 +22 -0
- package/packages/shared-components/src/Actions/AddAction.tsx +13 -0
- package/packages/shared-components/src/Actions/CalendarAction.tsx +13 -0
- package/packages/shared-components/src/Actions/DeleteAction.tsx +13 -0
- package/packages/shared-components/src/Actions/DownloadAction.tsx +13 -0
- package/packages/shared-components/src/Actions/EditAction.tsx +13 -0
- package/packages/shared-components/src/Actions/HistoryAction.tsx +13 -0
- package/packages/shared-components/src/Actions/index.ts +6 -0
- package/packages/shared-components/src/AgGrid/ActionCell/ActionCell.tsx +55 -0
- package/packages/shared-components/src/AgGrid/ActionCell/Popover.tsx +32 -0
- package/packages/shared-components/src/AgGrid/AgGrid.tsx +87 -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 +25 -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 +96 -0
- package/packages/shared-components/src/Card/index.ts +6 -0
- package/packages/shared-components/src/Charts/PieChart.tsx +69 -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 +50 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItemList.tsx +105 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.tsx +125 -0
- package/packages/shared-components/src/Drawer/CloseDrawer/MenuItem.tsx +0 -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 +51 -0
- package/packages/shared-components/src/Drawer/Drawer.tsx +55 -0
- package/packages/shared-components/src/Drawer/MenuItem.tsx +69 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerCollapse.tsx +13 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItem.tsx +46 -0
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItemList.tsx +249 -0
- package/packages/shared-components/src/Drawer/index.ts +1 -0
- package/packages/shared-components/src/FilterList/FilterList.tsx +172 -0
- package/packages/shared-components/src/FilterList/FilterListV2.tsx +504 -0
- package/packages/shared-components/src/FilterList/FilterPopup.tsx +148 -0
- package/packages/shared-components/src/FilterList/FilterPopupWrapper.tsx +113 -0
- package/packages/shared-components/src/FilterList/FilterTypeWrapper.tsx +58 -0
- package/packages/shared-components/src/FilterList/getFormData.ts +29 -0
- package/packages/shared-components/src/FilterList/index.ts +3 -0
- package/packages/shared-components/src/FormFields/Autocomplete/Autocomplete.tsx +428 -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 +67 -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 +206 -0
- package/packages/shared-components/src/FormFields/DatePicker/Skeleton.tsx +21 -0
- package/packages/shared-components/src/FormFields/DatePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/DateRangePicker/DateRangePicker.tsx +96 -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 +245 -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/FileUpload.styled.tsx +22 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.tsx +197 -0
- package/packages/shared-components/src/FormFields/FileUpload/Skeleton.tsx +21 -0
- package/packages/shared-components/src/FormFields/FileUpload/UploadedFileName.tsx +27 -0
- package/packages/shared-components/src/FormFields/FileUpload/index.ts +1 -0
- package/packages/shared-components/src/FormFields/ImageUpload/ImageUpload.styled.tsx +16 -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 +22 -0
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.tsx +37 -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/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 +26 -0
- package/packages/shared-components/src/FormFields/TextField/TextField.tsx +92 -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 +162 -0
- package/packages/shared-components/src/FormFields/TimePicker/index.ts +1 -0
- package/packages/shared-components/src/FormFields/index.ts +13 -0
- package/packages/shared-components/src/Indicator/Indicator.tsx +17 -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/FormRow/FormRow.styled.tsx +39 -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 +3 -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/Stepper/Stepper.tsx +54 -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 +51 -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 +79 -0
- package/packages/shared-components/src/Svgs/Drawer/index.ts +4 -0
- package/packages/shared-components/src/Svgs/FormAction.tsx +118 -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/SvgDelete.tsx +55 -0
- package/packages/shared-components/src/Svgs/SvgDownload.tsx +20 -0
- package/packages/shared-components/src/Svgs/SvgFilterList.tsx +19 -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/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 +16 -0
- package/packages/shared-components/src/Svgs/SvgsIndicator.tsx +20 -0
- package/packages/shared-components/src/Svgs/index.ts +12 -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 +171 -0
- package/packages/shared-components/src/Timeline/TimelineTrackSegments.tsx +121 -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 +76 -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 +37 -0
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.tsx +107 -0
- package/packages/shared-components/src/UserProfileMenu/index.ts +1 -0
- package/packages/shared-components/src/index.ts +24 -0
- package/packages/shared-components/src/utils/colorVariant.ts +142 -0
- package/packages/shared-components/src/utils/date.ts +11 -0
- package/packages/shared-components/src/utils/file.ts +20 -0
- package/packages/shared-components/src/utils/fileSizeValidate.ts +5 -0
- package/packages/shared-components/src/utils/index.ts +5 -0
- package/packages/shared-components/src/utils/theme/colorPalette.ts +110 -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 +289 -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/turbo/generators/config.ts +33 -0
- package/packages/shared-components/turbo/generators/templates/component.hbs +8 -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 +44 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { SvgIconProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const SvgsEdit = (props: SvgIconProps) => {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width={30}
|
|
8
|
+
height={30}
|
|
9
|
+
fill="none"
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
fill="#fff"
|
|
14
|
+
stroke="#DBE1E6"
|
|
15
|
+
d="M.5 4A3.5 3.5 0 0 1 4 .5h22A3.5 3.5 0 0 1 29.5 4v22a3.5 3.5 0 0 1-3.5 3.5H4A3.5 3.5 0 0 1 .5 26V4Z"
|
|
16
|
+
/>
|
|
17
|
+
<path
|
|
18
|
+
stroke="#4C5D70"
|
|
19
|
+
strokeLinecap="round"
|
|
20
|
+
strokeLinejoin="round"
|
|
21
|
+
strokeWidth={1.565}
|
|
22
|
+
d="M14.457 8.836h-1.25c-3.125 0-4.375 1.25-4.375 4.375v3.75c0 3.125 1.25 4.375 4.375 4.375h3.75c3.125 0 4.375-1.25 4.375-4.375v-1.25"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
stroke="#4C5D70"
|
|
26
|
+
strokeLinecap="round"
|
|
27
|
+
strokeLinejoin="round"
|
|
28
|
+
strokeMiterlimit={10}
|
|
29
|
+
strokeWidth={1.565}
|
|
30
|
+
d="M17.608 9.474 12.683 14.4a1.695 1.695 0 0 0-.413.825l-.269 1.881c-.1.682.382 1.157 1.063 1.063l1.881-.269a1.75 1.75 0 0 0 .825-.412l4.925-4.925c.85-.85 1.25-1.838 0-3.088s-2.237-.85-3.087 0Z"
|
|
31
|
+
/>
|
|
32
|
+
<path
|
|
33
|
+
stroke="#4C5D70"
|
|
34
|
+
strokeLinecap="round"
|
|
35
|
+
strokeLinejoin="round"
|
|
36
|
+
strokeMiterlimit={10}
|
|
37
|
+
strokeWidth={1.565}
|
|
38
|
+
d="M16.898 10.18a4.465 4.465 0 0 0 3.088 3.087"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SvgIconProps } from "@mui/material";
|
|
2
|
+
|
|
3
|
+
export const SvgsHistory = (props: SvgIconProps) => {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
width="30"
|
|
7
|
+
height="30"
|
|
8
|
+
viewBox="0 0 30 30"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
{...props}
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
d="M0.5 4C0.5 2.067 2.067 0.5 4 0.5H26C27.933 0.5 29.5 2.067 29.5 4V26C29.5 27.933 27.933 29.5 26 29.5H4C2.067 29.5 0.5 27.933 0.5 26V4Z"
|
|
15
|
+
fill="white"
|
|
16
|
+
stroke="#DBE1E6"
|
|
17
|
+
/>
|
|
18
|
+
<g clipPath="url(#clip0_22174_76909)">
|
|
19
|
+
<path
|
|
20
|
+
d="M15.687 8.125C14.1756 8.13236 12.7094 8.64089 11.5179 9.57092C10.3265 10.501 9.4773 11.7999 9.1033 13.2644L8.6458 12.5725C8.60248 12.5001 8.54495 12.4372 8.47667 12.3876C8.40838 12.338 8.33076 12.3027 8.24848 12.2839C8.1662 12.2651 8.08097 12.2632 7.99792 12.2783C7.91488 12.2933 7.83575 12.325 7.76529 12.3715C7.69484 12.418 7.63452 12.4782 7.58798 12.5486C7.54144 12.619 7.50965 12.6981 7.49451 12.7811C7.47937 12.8642 7.48121 12.9494 7.4999 13.0317C7.5186 13.114 7.55377 13.1917 7.6033 13.26L8.9783 15.3438C9.07381 15.4774 9.21463 15.5718 9.37455 15.6094C9.53784 15.6418 9.70733 15.6093 9.84705 15.5188L11.9095 14.1294C11.9807 14.085 12.0421 14.0267 12.0902 13.9581C12.1384 13.8894 12.1722 13.8118 12.1897 13.7298C12.2072 13.6478 12.2081 13.5631 12.1922 13.4808C12.1763 13.3985 12.144 13.3202 12.0972 13.2506C12.0505 13.181 11.9902 13.1216 11.9199 13.0758C11.8497 13.03 11.771 12.9988 11.6885 12.984C11.6059 12.9693 11.5213 12.9713 11.4395 12.9899C11.3578 13.0085 11.2806 13.0434 11.2127 13.0925L10.2745 13.725C10.5242 12.7115 11.0538 11.7886 11.8027 11.0615C12.5517 10.3345 13.4899 9.83264 14.5104 9.6132C15.5309 9.39375 16.5925 9.46557 17.5741 9.82045C18.5558 10.1753 19.4179 10.799 20.0621 11.6203C20.7063 12.4416 21.1067 13.4274 21.2176 14.4653C21.3285 15.5032 21.1455 16.5514 20.6893 17.4902C20.2332 18.4291 19.5223 19.2208 18.6378 19.7751C17.7533 20.3294 16.7309 20.6239 15.687 20.625C14.7923 20.6226 13.9113 20.4042 13.119 19.9883C12.3267 19.5724 11.6466 18.9713 11.1364 18.2363C11.0907 18.1661 11.0314 18.1058 10.962 18.059C10.8925 18.0122 10.8144 17.9799 10.7322 17.9639C10.65 17.9478 10.5655 17.9485 10.4836 17.9658C10.4016 17.9831 10.324 18.0167 10.2553 18.0646C10.1866 18.1124 10.1283 18.1736 10.0837 18.2445C10.0391 18.3154 10.0092 18.3945 9.99577 18.4771C9.98235 18.5598 9.98567 18.6443 10.0055 18.7256C10.0254 18.807 10.0614 18.8835 10.1114 18.9506C10.9408 20.1464 12.1319 21.0445 13.5097 21.513C14.8874 21.9816 16.3791 21.9959 17.7656 21.5537C19.152 21.1116 20.36 20.2364 21.2122 19.0567C22.0643 17.877 22.5155 16.4551 22.4995 15C22.5057 13.1856 21.7919 11.4428 20.5148 10.1539C19.2377 8.86508 17.5015 8.13542 15.687 8.125Z"
|
|
21
|
+
fill="#4C5D70"
|
|
22
|
+
/>
|
|
23
|
+
<path
|
|
24
|
+
d="M15.625 11.2188C15.4592 11.2188 15.3003 11.2846 15.1831 11.4018C15.0658 11.519 15 11.678 15 11.8438V15C15.0027 15.1652 15.0681 15.3232 15.1831 15.4419L17.0581 17.3338C17.1758 17.4496 17.334 17.5148 17.4991 17.5156C17.6642 17.5165 17.8231 17.4528 17.9419 17.3381C18.0595 17.2214 18.126 17.0628 18.1267 16.897C18.1274 16.7313 18.0623 16.5721 17.9456 16.4544L16.25 14.7431V11.8438C16.25 11.678 16.1842 11.519 16.0669 11.4018C15.9497 11.2846 15.7908 11.2188 15.625 11.2188Z"
|
|
25
|
+
fill="#4C5D70"
|
|
26
|
+
/>
|
|
27
|
+
</g>
|
|
28
|
+
<defs>
|
|
29
|
+
<clipPath id="clip0_22174_76909">
|
|
30
|
+
<rect
|
|
31
|
+
width="15"
|
|
32
|
+
height="15"
|
|
33
|
+
fill="white"
|
|
34
|
+
transform="translate(7.5 7.5)"
|
|
35
|
+
/>
|
|
36
|
+
</clipPath>
|
|
37
|
+
</defs>
|
|
38
|
+
</svg>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SVGProps } from "react";
|
|
2
|
+
export const SvgsHome = (props: SVGProps<SVGSVGElement>) => (
|
|
3
|
+
<svg
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width={20}
|
|
6
|
+
height={20}
|
|
7
|
+
fill="none"
|
|
8
|
+
{...props}
|
|
9
|
+
style={{ color: "inherit" }}
|
|
10
|
+
>
|
|
11
|
+
<path
|
|
12
|
+
fill={props.fill ?? "currentColor"}
|
|
13
|
+
d="m17.901 6.46-5.925-4.67A3.16 3.16 0 0 0 10 1.11a3.16 3.16 0 0 0-1.975.679L2.099 6.46a2.697 2.697 0 0 0-.734.907c-.17.346-.257.72-.254 1.099v7.76c0 .706.313 1.384.868 1.883.556.5 1.31.78 2.095.78h11.852c.786 0 1.54-.28 2.095-.78.556-.5.868-1.177.868-1.883V8.457a2.436 2.436 0 0 0-.255-1.094 2.696 2.696 0 0 0-.733-.903Zm-5.925 10.653H8.024v-4.439c0-.235.104-.461.29-.627.184-.167.436-.26.698-.26h1.975c.262 0 .513.093.698.26.185.166.29.392.29.627v4.44Zm4.938-.887a.845.845 0 0 1-.29.627c-.185.167-.436.26-.698.26h-1.975v-4.439c0-.706-.312-1.383-.868-1.883a3.14 3.14 0 0 0-2.095-.78H9.013c-.786 0-1.54.28-2.096.78-.555.5-.867 1.177-.867 1.883v4.44H4.074c-.262 0-.513-.094-.698-.26a.845.845 0 0 1-.29-.628V8.457c0-.126.03-.25.089-.365a.901.901 0 0 1 .248-.3L9.348 3.13c.18-.142.412-.22.652-.22.24 0 .472.078.652.22l5.926 4.661c.105.083.19.186.248.3.058.116.088.24.088.366v7.769Z"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getColorByVariant, type WorkDayType } from "../utils/colorVariant";
|
|
2
|
+
|
|
3
|
+
type SvgsIndicatorIconProps = {
|
|
4
|
+
variant: WorkDayType;
|
|
5
|
+
};
|
|
6
|
+
export const SvgsIndicator = ({ variant }: SvgsIndicatorIconProps) => {
|
|
7
|
+
const color = getColorByVariant(variant);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<svg
|
|
11
|
+
width="10"
|
|
12
|
+
height="10"
|
|
13
|
+
viewBox="0 0 10 10"
|
|
14
|
+
fill="none"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
>
|
|
17
|
+
<circle cx="5" cy="5" r="5" fill={color} />
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./Company";
|
|
2
|
+
export * from "./Drawer";
|
|
3
|
+
export * from "./FormAction";
|
|
4
|
+
export * from "./LogoIcon";
|
|
5
|
+
export * from "./SvgCalendar";
|
|
6
|
+
export * from "./SvgDelete";
|
|
7
|
+
export * from "./SvgDownload";
|
|
8
|
+
export * from "./SvgNoLogo";
|
|
9
|
+
export * from "./SvgNoSign";
|
|
10
|
+
export * from "./SvgsDrop";
|
|
11
|
+
export * from "./SvgsHome";
|
|
12
|
+
export * from "./SvgAdd";
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import HelpOutlineOutlinedIcon from "@mui/icons-material/HelpOutlineOutlined";
|
|
2
|
+
import { Tabs as MuiTabs, Stack } from "@mui/material";
|
|
3
|
+
import type { TabOwnProps } from "@mui/material/Tab";
|
|
4
|
+
import Tab from "@mui/material/Tab";
|
|
5
|
+
import type { ReactElement } from "react";
|
|
6
|
+
import { v4 as uuidv4 } from "uuid";
|
|
7
|
+
import { Tooltip } from "../Tooltip";
|
|
8
|
+
import { Skeleton } from "./Skeleton";
|
|
9
|
+
|
|
10
|
+
export type TabsItems = {
|
|
11
|
+
value: string;
|
|
12
|
+
label: string;
|
|
13
|
+
icon?: ReactElement;
|
|
14
|
+
toolTipLabel?: string;
|
|
15
|
+
iconPosition?: TabOwnProps["iconPosition"];
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type TabsProps = {
|
|
20
|
+
tabs: TabsItems[];
|
|
21
|
+
value: string;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Tabs = ({ tabs, value, loading }: TabsProps) => {
|
|
26
|
+
if (loading) {
|
|
27
|
+
return (
|
|
28
|
+
<Stack gap="10px" direction="row">
|
|
29
|
+
{tabs.map(() => {
|
|
30
|
+
return <Skeleton key={uuidv4()} />;
|
|
31
|
+
})}
|
|
32
|
+
</Stack>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<MuiTabs value={value}>
|
|
38
|
+
{tabs.map(
|
|
39
|
+
({
|
|
40
|
+
iconPosition = "end",
|
|
41
|
+
toolTipLabel = "",
|
|
42
|
+
icon = <HelpOutlineOutlinedIcon color="secondary" />,
|
|
43
|
+
...rest
|
|
44
|
+
}) => (
|
|
45
|
+
<Tab
|
|
46
|
+
key={uuidv4()}
|
|
47
|
+
icon={
|
|
48
|
+
toolTipLabel ? (
|
|
49
|
+
<Tooltip toolTipLabel={toolTipLabel} placement="bottom">
|
|
50
|
+
{icon}
|
|
51
|
+
</Tooltip>
|
|
52
|
+
) : (
|
|
53
|
+
icon
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
disabled={loading}
|
|
57
|
+
iconPosition={iconPosition}
|
|
58
|
+
{...rest}
|
|
59
|
+
/>
|
|
60
|
+
)
|
|
61
|
+
)}
|
|
62
|
+
</MuiTabs>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Tabs";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Box, Slider, Stack } from "@mui/material";
|
|
2
|
+
import {
|
|
3
|
+
getColorByVariant,
|
|
4
|
+
getStatusLabel,
|
|
5
|
+
type WorkDayType,
|
|
6
|
+
} from "../utils/colorVariant";
|
|
7
|
+
|
|
8
|
+
type AttendanceStatusProps = {
|
|
9
|
+
variant: WorkDayType;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const AttendanceStatus = ({ variant }: AttendanceStatusProps) => {
|
|
13
|
+
const color = getColorByVariant(variant);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Stack sx={{ position: "relative", width: "100%", alignItems: "center" }}>
|
|
17
|
+
<Box
|
|
18
|
+
sx={{
|
|
19
|
+
position: "absolute",
|
|
20
|
+
backgroundColor: "#ffffff",
|
|
21
|
+
border: `1px solid ${color}`,
|
|
22
|
+
borderRadius: "7px",
|
|
23
|
+
padding: "0px 5px",
|
|
24
|
+
zIndex: 1,
|
|
25
|
+
color: `${color}`,
|
|
26
|
+
height: "28px",
|
|
27
|
+
display: "flex",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
{getStatusLabel(variant)}
|
|
32
|
+
</Box>
|
|
33
|
+
<Slider
|
|
34
|
+
valueLabelDisplay="off"
|
|
35
|
+
value={[0, 2]}
|
|
36
|
+
max={2}
|
|
37
|
+
step={1}
|
|
38
|
+
sx={{
|
|
39
|
+
"& .MuiSlider-track": {
|
|
40
|
+
background: `${color}`,
|
|
41
|
+
height: "2px",
|
|
42
|
+
border: "none",
|
|
43
|
+
},
|
|
44
|
+
"& .MuiSlider-thumb": {
|
|
45
|
+
backgroundColor: `${color}`,
|
|
46
|
+
height: 8,
|
|
47
|
+
width: 8,
|
|
48
|
+
},
|
|
49
|
+
"& .MuiSlider-rail": {
|
|
50
|
+
backgroundColor: "transparent",
|
|
51
|
+
},
|
|
52
|
+
}}
|
|
53
|
+
/>
|
|
54
|
+
</Stack>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Box, Slider, Stack, Tooltip } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { TimelineTrackSegments } from "./TimelineTrackSegments";
|
|
4
|
+
import { type WorkDayType } from "../utils/colorVariant";
|
|
5
|
+
import { getTimeInHHmm } from "../utils/date";
|
|
6
|
+
import { ArrowUp } from "../Svgs/ArrowUp";
|
|
7
|
+
import { DateTime } from "luxon";
|
|
8
|
+
|
|
9
|
+
export type HighlightedInterval = {
|
|
10
|
+
in_time: string;
|
|
11
|
+
out_time: string;
|
|
12
|
+
status_type: WorkDayType;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type TimelineProps = {
|
|
16
|
+
totalDots: number;
|
|
17
|
+
highlightedIntervals: HighlightedInterval[];
|
|
18
|
+
startTimeline: string;
|
|
19
|
+
shiftStartTime: string;
|
|
20
|
+
shiftEndTime: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const getArrowValue = (date: string) => {
|
|
24
|
+
const time = DateTime.fromFormat(date, "HH:mm");
|
|
25
|
+
|
|
26
|
+
const hour = time.hour;
|
|
27
|
+
|
|
28
|
+
const minute = time.minute;
|
|
29
|
+
|
|
30
|
+
return hour + minute / 60;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Timeline = ({
|
|
34
|
+
totalDots,
|
|
35
|
+
highlightedIntervals,
|
|
36
|
+
shiftStartTime,
|
|
37
|
+
shiftEndTime,
|
|
38
|
+
startTimeline = "2024-11-17T18:30:04.000Z",
|
|
39
|
+
}: TimelineProps) => {
|
|
40
|
+
const slotStartTime = parseFloat(getTimeInHHmm(startTimeline));
|
|
41
|
+
|
|
42
|
+
const getArrowPosition = (
|
|
43
|
+
shiftStartTime: string,
|
|
44
|
+
shiftEndTime: string,
|
|
45
|
+
type: "END" | "START"
|
|
46
|
+
) => {
|
|
47
|
+
const shiftStart = getTimeInHHmm(shiftStartTime);
|
|
48
|
+
|
|
49
|
+
const shiftEnd = getTimeInHHmm(shiftEndTime);
|
|
50
|
+
|
|
51
|
+
let shiftStartValue = getArrowValue(shiftStart);
|
|
52
|
+
|
|
53
|
+
let shiftEndValue = getArrowValue(shiftEnd);
|
|
54
|
+
|
|
55
|
+
shiftStartValue =
|
|
56
|
+
shiftStartValue < slotStartTime
|
|
57
|
+
? shiftStartValue + totalDots
|
|
58
|
+
: shiftStartValue;
|
|
59
|
+
|
|
60
|
+
shiftEndValue =
|
|
61
|
+
shiftEndValue < shiftStartValue
|
|
62
|
+
? shiftEndValue + totalDots
|
|
63
|
+
: shiftEndValue;
|
|
64
|
+
|
|
65
|
+
return type === "END" ? shiftEndValue : shiftStartValue;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const isHighlighted = (index: number) => {
|
|
69
|
+
const wrappedValue = (index + slotStartTime) % totalDots;
|
|
70
|
+
|
|
71
|
+
return highlightedIntervals.some(
|
|
72
|
+
(interval) =>
|
|
73
|
+
wrappedValue >= parseFloat(getTimeInHHmm(interval.in_time)) &&
|
|
74
|
+
wrappedValue <= parseFloat(getTimeInHHmm(interval.out_time))
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const marks = Array.from({ length: totalDots }, (_, index) => ({
|
|
79
|
+
value: (index + slotStartTime) % totalDots,
|
|
80
|
+
label: "",
|
|
81
|
+
highlighted: isHighlighted((index + slotStartTime) % totalDots),
|
|
82
|
+
}));
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<Stack sx={{ position: "relative", width: "100%" }}>
|
|
86
|
+
<TimelineTrackSegments
|
|
87
|
+
totalDots={totalDots}
|
|
88
|
+
intervals={highlightedIntervals}
|
|
89
|
+
startTimeline={slotStartTime}
|
|
90
|
+
/>
|
|
91
|
+
<Tooltip
|
|
92
|
+
title={`Shift Start: ${getTimeInHHmm(shiftStartTime)}`}
|
|
93
|
+
arrow
|
|
94
|
+
placement="top"
|
|
95
|
+
>
|
|
96
|
+
<Box
|
|
97
|
+
sx={{
|
|
98
|
+
cursor: "pointer",
|
|
99
|
+
position: "absolute",
|
|
100
|
+
top: "12px",
|
|
101
|
+
zIndex: 2,
|
|
102
|
+
left: `${(((getArrowPosition(shiftStartTime, shiftEndTime, "START") - slotStartTime) % totalDots) / (totalDots - 1)) * 100}%`,
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
<ArrowUp />
|
|
106
|
+
</Box>
|
|
107
|
+
</Tooltip>
|
|
108
|
+
<Tooltip
|
|
109
|
+
title={`Shift End: ${getTimeInHHmm(shiftEndTime)}`}
|
|
110
|
+
arrow
|
|
111
|
+
placement="top"
|
|
112
|
+
>
|
|
113
|
+
<Box
|
|
114
|
+
sx={{
|
|
115
|
+
cursor: "pointer",
|
|
116
|
+
position: "absolute",
|
|
117
|
+
top: "12px",
|
|
118
|
+
zIndex: 2,
|
|
119
|
+
left: `${(((getArrowPosition(shiftStartTime, shiftEndTime, "END") - slotStartTime) % totalDots) / (totalDots - 1)) * 100}%`,
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
<ArrowUp />
|
|
123
|
+
</Box>
|
|
124
|
+
</Tooltip>
|
|
125
|
+
<Slider
|
|
126
|
+
valueLabelDisplay="off"
|
|
127
|
+
marks={marks}
|
|
128
|
+
max={totalDots - 1}
|
|
129
|
+
step={1}
|
|
130
|
+
value={highlightedIntervals
|
|
131
|
+
.map((interval) => [
|
|
132
|
+
(parseFloat(getTimeInHHmm(interval.in_time)) -
|
|
133
|
+
slotStartTime +
|
|
134
|
+
totalDots) %
|
|
135
|
+
totalDots,
|
|
136
|
+
(parseFloat(getTimeInHHmm(interval.out_time)) -
|
|
137
|
+
slotStartTime +
|
|
138
|
+
totalDots) %
|
|
139
|
+
totalDots,
|
|
140
|
+
])
|
|
141
|
+
.flat()}
|
|
142
|
+
sx={{
|
|
143
|
+
zIndex: 1,
|
|
144
|
+
"& .MuiSlider-track": {
|
|
145
|
+
background: "transparent",
|
|
146
|
+
height: 1,
|
|
147
|
+
border: "none",
|
|
148
|
+
},
|
|
149
|
+
"& .MuiSlider-mark": {
|
|
150
|
+
backgroundColor: "gray",
|
|
151
|
+
height: 4,
|
|
152
|
+
width: 4,
|
|
153
|
+
borderRadius: "50%",
|
|
154
|
+
},
|
|
155
|
+
"& .MuiSlider-markActive": {
|
|
156
|
+
backgroundColor: "transparent",
|
|
157
|
+
height: 5,
|
|
158
|
+
width: 5,
|
|
159
|
+
},
|
|
160
|
+
"& .MuiSlider-rail": {
|
|
161
|
+
height: 2,
|
|
162
|
+
backgroundColor: "#929292",
|
|
163
|
+
},
|
|
164
|
+
"& .MuiSlider-thumb": {
|
|
165
|
+
display: "none",
|
|
166
|
+
},
|
|
167
|
+
}}
|
|
168
|
+
/>
|
|
169
|
+
</Stack>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Box, Stack, Tooltip } from "@mui/material";
|
|
2
|
+
import { getColorByVariant } from "../utils/colorVariant";
|
|
3
|
+
import { getArrowValue, type HighlightedInterval } from "./Timeline";
|
|
4
|
+
import { getTimeInHHmm } from "../utils/date";
|
|
5
|
+
|
|
6
|
+
type TimelineTrackSegmentsProps = {
|
|
7
|
+
totalDots: number;
|
|
8
|
+
intervals: HighlightedInterval[];
|
|
9
|
+
startTimeline: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const TimelineTrackSegments = ({
|
|
13
|
+
totalDots,
|
|
14
|
+
intervals,
|
|
15
|
+
startTimeline,
|
|
16
|
+
}: TimelineTrackSegmentsProps) => {
|
|
17
|
+
return (
|
|
18
|
+
<Box sx={{ position: "relative", width: "100%", height: 4 }}>
|
|
19
|
+
{intervals?.map((interval, index) => {
|
|
20
|
+
const inTime = getTimeInHHmm(interval.in_time);
|
|
21
|
+
|
|
22
|
+
const outTime = getTimeInHHmm(interval.out_time);
|
|
23
|
+
|
|
24
|
+
let in_time = getArrowValue(inTime);
|
|
25
|
+
|
|
26
|
+
in_time = in_time < startTimeline ? in_time + totalDots : in_time;
|
|
27
|
+
|
|
28
|
+
let out_time = getArrowValue(outTime);
|
|
29
|
+
|
|
30
|
+
out_time = out_time < in_time ? out_time + totalDots : out_time;
|
|
31
|
+
|
|
32
|
+
const isValidInTime = !isNaN(in_time);
|
|
33
|
+
|
|
34
|
+
const isValidOutTime = !isNaN(out_time);
|
|
35
|
+
|
|
36
|
+
let inTimeLabel = "";
|
|
37
|
+
|
|
38
|
+
let outTimeLabel = "";
|
|
39
|
+
|
|
40
|
+
if (isValidInTime) {
|
|
41
|
+
inTimeLabel = `In time : ${inTime} ${!isValidOutTime ? " / Missing punch" : ""}`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (isValidOutTime) {
|
|
45
|
+
outTimeLabel = `Out time : ${outTime} ${!isValidInTime ? "/ Missing punch" : ""}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const startPercent =
|
|
49
|
+
(((in_time - startTimeline) % totalDots) / (totalDots - 1)) * 100;
|
|
50
|
+
|
|
51
|
+
const endPercent =
|
|
52
|
+
(((out_time - startTimeline) % totalDots) / (totalDots - 1)) * 100;
|
|
53
|
+
|
|
54
|
+
const labelText = `In/Out: ${getTimeInHHmm(interval.in_time)} - ${getTimeInHHmm(
|
|
55
|
+
interval.out_time
|
|
56
|
+
)}`;
|
|
57
|
+
|
|
58
|
+
const color = getColorByVariant(interval.status_type);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
// eslint-disable-next-line sonarjs/no-array-index-key
|
|
62
|
+
<Stack direction="row" key={index}>
|
|
63
|
+
{isValidInTime && (
|
|
64
|
+
<Tooltip arrow title={inTimeLabel} placement="top">
|
|
65
|
+
<Box
|
|
66
|
+
sx={{
|
|
67
|
+
height: 8,
|
|
68
|
+
width: 8,
|
|
69
|
+
position: "absolute",
|
|
70
|
+
left: `${startPercent}%`,
|
|
71
|
+
boxShadow: "none",
|
|
72
|
+
backgroundColor: color,
|
|
73
|
+
borderRadius: "50%",
|
|
74
|
+
top: "15px",
|
|
75
|
+
zIndex: 3,
|
|
76
|
+
"&:focus, &:hover, &:active": {
|
|
77
|
+
boxShadow: "none",
|
|
78
|
+
},
|
|
79
|
+
}}
|
|
80
|
+
/>
|
|
81
|
+
</Tooltip>
|
|
82
|
+
)}
|
|
83
|
+
<Tooltip arrow title={labelText} placement="top">
|
|
84
|
+
<Box
|
|
85
|
+
sx={{
|
|
86
|
+
position: "absolute",
|
|
87
|
+
left: `${startPercent}%`,
|
|
88
|
+
width: `${endPercent - startPercent}%`,
|
|
89
|
+
height: 3.5,
|
|
90
|
+
top: "17.5px",
|
|
91
|
+
backgroundColor: color,
|
|
92
|
+
zIndex: 2,
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
</Tooltip>
|
|
96
|
+
{isValidOutTime && (
|
|
97
|
+
<Tooltip arrow title={outTimeLabel} placement="top">
|
|
98
|
+
<Box
|
|
99
|
+
sx={{
|
|
100
|
+
height: 8,
|
|
101
|
+
width: 8,
|
|
102
|
+
position: "absolute",
|
|
103
|
+
right: `${100 - endPercent}%`,
|
|
104
|
+
boxShadow: "none",
|
|
105
|
+
backgroundColor: color,
|
|
106
|
+
borderRadius: "50%",
|
|
107
|
+
top: "15px",
|
|
108
|
+
zIndex: 3,
|
|
109
|
+
"&:focus, &:hover, &:active": {
|
|
110
|
+
boxShadow: "none",
|
|
111
|
+
},
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
</Tooltip>
|
|
115
|
+
)}
|
|
116
|
+
</Stack>
|
|
117
|
+
);
|
|
118
|
+
})}
|
|
119
|
+
</Box>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
@@ -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
|
+
}
|