@parallelworks/ui 0.41.0 → 0.43.0
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/README.md +25 -0
- package/dist/ai/components/AllocationSelector.d.ts +3 -4
- package/dist/ai/components/AllocationSelector.js +37 -33
- package/dist/ai/components/AttachmentManager.js +7 -7
- package/dist/ai/components/AttachmentUpload.js +5 -5
- package/dist/ai/components/BranchNavigator.js +1 -1
- package/dist/ai/components/ChatEmptyState.js +2 -2
- package/dist/ai/components/ChatInput.js +10 -8
- package/dist/ai/components/ChatLayout.js +4 -5
- package/dist/ai/components/ChatMessage.js +12 -12
- package/dist/ai/components/ChatMessageList.js +9 -9
- package/dist/ai/components/ChatSidebar.js +8 -9
- package/dist/ai/components/ChatThread.js +4 -4
- package/dist/ai/components/ComposerChrome.d.ts +2 -2
- package/dist/ai/components/ComposerChrome.js +3 -6
- package/dist/ai/components/DragOverlay.js +2 -2
- package/dist/ai/components/ModelSelector.d.ts +5 -3
- package/dist/ai/components/ModelSelector.js +102 -339
- package/dist/ai/components/PastedText.js +11 -11
- package/dist/ai/components/ProviderIssueBanner.d.ts +2 -0
- package/dist/ai/components/ProviderIssueBanner.js +34 -16
- package/dist/ai/components/Reasoning.js +4 -4
- package/dist/ai/components/ShareDialog.js +43 -35
- package/dist/ai/components/SlashMenu.d.ts +12 -2
- package/dist/ai/components/SlashMenu.js +29 -13
- package/dist/ai/components/agent/ActivityLine.js +3 -3
- package/dist/ai/components/agent/AgentMessageParts.js +20 -20
- package/dist/ai/components/agent/PermissionPicker.js +13 -11
- package/dist/ai/components/conversationActions.d.ts +4 -6
- package/dist/ai/components/conversationActions.js +9 -13
- package/dist/ai/core/ChatProvider.js +1 -1
- package/dist/ai/core/config.js +1 -1
- package/dist/ai/core/providerIssues.d.ts +7 -0
- package/dist/ai/core/providerIssues.js +9 -1
- package/dist/ai/core/useKeyboardShortcuts.d.ts +4 -0
- package/dist/ai/core/useKeyboardShortcuts.js +8 -2
- package/dist/ai/index.d.ts +0 -1
- package/dist/ai/index.js +1 -2
- package/dist/ai/strings.d.ts +19 -0
- package/dist/ai/strings.js +18 -1
- package/dist/ai/ui/Avatar.js +5 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +0 -1
- package/dist/ai/ui/ConversationSidebar.js +6 -7
- package/dist/ai/ui/Markdown.js +3 -3
- package/dist/ai/ui/Notice.js +6 -6
- package/dist/ai/ui/chip.d.ts +4 -0
- package/dist/ai/ui/chip.js +8 -0
- package/dist/ai/ui/sidebar.d.ts +6 -5
- package/dist/ai/ui/sidebar.js +39 -43
- package/dist/components/ActionMenu.d.ts +13 -0
- package/dist/components/ActionMenu.js +30 -0
- package/dist/components/Avatar.js +6 -6
- package/dist/components/Breadcrumbs.js +1 -1
- package/dist/components/Button.js +10 -10
- package/dist/components/Callout.js +2 -2
- package/dist/components/Card.js +3 -3
- package/dist/components/Combobox.d.ts +49 -0
- package/dist/components/Combobox.js +405 -0
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +23 -0
- package/dist/components/ContextMenu.js +89 -0
- package/dist/components/CopyToClipboard.js +2 -2
- package/dist/components/CreateModal.d.ts +19 -38
- package/dist/components/CreateModal.js +116 -267
- package/dist/components/DescriptionList.js +8 -8
- package/dist/components/Filter.js +2 -2
- package/dist/components/FilterPill.js +2 -2
- package/dist/components/HoverCard.d.ts +14 -0
- package/dist/components/HoverCard.js +33 -0
- package/dist/components/IconButton.d.ts +5 -5
- package/dist/components/IconButton.js +18 -22
- package/dist/components/InfoTip.d.ts +15 -0
- package/dist/components/InfoTip.js +60 -0
- package/dist/components/Input.js +5 -5
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.js +3 -3
- package/dist/components/Markdown.js +1 -1
- package/dist/components/MarkdownImpl.js +2 -2
- package/dist/components/Menu.d.ts +33 -0
- package/dist/components/Menu.js +86 -0
- package/dist/components/MenuEntries.d.ts +56 -0
- package/dist/components/MenuEntries.js +123 -0
- package/dist/components/Modal.d.ts +29 -0
- package/dist/components/Modal.js +47 -0
- package/dist/components/Overview.js +11 -10
- package/dist/components/PageHeader.d.ts +10 -16
- package/dist/components/PageHeader.js +69 -95
- package/dist/components/Pagination.js +5 -5
- package/dist/components/Provider.d.ts +5 -11
- package/dist/components/Provider.js +11 -14
- package/dist/components/Radio.d.ts +8 -0
- package/dist/components/Radio.js +16 -0
- package/dist/components/SectionHeader.js +2 -2
- package/dist/components/SegmentedControl.d.ts +6 -5
- package/dist/components/SegmentedControl.js +34 -30
- package/dist/components/Select.d.ts +27 -0
- package/dist/components/Select.js +78 -0
- package/dist/components/SettingModeOption.d.ts +5 -8
- package/dist/components/SettingModeOption.js +10 -12
- package/dist/components/SettingRow.js +4 -4
- package/dist/components/SettingsCard.js +4 -4
- package/dist/components/SettingsGroup.js +2 -2
- package/dist/components/Sort.js +1 -1
- package/dist/components/StatusBadge.js +7 -7
- package/dist/components/StatusIcons.js +4 -4
- package/dist/components/Switch.d.ts +22 -0
- package/dist/components/Switch.js +28 -0
- package/dist/components/Table.js +11 -11
- package/dist/components/Tooltip.d.ts +24 -20
- package/dist/components/Tooltip.js +58 -76
- package/dist/components/comboboxItems.d.ts +24 -0
- package/dist/components/comboboxItems.js +10 -0
- package/dist/components/floating.d.ts +14 -0
- package/dist/components/floating.js +21 -0
- package/dist/components/search.d.ts +2 -0
- package/dist/components/search.js +14 -0
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/EditorField.js +16 -21
- package/dist/editor/FormCodePanel.js +19 -19
- package/dist/editor/Monaco.js +3 -3
- package/dist/file-explorer/FileExplorer.js +77 -81
- package/dist/file-explorer/FileExplorerContext.js +2 -2
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +1 -1
- package/dist/file-explorer/FilePreview/Inline.js +1 -1
- package/dist/file-explorer/FilePreview/StreamedBadge.js +5 -6
- package/dist/file-explorer/FilePreview/Viewer.js +8 -8
- package/dist/file-explorer/FilePreview/index.d.ts +1 -1
- package/dist/file-explorer/FilePreview/index.js +49 -83
- package/dist/file-explorer/FileRow.d.ts +4 -3
- package/dist/file-explorer/FileRow.js +32 -38
- package/dist/file-explorer/FileRowsWindow.d.ts +3 -2
- package/dist/file-explorer/FileRowsWindow.js +4 -4
- package/dist/file-explorer/FileTable.d.ts +3 -2
- package/dist/file-explorer/FileTable.js +3 -3
- package/dist/file-explorer/LoadMoreRow.js +1 -1
- package/dist/file-explorer/TreeView.js +11 -16
- package/dist/file-explorer/helpers.js +11 -12
- package/dist/file-explorer/toasts.js +11 -11
- package/dist/form/FieldGroup.d.ts +11 -0
- package/dist/form/FieldGroup.js +36 -0
- package/dist/form/FieldWrapper.js +4 -4
- package/dist/form/Fields/BooleanField.js +23 -33
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +9 -13
- package/dist/form/Fields/ColorField.d.ts +1 -2
- package/dist/form/Fields/ColorField.js +6 -11
- package/dist/form/Fields/DropdownField.d.ts +3 -13
- package/dist/form/Fields/DropdownField.js +40 -27
- package/dist/form/Fields/DurationField.d.ts +1 -2
- package/dist/form/Fields/DurationField.js +25 -32
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +6 -12
- package/dist/form/Fields/MultiDropdownField.js +31 -22
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +65 -35
- package/dist/form/Fields/ObjectField.d.ts +1 -1
- package/dist/form/Fields/ObjectField.js +12 -43
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +30 -41
- package/dist/form/Fields/RangeField.d.ts +1 -2
- package/dist/form/Fields/RangeField.js +23 -16
- package/dist/form/Fields/StringField.d.ts +1 -2
- package/dist/form/Fields/StringField.js +58 -26
- package/dist/form/Fields/TextAreaField.js +12 -10
- package/dist/form/Form.d.ts +30 -48
- package/dist/form/Form.js +306 -412
- package/dist/form/FormLayout.js +9 -9
- package/dist/form/Wizard/WizardContainer.d.ts +1 -4
- package/dist/form/Wizard/WizardContainer.js +40 -56
- package/dist/form/Wizard/WizardNavigation.js +1 -1
- package/dist/form/Wizard/WizardStepContent.d.ts +1 -5
- package/dist/form/Wizard/WizardStepContent.js +11 -16
- package/dist/form/Wizard/WizardStepIndicator.js +6 -6
- package/dist/form/Wizard/types.d.ts +0 -14
- package/dist/form/fieldRegistry.d.ts +1 -1
- package/dist/form/fieldRegistry.js +6 -6
- package/dist/form/formEditing.js +1 -1
- package/dist/form/index.d.ts +5 -4
- package/dist/form/index.js +6 -7
- package/dist/form/lib.js +3 -2
- package/dist/form/types/fieldComponentTypes.d.ts +8 -10
- package/dist/form/useChoiceField.d.ts +18 -0
- package/dist/form/useChoiceField.js +46 -0
- package/dist/form/useFieldValue.d.ts +7 -0
- package/dist/form/useFieldValue.js +20 -0
- package/dist/form/useParsedOpts.d.ts +3 -1
- package/dist/form/useParsedOpts.js +12 -17
- package/dist/form/utils/dependentOptions.d.ts +8 -4
- package/dist/form/utils/dependentOptions.js +25 -17
- package/dist/form/utils/fieldItems.d.ts +32 -0
- package/dist/form/utils/fieldItems.js +32 -0
- package/dist/form/utils/fieldPath.d.ts +10 -0
- package/dist/form/utils/fieldPath.js +20 -0
- package/dist/form/utils/shareEqual.d.ts +6 -0
- package/dist/form/utils/shareEqual.js +38 -0
- package/dist/graph/AnnotationBanner.js +8 -8
- package/dist/graph/Collapse.d.ts +1 -0
- package/dist/graph/Collapse.js +6 -27
- package/dist/graph/Connectors.js +5 -5
- package/dist/graph/DependencyGraph.js +20 -19
- package/dist/graph/GraphEditor.js +30 -41
- package/dist/graph/GraphEditorDialogs.js +17 -17
- package/dist/graph/GraphNode.js +1 -1
- package/dist/graph/InputDialog.js +19 -22
- package/dist/graph/InputsEditor.js +58 -66
- package/dist/graph/JobSummary.js +42 -39
- package/dist/graph/MatrixGroup.js +1 -1
- package/dist/graph/ProblemsButton.js +18 -19
- package/dist/graph/Reveal.js +1 -1
- package/dist/graph/ShortcutsButton.js +15 -18
- package/dist/graph/SuggestionInput.d.ts +5 -10
- package/dist/graph/SuggestionInput.js +14 -18
- package/dist/graph/ToolbarPopover.d.ts +11 -6
- package/dist/graph/ToolbarPopover.js +35 -67
- package/dist/graph/TreeView.js +24 -37
- package/dist/graph/WorkflowSettingsDialog.js +4 -4
- package/dist/graph/editorChrome.js +13 -12
- package/dist/graph/editorFields.js +29 -29
- package/dist/graph/editorPrimitives.d.ts +1 -1
- package/dist/graph/editorPrimitives.js +10 -7
- package/dist/graph/editorRows.js +103 -97
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -3
- package/dist/graph/inputRefs.js +9 -9
- package/dist/graph/settingsViews.js +6 -7
- package/dist/graph/stepWith.js +6 -6
- package/dist/index.d.ts +14 -15
- package/dist/index.js +15 -14
- package/dist/list/ActionToolbar.d.ts +6 -14
- package/dist/list/ActionToolbar.js +48 -96
- package/dist/list/ListPage.d.ts +6 -12
- package/dist/list/ListPage.js +46 -29
- package/dist/list/ListPager.js +4 -4
- package/dist/list/ListTable.js +5 -5
- package/dist/list/ListViewControls.d.ts +5 -4
- package/dist/list/ListViewControls.js +177 -267
- package/dist/list/UserHoverCard.d.ts +3 -17
- package/dist/list/UserHoverCard.js +21 -45
- package/dist/list/index.d.ts +3 -4
- package/dist/list/index.js +3 -4
- package/dist/list/listSearch.js +12 -11
- package/dist/list/rowMenu.d.ts +68 -0
- package/dist/list/rowMenu.js +136 -0
- package/dist/logviewer/LogViewer.js +26 -26
- package/dist/styles.css +1 -1
- package/package.json +7 -13
- package/dist/ai/ui/Dropdown.d.ts +0 -31
- package/dist/ai/ui/Dropdown.js +0 -110
- package/dist/components/AddMenu.d.ts +0 -18
- package/dist/components/AddMenu.js +0 -46
- package/dist/components/BareModal.d.ts +0 -17
- package/dist/components/BareModal.js +0 -77
- package/dist/components/CollapsiblePanel.d.ts +0 -27
- package/dist/components/CollapsiblePanel.js +0 -77
- package/dist/components/Dropdown.d.ts +0 -28
- package/dist/components/Dropdown.js +0 -355
- package/dist/components/Listbox.d.ts +0 -21
- package/dist/components/Listbox.js +0 -119
- package/dist/components/MultiSelect.d.ts +0 -22
- package/dist/components/MultiSelect.js +0 -168
- package/dist/components/SwitchToggle.d.ts +0 -15
- package/dist/components/SwitchToggle.js +0 -57
- package/dist/components/SwitchToggleSmall.d.ts +0 -6
- package/dist/components/SwitchToggleSmall.js +0 -14
- package/dist/components/Toggle.d.ts +0 -6
- package/dist/components/Toggle.js +0 -20
- package/dist/components/dropdownUtils.d.ts +0 -37
- package/dist/components/dropdownUtils.js +0 -99
- package/dist/form/SpecialTypes/DropdownWrapper.d.ts +0 -25
- package/dist/form/SpecialTypes/DropdownWrapper.js +0 -28
- package/dist/form/SpecialTypes/FormikCustomDropdown.d.ts +0 -51
- package/dist/form/SpecialTypes/FormikCustomDropdown.js +0 -119
- package/dist/form/SpecialTypes/FormikCustomInput.d.ts +0 -19
- package/dist/form/SpecialTypes/FormikCustomInput.js +0 -121
- package/dist/form/SpecialTypes/FormikMultiSelectDropdown.d.ts +0 -13
- package/dist/form/SpecialTypes/FormikMultiSelectDropdown.js +0 -31
- package/dist/form/SpecialTypes/FormikNumericInput.d.ts +0 -9
- package/dist/form/SpecialTypes/FormikNumericInput.js +0 -60
- package/dist/form/SpecialTypes/index.d.ts +0 -3
- package/dist/list/HoverCard.d.ts +0 -24
- package/dist/list/HoverCard.js +0 -73
- package/dist/list/RowContextMenu.d.ts +0 -127
- package/dist/list/RowContextMenu.js +0 -515
|
@@ -1,117 +1,82 @@
|
|
|
1
|
-
import { useStrings } from "../components/Provider.js";
|
|
2
|
-
import { FaCheck } from "../icons/fa/FaCheck.js";
|
|
3
1
|
import { FaChevronDown } from "../icons/fa/FaChevronDown.js";
|
|
4
2
|
import { FaChevronUp } from "../icons/fa/FaChevronUp.js";
|
|
5
3
|
import { FaFilter } from "../icons/fa/FaFilter.js";
|
|
6
|
-
import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
|
|
7
4
|
import { LuSettings2 } from "../icons/lu/LuSettings2.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
5
|
+
import { panelClassName, portalContainer, positionerClassName } from "../components/floating.js";
|
|
6
|
+
import { MenuCheckboxItem, MenuPopup, MenuSubmenuTrigger } from "../components/Menu.js";
|
|
7
|
+
import { Tooltip } from "../components/Tooltip.js";
|
|
8
|
+
import { useStrings } from "../components/Provider.js";
|
|
9
|
+
import { useQueryMatch } from "../components/search.js";
|
|
10
|
+
import { InfoTip } from "../components/InfoTip.js";
|
|
11
|
+
import { Switch } from "../components/Switch.js";
|
|
12
|
+
import { Select } from "../components/Select.js";
|
|
10
13
|
import { isTextEntryContext } from "./textEntry.js";
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import { Fragment
|
|
14
|
-
import {
|
|
14
|
+
import { Menu } from "@base-ui/react/menu";
|
|
15
|
+
import { clsx } from "clsx";
|
|
16
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { useEffect, useRef, useState } from "react";
|
|
18
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
19
|
+
import { Popover } from "@base-ui/react/popover";
|
|
15
20
|
//#region src/list/ListViewControls.tsx
|
|
16
21
|
/** Shared chrome for the toolbar control buttons (Filter, Display, Search) so
|
|
17
22
|
* they read as a consistent button cluster — matched by ListSearchControl. */
|
|
18
23
|
var listControlButtonClasses = "relative flex h-7 w-7 items-center justify-center rounded-md border border-(--theme-border) text-(--theme-muted-text-color) hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app) transition-colors";
|
|
19
|
-
var
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
return cx("whitespace-nowrap rounded-full border px-2.5 py-1 text-[12px] transition-colors", on ? "border-transparent bg-(--theme-muted-panel-bg) text-(--theme-app)" : "border-(--theme-border) text-(--theme-muted-text-color) hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app)");
|
|
23
|
-
}
|
|
24
|
+
var activeButtonClassName = "border-(--theme-link) text-(--theme-app)";
|
|
25
|
+
/** A toggle pill, for the Display panel's column and pinned-action pickers. */
|
|
26
|
+
var pillClassName = "whitespace-nowrap rounded-full border border-(--theme-border) px-2.5 py-1 text-[12px] text-(--theme-muted-text-color) transition-colors hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app) data-pressed:border-transparent data-pressed:bg-(--theme-muted-panel-bg) data-pressed:text-(--theme-app)";
|
|
24
27
|
var SECTION_LABEL = "mb-2 text-[11px] font-medium uppercase tracking-wide text-(--theme-muted-text-color)";
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
function AnchoredPopover({ icon, label, active, shortcut, panelClassName, children }) {
|
|
30
|
-
const btnRef = useRef(null);
|
|
31
|
-
const panelRef = useRef(null);
|
|
32
|
-
const [pos, setPos] = useState(null);
|
|
33
|
-
const close = useCallback(() => setPos(null), []);
|
|
34
|
-
const open = useCallback(() => {
|
|
35
|
-
const r = btnRef.current?.getBoundingClientRect();
|
|
36
|
-
if (r) setPos({
|
|
37
|
-
right: Math.max(8, Math.round(window.innerWidth - r.right)),
|
|
38
|
-
top: Math.round(r.bottom) + 4
|
|
39
|
-
});
|
|
40
|
-
}, []);
|
|
28
|
+
/** Calls `onPress` on a single key, such as F to filter, unless the key goes to a text field. */
|
|
29
|
+
function useShortcutKey(key, onPress) {
|
|
30
|
+
const press = useRef(onPress);
|
|
31
|
+
press.current = onPress;
|
|
41
32
|
useEffect(() => {
|
|
42
|
-
if (!
|
|
33
|
+
if (!key) return;
|
|
43
34
|
const onKey = (e) => {
|
|
44
|
-
if (e.
|
|
45
|
-
};
|
|
46
|
-
const onScroll = (e) => {
|
|
47
|
-
if (e.target instanceof Node && panelRef.current?.contains(e.target)) return;
|
|
48
|
-
close();
|
|
49
|
-
};
|
|
50
|
-
window.addEventListener("keydown", onKey);
|
|
51
|
-
window.addEventListener("scroll", onScroll, true);
|
|
52
|
-
window.addEventListener("resize", close);
|
|
53
|
-
return () => {
|
|
54
|
-
window.removeEventListener("keydown", onKey);
|
|
55
|
-
window.removeEventListener("scroll", onScroll, true);
|
|
56
|
-
window.removeEventListener("resize", close);
|
|
57
|
-
};
|
|
58
|
-
}, [pos, close]);
|
|
59
|
-
useEffect(() => {
|
|
60
|
-
if (!shortcut) return;
|
|
61
|
-
const onKey = (e) => {
|
|
62
|
-
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
63
|
-
if (e.key.toLowerCase() !== shortcut.toLowerCase()) return;
|
|
35
|
+
if (e.metaKey || e.ctrlKey || e.altKey || e.key.toLowerCase() !== key.toLowerCase()) return;
|
|
64
36
|
if (isTextEntryContext(e.target)) return;
|
|
65
37
|
e.preventDefault();
|
|
66
|
-
|
|
38
|
+
press.current();
|
|
67
39
|
};
|
|
68
40
|
window.addEventListener("keydown", onKey);
|
|
69
41
|
return () => window.removeEventListener("keydown", onKey);
|
|
70
|
-
}, [
|
|
71
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("button", {
|
|
72
|
-
ref: btnRef,
|
|
73
|
-
type: "button",
|
|
74
|
-
onClick: () => pos ? close() : open(),
|
|
75
|
-
"aria-label": label,
|
|
76
|
-
"aria-haspopup": "dialog",
|
|
77
|
-
"aria-expanded": pos !== null,
|
|
78
|
-
"data-tooltip-id": TOOLTIP_ID,
|
|
79
|
-
"data-tooltip-content": label,
|
|
80
|
-
"data-tooltip-shortcut": shortcut ? shortcut.toUpperCase() : void 0,
|
|
81
|
-
className: cx(listControlButtonClasses, active && "border-(--theme-link) text-(--theme-app)"),
|
|
82
|
-
children: [icon, active && /* @__PURE__ */ jsx("span", { className: "absolute right-0 top-0 h-1.5 w-1.5 rounded-full bg-(--theme-link)" })]
|
|
83
|
-
}), pos && createPortal(/* @__PURE__ */ jsx("div", {
|
|
84
|
-
role: "none",
|
|
85
|
-
className: "fixed inset-0 z-50",
|
|
86
|
-
onMouseDown: close,
|
|
87
|
-
onContextMenu: (e) => {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
close();
|
|
90
|
-
},
|
|
91
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
92
|
-
ref: panelRef,
|
|
93
|
-
role: "dialog",
|
|
94
|
-
"aria-label": label,
|
|
95
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
96
|
-
className: cx("absolute rounded-lg border border-(--theme-border) bg-(--theme-app-bg) shadow-lg", panelClassName),
|
|
97
|
-
style: {
|
|
98
|
-
right: pos.right,
|
|
99
|
-
top: pos.top
|
|
100
|
-
},
|
|
101
|
-
children
|
|
102
|
-
})
|
|
103
|
-
}), document.querySelector(".ds-root") ?? document.body)] });
|
|
42
|
+
}, [key]);
|
|
104
43
|
}
|
|
105
|
-
/**
|
|
106
|
-
function
|
|
107
|
-
return /* @__PURE__ */ jsx("
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
44
|
+
/** Marks a control whose panel has narrowed or changed the list. */
|
|
45
|
+
function ActiveDot() {
|
|
46
|
+
return /* @__PURE__ */ jsx("span", { className: "absolute right-0 top-0 h-1.5 w-1.5 rounded-full bg-(--theme-link)" });
|
|
47
|
+
}
|
|
48
|
+
/** A header-strip button that opens a panel under it. The panel is a
|
|
49
|
+
* non-modal dialog named by the button, not a menu: it holds switches,
|
|
50
|
+
* pills and text rather than menu items. */
|
|
51
|
+
function AnchoredPopover({ icon, label, active, shortcut, panelClassName: panelClass, children }) {
|
|
52
|
+
const [open, setOpen] = useState(false);
|
|
53
|
+
useShortcutKey(shortcut, () => setOpen(true));
|
|
54
|
+
return /* @__PURE__ */ jsxs(Popover.Root, {
|
|
55
|
+
open,
|
|
56
|
+
onOpenChange: setOpen,
|
|
57
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
58
|
+
content: label,
|
|
59
|
+
shortcut: shortcut?.toUpperCase(),
|
|
60
|
+
disabled: open,
|
|
61
|
+
children: /* @__PURE__ */ jsxs(Popover.Trigger, {
|
|
62
|
+
"aria-label": label,
|
|
63
|
+
className: clsx(listControlButtonClasses, active && activeButtonClassName),
|
|
64
|
+
children: [icon, active && /* @__PURE__ */ jsx(ActiveDot, {})]
|
|
65
|
+
})
|
|
66
|
+
}), /* @__PURE__ */ jsx(Popover.Portal, {
|
|
67
|
+
container: portalContainer(),
|
|
68
|
+
children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
69
|
+
side: "bottom",
|
|
70
|
+
align: "end",
|
|
71
|
+
sideOffset: 4,
|
|
72
|
+
className: positionerClassName,
|
|
73
|
+
children: /* @__PURE__ */ jsx(Popover.Popup, {
|
|
74
|
+
"aria-label": label,
|
|
75
|
+
className: clsx(panelClassName, panelClass),
|
|
76
|
+
children
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
})]
|
|
115
80
|
});
|
|
116
81
|
}
|
|
117
82
|
function ListDisplayMenu({ view, label }) {
|
|
@@ -129,27 +94,31 @@ function ListDisplayMenu({ view, label }) {
|
|
|
129
94
|
children: [/* @__PURE__ */ jsx("span", {
|
|
130
95
|
className: "text-[13px] text-(--theme-app)",
|
|
131
96
|
children: t.grouping
|
|
132
|
-
}), /* @__PURE__ */ jsx(
|
|
97
|
+
}), /* @__PURE__ */ jsx(OptionSelect, {
|
|
98
|
+
label: t.grouping,
|
|
133
99
|
options: view.groupBys,
|
|
134
100
|
value: view.groupBy,
|
|
135
101
|
onSelect: view.setGroupBy
|
|
136
102
|
})]
|
|
137
103
|
}),
|
|
138
104
|
view.orderBys.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
139
|
-
className:
|
|
105
|
+
className: clsx("flex items-center justify-between gap-3", hasGrouping && "mt-2.5"),
|
|
140
106
|
children: [/* @__PURE__ */ jsx("span", {
|
|
141
107
|
className: "text-[13px] text-(--theme-app)",
|
|
142
108
|
children: t.ordering
|
|
143
109
|
}), /* @__PURE__ */ jsxs("div", {
|
|
144
110
|
className: "flex items-center gap-1",
|
|
145
|
-
children: [/* @__PURE__ */ jsx(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
111
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
112
|
+
content: orderDirLabel,
|
|
113
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
114
|
+
type: "button",
|
|
115
|
+
onClick: view.toggleOrderDir,
|
|
116
|
+
"aria-label": orderDirLabel,
|
|
117
|
+
className: "flex h-7 w-7 items-center justify-center rounded-md border border-(--theme-border) text-(--theme-muted-text-color) hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app)",
|
|
118
|
+
children: view.orderDir === "asc" ? /* @__PURE__ */ jsx(FaChevronUp, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(FaChevronDown, { className: "h-3 w-3" })
|
|
119
|
+
})
|
|
120
|
+
}), /* @__PURE__ */ jsx(OptionSelect, {
|
|
121
|
+
label: t.ordering,
|
|
153
122
|
options: view.orderBys,
|
|
154
123
|
value: view.orderBy,
|
|
155
124
|
onSelect: view.setOrderBy
|
|
@@ -157,14 +126,15 @@ function ListDisplayMenu({ view, label }) {
|
|
|
157
126
|
})]
|
|
158
127
|
}),
|
|
159
128
|
/* @__PURE__ */ jsxs("div", {
|
|
160
|
-
className:
|
|
129
|
+
className: clsx("flex items-center justify-between gap-3", (hasGrouping || view.orderBys.length > 0) && "mt-2.5"),
|
|
161
130
|
children: [/* @__PURE__ */ jsx("span", {
|
|
162
131
|
className: "text-[13px] text-(--theme-app)",
|
|
163
132
|
children: t.columnHeaders
|
|
164
133
|
}), /* @__PURE__ */ jsx(Switch, {
|
|
134
|
+
size: "sm",
|
|
165
135
|
checked: view.showColumnHeaders,
|
|
166
|
-
|
|
167
|
-
label: t.showColumnHeaders
|
|
136
|
+
onCheckedChange: view.toggleColumnHeaders,
|
|
137
|
+
"aria-label": t.showColumnHeaders
|
|
168
138
|
})]
|
|
169
139
|
}),
|
|
170
140
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -173,9 +143,10 @@ function ListDisplayMenu({ view, label }) {
|
|
|
173
143
|
className: "text-[13px] text-(--theme-app)",
|
|
174
144
|
children: t.showActions
|
|
175
145
|
}), /* @__PURE__ */ jsx(Switch, {
|
|
146
|
+
size: "sm",
|
|
176
147
|
checked: view.showActions,
|
|
177
|
-
|
|
178
|
-
label: t.showRowActions
|
|
148
|
+
onCheckedChange: view.toggleShowActions,
|
|
149
|
+
"aria-label": t.showRowActions
|
|
179
150
|
})]
|
|
180
151
|
}),
|
|
181
152
|
view.showActions && /* @__PURE__ */ jsxs("div", {
|
|
@@ -184,9 +155,10 @@ function ListDisplayMenu({ view, label }) {
|
|
|
184
155
|
className: "text-[13px] text-(--theme-muted-text-color)",
|
|
185
156
|
children: t.alwaysShowActions
|
|
186
157
|
}), /* @__PURE__ */ jsx(Switch, {
|
|
158
|
+
size: "sm",
|
|
187
159
|
checked: view.alwaysShowActions,
|
|
188
|
-
|
|
189
|
-
label: t.alwaysShowRowActions
|
|
160
|
+
onCheckedChange: view.toggleAlwaysShowActions,
|
|
161
|
+
"aria-label": t.alwaysShowRowActions
|
|
190
162
|
})]
|
|
191
163
|
}),
|
|
192
164
|
toggleable.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
@@ -196,10 +168,10 @@ function ListDisplayMenu({ view, label }) {
|
|
|
196
168
|
children: t.displayProperties
|
|
197
169
|
}), /* @__PURE__ */ jsx("div", {
|
|
198
170
|
className: "flex flex-wrap gap-1.5",
|
|
199
|
-
children: toggleable.map((c) => /* @__PURE__ */ jsx(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
className:
|
|
171
|
+
children: toggleable.map((c) => /* @__PURE__ */ jsx(Toggle, {
|
|
172
|
+
pressed: view.isVisible(c.key),
|
|
173
|
+
onPressedChange: () => view.toggleColumn(c.key),
|
|
174
|
+
className: pillClassName,
|
|
203
175
|
children: c.label
|
|
204
176
|
}, c.key))
|
|
205
177
|
})]
|
|
@@ -207,17 +179,14 @@ function ListDisplayMenu({ view, label }) {
|
|
|
207
179
|
view.showActions && view.actions.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
208
180
|
className: "mt-3 border-t border-(--theme-border) pt-3",
|
|
209
181
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
210
|
-
className:
|
|
211
|
-
children: [t.pinnedActions, /* @__PURE__ */ jsx(
|
|
212
|
-
className: "inline-flex",
|
|
213
|
-
text: t.pinnedActionsHelp
|
|
214
|
-
})]
|
|
182
|
+
className: clsx(SECTION_LABEL, "flex items-center gap-1"),
|
|
183
|
+
children: [t.pinnedActions, /* @__PURE__ */ jsx(InfoTip, { text: t.pinnedActionsHelp })]
|
|
215
184
|
}), /* @__PURE__ */ jsx("div", {
|
|
216
185
|
className: "flex flex-wrap gap-1.5",
|
|
217
|
-
children: view.actions.map((a) => /* @__PURE__ */ jsx(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
className:
|
|
186
|
+
children: view.actions.map((a) => /* @__PURE__ */ jsx(Toggle, {
|
|
187
|
+
pressed: view.isPinned(a.key),
|
|
188
|
+
onPressedChange: () => view.togglePinned(a.key),
|
|
189
|
+
className: pillClassName,
|
|
221
190
|
children: a.label
|
|
222
191
|
}, a.key))
|
|
223
192
|
})]
|
|
@@ -234,165 +203,106 @@ function ListDisplayMenu({ view, label }) {
|
|
|
234
203
|
]
|
|
235
204
|
});
|
|
236
205
|
}
|
|
237
|
-
/**
|
|
238
|
-
|
|
239
|
-
function useCloseOnOutsideClick(open, close) {
|
|
240
|
-
const ref = useRef(null);
|
|
241
|
-
useEffect(() => {
|
|
242
|
-
if (!open) return;
|
|
243
|
-
const onDown = (e) => {
|
|
244
|
-
if (e.target instanceof Node && !ref.current?.contains(e.target)) close();
|
|
245
|
-
};
|
|
246
|
-
document.addEventListener("mousedown", onDown, true);
|
|
247
|
-
return () => document.removeEventListener("mousedown", onDown, true);
|
|
248
|
-
}, [open, close]);
|
|
249
|
-
return ref;
|
|
250
|
-
}
|
|
251
|
-
/** Single-choice picker for the Display menu's grouping and ordering rows. */
|
|
252
|
-
function OptionDropdown({ options, value, onSelect }) {
|
|
206
|
+
/** Single-choice picker for the Display panel's grouping and ordering rows. */
|
|
207
|
+
function OptionSelect({ label, options, value, onSelect }) {
|
|
253
208
|
const t = useStrings().list;
|
|
254
|
-
const [open, setOpen] = useState(false);
|
|
255
|
-
const ref = useCloseOnOutsideClick(open, useCallback(() => setOpen(false), []));
|
|
256
209
|
const current = options.find((o) => o.value === value);
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
210
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
211
|
+
"aria-label": label,
|
|
212
|
+
items: options,
|
|
213
|
+
value,
|
|
214
|
+
onValueChange: (next) => {
|
|
215
|
+
if (next !== null) onSelect(next);
|
|
216
|
+
},
|
|
217
|
+
trigger: /* @__PURE__ */ jsxs("button", {
|
|
261
218
|
type: "button",
|
|
262
|
-
onClick: () => setOpen((o) => !o),
|
|
263
219
|
className: "flex items-center gap-1.5 rounded-md border border-(--theme-border) px-2 py-1 text-[12px] text-(--theme-app) hover:bg-(--theme-muted-panel-bg)",
|
|
264
220
|
children: [current?.label ?? t.none, /* @__PURE__ */ jsx(FaChevronDown, { className: "h-2.5 w-2.5 opacity-60" })]
|
|
265
|
-
})
|
|
266
|
-
className: cx("absolute right-0 top-full z-20 mt-1", FLYOUT),
|
|
267
|
-
children: options.map((o) => /* @__PURE__ */ jsxs("button", {
|
|
268
|
-
type: "button",
|
|
269
|
-
onClick: () => {
|
|
270
|
-
onSelect(o.value);
|
|
271
|
-
setOpen(false);
|
|
272
|
-
},
|
|
273
|
-
className: cx("flex w-full items-center justify-between gap-3 px-3 py-1.5 text-left text-[13px] hover:bg-(--theme-muted-panel-bg)", value === o.value ? "text-(--theme-app)" : "text-(--theme-muted-text-color)"),
|
|
274
|
-
children: [o.label, value === o.value && /* @__PURE__ */ jsx(FaCheck, { className: "h-3 w-3" })]
|
|
275
|
-
}, o.value))
|
|
276
|
-
})]
|
|
221
|
+
})
|
|
277
222
|
});
|
|
278
223
|
}
|
|
224
|
+
/** The Filter button's menu: a submenu for each facet, whose options toggle
|
|
225
|
+
* without closing it. F opens it. */
|
|
279
226
|
function ListFilterMenu({ view, label }) {
|
|
280
227
|
const t = useStrings().list;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
open: openKey === facet.key,
|
|
318
|
-
onEnter: () => openFacet(facet.key),
|
|
319
|
-
onLeave: scheduleClose
|
|
320
|
-
}, facet.key))] });
|
|
321
|
-
}
|
|
322
|
-
function FilterFacetRow({ view, facet, open, onEnter, onLeave }) {
|
|
323
|
-
const selected = view.filters[facet.key] ?? [];
|
|
324
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
325
|
-
className: "relative",
|
|
326
|
-
role: "none",
|
|
327
|
-
onMouseEnter: onEnter,
|
|
328
|
-
onMouseLeave: onLeave,
|
|
329
|
-
onFocus: onEnter,
|
|
330
|
-
onBlur: onLeave,
|
|
331
|
-
children: [/* @__PURE__ */ jsxs("button", {
|
|
332
|
-
type: "button",
|
|
333
|
-
"aria-expanded": open,
|
|
334
|
-
"aria-haspopup": "menu",
|
|
335
|
-
onClick: onEnter,
|
|
336
|
-
className: "flex w-full cursor-default items-center justify-between gap-3 px-3 py-1.5 text-[13px] text-(--theme-app) hover:bg-(--theme-muted-panel-bg)",
|
|
337
|
-
children: [/* @__PURE__ */ jsx("span", { children: facet.label }), /* @__PURE__ */ jsxs("span", {
|
|
338
|
-
className: "flex items-center gap-1.5",
|
|
339
|
-
children: [selected.length > 0 && /* @__PURE__ */ jsx("span", {
|
|
340
|
-
className: "text-[11px] text-(--theme-muted-text-color)",
|
|
341
|
-
children: selected.length
|
|
342
|
-
}), /* @__PURE__ */ jsx(LuChevronRight, { className: "h-3 w-3 opacity-60" })]
|
|
343
|
-
})]
|
|
344
|
-
}), open && /* @__PURE__ */ jsx(FacetOptions, {
|
|
345
|
-
view,
|
|
346
|
-
facet,
|
|
347
|
-
selected
|
|
228
|
+
const [open, setOpen] = useState(false);
|
|
229
|
+
const hasFacets = view.facets.length > 0;
|
|
230
|
+
useShortcutKey(hasFacets ? "f" : void 0, () => setOpen(true));
|
|
231
|
+
if (!hasFacets) return null;
|
|
232
|
+
const name = label ?? t.filter;
|
|
233
|
+
const active = view.activeFilterCount > 0;
|
|
234
|
+
return /* @__PURE__ */ jsxs(Menu.Root, {
|
|
235
|
+
open,
|
|
236
|
+
onOpenChange: setOpen,
|
|
237
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
238
|
+
content: name,
|
|
239
|
+
shortcut: "F",
|
|
240
|
+
disabled: open,
|
|
241
|
+
children: /* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
242
|
+
"aria-label": name,
|
|
243
|
+
className: clsx(listControlButtonClasses, active && activeButtonClassName),
|
|
244
|
+
children: [/* @__PURE__ */ jsx(FaFilter, { className: "h-3.5 w-3.5" }), active && /* @__PURE__ */ jsx(ActiveDot, {})]
|
|
245
|
+
})
|
|
246
|
+
}), /* @__PURE__ */ jsxs(MenuPopup, {
|
|
247
|
+
align: "end",
|
|
248
|
+
className: "w-56",
|
|
249
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
250
|
+
className: "flex items-center justify-between px-3 py-1",
|
|
251
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
252
|
+
className: "text-[11px] font-medium uppercase tracking-wide text-(--theme-muted-text-color)",
|
|
253
|
+
children: t.filter
|
|
254
|
+
}), active && /* @__PURE__ */ jsx(Menu.Item, {
|
|
255
|
+
closeOnClick: false,
|
|
256
|
+
onClick: view.clearFilters,
|
|
257
|
+
className: "cursor-pointer text-[12px] text-(--theme-muted-text-color) outline-none data-highlighted:text-(--theme-app)",
|
|
258
|
+
children: t.clear
|
|
259
|
+
})]
|
|
260
|
+
}), view.facets.map((facet) => /* @__PURE__ */ jsx(FacetSubmenu, {
|
|
261
|
+
view,
|
|
262
|
+
facet
|
|
263
|
+
}, facet.key))]
|
|
348
264
|
})]
|
|
349
265
|
});
|
|
350
266
|
}
|
|
351
|
-
|
|
352
|
-
function FacetOptions({ view, facet, selected }) {
|
|
267
|
+
function FacetSubmenu({ view, facet }) {
|
|
353
268
|
const strings = useStrings();
|
|
269
|
+
const matches = useQueryMatch();
|
|
354
270
|
const [query, setQuery] = useState("");
|
|
355
|
-
const
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
271
|
+
const selected = view.filters[facet.key] ?? [];
|
|
272
|
+
const needle = query.trim();
|
|
273
|
+
const options = needle ? facet.options.filter((o) => selected.includes(o.value) || matches(needle, o.label)) : facet.options;
|
|
274
|
+
const rows = options.map((option) => {
|
|
275
|
+
const checked = selected.includes(option.value);
|
|
276
|
+
return /* @__PURE__ */ jsxs(MenuCheckboxItem, {
|
|
277
|
+
checked,
|
|
278
|
+
closeOnClick: false,
|
|
279
|
+
onCheckedChange: () => view.setFacetValues(facet.key, checked ? selected.filter((v) => v !== option.value) : [...selected, option.value]),
|
|
280
|
+
children: [option.icon, option.label]
|
|
281
|
+
}, option.value);
|
|
282
|
+
});
|
|
283
|
+
const submenu = /* @__PURE__ */ jsxs(Menu.SubmenuRoot, { children: [/* @__PURE__ */ jsxs(MenuSubmenuTrigger, { children: [facet.label, selected.length > 0 && /* @__PURE__ */ jsx("span", {
|
|
284
|
+
className: "ml-auto text-[11px] text-(--theme-muted-text-color)",
|
|
285
|
+
children: selected.length
|
|
286
|
+
})] }), /* @__PURE__ */ jsxs(MenuPopup, {
|
|
287
|
+
side: "inline-start",
|
|
288
|
+
children: [facet.searchable ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
289
|
+
className: "sticky top-0 z-[1] border-b border-(--theme-border) bg-(--theme-app-bg) px-3 pb-1.5 pt-0.5",
|
|
290
|
+
children: /* @__PURE__ */ jsx(Menu.Input, {
|
|
368
291
|
placeholder: strings.list.searchOptions,
|
|
369
292
|
"aria-label": strings.list.searchOptions,
|
|
370
|
-
className: "w-full bg-transparent text-[13px] text-(--theme-app) placeholder:text-(--theme-muted-text-color)
|
|
293
|
+
className: "w-full bg-transparent text-[13px] text-(--theme-app) outline-none placeholder:text-(--theme-muted-text-color)"
|
|
371
294
|
})
|
|
372
|
-
}), /* @__PURE__ */
|
|
373
|
-
className: "
|
|
374
|
-
children:
|
|
375
|
-
className: "px-3 py-1.5 text-[13px] text-(--theme-muted-text-color)",
|
|
376
|
-
children: strings.dropdown.noOptionsFound
|
|
377
|
-
}), options.map((option) => {
|
|
378
|
-
const checked = selected.includes(option.value);
|
|
379
|
-
return /* @__PURE__ */ jsxs("button", {
|
|
380
|
-
type: "button",
|
|
381
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
382
|
-
onClick: () => view.setFacetValues(facet.key, checked ? selected.filter((v) => v !== option.value) : [...selected, option.value]),
|
|
383
|
-
className: "flex w-full items-center gap-2 px-3 py-1.5 text-left text-[13px] text-(--theme-app) hover:bg-(--theme-muted-panel-bg)",
|
|
384
|
-
children: [
|
|
385
|
-
/* @__PURE__ */ jsx("span", {
|
|
386
|
-
className: "flex h-3.5 w-3.5 shrink-0 items-center justify-center text-(--theme-link)",
|
|
387
|
-
children: checked && /* @__PURE__ */ jsx(FaCheck, { className: "h-3 w-3" })
|
|
388
|
-
}),
|
|
389
|
-
option.icon,
|
|
390
|
-
option.label
|
|
391
|
-
]
|
|
392
|
-
}, option.value);
|
|
393
|
-
})]
|
|
295
|
+
}), /* @__PURE__ */ jsx(Menu.List, { children: rows })] }) : rows, options.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
296
|
+
className: "px-3 py-1.5 text-[13px] text-(--theme-muted-text-color)",
|
|
297
|
+
children: strings.dropdown.noOptionsFound
|
|
394
298
|
})]
|
|
395
|
-
});
|
|
299
|
+
})] });
|
|
300
|
+
return facet.searchable ? /* @__PURE__ */ jsx(Menu.FilterProvider, {
|
|
301
|
+
filter: null,
|
|
302
|
+
value: query,
|
|
303
|
+
onValueChange: setQuery,
|
|
304
|
+
children: submenu
|
|
305
|
+
}) : submenu;
|
|
396
306
|
}
|
|
397
307
|
//#endregion
|
|
398
308
|
export { AnchoredPopover, ListDisplayMenu, ListFilterMenu, listControlButtonClasses };
|
|
@@ -1,19 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type UILinkComponent } from '../components/Provider.js';
|
|
3
|
-
/**
|
|
4
|
-
export interface
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
onKeepOpen: () => void;
|
|
8
|
-
onLeave: () => void;
|
|
9
|
-
}
|
|
10
|
-
/** Opens `card` after a short hover or on focus of `children`. */
|
|
11
|
-
export declare function HoverCardTrigger({ className, children, card, }: {
|
|
12
|
-
className?: string | undefined;
|
|
13
|
-
children: ReactNode;
|
|
14
|
-
card: (placement: HoverCardPlacement) => ReactNode;
|
|
15
|
-
}): import("react").JSX.Element;
|
|
16
|
-
export interface UserHoverCardProps extends HoverCardPlacement {
|
|
3
|
+
/** A person's card, for `HoverCard`'s `card`. */
|
|
4
|
+
export interface UserHoverCardProps {
|
|
17
5
|
username: string;
|
|
18
6
|
/** Display name; falls back to the username. */
|
|
19
7
|
name?: string | null | undefined;
|
|
@@ -26,12 +14,10 @@ export interface UserHoverCardProps extends HoverCardPlacement {
|
|
|
26
14
|
linkComponent?: UILinkComponent | undefined;
|
|
27
15
|
/** Shows placeholder detail lines while the profile loads. */
|
|
28
16
|
loading?: boolean | undefined;
|
|
29
|
-
/** Re-measures the card's position when this changes. */
|
|
30
|
-
relayoutKey?: unknown;
|
|
31
17
|
/** Detail lines, usually `HoverCardRow`s, below the header. */
|
|
32
18
|
children?: ReactNode;
|
|
33
19
|
}
|
|
34
|
-
export declare function UserHoverCard({
|
|
20
|
+
export declare function UserHoverCard({ username, name, avatarSrc, badge, href, linkComponent, loading, children, }: UserHoverCardProps): import("react").JSX.Element;
|
|
35
21
|
/** One detail line of a hover card: a leading icon and its content. With
|
|
36
22
|
* `onClick` the line is a button. */
|
|
37
23
|
export declare function HoverCardRow({ icon, children, title, align, truncate, onClick, }: {
|