pixelize-design-library 2.4.2-beta.34 → 2.4.2-beta.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/AppSwitcher/AppSwitcher.js +10 -4
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -3
- package/dist/Components/Common/fieldStyles.js +1 -1
- package/dist/Components/CopyButton/CopyButton.js +7 -6
- package/dist/Components/DatePicker/CalendarPanel.js +8 -5
- package/dist/Components/DatePicker/RangeDatePicker.js +27 -3
- package/dist/Components/DatePicker/SingleDatePicker.js +48 -14
- package/dist/Components/DatePicker/TimeOnlyPicker.js +7 -1
- package/dist/Components/DatePicker/TimePicker.js +3 -3
- package/dist/Components/DatePicker/TimePickerInput.js +1 -1
- package/dist/Components/Dropdown/DropDown.js +19 -6
- package/dist/Components/EmptyState/EmptyState.js +1 -1
- package/dist/Components/FileUpload/FileUpload.js +2 -2
- package/dist/Components/FilterSidebar/FilterSidebar.js +5 -5
- package/dist/Components/FilterSidebar/filterHoverStyle.d.ts +2 -1
- package/dist/Components/FilterSidebar/filterHoverStyle.js +3 -4
- package/dist/Components/Input/TextInput.styles.js +2 -2
- package/dist/Components/InputTextArea/InputTextArea.style.js +2 -2
- package/dist/Components/MoreItems/MoreItems.js +3 -1
- package/dist/Components/MultiSelect/MultiSelect.js +2 -2
- package/dist/Components/NavigationBar/NavigationBar.js +6 -7
- package/dist/Components/NumberInput/NumberInput.styles.js +2 -2
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +14 -10
- package/dist/Components/PdfViewer/PdfViewer.js +4 -4
- package/dist/Components/RolesPermission/RolesPermission.js +4 -3
- package/dist/Components/SearchSelect/SearchSelect.js +46 -41
- package/dist/Components/Select/Select.styles.js +1 -1
- package/dist/Components/SelectSearch/SelectSearch.js +35 -17
- package/dist/Components/SelectV2/SelectV2.js +3 -0
- package/dist/Components/Table/TableProps.d.ts +2 -0
- package/dist/Components/Table/components/TableBody.js +7 -10
- package/dist/Components/Table/filters/CompactSelect.js +29 -8
- package/dist/Components/Table/settings/ManageColumns.js +5 -3
- package/dist/Components/Table/settings/TableSettings.js +4 -2
- package/dist/Components/Trail/EditableCell.js +1 -1
- package/dist/Components/UserDetails/DeactivateConfirmModal.js +1 -1
- package/dist/Components/UserDetails/UserDetails.js +5 -3
- package/dist/Hooks/exclusiveOverlay.d.ts +4 -0
- package/dist/Hooks/exclusiveOverlay.js +22 -0
- package/dist/Hooks/useExclusiveOverlay.d.ts +5 -0
- package/dist/Hooks/useExclusiveOverlay.js +24 -0
- package/dist/Theme/chakra/Menu.styles.js +4 -2
- package/dist/Utils/table.d.ts +3 -0
- package/dist/Utils/table.js +44 -1
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +11 -5
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -3
- package/dist/esm/Components/Common/fieldStyles.js +1 -1
- package/dist/esm/Components/CopyButton/CopyButton.js +7 -6
- package/dist/esm/Components/DatePicker/CalendarPanel.js +9 -6
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +28 -4
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +49 -15
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +7 -1
- package/dist/esm/Components/DatePicker/TimePicker.js +3 -3
- package/dist/esm/Components/DatePicker/TimePickerInput.js +1 -1
- package/dist/esm/Components/Dropdown/DropDown.js +20 -7
- package/dist/esm/Components/EmptyState/EmptyState.js +1 -1
- package/dist/esm/Components/FileUpload/FileUpload.js +2 -2
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +5 -5
- package/dist/esm/Components/FilterSidebar/filterHoverStyle.js +3 -4
- package/dist/esm/Components/Input/TextInput.styles.js +2 -2
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +2 -2
- package/dist/esm/Components/MoreItems/MoreItems.js +3 -1
- package/dist/esm/Components/MultiSelect/MultiSelect.js +2 -2
- package/dist/esm/Components/NavigationBar/NavigationBar.js +6 -7
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +2 -2
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +14 -10
- package/dist/esm/Components/PdfViewer/PdfViewer.js +4 -4
- package/dist/esm/Components/RolesPermission/RolesPermission.js +4 -3
- package/dist/esm/Components/SearchSelect/SearchSelect.js +46 -41
- package/dist/esm/Components/Select/Select.styles.js +1 -1
- package/dist/esm/Components/SelectSearch/SelectSearch.js +35 -17
- package/dist/esm/Components/SelectV2/SelectV2.js +3 -0
- package/dist/esm/Components/Table/components/TableBody.js +7 -10
- package/dist/esm/Components/Table/filters/CompactSelect.js +29 -8
- package/dist/esm/Components/Table/settings/ManageColumns.js +5 -3
- package/dist/esm/Components/Table/settings/TableSettings.js +5 -3
- package/dist/esm/Components/Trail/EditableCell.js +1 -1
- package/dist/esm/Components/UserDetails/DeactivateConfirmModal.js +1 -1
- package/dist/esm/Components/UserDetails/UserDetails.js +5 -3
- package/dist/esm/Hooks/exclusiveOverlay.js +16 -0
- package/dist/esm/Hooks/useExclusiveOverlay.js +20 -0
- package/dist/esm/Theme/chakra/Menu.styles.js +4 -2
- package/dist/esm/Utils/table.js +45 -3
- package/package.json +1 -1
|
@@ -10,25 +10,38 @@ const react_2 = require("@chakra-ui/react");
|
|
|
10
10
|
const FormLabel_1 = require("../Common/FormLabel");
|
|
11
11
|
const fieldStyles_1 = require("../Common/fieldStyles");
|
|
12
12
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
13
|
-
const
|
|
13
|
+
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
14
|
+
const useExclusiveOverlay_1 = require("../../Hooks/useExclusiveOverlay");
|
|
14
15
|
const lucide_react_1 = require("lucide-react");
|
|
15
16
|
const ErrorMessage_1 = __importDefault(require("../Common/ErrorMessage"));
|
|
16
17
|
const RenderOptions = ({ isOptionLoading, filteredOptions, loadingText, handleOptionClick, isProfile, isColorOptions, isOptionSelected, activeIndex, optionRefs, }) => {
|
|
17
18
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
19
|
+
const rowBackgrounds = (0, react_1.useMemo)(() => (0, rowStates_1.listRowBackgrounds)(theme.colors), [theme.colors]);
|
|
18
20
|
if (isOptionLoading) {
|
|
19
21
|
return ((0, jsx_runtime_1.jsxs)(react_2.VStack, { py: 2, children: [(0, jsx_runtime_1.jsx)(react_2.Spinner, { size: "sm", color: theme.colors.accentText }), (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.accentText, children: loadingText })] }));
|
|
20
22
|
}
|
|
21
23
|
if (filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) {
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: filteredOptions.map((option, index) =>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: filteredOptions.map((option, index) => {
|
|
25
|
+
const selected = isOptionSelected(option);
|
|
26
|
+
const isActive = index === activeIndex;
|
|
27
|
+
const rowBg = selected
|
|
28
|
+
? isActive
|
|
29
|
+
? rowBackgrounds.selectedActive
|
|
30
|
+
: rowBackgrounds.selected
|
|
31
|
+
: isActive
|
|
32
|
+
? rowBackgrounds.active
|
|
33
|
+
: "transparent";
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "button", type: "button", ref: (el) => {
|
|
35
|
+
optionRefs.current[index] = el;
|
|
36
|
+
}, role: "option", "aria-selected": selected, tabIndex: isActive ? 0 : -1, w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", bg: rowBg, px: 4, py: 2, cursor: "pointer", color: theme.colors.text[700], fontWeight: selected ? 600 : 500, transition: "background 0.12s ease", _hover: {
|
|
37
|
+
bg: selected ? rowBackgrounds.selectedActive : rowBackgrounds.active,
|
|
38
|
+
}, onClick: () => handleOptionClick(option), onKeyDown: (e) => {
|
|
39
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
handleOptionClick(option);
|
|
42
|
+
}
|
|
43
|
+
}, display: "flex", alignItems: "center", gap: "0.5rem", children: [isProfile && ((0, jsx_runtime_1.jsx)(react_2.Box, { children: (0, jsx_runtime_1.jsx)(react_2.Avatar, { size: "sm", name: option.label.toLocaleUpperCase(), src: option.profileUrl ? option.profileUrl : undefined }) })), isColorOptions && ((0, jsx_runtime_1.jsx)(react_2.Box, { width: "0.8rem", height: "0.8rem", content: "", backgroundColor: option === null || option === void 0 ? void 0 : option.color, borderRadius: "50%" })), (0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.Box, { children: option.label }), option.email && ((0, jsx_runtime_1.jsx)(react_2.Box, { fontSize: 12, color: theme.colors.textMuted, children: option.email }))] })] }, option.id));
|
|
44
|
+
}) }));
|
|
32
45
|
}
|
|
33
46
|
return ((0, jsx_runtime_1.jsx)(react_2.Text, { px: 4, py: 2, color: theme.colors.textMuted, children: "No options found" }));
|
|
34
47
|
};
|
|
@@ -43,6 +56,11 @@ BottomIcon = false, BottomText, handleBottomClick, BottomTextColor, isColorOptio
|
|
|
43
56
|
const [selectedOptions, setSelectedOptions] = (0, react_1.useState)(initialSelectedOption ? [initialSelectedOption] : []);
|
|
44
57
|
const [inputValue, setInputValue] = (0, react_1.useState)(searchQuery);
|
|
45
58
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
59
|
+
const requestExclusiveOpen = (0, useExclusiveOverlay_1.useExclusiveOverlay)(isOpen, () => setIsOpen(false));
|
|
60
|
+
const openDropdown = (0, react_1.useCallback)(() => {
|
|
61
|
+
requestExclusiveOpen();
|
|
62
|
+
setIsOpen(true);
|
|
63
|
+
}, [requestExclusiveOpen]);
|
|
46
64
|
const [position, setPosition] = (0, react_1.useState)("below");
|
|
47
65
|
const inputRef = (0, react_1.useRef)(null);
|
|
48
66
|
const dropdownRef = (0, react_1.useRef)(null);
|
|
@@ -194,7 +212,7 @@ BottomIcon = false, BottomText, handleBottomClick, BottomTextColor, isColorOptio
|
|
|
194
212
|
handleOptionClick(matchingOption);
|
|
195
213
|
}
|
|
196
214
|
else if (!isOpen) {
|
|
197
|
-
|
|
215
|
+
openDropdown();
|
|
198
216
|
}
|
|
199
217
|
}
|
|
200
218
|
else if (e.key === "ArrowDown") {
|
|
@@ -203,7 +221,7 @@ BottomIcon = false, BottomText, handleBottomClick, BottomTextColor, isColorOptio
|
|
|
203
221
|
e.preventDefault();
|
|
204
222
|
if (!isOpen) {
|
|
205
223
|
pendingFocusFirstOption.current = true;
|
|
206
|
-
|
|
224
|
+
openDropdown();
|
|
207
225
|
}
|
|
208
226
|
else if (filteredOptions.length > 0) {
|
|
209
227
|
focusOption(0);
|
|
@@ -249,12 +267,12 @@ BottomIcon = false, BottomText, handleBottomClick, BottomTextColor, isColorOptio
|
|
|
249
267
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
250
268
|
};
|
|
251
269
|
}, [isOpen]);
|
|
252
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(react_2.FormControl, { isInvalid: error, children: (0, jsx_runtime_1.jsxs)(react_2.Box, { display: "flex", flexDirection: "column", position: "relative", sx: boxStyle, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, id: id, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), isMultipleSelect && selectedOptions.length > 0 && ((0, jsx_runtime_1.jsx)(react_2.HStack, { spacing: 2, mb: 2, children: selectedOptions.map((option) => ((0, jsx_runtime_1.jsxs)(react_2.Tag, { size: "md", borderRadius: "full", variant: "solid", colorScheme: "primary", children: [(0, jsx_runtime_1.jsx)(react_2.TagLabel, { width: "50px", children: option.label }), (0, jsx_runtime_1.jsx)(react_2.TagCloseButton, { onClick: () => handleRemoveOption(option) })] }, option.id))) })), (0, jsx_runtime_1.jsxs)(react_2.InputGroup, { children: [(0, jsx_runtime_1.jsx)(react_2.Input, { ref: inputRef, variant: "outline", borderRadius: fieldStyles_1.FIELD_RADIUS, value: inputValue ? inputValue : "", onClick:
|
|
270
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(react_2.FormControl, { isInvalid: error, children: (0, jsx_runtime_1.jsxs)(react_2.Box, { display: "flex", flexDirection: "column", position: "relative", sx: boxStyle, children: [label && ((0, jsx_runtime_1.jsx)(FormLabel_1.TextLabel, { label: label, id: id, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), isMultipleSelect && selectedOptions.length > 0 && ((0, jsx_runtime_1.jsx)(react_2.HStack, { spacing: 2, mb: 2, children: selectedOptions.map((option) => ((0, jsx_runtime_1.jsxs)(react_2.Tag, { size: "md", borderRadius: "full", variant: "solid", colorScheme: "primary", children: [(0, jsx_runtime_1.jsx)(react_2.TagLabel, { width: "50px", children: option.label }), (0, jsx_runtime_1.jsx)(react_2.TagCloseButton, { onClick: () => handleRemoveOption(option) })] }, option.id))) })), (0, jsx_runtime_1.jsxs)(react_2.InputGroup, { children: [(0, jsx_runtime_1.jsx)(react_2.Input, { ref: inputRef, variant: "outline", borderRadius: fieldStyles_1.FIELD_RADIUS, value: inputValue ? inputValue : "", onClick: openDropdown, onFocus: () => {
|
|
253
271
|
if (skipNextInputFocusOpen.current) {
|
|
254
272
|
skipNextInputFocusOpen.current = false;
|
|
255
273
|
return;
|
|
256
274
|
}
|
|
257
|
-
|
|
275
|
+
openDropdown();
|
|
258
276
|
}, onChange: (e) => handleInputChange(e.target.value), placeholder: placeholder, onKeyDown: handleKeyDown, id: id, name: name, role: "combobox", "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-expanded": isOpen, "aria-controls": listboxId, cursor: "pointer", borderColor: theme.colors.boxborder[500], transition: "border-color 0.2s, box-shadow 0.2s", _hover: {
|
|
259
277
|
borderColor: error
|
|
260
278
|
? theme.colors.semanticText.error
|
|
@@ -266,9 +284,9 @@ BottomIcon = false, BottomText, handleBottomClick, BottomTextColor, isColorOptio
|
|
|
266
284
|
boxShadow: (0, fieldStyles_1.fieldFocusRing)(theme, !!error),
|
|
267
285
|
}, style: {
|
|
268
286
|
...inputStyle,
|
|
269
|
-
backgroundColor: theme.colors.
|
|
287
|
+
backgroundColor: theme.colors.background[50],
|
|
270
288
|
fontWeight: 600,
|
|
271
|
-
color: theme.colors.
|
|
289
|
+
color: theme.colors.text[700],
|
|
272
290
|
padding: "0 0.75rem",
|
|
273
291
|
fontSize: 15,
|
|
274
292
|
letterSpacing: 0.7,
|
|
@@ -46,6 +46,7 @@ const placeholderInk_1 = require("../../Theme/tokens/builders/placeholderInk");
|
|
|
46
46
|
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
47
47
|
const scrollbar_1 = require("../../Theme/tokens/builders/scrollbar");
|
|
48
48
|
const fieldStyles_1 = require("../Common/fieldStyles");
|
|
49
|
+
const useExclusiveOverlay_1 = require("../../Hooks/useExclusiveOverlay");
|
|
49
50
|
const FormLabel_1 = require("../Common/FormLabel");
|
|
50
51
|
const ErrorMessage_1 = __importDefault(require("../Common/ErrorMessage"));
|
|
51
52
|
const HelperText_1 = __importDefault(require("../Common/HelperText"));
|
|
@@ -74,6 +75,7 @@ function SelectV2(props) {
|
|
|
74
75
|
const { options = [], placeholder = "Select Option", label, error = false, errorMessage, helperText, isDisabled = false, isRequired = false, size = "md", isSearchable = true, width, formControlStyle, onBlur, onFocus, renderOption, renderValue, maxMenuHeight = "16rem", defaultOpen = false, "data-testid": dataTestId, "aria-label": ariaLabel, } = props;
|
|
75
76
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
76
77
|
const { isOpen, onOpen, onClose } = (0, react_2.useDisclosure)({ defaultIsOpen: defaultOpen });
|
|
78
|
+
const requestExclusiveOpen = (0, useExclusiveOverlay_1.useExclusiveOverlay)(isOpen, onClose);
|
|
77
79
|
const [filterText, setFilterText] = (0, react_1.useState)("");
|
|
78
80
|
const [activeIndex, setActiveIndex] = (0, react_1.useState)(-1);
|
|
79
81
|
const triggerRef = (0, react_1.useRef)(null);
|
|
@@ -105,6 +107,7 @@ function SelectV2(props) {
|
|
|
105
107
|
var _a;
|
|
106
108
|
if (isDisabled)
|
|
107
109
|
return;
|
|
110
|
+
requestExclusiveOpen();
|
|
108
111
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus();
|
|
109
112
|
onOpen();
|
|
110
113
|
const firstSelected = props.isMulti ? (_a = props.value) === null || _a === void 0 ? void 0 : _a[0] : props.value;
|
|
@@ -114,6 +114,8 @@ export type TableHeaderProps = {
|
|
|
114
114
|
isFreeze?: boolean;
|
|
115
115
|
isHidden?: boolean;
|
|
116
116
|
type?: "status";
|
|
117
|
+
/** Pre-resolved tone per value — preferred over `statusColors` hex overrides. */
|
|
118
|
+
statusPalette?: Record<string, import("../../Utils/table").TablePaletteColor>;
|
|
117
119
|
statusColors?: Record<string, string>;
|
|
118
120
|
columnType?: TableColumnType;
|
|
119
121
|
node?: (data: DataObject) => JSX.Element | string | number | undefined;
|
|
@@ -41,7 +41,6 @@ const react_1 = require("@chakra-ui/react");
|
|
|
41
41
|
const react_2 = __importStar(require("react"));
|
|
42
42
|
const table_1 = require("../../../Utils/table");
|
|
43
43
|
const useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
44
|
-
const accentText_1 = require("../../../Theme/tokens/builders/accentText");
|
|
45
44
|
const TableLoading_1 = require("./TableLoading");
|
|
46
45
|
const TableActions_1 = __importDefault(require("./TableActions"));
|
|
47
46
|
const lucide_react_1 = require("lucide-react");
|
|
@@ -137,7 +136,7 @@ const TableRow = react_2.default.memo(({ row, rowIndex, isChecked, isExpanded, i
|
|
|
137
136
|
const chromeHoverable = rowStyle ? "false" : "true";
|
|
138
137
|
const rowContent = getRowContent(row);
|
|
139
138
|
return ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_1.Tr, { ref: mainRowRef, "aria-rowindex": ariaRowIndex, opacity: isLoading ? 0.4 : 1, pointerEvents: isLoading ? "none" : "auto", transition: "opacity 0.2s", sx: rowSx, children: [isContent && ((0, jsx_runtime_1.jsx)(react_1.Td, { w: "6", p: 0, fontSize: 14, background: isChecked ? selectedFrozenBg : frozenCellBg, color: freezedTextColor, position: "sticky", borderBottom: borderStyle, boxShadow: leadSx, boxSizing: "border-box", "data-hoverable": chromeHoverable, left: "0px", zIndex: 1, className: "columns sticky-columns", children: !!(row === null || row === void 0 ? void 0 : row.content) && ((0, jsx_runtime_1.jsx)(react_1.IconButton, { "aria-label": isExpanded ? "Collapse row" : "Expand row", color: theme.colors.textMuted, icon: isExpanded ? ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { fontSize: 16 })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { fontSize: 16 })), _hover: { transform: "scale(1.1)" }, size: "sm", onClick: () => toggleRowExpansion(rowIndex), variant: "ghost" })) })), isCheckbox && ((0, jsx_runtime_1.jsx)(react_1.Td, { w: variant.slot.width, minW: variant.slot.width, px: variant.slot.centered ? 0 : undefined, textAlign: variant.slot.centered ? "center" : undefined, fontSize: 14, fontWeight: 600, color: theme.colors.background[50], textTransform: "capitalize", background: isChecked ? selectedFrozenBg : frozenCellBg, position: "sticky", borderBottom: borderStyle, boxShadow: !isContent ? leadSx : undefined, "data-hoverable": chromeHoverable, boxSizing: "border-box", left: "0px", zIndex: 1, className: "columns sticky-columns", children: (0, jsx_runtime_1.jsxs)(react_1.Box, { display: restsOnIndex ? "grid" : undefined, placeItems: "center", children: [restsOnIndex && ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", className: "table-slot-index", gridArea: "1 / 1", color: variant.slot.indexInk, fontSize: "0.6875rem", fontWeight: 500, transition: "opacity 0.15s ease-in-out", sx: { fontVariantNumeric: "tabular-nums" }, children: rowIndex + 1 })), (0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", className: restsOnIndex ? "table-slot-box" : undefined, gridArea: restsOnIndex ? "1 / 1" : undefined, display: "flex", alignItems: "center", justifyContent: "center", transition: "opacity 0.15s ease-in-out", children: (0, jsx_runtime_1.jsx)(Checkbox_1.default, { "aria-label": `Select row ${rowIndex + 1}`, onChange: () => handleCheckbox(getRowId(row)), isChecked: isChecked }) })] }) })), columns.map((header, headerIndex) => {
|
|
140
|
-
var _a, _b, _c;
|
|
139
|
+
var _a, _b, _c, _d;
|
|
141
140
|
if (header.isHidden)
|
|
142
141
|
return null;
|
|
143
142
|
const isFrozen = header.isFreeze;
|
|
@@ -145,21 +144,19 @@ const TableRow = react_2.default.memo(({ row, rowIndex, isChecked, isExpanded, i
|
|
|
145
144
|
const isStatus = header.type === "status" && !header.node;
|
|
146
145
|
const rawStatus = String((_a = row[header.id]) !== null && _a !== void 0 ? _a : "");
|
|
147
146
|
const statusColor = isStatus
|
|
148
|
-
? (0, table_1.pickTableColor)(rawStatus, palette, (
|
|
147
|
+
? (_c = (_b = header.statusPalette) === null || _b === void 0 ? void 0 : _b[rawStatus]) !== null && _c !== void 0 ? _c : (0, table_1.pickTableColor)(rawStatus, palette, (_d = header.statusColors) === null || _d === void 0 ? void 0 : _d[rawStatus], theme)
|
|
149
148
|
: null;
|
|
150
|
-
// Guards a `statusColor` built by an older external caller that predates `onSolid`.
|
|
151
|
-
const statusOnSolid = statusColor
|
|
152
|
-
? (_c = statusColor.onSolid) !== null && _c !== void 0 ? _c : (0, accentText_1.onFilled)(statusColor.solid, theme.colors.white, theme.colors.black)
|
|
153
|
-
: undefined;
|
|
154
149
|
const isBleed = variant.cells.statusFill === "bleed" && !!statusColor;
|
|
150
|
+
const bleedBg = statusColor === null || statusColor === void 0 ? void 0 : statusColor.soft;
|
|
151
|
+
const bleedInk = statusColor === null || statusColor === void 0 ? void 0 : statusColor.text;
|
|
155
152
|
const canHover = !isBleed && !((cellStyles === null || cellStyles === void 0 ? void 0 : cellStyles[header.id]) || rowStyle);
|
|
156
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Td, { maxWidth: 500, minWidth: 120, height: `${rowHeight}px`, py: isBleed ? 0 : cellPy, px: isBleed ? 0 : undefined, onClick: () => handleCellClick(header), fontSize: 14, fontWeight: 400, position: isFrozen ? "sticky" : undefined, left: isFrozen ? leftOffsets[headerIndex] : undefined, zIndex: isFrozen ? 1 : 0, background: isBleed ?
|
|
153
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Td, { maxWidth: 500, minWidth: 120, height: `${rowHeight}px`, py: isBleed ? 0 : cellPy, px: isBleed ? 0 : undefined, onClick: () => handleCellClick(header), fontSize: 14, fontWeight: 400, position: isFrozen ? "sticky" : undefined, left: isFrozen ? leftOffsets[headerIndex] : undefined, zIndex: isFrozen ? 1 : 0, background: isBleed ? bleedBg : isChecked ? (isFrozen ? selectedFrozenBg : selectedBg) : isFrozen ? frozenCellBg : theme.colors.background[50], textOverflow: "ellipsis", boxShadow: isFirstDataCell ? leadSx : undefined, borderBottom: noBorders
|
|
157
154
|
? "none"
|
|
158
155
|
: `0.063rem solid ${isFrozen || isChecked
|
|
159
156
|
? variant.row.frozenRuleColor
|
|
160
|
-
: variant.row.ruleColor}`, className: `columns ${isFrozen ? "sticky-columns" : "scrollable-columns"}`, boxSizing: "border-box", color: isBleed ?
|
|
157
|
+
: variant.row.ruleColor}`, className: `columns ${isFrozen ? "sticky-columns" : "scrollable-columns"}`, boxSizing: "border-box", color: isBleed ? bleedInk : variant.cells.ink, "data-hoverable": canHover ? "true" : "false", _hover: variant.row.hoverScope === "row" || !canHover
|
|
161
158
|
? EMPTY_HOVER
|
|
162
|
-
: hoverStyle, children: isBleed ? ((0, jsx_runtime_1.jsx)(StatusCell, { value: (0, table_1.normalizeTableCellValue)(row[header.id]), onSolid:
|
|
159
|
+
: hoverStyle, children: isBleed ? ((0, jsx_runtime_1.jsx)(StatusCell, { value: (0, table_1.normalizeTableCellValue)(row[header.id]), onSolid: bleedInk })) : isStatus && statusColor ? ((0, jsx_runtime_1.jsx)(StatusPill, { value: (0, table_1.normalizeTableCellValue)(row[header.id]), soft: statusColor.soft, ink: (0, pillInk_1.resolvePillInk)(statusColor.text, statusColor.soft, theme.colors.background[50]), radius: variant.cells.pillRadius })) : ((0, jsx_runtime_1.jsx)(react_1.Box, { display: "block", overflow: "hidden", whiteSpace: "normal", overflowWrap: "break-word", children: (0, table_1.normalizeTableCellValue)(header.node ? header.node(row) : row[header.id]) })) }, headerIndex + 1));
|
|
163
160
|
}), isLink && ((0, jsx_runtime_1.jsx)(react_1.Td, { w: 2, p: 0, fontSize: 14, background: isChecked ? (isActionFreeze ? selectedFrozenBg : selectedBg) : isActionFreeze ? frozenCellBg : theme.colors.background[50], color: freezedTextColor, position: isActionFreeze ? "sticky" : "relative", borderBottom: borderStyle, boxSizing: "border-box", right: 0, zIndex: 1, className: `columns sticky-columns${isActionFreeze ? "-right" : ""}`, children: (row.onLink || row.onEdit || row.onDelete) ? ((0, jsx_runtime_1.jsx)(TableActions_1.default, { row: row })) : null }))] }), rowContent && isExpanded && ((0, jsx_runtime_1.jsx)(react_1.Tr, { ref: expandedRowRef, children: (0, jsx_runtime_1.jsx)(react_1.Td, { colSpan: columns.length +
|
|
164
161
|
(isCheckbox ? 1 : 0) +
|
|
165
162
|
(isContent ? 1 : 0) +
|
|
@@ -5,9 +5,17 @@ const react_1 = require("react");
|
|
|
5
5
|
const react_2 = require("@chakra-ui/react");
|
|
6
6
|
const lucide_react_1 = require("lucide-react");
|
|
7
7
|
const useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
8
|
+
const rowStates_1 = require("../../../Theme/tokens/builders/rowStates");
|
|
9
|
+
const useExclusiveOverlay_1 = require("../../../Hooks/useExclusiveOverlay");
|
|
8
10
|
const CompactSelect = ({ options, value, placeholder = "Select", height = "22px", onSelect, size = "xs" }) => {
|
|
9
11
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
12
|
+
const rowBackgrounds = (0, react_1.useMemo)(() => (0, rowStates_1.listRowBackgrounds)(theme.colors), [theme.colors]);
|
|
10
13
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
14
|
+
const requestExclusiveOpen = (0, useExclusiveOverlay_1.useExclusiveOverlay)(isOpen, () => setIsOpen(false));
|
|
15
|
+
const openDropdown = () => {
|
|
16
|
+
requestExclusiveOpen();
|
|
17
|
+
setIsOpen(true);
|
|
18
|
+
};
|
|
11
19
|
const [query, setQuery] = (0, react_1.useState)("");
|
|
12
20
|
const filtered = (0, react_1.useMemo)(() => {
|
|
13
21
|
const q = query.trim().toLowerCase();
|
|
@@ -40,17 +48,30 @@ const CompactSelect = ({ options, value, placeholder = "Select", height = "22px"
|
|
|
40
48
|
focusOption(filtered.length - 1);
|
|
41
49
|
}
|
|
42
50
|
}, [activeIndex, filtered.length, focusOption]);
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: isOpen, onClose: () => setIsOpen(false), placement: "bottom-start", children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsxs)(react_2.Box, { as: "button", type: "button", w: "100%", h: typeof height === "number" ? `${height}px` : height, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, px: 2, border: "0.063rem solid", borderColor: theme.colors.boxborder[500], bg: theme.colors.background[50], borderRadius: "base", onClick: () => setIsOpen(
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: isOpen, onClose: () => setIsOpen(false), placement: "bottom-start", children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsxs)(react_2.Box, { as: "button", type: "button", w: "100%", h: typeof height === "number" ? `${height}px` : height, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, px: 2, border: "0.063rem solid", borderColor: theme.colors.boxborder[500], bg: theme.colors.background[50], borderRadius: "base", onClick: () => (isOpen ? setIsOpen(false) : openDropdown()), children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: size === "xs" ? "0.75rem" : "0.875rem", color: theme.colors.text[500], noOfLines: 1, textAlign: "left", children: (value === null || value === void 0 ? void 0 : value.label) || placeholder }), isOpen ? (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { size: 12 }) : (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 12 })] }) }), (0, jsx_runtime_1.jsx)(react_2.Portal, { children: (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { w: "100%", maxW: "14rem", p: 0, zIndex: 1600, bg: theme.colors.background[50], children: (0, jsx_runtime_1.jsx)(react_2.PopoverBody, { p: 2, children: (0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 2, align: "stretch", children: [(0, jsx_runtime_1.jsx)(react_2.Input, { size: size, placeholder: "Search", value: query, onChange: (e) => setQuery(e.target.value), onKeyDown: (e) => {
|
|
44
52
|
if (e.key === "ArrowDown" && filtered.length > 0) {
|
|
45
53
|
e.preventDefault();
|
|
46
54
|
focusOption(0);
|
|
47
55
|
}
|
|
48
|
-
}, sx: { fontSize: "0.75rem", height: "22px" } }), (0, jsx_runtime_1.jsxs)(react_2.Box, { role: "listbox", "aria-label": placeholder, maxH: "12rem", overflowY: "auto", borderTop: "1px solid", borderColor: theme.colors.boxborder[200], onKeyDown: handleListKeyDown, children: [filtered.map((opt, i) =>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
}, sx: { fontSize: "0.75rem", height: "22px" } }), (0, jsx_runtime_1.jsxs)(react_2.Box, { role: "listbox", "aria-label": placeholder, maxH: "12rem", overflowY: "auto", borderTop: "1px solid", borderColor: theme.colors.boxborder[200], onKeyDown: handleListKeyDown, children: [filtered.map((opt, i) => {
|
|
57
|
+
const selected = (value === null || value === void 0 ? void 0 : value.id) === opt.id;
|
|
58
|
+
const isActive = i === activeIndex;
|
|
59
|
+
const rowBg = selected
|
|
60
|
+
? isActive
|
|
61
|
+
? rowBackgrounds.selectedActive
|
|
62
|
+
: rowBackgrounds.selected
|
|
63
|
+
: isActive
|
|
64
|
+
? rowBackgrounds.active
|
|
65
|
+
: theme.colors.transparent;
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", role: "option", "aria-selected": selected, tabIndex: isActive ? 0 : -1, ref: (el) => {
|
|
67
|
+
optionRefs.current[i] = el;
|
|
68
|
+
}, w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", px: 2, py: 1, cursor: "pointer", color: theme.colors.text[700], _hover: {
|
|
69
|
+
bg: selected ? rowBackgrounds.selectedActive : rowBackgrounds.active,
|
|
70
|
+
}, bg: rowBg, onClick: () => {
|
|
71
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(opt);
|
|
72
|
+
setIsOpen(false);
|
|
73
|
+
setQuery("");
|
|
74
|
+
}, children: (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "0.75rem", children: opt.label }) }, opt.id));
|
|
75
|
+
}), filtered.length === 0 && ((0, jsx_runtime_1.jsx)(react_2.Box, { px: 2, py: 2, children: (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "0.75rem", color: theme.colors.textMuted, children: "No results" }) }))] })] }) }) }) })] }));
|
|
55
76
|
};
|
|
56
77
|
exports.default = CompactSelect;
|
|
@@ -10,9 +10,11 @@ const Checkbox_1 = __importDefault(require("../../Checkbox/Checkbox"));
|
|
|
10
10
|
const useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
11
11
|
const scrollbar_1 = require("../../../Theme/tokens/builders/scrollbar");
|
|
12
12
|
const accentText_1 = require("../../../Theme/tokens/builders/accentText");
|
|
13
|
+
const rowStates_1 = require("../../../Theme/tokens/builders/rowStates");
|
|
13
14
|
const lucide_react_1 = require("lucide-react");
|
|
14
15
|
const ManageColumns = ({ columns, items, setItems, childInputMethodsRef, }) => {
|
|
15
16
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
17
|
+
const rowBackgrounds = (0, react_1.useMemo)(() => (0, rowStates_1.listRowBackgrounds)(theme.colors), [theme.colors]);
|
|
16
18
|
const [searchTerm, setSearchTerm] = (0, react_1.useState)("");
|
|
17
19
|
const [draggedItemIndex, setDraggedItemIndex] = (0, react_1.useState)(null);
|
|
18
20
|
const [error, setError] = (0, react_1.useState)(null);
|
|
@@ -83,14 +85,14 @@ const ManageColumns = ({ columns, items, setItems, childInputMethodsRef, }) => {
|
|
|
83
85
|
return ((0, jsx_runtime_1.jsxs)(react_2.ListItem, { draggable: true, onDragStart: () => handleDragStart(index), onDragOver: (e) => handleDragOver(e, index), onDragEnd: handleDragEnd, bg: isDraggingThisItem
|
|
84
86
|
? theme.colors.primary[100]
|
|
85
87
|
: isDropZone
|
|
86
|
-
?
|
|
88
|
+
? rowBackgrounds.selected
|
|
87
89
|
: "transparent", display: "flex", alignItems: "center", borderRadius: "sm", border: "1px solid", borderColor: isDraggingThisItem
|
|
88
90
|
? theme.colors.primary[400]
|
|
89
91
|
: "transparent", cursor: "grab", fontSize: "13px", px: 2, py: "3px", mb: "3px", transition: "all 0.15s ease", _hover: {
|
|
90
|
-
bg:
|
|
92
|
+
bg: rowBackgrounds.active,
|
|
91
93
|
borderColor: theme.colors.boxborder[200],
|
|
92
94
|
}, _active: { cursor: "grabbing" }, children: [(0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", "aria-hidden": "true", display: "inline-flex", cursor: "grab", mr: 1, _hover: { color: theme.colors.gray[500] }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.GripVertical, { size: 14 }) }), (0, jsx_runtime_1.jsx)(Checkbox_1.default, { isChecked: !item.isHidden, label: String(item.label), onChange: () => toggleCheckbox(item.id), size: "sm", labelSx: {
|
|
93
|
-
color: item.isHidden ? theme.colors.
|
|
95
|
+
color: item.isHidden ? theme.colors.textMuted : theme.colors.text[700],
|
|
94
96
|
} }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "12px", color: theme.colors.gray[500], ml: 'auto', children: index + 1 }), (0, jsx_runtime_1.jsx)(react_2.IconButton, { "aria-label": `Move ${item.label} up`, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { size: 14 }), variant: "ghost", size: "xs", ml: 1, minW: "auto", h: "auto", p: 0, color: theme.colors.gray[500], isDisabled: realIndex <= 0, onClick: () => moveItem(item.id, -1) }), (0, jsx_runtime_1.jsx)(react_2.IconButton, { "aria-label": `Move ${item.label} down`, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 14 }), variant: "ghost", size: "xs", ml: 1, minW: "auto", h: "auto", p: 0, color: theme.colors.gray[500], isDisabled: realIndex === -1 || realIndex >= items.length - 1, onClick: () => moveItem(item.id, 1) })] }, item.id));
|
|
95
97
|
})) : ((0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.textMuted, textAlign: "center", fontSize: "sm", py: 6, children: "No columns found" })) }), (0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "xs", color: theme.colors.gray[500], mt: 2, textAlign: "right", children: [visibleCount, " / ", items.length, " visible"] })] }));
|
|
96
98
|
};
|
|
@@ -13,6 +13,7 @@ const useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
|
13
13
|
const scrollbar_1 = require("../../../Theme/tokens/builders/scrollbar");
|
|
14
14
|
const lucide_react_1 = require("lucide-react");
|
|
15
15
|
const ToolTip_1 = __importDefault(require("../../ToolTip/ToolTip"));
|
|
16
|
+
const rowStates_1 = require("../../../Theme/tokens/builders/rowStates");
|
|
16
17
|
const MotionModalContent = (0, framer_motion_1.motion)(react_1.ModalContent);
|
|
17
18
|
const DENSITY_OPTIONS = [
|
|
18
19
|
{ value: "compact", label: "Compact", desc: "Tight rows — fit more data on screen" },
|
|
@@ -21,6 +22,7 @@ const DENSITY_OPTIONS = [
|
|
|
21
22
|
];
|
|
22
23
|
const TableSettings = ({ columns, onSave, density = "normal", onDensityChange, groupBy, }) => {
|
|
23
24
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
25
|
+
const rowBackgrounds = (0, react_2.useMemo)(() => (0, rowStates_1.listRowBackgrounds)(theme.colors), [theme.colors]);
|
|
24
26
|
const childInputMethodsRef = (0, react_2.useRef)({});
|
|
25
27
|
const [settingsOpen, setSettingsOpen] = (0, react_2.useState)(false);
|
|
26
28
|
const [selectedIndex, setSelectedIndex] = (0, react_2.useState)(0);
|
|
@@ -55,7 +57,7 @@ const TableSettings = ({ columns, onSave, density = "normal", onDensityChange, g
|
|
|
55
57
|
color: theme.colors.accentText
|
|
56
58
|
} }) }), (0, jsx_runtime_1.jsxs)(react_1.Modal, { isOpen: settingsOpen, onClose: () => setSettingsOpen(false), size: "md", children: [(0, jsx_runtime_1.jsx)(react_1.ModalOverlay, {}), (0, jsx_runtime_1.jsxs)(MotionModalContent, { mt: "0", top: "0", position: "absolute", borderTopRadius: "none", initial: { y: "-100%", opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: "-100%", opacity: 0 }, transition: { duration: 0.4, ease: "easeOut" }, padding: "0", minW: "620px", minH: "520px", maxH: "90vh", display: "flex", flexDirection: "column", bg: theme.colors.background[50], overflow: "hidden", children: [(0, jsx_runtime_1.jsx)(react_1.ModalCloseButton, { top: 3, right: 3, zIndex: 2 }), (0, jsx_runtime_1.jsxs)(react_1.Tabs, { index: selectedIndex, onChange: setSelectedIndex, variant: "unstyled", display: "flex", flexDirection: "column", flex: "1", minH: 0, children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { pt: 4, px: 4, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontWeight: 600, fontSize: "md", mb: 3, children: "Table Settings" }), (0, jsx_runtime_1.jsxs)(react_1.TabList, { gap: 0, borderBottom: "1px solid", borderColor: theme.colors.boxborder[200], children: [(0, jsx_runtime_1.jsx)(react_1.Tab, { ...tabStyle, children: "Density" }), (0, jsx_runtime_1.jsx)(react_1.Tab, { ...tabStyle, children: "Manage Columns" }), (0, jsx_runtime_1.jsx)(react_1.Tab, { ...tabStyle, children: "Group" })] })] }), (0, jsx_runtime_1.jsx)(react_1.ModalBody, { px: 4, py: 3, flex: "1", overflowY: "auto", sx: (0, scrollbar_1.scrollbarStyles)(theme.colors), children: (0, jsx_runtime_1.jsxs)(react_1.TabPanels, { children: [(0, jsx_runtime_1.jsx)(react_1.TabPanel, { px: 0, py: 1, children: (0, jsx_runtime_1.jsx)(react_1.Flex, { direction: "column", gap: 2, children: DENSITY_OPTIONS.map((opt) => {
|
|
57
59
|
const selected = density === opt.value;
|
|
58
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { as: "button", type: "button", align: "center", gap: 3, px: 3, py: 2.5, borderRadius: "lg", border: "1px solid", borderColor: selected ? theme.colors.accentText : theme.colors.boxborder[200], bg: selected ?
|
|
60
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { as: "button", type: "button", align: "center", gap: 3, px: 3, py: 2.5, borderRadius: "lg", border: "1px solid", borderColor: selected ? theme.colors.accentText : theme.colors.boxborder[200], bg: selected ? rowBackgrounds.selected : theme.colors.transparent, transition: "all 0.15s", _hover: { borderColor: theme.colors.accentText }, onClick: () => onDensityChange === null || onDensityChange === void 0 ? void 0 : onDensityChange(opt.value), children: [(0, jsx_runtime_1.jsx)(react_1.Box, { boxSize: "1.1rem", borderRadius: "full", border: "2px solid", borderColor: selected ? theme.colors.accentText : theme.colors.boxborder[500], display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0, children: selected && (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: 11, color: theme.colors.accentText, strokeWidth: 3 }) }), (0, jsx_runtime_1.jsxs)(react_1.Box, { textAlign: "left", children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "13px", fontWeight: 600, color: theme.colors.text[700], children: opt.label }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "11px", color: theme.colors.textMuted, children: opt.desc })] })] }, opt.value));
|
|
59
61
|
}) }) }), (0, jsx_runtime_1.jsx)(react_1.TabPanel, { px: 0, py: 0, children: (0, jsx_runtime_1.jsx)(react_1.Box, { sx: {
|
|
60
62
|
"& [role='listitem'], & > div > div": {
|
|
61
63
|
py: "4px !important",
|
|
@@ -73,7 +75,7 @@ const TableSettings = ({ columns, onSave, density = "normal", onDensityChange, g
|
|
|
73
75
|
.map((opt) => {
|
|
74
76
|
var _a;
|
|
75
77
|
const selected = selectedGroup === opt.id;
|
|
76
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { as: "button", type: "button", align: "center", gap: 3, px: 3, py: 2.5, borderRadius: "lg", border: "1px solid", borderColor: selected ? theme.colors.accentText : theme.colors.boxborder[200], bg: selected ?
|
|
78
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { as: "button", type: "button", align: "center", gap: 3, px: 3, py: 2.5, borderRadius: "lg", border: "1px solid", borderColor: selected ? theme.colors.accentText : theme.colors.boxborder[200], bg: selected ? rowBackgrounds.selected : theme.colors.transparent, transition: "all 0.15s", _hover: { borderColor: theme.colors.accentText }, onClick: () => setSelectedGroup(opt.id), children: [(0, jsx_runtime_1.jsx)(react_1.Box, { boxSize: "1.1rem", borderRadius: "full", border: "2px solid", borderColor: selected ? theme.colors.accentText : theme.colors.boxborder[500], display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0, children: selected && (0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: 11, color: theme.colors.accentText, strokeWidth: 3 }) }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "13px", fontWeight: 600, color: theme.colors.text[700], textAlign: "left", children: opt.label })] }, String((_a = opt.id) !== null && _a !== void 0 ? _a : "__none__")));
|
|
77
79
|
}) })] })] }) })] }), (0, jsx_runtime_1.jsxs)(react_1.ModalFooter, { gap: "0.5rem", borderTop: "1px solid", borderColor: theme.colors.boxborder[200], pt: 3, pb: 3, px: 4, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { label: "Close", size: "sm", onClick: () => setSettingsOpen(false), variant: "outline", colorScheme: "red" }), (0, jsx_runtime_1.jsx)(Button_1.default, { label: "Save", size: "sm", onClick: handleSave })] })] })] })] }));
|
|
78
80
|
};
|
|
79
81
|
exports.default = TableSettings;
|
|
@@ -23,7 +23,7 @@ const EditableCell = ({ row, column, isEditable, handleCellClick, handleCellChan
|
|
|
23
23
|
return ((0, jsx_runtime_1.jsx)(react_2.Box, { width: "50%", ref: cellRef, children: (0, jsx_runtime_1.jsx)(react_2.Input, { type: "date", value: value, onChange: (e) => handleCellChange(row.id, column.label, e.target.value) }) }));
|
|
24
24
|
}
|
|
25
25
|
else if (column.label === "priority") {
|
|
26
|
-
return ((0, jsx_runtime_1.jsx)(react_2.Box, { width: "100%", ref: cellRef, children: (0, jsx_runtime_1.jsxs)(react_2.Menu, { isOpen: true, children: [(0, jsx_runtime_1.jsx)(react_2.MenuButton, { as: react_2.Button, rightIcon: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, {}), bg: colors.teal[50], color: (0, accentText_1.accentTextOnCanvas)(colors.teal, colors.teal[50]), _hover: { bg: colors.teal[100] }, _active: { bg: colors.teal[200] }, children: value }), (0, jsx_runtime_1.jsxs)(react_2.MenuList, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuItem, { onClick: () => handleCellChange(row.id, column.label, "Low"),
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Box, { width: "100%", ref: cellRef, children: (0, jsx_runtime_1.jsxs)(react_2.Menu, { isOpen: true, children: [(0, jsx_runtime_1.jsx)(react_2.MenuButton, { as: react_2.Button, rightIcon: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, {}), bg: colors.teal[50], color: (0, accentText_1.accentTextOnCanvas)(colors.teal, colors.teal[50]), _hover: { bg: colors.teal[100] }, _active: { bg: colors.teal[200] }, children: value }), (0, jsx_runtime_1.jsxs)(react_2.MenuList, { children: [(0, jsx_runtime_1.jsx)(react_2.MenuItem, { onClick: () => handleCellChange(row.id, column.label, "Low"), children: "Low" }), (0, jsx_runtime_1.jsx)(react_2.MenuItem, { onClick: () => handleCellChange(row.id, column.label, "Medium"), children: "Medium" }), (0, jsx_runtime_1.jsx)(react_2.MenuItem, { onClick: () => handleCellChange(row.id, column.label, "High"), children: "High" })] })] }) }));
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
return ((0, jsx_runtime_1.jsx)(react_2.Box, { width: "100%", ref: cellRef, children: (0, jsx_runtime_1.jsx)(react_2.Input, { value: value, onChange: (e) => handleCellChange(row.id, column.label, e.target.value) }) }));
|
|
@@ -14,6 +14,6 @@ const DeactivateConfirmModal = ({ isOpen, onClose, userName, isLoading, onConfir
|
|
|
14
14
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
15
15
|
const mode = (0, accentText_1.isDarkCanvas)(colors.backgroundColor.main) ? "dark" : "light";
|
|
16
16
|
const errorTone = (0, statusTone_1.resolveStatusTone)(colors.semantic.error, mode);
|
|
17
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, children: [(0, jsx_runtime_1.jsx)(react_1.ModalOverlay, { backdropFilter: "blur(4px)" }), (0, jsx_runtime_1.jsxs)(react_1.ModalContent, { bg: colors.background[50], borderRadius: "2xl", overflow: "hidden", children: [(0, jsx_runtime_1.jsxs)(react_1.ModalHeader, { borderBottom: "1px solid", borderColor: colors.boxborder[200], display: "flex", alignItems: "center", gap: 3, children: [(0, jsx_runtime_1.jsx)(react_1.Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "full", bg: errorTone.bg, color: errorTone.fg, children: (0, jsx_runtime_1.jsx)(lucide_react_1.AlertTriangle, { size: 18 }) }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "1.05rem", fontWeight: 600, children: labels.confirmDeactivation })] }), (0, jsx_runtime_1.jsx)(react_1.ModalCloseButton, {}), (0, jsx_runtime_1.jsx)(react_1.ModalBody, { py: 6, children: (0, jsx_runtime_1.jsxs)(react_1.VStack, { spacing: 4, align: "stretch", children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "md", fontWeight: 500, color: colors.text[900], children: labels.deactivateConfirmQuestion }), (0, jsx_runtime_1.jsx)(react_1.Box, { bg: colors.
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, children: [(0, jsx_runtime_1.jsx)(react_1.ModalOverlay, { backdropFilter: "blur(4px)" }), (0, jsx_runtime_1.jsxs)(react_1.ModalContent, { bg: colors.background[50], borderRadius: "2xl", overflow: "hidden", children: [(0, jsx_runtime_1.jsxs)(react_1.ModalHeader, { borderBottom: "1px solid", borderColor: colors.boxborder[200], display: "flex", alignItems: "center", gap: 3, children: [(0, jsx_runtime_1.jsx)(react_1.Flex, { align: "center", justify: "center", boxSize: "36px", borderRadius: "full", bg: errorTone.bg, color: errorTone.fg, children: (0, jsx_runtime_1.jsx)(lucide_react_1.AlertTriangle, { size: 18 }) }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "1.05rem", fontWeight: 600, children: labels.confirmDeactivation })] }), (0, jsx_runtime_1.jsx)(react_1.ModalCloseButton, {}), (0, jsx_runtime_1.jsx)(react_1.ModalBody, { py: 6, children: (0, jsx_runtime_1.jsxs)(react_1.VStack, { spacing: 4, align: "stretch", children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "md", fontWeight: 500, color: colors.text[900], children: labels.deactivateConfirmQuestion }), (0, jsx_runtime_1.jsx)(react_1.Box, { bg: colors.background[50], borderRadius: "lg", p: 4, border: "1px solid", borderColor: colors.boxborder[200], children: (0, jsx_runtime_1.jsxs)(react_1.Text, { color: colors.textMuted, fontSize: "sm", children: [userName ? `${userName} ` : "", labels.deactivateConfirmDescription] }) }), (0, jsx_runtime_1.jsxs)(react_1.HStack, { justifyContent: "flex-end", spacing: 3, pt: 2, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { label: labels.cancel, onClick: onClose, variant: "outline", size: "sm", colorScheme: "gray" }), (0, jsx_runtime_1.jsx)(Button_1.default, { label: labels.deactivateUser, onClick: onConfirm, colorScheme: "red", size: "sm", isLoading: isLoading, leftIcon: (0, jsx_runtime_1.jsx)(lucide_react_1.Trash2, { size: 16 }) })] })] }) })] })] }));
|
|
18
18
|
};
|
|
19
19
|
exports.default = DeactivateConfirmModal;
|
|
@@ -43,6 +43,7 @@ const lucide_react_1 = require("lucide-react");
|
|
|
43
43
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
44
44
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
45
45
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
46
|
+
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
46
47
|
const EmptyState_1 = __importDefault(require("../EmptyState/EmptyState"));
|
|
47
48
|
const AddUserModal_1 = __importDefault(require("./AddUserModal"));
|
|
48
49
|
const ChangeRoleModal_1 = __importDefault(require("./ChangeRoleModal"));
|
|
@@ -93,6 +94,7 @@ const UserDetails = ({ users, selectedUser, selectedUserId, roleOptions = [], ca
|
|
|
93
94
|
const [actionUserId, setActionUserId] = (0, react_1.useState)(null);
|
|
94
95
|
const border = colors.boxborder[200];
|
|
95
96
|
const surface = colors.background[50];
|
|
97
|
+
const rowBackgrounds = (0, react_1.useMemo)(() => (0, rowStates_1.listRowBackgrounds)(colors), [colors]);
|
|
96
98
|
const muted = colors.textMuted;
|
|
97
99
|
const heading = colors.text[900];
|
|
98
100
|
const avatarBg = colors.primary[100];
|
|
@@ -109,10 +111,10 @@ const UserDetails = ({ users, selectedUser, selectedUserId, roleOptions = [], ca
|
|
|
109
111
|
const renderStatusBadge = (isActive) => ((0, jsx_runtime_1.jsx)(react_2.Badge, { variant: "subtle", colorScheme: isActive ? successScheme : dangerScheme, borderRadius: "full", px: 2, py: 0.5, fontSize: "0.65rem", fontWeight: 600, textTransform: "none", children: isActive ? labels.active : labels.inactive }));
|
|
110
112
|
return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { backgroundColor: colors.backgroundColor.main, minHeight: minHeight, p: { base: 3, md: 4 }, gap: 3, flexDirection: { base: "column", lg: "row" }, children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { width: { base: "100%", lg: "300px" }, backgroundColor: surface, borderRadius: "xl", boxShadow: "sm", border: "1px solid", borderColor: border, position: "relative", order: { base: 2, lg: 1 }, overflow: "hidden", display: "flex", flexDirection: "column", children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { px: 4, py: 3, borderBottom: "1px solid", borderColor: border, alignItems: "center", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [onBack && ((0, jsx_runtime_1.jsx)(react_2.IconButton, { "aria-label": "Go back", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronLeft, { size: 18 }), variant: "ghost", size: "xs", color: muted, onClick: onBack })), (0, jsx_runtime_1.jsx)(react_2.Heading, { size: "sm", fontWeight: 600, color: heading, children: labels.teamMembers }), (0, jsx_runtime_1.jsx)(react_2.Badge, { colorScheme: "gray", borderRadius: "full", fontSize: "0.65rem", px: 2, children: users.length })] }), onRefresh && ((0, jsx_runtime_1.jsx)(react_2.IconButton, { "aria-label": labels.refreshList, icon: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { size: 15 }), variant: "ghost", size: "xs", color: muted, onClick: onRefresh, isLoading: isUsersLoading }))] }), (0, jsx_runtime_1.jsx)(react_2.Box, { flex: 1, overflowY: "auto", maxHeight: { base: "380px", lg: `calc(${minHeight} - 80px)` }, children: isUsersLoading ? ((0, jsx_runtime_1.jsx)(react_2.VStack, { spacing: 2, p: 3, children: Array.from({ length: 6 }).map((_, idx) => ((0, jsx_runtime_1.jsxs)(react_2.Flex, { alignItems: "center", gap: 3, p: 2, w: "100%", children: [(0, jsx_runtime_1.jsx)(react_2.SkeletonCircle, { size: "9" }), (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: 1, children: [(0, jsx_runtime_1.jsx)(react_2.Skeleton, { height: "12px", mb: 2, width: "80%" }), (0, jsx_runtime_1.jsx)(react_2.Skeleton, { height: "9px", width: "60%" })] })] }, idx))) })) : users.length === 0 ? ((0, jsx_runtime_1.jsx)(EmptyState_1.default, { icon: lucide_react_1.Users, title: labels.noUsers, size: "sm", minH: "220px" })) : ((0, jsx_runtime_1.jsx)(react_2.VStack, { spacing: 1, p: 2, align: "stretch", children: users.map((user) => {
|
|
111
113
|
const isSelected = selectedUserId != null && selectedUserId === user.id;
|
|
112
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { p: 2.5, w: "100%", cursor: "pointer", alignItems: "center", gap: 2.5, backgroundColor: isSelected ?
|
|
114
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { p: 2.5, w: "100%", cursor: "pointer", alignItems: "center", gap: 2.5, backgroundColor: isSelected ? rowBackgrounds.selected : "transparent", _hover: {
|
|
113
115
|
background: isSelected
|
|
114
|
-
?
|
|
115
|
-
:
|
|
116
|
+
? rowBackgrounds.selectedActive
|
|
117
|
+
: rowBackgrounds.active,
|
|
116
118
|
}, transition: "background 0.15s ease", borderRadius: "lg", position: "relative", onClick: () => onSelectUser === null || onSelectUser === void 0 ? void 0 : onSelectUser(user), children: [isSelected && ((0, jsx_runtime_1.jsx)(react_2.Box, { position: "absolute", left: 0, top: "20%", bottom: "20%", width: "3px", borderRadius: "full", bg: colors.primary[500] })), (0, jsx_runtime_1.jsx)(react_2.Avatar, { size: "sm", name: `${user.firstName} ${user.lastName}`, src: user.profile, bg: avatarBg, color: avatarColor }), (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: 1, overflow: "hidden", children: [(0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "sm", fontWeight: 600, noOfLines: 1, color: heading, children: [user.firstName, " ", user.lastName] }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "xs", color: muted, noOfLines: 1, children: user.email })] }), renderStatusBadge(user.isActive)] }, user.id));
|
|
117
119
|
}) })) })] }), (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: 1, backgroundColor: surface, borderRadius: "xl", boxShadow: "sm", border: "1px solid", borderColor: border, display: "flex", flexDirection: "column", order: { base: 1, lg: 2 }, overflow: "hidden", children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { justifyContent: "space-between", alignItems: "center", px: 4, py: 3, borderBottom: "1px solid", borderColor: border, children: [(0, jsx_runtime_1.jsx)(react_2.Heading, { size: "sm", fontWeight: 600, color: heading, children: selectedUser ? labels.userDetails : labels.selectTeamMember }), canManageUsers && ((0, jsx_runtime_1.jsx)(react_2.Button, { size: "sm", colorScheme: "primary", fontSize: "xs", leftIcon: (0, jsx_runtime_1.jsx)(lucide_react_1.UserPlus, { size: 15 }), onClick: onAddUserOpen, children: labels.addUser }))] }), (0, jsx_runtime_1.jsx)(react_2.Box, { flex: 1, overflowY: "auto", children: isUsersLoading ? ((0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 4, p: 4, align: "stretch", children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 4, children: [(0, jsx_runtime_1.jsx)(react_2.SkeletonCircle, { size: "16" }), (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: 1, children: [(0, jsx_runtime_1.jsx)(react_2.Skeleton, { height: "18px", width: "50%", mb: 2 }), (0, jsx_runtime_1.jsx)(react_2.Skeleton, { height: "12px", width: "35%" })] })] }), Array.from({ length: 4 }).map((_, idx) => ((0, jsx_runtime_1.jsxs)(react_2.Box, { w: "100%", children: [(0, jsx_runtime_1.jsx)(react_2.Skeleton, { height: "12px", width: "30%", mb: 2 }), (0, jsx_runtime_1.jsx)(react_2.Skeleton, { height: "10px", width: "80%" })] }, idx)))] })) : selectedUser ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { direction: { base: "column", md: "row" }, alignItems: { base: "flex-start", md: "center" }, justifyContent: "space-between", gap: 4, p: 4, borderBottom: "1px solid", borderColor: border, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { alignItems: "center", gap: 4, children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { position: "relative", children: [(0, jsx_runtime_1.jsx)(react_2.Avatar, { size: "lg", name: selectedUser.name, src: selectedUser.profilePhoto, bg: avatarBg, color: avatarColor }), selectedUser.isCurrent && ((0, jsx_runtime_1.jsx)(react_2.Badge, { position: "absolute", bottom: -1, right: -1, colorScheme: "blue", variant: "solid", fontSize: "0.6rem", borderRadius: "full", px: 2, py: 0.5, boxShadow: "sm", textTransform: "none", children: labels.you }))] }), (0, jsx_runtime_1.jsxs)(react_2.Box, { children: [(0, jsx_runtime_1.jsx)(react_2.Heading, { size: "md", mb: 1, color: heading, children: selectedUser.name }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: muted, mb: 2, children: selectedUser.role }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [renderStatusBadge(selectedUser.isActive), selectedUser.isPending && ((0, jsx_runtime_1.jsx)(react_2.Badge, { variant: "subtle", borderRadius: "full", px: 2, py: 0.5, fontSize: "0.65rem", fontWeight: 600, colorScheme: "orange", textTransform: "none", children: labels.pendingInvitation }))] })] })] }), canManageUsers &&
|
|
118
120
|
!selectedUser.isSuperAdmin && ((0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, flexWrap: "wrap", children: [!selectedUser.isCurrent && !selectedUser.isActive && ((0, jsx_runtime_1.jsx)(react_2.Button, { size: "xs", variant: "outline", colorScheme: "blue", fontSize: "xs", leftIcon: (0, jsx_runtime_1.jsx)(lucide_react_1.Send, { size: 13 }), isLoading: isInviteLoading, onClick: () => selectedUser.userId != null &&
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resetExclusiveOverlay = exports.exclusiveClose = exports.exclusiveOpen = void 0;
|
|
4
|
+
let active = null;
|
|
5
|
+
const exclusiveOpen = (id, close) => {
|
|
6
|
+
if (active && active.id !== id) {
|
|
7
|
+
active.close();
|
|
8
|
+
}
|
|
9
|
+
active = { id, close };
|
|
10
|
+
};
|
|
11
|
+
exports.exclusiveOpen = exclusiveOpen;
|
|
12
|
+
const exclusiveClose = (id) => {
|
|
13
|
+
if ((active === null || active === void 0 ? void 0 : active.id) === id) {
|
|
14
|
+
active = null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.exclusiveClose = exclusiveClose;
|
|
18
|
+
/** Test-only reset — not exported from the package root. */
|
|
19
|
+
const resetExclusiveOverlay = () => {
|
|
20
|
+
active = null;
|
|
21
|
+
};
|
|
22
|
+
exports.resetExclusiveOverlay = resetExclusiveOverlay;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useExclusiveOverlay = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const exclusiveOverlay_1 = require("./exclusiveOverlay");
|
|
6
|
+
/**
|
|
7
|
+
* Register this overlay with the global dismiss coordinator. Call `requestOpen()`
|
|
8
|
+
* immediately before opening; `onClose` is invoked when another overlay opens.
|
|
9
|
+
*/
|
|
10
|
+
const useExclusiveOverlay = (isOpen, onClose) => {
|
|
11
|
+
const id = (0, react_1.useId)();
|
|
12
|
+
const onCloseRef = (0, react_1.useRef)(onClose);
|
|
13
|
+
onCloseRef.current = onClose;
|
|
14
|
+
const requestOpen = (0, react_1.useCallback)(() => {
|
|
15
|
+
(0, exclusiveOverlay_1.exclusiveOpen)(id, () => onCloseRef.current());
|
|
16
|
+
}, [id]);
|
|
17
|
+
(0, react_1.useEffect)(() => {
|
|
18
|
+
if (!isOpen) {
|
|
19
|
+
(0, exclusiveOverlay_1.exclusiveClose)(id);
|
|
20
|
+
}
|
|
21
|
+
}, [isOpen, id]);
|
|
22
|
+
return requestOpen;
|
|
23
|
+
};
|
|
24
|
+
exports.useExclusiveOverlay = useExclusiveOverlay;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Menu = void 0;
|
|
4
4
|
const react_1 = require("@chakra-ui/react");
|
|
5
5
|
const anatomy_1 = require("@chakra-ui/anatomy");
|
|
6
|
+
const rowStates_1 = require("../tokens/builders/rowStates");
|
|
6
7
|
const paletteFromTheme_1 = require("./paletteFromTheme");
|
|
7
8
|
const { defineMultiStyleConfig, definePartsStyle } = (0, react_1.createMultiStyleConfigHelpers)(anatomy_1.menuAnatomy.keys);
|
|
8
9
|
const $bg = (0, react_1.cssVar)("menu-bg");
|
|
@@ -24,8 +25,9 @@ const $bg = (0, react_1.cssVar)("menu-bg");
|
|
|
24
25
|
const $itemBg = (0, react_1.cssVar)("menu-item-bg");
|
|
25
26
|
const baseStyle = definePartsStyle(({ theme }) => {
|
|
26
27
|
const colors = (0, paletteFromTheme_1.paletteOf)(theme);
|
|
27
|
-
const
|
|
28
|
-
const
|
|
28
|
+
const rowBgs = (0, rowStates_1.listRowBackgrounds)(colors);
|
|
29
|
+
const hoverBg = rowBgs.active;
|
|
30
|
+
const activeBg = rowBgs.selectedActive;
|
|
29
31
|
return {
|
|
30
32
|
list: {
|
|
31
33
|
[$bg.variable]: colors.backgroundColor.light,
|
package/dist/Utils/table.d.ts
CHANGED
|
@@ -16,6 +16,9 @@ export type TablePaletteColor = {
|
|
|
16
16
|
text: string;
|
|
17
17
|
onSolid?: string;
|
|
18
18
|
};
|
|
19
|
+
export type SemanticStatusTone = "info" | "warning" | "success" | "error" | "neutral";
|
|
20
|
+
/** Theme-aware status palette per value — soft fill + semantic ink from `resolveStatusTone`. */
|
|
21
|
+
export declare function buildSemanticStatusPalette(toneByValue: Record<string, SemanticStatusTone>, theme: CustomThemeProps): Record<string, TablePaletteColor>;
|
|
19
22
|
/** Deterministic, theme-aware color palette for groups + status pills. */
|
|
20
23
|
export declare function buildTablePalette(theme: CustomThemeProps): TablePaletteColor[];
|
|
21
24
|
/** Pick a deterministic palette color for a value, with optional consumer override hex. */
|