@codezee/sixtify-brahma 0.2.2 → 0.2.6
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 +1 -1
- package/packages/shared-components/src/Actions/ConfigureAction.tsx +13 -0
- package/packages/shared-components/src/Actions/index.ts +2 -1
- package/packages/shared-components/src/AgGrid/ActionCell/ActionCell.tsx +3 -1
- package/packages/shared-components/src/AgGrid/AgGrid.tsx +7 -1
- package/packages/shared-components/src/Card/ProfileCard/ProfileCard.tsx +1 -1
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardBody.tsx +4 -4
- package/packages/shared-components/src/Card/ProfileCard/ProfileCardItem/ProfileCardHeader.tsx +1 -1
- package/packages/shared-components/src/Charts/PieChart.tsx +20 -8
- package/packages/shared-components/src/Charts/Skeleton.tsx +36 -0
- package/packages/shared-components/src/Drawer/Bullet.tsx +1 -1
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItem.tsx +8 -1
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerMenuItemList.tsx +11 -7
- package/packages/shared-components/src/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.tsx +96 -97
- package/packages/shared-components/src/Drawer/CloseDrawer/Popper.tsx +3 -3
- package/packages/shared-components/src/Drawer/Drawer.tsx +1 -1
- package/packages/shared-components/src/Drawer/MenuItem.tsx +8 -2
- package/packages/shared-components/src/Drawer/OpenDrawer/OpenDrawerMenuItemList.tsx +162 -214
- package/packages/shared-components/src/FilterList/FilterListV2.tsx +24 -13
- package/packages/shared-components/src/FilterList/index.ts +2 -0
- package/packages/shared-components/src/FormFields/Autocomplete/Autocomplete.tsx +86 -4
- package/packages/shared-components/src/FormFields/DatePicker/DatePicker.tsx +14 -3
- package/packages/shared-components/src/FormFields/DatePicker/Skeleton.tsx +15 -8
- package/packages/shared-components/src/FormFields/DateTimePicker/DateTimePicker.tsx +9 -4
- package/packages/shared-components/src/FormFields/FileUpload/FileNames.tsx +32 -0
- package/packages/shared-components/src/FormFields/FileUpload/FileUpload.tsx +13 -53
- package/packages/shared-components/src/FormFields/FileUpload/index.ts +1 -0
- package/packages/shared-components/src/FormFields/ListItemButton/ListItemButton.tsx +16 -1
- package/packages/shared-components/src/FormFields/TextField/Skeleton.tsx +13 -8
- package/packages/shared-components/src/FormFields/TextField/TextField.tsx +2 -2
- package/packages/shared-components/src/FormFields/TimePicker/TimePicker.tsx +6 -0
- package/packages/shared-components/src/Indicator/Indicator.tsx +4 -3
- package/packages/shared-components/src/Layouts/FormGridLayout.tsx +27 -0
- package/packages/shared-components/src/Layouts/index.ts +2 -1
- 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 +1 -1
- package/packages/shared-components/src/Svgs/Drawer/SettingIcon.tsx +17 -37
- 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/SvgsTransaction.tsx +72 -70
- package/packages/shared-components/src/Svgs/Drawer/index.ts +3 -0
- package/packages/shared-components/src/Svgs/ImportExcelSuccessIcon.tsx +54 -0
- package/packages/shared-components/src/Svgs/SvgConfigure.tsx +51 -0
- package/packages/shared-components/src/Svgs/SvgEmail.tsx +24 -0
- package/packages/shared-components/src/Svgs/SvgPhone.tsx +16 -0
- package/packages/shared-components/src/Svgs/SvgsHome.tsx +8 -6
- package/packages/shared-components/src/Svgs/SvgsIndicator.tsx +7 -3
- package/packages/shared-components/src/Svgs/index.ts +3 -1
- package/packages/shared-components/src/Timeline/TimelineTrackSegments.tsx +11 -2
- package/packages/shared-components/src/Tooltip/Tooltip.tsx +1 -1
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.styled.tsx +3 -7
- package/packages/shared-components/src/UserProfileMenu/UserProfileMenu.tsx +76 -15
- package/packages/shared-components/src/index.ts +6 -5
- package/packages/shared-components/src/utils/colorVariant.ts +26 -6
- package/packages/shared-components/src/utils/date.ts +19 -5
- package/packages/shared-components/src/utils/index.ts +9 -11
- package/packages/shared-components/src/utils/theme/colorPalette.ts +2 -0
- package/packages/shared-components/src/utils/theme/theme.ts +8 -0
|
@@ -4,10 +4,12 @@ import {
|
|
|
4
4
|
Avatar,
|
|
5
5
|
Box,
|
|
6
6
|
Divider,
|
|
7
|
+
ListItemIcon,
|
|
7
8
|
Menu,
|
|
8
9
|
MenuItem,
|
|
9
10
|
Stack,
|
|
10
11
|
Typography,
|
|
12
|
+
useTheme,
|
|
11
13
|
} from "@mui/material";
|
|
12
14
|
import _isFunction from "lodash/isFunction";
|
|
13
15
|
import {
|
|
@@ -40,6 +42,10 @@ export function UserProfileMenu({
|
|
|
40
42
|
}: UserProfileMenuProps) {
|
|
41
43
|
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
|
42
44
|
|
|
45
|
+
const theme = useTheme();
|
|
46
|
+
|
|
47
|
+
const { iron } = theme.palette.app.color;
|
|
48
|
+
|
|
43
49
|
const open = Boolean(anchorEl);
|
|
44
50
|
|
|
45
51
|
const handleClick = (event: MouseEvent<HTMLElement>) => {
|
|
@@ -51,25 +57,67 @@ export function UserProfileMenu({
|
|
|
51
57
|
};
|
|
52
58
|
|
|
53
59
|
return (
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
<Box position="relative">
|
|
61
|
+
<Box sx={{ display: "flex", alignItems: "center", textAlign: "center" }}>
|
|
62
|
+
<IconButtonStyled
|
|
63
|
+
onClick={handleClick}
|
|
64
|
+
size="small"
|
|
65
|
+
sx={{ ml: 2 }}
|
|
66
|
+
aria-controls={open ? "account-menu" : undefined}
|
|
67
|
+
aria-haspopup="true"
|
|
68
|
+
aria-expanded={open ? "true" : undefined}
|
|
69
|
+
>
|
|
70
|
+
<Stack direction="row" alignItems="center" gap={1} color="black">
|
|
71
|
+
<Avatar
|
|
72
|
+
src={userDetails.avatar}
|
|
73
|
+
sx={{ border: `1px solid ${iron[700]}` }}
|
|
74
|
+
/>
|
|
75
|
+
<Typography>{userDetails.name}</Typography>
|
|
76
|
+
{open ? <KeyboardArrowUp /> : <KeyboardArrowDown />}
|
|
77
|
+
</Stack>
|
|
78
|
+
</IconButtonStyled>
|
|
79
|
+
</Box>
|
|
63
80
|
<Menu
|
|
64
81
|
anchorEl={anchorEl}
|
|
82
|
+
id="account-menu"
|
|
65
83
|
open={open}
|
|
66
84
|
onClose={handleClose}
|
|
85
|
+
onClick={handleClose}
|
|
67
86
|
sx={{
|
|
68
87
|
"& .MuiPaper-root": {
|
|
69
|
-
|
|
70
|
-
width: "290px",
|
|
88
|
+
width: "220px",
|
|
71
89
|
},
|
|
72
90
|
}}
|
|
91
|
+
slotProps={{
|
|
92
|
+
paper: {
|
|
93
|
+
elevation: 0,
|
|
94
|
+
sx: {
|
|
95
|
+
overflow: "visible",
|
|
96
|
+
filter: "drop-shadow(0px 2px 8px rgba(0,0,0,0.32))",
|
|
97
|
+
mt: 1.5,
|
|
98
|
+
"& .MuiAvatar-root": {
|
|
99
|
+
width: 32,
|
|
100
|
+
height: 32,
|
|
101
|
+
ml: -0.5,
|
|
102
|
+
mr: 1,
|
|
103
|
+
},
|
|
104
|
+
"&::before": {
|
|
105
|
+
content: "''",
|
|
106
|
+
display: "block",
|
|
107
|
+
position: "absolute",
|
|
108
|
+
top: 0,
|
|
109
|
+
right: 14,
|
|
110
|
+
width: 10,
|
|
111
|
+
height: 10,
|
|
112
|
+
bgcolor: "background.paper",
|
|
113
|
+
transform: "translateY(-50%) rotate(45deg)",
|
|
114
|
+
zIndex: 0,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
}}
|
|
119
|
+
transformOrigin={{ horizontal: "right", vertical: "top" }}
|
|
120
|
+
anchorOrigin={{ horizontal: "right", vertical: "bottom" }}
|
|
73
121
|
>
|
|
74
122
|
{menuItems.map(
|
|
75
123
|
({ divider = false, onClick, icon, label, sx = {}, key }) => {
|
|
@@ -86,14 +134,27 @@ export function UserProfileMenu({
|
|
|
86
134
|
>
|
|
87
135
|
{(icon || label) && (
|
|
88
136
|
<Stack
|
|
89
|
-
gap="
|
|
137
|
+
gap="1px"
|
|
90
138
|
alignItems="center"
|
|
91
139
|
width="100%"
|
|
92
140
|
flexDirection="row"
|
|
93
141
|
sx={{ ...sx }}
|
|
94
142
|
>
|
|
95
|
-
|
|
96
|
-
|
|
143
|
+
<ListItemIcon
|
|
144
|
+
sx={{
|
|
145
|
+
minWidth: "20px",
|
|
146
|
+
alignItems: "center",
|
|
147
|
+
...sx,
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
{icon}
|
|
151
|
+
</ListItemIcon>
|
|
152
|
+
|
|
153
|
+
{label && (
|
|
154
|
+
<Typography sx={{ fontSize: "15px" }}>
|
|
155
|
+
{label}
|
|
156
|
+
</Typography>
|
|
157
|
+
)}
|
|
97
158
|
</Stack>
|
|
98
159
|
)}
|
|
99
160
|
</MenuItem>
|
|
@@ -102,6 +163,6 @@ export function UserProfileMenu({
|
|
|
102
163
|
}
|
|
103
164
|
)}
|
|
104
165
|
</Menu>
|
|
105
|
-
</
|
|
166
|
+
</Box>
|
|
106
167
|
);
|
|
107
168
|
}
|
|
@@ -4,21 +4,22 @@ export * from "./AppBar";
|
|
|
4
4
|
export * from "./Breadcrumbs";
|
|
5
5
|
export * from "./Button";
|
|
6
6
|
export * from "./Card";
|
|
7
|
+
export * from "./Charts";
|
|
7
8
|
export * from "./Chips";
|
|
8
9
|
export * from "./Dialog";
|
|
9
10
|
export * from "./Drawer";
|
|
11
|
+
export * from "./FilterList";
|
|
10
12
|
export * from "./FormFields";
|
|
13
|
+
export * from "./Indicator";
|
|
11
14
|
export * from "./Layouts";
|
|
12
15
|
export * from "./Loader";
|
|
13
16
|
export * from "./PadBox";
|
|
17
|
+
export * from "./Pagination";
|
|
18
|
+
export * from "./Stepper";
|
|
14
19
|
export * from "./Svgs";
|
|
15
20
|
export * from "./Tab";
|
|
21
|
+
export * from "./Timeline";
|
|
16
22
|
export * from "./Toast";
|
|
17
23
|
export * from "./Tooltip";
|
|
18
24
|
export * from "./UserProfileMenu";
|
|
19
25
|
export * from "./utils";
|
|
20
|
-
export * from "./Timeline";
|
|
21
|
-
export * from "./Indicator";
|
|
22
|
-
export * from "./FilterList";
|
|
23
|
-
export * from "./Charts";
|
|
24
|
-
export * from "./Stepper";
|
|
@@ -13,18 +13,23 @@ export type WorkDayType =
|
|
|
13
13
|
| "paid_leave"
|
|
14
14
|
| "absent"
|
|
15
15
|
| "late_in_early_out"
|
|
16
|
-
| "unpaid_leave"
|
|
16
|
+
| "unpaid_leave"
|
|
17
|
+
| "loss_of_pay"
|
|
18
|
+
| "penalty";
|
|
17
19
|
|
|
18
20
|
export type WorkDayTypeShort =
|
|
19
21
|
| "P"
|
|
20
22
|
| "H"
|
|
21
23
|
| "WO"
|
|
22
24
|
| "HO"
|
|
23
|
-
| "
|
|
25
|
+
| "FHWO"
|
|
26
|
+
| "SHWO"
|
|
24
27
|
| "PL"
|
|
25
28
|
| "A"
|
|
26
29
|
| "LIEO"
|
|
27
|
-
| "UPL"
|
|
30
|
+
| "UPL"
|
|
31
|
+
| "PEN"
|
|
32
|
+
| "LOP";
|
|
28
33
|
|
|
29
34
|
export const serverityOptions: Record<WorkDayType, WorkDayTypeShort> = {
|
|
30
35
|
present: "P",
|
|
@@ -34,12 +39,14 @@ export const serverityOptions: Record<WorkDayType, WorkDayTypeShort> = {
|
|
|
34
39
|
first_half_off: "HO",
|
|
35
40
|
second_half_off: "HO",
|
|
36
41
|
full_day_weekly_off: "WO",
|
|
37
|
-
first_half_weekly_off: "
|
|
38
|
-
second_half_weekly_off: "
|
|
42
|
+
first_half_weekly_off: "FHWO",
|
|
43
|
+
second_half_weekly_off: "SHWO",
|
|
39
44
|
paid_leave: "PL",
|
|
40
45
|
absent: "A",
|
|
41
46
|
unpaid_leave: "UPL",
|
|
42
47
|
late_in_early_out: "LIEO",
|
|
48
|
+
loss_of_pay: "LOP",
|
|
49
|
+
penalty: "PEN",
|
|
43
50
|
};
|
|
44
51
|
|
|
45
52
|
export const getColorByVariant = (variant: WorkDayType, type = "dark") => {
|
|
@@ -48,7 +55,8 @@ export const getColorByVariant = (variant: WorkDayType, type = "dark") => {
|
|
|
48
55
|
const { darkMint, sapphireBlue, darkOrange, orchid, lipstickRed, deepAqua } =
|
|
49
56
|
theme.palette.app.color;
|
|
50
57
|
|
|
51
|
-
|
|
58
|
+
// eslint-disable-next-line sonarjs/no-nested-conditional
|
|
59
|
+
const index = type === "dark" ? (variant === "penalty" ? 800 : 900) : 600;
|
|
52
60
|
|
|
53
61
|
switch (variant) {
|
|
54
62
|
case "present":
|
|
@@ -90,6 +98,12 @@ export const getColorByVariant = (variant: WorkDayType, type = "dark") => {
|
|
|
90
98
|
case "late_in_early_out":
|
|
91
99
|
return lipstickRed[800];
|
|
92
100
|
|
|
101
|
+
case "loss_of_pay":
|
|
102
|
+
return lipstickRed[800];
|
|
103
|
+
|
|
104
|
+
case "penalty":
|
|
105
|
+
return lipstickRed[index];
|
|
106
|
+
|
|
93
107
|
default:
|
|
94
108
|
return lipstickRed[index];
|
|
95
109
|
}
|
|
@@ -136,6 +150,12 @@ export const getStatusLabel = (status: WorkDayType) => {
|
|
|
136
150
|
case "late_in_early_out":
|
|
137
151
|
return "Late In/Early Out";
|
|
138
152
|
|
|
153
|
+
case "loss_of_pay":
|
|
154
|
+
return "Loss of Pay";
|
|
155
|
+
|
|
156
|
+
case "penalty":
|
|
157
|
+
return "Penalty";
|
|
158
|
+
|
|
139
159
|
default:
|
|
140
160
|
return "Absent";
|
|
141
161
|
}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
import { DateTime } from "luxon";
|
|
1
|
+
import { DateTime, Duration } from "luxon";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
return DateTime.
|
|
3
|
+
export const formatDate = (date: string, format: string = "dd-MM-yyyy") => {
|
|
4
|
+
return DateTime.fromISO(date).toFormat(format);
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
export const getTimeInHHmm = (date: string, format: string = "HH:mm") => {
|
|
8
|
-
const dateTime = DateTime.fromISO(date)
|
|
8
|
+
const dateTime = DateTime.fromISO(date);
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
if (!dateTime.isValid) {
|
|
11
|
+
return "";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return dateTime.toFormat(format);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const getDifferenceInHHmmss = (startTime: string, endTime: string) => {
|
|
18
|
+
const start = DateTime.fromISO(startTime);
|
|
19
|
+
|
|
20
|
+
const end = DateTime.fromISO(endTime);
|
|
21
|
+
|
|
22
|
+
const diff = end.diff(start, ["hours", "minutes", "seconds"]);
|
|
23
|
+
|
|
24
|
+
return Duration.fromObject(diff.toObject()).toFormat("hh:mm:ss");
|
|
11
25
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export * from "./theme/theme";
|
|
2
|
-
|
|
3
|
-
export * from "./
|
|
4
|
-
|
|
5
|
-
export * from "./
|
|
6
|
-
|
|
7
|
-
export * from "./
|
|
8
|
-
|
|
9
|
-
export * from "./
|
|
10
|
-
|
|
11
|
-
export * from "./urlToNestedObject";
|
|
1
|
+
export * from "./theme/theme";
|
|
2
|
+
|
|
3
|
+
export * from "./theme/colorPaletteUI";
|
|
4
|
+
|
|
5
|
+
export * from "./colorVariant";
|
|
6
|
+
|
|
7
|
+
export * from "./date";
|
|
8
|
+
|
|
9
|
+
export * from "./fileSizeValidate";
|
|
@@ -41,6 +41,7 @@ export const colorPalette: ColorPalette = {
|
|
|
41
41
|
800: "hsla(230, 90%, 3%, 0.08)",
|
|
42
42
|
700: "hsla(226, 34%, 15%, 1)",
|
|
43
43
|
600: "hsla(0, 0%, 22%, 0.7)",
|
|
44
|
+
500: "hsla(0, 0%, 18%, 1)",
|
|
44
45
|
},
|
|
45
46
|
lightSlateBlue: {
|
|
46
47
|
900: "hsla(234, 99%, 68%, 1)",
|
|
@@ -99,6 +100,7 @@ export const colorPalette: ColorPalette = {
|
|
|
99
100
|
red: {
|
|
100
101
|
900: "hsla(0, 90%, 47%, 1)", //error
|
|
101
102
|
800: "hsla(0, 73%, 59%, 1)",
|
|
103
|
+
700: "hsla(0, 81%, 37%, 1)",
|
|
102
104
|
},
|
|
103
105
|
lightBlue: {
|
|
104
106
|
100: "hsla(193, 4%, 92%)",
|
|
@@ -283,6 +283,14 @@ export function appTheme(theme: PaletteMode): ThemeOptions {
|
|
|
283
283
|
},
|
|
284
284
|
],
|
|
285
285
|
},
|
|
286
|
+
MuiTableCell: {
|
|
287
|
+
styleOverrides: {
|
|
288
|
+
root: {
|
|
289
|
+
borderBottom: `1px solid ${palette.app.color.butterflyBlue[700]}`,
|
|
290
|
+
padding: "10px 16px",
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
286
294
|
},
|
|
287
295
|
spacing: 10,
|
|
288
296
|
};
|