@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,120 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { CloseIcon } from "../icons.js";
|
|
3
|
+
import { pressedToast } from "./Toast.js";
|
|
4
|
+
import { useStrings } from "./Provider.js";
|
|
5
|
+
import { useSplitter } from "./splitter.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
8
|
+
import { Drawer } from "@base-ui/react/drawer";
|
|
9
|
+
//#region src/components/Drawer.tsx
|
|
10
|
+
/** A panel that slides in from an edge over the page. A swipe toward that edge,
|
|
11
|
+
* Escape or a press outside closes it, and focus returns where it was.
|
|
12
|
+
*
|
|
13
|
+
* It leaves the host's fixed chrome uncovered: it starts below
|
|
14
|
+
* `--app-inset-top` (a top bar's height), and at its widest leaves the strip
|
|
15
|
+
* `--app-inset-start` (a start-side sidebar's width, at least 2.5rem). Set both
|
|
16
|
+
* on the document root. */
|
|
17
|
+
function Drawer$1({ open, onClose, title, description, footer, side = "right", width = 480, resizable = false, minWidth = 320, dismissible = true, modal = true, closeButton = true, contained = false, keepMounted = false, padded = true, className, children, ...popupProps }) {
|
|
18
|
+
const { common } = useStrings();
|
|
19
|
+
const container = useRef(null);
|
|
20
|
+
const viewport = useRef(null);
|
|
21
|
+
const [popup, setPopup] = useState(null);
|
|
22
|
+
const [chosen, setChosen] = useState(null);
|
|
23
|
+
const rendered = useRenderedWidth(resizable ? popup : null);
|
|
24
|
+
const splitter = useSplitter({
|
|
25
|
+
width: chosen ?? rendered ?? (typeof width === "number" ? width : minWidth),
|
|
26
|
+
onWidthChange: setChosen,
|
|
27
|
+
min: minWidth,
|
|
28
|
+
max: () => innerWidth(viewport.current),
|
|
29
|
+
side: side === "right" ? "left" : "right"
|
|
30
|
+
});
|
|
31
|
+
const header = title !== void 0 || description !== void 0 || closeButton;
|
|
32
|
+
const area = contained ? "absolute inset-0" : "fixed inset-x-0 bottom-0 top-(--app-inset-top,0px)";
|
|
33
|
+
const onOpenChange = (next, details) => {
|
|
34
|
+
if (next) return;
|
|
35
|
+
if (!dismissible && details.reason === "escape-key" || details.reason === "outside-press" && pressedToast(details.event)) {
|
|
36
|
+
details.cancel();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
onClose();
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ jsxs(Drawer.Root, {
|
|
42
|
+
open,
|
|
43
|
+
onOpenChange,
|
|
44
|
+
swipeDirection: side,
|
|
45
|
+
modal,
|
|
46
|
+
disablePointerDismissal: !dismissible,
|
|
47
|
+
children: [contained && /* @__PURE__ */ jsx("div", {
|
|
48
|
+
ref: container,
|
|
49
|
+
className: "contents"
|
|
50
|
+
}), /* @__PURE__ */ jsxs(Drawer.Portal, {
|
|
51
|
+
...contained ? { container } : {},
|
|
52
|
+
keepMounted,
|
|
53
|
+
className: contained ? "contents" : void 0,
|
|
54
|
+
children: [modal !== false && /* @__PURE__ */ jsx(Drawer.Backdrop, { className: cx(area, "z-(--layer-drawer) bg-black/40 opacity-[calc(1-var(--drawer-swipe-progress))] transition-opacity duration-300 data-ending-style:opacity-0 data-starting-style:opacity-0 data-swiping:duration-0 motion-reduce:transition-none") }), /* @__PURE__ */ jsx(Drawer.Viewport, {
|
|
55
|
+
ref: viewport,
|
|
56
|
+
className: cx(area, "pointer-events-none z-(--layer-drawer) flex", side === "right" ? "justify-end pl-[max(var(--app-inset-start,0px),2.5rem)]" : "justify-start pl-(--app-inset-start,0px) pr-10"),
|
|
57
|
+
children: /* @__PURE__ */ jsxs(Drawer.Popup, {
|
|
58
|
+
...popupProps,
|
|
59
|
+
ref: setPopup,
|
|
60
|
+
className: cx("pointer-events-auto relative flex h-full max-w-full flex-col border-(--theme-border) bg-(--theme-panel-bg) text-(--theme-app) shadow-xl outline-none", side === "right" ? "border-l" : "border-r", "transition-transform duration-300 ease-in-out [transform:translateX(var(--drawer-swipe-movement-x))] data-swiping:select-none data-swiping:duration-0 motion-reduce:transition-none", side === "right" ? "data-ending-style:[transform:translateX(100%)] data-starting-style:[transform:translateX(100%)]" : "data-ending-style:[transform:translateX(-100%)] data-starting-style:[transform:translateX(-100%)]"),
|
|
61
|
+
style: { width: splitter.resizing || chosen !== null ? splitter.width : width },
|
|
62
|
+
children: [resizable && /* @__PURE__ */ jsx("div", {
|
|
63
|
+
...splitter.separatorProps,
|
|
64
|
+
"data-base-ui-swipe-ignore": ""
|
|
65
|
+
}), /* @__PURE__ */ jsxs(Drawer.Content, {
|
|
66
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
67
|
+
children: [
|
|
68
|
+
header && /* @__PURE__ */ jsxs("div", {
|
|
69
|
+
className: "flex shrink-0 items-start gap-3 border-b border-(--theme-border) px-4 py-3",
|
|
70
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
71
|
+
className: "min-w-0 flex-1",
|
|
72
|
+
children: [title !== void 0 && /* @__PURE__ */ jsx(Drawer.Title, {
|
|
73
|
+
className: "truncate text-sm font-semibold",
|
|
74
|
+
children: title
|
|
75
|
+
}), description !== void 0 && /* @__PURE__ */ jsx(Drawer.Description, {
|
|
76
|
+
className: "mt-0.5 text-xs text-(--theme-muted-text-color)",
|
|
77
|
+
children: description
|
|
78
|
+
})]
|
|
79
|
+
}), closeButton && /* @__PURE__ */ jsx(Drawer.Close, {
|
|
80
|
+
"aria-label": common.close,
|
|
81
|
+
className: "-m-1 shrink-0 cursor-pointer rounded-md p-1 text-(--theme-muted-text-color) transition-colors hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app)",
|
|
82
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "h-4 w-4" })
|
|
83
|
+
})]
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: cx("relative flex min-h-0 flex-1 flex-col overflow-y-auto", padded && "p-4", className),
|
|
87
|
+
children
|
|
88
|
+
}),
|
|
89
|
+
footer && /* @__PURE__ */ jsx("div", {
|
|
90
|
+
className: "flex shrink-0 justify-end gap-2 border-t border-(--theme-border) px-4 py-3",
|
|
91
|
+
children: footer
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
})]
|
|
95
|
+
})
|
|
96
|
+
})]
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/** The width an element renders at, which its CSS may hold below the width asked for. */
|
|
101
|
+
function useRenderedWidth(el) {
|
|
102
|
+
const [rendered, setRendered] = useState(null);
|
|
103
|
+
useLayoutEffect(() => {
|
|
104
|
+
if (!el) return;
|
|
105
|
+
const measure = () => setRendered(el.getBoundingClientRect().width || null);
|
|
106
|
+
measure();
|
|
107
|
+
const observer = new ResizeObserver(measure);
|
|
108
|
+
observer.observe(el);
|
|
109
|
+
return () => observer.disconnect();
|
|
110
|
+
}, [el]);
|
|
111
|
+
return rendered;
|
|
112
|
+
}
|
|
113
|
+
/** The room inside the drawer's viewport, past its gutter; unbounded before layout, as in a test. */
|
|
114
|
+
function innerWidth(el) {
|
|
115
|
+
if (!el?.clientWidth) return Number.POSITIVE_INFINITY;
|
|
116
|
+
const style = getComputedStyle(el);
|
|
117
|
+
return el.clientWidth - (Number.parseFloat(style.paddingLeft) || 0) - (Number.parseFloat(style.paddingRight) || 0);
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
export { Drawer$1 as Drawer };
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import type
|
|
2
|
-
interface EmptyStateProps {
|
|
3
|
-
title:
|
|
4
|
-
description?:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface EmptyStateProps {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
/** What to do about it, such as a create button. */
|
|
6
|
+
action?: ReactNode;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/** `panel` stands in for a whole page or list; `bare` sits inside something
|
|
9
|
+
* that already frames it, such as a sidebar, a menu or a dialog. */
|
|
10
|
+
variant?: 'panel' | 'bare' | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
testId?: string | undefined;
|
|
9
13
|
}
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
/** What shows where there is nothing yet, or nothing matches: what's missing,
|
|
15
|
+
* and what to do about it. */
|
|
16
|
+
export declare function EmptyState({ title, description, action, icon, variant, className, testId, }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
//#region src/components/EmptyState.tsx
|
|
3
|
-
|
|
4
|
+
/** What shows where there is nothing yet, or nothing matches: what's missing,
|
|
5
|
+
* and what to do about it. */
|
|
6
|
+
function EmptyState({ title, description, action, icon, variant = "panel", className, testId }) {
|
|
7
|
+
const panel = variant === "panel";
|
|
4
8
|
return /* @__PURE__ */ jsxs("div", {
|
|
5
|
-
|
|
9
|
+
"data-testid": testId,
|
|
10
|
+
className: cx("flex flex-col items-center justify-center text-center", panel ? "panel px-6 py-12" : "px-3 py-6", className),
|
|
6
11
|
children: [
|
|
7
|
-
|
|
8
|
-
className: "
|
|
9
|
-
children:
|
|
12
|
+
icon && /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: "mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-(--theme-muted-panel-bg) theme-muted-text [&_svg]:h-5 [&_svg]:w-5",
|
|
14
|
+
children: icon
|
|
10
15
|
}),
|
|
11
16
|
/* @__PURE__ */ jsx("p", {
|
|
12
|
-
className: "text-sm font-medium
|
|
17
|
+
className: cx("text-sm", panel ? "mb-1 font-medium" : "theme-muted-text"),
|
|
13
18
|
children: title
|
|
14
19
|
}),
|
|
15
20
|
description && /* @__PURE__ */ jsx("p", {
|
|
16
|
-
className: "text-xs theme-muted-text
|
|
21
|
+
className: "max-w-xs text-xs theme-muted-text",
|
|
17
22
|
children: description
|
|
18
23
|
}),
|
|
19
24
|
action && /* @__PURE__ */ jsx("div", {
|
|
@@ -24,4 +29,4 @@ function EmptyState({ title, description, action, icon: Icon }) {
|
|
|
24
29
|
});
|
|
25
30
|
}
|
|
26
31
|
//#endregion
|
|
27
|
-
export { EmptyState
|
|
32
|
+
export { EmptyState };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type ExternalLinkProps = Omit<ComponentPropsWithRef<'a'>, 'target' | 'rel'> & {
|
|
3
|
+
/** Marks the link as leaving the page with an arrow after its text. */
|
|
4
|
+
icon?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/** A link that opens in a new tab, says so to screen readers, and gives the
|
|
7
|
+
* page it opens no hold on this one. */
|
|
8
|
+
export declare function ExternalLink({ children, icon, className, ...props }: ExternalLinkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { ExternalLinkIcon } from "../icons.js";
|
|
3
|
+
import { useStrings } from "./Provider.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/ExternalLink.tsx
|
|
6
|
+
/** A link that opens in a new tab, says so to screen readers, and gives the
|
|
7
|
+
* page it opens no hold on this one. */
|
|
8
|
+
function ExternalLink({ children, icon = false, className, ...props }) {
|
|
9
|
+
const { common } = useStrings();
|
|
10
|
+
return /* @__PURE__ */ jsxs("a", {
|
|
11
|
+
...props,
|
|
12
|
+
target: "_blank",
|
|
13
|
+
rel: "noopener noreferrer",
|
|
14
|
+
className: cx(icon && "inline-flex items-center gap-1", className),
|
|
15
|
+
children: [
|
|
16
|
+
children,
|
|
17
|
+
/* @__PURE__ */ jsxs("span", {
|
|
18
|
+
className: "sr-only",
|
|
19
|
+
children: [" ", common.opensInNewTab]
|
|
20
|
+
}),
|
|
21
|
+
icon && /* @__PURE__ */ jsx(ExternalLinkIcon, {
|
|
22
|
+
className: "h-3 w-3 shrink-0",
|
|
23
|
+
"aria-hidden": true
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { ExternalLink };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** What a field's control takes to be named, described and marked by its field. Spread it
|
|
3
|
+
* on the control: `{(control) => <input {...control} />}`. */
|
|
4
|
+
export interface FieldControlProps {
|
|
5
|
+
id: string;
|
|
6
|
+
/** Set for a group, which its legend names rather than a label. */
|
|
7
|
+
'aria-labelledby'?: string | undefined;
|
|
8
|
+
'aria-describedby'?: string | undefined;
|
|
9
|
+
'aria-invalid'?: true | undefined;
|
|
10
|
+
'aria-required'?: true | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** Set by a layout that lines up the fields in a row, as a form's grid does: a stacked field's
|
|
13
|
+
* label and control take the row's label and control tracks, so controls under labels of
|
|
14
|
+
* different lengths line up. The layout makes the field's box a subgrid of two rows. */
|
|
15
|
+
export declare const FieldRowContext: import("react").Context<boolean>;
|
|
16
|
+
/** The surrounding Field's control props, for a control drawn further down than the Field's
|
|
17
|
+
* own children. Null outside a Field. */
|
|
18
|
+
export declare function useFieldControl(): FieldControlProps | null;
|
|
19
|
+
export type FieldLayout = 'stacked' | 'inline';
|
|
20
|
+
export interface FieldProps {
|
|
21
|
+
label: ReactNode;
|
|
22
|
+
/** Beside the label and outside it, so it stays out of the control's name: an InfoTip, a count. */
|
|
23
|
+
hint?: ReactNode;
|
|
24
|
+
/** Buttons at the far end of the label's row that act on the field, such as one that
|
|
25
|
+
* switches its control to a typed expression. */
|
|
26
|
+
actions?: ReactNode;
|
|
27
|
+
/** Help under the control, read with it. */
|
|
28
|
+
description?: ReactNode;
|
|
29
|
+
/** A message under the control. It also marks the control invalid. */
|
|
30
|
+
error?: ReactNode;
|
|
31
|
+
/** Marks the control invalid without a message, for one shown elsewhere. */
|
|
32
|
+
invalid?: boolean | undefined;
|
|
33
|
+
required?: boolean | undefined;
|
|
34
|
+
disabled?: boolean | undefined;
|
|
35
|
+
/** `stacked` puts the label above the control. `inline` puts it in a column to the left, as a
|
|
36
|
+
* form lays out its fields. */
|
|
37
|
+
layout?: FieldLayout | undefined;
|
|
38
|
+
/** With `inline`, the label takes only its own width rather than the column's. */
|
|
39
|
+
compact?: boolean | undefined;
|
|
40
|
+
/** A set of controls, such as radios or checkboxes, that a legend names instead of a label. */
|
|
41
|
+
group?: boolean | undefined;
|
|
42
|
+
/** The control's id; one is made up when left out. */
|
|
43
|
+
id?: string | undefined;
|
|
44
|
+
className?: string | undefined;
|
|
45
|
+
/** The control, or a function that places the control props on it. A Base UI control, such
|
|
46
|
+
* as Select, Combobox, NumberInput, Checkbox or Switch, needs only the `id`. */
|
|
47
|
+
children: ReactNode | ((control: FieldControlProps) => ReactNode);
|
|
48
|
+
}
|
|
49
|
+
/** An error in the look a Field gives its own, for one under a part of a control rather than
|
|
50
|
+
* the whole of it, such as a row of a list editor. */
|
|
51
|
+
export declare function ErrorText({ children }: {
|
|
52
|
+
children: ReactNode;
|
|
53
|
+
}): import("react").JSX.Element | null;
|
|
54
|
+
/** A control with its label, help and error, tied to it for assistive technology. One frame
|
|
55
|
+
* for every field, in a form or standing alone. */
|
|
56
|
+
export declare function Field({ label, hint, actions, description, error, invalid, required, disabled, layout, compact, group, id: ownId, className, children, }: FieldProps): import("react").JSX.Element;
|
|
57
|
+
/** One checkbox or radio and its label inside a Field, such as an option of a group. A bare
|
|
58
|
+
* `<label>` there would take the Field's label as its own, so every option read as the field. */
|
|
59
|
+
export declare function FieldOption({ disabled, className, children, }: {
|
|
60
|
+
disabled?: boolean | undefined;
|
|
61
|
+
className?: string | undefined;
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
}): import("react").JSX.Element;
|
|
64
|
+
/** The eye button inside a secret's box that shows or hides what was typed. Give the box
|
|
65
|
+
* room for it on the right, such as `pr-9`. */
|
|
66
|
+
export declare function RevealToggle({ revealed, onRevealedChange, disabled, }: {
|
|
67
|
+
revealed: boolean;
|
|
68
|
+
onRevealedChange: (revealed: boolean) => void;
|
|
69
|
+
disabled?: boolean | undefined;
|
|
70
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { EyeIcon, EyeOffIcon, WarningIcon } from "../icons.js";
|
|
3
|
+
import { useStrings } from "./Provider.js";
|
|
4
|
+
import { RequiredMark } from "./RequiredMark.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { createContext, use, useId } from "react";
|
|
7
|
+
import { Field } from "@base-ui/react/field";
|
|
8
|
+
import { Fieldset } from "@base-ui/react/fieldset";
|
|
9
|
+
//#region src/components/Field.tsx
|
|
10
|
+
var ControlContext = createContext(null);
|
|
11
|
+
/** Set by a layout that lines up the fields in a row, as a form's grid does: a stacked field's
|
|
12
|
+
* label and control take the row's label and control tracks, so controls under labels of
|
|
13
|
+
* different lengths line up. The layout makes the field's box a subgrid of two rows. */
|
|
14
|
+
var FieldRowContext = createContext(false);
|
|
15
|
+
/** The surrounding Field's control props, for a control drawn further down than the Field's
|
|
16
|
+
* own children. Null outside a Field. */
|
|
17
|
+
function useFieldControl() {
|
|
18
|
+
return use(ControlContext);
|
|
19
|
+
}
|
|
20
|
+
var labelClassName = "flex items-center gap-1 text-sm font-medium text-(--theme-app)";
|
|
21
|
+
var actionsClassName = "ml-auto flex shrink-0 items-center gap-1";
|
|
22
|
+
var errorTextClassName = "flex items-center gap-1.5 text-xs text-(--theme-error)";
|
|
23
|
+
/** An error in the look a Field gives its own, for one under a part of a control rather than
|
|
24
|
+
* the whole of it, such as a row of a list editor. */
|
|
25
|
+
function ErrorText({ children }) {
|
|
26
|
+
return children ? /* @__PURE__ */ jsxs("div", {
|
|
27
|
+
role: "alert",
|
|
28
|
+
className: errorTextClassName,
|
|
29
|
+
children: [/* @__PURE__ */ jsx(WarningIcon, {
|
|
30
|
+
"aria-hidden": "true",
|
|
31
|
+
className: "size-3.5 shrink-0"
|
|
32
|
+
}), children]
|
|
33
|
+
}) : null;
|
|
34
|
+
}
|
|
35
|
+
/** A control with its label, help and error, tied to it for assistive technology. One frame
|
|
36
|
+
* for every field, in a form or standing alone. */
|
|
37
|
+
function Field$1({ label, hint, actions, description, error, invalid, required = false, disabled = false, layout = "stacked", compact = false, group = false, id: ownId, className, children }) {
|
|
38
|
+
const uid = useId();
|
|
39
|
+
const id = ownId ?? `${uid}control`;
|
|
40
|
+
const labelId = `${uid}label`;
|
|
41
|
+
const descriptionId = description ? `${uid}description` : void 0;
|
|
42
|
+
const errorId = error ? `${uid}error` : void 0;
|
|
43
|
+
const isInvalid = Boolean(error) || Boolean(invalid);
|
|
44
|
+
const describedBy = [descriptionId, errorId].filter(Boolean).join(" ");
|
|
45
|
+
const control = {
|
|
46
|
+
id,
|
|
47
|
+
...group && { "aria-labelledby": labelId },
|
|
48
|
+
...describedBy && { "aria-describedby": describedBy },
|
|
49
|
+
...isInvalid && { "aria-invalid": true },
|
|
50
|
+
...required && { "aria-required": true }
|
|
51
|
+
};
|
|
52
|
+
const inline = layout === "inline";
|
|
53
|
+
const inRow = use(FieldRowContext) && !inline && !group;
|
|
54
|
+
const labelBox = cx(labelClassName, inline && cx("min-h-9 shrink-0", compact ? "mr-2 w-fit" : "w-52 pr-3"), inRow && "row-start-1 self-end");
|
|
55
|
+
const labelContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("span", { children: [label, required && /* @__PURE__ */ jsx(RequiredMark, {})] }),
|
|
57
|
+
hint,
|
|
58
|
+
actions && /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: actionsClassName,
|
|
60
|
+
children: actions
|
|
61
|
+
})
|
|
62
|
+
] });
|
|
63
|
+
const body = /* @__PURE__ */ jsxs("div", {
|
|
64
|
+
className: cx("flex w-full min-w-0 flex-col gap-1", inRow && "row-start-2"),
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx(FieldRowContext, {
|
|
67
|
+
value: false,
|
|
68
|
+
children: /* @__PURE__ */ jsx(ControlContext, {
|
|
69
|
+
value: control,
|
|
70
|
+
children: typeof children === "function" ? children(control) : children
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
description && /* @__PURE__ */ jsx(Field.Description, {
|
|
74
|
+
id: descriptionId,
|
|
75
|
+
className: "text-xs leading-relaxed text-(--theme-muted-text-color)",
|
|
76
|
+
children: description
|
|
77
|
+
}),
|
|
78
|
+
error && /* @__PURE__ */ jsxs(Field.Error, {
|
|
79
|
+
id: errorId,
|
|
80
|
+
match: true,
|
|
81
|
+
role: "alert",
|
|
82
|
+
className: errorTextClassName,
|
|
83
|
+
children: [/* @__PURE__ */ jsx(WarningIcon, {
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
className: "size-3.5 shrink-0"
|
|
86
|
+
}), error]
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
const frame = inRow ? cx("contents", className) : cx("flex w-full", inline ? "items-start" : "flex-col gap-1.5", className);
|
|
91
|
+
if (group) return /* @__PURE__ */ jsx(Field.Root, {
|
|
92
|
+
invalid: isInvalid,
|
|
93
|
+
disabled,
|
|
94
|
+
render: /* @__PURE__ */ jsx(Fieldset.Root, {
|
|
95
|
+
"aria-describedby": control["aria-describedby"],
|
|
96
|
+
"aria-invalid": control["aria-invalid"]
|
|
97
|
+
}),
|
|
98
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
99
|
+
className: frame,
|
|
100
|
+
children: [/* @__PURE__ */ jsx(Fieldset.Legend, {
|
|
101
|
+
id: labelId,
|
|
102
|
+
className: labelBox,
|
|
103
|
+
children: labelContent
|
|
104
|
+
}), body]
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
return /* @__PURE__ */ jsxs(Field.Root, {
|
|
108
|
+
invalid: isInvalid,
|
|
109
|
+
disabled,
|
|
110
|
+
className: frame,
|
|
111
|
+
"data-field-row": inRow || void 0,
|
|
112
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
113
|
+
className: labelBox,
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsxs(Field.Label, {
|
|
116
|
+
htmlFor: id,
|
|
117
|
+
id: labelId,
|
|
118
|
+
"data-field-label": true,
|
|
119
|
+
children: [label, required && /* @__PURE__ */ jsx(RequiredMark, {})]
|
|
120
|
+
}),
|
|
121
|
+
hint,
|
|
122
|
+
actions && /* @__PURE__ */ jsx("span", {
|
|
123
|
+
className: actionsClassName,
|
|
124
|
+
children: actions
|
|
125
|
+
})
|
|
126
|
+
]
|
|
127
|
+
}), body]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/** One checkbox or radio and its label inside a Field, such as an option of a group. A bare
|
|
131
|
+
* `<label>` there would take the Field's label as its own, so every option read as the field. */
|
|
132
|
+
function FieldOption({ disabled, className, children }) {
|
|
133
|
+
return /* @__PURE__ */ jsx(Field.Item, {
|
|
134
|
+
disabled,
|
|
135
|
+
render: /* @__PURE__ */ jsx("label", {}),
|
|
136
|
+
className: cx(disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer", className),
|
|
137
|
+
children
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/** The eye button inside a secret's box that shows or hides what was typed. Give the box
|
|
141
|
+
* room for it on the right, such as `pr-9`. */
|
|
142
|
+
function RevealToggle({ revealed, onRevealedChange, disabled }) {
|
|
143
|
+
const { common: t } = useStrings();
|
|
144
|
+
const Icon = revealed ? EyeOffIcon : EyeIcon;
|
|
145
|
+
return /* @__PURE__ */ jsx("button", {
|
|
146
|
+
type: "button",
|
|
147
|
+
"aria-label": revealed ? t.hideValue : t.showValue,
|
|
148
|
+
"aria-pressed": revealed,
|
|
149
|
+
disabled,
|
|
150
|
+
onClick: () => onRevealedChange(!revealed),
|
|
151
|
+
className: "absolute inset-y-0 right-0 flex w-9 cursor-pointer items-center justify-center text-(--theme-muted-text-color) hover:text-(--theme-app) disabled:cursor-not-allowed disabled:opacity-50",
|
|
152
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
153
|
+
"aria-hidden": "true",
|
|
154
|
+
className: "size-4"
|
|
155
|
+
})
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
export { ErrorText, Field$1 as Field, FieldOption, FieldRowContext, RevealToggle, useFieldControl };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { cardClassName,
|
|
1
|
+
import { cardClassName, positionerClassName } from "./floating.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { PreviewCard } from "@base-ui/react/preview-card";
|
|
4
4
|
//#region src/components/HoverCard.tsx
|
|
@@ -13,20 +13,17 @@ function HoverCard({ card, children, defaultOpen = false }) {
|
|
|
13
13
|
delay: 350,
|
|
14
14
|
closeDelay: 150,
|
|
15
15
|
render: children
|
|
16
|
-
}), /* @__PURE__ */ jsx(PreviewCard.Portal, {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
className:
|
|
24
|
-
children:
|
|
25
|
-
className: cardClassName,
|
|
26
|
-
children: card
|
|
27
|
-
})
|
|
16
|
+
}), /* @__PURE__ */ jsx(PreviewCard.Portal, { children: /* @__PURE__ */ jsx(PreviewCard.Positioner, {
|
|
17
|
+
side: "bottom",
|
|
18
|
+
align: "start",
|
|
19
|
+
sideOffset: 8,
|
|
20
|
+
collisionPadding: 8,
|
|
21
|
+
className: positionerClassName,
|
|
22
|
+
children: /* @__PURE__ */ jsx(PreviewCard.Popup, {
|
|
23
|
+
className: cardClassName,
|
|
24
|
+
children: card
|
|
28
25
|
})
|
|
29
|
-
})]
|
|
26
|
+
}) })]
|
|
30
27
|
});
|
|
31
28
|
}
|
|
32
29
|
//#endregion
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
|
+
import { type ButtonSize, type ButtonVariant } from './buttonClasses.js';
|
|
3
|
+
export interface IconButtonProps extends ComponentPropsWithRef<'button'> {
|
|
4
4
|
icon: ReactNode;
|
|
5
5
|
/** The accessible name, also shown as the tooltip. */
|
|
6
6
|
label: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
/** A toggle's state: set, it reads as pressed (`aria-pressed`). */
|
|
10
|
+
pressed?: boolean | undefined;
|
|
11
|
+
/** A dot in the corner, such as for filters narrowing what the page shows. */
|
|
12
|
+
dot?: boolean;
|
|
13
|
+
/** A single key, such as F, that presses the button from anywhere on the page
|
|
14
|
+
* outside a text field. Also shown in the tooltip. */
|
|
15
|
+
shortcut?: string | undefined;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
/** A button that shows only an icon, named by its tooltip. It can be a popup's
|
|
18
|
+
* trigger: it passes the trigger's props and ref on, and hides its tooltip while
|
|
19
|
+
* the popup is open. */
|
|
20
|
+
export declare function IconButton({ icon, label, variant, size, pressed, dot, shortcut, className, ref, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
@@ -1,28 +1,37 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { buttonClasses } from "./buttonClasses.js";
|
|
1
3
|
import { Tooltip } from "./Tooltip.js";
|
|
2
|
-
import {
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useShortcutKey } from "./shortcutKey.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useCallback, useRef } from "react";
|
|
4
7
|
//#region src/components/IconButton.tsx
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
8
|
+
/** A button that shows only an icon, named by its tooltip. It can be a popup's
|
|
9
|
+
* trigger: it passes the trigger's props and ref on, and hides its tooltip while
|
|
10
|
+
* the popup is open. */
|
|
11
|
+
function IconButton({ icon, label, variant = "ghost", size = "sm", pressed, dot = false, shortcut, className, ref, ...props }) {
|
|
12
|
+
const button = useRef(null);
|
|
13
|
+
const setButton = useCallback((node) => {
|
|
14
|
+
button.current = node;
|
|
15
|
+
if (typeof ref === "function") ref(node);
|
|
16
|
+
else if (ref) ref.current = node;
|
|
17
|
+
}, [ref]);
|
|
18
|
+
useShortcutKey(shortcut, () => button.current?.click());
|
|
17
19
|
return /* @__PURE__ */ jsx(Tooltip, {
|
|
18
20
|
content: label,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
shortcut: shortcut?.toUpperCase(),
|
|
22
|
+
disabled: props["aria-expanded"] === true && !!props["aria-haspopup"],
|
|
23
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
21
24
|
type: "button",
|
|
22
25
|
"aria-label": label,
|
|
23
|
-
|
|
26
|
+
"aria-pressed": pressed,
|
|
27
|
+
ref: setButton,
|
|
28
|
+
className: cx(buttonClasses({
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
iconOnly: true
|
|
32
|
+
}), className),
|
|
24
33
|
...props,
|
|
25
|
-
children: icon
|
|
34
|
+
children: [icon, dot && /* @__PURE__ */ jsx("span", { className: "absolute right-0 top-0 h-1.5 w-1.5 rounded-full bg-(--theme-link)" })]
|
|
26
35
|
})
|
|
27
36
|
});
|
|
28
37
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { HelpIcon } from "../icons.js";
|
|
3
3
|
import { keyedByContent } from "./keys.js";
|
|
4
4
|
import { useStrings } from "./Provider.js";
|
|
5
|
-
import {
|
|
5
|
+
import { ExternalLink } from "./ExternalLink.js";
|
|
6
|
+
import { Popover } from "./Popover.js";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { Fragment as Fragment$1 } from "react";
|
|
8
|
-
import { Popover } from "@base-ui/react/popover";
|
|
9
9
|
//#region src/components/InfoTip.tsx
|
|
10
10
|
var linkRegex = /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g;
|
|
11
11
|
function formatLine(line) {
|
|
@@ -13,10 +13,8 @@ function formatLine(line) {
|
|
|
13
13
|
let last = 0;
|
|
14
14
|
for (const match of line.matchAll(linkRegex)) {
|
|
15
15
|
if (match.index > last) nodes.push(line.slice(last, match.index));
|
|
16
|
-
nodes.push(/* @__PURE__ */ jsx(
|
|
16
|
+
nodes.push(/* @__PURE__ */ jsx(ExternalLink, {
|
|
17
17
|
href: match[2],
|
|
18
|
-
target: "_blank",
|
|
19
|
-
rel: "noopener noreferrer",
|
|
20
18
|
className: "underline",
|
|
21
19
|
children: match[1]
|
|
22
20
|
}, match.index));
|
|
@@ -38,23 +36,18 @@ function InfoTip({ text, side = "top", className, children }) {
|
|
|
38
36
|
className,
|
|
39
37
|
children
|
|
40
38
|
}) : null;
|
|
41
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ jsx(Popover, {
|
|
40
|
+
variant: "tip",
|
|
42
41
|
openOnHover: true,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
children: /* @__PURE__ */ jsxs(Popover.Popup, {
|
|
53
|
-
className: clsx("max-w-sm text-left", tipClassName),
|
|
54
|
-
children: [/* @__PURE__ */ jsx(Popover.Arrow, { className: tipArrowClassName }), formatInfoTipContent(text)]
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
})] });
|
|
42
|
+
side,
|
|
43
|
+
trigger: /* @__PURE__ */ jsx("button", {
|
|
44
|
+
type: "button",
|
|
45
|
+
"aria-label": children ? void 0 : t.moreInfo,
|
|
46
|
+
className: cx("inline-flex items-center cursor-help", !children && "tooltip", className),
|
|
47
|
+
children: children ?? /* @__PURE__ */ jsx(HelpIcon, { "aria-hidden": "true" })
|
|
48
|
+
}),
|
|
49
|
+
children: formatInfoTipContent(text)
|
|
50
|
+
});
|
|
58
51
|
}
|
|
59
52
|
//#endregion
|
|
60
53
|
export { InfoTip, formatInfoTipContent };
|