@parallelworks/ui 0.43.0 → 0.45.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 +348 -25
- package/dist/ai/agent/diff.d.ts +2 -1
- package/dist/ai/agent/diff.js +4 -12
- package/dist/ai/agent/diffHighlight.d.ts +1 -1
- package/dist/ai/agent/diffHighlight.js +4 -3
- package/dist/ai/agent/index.d.ts +2 -1
- package/dist/ai/agent/toolStrings.d.ts +37 -0
- package/dist/ai/agent/toolStrings.js +35 -0
- package/dist/ai/agent/toolfmt.d.ts +8 -3
- package/dist/ai/agent/toolfmt.js +50 -65
- package/dist/ai/ai.css +18 -31
- package/dist/ai/components/AllocationSelector.js +2 -2
- package/dist/ai/components/AttachmentManager.js +28 -29
- package/dist/ai/components/AttachmentUpload.js +25 -30
- package/dist/ai/components/BlockedGroupBanner.js +2 -2
- package/dist/ai/components/BranchNavigator.js +3 -4
- package/dist/ai/components/ChatEmptyState.js +8 -7
- package/dist/ai/components/ChatInput.js +10 -12
- package/dist/ai/components/ChatLayout.js +3 -3
- package/dist/ai/components/ChatMessage.js +49 -61
- package/dist/ai/components/ChatMessageList.js +46 -42
- package/dist/ai/components/ChatSidebar.js +26 -34
- package/dist/ai/components/ChatStage.js +1 -1
- package/dist/ai/components/ComposerChrome.js +3 -4
- package/dist/ai/components/DragOverlay.js +6 -4
- package/dist/ai/components/ModelSelector.js +14 -15
- package/dist/ai/components/PastedText.js +18 -14
- package/dist/ai/components/ProviderIssueBanner.js +3 -4
- package/dist/ai/components/Reasoning.d.ts +12 -6
- package/dist/ai/components/Reasoning.js +31 -18
- package/dist/ai/components/ShareDialog.js +25 -28
- package/dist/ai/components/SlashMenu.js +3 -3
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -5
- package/dist/ai/components/agent/ActivityLine.js +17 -54
- package/dist/ai/components/agent/AgentMessageParts.js +139 -149
- package/dist/ai/components/conversationActions.js +16 -16
- package/dist/ai/core/ChatProvider.d.ts +2 -4
- package/dist/ai/core/ChatProvider.js +25 -38
- package/dist/ai/core/exportConversation.js +4 -4
- package/dist/ai/core/sidebarState.d.ts +8 -6
- package/dist/ai/core/sidebarState.js +21 -28
- package/dist/ai/core/useKeyboardShortcuts.js +14 -5
- package/dist/ai/index.d.ts +4 -5
- package/dist/ai/index.js +7 -7
- package/dist/ai/strings.d.ts +14 -31
- package/dist/ai/strings.js +19 -39
- package/dist/ai/types.d.ts +0 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +12 -9
- package/dist/ai/ui/ConversationSidebar.js +43 -87
- package/dist/ai/ui/Markdown.d.ts +3 -6
- package/dist/ai/ui/Markdown.js +6 -73
- package/dist/ai/ui/Notice.js +10 -12
- package/dist/ai/ui/chip.d.ts +2 -2
- package/dist/ai/ui/chip.js +1 -1
- package/dist/ai/ui/sidebar.d.ts +4 -20
- package/dist/ai/ui/sidebar.js +30 -67
- package/dist/ai/utils.d.ts +0 -1
- package/dist/ai/utils.js +1 -14
- package/dist/brandIcons.d.ts +51 -0
- package/dist/brandIcons.js +75 -0
- package/dist/components/Avatar.d.ts +3 -1
- package/dist/components/Avatar.js +34 -28
- package/dist/components/Button.d.ts +12 -7
- package/dist/components/Button.js +39 -44
- package/dist/components/Callout.js +18 -12
- package/dist/components/Card.d.ts +18 -8
- package/dist/components/Card.js +17 -6
- package/dist/components/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox.js +30 -0
- package/dist/components/Combobox.d.ts +9 -1
- package/dist/components/Combobox.js +71 -44
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +2 -8
- package/dist/components/ContextMenu.js +2 -29
- package/dist/components/CopyToClipboard.js +17 -36
- package/dist/components/CreateModal.d.ts +3 -24
- package/dist/components/CreateModal.js +46 -113
- package/dist/components/DatePicker.d.ts +31 -0
- package/dist/components/DatePicker.js +191 -0
- package/dist/components/DescriptionList.js +4 -4
- package/dist/components/Disclosure.d.ts +34 -0
- package/dist/components/Disclosure.js +46 -0
- package/dist/components/Drawer.d.ts +47 -0
- package/dist/components/Drawer.js +120 -0
- package/dist/components/EmptyState.d.ts +15 -10
- package/dist/components/EmptyState.js +13 -8
- package/dist/components/ExternalLink.d.ts +8 -0
- package/dist/components/ExternalLink.js +29 -0
- package/dist/components/Field.d.ts +70 -0
- package/dist/components/Field.js +159 -0
- package/dist/components/HoverCard.js +11 -14
- package/dist/components/IconButton.d.ts +16 -13
- package/dist/components/IconButton.js +27 -18
- package/dist/components/InfoTip.js +16 -23
- package/dist/components/Input.d.ts +10 -9
- package/dist/components/Input.js +54 -96
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.d.ts +15 -8
- package/dist/components/Loader.js +29 -19
- package/dist/components/Markdown.d.ts +7 -1
- package/dist/components/Markdown.js +2 -0
- package/dist/components/MarkdownImpl.d.ts +1 -1
- package/dist/components/MarkdownImpl.js +55 -14
- package/dist/components/Menu.js +13 -15
- package/dist/components/MenuEntries.js +11 -16
- package/dist/components/Meter.d.ts +48 -0
- package/dist/components/Meter.js +94 -0
- package/dist/components/Modal.js +11 -14
- package/dist/components/NumberInput.d.ts +25 -0
- package/dist/components/NumberInput.js +55 -0
- package/dist/components/Overview.js +12 -10
- package/dist/components/PageHeader.d.ts +2 -3
- package/dist/components/PageHeader.js +30 -21
- package/dist/components/Pagination.d.ts +27 -14
- package/dist/components/Pagination.js +86 -25
- package/dist/components/Popover.d.ts +47 -0
- package/dist/components/Popover.js +63 -0
- package/dist/components/Provider.d.ts +197 -80
- package/dist/components/Provider.js +200 -118
- package/dist/components/Radio.d.ts +1 -1
- package/dist/components/Radio.js +4 -4
- package/dist/components/RefreshButton.d.ts +15 -0
- package/dist/components/RefreshButton.js +53 -0
- package/dist/components/RunStatusIcon.d.ts +12 -0
- package/dist/components/RunStatusIcon.js +84 -0
- package/dist/components/SearchInput.d.ts +16 -0
- package/dist/components/SearchInput.js +52 -0
- package/dist/components/Section.d.ts +28 -0
- package/dist/components/Section.js +76 -0
- package/dist/components/SegmentedControl.d.ts +7 -11
- package/dist/components/SegmentedControl.js +25 -56
- package/dist/components/Select.d.ts +8 -1
- package/dist/components/Select.js +47 -43
- package/dist/components/SettingModeOption.d.ts +3 -5
- package/dist/components/SettingModeOption.js +5 -6
- package/dist/components/SettingsCard.d.ts +32 -19
- package/dist/components/SettingsCard.js +40 -13
- package/dist/components/Skeleton.d.ts +22 -0
- package/dist/components/Skeleton.js +34 -0
- package/dist/components/Slider.d.ts +16 -0
- package/dist/components/Slider.js +30 -0
- package/dist/components/Sort.js +4 -6
- package/dist/components/StatusBadge.d.ts +3 -1
- package/dist/components/StatusBadge.js +9 -32
- package/dist/components/StatusIcons.d.ts +0 -4
- package/dist/components/StatusIcons.js +5 -13
- package/dist/components/Switch.d.ts +5 -1
- package/dist/components/Switch.js +23 -6
- package/dist/components/Table.js +13 -20
- package/dist/components/Tabs.d.ts +52 -0
- package/dist/components/Tabs.js +75 -0
- package/dist/components/ThemeEditor.d.ts +29 -0
- package/dist/components/ThemeEditor.js +397 -0
- package/dist/components/Toast.d.ts +57 -0
- package/dist/components/Toast.js +203 -0
- package/dist/components/Tooltip.js +12 -15
- package/dist/components/buttonClasses.d.ts +18 -0
- package/dist/components/buttonClasses.js +31 -0
- package/dist/components/codeTheme.d.ts +5 -0
- package/dist/components/codeTheme.js +93 -0
- package/dist/components/fieldBox.d.ts +14 -0
- package/dist/components/fieldBox.js +29 -0
- package/dist/components/floating.d.ts +26 -5
- package/dist/components/floating.js +31 -9
- package/dist/{ai/ui/codeBreaks.js → components/markdownCodeBreaks.js} +1 -1
- package/dist/components/persistedState.d.ts +2 -0
- package/dist/components/persistedState.js +63 -0
- package/dist/components/relativeTime.d.ts +36 -8
- package/dist/components/relativeTime.js +106 -23
- package/dist/components/segmented.d.ts +17 -0
- package/dist/components/segmented.js +27 -0
- package/dist/components/shortcutKey.d.ts +4 -0
- package/dist/components/shortcutKey.js +27 -0
- package/dist/components/splitter.d.ts +26 -0
- package/dist/components/splitter.js +69 -0
- package/dist/components/tone.d.ts +9 -0
- package/dist/components/tone.js +30 -0
- package/dist/components/useCopy.d.ts +14 -0
- package/dist/components/useCopy.js +31 -0
- package/dist/components/useCssIsDark.d.ts +2 -0
- package/dist/components/useCssIsDark.js +2 -1
- package/dist/components/useTheme.d.ts +10 -0
- package/dist/components/useTheme.js +40 -0
- package/dist/cx.d.ts +5 -0
- package/dist/cx.js +11 -0
- package/dist/editor/Editor.js +2 -2
- package/dist/editor/EditorField.js +7 -10
- package/dist/editor/FormCodePanel.js +10 -23
- package/dist/editor/Monaco.js +7 -4
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +2 -2
- package/dist/editor/themes.d.ts +4 -0
- package/dist/editor/themes.js +75 -76
- package/dist/file-explorer/FileExplorer.js +180 -187
- package/dist/file-explorer/FileExplorerContext.js +36 -58
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +2 -1
- package/dist/file-explorer/FilePreview/Inline.js +9 -7
- package/dist/file-explorer/FilePreview/StreamedBadge.js +2 -2
- package/dist/file-explorer/FilePreview/Viewer.js +32 -34
- package/dist/file-explorer/FilePreview/index.js +60 -92
- package/dist/file-explorer/FileRow.js +10 -15
- package/dist/file-explorer/FileRowsWindow.js +2 -6
- package/dist/file-explorer/FileTable.js +2 -2
- package/dist/file-explorer/FileTableHeaders.js +8 -11
- package/dist/file-explorer/LoadMoreRow.js +8 -9
- package/dist/file-explorer/TreeView.js +16 -16
- package/dist/file-explorer/helpers.d.ts +1 -4
- package/dist/file-explorer/helpers.js +101 -114
- package/dist/file-explorer/lib/utils.d.ts +0 -2
- package/dist/file-explorer/lib/utils.js +1 -25
- package/dist/file-explorer/toasts.js +104 -185
- package/dist/form/Fields/BooleanField.js +12 -14
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +16 -18
- package/dist/form/Fields/ColorField.js +11 -11
- package/dist/form/Fields/DropdownField.d.ts +1 -1
- package/dist/form/Fields/DropdownField.js +20 -36
- package/dist/form/Fields/DurationField.d.ts +1 -1
- package/dist/form/Fields/DurationField.js +36 -50
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +1 -1
- package/dist/form/Fields/MultiDropdownField.js +9 -14
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +13 -48
- package/dist/form/Fields/ObjectField.js +3 -3
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +15 -18
- package/dist/form/Fields/RangeField.js +34 -35
- package/dist/form/Fields/StringField.d.ts +1 -1
- package/dist/form/Fields/StringField.js +15 -25
- package/dist/form/Fields/TextAreaField.js +10 -15
- package/dist/form/Form.d.ts +7 -2
- package/dist/form/Form.js +144 -49
- package/dist/form/FormLayout.js +18 -12
- package/dist/form/Wizard/WizardContainer.js +44 -18
- package/dist/form/Wizard/WizardNavigation.d.ts +1 -1
- package/dist/form/Wizard/WizardNavigation.js +31 -56
- package/dist/form/Wizard/WizardStepIndicator.d.ts +3 -0
- package/dist/form/Wizard/WizardStepIndicator.js +98 -114
- package/dist/form/Wizard/types.d.ts +2 -2
- package/dist/form/fieldFrame.d.ts +7 -0
- package/dist/form/fieldFrame.js +19 -0
- package/dist/form/index.d.ts +5 -5
- package/dist/form/index.js +4 -6
- package/dist/form/layoutCSS.js +5 -4
- package/dist/form/types/fieldComponentTypes.d.ts +5 -3
- package/dist/form/useChoiceField.js +2 -3
- package/dist/form/useFieldValue.d.ts +3 -0
- package/dist/form/useFieldValue.js +24 -7
- package/dist/form/utils/duration.d.ts +2 -2
- package/dist/form/utils/duration.js +3 -3
- package/dist/form/utils/fieldPath.d.ts +5 -3
- package/dist/form/utils/fieldPath.js +18 -3
- package/dist/form/utils/secondaryField.d.ts +0 -7
- package/dist/form/utils/secondaryField.js +1 -12
- package/dist/form/validation.d.ts +29 -0
- package/dist/form/validation.js +14 -0
- package/dist/format.d.ts +28 -0
- package/dist/format.js +64 -0
- package/dist/graph/AnnotationBanner.js +20 -31
- package/dist/graph/Connectors.js +1 -1
- package/dist/graph/DependencyGraph.js +51 -65
- package/dist/graph/GraphEditor.js +24 -28
- package/dist/graph/GraphEditorDialogs.js +239 -245
- package/dist/graph/InputDialog.js +93 -112
- package/dist/graph/InputsEditor.js +83 -84
- package/dist/graph/JobSummary.js +10 -11
- package/dist/graph/MatrixGroup.js +3 -3
- package/dist/graph/ProblemsButton.js +9 -10
- package/dist/graph/ShortcutsButton.js +12 -17
- package/dist/graph/SuggestionInput.d.ts +1 -2
- package/dist/graph/SuggestionInput.js +1 -3
- package/dist/graph/TreeView.js +47 -45
- package/dist/graph/WorkflowSettingsDialog.js +97 -102
- package/dist/graph/editorChrome.js +10 -12
- package/dist/graph/editorFields.d.ts +19 -16
- package/dist/graph/editorFields.js +97 -135
- package/dist/graph/editorPrimitives.js +2 -2
- package/dist/graph/editorRows.js +22 -25
- package/dist/graph/editorStrings.d.ts +16 -19
- package/dist/graph/editorStrings.js +11 -23
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -4
- package/dist/graph/inputRefs.d.ts +0 -13
- package/dist/graph/inputRefs.js +121 -159
- package/dist/graph/settingsViews.js +5 -3
- package/dist/graph/stepWith.js +100 -100
- package/dist/graph/toolbarPanel.d.ts +8 -0
- package/dist/graph/toolbarPanel.js +11 -0
- package/dist/icons.d.ts +234 -23
- package/dist/icons.js +249 -264
- package/dist/index.d.ts +38 -21
- package/dist/index.js +42 -21
- package/dist/list/ActionToolbar.d.ts +1 -5
- package/dist/list/ActionToolbar.js +21 -20
- package/dist/list/ListPage.js +7 -7
- package/dist/list/ListTable.d.ts +3 -2
- package/dist/list/ListTable.js +33 -29
- package/dist/list/ListViewControls.d.ts +0 -17
- package/dist/list/ListViewControls.js +50 -118
- package/dist/list/UserHoverCard.js +24 -32
- package/dist/list/index.d.ts +2 -4
- package/dist/list/index.js +3 -5
- package/dist/list/listSearch.d.ts +1 -1
- package/dist/list/listSearch.js +19 -14
- package/dist/list/rowMenu.js +20 -26
- package/dist/logviewer/LogViewer.js +268 -382
- package/dist/logviewer/logviewer.css +53 -41
- package/dist/styles/base.css +16 -40
- package/dist/styles/theme.css +75 -106
- package/dist/styles.css +1 -1
- package/dist/theme/color.d.ts +40 -0
- package/dist/theme/color.js +228 -0
- package/dist/theme/contrast.d.ts +42 -0
- package/dist/theme/contrast.js +145 -0
- package/dist/theme/derive.d.ts +25 -0
- package/dist/theme/derive.js +475 -0
- package/dist/theme/fit.d.ts +35 -0
- package/dist/theme/fit.js +185 -0
- package/dist/theme/index.d.ts +14 -29
- package/dist/theme/index.js +20 -279
- package/dist/theme/model.d.ts +64 -0
- package/dist/theme/model.js +219 -0
- package/package.json +9 -5
- package/dist/ai/ui/Avatar.d.ts +0 -7
- package/dist/ai/ui/Avatar.js +0 -24
- package/dist/components/Filter.d.ts +0 -15
- package/dist/components/Filter.js +0 -32
- package/dist/components/FilterPill.d.ts +0 -7
- package/dist/components/FilterPill.js +0 -14
- package/dist/components/Indicator.d.ts +0 -4
- package/dist/components/Indicator.js +0 -44
- package/dist/components/SectionHeader.d.ts +0 -8
- package/dist/components/SectionHeader.js +0 -11
- package/dist/components/SettingRow.d.ts +0 -18
- package/dist/components/SettingRow.js +0 -35
- package/dist/components/SettingsGroup.d.ts +0 -8
- package/dist/components/SettingsGroup.js +0 -17
- package/dist/components/ghostButton.d.ts +0 -4
- package/dist/components/ghostButton.js +0 -7
- package/dist/components/inputClasses.d.ts +0 -1
- package/dist/components/inputClasses.js +0 -4
- package/dist/duration.d.ts +0 -3
- package/dist/duration.js +0 -17
- package/dist/form/FieldGroup.d.ts +0 -11
- package/dist/form/FieldGroup.js +0 -36
- package/dist/form/FieldWrapper.d.ts +0 -16
- package/dist/form/FieldWrapper.js +0 -55
- package/dist/form/fieldContext.d.ts +0 -19
- package/dist/form/fieldContext.js +0 -26
- package/dist/graph/Collapse.d.ts +0 -7
- package/dist/graph/Collapse.js +0 -15
- package/dist/graph/ToolbarPopover.d.ts +0 -13
- package/dist/graph/ToolbarPopover.js +0 -39
- package/dist/icons/ai/AiOutlineRollback.js +0 -16
- package/dist/icons/bi/BiBell.js +0 -16
- package/dist/icons/bi/BiBellOff.js +0 -16
- package/dist/icons/bi/BiBuildings.js +0 -20
- package/dist/icons/bi/BiError.js +0 -20
- package/dist/icons/bi/BiExpandVertical.js +0 -16
- package/dist/icons/bi/BiPause.js +0 -16
- package/dist/icons/bi/BiPlay.js +0 -16
- package/dist/icons/bi/BiRedo.js +0 -16
- package/dist/icons/bi/BiSolidCheckShield.js +0 -16
- package/dist/icons/bi/BiSolidTrashAlt.js +0 -16
- package/dist/icons/bi/BiStop.js +0 -16
- package/dist/icons/bi/BiUndo.js +0 -16
- package/dist/icons/bs/BsArrowsCollapse.js +0 -22
- package/dist/icons/bs/BsBank2.js +0 -19
- package/dist/icons/bs/BsBriefcase.js +0 -19
- package/dist/icons/bs/BsBucket.js +0 -19
- package/dist/icons/bs/BsCalendarX.js +0 -23
- package/dist/icons/bs/BsChatLeft.js +0 -19
- package/dist/icons/bs/BsChevronDoubleDown.js +0 -29
- package/dist/icons/bs/BsChevronDoubleUp.js +0 -29
- package/dist/icons/bs/BsClipboardCheck.js +0 -34
- package/dist/icons/bs/BsCurrencyDollar.js +0 -19
- package/dist/icons/bs/BsDash.js +0 -19
- package/dist/icons/bs/BsFileEarmarkZip.js +0 -23
- package/dist/icons/bs/BsFiles.js +0 -19
- package/dist/icons/bs/BsGeoAlt.js +0 -23
- package/dist/icons/bs/BsGrid.js +0 -19
- package/dist/icons/bs/BsLayers.js +0 -19
- package/dist/icons/bs/BsLayoutThreeColumns.js +0 -19
- package/dist/icons/bs/BsListUl.js +0 -22
- package/dist/icons/bs/BsMortarboard.js +0 -23
- package/dist/icons/bs/BsMusicNoteBeamed.js +0 -34
- package/dist/icons/bs/BsOpenai.js +0 -19
- package/dist/icons/bs/BsPersonPlus.js +0 -26
- package/dist/icons/bs/BsSearch.js +0 -19
- package/dist/icons/bs/BsSend.js +0 -19
- package/dist/icons/bs/BsShieldSlash.js +0 -22
- package/dist/icons/bs/BsStar.js +0 -19
- package/dist/icons/bs/BsStarFill.js +0 -19
- package/dist/icons/bs/BsStopCircle.js +0 -23
- package/dist/icons/bs/BsTag.js +0 -23
- package/dist/icons/bs/BsTelephone.js +0 -19
- package/dist/icons/bs/BsTerminal.js +0 -23
- package/dist/icons/bs/BsTerminalFill.js +0 -19
- package/dist/icons/bs/BsThreeDots.js +0 -19
- package/dist/icons/bs/BsThreeDotsVertical.js +0 -19
- package/dist/icons/bs/BsZoomIn.js +0 -37
- package/dist/icons/fa/FaAmazon.js +0 -16
- package/dist/icons/fa/FaAngleDown.js +0 -16
- package/dist/icons/fa/FaAngleLeft.js +0 -16
- package/dist/icons/fa/FaAngleRight.js +0 -16
- package/dist/icons/fa/FaAngleUp.js +0 -16
- package/dist/icons/fa/FaArrowDown.js +0 -16
- package/dist/icons/fa/FaArrowLeft.js +0 -16
- package/dist/icons/fa/FaArrowRight.js +0 -16
- package/dist/icons/fa/FaArrowUp.js +0 -16
- package/dist/icons/fa/FaBalanceScale.js +0 -16
- package/dist/icons/fa/FaCaretDown.js +0 -16
- package/dist/icons/fa/FaCentos.js +0 -16
- package/dist/icons/fa/FaChartLine.js +0 -16
- package/dist/icons/fa/FaChartPie.js +0 -16
- package/dist/icons/fa/FaCheck.js +0 -16
- package/dist/icons/fa/FaChevronDown.js +0 -16
- package/dist/icons/fa/FaChevronUp.js +0 -16
- package/dist/icons/fa/FaChrome.js +0 -16
- package/dist/icons/fa/FaCircleNotch.js +0 -16
- package/dist/icons/fa/FaCloud.js +0 -16
- package/dist/icons/fa/FaCloudDownloadAlt.js +0 -16
- package/dist/icons/fa/FaCog.js +0 -16
- package/dist/icons/fa/FaCogs.js +0 -16
- package/dist/icons/fa/FaComments.js +0 -16
- package/dist/icons/fa/FaCompress.js +0 -16
- package/dist/icons/fa/FaDesktop.js +0 -16
- package/dist/icons/fa/FaDocker.js +0 -16
- package/dist/icons/fa/FaDollarSign.js +0 -16
- package/dist/icons/fa/FaEdge.js +0 -16
- package/dist/icons/fa/FaEdit.js +0 -16
- package/dist/icons/fa/FaExclamationTriangle.js +0 -16
- package/dist/icons/fa/FaExpand.js +0 -16
- package/dist/icons/fa/FaEye.js +0 -16
- package/dist/icons/fa/FaEyeSlash.js +0 -16
- package/dist/icons/fa/FaFile.js +0 -16
- package/dist/icons/fa/FaFilePdf.js +0 -16
- package/dist/icons/fa/FaFilter.js +0 -16
- package/dist/icons/fa/FaFirefoxBrowser.js +0 -16
- package/dist/icons/fa/FaFlask.js +0 -16
- package/dist/icons/fa/FaFolder.js +0 -16
- package/dist/icons/fa/FaGithub.js +0 -16
- package/dist/icons/fa/FaGitlab.js +0 -16
- package/dist/icons/fa/FaGlobe.js +0 -16
- package/dist/icons/fa/FaGlobeAmericas.js +0 -16
- package/dist/icons/fa/FaImage.js +0 -16
- package/dist/icons/fa/FaInfoCircle.js +0 -16
- package/dist/icons/fa/FaKey.js +0 -16
- package/dist/icons/fa/FaLayerGroup.js +0 -16
- package/dist/icons/fa/FaLink.js +0 -16
- package/dist/icons/fa/FaLinkedin.js +0 -16
- package/dist/icons/fa/FaLinux.js +0 -16
- package/dist/icons/fa/FaList.js +0 -16
- package/dist/icons/fa/FaLock.js +0 -16
- package/dist/icons/fa/FaOpenid.js +0 -16
- package/dist/icons/fa/FaOpera.js +0 -16
- package/dist/icons/fa/FaPaperclip.js +0 -16
- package/dist/icons/fa/FaPlus.js +0 -16
- package/dist/icons/fa/FaPowerOff.js +0 -16
- package/dist/icons/fa/FaPrint.js +0 -16
- package/dist/icons/fa/FaQrcode.js +0 -16
- package/dist/icons/fa/FaQuestionCircle.js +0 -16
- package/dist/icons/fa/FaRedhat.js +0 -16
- package/dist/icons/fa/FaRegCircle.js +0 -16
- package/dist/icons/fa/FaRegFileImage.js +0 -16
- package/dist/icons/fa/FaRegFolder.js +0 -16
- package/dist/icons/fa/FaRobot.js +0 -16
- package/dist/icons/fa/FaRocket.js +0 -16
- package/dist/icons/fa/FaRunning.js +0 -16
- package/dist/icons/fa/FaSafari.js +0 -16
- package/dist/icons/fa/FaSave.js +0 -16
- package/dist/icons/fa/FaSearch.js +0 -16
- package/dist/icons/fa/FaShieldAlt.js +0 -16
- package/dist/icons/fa/FaSlack.js +0 -16
- package/dist/icons/fa/FaStar.js +0 -16
- package/dist/icons/fa/FaStop.js +0 -16
- package/dist/icons/fa/FaSuse.js +0 -16
- package/dist/icons/fa/FaTerminal.js +0 -16
- package/dist/icons/fa/FaTimes.js +0 -16
- package/dist/icons/fa/FaUbuntu.js +0 -16
- package/dist/icons/fa/FaUndoAlt.js +0 -16
- package/dist/icons/fa/FaUnlink.js +0 -16
- package/dist/icons/fa/FaUser.js +0 -16
- package/dist/icons/fa/FaUsers.js +0 -16
- package/dist/icons/fa/FaWindows.js +0 -16
- package/dist/icons/fa6/FaApple.js +0 -16
- package/dist/icons/fa6/FaArrowsRotate.js +0 -16
- package/dist/icons/fa6/FaDebian.js +0 -16
- package/dist/icons/fa6/FaFilterCircleXmark.js +0 -16
- package/dist/icons/fa6/FaInbox.js +0 -16
- package/dist/icons/fa6/FaLocationDot.js +0 -16
- package/dist/icons/fa6/FaRegFilePdf.js +0 -16
- package/dist/icons/fa6/FaRegFolderOpen.js +0 -16
- package/dist/icons/fa6/FaUpRightFromSquare.js +0 -16
- package/dist/icons/fa6/FaWandMagicSparkles.js +0 -16
- package/dist/icons/fa6/FaXTwitter.js +0 -16
- package/dist/icons/fi/FiActivity.js +0 -23
- package/dist/icons/fi/FiAlertCircle.js +0 -49
- package/dist/icons/fi/FiChevronDown.js +0 -23
- package/dist/icons/fi/FiClock.js +0 -31
- package/dist/icons/fi/FiCopy.js +0 -34
- package/dist/icons/fi/FiDownload.js +0 -40
- package/dist/icons/fi/FiFile.js +0 -27
- package/dist/icons/fi/FiFileText.js +0 -55
- package/dist/icons/fi/FiHardDrive.js +0 -55
- package/dist/icons/fi/FiRotateCcw.js +0 -27
- package/dist/icons/fi/FiUpload.js +0 -40
- package/dist/icons/fi/FiX.js +0 -37
- package/dist/icons/fi/FiZap.js +0 -23
- package/dist/icons/gi/GiSpy.js +0 -16
- package/dist/icons/go/GoGitCommit.js +0 -16
- package/dist/icons/go/GoGitPullRequest.js +0 -20
- package/dist/icons/go/GoIssueOpened.js +0 -16
- package/dist/icons/go/GoPlus.js +0 -16
- package/dist/icons/go/GoRepoForked.js +0 -28
- package/dist/icons/go/GoSignOut.js +0 -16
- package/dist/icons/go/GoSkip.js +0 -20
- package/dist/icons/go/GoVideo.js +0 -20
- package/dist/icons/gr/GrCloudComputer.js +0 -20
- package/dist/icons/gr/GrInbox.js +0 -20
- package/dist/icons/gr/GrServerCluster.js +0 -20
- package/dist/icons/gr/GrStorage.js +0 -20
- package/dist/icons/gr/GrTasks.js +0 -20
- package/dist/icons/hi/HiCog.js +0 -24
- package/dist/icons/hi/HiDuplicate.js +0 -24
- package/dist/icons/hi/HiOutlineArchive.js +0 -26
- package/dist/icons/hi/HiOutlineClipboardCopy.js +0 -26
- package/dist/icons/hi/HiOutlineHome.js +0 -26
- package/dist/icons/hi/HiQuestionMarkCircle.js +0 -24
- package/dist/icons/hi/HiServer.js +0 -24
- package/dist/icons/hi2/HiMiniCheckCircle.js +0 -24
- package/dist/icons/hi2/HiMiniLanguage.js +0 -28
- package/dist/icons/hi2/HiMiniMinusCircle.js +0 -24
- package/dist/icons/hi2/HiMiniXCircle.js +0 -24
- package/dist/icons/hi2/HiSparkles.js +0 -24
- package/dist/icons/im/ImSpinner5.js +0 -19
- package/dist/icons/io/IoIosNotifications.js +0 -16
- package/dist/icons/io/IoMdBuild.js +0 -16
- package/dist/icons/io/IoMdClose.js +0 -16
- package/dist/icons/io5/IoCloudUploadOutline.js +0 -32
- package/dist/icons/io5/IoDocumentTextOutline.js +0 -31
- package/dist/icons/io5/IoFileTrayFullOutline.js +0 -31
- package/dist/icons/io5/IoHeart.js +0 -16
- package/dist/icons/io5/IoHeartDislike.js +0 -16
- package/dist/icons/io5/IoHeartOutline.js +0 -22
- package/dist/icons/io5/IoInformationCircleOutline.js +0 -50
- package/dist/icons/io5/IoSettingsOutline.js +0 -22
- package/dist/icons/io5/IoWarningOutline.js +0 -40
- package/dist/icons/lu/LuArrowRight.js +0 -27
- package/dist/icons/lu/LuBadgeCheck.js +0 -27
- package/dist/icons/lu/LuBraces.js +0 -27
- package/dist/icons/lu/LuBrainCircuit.js +0 -101
- package/dist/icons/lu/LuCalendar.js +0 -46
- package/dist/icons/lu/LuCheck.js +0 -23
- package/dist/icons/lu/LuChevronLeft.js +0 -23
- package/dist/icons/lu/LuChevronRight.js +0 -23
- package/dist/icons/lu/LuCode.js +0 -27
- package/dist/icons/lu/LuExternalLink.js +0 -35
- package/dist/icons/lu/LuEye.js +0 -31
- package/dist/icons/lu/LuEyeOff.js +0 -40
- package/dist/icons/lu/LuFolderTree.js +0 -40
- package/dist/icons/lu/LuIdCard.js +0 -55
- package/dist/icons/lu/LuKeyboard.js +0 -71
- package/dist/icons/lu/LuLogs.js +0 -65
- package/dist/icons/lu/LuMail.js +0 -33
- package/dist/icons/lu/LuMegaphone.js +0 -27
- package/dist/icons/lu/LuMoon.js +0 -23
- package/dist/icons/lu/LuNetwork.js +0 -63
- package/dist/icons/lu/LuPartyPopper.js +0 -65
- package/dist/icons/lu/LuSettings2.js +0 -48
- package/dist/icons/lu/LuSheet.js +0 -72
- package/dist/icons/lu/LuShield.js +0 -23
- package/dist/icons/lu/LuSun.js +0 -69
- package/dist/icons/lu/LuTextCursorInput.js +0 -45
- package/dist/icons/lu/LuX.js +0 -27
- package/dist/icons/lu/LuZoomIn.js +0 -59
- package/dist/icons/lu/LuZoomOut.js +0 -49
- package/dist/icons/md/MdClear.js +0 -23
- package/dist/icons/md/MdDragHandle.js +0 -23
- package/dist/icons/md/MdInstallDesktop.js +0 -31
- package/dist/icons/md/MdOutlineAttachMoney.js +0 -23
- package/dist/icons/md/MdOutlineMoneyOff.js +0 -23
- package/dist/icons/md/MdPieChart.js +0 -23
- package/dist/icons/md/MdRefresh.js +0 -23
- package/dist/icons/md/MdReplay.js +0 -23
- package/dist/icons/md/MdSmartphone.js +0 -23
- package/dist/icons/pi/PiArrowBendUpRightBold.js +0 -19
- package/dist/icons/pi/PiPlugsConnectedFill.js +0 -19
- package/dist/icons/pi/PiRectangleDashed.js +0 -19
- package/dist/icons/pi/PiShareBold.js +0 -19
- package/dist/icons/si/SiAnthropic.js +0 -19
- package/dist/icons/si/SiHelm.js +0 -19
- package/dist/icons/si/SiKubernetes.js +0 -19
- package/dist/icons/tb/TbAlertTriangle.js +0 -35
- package/dist/icons/tb/TbAlertTriangleFilled.js +0 -19
- package/dist/icons/tb/TbApi.js +0 -40
- package/dist/icons/tb/TbBrain.js +0 -50
- package/dist/icons/tb/TbBuildingTunnel.js +0 -65
- package/dist/icons/tb/TbEdit.js +0 -35
- package/dist/icons/tb/TbLayoutSidebar.js +0 -27
- package/dist/icons/tb/TbLayoutSidebarLeftCollapse.js +0 -35
- package/dist/icons/tb/TbLayoutSidebarRightCollapse.js +0 -35
- package/dist/icons/tb/TbUser.js +0 -27
- package/dist/icons/tb/TbUserOff.js +0 -35
- package/dist/icons/tb/TbWorldShare.js +0 -55
- package/dist/icons/tb/TbWorldWww.js +0 -65
- package/dist/icons/ti/TiArrowSortedDown.js +0 -20
- package/dist/icons/ti/TiArrowSortedUp.js +0 -20
- package/dist/icons/ti/TiArrowUnsorted.js +0 -20
- package/dist/icons/ti/TiCancel.js +0 -20
- package/dist/icons/vsc/VscChromeMinimize.js +0 -19
- package/dist/icons/vsc/VscJson.js +0 -19
- package/dist/icons/vsc/VscLayoutSidebarLeft.js +0 -19
- package/dist/icons/vsc/VscPass.js +0 -27
- package/dist/icons/vsc/VscSplitHorizontal.js +0 -19
- package/dist/icons/vsc/VscTerminalPowershell.js +0 -19
- package/dist/list/ListPager.d.ts +0 -14
- package/dist/list/ListPager.js +0 -62
- package/dist/list/textEntry.d.ts +0 -2
- package/dist/list/textEntry.js +0 -10
- /package/dist/{ai/ui/codeBreaks.d.ts → components/markdownCodeBreaks.d.ts} +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { Tooltip } from "./Tooltip.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Meter } from "@base-ui/react/meter";
|
|
5
|
+
import { Progress } from "@base-ui/react/progress";
|
|
6
|
+
//#region src/components/Meter.tsx
|
|
7
|
+
var fillClassName = {
|
|
8
|
+
accent: "bg-(--theme-accent)",
|
|
9
|
+
success: "bg-green-600",
|
|
10
|
+
warning: "bg-amber-500",
|
|
11
|
+
error: "bg-red-600",
|
|
12
|
+
muted: "bg-(--theme-muted-text-color)"
|
|
13
|
+
};
|
|
14
|
+
var trackClassName = {
|
|
15
|
+
sm: "h-1",
|
|
16
|
+
md: "h-1.5",
|
|
17
|
+
lg: "h-2"
|
|
18
|
+
};
|
|
19
|
+
var labelRowClassName = "mb-1 flex items-baseline justify-between gap-2 text-[13px]";
|
|
20
|
+
var detailClassName = "mt-1 text-[11px] tabular-nums text-(--theme-muted-text-color)";
|
|
21
|
+
/** The tone for `value` against a warning and an error level, for a measure
|
|
22
|
+
* that's worse the higher it reads. */
|
|
23
|
+
function levelTone(value, warnAt, errorAt) {
|
|
24
|
+
return value >= errorAt ? "error" : value >= warnAt ? "warning" : "accent";
|
|
25
|
+
}
|
|
26
|
+
/** How full something is, such as storage used or a quota spent: a reading,
|
|
27
|
+
* not a task under way (that's `ProgressBar`). The bar turns amber, then red,
|
|
28
|
+
* as it passes `warnAt` and `errorAt`; `tone` overrides that. */
|
|
29
|
+
function Meter$1({ value, min = 0, max = 100, warnAt = 80, errorAt = 90, tone, format, showValue = "beside", label, "aria-label": ariaLabel, detail, size = "md", className }) {
|
|
30
|
+
const clamped = Math.min(Math.max(value, min), max);
|
|
31
|
+
const fill = fillClassName[tone ?? levelTone(clamped, warnAt, errorAt)];
|
|
32
|
+
const shownValue = /* @__PURE__ */ jsx(Meter.Value, { className: "shrink-0 font-medium tabular-nums theme-text" });
|
|
33
|
+
const track = /* @__PURE__ */ jsx(Meter.Track, {
|
|
34
|
+
className: cx("w-full overflow-hidden rounded-full bg-(--theme-border)", trackClassName[size]),
|
|
35
|
+
children: /* @__PURE__ */ jsx(Meter.Indicator, { className: cx("h-full rounded-full transition-[width] duration-300 motion-reduce:transition-none", fill) })
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ jsxs(Meter.Root, {
|
|
38
|
+
value: clamped,
|
|
39
|
+
min,
|
|
40
|
+
max,
|
|
41
|
+
format,
|
|
42
|
+
"aria-label": ariaLabel,
|
|
43
|
+
className: cx("min-w-0", className),
|
|
44
|
+
children: [
|
|
45
|
+
label !== void 0 && /* @__PURE__ */ jsxs("div", {
|
|
46
|
+
className: labelRowClassName,
|
|
47
|
+
children: [/* @__PURE__ */ jsx(Meter.Label, {
|
|
48
|
+
className: "min-w-0 truncate theme-text",
|
|
49
|
+
children: label
|
|
50
|
+
}), showValue === "beside" && shownValue]
|
|
51
|
+
}),
|
|
52
|
+
showValue === "tooltip" ? /* @__PURE__ */ jsx(Tooltip, {
|
|
53
|
+
content: formatShare(clamped, min, max, format),
|
|
54
|
+
children: track
|
|
55
|
+
}) : track,
|
|
56
|
+
detail !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: detailClassName,
|
|
58
|
+
children: detail
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function formatShare(value, min, max, format) {
|
|
64
|
+
return format ? new Intl.NumberFormat(void 0, format).format(value) : new Intl.NumberFormat(void 0, { style: "percent" }).format((value - min) / (max - min || 1));
|
|
65
|
+
}
|
|
66
|
+
/** How far a task has come, such as an upload, out of `max`; `null` while
|
|
67
|
+
* that's not known. Name it with `label` or `aria-label`. */
|
|
68
|
+
function ProgressBar({ value, max = 100, tone = "accent", status, label, "aria-label": ariaLabel, detail, size = "md", className }) {
|
|
69
|
+
return /* @__PURE__ */ jsxs(Progress.Root, {
|
|
70
|
+
value,
|
|
71
|
+
max,
|
|
72
|
+
"aria-label": ariaLabel,
|
|
73
|
+
className: cx("min-w-0", className),
|
|
74
|
+
children: [
|
|
75
|
+
(label !== void 0 || status !== void 0) && /* @__PURE__ */ jsxs("div", {
|
|
76
|
+
className: labelRowClassName,
|
|
77
|
+
children: [/* @__PURE__ */ jsx(Progress.Label, {
|
|
78
|
+
className: "min-w-0 truncate theme-muted-text",
|
|
79
|
+
children: label
|
|
80
|
+
}), status ?? /* @__PURE__ */ jsx(Progress.Value, { className: "shrink-0 tabular-nums theme-muted-text" })]
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ jsx(Progress.Track, {
|
|
83
|
+
className: cx("w-full overflow-hidden rounded-full bg-(--theme-border)", trackClassName[size]),
|
|
84
|
+
children: /* @__PURE__ */ jsx(Progress.Indicator, { className: cx("h-full rounded-full transition-[width] duration-300 motion-reduce:transition-none", "data-indeterminate:w-1/3 data-indeterminate:animate-pulse", fillClassName[tone]) })
|
|
85
|
+
}),
|
|
86
|
+
detail !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
87
|
+
className: detailClassName,
|
|
88
|
+
children: detail
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { Meter$1 as Meter, ProgressBar, levelTone };
|
package/dist/components/Modal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { pressedToast } from "./Toast.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { AlertDialog } from "@base-ui/react/alert-dialog";
|
|
5
5
|
import { Dialog } from "@base-ui/react/dialog";
|
|
@@ -15,23 +15,20 @@ var ModalDescription = Dialog.Description;
|
|
|
15
15
|
function Modal({ open, onClose, alert = false, dismissible = true, align = "top", panel = true, backdropClassName = "bg-black/40", className, children, ...popupProps }) {
|
|
16
16
|
const onOpenChange = (next, details) => {
|
|
17
17
|
if (next) return;
|
|
18
|
-
if (!dismissible && details.reason === "escape-key") {
|
|
18
|
+
if (!dismissible && details.reason === "escape-key" || details.reason === "outside-press" && pressedToast(details.event)) {
|
|
19
19
|
details.cancel();
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
onClose();
|
|
23
23
|
};
|
|
24
|
-
const content = /* @__PURE__ */ jsxs(Dialog.Portal, {
|
|
25
|
-
|
|
26
|
-
children:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})
|
|
33
|
-
})]
|
|
34
|
-
});
|
|
24
|
+
const content = /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: cx("fixed inset-0 z-(--layer-modal)", backdropClassName) }), /* @__PURE__ */ jsx(Dialog.Viewport, {
|
|
25
|
+
className: cx("fixed inset-0 z-(--layer-modal) flex justify-center px-4 pt-20 pb-8", align === "center" ? "items-center" : "items-start sm:pt-[max(14vh,5rem)]"),
|
|
26
|
+
children: /* @__PURE__ */ jsx(Dialog.Popup, {
|
|
27
|
+
...popupProps,
|
|
28
|
+
className: cx(panel && "rounded-xl border border-(--theme-border) bg-(--theme-app-bg) text-(--theme-app) shadow-2xl", "outline-none", className),
|
|
29
|
+
children
|
|
30
|
+
})
|
|
31
|
+
})] });
|
|
35
32
|
return alert ? /* @__PURE__ */ jsx(AlertDialog.Root, {
|
|
36
33
|
open,
|
|
37
34
|
onOpenChange,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NumberField } from '@base-ui/react/number-field';
|
|
2
|
+
import { type FieldBoxSize } from './fieldBox.js';
|
|
3
|
+
export interface NumberInputProps extends Omit<NumberField.Root.Props, 'className' | 'children' | 'render'> {
|
|
4
|
+
/** How the value reads in the box: grouping, currency, units, percent. Intl's own options, so
|
|
5
|
+
* `{ style: 'currency', currency: 'USD' }` or `{ style: 'unit', unit: 'gigabyte' }`. Digits
|
|
6
|
+
* are kept as typed unless the format limits them, and grouping is off unless it turns it on. */
|
|
7
|
+
format?: Intl.NumberFormatOptions | undefined;
|
|
8
|
+
placeholder?: string | undefined;
|
|
9
|
+
/** Up and down buttons beside the value. */
|
|
10
|
+
steppers?: boolean | undefined;
|
|
11
|
+
autoFocus?: boolean | undefined;
|
|
12
|
+
'aria-label'?: string | undefined;
|
|
13
|
+
'aria-labelledby'?: string | undefined;
|
|
14
|
+
'aria-describedby'?: string | undefined;
|
|
15
|
+
'aria-invalid'?: boolean | undefined;
|
|
16
|
+
/** Marks the field required for assistive technology without the native check `required` adds. */
|
|
17
|
+
'aria-required'?: boolean | undefined;
|
|
18
|
+
size?: FieldBoxSize | undefined;
|
|
19
|
+
/** Applied to the box around the input and its steppers, such as a width. */
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
/** A number field: typing, arrow keys and the steppers move the value within `min` and `max`
|
|
23
|
+
* by `step`, and `format` shows it as Intl formats it in the reader's locale. The value is a
|
|
24
|
+
* number, or null while the box is empty. */
|
|
25
|
+
export declare function NumberInput({ format, placeholder, steppers, autoFocus, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-required': ariaRequired, size, className, ...rootProps }: NumberInputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { ChevronDownIcon, ChevronUpIcon } from "../icons.js";
|
|
3
|
+
import { fieldBox } from "./fieldBox.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
6
|
+
//#region src/components/NumberInput.tsx
|
|
7
|
+
var stepperClassName = "flex flex-1 items-center justify-center px-1 text-(--theme-muted-text-color) hover:text-(--theme-app) cursor-pointer data-disabled:cursor-not-allowed data-disabled:opacity-40";
|
|
8
|
+
/** A number field: typing, arrow keys and the steppers move the value within `min` and `max`
|
|
9
|
+
* by `step`, and `format` shows it as Intl formats it in the reader's locale. The value is a
|
|
10
|
+
* number, or null while the box is empty. */
|
|
11
|
+
function NumberInput({ format, placeholder, steppers = true, autoFocus, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, size = "md", className, ...rootProps }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(NumberField.Root, {
|
|
13
|
+
...rootProps,
|
|
14
|
+
format: {
|
|
15
|
+
maximumFractionDigits: 20,
|
|
16
|
+
useGrouping: false,
|
|
17
|
+
...format
|
|
18
|
+
},
|
|
19
|
+
children: /* @__PURE__ */ jsxs(NumberField.Group, {
|
|
20
|
+
className: cx(fieldBox({
|
|
21
|
+
size,
|
|
22
|
+
within: true,
|
|
23
|
+
padded: false
|
|
24
|
+
}), "relative", className),
|
|
25
|
+
children: [/* @__PURE__ */ jsx(NumberField.Input, {
|
|
26
|
+
placeholder,
|
|
27
|
+
autoFocus,
|
|
28
|
+
"aria-label": ariaLabel,
|
|
29
|
+
"aria-labelledby": ariaLabelledBy,
|
|
30
|
+
"aria-describedby": ariaDescribedBy,
|
|
31
|
+
"aria-invalid": ariaInvalid || void 0,
|
|
32
|
+
"aria-required": ariaRequired || void 0,
|
|
33
|
+
"data-1p-ignore": true,
|
|
34
|
+
className: cx("h-full w-full min-w-0 bg-transparent tabular-nums outline-none", size === "sm" ? "px-2" : "px-3", steppers && "pr-6")
|
|
35
|
+
}), steppers && /* @__PURE__ */ jsxs("div", {
|
|
36
|
+
className: "absolute inset-y-0 right-0 flex flex-col",
|
|
37
|
+
children: [/* @__PURE__ */ jsx(NumberField.Increment, {
|
|
38
|
+
className: stepperClassName,
|
|
39
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, {
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
className: "size-3"
|
|
42
|
+
})
|
|
43
|
+
}), /* @__PURE__ */ jsx(NumberField.Decrement, {
|
|
44
|
+
className: stepperClassName,
|
|
45
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: "size-3"
|
|
48
|
+
})
|
|
49
|
+
})]
|
|
50
|
+
})]
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { NumberInput };
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { LoadingRegion, Skeleton } from "./Skeleton.js";
|
|
2
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/Overview.tsx
|
|
4
5
|
function Overview({ Icon, name, type, children, right, className, loading, iconSize = 75 }) {
|
|
5
6
|
return /* @__PURE__ */ jsxs("div", {
|
|
6
|
-
className:
|
|
7
|
+
className: cx("flex items-center w-full", className),
|
|
7
8
|
children: [
|
|
8
|
-
loading ? /* @__PURE__ */ jsx(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
height: iconSize
|
|
13
|
-
}
|
|
9
|
+
loading ? /* @__PURE__ */ jsx(Skeleton, {
|
|
10
|
+
circle: true,
|
|
11
|
+
height: iconSize,
|
|
12
|
+
className: "shrink-0"
|
|
14
13
|
}) : Icon,
|
|
15
14
|
/* @__PURE__ */ jsx("div", {
|
|
16
15
|
className: "flex flex-col min-w-0 flex-1",
|
|
17
|
-
children: loading ? /* @__PURE__ */
|
|
16
|
+
children: loading ? /* @__PURE__ */ jsx(LoadingRegion, {
|
|
18
17
|
className: "space-y-1",
|
|
19
|
-
children:
|
|
18
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
19
|
+
count: 2,
|
|
20
|
+
height: 12
|
|
21
|
+
})
|
|
20
22
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
23
|
/* @__PURE__ */ jsx("div", {
|
|
22
24
|
className: "font-semibold text-xl tracking-tight",
|
|
@@ -9,7 +9,6 @@ export interface PageHeaderCrumb {
|
|
|
9
9
|
label: ReactNode;
|
|
10
10
|
href?: string;
|
|
11
11
|
}
|
|
12
|
-
export declare const 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";
|
|
13
12
|
/** With menu, the plus opens a chooser; otherwise navigates to or calls the
|
|
14
13
|
* single action. `word` is the visible verb; `label` stays the full action for
|
|
15
14
|
* the tooltip and screen readers. */
|
|
@@ -24,11 +23,11 @@ export declare function HeaderAddButton({ href, onClick, label, word, menu, disa
|
|
|
24
23
|
disabledHint?: string;
|
|
25
24
|
}): import("react").JSX.Element;
|
|
26
25
|
/** The header's "…" menu of actions on the page's subject. */
|
|
27
|
-
export declare function HeaderActionMenu({ items, label
|
|
26
|
+
export declare function HeaderActionMenu({ items, label }: {
|
|
28
27
|
items: MenuEntry[];
|
|
29
28
|
label?: string;
|
|
30
29
|
}): import("react").JSX.Element | null;
|
|
31
|
-
export declare function HeaderEditButton({ href, onClick, label, disabled, tooltip, }: {
|
|
30
|
+
export declare function HeaderEditButton({ href, onClick, label: labelProp, disabled, tooltip, }: {
|
|
32
31
|
href?: string;
|
|
33
32
|
onClick?: () => void;
|
|
34
33
|
label?: string;
|
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FaPlus } from "../icons/fa/FaPlus.js";
|
|
4
|
-
import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { AddIcon, ChevronRightIcon, EditIcon, MoreIcon } from "../icons.js";
|
|
5
3
|
import { keyedByContent } from "./keys.js";
|
|
4
|
+
import { buttonClasses } from "./buttonClasses.js";
|
|
6
5
|
import { Tooltip } from "./Tooltip.js";
|
|
7
6
|
import { useLink, useSlots, useStrings } from "./Provider.js";
|
|
8
7
|
import { ActionMenu } from "./ActionMenu.js";
|
|
9
8
|
import { useBreadcrumb } from "./Breadcrumbs.js";
|
|
10
|
-
import { clsx } from "clsx";
|
|
11
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
10
|
import { Fragment as Fragment$1, useLayoutEffect } from "react";
|
|
13
11
|
import { createPortal } from "react-dom";
|
|
14
12
|
//#region src/components/PageHeader.tsx
|
|
15
|
-
var headerActionButtonClasses =
|
|
16
|
-
|
|
13
|
+
var headerActionButtonClasses = buttonClasses({
|
|
14
|
+
variant: "ghost",
|
|
15
|
+
size: "xs",
|
|
16
|
+
iconOnly: true
|
|
17
|
+
});
|
|
18
|
+
var headerAddButtonClasses = buttonClasses({
|
|
19
|
+
variant: "outline",
|
|
20
|
+
size: "xs"
|
|
21
|
+
});
|
|
17
22
|
/** With menu, the plus opens a chooser; otherwise navigates to or calls the
|
|
18
23
|
* single action. `word` is the visible verb; `label` stays the full action for
|
|
19
24
|
* the tooltip and screen readers. */
|
|
20
25
|
function HeaderAddButton({ href, onClick, label, word = "add", menu, disabled = false, disabledHint }) {
|
|
21
26
|
const { common } = useStrings();
|
|
22
27
|
const Link = useLink();
|
|
23
|
-
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(
|
|
28
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AddIcon, { className: "w-3 h-3" }), /* @__PURE__ */ jsx("span", { children: word === "create" ? common.create : common.add })] });
|
|
24
29
|
if (menu) return /* @__PURE__ */ jsx(ActionMenu, {
|
|
25
30
|
items: menu,
|
|
26
31
|
label,
|
|
@@ -44,37 +49,40 @@ function HeaderAddButton({ href, onClick, label, word = "add", menu, disabled =
|
|
|
44
49
|
onClick: disabled ? void 0 : onClick,
|
|
45
50
|
"aria-label": hint ? `${label}. ${hint}` : label,
|
|
46
51
|
"aria-disabled": disabled || void 0,
|
|
47
|
-
className:
|
|
52
|
+
className: headerAddButtonClasses,
|
|
48
53
|
children: content
|
|
49
54
|
})
|
|
50
55
|
});
|
|
51
56
|
}
|
|
52
57
|
/** The header's "…" menu of actions on the page's subject. */
|
|
53
|
-
function HeaderActionMenu({ items, label
|
|
58
|
+
function HeaderActionMenu({ items, label }) {
|
|
59
|
+
const { common } = useStrings();
|
|
54
60
|
if (items.length === 0) return null;
|
|
55
61
|
return /* @__PURE__ */ jsx(ActionMenu, {
|
|
56
62
|
items,
|
|
57
|
-
label,
|
|
63
|
+
label: label ?? common.actions,
|
|
58
64
|
triggerClassName: headerActionButtonClasses,
|
|
59
|
-
children: /* @__PURE__ */ jsx(
|
|
65
|
+
children: /* @__PURE__ */ jsx(MoreIcon, { className: "w-3.5 h-3.5" })
|
|
60
66
|
});
|
|
61
67
|
}
|
|
62
|
-
function HeaderEditButton({ href, onClick, label
|
|
68
|
+
function HeaderEditButton({ href, onClick, label: labelProp, disabled, tooltip }) {
|
|
63
69
|
const Link = useLink();
|
|
70
|
+
const { common } = useStrings();
|
|
71
|
+
const label = labelProp ?? common.edit;
|
|
64
72
|
return /* @__PURE__ */ jsx(Tooltip, {
|
|
65
73
|
content: tooltip ?? label,
|
|
66
74
|
children: href && !disabled ? /* @__PURE__ */ jsx(Link, {
|
|
67
75
|
href,
|
|
68
76
|
"aria-label": label,
|
|
69
77
|
className: headerActionButtonClasses,
|
|
70
|
-
children: /* @__PURE__ */ jsx(
|
|
78
|
+
children: /* @__PURE__ */ jsx(EditIcon, { className: "w-3 h-3" })
|
|
71
79
|
}) : /* @__PURE__ */ jsx("button", {
|
|
72
80
|
type: "button",
|
|
73
81
|
onClick,
|
|
74
82
|
disabled,
|
|
75
83
|
"aria-label": label,
|
|
76
|
-
className:
|
|
77
|
-
children: /* @__PURE__ */ jsx(
|
|
84
|
+
className: headerActionButtonClasses,
|
|
85
|
+
children: /* @__PURE__ */ jsx(EditIcon, { className: "w-3 h-3" })
|
|
78
86
|
})
|
|
79
87
|
});
|
|
80
88
|
}
|
|
@@ -114,6 +122,7 @@ function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, classNa
|
|
|
114
122
|
const { setHidden } = useBreadcrumb();
|
|
115
123
|
const Link = useLink();
|
|
116
124
|
const { breadcrumbPin, navToggle } = useSlots();
|
|
125
|
+
const { common } = useStrings();
|
|
117
126
|
useLayoutEffect(() => {
|
|
118
127
|
setHidden(true);
|
|
119
128
|
return () => setHidden(false);
|
|
@@ -125,7 +134,7 @@ function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, classNa
|
|
|
125
134
|
className: "flex items-center gap-1.5 min-w-0",
|
|
126
135
|
children: [
|
|
127
136
|
/* @__PURE__ */ jsx("nav", {
|
|
128
|
-
"aria-label":
|
|
137
|
+
"aria-label": common.breadcrumb,
|
|
129
138
|
className: "flex items-center gap-2 min-w-0 text-[13px]",
|
|
130
139
|
children: keyedByContent(crumbs, (c) => c.href ?? (typeof c.label === "string" ? c.label : "crumb")).map(({ key, item: crumb }, idx) => {
|
|
131
140
|
if (idx === crumbs.length - 1) return /* @__PURE__ */ jsx("h1", {
|
|
@@ -139,7 +148,7 @@ function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, classNa
|
|
|
139
148
|
}) : /* @__PURE__ */ jsx("span", {
|
|
140
149
|
className: "text-(--theme-muted-text-color) whitespace-nowrap",
|
|
141
150
|
children: crumb.label
|
|
142
|
-
}), /* @__PURE__ */ jsx(
|
|
151
|
+
}), /* @__PURE__ */ jsx(ChevronRightIcon, { className: "w-3 h-3 opacity-60 shrink-0 text-(--theme-muted-text-color)" })] }, key);
|
|
143
152
|
})
|
|
144
153
|
}),
|
|
145
154
|
titleAction,
|
|
@@ -157,9 +166,9 @@ function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, classNa
|
|
|
157
166
|
children: [toggle, crumbRow]
|
|
158
167
|
}) : /* @__PURE__ */ jsx("div", {});
|
|
159
168
|
return /* @__PURE__ */ jsxs("div", {
|
|
160
|
-
className:
|
|
169
|
+
className: cx(sticky && cx("sticky z-(--layer-header)", stickyTopClassName), "w-full bg-(--theme-app-bg)", className),
|
|
161
170
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
162
|
-
className:
|
|
171
|
+
className: cx("flex items-center justify-between gap-6 px-4 h-11", hasLeading && "border-b border-(--theme-border)"),
|
|
163
172
|
children: [leading, actionCluster]
|
|
164
173
|
}), toolbar && /* @__PURE__ */ jsx("div", {
|
|
165
174
|
className: "px-4",
|
|
@@ -168,4 +177,4 @@ function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, classNa
|
|
|
168
177
|
});
|
|
169
178
|
}
|
|
170
179
|
//#endregion
|
|
171
|
-
export { BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, HeaderActionMenu, HeaderAddButton, HeaderEditButton, PageHeader
|
|
180
|
+
export { BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, HeaderActionMenu, HeaderAddButton, HeaderEditButton, PageHeader };
|
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** Page sizes a list offers; the first is the default. */
|
|
3
|
+
export declare const PAGE_SIZES: readonly [number, ...number[]];
|
|
4
|
+
export interface PaginationProps {
|
|
5
|
+
/** The page shown, counting from 0. */
|
|
6
|
+
page: number;
|
|
7
|
+
pageSize: number;
|
|
8
|
+
/** How many rows there are. Leave it out for a list that only knows whether
|
|
9
|
+
* more follow, and pass `hasNext`. */
|
|
10
|
+
total?: number | undefined;
|
|
11
|
+
/** Whether a page follows. Needed without a `total`, and for a total that is
|
|
12
|
+
* a capped count, so paging doesn't stop at the cap. */
|
|
13
|
+
hasNext?: boolean | undefined;
|
|
14
|
+
/** Moves to a page. */
|
|
15
|
+
onPageChange?: ((page: number) => void) | undefined;
|
|
16
|
+
/** Makes each page a link instead, for pages the address names. */
|
|
17
|
+
pageHref?: ((page: number) => string) | undefined;
|
|
18
|
+
/** Page sizes to offer; shown only with `onPageSizeChange`. */
|
|
19
|
+
pageSizes?: readonly number[];
|
|
20
|
+
onPageSizeChange?: ((size: number) => void) | undefined;
|
|
21
|
+
/** Replaces "1–50 of 200", such as with the time range a page covers. */
|
|
22
|
+
summary?: ReactNode;
|
|
23
|
+
className?: string | undefined;
|
|
13
24
|
}
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
/** Steps through a list a page at a time: where the page sits in the list,
|
|
26
|
+
* previous and next, and optionally how many rows a page holds. Renders
|
|
27
|
+
* nothing when everything fits on one page. */
|
|
28
|
+
export declare function Pagination({ page, pageSize, total, hasNext, onPageChange, pageHref, pageSizes, onPageSizeChange, summary, className, }: PaginationProps): import("react").JSX.Element | null;
|
|
@@ -1,35 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "../icons.js";
|
|
3
|
+
import { buttonClasses } from "./buttonClasses.js";
|
|
4
|
+
import { Tooltip } from "./Tooltip.js";
|
|
5
|
+
import { useLink, useStrings } from "./Provider.js";
|
|
6
|
+
import { IconButton } from "./IconButton.js";
|
|
7
|
+
import { Select } from "./Select.js";
|
|
3
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
9
|
//#region src/components/Pagination.tsx
|
|
5
|
-
|
|
10
|
+
/** Page sizes a list offers; the first is the default. */
|
|
11
|
+
var PAGE_SIZES = [
|
|
12
|
+
50,
|
|
13
|
+
100,
|
|
14
|
+
200
|
|
15
|
+
];
|
|
16
|
+
/** Steps through a list a page at a time: where the page sits in the list,
|
|
17
|
+
* previous and next, and optionally how many rows a page holds. Renders
|
|
18
|
+
* nothing when everything fits on one page. */
|
|
19
|
+
function Pagination({ page, pageSize, total, hasNext, onPageChange, pageHref, pageSizes = PAGE_SIZES, onPageSizeChange, summary, className }) {
|
|
6
20
|
const t = useStrings().list;
|
|
21
|
+
const start = page * pageSize + 1;
|
|
22
|
+
const pageEnd = (page + 1) * pageSize;
|
|
23
|
+
const known = total !== void 0;
|
|
24
|
+
const pageCount = known ? Math.max(1, Math.ceil(total / pageSize)) : void 0;
|
|
25
|
+
const pastCap = known && hasNext === true && pageEnd >= total;
|
|
26
|
+
const end = known && !pastCap ? Math.min(total, pageEnd) : pageEnd;
|
|
27
|
+
const hasPrevious = page > 0;
|
|
28
|
+
const hasMore = hasNext ?? (pageCount !== void 0 && page < pageCount - 1);
|
|
29
|
+
const smallest = Math.min(...pageSizes);
|
|
30
|
+
const showSizes = !!onPageSizeChange && (known && total > smallest || pageSize > smallest);
|
|
31
|
+
if (!hasPrevious && !hasMore && !showSizes) return null;
|
|
32
|
+
const position = summary ?? (known ? t.pager(start, end, pastCap ? end : total, pastCap) : null);
|
|
7
33
|
return /* @__PURE__ */ jsxs("nav", {
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
children: [/* @__PURE__ */
|
|
11
|
-
className:
|
|
12
|
-
children: /* @__PURE__ */ jsx("
|
|
13
|
-
className: "
|
|
14
|
-
children:
|
|
15
|
-
})
|
|
34
|
+
"aria-label": t.pagination,
|
|
35
|
+
className: cx("flex h-10 shrink-0 items-center justify-between gap-3 px-2.5", className),
|
|
36
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
37
|
+
className: "flex min-w-0 flex-1 items-center gap-3 text-xs text-(--theme-muted-text-color)",
|
|
38
|
+
children: [position && /* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "truncate",
|
|
40
|
+
children: position
|
|
41
|
+
}), showSizes && /* @__PURE__ */ jsx(Select, {
|
|
42
|
+
"aria-label": t.perPage,
|
|
43
|
+
size: "sm",
|
|
44
|
+
className: "w-20",
|
|
45
|
+
items: pageSizes.map((size) => ({
|
|
46
|
+
value: size,
|
|
47
|
+
label: String(size)
|
|
48
|
+
})),
|
|
49
|
+
value: pageSize,
|
|
50
|
+
onValueChange: (size) => size !== null && onPageSizeChange(size)
|
|
51
|
+
})]
|
|
16
52
|
}), /* @__PURE__ */ jsxs("div", {
|
|
17
|
-
className: "flex
|
|
18
|
-
children: [/* @__PURE__ */ jsx(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
53
|
+
className: "flex items-center gap-1",
|
|
54
|
+
children: [/* @__PURE__ */ jsx(PageStep, {
|
|
55
|
+
to: page - 1,
|
|
56
|
+
enabled: hasPrevious,
|
|
57
|
+
label: t.paginationPrevious,
|
|
58
|
+
icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {}),
|
|
59
|
+
onPageChange,
|
|
60
|
+
pageHref
|
|
61
|
+
}), /* @__PURE__ */ jsx(PageStep, {
|
|
62
|
+
to: page + 1,
|
|
63
|
+
enabled: hasMore,
|
|
64
|
+
label: t.paginationNext,
|
|
65
|
+
icon: /* @__PURE__ */ jsx(ChevronRightIcon, {}),
|
|
66
|
+
onPageChange,
|
|
67
|
+
pageHref
|
|
30
68
|
})]
|
|
31
69
|
})]
|
|
32
70
|
});
|
|
33
71
|
}
|
|
72
|
+
function PageStep({ to, enabled, label, icon, onPageChange, pageHref }) {
|
|
73
|
+
const Link = useLink();
|
|
74
|
+
if (pageHref && enabled) return /* @__PURE__ */ jsx(Tooltip, {
|
|
75
|
+
content: label,
|
|
76
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
77
|
+
href: pageHref(to),
|
|
78
|
+
"aria-label": label,
|
|
79
|
+
className: buttonClasses({
|
|
80
|
+
variant: "outline",
|
|
81
|
+
size: "sm",
|
|
82
|
+
iconOnly: true
|
|
83
|
+
}),
|
|
84
|
+
children: icon
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
88
|
+
variant: "outline",
|
|
89
|
+
icon,
|
|
90
|
+
label,
|
|
91
|
+
disabled: !enabled,
|
|
92
|
+
onClick: () => onPageChange?.(to)
|
|
93
|
+
});
|
|
94
|
+
}
|
|
34
95
|
//#endregion
|
|
35
|
-
export { Pagination };
|
|
96
|
+
export { PAGE_SIZES, Pagination };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Popover as BasePopover } from '@base-ui/react/popover';
|
|
2
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
3
|
+
import { type FloatingAnchor } from './floating.js';
|
|
4
|
+
/** A button that closes the popover it sits in. */
|
|
5
|
+
export declare const PopoverClose: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
/** Closes the popover the caller sits in, for an element that isn't a button,
|
|
7
|
+
* such as a link that leaves the panel: `<Link href onClick={close}>`. */
|
|
8
|
+
export declare function useClosePopover(): () => void;
|
|
9
|
+
/** What a popover opens from: a trigger that opens it on press, or an anchor
|
|
10
|
+
* it opens at while `open`, such as the point where a selection ended. */
|
|
11
|
+
type PopoverOpener = {
|
|
12
|
+
/** The button that opens it. It receives the trigger's props and ref, so it must pass them to its element. */
|
|
13
|
+
trigger: ReactElement;
|
|
14
|
+
at?: never;
|
|
15
|
+
} | {
|
|
16
|
+
/** An element or pointer event it opens at, for a popover with no trigger. */
|
|
17
|
+
at: FloatingAnchor;
|
|
18
|
+
trigger?: never;
|
|
19
|
+
};
|
|
20
|
+
export type PopoverProps = PopoverOpener & PopoverOptions;
|
|
21
|
+
export interface PopoverOptions extends Omit<BasePopover.Popup.Props, 'className' | 'children' | 'render' | 'title' | 'initialFocus'> {
|
|
22
|
+
/** A heading at the top that names the popover. Without one, name it with `aria-label`. */
|
|
23
|
+
title?: ReactNode;
|
|
24
|
+
open?: boolean;
|
|
25
|
+
defaultOpen?: boolean;
|
|
26
|
+
onOpenChange?: (open: boolean) => void;
|
|
27
|
+
side?: BasePopover.Positioner.Props['side'];
|
|
28
|
+
align?: BasePopover.Positioner.Props['align'];
|
|
29
|
+
/** Also opens while the pointer rests on the trigger. A click or a tap still
|
|
30
|
+
* opens it, so touch and keyboard users reach it too. */
|
|
31
|
+
openOnHover?: boolean;
|
|
32
|
+
/** Where focus goes on opening: the first control in it, the panel itself for
|
|
33
|
+
* a list read before one item in it is picked, or nowhere, for a popover that
|
|
34
|
+
* offers an action on what the reader is doing, such as copying a selection. */
|
|
35
|
+
initialFocus?: 'first-control' | 'popup' | 'none';
|
|
36
|
+
/** `panel` holds controls or a list; `tip` is a tooltip-sized note with an arrow. */
|
|
37
|
+
variant?: 'panel' | 'tip';
|
|
38
|
+
/** On the popup: its width, padding or text size. */
|
|
39
|
+
className?: string;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/** A panel anchored to its trigger, over the page so no container clips it. It
|
|
43
|
+
* flips and shifts to stay on screen, closes on Escape or a press outside, and
|
|
44
|
+
* returns focus to the trigger. Use a Menu for a list of actions, and a
|
|
45
|
+
* HoverCard for a preview a link already leads to. */
|
|
46
|
+
export declare function Popover({ trigger, at, title, open, defaultOpen, onOpenChange, side, align, openOnHover, initialFocus, variant, className, children, ...popupProps }: PopoverProps): import("react").JSX.Element;
|
|
47
|
+
export {};
|