sea-react-components 1.3.0 → 1.3.2

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 (47) hide show
  1. package/dist/HOC/can-access-application/index.js +1 -1
  2. package/dist/HOC/with-authorization/index.js +1 -1
  3. package/dist/components/{auto-complete-Input → auto-complete-input}/index.js +5 -17
  4. package/dist/components/avatar/index.js +2 -14
  5. package/dist/components/button/index.js +2 -14
  6. package/dist/components/color-picker/index.js +2 -14
  7. package/dist/components/file-input/index.js +22 -20
  8. package/dist/components/input/index.js +2 -14
  9. package/dist/components/list-item/index.js +1 -1
  10. package/dist/components/menu/index.js +2 -14
  11. package/dist/components/menu/menu-item/index.js +2 -14
  12. package/dist/components/modal/index.js +3 -15
  13. package/dist/components/month-calendar/index.js +4 -1
  14. package/dist/components/native-menu/index.d.ts +11 -0
  15. package/dist/components/native-menu/index.d.ts.map +1 -0
  16. package/dist/components/native-menu/index.js +46 -0
  17. package/dist/components/native-menu/native-menu-item/index.d.ts +10 -0
  18. package/dist/components/native-menu/native-menu-item/index.d.ts.map +1 -0
  19. package/dist/components/native-menu/native-menu-item/index.js +6 -0
  20. package/dist/components/notifications-menu/index.d.ts +10 -0
  21. package/dist/components/notifications-menu/index.d.ts.map +1 -0
  22. package/dist/components/notifications-menu/index.js +143 -0
  23. package/dist/components/paper/index.js +2 -14
  24. package/dist/components/progress-bar/index.js +3 -15
  25. package/dist/components/radio-button/index.js +2 -14
  26. package/dist/components/search-input/index.js +2 -14
  27. package/dist/components/skeleton/index.js +2 -14
  28. package/dist/components/stacked-avatars/index.js +1 -1
  29. package/dist/components/table/index.js +4 -15
  30. package/dist/components/textarea/index.js +2 -14
  31. package/dist/components/tree-checkbox/index.js +16 -5
  32. package/dist/index.d.ts +3 -0
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +3 -0
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/dist/utils/axios/index.d.ts +2 -1
  37. package/dist/utils/axios/index.d.ts.map +1 -1
  38. package/dist/utils/axios/index.js +1 -0
  39. package/dist/utils/validation/index.d.ts +1 -0
  40. package/dist/utils/validation/index.d.ts.map +1 -1
  41. package/dist/utils/validation/index.js +2 -1
  42. package/package.json +2 -2
  43. package/dist/components/list-item/components/search-input/index.d.ts +0 -7
  44. package/dist/components/list-item/components/search-input/index.d.ts.map +0 -1
  45. package/dist/components/list-item/components/search-input/index.js +0 -38
  46. /package/dist/components/{auto-complete-Input → auto-complete-input}/index.d.ts +0 -0
  47. /package/dist/components/{auto-complete-Input → auto-complete-input}/index.d.ts.map +0 -0
@@ -6,6 +6,6 @@ export default function CanAccessApplication(WrappedComponent, { applicationKey,
6
6
  const canAccess = hasApplicationAccess(applicationKey);
7
7
  if (!canAccess)
8
8
  return _jsx(_Fragment, { children: fallback });
9
- return _jsx(WrappedComponent, Object.assign({}, props));
9
+ return _jsx(WrappedComponent, { ...props });
10
10
  };
11
11
  }
@@ -6,7 +6,7 @@ export default function WithAuthorization(WrappedComponent, { requiredPermission
6
6
  const isAuthorized = validatePermissions(requiredPermissions, strategy, hasPermission);
7
7
  if (!isAuthorized)
8
8
  return _jsx(_Fragment, { children: fallback });
9
- return _jsx(WrappedComponent, Object.assign({}, props));
9
+ return _jsx(WrappedComponent, { ...props });
10
10
  };
11
11
  }
12
12
  function validatePermissions(requiredPermissions, strategy, hasPermission) {
@@ -1,25 +1,13 @@
1
1
  "use client";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
3
  import { useState, useRef, useEffect } from "react";
15
4
  import SearchInput from "../search-input";
16
5
  import clsx from "clsx";
17
6
  import Loader from "../loader";
18
- export default function AutoCompleteInput(_a) {
19
- var _b;
20
- var { name, options, selectedOptions = [], setSelectedOptions, onOptionSelect, value, onChange, onDebouncedChange, loading = false, multiselect = true, renderSelectedOptions, renderContainer } = _a, rest = __rest(_a, ["name", "options", "selectedOptions", "setSelectedOptions", "onOptionSelect", "value", "onChange", "onDebouncedChange", "loading", "multiselect", "renderSelectedOptions", "renderContainer"]);
7
+ export default function AutoCompleteInput({ name, options, selectedOptions = [], setSelectedOptions, onOptionSelect, value, onChange, onDebouncedChange, loading = false, multiselect = true, renderSelectedOptions, renderContainer, ...rest }) {
8
+ var _a;
21
9
  const [show, setShow] = useState(false);
22
- const [inputValue, setInputValue] = useState((_b = value === null || value === void 0 ? void 0 : value.toString()) !== null && _b !== void 0 ? _b : "");
10
+ const [inputValue, setInputValue] = useState((_a = value === null || value === void 0 ? void 0 : value.toString()) !== null && _a !== void 0 ? _a : "");
23
11
  const containerRef = useRef(null);
24
12
  useEffect(() => {
25
13
  const handler = (e) => {
@@ -67,13 +55,13 @@ export default function AutoCompleteInput(_a) {
67
55
  var _a;
68
56
  setInputValue((_a = value === null || value === void 0 ? void 0 : value.toString()) !== null && _a !== void 0 ? _a : "");
69
57
  }, [value]);
70
- const input = (_jsx(SearchInput, Object.assign({ name: name, value: inputValue, onFocus: () => setShow(true), onChange: (e) => {
58
+ const input = (_jsx(SearchInput, { name: name, value: inputValue, onFocus: () => setShow(true), onChange: (e) => {
71
59
  setInputValue(e.target.value);
72
60
  onChange === null || onChange === void 0 ? void 0 : onChange(e);
73
61
  }, onDebouncedChange: (val) => {
74
62
  setShow(true);
75
63
  onDebouncedChange === null || onDebouncedChange === void 0 ? void 0 : onDebouncedChange(val);
76
- }, autoComplete: "off" }, rest)));
64
+ }, autoComplete: "off", ...rest }));
77
65
  const dropdown = show && inputValue.trim() !== "" ? (_jsx("div", { className: "absolute z-10 w-full mt-1 bg-white border rounded shadow max-h-60 overflow-y-auto", children: loading ? (_jsx("div", { className: "p-4 flex justify-center items-center", children: _jsx(Loader, {}) })) : filteredOptions.length > 0 ? (filteredOptions.map((o, i) => (_jsx("div", { className: clsx("px-4 py-2 cursor-pointer custom-animation hover:bg-primary hover:bg-opacity-20"), onClick: () => handleSelect(o), children: o.label }, `${name}-option-${i}`)))) : (_jsx("div", { className: "p-4 text-center text-gray-400", children: "No options found" })) })) : null;
78
66
  const selected = selectedOptions.length
79
67
  ? renderSelectedOptions === null || renderSelectedOptions === void 0 ? void 0 : renderSelectedOptions(selectedOptions)
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
2
  import clsx from "clsx";
14
3
  import { PROFILE_PLACEHOLDER_IMAGE } from "../../constants/index";
@@ -27,13 +16,12 @@ const textSizeClasses = {
27
16
  lg: "text-base",
28
17
  xl: "text-base",
29
18
  };
30
- export default function Avatar(_a) {
31
- var { url, alt, size = "md", placeholder = PROFILE_PLACEHOLDER_IMAGE, className, placeholderSource = "image" } = _a, props = __rest(_a, ["url", "alt", "size", "placeholder", "className", "placeholderSource"]);
19
+ export default function Avatar({ url, alt, size = "md", placeholder = PROFILE_PLACEHOLDER_IMAGE, className, placeholderSource = "image", ...props }) {
32
20
  const sizeValue = sizeValues[size];
33
21
  const textClass = textSizeClasses[size];
34
22
  if (!url && placeholderSource === "letters")
35
23
  return (_jsx("div", { style: { width: sizeValue, height: sizeValue }, className: "flex items-center justify-center rounded-full bg-gray-100 border-[1px] border-gray-200", children: _jsxs("p", { className: textClass, children: [" ", Utils.String.getInitials(alt)] }) }));
36
24
  if (!url && placeholderSource === "image")
37
25
  url = url || placeholder;
38
- return (_jsx("img", Object.assign({}, props, { src: url, alt: alt, width: sizeValue, height: sizeValue, className: clsx("object-cover rounded-full border-[1px] border-gray-400", className) })));
26
+ return (_jsx("img", { ...props, src: url, alt: alt, width: sizeValue, height: sizeValue, className: clsx("object-cover rounded-full border-[1px] border-gray-400", className) }));
39
27
  }
@@ -1,18 +1,6 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import clsx from "clsx";
14
3
  import { Icon } from "@iconify/react";
15
- export default function Button(_a) {
16
- var { loading = false, disabled, className, children } = _a, props = __rest(_a, ["loading", "disabled", "className", "children"]);
17
- return (_jsx("button", Object.assign({ className: clsx("px-2 py-1 rounded-lg disabled:bg-gray-200 text-white transition-all duration-300 ease-in-out flex items-center justify-center", !loading && !disabled && "hover:bg-opacity-70", className ? className : "bg-primary", disabled && "bg-gray-300"), disabled: disabled }, props, { children: loading ? (_jsx(Icon, { icon: "line-md:loading-loop", className: "w-6 h-6" })) : (children) })));
4
+ export default function Button({ loading = false, disabled, className, children, ...props }) {
5
+ return (_jsx("button", { className: clsx("px-2 py-1 rounded-lg disabled:bg-gray-200 text-white transition-all duration-300 ease-in-out flex items-center justify-center", !loading && !disabled && "hover:bg-opacity-70", className ? className : "bg-primary", disabled && "bg-gray-300"), disabled: disabled, ...props, children: loading ? (_jsx(Icon, { icon: "line-md:loading-loop", className: "w-6 h-6" })) : (children) }));
18
6
  }
@@ -1,22 +1,10 @@
1
1
  "use client";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
3
  import { isColorLight } from "../../utils/color";
15
- export default function ColorPicker(_a) {
16
- var { color, setColor, showDisplay = true, className = "", style } = _a, props = __rest(_a, ["color", "setColor", "showDisplay", "className", "style"]);
4
+ export default function ColorPicker({ color, setColor, showDisplay = true, className = "", style, ...props }) {
17
5
  return (_jsxs("label", { className: `relative inline-block overflow-hidden ${className}`, style: style, children: [showDisplay && (_jsx("div", { className: "w-full h-full flex items-center justify-center", style: {
18
6
  backgroundColor: color,
19
7
  color: isColorLight(color) ? "#000000" : "#FFFFFF",
20
8
  borderRadius: "inherit",
21
- }, children: _jsx("p", { className: "text-xs", children: color }) })), _jsx("input", Object.assign({ type: "color", className: "absolute inset-0 w-full h-full opacity-0 appearance-none cursor-pointer", value: color, onChange: (e) => setColor(e.target.value) }, props))] }));
9
+ }, children: _jsx("p", { className: "text-xs", children: color }) })), _jsx("input", { type: "color", className: "absolute inset-0 w-full h-full opacity-0 appearance-none cursor-pointer", value: color, onChange: (e) => setColor(e.target.value), ...props })] }));
22
10
  }
@@ -1,13 +1,4 @@
1
1
  "use client";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
12
3
  import { useEffect, useRef, useState } from "react";
13
4
  export var AcceptedTypes;
@@ -49,39 +40,50 @@ export default function FileInput({ name, acceptedTypes = [], initialFiles = [],
49
40
  setFiles((prev) => [...prev, ...newFiles]);
50
41
  newFiles.forEach(handleUploadFile);
51
42
  };
52
- const handleUploadFile = (file) => __awaiter(this, void 0, void 0, function* () {
53
- setFiles((prev) => prev.map((f) => f.id === file.id ? Object.assign(Object.assign({}, f), { status: UploadStatuses.Uploading }) : f));
43
+ const handleUploadFile = async (file) => {
44
+ setFiles((prev) => prev.map((f) => f.id === file.id ? { ...f, status: UploadStatuses.Uploading } : f));
54
45
  try {
55
- const result = yield onUpload(file);
46
+ const result = await onUpload(file);
56
47
  onUploadSuccess === null || onUploadSuccess === void 0 ? void 0 : onUploadSuccess(result); // This allows parent to set `iconFileId`
57
48
  // For single-file mode: remove old uploaded file if any
58
49
  if (!multiple) {
59
- const uploadedFile = Object.assign(Object.assign({}, file), { serverId: result.id, status: UploadStatuses.Uploaded, progress: 100 });
50
+ const uploadedFile = {
51
+ ...file,
52
+ serverId: result.id,
53
+ status: UploadStatuses.Uploaded,
54
+ progress: 100,
55
+ };
60
56
  const oldUploaded = files.find((f) => f.status === UploadStatuses.Uploaded);
61
57
  // Delete old uploaded file
62
58
  if (oldUploaded && oldUploaded.serverId) {
63
- yield onDelete(oldUploaded);
59
+ await onDelete(oldUploaded);
64
60
  onDeleteSuccess === null || onDeleteSuccess === void 0 ? void 0 : onDeleteSuccess(oldUploaded);
65
61
  }
66
62
  setFiles([uploadedFile]); // Keep only the new one
67
63
  }
68
64
  else {
69
65
  setFiles((prev) => prev.map((f) => f.id === file.id
70
- ? Object.assign(Object.assign({}, f), { serverId: result.id, status: UploadStatuses.Uploaded, progress: 100 }) : f));
66
+ ? {
67
+ ...f,
68
+ serverId: result.id,
69
+ status: UploadStatuses.Uploaded,
70
+ progress: 100,
71
+ }
72
+ : f));
71
73
  }
72
74
  }
73
75
  catch (_a) {
74
- setFiles((prev) => prev.map((f) => f.id === file.id ? Object.assign(Object.assign({}, f), { status: UploadStatuses.Failed }) : f));
76
+ setFiles((prev) => prev.map((f) => f.id === file.id ? { ...f, status: UploadStatuses.Failed } : f));
75
77
  }
76
- });
77
- const handleDeleteFile = (file) => __awaiter(this, void 0, void 0, function* () {
78
+ };
79
+ const handleDeleteFile = async (file) => {
78
80
  try {
79
- const result = yield onDelete(file);
81
+ const result = await onDelete(file);
80
82
  onDeleteSuccess === null || onDeleteSuccess === void 0 ? void 0 : onDeleteSuccess(result);
81
83
  setFiles((prev) => prev.filter((f) => f.serverId !== result.id));
82
84
  }
83
85
  catch (_a) { }
84
- });
86
+ };
85
87
  useEffect(() => {
86
88
  if (initialFiles && initialFiles.length > 0) {
87
89
  setFiles(initialFiles);
@@ -1,21 +1,9 @@
1
1
  "use client";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
3
  import { Icon } from "@iconify/react";
15
4
  import clsx from "clsx";
16
5
  import { useState } from "react";
17
- export default function Input(_a) {
18
- var { errorMessage, className, start = null, end = null, ref, type } = _a, props = __rest(_a, ["errorMessage", "className", "start", "end", "ref", "type"]);
6
+ export default function Input({ errorMessage, className, start = null, end = null, ref, type, ...props }) {
19
7
  const [isFocused, setIsFocused] = useState(false);
20
8
  const [currentType, setCurrentType] = useState(type);
21
9
  if (type === "password") {
@@ -29,5 +17,5 @@ export default function Input(_a) {
29
17
  ? "border-error"
30
18
  : isFocused
31
19
  ? "border-primary"
32
- : "border-gray-200"), children: [start, _jsx("input", Object.assign({ ref: ref, type: currentType, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), className: clsx("outline-none text-text flex-1", className) }, props)), end] }), errorMessage && (_jsx("p", { className: "pl-1 text-sm text-error", children: errorMessage }))] }));
20
+ : "border-gray-200"), children: [start, _jsx("input", { ref: ref, type: currentType, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), className: clsx("outline-none text-text flex-1", className), ...props }), end] }), errorMessage && (_jsx("p", { className: "pl-1 text-sm text-error", children: errorMessage }))] }));
33
21
  }
@@ -19,5 +19,5 @@ export default function ListItem({ title, name, filters = [], totalPages, query,
19
19
  : "justify-end"), children: [showFiltersRow && (_jsxs("div", { className: "flex items-end gap-2 flex-wrap", children: [_jsx(SearchInput, { placeholder: `search about ${name}`, value: query, onDebouncedChange: setQuery, QueryDebouncedTime: QueryDebouncedTime }), filters.map((f, i) => (_jsxs("div", { className: "flex flex-col gap-1", children: [f.label && (_jsx("p", { className: "text-text font-semibold", children: f.label })), _jsx(Select, { name: `table-${name}-filter-${f.label}-${i}`, values: [f.value], setValues: (newValues) => f.setValue(newValues[0]), options: [
20
20
  { label: "All", value: DEFAULT_FILTER_VALUE },
21
21
  ...f.options,
22
- ], placeholder: f.label })] }, `table-${name}-filter-${f.label}-${i}`)))] })), bulkActionFeature && (_jsx("div", { className: "flex items-center gap-2 justify-end w-full md:w-fit", children: bulkActionFeature.bulkActions.map((a, i) => (_jsx(Button, Object.assign({}, a, { disabled: bulkActionFeature.selectedRowIds.length === 0 }), `table-${name}-bulk-action-${i}`))) }))] }), _jsx("div", { className: "overflow-x-auto", children: loading ? (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Loader, {}) })) : (_jsx(_Fragment, { children: children })) }), showPaginationRow && (_jsxs("div", { className: "flex items-center justify-end gap-5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "text-text text-sm", children: "Rows per page" }), _jsx(Select, { name: `${name}-select`, values: [rowsPerPage], setValues: (newValues) => setRowsPerPage(newValues[0]), options: rowsPerPageOptions })] }), totalPages >= 1 && (_jsx(Pagination, { name: name, page: page, setPage: setPage, totalPages: totalPages }))] }))] }));
22
+ ], placeholder: f.label })] }, `table-${name}-filter-${f.label}-${i}`)))] })), bulkActionFeature && (_jsx("div", { className: "flex items-center gap-2 justify-end w-full md:w-fit", children: bulkActionFeature.bulkActions.map((a, i) => (_jsx(Button, { ...a, disabled: bulkActionFeature.selectedRowIds.length === 0 }, `table-${name}-bulk-action-${i}`))) }))] }), _jsx("div", { className: "overflow-x-auto", children: loading ? (_jsx("div", { className: "flex items-center justify-center", children: _jsx(Loader, {}) })) : (_jsx(_Fragment, { children: children })) }), showPaginationRow && (_jsxs("div", { className: "flex items-center justify-end gap-5", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "text-text text-sm", children: "Rows per page" }), _jsx(Select, { name: `${name}-select`, values: [rowsPerPage], setValues: (newValues) => setRowsPerPage(newValues[0]), options: rowsPerPageOptions })] }), totalPages >= 1 && (_jsx(Pagination, { name: name, page: page, setPage: setPage, totalPages: totalPages }))] }))] }));
23
23
  }
@@ -1,19 +1,7 @@
1
1
  "use client";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  import { jsx as _jsx } from "react/jsx-runtime";
14
3
  import { Menu as SMenu, MenuButton } from "@szhsin/react-menu";
15
4
  import clsx from "clsx";
16
- export default function Menu(_a) {
17
- var { menuButton, children, className } = _a, props = __rest(_a, ["menuButton", "children", "className"]);
18
- return (_jsx(SMenu, Object.assign({ menuButton: _jsx(MenuButton, { children: menuButton }) }, props, { children: _jsx("div", { className: clsx("bg-white rounded-xl shadow-lg", className), children: children }) })));
5
+ export default function Menu({ menuButton, children, className, ...props }) {
6
+ return (_jsx(SMenu, { menuButton: _jsx(MenuButton, { children: menuButton }), ...props, children: _jsx("div", { className: clsx("bg-white rounded-xl shadow-lg", className), children: children }) }));
19
7
  }
@@ -1,19 +1,7 @@
1
1
  "use client";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  import { jsx as _jsx } from "react/jsx-runtime";
14
3
  import clsx from "clsx";
15
4
  import { MenuItem as SMenuItem } from "@szhsin/react-menu";
16
- export default function MenuItem(_a) {
17
- var { children, className, selected = false, disabled = false } = _a, props = __rest(_a, ["children", "className", "selected", "disabled"]);
18
- return (_jsx("div", Object.assign({ className: clsx("rounded-md transition-all duration-300 ease-in-out", selected && "bg-primary", !disabled ? "hover:bg-primary hover:bg-opacity-50" : "bg-gray-200", className) }, props, { children: _jsx(SMenuItem, { disabled: disabled, children: children }) })));
5
+ export default function MenuItem({ children, className, selected = false, disabled = false, ...props }) {
6
+ return (_jsx("div", { className: clsx("rounded-md transition-all duration-300 ease-in-out", selected && "bg-primary", !disabled ? "hover:bg-primary hover:bg-opacity-50" : "bg-gray-200", className), ...props, children: _jsx(SMenuItem, { disabled: disabled, children: children }) }));
19
7
  }
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
2
  import { Icon } from "@iconify/react";
14
3
  import clsx from "clsx";
@@ -29,15 +18,14 @@ const positionClasses = {
29
18
  left: "top-1/2 left-5 transform -translate-y-1/2",
30
19
  right: "top-1/2 right-5 transform -translate-y-1/2",
31
20
  };
32
- export default function Modal(_a) {
33
- var { isOpen, onClose, children, position = "center", size = "md", overlayPercentage = 50, className, onClick } = _a, props = __rest(_a, ["isOpen", "onClose", "children", "position", "size", "overlayPercentage", "className", "onClick"]);
21
+ export default function Modal({ isOpen, onClose, children, position = "center", size = "md", overlayPercentage = 50, className, onClick, ...props }) {
34
22
  if (!isOpen)
35
23
  return null;
36
24
  return (_jsx("div", { className: "fixed inset-0 bg-black z-50 overflow-auto animate-fade-in", style: {
37
25
  backgroundColor: `rgba(0,0,0,0.${overlayPercentage})`,
38
- }, onClick: onClose, children: _jsxs("div", Object.assign({ className: clsx("absolute bg-white rounded-lg shadow-lg p-6 max-h-[90vh] overflow-y-auto ", sizeClasses[size], positionClasses[position], className), onClick: (e) => {
26
+ }, onClick: onClose, children: _jsxs("div", { className: clsx("absolute bg-white rounded-lg shadow-lg p-6 max-h-[90vh] overflow-y-auto ", sizeClasses[size], positionClasses[position], className), onClick: (e) => {
39
27
  e.stopPropagation(); // Prevent closing when clicking inside the modal
40
28
  if (onClick)
41
29
  onClick(e);
42
- } }, props, { children: [_jsx("button", { onClick: onClose, className: "absolute top-2 right-2 text-primary", children: _jsx(Icon, { icon: "line-md:close-small", className: "h-5 w-5 hover:scale-110 transition-all duration-300 ease-in-out" }) }), children] })) }));
30
+ }, ...props, children: [_jsx("button", { onClick: onClose, className: "absolute top-2 right-2 text-primary", children: _jsx(Icon, { icon: "line-md:close-small", className: "h-5 w-5 hover:scale-110 transition-all duration-300 ease-in-out" }) }), children] }) }));
43
31
  }
@@ -52,6 +52,9 @@ export default function MonthCalendar({ month, events, EventItem, loading, optio
52
52
  const expanded = expandStatus[day] === true;
53
53
  return (_jsxs("div", { className: "flex flex-col gap-3 border-[1px] border-gray-200 p-1", children: [_jsx("p", { className: "text-left text-primary font-semibold", children: dayItem.date() }), _jsx("div", { className: "flex flex-col gap-1", children: loading ? (_jsx(_Fragment, { children: Array(Utils.Number.getRandomInt(0, 2))
54
54
  .fill({})
55
- .map((_, j) => (_jsx(Skeleton, { className: "w-full h-20" }, `${day}-(${j})`))) })) : (_jsxs(_Fragment, { children: [" ", (expanded ? dayEvents : dayEventsSlice).map((e, j) => (_jsx(EventItem, { event: e }, `${i}-${j}`))), moreCounts > 0 && !expanded && (_jsxs("button", { onClick: () => setExpandStatus((prev) => (Object.assign(Object.assign({}, prev), { [day]: true }))), className: "text-left text-sm text-primary hover:text-opacity-70", children: ["+", moreCounts, " more"] }))] })) })] }, i));
55
+ .map((_, j) => (_jsx(Skeleton, { className: "w-full h-20" }, `${day}-(${j})`))) })) : (_jsxs(_Fragment, { children: [" ", (expanded ? dayEvents : dayEventsSlice).map((e, j) => (_jsx(EventItem, { event: e }, `${i}-${j}`))), moreCounts > 0 && !expanded && (_jsxs("button", { onClick: () => setExpandStatus((prev) => ({
56
+ ...prev,
57
+ [day]: true,
58
+ })), className: "text-left text-sm text-primary hover:text-opacity-70", children: ["+", moreCounts, " more"] }))] })) })] }, i));
56
59
  }) }, currentMonth.format("YYYY-MM"))] }));
57
60
  }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ export type MenuSize = "sm" | "md" | "lg" | "xl";
3
+ export type Props = {
4
+ menuButton: React.ReactNode;
5
+ children: React.ReactNode;
6
+ size?: MenuSize;
7
+ maxHeight?: number;
8
+ onReachBottom?: () => void;
9
+ } & React.HTMLAttributes<HTMLDivElement>;
10
+ export default function NativeMenu({ menuButton, children, className, size, maxHeight, onReachBottom, ...props }: Props): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/native-menu/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAGpE,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AASjD,MAAM,MAAM,KAAK,GAAG;IAClB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,UAAU,EACV,QAAQ,EACR,SAAS,EACT,IAAW,EACX,SAAe,EACf,aAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,2CA+DP"}
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import clsx from "clsx";
5
+ const sizeClasses = {
6
+ sm: "w-52",
7
+ md: "w-72",
8
+ lg: "w-80",
9
+ xl: "w-96",
10
+ };
11
+ export default function NativeMenu({ menuButton, children, className, size = "md", maxHeight = 200, onReachBottom, ...props }) {
12
+ const [open, setOpen] = useState(false);
13
+ const menuRef = useRef(null);
14
+ const scrollRef = useRef(null);
15
+ // Close menu on outside click
16
+ useEffect(() => {
17
+ const handleClickOutside = (event) => {
18
+ if (menuRef.current && !menuRef.current.contains(event.target)) {
19
+ setOpen(false);
20
+ }
21
+ };
22
+ document.addEventListener("mousedown", handleClickOutside);
23
+ return () => document.removeEventListener("mousedown", handleClickOutside);
24
+ }, []);
25
+ const checkBottom = () => {
26
+ const target = scrollRef.current;
27
+ if (!target)
28
+ return false;
29
+ return target.scrollHeight - target.scrollTop <= target.clientHeight + 1;
30
+ };
31
+ const handleScroll = (e) => {
32
+ if (checkBottom() && onReachBottom) {
33
+ onReachBottom();
34
+ }
35
+ };
36
+ // Trigger onReachBottom when menu opens if already at bottom
37
+ useEffect(() => {
38
+ if (open && onReachBottom && checkBottom()) {
39
+ onReachBottom();
40
+ }
41
+ }, [open]);
42
+ return (_jsxs("div", { className: clsx("relative inline-block text-left", className), ref: menuRef, ...props, children: [_jsx("div", { onClick: () => setOpen((prev) => !prev), className: "cursor-pointer", children: menuButton }), open && (_jsx("div", { ref: scrollRef, onScroll: handleScroll, className: clsx("absolute right-0 mt-2 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 z-50 overflow-x-hidden", sizeClasses[size]), style: {
43
+ maxHeight: maxHeight,
44
+ overflowY: "auto",
45
+ }, children: _jsx("div", { className: "py-1", children: children }) }))] }));
46
+ }
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export type Props = {
3
+ key: string;
4
+ children: React.ReactNode;
5
+ className?: string | undefined;
6
+ selected?: boolean;
7
+ disabled?: boolean;
8
+ } & React.HTMLAttributes<HTMLDivElement>;
9
+ export default function NativeMenuItem({ children, className, selected, disabled, ...props }: Props): import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/native-menu/native-menu-item/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,MAAM,MAAM,KAAK,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACzC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,QAAQ,EACR,SAAS,EACT,QAAgB,EAChB,QAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,2CAcP"}
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import clsx from "clsx";
4
+ export default function NativeMenuItem({ children, className, selected = false, disabled = false, ...props }) {
5
+ return (_jsx("div", { className: clsx("rounded-md transition-all duration-300 ease-in-out", selected && "bg-primary", !disabled ? "hover:bg-primary hover:bg-opacity-50" : "bg-gray-200", className), ...props, children: children }));
6
+ }
@@ -0,0 +1,10 @@
1
+ import { CONSTANTS } from "sea-platform-helpers";
2
+ export type Props = {
3
+ applicationKey: CONSTANTS.Application.ApplicationKeys | CONSTANTS.Global.AllType;
4
+ limit?: number;
5
+ notificationBaseUrl: string;
6
+ applicationsBaseUrls: Partial<Record<CONSTANTS.Application.ApplicationKeys, string>>;
7
+ navigate?: (to: string) => void;
8
+ };
9
+ export default function NotificationMenu({ applicationKey, notificationBaseUrl, limit, applicationsBaseUrls, navigate, }: Props): import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/notifications-menu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAc,MAAM,sBAAsB,CAAC;AAmB7D,MAAM,MAAM,KAAK,GAAG;IAClB,cAAc,EACV,SAAS,CAAC,WAAW,CAAC,eAAe,GACrC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;IAQ7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAC3B,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,eAAe,EAAE,MAAM,CAAC,CACtD,CAAC;IACF,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,cAAc,EACd,mBAAmB,EAEnB,KAAyC,EACzC,oBAAoB,EACpB,QAAQ,GACT,EAAE,KAAK,2CAoSP"}
@@ -0,0 +1,143 @@
1
+ "use client";
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { CONSTANTS, DTO, Utils } from "sea-platform-helpers";
5
+ import clsx from "clsx";
6
+ import Icon from "../icon";
7
+ import NativeMenu from "../native-menu";
8
+ import NativeMenuItem from "../native-menu/native-menu-item";
9
+ import { getCookie } from "../../utils/cookie";
10
+ import axios from "axios";
11
+ import Skeleton from "../skeleton";
12
+ const DEFAULT_FETCH_NOTIFICATIONS_LIMIT = 50;
13
+ const axiosOptions = {
14
+ headers: {
15
+ Authorization: `Bearer ${getCookie(CONSTANTS.JWT.JWTCookieKey)}`,
16
+ },
17
+ };
18
+ export default function NotificationMenu({ applicationKey, notificationBaseUrl,
19
+ // fetchNotifications,
20
+ limit = DEFAULT_FETCH_NOTIFICATIONS_LIMIT, applicationsBaseUrls, navigate, }) {
21
+ const [loading, setLoading] = useState(false);
22
+ const [page, setPage] = useState(1);
23
+ const [totalCount, setTotalCount] = useState(0);
24
+ const [totalPages, setTotalPages] = useState(1);
25
+ const [unreadCount, setUnreadCount] = useState(0);
26
+ const [notifications, setNotifications] = useState([]);
27
+ useEffect(() => {
28
+ setLoading(true);
29
+ axios
30
+ .get(`${notificationBaseUrl}?applicationKey=${applicationKey}&page=${page}&limit=${limit}`, axiosOptions)
31
+ .then((response) => {
32
+ const { data, page: p, totalCount: tc, totalPages: tp, unreadCount, } = response.data;
33
+ setTotalCount(tc);
34
+ setTotalPages(tp);
35
+ setUnreadCount(unreadCount);
36
+ setNotifications((prev) => {
37
+ const all = Utils.Array.concatWithoutDuplicates(prev, data, (a, b) => a.id === b.id);
38
+ return all;
39
+ });
40
+ return response;
41
+ })
42
+ .finally(() => {
43
+ setLoading(false);
44
+ });
45
+ }, [applicationKey, notificationBaseUrl, limit, page]);
46
+ const markAsRead = (notification) => {
47
+ axios
48
+ .put(`${notificationBaseUrl}/${notification.id}/read`, {}, axiosOptions)
49
+ .then((response) => {
50
+ const readed = response.data;
51
+ setNotifications((prev) => {
52
+ return prev.map((n) => {
53
+ if (n.id === readed.id)
54
+ n = readed;
55
+ return n;
56
+ });
57
+ });
58
+ if (!notification.readAt)
59
+ setUnreadCount((prev) => prev - 1);
60
+ });
61
+ };
62
+ const markAllAsRead = () => {
63
+ axios
64
+ .put(`${notificationBaseUrl}/read-all`, {}, axiosOptions)
65
+ .then(() => {
66
+ setNotifications((prev) => {
67
+ return prev.map((n) => {
68
+ n.readAt = new Date();
69
+ return n;
70
+ });
71
+ });
72
+ setUnreadCount(0);
73
+ });
74
+ };
75
+ const LoadMoreNotifications = () => {
76
+ setPage((prev) => {
77
+ let newPage = prev + 1;
78
+ if (newPage > totalPages)
79
+ newPage = totalPages;
80
+ return newPage;
81
+ });
82
+ };
83
+ const renderNotificationItem = (notification) => {
84
+ var _a, _b, _c, _d, _e;
85
+ let title = _jsx(_Fragment, {}), description = _jsx(_Fragment, {}), icon = _jsx(_Fragment, {}), link = undefined;
86
+ switch (notification.type) {
87
+ case CONSTANTS.Notification.NotificationTypes.TaskAssignedToYou: {
88
+ const task = ((_a = notification.objects) !== null && _a !== void 0 ? _a : {}).task;
89
+ icon = (_jsx(Icon, { icon: "fluent-mdl2:assign", className: "h-10 w-10 transform" }));
90
+ title = (_jsx("p", { className: "font-semibold line-clamp-2", children: "New task assigned to you" }));
91
+ description = (_jsxs("p", { className: "text-text text-sm line-clamp-2", children: [_jsx("span", { className: "font-bold", children: task === null || task === void 0 ? void 0 : task.title }), " assigned to you, check it!", " "] }));
92
+ link = `${applicationsBaseUrls[CONSTANTS.Application.ApplicationKeys.StrategyApplication]}/tasks/${task.id}`;
93
+ break;
94
+ }
95
+ case CONSTANTS.Notification.NotificationTypes.TaskUnassignedFromYou: {
96
+ const task = ((_b = notification.objects) !== null && _b !== void 0 ? _b : {}).task;
97
+ icon = (_jsx(Icon, { icon: "fluent-mdl2:assign", className: "h-10 w-10 transform scale-x-[-1]" }));
98
+ title = (_jsx("p", { className: "font-semibold line-clamp-2", children: "Task unassigned from you" }));
99
+ description = (_jsxs("p", { className: "text-text text-sm line-clamp-2", children: ["Task ", _jsx("span", { className: "font-bold", children: task === null || task === void 0 ? void 0 : task.title }), " unassigned from you, check it!", " "] }));
100
+ link = `${applicationsBaseUrls[CONSTANTS.Application.ApplicationKeys.StrategyApplication]}/tasks/${task.id}`;
101
+ break;
102
+ }
103
+ case CONSTANTS.Notification.NotificationTypes.NewCommentAdded: {
104
+ const addedBy = ((_c = notification.objects) !== null && _c !== void 0 ? _c : {})
105
+ .addedBy;
106
+ const objectName = ((_d = notification.objects) !== null && _d !== void 0 ? _d : {}).objectName;
107
+ const model = ((_e = notification.objects) !== null && _e !== void 0 ? _e : {}).model;
108
+ icon = (_jsx(Icon, { icon: "weui:comment-outlined", className: "h-10 w-10 transform" }));
109
+ title = _jsx("p", { className: "font-semibold line-clamp-2", children: "New comment" });
110
+ description = (_jsxs("p", { className: "text-text text-sm line-clamp-2", children: ["A new comment by ", _jsx("span", { className: "font-bold", children: addedBy === null || addedBy === void 0 ? void 0 : addedBy.name }), " ", "on ", _jsx("span", { className: "font-bold", children: objectName }), " ", model] }));
111
+ switch (model) {
112
+ case DTO.Comment.CommentSupportedModels.Project: {
113
+ link = `${applicationsBaseUrls[CONSTANTS.Application.ApplicationKeys.StrategyApplication]}/projects/${notification.objects.objectId}?comments=true&commentId=${notification.objects.commentId}`;
114
+ break;
115
+ }
116
+ case DTO.Comment.CommentSupportedModels.Initiative: {
117
+ link = `${applicationsBaseUrls[CONSTANTS.Application.ApplicationKeys.StrategyApplication]}/initiatives/${notification.objects.objectId}?comments=true&commentId=${notification.objects.commentId}`;
118
+ break;
119
+ }
120
+ case DTO.Comment.CommentSupportedModels.Task: {
121
+ link = `${applicationsBaseUrls[CONSTANTS.Application.ApplicationKeys.StrategyApplication]}/tasks/${notification.objects.objectId}?comments=true&commentId=${notification.objects.commentId}`;
122
+ break;
123
+ }
124
+ default:
125
+ break;
126
+ }
127
+ break;
128
+ }
129
+ default:
130
+ break;
131
+ }
132
+ return (_jsxs("div", { className: clsx("flex items-center gap-1 px-2 py-1 cursor-pointer", {
133
+ "bg-primary bg-opacity-25": notification.readAt === undefined,
134
+ }), onClick: () => {
135
+ markAsRead(notification);
136
+ if (link && navigate)
137
+ navigate(link);
138
+ }, children: [_jsx("div", { children: icon }), _jsxs("div", { className: "flex-1", children: [_jsx("div", { children: title }), _jsx("div", { children: description }), _jsx("div", { className: "flex justify-end", children: _jsx("p", { className: "text-text text-xs", children: Utils.Moment.formatDateAsLabel(notification.createdAt) }) })] })] }));
139
+ };
140
+ return (_jsx(NativeMenu, { size: "xl", menuButton: _jsxs("div", { className: "relative", children: [_jsx(Icon, { icon: "mingcute:notification-line", className: "text-primary hover:text-opacity-50 w-6 h-6 custom-animation" }), unreadCount !== 0 && (_jsx("div", { className: "absolute -top-2 -right-2 w-5 h-5 text-center rounded-full text-white bg-error shadow-md flex items-center justify-center", children: _jsx("p", { className: "text-xs select-none", children: unreadCount }) }))] }), maxHeight: 350, onReachBottom: () => LoadMoreNotifications(), children: _jsxs("div", { className: "flex flex-col gap-5 p-2", children: [_jsxs("div", { className: "flex items-center justify-between gap-1", children: [_jsx("p", { className: "text-xl font-bold", children: "Notifications" }), _jsxs("button", { type: "button", className: "flex items-center gap-1 px-2 text-primary custom-animation hover:text-opacity-75", onClick: () => markAllAsRead(), children: [_jsx("p", { children: "Mare all as read" }), _jsx(Icon, { icon: "solar:check-read-linear", className: "h-5 w-5" })] })] }), _jsxs("div", { className: "flex flex-col gap-2", children: [notifications.map((notification) => (_jsx(NativeMenuItem, { children: renderNotificationItem(notification) }, `notification-${notification.id}`))), loading && (_jsx(_Fragment, { children: Array(3)
141
+ .fill({})
142
+ .map((_, i) => (_jsx(Skeleton, { className: "h-24 w-full" }, `notification-loading-${i}`))) }))] }), !loading && page === totalPages && (_jsx("p", { className: "text-text text-center text-xs", children: "There are no more notifications" }))] }) }));
143
+ }
@@ -1,17 +1,5 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import clsx from "clsx";
14
- export default function Paper(_a) {
15
- var { className = "bg-white", children } = _a, props = __rest(_a, ["className", "children"]);
16
- return (_jsx("div", Object.assign({ className: clsx("px-4 py-2 rounded-lg shadow-md", className) }, props, { children: children })));
3
+ export default function Paper({ className = "bg-white", children, ...props }) {
4
+ return (_jsx("div", { className: clsx("px-4 py-2 rounded-lg shadow-md", className), ...props, children: children }));
17
5
  }
@@ -1,14 +1,3 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
2
  import clsx from "clsx";
14
3
  const backgroundColors = {
@@ -33,13 +22,12 @@ const textSizes = {
33
22
  lg: "text-[14px]",
34
23
  xl: "text-[16px]",
35
24
  };
36
- export default function ProgressBar(_a) {
37
- var { percentage = 0, showPercentage = false, size = "md", type = "primary", className } = _a, rest = __rest(_a, ["percentage", "showPercentage", "size", "type", "className"]);
25
+ export default function ProgressBar({ percentage = 0, showPercentage = false, size = "md", type = "primary", className, ...rest }) {
38
26
  const heightClass = barHeights[size];
39
27
  const textClass = textSizes[size];
40
28
  const fillColor = backgroundColors[type];
41
- return (_jsxs("div", Object.assign({ className: clsx("w-full bg-gray-300 rounded-full overflow-hidden relative", heightClass, className) }, rest, { children: [_jsx("div", { className: clsx("rounded-full transition-all duration-300 ease-in-out min-w-[1px]", fillColor), style: {
29
+ return (_jsxs("div", { className: clsx("w-full bg-gray-300 rounded-full overflow-hidden relative", heightClass, className), ...rest, children: [_jsx("div", { className: clsx("rounded-full transition-all duration-300 ease-in-out min-w-[1px]", fillColor), style: {
42
30
  width: `${Math.min(Math.max(percentage, 0), 100)}%`,
43
31
  height: "100%",
44
- } }), showPercentage && (_jsxs("div", { className: clsx("absolute inset-0 flex items-center justify-center text-white pointer-events-none", textClass), children: [Math.round(percentage), "%"] }))] })));
32
+ } }), showPercentage && (_jsxs("div", { className: clsx("absolute inset-0 flex items-center justify-center text-white pointer-events-none", textClass), children: [Math.round(percentage), "%"] }))] }));
45
33
  }
@@ -1,17 +1,5 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
2
  import clsx from "clsx";
14
- export default function RadioButton(_a) {
15
- var { id, name, checked, onChange, label } = _a, props = __rest(_a, ["id", "name", "checked", "onChange", "label"]);
16
- return (_jsxs("label", { htmlFor: id, className: "flex items-center space-x-2 cursor-pointer", children: [_jsx("input", Object.assign({}, props, { type: "radio", id: id, name: name, checked: checked, onChange: onChange, className: "hidden" })), _jsx("div", { className: clsx("w-5 h-5 rounded-full border-2 flex items-center justify-center", checked ? "bg-primary border-primary" : "bg-white border-gray-300"), children: checked && _jsx("div", { className: "w-3 h-3 rounded-full bg-white" }) }), label] }));
3
+ export default function RadioButton({ id, name, checked, onChange, label, ...props }) {
4
+ return (_jsxs("label", { htmlFor: id, className: "flex items-center space-x-2 cursor-pointer", children: [_jsx("input", { ...props, type: "radio", id: id, name: name, checked: checked, onChange: onChange, className: "hidden" }), _jsx("div", { className: clsx("w-5 h-5 rounded-full border-2 flex items-center justify-center", checked ? "bg-primary border-primary" : "bg-white border-gray-300"), children: checked && _jsx("div", { className: "w-3 h-3 rounded-full bg-white" }) }), label] }));
17
5
  }
@@ -1,21 +1,9 @@
1
1
  "use client";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  import { jsx as _jsx } from "react/jsx-runtime";
14
3
  import { Icon } from "@iconify/react";
15
4
  import { useEffect, useRef, useState } from "react";
16
5
  import Input from "../input";
17
- export default function SearchInput(_a) {
18
- var { value, onDebouncedChange, QueryDebouncedTime = 500 } = _a, props = __rest(_a, ["value", "onDebouncedChange", "QueryDebouncedTime"]);
6
+ export default function SearchInput({ value, onDebouncedChange, QueryDebouncedTime = 500, ...props }) {
19
7
  const [currentValue, setCurrentValue] = useState(value);
20
8
  const [debouncedQuery, setDebouncedQuery] = useState("");
21
9
  const isFirstRun = useRef(true);
@@ -35,5 +23,5 @@ export default function SearchInput(_a) {
35
23
  }
36
24
  onDebouncedChange(debouncedQuery);
37
25
  }, [debouncedQuery]);
38
- return (_jsx(Input, Object.assign({ value: currentValue, onChange: (e) => setCurrentValue(e.target.value), end: _jsx(Icon, { icon: "material-symbols:search", className: "w-5 h-5 text-primary" }) }, props)));
26
+ return (_jsx(Input, { value: currentValue, onChange: (e) => setCurrentValue(e.target.value), end: _jsx(Icon, { icon: "material-symbols:search", className: "w-5 h-5 text-primary" }), ...props }));
39
27
  }
@@ -1,17 +1,5 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
1
  import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import clsx from "clsx";
14
- export default function Skeleton(_a) {
15
- var { className } = _a, props = __rest(_a, ["className"]);
16
- return (_jsx("div", Object.assign({ className: clsx("bg-gray-300 animate-pulse rounded-md", className) }, props)));
3
+ export default function Skeleton({ className, ...props }) {
4
+ return (_jsx("div", { className: clsx("bg-gray-300 animate-pulse rounded-md", className), ...props }));
17
5
  }
@@ -17,7 +17,7 @@ export default function StackedAvatars({ name, items, max = DEFAULT_MAX, size =
17
17
  return (_jsxs("div", { className: clsx("relative flex", className), style: { height: sizeValue }, children: [avatarsToDisplay.map((item, i) => (_jsx("div", { className: "absolute", style: {
18
18
  left: `${(i * sizeValue) / offsetFactor}px`,
19
19
  zIndex: avatarsToDisplay.length - i,
20
- }, children: _jsx(Avatar, Object.assign({}, item, { size: size })) }, `${name}-avatar-${i}`))), remainingCount > 0 && (_jsxs("div", { className: "absolute flex items-center justify-center bg-gray-400 text-white rounded-full text-xs font-medium", style: {
20
+ }, children: _jsx(Avatar, { ...item, size: size }) }, `${name}-avatar-${i}`))), remainingCount > 0 && (_jsxs("div", { className: "absolute flex items-center justify-center bg-gray-400 text-white rounded-full text-xs font-medium", style: {
21
21
  left: `${(clampedMax * sizeValue) / offsetFactor}px`,
22
22
  width: sizeValue,
23
23
  height: sizeValue,
@@ -1,15 +1,4 @@
1
1
  "use client";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
3
  import clsx from "clsx";
15
4
  import Checkbox from "../checkbox";
@@ -30,8 +19,8 @@ export default function Table({ name, columns, rows, bulkActionFeature, loading
30
19
  }
31
20
  } }) }, `loading-column-${name}-checkbox`)), columns.map((column, i) => {
32
21
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
33
- const { className, key, label, custom } = column, restColumn = __rest(column, ["className", "key", "label", "custom"]);
34
- return (_jsx("th", Object.assign({ className: clsx("px-4 py-2 text-left", className) }, restColumn, { children: label }), `loading-column-${name}-${i}-${key}`));
22
+ const { className, key, label, custom, ...restColumn } = column;
23
+ return (_jsx("th", { className: clsx("px-4 py-2 text-left", className), ...restColumn, children: label }, `loading-column-${name}-${i}-${key}`));
35
24
  })] }) }), _jsx("tbody", { id: `loading-table-${name}-body` })] }), _jsx("div", { className: "flex items-center justify-center", children: _jsx(Icon, { icon: "line-md:loading-loop", className: "text-primary w-20 h-20" }) })] })) : (_jsxs("table", { className: "min-w-full table-auto", children: [_jsx("thead", { id: `table-${name}-head`, className: "bg-gray-100", children: _jsxs("tr", { className: "text-text pb-2 border-b-[2px] border-b-gray-100", children: [bulkActionFeature && (_jsx("th", { className: clsx("px-4 py-2 text-left"), children: _jsx(Checkbox, { checked: bulkActionFeature.selectedRowIds.length === rows.length, onChange: (checked) => {
36
25
  if (checked) {
37
26
  bulkActionFeature.setSelectedRowIds(rows.map((r) => r.id));
@@ -43,8 +32,8 @@ export default function Table({ name, columns, rows, bulkActionFeature, loading
43
32
  }
44
33
  } }) }, `column-${name}-checkbox`)), columns.map((column, i) => {
45
34
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
46
- const { className, key, label, custom } = column, restColumn = __rest(column, ["className", "key", "label", "custom"]);
47
- return (_jsx("th", Object.assign({ className: clsx("px-4 py-2 text-left", className) }, restColumn, { children: label }), `column-${name}-${i}-${key}`));
35
+ const { className, key, label, custom, ...restColumn } = column;
36
+ return (_jsx("th", { className: clsx("px-4 py-2 text-left", className), ...restColumn, children: label }, `column-${name}-${i}-${key}`));
48
37
  })] }) }), _jsx("tbody", { id: `table-${name}-body`, children: rows.map((row, i) => {
49
38
  return (_jsxs("tr", { className: clsx("text-text pb-2 ", i !== rows.length - 1 && "border-b-[2px] border-gray-100"), children: [bulkActionFeature && (_jsx("td", { className: "px-4 py-2", children: _jsx(Checkbox, { checked: bulkActionFeature.selectedRowIds.includes(row.id) ||
50
39
  false, onChange: (checked) => {
@@ -1,24 +1,12 @@
1
1
  "use client";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
3
  import clsx from "clsx";
15
4
  import { useState } from "react";
16
- export default function Textarea(_a) {
17
- var { errorMessage, className, ref } = _a, props = __rest(_a, ["errorMessage", "className", "ref"]);
5
+ export default function Textarea({ errorMessage, className, ref, ...props }) {
18
6
  const [isFocused, setIsFocused] = useState(false);
19
7
  return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("div", { className: clsx("flex items-center justify-between gap-2 bg-white px-3 py-2 rounded-xl border-0.5 hover:border-primary", errorMessage
20
8
  ? "border-error"
21
9
  : isFocused
22
10
  ? "border-primary"
23
- : "border-gray-200"), children: _jsx("textarea", Object.assign({ ref: ref, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), className: clsx("outline-none text-text flex-1", className) }, props)) }), errorMessage && (_jsx("p", { className: "pl-1 text-sm text-error", children: errorMessage }))] }));
11
+ : "border-gray-200"), children: _jsx("textarea", { ref: ref, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), className: clsx("outline-none text-text flex-1", className), ...props }) }), errorMessage && (_jsx("p", { className: "pl-1 text-sm text-error", children: errorMessage }))] }));
24
12
  }
@@ -31,23 +31,34 @@ const TreeCheckbox = ({ name, nodes, onChange, readonly = false, }) => {
31
31
  };
32
32
  const updateChildCheckStatus = (node, newStatus) => {
33
33
  var _a;
34
- return Object.assign(Object.assign({}, node), { checked: newStatus, children: (_a = node.children) === null || _a === void 0 ? void 0 : _a.map((child) => updateChildCheckStatus(child, newStatus)) });
34
+ return {
35
+ ...node,
36
+ checked: newStatus,
37
+ children: (_a = node.children) === null || _a === void 0 ? void 0 : _a.map((child) => updateChildCheckStatus(child, newStatus)),
38
+ };
35
39
  };
36
40
  const handleCheckNodeRecursive = (nodes, nodeKey, checked) => {
37
41
  return nodes.map((node) => {
38
42
  // Check if the current node matches the key
39
43
  if (node.key === nodeKey) {
40
44
  const newChecked = checked ? "all" : "none";
41
- return Object.assign(Object.assign({}, node), { checked: newChecked, children: node.children
45
+ return {
46
+ ...node,
47
+ checked: newChecked,
48
+ children: node.children
42
49
  ? node.children.map((child) => updateChildCheckStatus(child, newChecked))
43
- : undefined });
50
+ : undefined,
51
+ };
44
52
  }
45
53
  // If it doesn't match, recursively update the children
46
54
  if (node.children) {
47
55
  const updatedChildren = handleCheckNodeRecursive(node.children, nodeKey, checked);
48
- const updatedNode = Object.assign(Object.assign({}, node), { children: updatedChildren });
56
+ const updatedNode = { ...node, children: updatedChildren };
49
57
  // Update the parent's status based on the children's status
50
- return Object.assign(Object.assign({}, updatedNode), { checked: updateParentCheckStatus(updatedNode) });
58
+ return {
59
+ ...updatedNode,
60
+ checked: updateParentCheckStatus(updatedNode),
61
+ };
51
62
  }
52
63
  // If it's a leaf node and doesn't match, return as is
53
64
  return node;
package/dist/index.d.ts CHANGED
@@ -12,6 +12,8 @@ export { default as Badge, Props as BadgeProps, Types as BudgeTypes, } from "./c
12
12
  export { default as Modal, ModalPosition, ModalSize, Props as ModalProps, } from "./components/modal";
13
13
  export { default as Menu, Props as MenuProps } from "./components/menu";
14
14
  export { default as MenuItem, Props as MenuItemProps, } from "./components/menu/menu-item";
15
+ export { default as NativeMenu, Props as NativeMenuProps, } from "./components/native-menu";
16
+ export { default as NativeMenuItem, Props as NativeMenuItemProps, } from "./components/native-menu/native-menu-item";
15
17
  export { default as Select, Props as SelectProps, SelectOption, } from "./components/select";
16
18
  export { default as Paper, Props as PaperProps } from "./components/paper";
17
19
  export { default as Input, Props as InputProps } from "./components/input";
@@ -48,6 +50,7 @@ export { default as DayCalendar, Props as DayCalendarProps, } from "./components
48
50
  export { default as Loader, Props as LoaderProps } from "./components/loader";
49
51
  export { default as ItemNouFound, Props as ItemNouFoundProps, } from "./components/item-not-found";
50
52
  export * from "./components/accordion";
53
+ export { default as NotificationsMenu, Props as NotificationsMenuProps, } from "./components/notifications-menu";
51
54
  export { default as WithAuthorization, Props as WithAuthorizationProps, } from "./HOC/with-authorization";
52
55
  export { default as CanAccessApplication, Props as CanAccessApplicationProps, } from "./HOC/can-access-application";
53
56
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,OAAO,KAAK,eAAe,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,K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wBAAwB,CAAC;AAEvC,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,KAAK,IAAI,sBAAsB,GAChC,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,KAAK,IAAI,sBAAsB,GAChC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,OAAO,IAAI,oBAAoB,EAC/B,KAAK,IAAI,yBAAyB,GACnC,MAAM,8BAA8B,CAAC"}
package/dist/index.js CHANGED
@@ -15,6 +15,8 @@ export { default as Badge, } from "./components/badge";
15
15
  export { default as Modal, } from "./components/modal";
16
16
  export { default as Menu } from "./components/menu";
17
17
  export { default as MenuItem, } from "./components/menu/menu-item";
18
+ export { default as NativeMenu, } from "./components/native-menu";
19
+ export { default as NativeMenuItem, } from "./components/native-menu/native-menu-item";
18
20
  export { default as Select, } from "./components/select";
19
21
  export { default as Paper } from "./components/paper";
20
22
  export { default as Input } from "./components/input";
@@ -51,5 +53,6 @@ export { default as DayCalendar, } from "./components/day-calendar";
51
53
  export { default as Loader } from "./components/loader";
52
54
  export { default as ItemNouFound, } from "./components/item-not-found";
53
55
  export * from "./components/accordion";
56
+ export { default as NotificationsMenu, } from "./components/notifications-menu";
54
57
  export { default as WithAuthorization, } from "./HOC/with-authorization";
55
58
  export { default as CanAccessApplication, } from "./HOC/can-access-application";
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/hoc/can-access-application/index.tsx","../src/hoc/with-authorization/index.tsx","../src/components/accordion/index.tsx","../src/components/alert/index.tsx","../src/components/auto-complete-input/index.tsx","../src/components/avatar/index.tsx","../src/components/badge/index.tsx","../src/components/breadcrumb/index.tsx","../src/components/button/index.tsx","../src/components/calendar/index.tsx","../src/components/cards-list/index.tsx","../src/components/carousel/index.tsx","../src/components/checkbox/index.tsx","../src/components/color-picker/index.tsx","../src/components/count-down/index.tsx","../src/components/day-calendar/index.tsx","../src/components/drawer/index.tsx","../src/components/editable-text/index.tsx","../src/components/file-input/index.tsx","../src/components/file-input/components/file-item/index.tsx","../src/components/icon/index.tsx","../src/components/input/index.tsx","../src/components/item-not-found/index.tsx","../src/components/list-item/index.tsx","../src/components/list-item/components/page-button/index.tsx","../src/components/list-item/components/pagination/index.tsx","../src/components/loader/index.tsx","../src/components/menu/index.tsx","../src/components/menu/menu-item/index.tsx","../src/components/modal/index.tsx","../src/components/month-calendar/index.tsx","../src/components/not-authorized/index.tsx","../src/components/otp-input/index.tsx","../src/components/paper/index.tsx","../src/components/progress-bar/index.tsx","../src/components/radio-button/index.tsx","../src/components/search-input/index.tsx","../src/components/select/index.tsx","../src/components/skeleton/index.tsx","../src/components/stacked-avatars/index.tsx","../src/components/tab/index.tsx","../src/components/table/index.tsx","../src/components/text-editor/index.tsx","../src/components/text-editor/components/toolbar/index.tsx","../src/components/text-editor/utils/index.ts","../src/components/textarea/index.tsx","../src/components/toggle/index.tsx","../src/components/tooltip/index.tsx","../src/components/tree-checkbox/index.tsx","../src/components/tree-checkbox/components/tree-checkbox-item/index.tsx","../src/components/tree-checkbox/utils/index.ts","../src/components/week-calendar/index.tsx","../src/constants/index.ts","../src/hooks/list-items-hook/types.ts","../src/hooks/list-items-hook/usebulkactions.ts","../src/hooks/list-items-hook/usefilters.ts","../src/hooks/list-items-hook/usepagination.ts","../src/utils/axios/index.ts","../src/utils/color/index.ts","../src/utils/cookie/index.ts","../src/utils/file/index.ts","../src/utils/jwt/index.ts","../src/utils/validation/index.ts"],"version":"5.6.3"}
1
+ {"root":["../src/index.ts","../src/hoc/can-access-application/index.tsx","../src/hoc/with-authorization/index.tsx","../src/components/accordion/index.tsx","../src/components/alert/index.tsx","../src/components/auto-complete-input/index.tsx","../src/components/avatar/index.tsx","../src/components/badge/index.tsx","../src/components/breadcrumb/index.tsx","../src/components/button/index.tsx","../src/components/calendar/index.tsx","../src/components/cards-list/index.tsx","../src/components/carousel/index.tsx","../src/components/checkbox/index.tsx","../src/components/color-picker/index.tsx","../src/components/count-down/index.tsx","../src/components/day-calendar/index.tsx","../src/components/drawer/index.tsx","../src/components/editable-text/index.tsx","../src/components/file-input/index.tsx","../src/components/file-input/components/file-item/index.tsx","../src/components/icon/index.tsx","../src/components/input/index.tsx","../src/components/item-not-found/index.tsx","../src/components/list-item/index.tsx","../src/components/list-item/components/page-button/index.tsx","../src/components/list-item/components/pagination/index.tsx","../src/components/loader/index.tsx","../src/components/menu/index.tsx","../src/components/menu/menu-item/index.tsx","../src/components/modal/index.tsx","../src/components/month-calendar/index.tsx","../src/components/native-menu/index.tsx","../src/components/native-menu/native-menu-item/index.tsx","../src/components/not-authorized/index.tsx","../src/components/notifications-menu/index.tsx","../src/components/otp-input/index.tsx","../src/components/paper/index.tsx","../src/components/progress-bar/index.tsx","../src/components/radio-button/index.tsx","../src/components/search-input/index.tsx","../src/components/select/index.tsx","../src/components/skeleton/index.tsx","../src/components/stacked-avatars/index.tsx","../src/components/tab/index.tsx","../src/components/table/index.tsx","../src/components/text-editor/index.tsx","../src/components/text-editor/components/toolbar/index.tsx","../src/components/text-editor/utils/index.ts","../src/components/textarea/index.tsx","../src/components/toggle/index.tsx","../src/components/tooltip/index.tsx","../src/components/tree-checkbox/index.tsx","../src/components/tree-checkbox/components/tree-checkbox-item/index.tsx","../src/components/tree-checkbox/utils/index.ts","../src/components/week-calendar/index.tsx","../src/constants/index.ts","../src/hooks/list-items-hook/types.ts","../src/hooks/list-items-hook/usebulkactions.ts","../src/hooks/list-items-hook/usefilters.ts","../src/hooks/list-items-hook/usepagination.ts","../src/utils/axios/index.ts","../src/utils/color/index.ts","../src/utils/cookie/index.ts","../src/utils/file/index.ts","../src/utils/jwt/index.ts","../src/utils/validation/index.ts"],"version":"5.6.3"}
@@ -1,8 +1,9 @@
1
+ import axios from "axios";
1
2
  type AxiosOptions = {
2
3
  JWTTokenKey?: string;
3
4
  withCredentials?: boolean;
4
5
  storage?: "localStorage" | "cookie";
5
6
  };
6
7
  export declare const createInstance: (baseURL: string, options?: AxiosOptions) => import("axios").AxiosInstance;
7
- export {};
8
+ export default axios;
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/axios/index.ts"],"names":[],"mappings":"AAGA,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,GAAG,QAAQ,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,MAAM,YACN,YAAY,kCAyCtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/axios/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAGzD,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,GAAG,QAAQ,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,cAAc,YAChB,MAAM,YACN,YAAY,kCAyCtB,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -33,3 +33,4 @@ export const createInstance = (baseURL, options = {
33
33
  });
34
34
  return axiosInstance;
35
35
  };
36
+ export default axios;
@@ -1,5 +1,6 @@
1
1
  import * as Yup from "yup";
2
2
  export declare const name: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
3
+ export declare const description: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
3
4
  export declare const birthDate: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
4
5
  export declare const email: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
5
6
  export declare const phoneNumber: Yup.StringSchema<string, Yup.AnyObject, undefined, "">;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,eAAO,MAAM,IAAI,wDAAmD,CAAC;AACrE,eAAO,MAAM,SAAS,wDAAoC,CAAC;AAC3D,eAAO,MAAM,KAAK,wDAA4C,CAAC;AAC/D,eAAO,MAAM,WAAW,wDAKpB,CAAC;AACL,eAAO,MAAM,QAAQ,wDAA2C,CAAC;AACjE,eAAO,MAAM,eAAe,wDAEe,CAAC;AAE5C,eAAO,MAAM,UAAU,wDASpB,CAAC;AAEJ,eAAO,MAAM,OAAO,WAAY,MAAM,2DAGb,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/validation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAG3B,eAAO,MAAM,IAAI,wDAAoD,CAAC;AACtE,eAAO,MAAM,WAAW,wDAAkD,CAAC;AAC3E,eAAO,MAAM,SAAS,wDAAoC,CAAC;AAC3D,eAAO,MAAM,KAAK,wDAA4C,CAAC;AAC/D,eAAO,MAAM,WAAW,wDAKpB,CAAC;AACL,eAAO,MAAM,QAAQ,wDAA2C,CAAC;AACjE,eAAO,MAAM,eAAe,wDAEe,CAAC;AAE5C,eAAO,MAAM,UAAU,wDASpB,CAAC;AAEJ,eAAO,MAAM,OAAO,WAAY,MAAM,2DAGb,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import * as Yup from "yup";
2
2
  import { Utils } from "sea-platform-helpers";
3
- export const name = Yup.string().min(3).max(50).required("Required");
3
+ export const name = Yup.string().min(3).max(255).required("Required");
4
+ export const description = Yup.string().trim().optional().min(3).max(1000);
4
5
  export const birthDate = Yup.string().required("Required");
5
6
  export const email = Yup.string().email().required("Required");
6
7
  export const phoneNumber = Yup.string()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sea-react-components",
3
3
  "description": "SEA react components library",
4
- "version": "1.3.0",
4
+ "version": "1.3.2",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
7
  "build": "tsc --build && npx postcss src/styles.css -o dist/styles.css && npx postcss src/components/text-editor/style.css -o dist/components/text-editor/style.css",
@@ -45,7 +45,7 @@
45
45
  "jwt-decode": "^4.0.0",
46
46
  "lowlight": "^3.3.0",
47
47
  "react-dom": "^18.3.1",
48
- "sea-platform-helpers": "^1.4.0",
48
+ "sea-platform-helpers": "^1.5.1",
49
49
  "sea-react-components": "file:",
50
50
  "yup": "^1.5.0"
51
51
  },
@@ -1,7 +0,0 @@
1
- import { Props as InputProps } from "../../../input";
2
- export type Props = {
3
- onDebouncedChange: (newValue: string) => void;
4
- QueryDebouncedTime?: number;
5
- } & InputProps;
6
- export default function SearchInput({ value, onDebouncedChange, QueryDebouncedTime, ...props }: Props): import("react/jsx-runtime").JSX.Element;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/list-item/components/search-input/index.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5D,MAAM,MAAM,KAAK,GAAG;IAClB,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,GAAG,UAAU,CAAC;AACf,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAK,EACL,iBAAiB,EACjB,kBAAwB,EACxB,GAAG,KAAK,EACT,EAAE,KAAK,2CAiCP"}
@@ -1,38 +0,0 @@
1
- "use client";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { Icon } from "@iconify/react";
15
- import { useEffect, useState } from "react";
16
- import Input from "../../../input";
17
- export default function SearchInput(_a) {
18
- var { value, onDebouncedChange, QueryDebouncedTime = 500 } = _a, props = __rest(_a, ["value", "onDebouncedChange", "QueryDebouncedTime"]);
19
- const [currentValue, setCurrentValue] = useState(value);
20
- const [debouncedQuery, setDebouncedQuery] = useState("");
21
- useEffect(() => {
22
- setCurrentValue((value || "").toString());
23
- }, [value]);
24
- useEffect(() => {
25
- const handler = setTimeout(() => {
26
- setDebouncedQuery(currentValue);
27
- }, QueryDebouncedTime);
28
- // Cleanup the timeout on every keystroke
29
- return () => clearTimeout(handler);
30
- }, [currentValue, QueryDebouncedTime]);
31
- // Trigger the callback when debouncedQuery changes
32
- useEffect(() => {
33
- if (onDebouncedChange) {
34
- onDebouncedChange(debouncedQuery);
35
- }
36
- }, [debouncedQuery, onDebouncedChange]);
37
- return (_jsx(Input, Object.assign({ value: currentValue, onChange: (e) => setCurrentValue(e.target.value), end: _jsx(Icon, { icon: "material-symbols:search", className: "w-5 h-5 text-primary" }) }, props)));
38
- }