@codezee/sixtify-brahma 0.2.58 → 0.2.60

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.
Files changed (43) hide show
  1. package/package.json +1 -1
  2. package/packages/shared-components/dist/ActionButtons/ActionButtons.d.ts.map +1 -1
  3. package/packages/shared-components/dist/ActionButtons/ActionButtons.js +3 -5
  4. package/packages/shared-components/dist/ActionButtons/types.d.ts +1 -0
  5. package/packages/shared-components/dist/ActionButtons/types.d.ts.map +1 -1
  6. package/packages/shared-components/dist/Actions/ColumnIconAction.js +1 -1
  7. package/packages/shared-components/dist/AgGrid/ActionCell/ActionCell.d.ts.map +1 -1
  8. package/packages/shared-components/dist/AgGrid/ActionCell/ActionCell.js +4 -1
  9. package/packages/shared-components/dist/CellSelectionTable/CellSelectionTable.d.ts +13 -0
  10. package/packages/shared-components/dist/CellSelectionTable/CellSelectionTable.d.ts.map +1 -0
  11. package/packages/shared-components/dist/CellSelectionTable/CellSelectionTable.js +125 -0
  12. package/packages/shared-components/dist/CellSelectionTable/SubComponents/EmployeeCell.d.ts +6 -0
  13. package/packages/shared-components/dist/CellSelectionTable/SubComponents/EmployeeCell.d.ts.map +1 -0
  14. package/packages/shared-components/dist/CellSelectionTable/SubComponents/EmployeeCell.js +10 -0
  15. package/packages/shared-components/dist/CellSelectionTable/SubComponents/TableBodyLoader.d.ts +8 -0
  16. package/packages/shared-components/dist/CellSelectionTable/SubComponents/TableBodyLoader.d.ts.map +1 -0
  17. package/packages/shared-components/dist/CellSelectionTable/SubComponents/TableBodyLoader.js +10 -0
  18. package/packages/shared-components/dist/CellSelectionTable/index.d.ts +3 -0
  19. package/packages/shared-components/dist/CellSelectionTable/index.d.ts.map +1 -0
  20. package/packages/shared-components/dist/CellSelectionTable/index.js +18 -0
  21. package/packages/shared-components/dist/CellSelectionTable/utils/helper.d.ts +6 -0
  22. package/packages/shared-components/dist/CellSelectionTable/utils/helper.d.ts.map +1 -0
  23. package/packages/shared-components/dist/CellSelectionTable/utils/helper.js +77 -0
  24. package/packages/shared-components/dist/CellSelectionTable/utils/index.d.ts +2 -0
  25. package/packages/shared-components/dist/CellSelectionTable/utils/index.d.ts.map +1 -0
  26. package/packages/shared-components/dist/CellSelectionTable/utils/index.js +17 -0
  27. package/packages/shared-components/dist/CellSelectionTable/utils/types.d.ts +57 -0
  28. package/packages/shared-components/dist/CellSelectionTable/utils/types.d.ts.map +1 -0
  29. package/packages/shared-components/dist/CellSelectionTable/utils/types.js +2 -0
  30. package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/FilePreview.d.ts +2 -1
  31. package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/FilePreview.d.ts.map +1 -1
  32. package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/FilePreview.js +121 -7
  33. package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/ViewFilePreviewDialog.js +2 -2
  34. package/packages/shared-components/dist/index.d.ts +1 -0
  35. package/packages/shared-components/dist/index.d.ts.map +1 -1
  36. package/packages/shared-components/dist/index.js +1 -0
  37. package/packages/shared-components/dist/utils/colorVariant.d.ts +1 -1
  38. package/packages/shared-components/dist/utils/colorVariant.d.ts.map +1 -1
  39. package/packages/shared-components/dist/utils/theme/colorPalette.d.ts +14 -15
  40. package/packages/shared-components/dist/utils/theme/colorPalette.d.ts.map +1 -1
  41. package/packages/shared-components/dist/utils/theme/colorPalette.js +136 -1
  42. package/packages/shared-components/dist/utils/theme/paletteDark.d.ts +1 -1
  43. package/packages/shared-components/dist/utils/theme/theme.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codezee/sixtify-brahma",
3
- "version": "0.2.58",
3
+ "version": "0.2.60",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButtons.d.ts","sourceRoot":"","sources":["../../src/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKhD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;CAC/C,CAAC;AAGF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,cAAsB,GACvB,EAAE,kBAAkB,2CAmGpB"}
1
+ {"version":3,"file":"ActionButtons.d.ts","sourceRoot":"","sources":["../../src/ActionButtons/ActionButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKhD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG;IAC3C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;CAC/C,CAAC;AAGF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,cAAsB,GACvB,EAAE,kBAAkB,2CAqGpB"}
@@ -23,7 +23,7 @@ function ActionButtons({ buttons, justifyContent = "end", }) {
23
23
  };
24
24
  return ((0, jsx_runtime_1.jsx)(material_1.Stack, { direction: "row", gap: "1.6rem", justifyContent: justifyContent, children: buttons
25
25
  .filter((button) => !button.hidden)
26
- .map(({ menuItems, ...button }) => {
26
+ .map(({ menuItems, key, ...button }) => {
27
27
  const visibleMenuItems = menuItems?.filter((menuItem) => !menuItem.hidden);
28
28
  const isMenuOpen = openMenuKey === button.key;
29
29
  const onClick = visibleMenuItems && visibleMenuItems.length > 0
@@ -31,11 +31,9 @@ function ActionButtons({ buttons, justifyContent = "end", }) {
31
31
  : (button.onClick ?? noop_1.default);
32
32
  const buttonProps = {
33
33
  ...button,
34
- dataPTag: button.dataPTag,
35
- dataCy: button.dataCy,
36
34
  onClick,
37
35
  };
38
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [button.label ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { ...buttonProps, children: button.label })) : ((0, jsx_runtime_1.jsx)(material_1.IconButton, { ...buttonProps, children: button.icon })), isMenuOpen && visibleMenuItems && ((0, jsx_runtime_1.jsx)(material_1.Menu, { anchorEl: anchorEl, open: Boolean(anchorEl && isMenuOpen), onClose: handleMenuClose, anchorOrigin: {
36
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [button.label ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { ...buttonProps, children: button.label }, key)) : ((0, jsx_runtime_1.jsx)(material_1.IconButton, { ...buttonProps, children: button.icon }, key)), isMenuOpen && visibleMenuItems && ((0, jsx_runtime_1.jsx)(material_1.Menu, { anchorEl: anchorEl, open: Boolean(anchorEl && isMenuOpen), onClose: handleMenuClose, anchorOrigin: {
39
37
  vertical: "bottom",
40
38
  horizontal: button.menuPlacement === "left" ? "left" : "right",
41
39
  }, children: visibleMenuItems.map((item) => {
@@ -51,6 +49,6 @@ function ActionButtons({ buttons, justifyContent = "end", }) {
51
49
  handleMenuClose();
52
50
  item.onClick?.();
53
51
  }, children: [item.icon, item.label] }, item.key));
54
- }) }))] }));
52
+ }) }))] }, key));
55
53
  }) }));
56
54
  }
@@ -34,6 +34,7 @@ export type ActionButton = {
34
34
  hidden?: boolean;
35
35
  disableElevation?: boolean;
36
36
  [x: string]: any;
37
+ disabled?: boolean;
37
38
  };
38
39
  export type DataProps = {
39
40
  dataPTag?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ActionButtons/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D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,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -6,6 +6,6 @@ const material_1 = require("@mui/material");
6
6
  const Svgs_1 = require("../Svgs");
7
7
  const Tooltip_1 = require("../Tooltip");
8
8
  const ColumnIconAction = (props) => {
9
- return ((0, jsx_runtime_1.jsx)(material_1.IconButton, { ...props, sx: { padding: 0 }, children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: "Column Chooser", children: (0, jsx_runtime_1.jsx)(Svgs_1.SvgColumn, {}) }) }));
9
+ return ((0, jsx_runtime_1.jsx)(material_1.IconButton, { ...props, sx: { padding: 0, height: "43px" }, children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: "Column Chooser", children: (0, jsx_runtime_1.jsx)(Svgs_1.SvgColumn, {}) }) }));
10
10
  };
11
11
  exports.ColumnIconAction = ColumnIconAction;
@@ -1 +1 @@
1
- {"version":3,"file":"ActionCell.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/ActionCell/ActionCell.tsx"],"names":[],"mappings":"AAMA,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,eAAO,MAAM,UAAU,GAAI,qBAAqB,iBAAiB,4CAyChE,CAAC"}
1
+ {"version":3,"file":"ActionCell.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/ActionCell/ActionCell.tsx"],"names":[],"mappings":"AAMA,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AACF,eAAO,MAAM,UAAU,GAAI,qBAAqB,iBAAiB,4CA6ChE,CAAC"}
@@ -19,7 +19,10 @@ const ActionCell = ({ items, disabled }) => {
19
19
  setAnchorEl(event.currentTarget);
20
20
  };
21
21
  return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { width: "100%" }, children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { component: "div", sx: { cursor: "pointer", alignItems: "center", width: "100%" }, onClick: HandleClick, disabled: disabled, children: (0, jsx_runtime_1.jsx)(MoreVert_1.default, {}) }), !!anchorEl && ((0, jsx_runtime_1.jsx)(Popover_1.Popover, { open: true, anchorEl: anchorEl, onClose: HandleClose, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "2px" }, children: items.map((item) => {
22
- return ((0, jsx_runtime_1.jsx)(material_1.Stack, { children: (0, jsx_runtime_1.jsx)(material_1.ListItemButton, { sx: { width: "100%", textAlign: "center" }, onClick: () => item?.onClick(), children: item.title }) }, item.title));
22
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, jsx_runtime_1.jsx)(material_1.ListItemButton, { sx: { width: "100%", textAlign: "center" }, onClick: () => {
23
+ item?.onClick();
24
+ setAnchorEl(null);
25
+ }, children: item.title }) }, item.title));
23
26
  }) }) }))] }));
24
27
  };
25
28
  exports.ActionCell = ActionCell;
@@ -0,0 +1,13 @@
1
+ import type { Dictionary } from "lodash";
2
+ import { type MouseEvent } from "react";
3
+ import type { CellCoord, Column } from "./utils/types";
4
+ export type CellSelectionTableProps = {
5
+ columns: Column[];
6
+ data: Record<string, string>[];
7
+ onCellSelection: (selectedCells: Dictionary<CellCoord[]>, e: MouseEvent) => void;
8
+ cellColors?: (status: string) => string;
9
+ height?: string | number;
10
+ loading?: boolean;
11
+ };
12
+ export declare const CellSelectionTable: ({ columns, data, onCellSelection, cellColors, height, loading, }: Readonly<CellSelectionTableProps>) => import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=CellSelectionTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CellSelectionTable.d.ts","sourceRoot":"","sources":["../../src/CellSelectionTable/CellSelectionTable.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGzC,OAAO,EAAE,KAAK,UAAU,EAA0C,MAAM,OAAO,CAAC;AAUhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAoB,MAAM,eAAe,CAAC;AAEzE,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAC/B,eAAe,EAAE,CACf,aAAa,EAAE,UAAU,CAAC,SAAS,EAAE,CAAC,EACtC,CAAC,EAAE,UAAU,KACV,IAAI,CAAC;IACV,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,kEAOhC,QAAQ,CAAC,uBAAuB,CAAC,4CAoOnC,CAAC"}
@@ -0,0 +1,125 @@
1
+ "use client";
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CellSelectionTable = void 0;
8
+ const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const material_1 = require("@mui/material");
10
+ const groupBy_1 = __importDefault(require("lodash/groupBy"));
11
+ const uniqBy_1 = __importDefault(require("lodash/uniqBy"));
12
+ const react_1 = require("react");
13
+ const Tooltip_1 = require("../Tooltip");
14
+ const EmployeeCell_1 = require("./SubComponents/EmployeeCell");
15
+ const TableBodyLoader_1 = require("./SubComponents/TableBodyLoader");
16
+ const helper_1 = require("./utils/helper");
17
+ const CellSelectionTable = ({ columns, data, onCellSelection, cellColors, height, loading = false, }) => {
18
+ const theme = (0, material_1.useTheme)();
19
+ const { slate, iron, butterflyBlue } = theme.palette.app.color;
20
+ const selectingRef = (0, react_1.useRef)(false);
21
+ const anchorRef = (0, react_1.useRef)(null);
22
+ const hoveringRef = (0, react_1.useRef)(null);
23
+ const [selectedRanges, setSelectedRanges] = (0, react_1.useState)([]);
24
+ const selectedSet = (0, react_1.useMemo)(() => {
25
+ const set = new Set();
26
+ selectedRanges.flat().forEach((cell) => {
27
+ set.add(`${cell.row}-${cell.col}`);
28
+ });
29
+ return set;
30
+ }, [selectedRanges]);
31
+ const isSelectedCell = (0, react_1.useCallback)((rowIndex, colIndex) => selectedSet.has(`${rowIndex}-${colIndex}`), [selectedSet]);
32
+ const memoizedData = (0, react_1.useMemo)(() => data, [data]);
33
+ function getCellColor({ cellKey, isSelected = false, }) {
34
+ if (isSelected) {
35
+ return butterflyBlue[800];
36
+ }
37
+ if (!isSelected && cellKey && cellColors) {
38
+ return cellColors(cellKey);
39
+ }
40
+ return iron[600];
41
+ }
42
+ const groupedRanges = (0, react_1.useMemo)(() => {
43
+ const unique = (0, uniqBy_1.default)(selectedRanges, (cell) => `${cell.row}-${cell.col}`);
44
+ return (0, groupBy_1.default)(unique, "row");
45
+ }, [selectedRanges]);
46
+ const handleCellMouseDown = (0, react_1.useCallback)((ri, ci) => (e) => {
47
+ (0, helper_1.handleMouseDown)({
48
+ e,
49
+ ri,
50
+ ci,
51
+ selectingRef,
52
+ anchorRef,
53
+ setSelectedRanges,
54
+ });
55
+ }, []);
56
+ const handleCellMouseEnter = (0, react_1.useCallback)((ri, ci) => () => {
57
+ (0, helper_1.handleMouseEnter)({
58
+ selectingRef,
59
+ anchorRef,
60
+ hoveringRef,
61
+ ri,
62
+ ci,
63
+ setSelectedRanges,
64
+ });
65
+ }, []);
66
+ const handleCellMouseUp = (0, react_1.useCallback)((e) => {
67
+ (0, helper_1.handleMouseUp)({
68
+ e,
69
+ selectingRef,
70
+ anchorRef,
71
+ hoveringRef,
72
+ setSelectedRanges,
73
+ });
74
+ }, []);
75
+ const handleContextMenuCallback = (0, react_1.useCallback)((ri, ci) => (e) => {
76
+ if (Object.keys(groupedRanges).length && !e) {
77
+ setSelectedRanges([]);
78
+ return;
79
+ }
80
+ (0, helper_1.handleContextMenu)({
81
+ e,
82
+ ri,
83
+ ci,
84
+ selectedRanges,
85
+ setSelectedRanges,
86
+ onCellSelection,
87
+ });
88
+ }, [setSelectedRanges, onCellSelection, groupedRanges]);
89
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, { position: "relative", overflow: "auto", height: height, bgcolor: iron[600], children: (0, jsx_runtime_1.jsxs)(material_1.Table, { stickyHeader: true, sx: {
90
+ borderCollapse: "separate",
91
+ borderSpacing: 0,
92
+ "& th, & td": {
93
+ borderRight: `1px solid ${slate[700]}`,
94
+ borderBottom: `1px solid ${slate[700]}`,
95
+ padding: "5px",
96
+ height: "50px",
97
+ },
98
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.TableHead, { children: (0, jsx_runtime_1.jsx)(material_1.TableRow, { children: columns.map(({ key, label, minWidth = "auto", align = "left" }) => ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: align, sx: {
99
+ backgroundColor: slate[700],
100
+ minWidth,
101
+ padding: "5px 10px",
102
+ }, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "subtitle2", children: label }) }, key))) }) }), loading ? ((0, jsx_runtime_1.jsx)(TableBodyLoader_1.TableBodyLoader, { columns: columns, rowCount: 25 })) : ((0, jsx_runtime_1.jsx)(material_1.TableBody, { children: memoizedData.map((row, ri) => ((0, jsx_runtime_1.jsx)(material_1.TableRow, { sx: { backgroundColor: iron[600] }, children: columns.map(({ key, maxWidth = "auto", minWidth = "auto", isEmployee, align = "center", }, ci) => {
103
+ return ((0, jsx_runtime_1.jsx)(material_1.TableCell, { align: align, sx: {
104
+ userSelect: "none",
105
+ overflow: "hidden",
106
+ bgcolor: (0, material_1.lighten)(getCellColor({
107
+ cellKey: row[key],
108
+ isSelected: isSelectedCell(ri, ci),
109
+ }), 0.8),
110
+ padding: "5px 10px",
111
+ cursor: "pointer",
112
+ maxWidth,
113
+ minWidth,
114
+ }, onMouseDown: !columns[ci]?.disableSelection
115
+ ? handleCellMouseDown(ri, ci)
116
+ : undefined, onMouseEnter: !columns[ci]?.disableSelection
117
+ ? handleCellMouseEnter(ri, ci)
118
+ : undefined, onMouseUp: !columns[ci]?.disableSelection
119
+ ? handleCellMouseUp
120
+ : undefined, onContextMenu: !columns[ci]?.disableSelection
121
+ ? handleContextMenuCallback(ri, ci)
122
+ : undefined, children: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: row[key], children: isEmployee ? ((0, jsx_runtime_1.jsx)(EmployeeCell_1.EmployeeCell, { row: row })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { title: row[key], children: row[key] })) }) }, key));
123
+ }) }, row.id))) }))] }) }));
124
+ };
125
+ exports.CellSelectionTable = CellSelectionTable;
@@ -0,0 +1,6 @@
1
+ type EmployeeCellProps = {
2
+ row: Record<string, string>;
3
+ };
4
+ export declare const EmployeeCell: ({ row }: EmployeeCellProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=EmployeeCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmployeeCell.d.ts","sourceRoot":"","sources":["../../../src/CellSelectionTable/SubComponents/EmployeeCell.tsx"],"names":[],"mappings":"AAEA,KAAK,iBAAiB,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,SAAS,iBAAiB,4CAatD,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmployeeCell = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const material_1 = require("@mui/material");
6
+ const EmployeeCell = ({ row }) => {
7
+ const { avatar, name, employee_code } = row ?? {};
8
+ return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", gap: "10px", children: [(0, jsx_runtime_1.jsx)(material_1.Avatar, { src: avatar, alt: name, sx: { width: 40, height: 40 } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: name }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", children: employee_code })] })] }));
9
+ };
10
+ exports.EmployeeCell = EmployeeCell;
@@ -0,0 +1,8 @@
1
+ import type { Column } from "../utils";
2
+ type TableBodyLoaderProps = {
3
+ columns: Column[];
4
+ rowCount?: number;
5
+ };
6
+ export declare const TableBodyLoader: ({ columns, rowCount, }: TableBodyLoaderProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=TableBodyLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableBodyLoader.d.ts","sourceRoot":"","sources":["../../../src/CellSelectionTable/SubComponents/TableBodyLoader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,wBAG7B,oBAAoB,4CActB,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableBodyLoader = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const material_1 = require("@mui/material");
6
+ const uuid_1 = require("uuid");
7
+ const TableBodyLoader = ({ columns, rowCount = 25, }) => {
8
+ return ((0, jsx_runtime_1.jsx)(material_1.TableBody, { children: Array.from({ length: rowCount }).map(() => ((0, jsx_runtime_1.jsx)(material_1.TableRow, { children: columns.map(() => ((0, jsx_runtime_1.jsx)(material_1.TableCell, { sx: { padding: "5px 10px" }, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: "100%", height: "100%" }) }, (0, uuid_1.v4)()))) }, (0, uuid_1.v4)()))) }));
9
+ };
10
+ exports.TableBodyLoader = TableBodyLoader;
@@ -0,0 +1,3 @@
1
+ export * from "./CellSelectionTable";
2
+ export * from "./utils/types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/CellSelectionTable/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./CellSelectionTable"), exports);
18
+ __exportStar(require("./utils/types"), exports);
@@ -0,0 +1,6 @@
1
+ import type { HandleContextMenuArgs, HandleMouseDownArgs, HandleMouseEnterArgs, HandleMunseUpArgs } from "./types";
2
+ export declare function handleMouseEnter({ selectingRef, anchorRef, hoveringRef, ri, ci, setSelectedRanges, }: HandleMouseEnterArgs): void;
3
+ export declare function handleMouseDown({ e, ri, ci, selectingRef, anchorRef, setSelectedRanges, }: HandleMouseDownArgs): void;
4
+ export declare function handleMouseUp({ e, selectingRef, anchorRef, hoveringRef, setSelectedRanges, }: HandleMunseUpArgs): void;
5
+ export declare function handleContextMenu({ e, ri, ci, setSelectedRanges, onCellSelection, selectedRanges, }: HandleContextMenuArgs): void;
6
+ //# sourceMappingURL=helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/CellSelectionTable/utils/helper.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAgCjB,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,SAAS,EACT,WAAW,EACX,EAAE,EACF,EAAE,EACF,iBAAiB,GAClB,EAAE,oBAAoB,QAOtB;AAED,wBAAgB,eAAe,CAAC,EAC9B,CAAC,EACD,EAAE,EACF,EAAE,EACF,YAAY,EACZ,SAAS,EACT,iBAAiB,GAClB,EAAE,mBAAmB,QAkBrB;AAED,wBAAgB,aAAa,CAAC,EAC5B,CAAC,EACD,YAAY,EACZ,SAAS,EACT,WAAW,EACX,iBAAiB,GAClB,EAAE,iBAAiB,QAQnB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,CAAC,EACD,EAAE,EACF,EAAE,EACF,iBAAiB,EACjB,eAAe,EACf,cAAc,GACf,EAAE,qBAAqB,QAkCvB"}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.handleMouseEnter = handleMouseEnter;
7
+ exports.handleMouseDown = handleMouseDown;
8
+ exports.handleMouseUp = handleMouseUp;
9
+ exports.handleContextMenu = handleContextMenu;
10
+ const compact_1 = __importDefault(require("lodash/compact"));
11
+ const map_1 = __importDefault(require("lodash/map"));
12
+ function updateRange(start, end, setSelectedRanges) {
13
+ const top = Math.min(start.row, end.row);
14
+ const bottom = Math.max(start.row, end.row);
15
+ const left = Math.min(start.col, end.col);
16
+ const right = Math.max(start.col, end.col);
17
+ const range = [];
18
+ for (let r = top; r <= bottom; r++) {
19
+ for (let c = left; c <= right; c++) {
20
+ range.push({ row: r, col: c });
21
+ }
22
+ }
23
+ setSelectedRanges((prev) => {
24
+ const out = [...prev];
25
+ out.splice(out.length - 1, 1, ...range);
26
+ return out;
27
+ });
28
+ }
29
+ function handleMouseEnter({ selectingRef, anchorRef, hoveringRef, ri, ci, setSelectedRanges, }) {
30
+ if (!selectingRef.current || !anchorRef.current) {
31
+ return;
32
+ }
33
+ hoveringRef.current = { row: ri, col: ci };
34
+ updateRange(anchorRef.current, hoveringRef.current, setSelectedRanges);
35
+ }
36
+ function handleMouseDown({ e, ri, ci, selectingRef, anchorRef, setSelectedRanges, }) {
37
+ if (e.button === 2) {
38
+ return;
39
+ }
40
+ const anchor = { row: ri, col: ci };
41
+ selectingRef.current = true;
42
+ anchorRef.current = anchor;
43
+ if (e.ctrlKey || e.metaKey) {
44
+ setSelectedRanges((prev) => [...prev, anchor]);
45
+ return;
46
+ }
47
+ setSelectedRanges([anchor]);
48
+ }
49
+ function handleMouseUp({ e, selectingRef, anchorRef, hoveringRef, setSelectedRanges, }) {
50
+ selectingRef.current = false;
51
+ anchorRef.current = null;
52
+ hoveringRef.current = null;
53
+ if (!(e?.ctrlKey || e?.metaKey)) {
54
+ setSelectedRanges([]);
55
+ }
56
+ }
57
+ function handleContextMenu({ e, ri, ci, setSelectedRanges, onCellSelection, selectedRanges, }) {
58
+ e.preventDefault();
59
+ const singleCell = [{ row: ri, col: ci }];
60
+ const keySet = new Set((0, map_1.default)(selectedRanges, (cell) => `${cell.row}:${cell.col}`));
61
+ if (e.ctrlKey || e.metaKey) {
62
+ singleCell.forEach((cell) => keySet.add(`${cell.row}:${cell.col}`));
63
+ const merged = (0, compact_1.default)((0, map_1.default)(Array.from(keySet), (key) => {
64
+ const [rowStr, colStr] = key.split(":");
65
+ const row = Number(rowStr);
66
+ const col = Number(colStr);
67
+ return Number.isNaN(row) || Number.isNaN(col)
68
+ ? null
69
+ : { row, col };
70
+ }));
71
+ setSelectedRanges(merged);
72
+ onCellSelection?.({ selectedCells: merged }, e);
73
+ return;
74
+ }
75
+ setSelectedRanges(singleCell);
76
+ onCellSelection?.({ selectedCells: singleCell }, e);
77
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./types";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/CellSelectionTable/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,57 @@
1
+ import type { TableCellProps } from "@mui/material";
2
+ import type { Dictionary } from "lodash";
3
+ import type { Dispatch, MouseEvent, MutableRefObject, SetStateAction } from "react";
4
+ export type Column = {
5
+ key: string;
6
+ label: string;
7
+ isEmployee?: boolean;
8
+ minWidth?: string | number;
9
+ maxWidth?: string | number;
10
+ align?: TableCellProps["align"];
11
+ disableSelection?: boolean;
12
+ };
13
+ export type OptionsType = {
14
+ value: string;
15
+ label: string;
16
+ disabled?: boolean;
17
+ };
18
+ export type CellCoord = {
19
+ row: number;
20
+ col: number;
21
+ };
22
+ export type HandleMouseEnterArgs = {
23
+ selectingRef: MutableRefObject<boolean>;
24
+ anchorRef: MutableRefObject<CellCoord | null>;
25
+ hoveringRef: MutableRefObject<CellCoord | null>;
26
+ ri: number;
27
+ ci: number;
28
+ setSelectedRanges: Dispatch<SetStateAction<CellCoord[]>>;
29
+ };
30
+ export type HandleMouseDownArgs = {
31
+ e: MouseEvent<HTMLTableCellElement>;
32
+ ri: number;
33
+ ci: number;
34
+ selectingRef: MutableRefObject<boolean>;
35
+ anchorRef: MutableRefObject<CellCoord | null>;
36
+ setSelectedRanges: Dispatch<SetStateAction<CellCoord[]>>;
37
+ };
38
+ export type HandleMunseUpArgs = {
39
+ e: MouseEvent<HTMLTableCellElement>;
40
+ selectingRef: MutableRefObject<boolean>;
41
+ anchorRef: MutableRefObject<CellCoord | null>;
42
+ hoveringRef: MutableRefObject<CellCoord | null>;
43
+ setSelectedRanges: Dispatch<SetStateAction<CellCoord[]>>;
44
+ };
45
+ export type HandleContextMenuArgs = {
46
+ e: MouseEvent<HTMLTableCellElement>;
47
+ ri: number;
48
+ ci: number;
49
+ selectedRanges: CellCoord[];
50
+ setSelectedRanges: Dispatch<SetStateAction<CellCoord[]>>;
51
+ onCellSelection: (ranges: Dictionary<CellCoord[]>, e: MouseEvent<HTMLTableCellElement>) => void;
52
+ };
53
+ export type GetCellColorArgs = {
54
+ cellKey?: string;
55
+ isSelected: boolean;
56
+ };
57
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/CellSelectionTable/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,cAAc,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CA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AC5B,iBAAiB,EAAE,QAAQ,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACzD,eAAe,EAAE,CACf,MAAM,EAAE,UAAU,CAAC,SAAS,EAAE,CAAC,EAC/B,CAAC,EAAE,UAAU,CAAC,oBAAoB,CAAC,KAChC,IAAI,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,11 +1,12 @@
1
1
  type FilePreviewProps = {
2
2
  fileName: string;
3
+ resetTrigger?: number;
3
4
  };
4
5
  export declare const SUPPORTED_IMAGE_FORMATS: readonly [".png", ".jpg", ".jpeg"];
5
6
  export declare const SUPPORTED_PDF_FORMATS: readonly [".pdf"];
6
7
  export declare const SUPPORTED_DOC_FORMATS: readonly [".doc", ".docx"];
7
8
  export declare const SUPPORTED_EXCEL_FORMATS: readonly [".xls", ".xlsx"];
8
9
  export declare function isFileType(url: string, extensions: readonly string[]): boolean;
9
- export declare const FilePreview: ({ fileName }: FilePreviewProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const FilePreview: ({ fileName, resetTrigger }: FilePreviewProps) => import("react/jsx-runtime").JSX.Element;
10
11
  export {};
11
12
  //# sourceMappingURL=FilePreview.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FilePreview.d.ts","sourceRoot":"","sources":["../../../../src/FormFields/FileUpload/Dialogs/FilePreview.tsx"],"names":[],"mappings":"AAMA,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,uBAAuB,oCAAqC,CAAC;AAE1E,eAAO,MAAM,qBAAqB,mBAAoB,CAAC;AAEvD,eAAO,MAAM,qBAAqB,4BAA6B,CAAC;AAEhE,eAAO,MAAM,uBAAuB,4BAA6B,CAAC;AAElE,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,OAAO,CAET;AAED,eAAO,MAAM,WAAW,GAAI,cAAc,gBAAgB,4CA0DzD,CAAC"}
1
+ {"version":3,"file":"FilePreview.d.ts","sourceRoot":"","sources":["../../../../src/FormFields/FileUpload/Dialogs/FilePreview.tsx"],"names":[],"mappings":"AA0BA,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,uBAAuB,oCAAqC,CAAC;AAE1E,eAAO,MAAM,qBAAqB,mBAAoB,CAAC;AAEvD,eAAO,MAAM,qBAAqB,4BAA6B,CAAC;AAEhE,eAAO,MAAM,uBAAuB,4BAA6B,CAAC;AASlE,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,OAAO,CAET;AAED,eAAO,MAAM,WAAW,GAAI,4BAA4B,gBAAgB,4CAkQvE,CAAC"}
@@ -6,8 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.FilePreview = exports.SUPPORTED_EXCEL_FORMATS = exports.SUPPORTED_DOC_FORMATS = exports.SUPPORTED_PDF_FORMATS = exports.SUPPORTED_IMAGE_FORMATS = void 0;
7
7
  exports.isFileType = isFileType;
8
8
  const jsx_runtime_1 = require("react/jsx-runtime");
9
+ const ZoomInOutlined_1 = __importDefault(require("@mui/icons-material/ZoomInOutlined"));
10
+ const ZoomOutOutlined_1 = __importDefault(require("@mui/icons-material/ZoomOutOutlined"));
9
11
  const material_1 = require("@mui/material");
10
12
  const image_1 = __importDefault(require("next/image"));
13
+ const react_1 = require("react");
14
+ const Button_1 = require("../../../Button");
11
15
  const Layouts_1 = require("../../../Layouts");
12
16
  const PadBox_1 = require("../../../PadBox");
13
17
  const utils_1 = require("../../../utils");
@@ -15,21 +19,131 @@ exports.SUPPORTED_IMAGE_FORMATS = [".png", ".jpg", ".jpeg"];
15
19
  exports.SUPPORTED_PDF_FORMATS = [".pdf"];
16
20
  exports.SUPPORTED_DOC_FORMATS = [".doc", ".docx"];
17
21
  exports.SUPPORTED_EXCEL_FORMATS = [".xls", ".xlsx"];
22
+ const DEFAULT_ZOOM_CONFIG = {
23
+ min: 0.5,
24
+ max: 2,
25
+ step: 0.5,
26
+ sensitivity: 0.1,
27
+ };
18
28
  function isFileType(url, extensions) {
19
29
  return extensions.some((ext) => url.toLowerCase().endsWith(ext));
20
30
  }
21
- const FilePreview = ({ fileName }) => {
31
+ const FilePreview = ({ fileName, resetTrigger }) => {
22
32
  const isValidUrl = (0, utils_1.isImageDomainValid)(fileName);
33
+ const [isDragging, setIsDragging] = (0, react_1.useState)(false);
34
+ const [position, setPosition] = (0, react_1.useState)({ x: 0, y: 0 });
35
+ const [startPos, setStartPos] = (0, react_1.useState)({ x: 0, y: 0 });
36
+ const [zoomLevel, setZoomLevel] = (0, react_1.useState)(1);
37
+ const imageContainerRef = (0, react_1.useRef)(null);
38
+ const theme = (0, material_1.useTheme)();
39
+ const { slate } = theme.palette.app.color;
40
+ const { sensitivity, min, max, step } = DEFAULT_ZOOM_CONFIG;
41
+ const { x: positionX, y: positionY } = position;
42
+ const handleMouseDown = ({ clientX, clientY, }) => {
43
+ setIsDragging(true);
44
+ setStartPos({ x: clientX - positionX, y: clientY - positionY });
45
+ };
46
+ const handleMouseMove = ({ clientX, clientY, }) => {
47
+ if (isDragging) {
48
+ const x = clientX - startPos.x;
49
+ const y = clientY - startPos.y;
50
+ setPosition({ x, y });
51
+ }
52
+ };
53
+ const calculateOffset = ({ clientX, clientY, }, container) => {
54
+ const { left, top, height, width } = container.getBoundingClientRect();
55
+ const mouseX = clientX - left;
56
+ const mouseY = clientY - top;
57
+ return {
58
+ offsetX: mouseX - width / 2,
59
+ offsetY: mouseY - height / 2,
60
+ };
61
+ };
62
+ const handleWheel = (e) => {
63
+ const container = imageContainerRef.current;
64
+ if (!container) {
65
+ return;
66
+ }
67
+ const { offsetX, offsetY } = calculateOffset(e, container);
68
+ const delta = e.deltaY > 0 ? -sensitivity : sensitivity;
69
+ const newZoom = Math.min(Math.max(zoomLevel + delta, min), max);
70
+ if (newZoom !== zoomLevel) {
71
+ const zoomFactor = newZoom / zoomLevel;
72
+ const newX = positionX - offsetX * (zoomFactor - 1);
73
+ const newY = positionY - offsetY * (zoomFactor - 1);
74
+ setPosition({ x: newX, y: newY });
75
+ setZoomLevel(newZoom);
76
+ }
77
+ };
78
+ const resetZoomLevel = () => {
79
+ setZoomLevel(1);
80
+ setPosition({ x: 0, y: 0 });
81
+ };
82
+ (0, react_1.useMemo)(() => {
83
+ resetZoomLevel();
84
+ }, [resetTrigger]);
85
+ const updateZoomLevel = (delta) => {
86
+ setZoomLevel((prev) => {
87
+ const updatedZoom = Math.min(2, Math.max(0.5, prev + delta));
88
+ return updatedZoom;
89
+ });
90
+ };
91
+ const handleDoubleClick = (e) => {
92
+ e.preventDefault();
93
+ const container = imageContainerRef.current;
94
+ if (!container) {
95
+ return;
96
+ }
97
+ const { offsetX, offsetY } = calculateOffset(e, container);
98
+ const newZoom = zoomLevel > 1 ? 1 : Math.min(zoomLevel + step, max);
99
+ if (zoomLevel > 1) {
100
+ resetZoomLevel();
101
+ setZoomLevel(newZoom);
102
+ return;
103
+ }
104
+ const zoomFactor = newZoom / zoomLevel;
105
+ const newX = positionX - offsetX * (zoomFactor - 1);
106
+ const newY = positionY - offsetY * (zoomFactor - 1);
107
+ setPosition({ x: newX, y: newY });
108
+ setZoomLevel(newZoom);
109
+ };
110
+ const endDrag = () => {
111
+ setIsDragging(false);
112
+ };
23
113
  if (isFileType(fileName, exports.SUPPORTED_PDF_FORMATS)) {
24
114
  return ((0, jsx_runtime_1.jsx)(Layouts_1.FilePreviewContainer, { children: (0, jsx_runtime_1.jsx)("iframe", { src: `${fileName}#toolbar=0`, style: { width: "100%", height: "100%" } }) }));
25
115
  }
26
116
  if (isFileType(fileName, exports.SUPPORTED_IMAGE_FORMATS) && isValidUrl) {
27
- return ((0, jsx_runtime_1.jsx)(Layouts_1.FilePreviewContainer, { children: (0, jsx_runtime_1.jsx)(image_1.default, { src: fileName, alt: "Attachment", width: 800, height: 0, style: {
28
- width: "100%",
29
- height: "100%",
30
- objectFit: "contain",
31
- display: "block",
32
- } }) }));
117
+ return ((0, jsx_runtime_1.jsxs)(Layouts_1.FilePreviewContainer, { children: [(0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", alignItems: "center", justifyContent: "center", gap: "10px", sx: {
118
+ position: "absolute",
119
+ top: 10,
120
+ right: 66,
121
+ zIndex: 10,
122
+ }, children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { sx: {
123
+ backgroundColor: slate[900],
124
+ minWidth: "42px",
125
+ height: "42px",
126
+ }, onClick: () => updateZoomLevel(-0.3), children: (0, jsx_runtime_1.jsx)(ZoomOutOutlined_1.default, {}) }), (0, jsx_runtime_1.jsx)(Button_1.Button, { sx: {
127
+ backgroundColor: slate[900],
128
+ minWidth: "42px",
129
+ height: "42px",
130
+ }, onClick: () => updateZoomLevel(0.3), children: (0, jsx_runtime_1.jsx)(ZoomInOutlined_1.default, {}) }), zoomLevel !== 1 && ((0, jsx_runtime_1.jsx)(Button_1.Button, { sx: {
131
+ backgroundColor: slate[900],
132
+ minWidth: "42px",
133
+ height: "42px",
134
+ }, onClick: () => resetZoomLevel(), children: "Reset" }))] }), (0, jsx_runtime_1.jsx)(material_1.Box, { ref: imageContainerRef, style: {
135
+ position: "relative",
136
+ width: "100%",
137
+ height: "100%",
138
+ cursor: isDragging ? "grabbing" : "grab",
139
+ transform: `scale(${zoomLevel}) translate(${positionX / zoomLevel}px, ${positionY / zoomLevel}px)`,
140
+ transformOrigin: "center center",
141
+ transition: isDragging ? "none" : "transform 0.2s ease-in-out",
142
+ }, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: endDrag, onMouseLeave: endDrag, onWheel: handleWheel, onDoubleClick: handleDoubleClick, children: (0, jsx_runtime_1.jsx)(image_1.default, { src: fileName, alt: "Attachment", fill: true, style: {
143
+ objectFit: "contain",
144
+ userSelect: "none",
145
+ pointerEvents: "none",
146
+ } }) })] }));
33
147
  }
34
148
  if (isFileType(fileName, exports.SUPPORTED_DOC_FORMATS) ||
35
149
  isFileType(fileName, exports.SUPPORTED_EXCEL_FORMATS)) {
@@ -17,7 +17,7 @@ const ViewFilePreviewDialog = ({ open, onClose, fileName, }) => {
17
17
  }, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "20px" }, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
18
18
  position: "relative",
19
19
  backgroundColor: iron[600],
20
- overflow: "none",
20
+ overflow: "hidden",
21
21
  maxHeight: "650px",
22
22
  boxShadow: "none",
23
23
  }, children: [(0, jsx_runtime_1.jsx)(Actions_1.DownloadIconAction
@@ -26,7 +26,7 @@ const ViewFilePreviewDialog = ({ open, onClose, fileName, }) => {
26
26
  // eslint-disable-next-line sonarjs/no-misused-promises
27
27
  onClick: () => (0, download_1.downloadFile)(fileName, fileName), sx: {
28
28
  position: "absolute",
29
- top: 10,
29
+ top: 5,
30
30
  right: 10,
31
31
  zIndex: 10,
32
32
  } }), (0, jsx_runtime_1.jsx)(FilePreview_1.FilePreview, { fileName: fileName })] }) }) }) }));
@@ -6,6 +6,7 @@ export * from "./Badge";
6
6
  export * from "./Breadcrumbs";
7
7
  export * from "./Button";
8
8
  export * from "./Card";
9
+ export * from "./CellSelectionTable";
9
10
  export * from "./Charts";
10
11
  export * from "./Chips";
11
12
  export * from "./ColumnArranger";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;A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;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
@@ -22,6 +22,7 @@ __exportStar(require("./Badge"), exports);
22
22
  __exportStar(require("./Breadcrumbs"), exports);
23
23
  __exportStar(require("./Button"), exports);
24
24
  __exportStar(require("./Card"), exports);
25
+ __exportStar(require("./CellSelectionTable"), exports);
25
26
  __exportStar(require("./Charts"), exports);
26
27
  __exportStar(require("./Chips"), exports);
27
28
  __exportStar(require("./ColumnArranger"), exports);
@@ -1,6 +1,6 @@
1
1
  export type WorkDayType = "present" | "holiday" | "weekly_off" | "working" | "first_half_off" | "second_half_off" | "full_day_weekly_off" | "first_half_weekly_off" | "second_half_weekly_off" | "paid_leave" | "absent" | "late_in_early_out" | "unpaid_leave" | "loss_of_pay" | "penalty" | "first_half_paid_leave" | "second_half_paid_leave" | "full_day_paid_leave" | "first_half_unpaid_leave" | "second_half_unpaid_leave" | "full_day_unpaid_leave" | "leave";
2
2
  export type WorkDayTypeShort = "P" | "H" | "WO" | "HO" | "FHWO" | "SHWO" | "PL" | "A" | "LIEO" | "UPL" | "PEN" | "LOP" | "L";
3
3
  export declare const serverityOptions: Record<WorkDayType, WorkDayTypeShort>;
4
- export declare const getColorByVariant: (variant: WorkDayType, type?: string) => string | undefined;
4
+ export declare const getColorByVariant: (variant: WorkDayType, type?: string) => string;
5
5
  export declare const getStatusLabel: (status: WorkDayType) => "Present" | "Absent" | "Weekly Off" | "Working" | "Holiday" | "Paid Leave" | "Unpaid Leave" | "First Half Weekly Off" | "Second Half Weekly Off" | "First Half Off" | "Second Half Off" | "Late In/Early Out" | "Loss of Pay" | "Penalty" | "First Half Paid Leave" | "Second Half Paid Leave" | "Full Day Paid Leave" | "First Half Unpaid Leave" | "Second Half Unpaid Leave" | "Full Day Unpaid Leave" | "Leave";
6
6
  //# sourceMappingURL=colorVariant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"colorVariant.d.ts","sourceRoot":"","sources":["../../src/utils/colorVariant.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,SAAS,GACT,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,iBAAiB,GACjB,qBAAqB,GACrB,uBAAuB,GACvB,wBAAwB,GACxB,YAAY,GACZ,QAAQ,GACR,mBAAmB,GACnB,cAAc,GACd,aAAa,GACb,SAAS,GACT,uBAAuB,GACvB,wBAAwB,GACxB,qBAAqB,GACrB,yBAAyB,GACzB,0BAA0B,GAC1B,uBAAuB,GACvB,OAAO,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GACxB,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,MAAM,GACN,IAAI,GACJ,GAAG,GACH,MAAM,GACN,KAAK,GACL,KAAK,GACL,KAAK,GACL,GAAG,CAAC;AAER,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAuBlE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,WAAW,EAAE,aAAa,uBA4EpE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,WAAW,wZAuEjD,CAAC"}
1
+ {"version":3,"file":"colorVariant.d.ts","sourceRoot":"","sources":["../../src/utils/colorVariant.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,SAAS,GACT,YAAY,GACZ,SAAS,GACT,gBAAgB,GAChB,iBAAiB,GACjB,qBAAqB,GACrB,uBAAuB,GACvB,wBAAwB,GACxB,YAAY,GACZ,QAAQ,GACR,mBAAmB,GACnB,cAAc,GACd,aAAa,GACb,SAAS,GACT,uBAAuB,GACvB,wBAAwB,GACxB,qBAAqB,GACrB,yBAAyB,GACzB,0BAA0B,GAC1B,uBAAuB,GACvB,OAAO,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GACxB,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,MAAM,GACN,IAAI,GACJ,GAAG,GACH,MAAM,GACN,KAAK,GACL,KAAK,GACL,KAAK,GACL,GAAG,CAAC;AAER,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,gBAAgB,CAuBlE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,WAAW,EAAE,aAAa,WA4EpE,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,WAAW,wZAuEjD,CAAC"}
@@ -1,20 +1,19 @@
1
1
  import type { Color } from "@mui/material";
2
- export type ColorShades = Partial<Color>;
3
2
  export type ColorPalette = {
4
- lightSlateBlue: ColorShades;
5
- lipstickRed: ColorShades;
6
- darkOrange: ColorShades;
7
- deepAqua: ColorShades;
8
- sapphireBlue: ColorShades;
9
- darkMint: ColorShades;
10
- butterflyBlue: ColorShades;
11
- orchid: ColorShades;
12
- mirage: ColorShades;
13
- iron: ColorShades;
14
- slate: ColorShades;
15
- red: ColorShades;
16
- lightBlue: ColorShades;
17
- black: ColorShades;
3
+ lightSlateBlue: Color;
4
+ lipstickRed: Color;
5
+ darkOrange: Color;
6
+ deepAqua: Color;
7
+ sapphireBlue: Color;
8
+ darkMint: Color;
9
+ butterflyBlue: Color;
10
+ orchid: Color;
11
+ mirage: Color;
12
+ iron: Color;
13
+ slate: Color;
14
+ red: Color;
15
+ lightBlue: Color;
16
+ black: Color;
18
17
  };
19
18
  export declare const colorPalette: ColorPalette;
20
19
  //# sourceMappingURL=colorPalette.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"colorPalette.d.ts","sourceRoot":"","sources":["../../../src/utils/theme/colorPalette.ts"],"names":[],"mappings":"A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AEF,eAAO,MAAM,YAAY,EAAE,YAiO1B,CAAC"}
@@ -9,7 +9,14 @@ exports.colorPalette = {
9
9
  600: "hsla(0, 0%, 100%, 1)", // white
10
10
  500: "hsla(218, 15%, 59%, 1)",
11
11
  400: "hsla(0, 0%, 18%, 1)",
12
- 300: "hsla(0, 0%, 0%, 0.35)", // shadow color
12
+ 300: "hsla(0, 0%, 0%, 0.35)",
13
+ 50: "hsla(0, 0%, 0%, 0)",
14
+ 100: "hsla(0, 0%, 0%, 0)",
15
+ 200: "hsla(0, 0%, 0%, 0)",
16
+ A100: "hsla(0, 0%, 0%, 0)",
17
+ A200: "hsla(0, 0%, 0%, 0)",
18
+ A400: "hsla(0, 0%, 0%, 0)",
19
+ A700: "hsla(0, 0%, 0%, 0)",
13
20
  },
14
21
  slate: {
15
22
  900: "hsla(212, 19%, 37%, 1)", // info
@@ -17,6 +24,15 @@ exports.colorPalette = {
17
24
  700: "hsl(193, 22%, 92%)",
18
25
  600: " hsl(0, 0%, 98%)",
19
26
  500: "hsl(0, 0%, 49%)",
27
+ 50: "hsla(0, 0%, 0%, 0)",
28
+ 100: "hsla(0, 0%, 0%, 0)",
29
+ 200: "hsla(0, 0%, 0%, 0)",
30
+ 300: "hsla(0, 0%, 0%, 0)",
31
+ 400: "hsla(0, 0%, 0%, 0)",
32
+ A100: "hsla(0, 0%, 0%, 0)",
33
+ A200: "hsla(0, 0%, 0%, 0)",
34
+ A400: "hsla(0, 0%, 0%, 0)",
35
+ A700: "hsla(0, 0%, 0%, 0)",
20
36
  },
21
37
  mirage: {
22
38
  900: "hsla(224, 35%, 12%, 1)", // primary
@@ -24,30 +40,79 @@ exports.colorPalette = {
24
40
  700: "hsla(226, 34%, 15%, 1)",
25
41
  600: "hsla(0, 0%, 22%, 0.7)",
26
42
  500: "hsla(0, 0%, 18%, 1)",
43
+ 50: "hsla(0, 0%, 0%, 0)",
44
+ 100: "hsla(0, 0%, 0%, 0)",
45
+ 200: "hsla(0, 0%, 0%, 0)",
46
+ 300: "hsla(0, 0%, 0%, 0)",
47
+ 400: "hsla(0, 0%, 0%, 0)",
48
+ A100: "hsla(0, 0%, 0%, 0)",
49
+ A200: "hsla(0, 0%, 0%, 0)",
50
+ A400: "hsla(0, 0%, 0%, 0)",
51
+ A700: "hsla(0, 0%, 0%, 0)",
27
52
  },
28
53
  lightSlateBlue: {
29
54
  900: "hsla(234, 99%, 68%, 1)",
30
55
  800: "hsla(234, 98%, 81%, 1)",
31
56
  700: "hsla(233, 100%, 94%, 1)",
32
57
  600: "hsla(236, 100%, 97%, 1)",
58
+ 50: "hsla(0, 0%, 0%, 0)",
59
+ 100: "hsla(0, 0%, 0%, 0)",
60
+ 200: "hsla(0, 0%, 0%, 0)",
61
+ 300: "hsla(0, 0%, 0%, 0)",
62
+ 400: "hsla(0, 0%, 0%, 0)",
63
+ 500: "hsla(0, 0%, 0%, 0)",
64
+ A100: "hsla(0, 0%, 0%, 0)",
65
+ A200: "hsla(0, 0%, 0%, 0)",
66
+ A400: "hsla(0, 0%, 0%, 0)",
67
+ A700: "hsla(0, 0%, 0%, 0)",
33
68
  },
34
69
  lipstickRed: {
35
70
  900: "hsla(349, 90%, 41%, 1)",
36
71
  800: "hsla(350, 63%, 64%, 1)",
37
72
  700: "hsla(349, 66%, 87%, 1)",
38
73
  600: "hsla(348, 100%, 95%, 1)",
74
+ 50: "hsla(0, 0%, 0%, 0)",
75
+ 100: "hsla(0, 0%, 0%, 0)",
76
+ 200: "hsla(0, 0%, 0%, 0)",
77
+ 300: "hsla(0, 0%, 0%, 0)",
78
+ 400: "hsla(0, 0%, 0%, 0)",
79
+ 500: "hsla(0, 0%, 0%, 0)",
80
+ A100: "hsla(0, 0%, 0%, 0)",
81
+ A200: "hsla(0, 0%, 0%, 0)",
82
+ A400: "hsla(0, 0%, 0%, 0)",
83
+ A700: "hsla(0, 0%, 0%, 0)",
39
84
  },
40
85
  darkOrange: {
41
86
  900: "hsla(32, 100%, 52%, 1)", //warning
42
87
  800: "hsla(32, 100%, 71%, 1)",
43
88
  700: "hsla(33, 100%, 90%, 1)",
44
89
  600: "hsla(33, 100%, 95%, 1)",
90
+ 50: "hsla(0, 0%, 0%, 0)",
91
+ 100: "hsla(0, 0%, 0%, 0)",
92
+ 200: "hsla(0, 0%, 0%, 0)",
93
+ 300: "hsla(0, 0%, 0%, 0)",
94
+ 400: "hsla(0, 0%, 0%, 0)",
95
+ 500: "hsla(0, 0%, 0%, 0)",
96
+ A100: "hsla(0, 0%, 0%, 0)",
97
+ A200: "hsla(0, 0%, 0%, 0)",
98
+ A400: "hsla(0, 0%, 0%, 0)",
99
+ A700: "hsla(0, 0%, 0%, 0)",
45
100
  },
46
101
  deepAqua: {
47
102
  900: "hsla(183, 87%, 27%, 1)",
48
103
  800: "hsla(184, 50%, 68%, 1)",
49
104
  700: "hsla(183, 68%, 79%, 1)",
50
105
  600: "hsla(183, 85%, 95%, 1)",
106
+ 50: "hsla(0, 0%, 0%, 0)",
107
+ 100: "hsla(0, 0%, 0%, 0)",
108
+ 200: "hsla(0, 0%, 0%, 0)",
109
+ 300: "hsla(0, 0%, 0%, 0)",
110
+ 400: "hsla(0, 0%, 0%, 0)",
111
+ 500: "hsla(0, 0%, 0%, 0)",
112
+ A100: "hsla(0, 0%, 0%, 0)",
113
+ A200: "hsla(0, 0%, 0%, 0)",
114
+ A400: "hsla(0, 0%, 0%, 0)",
115
+ A700: "hsla(0, 0%, 0%, 0)",
51
116
  },
52
117
  sapphireBlue: {
53
118
  900: "hsla(223, 59%, 49%, 1)",
@@ -57,12 +122,29 @@ exports.colorPalette = {
57
122
  500: "hsl(216, 100%, 91%)",
58
123
  400: " hsl(217, 100%, 95%)",
59
124
  300: " hsl(193, 22%, 92%)",
125
+ 50: "hsla(0, 0%, 0%, 0)",
126
+ 100: "hsla(0, 0%, 0%, 0)",
127
+ 200: "hsla(0, 0%, 0%, 0)",
128
+ A100: "hsla(0, 0%, 0%, 0)",
129
+ A200: "hsla(0, 0%, 0%, 0)",
130
+ A400: "hsla(0, 0%, 0%, 0)",
131
+ A700: "hsla(0, 0%, 0%, 0)",
60
132
  },
61
133
  darkMint: {
62
134
  900: "hsla(136, 59%, 49%, 1)",
63
135
  800: "hsla(136, 56%, 69%, 1)",
64
136
  700: "hsla(136, 58%, 90%, 1)",
65
137
  600: "hsla(133, 54%, 95%, 1)",
138
+ 50: "hsla(0, 0%, 0%, 0)",
139
+ 100: "hsla(0, 0%, 0%, 0)",
140
+ 200: "hsla(0, 0%, 0%, 0)",
141
+ 300: "hsla(0, 0%, 0%, 0)",
142
+ 400: "hsla(0, 0%, 0%, 0)",
143
+ 500: "hsla(0, 0%, 0%, 0)",
144
+ A100: "hsla(0, 0%, 0%, 0)",
145
+ A200: "hsla(0, 0%, 0%, 0)",
146
+ A400: "hsla(0, 0%, 0%, 0)",
147
+ A700: "hsla(0, 0%, 0%, 0)",
66
148
  },
67
149
  butterflyBlue: {
68
150
  900: "hsla(203, 79%, 57%, 1)", //secondary
@@ -72,23 +154,76 @@ exports.colorPalette = {
72
154
  500: "hsla(203, 82%, 96%, 1)",
73
155
  400: "hsla(208, 25%, 66%, 1)", //primary.light
74
156
  300: "hsla(207, 17%, 88%, 1)",
157
+ 50: "hsla(0, 0%, 0%, 0)",
158
+ 100: "hsla(0, 0%, 0%, 0)",
159
+ 200: "hsla(0, 0%, 0%, 0)",
160
+ A100: "hsla(0, 0%, 0%, 0)",
161
+ A200: "hsla(0, 0%, 0%, 0)",
162
+ A400: "hsla(0, 0%, 0%, 0)",
163
+ A700: "hsla(0, 0%, 0%, 0)",
75
164
  },
76
165
  orchid: {
77
166
  900: "hsla(295, 60%, 66%, 1)",
78
167
  800: "hsla(295, 61%, 80%, 1)",
79
168
  700: "hsla(297, 60%, 93%, 1)",
80
169
  600: "hsla(295, 65%, 97%, 1)",
170
+ 50: "hsla(0, 0%, 0%, 0)",
171
+ 100: "hsla(0, 0%, 0%, 0)",
172
+ 200: "hsla(0, 0%, 0%, 0)",
173
+ 300: "hsla(0, 0%, 0%, 0)",
174
+ 400: "hsla(0, 0%, 0%, 0)",
175
+ 500: "hsla(0, 0%, 0%, 0)",
176
+ A100: "hsla(0, 0%, 0%, 0)",
177
+ A200: "hsla(0, 0%, 0%, 0)",
178
+ A400: "hsla(0, 0%, 0%, 0)",
179
+ A700: "hsla(0, 0%, 0%, 0)",
81
180
  },
82
181
  red: {
83
182
  900: "hsla(0, 90%, 47%, 1)", //error
84
183
  800: "hsla(0, 73%, 59%, 1)",
85
184
  700: "hsla(0, 81%, 37%, 1)",
185
+ 50: "hsla(0, 0%, 0%, 0)",
186
+ 100: "hsla(0, 0%, 0%, 0)",
187
+ 200: "hsla(0, 0%, 0%, 0)",
188
+ 300: "hsla(0, 0%, 0%, 0)",
189
+ 400: "hsla(0, 0%, 0%, 0)",
190
+ 500: "hsla(0, 0%, 0%, 0)",
191
+ 600: "hsla(0, 0%, 0%, 0)",
192
+ A100: "hsla(0, 0%, 0%, 0)",
193
+ A200: "hsla(0, 0%, 0%, 0)",
194
+ A400: "hsla(0, 0%, 0%, 0)",
195
+ A700: "hsla(0, 0%, 0%, 0)",
86
196
  },
87
197
  lightBlue: {
88
198
  100: "hsla(193, 4%, 92%)",
89
199
  50: "hsla(193, 0%, 100%)",
200
+ 200: "hsla(0, 0%, 0%, 0)",
201
+ 300: "hsla(0, 0%, 0%, 0)",
202
+ 400: "hsla(0, 0%, 0%, 0)",
203
+ 500: "hsla(0, 0%, 0%, 0)",
204
+ 600: "hsla(0, 0%, 0%, 0)",
205
+ 700: "hsla(0, 0%, 0%, 0)",
206
+ 800: "hsla(0, 0%, 0%, 0)",
207
+ 900: "hsla(0, 0%, 0%, 0)",
208
+ A100: "hsla(0, 0%, 0%, 0)",
209
+ A200: "hsla(0, 0%, 0%, 0)",
210
+ A400: "hsla(0, 0%, 0%, 0)",
211
+ A700: "hsla(0, 0%, 0%, 0)",
90
212
  },
91
213
  black: {
92
214
  900: "hsl(0, 0%, 0%)",
215
+ 50: "hsla(0, 0%, 0%, 0)",
216
+ 100: "hsla(0, 0%, 0%, 0)",
217
+ 200: "hsla(0, 0%, 0%, 0)",
218
+ 300: "hsla(0, 0%, 0%, 0)",
219
+ 400: "hsla(0, 0%, 0%, 0)",
220
+ 500: "hsla(0, 0%, 0%, 0)",
221
+ 600: "hsla(0, 0%, 0%, 0)",
222
+ 700: "hsla(0, 0%, 0%, 0)",
223
+ 800: "hsla(0, 0%, 0%, 0)",
224
+ A100: "hsla(0, 0%, 0%, 0)",
225
+ A200: "hsla(0, 0%, 0%, 0)",
226
+ A400: "hsla(0, 0%, 0%, 0)",
227
+ A700: "hsla(0, 0%, 0%, 0)",
93
228
  },
94
229
  };
@@ -3,6 +3,6 @@ export declare const darkPalette: {
3
3
  color: import("./colorPalette").ColorPalette;
4
4
  paperBoxShadow: string;
5
5
  };
6
- divider: string | undefined;
6
+ divider: string;
7
7
  };
8
8
  //# sourceMappingURL=paletteDark.d.ts.map
@@ -11,7 +11,7 @@ export declare const getPaletteByTheme: (mode: PaletteMode) => {
11
11
  color: import("./colorPalette").ColorPalette;
12
12
  paperBoxShadow: string;
13
13
  };
14
- divider: string | undefined;
14
+ divider: string;
15
15
  mode: PaletteMode;
16
16
  } | {
17
17
  primary?: import("@mui/material").PaletteColorOptions;