pixelize-design-library 2.4.2-beta.63 → 2.4.2-beta.65
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 +130 -8
- package/COMPONENT-GOTCHAS.md +63 -7
- package/DESIGN-GUIDE.md +8 -3
- package/dist/Components/Button/Button.styles.js +7 -2
- package/dist/Components/CopyButton/CopyButton.d.ts +3 -1
- package/dist/Components/CopyButton/CopyButton.js +2 -2
- package/dist/Components/Drawer/Drawer.d.ts +1 -1
- package/dist/Components/Drawer/Drawer.js +6 -2
- package/dist/Components/Drawer/DrawerProps.d.ts +4 -0
- package/dist/Components/Dropdown/DropDown.js +2 -9
- package/dist/Components/FilePreview/FilePreview.js +2 -1
- package/dist/Components/FileUploader/FileUploader.js +4 -0
- package/dist/Components/FileUploader/FileUploaderProps.d.ts +1 -1
- package/dist/Components/FormDrawer/FormDrawer.d.ts +1 -1
- package/dist/Components/FormDrawer/FormDrawer.js +3 -3
- package/dist/Components/FormDrawer/FormDrawerProps.d.ts +2 -0
- package/dist/Components/Input/TextInput.styles.js +10 -6
- package/dist/Components/KanbanBoard/KanbanBoard.js +6 -5
- package/dist/Components/Modal/dialogNaming.d.ts +8 -0
- package/dist/Components/Modal/dialogNaming.js +21 -0
- package/dist/Components/NavLauncher/LauncherTabs.js +2 -2
- package/dist/Components/NavLauncher/NavLauncher.d.ts +1 -1
- package/dist/Components/NavLauncher/NavLauncher.js +257 -47
- package/dist/Components/NavLauncher/NavLauncherProps.d.ts +79 -3
- package/dist/Components/NavLauncher/ScopeBar.d.ts +14 -0
- package/dist/Components/NavLauncher/ScopeBar.js +137 -0
- package/dist/Components/NavLauncher/engine/distance.d.ts +4 -0
- package/dist/Components/NavLauncher/engine/distance.js +41 -0
- package/dist/Components/NavLauncher/engine/engine.d.ts +84 -0
- package/dist/Components/NavLauncher/engine/engine.js +471 -0
- package/dist/Components/NavLauncher/engine/fold.d.ts +15 -0
- package/dist/Components/NavLauncher/engine/fold.js +83 -0
- package/dist/Components/NavLauncher/engine/index.d.ts +21 -0
- package/dist/Components/NavLauncher/engine/index.js +17 -0
- package/dist/Components/NavLauncher/launcherParts.d.ts +2 -0
- package/dist/Components/NavLauncher/launcherParts.js +11 -7
- package/dist/Components/NavLauncher/match.d.ts +13 -2
- package/dist/Components/NavLauncher/match.js +26 -12
- package/dist/Components/NavLauncher/searchLayout.d.ts +60 -0
- package/dist/Components/NavLauncher/searchLayout.js +108 -0
- package/dist/Components/NavLauncher/spotlight.d.ts +39 -0
- package/dist/Components/NavLauncher/spotlight.js +202 -0
- package/dist/Components/NavLauncher/spotlightParts.d.ts +49 -0
- package/dist/Components/NavLauncher/spotlightParts.js +108 -0
- package/dist/Components/NavigationBar/NavigationBar.js +2 -1
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +2 -4
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +6 -5
- package/dist/Components/ScrollToTop/ScrollToTop.js +4 -3
- package/dist/Components/SearchSelect/SearchSelect.js +4 -16
- package/dist/Components/Select/SelectPopup.js +1 -3
- package/dist/Components/Select/optionRowInk.d.ts +12 -0
- package/dist/Components/Select/optionRowInk.js +10 -1
- package/dist/Components/SelectSearch/SelectSearch.js +1 -10
- package/dist/Components/Table/Table.js +3 -2
- package/dist/Components/Table/TableProps.d.ts +1 -1
- package/dist/Components/Table/components/TableBody.js +9 -1
- package/dist/Components/Table/components/TableHeader.js +9 -2
- package/dist/Components/Table/components/TableLoading.d.ts +4 -1
- package/dist/Components/Table/components/TableLoading.js +13 -6
- package/dist/Components/Table/filters/CompactSelect.js +1 -10
- package/dist/Components/Table/variants/TableVariantContext.d.ts +1 -1
- package/dist/Components/Table/variants/TableVariantContext.js +3 -3
- package/dist/Components/WizardDialog/WizardDialog.d.ts +1 -1
- package/dist/Components/WizardDialog/WizardDialog.js +15 -3
- package/dist/Components/WizardDialog/WizardDialogProps.d.ts +5 -3
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +4 -0
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.d.ts +2 -2
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +26 -18
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +38 -8
- package/dist/Theme/chakra/Menu.styles.d.ts +8 -0
- package/dist/Theme/chakra/Menu.styles.js +7 -0
- package/dist/Theme/chakra/componentStyles.d.ts +8 -0
- package/dist/Theme/chakra/componentStyles.js +2 -2
- package/dist/Theme/chakra/ringShadow.d.ts +3 -0
- package/dist/Theme/chakra/ringShadow.js +7 -0
- package/dist/Theme/tokens/builders/accentText.d.ts +2 -0
- package/dist/Theme/tokens/builders/accentText.js +7 -1
- package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +1 -1
- package/dist/Theme/tokens/builders/buildDarkPalette.js +5 -5
- package/dist/Theme/tokens/builders/filledSurface.d.ts +5 -1
- package/dist/Theme/tokens/builders/filledSurface.js +17 -4
- package/dist/Theme/tokens/builders/planeStep.d.ts +1 -0
- package/dist/Theme/tokens/builders/planeStep.js +5 -4
- package/dist/Utils/table.js +2 -2
- package/dist/esm/Components/Button/Button.styles.js +8 -3
- package/dist/esm/Components/CopyButton/CopyButton.js +2 -2
- package/dist/esm/Components/Drawer/Drawer.js +6 -2
- package/dist/esm/Components/Dropdown/DropDown.js +2 -9
- package/dist/esm/Components/FilePreview/FilePreview.js +3 -2
- package/dist/esm/Components/FileUploader/FileUploader.js +4 -0
- package/dist/esm/Components/FormDrawer/FormDrawer.js +3 -3
- package/dist/esm/Components/Input/TextInput.styles.js +10 -6
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +6 -5
- package/dist/esm/Components/Modal/dialogNaming.js +18 -0
- package/dist/esm/Components/NavLauncher/LauncherTabs.js +2 -2
- package/dist/esm/Components/NavLauncher/NavLauncher.js +259 -49
- package/dist/esm/Components/NavLauncher/ScopeBar.js +134 -0
- package/dist/esm/Components/NavLauncher/engine/distance.js +37 -0
- package/dist/esm/Components/NavLauncher/engine/engine.js +458 -0
- package/dist/esm/Components/NavLauncher/engine/fold.js +74 -0
- package/dist/esm/Components/NavLauncher/engine/index.js +14 -0
- package/dist/esm/Components/NavLauncher/launcherParts.js +10 -6
- package/dist/esm/Components/NavLauncher/match.js +25 -12
- package/dist/esm/Components/NavLauncher/searchLayout.js +100 -0
- package/dist/esm/Components/NavLauncher/spotlight.js +194 -0
- package/dist/esm/Components/NavLauncher/spotlightParts.js +95 -0
- package/dist/esm/Components/NavigationBar/NavigationBar.js +2 -1
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +2 -4
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +7 -6
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +5 -4
- package/dist/esm/Components/SearchSelect/SearchSelect.js +6 -18
- package/dist/esm/Components/Select/SelectPopup.js +2 -4
- package/dist/esm/Components/Select/optionRowInk.js +7 -0
- package/dist/esm/Components/SelectSearch/SelectSearch.js +2 -11
- package/dist/esm/Components/Table/Table.js +4 -3
- package/dist/esm/Components/Table/components/TableBody.js +10 -2
- package/dist/esm/Components/Table/components/TableHeader.js +10 -3
- package/dist/esm/Components/Table/components/TableLoading.js +10 -6
- package/dist/esm/Components/Table/filters/CompactSelect.js +2 -11
- package/dist/esm/Components/Table/variants/TableVariantContext.js +3 -3
- package/dist/esm/Components/WizardDialog/WizardDialog.js +15 -3
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +4 -0
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +28 -20
- package/dist/esm/Theme/chakra/Menu.styles.js +7 -0
- package/dist/esm/Theme/chakra/componentStyles.js +2 -2
- package/dist/esm/Theme/chakra/ringShadow.js +3 -0
- package/dist/esm/Theme/tokens/builders/accentText.js +5 -0
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +5 -5
- package/dist/esm/Theme/tokens/builders/filledSurface.js +18 -5
- package/dist/esm/Theme/tokens/builders/planeStep.js +3 -3
- package/dist/esm/Utils/table.js +2 -2
- package/dist/esm/index.js +6 -5
- package/dist/index.d.ts +10 -8
- package/dist/index.js +14 -6
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.describeFacts = exports.QUICK_ACTION_LIMIT = void 0;
|
|
7
|
+
exports.QuickActionsRow = QuickActionsRow;
|
|
8
|
+
exports.TopHitCard = TopHitCard;
|
|
9
|
+
exports.AnswerCard = AnswerCard;
|
|
10
|
+
exports.ShowMoreOption = ShowMoreOption;
|
|
11
|
+
exports.FactList = FactList;
|
|
12
|
+
exports.PreviewPane = PreviewPane;
|
|
13
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
14
|
+
const react_1 = require("@chakra-ui/react");
|
|
15
|
+
const lucide_react_1 = require("lucide-react");
|
|
16
|
+
const react_2 = require("react");
|
|
17
|
+
const motion_1 = require("../../Theme/chakra/motion");
|
|
18
|
+
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
19
|
+
const motion_2 = require("../../Theme/tokens/primitives/motion");
|
|
20
|
+
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
21
|
+
const Button_1 = __importDefault(require("../Button/Button"));
|
|
22
|
+
const CopyButton_1 = __importDefault(require("../CopyButton/CopyButton"));
|
|
23
|
+
const Kbd_1 = require("../Kbd/Kbd");
|
|
24
|
+
const launcherParts_1 = require("./launcherParts");
|
|
25
|
+
exports.QUICK_ACTION_LIMIT = 5;
|
|
26
|
+
const HIDE_ON_TOUCH = { "@media (hover: none)": { display: "none" } };
|
|
27
|
+
function QuickActionsRow({ items, label, link, onRun, }) {
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Flex, { role: "group", "aria-label": label, "data-testid": "launcher-quick-actions", gap: "6px", minW: 0, flexWrap: "wrap", px: "4px", children: items.slice(0, exports.QUICK_ACTION_LIMIT).map((item) => {
|
|
29
|
+
const Icon = item.icon;
|
|
30
|
+
const common = {
|
|
31
|
+
variant: "outline",
|
|
32
|
+
colorScheme: "gray",
|
|
33
|
+
size: "sm",
|
|
34
|
+
borderRadius: "full",
|
|
35
|
+
flexShrink: 0,
|
|
36
|
+
label: item.label,
|
|
37
|
+
leftIcon: Icon ? ((0, jsx_runtime_1.jsx)(Icon, { size: 14, strokeWidth: 2, "aria-hidden": true })) : undefined,
|
|
38
|
+
};
|
|
39
|
+
return item.href && !item.run ? ((0, jsx_runtime_1.jsx)(Button_1.default, { ...common, as: link.linkAs, href: item.href, onClick: link.onPlainClick }, item.id)) : ((0, jsx_runtime_1.jsx)(Button_1.default, { ...common, onClick: () => onRun(item) }, item.id));
|
|
40
|
+
}) }));
|
|
41
|
+
}
|
|
42
|
+
const useCardSurface = (isActive) => {
|
|
43
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
44
|
+
const { edge, fill } = (0, launcherParts_1.activeRowStyle)(colors);
|
|
45
|
+
return {
|
|
46
|
+
position: "relative",
|
|
47
|
+
borderRadius: "xl",
|
|
48
|
+
borderWidth: "1px",
|
|
49
|
+
borderColor: isActive ? edge : colors.boxborder[200],
|
|
50
|
+
bg: isActive ? fill : colors.surfaceRaised,
|
|
51
|
+
transition: (0, motion_2.transitionFor)(["background-color", "border-color"]),
|
|
52
|
+
sx: (0, motion_1.reducedMotionSx)(),
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
function IconChip({ icon, size }) {
|
|
56
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
57
|
+
const Icon = icon !== null && icon !== void 0 ? icon : lucide_react_1.Search;
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Flex, { boxSize: `${size}px`, borderRadius: "10px", bg: colors.primary.opacity[8], color: colors.accentText, align: "center", justify: "center", flexShrink: 0, children: (0, jsx_runtime_1.jsx)(Icon, { size: Math.round(size / 2), strokeWidth: 1.8, "aria-hidden": true }) }));
|
|
59
|
+
}
|
|
60
|
+
function CardAnchor({ item, link }) {
|
|
61
|
+
if (!item.href)
|
|
62
|
+
return null;
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: link.linkAs, href: item.href, tabIndex: -1, "aria-hidden": true, onClick: link.onPlainClick, position: "absolute", inset: 0, borderRadius: "xl" }));
|
|
64
|
+
}
|
|
65
|
+
function TopHitCard({ item, query, isActive, optionId, link, labels, onOpen, onHover, describedBy, }) {
|
|
66
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
67
|
+
const surface = useCardSurface(isActive);
|
|
68
|
+
const meta = [item.context, item.hint].filter(Boolean).join(" · ");
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { role: "presentation", "data-group": true, "data-reveal": isActive, direction: "column", gap: "10px", p: "12px", onMouseMove: onHover, ...surface, children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { id: optionId, role: "option", "aria-selected": isActive, "aria-describedby": describedBy, "data-active": isActive, align: "center", gap: "12px", minW: 0, cursor: "pointer", onClick: () => {
|
|
70
|
+
if (!item.href)
|
|
71
|
+
onOpen();
|
|
72
|
+
}, children: [(0, jsx_runtime_1.jsx)(IconChip, { icon: item.icon, size: 40 }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", flex: 1, minW: 0, gap: "2px", children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "md", lineHeight: "22px", fontWeight: 600, color: colors.text[900], noOfLines: 1, children: (0, jsx_runtime_1.jsx)(launcherParts_1.Highlight, { text: item.label, query: query }) }), meta ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "12.5px", color: colors.textMuted, noOfLines: 1, children: meta })) : null, item.keywordHint ? ((0, jsx_runtime_1.jsxs)(react_1.Text, { fontSize: "xs", color: colors.textMuted, noOfLines: 1, children: [`${labels.matchedOn} “`, (0, jsx_runtime_1.jsx)(launcherParts_1.Highlight, { text: item.keywordHint, query: query }), "\u201D"] })) : null] }), (0, jsx_runtime_1.jsx)(launcherParts_1.CountBadge, { value: item.badge }), (0, jsx_runtime_1.jsx)(react_1.Box, { "aria-hidden": true, flexShrink: 0, sx: HIDE_ON_TOUCH, children: (0, jsx_runtime_1.jsx)(Kbd_1.KbdShortcut, { shortcut: "enter", size: "sm" }) })] }), (0, jsx_runtime_1.jsx)(CardAnchor, { item: item, link: link })] }));
|
|
73
|
+
}
|
|
74
|
+
function AnswerCard({ item, isActive, optionId, link, labels, onOpen, onHover, describedBy, }) {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
77
|
+
const surface = useCardSurface(isActive);
|
|
78
|
+
const answer = (_a = item.answer) !== null && _a !== void 0 ? _a : {
|
|
79
|
+
label: (_b = item.context) !== null && _b !== void 0 ? _b : "",
|
|
80
|
+
value: item.label,
|
|
81
|
+
};
|
|
82
|
+
const acts = Boolean(item.href || item.run);
|
|
83
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { role: "presentation", "data-group": true, p: "12px 14px", onMouseMove: onHover, ...surface, children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { id: optionId, role: "option", "aria-selected": isActive, "aria-describedby": describedBy, "data-active": isActive, align: "center", gap: "12px", flex: 1, minW: 0, cursor: "pointer", onClick: () => {
|
|
84
|
+
if (!item.href)
|
|
85
|
+
onOpen();
|
|
86
|
+
}, children: [(0, jsx_runtime_1.jsx)(IconChip, { icon: item.icon, size: 36 }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { direction: "column", flex: 1, minW: 0, gap: "1px", children: [answer.label ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs-minus", fontWeight: 600, letterSpacing: "0.06em", textTransform: "uppercase", color: colors.textMuted, noOfLines: 1, children: answer.label })) : null, (0, jsx_runtime_1.jsx)(react_1.Text, { id: `${optionId}-value`, fontSize: "lg", lineHeight: "24px", fontWeight: 600, color: colors.text[900], noOfLines: 2, children: answer.value }), answer.hint ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs", color: colors.textMuted, noOfLines: 1, children: answer.hint })) : null] }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { "aria-hidden": true, align: "center", gap: "6px", flexShrink: 0, fontSize: "11.5px", color: colors.textMuted, sx: HIDE_ON_TOUCH, children: [(0, jsx_runtime_1.jsx)(Kbd_1.KbdShortcut, { shortcut: "enter", size: "xs" }), acts ? labels.hintOpen : labels.hintCopy] })] }), (0, jsx_runtime_1.jsx)(CardAnchor, { item: item, link: link })] }));
|
|
87
|
+
}
|
|
88
|
+
function ShowMoreOption({ count, isActive, optionId, label, onExpand, onHover, }) {
|
|
89
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
90
|
+
const isTouch = (0, launcherParts_1.useTouchDensity)();
|
|
91
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Flex, { id: optionId, role: "option", "aria-selected": isActive, "data-active": isActive, align: "center", gap: "6px", minH: isTouch ? "44px" : "30px", px: "8px", mt: "2px", borderRadius: "lg", cursor: "pointer", fontSize: "12.5px", fontWeight: 500, color: colors.accentText, onClick: onExpand, onMouseMove: onHover, _hover: { bg: (0, rowStates_1.listRowBackgrounds)(colors).active }, sx: isActive ? (0, launcherParts_1.activeRowSurface)(colors) : undefined, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: 14, strokeWidth: 2, "aria-hidden": true }), label(count)] }));
|
|
92
|
+
}
|
|
93
|
+
const describeFacts = (facts) => facts.map((f) => `${f.label}: ${f.value}`).join("; ");
|
|
94
|
+
exports.describeFacts = describeFacts;
|
|
95
|
+
function FactList({ facts, labels, layout, onCopied, onCopyBlocked, }) {
|
|
96
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
97
|
+
const values = (0, react_2.useRef)([]);
|
|
98
|
+
const isPane = layout === "pane";
|
|
99
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "dl", m: 0, display: "grid", gridTemplateColumns: isPane ? "minmax(0, 1fr)" : "repeat(auto-fill, minmax(11rem, 1fr))", gap: isPane ? "12px" : "6px 16px", children: facts.map((fact, i) => ((0, jsx_runtime_1.jsxs)(react_1.Box, { minW: 0, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { as: "dt", fontSize: "11.5px", lineHeight: "16px", color: colors.textMuted, children: fact.label }), (0, jsx_runtime_1.jsxs)(react_1.Flex, { as: "dd", m: 0, align: "center", gap: "2px", minW: 0, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { ref: (node) => {
|
|
100
|
+
values.current[i] = node;
|
|
101
|
+
}, fontSize: isPane ? "13.5px" : "12.5px", lineHeight: "20px", color: colors.text[900], wordBreak: "break-word", minW: 0, children: fact.value }), fact.copyable ? ((0, jsx_runtime_1.jsx)(CopyButton_1.default, { value: fact.value, tooltip: labels.copy(fact.label), copiedLabel: labels.copied, size: isPane ? "xs" : "sm", iconSize: 14, onCopy: onCopied, onCopyError: () => onCopyBlocked(values.current[i]) })) : null] })] }, `${fact.label}-${i}`))) }));
|
|
102
|
+
}
|
|
103
|
+
function PreviewPane({ item, placement, width, labels, onCopied, onCopyBlocked, }) {
|
|
104
|
+
var _a, _b, _c, _d, _e;
|
|
105
|
+
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
106
|
+
const isDock = placement === "dock";
|
|
107
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Flex, { as: "aside", "aria-label": labels.preview, "data-testid": "launcher-preview", "data-scroll-region": true, direction: "column", gap: isDock ? "10px" : "16px", w: isDock ? "100%" : width, maxH: isDock ? "min(45vh, 20rem)" : undefined, flexShrink: 0, px: "18px", pt: isDock ? "12px" : "16px", pb: isDock ? "12px" : "16px", bg: colors.backgroundColor.subtle, ...(isDock ? { borderTopWidth: "1px" } : { borderLeftWidth: "1px" }), borderColor: colors.boxborder[200], overflowY: "auto", children: item ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", gap: "10px", minW: 0, children: [(0, jsx_runtime_1.jsx)(IconChip, { icon: item.icon, size: isDock ? 28 : 36 }), (0, jsx_runtime_1.jsxs)(react_1.Box, { minW: 0, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: isDock ? "14px" : "15px", fontWeight: 600, color: colors.text[900], noOfLines: isDock ? 1 : 2, children: (_b = (_a = item.answer) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : item.label }), item.context || item.answer ? ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xs", color: colors.textMuted, noOfLines: 1, children: (_d = (_c = item.answer) === null || _c === void 0 ? void 0 : _c.label) !== null && _d !== void 0 ? _d : item.context })) : null] })] }), ((_e = item.facts) === null || _e === void 0 ? void 0 : _e.length) ? ((0, jsx_runtime_1.jsx)(FactList, { facts: item.facts, labels: labels, layout: isDock ? "inline" : "pane", onCopied: onCopied, onCopyBlocked: onCopyBlocked }, item.id)) : ((0, jsx_runtime_1.jsxs)(react_1.Flex, { "aria-hidden": true, align: "center", gap: "6px", fontSize: "xs", color: colors.textMuted, children: [(0, jsx_runtime_1.jsx)(Kbd_1.KbdShortcut, { shortcut: "enter", size: "xs" }), labels.hintOpen] }))] })) : null }));
|
|
108
|
+
}
|
|
@@ -9,6 +9,7 @@ const react_1 = require("@chakra-ui/react");
|
|
|
9
9
|
const Avatar_1 = __importDefault(require("../Avatar/Avatar"));
|
|
10
10
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
11
11
|
const surfaceRaised_1 = require("../../Theme/tokens/builders/surfaceRaised");
|
|
12
|
+
const planeStep_1 = require("../../Theme/tokens/builders/planeStep");
|
|
12
13
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
13
14
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
14
15
|
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
@@ -54,7 +55,7 @@ function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavO
|
|
|
54
55
|
_focus: { bg: menuHoverBg },
|
|
55
56
|
_active: { bg: rowBackgrounds.selectedActive },
|
|
56
57
|
};
|
|
57
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { bg: theme.colors.backgroundColor.light, px: 4, borderBottom: "1px solid", borderColor: theme.colors.
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { bg: theme.colors.backgroundColor.light, px: 4, borderBottom: "1px solid", borderColor: (0, planeStep_1.ruleOn)(theme.colors, theme.colors.backgroundColor.light), children: (0, jsx_runtime_1.jsxs)(react_1.Flex, { h: 16, alignItems: "center", justifyContent: "space-between", gap: 2, children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", gap: 1.5, alignItems: "center", flex: "1 1 0%", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { as: "button", type: "button", onClick: () => onSideBarToggole === null || onSideBarToggole === void 0 ? void 0 : onSideBarToggole(), onMouseEnter: onSideBarPeek, onFocus: onSideBarPeek, "aria-label": sideBarToggole ? "Close navigation menu" : "Open navigation menu", "aria-expanded": !!sideBarToggole, ...iconButtonStyle, flexShrink: 0, display: forceSideBarToggle ? "flex" : { base: "flex", lg: "none" }, w: SIDEBAR_TOGGLE_HIT, h: SIDEBAR_TOGGLE_HIT, children: sideBarToggole ? ((0, jsx_runtime_1.jsx)(lucide_react_1.PanelLeftClose, { size: "1.25rem" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.PanelRightClose, { size: "1.25rem" })) }), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) && ((0, jsx_runtime_1.jsx)(react_1.Box, { ...iconButtonStyle, as: "button", type: "button", "aria-label": "Go back", display: "flex", flexShrink: 0, onClick: () => { var _a; return (_a = navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) === null || _a === void 0 ? void 0 : _a.call(navigationBarText); }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.CircleArrowLeft, { size: "1.25rem", color: theme.colors.text[500] }) })), leading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [leading, (0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", "aria-hidden": "true", mx: 2, w: "1px", h: "1.625rem", flexShrink: 0, bg: (0, planeStep_1.ruleOn)(theme.colors, theme.colors.backgroundColor.light) })] })), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text) && ((0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: typeof navigationBarText.text === "string" ? navigationBarText.text : "", overflowOnly: true, placement: "bottom", children: (0, jsx_runtime_1.jsx)(react_1.Text, { flex: "1 1 0%", w: 0, minW: 0, isTruncated: true, color: (0, accentText_1.accentTextOnCanvas)(theme.colors.secondary, theme.colors.backgroundColor.light), fontSize: "xl", fontWeight: 600, fontFamily: "open-sans, sans-serif", letterSpacing: "-0.013rem", children: navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text }) }))] }), (0, jsx_runtime_1.jsx)(react_1.Flex, { minW: 0, flexShrink: 1, children: (0, jsx_runtime_1.jsxs)(react_1.Stack, { direction: "row", alignItems: "center", spacing: 4, minW: 0, children: [moreIcon && ((0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", minW: 0, sx: { "& > *": { minW: 0 } }, children: moreIcon })), (0, jsx_runtime_1.jsxs)(react_1.Menu, { children: [(0, jsx_runtime_1.jsx)(react_1.MenuButton, { as: react_1.Button, rounded: "full", variant: "link", cursor: "pointer", minW: 0, flexShrink: 0, children: (0, jsx_runtime_1.jsx)(Avatar_1.default, { size: "sm", name: userName, src: userAvathar }) }), (0, jsx_runtime_1.jsx)(react_1.MenuList, { alignItems: "center", zIndex: 5, p: 0, py: "0.375rem",
|
|
58
59
|
// Without a cap one long title stretches the whole dropdown; titles truncate instead.
|
|
59
60
|
maxW: "18rem", bg: theme.colors.surfaceRaised,
|
|
60
61
|
// NOTE: Chakra's MenuItem inherits --menu-bg hardcoded to #fff via dead _dark — set it or items stay white.
|
|
@@ -12,6 +12,7 @@ const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
|
12
12
|
const chartColorsFromTheme_1 = require("../../Theme/tokens/builders/chartColorsFromTheme");
|
|
13
13
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
14
14
|
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
15
|
+
const optionRowInk_1 = require("../Select/optionRowInk");
|
|
15
16
|
const useExclusiveOverlay_1 = require("../../Hooks/useExclusiveOverlay");
|
|
16
17
|
const useMatchMedia_1 = require("../../Hooks/useMatchMedia");
|
|
17
18
|
const ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
@@ -111,14 +112,11 @@ const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSear
|
|
|
111
112
|
}
|
|
112
113
|
}, borderRadius: "lg" })] }) })), (0, jsx_runtime_1.jsxs)(react_2.Box, { role: "listbox", "aria-label": "Organizations", maxH: "320px", overflowY: "auto", py: 1, onKeyDown: handleListKeyDown, children: [filtered.map((org, idx) => {
|
|
113
114
|
const isActive = org.id === value;
|
|
114
|
-
const rowHoverBg = isActive
|
|
115
|
-
? rowBackgrounds.selectedActive
|
|
116
|
-
: rowBackgrounds.active;
|
|
117
115
|
return ((0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "button", type: "button", role: "option", "aria-selected": isActive, ref: (el) => {
|
|
118
116
|
optionRefs.current[idx] = el;
|
|
119
117
|
if (idx === 0)
|
|
120
118
|
firstOptionRef.current = el;
|
|
121
|
-
}, tabIndex: idx === activeIndex ? 0 : -1, align: "center", gap: "10px", w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", px: 3, py: 2, cursor: "pointer", bg:
|
|
119
|
+
}, tabIndex: idx === activeIndex ? 0 : -1, align: "center", gap: "10px", w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", px: 3, py: 2, cursor: "pointer", bg: "transparent", transition: "background 0.12s ease", ...(0, optionRowInk_1.optionRowCursorSx)(rowBackgrounds), onClick: () => handleSelect(org), children: [(0, jsx_runtime_1.jsx)(Avatar, { org: org, boxSize: s.avatar, fontSize: s.sub }), (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: "1", minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.font, fontWeight: isActive ? 600 : 500, color: theme.colors.text[900], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: org.name }), showRole && org.role && ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.sub, color: theme.colors.text[500], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: org.role }))] }), isActive && ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.Check, size: 16, color: theme.colors.accentText, flexShrink: 0 }))] }, org.id));
|
|
122
120
|
}), filtered.length === 0 && ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: theme.colors.textMuted, textAlign: "center", py: 6, children: "No organizations found" }))] })] }) })] }));
|
|
123
121
|
};
|
|
124
122
|
exports.default = OrgSwitcher;
|
|
@@ -26,6 +26,7 @@ function ProfilePhotoViewer({ photoUrl, onPhotoChange, imageWidth = "100px", ima
|
|
|
26
26
|
const fileInputRef = (0, react_1.useRef)(null);
|
|
27
27
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
28
28
|
const c = theme.colors;
|
|
29
|
+
const editFill = (0, filledSurface_1.resolveFilledSurface)(c.primary, c);
|
|
29
30
|
const handlePhotoChange = (event) => {
|
|
30
31
|
var _a;
|
|
31
32
|
if (!isEditable)
|
|
@@ -75,14 +76,14 @@ function ProfilePhotoViewer({ photoUrl, onPhotoChange, imageWidth = "100px", ima
|
|
|
75
76
|
"&:hover .ppv-media": {
|
|
76
77
|
boxShadow: `0 0 0 0.1875rem ${c.primary.opacity[24]}`,
|
|
77
78
|
},
|
|
78
|
-
}, children: [(0, jsx_runtime_1.jsx)(react_2.Box, { className: "ppv-media", borderRadius: imageBorderRadius, transition: RING_TRANSITION, children: renderMedia() }), hasActions && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Box, { className: "ppv-overlay", position: "absolute", inset: 0, borderRadius: imageBorderRadius, bg: hoverScrim(0.3), opacity: 0, transition: FADE_TRANSITION, pointerEvents: "none" }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { className: "ppv-actions", position: "absolute", right: editIconPositionRight, bottom: editIconPositionBottom, transform: "translate(-15%, -15%)", spacing: 1.5, opacity: revealOnHover ? 0 : 1, transition: FADE_TRANSITION, children: [isEditable && ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: "Edit", "aria-label": "Edit", hasArrow: true, children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { icon: (0, jsx_runtime_1.jsx)(lucide_react_1.SquarePen, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleClick, "aria-label": "Edit photo", bg:
|
|
79
|
-
bg:
|
|
80
|
-
color:
|
|
79
|
+
}, children: [(0, jsx_runtime_1.jsx)(react_2.Box, { className: "ppv-media", borderRadius: imageBorderRadius, transition: RING_TRANSITION, children: renderMedia() }), hasActions && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Box, { className: "ppv-overlay", position: "absolute", inset: 0, borderRadius: imageBorderRadius, bg: hoverScrim(0.3), opacity: 0, transition: FADE_TRANSITION, pointerEvents: "none" }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { className: "ppv-actions", position: "absolute", right: editIconPositionRight, bottom: editIconPositionBottom, transform: "translate(-15%, -15%)", spacing: 1.5, opacity: revealOnHover ? 0 : 1, transition: FADE_TRANSITION, children: [isEditable && ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: "Edit", "aria-label": "Edit", hasArrow: true, children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { icon: (0, jsx_runtime_1.jsx)(lucide_react_1.SquarePen, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleClick, "aria-label": "Edit photo", bg: editFill.fill, color: editFill.color, border: `0.125rem solid ${c.background[50]}`, boxShadow: (_b = theme.shadows) === null || _b === void 0 ? void 0 : _b.md, style: style, transition: ACTION_TRANSITION, _hover: {
|
|
80
|
+
bg: editFill.hoverFill,
|
|
81
|
+
color: editFill.hoverColor,
|
|
81
82
|
transform: "scale(1.1)",
|
|
82
83
|
boxShadow: (_c = theme.shadows) === null || _c === void 0 ? void 0 : _c.lg,
|
|
83
84
|
}, _active: {
|
|
84
|
-
bg:
|
|
85
|
-
color:
|
|
85
|
+
bg: editFill.activeFill,
|
|
86
|
+
color: editFill.activeColor,
|
|
86
87
|
} }) })), isView && ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: "View", "aria-label": "View", hasArrow: true, children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, { size: 14 }), isRound: isRound, size: editIconSize, onClick: handleIsView, "aria-label": "View photo", bg: c.background[50], color: c.text[700], border: `${borderWidths_1.BORDER_WIDTHS.hairline} solid ${border}`, boxShadow: (_d = theme.shadows) === null || _d === void 0 ? void 0 : _d.md, style: style, transition: ACTION_TRANSITION, _hover: {
|
|
87
88
|
bg: c.gray[50],
|
|
88
89
|
color: (0, accentText_1.accentTextOnCanvas)(c.primary, c.gray[50]),
|
|
@@ -19,6 +19,7 @@ const ScrollToTop = ({ children, tooltipLabel = "Scroll to top", threshold = 300
|
|
|
19
19
|
const [visible, setVisible] = (0, react_1.useState)(false);
|
|
20
20
|
const anchorRef = (0, react_1.useRef)(null);
|
|
21
21
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
22
|
+
const fill = (0, filledSurface_1.resolveFilledSurface)(theme.colors.primary, theme.colors);
|
|
22
23
|
const getScroller = () => {
|
|
23
24
|
var _a, _b;
|
|
24
25
|
if (useWindow)
|
|
@@ -67,9 +68,9 @@ const ScrollToTop = ({ children, tooltipLabel = "Scroll to top", threshold = 300
|
|
|
67
68
|
};
|
|
68
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
70
|
}, [useWindow, threshold]);
|
|
70
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { ref: anchorRef, position: "relative", children: [children, (0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: tooltipLabel, placement: "left", children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", onClick: scrollToTop, "aria-label": tooltipLabel, border: "none", position: "fixed", bottom: bottom, right: right, zIndex: 1000, display: "flex", alignItems: "center", justifyContent: "center", boxSize: "44px", borderRadius: "full", cursor: "pointer", bg:
|
|
71
|
-
bg:
|
|
72
|
-
color:
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { ref: anchorRef, position: "relative", children: [children, (0, jsx_runtime_1.jsx)(ToolTip_1.default, { label: tooltipLabel, placement: "left", children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", onClick: scrollToTop, "aria-label": tooltipLabel, border: "none", position: "fixed", bottom: bottom, right: right, zIndex: 1000, display: "flex", alignItems: "center", justifyContent: "center", boxSize: "44px", borderRadius: "full", cursor: "pointer", bg: fill.fill, color: fill.color, boxShadow: "md", opacity: visible ? 1 : 0, transform: visible ? "translateY(0) scale(1)" : "translateY(16px) scale(0.85)", pointerEvents: visible ? "auto" : "none", transition: (0, primitives_1.transitionFor)(["opacity", "transform", "box-shadow", "background-color", "color"], "base"), _hover: {
|
|
72
|
+
bg: fill.hoverFill,
|
|
73
|
+
color: fill.hoverColor,
|
|
73
74
|
transform: "translateY(-2px) scale(1.05)",
|
|
74
75
|
boxShadow: "lg",
|
|
75
76
|
}, _active: { transform: "scale(0.95)" }, sx: { ...(0, focusRing_styles_1.focusVisibleStyles)(theme.colors), ...(0, motion_1.reducedMotionSx)({ transform: "none" }) }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronUp, { size: 24, strokeWidth: 2.5 }) }) })] }));
|
|
@@ -79,17 +79,9 @@ const normalizeMultiValue = (val) => {
|
|
|
79
79
|
const DECORATIVE_CHECKBOX_SX = { pointerEvents: "none", "& input": { visibility: "hidden" } };
|
|
80
80
|
const OptionRow = react_1.default.memo(function OptionRow({ option, index, optionId, isSelected, isActive, isMultiple, spec, colors, rowBackgrounds, checkboxSize, onSelect, onActivate, }) {
|
|
81
81
|
const singleSelected = isSelected && !isMultiple;
|
|
82
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { id: optionId, "data-index": index, role: "option", "aria-selected": isSelected, py: spec.py, px: spec.px, minH: spec.minH, cursor: "pointer", bg:
|
|
83
|
-
? isActive
|
|
84
|
-
? rowBackgrounds.selectedActive
|
|
85
|
-
: rowBackgrounds.selected
|
|
86
|
-
: isActive
|
|
87
|
-
? rowBackgrounds.active
|
|
88
|
-
: "transparent", _hover: {
|
|
89
|
-
bg: isSelected ? rowBackgrounds.selectedActive : rowBackgrounds.active,
|
|
90
|
-
}, onClick: () => onSelect(option), onMouseEnter: () => onActivate(index), display: "flex", alignItems: "center", gap: spec.gap, color: (0, optionRowInk_1.optionRowInk)(colors, singleSelected),
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { id: optionId, "data-index": index, role: "option", "aria-selected": isSelected, mx: spec.mx, py: spec.py, px: spec.px, minH: spec.minH, borderRadius: optionRowSizes_1.OPTION_ROW_RADIUS, cursor: "pointer", bg: (0, optionRowInk_1.optionRowFill)(rowBackgrounds, isActive), onClick: () => onSelect(option), onMouseEnter: () => onActivate(index), display: "flex", alignItems: "center", gap: spec.gap, color: (0, optionRowInk_1.optionRowInk)(colors, singleSelected),
|
|
91
83
|
// `view` is consumer JSX with no size of its own; it inherited the 16px body font.
|
|
92
|
-
fontSize: spec.fontSize, fontWeight: (0, optionRowInk_1.optionRowWeight)(singleSelected),
|
|
84
|
+
fontSize: spec.fontSize, fontWeight: (0, optionRowInk_1.optionRowWeight)(singleSelected), children: [isMultiple && ((0, jsx_runtime_1.jsx)(Checkbox_1.default, { isChecked: isSelected, sx: DECORATIVE_CHECKBOX_SX, size: checkboxSize })), option.view ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: option.view })) : ((0, jsx_runtime_1.jsx)(react_2.Text, { flex: 1, minW: 0, isTruncated: true, children: option.label })), singleSelected && ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.Check, size: spec.iconSize, color: colors.accentText, flexShrink: 0 }))] }));
|
|
93
85
|
});
|
|
94
86
|
/** Full-featured combobox: search, chips, select-all, paginated infinite scroll — not DOM-virtualized despite the `virtualization` prop. */
|
|
95
87
|
/** Prefer `Select` with `native={false}` for new work — not yet a drop-in; see select-absorption-spec.md. */
|
|
@@ -656,11 +648,7 @@ const SearchSelect = ({ id, label, options, onChange, onSelect, onSearch, isOpti
|
|
|
656
648
|
}, children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { minW: "4.5rem", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", gap: 1, width: insideSelect.width, height: insideSelectBoxHeight, pl: "0.5rem", pr: "0.375rem", children: [insideLabel ? ((0, jsx_runtime_1.jsx)(SelectTruncatedLabel_1.default, { label: insideLabel, maxWidth: insideSelect.width || "6rem", fontSize: s.fieldFontSize })) : ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.fieldFontSize, fontWeight: 500, color: theme.colors.textMuted, isTruncated: true, maxW: insideSelect.width || "6rem", children: insidePlaceholder })), (0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-flex", flexShrink: 0, color: customSelectOpen ? theme.colors.accentText : theme.colors.textMuted, transition: CHEVRON_TRANSITION, transform: customSelectOpen ? "rotate(180deg)" : "rotate(0deg)", children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { size: s.chevronSize }) })] }), customSelectOpen && ((0, jsx_runtime_1.jsx)(react_2.Portal, { children: (0, jsx_runtime_1.jsx)(react_2.Box, { ref: setInsideSelectMenuRef, id: insideSelectPortalId, role: "listbox", "aria-label": insidePlaceholder, onKeyDown: handleInsideMenuKeyDown, onFocus: stopFocusBubbling, onBlur: stopFocusBubbling, position: "fixed", style: { top: `${customSelectPos.top}px`, left: `${customSelectPos.left}px` }, zIndex: zIndices_1.default.popoverNested, bg: theme.colors.surfaceRaised, border: `${borderWidths_1.BORDER_WIDTHS.hairline} solid`, borderColor: theme.colors.boxborder[200], borderRadius: "xl", boxShadow: theme.shadows.lg, minW: `${customSelectPos.width}px`, maxW: "20rem", py: 1, overflow: "hidden", children: (_c = insideSelect.option) === null || _c === void 0 ? void 0 : _c.map((item) => {
|
|
657
649
|
var _a;
|
|
658
650
|
const selected = ((_a = insideSelect.value) === null || _a === void 0 ? void 0 : _a.id) === item.id;
|
|
659
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", gap: spec.gap, minH: spec.minH, py: spec.py, px: spec.px, fontSize: spec.fontSize, fontWeight: (0, optionRowInk_1.optionRowWeight)(selected), color: (0, optionRowInk_1.optionRowInk)(theme.colors, selected), bg:
|
|
660
|
-
bg: selected
|
|
661
|
-
? rowBackgrounds.selectedActive
|
|
662
|
-
: rowBackgrounds.active,
|
|
663
|
-
}, cursor: "pointer", role: "option", "aria-selected": selected, tabIndex: -1, _focusVisible: insideFocusRing, onClick: (e) => {
|
|
651
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", gap: spec.gap, minH: spec.minH, py: spec.py, px: spec.px, fontSize: spec.fontSize, fontWeight: (0, optionRowInk_1.optionRowWeight)(selected), color: (0, optionRowInk_1.optionRowInk)(theme.colors, selected), bg: "transparent", ...(0, optionRowInk_1.optionRowCursorSx)(rowBackgrounds), cursor: "pointer", role: "option", "aria-selected": selected, tabIndex: -1, _focusVisible: insideFocusRing, onClick: (e) => {
|
|
664
652
|
e.stopPropagation();
|
|
665
653
|
handleCustomSelect(item);
|
|
666
654
|
}, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { isTruncated: true, children: item.label }), selected && ((0, jsx_runtime_1.jsx)(lucide_react_1.Check, { size: spec.iconSize, color: theme.colors.accentText }))] }, item.id));
|
|
@@ -699,6 +687,6 @@ const SearchSelect = ({ id, label, options, onChange, onSelect, onSearch, isOpti
|
|
|
699
687
|
top: `${dropdownPos.top}px`,
|
|
700
688
|
left: `${dropdownPos.left}px`,
|
|
701
689
|
width: `${dropdownPos.width}px`,
|
|
702
|
-
}, zIndex: zIndices_1.default.popover, maxH: "20rem", borderWidth: 1, borderColor: theme.colors.boxborder[200], borderRadius: "xl", overflow: "hidden", bg: theme.colors.surfaceRaised, boxShadow: theme.shadows.lg, display: "flex", flexDirection: "column", children: [hasSelectAllRow && ((0, jsx_runtime_1.jsxs)(react_2.Box, { id: selectAllId, role: "option", "aria-selected": allFilteredSelected, bg: activeIndex === searchSelectNav_1.SELECT_ALL_ROW ? rowBackgrounds.active : undefined, py: spec.py, px: spec.px, minH: spec.minH, cursor: "pointer", onClick: handleSelectAll, display: "flex", alignItems: "center", gap: spec.gap, color: theme.colors.text[700], borderBottom: `${borderWidths_1.BORDER_WIDTHS.hairline} solid ${(0, surfaceRaised_1.raisedRule)(theme.colors)}`, children: [(0, jsx_runtime_1.jsx)(Checkbox_1.default, { isChecked: allFilteredSelected, sx: DECORATIVE_CHECKBOX_SX, size: s.checkboxSize }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: spec.fontSize, children: allFilteredSelected ? "Unselect All" : "Select All" })] })), (0, jsx_runtime_1.jsx)(react_2.Box, { ref: optionsListRef, flex: "1", overflowY: "auto", onScroll: handleScroll, maxH: "15rem", borderBottom: `${borderWidths_1.BORDER_WIDTHS.hairline} solid`, borderColor: (0, surfaceRaised_1.raisedRule)(theme.colors), children: isOptionLoading && filteredOptions.length === 0 ? ((0, jsx_runtime_1.jsxs)(react_2.Box, { py: spec.py, px: spec.px, display: "flex", alignItems: "center", gap: spec.gap, minH: spec.minH, color: theme.colors.textMuted, children: [(0, jsx_runtime_1.jsx)(react_2.Spinner, { size: s.spinnerSize }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: spec.fontSize, children: loadingText })] })) : !isOptionLoading && filteredOptions.length === 0 ? ((0, jsx_runtime_1.jsx)(react_2.Text, { p: 3, fontSize: spec.fontSize, color: theme.colors.textMuted, children: "No results found" })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [filteredOptions.map((option, index) => ((0, jsx_runtime_1.jsx)(OptionRow, { option: option, index: index, optionId: getOptionId(index), isSelected: isSelected(option.id), isActive: index === activeIndex, isMultiple: isMultiple, spec: spec, colors: theme.colors, rowBackgrounds: rowBackgrounds, checkboxSize: s.checkboxSize, onSelect: selectOption, onActivate: setActiveIndex }, option.id))), ((pagination === null || pagination === void 0 ? void 0 : pagination.scrollLoading) || (isOptionLoading && filteredOptions.length > 0)) && ((0, jsx_runtime_1.jsxs)(react_2.Box, { py: spec.py, px: spec.px, display: "flex", alignItems: "center", justifyContent: "center", gap: spec.gap, minH: spec.minH, color: theme.colors.textMuted, children: [(0, jsx_runtime_1.jsx)(react_2.Spinner, { size: s.spinnerSize }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: spec.fontSize, children: loadingText })] }))] })) }), (addNew === null || addNew === void 0 ? void 0 : addNew.enabled) && ((0, jsx_runtime_1.jsxs)(react_2.Box, { id: addNewId, role: "option", "aria-selected": false, py: spec.py, px: spec.px, borderTop: `${borderWidths_1.BORDER_WIDTHS.hairline} solid`, borderColor: (0, surfaceRaised_1.raisedRule)(theme.colors), bg: activeIndex === searchSelectNav_1.ADD_NEW_ROW ? rowBackgrounds.active : theme.colors.surfaceRaised, display: "flex", alignItems: "center", gap: spec.gap, color: theme.colors.accentText, fontWeight: 500, minH: spec.minH, cursor: "pointer", onClick: addNew.onClick, _hover: { bg: rowBackgrounds.active }, children: [addNew.icon || (0, jsx_runtime_1.jsx)(lucide_react_1.Plus, { size: s.addNewIconSize }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: spec.fontSize, children: addNew.text || "Add New" })] }))] }) })), (0, jsx_runtime_1.jsx)(FieldMessage_1.default, { error: error, errorMessage: errorMessage, helperText: helperText, helperId: ids.helperId, errorId: ids.errorId })] }));
|
|
690
|
+
}, zIndex: zIndices_1.default.popover, maxH: "20rem", borderWidth: 1, borderColor: theme.colors.boxborder[200], borderRadius: "xl", overflow: "hidden", bg: theme.colors.surfaceRaised, boxShadow: theme.shadows.lg, display: "flex", flexDirection: "column", children: [hasSelectAllRow && ((0, jsx_runtime_1.jsxs)(react_2.Box, { id: selectAllId, role: "option", "aria-selected": allFilteredSelected, bg: activeIndex === searchSelectNav_1.SELECT_ALL_ROW ? rowBackgrounds.active : undefined, py: spec.py, px: spec.px, minH: spec.minH, cursor: "pointer", onClick: handleSelectAll, display: "flex", alignItems: "center", gap: spec.gap, color: theme.colors.text[700], borderBottom: `${borderWidths_1.BORDER_WIDTHS.hairline} solid ${(0, surfaceRaised_1.raisedRule)(theme.colors)}`, children: [(0, jsx_runtime_1.jsx)(Checkbox_1.default, { isChecked: allFilteredSelected, sx: DECORATIVE_CHECKBOX_SX, size: s.checkboxSize }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: spec.fontSize, children: allFilteredSelected ? "Unselect All" : "Select All" })] })), (0, jsx_runtime_1.jsx)(react_2.Box, { ref: optionsListRef, flex: "1", overflowY: "auto", onScroll: handleScroll, maxH: "15rem", py: 1, borderBottom: `${borderWidths_1.BORDER_WIDTHS.hairline} solid`, borderColor: (0, surfaceRaised_1.raisedRule)(theme.colors), children: isOptionLoading && filteredOptions.length === 0 ? ((0, jsx_runtime_1.jsxs)(react_2.Box, { py: spec.py, px: spec.px, display: "flex", alignItems: "center", gap: spec.gap, minH: spec.minH, color: theme.colors.textMuted, children: [(0, jsx_runtime_1.jsx)(react_2.Spinner, { size: s.spinnerSize }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: spec.fontSize, children: loadingText })] })) : !isOptionLoading && filteredOptions.length === 0 ? ((0, jsx_runtime_1.jsx)(react_2.Text, { p: 3, fontSize: spec.fontSize, color: theme.colors.textMuted, children: "No results found" })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [filteredOptions.map((option, index) => ((0, jsx_runtime_1.jsx)(OptionRow, { option: option, index: index, optionId: getOptionId(index), isSelected: isSelected(option.id), isActive: index === activeIndex, isMultiple: isMultiple, spec: spec, colors: theme.colors, rowBackgrounds: rowBackgrounds, checkboxSize: s.checkboxSize, onSelect: selectOption, onActivate: setActiveIndex }, option.id))), ((pagination === null || pagination === void 0 ? void 0 : pagination.scrollLoading) || (isOptionLoading && filteredOptions.length > 0)) && ((0, jsx_runtime_1.jsxs)(react_2.Box, { py: spec.py, px: spec.px, display: "flex", alignItems: "center", justifyContent: "center", gap: spec.gap, minH: spec.minH, color: theme.colors.textMuted, children: [(0, jsx_runtime_1.jsx)(react_2.Spinner, { size: s.spinnerSize }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: spec.fontSize, children: loadingText })] }))] })) }), (addNew === null || addNew === void 0 ? void 0 : addNew.enabled) && ((0, jsx_runtime_1.jsxs)(react_2.Box, { id: addNewId, role: "option", "aria-selected": false, py: spec.py, px: spec.px, borderTop: `${borderWidths_1.BORDER_WIDTHS.hairline} solid`, borderColor: (0, surfaceRaised_1.raisedRule)(theme.colors), bg: activeIndex === searchSelectNav_1.ADD_NEW_ROW ? rowBackgrounds.active : theme.colors.surfaceRaised, display: "flex", alignItems: "center", gap: spec.gap, color: theme.colors.accentText, fontWeight: 500, minH: spec.minH, cursor: "pointer", onClick: addNew.onClick, _hover: { bg: rowBackgrounds.active }, children: [addNew.icon || (0, jsx_runtime_1.jsx)(lucide_react_1.Plus, { size: s.addNewIconSize }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: spec.fontSize, children: addNew.text || "Add New" })] }))] }) })), (0, jsx_runtime_1.jsx)(FieldMessage_1.default, { error: error, errorMessage: errorMessage, helperText: helperText, helperId: ids.helperId, errorId: ids.errorId })] }));
|
|
703
691
|
};
|
|
704
692
|
exports.default = SearchSelect;
|
|
@@ -74,9 +74,7 @@ const parseRemToPx = (value, fallbackPx) => {
|
|
|
74
74
|
};
|
|
75
75
|
const OptionRow = react_1.default.memo(function OptionRow({ option, index, listboxId, isSelected, isActive, isMulti, theme, backgrounds, spec, renderOption, onSelect, onActivate, }) {
|
|
76
76
|
const isSingleSelected = isSelected && !isMulti;
|
|
77
|
-
|
|
78
|
-
const restBg = isActive ? backgrounds.active : "transparent";
|
|
79
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { id: optionDomId(listboxId, option.id), "data-index": index, role: "option", "aria-selected": isSelected, "aria-disabled": option.isDisabled, onMouseEnter: () => onActivate(index), onClick: () => onSelect(option), mx: spec.mx, px: spec.px, py: spec.py, minH: spec.minH, borderRadius: "md", cursor: option.isDisabled ? "not-allowed" : "pointer", opacity: option.isDisabled ? 0.4 : 1, display: "flex", alignItems: "center", gap: spec.gap, fontSize: spec.fontSize, fontWeight: (0, optionRowInk_1.optionRowWeight)(isSingleSelected), color: (0, optionRowInk_1.optionRowInk)(theme.colors, isSingleSelected), bg: isSingleSelected ? selectedBg : restBg, transition: ROW_TRANSITION, sx: (0, motion_2.reducedMotionSx)(), children: [isMulti ? ((0, jsx_runtime_1.jsx)(react_2.Checkbox, { id: `${optionDomId(listboxId, option.id)}-checkbox`, isChecked: isSelected, isDisabled: option.isDisabled, pointerEvents: "none", tabIndex: -1, sx: DECORATIVE_CHECKBOX_SX })) : null, renderOption ? ((0, jsx_runtime_1.jsx)(react_2.Box, { flex: 1, minW: 0, children: renderOption(option, { isSelected, isActive }) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [option.icon ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-flex", flexShrink: 0, children: option.icon })) : null, (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: 1, minW: 0, isTruncated: true, children: [(0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", isTruncated: true, children: option.label }), option.description ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "block", fontSize: spec.descriptionFontSize, color: (0, optionRowInk_1.optionRowDescriptionInk)(theme.colors), isTruncated: true, children: option.description })) : null] })] })), isSingleSelected ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.Check, size: spec.iconSize, color: theme.colors.accentText, flexShrink: 0 })) : null] }));
|
|
77
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { id: optionDomId(listboxId, option.id), "data-index": index, role: "option", "aria-selected": isSelected, "aria-disabled": option.isDisabled, onMouseEnter: () => onActivate(index), onClick: () => onSelect(option), mx: spec.mx, px: spec.px, py: spec.py, minH: spec.minH, borderRadius: "md", cursor: option.isDisabled ? "not-allowed" : "pointer", opacity: option.isDisabled ? 0.4 : 1, display: "flex", alignItems: "center", gap: spec.gap, fontSize: spec.fontSize, fontWeight: (0, optionRowInk_1.optionRowWeight)(isSingleSelected), color: (0, optionRowInk_1.optionRowInk)(theme.colors, isSingleSelected), bg: (0, optionRowInk_1.optionRowFill)(backgrounds, isActive), transition: ROW_TRANSITION, sx: (0, motion_2.reducedMotionSx)(), children: [isMulti ? ((0, jsx_runtime_1.jsx)(react_2.Checkbox, { id: `${optionDomId(listboxId, option.id)}-checkbox`, isChecked: isSelected, isDisabled: option.isDisabled, pointerEvents: "none", tabIndex: -1, sx: DECORATIVE_CHECKBOX_SX })) : null, renderOption ? ((0, jsx_runtime_1.jsx)(react_2.Box, { flex: 1, minW: 0, children: renderOption(option, { isSelected, isActive }) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [option.icon ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "inline-flex", flexShrink: 0, children: option.icon })) : null, (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: 1, minW: 0, isTruncated: true, children: [(0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", isTruncated: true, children: option.label }), option.description ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "span", display: "block", fontSize: spec.descriptionFontSize, color: (0, optionRowInk_1.optionRowDescriptionInk)(theme.colors), isTruncated: true, children: option.description })) : null] })] })), isSingleSelected ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.Check, size: spec.iconSize, color: theme.colors.accentText, flexShrink: 0 })) : null] }));
|
|
80
78
|
});
|
|
81
79
|
const buildGroupedRows = (options) => {
|
|
82
80
|
const rows = [];
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import { type RowStateBackgrounds } from "../../Theme/tokens/builders/rowStates";
|
|
1
2
|
import type { PaletteProps } from "../../Theme/tokens/types";
|
|
2
3
|
/** Selection is carried by weight and a trailing brand check, so the label itself stays neutral. */
|
|
3
4
|
export declare const optionRowInk: (colors: PaletteProps, isSingleSelected: boolean) => string;
|
|
4
5
|
export declare const optionRowDescriptionInk: (colors: PaletteProps) => string;
|
|
6
|
+
/** The one fill an option row paints: the cursor's (hover or keyboard). Selection never fills a row. */
|
|
7
|
+
export declare const optionRowFill: (rows: RowStateBackgrounds, isActive: boolean) => string;
|
|
8
|
+
/** Fill for rows that take real DOM focus (roving tabindex) — `:hover` and `:focus` are the cursor. */
|
|
9
|
+
export declare const optionRowCursorSx: (rows: RowStateBackgrounds) => {
|
|
10
|
+
_hover: {
|
|
11
|
+
bg: string;
|
|
12
|
+
};
|
|
13
|
+
_focus: {
|
|
14
|
+
bg: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
5
17
|
export declare const OPTION_ROW_REST_WEIGHT = 400;
|
|
6
18
|
export declare const OPTION_ROW_SELECTED_WEIGHT = 500;
|
|
7
19
|
export declare const optionRowWeight: (isSingleSelected: boolean) => number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optionRowWeight = exports.OPTION_ROW_SELECTED_WEIGHT = exports.OPTION_ROW_REST_WEIGHT = exports.optionRowDescriptionInk = exports.optionRowInk = void 0;
|
|
3
|
+
exports.optionRowWeight = exports.OPTION_ROW_SELECTED_WEIGHT = exports.OPTION_ROW_REST_WEIGHT = exports.optionRowCursorSx = exports.optionRowFill = exports.optionRowDescriptionInk = exports.optionRowInk = void 0;
|
|
4
4
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
5
5
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
6
6
|
const rowStates_1 = require("../../Theme/tokens/builders/rowStates");
|
|
@@ -10,6 +10,15 @@ exports.optionRowInk = optionRowInk;
|
|
|
10
10
|
// A 12px sub-line reached only 4.00:1 on the hovered selected row in dark.
|
|
11
11
|
const optionRowDescriptionInk = (colors) => (0, outlineRung_1.liftToContrast)(colors.textMuted, (0, rowStates_1.listRowBackgrounds)(colors).selectedActive, accentText_1.AA_NORMAL_TEXT);
|
|
12
12
|
exports.optionRowDescriptionInk = optionRowDescriptionInk;
|
|
13
|
+
/** The one fill an option row paints: the cursor's (hover or keyboard). Selection never fills a row. */
|
|
14
|
+
const optionRowFill = (rows, isActive) => isActive ? rows.active : "transparent";
|
|
15
|
+
exports.optionRowFill = optionRowFill;
|
|
16
|
+
/** Fill for rows that take real DOM focus (roving tabindex) — `:hover` and `:focus` are the cursor. */
|
|
17
|
+
const optionRowCursorSx = (rows) => ({
|
|
18
|
+
_hover: { bg: rows.active },
|
|
19
|
+
_focus: { bg: rows.active },
|
|
20
|
+
});
|
|
21
|
+
exports.optionRowCursorSx = optionRowCursorSx;
|
|
13
22
|
exports.OPTION_ROW_REST_WEIGHT = 400;
|
|
14
23
|
// NOTE: 600 beside a tinted fill and a check read as three signals for one state.
|
|
15
24
|
exports.OPTION_ROW_SELECTED_WEIGHT = 500;
|
|
@@ -36,18 +36,9 @@ const RenderOptions = ({ isOptionLoading, filteredOptions, loadingText, handleOp
|
|
|
36
36
|
const selected = isOptionSelected(option);
|
|
37
37
|
const isSingleSelected = selected && !isMultipleSelect;
|
|
38
38
|
const isActive = index === activeIndex;
|
|
39
|
-
const rowBg = selected
|
|
40
|
-
? isActive
|
|
41
|
-
? rowBackgrounds.selectedActive
|
|
42
|
-
: rowBackgrounds.selected
|
|
43
|
-
: isActive
|
|
44
|
-
? rowBackgrounds.active
|
|
45
|
-
: "transparent";
|
|
46
39
|
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "button", type: "button", ref: (el) => {
|
|
47
40
|
optionRefs.current[index] = el;
|
|
48
|
-
}, role: "option", "aria-selected": selected, tabIndex: isActive ? 0 : -1, w: `calc(100% - 2 * ${spec.mx})`, minH: spec.minH, textAlign: "left", border: "none", fontFamily: "inherit", bg:
|
|
49
|
-
bg: selected ? rowBackgrounds.selectedActive : rowBackgrounds.active,
|
|
50
|
-
}, onClick: () => handleOptionClick(option), onKeyDown: (e) => {
|
|
41
|
+
}, role: "option", "aria-selected": selected, tabIndex: isActive ? 0 : -1, w: `calc(100% - 2 * ${spec.mx})`, minH: spec.minH, textAlign: "left", border: "none", fontFamily: "inherit", bg: "transparent", mx: spec.mx, px: spec.px, py: spec.py, borderRadius: optionRowSizes_1.OPTION_ROW_RADIUS, fontSize: spec.fontSize, cursor: "pointer", color: (0, optionRowInk_1.optionRowInk)(theme.colors, isSingleSelected), fontWeight: (0, optionRowInk_1.optionRowWeight)(isSingleSelected), transition: ROW_TRANSITION, sx: (0, motion_2.reducedMotionSx)(), ...(0, optionRowInk_1.optionRowCursorSx)(rowBackgrounds), onClick: () => handleOptionClick(option), onKeyDown: (e) => {
|
|
51
42
|
if (e.key === "Enter" || e.key === " ") {
|
|
52
43
|
e.preventDefault();
|
|
53
44
|
handleOptionClick(option);
|
|
@@ -49,11 +49,12 @@ function Table({ data, columns, onSelection, isLoading, isCheckbox = false, free
|
|
|
49
49
|
name: "",
|
|
50
50
|
page: "",
|
|
51
51
|
orgId: "",
|
|
52
|
-
}, paginationMode = "client", infiniteScroll = false, hasMore, isLoadingMore = false, groupLoadMore = false, loadMoreText = "Load more", loadMorePosition = "top", loadMoreChunkSize, noOfRowsPerPage = 50, totalRecords = 0, onPagination, isTableSettings = false, headerActions, onGlobalSearch, onNoOfRowsPerPageChange, paginationSelectOptions, tableMaxHeight, minVisibleRows, maxVisibleRows, autoFitViewport, tableSettings, filterSidebar, loadingSkeletonRows, defaultVisibleColumns, density = "normal", variant = "
|
|
52
|
+
}, paginationMode = "client", infiniteScroll = false, hasMore, isLoadingMore = false, groupLoadMore = false, loadMoreText = "Load more", loadMorePosition = "top", loadMoreChunkSize, noOfRowsPerPage = 50, totalRecords = 0, onPagination, isTableSettings = false, headerActions, onGlobalSearch, onNoOfRowsPerPageChange, paginationSelectOptions, tableMaxHeight, minVisibleRows, maxVisibleRows, autoFitViewport, tableSettings, filterSidebar, loadingSkeletonRows, defaultVisibleColumns, density = "normal", variant = "studio", stripe = false, renderRowDetail, expandedRows, onExpandedRowsChange, groupColors, onAddItem, emptyState, onRefresh, isGlobalSearch = true, }) {
|
|
53
53
|
var _a, _b, _c, _d, _e;
|
|
54
54
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
55
55
|
const prefersReducedMotion = (0, motion_2.usePrefersReducedMotion)();
|
|
56
56
|
const clearFiltersTone = (0, react_1.useMemo)(() => (0, filledSurface_1.resolveFilledSurface)(theme.colors.semantic.error, theme.colors), [theme.colors]);
|
|
57
|
+
const clearBadge = (0, react_1.useMemo)(() => (0, filledSurface_1.resolveFilledSurface)(theme.colors.primary, theme.colors), [theme.colors]);
|
|
57
58
|
const variantTokens = (0, react_1.useMemo)(() => variants_1.TABLE_VARIANTS[variant](theme.colors, (0, accentText_1.isDarkCanvas)(theme.colors.backgroundColor.main)), [variant, theme.colors]);
|
|
58
59
|
const [columnsSearch, setColumnsSearch] = (0, react_1.useState)({});
|
|
59
60
|
const detailIdPrefix = (0, react_1.useId)();
|
|
@@ -397,7 +398,7 @@ function Table({ data, columns, onSelection, isLoading, isCheckbox = false, free
|
|
|
397
398
|
? isFilterModalOpen
|
|
398
399
|
: !!(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: {
|
|
399
400
|
color: theme.colors.accentText,
|
|
400
|
-
}, sx: (0, focusRing_styles_1.focusVisibleStyles)(theme.colors), children: (0, jsx_runtime_1.jsx)(react_3.Icon, { as: lucide_react_1.Filter, transform: "scaleX(-1)", boxSize: 4, color: sidebarActiveCount > 0 ? theme.colors.accentText : theme.colors.text[500] }) }), sidebarActiveCount > 0 && ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", "aria-label": "Clear filters", position: "absolute", top: "-6px", right: "-10px", bg:
|
|
401
|
+
}, sx: (0, focusRing_styles_1.focusVisibleStyles)(theme.colors), children: (0, jsx_runtime_1.jsx)(react_3.Icon, { as: lucide_react_1.Filter, transform: "scaleX(-1)", boxSize: 4, color: sidebarActiveCount > 0 ? theme.colors.accentText : theme.colors.text[500] }) }), sidebarActiveCount > 0 && ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", "aria-label": "Clear filters", position: "absolute", top: "-6px", right: "-10px", bg: clearBadge.fill, color: clearBadge.color, border: "none", borderRadius: "full", p: "1px", cursor: "pointer", onClick: (e) => {
|
|
401
402
|
var _a;
|
|
402
403
|
e.stopPropagation();
|
|
403
404
|
if (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) {
|
|
@@ -26,7 +26,7 @@ export type TableProps = {
|
|
|
26
26
|
onAddItem?: (groupValue: string | number) => void;
|
|
27
27
|
/** Seeds the initial row height only — Table Settings > Density (or saved preferences.density) takes over after the first change. */
|
|
28
28
|
density?: TableDensity;
|
|
29
|
-
/** Visual preset. Defaults to `classic`
|
|
29
|
+
/** Visual preset. Defaults to `studio`; pass `"classic"` for the banded header and per-column rules. */
|
|
30
30
|
variant?: TableVariant;
|
|
31
31
|
/** Content shown under a row when expanded; return null for rows with no detail and they get no chevron. Memoize it: an inline function re-renders every row. */
|
|
32
32
|
renderRowDetail?: (row: DataObject) => ReactNode | null;
|
|
@@ -424,7 +424,15 @@ const TableBody = ({ data, isCheckbox, columns, startRow, rowsPerPage, columnWid
|
|
|
424
424
|
});
|
|
425
425
|
}, [data]);
|
|
426
426
|
if (isLoading && data.length === 0) {
|
|
427
|
-
|
|
427
|
+
const dataColumns = columns.filter((o) => !o.isHidden).length;
|
|
428
|
+
const cells = [
|
|
429
|
+
...(isContent ? ["blank"] : []),
|
|
430
|
+
...(isCheckbox ? ["checkbox"] : []),
|
|
431
|
+
...(rowDetail ? ["blank"] : []),
|
|
432
|
+
...Array.from({ length: dataColumns || TableLoading_1.LOADING_PLACEHOLDER_COLUMNS }, () => "bar"),
|
|
433
|
+
...(isLink ? ["blank"] : []),
|
|
434
|
+
];
|
|
435
|
+
return ((0, jsx_runtime_1.jsx)(TableLoading_1.TableBodyLoading, { noOfColumns: cells.length, cells: cells, borderColor: variant.row.ruleColor, rowsCount: typeof loadingSkeletonRows === "number" ? loadingSkeletonRows : 4, rowHeight: rowHeight }));
|
|
428
436
|
}
|
|
429
437
|
if (!isLoading && data.length === 0) {
|
|
430
438
|
return ((0, jsx_runtime_1.jsx)(react_1.Tr, { backgroundColor: theme.colors.background[50], children: (0, jsx_runtime_1.jsx)(react_1.Td, { colSpan: totalVisibleColumns, p: 0, border: "none", children: (0, jsx_runtime_1.jsx)(TableEmpty, { emptyState: emptyState }) }) }));
|
|
@@ -13,16 +13,19 @@ const TableFilters_1 = __importDefault(require("../filters/TableFilters"));
|
|
|
13
13
|
const columnLabel_1 = require("../columnLabel");
|
|
14
14
|
const lucide_react_1 = require("lucide-react");
|
|
15
15
|
const Checkbox_1 = __importDefault(require("../../Checkbox/Checkbox"));
|
|
16
|
+
const Skeletons_1 = __importDefault(require("../../Skeletons/Skeletons"));
|
|
16
17
|
const TableVariantContext_1 = require("../variants/TableVariantContext");
|
|
17
18
|
const motion_1 = require("../../../Theme/tokens/primitives/motion");
|
|
19
|
+
const borderWidths_1 = require("../../../Theme/tokens/primitives/borderWidths");
|
|
18
20
|
const motion_2 = require("../../../Theme/chakra/motion");
|
|
19
21
|
const focusRing_styles_1 = require("../../../Theme/chakra/focusRing.styles");
|
|
20
22
|
const rowDetail_1 = require("./rowDetail");
|
|
23
|
+
const TableLoading_1 = require("./TableLoading");
|
|
21
24
|
const LABEL_JUSTIFY = { start: "space-between", center: "center", end: "flex-start" };
|
|
22
25
|
const TableHeader = ({ columns, isCheckbox, handleSort, headerRefs, columnWidths, slotRef, slotWidth, columnsSort, freezedTextColor, noBorders, handleCheckbox, checked, isLoading, isContent, isLink, hasDetail = false, isActionFreeze, setColumnsSearch, columnsSearch, isSelecting, }) => {
|
|
23
26
|
const [openFilterId, setOpenFilterId] = (0, react_2.useState)(null);
|
|
24
27
|
const variant = (0, TableVariantContext_1.useTableVariant)();
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Tr, { pr: 0, "aria-rowindex": 1, children: [isContent && (0, jsx_runtime_1.jsx)(ContentSpacerCell, { noBorders: noBorders }), isCheckbox && ((0, jsx_runtime_1.jsx)(SelectAllCell, { slotRef: slotRef, freezedTextColor: freezedTextColor, noBorders: noBorders, isSelecting: isSelecting, isLoading: isLoading, checked: checked, handleCheckbox: handleCheckbox })), hasDetail && ((0, jsx_runtime_1.jsx)(rowDetail_1.RowDetailHeaderCell, { left: isCheckbox ? slotWidth : 0, bg: variant.header.bg, ruleColor: variant.header.ruleColor, noBorders: noBorders })), columns.map((header, index) => {
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Tr, { pr: 0, "aria-rowindex": 1, children: [isContent && (0, jsx_runtime_1.jsx)(ContentSpacerCell, { noBorders: noBorders }), isCheckbox && ((0, jsx_runtime_1.jsx)(SelectAllCell, { slotRef: slotRef, freezedTextColor: freezedTextColor, noBorders: noBorders, isSelecting: isSelecting, isLoading: isLoading, checked: checked, handleCheckbox: handleCheckbox })), hasDetail && ((0, jsx_runtime_1.jsx)(rowDetail_1.RowDetailHeaderCell, { left: isCheckbox ? slotWidth : 0, bg: variant.header.bg, ruleColor: variant.header.ruleColor, noBorders: noBorders })), isLoading && !columns.some((header) => !(header === null || header === void 0 ? void 0 : header.isHidden)) && ((0, jsx_runtime_1.jsx)(LoadingHeaderCells, { noBorders: noBorders })), columns.map((header, index) => {
|
|
26
29
|
if (header === null || header === void 0 ? void 0 : header.isHidden)
|
|
27
30
|
return null;
|
|
28
31
|
return ((0, jsx_runtime_1.jsx)(ColumnHeader, { header: header, index: index, columnWidths: columnWidths, slotWidth: slotWidth, detailWidth: hasDetail ? rowDetail_1.DETAIL_SLOT_PX : 0, handleSort: handleSort, isCheckbox: isCheckbox, noBorders: noBorders, columnsSort: columnsSort, headerRefs: headerRefs, columnsSearch: columnsSearch, setColumnsSearch: setColumnsSearch, openFilterId: openFilterId, setOpenFilterId: setOpenFilterId }, (0, columnLabel_1.columnLabelText)(header)));
|
|
@@ -32,8 +35,12 @@ exports.default = (0, react_2.memo)(TableHeader);
|
|
|
32
35
|
const SelectAllCell = (0, react_2.memo)(({ slotRef, freezedTextColor, noBorders, isSelecting, isLoading, checked, handleCheckbox, }) => {
|
|
33
36
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
34
37
|
const variant = (0, TableVariantContext_1.useTableVariant)();
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Th, { ref: slotRef, scope: "col", 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: freezedTextColor, textTransform: "capitalize", backgroundColor: variant.header.bg, position: "sticky", className: `columns sticky-columns`, left: "0px", zIndex: 9, borderBottom: noBorders ? "none" : `0.063rem solid ${variant.header.ruleColor}`, children: (0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", justifyContent: "center", children: isSelecting ? ((0, jsx_runtime_1.jsx)(react_1.Spinner, { size: "sm", color: theme.colors.accentText })) : ((0, jsx_runtime_1.jsx)(Checkbox_1.default, { "aria-label": "Select all rows", variant: "outline", onChange: () => handleCheckbox(0), isChecked: isLoading ? false : checked === true, isIndeterminate: checked === "indeterminate" })) }) }));
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Th, { ref: slotRef, scope: "col", 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: freezedTextColor, textTransform: "capitalize", backgroundColor: variant.header.bg, position: "sticky", className: `columns sticky-columns`, left: "0px", zIndex: 9, borderBottom: noBorders ? "none" : `0.063rem solid ${variant.header.ruleColor}`, children: (0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", justifyContent: "center", children: isSelecting ? ((0, jsx_runtime_1.jsx)(react_1.Spinner, { size: "sm", color: theme.colors.accentText })) : ((0, jsx_runtime_1.jsx)(Checkbox_1.default, { "aria-label": "Select all rows", variant: "outline", onChange: () => handleCheckbox(0), isChecked: isLoading ? false : checked === true, isDisabled: isLoading, isIndeterminate: checked === "indeterminate" })) }) }));
|
|
36
39
|
});
|
|
40
|
+
const LoadingHeaderCells = ({ noBorders }) => {
|
|
41
|
+
const variant = (0, TableVariantContext_1.useTableVariant)();
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Array.from({ length: TableLoading_1.LOADING_PLACEHOLDER_COLUMNS }, (_, i) => ((0, jsx_runtime_1.jsx)(react_1.Th, { scope: "col", "aria-hidden": "true", px: 3, backgroundColor: variant.header.bg, borderBottom: noBorders ? "none" : `${borderWidths_1.BORDER_WIDTHS.hairline} solid ${variant.header.ruleColor}`, children: (0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", height: "0.75rem", width: i % 2 ? "50%" : "70%", borderRadius: "full" }) }, i))) }));
|
|
43
|
+
};
|
|
37
44
|
const ContentSpacerCell = (0, react_2.memo)(({ noBorders }) => {
|
|
38
45
|
const variant = (0, TableVariantContext_1.useTableVariant)();
|
|
39
46
|
return ((0, jsx_runtime_1.jsx)(react_1.Th, { scope: "col", w: 6, minW: "35px", p: 0, backgroundColor: variant.header.bg, borderBottom: noBorders ? "none" : `0.063rem solid ${variant.header.ruleColor}`, position: "sticky", className: `columns sticky-columns`, left: "0px", zIndex: 1 }));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
declare const TableLoading: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default TableLoading;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const LOADING_PLACEHOLDER_COLUMNS = 4;
|
|
4
|
+
export type LoadingCell = "bar" | "checkbox" | "blank";
|
|
5
|
+
export declare const TableBodyLoading: ({ noOfColumns, cells, borderColor, rowsCount, rowHeight, }: {
|
|
4
6
|
noOfColumns: number;
|
|
7
|
+
cells?: LoadingCell[];
|
|
5
8
|
borderColor: string;
|
|
6
9
|
rowsCount?: number;
|
|
7
10
|
rowHeight?: number;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TableBodyLoading = void 0;
|
|
6
|
+
exports.TableBodyLoading = exports.LOADING_PLACEHOLDER_COLUMNS = void 0;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
8
|
const react_1 = require("@chakra-ui/react");
|
|
9
|
+
const Skeletons_1 = __importDefault(require("../../Skeletons/Skeletons"));
|
|
10
|
+
const borderWidths_1 = require("../../../Theme/tokens/primitives/borderWidths");
|
|
11
|
+
const CHECKBOX_PLACEHOLDER_STYLE = { display: "inline-block", verticalAlign: "middle" };
|
|
6
12
|
const TableLoading = () => {
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { overflowX: "auto", p: 4, children: (0, jsx_runtime_1.jsxs)(react_1.Table, { variant: "simple", width: "full", children: [(0, jsx_runtime_1.jsx)(react_1.Thead, { children: (0, jsx_runtime_1.jsxs)(react_1.Tr, { children: [(0, jsx_runtime_1.jsx)(react_1.Th, { p: 2, children: (0, jsx_runtime_1.jsx)(
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { overflowX: "auto", p: 4, children: (0, jsx_runtime_1.jsxs)(react_1.Table, { variant: "simple", width: "full", children: [(0, jsx_runtime_1.jsx)(react_1.Thead, { children: (0, jsx_runtime_1.jsxs)(react_1.Tr, { children: [(0, jsx_runtime_1.jsx)(react_1.Th, { p: 2, children: (0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", height: "20px" }) }), (0, jsx_runtime_1.jsx)(react_1.Th, { p: 2, children: (0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", height: "20px" }) }), (0, jsx_runtime_1.jsx)(react_1.Th, { p: 2, children: (0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", height: "20px" }) }), (0, jsx_runtime_1.jsx)(react_1.Th, { p: 2, children: (0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", height: "20px" }) })] }) }), (0, jsx_runtime_1.jsx)(react_1.Tbody, { children: Array.from({ length: 5 }).map((_, rowIndex) => ((0, jsx_runtime_1.jsxs)(react_1.Tr, { children: [(0, jsx_runtime_1.jsx)(react_1.Td, { p: 2, children: (0, jsx_runtime_1.jsx)(react_1.SkeletonText, { noOfLines: 1, skeletonHeight: "2" }) }), (0, jsx_runtime_1.jsx)(react_1.Td, { p: 2, children: (0, jsx_runtime_1.jsx)(react_1.SkeletonText, { noOfLines: 1, skeletonHeight: "2" }) }), (0, jsx_runtime_1.jsx)(react_1.Td, { p: 2, children: (0, jsx_runtime_1.jsx)(react_1.SkeletonText, { noOfLines: 1, skeletonHeight: "2" }) }), (0, jsx_runtime_1.jsx)(react_1.Td, { p: 2, children: (0, jsx_runtime_1.jsx)(react_1.SkeletonText, { noOfLines: 1, skeletonHeight: "2" }) })] }, rowIndex))) })] }) }));
|
|
8
14
|
};
|
|
9
15
|
exports.default = TableLoading;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
exports.LOADING_PLACEHOLDER_COLUMNS = 4;
|
|
17
|
+
const BAR_WIDTHS = ["72%", "58%", "84%", "46%", "66%", "78%"];
|
|
18
|
+
const TableBodyLoading = ({ noOfColumns, cells, borderColor, rowsCount = 4, rowHeight = 45, }) => {
|
|
19
|
+
const layout = cells !== null && cells !== void 0 ? cells : Array.from({ length: noOfColumns }, () => "bar");
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Array.from({ length: rowsCount }).map((_, row) => ((0, jsx_runtime_1.jsx)(react_1.Tr, { "aria-hidden": "true", children: layout.map((kind, col) => ((0, jsx_runtime_1.jsxs)(react_1.Td, { px: kind === "checkbox" ? 0 : 3, py: 0, height: `${rowHeight}px`, boxSizing: "border-box", border: "none", borderBottom: `${borderWidths_1.BORDER_WIDTHS.hairline} solid ${borderColor}`, textAlign: kind === "checkbox" ? "center" : undefined, children: [kind === "checkbox" && ((0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", height: "1rem", width: "1rem", borderRadius: "sm", style: CHECKBOX_PLACEHOLDER_STYLE })), kind === "bar" && ((0, jsx_runtime_1.jsx)(Skeletons_1.default, { type: "skeleton", height: "0.75rem", width: BAR_WIDTHS[(row * 3 + col) % BAR_WIDTHS.length], borderRadius: "full" }))] }, col))) }, row))) }));
|
|
14
21
|
};
|
|
15
22
|
exports.TableBodyLoading = TableBodyLoading;
|
|
@@ -60,18 +60,9 @@ const CompactSelect = ({ options, value, placeholder = "Select", height = "22px"
|
|
|
60
60
|
}, 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: (0, surfaceRaised_1.raisedRule)(theme.colors), onKeyDown: handleListKeyDown, children: [filtered.map((opt, i) => {
|
|
61
61
|
const selected = (value === null || value === void 0 ? void 0 : value.id) === opt.id;
|
|
62
62
|
const isActive = i === activeIndex;
|
|
63
|
-
const rowBg = selected
|
|
64
|
-
? isActive
|
|
65
|
-
? rowBackgrounds.selectedActive
|
|
66
|
-
: rowBackgrounds.selected
|
|
67
|
-
: isActive
|
|
68
|
-
? rowBackgrounds.active
|
|
69
|
-
: theme.colors.transparent;
|
|
70
63
|
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { as: "button", type: "button", role: "option", "aria-selected": selected, tabIndex: isActive ? 0 : -1, ref: (el) => {
|
|
71
64
|
optionRefs.current[i] = el;
|
|
72
|
-
}, w: `calc(100% - 2 * ${spec.mx})`, minH: spec.minH, textAlign: "left", border: "none", fontFamily: "inherit", display: "flex", alignItems: "center", gap: spec.gap, mx: spec.mx, px: spec.px, py: spec.py, borderRadius: optionRowSizes_1.OPTION_ROW_RADIUS, cursor: "pointer", color: (0, optionRowInk_1.optionRowInk)(theme.colors, selected), fontSize: spec.fontSize, fontWeight: (0, optionRowInk_1.optionRowWeight)(selected),
|
|
73
|
-
bg: selected ? rowBackgrounds.selectedActive : rowBackgrounds.active,
|
|
74
|
-
}, bg: rowBg, onClick: () => {
|
|
65
|
+
}, w: `calc(100% - 2 * ${spec.mx})`, minH: spec.minH, textAlign: "left", border: "none", fontFamily: "inherit", display: "flex", alignItems: "center", gap: spec.gap, mx: spec.mx, px: spec.px, py: spec.py, borderRadius: optionRowSizes_1.OPTION_ROW_RADIUS, cursor: "pointer", color: (0, optionRowInk_1.optionRowInk)(theme.colors, selected), fontSize: spec.fontSize, fontWeight: (0, optionRowInk_1.optionRowWeight)(selected), bg: "transparent", ...(0, optionRowInk_1.optionRowCursorSx)(rowBackgrounds), onClick: () => {
|
|
75
66
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(opt);
|
|
76
67
|
setIsOpen(false);
|
|
77
68
|
setQuery("");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { TableVariantTokens } from "./tokens";
|
|
2
2
|
export declare const TableVariantProvider: import("react").Provider<TableVariantTokens | null>;
|
|
3
|
-
/** No provider means the
|
|
3
|
+
/** No provider means the default variant — studio, the same preset `Table` falls back to. */
|
|
4
4
|
export declare function useTableVariant(): TableVariantTokens;
|