@megha-ui/react 1.2.179 → 1.2.181

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.
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  const Button = ({ text, color, icon, fontSize, fontWeight, onClick, gap = "0.5rem", borderWidth = 1, borderColor, borderRadius = "0.25rem", border = true, backgroundColor, borderStyle = "solid", cursor = "pointer", type, width, paddingBottom = "0.35rem", paddingLeft = "0.65rem", paddingRight = "0.65rem", paddingTop = "0.35rem", marginBottom, marginLeft, marginRight, marginTop, disabled = false, style, className, iconPosition = "before", textEleClass = "", }) => {
3
3
  const buttonStyle = Object.assign({ color,
4
4
  fontSize,
5
- fontWeight, display: "flex", alignItems: "center", justifyContent: "center", gap, cursor: disabled ? "not-allowed" : cursor, borderColor, backgroundColor: disabled ? "#D3D3D3" : backgroundColor, borderWidth, border: border ? `${borderWidth} ${borderStyle} ${borderColor}` : "none", borderRadius, fontFamily: "var(--font-family)", width,
5
+ fontWeight, display: "flex", alignItems: "center", justifyContent: "center", gap, cursor: disabled ? "not-allowed" : cursor, borderColor, backgroundColor: disabled ? "var(--disabled-bg)" : backgroundColor, borderWidth, border: border ? `${borderWidth} ${borderStyle} ${borderColor}` : "none", borderRadius, fontFamily: "var(--font-family)", width,
6
6
  paddingBottom,
7
7
  paddingLeft,
8
8
  paddingRight,
@@ -29,7 +29,7 @@ const ChatDetails = ({ selectedUser, currentUserId }) => {
29
29
  if (!selectedUser) {
30
30
  return _jsx("div", { className: "wk-chat-placeholder", style: { flex: 1, padding: 16 }, children: "Select a chat" });
31
31
  }
32
- return (_jsxs("div", { className: "wk-chat-details", style: { flex: 1, display: "flex", flexDirection: "column" }, children: [_jsxs("div", { className: "wk-chat-header", style: { display: "flex", alignItems: "center", padding: "8px", borderBottom: "1px solid #f5f5f5" }, children: [_jsx("div", { className: "wk-chat-user-icon", style: {
32
+ return (_jsxs("div", { className: "wk-chat-details", style: { flex: 1, display: "flex", flexDirection: "column" }, children: [_jsxs("div", { className: "wk-chat-header", style: { display: "flex", alignItems: "center", padding: "8px", borderBottom: "1px solid var(--divider, #f5f5f5)" }, children: [_jsx("div", { className: "wk-chat-user-icon", style: {
33
33
  width: 32,
34
34
  height: 32,
35
35
  borderRadius: "50%",
@@ -47,15 +47,15 @@ const ChatDetails = ({ selectedUser, currentUserId }) => {
47
47
  display: "flex",
48
48
  justifyContent: m.senderId === currentUserId ? "flex-end" : "flex-start",
49
49
  }, children: _jsx("div", { style: {
50
- background: m.senderId === currentUserId ? "#F9F9F9" : "#EAF2FA",
50
+ background: m.senderId === currentUserId ? "var(--background)" : "var(--background)",
51
51
  padding: "6px 8px",
52
52
  borderRadius: 4,
53
53
  maxWidth: "70%",
54
- }, children: m.text }) }, m.id))), _jsx("div", { ref: endRef })] }), _jsxs("div", { className: "wk-chat-input", style: { display: "flex", padding: 8, borderTop: "1px solid #f5f5f5" }, children: [_jsx("input", { type: "text", value: newMessage, onChange: (e) => setNewMessage(e.target.value), onKeyDown: (e) => {
54
+ }, children: m.text }) }, m.id))), _jsx("div", { ref: endRef })] }), _jsxs("div", { className: "wk-chat-input", style: { display: "flex", padding: 8, borderTop: "1px solid var(--divider, #f5f5f5)" }, children: [_jsx("input", { type: "text", value: newMessage, onChange: (e) => setNewMessage(e.target.value), onKeyDown: (e) => {
55
55
  if (e.key === "Enter") {
56
56
  e.preventDefault();
57
57
  handleSend();
58
58
  }
59
- }, style: { flex: 1, border: "1px solid #dbdfe9", borderRadius: 4, padding: "6px" } }), _jsx("button", { onClick: handleSend, style: { marginLeft: 8, background: "transparent", border: "none", cursor: "pointer" }, children: _jsx(VscSend, { size: 20 }) })] })] }));
59
+ }, style: { flex: 1, border: "1px solid var(--form-border-color, #dbdfe9)", borderRadius: 4, padding: "6px" } }), _jsx("button", { onClick: handleSend, style: { marginLeft: 8, background: "transparent", border: "none", cursor: "pointer" }, children: _jsx(VscSend, { size: 20 }) })] })] }));
60
60
  };
61
61
  export default ChatDetails;
@@ -27,7 +27,7 @@ const ChatList = ({ users, onSelectUser, selectedUserId, unreadCounts = {}, }) =
27
27
  padding: "8px",
28
28
  cursor: "pointer",
29
29
  display: "flex",
30
- borderBottom: "1px solid #f5f5f5",
30
+ borderBottom: "1px solid var(--divider, #f5f5f5)",
31
31
  }, children: [_jsx("div", { className: "wk-chat-user-icon", style: {
32
32
  width: 32,
33
33
  height: 32,
@@ -41,7 +41,7 @@ const ChatList = ({ users, onSelectUser, selectedUserId, unreadCounts = {}, }) =
41
41
  textTransform: "uppercase",
42
42
  }, children: user.isGroup ? (_jsx(FaUsers, {})) : (`${(_a = user.firstName) === null || _a === void 0 ? void 0 : _a[0]}${(_b = user.lastName) === null || _b === void 0 ? void 0 : _b[0]}`) }), _jsxs("div", { style: { flex: 1 }, children: [_jsx("div", { style: { fontWeight: "bold" }, children: user.isGroup
43
43
  ? user.firstName
44
- : `${user.firstName} ${user.lastName}` }), _jsx("div", { style: { fontSize: "0.8rem", color: "#555" }, children: user.latestMessageText || "No messages yet" })] }), unreadCounts[user.id] > 0 && (_jsx("span", { style: {
44
+ : `${user.firstName} ${user.lastName}` }), _jsx("div", { style: { fontSize: "0.8rem", color: "var(--foreground)" }, children: user.latestMessageText || "No messages yet" })] }), unreadCounts[user.id] > 0 && (_jsx("span", { style: {
45
45
  marginLeft: "auto",
46
46
  background: "#0096c7",
47
47
  color: "#fff",
@@ -52,7 +52,7 @@ const ChatList = ({ users, onSelectUser, selectedUserId, unreadCounts = {}, }) =
52
52
  alignItems: "center",
53
53
  justifyContent: "center",
54
54
  fontSize: "0.75rem",
55
- }, children: unreadCounts[user.id] })), _jsx("div", { style: { marginLeft: 8, fontSize: "0.75rem", color: "#888" }, children: formatTimestamp(user.latestMessageTimestamp) })] }, user.id));
55
+ }, children: unreadCounts[user.id] })), _jsx("div", { style: { marginLeft: 8, fontSize: "0.75rem", color: "var(--foreground)" }, children: formatTimestamp(user.latestMessageTimestamp) })] }, user.id));
56
56
  })) : (_jsx("div", { style: { padding: 16, textAlign: "center" }, children: _jsx(Loader, { size: 24 }) })) }));
57
57
  };
58
58
  export default ChatList;
@@ -4,6 +4,6 @@ import ChatList from "./components/ChatList";
4
4
  import ChatDetails from "./components/ChatDetails";
5
5
  const Chat = ({ users, currentUserId }) => {
6
6
  const [selectedUser, setSelectedUser] = useState(null);
7
- return (_jsxs("div", { className: "wk-chat-container", style: { display: "flex", border: "1px solid #dbdfe9", height: "400px" }, children: [_jsx(ChatList, { users: users, onSelectUser: setSelectedUser, selectedUserId: selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id }), _jsx(ChatDetails, { selectedUser: selectedUser, currentUserId: currentUserId })] }));
7
+ return (_jsxs("div", { className: "wk-chat-container", style: { display: "flex", border: "1px solid var(--form-border-color, #dbdfe9)", height: "400px" }, children: [_jsx(ChatList, { users: users, onSelectUser: setSelectedUser, selectedUserId: selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id }), _jsx(ChatDetails, { selectedUser: selectedUser, currentUserId: currentUserId })] }));
8
8
  };
9
9
  export default Chat;
@@ -238,13 +238,13 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
238
238
  paddingBottom: 6,
239
239
  paddingLeft: "1rem",
240
240
  paddingRight: "1rem",
241
- borderBottom: "1px solid #dddddd",
241
+ borderBottom: "1px solid var(--divider-strong, #dddddd)",
242
242
  cursor: "pointer",
243
243
  };
244
244
  const listItemDisabledStyle = {
245
245
  cursor: "not-allowed",
246
- color: "#a0a0a0",
247
- backgroundColor: "#f5f5f5",
246
+ color: "var(--muted, #a0a0a0)",
247
+ backgroundColor: "var(--disabled-bg)",
248
248
  pointerEvents: "none",
249
249
  };
250
250
  const listItemHoverStyle = {
@@ -304,14 +304,14 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
304
304
  : placeholder }), _jsxs("div", { style: {
305
305
  display: "flex",
306
306
  alignItems: "center",
307
- }, children: [isClear && (displayValue || selectedDisplay) && (_jsx("div", { style: { marginRight: "0.5rem" }, onClick: handleClear, id: clearId, title: "Click to clear the value", children: ClearIcon ? (ClearIcon) : (_jsx("span", { style: { color: "#dbdfe9", fontSize: "1rem" }, children: "X" })) })), disabled ? (Tooltip && Tooltip) : DropDownIcon ? (DropDownIcon) : (_jsx(HiChevronDown, { fontSize: "1rem" })), withTooltip && Tooltip && Tooltip] })] }), _jsxs("ul", { style: Object.assign(Object.assign({ width: dropdownListWidth || "100%", position: "absolute", backgroundColor: dropdownListBG || "var(--dropdown-bg)", boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)", border: "1px solid #f5f5f5", zIndex: 10, marginTop: 4, borderRadius: 4, overflow: "hidden" }, clickStyle), { display: !isOpen ? "none" : "" }), children: [searchEnabled && (_jsx("li", { style: { padding: "0.5rem" }, children: _jsx("input", { ref: searchInputRef, type: "text", placeholder: "Search...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), disabled: disabled, style: {
307
+ }, children: [isClear && (displayValue || selectedDisplay) && (_jsx("div", { style: { marginRight: "0.5rem" }, onClick: handleClear, id: clearId, title: "Click to clear the value", children: ClearIcon ? (ClearIcon) : (_jsx("span", { style: { color: "var(--form-border-color, #dbdfe9)", fontSize: "1rem" }, children: "X" })) })), disabled ? (Tooltip && Tooltip) : DropDownIcon ? (DropDownIcon) : (_jsx(HiChevronDown, { fontSize: "1rem" })), withTooltip && Tooltip && Tooltip] })] }), _jsxs("ul", { style: Object.assign(Object.assign({ width: dropdownListWidth || "100%", position: "absolute", backgroundColor: dropdownListBG || "var(--dropdown-bg)", boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)", border: "1px solid var(--divider, #f5f5f5)", zIndex: 10, marginTop: 4, borderRadius: 4, overflow: "hidden" }, clickStyle), { display: !isOpen ? "none" : "" }), children: [searchEnabled && (_jsx("li", { style: { padding: "0.5rem" }, children: _jsx("input", { ref: searchInputRef, type: "text", placeholder: "Search...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), disabled: disabled, style: {
308
308
  width: "100%",
309
309
  padding: "0.5rem",
310
310
  boxSizing: "border-box",
311
311
  border: "1px solid",
312
312
  borderColor: searchBorderColor,
313
313
  borderRadius: 4,
314
- } }) })), isSelectAll && isMultiple && filteredOptions.length > 0 && (_jsxs("li", { style: Object.assign(Object.assign(Object.assign(Object.assign({}, listItemStyle), { display: "flex", alignItems: "center" }), (-1 === highlightIndex ? listItemHoverStyle : {})), { borderBottom: "1px solid #dddddd", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between" }), onMouseEnter: (e) => {
314
+ } }) })), isSelectAll && isMultiple && filteredOptions.length > 0 && (_jsxs("li", { style: Object.assign(Object.assign(Object.assign(Object.assign({}, listItemStyle), { display: "flex", alignItems: "center" }), (-1 === highlightIndex ? listItemHoverStyle : {})), { borderBottom: "1px solid var(--divider-strong, #dddddd)", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between" }), onMouseEnter: (e) => {
315
315
  setHighlightIndex(-1);
316
316
  }, onClick: () => onSelectChange ? handleAllItemSelect() : handleAllSelect(), children: [_jsx("div", { style: { marginRight: "0.5rem" }, children: _jsx(Checkbox, { selected: intermediateValues
317
317
  .sort((a, b) => (a > b ? -1 : 1))
@@ -337,7 +337,7 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
337
337
  ? selectedItemStyle
338
338
  : {})), { borderBottom: index === filteredOptions.length - 1
339
339
  ? "none"
340
- : "1px solid #dddddd", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between" }), onMouseEnter: (e) => {
340
+ : "1px solid var(--divider-strong, #dddddd)", wordWrap: "break-word", textWrap: "wrap", justifyContent: "space-between" }), onMouseEnter: (e) => {
341
341
  if (!option.disabled) {
342
342
  setHighlightIndex(index);
343
343
  }
@@ -350,7 +350,7 @@ const Dropdown = ({ options, selectedValues, onChange, placeholder = "Select..."
350
350
  alignItems: "center",
351
351
  justifyContent: "end",
352
352
  padding: "0.75rem 0.5rem",
353
- borderTop: "1px solid #f5f5f5",
353
+ borderTop: "1px solid var(--divider, #f5f5f5)",
354
354
  }, children: _jsx(Button, { text: "Apply", fontSize: "", fontWeight: "", color: "#FFFFFF", backgroundColor: "#2377BA", borderColor: "#2377BA", onClick: () => {
355
355
  onApplyChange(intermediateValues);
356
356
  setIsOpen(false);
@@ -1155,7 +1155,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
1155
1155
  // };
1156
1156
  return (_jsxs("div", { style: {
1157
1157
  height,
1158
- backgroundColor: isFullScreen ? "white" : "transparent",
1158
+ backgroundColor: isFullScreen ? "var(--background)" : "transparent",
1159
1159
  }, className: wrapperClass, ref: entrieGridRef, children: [isOpen && (_jsx("div", { style: {
1160
1160
  position: "fixed",
1161
1161
  width: "100vw",
@@ -1170,7 +1170,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
1170
1170
  }, onClick: closeSetting, ref: modalContent, children: _jsxs("div", { style: {
1171
1171
  height: "100vh",
1172
1172
  width: "20rem",
1173
- background: "#fff",
1173
+ background: "var(--background)",
1174
1174
  overflow: "hidden",
1175
1175
  display: "flex",
1176
1176
  flexDirection: "column",
@@ -1395,7 +1395,7 @@ const Grid = ({ columns, wrapperClass, updateGridColumns, data, height, sortable
1395
1395
  display: "flex",
1396
1396
  alignItems: "center",
1397
1397
  justifyContent: "center",
1398
- background: "#fff",
1398
+ background: "var(--background)",
1399
1399
  }, children: _jsx(Loader, { size: 32 }) })), _jsx("div", { id: "table-body", children: gridGroupBy !== "" ? (_jsx(GroupedGridDetails, { locale: locale, formatOptions: formatOptions, groupedData: groupedData, rowOpened: rowOpened, startIndex: startIndex, endIndex: endIndex, alternateRowColor: alternateRowColor, updateRowOpened: updateRowOpened, columnWidths: columnWidths, columnHeights: columnHeights, groupBy: groupBy, widthMode: widthMode, rowKey: rowKey, rowHeight: rowHeight, headerBackground: headerBackground, isSummarise: summariseAvailable, gridGroupBy: gridGroupBy, rowStyle: rowStyle, sortable: sortable, cellStyle: cellStyle, summariseKeys: summariseKeys, summariseDetails: summariseDetails, activeCalculateColor: activeCalculateColor, gridRef: gridRef, setCalculatePosition: setCalculatePosition, calculatePosition: calculatePosition, calculatetextColor: calculatetextColor, setCalculateVisible: setCalculateVisible, calculateVisible: calculateVisible, summariseDisplay: summariseDisplay, recalculate: recalculate, selectedRowStyle: selectedRowStyle, isLoading: isLoading, selectedRow: selectedRow, onRowClick: onRowClick, gridColumns: gridColumns, bulkSelect: bulkSelect, selectedRows: selectedRows, toggleRowSelection: toggleRowSelection, hasVerticalScroll: hasVerticalScroll, setColumnWidths: setColumnWidths, setColumnHeights: setColumnHeights, actionsKey: actionsKey })) : (_jsxs(_Fragment, { children: [(paginate ? paginatedData : sortedData).map((item, index) => {
1400
1400
  var _a, _b, _c, _d;
1401
1401
  if (paginate) {
@@ -368,7 +368,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
368
368
  visibility: ((_20 = headerColumns.find((column) => column.key === _groupBy)) === null || _20 === void 0 ? void 0 : _20.search)
369
369
  ? "visible"
370
370
  : "hidden",
371
- }, height: 32, width: "100%", className: "w-full", backgroundColor: "#fff" })) }), onFilter: onFilter, setUniqueSearch: setUniqueSearch, uniqueSearch: uniqueSearch, textFilterLabel: textFilterLabel, activeSearchType: ((_22 = searchQueries[((_21 = headerColumns.find((column) => column.key === _groupBy)) === null || _21 === void 0 ? void 0 : _21.key) || ""]) === null || _22 === void 0 ? void 0 : _22.type) ||
371
+ }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), onFilter: onFilter, setUniqueSearch: setUniqueSearch, uniqueSearch: uniqueSearch, textFilterLabel: textFilterLabel, activeSearchType: ((_22 = searchQueries[((_21 = headerColumns.find((column) => column.key === _groupBy)) === null || _21 === void 0 ? void 0 : _21.key) || ""]) === null || _22 === void 0 ? void 0 : _22.type) ||
372
372
  defaultSearchOperation ||
373
373
  "contains", checkboxWrapper: checkboxWrapper })) : (_jsx(TextFilterDropdown, { columnIndex: -1, combined: false, headerDropdownIndex: headerDropdownIndex, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions.filter((item) => item.label !== "Group by"), onClose: () => setDropdownVisible(null), column: headerColumns.find((column) => column.key === _groupBy) }), searchOptions: searchOptions.filter((item) => {
374
374
  var _a, _b;
@@ -418,7 +418,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
418
418
  visibility: ((_37 = headerColumns.find((column) => column.key === _groupBy)) === null || _37 === void 0 ? void 0 : _37.search)
419
419
  ? "visible"
420
420
  : "hidden",
421
- }, height: 32, width: "100%", className: "w-full", backgroundColor: "#fff" })) : (_jsx(DateInput, { value: (_39 = searchQueries[((_38 = headerColumns.find((column) => column.key === _groupBy)) === null || _38 === void 0 ? void 0 : _38.key) || ""]) === null || _39 === void 0 ? void 0 : _39.text.split("to")[0], placeholder: `asd Filter ${(_40 = headerColumns.find((column) => column.key === _groupBy)) === null || _40 === void 0 ? void 0 : _40.label}`, onChange: (value) => {
421
+ }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) : (_jsx(DateInput, { value: (_39 = searchQueries[((_38 = headerColumns.find((column) => column.key === _groupBy)) === null || _38 === void 0 ? void 0 : _38.key) || ""]) === null || _39 === void 0 ? void 0 : _39.text.split("to")[0], placeholder: `asd Filter ${(_40 = headerColumns.find((column) => column.key === _groupBy)) === null || _40 === void 0 ? void 0 : _40.label}`, onChange: (value) => {
422
422
  var _a, _b, _c;
423
423
  return onSearch(((_a = headerColumns.find((column) => column.key === _groupBy)) === null || _a === void 0 ? void 0 : _a.key) || "", value, ((_c = searchQueries[((_b = headerColumns.find((column) => column.key === _groupBy)) === null || _b === void 0 ? void 0 : _b.key) || ""]) === null || _c === void 0 ? void 0 : _c.type) ||
424
424
  defaultSearchOperation ||
@@ -437,7 +437,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
437
437
  visibility: ((_44 = headerColumns.find((column) => column.key === _groupBy)) === null || _44 === void 0 ? void 0 : _44.search)
438
438
  ? "visible"
439
439
  : "hidden",
440
- }, height: 32, width: "100%", className: "w-full", backgroundColor: "#fff" })) }), activeSearchType: ((_46 = searchQueries[((_45 = headerColumns.find((column) => column.key === _groupBy)) === null || _45 === void 0 ? void 0 : _45.key) || ""]) === null || _46 === void 0 ? void 0 : _46.type) ||
440
+ }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), activeSearchType: ((_46 = searchQueries[((_45 = headerColumns.find((column) => column.key === _groupBy)) === null || _45 === void 0 ? void 0 : _45.key) || ""]) === null || _46 === void 0 ? void 0 : _46.type) ||
441
441
  defaultSearchOperation ||
442
442
  "contains", searchInput: (search &&
443
443
  ((_47 = headerColumns.find((column) => column.key === _groupBy)) === null || _47 === void 0 ? void 0 : _47.search) && (_jsx("div", { style: {
@@ -503,9 +503,9 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
503
503
  onSearch(((_c = headerColumns.find((column) => column.key === _groupBy)) === null || _c === void 0 ? void 0 : _c.key) || "", e.target.value, searchType);
504
504
  }, value: ((_59 = searchQueries[((_58 = headerColumns.find((column) => column.key === _groupBy)) === null || _58 === void 0 ? void 0 : _58.key) || ""]) === null || _59 === void 0 ? void 0 : _59.text) || "", disabled: !((_60 = headerColumns.find((column) => column.key === _groupBy)) === null || _60 === void 0 ? void 0 : _60.search), extraWrapperStyle: {
505
505
  background: ((_61 = headerColumns.find((column) => column.key === _groupBy)) === null || _61 === void 0 ? void 0 : _61.search)
506
- ? "#fff"
507
- : "#eee",
508
- }, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }) }))] }, (_62 = headerColumns.find((column) => column.key === _groupBy)) === null || _62 === void 0 ? void 0 : _62.key)) }));
506
+ ? "var(--background)"
507
+ : "var(--disabled-bg)",
508
+ }, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) }))] }, (_62 = headerColumns.find((column) => column.key === _groupBy)) === null || _62 === void 0 ? void 0 : _62.key)) }));
509
509
  }), headerColumns
510
510
  .filter((column) => !groupBy.includes(column.key))
511
511
  .map((column, colIndex) => {
@@ -609,7 +609,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
609
609
  visibility: column.search
610
610
  ? "visible"
611
611
  : "hidden",
612
- }, height: 32, width: "100%", className: "w-full", backgroundColor: "#fff" })) }), onFilter: onFilter, setUniqueSearch: setUniqueSearch, uniqueSearch: uniqueSearch, textFilterLabel: textFilterLabel, activeSearchType: ((_h = searchQueries[column.key]) === null || _h === void 0 ? void 0 : _h.type) ||
612
+ }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), onFilter: onFilter, setUniqueSearch: setUniqueSearch, uniqueSearch: uniqueSearch, textFilterLabel: textFilterLabel, activeSearchType: ((_h = searchQueries[column.key]) === null || _h === void 0 ? void 0 : _h.type) ||
613
613
  defaultSearchOperation ||
614
614
  "contains", checkboxWrapper: checkboxWrapper, searchInput: search &&
615
615
  column.search && (_jsx("div", { style: {
@@ -639,7 +639,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
639
639
  ? "var(--background)"
640
640
  : "var(--disabled-bg)",
641
641
  }, placeholder: "Search", value: ((_j = searchQueries[column.key]) === null || _j === void 0 ? void 0 : _j.text) ||
642
- "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }) })) })) : (_jsx(TextFilterDropdown, { combined: false, columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number" ||
642
+ "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) })) })) : (_jsx(TextFilterDropdown, { combined: false, columnIndex: colIndex, searchable: (column === null || column === void 0 ? void 0 : column.search) || false, sortingOps: _jsx(GridHeaderDropdown, { options: menuOptions, onClose: () => setDropdownVisible(null), column: column }), headerDropdownIndex: headerDropdownIndex, searchOptions: searchOptions.filter((item) => column.dataType === "number" ||
643
643
  column.dataType === "currency"
644
644
  ? numberTypeSearch.includes(item.value)
645
645
  : column.dataType === "date"
@@ -686,7 +686,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
686
686
  visibility: column.search
687
687
  ? "visible"
688
688
  : "hidden",
689
- }, height: 32, width: "100%", className: "w-full", backgroundColor: "#fff" })) : (_jsx(DateInput, { value: (_q = searchQueries[column.key]) === null || _q === void 0 ? void 0 : _q.text.split("to")[0], placeholder: `asd Filter ${column.label}`, onChange: (value) => {
689
+ }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) : (_jsx(DateInput, { value: (_q = searchQueries[column.key]) === null || _q === void 0 ? void 0 : _q.text.split("to")[0], placeholder: `asd Filter ${column.label}`, onChange: (value) => {
690
690
  var _a;
691
691
  return onSearch(column.key, value, ((_a = searchQueries[column.key]) === null || _a === void 0 ? void 0 : _a.type) ||
692
692
  defaultSearchOperation ||
@@ -705,7 +705,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
705
705
  visibility: column.search
706
706
  ? "visible"
707
707
  : "hidden",
708
- }, height: 32, width: "100%", className: "w-full", backgroundColor: "#fff" })) }), activeSearchType: ((_s = searchQueries[column.key]) === null || _s === void 0 ? void 0 : _s.type) ||
708
+ }, height: 32, width: "100%", className: "w-full", backgroundColor: "var(--background)" })) }), activeSearchType: ((_s = searchQueries[column.key]) === null || _s === void 0 ? void 0 : _s.type) ||
709
709
  defaultSearchOperation ||
710
710
  "contains", searchInput: (search && column.search && (_jsx("div", { style: {
711
711
  padding: "0.5rem",
@@ -733,7 +733,7 @@ const GridHeader = ({ columns, onSearch, searchQueries, sortable, search, resiza
733
733
  ? "var(--background)"
734
734
  : "var(--disabled-bg)",
735
735
  }, value: ((_t = searchQueries[column.key]) === null || _t === void 0 ? void 0 : _t.text) ||
736
- "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "#fff" }) }))) ||
736
+ "", disabled: !column.search, height: 32, extraInputStyle: { minWidth: 10 }, className: "w-full", backgroundColor: "var(--background)" }) }))) ||
737
737
  null })))] })) })] }), search && columnSearchOutside && (_jsx("div", { style: {
738
738
  marginTop: "0.5rem",
739
739
  width: (hugColumnWidths === null || hugColumnWidths === void 0 ? void 0 : hugColumnWidths[`column-${column.key}`]) ||
@@ -91,8 +91,8 @@ const GroupedGrid = ({ groupedData, rowOpened, startIndex, endIndex, alternateRo
91
91
  }, className: `group-column ${item.key}`, onClick: () => updateRowOpened(item.groupedValue), children: [_jsx("span", { style: {
92
92
  fontSize: "inherit",
93
93
  marginRight: "0.5rem",
94
- color: "black",
95
- background: "#dedede",
94
+ color: "var(--foreground)",
95
+ background: "var(--disabled-bg)",
96
96
  width: "1rem",
97
97
  height: "1rem",
98
98
  flexGrow: 0,
@@ -26,8 +26,10 @@ const Pagination = ({ currentPage, totalPages, handleChangePage, rowsPerPage, ha
26
26
  }
27
27
  return pageNumbers;
28
28
  };
29
- return (_jsx("div", { className: "pagination text-sm px-2.5", children: _jsxs("div", { children: [_jsx("button", { onClick: () => handleChangePage(currentPage - 1), disabled: currentPage === 1, style: currentPage === 1 ? { cursor: "not-allowed", color: "#ccc" } : {}, children: "Prev" }), renderPageNumbers(), _jsx("button", { onClick: () => handleChangePage(currentPage + 1), disabled: currentPage >= totalPages, style: currentPage >= totalPages
30
- ? { cursor: "not-allowed", color: "#ccc" }
29
+ return (_jsx("div", { className: "pagination text-sm px-2.5", children: _jsxs("div", { children: [_jsx("button", { onClick: () => handleChangePage(currentPage - 1), disabled: currentPage === 1, style: currentPage === 1
30
+ ? { cursor: "not-allowed", color: "var(--muted, #ccc)" }
31
+ : {}, children: "Prev" }), renderPageNumbers(), _jsx("button", { onClick: () => handleChangePage(currentPage + 1), disabled: currentPage >= totalPages, style: currentPage >= totalPages
32
+ ? { cursor: "not-allowed", color: "var(--muted, #ccc)" }
31
33
  : {}, children: "Next" }), _jsx("select", { value: rowsPerPage, onChange: handleChangeRowsPerPage, children: rowsPerPageOptions.map((option) => (_jsx("option", { value: option, children: option }, option))) })] }) }));
32
34
  };
33
35
  export default Pagination;
@@ -14,8 +14,14 @@ const Shimmer = ({ style, width, height }) => {
14
14
  overflow: hidden;
15
15
  display: flex;
16
16
  align-items: center;
17
- background: #f6f7f8;
18
- background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
17
+ background: var(--shimmer-base, #f6f7f8);
18
+ background-image: linear-gradient(
19
+ to right,
20
+ var(--shimmer-base, #f6f7f8) 0%,
21
+ var(--shimmer-highlight, #edeef1) 20%,
22
+ var(--shimmer-base, #f6f7f8) 40%,
23
+ var(--shimmer-base, #f6f7f8) 100%
24
+ );
19
25
  background-repeat: no-repeat;
20
26
  background-size: 1000px 100%;
21
27
  animation: shimmer 1.2s infinite;
@@ -17,7 +17,7 @@ const Spinner = styled.div `
17
17
  border-radius: 50%;
18
18
  animation: ${spin} 1s linear infinite;
19
19
  `;
20
- const Loader = ({ size = 40, color = "#3498db", className = "", }) => {
20
+ const Loader = ({ size = 24, color = "var(--accent, #3498db)", className = "", }) => {
21
21
  return _jsx(Spinner, { size: size, color: color, className: className });
22
22
  };
23
23
  export default Loader;
@@ -54,8 +54,8 @@ export const Tab = ({ label, description, tabNumber }) => {
54
54
  fontWeight: 700,
55
55
  fontSize: "1rem",
56
56
  marginRight: "0.5rem",
57
- background: isActive ? "#2377BA" : "#fff",
58
- color: isActive ? "#fff" : "#4D4D4D",
57
+ background: isActive ? "#2377BA" : "var(--background)",
58
+ color: isActive ? "#fff" : "var(--foreground)",
59
59
  padding: "0.5rem 1rem",
60
60
  borderRadius: "0.35rem",
61
61
  minWidth: "1.75rem",
@@ -64,7 +64,7 @@ export const Tab = ({ label, description, tabNumber }) => {
64
64
  display: "flex",
65
65
  flexDirection: "column",
66
66
  }, children: [_jsx("span", { style: { fontWeight: 500, fontSize: "1rem" }, children: label }), showTabDescription && description && (_jsx("span", { style: {
67
- color: "#4D4D4D",
67
+ color: "var(--foreground)",
68
68
  fontWeight: 400,
69
69
  fontSize: "0.85rem",
70
70
  }, children: description }))] })] }) }));
@@ -78,6 +78,6 @@ export const TabPanel = ({ label, children, className, }) => {
78
78
  const isActive = activeTab === label;
79
79
  return isActive ? (_jsx("div", { className: className, style: {
80
80
  flex: 1,
81
- background: "white",
81
+ background: "var(--background)",
82
82
  }, children: children })) : null;
83
83
  };
@@ -10,7 +10,7 @@ const Textarea = ({ value = "", onChange, onBlur = () => { }, placeholder = "",
10
10
  borderRadius,
11
11
  fontSize,
12
12
  resize,
13
- border: "1px solid #dbdfe9",
13
+ border: "1px solid var(--form-border-color, #dbdfe9)",
14
14
  fontFamily: "var(--font-family)",
15
15
  };
16
16
  const labelStyle = {
@@ -204,7 +204,7 @@ const TextEditor = ({ value, onChange, enabledTools = {
204
204
  };
205
205
  return (_jsxs("div", { style: {
206
206
  width: "100%",
207
- border: "1px solid #ccc",
207
+ border: "1px solid var(--divider, #ccc)",
208
208
  borderRadius: "0.25rem",
209
209
  padding: "0.65rem",
210
210
  position: "relative",
@@ -212,7 +212,7 @@ const TextEditor = ({ value, onChange, enabledTools = {
212
212
  display: "flex",
213
213
  gap: "0.65rem",
214
214
  marginBottom: "0.65rem",
215
- borderBottom: "1px solid #ccc",
215
+ borderBottom: "1px solid var(--divider, #ccc)",
216
216
  paddingBottom: "0.25rem",
217
217
  flexWrap: "wrap",
218
218
  }, children: [enabledTools.headingOptions && (_jsxs("select", { onChange: (e) => applyHeading(e.target.value), style: buttonStyle, children: [_jsx("option", { value: "p", children: "Normal" }), _jsx("option", { value: "h1", children: "H1" }), _jsx("option", { value: "h2", children: "H2" }), _jsx("option", { value: "h3", children: "H3" })] })), enabledTools.bold && (_jsx("button", { type: "button", onClick: () => toggleFormat("bold"), style: buttonStyle, children: _jsx(IconBold, {}) })), enabledTools.italic && (_jsx("button", { type: "button", onClick: () => toggleFormat("italic"), style: buttonStyle, children: _jsx(IconItalic, {}) })), enabledTools.underline && (_jsx("button", { type: "button", onClick: () => toggleFormat("underline"), style: buttonStyle, children: _jsx(IconUnderline, {}) })), enabledTools.strikeThrough && (_jsx("button", { type: "button", onClick: () => toggleFormat("strikeThrough"), style: buttonStyle, children: _jsx(IconStrikethrough, {}) })), enabledTools.bulletList && (_jsx("button", { type: "button", onClick: () => insertList("ul"), style: buttonStyle, children: _jsx(IconFormatListBulleted, {}) })), enabledTools.numberList && (_jsx("button", { type: "button", onClick: () => insertList("ol"), style: buttonStyle, children: _jsx(IconFormatListNumbered, {}) })), enabledTools.textAlign && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: () => toggleFormat("justifyLeft"), style: buttonStyle, children: _jsx(IconAlignLeft, {}) }), _jsx("button", { type: "button", onClick: () => toggleFormat("justifyCenter"), style: buttonStyle, children: _jsx(IconAlignCenter, {}) }), _jsx("button", { type: "button", onClick: () => toggleFormat("justifyRight"), style: buttonStyle, children: _jsx(IconAlignRight, {}) })] })), enabledTools.textColor && (_jsx("input", { type: "color", onChange: (e) => toggleFormat("foreColor", e.target.value), style: Object.assign(Object.assign({}, buttonStyle), { width: 32, padding: 0 }) })), enabledTools.imageUpload && (_jsxs("div", { style: { position: "relative" }, children: [_jsx("button", { type: "button", onClick: toggleImageDropdown, style: buttonStyle, children: _jsx(IconImage, {}) }), showImageDropdown && (_jsxs("div", { style: dropdownStyle, children: [_jsx("button", { type: "button", onClick: () => {
@@ -223,14 +223,14 @@ const TextEditor = ({ value, onChange, enabledTools = {
223
223
  }, style: dropdownItemStyle, children: "Insert from URL" }), _jsxs("label", { style: Object.assign(Object.assign({}, dropdownItemStyle), { cursor: "pointer" }), children: ["Upload from Computer", _jsx("input", { type: "file", accept: "image/*", onChange: handleImageUpload, style: { display: "none" } })] })] }))] })), enabledTools.linkOptions && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: insertLink, style: buttonStyle, children: _jsx(IconLink, {}) }), _jsx("button", { type: "button", onClick: removeLink, style: buttonStyle, children: _jsx(IconUnlink, {}) })] }))] }), _jsx("div", { ref: editorRef, contentEditable: true, onInput: updateContent, onClick: handleEditorClick, suppressContentEditableWarning: true, style: {
224
224
  minHeight: "10rem",
225
225
  padding: "0.65rem",
226
- border: "1px solid #ddd",
226
+ border: "1px solid var(--divider-strong, #ddd)",
227
227
  borderRadius: "0.25rem",
228
228
  outline: "none",
229
229
  } })] }));
230
230
  };
231
231
  const buttonStyle = {
232
232
  padding: "0.25rem 0.65rem",
233
- border: "1px solid #ccc",
233
+ border: "1px solid var(--divider, #ccc)",
234
234
  borderRadius: "3px",
235
235
  cursor: "pointer",
236
236
  background: "var(--editor-btn)",
@@ -241,7 +241,7 @@ const dropdownStyle = {
241
241
  top: "100%",
242
242
  left: 0,
243
243
  background: "var(--editor-btn)",
244
- border: "1px solid #ccc",
244
+ border: "1px solid var(--divider, #ccc)",
245
245
  borderRadius: "3px",
246
246
  boxShadow: "0px 2px 0.25rem rgba(0, 0, 0, 0.2)",
247
247
  padding: "0.25rem",
@@ -16,7 +16,7 @@ const Toggle = ({ isChecked = false, onChange, label, disabled = false, activeCo
16
16
  left: 0,
17
17
  right: 0,
18
18
  bottom: 0,
19
- backgroundColor: "#ccc",
19
+ backgroundColor: "var(--disabled-bg)",
20
20
  transition: "0.4s",
21
21
  borderRadius: "1.5rem",
22
22
  };
@@ -30,7 +30,7 @@ const Toggle = ({ isChecked = false, onChange, label, disabled = false, activeCo
30
30
  width: "1rem",
31
31
  left: "0.125rem",
32
32
  bottom: "0.125rem",
33
- backgroundColor: "white",
33
+ backgroundColor: "var(--background)",
34
34
  transition: "0.4s",
35
35
  borderRadius: "50%",
36
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.179",
3
+ "version": "1.2.181",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",