pixelize-design-library 2.4.2-beta.53 → 2.4.2-beta.55
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/CHANGELOG.md +43 -0
- package/COMPONENT-GOTCHAS.md +57 -4
- package/DESIGN-GUIDE.md +8 -6
- package/dist/Components/AppSwitcher/AppSwitcher.js +1 -2
- package/dist/Components/Button/Button.styles.js +1 -1
- package/dist/Components/Button/ButtonProps.d.ts +1 -1
- package/dist/Components/Common/fieldStyles.d.ts +1 -1
- package/dist/Components/Common/fieldStyles.js +1 -1
- package/dist/Components/DatePicker/DatePickerProps.d.ts +1 -1
- package/dist/Components/Dropdown/DropDown.js +4 -4
- package/dist/Components/Dropdown/DropdownProps.d.ts +1 -1
- package/dist/Components/Input/PhoneNumberInputProps.d.ts +1 -1
- package/dist/Components/MultiSelect/MultiSelectProps.d.ts +1 -1
- package/dist/Components/NotificationBell/NotificationBellProps.d.ts +1 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +3 -4
- package/dist/Components/PinInput/PinInputProps.d.ts +1 -1
- package/dist/Components/RangeSlider/RangeSliderProps.d.ts +1 -1
- package/dist/Components/RangeSlider/rangeSliderSize.d.ts +1 -1
- package/dist/Components/RangeSlider/rangeSliderSize.js +1 -1
- package/dist/Components/Search/SearchProps.d.ts +1 -1
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +1 -1
- package/dist/Components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/Components/SegmentedControl/SegmentedControlProps.d.ts +1 -1
- package/dist/Components/Select/SelectProps.d.ts +1 -1
- package/dist/Components/SelectSearch/SelectSearchProps.d.ts +1 -1
- package/dist/Components/SelectV2/SelectV2Props.d.ts +1 -1
- package/dist/Components/SideBar/SecondaryBar.js +4 -2
- package/dist/Components/SideBar/SideBar.js +14 -8
- package/dist/Components/SideBar/components/MenuItemBox.js +9 -5
- package/dist/Components/SideBar/components/MenuPopoverContent.js +5 -3
- package/dist/Components/SideBar/components/OtherApps.js +1 -1
- package/dist/Components/Table/Table.js +16 -4
- package/dist/Components/Table/TableProps.d.ts +1 -1
- package/dist/Components/Table/components/rowMetrics.d.ts +1 -0
- package/dist/Components/Table/components/rowMetrics.js +2 -1
- package/dist/Components/Tabs/TabsProps.d.ts +1 -1
- package/dist/Components/Tabs/components/Tab.js +1 -1
- package/dist/Components/Toggle/TableToggle.js +1 -1
- package/dist/Constants/Sidebar.js +3 -3
- package/dist/Theme/tokens/builders/sidebarAccent.js +4 -2
- package/dist/Theme/tokens/primitives/controlSizes.d.ts +2 -1
- package/dist/Theme/tokens/primitives/controlSizes.js +10 -4
- package/dist/Theme/tokens/primitives/optionRowSizes.js +6 -6
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +1 -2
- package/dist/esm/Components/Button/Button.styles.js +2 -2
- package/dist/esm/Components/Common/fieldStyles.js +1 -1
- package/dist/esm/Components/Dropdown/DropDown.js +5 -5
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +3 -4
- package/dist/esm/Components/RangeSlider/rangeSliderSize.js +1 -1
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +2 -2
- package/dist/esm/Components/SideBar/SecondaryBar.js +6 -4
- package/dist/esm/Components/SideBar/SideBar.js +14 -8
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +9 -5
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +6 -4
- package/dist/esm/Components/SideBar/components/OtherApps.js +1 -1
- package/dist/esm/Components/Table/Table.js +17 -5
- package/dist/esm/Components/Table/components/rowMetrics.js +1 -0
- package/dist/esm/Components/Tabs/components/Tab.js +2 -2
- package/dist/esm/Components/Toggle/TableToggle.js +2 -2
- package/dist/esm/Constants/Sidebar.js +3 -3
- package/dist/esm/Theme/tokens/builders/sidebarAccent.js +5 -3
- package/dist/esm/Theme/tokens/primitives/controlSizes.js +9 -3
- package/dist/esm/Theme/tokens/primitives/optionRowSizes.js +6 -6
- package/package.json +1 -1
|
@@ -91,7 +91,7 @@ const MenuItemBox = ({ menu, activeMenu, toggle, handleClick, isOpen, onToggle,
|
|
|
91
91
|
opacity: isBlocked ? 0.6 : 1,
|
|
92
92
|
transition: "background 0.12s",
|
|
93
93
|
};
|
|
94
|
-
const buttonContent = ((0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: "9px", justify: toggle ? "center" : "space-between", w: "100%", children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: "9px", overflow: "hidden", children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { position: "relative", display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(react_2.Icon, { as: icon, fontSize: "md", verticalAlign: "middle", color: isAnyActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isAnyActive ? undefined : { color: theme.colors.white }, transition: "color 0.12s" }), toggle && (badgeValue != null || hasSubmenuBadge) && ((0, jsx_runtime_1.jsx)(react_2.Box, { position: "absolute", top: "0", right: "0", w: "0.375rem", h: "0.375rem", borderRadius: "full", bg: theme.colors.
|
|
94
|
+
const buttonContent = ((0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: "9px", justify: toggle ? "center" : "space-between", w: "100%", children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: "9px", overflow: "hidden", children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { position: "relative", display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(react_2.Icon, { as: icon, fontSize: "md", verticalAlign: "middle", color: isAnyActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isAnyActive ? undefined : { color: theme.colors.white }, transition: "color 0.12s" }), toggle && (badgeValue != null || hasSubmenuBadge) && ((0, jsx_runtime_1.jsx)(react_2.Box, { position: "absolute", top: "0", right: "0", w: "0.375rem", h: "0.375rem", borderRadius: "full", bg: theme.colors.sidebar.semanticText.error }))] }), !toggle && ((0, jsx_runtime_1.jsx)(TextTruncation_1.default
|
|
95
95
|
// open={isOpen}
|
|
96
96
|
, {
|
|
97
97
|
// open={isOpen}
|
|
@@ -128,15 +128,19 @@ const MenuItemBox = ({ menu, activeMenu, toggle, handleClick, isOpen, onToggle,
|
|
|
128
128
|
var _a, _b, _c;
|
|
129
129
|
const isSubActive = activeMenu === sub.id;
|
|
130
130
|
const isSubBlocked = (0, menuDisabled_1.menuDisabled)(sub) || sub.locked;
|
|
131
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "a", href: (_a = sub.url) !== null && _a !== void 0 ? _a : "#", "data-group": "", "aria-current": isSubActive ? "page" : undefined, "aria-disabled": isSubBlocked ? true : undefined, textDecoration: "none", h: sidebarScale_1.SIDEBAR_ROW.subHeight, pl: "
|
|
131
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "a", href: (_a = sub.url) !== null && _a !== void 0 ? _a : "#", "data-group": "", "aria-current": isSubActive ? "page" : undefined, "aria-disabled": isSubBlocked ? true : undefined, textDecoration: "none", h: sidebarScale_1.SIDEBAR_ROW.subHeight, pl: "28px", pr: "10px", borderRadius: "lg", fontSize: sidebarScale_1.SIDEBAR_ROW.fontSize, borderLeft: "2px solid", borderLeftColor: isSubActive ? theme.colors.sidebar.activeIcon : "transparent", backgroundColor: isSubActive ? "whiteAlpha.300" : "transparent", _hover: {
|
|
132
|
+
backgroundColor: isSubBlocked
|
|
133
|
+
? "transparent"
|
|
134
|
+
: isSubActive
|
|
135
|
+
? "whiteAlpha.400"
|
|
136
|
+
: "whiteAlpha.200",
|
|
137
|
+
}, opacity: isSubBlocked ? 0.6 : 1, cursor: isSubBlocked ? "not-allowed" : "pointer", pointerEvents: isSubBlocked ? "none" : "auto", onClick: (e) => {
|
|
132
138
|
if (sub.url && isBrowserNavigationGesture(e))
|
|
133
139
|
return;
|
|
134
140
|
e.preventDefault();
|
|
135
141
|
if (!isSubBlocked)
|
|
136
142
|
handleClick === null || handleClick === void 0 ? void 0 : handleClick(sub);
|
|
137
|
-
}, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, transition: "background 0.12s", children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: "9px", overflow: "hidden", flex: "1", children: [sub.icon ? ((0, jsx_runtime_1.jsx)(react_2.Icon, { as: sub.icon, fontSize: sidebarScale_1.SIDEBAR_ROW.iconSize, flexShrink: 0, color: isSubActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isSubActive ? undefined : { color: theme.colors.white }, transition: "color 0.12s" })) : ((0, jsx_runtime_1.jsx)(react_2.Box, { w: "5px", h: "5px", borderRadius: "full", flexShrink: 0, bg: isSubActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isSubActive ? undefined : { bg: theme.colors.white }, transition: "background 0.12s" })), (0, jsx_runtime_1.jsx)(TextTruncation_1.default, { fontSize: sidebarScale_1.SIDEBAR_ROW.fontSize, fontWeight: isSubActive ? 600 : 500, lineHeight: "1",
|
|
138
|
-
// open={isOpen}
|
|
139
|
-
color: isSubActive ? theme.colors.white : theme.colors.sidebar.mutedLabel, _groupHover: isSubActive ? undefined : { color: theme.colors.white }, children: sub.title })] }), sub.locked ? ((0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.LockKeyhole, fontSize: "md", color: theme.colors.sidebar.mutedIcon })) : (() => {
|
|
143
|
+
}, display: "flex", alignItems: "center", justifyContent: "space-between", gap: 2, transition: "background 0.12s", children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: "9px", overflow: "hidden", flex: "1", children: [sub.icon ? ((0, jsx_runtime_1.jsx)(react_2.Icon, { as: sub.icon, fontSize: sidebarScale_1.SIDEBAR_ROW.iconSize, flexShrink: 0, color: isSubActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isSubActive ? undefined : { color: theme.colors.white }, transition: "color 0.12s" })) : ((0, jsx_runtime_1.jsx)(react_2.Box, { w: "5px", h: "5px", borderRadius: "full", flexShrink: 0, bg: isSubActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isSubActive ? undefined : { bg: theme.colors.white }, transition: "background 0.12s" })), (0, jsx_runtime_1.jsx)(TextTruncation_1.default, { fontSize: sidebarScale_1.SIDEBAR_ROW.fontSize, fontWeight: isSubActive ? 600 : 500, lineHeight: "1", color: isSubActive ? activeAccent.label : theme.colors.sidebar.mutedLabel, _groupHover: isSubActive ? undefined : { color: theme.colors.white }, children: sub.title })] }), sub.locked ? ((0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.LockKeyhole, fontSize: "md", color: theme.colors.sidebar.mutedIcon })) : (() => {
|
|
140
144
|
var _a, _b, _c, _d;
|
|
141
145
|
const subCfg = typeof sub.badge === "object" && sub.badge !== null
|
|
142
146
|
? sub.badge
|
|
@@ -22,7 +22,9 @@ const MenuPopoverContent = ({ menu, handleMenuClick, activeMenu, }) => {
|
|
|
22
22
|
const isBlocked = (0, menuDisabled_1.menuDisabled)(menu) || locked;
|
|
23
23
|
const hasSubMenu = !!(subMenu === null || subMenu === void 0 ? void 0 : subMenu.length);
|
|
24
24
|
const isParentActive = activeMenu === menu.id;
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { as: (hasSubMenu ? "div" : "a"), href: hasSubMenu ? undefined : (_a = menu.url) !== null && _a !== void 0 ? _a : "#", "aria-current": !hasSubMenu && isParentActive ? "page" : undefined, textDecoration: "none", align: "center", gap: 2, px: 2, h: "32px", mb: hasSubMenu ? "4px" : 0, borderBottom: hasSubMenu ? "1px solid" : undefined, borderColor: hasSubMenu ? theme.colors.sidebar.divider : undefined, borderRadius: hasSubMenu ? "none" : "lg", bg: !hasSubMenu && isParentActive ? "whiteAlpha.300" : "transparent", _hover: !hasSubMenu && !isBlocked
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { as: (hasSubMenu ? "div" : "a"), href: hasSubMenu ? undefined : (_a = menu.url) !== null && _a !== void 0 ? _a : "#", "aria-current": !hasSubMenu && isParentActive ? "page" : undefined, textDecoration: "none", align: "center", gap: 2, px: 2, h: "32px", mb: hasSubMenu ? "4px" : 0, borderBottom: hasSubMenu ? "1px solid" : undefined, borderColor: hasSubMenu ? theme.colors.sidebar.divider : undefined, borderRadius: hasSubMenu ? "none" : "lg", bg: !hasSubMenu && isParentActive ? "whiteAlpha.300" : "transparent", _hover: !hasSubMenu && !isBlocked
|
|
26
|
+
? { bg: isParentActive ? "whiteAlpha.400" : "whiteAlpha.200" }
|
|
27
|
+
: undefined, onClick: (e) => {
|
|
26
28
|
if (!hasSubMenu) {
|
|
27
29
|
e.preventDefault();
|
|
28
30
|
if (!isBlocked)
|
|
@@ -50,9 +52,9 @@ const MenuPopoverContent = ({ menu, handleMenuClick, activeMenu, }) => {
|
|
|
50
52
|
if (!isSubBlocked)
|
|
51
53
|
handleMenuClick === null || handleMenuClick === void 0 ? void 0 : handleMenuClick(sub);
|
|
52
54
|
}, px: 2, h: sidebarScale_1.SIDEBAR_ROW.subHeight, mb: "2px", borderRadius: "lg", align: "center", justify: "space-between", gap: 2, borderLeft: "2px solid", borderLeftColor: isSubActive ? theme.colors.sidebar.activeIcon : "transparent", bg: isSubActive ? "whiteAlpha.300" : "transparent", _hover: {
|
|
53
|
-
bg:
|
|
55
|
+
bg: isSubBlocked ? "transparent" : isSubActive ? "whiteAlpha.400" : "whiteAlpha.200",
|
|
54
56
|
cursor: !isSubBlocked ? "pointer" : "not-allowed",
|
|
55
|
-
}, opacity: isSubBlocked ? 0.5 : 1, pointerEvents: isSubBlocked ? "none" : "auto", transition: "background 0.12s", children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: "9px", overflow: "hidden", flex: "1", children: [(0, jsx_runtime_1.jsx)(react_1.Icon, { as: sub.icon, fontSize: sidebarScale_1.SIDEBAR_ROW.iconSize, flexShrink: 0, color: isSubActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isSubActive ? undefined : { color: theme.colors.white }, transition: "color 0.12s" }), (0, jsx_runtime_1.jsx)(TextTruncation_1.default, { fontSize: sidebarScale_1.SIDEBAR_ROW.fontSize, fontWeight: isSubActive ? 600 : 500, flex: 1, color: isSubActive ? activeAccent.label : theme.colors.white, _groupHover: isSubActive ? undefined : { color: theme.colors.white }, children: sub.title })] }), sub.locked ? ((0, jsx_runtime_1.jsx)(react_1.Icon, { as: lucide_react_1.LockKeyhole, fontSize: "md", color: theme.colors.sidebar.mutedIcon })) : (() => {
|
|
57
|
+
}, opacity: isSubBlocked ? 0.5 : 1, pointerEvents: isSubBlocked ? "none" : "auto", transition: "background 0.12s", children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: "9px", overflow: "hidden", flex: "1", children: [sub.icon ? ((0, jsx_runtime_1.jsx)(react_1.Icon, { as: sub.icon, fontSize: sidebarScale_1.SIDEBAR_ROW.iconSize, flexShrink: 0, color: isSubActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isSubActive ? undefined : { color: theme.colors.white }, transition: "color 0.12s" })) : ((0, jsx_runtime_1.jsx)(react_1.Box, { w: "5px", h: "5px", borderRadius: "full", flexShrink: 0, bg: isSubActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isSubActive ? undefined : { bg: theme.colors.white }, transition: "background 0.12s" })), (0, jsx_runtime_1.jsx)(TextTruncation_1.default, { fontSize: sidebarScale_1.SIDEBAR_ROW.fontSize, fontWeight: isSubActive ? 600 : 500, flex: 1, color: isSubActive ? activeAccent.label : theme.colors.white, _groupHover: isSubActive ? undefined : { color: theme.colors.white }, children: sub.title })] }), sub.locked ? ((0, jsx_runtime_1.jsx)(react_1.Icon, { as: lucide_react_1.LockKeyhole, fontSize: "md", color: theme.colors.sidebar.mutedIcon })) : (() => {
|
|
56
58
|
var _a, _b, _c, _d;
|
|
57
59
|
const cfg = typeof sub.badge === "object" && sub.badge !== null
|
|
58
60
|
? sub.badge
|
|
@@ -12,7 +12,7 @@ const OtherApps = ({ toggle, otherApps }) => {
|
|
|
12
12
|
return ((0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", justifyContent: "center", color: theme.colors.sidebar.mutedIcon, fontSize: "15px", flexShrink: 0, children: (_a = app.icon) !== null && _a !== void 0 ? _a : ((0, jsx_runtime_1.jsx)(react_1.Box, { w: "0.5rem", h: "0.5rem", borderRadius: "full", bg: app.color, boxShadow: `0 0 5px ${app.color}`, flexShrink: 0 })) }));
|
|
13
13
|
};
|
|
14
14
|
// Grid cell: icon on top, truncated label below (label hidden when collapsed).
|
|
15
|
-
const appCell = (app) => ((0, jsx_runtime_1.jsxs)(react_1.Flex, { as: "button", type: "button", direction: "column", align: "center", justify: "center", gap: "3px", px: "2px", py: "6px", borderRadius: "lg", cursor: "pointer", border: "none", bg: "transparent", w: "100%", _hover: { backgroundColor: "whiteAlpha.
|
|
15
|
+
const appCell = (app) => ((0, jsx_runtime_1.jsxs)(react_1.Flex, { as: "button", type: "button", direction: "column", align: "center", justify: "center", gap: "3px", px: "2px", py: "6px", borderRadius: "lg", cursor: "pointer", border: "none", bg: "transparent", w: "100%", _hover: { backgroundColor: "whiteAlpha.200" }, transition: "background 0.12s", onClick: app.onClick, children: [appIcon(app), !toggle && ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "9.5px", color: theme.colors.sidebar.mutedLabel, textAlign: "center", maxW: "44px", isTruncated: true, children: app.name }))] }));
|
|
16
16
|
const flyoutBody = (app) => {
|
|
17
17
|
var _a;
|
|
18
18
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { alignItems: "center", gap: 2, mb: 1, onClick: app.onClick, children: [(_a = app.icon) !== null && _a !== void 0 ? _a : ((0, jsx_runtime_1.jsx)(react_1.Box, { w: "0.5rem", h: "0.5rem", borderRadius: "full", bg: app.color, boxShadow: `0 0 5px ${app.color}`, flexShrink: 0 })), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "sm", fontWeight: 700, color: theme.colors.white, children: app.name })] }), app.description && ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs", color: theme.colors.sidebar.mutedLabel, children: app.description }))] }));
|
|
@@ -318,9 +318,21 @@ function Table({ data, columns, onSelection, isLoading, isCheckbox = false, free
|
|
|
318
318
|
rowsHeight += ((_c = renderGroups === null || renderGroups === void 0 ? void 0 : renderGroups.length) !== null && _c !== void 0 ? _c : 1) * rowMetrics_1.GROUP_HEADER_HEIGHT;
|
|
319
319
|
if (isEmptyState)
|
|
320
320
|
rowsHeight = Math.max(rowsHeight, headerHeight + rowMetrics_1.EMPTY_STATE_HEIGHT);
|
|
321
|
-
const dynamicMaxH = Math.min(
|
|
321
|
+
const dynamicMaxH = Math.min(rowMetrics_1.MAX_TABLE_HEIGHT, rowsHeight);
|
|
322
322
|
const fittedMaxH = autoFitViewport ? Math.min(dynamicMaxH, viewportAvailableH) : dynamicMaxH;
|
|
323
|
-
const
|
|
323
|
+
const formulaMaxH = typeof tableMaxHeight === "number" ? tableMaxHeight : (isCompactRows ? rowsHeight + 8 : fittedMaxH);
|
|
324
|
+
// NOTE: wrapped cell content can exceed the per-row estimate; when the row count is
|
|
325
|
+
// within the display cap (explicit maxVisibleRows, else the default 10), size naturally
|
|
326
|
+
// instead of clipping. `visibleRowsCount` isn't used here — minRows defaults to
|
|
327
|
+
// actualRows, which would make this true for any row count.
|
|
328
|
+
const rawMaxRows = typeof maxVisibleRows === "number" ? maxVisibleRows : (actualRows === 0 ? 1 : 10);
|
|
329
|
+
const showsAllRows = actualRows <= rawMaxRows;
|
|
330
|
+
const useNaturalHeight = typeof tableMaxHeight !== "number" && showsAllRows && !isTableLoading && !canInfinite &&
|
|
331
|
+
!(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar);
|
|
332
|
+
const tableMinH = useNaturalHeight ? formulaMaxH : undefined;
|
|
333
|
+
const tableMaxH = useNaturalHeight
|
|
334
|
+
? (autoFitViewport ? viewportAvailableH : undefined)
|
|
335
|
+
: formulaMaxH;
|
|
324
336
|
const isCompactHeader = (0, react_2.useBreakpointValue)({ base: true, md: true, lg: false });
|
|
325
337
|
(0, react_1.useEffect)(() => {
|
|
326
338
|
if (!isCompactHeader) {
|
|
@@ -371,7 +383,7 @@ function Table({ data, columns, onSelection, isLoading, isCheckbox = false, free
|
|
|
371
383
|
from { transform: rotate(0deg); }
|
|
372
384
|
to { transform: rotate(360deg); }
|
|
373
385
|
}
|
|
374
|
-
` }), (0, jsx_runtime_1.jsxs)(react_2.Box, { bg: theme.colors.background[50], border: `0.063rem solid ${theme.colors.boxborder[200]}`, borderRadius: "xl", overflow: "hidden", children: [filterSidebar && filterMode === "modal" && ((0, jsx_runtime_1.jsxs)(react_2.Modal, { isOpen: isFilterModalOpen, onClose: onFilterModalClose, size: "4xl", scrollBehavior: "inside", children: [(0, jsx_runtime_1.jsx)(react_2.ModalOverlay, {}), (0, jsx_runtime_1.jsxs)(react_2.ModalContent, { bg: theme.colors.surfaceRaised, my: 0, top: "10%", position: "fixed", left: "auto", right: "auto", children: [(0, jsx_runtime_1.jsx)(react_2.ModalCloseButton, { size: "sm" }), (0, jsx_runtime_1.jsx)(react_2.ModalBody, { p: 0, children: (0, jsx_runtime_1.jsx)(LeftFilterPane_1.default, { theme: theme, sections: (_d = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _d !== void 0 ? _d : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: (sel) => { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply) === null || _a === void 0 ? void 0 : _a.call(filterSidebar, sel); onFilterModalClose(); }, onClear: () => { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) === null || _a === void 0 ? void 0 : _a.call(filterSidebar); }, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }) })] })] })), (0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "start", children: [filterMode === "sidebar" && ((0, jsx_runtime_1.jsx)(MotionBox, { "data-testid": "filter-sidebar-pane", initial: { width: 0 }, animate: { width: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? 180 : 0 }, transition: { type: "tween", duration: 0.5 }, overflow: "hidden", flexShrink: 0, borderRight: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? "1px solid" : "none", borderColor: theme.colors.boxborder[200], style: { height: rowMetrics_1.TOOLBAR_HEIGHT +
|
|
386
|
+
` }), (0, jsx_runtime_1.jsxs)(react_2.Box, { bg: theme.colors.background[50], border: `0.063rem solid ${theme.colors.boxborder[200]}`, borderRadius: "xl", overflow: "hidden", children: [filterSidebar && filterMode === "modal" && ((0, jsx_runtime_1.jsxs)(react_2.Modal, { isOpen: isFilterModalOpen, onClose: onFilterModalClose, size: "4xl", scrollBehavior: "inside", children: [(0, jsx_runtime_1.jsx)(react_2.ModalOverlay, {}), (0, jsx_runtime_1.jsxs)(react_2.ModalContent, { bg: theme.colors.surfaceRaised, my: 0, top: "10%", position: "fixed", left: "auto", right: "auto", children: [(0, jsx_runtime_1.jsx)(react_2.ModalCloseButton, { size: "sm" }), (0, jsx_runtime_1.jsx)(react_2.ModalBody, { p: 0, children: (0, jsx_runtime_1.jsx)(LeftFilterPane_1.default, { theme: theme, sections: (_d = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _d !== void 0 ? _d : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: (sel) => { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply) === null || _a === void 0 ? void 0 : _a.call(filterSidebar, sel); onFilterModalClose(); }, onClear: () => { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) === null || _a === void 0 ? void 0 : _a.call(filterSidebar); }, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }) })] })] })), (0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "start", children: [filterMode === "sidebar" && ((0, jsx_runtime_1.jsx)(MotionBox, { "data-testid": "filter-sidebar-pane", initial: { width: 0 }, animate: { width: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? 180 : 0 }, transition: { type: "tween", duration: 0.5 }, overflow: "hidden", flexShrink: 0, borderRight: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? "1px solid" : "none", borderColor: theme.colors.boxborder[200], style: { height: rowMetrics_1.TOOLBAR_HEIGHT + formulaMaxH }, minHeight: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? "32rem" : "auto", children: (0, jsx_runtime_1.jsx)(LeftFilterPane_1.default, { height: rowMetrics_1.TOOLBAR_HEIGHT + formulaMaxH, theme: theme, sections: (_e = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _e !== void 0 ? _e : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply, onClear: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }) })), (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: "1", minW: 0, children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 0, height: `${rowMetrics_1.TOOLBAR_HEIGHT}px`, gap: 3, flexWrap: "nowrap", bg: theme.colors.background[50], borderBottom: `0.063rem solid ${theme.colors.boxborder[200]}`, children: [[
|
|
375
387
|
filterSidebar && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: "Filter", placement: "top", children: (0, jsx_runtime_1.jsxs)(react_2.Box, { position: "relative", display: "inline-block", children: [(0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", "aria-label": "Filter", "aria-haspopup": filterMode === "modal" ? "dialog" : undefined, "aria-expanded": filterMode === "modal"
|
|
376
388
|
? isFilterModalOpen
|
|
377
389
|
: !!(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar), display: "inline-flex", alignItems: "center", justifyContent: "center", p: 0, bg: "transparent", border: "none", borderRadius: "md", cursor: "pointer", onClick: filterMode === "modal" ? onFilterModalOpen : filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.filterSidebarToggle, _hover: {
|
|
@@ -407,7 +419,7 @@ function Table({ data, columns, onSelection, isLoading, isCheckbox = false, free
|
|
|
407
419
|
.filter(Boolean)
|
|
408
420
|
.flatMap((tool, i) => (i === 0 ? [tool] : [(0, jsx_runtime_1.jsx)(Divider_1.default, {}, `divider-${i}`), tool])), (0, jsx_runtime_1.jsx)(ActiveFilters_1.default, { columns: columnsList, columnsSearch: columnsSearch, setColumnsSearch: setColumnsSearch }), (0, jsx_runtime_1.jsxs)(react_2.Box, { ml: "auto", display: "flex", alignItems: "center", gap: 2, children: [groupLoadMoreActive && loadMorePosition === "top" && (groupLoadMoreCaption || canGroupLoadMore) && ((0, jsx_runtime_1.jsxs)(react_2.Box, { display: "flex", alignItems: "center", gap: 2, flex: "0 0 auto", children: [groupLoadMoreCaption && ((0, jsx_runtime_1.jsx)(react_2.Box, { fontSize: "0.75rem", color: theme.colors.text[500], whiteSpace: "nowrap", children: groupLoadMoreCaption })), canGroupLoadMore && ((0, jsx_runtime_1.jsx)(Button_1.default, { size: "xs", variant: "outline", colorScheme: "gray", isLoading: isLoadingMore, loadingText: loadMoreText, onClick: handleGroupLoadMore, label: loadMoreText }))] })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && !isCompactHeader && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Pagination_1.default, { currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions }) })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && isCompactHeader && ((0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: isPaginationPopoverOpen, onClose: () => setIsPaginationPopoverOpen(false), placement: "bottom-end", children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { "aria-label": "Pagination", size: "sm", variant: "ghost", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.EllipsisVertical, { size: 18 }), color: theme.colors.text[500], _hover: {
|
|
409
421
|
color: theme.colors.accentText,
|
|
410
|
-
}, onClick: () => setIsPaginationPopoverOpen((open) => !open) }) }), (0, jsx_runtime_1.jsx)(react_2.Portal, { children: (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { maxW: "22rem", p: 2, zIndex: 1600, bg: theme.colors.surfaceRaised, boxShadow: "lg", children: (0, jsx_runtime_1.jsx)(react_2.PopoverBody, { p: 0, children: (0, jsx_runtime_1.jsx)(Pagination_1.default, { currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions }) }) }) })] }))] })] }), (0, jsx_runtime_1.jsxs)(react_2.TableContainer, { ref: tableContainerRef, position: "relative", h: isTableLoading ? tableMaxH : undefined, maxH: !isTableLoading ? tableMaxH : undefined, pb: isTableLoading ? 0 : compactScrollbarPadding, overflowY: isCompactRows ? "hidden" : "auto", overflowX: "auto", sx: {
|
|
422
|
+
}, onClick: () => setIsPaginationPopoverOpen((open) => !open) }) }), (0, jsx_runtime_1.jsx)(react_2.Portal, { children: (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { maxW: "22rem", p: 2, zIndex: 1600, bg: theme.colors.surfaceRaised, boxShadow: "lg", children: (0, jsx_runtime_1.jsx)(react_2.PopoverBody, { p: 0, children: (0, jsx_runtime_1.jsx)(Pagination_1.default, { currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions }) }) }) })] }))] })] }), (0, jsx_runtime_1.jsxs)(react_2.TableContainer, { ref: tableContainerRef, position: "relative", h: isTableLoading ? tableMaxH : undefined, minH: !isTableLoading ? tableMinH : undefined, maxH: !isTableLoading ? tableMaxH : undefined, pb: isTableLoading ? 0 : compactScrollbarPadding, overflowY: isCompactRows ? "hidden" : "auto", overflowX: "auto", sx: {
|
|
411
423
|
...(0, scrollShadow_1.scrollShadowStyles)(theme.colors.background[50]),
|
|
412
424
|
...(0, scrollbar_1.scrollbarStyles)(theme.colors),
|
|
413
425
|
// Compact rows hide the horizontal bar until hover to keep the row height.
|
|
@@ -94,7 +94,7 @@ export type TableProps = {
|
|
|
94
94
|
tableMaxHeight?: number;
|
|
95
95
|
/** Floors the auto-computed row count used for sizing only — doesn't add rows or affect pagination. */
|
|
96
96
|
minVisibleRows?: number;
|
|
97
|
-
/**
|
|
97
|
+
/** Row count above which height is capped and scrolls; at or under it the table grows to fit every row, even wrapped ones. Ignored once tableMaxHeight is set. */
|
|
98
98
|
maxVisibleRows?: number;
|
|
99
99
|
/** Further clamps computed height to remaining viewport space below the table, recalculated on resize; ignored once tableMaxHeight is set. */
|
|
100
100
|
autoFitViewport?: boolean;
|
|
@@ -6,5 +6,6 @@ export declare const DENSITY_ROWS: Record<TableDensity, {
|
|
|
6
6
|
export declare const TOOLBAR_HEIGHT = 45;
|
|
7
7
|
export declare const GROUP_HEADER_HEIGHT = 42;
|
|
8
8
|
export declare const EMPTY_STATE_HEIGHT = 200;
|
|
9
|
+
export declare const MAX_TABLE_HEIGHT = 500;
|
|
9
10
|
export declare const rowHeightFor: (density: TableDensity | undefined) => number;
|
|
10
11
|
export declare const pxOf: (length: string) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pxOf = exports.rowHeightFor = exports.EMPTY_STATE_HEIGHT = exports.GROUP_HEADER_HEIGHT = exports.TOOLBAR_HEIGHT = exports.DENSITY_ROWS = void 0;
|
|
3
|
+
exports.pxOf = exports.rowHeightFor = exports.MAX_TABLE_HEIGHT = exports.EMPTY_STATE_HEIGHT = exports.GROUP_HEADER_HEIGHT = exports.TOOLBAR_HEIGHT = exports.DENSITY_ROWS = void 0;
|
|
4
4
|
exports.DENSITY_ROWS = {
|
|
5
5
|
compact: { height: 32, py: "0.125rem" },
|
|
6
6
|
normal: { height: 40, py: "0.5rem" },
|
|
@@ -9,6 +9,7 @@ exports.DENSITY_ROWS = {
|
|
|
9
9
|
exports.TOOLBAR_HEIGHT = 45;
|
|
10
10
|
exports.GROUP_HEADER_HEIGHT = 42;
|
|
11
11
|
exports.EMPTY_STATE_HEIGHT = 200;
|
|
12
|
+
exports.MAX_TABLE_HEIGHT = 500;
|
|
12
13
|
const rowHeightFor = (density) => exports.DENSITY_ROWS[density !== null && density !== void 0 ? density : "normal"].height;
|
|
13
14
|
exports.rowHeightFor = rowHeightFor;
|
|
14
15
|
const pxOf = (length) => parseFloat(length);
|
|
@@ -32,7 +32,7 @@ export interface TabsProps {
|
|
|
32
32
|
defaultValue?: string;
|
|
33
33
|
onChange?: (value: string) => void;
|
|
34
34
|
variant?: TabsVariant;
|
|
35
|
-
/** Defaults to "sm",
|
|
35
|
+
/** Defaults to "sm", on the button control scale (sm 32 · md 40 · lg 48px), not form fields. */
|
|
36
36
|
size?: ControlSize;
|
|
37
37
|
colorScheme?: TabsColorScheme;
|
|
38
38
|
orientation?: TabsOrientation;
|
|
@@ -29,7 +29,7 @@ const Tab = ({ value, children, icon, count, isDisabled }) => {
|
|
|
29
29
|
const canvas = colors.backgroundColor.main;
|
|
30
30
|
const scale = (0, tabStyles_1.scaleForColorScheme)(colors, ctx.colorScheme);
|
|
31
31
|
const style = (0, tabStyles_1.resolveTabStyle)(colors, scale, canvas, ctx.variant, isSelected);
|
|
32
|
-
const spec = controlSizes_1.
|
|
32
|
+
const spec = controlSizes_1.BUTTON_SIZES[ctx.size];
|
|
33
33
|
// The list scrolls on both axes, so an outer ring is clipped into arcs; a negative offset draws it
|
|
34
34
|
// inside the tab, clear of its own border rather than thickening it.
|
|
35
35
|
const focusRing = {
|
|
@@ -13,7 +13,7 @@ const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
|
13
13
|
const useSlidingPill_1 = require("../SegmentedControl/useSlidingPill");
|
|
14
14
|
const controlSizes_1 = require("../../Theme/tokens/primitives/controlSizes");
|
|
15
15
|
const MODES = ["grid", "list"];
|
|
16
|
-
const TRACK_HEIGHT = controlSizes_1.
|
|
16
|
+
const TRACK_HEIGHT = controlSizes_1.BUTTON_SIZES.sm.height;
|
|
17
17
|
const SEGMENT_HEIGHT = `calc(${TRACK_HEIGHT} - 0.25rem)`;
|
|
18
18
|
/** Two icon-only IconButtons (Grid/List), aria-pressed marks the active one; shares variant with SegmentedControl (see MODULE.md). */
|
|
19
19
|
const TableToggle = ({ value, onChange, variant = "default" }) => {
|
|
@@ -15,15 +15,15 @@ const cssForScrollBar = (theme) => ({
|
|
|
15
15
|
borderRadius: "0.5rem",
|
|
16
16
|
},
|
|
17
17
|
"&:hover::-webkit-scrollbar-thumb": {
|
|
18
|
-
background: theme.colors.
|
|
18
|
+
background: theme.colors.sidebar.mutedIcon,
|
|
19
19
|
},
|
|
20
20
|
"&:hover::-webkit-scrollbar-thumb:hover": {
|
|
21
|
-
background: theme.colors.
|
|
21
|
+
background: theme.colors.sidebar.mutedLabel,
|
|
22
22
|
},
|
|
23
23
|
scrollbarWidth: "none",
|
|
24
24
|
"&:hover": {
|
|
25
25
|
scrollbarWidth: "thin",
|
|
26
|
-
scrollbarColor: `${theme.colors.
|
|
26
|
+
scrollbarColor: `${theme.colors.sidebar.mutedIcon} ${theme.colors.sidebar.background[500]}`,
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
29
|
exports.cssForScrollBar = cssForScrollBar;
|
|
@@ -25,13 +25,15 @@ exports.sidebarDivider = sidebarDivider;
|
|
|
25
25
|
const buildSidebarTokens = (background, lightPrimary, semantic) => {
|
|
26
26
|
const surface = (0, exports.sidebarActiveSurface)(background);
|
|
27
27
|
const elevated = (0, outlineRung_1.resolveHoverTint)(background[500], background[500]);
|
|
28
|
+
// Muted chrome must clear contrast on the bare rail AND the lightest row-hover overlay.
|
|
29
|
+
const rowPeak = (0, exports.sidebarRowPeak)(elevated);
|
|
28
30
|
return {
|
|
29
31
|
background,
|
|
30
32
|
elevated,
|
|
31
33
|
activeIcon: (0, outlineRung_1.liftToContrast)(lightPrimary[300], surface, outlineRung_1.AA_NON_TEXT),
|
|
32
34
|
activeLabel: (0, outlineRung_1.liftToContrast)(lightPrimary[100], surface, exports.AA_NORMAL_TEXT),
|
|
33
|
-
mutedIcon: (0, outlineRung_1.
|
|
34
|
-
mutedLabel: (0, outlineRung_1.
|
|
35
|
+
mutedIcon: (0, outlineRung_1.settleAcross)(background[300], [elevated, rowPeak], outlineRung_1.AA_NON_TEXT),
|
|
36
|
+
mutedLabel: (0, outlineRung_1.settleAcross)(background[100], [elevated, rowPeak], exports.AA_NORMAL_TEXT),
|
|
35
37
|
semanticText: (0, semanticText_1.buildSemanticText)(semantic, elevated),
|
|
36
38
|
hoverBg: (0, exports.sidebarHoverSurface)(background),
|
|
37
39
|
activeBg: surface,
|
|
@@ -5,8 +5,9 @@ export type ControlSizeSpec = {
|
|
|
5
5
|
paddingX: string;
|
|
6
6
|
iconSize: number;
|
|
7
7
|
};
|
|
8
|
-
/**
|
|
8
|
+
/** Height scale for form fields and selects — text inputs, pickers, anything typed or picked into. */
|
|
9
9
|
export declare const CONTROL_SIZES: Readonly<Record<ControlSize, ControlSizeSpec>>;
|
|
10
|
+
export declare const BUTTON_SIZES: Readonly<Record<ControlSize, ControlSizeSpec>>;
|
|
10
11
|
export declare const CONTROL_SIZE_NAMES: readonly ControlSize[];
|
|
11
12
|
export declare const DEFAULT_CONTROL_SIZE: ControlSize;
|
|
12
13
|
export declare const isControlSize: (value: unknown) => value is ControlSize;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isControlSize = exports.DEFAULT_CONTROL_SIZE = exports.CONTROL_SIZE_NAMES = exports.CONTROL_SIZES = void 0;
|
|
4
|
-
/**
|
|
3
|
+
exports.isControlSize = exports.DEFAULT_CONTROL_SIZE = exports.CONTROL_SIZE_NAMES = exports.BUTTON_SIZES = exports.CONTROL_SIZES = void 0;
|
|
4
|
+
/** Height scale for form fields and selects — text inputs, pickers, anything typed or picked into. */
|
|
5
5
|
exports.CONTROL_SIZES = {
|
|
6
|
-
xs: { height: "1.
|
|
6
|
+
xs: { height: "1.5rem", fontSize: "0.75rem", paddingX: "0.5rem", iconSize: 12 },
|
|
7
7
|
sm: { height: "2.375rem", fontSize: "0.8125rem", paddingX: "0.75rem", iconSize: 14 },
|
|
8
|
-
md: { height: "2.
|
|
8
|
+
md: { height: "2.5rem", fontSize: "0.875rem", paddingX: "1rem", iconSize: 16 },
|
|
9
|
+
lg: { height: "3rem", fontSize: "1rem", paddingX: "1.5rem", iconSize: 18 },
|
|
10
|
+
};
|
|
11
|
+
exports.BUTTON_SIZES = {
|
|
12
|
+
xs: { height: "1.5rem", fontSize: "0.75rem", paddingX: "0.5rem", iconSize: 12 },
|
|
13
|
+
sm: { height: "2rem", fontSize: "0.8125rem", paddingX: "0.75rem", iconSize: 14 },
|
|
14
|
+
md: { height: "2.5rem", fontSize: "0.875rem", paddingX: "1rem", iconSize: 16 },
|
|
9
15
|
lg: { height: "3rem", fontSize: "1rem", paddingX: "1.5rem", iconSize: 18 },
|
|
10
16
|
};
|
|
11
17
|
exports.CONTROL_SIZE_NAMES = ["xs", "sm", "md", "lg"];
|
|
@@ -4,19 +4,19 @@ exports.optionRowSpec = exports.OPTION_ROW_RADIUS = exports.OPTION_ROW_SIZES = v
|
|
|
4
4
|
/** One density for every option row — Select, SearchSelect, SelectSearch, table filters and Chakra's MenuItem. */
|
|
5
5
|
exports.OPTION_ROW_SIZES = {
|
|
6
6
|
xs: {
|
|
7
|
-
minH: "1.
|
|
7
|
+
minH: "1.5rem", px: "0.5rem", py: "0.125rem", gap: "0.375rem", mx: "0.25rem",
|
|
8
8
|
fontSize: "0.75rem", descriptionFontSize: "0.6875rem", iconSize: 12,
|
|
9
|
-
avatarSize: "2xs", virtualRowHeightPx:
|
|
9
|
+
avatarSize: "2xs", virtualRowHeightPx: 24,
|
|
10
10
|
},
|
|
11
11
|
sm: {
|
|
12
|
-
minH: "
|
|
12
|
+
minH: "1.875rem", px: "0.625rem", py: "0.25rem", gap: "0.5rem", mx: "0.375rem",
|
|
13
13
|
fontSize: "0.8125rem", descriptionFontSize: "0.75rem", iconSize: 14,
|
|
14
|
-
avatarSize: "xs", virtualRowHeightPx:
|
|
14
|
+
avatarSize: "xs", virtualRowHeightPx: 30,
|
|
15
15
|
},
|
|
16
16
|
md: {
|
|
17
|
-
minH: "2.
|
|
17
|
+
minH: "2.125rem", px: "0.75rem", py: "0.3125rem", gap: "0.5rem", mx: "0.375rem",
|
|
18
18
|
fontSize: "0.875rem", descriptionFontSize: "0.75rem", iconSize: 16,
|
|
19
|
-
avatarSize: "xs", virtualRowHeightPx:
|
|
19
|
+
avatarSize: "xs", virtualRowHeightPx: 34,
|
|
20
20
|
},
|
|
21
21
|
lg: {
|
|
22
22
|
minH: "2.5rem", px: "0.875rem", py: "0.375rem", gap: "0.625rem", mx: "0.5rem",
|
|
@@ -11,10 +11,9 @@ import { useExclusiveOverlay } from "../../Hooks/useExclusiveOverlay.js";
|
|
|
11
11
|
import AppMark, { assignAppHues } from "./AppMark.js";
|
|
12
12
|
import { filterApps, formatShortcut, } from "./AppSwitcherProps.js";
|
|
13
13
|
import { useAppSwitcherShortcut } from "./useAppSwitcherShortcut.js";
|
|
14
|
-
import { CONTROL_SIZES } from "../../Theme/tokens/primitives/controlSizes.js";
|
|
15
14
|
const COLUMNS = 2;
|
|
16
15
|
const HEADING = "Your apps";
|
|
17
|
-
const s = { trigger:
|
|
16
|
+
const s = { trigger: "36px", mark: "32px", icon: 17, name: "0.875rem", sub: "0.75rem", row: "52px" };
|
|
18
17
|
const warned = new Set();
|
|
19
18
|
const warnOnce = (key, message) => {
|
|
20
19
|
if (process.env.NODE_ENV === "production" || warned.has(key))
|
|
@@ -3,9 +3,9 @@ import { darkerFillRung, labelOnFill, solidFillRung, } from "../../Theme/tokens/
|
|
|
3
3
|
import { resolveGradient, gradientCss } from "../../Theme/tokens/builders/gradientInk.js";
|
|
4
4
|
import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
|
|
5
5
|
import { reducedMotionSx } from "../../Theme/chakra/motion.js";
|
|
6
|
-
import {
|
|
6
|
+
import { BUTTON_SIZES, DEFAULT_CONTROL_SIZE, transitionFor } from "../../Theme/tokens/primitives/index.js";
|
|
7
7
|
const controlSize = (size) => {
|
|
8
|
-
const { height, fontSize, paddingX } =
|
|
8
|
+
const { height, fontSize, paddingX } = BUTTON_SIZES[size];
|
|
9
9
|
return { h: height, minW: height, fontSize, px: paddingX };
|
|
10
10
|
};
|
|
11
11
|
// NOTE: [500] alone measures ~4.2 on a dark canvas — resolved per-mode so outline/ghost/link text stays readable.
|
|
@@ -6,7 +6,7 @@ import { fieldFocusVisible, focusGlowShadow } from "../../Theme/chakra/focusRing
|
|
|
6
6
|
export const FIELD_RADIUS = "lg";
|
|
7
7
|
export const FIELD_BORDER_WIDTH = "1px";
|
|
8
8
|
export const FIELD_TRANSITION = transitionFor(["border-color", "box-shadow", "background-color"]);
|
|
9
|
-
/** Chakra `h`/`fontSize`/`px` for a
|
|
9
|
+
/** Chakra `h`/`fontSize`/`px` for a field or select of this size. */
|
|
10
10
|
export const controlSizeStyles = (size) => {
|
|
11
11
|
const spec = CONTROL_SIZES[size];
|
|
12
12
|
return { h: spec.height, minH: spec.height, fontSize: spec.fontSize, px: spec.paddingX };
|
|
@@ -8,17 +8,17 @@ import { listRowBackgrounds } from "../../Theme/tokens/builders/rowStates.js";
|
|
|
8
8
|
import { useExclusiveOverlay } from "../../Hooks/useExclusiveOverlay.js";
|
|
9
9
|
import { ChevronDown } from "lucide-react";
|
|
10
10
|
import { rafThrottle } from "../../Utils/rafThrottle.js";
|
|
11
|
-
import {
|
|
11
|
+
import { BUTTON_SIZES } from "../../Theme/tokens/primitives/controlSizes.js";
|
|
12
12
|
import { optionRowSpec, OPTION_ROW_RADIUS } from "../../Theme/tokens/primitives/optionRowSizes.js";
|
|
13
13
|
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
14
14
|
import { reducedMotionSx } from "../../Theme/chakra/motion.js";
|
|
15
15
|
import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
|
|
16
16
|
const MotionBox = motion(forwardRef((props, ref) => (_jsx(Box, { ref: ref, ...props }))));
|
|
17
17
|
const SIZE_MAP = {
|
|
18
|
-
xs: { btn: "xs", img: "1rem", chevron:
|
|
19
|
-
sm: { btn: "sm", img: "1rem", chevron:
|
|
20
|
-
md: { btn: "md", img: "1.125rem", chevron:
|
|
21
|
-
lg: { btn: "lg", img: "1.25rem", chevron:
|
|
18
|
+
xs: { btn: "xs", img: "1rem", chevron: BUTTON_SIZES.xs.iconSize, minW: "8rem", gap: 1.5, rowSize: "xs" },
|
|
19
|
+
sm: { btn: "sm", img: "1rem", chevron: BUTTON_SIZES.sm.iconSize, minW: "9rem", gap: 2, rowSize: "sm" },
|
|
20
|
+
md: { btn: "md", img: "1.125rem", chevron: BUTTON_SIZES.md.iconSize, minW: "11rem", gap: 2, rowSize: "md" },
|
|
21
|
+
lg: { btn: "lg", img: "1.25rem", chevron: BUTTON_SIZES.lg.iconSize, minW: "12rem", gap: 2.5, rowSize: "lg" },
|
|
22
22
|
xl: { btn: "lg", img: "1.4rem", chevron: 20, minW: "13rem", gap: 3, rowSize: "lg" },
|
|
23
23
|
};
|
|
24
24
|
const TRIGGER_TRANSITION = transitionFor(["background-color", "border-color", "color", "box-shadow"]);
|
|
@@ -9,11 +9,10 @@ import { resolveHoverTint } from "../../Theme/tokens/builders/outlineRung.js";
|
|
|
9
9
|
import { listRowBackgrounds } from "../../Theme/tokens/builders/rowStates.js";
|
|
10
10
|
import { useExclusiveOverlay } from "../../Hooks/useExclusiveOverlay.js";
|
|
11
11
|
import { avatarColor, orgInitial, } from "./OrgSwitcherProps.js";
|
|
12
|
-
import { CONTROL_SIZES } from "../../Theme/tokens/primitives/controlSizes.js";
|
|
13
12
|
const sizeMap = {
|
|
14
|
-
sm: { h:
|
|
15
|
-
md: { h:
|
|
16
|
-
lg: { h:
|
|
13
|
+
sm: { h: "32px", avatar: "22px", font: "0.8rem", sub: "0.65rem", px: 2 },
|
|
14
|
+
md: { h: "40px", avatar: "28px", font: "0.9rem", sub: "0.7rem", px: 3 },
|
|
15
|
+
lg: { h: "48px", avatar: "34px", font: "1rem", sub: "0.78rem", px: 4 },
|
|
17
16
|
};
|
|
18
17
|
const Avatar = ({ org, boxSize, fontSize, }) => {
|
|
19
18
|
const { colors } = useCustomTheme();
|
|
@@ -4,5 +4,5 @@ const RANGE_SLIDER_SIZES = {
|
|
|
4
4
|
md: { trackHeight: "4px", thumbSize: "1.25rem" },
|
|
5
5
|
lg: { trackHeight: "5px", thumbSize: "1.5rem" },
|
|
6
6
|
};
|
|
7
|
-
/** Track thickness and thumb diameter for a size,
|
|
7
|
+
/** Track thickness and thumb diameter for a size — its own values, keyed by the same size names. */
|
|
8
8
|
export const rangeSliderSize = (size) => RANGE_SLIDER_SIZES[size];
|
|
@@ -3,7 +3,7 @@ import { useState } from "react";
|
|
|
3
3
|
import { Box, Flex } from "@chakra-ui/react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
5
|
import { resolveFilledSurface } from "../../Theme/tokens/builders/filledSurface.js";
|
|
6
|
-
import {
|
|
6
|
+
import { BUTTON_SIZES } from "../../Theme/tokens/primitives/controlSizes.js";
|
|
7
7
|
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
8
8
|
import { FOCUS_VISIBLE_OVER_STATE } from "../../Theme/chakra/focusRing.styles.js";
|
|
9
9
|
import { reducedMotionSx } from "../../Theme/chakra/motion.js";
|
|
@@ -21,7 +21,7 @@ const formatCount = (count) => (count > MAX_COUNT ? `${MAX_COUNT}+` : `${count}`
|
|
|
21
21
|
/** Renders role="radiogroup" of role="radio" buttons with roving tabindex, not a native form radio group; shares variant with Toggle/TableToggle (see MODULE.md). */
|
|
22
22
|
export default function SegmentedControl({ options, value, onChange, size = "sm", isFullWidth = false, variant = "default", surface, "aria-label": ariaLabel, }) {
|
|
23
23
|
const { colors, radii } = useCustomTheme();
|
|
24
|
-
const control =
|
|
24
|
+
const control = BUTTON_SIZES[size];
|
|
25
25
|
const isBrandSlide = variant === "brandSlide";
|
|
26
26
|
const isUnderlineSlide = variant === "underlineSlide";
|
|
27
27
|
const hasIndicator = isBrandSlide || isUnderlineSlide;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
2
|
+
import { useId, useState } from "react";
|
|
3
3
|
import { Box, Flex, Icon, VStack, Badge, Popover, PopoverTrigger, PopoverContent, PopoverBody, Portal, } from "@chakra-ui/react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
5
|
import { getSidebarActiveAccent } from "./sidebarAccentColors.js";
|
|
@@ -8,7 +8,8 @@ import { menuDisabled } from "./menuDisabled.js";
|
|
|
8
8
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
9
9
|
import OverflowTooltipText from "./components/OverflowTooltipText.js";
|
|
10
10
|
import ToolTip from "../ToolTip/ToolTip.js";
|
|
11
|
-
import { HEADER_HEIGHT } from "../../Constants/Sidebar.js";
|
|
11
|
+
import { cssForScrollBar, HEADER_HEIGHT } from "../../Constants/Sidebar.js";
|
|
12
|
+
import { sanitizeId } from "./sidebarId.js";
|
|
12
13
|
import { resolveSoftTone } from "../../Theme/tokens/builders/tone.js";
|
|
13
14
|
import { sidebarRowPeak } from "../../Theme/tokens/builders/sidebarAccent.js";
|
|
14
15
|
import { scaleFor } from "../../Theme/chakra/paletteFromTheme.js";
|
|
@@ -42,7 +43,7 @@ const CollapsedItem = ({ item, isActive, itemFontSize, onItemClick }) => {
|
|
|
42
43
|
e.preventDefault();
|
|
43
44
|
if (!menuDisabled(item))
|
|
44
45
|
onItemClick === null || onItemClick === void 0 ? void 0 : onItemClick(item);
|
|
45
|
-
}, bg: isActive ? "whiteAlpha.300" : "transparent", transition: "background 0.12s", children: _jsxs(Box, { position: "relative", display: "flex", alignItems: "center", children: [_jsx(Icon, { as: item.icon, fontSize: SIDEBAR_ROW.iconSize, color: isActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isActive ? undefined : { color: theme.colors.white }, transition: "color 0.12s" }), badgeVal != null && (_jsx(Box, { position: "absolute", top: "0", right: "0", w: "0.375rem", h: "0.375rem", borderRadius: "full", bg: theme.colors.
|
|
46
|
+
}, bg: isActive ? "whiteAlpha.300" : "transparent", transition: "background 0.12s", children: _jsxs(Box, { position: "relative", display: "flex", alignItems: "center", children: [_jsx(Icon, { as: item.icon, fontSize: SIDEBAR_ROW.iconSize, color: isActive ? activeAccent.icon : theme.colors.sidebar.mutedIcon, _groupHover: isActive ? undefined : { color: theme.colors.white }, transition: "color 0.12s" }), badgeVal != null && (_jsx(Box, { position: "absolute", top: "0", right: "0", w: "0.375rem", h: "0.375rem", borderRadius: "full", bg: theme.colors.sidebar.semanticText.error }))] }) }) }), _jsx(Portal, { children: _jsx(PopoverContent, { borderRadius: "lg", bg: theme.colors.sidebar.elevated, boxShadow: "lg", minW: "10rem", maxW: "14rem", py: "0.125rem", ml: "-0.5rem", cursor: menuDisabled(item) ? "not-allowed" : "pointer", zIndex: 1500, color: theme.colors.white, border: 'none', children: _jsx(PopoverBody, { p: 3, children: _jsxs(Flex, { align: "center", gap: 2, justify: "space-between", children: [_jsxs(Flex, { align: "center", gap: 2, flex: "1", minW: 0, children: [_jsx(Icon, { as: item.icon, fontSize: "md", flexShrink: 0 }), _jsx(OverflowTooltipText, { placement: "right", maxWidth: "100%", fontSize: itemFontSize, fontWeight: "medium", as: "p", children: item.title })] }), badgeVal != null && (_jsx(Badge, { ...softBadge(theme.colors, colorScheme, sidebarRowPeak(theme.colors.sidebar.elevated)), fontSize: "xs", variant: variant, borderRadius: radius, children: badgeVal }))] }) }) }) })] }));
|
|
46
47
|
};
|
|
47
48
|
const ExpandedItem = ({ item, isActive, itemFontSize, onItemClick }) => {
|
|
48
49
|
var _a;
|
|
@@ -60,9 +61,10 @@ const ExpandedItem = ({ item, isActive, itemFontSize, onItemClick }) => {
|
|
|
60
61
|
const SecondaryBar = ({ items = [], defaultCollapsed = true, collapsedWidth = "3.5rem", expandedWidth = "10rem", headerFontSize = SIDEBAR_ROW.fontSize, itemFontSize = SIDEBAR_ROW.fontSize, selected, onItemClick, title, icon, }) => {
|
|
61
62
|
const theme = useCustomTheme();
|
|
62
63
|
const activeAccent = getSidebarActiveAccent(theme.colors);
|
|
64
|
+
const scrollContainerId = sanitizeId(useId());
|
|
63
65
|
const [collapsed, setCollapsed] = useState(defaultCollapsed);
|
|
64
66
|
const width = collapsed ? collapsedWidth : expandedWidth;
|
|
65
|
-
return (_jsx(Box, { as: "nav", "aria-label": title ? `${title} navigation` : "Secondary navigation", transition: transitionFor(["width"], "base"), pos: "sticky", top: 0, sx: fullViewportHeight, w: width, bg: theme.colors.sidebar.background[500], borderLeft: "1px solid", borderColor: theme.colors.sidebar.divider, boxShadow: theme.shadows.md, zIndex: 1, children: _jsxs(VStack, { align: "stretch", spacing: 0, h: "100%", children: [_jsxs(Flex, { align: "center", justify: collapsed ? "center" : "space-between", px: collapsed ? 0 : "10px", gap: "7px", h: HEADER_HEIGHT, overflow: "hidden", borderBottom: "1px solid", borderColor: theme.colors.sidebar.divider, flexShrink: 0, children: [!collapsed && (_jsxs(_Fragment, { children: [icon && (_jsx(Icon, { as: icon, fontSize: SIDEBAR_ROW.iconSize, color: activeAccent.icon, flexShrink: 0 })), _jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "right", maxWidth: "100%", fontSize: headerFontSize, fontWeight: 600, color: theme.colors.white, as: "p", children: title !== null && title !== void 0 ? title : "" }) })] })), _jsx(Box, { as: "button", type: "button", "aria-label": collapsed ? "Expand navigation panel" : "Collapse navigation panel", "aria-expanded": !collapsed, border: "none", bg: "transparent", w: "24px", h: "24px", borderRadius: "lg", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", flexShrink: 0, onClick: () => setCollapsed((c) => !c), _hover: { bg: "whiteAlpha.
|
|
67
|
+
return (_jsx(Box, { as: "nav", "aria-label": title ? `${title} navigation` : "Secondary navigation", transition: transitionFor(["width"], "base"), pos: "sticky", top: 0, sx: fullViewportHeight, w: width, bg: theme.colors.sidebar.background[500], borderLeft: "1px solid", borderColor: theme.colors.sidebar.divider, boxShadow: theme.shadows.md, zIndex: 1, children: _jsxs(VStack, { align: "stretch", spacing: 0, h: "100%", children: [_jsxs(Flex, { align: "center", justify: collapsed ? "center" : "space-between", px: collapsed ? 0 : "10px", gap: "7px", h: HEADER_HEIGHT, overflow: "hidden", borderBottom: "1px solid", borderColor: theme.colors.sidebar.divider, flexShrink: 0, children: [!collapsed && (_jsxs(_Fragment, { children: [icon && (_jsx(Icon, { as: icon, fontSize: SIDEBAR_ROW.iconSize, color: activeAccent.icon, flexShrink: 0 })), _jsx(Box, { flex: "1", minW: 0, children: _jsx(OverflowTooltipText, { placement: "right", maxWidth: "100%", fontSize: headerFontSize, fontWeight: 600, color: theme.colors.white, as: "p", children: title !== null && title !== void 0 ? title : "" }) })] })), _jsx(Box, { as: "button", type: "button", "aria-label": collapsed ? "Expand navigation panel" : "Collapse navigation panel", "aria-expanded": !collapsed, border: "none", bg: "transparent", w: "24px", h: "24px", borderRadius: "lg", display: "flex", alignItems: "center", justifyContent: "center", cursor: "pointer", flexShrink: 0, onClick: () => setCollapsed((c) => !c), _hover: { bg: "whiteAlpha.200" }, transition: "background 0.15s", children: collapsed ? (_jsx(ToolTip, { label: title !== null && title !== void 0 ? title : "", placement: "right", children: _jsx(ChevronRight, { size: 13, color: theme.colors.sidebar.mutedIcon }) })) : (_jsx(ChevronLeft, { size: 13, color: theme.colors.sidebar.mutedIcon })) })] }), _jsx(Box, { id: scrollContainerId, flex: "1", minH: 0, overflowY: "auto", overflowX: "hidden", py: 2, px: "6px", sx: cssForScrollBar(theme), children: items.map((item) => {
|
|
66
68
|
var _a;
|
|
67
69
|
const isActive = String(selected) === String(item.id) ||
|
|
68
70
|
String(selected) === String(item.title);
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useEffect, useId, useRef, useState } from "react";
|
|
3
3
|
import { Flex, Text, Image, Box, Skeleton, useBreakpointValue } from "@chakra-ui/react";
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
-
import { labelOnFill, solidFillRung } from "../../Theme/tokens/builders/filledSurface.js";
|
|
6
5
|
import { getSidebarActiveAccent } from "./sidebarAccentColors.js";
|
|
7
6
|
import { sanitizeId } from "./sidebarId.js";
|
|
8
7
|
import { cssForScrollBar, HEADER_HEIGHT } from "../../Constants/Sidebar.js";
|
|
@@ -30,13 +29,18 @@ import { SIDEBAR_CHROME, SIDEBAR_ROW } from "./sidebarScale.js";
|
|
|
30
29
|
import { fullViewportHeight } from "../../Theme/tokens/builders/viewportHeight.js";
|
|
31
30
|
const SidebarHeader = ({ logo, companyName, companySubtitle, toggle, isLoading, onToggle, overlay, onClose, }) => {
|
|
32
31
|
const theme = useCustomTheme();
|
|
32
|
+
const activeAccent = getSidebarActiveAccent(theme.colors);
|
|
33
33
|
if (isLoading) {
|
|
34
34
|
return (_jsx(Box, { w: "100%", px: toggle ? 2 : 4, py: 2, h: HEADER_HEIGHT, display: "flex", alignItems: "center", flexShrink: 0, children: toggle ? (_jsx(Flex, { align: "center", gap: 4, justifyContent: "center", w: "100%", children: _jsx(Skeleton, { w: "28px", h: "28px", borderRadius: "lg", startColor: theme.colors.sidebar.background[400], endColor: theme.colors.sidebar.background[300] }) })) : (_jsxs(Flex, { align: "center", gap: 3, w: "100%", children: [_jsx(Skeleton, { w: "28px", h: "28px", borderRadius: "lg", startColor: theme.colors.sidebar.background[400], endColor: theme.colors.sidebar.background[300] }), _jsx(Skeleton, { h: "1.25rem", w: "60%", borderRadius: "lg", startColor: theme.colors.sidebar.background[400], endColor: theme.colors.sidebar.background[300] })] })) }));
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const logoNode = logo ? (_jsx(Image, { borderRadius: "lg", boxSize: "1.75rem", src: logo, alt: "Company Logo", flexShrink: 0, cursor: toggle ? "pointer" : undefined, onClick: toggle ? onToggle : undefined })) : (_jsx(Box
|
|
37
|
+
// Rail-safe pairing, not a raw primary fill: primary[500] equals the rail itself on
|
|
38
|
+
// some brands (zinc), making the tile disappear. See THEME-CONTRACT.md sidebar rules.
|
|
39
|
+
, {
|
|
40
|
+
// Rail-safe pairing, not a raw primary fill: primary[500] equals the rail itself on
|
|
41
|
+
// some brands (zinc), making the tile disappear. See THEME-CONTRACT.md sidebar rules.
|
|
42
|
+
bg: theme.colors.sidebar.activeBg, color: activeAccent.label, borderRadius: "lg", boxSize: "1.75rem", display: "flex", alignItems: "center", justifyContent: "center", fontWeight: "bold", flexShrink: 0, cursor: toggle ? "pointer" : undefined, onClick: toggle ? onToggle : undefined, children: _jsx(DefaultLogo, {}) }));
|
|
43
|
+
return (_jsxs(Flex, { h: HEADER_HEIGHT, w: "100%", alignItems: "center", justifyContent: toggle ? "center" : "flex-start", gap: 2, px: toggle ? "8px" : "10px", borderBottom: "1px solid", borderColor: theme.colors.sidebar.divider, minW: 0, overflow: "hidden", flexShrink: 0, children: [logoNode, !toggle && (_jsxs(Box, { flex: "1", minW: 0, children: [_jsx(OverflowTooltipText, { placement: "right", fontWeight: 600, fontSize: SIDEBAR_CHROME.titleFontSize, textAlign: "left", color: theme.colors.white, lineHeight: "1.3", as: "p", width: "100%", children: companyName !== null && companyName !== void 0 ? companyName : "" }), companySubtitle && (_jsx(Text, { fontSize: SIDEBAR_CHROME.metaFontSize, color: theme.colors.sidebar.mutedLabel, lineHeight: "1.3", isTruncated: true, children: companySubtitle }))] })), !toggle && (_jsx(Box, { as: "button", type: "button", onClick: overlay ? onClose : onToggle, "aria-label": overlay ? "Close menu" : "Collapse sidebar", w: "22px", h: "22px", borderRadius: "lg", bg: "whiteAlpha.200", display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0, position: "relative", _hover: { bg: "whiteAlpha.300" }, transition: "background 0.15s", sx: {
|
|
40
44
|
"&::after": {
|
|
41
45
|
content: '""',
|
|
42
46
|
position: "absolute",
|
|
@@ -55,7 +59,7 @@ const SkeletonMenuRow = ({ toggle }) => {
|
|
|
55
59
|
const AddNewButton = ({ toggle, onClick, overlay }) => {
|
|
56
60
|
const theme = useCustomTheme();
|
|
57
61
|
const activeAccent = getSidebarActiveAccent(theme.colors);
|
|
58
|
-
return (_jsxs(Flex, { as: "button", type: "button", "data-group": "", "aria-label": "Add New", alignItems: "center", gap: "9px", px: "10px", py: overlay ? "11px" : "7px", borderRadius: "lg", cursor: "pointer", border: "none", bg: "transparent", w: "100%", mb: "2px", justifyContent: toggle ? "center" : "flex-start", _hover: { backgroundColor: "whiteAlpha.
|
|
62
|
+
return (_jsxs(Flex, { as: "button", type: "button", "data-group": "", "aria-label": "Add New", alignItems: "center", gap: "9px", px: "10px", py: overlay ? "11px" : "7px", borderRadius: "lg", cursor: "pointer", border: "none", bg: "transparent", w: "100%", mb: "2px", justifyContent: toggle ? "center" : "flex-start", _hover: { backgroundColor: "whiteAlpha.200" }, transition: "background 0.12s", onClick: onClick, children: [_jsx(Box, { w: "18px", h: "18px", display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0, children: _jsx(Plus, { size: 16, color: activeAccent.icon }) }), !toggle && (_jsx(Text, { fontSize: SIDEBAR_ROW.fontSize, color: theme.colors.white, fontWeight: "medium", children: "Add New" }))] }));
|
|
59
63
|
};
|
|
60
64
|
const deriveInitials = (user) => {
|
|
61
65
|
if (user.initials)
|
|
@@ -70,8 +74,10 @@ const deriveInitials = (user) => {
|
|
|
70
74
|
const UserFooter = ({ user, toggle, overlay }) => {
|
|
71
75
|
const theme = useCustomTheme();
|
|
72
76
|
const activeAccent = getSidebarActiveAccent(theme.colors);
|
|
73
|
-
const avatar = user.avatarUrl ? (_jsx(Image, { src: user.avatarUrl, alt: user.name, boxSize: "26px", borderRadius: "full", objectFit: "cover", flexShrink: 0 })) : (_jsx(Box, { boxSize: "26px", borderRadius: "full",
|
|
74
|
-
|
|
77
|
+
const avatar = user.avatarUrl ? (_jsx(Image, { src: user.avatarUrl, alt: user.name, boxSize: "26px", borderRadius: "full", objectFit: "cover", flexShrink: 0 })) : (_jsx(Box, { boxSize: "26px", borderRadius: "full",
|
|
78
|
+
// Same rail-safe pairing as the logo tile — primary.opacity[32] was invisible on zinc/skyline.
|
|
79
|
+
bg: theme.colors.sidebar.activeBg, color: activeAccent.label, display: "flex", alignItems: "center", justifyContent: "center", fontSize: SIDEBAR_CHROME.metaFontSize, fontWeight: 600, flexShrink: 0, children: deriveInitials(user) }));
|
|
80
|
+
return (_jsx(Box, { borderTop: "1px solid", borderColor: theme.colors.sidebar.divider, py: 2, px: "6px", flexShrink: 0, children: _jsxs(Flex, { as: "button", type: "button", onClick: user.onClick, align: "center", gap: 2, px: 2, py: overlay ? "10px" : "6px", w: "100%", borderRadius: "lg", cursor: "pointer", bg: "transparent", border: "none", justify: toggle ? "center" : "flex-start", _hover: { bg: "whiteAlpha.200" }, transition: "background 0.12s", children: [avatar, !toggle && (_jsxs(Box, { flex: "1", minW: 0, textAlign: "left", children: [_jsx(Text, { fontSize: SIDEBAR_CHROME.labelFontSize, fontWeight: 500, color: theme.colors.white, isTruncated: true, children: user.name }), user.role && (_jsx(Text, { fontSize: SIDEBAR_CHROME.metaFontSize, color: theme.colors.sidebar.mutedLabel, isTruncated: true, children: user.role }))] })), !toggle && _jsx(MoreVertical, { size: 14, color: theme.colors.sidebar.mutedIcon })] }) }));
|
|
75
81
|
};
|
|
76
82
|
// Footer "cell" — one segment of the Collapse | Hide/Show control.
|
|
77
83
|
const ControlCell = ({ onClick, ariaLabel, label, accent, children }) => {
|