pixelize-design-library 2.4.2-beta.34 → 2.4.2-beta.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/Components/AppSwitcher/AppSwitcher.js +12 -49
  2. package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -3
  3. package/dist/Components/Common/fieldStyles.js +1 -1
  4. package/dist/Components/CopyButton/CopyButton.js +7 -6
  5. package/dist/Components/DatePicker/CalendarPanel.js +8 -5
  6. package/dist/Components/DatePicker/RangeDatePicker.js +27 -3
  7. package/dist/Components/DatePicker/SingleDatePicker.js +48 -14
  8. package/dist/Components/DatePicker/TimeOnlyPicker.js +7 -1
  9. package/dist/Components/DatePicker/TimePicker.js +3 -3
  10. package/dist/Components/DatePicker/TimePickerInput.js +1 -1
  11. package/dist/Components/Dropdown/DropDown.js +19 -6
  12. package/dist/Components/EmptyState/EmptyState.js +1 -1
  13. package/dist/Components/FileUpload/FileUpload.js +2 -2
  14. package/dist/Components/FilterSidebar/FilterSidebar.js +5 -5
  15. package/dist/Components/FilterSidebar/filterHoverStyle.d.ts +2 -1
  16. package/dist/Components/FilterSidebar/filterHoverStyle.js +3 -4
  17. package/dist/Components/Input/TextInput.styles.js +2 -2
  18. package/dist/Components/InputTextArea/InputTextArea.style.js +2 -2
  19. package/dist/Components/MoreItems/MoreItems.js +3 -1
  20. package/dist/Components/MultiSelect/MultiSelect.js +2 -2
  21. package/dist/Components/NavigationBar/NavigationBar.js +6 -7
  22. package/dist/Components/NumberInput/NumberInput.styles.js +2 -2
  23. package/dist/Components/OrgSwitcher/OrgSwitcher.js +14 -10
  24. package/dist/Components/PdfViewer/PdfViewer.js +4 -4
  25. package/dist/Components/RolesPermission/RolesPermission.js +4 -3
  26. package/dist/Components/SearchSelect/SearchSelect.js +46 -41
  27. package/dist/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
  28. package/dist/Components/SegmentedControl/SegmentedControl.js +40 -10
  29. package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +3 -0
  30. package/dist/Components/Select/Select.styles.js +1 -1
  31. package/dist/Components/SelectSearch/SelectSearch.js +35 -17
  32. package/dist/Components/SelectV2/SelectV2.js +3 -0
  33. package/dist/Components/Table/TableProps.d.ts +2 -0
  34. package/dist/Components/Table/components/TableBody.js +7 -10
  35. package/dist/Components/Table/filters/CompactSelect.js +29 -8
  36. package/dist/Components/Table/settings/ManageColumns.js +5 -3
  37. package/dist/Components/Table/settings/TableSettings.js +4 -2
  38. package/dist/Components/Toggle/TableToggle.js +68 -18
  39. package/dist/Components/Toggle/TableToggleProps.d.ts +3 -0
  40. package/dist/Components/ToggleSwitch/ToggleSwitch.js +1 -1
  41. package/dist/Components/Trail/EditableCell.js +1 -1
  42. package/dist/Components/UserDetails/DeactivateConfirmModal.js +1 -1
  43. package/dist/Components/UserDetails/UserDetails.js +5 -3
  44. package/dist/Hooks/exclusiveOverlay.d.ts +4 -0
  45. package/dist/Hooks/exclusiveOverlay.js +22 -0
  46. package/dist/Hooks/useExclusiveOverlay.d.ts +5 -0
  47. package/dist/Hooks/useExclusiveOverlay.js +24 -0
  48. package/dist/Theme/chakra/Menu.styles.js +4 -2
  49. package/dist/Utils/table.d.ts +3 -0
  50. package/dist/Utils/table.js +44 -1
  51. package/dist/esm/Components/AppSwitcher/AppSwitcher.js +13 -50
  52. package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -3
  53. package/dist/esm/Components/Common/fieldStyles.js +1 -1
  54. package/dist/esm/Components/CopyButton/CopyButton.js +7 -6
  55. package/dist/esm/Components/DatePicker/CalendarPanel.js +9 -6
  56. package/dist/esm/Components/DatePicker/RangeDatePicker.js +28 -4
  57. package/dist/esm/Components/DatePicker/SingleDatePicker.js +49 -15
  58. package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +7 -1
  59. package/dist/esm/Components/DatePicker/TimePicker.js +3 -3
  60. package/dist/esm/Components/DatePicker/TimePickerInput.js +1 -1
  61. package/dist/esm/Components/Dropdown/DropDown.js +20 -7
  62. package/dist/esm/Components/EmptyState/EmptyState.js +1 -1
  63. package/dist/esm/Components/FileUpload/FileUpload.js +2 -2
  64. package/dist/esm/Components/FilterSidebar/FilterSidebar.js +5 -5
  65. package/dist/esm/Components/FilterSidebar/filterHoverStyle.js +3 -4
  66. package/dist/esm/Components/Input/TextInput.styles.js +2 -2
  67. package/dist/esm/Components/InputTextArea/InputTextArea.style.js +2 -2
  68. package/dist/esm/Components/MoreItems/MoreItems.js +3 -1
  69. package/dist/esm/Components/MultiSelect/MultiSelect.js +2 -2
  70. package/dist/esm/Components/NavigationBar/NavigationBar.js +6 -7
  71. package/dist/esm/Components/NumberInput/NumberInput.styles.js +2 -2
  72. package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +14 -10
  73. package/dist/esm/Components/PdfViewer/PdfViewer.js +4 -4
  74. package/dist/esm/Components/RolesPermission/RolesPermission.js +4 -3
  75. package/dist/esm/Components/SearchSelect/SearchSelect.js +46 -41
  76. package/dist/esm/Components/SegmentedControl/SegmentedControl.js +42 -12
  77. package/dist/esm/Components/Select/Select.styles.js +1 -1
  78. package/dist/esm/Components/SelectSearch/SelectSearch.js +35 -17
  79. package/dist/esm/Components/SelectV2/SelectV2.js +3 -0
  80. package/dist/esm/Components/Table/components/TableBody.js +7 -10
  81. package/dist/esm/Components/Table/filters/CompactSelect.js +29 -8
  82. package/dist/esm/Components/Table/settings/ManageColumns.js +5 -3
  83. package/dist/esm/Components/Table/settings/TableSettings.js +5 -3
  84. package/dist/esm/Components/Toggle/TableToggle.js +67 -17
  85. package/dist/esm/Components/ToggleSwitch/ToggleSwitch.js +1 -1
  86. package/dist/esm/Components/Trail/EditableCell.js +1 -1
  87. package/dist/esm/Components/UserDetails/DeactivateConfirmModal.js +1 -1
  88. package/dist/esm/Components/UserDetails/UserDetails.js +5 -3
  89. package/dist/esm/Hooks/exclusiveOverlay.js +16 -0
  90. package/dist/esm/Hooks/useExclusiveOverlay.js +20 -0
  91. package/dist/esm/Theme/chakra/Menu.styles.js +4 -2
  92. package/dist/esm/Utils/table.js +45 -3
  93. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
1
  import { SegmentedControlProps } from "./SegmentedControlProps";
2
- export default function SegmentedControl<T extends string = string>({ options, value, onChange, size, isFullWidth, "aria-label": ariaLabel, }: SegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
2
+ export default function SegmentedControl<T extends string = string>({ options, value, onChange, size, isFullWidth, variant, "aria-label": ariaLabel, }: SegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -5,18 +5,38 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const react_2 = require("@chakra-ui/react");
7
7
  const useCustomTheme_1 = require("../../Theme/useCustomTheme");
8
+ const filledSurface_1 = require("../../Theme/tokens/builders/filledSurface");
8
9
  const SIZES = {
9
10
  sm: { h: "1.625rem", px: "0.625rem", fontSize: "0.75rem" },
10
11
  md: { h: "2rem", px: "0.875rem", fontSize: "0.8125rem" },
11
12
  };
12
- function SegmentedControl({ options, value, onChange, size = "md", isFullWidth = false, "aria-label": ariaLabel, }) {
13
+ function SegmentedControl({ options, value, onChange, size = "md", isFullWidth = false, variant = "default", "aria-label": ariaLabel, }) {
13
14
  const { colors } = (0, useCustomTheme_1.useCustomTheme)();
14
15
  const dims = SIZES[size];
15
16
  const refs = (0, react_1.useRef)([]);
17
+ const trackRef = (0, react_1.useRef)(null);
18
+ const isBrandSlide = variant === "brandSlide";
19
+ const isUnderlineSlide = variant === "underlineSlide";
20
+ const hasIndicator = isBrandSlide || isUnderlineSlide;
21
+ const brandFill = (0, filledSurface_1.resolveFilledSurface)(colors.primary, colors);
22
+ const [pill, setPill] = (0, react_1.useState)(null);
16
23
  const selectedIndex = options.findIndex((o) => o.value === value);
17
24
  const enabled = options.reduce((acc, o, i) => (o.isDisabled ? acc : [...acc, i]), []);
18
25
  // WAI-APG: with nothing selected, the first enabled segment owns the tab stop.
19
26
  const tabIndex = selectedIndex >= 0 ? selectedIndex : enabled[0];
27
+ (0, react_1.useLayoutEffect)(() => {
28
+ if (!hasIndicator)
29
+ return;
30
+ const track = trackRef.current;
31
+ const node = refs.current[selectedIndex];
32
+ if (!track || !node) {
33
+ setPill(null);
34
+ return;
35
+ }
36
+ const trackRect = track.getBoundingClientRect();
37
+ const nodeRect = node.getBoundingClientRect();
38
+ setPill({ left: nodeRect.left - trackRect.left, width: nodeRect.width });
39
+ }, [hasIndicator, selectedIndex, options, isFullWidth, size]);
20
40
  const selectAt = (index) => {
21
41
  var _a;
22
42
  (_a = refs.current[index]) === null || _a === void 0 ? void 0 : _a.focus();
@@ -46,13 +66,23 @@ function SegmentedControl({ options, value, onChange, size = "md", isFullWidth =
46
66
  selectAt(enabled[enabled.length - 1]);
47
67
  }
48
68
  };
49
- return ((0, jsx_runtime_1.jsx)(react_2.Flex, { role: "radiogroup", "aria-label": ariaLabel, onKeyDown: handleKeyDown, display: "inline-flex", align: "center", gap: "0.125rem", p: "0.125rem", borderRadius: "md", bg: colors.background[600], w: isFullWidth ? "100%" : "fit-content", children: options.map((option, index) => {
50
- const isSelected = option.value === value;
51
- return ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "button", type: "button", ref: (node) => {
52
- refs.current[index] = node;
53
- }, role: "radio", "aria-checked": isSelected, disabled: option.isDisabled, tabIndex: index === tabIndex ? 0 : -1, onClick: () => onChange(option.value), display: "inline-flex", alignItems: "center", justifyContent: "center", gap: "0.375rem", flex: isFullWidth ? "1" : undefined, h: dims.h, px: dims.px, borderRadius: "base", borderWidth: "1px", borderStyle: "solid", borderColor: isSelected ? colors.background[400] : "transparent", bg: isSelected ? colors.background[50] : "transparent", boxShadow: isSelected ? "sm" : "none", color: isSelected ? colors.text[900] : colors.text[600], fontSize: dims.fontSize, fontWeight: isSelected ? 600 : 500, whiteSpace: "nowrap", opacity: option.isDisabled ? 0.5 : 1, cursor: option.isDisabled ? "not-allowed" : "pointer", transition: "background-color 0.2s ease, color 0.2s ease", _hover: option.isDisabled || isSelected ? undefined : { color: colors.text[900] }, _focusVisible: {
54
- outline: "none",
55
- boxShadow: `0 0 0 2px ${colors.primary[300]}`,
56
- }, children: [option.icon, option.label] }, option.value));
57
- }) }));
69
+ return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { ref: trackRef, role: "radiogroup", "aria-label": ariaLabel, onKeyDown: handleKeyDown, position: "relative", display: "inline-flex", align: "center", gap: isUnderlineSlide ? "0" : "0.125rem", p: isUnderlineSlide ? "0" : "0.125rem", borderRadius: isUnderlineSlide ? "none" : "md", borderBottom: isUnderlineSlide ? `0.0625rem solid ${colors.boxborder[200]}` : undefined, bg: isBrandSlide ? colors.primary.opacity[8] : isUnderlineSlide ? "transparent" : colors.background[600], w: isFullWidth ? "100%" : "fit-content", children: [isBrandSlide && pill && ((0, jsx_runtime_1.jsx)(react_2.Box, { "aria-hidden": "true", position: "absolute", top: "0.125rem", left: 0, h: dims.h, w: `${pill.width}px`, borderRadius: "base", bg: brandFill.fill, boxShadow: `0 0.125rem 0.5rem ${colors.boxShadow.primary}`, transform: `translateX(${pill.left}px)`, transition: "transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.24s cubic-bezier(0.2, 0.8, 0.2, 1)" })), isUnderlineSlide && pill && ((0, jsx_runtime_1.jsx)(react_2.Box, { "aria-hidden": "true", position: "absolute", bottom: "-0.0625rem", left: 0, h: "0.125rem", w: `${pill.width}px`, borderRadius: "full", bg: colors.primary[500], transform: `translateX(${pill.left}px)`, transition: "transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.24s cubic-bezier(0.2, 0.8, 0.2, 1)" })), options.map((option, index) => {
70
+ const isSelected = option.value === value;
71
+ return ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "button", type: "button", ref: (node) => {
72
+ refs.current[index] = node;
73
+ }, role: "radio", "aria-checked": isSelected, disabled: option.isDisabled, tabIndex: index === tabIndex ? 0 : -1, onClick: () => onChange(option.value), position: "relative", zIndex: 1, display: "inline-flex", alignItems: "center", justifyContent: "center", gap: "0.375rem", flex: isFullWidth ? "1" : undefined, h: dims.h, px: dims.px, borderRadius: isUnderlineSlide ? "none" : "base", borderWidth: "1px", borderStyle: "solid", borderColor: hasIndicator
74
+ ? "transparent"
75
+ : isSelected
76
+ ? colors.primary.opacity[32]
77
+ : "transparent", bg: hasIndicator ? "transparent" : isSelected ? colors.backgroundColor.light : "transparent", boxShadow: hasIndicator ? "none" : isSelected ? "sm" : "none", color: isBrandSlide
78
+ ? isSelected
79
+ ? brandFill.color
80
+ : colors.text[600]
81
+ : isSelected
82
+ ? colors.accentText
83
+ : colors.text[600], fontSize: dims.fontSize, fontWeight: isSelected ? 600 : 500, whiteSpace: "nowrap", opacity: option.isDisabled ? 0.5 : 1, cursor: option.isDisabled ? "not-allowed" : "pointer", transition: "color 0.2s ease", _hover: option.isDisabled || isSelected ? undefined : { color: colors.text[900] }, _focusVisible: {
84
+ outline: "none",
85
+ boxShadow: `0 0 0 2px ${colors.primary[300]}`,
86
+ }, children: [option.icon, option.label] }, option.value));
87
+ })] }));
58
88
  }
@@ -1,4 +1,5 @@
1
1
  export type SegmentedControlSize = "sm" | "md";
2
+ export type SegmentedControlVariant = "default" | "brandSlide" | "underlineSlide";
2
3
  export type SegmentedControlOption<T extends string = string> = {
3
4
  value: T;
4
5
  label: string;
@@ -12,5 +13,7 @@ export type SegmentedControlProps<T extends string = string> = {
12
13
  onChange: (value: T) => void;
13
14
  size?: SegmentedControlSize;
14
15
  isFullWidth?: boolean;
16
+ /** brandSlide = primary view switcher; underlineSlide = dense toolbars/headers. */
17
+ variant?: SegmentedControlVariant;
15
18
  "aria-label": string;
16
19
  };
@@ -70,7 +70,7 @@ exports.Select = {
70
70
  const primary = theme.colors.primary[500];
71
71
  return {
72
72
  field: {
73
- bg: theme.colors.gray[50],
73
+ bg: theme.colors.background[50],
74
74
  border: "0.063rem solid",
75
75
  borderColor,
76
76
  _hover: {
@@ -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 outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
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) => ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "button", type: "button", ref: (el) => {
23
- optionRefs.current[index] = el;
24
- }, role: "option", "aria-selected": isOptionSelected(option), tabIndex: index === activeIndex ? 0 : -1, w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", bg: "transparent", px: 4, py: 2, cursor: "pointer", _hover: {
25
- backgroundColor: (0, outlineRung_1.resolveHoverTint)(theme.colors.primary[500], theme.colors.background[50]),
26
- }, onClick: () => handleOptionClick(option), onKeyDown: (e) => {
27
- if (e.key === "Enter" || e.key === " ") {
28
- e.preventDefault();
29
- handleOptionClick(option);
30
- }
31
- }, 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))) }));
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
- setIsOpen(true);
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
- setIsOpen(true);
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: () => setIsOpen(true), onFocus: () => {
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
- setIsOpen(true);
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.gray[50],
287
+ backgroundColor: theme.colors.background[50],
270
288
  fontWeight: 600,
271
- color: theme.colors.gray[700],
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, (_b = header.statusColors) === null || _b === void 0 ? void 0 : _b[rawStatus], theme)
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 ? statusColor.solid : isChecked ? (isFrozen ? selectedFrozenBg : selectedBg) : isFrozen ? frozenCellBg : theme.colors.background[50], textOverflow: "ellipsis", boxShadow: isFirstDataCell ? leadSx : undefined, borderBottom: noBorders
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 ? statusOnSolid : variant.cells.ink, "data-hoverable": canHover ? "true" : "false", _hover: variant.row.hoverScope === "row" || !canHover
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: statusOnSolid })) : 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));
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((prev) => !prev), 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) => {
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) => ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", role: "option", "aria-selected": (value === null || value === void 0 ? void 0 : value.id) === opt.id, tabIndex: i === activeIndex ? 0 : -1, ref: (el) => {
49
- optionRefs.current[i] = el;
50
- }, w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", px: 2, py: 1, cursor: "pointer", _hover: { bg: theme.colors.background[100] }, bg: (value === null || value === void 0 ? void 0 : value.id) === opt.id ? theme.colors.background[200] : theme.colors.transparent, onClick: () => {
51
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(opt);
52
- setIsOpen(false);
53
- setQuery("");
54
- }, children: (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "0.75rem", children: opt.label }) }, opt.id))), 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" }) }))] })] }) }) }) })] }));
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
- ? theme.colors.primary[50]
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: theme.colors.gray[50],
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.gray[500] : theme.colors.gray[700],
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 ? theme.colors.primary.opacity[8] : 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));
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 ? theme.colors.primary.opacity[8] : 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__")));
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;
@@ -4,45 +4,95 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
- const react_1 = require("@chakra-ui/react");
7
+ const react_1 = require("react");
8
+ const react_2 = require("@chakra-ui/react");
8
9
  const lucide_react_1 = require("lucide-react");
9
10
  const useCustomTheme_1 = require("../../Theme/useCustomTheme");
10
11
  const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
12
+ const filledSurface_1 = require("../../Theme/tokens/builders/filledSurface");
11
13
  const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
12
- const TableToggle = ({ value, onChange }) => {
14
+ const MODES = ["grid", "list"];
15
+ const TableToggle = ({ value, onChange, variant = "default" }) => {
13
16
  const theme = (0, useCustomTheme_1.useCustomTheme)();
14
17
  const { colors } = theme;
18
+ const isBrandSlide = variant === "brandSlide";
19
+ const isUnderlineSlide = variant === "underlineSlide";
20
+ const hasIndicator = isBrandSlide || isUnderlineSlide;
21
+ const brandFill = (0, filledSurface_1.resolveFilledSurface)(colors.primary, colors);
15
22
  const restInk = (0, outlineRung_1.liftToContrast)(colors.background[800], colors.background[600], outlineRung_1.AA_NON_TEXT);
16
23
  const hoverInk = (0, outlineRung_1.liftToContrast)(colors.background[900], colors.background[400], outlineRung_1.AA_NON_TEXT);
24
+ const trackRef = (0, react_1.useRef)(null);
25
+ const refs = (0, react_1.useRef)([]);
26
+ const [pill, setPill] = (0, react_1.useState)(null);
27
+ const selectedIndex = MODES.indexOf(value);
28
+ (0, react_1.useLayoutEffect)(() => {
29
+ if (!hasIndicator)
30
+ return;
31
+ const track = trackRef.current;
32
+ const node = refs.current[selectedIndex];
33
+ if (!track || !node) {
34
+ setPill(null);
35
+ return;
36
+ }
37
+ const trackRect = track.getBoundingClientRect();
38
+ const nodeRect = node.getBoundingClientRect();
39
+ setPill({ left: nodeRect.left - trackRect.left, width: nodeRect.width });
40
+ }, [hasIndicator, selectedIndex]);
17
41
  const styles = {
18
42
  container: {
19
43
  display: "flex",
20
44
  alignItems: "center",
21
- bg: colors.background[600],
22
- p: "0.125rem",
23
- borderRadius: "md",
45
+ bg: isBrandSlide ? colors.primary.opacity[8] : isUnderlineSlide ? "transparent" : colors.background[600],
46
+ p: isUnderlineSlide ? "0" : "0.125rem",
47
+ borderRadius: isUnderlineSlide ? "none" : "md",
48
+ borderBottom: isUnderlineSlide ? `0.0625rem solid ${colors.boxborder[200]}` : undefined,
24
49
  height: "2rem",
25
- gap: "0.125rem",
50
+ gap: isUnderlineSlide ? "0" : "0.125rem",
26
51
  width: "6.3rem",
52
+ position: "relative",
27
53
  },
28
54
  button: (mode) => ({
29
- bg: value === mode ? colors.background[50] : "transparent",
30
- boxShadow: value === mode ? "md" : "none",
31
- color: value === mode ? colors.text[900] : restInk,
32
- borderRadius: "base",
55
+ position: "relative",
56
+ zIndex: 1,
57
+ bg: hasIndicator ? "transparent" : value === mode ? colors.backgroundColor.light : "transparent",
58
+ boxShadow: hasIndicator ? "none" : value === mode ? "md" : "none",
59
+ color: isBrandSlide
60
+ ? value === mode
61
+ ? brandFill.color
62
+ : restInk
63
+ : value === mode
64
+ ? colors.accentText
65
+ : restInk,
66
+ borderRadius: isUnderlineSlide ? "none" : "base",
33
67
  height: "1.75rem",
34
- border: "0.031rem solid",
35
- borderColor: value === mode ? colors.background[400] : "transparent",
68
+ border: hasIndicator ? "none" : "0.031rem solid",
69
+ borderColor: hasIndicator
70
+ ? "transparent"
71
+ : value === mode
72
+ ? colors.primary.opacity[32]
73
+ : "transparent",
36
74
  padding: "0.313rem 0.813rem",
37
75
  _hover: {
38
- bg: value === mode
39
- ? colors.background[50]
40
- : colors.background[400],
41
- color: value === mode ? colors.text[900] : hoverInk,
76
+ bg: hasIndicator
77
+ ? "transparent"
78
+ : value === mode
79
+ ? colors.backgroundColor.light
80
+ : colors.background[400],
81
+ color: isBrandSlide
82
+ ? value === mode
83
+ ? brandFill.color
84
+ : hoverInk
85
+ : value === mode
86
+ ? colors.accentText
87
+ : hoverInk,
42
88
  },
43
- transition: "all 0.3s ease-in-out",
89
+ transition: "color 0.2s ease-in-out",
44
90
  }),
45
91
  };
46
- return ((0, jsx_runtime_1.jsxs)(react_1.Box, { ...styles.container, children: [(0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: "Table View", placement: "top", fontSize: 12, hasArrow: true, children: (0, jsx_runtime_1.jsx)(react_1.IconButton, { "aria-label": "Grid View", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Table2, { size: "1.25rem" }), variant: "ghost", onClick: () => onChange("grid"), ...styles.button("grid") }) }), (0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: "Kanban View", placement: "top", fontSize: 12, hasArrow: true, children: (0, jsx_runtime_1.jsx)(react_1.IconButton, { "aria-label": "List View", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Columns3, { size: "1.25rem" }), variant: "ghost", onClick: () => onChange("list"), ...styles.button("list") }) })] }));
92
+ return ((0, jsx_runtime_1.jsxs)(react_2.Box, { ref: trackRef, ...styles.container, children: [isBrandSlide && pill && ((0, jsx_runtime_1.jsx)(react_2.Box, { "aria-hidden": "true", position: "absolute", top: "0.125rem", left: 0, h: "1.75rem", w: `${pill.width}px`, borderRadius: "base", bg: brandFill.fill, boxShadow: `0 0.125rem 0.5rem ${colors.boxShadow.primary}`, transform: `translateX(${pill.left}px)`, transition: "transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.24s cubic-bezier(0.2, 0.8, 0.2, 1)" })), isUnderlineSlide && pill && ((0, jsx_runtime_1.jsx)(react_2.Box, { "aria-hidden": "true", position: "absolute", bottom: "-0.0625rem", left: 0, h: "0.125rem", w: `${pill.width}px`, borderRadius: "full", bg: colors.primary[500], transform: `translateX(${pill.left}px)`, transition: "transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.24s cubic-bezier(0.2, 0.8, 0.2, 1)" })), (0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: "Table View", placement: "top", fontSize: 12, hasArrow: true, children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { ref: (node) => {
93
+ refs.current[0] = node;
94
+ }, "aria-label": "Grid View", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Table2, { size: "1.25rem" }), variant: "ghost", onClick: () => onChange("grid"), ...styles.button("grid") }) }), (0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: "Kanban View", placement: "top", fontSize: 12, hasArrow: true, children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { ref: (node) => {
95
+ refs.current[1] = node;
96
+ }, "aria-label": "List View", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Columns3, { size: "1.25rem" }), variant: "ghost", onClick: () => onChange("list"), ...styles.button("list") }) })] }));
47
97
  };
48
98
  exports.default = TableToggle;
@@ -1,5 +1,8 @@
1
1
  export type ViewMode = "grid" | "list";
2
+ export type TableToggleVariant = "default" | "brandSlide" | "underlineSlide";
2
3
  export type ViewToggleProps = {
3
4
  value: ViewMode;
4
5
  onChange: (val: ViewMode) => void;
6
+ /** brandSlide = primary view switcher; underlineSlide = dense toolbars/headers. */
7
+ variant?: TableToggleVariant;
5
8
  };