@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
package/dist/index.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
|
+
import { MenuCheckboxItem, MenuGroupLabel, MenuItem, MenuLinkItem, MenuPopup, MenuRadioItem, MenuSeparator, MenuSubmenuTrigger } from "./components/Menu.js";
|
|
2
|
+
import { Tooltip, TooltipProvider } from "./components/Tooltip.js";
|
|
1
3
|
import { UIProvider, useNavigation, useNotify, useOptionalWorkflowEngine, usePersistedState, useProvisionCorsRules, useRunFile, useSlots, useStrings, useWorkflowActions, useWorkflowEditing, useWorkflowEngine, useWorkflowEngineLoader } from "./components/Provider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
+
import { MenuEntries, MenuFilter, menuDivider } from "./components/MenuEntries.js";
|
|
5
|
+
import { ActionMenu } from "./components/ActionMenu.js";
|
|
4
6
|
import { Avatar, avatarInitials } from "./components/Avatar.js";
|
|
5
|
-
import { BareModal, modalPanelClasses } from "./components/BareModal.js";
|
|
6
7
|
import { BreadcrumbProvider, useBreadcrumb, useClearBreadcrumbs, useHideBreadcrumbs, useSetBreadcrumbs, useSetDefaultBreadcrumbs } from "./components/Breadcrumbs.js";
|
|
7
8
|
import { Button, MethodButton } from "./components/Button.js";
|
|
8
9
|
import Callout from "./components/Callout.js";
|
|
9
10
|
import { Card, CardHeader } from "./components/Card.js";
|
|
10
|
-
import {
|
|
11
|
+
import { Autocomplete, Combobox } from "./components/Combobox.js";
|
|
11
12
|
import { dangerButtonClasses, ghostButtonClasses, primaryButtonClasses } from "./components/ghostButton.js";
|
|
13
|
+
import { Modal, ModalDescription, ModalTitle, modalPanelClassName } from "./components/Modal.js";
|
|
12
14
|
import { ConfirmModal } from "./components/ConfirmModal.js";
|
|
15
|
+
import { useContextMenu } from "./components/ContextMenu.js";
|
|
13
16
|
import CopyToClipboard, { CopyCodeBlock } from "./components/CopyToClipboard.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
17
|
+
import { InfoTip, formatInfoTipContent } from "./components/InfoTip.js";
|
|
18
|
+
import { Switch } from "./components/Switch.js";
|
|
19
|
+
import { CreateModal, CreateModalAutocompleteField, CreateModalField, CreateModalSelect, CreateModalSwitch, CreateModalTextarea } from "./components/CreateModal.js";
|
|
16
20
|
import DescriptionList, { DescriptionListItem } from "./components/DescriptionList.js";
|
|
17
|
-
import Dropdown from "./components/Dropdown.js";
|
|
18
21
|
import EmptyState from "./components/EmptyState.js";
|
|
19
22
|
import Filter from "./components/Filter.js";
|
|
20
23
|
import { FilterPill } from "./components/FilterPill.js";
|
|
24
|
+
import { HoverCard } from "./components/HoverCard.js";
|
|
21
25
|
import { IconButton } from "./components/IconButton.js";
|
|
22
26
|
import { Indicator } from "./components/Indicator.js";
|
|
23
27
|
import { RequiredMark } from "./components/RequiredMark.js";
|
|
24
28
|
import { Input, Textarea } from "./components/Input.js";
|
|
25
29
|
import { inputClasses } from "./components/inputClasses.js";
|
|
26
30
|
import { LetterBadge } from "./components/LetterBadge.js";
|
|
27
|
-
import CustomListbox from "./components/Listbox.js";
|
|
28
31
|
import Loader from "./components/Loader.js";
|
|
29
32
|
import Markdown from "./components/Markdown.js";
|
|
30
|
-
import MultiSelectDropdown from "./components/MultiSelect.js";
|
|
31
33
|
import { Overview } from "./components/Overview.js";
|
|
32
|
-
import { BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, HeaderActionMenu, HeaderAddButton, HeaderEditButton,
|
|
34
|
+
import { BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, HeaderActionMenu, HeaderAddButton, HeaderEditButton, PageHeader, headerActionButtonClasses } from "./components/PageHeader.js";
|
|
33
35
|
import { Pagination } from "./components/Pagination.js";
|
|
36
|
+
import { Radio, RadioGroup } from "./components/Radio.js";
|
|
34
37
|
import { useRelativeTime } from "./components/relativeTime.js";
|
|
35
38
|
import SectionHeader from "./components/SectionHeader.js";
|
|
36
39
|
import { SegmentedControl } from "./components/SegmentedControl.js";
|
|
40
|
+
import { Select } from "./components/Select.js";
|
|
37
41
|
import { SettingModeOption } from "./components/SettingModeOption.js";
|
|
38
42
|
import { SettingRow, SettingSection } from "./components/SettingRow.js";
|
|
39
43
|
import SettingsCard from "./components/SettingsCard.js";
|
|
40
44
|
import SettingsGroup from "./components/SettingsGroup.js";
|
|
41
45
|
import Sort from "./components/Sort.js";
|
|
42
46
|
import { StatusBadge, StatusDot, statusTextClass } from "./components/StatusBadge.js";
|
|
43
|
-
import SwitchToggle from "./components/SwitchToggle.js";
|
|
44
|
-
import SwitchToggleSmall from "./components/SwitchToggleSmall.js";
|
|
45
47
|
import { CompactTable, Table } from "./components/Table.js";
|
|
46
|
-
import { Toggle } from "./components/Toggle.js";
|
|
47
48
|
import { useCssIsDark } from "./components/useCssIsDark.js";
|
|
48
49
|
import { DEFAULT_PRESET, THEME_PRESETS, THEME_TOKENS, applyTheme, contrastRatio, deriveTheme, isDarkColor } from "./theme/index.js";
|
|
49
|
-
export {
|
|
50
|
+
export { ActionMenu, Autocomplete, Avatar, BreadcrumbProvider, BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, Button, Callout, Card, CardHeader, Combobox, CompactTable, ConfirmModal, CopyCodeBlock, CopyToClipboard, CreateModal, CreateModalAutocompleteField, CreateModalField, CreateModalSelect, CreateModalSwitch, CreateModalTextarea, DEFAULT_PRESET, DescriptionList, DescriptionListItem, EmptyState, Filter, FilterPill, HeaderActionMenu, HeaderAddButton, HeaderEditButton, HoverCard, IconButton, Indicator, InfoTip, Input, LetterBadge, Loader, Markdown, MenuCheckboxItem, MenuEntries, MenuFilter, MenuGroupLabel, MenuItem, MenuLinkItem, MenuPopup, MenuRadioItem, MenuSeparator, MenuSubmenuTrigger, MethodButton, Modal, ModalDescription, ModalTitle, Overview, PageHeader, Pagination, Radio, RadioGroup, RequiredMark, SectionHeader, SegmentedControl, Select, SettingModeOption, SettingRow, SettingSection, SettingsCard, SettingsGroup, Sort, StatusBadge, StatusDot, Switch, THEME_PRESETS, THEME_TOKENS, Table, Textarea, Tooltip, TooltipProvider, UIProvider, applyTheme, avatarInitials, contrastRatio, dangerButtonClasses, deriveTheme, formatInfoTipContent, ghostButtonClasses, headerActionButtonClasses, inputClasses, isDarkColor, menuDivider, modalPanelClassName, primaryButtonClasses, statusTextClass, useBreadcrumb, useClearBreadcrumbs, useContextMenu, useCssIsDark, useHideBreadcrumbs, useNavigation, useNotify, useOptionalWorkflowEngine, usePersistedState, useProvisionCorsRules, useRelativeTime, useRunFile, useSetBreadcrumbs, useSetDefaultBreadcrumbs, useSlots, useStrings, useWorkflowActions, useWorkflowEditing, useWorkflowEngine, useWorkflowEngineLoader };
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}>;
|
|
7
|
-
iconClassName?: string;
|
|
8
|
-
onClick?: (() => void) | undefined;
|
|
9
|
-
href?: string | undefined;
|
|
10
|
-
disabled?: boolean | undefined;
|
|
11
|
-
enabledTooltip?: string;
|
|
12
|
-
disabledTooltip?: string | undefined;
|
|
1
|
+
import type { RowAction } from './rowMenu.js';
|
|
2
|
+
/** A toolbar button, which moves into the `…` menu as a row when the toolbar runs out of room. */
|
|
3
|
+
export interface ToolbarAction extends RowAction {
|
|
4
|
+
/** A hint on the enabled button. */
|
|
5
|
+
tooltip?: string | undefined;
|
|
13
6
|
hidden?: boolean;
|
|
14
|
-
/** Makes the action a toggle: filled while on, outlined while off. */
|
|
15
|
-
active?: boolean | undefined;
|
|
16
7
|
}
|
|
17
8
|
/** A pre-rendered element (e.g. a button component that owns its modal). */
|
|
18
9
|
interface ToolbarElement {
|
|
@@ -21,6 +12,7 @@ interface ToolbarElement {
|
|
|
21
12
|
hidden?: boolean;
|
|
22
13
|
}
|
|
23
14
|
export type ToolbarItem = ToolbarAction | ToolbarElement;
|
|
15
|
+
/** A toolbar action as a button: a link with `href`, a toggle with `checked`. */
|
|
24
16
|
export declare function ToolbarButton({ action }: {
|
|
25
17
|
action: ToolbarAction;
|
|
26
18
|
}): import("react").JSX.Element;
|
|
@@ -1,124 +1,76 @@
|
|
|
1
|
-
import { useLink, useStrings } from "../components/Provider.js";
|
|
2
1
|
import { BsThreeDotsVertical } from "../icons/bs/BsThreeDotsVertical.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { MenuPopup } from "../components/Menu.js";
|
|
3
|
+
import { Tooltip } from "../components/Tooltip.js";
|
|
4
|
+
import { useLink, useStrings } from "../components/Provider.js";
|
|
5
|
+
import { MenuEntries } from "../components/MenuEntries.js";
|
|
6
|
+
import { Menu } from "@base-ui/react/menu";
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment as Fragment$1, createContext, useContext, useLayoutEffect, useRef, useState } from "react";
|
|
10
|
+
import { Button } from "@base-ui/react/button";
|
|
11
|
+
import { Toggle } from "@base-ui/react/toggle";
|
|
9
12
|
//#region src/list/ActionToolbar.tsx
|
|
10
13
|
var OverflowMenuContext = createContext(false);
|
|
11
|
-
/** Omits data-tooltip-content when absent — react-tooltip treats an explicit undefined as an empty tooltip anchor. */
|
|
12
|
-
function tipProps(content, place) {
|
|
13
|
-
return {
|
|
14
|
-
"data-tooltip-id": TOOLTIP_ID,
|
|
15
|
-
"data-tooltip-place": place,
|
|
16
|
-
...content !== void 0 && { "data-tooltip-content": content }
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
14
|
function ToolbarItemView({ item }) {
|
|
20
|
-
if ("element" in item) return /* @__PURE__ */ jsx(Fragment
|
|
15
|
+
if ("element" in item) return /* @__PURE__ */ jsx(Fragment, { children: item.element });
|
|
21
16
|
return /* @__PURE__ */ jsx(ToolbarButton, { action: item });
|
|
22
17
|
}
|
|
18
|
+
/** A toolbar action as a button: a link with `href`, a toggle with `checked`. */
|
|
23
19
|
function ToolbarButton({ action }) {
|
|
24
20
|
const inOverflowMenu = useContext(OverflowMenuContext);
|
|
25
21
|
const Link = useLink();
|
|
26
|
-
if (inOverflowMenu) return /* @__PURE__ */ jsx(
|
|
27
|
-
const off = action.
|
|
28
|
-
const className =
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
33
|
-
className: "h-6 flex items-center",
|
|
34
|
-
children: /* @__PURE__ */ jsx(Icon, { className: cx("w-auto", action.iconClassName) })
|
|
22
|
+
if (inOverflowMenu) return /* @__PURE__ */ jsx(MenuEntries, { entries: [action] });
|
|
23
|
+
const off = action.checked === false;
|
|
24
|
+
const className = clsx("inline-flex items-center gap-x-0.5 h-9 px-2 rounded-md text-[13.5px] uppercase font-semibold transition-colors whitespace-nowrap", off ? "border theme-border theme-muted-text" : "bg-(--theme-element) text-(--theme-element-text)", "data-disabled:opacity-50 data-disabled:cursor-not-allowed", !action.disabled && (off ? "cursor-pointer hover:theme-hover" : "cursor-pointer hover:bg-(--theme-element-hover)"));
|
|
25
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
26
|
+
className: "h-6 flex items-center [&>svg]:w-auto",
|
|
27
|
+
children: action.icon
|
|
35
28
|
}), action.label] });
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
let control;
|
|
30
|
+
if (action.href && !action.disabled) control = /* @__PURE__ */ jsx(Link, {
|
|
31
|
+
href: action.href,
|
|
38
32
|
className,
|
|
39
|
-
...tooltipProps,
|
|
40
33
|
children: content
|
|
41
34
|
});
|
|
42
|
-
if (action.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
type: "button",
|
|
47
|
-
disabled: true,
|
|
48
|
-
className,
|
|
49
|
-
...pressed,
|
|
50
|
-
children: content
|
|
51
|
-
})
|
|
52
|
-
});
|
|
53
|
-
return /* @__PURE__ */ jsx("button", {
|
|
54
|
-
type: "button",
|
|
55
|
-
onClick: action.onClick,
|
|
35
|
+
else if (action.checked !== void 0) control = /* @__PURE__ */ jsx(Toggle, {
|
|
36
|
+
pressed: action.checked,
|
|
37
|
+
onPressedChange: () => action.onClick?.(),
|
|
38
|
+
disabled: action.disabled,
|
|
56
39
|
className,
|
|
57
|
-
...pressed,
|
|
58
|
-
...tooltipProps,
|
|
59
40
|
children: content
|
|
60
41
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const { list: t } = useStrings();
|
|
66
|
-
const Icon = item.icon;
|
|
67
|
-
const className = cx("flex w-full items-center gap-x-1 px-4 py-2 text-[13px] uppercase font-semibold link hover:theme-hover", item.disabled && "opacity-50 cursor-not-allowed");
|
|
68
|
-
const tooltipProps = tipProps(item.disabled ? item.disabledTooltip : item.enabledTooltip, "left");
|
|
69
|
-
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
70
|
-
/* @__PURE__ */ jsx("div", {
|
|
71
|
-
className: "w-5 h-6 flex items-center",
|
|
72
|
-
children: /* @__PURE__ */ jsx(Icon, { className: cx(item.iconClassName) })
|
|
73
|
-
}),
|
|
74
|
-
item.label,
|
|
75
|
-
item.active && /* @__PURE__ */ jsx(FaCheck, { className: "ml-auto h-4 w-4 opacity-80" })
|
|
76
|
-
] });
|
|
77
|
-
const named = item.active === void 0 ? {} : { "aria-label": t.toggleState(item.label, item.active) };
|
|
78
|
-
if (item.href && !item.disabled) return /* @__PURE__ */ jsx(MenuItem, {
|
|
79
|
-
as: Link,
|
|
80
|
-
to: item.href,
|
|
42
|
+
else control = /* @__PURE__ */ jsx(Button, {
|
|
43
|
+
onClick: action.onClick,
|
|
44
|
+
disabled: action.disabled,
|
|
45
|
+
focusableWhenDisabled: true,
|
|
81
46
|
className,
|
|
82
|
-
...named,
|
|
83
|
-
...tooltipProps,
|
|
84
47
|
children: content
|
|
85
48
|
});
|
|
86
|
-
return /* @__PURE__ */ jsx(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
disabled: item.disabled ?? false,
|
|
91
|
-
className,
|
|
92
|
-
...named,
|
|
93
|
-
...tooltipProps,
|
|
94
|
-
children: content
|
|
49
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
50
|
+
content: action.disabled ? action.disabledReason : action.tooltip,
|
|
51
|
+
side: "bottom",
|
|
52
|
+
children: control
|
|
95
53
|
});
|
|
96
54
|
}
|
|
97
55
|
function OverflowMenu({ items }) {
|
|
98
56
|
const { list: t } = useStrings();
|
|
99
|
-
return /* @__PURE__ */ jsxs(Menu, {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
children: [/* @__PURE__ */ jsx(MenuButton, {
|
|
57
|
+
return /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
58
|
+
content: t.moreActions,
|
|
59
|
+
children: /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
103
60
|
"aria-label": t.moreActions,
|
|
104
61
|
className: "inline-flex items-center justify-center h-9 w-9 rounded-md border theme-border link hover:theme-hover transition-colors",
|
|
105
|
-
"data-tooltip-id": TOOLTIP_ID,
|
|
106
|
-
"data-tooltip-content": t.moreActions,
|
|
107
62
|
"data-testid": "action-toolbar-menu-button",
|
|
108
63
|
children: /* @__PURE__ */ jsx(BsThreeDotsVertical, {})
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
children: /* @__PURE__ */ jsx(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
})
|
|
120
|
-
})]
|
|
121
|
-
});
|
|
64
|
+
})
|
|
65
|
+
}), /* @__PURE__ */ jsx(MenuPopup, {
|
|
66
|
+
keepMounted: true,
|
|
67
|
+
align: "end",
|
|
68
|
+
className: "min-w-56",
|
|
69
|
+
children: /* @__PURE__ */ jsx(OverflowMenuContext.Provider, {
|
|
70
|
+
value: true,
|
|
71
|
+
children: items.map((item) => "element" in item ? /* @__PURE__ */ jsx(Fragment$1, { children: item.element }, item.key) : /* @__PURE__ */ jsx(MenuEntries, { entries: [item] }, item.key))
|
|
72
|
+
})
|
|
73
|
+
})] });
|
|
122
74
|
}
|
|
123
75
|
var MENU_BUTTON_WIDTH = 44;
|
|
124
76
|
var ITEM_GAP = 4;
|
|
@@ -183,10 +135,10 @@ function ActionToolbar({ groups, right = [], sticky = false }) {
|
|
|
183
135
|
const visibleGroups = groups.map((group) => group.filter((a) => !a.hidden)).filter((group) => group.length > 0);
|
|
184
136
|
const visibleRight = right.filter((a) => !a.hidden);
|
|
185
137
|
return /* @__PURE__ */ jsxs("div", {
|
|
186
|
-
className:
|
|
138
|
+
className: clsx("flex items-center gap-2.5", sticky && clsx("sticky top-10 z-10 bg-(--theme-app-bg)", "py-1.5")),
|
|
187
139
|
children: [visibleGroups.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
188
140
|
className: "flex items-center gap-2.5 shrink-0",
|
|
189
|
-
children: visibleGroups.map((group, i) => /* @__PURE__ */ jsxs(Fragment, { children: [i > 0 && /* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-(--theme-border)" }), /* @__PURE__ */ jsx("div", {
|
|
141
|
+
children: visibleGroups.map((group, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [i > 0 && /* @__PURE__ */ jsx("div", { className: "w-px h-5 bg-(--theme-border)" }), /* @__PURE__ */ jsx("div", {
|
|
190
142
|
className: "flex items-center gap-1",
|
|
191
143
|
children: group.map((item) => /* @__PURE__ */ jsx(ToolbarItemView, { item }, item.key))
|
|
192
144
|
})] }, group[0]?.key ?? i))
|
package/dist/list/ListPage.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { MouseEvent as ReactMouseEvent, ReactNode } from 'react';
|
|
2
|
+
import type { OpenMenu } from '../components/ContextMenu.js';
|
|
3
|
+
import { type MenuEntry } from '../components/MenuEntries.js';
|
|
2
4
|
import { type PageHeaderBreadcrumb } from '../components/PageHeader.js';
|
|
3
5
|
import type { ListView, ListViewChrome } from './listView.js';
|
|
4
|
-
import { type
|
|
6
|
+
import { type RowAction } from './rowMenu.js';
|
|
5
7
|
/** Negative offsets (admin/org) cancel the shell's pt-4 so rows don't peek through the gap above the pinned header. */
|
|
6
8
|
declare const SECTION_STICKY_TOP: {
|
|
7
9
|
readonly main: 'top-0';
|
|
@@ -32,23 +34,15 @@ export interface ListPageProps {
|
|
|
32
34
|
children: ReactNode;
|
|
33
35
|
}
|
|
34
36
|
export declare function ListPage({ section, shellPadded, embedded, breadcrumbs, title, titleAction, actions, toolbar, view, children, }: ListPageProps): import("react").JSX.Element;
|
|
35
|
-
export interface PinnedRowAction {
|
|
36
|
-
key: string;
|
|
37
|
-
label: string;
|
|
38
|
-
icon: ReactNode;
|
|
39
|
-
onSelect: () => void;
|
|
40
|
-
disabled?: boolean | undefined;
|
|
41
|
-
/** Replaces the label on hover when the action is disabled, explaining why. */
|
|
42
|
-
tooltip?: string | undefined;
|
|
43
|
-
}
|
|
44
37
|
export declare function ListRow({ href, onActivate, items, goTo, openMenu, pinnedActions, selected, selectionActive, onRowSelect, leading, className, children, }: {
|
|
45
38
|
href: string | null;
|
|
46
39
|
/** Plain-click handler for rows that open something in place instead of navigating. */
|
|
47
40
|
onActivate?: (() => void) | undefined;
|
|
48
|
-
items:
|
|
41
|
+
items: MenuEntry[];
|
|
49
42
|
goTo: (to: string) => void;
|
|
50
43
|
openMenu: OpenMenu;
|
|
51
|
-
|
|
44
|
+
/** Actions shown as buttons on the row, beside the menu. */
|
|
45
|
+
pinnedActions?: RowAction[] | undefined;
|
|
52
46
|
className?: string;
|
|
53
47
|
/** Tints the whole row to mark it as part of a multi-selection. */
|
|
54
48
|
selected?: boolean;
|
package/dist/list/ListPage.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../components/
|
|
3
|
-
import {
|
|
1
|
+
import { Tooltip } from "../components/Tooltip.js";
|
|
2
|
+
import { useLink, useNavigation } from "../components/Provider.js";
|
|
3
|
+
import { isMenuDivider, isMenuSubmenu } from "../components/MenuEntries.js";
|
|
4
4
|
import { PageHeader } from "../components/PageHeader.js";
|
|
5
5
|
import { Table } from "../components/Table.js";
|
|
6
6
|
import { ListActionsHeader } from "./ListTable.js";
|
|
7
|
-
import
|
|
7
|
+
import { MoreButton, rowContextMenuProps, useRowMenuActive } from "./rowMenu.js";
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
10
|
import { Children, cloneElement, createContext, isValidElement, useContext, useMemo } from "react";
|
|
9
|
-
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
//#region src/list/ListPage.tsx
|
|
11
12
|
/** Negative offsets (admin/org) cancel the shell's pt-4 so rows don't peek through the gap above the pinned header. */
|
|
12
13
|
var SECTION_STICKY_TOP = {
|
|
@@ -52,7 +53,7 @@ function ListRowActionsProvider({ view, children }) {
|
|
|
52
53
|
function ListPage({ section = "main", shellPadded, embedded = false, breadcrumbs, title, titleAction, actions, toolbar, view, children }) {
|
|
53
54
|
const cancelShellPadding = shellPadded ?? SECTION_SHELL_PADDED[section];
|
|
54
55
|
return /* @__PURE__ */ jsxs("div", {
|
|
55
|
-
className:
|
|
56
|
+
className: clsx("flex h-full min-h-0 flex-col", cancelShellPadding && "-m-4"),
|
|
56
57
|
children: [embedded ? toolbar && /* @__PURE__ */ jsx("div", {
|
|
57
58
|
className: "px-4 py-1.5",
|
|
58
59
|
children: toolbar
|
|
@@ -86,14 +87,14 @@ function ListRow({ href, onActivate, items, goTo, openMenu, pinnedActions, selec
|
|
|
86
87
|
if (!isValidElement(child) || !cls && !(i === 0 && stacked.length > 0)) return child;
|
|
87
88
|
const el = child;
|
|
88
89
|
if (i === 0 && stacked.length > 0) return cloneElement(el, {
|
|
89
|
-
className:
|
|
90
|
-
children: /* @__PURE__ */ jsxs(Fragment
|
|
90
|
+
className: clsx(el.props.className, cls),
|
|
91
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [el.props.children, stacked.map((content, j) => /* @__PURE__ */ jsx("div", {
|
|
91
92
|
className: "mt-1 @[36rem]:hidden",
|
|
92
93
|
"data-stacked": true,
|
|
93
94
|
children: content
|
|
94
95
|
}, j))] })
|
|
95
96
|
});
|
|
96
|
-
return cloneElement(el, { className:
|
|
97
|
+
return cloneElement(el, { className: clsx(el.props.className, cls) });
|
|
97
98
|
});
|
|
98
99
|
const handleRowClick = (e) => {
|
|
99
100
|
if (e.target.closest("a,button,input,label")) return;
|
|
@@ -105,9 +106,9 @@ function ListRow({ href, onActivate, items, goTo, openMenu, pinnedActions, selec
|
|
|
105
106
|
else onActivate?.();
|
|
106
107
|
};
|
|
107
108
|
const pinnedLabels = new Set((pinnedActions ?? []).map((a) => a.label));
|
|
108
|
-
const hasOverflowItems = items.some((item) => item
|
|
109
|
+
const hasOverflowItems = items.some((item) => !isMenuDivider(item) && (isMenuSubmenu(item) || !pinnedLabels.has(item.label)));
|
|
109
110
|
return /* @__PURE__ */ jsxs("tr", {
|
|
110
|
-
className:
|
|
111
|
+
className: clsx("group", selected ? "bg-blue-500/5" : menuActive ? "theme-hover" : "hover:theme-hover", (href || onActivate || selectionActive) && "cursor-pointer", className),
|
|
111
112
|
onClick: handleRowClick,
|
|
112
113
|
...rowContextMenuProps(openRowMenu, items),
|
|
113
114
|
children: [
|
|
@@ -119,24 +120,14 @@ function ListRow({ href, onActivate, items, goTo, openMenu, pinnedActions, selec
|
|
|
119
120
|
className: "absolute inset-y-0 right-0 flex items-center gap-0.5 pr-4",
|
|
120
121
|
children: [pinnedActions && pinnedActions.length > 0 && /* @__PURE__ */ jsx("span", {
|
|
121
122
|
className: "hidden items-center gap-0.5 @[44rem]:flex",
|
|
122
|
-
children: pinnedActions.map((action) => /* @__PURE__ */ jsx(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"data-tooltip-id": "global-tooltip",
|
|
126
|
-
"data-tooltip-content": action.disabled && action.tooltip ? action.tooltip : action.label,
|
|
127
|
-
"data-tooltip-place": "bottom",
|
|
128
|
-
"aria-disabled": action.disabled,
|
|
129
|
-
onClick: (e) => {
|
|
130
|
-
e.stopPropagation();
|
|
131
|
-
if (action.disabled) return;
|
|
132
|
-
action.onSelect();
|
|
133
|
-
},
|
|
134
|
-
className: cx("rounded p-1 cursor-pointer text-(--theme-muted-text-color) transition-colors hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app) aria-disabled:cursor-not-allowed aria-disabled:opacity-20 aria-disabled:hover:bg-transparent aria-disabled:hover:text-(--theme-muted-text-color) [&>svg]:h-4 [&>svg]:w-4", alwaysShowActions || menuActive ? "opacity-100" : "opacity-0 group-hover:opacity-100 focus-visible:opacity-100"),
|
|
135
|
-
children: action.icon
|
|
123
|
+
children: pinnedActions.map((action) => /* @__PURE__ */ jsx(PinnedActionButton, {
|
|
124
|
+
action,
|
|
125
|
+
visible: alwaysShowActions || menuActive
|
|
136
126
|
}, action.key))
|
|
137
127
|
}), /* @__PURE__ */ jsx(MoreButton, {
|
|
138
|
-
|
|
139
|
-
|
|
128
|
+
open: menuActive,
|
|
129
|
+
visible: menuActive || alwaysShowActions,
|
|
130
|
+
onOpen: (button) => openRowMenu(button, items),
|
|
140
131
|
className: hasOverflowItems ? void 0 : "@[44rem]:hidden"
|
|
141
132
|
})]
|
|
142
133
|
})
|
|
@@ -144,11 +135,37 @@ function ListRow({ href, onActivate, items, goTo, openMenu, pinnedActions, selec
|
|
|
144
135
|
]
|
|
145
136
|
});
|
|
146
137
|
}
|
|
138
|
+
function PinnedActionButton({ action, visible }) {
|
|
139
|
+
const Link = useLink();
|
|
140
|
+
const reason = action.disabled ? action.disabledReason : void 0;
|
|
141
|
+
const props = {
|
|
142
|
+
"aria-label": reason ? `${action.label}. ${reason}` : action.label,
|
|
143
|
+
className: clsx("rounded p-1 cursor-pointer text-(--theme-muted-text-color) transition-colors hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app) aria-disabled:cursor-not-allowed aria-disabled:opacity-20 aria-disabled:hover:bg-transparent aria-disabled:hover:text-(--theme-muted-text-color) [&>svg]:h-4 [&>svg]:w-4", visible ? "opacity-100" : "opacity-0 group-hover:opacity-100 focus-visible:opacity-100")
|
|
144
|
+
};
|
|
145
|
+
return /* @__PURE__ */ jsx(Tooltip, {
|
|
146
|
+
content: reason ?? action.label,
|
|
147
|
+
side: "bottom",
|
|
148
|
+
children: action.href && !action.disabled ? /* @__PURE__ */ jsx(Link, {
|
|
149
|
+
href: action.href,
|
|
150
|
+
...props,
|
|
151
|
+
children: action.icon
|
|
152
|
+
}) : /* @__PURE__ */ jsx("button", {
|
|
153
|
+
type: "button",
|
|
154
|
+
"aria-disabled": action.disabled,
|
|
155
|
+
onClick: (e) => {
|
|
156
|
+
e.stopPropagation();
|
|
157
|
+
if (!action.disabled) action.onClick?.();
|
|
158
|
+
},
|
|
159
|
+
...props,
|
|
160
|
+
children: action.icon
|
|
161
|
+
})
|
|
162
|
+
});
|
|
163
|
+
}
|
|
147
164
|
/** Name column min-width is by role, not position, so a leading checkbox doesn't shift it. */
|
|
148
165
|
function ListColumns({ view }) {
|
|
149
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
166
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [view.visibleColumns.map((col, i) => /* @__PURE__ */ jsx(Table.Header, {
|
|
150
167
|
caps: false,
|
|
151
|
-
className:
|
|
168
|
+
className: clsx(col.headerClassName, view.columnClasses[i]),
|
|
152
169
|
style: col.alwaysVisible ? { minWidth: 200 } : void 0,
|
|
153
170
|
children: col.label
|
|
154
171
|
}, col.key)), /* @__PURE__ */ jsx(ListActionsHeader, { view })] });
|
package/dist/list/ListPager.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useStrings } from "../components/Provider.js";
|
|
2
1
|
import { LuChevronLeft } from "../icons/lu/LuChevronLeft.js";
|
|
3
2
|
import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
|
|
3
|
+
import { useStrings } from "../components/Provider.js";
|
|
4
4
|
import { listControlButtonClasses } from "./ListViewControls.js";
|
|
5
|
-
import
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/list/ListPager.tsx
|
|
8
8
|
/** Page sizes offered by the pager's per-page select; first entry is the default. */
|
|
@@ -45,14 +45,14 @@ function ListPager({ page, pageSize, total, onPageChange, pageSizes = LIST_PAGE_
|
|
|
45
45
|
"aria-label": t.paginationPrevious,
|
|
46
46
|
disabled: page === 0,
|
|
47
47
|
onClick: () => onPageChange(page - 1),
|
|
48
|
-
className:
|
|
48
|
+
className: clsx(listControlButtonClasses, "disabled:opacity-40 disabled:pointer-events-none"),
|
|
49
49
|
children: /* @__PURE__ */ jsx(LuChevronLeft, { className: "w-3.5 h-3.5" })
|
|
50
50
|
}), /* @__PURE__ */ jsx("button", {
|
|
51
51
|
type: "button",
|
|
52
52
|
"aria-label": t.paginationNext,
|
|
53
53
|
disabled: hasNext === void 0 ? page >= pageCount - 1 : !hasNext,
|
|
54
54
|
onClick: () => onPageChange(page + 1),
|
|
55
|
-
className:
|
|
55
|
+
className: clsx(listControlButtonClasses, "disabled:opacity-40 disabled:pointer-events-none"),
|
|
56
56
|
children: /* @__PURE__ */ jsx(LuChevronRight, { className: "w-3.5 h-3.5" })
|
|
57
57
|
})]
|
|
58
58
|
})]
|
package/dist/list/ListTable.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useLink, useStrings } from "../components/Provider.js";
|
|
2
1
|
import { BiError } from "../icons/bi/BiError.js";
|
|
3
2
|
import { positionKeys } from "../components/keys.js";
|
|
3
|
+
import { useLink, useStrings } from "../components/Provider.js";
|
|
4
4
|
import { Table } from "../components/Table.js";
|
|
5
|
-
import
|
|
5
|
+
import { clsx } from "clsx";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/list/ListTable.tsx
|
|
8
8
|
var NAME_TEXT = "font-medium text-[13px] leading-tight text-(--theme-app) truncate";
|
|
@@ -29,7 +29,7 @@ function NameCell({ icon, name, subtitle, href, badge, title, children }) {
|
|
|
29
29
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
30
30
|
className: "flex min-w-0 items-center gap-1.5",
|
|
31
31
|
children: [/* @__PURE__ */ jsx("div", {
|
|
32
|
-
className:
|
|
32
|
+
className: clsx(NAME_TEXT, href && "group-hover/namecell:text-(--theme-link)"),
|
|
33
33
|
title,
|
|
34
34
|
children: name
|
|
35
35
|
}), badge]
|
|
@@ -41,7 +41,7 @@ function NameCell({ icon, name, subtitle, href, badge, title, children }) {
|
|
|
41
41
|
return /* @__PURE__ */ jsxs(Table.Item, {
|
|
42
42
|
className: "py-2.5",
|
|
43
43
|
children: [href ? /* @__PURE__ */ jsx(Link, {
|
|
44
|
-
|
|
44
|
+
href,
|
|
45
45
|
className: "group/namecell flex items-center gap-2.5 min-w-0 cursor-pointer",
|
|
46
46
|
children: inner
|
|
47
47
|
}) : /* @__PURE__ */ jsx("div", {
|
|
@@ -154,7 +154,7 @@ function ListActionsHeader({ view, actionCount = 0, className }) {
|
|
|
154
154
|
width,
|
|
155
155
|
minWidth: width
|
|
156
156
|
},
|
|
157
|
-
className:
|
|
157
|
+
className: clsx("relative py-2 text-right @max-[43rem]:w-[52px]! @max-[43rem]:min-w-[52px]!", className),
|
|
158
158
|
children: /* @__PURE__ */ jsx("span", {
|
|
159
159
|
className: "sr-only",
|
|
160
160
|
children: "Actions"
|
|
@@ -5,13 +5,12 @@ import type { ListView } from './listView.js';
|
|
|
5
5
|
export declare const 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";
|
|
6
6
|
/** A header-strip button that opens a panel under it. The panel is a
|
|
7
7
|
* non-modal dialog named by the button, not a menu: it holds switches,
|
|
8
|
-
* pills and text rather than menu items.
|
|
9
|
-
|
|
10
|
-
export declare function AnchoredPopover({ icon, label, active, shortcut, panelClassName, children, }: {
|
|
8
|
+
* pills and text rather than menu items. */
|
|
9
|
+
export declare function AnchoredPopover({ icon, label, active, shortcut, panelClassName: panelClass, children, }: {
|
|
11
10
|
icon: ReactNode;
|
|
12
11
|
label: string;
|
|
13
12
|
active?: boolean;
|
|
14
|
-
/** Single-key shortcut (e.g. '
|
|
13
|
+
/** Single-key shortcut (e.g. 'd') that opens the popover; also shown in the
|
|
15
14
|
* tooltip. */
|
|
16
15
|
shortcut?: string;
|
|
17
16
|
panelClassName?: string;
|
|
@@ -21,6 +20,8 @@ export declare function ListDisplayMenu<T>({ view, label }: {
|
|
|
21
20
|
view: ListView<T>;
|
|
22
21
|
label?: string;
|
|
23
22
|
}): import("react").JSX.Element;
|
|
23
|
+
/** The Filter button's menu: a submenu for each facet, whose options toggle
|
|
24
|
+
* without closing it. F opens it. */
|
|
24
25
|
export declare function ListFilterMenu<T>({ view, label }: {
|
|
25
26
|
view: ListView<T>;
|
|
26
27
|
label?: string;
|