@codezee/sixtify-brahma 0.2.88 → 0.2.90
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/dist/FormFields/FileUpload/Dialogs/FilePreview.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/FilePreview.js +9 -9
- package/packages/shared-components/dist/FormFields/Select/Select.d.ts +2 -1
- package/packages/shared-components/dist/FormFields/Select/Select.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/Select/Select.js +39 -20
- package/packages/shared-components/dist/Layouts/GridProvider.js +4 -4
- package/packages/shared-components/dist/Svgs/ArrowUpRight.d.ts +2 -0
- package/packages/shared-components/dist/Svgs/ArrowUpRight.d.ts.map +1 -0
- package/packages/shared-components/dist/Svgs/ArrowUpRight.js +6 -0
- package/packages/shared-components/dist/Svgs/index.d.ts +1 -0
- package/packages/shared-components/dist/Svgs/index.d.ts.map +1 -1
- package/packages/shared-components/dist/Svgs/index.js +1 -0
- package/packages/shared-components/dist/Tab/Skeleton.js +2 -1
- package/packages/shared-components/dist/utils/file.d.ts +0 -1
- package/packages/shared-components/dist/utils/file.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/file.js +0 -5
- package/packages/shared-components/dist/utils/theme/colorPalette.js +2 -2
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePreview.d.ts","sourceRoot":"","sources":["../../../../src/FormFields/FileUpload/Dialogs/FilePreview.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilePreview.d.ts","sourceRoot":"","sources":["../../../../src/FormFields/FileUpload/Dialogs/FilePreview.tsx"],"names":[],"mappings":"AAwBA,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"}
|
|
@@ -9,12 +9,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
9
9
|
const ZoomInOutlined_1 = __importDefault(require("@mui/icons-material/ZoomInOutlined"));
|
|
10
10
|
const ZoomOutOutlined_1 = __importDefault(require("@mui/icons-material/ZoomOutOutlined"));
|
|
11
11
|
const material_1 = require("@mui/material");
|
|
12
|
-
const image_1 = __importDefault(require("next/image"));
|
|
13
12
|
const react_1 = require("react");
|
|
14
13
|
const Button_1 = require("../../../Button");
|
|
15
14
|
const Layouts_1 = require("../../../Layouts");
|
|
16
15
|
const PadBox_1 = require("../../../PadBox");
|
|
17
|
-
const utils_1 = require("../../../utils");
|
|
18
16
|
exports.SUPPORTED_IMAGE_FORMATS = [".png", ".jpg", ".jpeg"];
|
|
19
17
|
exports.SUPPORTED_PDF_FORMATS = [".pdf"];
|
|
20
18
|
exports.SUPPORTED_DOC_FORMATS = [".doc", ".docx"];
|
|
@@ -29,7 +27,6 @@ function isFileType(url, extensions) {
|
|
|
29
27
|
return extensions.some((ext) => url.toLowerCase().endsWith(ext));
|
|
30
28
|
}
|
|
31
29
|
const FilePreview = ({ fileName, resetTrigger }) => {
|
|
32
|
-
const isValidUrl = (0, utils_1.isImageDomainValid)(fileName);
|
|
33
30
|
const [isDragging, setIsDragging] = (0, react_1.useState)(false);
|
|
34
31
|
const [position, setPosition] = (0, react_1.useState)({ x: 0, y: 0 });
|
|
35
32
|
const [startPos, setStartPos] = (0, react_1.useState)({ x: 0, y: 0 });
|
|
@@ -113,25 +110,25 @@ const FilePreview = ({ fileName, resetTrigger }) => {
|
|
|
113
110
|
if (isFileType(fileName, exports.SUPPORTED_PDF_FORMATS)) {
|
|
114
111
|
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%" } }) }));
|
|
115
112
|
}
|
|
116
|
-
if (isFileType(fileName, exports.SUPPORTED_IMAGE_FORMATS)
|
|
113
|
+
if (isFileType(fileName, exports.SUPPORTED_IMAGE_FORMATS)) {
|
|
117
114
|
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
115
|
position: "absolute",
|
|
119
116
|
top: 10,
|
|
120
117
|
right: 66,
|
|
121
118
|
zIndex: 10,
|
|
122
|
-
}, children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { sx: {
|
|
119
|
+
}, children: [zoomLevel !== 1 && ((0, jsx_runtime_1.jsx)(Button_1.Button, { sx: {
|
|
123
120
|
backgroundColor: slate[900],
|
|
124
121
|
minWidth: "42px",
|
|
125
122
|
height: "42px",
|
|
126
|
-
}, onClick: () =>
|
|
123
|
+
}, onClick: () => resetZoomLevel(), children: "Reset" })), (0, jsx_runtime_1.jsx)(Button_1.Button, { sx: {
|
|
127
124
|
backgroundColor: slate[900],
|
|
128
125
|
minWidth: "42px",
|
|
129
126
|
height: "42px",
|
|
130
|
-
}, onClick: () => updateZoomLevel(0.3), children: (0, jsx_runtime_1.jsx)(
|
|
127
|
+
}, onClick: () => updateZoomLevel(-0.3), children: (0, jsx_runtime_1.jsx)(ZoomOutOutlined_1.default, {}) }), (0, jsx_runtime_1.jsx)(Button_1.Button, { sx: {
|
|
131
128
|
backgroundColor: slate[900],
|
|
132
129
|
minWidth: "42px",
|
|
133
130
|
height: "42px",
|
|
134
|
-
}, onClick: () =>
|
|
131
|
+
}, onClick: () => updateZoomLevel(0.3), children: (0, jsx_runtime_1.jsx)(ZoomInOutlined_1.default, {}) })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { ref: imageContainerRef, style: {
|
|
135
132
|
position: "relative",
|
|
136
133
|
width: "100%",
|
|
137
134
|
height: "100%",
|
|
@@ -139,7 +136,10 @@ const FilePreview = ({ fileName, resetTrigger }) => {
|
|
|
139
136
|
transform: `scale(${zoomLevel}) translate(${positionX / zoomLevel}px, ${positionY / zoomLevel}px)`,
|
|
140
137
|
transformOrigin: "center center",
|
|
141
138
|
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)(
|
|
139
|
+
}, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: endDrag, onMouseLeave: endDrag, onWheel: handleWheel, onDoubleClick: handleDoubleClick, children: (0, jsx_runtime_1.jsx)("img", { src: fileName, alt: "Attachment", style: {
|
|
140
|
+
position: "absolute",
|
|
141
|
+
width: "100%",
|
|
142
|
+
height: "100%",
|
|
143
143
|
objectFit: "contain",
|
|
144
144
|
userSelect: "none",
|
|
145
145
|
pointerEvents: "none",
|
|
@@ -24,6 +24,7 @@ export type SelectProps<P extends FieldValues> = UseControllerProps<P> & Omit<Mu
|
|
|
24
24
|
renderOption?: (option: SelectOption, selected: boolean) => JSX.Element;
|
|
25
25
|
maxDisplayItems?: number;
|
|
26
26
|
disableClearable?: boolean;
|
|
27
|
+
setOnFinalChange?: boolean;
|
|
27
28
|
};
|
|
28
|
-
export declare function Select<P extends FieldValues>({ control, defaultValue, name, required, multiple, disabled, options, rules, loading, helperText, error, placeholder, isShowSelectAll, isShowAvatar, onAction, renderOption, maxLimit, maxDisplayItems, disableClearable, ...restProps }: SelectProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function Select<P extends FieldValues>({ control, defaultValue, name, required, multiple, disabled, options, rules, loading, helperText, error, placeholder, isShowSelectAll, isShowAvatar, onAction, renderOption, maxLimit, maxDisplayItems, disableClearable, setOnFinalChange, ...restProps }: SelectProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/FormFields/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAkBnE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AAOzB,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GACpE,IAAI,CACF,cAAc,EACd,MAAM,qBAAqB,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CACnE,GAAG;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,YAAY,EAA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,CAAC,CAAC,CAAC,2CAuWhB"}
|
|
@@ -11,7 +11,7 @@ const Actions_1 = require("../../Actions");
|
|
|
11
11
|
const Toast_1 = require("../../Toast");
|
|
12
12
|
const CheckBox_styled_1 = require("../CheckBox/CheckBox.styled");
|
|
13
13
|
const Select_styled_1 = require("./Select.styled");
|
|
14
|
-
function Select({ control, defaultValue, name, required = false, multiple = false, disabled = false, options = [], rules, loading = false, helperText, error, placeholder = "", isShowSelectAll = true, isShowAvatar = false, onAction, renderOption, maxLimit, maxDisplayItems = 2, disableClearable = required ? true : false, ...restProps }) {
|
|
14
|
+
function Select({ control, defaultValue, name, required = false, multiple = false, disabled = false, options = [], rules, loading = false, helperText, error, placeholder = "", isShowSelectAll = true, isShowAvatar = false, onAction, renderOption, maxLimit, maxDisplayItems = 2, disableClearable = required ? true : false, setOnFinalChange = false, ...restProps }) {
|
|
15
15
|
const { field: { onChange, value, ...restField }, } = (0, react_hook_form_1.useController)({
|
|
16
16
|
name,
|
|
17
17
|
control,
|
|
@@ -21,6 +21,8 @@ function Select({ control, defaultValue, name, required = false, multiple = fals
|
|
|
21
21
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
22
22
|
const theme = (0, material_1.useTheme)();
|
|
23
23
|
const { slate } = theme.palette.app.color;
|
|
24
|
+
const [pendingValue, setPendingValue] = (0, react_1.useState)(null);
|
|
25
|
+
const hasPendingChange = (0, react_1.useRef)(false);
|
|
24
26
|
const handleSelectAll = (isSelected) => {
|
|
25
27
|
if (isSelected) {
|
|
26
28
|
const allValues = options
|
|
@@ -90,10 +92,18 @@ function Select({ control, defaultValue, name, required = false, multiple = fals
|
|
|
90
92
|
transform: "scale(1)",
|
|
91
93
|
} }));
|
|
92
94
|
}
|
|
95
|
+
// eslint-disable-next-line sonarjs/function-return-type
|
|
96
|
+
const getDisplayValue = () => {
|
|
97
|
+
return setOnFinalChange && hasPendingChange.current ? pendingValue : value;
|
|
98
|
+
};
|
|
93
99
|
const renderMenuItems = () => {
|
|
94
100
|
const items = [];
|
|
101
|
+
const displayValue = getDisplayValue();
|
|
95
102
|
if (multiple && isShowSelectAll && options.length > 0) {
|
|
96
|
-
items.push((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { value: "select-all", children: [(0, jsx_runtime_1.jsx)(material_1.Checkbox, { icon: (0, jsx_runtime_1.jsx)(CheckBox_styled_1.BoxStyled, { size: "small" }), checkedIcon: (0, jsx_runtime_1.jsx)(CheckBox_styled_1.CheckStyled, { size: "small" }), indeterminate: !isAllSelected &&
|
|
103
|
+
items.push((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { value: "select-all", children: [(0, jsx_runtime_1.jsx)(material_1.Checkbox, { icon: (0, jsx_runtime_1.jsx)(CheckBox_styled_1.BoxStyled, { size: "small" }), checkedIcon: (0, jsx_runtime_1.jsx)(CheckBox_styled_1.CheckStyled, { size: "small" }), indeterminate: !isAllSelected &&
|
|
104
|
+
Array.isArray(displayValue) &&
|
|
105
|
+
displayValue.length > 0, checked: Array.isArray(displayValue) &&
|
|
106
|
+
displayValue.length === options.filter((o) => !o.disabled).length, sx: { marginRight: 1 } }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: "Select All" })] }, "select-all"));
|
|
97
107
|
items.push((0, jsx_runtime_1.jsx)(material_1.Divider, { sx: { margin: "0px !important" } }, "divider-select-all"));
|
|
98
108
|
}
|
|
99
109
|
Object.entries(groupedOptions).forEach(([groupName, groupOptions]) => {
|
|
@@ -102,34 +112,43 @@ function Select({ control, defaultValue, name, required = false, multiple = fals
|
|
|
102
112
|
}
|
|
103
113
|
groupOptions.forEach((option) => {
|
|
104
114
|
const isSelected = multiple
|
|
105
|
-
? Array.isArray(
|
|
106
|
-
:
|
|
115
|
+
? Array.isArray(displayValue) && displayValue.includes(option.value)
|
|
116
|
+
: displayValue === option.value;
|
|
107
117
|
items.push((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: option.value, disabled: option.disabled, children: renderOption ? (renderOption(option, isSelected)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [multiple && ((0, jsx_runtime_1.jsx)(material_1.Checkbox, { icon: (0, jsx_runtime_1.jsx)(CheckBox_styled_1.BoxStyled, { size: "small" }), checkedIcon: (0, jsx_runtime_1.jsx)(CheckBox_styled_1.CheckStyled, { size: "small" }), checked: isSelected, sx: { marginRight: 1 } })), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [isShowAvatar && option.avatar && ((0, jsx_runtime_1.jsx)(material_1.Avatar, { src: option.avatar, alt: option.label, sx: { width: 24, height: 24 } })), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: option.label })] })] })) }, option.value));
|
|
108
118
|
});
|
|
109
119
|
});
|
|
110
120
|
return items;
|
|
111
121
|
};
|
|
112
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Stack, { gap: "10px", children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", justifyContent: "space-between", gap: "10px", alignItems: "start", children: [(0, jsx_runtime_1.jsxs)(Select_styled_1.StyledFormControl, { fullWidth: true, error: error, disabled: disabled, required: required, children: [(0, jsx_runtime_1.jsx)(material_1.Select, { ...restField, ...restProps, multiple: multiple, value:
|
|
122
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Stack, { gap: "10px", children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", justifyContent: "space-between", gap: "10px", alignItems: "start", children: [(0, jsx_runtime_1.jsxs)(Select_styled_1.StyledFormControl, { fullWidth: true, error: error, disabled: disabled, required: required, children: [(0, jsx_runtime_1.jsx)(material_1.Select, { ...restField, ...restProps, multiple: multiple, value: getDisplayValue() ?? (multiple ? [] : ""), onChange: (event) => {
|
|
113
123
|
const newValue = event.target.value;
|
|
114
|
-
if (
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (isSelectAllIncluded) {
|
|
118
|
-
handleSelectAll(!isAllSelected);
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (maxLimit && newValue.length > maxLimit) {
|
|
122
|
-
Toast_1.toasts.error({
|
|
123
|
-
title: t("common.select.limitExceed", { maxLimit }),
|
|
124
|
-
});
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
onChange(newValue);
|
|
124
|
+
if (setOnFinalChange) {
|
|
125
|
+
hasPendingChange.current = true;
|
|
126
|
+
setPendingValue(newValue);
|
|
128
127
|
}
|
|
129
128
|
else {
|
|
129
|
+
// Existing logic unchanged
|
|
130
|
+
if (multiple && Array.isArray(newValue)) {
|
|
131
|
+
const isSelectAllIncluded = newValue.includes("select-all");
|
|
132
|
+
if (isSelectAllIncluded) {
|
|
133
|
+
handleSelectAll(!isAllSelected);
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (maxLimit && newValue.length > maxLimit) {
|
|
137
|
+
Toast_1.toasts.error({
|
|
138
|
+
title: t("common.select.limitExceed", { maxLimit }),
|
|
139
|
+
});
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
130
143
|
onChange(newValue);
|
|
131
144
|
}
|
|
132
|
-
},
|
|
145
|
+
}, onClose: () => {
|
|
146
|
+
if (setOnFinalChange && hasPendingChange.current) {
|
|
147
|
+
onChange(pendingValue);
|
|
148
|
+
hasPendingChange.current = false;
|
|
149
|
+
setPendingValue(null);
|
|
150
|
+
}
|
|
151
|
+
}, renderValue: restProps.renderValue ?? renderValue,
|
|
133
152
|
// eslint-disable-next-line sonarjs/no-unstable-nested-components
|
|
134
153
|
IconComponent: (props) => ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
135
154
|
display: "flex",
|
|
@@ -5,10 +5,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const GridProvider = ({ children, gap, columns = 3, columnsOnMobile = 1, columnsOnSmallDevice = 2, columnsOnTablet = 3, ...props }) => {
|
|
7
7
|
return ((0, jsx_runtime_1.jsx)(material_1.Stack, { ...props, display: "grid", gap: gap, gridTemplateColumns: {
|
|
8
|
-
xs: `repeat(${columnsOnMobile}, 1fr)`,
|
|
9
|
-
sm: `repeat(${Math.min(columns, columnsOnSmallDevice)}, 1fr)`,
|
|
10
|
-
md: `repeat(${Math.min(columns, columnsOnTablet)}, 1fr)`,
|
|
11
|
-
lg: `repeat(${columns}, 1fr)`,
|
|
8
|
+
xs: `repeat(${columnsOnMobile}, minmax(0, 1fr))`,
|
|
9
|
+
sm: `repeat(${Math.min(columns, columnsOnSmallDevice)}, minmax(0, 1fr))`,
|
|
10
|
+
md: `repeat(${Math.min(columns, columnsOnTablet)}, minmax(0, 1fr))`,
|
|
11
|
+
lg: `repeat(${columns}, minmax(0, 1fr))`,
|
|
12
12
|
}, children: children }));
|
|
13
13
|
};
|
|
14
14
|
exports.GridProvider = GridProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrowUpRight.d.ts","sourceRoot":"","sources":["../../src/Svgs/ArrowUpRight.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,+CAgBxB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrowUpRight = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ArrowUpRight = () => ((0, jsx_runtime_1.jsx)("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M6.41406 15.5837L15.5807 6.41699M15.5807 6.41699H6.41406M15.5807 6.41699V15.5837", stroke: "#93AABE", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
6
|
+
exports.ArrowUpRight = ArrowUpRight;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Svgs/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Svgs/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ArrowUpRight"), exports);
|
|
17
18
|
__exportStar(require("./AttendanceDashboard"), exports);
|
|
18
19
|
__exportStar(require("./Company"), exports);
|
|
19
20
|
__exportStar(require("./Drawer"), exports);
|
|
@@ -4,7 +4,8 @@ exports.Skeleton = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const Skeleton = () => {
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)(material_1.
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { flex: 1, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { height: "30px", sx: {
|
|
8
|
+
maxWidth: "200px",
|
|
8
9
|
transform: "scale(1)",
|
|
9
10
|
} }) }));
|
|
10
11
|
};
|
|
@@ -2,5 +2,4 @@ export type SupportedFileType = "image/png" | "image/jpeg" | "image/jpg" | "appl
|
|
|
2
2
|
export declare const SUPPORTED_FILE_TYPES: SupportedFileType[];
|
|
3
3
|
export declare const isFileSizeValid: (file: File, maxSizeMB: number) => boolean;
|
|
4
4
|
export declare const isFileTypeValid: (file: File, fileTypes: SupportedFileType[]) => boolean;
|
|
5
|
-
export declare function isImageDomainValid(url: string): boolean;
|
|
6
5
|
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/utils/file.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,oBAAoB,GACpB,8BAA8B,GAC9B,yEAAyE,GACzE,mEAAmE,GACnE,0BAA0B,CAAC;AAE/B,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EAWnD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,WAAW,MAAM,YAI5D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,WAAW,iBAAiB,EAAE,YAEzE,CAAC
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/utils/file.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GACzB,WAAW,GACX,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,iBAAiB,GACjB,oBAAoB,GACpB,8BAA8B,GAC9B,yEAAyE,GACzE,mEAAmE,GACnE,0BAA0B,CAAC;AAE/B,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,EAWnD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,WAAW,MAAM,YAI5D,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,IAAI,EAAE,WAAW,iBAAiB,EAAE,YAEzE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isFileTypeValid = exports.isFileSizeValid = exports.SUPPORTED_FILE_TYPES = void 0;
|
|
4
|
-
exports.isImageDomainValid = isImageDomainValid;
|
|
5
4
|
exports.SUPPORTED_FILE_TYPES = [
|
|
6
5
|
"image/png",
|
|
7
6
|
"image/jpeg",
|
|
@@ -23,7 +22,3 @@ const isFileTypeValid = (file, fileTypes) => {
|
|
|
23
22
|
return fileTypes.includes(file.type);
|
|
24
23
|
};
|
|
25
24
|
exports.isFileTypeValid = isFileTypeValid;
|
|
26
|
-
function isImageDomainValid(url) {
|
|
27
|
-
const parsedUrl = new URL(url);
|
|
28
|
-
return parsedUrl.hostname === "sixtify.s3.amazonaws.com";
|
|
29
|
-
}
|
|
@@ -28,7 +28,7 @@ exports.colorPalette = {
|
|
|
28
28
|
100: "hsla(0, 0%, 0%, 0)",
|
|
29
29
|
200: "hsla(0, 0%, 0%, 0)",
|
|
30
30
|
300: "hsla(0, 0%, 0%, 0)",
|
|
31
|
-
400: "hsla(
|
|
31
|
+
400: "hsla(212, 18%, 47%, 1)",
|
|
32
32
|
A100: "hsla(0, 0%, 0%, 0)",
|
|
33
33
|
A200: "hsla(0, 0%, 0%, 0)",
|
|
34
34
|
A400: "hsla(0, 0%, 0%, 0)",
|
|
@@ -155,7 +155,7 @@ exports.colorPalette = {
|
|
|
155
155
|
400: "hsla(208, 25%, 66%, 1)", //primary.light
|
|
156
156
|
300: "hsla(207, 17%, 88%, 1)",
|
|
157
157
|
50: "hsla(209, 83%, 53%, 1)",
|
|
158
|
-
100: "hsla(
|
|
158
|
+
100: "hsla(209, 24%, 83%, 1)",
|
|
159
159
|
200: "hsla(0, 0%, 0%, 0)",
|
|
160
160
|
A100: "hsla(0, 0%, 0%, 0)",
|
|
161
161
|
A200: "hsla(0, 0%, 0%, 0)",
|