@parallelworks/ui 0.40.1 → 0.42.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/adapter/memoryStore.js +7 -0
- package/dist/ai/adapter/mock/mockAdapter.js +52 -17
- package/dist/ai/adapter/openai/createOpenAIStream.js +1 -1
- package/dist/ai/adapter/openai/index.d.ts +1 -1
- package/dist/ai/adapter/openai/sse.d.ts +8 -2
- package/dist/ai/adapter/openai/sse.js +40 -4
- package/dist/ai/adapter/openai/wire.d.ts +6 -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 +4 -4
- package/dist/ai/core/config.js +1 -1
- package/dist/ai/core/parts.d.ts +5 -0
- package/dist/ai/core/parts.js +28 -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 +66 -0
- package/dist/components/Combobox.js +393 -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 +17 -36
- package/dist/components/CreateModal.js +97 -259
- 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/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/types/fieldComponentTypes.d.ts +8 -10
- package/dist/form/useChoiceField.d.ts +20 -0
- package/dist/form/useChoiceField.js +49 -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 +10 -0
- package/dist/form/utils/fieldItems.js +11 -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 +63 -0
- package/dist/list/rowMenu.js +134 -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
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { MenuCheckboxItem, MenuItem, MenuLinkItem, MenuPopup, MenuSeparator, MenuSubmenuTrigger } from "./Menu.js";
|
|
2
|
+
import { safeUrl } from "../safeUrl.js";
|
|
3
|
+
import { keyedByContent } from "./keys.js";
|
|
4
|
+
import { Tooltip } from "./Tooltip.js";
|
|
5
|
+
import { useLink, useNotify, useStrings } from "./Provider.js";
|
|
6
|
+
import { useQueryMatch } from "./search.js";
|
|
7
|
+
import { Menu } from "@base-ui/react/menu";
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
//#region src/components/MenuEntries.tsx
|
|
12
|
+
var menuDivider = { divider: true };
|
|
13
|
+
var isMenuDivider = (entry) => "divider" in entry;
|
|
14
|
+
var isMenuSubmenu = (entry) => "items" in entry;
|
|
15
|
+
/** Gives a menu root its search's filter; `children` renders the root with the query. */
|
|
16
|
+
function MenuFilter({ search, children }) {
|
|
17
|
+
const [query, setQuery] = useState("");
|
|
18
|
+
if (!search) return children("");
|
|
19
|
+
return /* @__PURE__ */ jsx(Menu.FilterProvider, {
|
|
20
|
+
filter: null,
|
|
21
|
+
value: query,
|
|
22
|
+
onValueChange: setQuery,
|
|
23
|
+
autoHighlight: true,
|
|
24
|
+
children: children(query)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** A menu's rows, with its search field when it has one. */
|
|
28
|
+
function MenuEntries({ entries, search, query = "" }) {
|
|
29
|
+
const matches = useQueryMatch();
|
|
30
|
+
if (!search) return /* @__PURE__ */ jsx(EntryRows, { entries });
|
|
31
|
+
const needle = query.trim();
|
|
32
|
+
const shown = needle ? searchMatches(entries, (a) => matches(needle, a.label, a.keywords)) : entries;
|
|
33
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx("div", {
|
|
35
|
+
className: "sticky top-0 z-[1] bg-(--theme-app-bg) px-2 pt-0.5 pb-1",
|
|
36
|
+
children: /* @__PURE__ */ jsx(Menu.Input, {
|
|
37
|
+
"aria-label": search.placeholder,
|
|
38
|
+
placeholder: search.placeholder,
|
|
39
|
+
className: "w-full rounded-md border border-(--theme-border) bg-(--theme-muted-panel-bg) px-2 py-1 text-[13px] text-(--theme-app) outline-none placeholder:text-(--theme-muted-text-color) focus:border-(--theme-element)"
|
|
40
|
+
})
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx(Menu.List, { children: /* @__PURE__ */ jsx(EntryRows, { entries: shown }) }),
|
|
43
|
+
needle && shown.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
44
|
+
className: "px-3 py-1.5 text-[13px] text-(--theme-muted-text-color)",
|
|
45
|
+
children: search.empty
|
|
46
|
+
})
|
|
47
|
+
] });
|
|
48
|
+
}
|
|
49
|
+
function searchMatches(entries, match) {
|
|
50
|
+
const found = /* @__PURE__ */ new Map();
|
|
51
|
+
const walk = (list) => {
|
|
52
|
+
for (const entry of list) if (isMenuSubmenu(entry)) walk(entry.items);
|
|
53
|
+
else if (!isMenuDivider(entry) && !found.has(entry.label) && match(entry)) found.set(entry.label, entry);
|
|
54
|
+
};
|
|
55
|
+
walk(entries);
|
|
56
|
+
return [...found.values()];
|
|
57
|
+
}
|
|
58
|
+
function EntryRows({ entries }) {
|
|
59
|
+
return keyedByContent(entries, (entry) => isMenuDivider(entry) ? "divider" : entry.label).map(({ key, item }) => isMenuDivider(item) ? /* @__PURE__ */ jsx(MenuSeparator, {}, key) : isMenuSubmenu(item) ? /* @__PURE__ */ jsx(SubmenuRow, { submenu: item }, key) : /* @__PURE__ */ jsx(ActionRow, { action: item }, key));
|
|
60
|
+
}
|
|
61
|
+
function SubmenuRow({ submenu }) {
|
|
62
|
+
return /* @__PURE__ */ jsx(MenuFilter, {
|
|
63
|
+
search: submenu.search,
|
|
64
|
+
children: (query) => /* @__PURE__ */ jsxs(Menu.SubmenuRoot, { children: [/* @__PURE__ */ jsxs(MenuSubmenuTrigger, { children: [submenu.icon, submenu.label] }), /* @__PURE__ */ jsx(MenuPopup, {
|
|
65
|
+
side: "inline-end",
|
|
66
|
+
children: /* @__PURE__ */ jsx(MenuEntries, {
|
|
67
|
+
entries: submenu.items,
|
|
68
|
+
search: submenu.search,
|
|
69
|
+
query
|
|
70
|
+
})
|
|
71
|
+
})] })
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
var destructiveClassName = "text-(--theme-error) data-highlighted:text-(--theme-error)";
|
|
75
|
+
function ActionRow({ action }) {
|
|
76
|
+
const Link = useLink();
|
|
77
|
+
const copy = useCopy();
|
|
78
|
+
const className = clsx(action.destructive && destructiveClassName);
|
|
79
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [action.icon, action.label] });
|
|
80
|
+
if (action.href && !action.disabled) return action.reloadDocument ? /* @__PURE__ */ jsx(MenuLinkItem, {
|
|
81
|
+
href: safeUrl(action.href),
|
|
82
|
+
className,
|
|
83
|
+
children: content
|
|
84
|
+
}) : /* @__PURE__ */ jsx(MenuLinkItem, {
|
|
85
|
+
render: /* @__PURE__ */ jsx(Link, { href: action.href }),
|
|
86
|
+
className,
|
|
87
|
+
children: content
|
|
88
|
+
});
|
|
89
|
+
const run = () => {
|
|
90
|
+
if (action.copy) copy(action.copy);
|
|
91
|
+
action.onClick?.();
|
|
92
|
+
};
|
|
93
|
+
const reason = action.disabled ? action.disabledReason : void 0;
|
|
94
|
+
const label = /* @__PURE__ */ jsxs(Fragment, { children: [content, reason && /* @__PURE__ */ jsxs("span", {
|
|
95
|
+
className: "sr-only",
|
|
96
|
+
children: [". ", reason]
|
|
97
|
+
})] });
|
|
98
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
99
|
+
content: reason,
|
|
100
|
+
side: "right",
|
|
101
|
+
children: action.checked === void 0 ? /* @__PURE__ */ jsx(MenuItem, {
|
|
102
|
+
disabled: action.disabled,
|
|
103
|
+
onClick: run,
|
|
104
|
+
className,
|
|
105
|
+
children: label
|
|
106
|
+
}) : /* @__PURE__ */ jsx(MenuCheckboxItem, {
|
|
107
|
+
checked: action.checked,
|
|
108
|
+
onCheckedChange: run,
|
|
109
|
+
disabled: action.disabled,
|
|
110
|
+
className,
|
|
111
|
+
children: label
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function useCopy() {
|
|
116
|
+
const notify = useNotify();
|
|
117
|
+
const { list: t } = useStrings();
|
|
118
|
+
return ({ text, label }) => {
|
|
119
|
+
navigator.clipboard?.writeText(text).then(() => notify.success(t.copied(label)), () => notify.error(t.couldntCopy(label)));
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
export { MenuEntries, MenuFilter, isMenuDivider, isMenuSubmenu, menuDivider };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Dialog } from '@base-ui/react/dialog';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
/** The panel a modal draws by default; pass `panel={false}` to paint your own. */
|
|
4
|
+
export declare const modalPanelClassName = "rounded-xl border border-(--theme-border) bg-(--theme-app-bg) text-(--theme-app) shadow-2xl";
|
|
5
|
+
/** Names the modal for assistive technology; renders an `<h2>`. */
|
|
6
|
+
export declare const ModalTitle: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogTitleProps, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
7
|
+
/** Describes the modal for assistive technology; renders a `<p>`. */
|
|
8
|
+
export declare const ModalDescription: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogDescriptionProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
|
|
9
|
+
export interface ModalProps extends Omit<Dialog.Popup.Props, 'className' | 'children' | 'render'> {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
/** A confirmation the person must answer: it takes the alertdialog role and the
|
|
13
|
+
* backdrop doesn't close it. Escape still cancels while it's dismissible. */
|
|
14
|
+
alert?: boolean | undefined;
|
|
15
|
+
/** False ignores the backdrop and Escape, so typed input isn't lost to a stray
|
|
16
|
+
* click; the modal's own buttons still close it. */
|
|
17
|
+
dismissible?: boolean | undefined;
|
|
18
|
+
/** Where the panel sits: near the top of the window, or in its middle. */
|
|
19
|
+
align?: 'top' | 'center' | undefined;
|
|
20
|
+
/** Draws the default panel surface around `className`. */
|
|
21
|
+
panel?: boolean;
|
|
22
|
+
/** The backdrop's dimming, for a modal that needs a darker or blurred stage. */
|
|
23
|
+
backdropClassName?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
/** A modal dialog: focus stays inside, the page behind is inert and doesn't scroll,
|
|
28
|
+
* and focus returns to where it was on close. Name it with `ModalTitle` or `aria-label`. */
|
|
29
|
+
export declare function Modal({ open, onClose, alert, dismissible, align, panel, backdropClassName, className, children, ...popupProps }: ModalProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { portalContainer } from "./floating.js";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
5
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
6
|
+
//#region src/components/Modal.tsx
|
|
7
|
+
/** The panel a modal draws by default; pass `panel={false}` to paint your own. */
|
|
8
|
+
var modalPanelClassName = "rounded-xl border border-(--theme-border) bg-(--theme-app-bg) text-(--theme-app) shadow-2xl";
|
|
9
|
+
/** Names the modal for assistive technology; renders an `<h2>`. */
|
|
10
|
+
var ModalTitle = Dialog.Title;
|
|
11
|
+
/** Describes the modal for assistive technology; renders a `<p>`. */
|
|
12
|
+
var ModalDescription = Dialog.Description;
|
|
13
|
+
/** A modal dialog: focus stays inside, the page behind is inert and doesn't scroll,
|
|
14
|
+
* and focus returns to where it was on close. Name it with `ModalTitle` or `aria-label`. */
|
|
15
|
+
function Modal({ open, onClose, alert = false, dismissible = true, align = "top", panel = true, backdropClassName = "bg-black/40", className, children, ...popupProps }) {
|
|
16
|
+
const onOpenChange = (next, details) => {
|
|
17
|
+
if (next) return;
|
|
18
|
+
if (!dismissible && details.reason === "escape-key") {
|
|
19
|
+
details.cancel();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
onClose();
|
|
23
|
+
};
|
|
24
|
+
const content = /* @__PURE__ */ jsxs(Dialog.Portal, {
|
|
25
|
+
container: portalContainer(),
|
|
26
|
+
children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: clsx("fixed inset-0 z-[9990]", backdropClassName) }), /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
27
|
+
className: clsx("fixed inset-0 z-[9990] flex justify-center px-4 pb-8", align === "center" ? "items-center" : "items-start pt-[14vh]"),
|
|
28
|
+
children: /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
29
|
+
...popupProps,
|
|
30
|
+
className: clsx(panel && "rounded-xl border border-(--theme-border) bg-(--theme-app-bg) text-(--theme-app) shadow-2xl", "outline-none", className),
|
|
31
|
+
children
|
|
32
|
+
})
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
return alert ? /* @__PURE__ */ jsx(AlertDialog.Root, {
|
|
36
|
+
open,
|
|
37
|
+
onOpenChange,
|
|
38
|
+
children: content
|
|
39
|
+
}) : /* @__PURE__ */ jsx(Dialog.Root, {
|
|
40
|
+
open,
|
|
41
|
+
disablePointerDismissal: !dismissible,
|
|
42
|
+
onOpenChange,
|
|
43
|
+
children: content
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Modal, ModalDescription, ModalTitle, modalPanelClassName };
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import Skeleton from "react-loading-skeleton";
|
|
4
3
|
//#region src/components/Overview.tsx
|
|
5
4
|
function Overview({ Icon, name, type, children, right, className, loading, iconSize = 75 }) {
|
|
6
5
|
return /* @__PURE__ */ jsxs("div", {
|
|
7
|
-
className:
|
|
6
|
+
className: clsx("flex items-center w-full", className),
|
|
8
7
|
children: [
|
|
9
|
-
loading ? /* @__PURE__ */ jsx(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
loading ? /* @__PURE__ */ jsx("div", {
|
|
9
|
+
className: "shrink-0 animate-pulse rounded-full bg-(--theme-muted-panel-bg)",
|
|
10
|
+
style: {
|
|
11
|
+
width: iconSize,
|
|
12
|
+
height: iconSize
|
|
13
|
+
}
|
|
13
14
|
}) : Icon,
|
|
14
15
|
/* @__PURE__ */ jsx("div", {
|
|
15
16
|
className: "flex flex-col min-w-0 flex-1",
|
|
16
|
-
children: loading ? /* @__PURE__ */
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
children: loading ? /* @__PURE__ */ jsxs("div", {
|
|
18
|
+
className: "space-y-1",
|
|
19
|
+
children: [/* @__PURE__ */ jsx("div", { className: "h-3 animate-pulse rounded bg-(--theme-muted-panel-bg)" }), /* @__PURE__ */ jsx("div", { className: "h-3 animate-pulse rounded bg-(--theme-muted-panel-bg)" })]
|
|
19
20
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
21
|
/* @__PURE__ */ jsx("div", {
|
|
21
22
|
className: "font-semibold text-xl tracking-tight",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { type HeaderAddMenuItem } from './AddMenu.js';
|
|
2
|
+
import type { MenuEntry } from './MenuEntries.js';
|
|
4
3
|
export interface PageHeaderBreadcrumb {
|
|
5
4
|
label: string;
|
|
6
5
|
href?: string;
|
|
@@ -14,28 +13,23 @@ export declare const headerActionButtonClasses = "flex items-center justify-cent
|
|
|
14
13
|
/** With menu, the plus opens a chooser; otherwise navigates to or calls the
|
|
15
14
|
* single action. `word` is the visible verb; `label` stays the full action for
|
|
16
15
|
* the tooltip and screen readers. */
|
|
17
|
-
export declare function HeaderAddButton({
|
|
18
|
-
|
|
16
|
+
export declare function HeaderAddButton({ href, onClick, label, word, menu, disabled, disabledHint, }: {
|
|
17
|
+
href?: string;
|
|
19
18
|
onClick?: () => void;
|
|
20
19
|
label: string;
|
|
21
20
|
word?: 'add' | 'create';
|
|
22
|
-
menu?:
|
|
21
|
+
menu?: MenuEntry[];
|
|
23
22
|
/** Button mode only. */
|
|
24
23
|
disabled?: boolean;
|
|
25
24
|
disabledHint?: string;
|
|
26
25
|
}): import("react").JSX.Element;
|
|
26
|
+
/** The header's "…" menu of actions on the page's subject. */
|
|
27
27
|
export declare function HeaderActionMenu({ items, label, }: {
|
|
28
|
-
items:
|
|
29
|
-
label?: string;
|
|
30
|
-
}): import("react").JSX.Element | null;
|
|
31
|
-
/** The header "…" trigger for a RowMenuItem menu — same rendering (submenus,
|
|
32
|
-
* destructive styling) as the list pages' right-click context menus. */
|
|
33
|
-
export declare function HeaderRowMenu({ items, label, }: {
|
|
34
|
-
items: RowMenuItem[];
|
|
28
|
+
items: MenuEntry[];
|
|
35
29
|
label?: string;
|
|
36
30
|
}): import("react").JSX.Element | null;
|
|
37
|
-
export declare function HeaderEditButton({
|
|
38
|
-
|
|
31
|
+
export declare function HeaderEditButton({ href, onClick, label, disabled, tooltip, }: {
|
|
32
|
+
href?: string;
|
|
39
33
|
onClick?: () => void;
|
|
40
34
|
label?: string;
|
|
41
35
|
disabled?: boolean;
|
|
@@ -48,13 +42,13 @@ export declare function BreadcrumbsTitleAction({ children }: {
|
|
|
48
42
|
export declare function BreadcrumbsRightAction({ children }: {
|
|
49
43
|
children: ReactNode;
|
|
50
44
|
}): import("react").ReactPortal | null;
|
|
51
|
-
export declare function BreadcrumbsActionButton({ icon: Icon, label, ariaLabel,
|
|
45
|
+
export declare function BreadcrumbsActionButton({ icon: Icon, label, ariaLabel, href, onClick, disabled, tooltip, }: {
|
|
52
46
|
icon: ComponentType<{
|
|
53
47
|
className?: string;
|
|
54
48
|
}>;
|
|
55
49
|
label: string;
|
|
56
50
|
ariaLabel?: string;
|
|
57
|
-
|
|
51
|
+
href?: string;
|
|
58
52
|
onClick?: (() => void) | undefined;
|
|
59
53
|
disabled?: boolean;
|
|
60
54
|
tooltip?: string | undefined;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { useLink, useSlots, useStrings } from "./Provider.js";
|
|
2
1
|
import { BsThreeDots } from "../icons/bs/BsThreeDots.js";
|
|
3
2
|
import { FaEdit } from "../icons/fa/FaEdit.js";
|
|
4
3
|
import { FaPlus } from "../icons/fa/FaPlus.js";
|
|
5
4
|
import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
|
|
6
5
|
import { keyedByContent } from "./keys.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { Tooltip } from "./Tooltip.js";
|
|
7
|
+
import { useLink, useSlots, useStrings } from "./Provider.js";
|
|
8
|
+
import { ActionMenu } from "./ActionMenu.js";
|
|
9
9
|
import { useBreadcrumb } from "./Breadcrumbs.js";
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import { Fragment, useLayoutEffect } from "react";
|
|
13
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { clsx } from "clsx";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { Fragment as Fragment$1, useLayoutEffect } from "react";
|
|
14
13
|
import { createPortal } from "react-dom";
|
|
15
14
|
//#region src/components/PageHeader.tsx
|
|
16
15
|
var headerActionButtonClasses = "flex items-center justify-center w-6 h-6 rounded-md shrink-0 cursor-pointer text-(--theme-muted-text-color) hover:text-(--theme-app) hover:bg-(--theme-muted-panel-bg) transition-colors";
|
|
@@ -18,86 +17,65 @@ var headerAddButtonClasses = "inline-flex h-[26px] shrink-0 items-center gap-1.5
|
|
|
18
17
|
/** With menu, the plus opens a chooser; otherwise navigates to or calls the
|
|
19
18
|
* single action. `word` is the visible verb; `label` stays the full action for
|
|
20
19
|
* the tooltip and screen readers. */
|
|
21
|
-
function HeaderAddButton({
|
|
20
|
+
function HeaderAddButton({ href, onClick, label, word = "add", menu, disabled = false, disabledHint }) {
|
|
22
21
|
const { common } = useStrings();
|
|
23
22
|
const Link = useLink();
|
|
24
|
-
const content = /* @__PURE__ */ jsxs(Fragment
|
|
25
|
-
if (menu) return /* @__PURE__ */ jsx(
|
|
23
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FaPlus, { className: "w-3 h-3" }), /* @__PURE__ */ jsx("span", { children: word === "create" ? common.create : common.add })] });
|
|
24
|
+
if (menu) return /* @__PURE__ */ jsx(ActionMenu, {
|
|
26
25
|
items: menu,
|
|
27
26
|
label,
|
|
28
|
-
|
|
27
|
+
triggerClassName: headerAddButtonClasses,
|
|
29
28
|
children: content
|
|
30
29
|
});
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
if (href) return /* @__PURE__ */ jsx(Tooltip, {
|
|
31
|
+
content: label,
|
|
32
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
33
|
+
href,
|
|
34
|
+
"aria-label": label,
|
|
35
|
+
className: headerAddButtonClasses,
|
|
36
|
+
children: content
|
|
37
|
+
})
|
|
37
38
|
});
|
|
38
39
|
const hint = disabled ? disabledHint : void 0;
|
|
39
|
-
return /* @__PURE__ */ jsx(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
children: content
|
|
40
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
41
|
+
content: hint ?? label,
|
|
42
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: disabled ? void 0 : onClick,
|
|
45
|
+
"aria-label": hint ? `${label}. ${hint}` : label,
|
|
46
|
+
"aria-disabled": disabled || void 0,
|
|
47
|
+
className: clsx(headerAddButtonClasses, "aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent aria-disabled:hover:text-(--theme-muted-text-color)"),
|
|
48
|
+
children: content
|
|
49
|
+
})
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
+
/** The header's "…" menu of actions on the page's subject. */
|
|
52
53
|
function HeaderActionMenu({ items, label = "Actions" }) {
|
|
53
54
|
if (items.length === 0) return null;
|
|
54
|
-
return /* @__PURE__ */ jsx(
|
|
55
|
+
return /* @__PURE__ */ jsx(ActionMenu, {
|
|
55
56
|
items,
|
|
56
57
|
label,
|
|
57
|
-
|
|
58
|
+
triggerClassName: headerActionButtonClasses,
|
|
58
59
|
children: /* @__PURE__ */ jsx(BsThreeDots, { className: "w-3.5 h-3.5" })
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
-
* destructive styling) as the list pages' right-click context menus. */
|
|
63
|
-
function HeaderRowMenu({ items, label = "Actions" }) {
|
|
64
|
-
const { openMenu, contextMenu } = useRowMenu();
|
|
65
|
-
if (items.length === 0) return null;
|
|
66
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("button", {
|
|
67
|
-
type: "button",
|
|
68
|
-
"aria-label": label,
|
|
69
|
-
title: label,
|
|
70
|
-
className: headerActionButtonClasses,
|
|
71
|
-
onClick: (e) => {
|
|
72
|
-
const r = e.currentTarget.getBoundingClientRect();
|
|
73
|
-
openMenu(r.left, r.bottom + 4, items);
|
|
74
|
-
},
|
|
75
|
-
children: /* @__PURE__ */ jsx(BsThreeDots, { className: "w-3.5 h-3.5" })
|
|
76
|
-
}), contextMenu] });
|
|
77
|
-
}
|
|
78
|
-
function HeaderEditButton({ to, onClick, label = "Edit", disabled, tooltip }) {
|
|
62
|
+
function HeaderEditButton({ href, onClick, label = "Edit", disabled, tooltip }) {
|
|
79
63
|
const Link = useLink();
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
disabled,
|
|
96
|
-
"aria-label": label,
|
|
97
|
-
title: tooltip ? void 0 : label,
|
|
98
|
-
className: cx(headerActionButtonClasses, disabled && "opacity-50 cursor-not-allowed hover:bg-transparent"),
|
|
99
|
-
...tooltipProps,
|
|
100
|
-
children: /* @__PURE__ */ jsx(FaEdit, { className: "w-3 h-3" })
|
|
64
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
65
|
+
content: tooltip ?? label,
|
|
66
|
+
children: href && !disabled ? /* @__PURE__ */ jsx(Link, {
|
|
67
|
+
href,
|
|
68
|
+
"aria-label": label,
|
|
69
|
+
className: headerActionButtonClasses,
|
|
70
|
+
children: /* @__PURE__ */ jsx(FaEdit, { className: "w-3 h-3" })
|
|
71
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
72
|
+
type: "button",
|
|
73
|
+
onClick,
|
|
74
|
+
disabled,
|
|
75
|
+
"aria-label": label,
|
|
76
|
+
className: clsx(headerActionButtonClasses, disabled && "opacity-50 cursor-not-allowed hover:bg-transparent"),
|
|
77
|
+
children: /* @__PURE__ */ jsx(FaEdit, { className: "w-3 h-3" })
|
|
78
|
+
})
|
|
101
79
|
});
|
|
102
80
|
}
|
|
103
81
|
/** Renders nothing when the modern breadcrumb strip isn't mounted (classic chrome or self-headered pages). */
|
|
@@ -112,28 +90,24 @@ function BreadcrumbsRightAction({ children }) {
|
|
|
112
90
|
return createPortal(children, rightActionSlot);
|
|
113
91
|
}
|
|
114
92
|
var breadcrumbsActionClasses = "flex items-center gap-1 link text-xs whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed";
|
|
115
|
-
function BreadcrumbsActionButton({ icon: Icon, label, ariaLabel,
|
|
93
|
+
function BreadcrumbsActionButton({ icon: Icon, label, ariaLabel, href, onClick, disabled, tooltip }) {
|
|
116
94
|
const Link = useLink();
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
className: breadcrumbsActionClasses,
|
|
134
|
-
...ariaLabel ? { "aria-label": ariaLabel } : {},
|
|
135
|
-
...tip,
|
|
136
|
-
children: content
|
|
95
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, { className: "w-3 h-3" }), label] });
|
|
96
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
97
|
+
content: tooltip,
|
|
98
|
+
children: href && !disabled ? /* @__PURE__ */ jsx(Link, {
|
|
99
|
+
href,
|
|
100
|
+
className: breadcrumbsActionClasses,
|
|
101
|
+
"aria-label": ariaLabel,
|
|
102
|
+
children: content
|
|
103
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
104
|
+
type: "button",
|
|
105
|
+
onClick,
|
|
106
|
+
disabled,
|
|
107
|
+
className: breadcrumbsActionClasses,
|
|
108
|
+
"aria-label": ariaLabel,
|
|
109
|
+
children: content
|
|
110
|
+
})
|
|
137
111
|
});
|
|
138
112
|
}
|
|
139
113
|
function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, className, sticky = true, stickyTopClassName = "top-0" }) {
|
|
@@ -158,8 +132,8 @@ function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, classNa
|
|
|
158
132
|
className: "m-0 text-[13px] font-medium leading-none text-(--theme-app) truncate",
|
|
159
133
|
children: crumb.label
|
|
160
134
|
}, key);
|
|
161
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [crumb.href ? /* @__PURE__ */ jsx(Link, {
|
|
162
|
-
|
|
135
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [crumb.href ? /* @__PURE__ */ jsx(Link, {
|
|
136
|
+
href: crumb.href,
|
|
163
137
|
className: "text-(--theme-muted-text-color) hover:text-(--theme-app) transition-colors cursor-pointer whitespace-nowrap",
|
|
164
138
|
children: crumb.label
|
|
165
139
|
}) : /* @__PURE__ */ jsx("span", {
|
|
@@ -183,9 +157,9 @@ function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, classNa
|
|
|
183
157
|
children: [toggle, crumbRow]
|
|
184
158
|
}) : /* @__PURE__ */ jsx("div", {});
|
|
185
159
|
return /* @__PURE__ */ jsxs("div", {
|
|
186
|
-
className:
|
|
160
|
+
className: clsx(sticky && clsx("sticky z-20", stickyTopClassName), "w-full bg-(--theme-app-bg)", className),
|
|
187
161
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
188
|
-
className:
|
|
162
|
+
className: clsx("flex items-center justify-between gap-6 px-4 h-11", hasLeading && "border-b border-(--theme-border)"),
|
|
189
163
|
children: [leading, actionCluster]
|
|
190
164
|
}), toolbar && /* @__PURE__ */ jsx("div", {
|
|
191
165
|
className: "px-4",
|
|
@@ -194,4 +168,4 @@ function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, classNa
|
|
|
194
168
|
});
|
|
195
169
|
}
|
|
196
170
|
//#endregion
|
|
197
|
-
export { BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, HeaderActionMenu, HeaderAddButton, HeaderEditButton,
|
|
171
|
+
export { BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, HeaderActionMenu, HeaderAddButton, HeaderEditButton, PageHeader, headerActionButtonClasses };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useStrings } from "./Provider.js";
|
|
2
|
-
import
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/Pagination.tsx
|
|
5
5
|
function Pagination({ endingNumber, endingTime, nextCallback, prevCallback, roundedBottom, startingNumber, startingTime, nextDisabled, prevDisabled, name, useTimeRange = false }) {
|
|
6
6
|
const t = useStrings().list;
|
|
7
7
|
return /* @__PURE__ */ jsxs("nav", {
|
|
8
|
-
className:
|
|
8
|
+
className: clsx(roundedBottom && "rounded-b-2xl", "theme-muted-panel flex items-center justify-between border-t theme-border px-4 py-1 sm:px-6"),
|
|
9
9
|
"aria-label": "Pagination",
|
|
10
10
|
children: [/* @__PURE__ */ jsx("div", {
|
|
11
|
-
className:
|
|
11
|
+
className: clsx("hidden", (startingNumber !== void 0 && endingNumber !== void 0 || startingTime && endingTime) && "sm:block"),
|
|
12
12
|
children: /* @__PURE__ */ jsx("p", {
|
|
13
13
|
className: "text-sm whitespace-nowrap",
|
|
14
14
|
children: useTimeRange && startingTime && endingTime ? t.paginationShowingTimeRange(name ?? "", startingTime, endingTime) : t.paginationShowing(name ?? "", startingNumber ?? "", endingNumber ?? "")
|
|
@@ -19,13 +19,13 @@ function Pagination({ endingNumber, endingTime, nextCallback, prevCallback, roun
|
|
|
19
19
|
type: "button",
|
|
20
20
|
disabled: prevDisabled,
|
|
21
21
|
onClick: prevCallback,
|
|
22
|
-
className:
|
|
22
|
+
className: clsx("link text-sm", prevDisabled && "disabled"),
|
|
23
23
|
children: t.paginationPrevious
|
|
24
24
|
}), /* @__PURE__ */ jsx("button", {
|
|
25
25
|
type: "button",
|
|
26
26
|
disabled: nextDisabled,
|
|
27
27
|
onClick: nextCallback,
|
|
28
|
-
className:
|
|
28
|
+
className: clsx("link text-sm", nextDisabled && "disabled"),
|
|
29
29
|
children: t.paginationNext
|
|
30
30
|
})]
|
|
31
31
|
})]
|
|
@@ -45,7 +45,6 @@ export interface UIStrings {
|
|
|
45
45
|
favoriteHintOn: string;
|
|
46
46
|
favoriteHintOff: string;
|
|
47
47
|
filter: string;
|
|
48
|
-
noOptions: string;
|
|
49
48
|
};
|
|
50
49
|
common: {
|
|
51
50
|
copy: string;
|
|
@@ -59,6 +58,7 @@ export interface UIStrings {
|
|
|
59
58
|
remove: string;
|
|
60
59
|
sort: string;
|
|
61
60
|
userAvatar: string;
|
|
61
|
+
moreInfo: string;
|
|
62
62
|
};
|
|
63
63
|
dropdown: {
|
|
64
64
|
select: (type: string) => string;
|
|
@@ -354,7 +354,6 @@ export interface UIStrings {
|
|
|
354
354
|
couldntCopy: (label: string) => string;
|
|
355
355
|
moreActions: string;
|
|
356
356
|
/** A toolbar toggle's name in the overflow menu, where a row can't be pressed. */
|
|
357
|
-
toggleState: (label: string, on: boolean) => string;
|
|
358
357
|
labelName: string;
|
|
359
358
|
labelEmail: string;
|
|
360
359
|
labelUsername: string;
|
|
@@ -448,15 +447,10 @@ import type { FieldComponent } from '../form/fieldRegistry.js';
|
|
|
448
447
|
import type { PageHeaderCrumb } from './PageHeader.js';
|
|
449
448
|
/** Renders internal navigation; hosts bind their router's Link. Accessibility
|
|
450
449
|
* and tooltip data attributes pass through so header links keep their labels. */
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
children: ReactNode;
|
|
456
|
-
title?: string | undefined;
|
|
457
|
-
'aria-label'?: string | undefined;
|
|
458
|
-
'aria-current'?: 'page' | undefined;
|
|
459
|
-
[dataAttr: `data-${string}`]: string | undefined;
|
|
450
|
+
/** An internal navigation link. It passes every other prop, ref included, to
|
|
451
|
+
* its anchor, so menus and tooltips can attach to it. */
|
|
452
|
+
export type UILinkComponent = React.ComponentType<React.ComponentPropsWithRef<'a'> & {
|
|
453
|
+
href: string;
|
|
460
454
|
}>;
|
|
461
455
|
/** The provider's link slot, with a plain anchor fallback. */
|
|
462
456
|
export declare function useLink(): UILinkComponent;
|