@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
|
@@ -1,31 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/SettingsCard.tsx
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
* cards; the rows inside provide their own dividers via SettingRow's `isFirst`.
|
|
8
|
-
*/
|
|
9
|
-
function SettingsCard({ title, description, action, actionAlign = "adjacent", overflowVisible, children, className }) {
|
|
4
|
+
/** A page's settings, grouped: a titled panel of SettingRows, each ruled off from
|
|
5
|
+
* the next. Cards stack with room between them. */
|
|
6
|
+
function SettingsCard({ title, description, action, actionAlign = "beside", overflowVisible = false, className, children }) {
|
|
10
7
|
return /* @__PURE__ */ jsxs("section", {
|
|
11
|
-
className:
|
|
8
|
+
className: cx("mt-10 first:mt-0", className),
|
|
12
9
|
children: [(title || action) && /* @__PURE__ */ jsxs("div", {
|
|
13
10
|
className: "mb-3 px-0.5",
|
|
14
11
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
15
|
-
className:
|
|
12
|
+
className: cx("flex items-center gap-1.5", actionAlign === "end" && "justify-between"),
|
|
16
13
|
children: [title && /* @__PURE__ */ jsx("h2", {
|
|
17
|
-
className: "text-[15px] font-semibold theme-text
|
|
14
|
+
className: "text-[15px] leading-none font-semibold theme-text",
|
|
18
15
|
children: title
|
|
19
16
|
}), action]
|
|
20
17
|
}), description && /* @__PURE__ */ jsx("p", {
|
|
21
|
-
className: "text-xs theme-muted-text
|
|
18
|
+
className: "mt-1.5 text-xs leading-snug theme-muted-text",
|
|
22
19
|
children: description
|
|
23
20
|
})]
|
|
24
21
|
}), /* @__PURE__ */ jsx("div", {
|
|
25
|
-
className:
|
|
22
|
+
className: cx("panel divide-y divide-(--theme-border)", overflowVisible ? "overflow-visible" : "overflow-hidden"),
|
|
23
|
+
children
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** A heading between groups of rows inside a SettingsCard. */
|
|
28
|
+
function SettingsHeading({ children }) {
|
|
29
|
+
return /* @__PURE__ */ jsx("h3", {
|
|
30
|
+
className: "px-5 py-3 text-sm font-semibold tracking-wider uppercase theme-muted-panel theme-muted-text",
|
|
31
|
+
children
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/** One setting in a SettingsCard: its name and help on the left, its control on
|
|
35
|
+
* the right, or under the name across the row with `fill`. */
|
|
36
|
+
function SettingRow({ label, htmlFor, helpText, fill = false, onClick, children }) {
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
38
|
+
role: "none",
|
|
39
|
+
onClick,
|
|
40
|
+
className: cx("grid grid-cols-1 gap-x-8 gap-y-2 px-5 py-5", fill ? "md:grid-cols-[200px_1fr]" : "md:grid-cols-[1fr_auto]", onClick && "cursor-pointer transition-colors select-none hover:theme-hover"),
|
|
41
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
42
|
+
className: "flex flex-col gap-y-1",
|
|
43
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
44
|
+
htmlFor,
|
|
45
|
+
className: "leading-tight font-semibold theme-text",
|
|
46
|
+
children: label
|
|
47
|
+
}), helpText && /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: "text-xs leading-snug theme-muted-text",
|
|
49
|
+
children: helpText
|
|
50
|
+
})]
|
|
51
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: cx("min-w-0", !fill && "flex items-center justify-end"),
|
|
26
53
|
children
|
|
27
54
|
})]
|
|
28
55
|
});
|
|
29
56
|
}
|
|
30
57
|
//#endregion
|
|
31
|
-
export { SettingsCard
|
|
58
|
+
export { SettingRow, SettingsCard, SettingsHeading };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface SkeletonProps {
|
|
3
|
+
/** Any CSS length, or pixels. Defaults to the container's width. */
|
|
4
|
+
width?: number | string | undefined;
|
|
5
|
+
/** Any CSS length, or pixels. Defaults to a line of text. */
|
|
6
|
+
height?: number | string | undefined;
|
|
7
|
+
circle?: boolean | undefined;
|
|
8
|
+
/** Lines of the same shape, one under another; space them with `className`. */
|
|
9
|
+
count?: number | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/** The shape of content still loading. Hidden from assistive technology, so
|
|
13
|
+
* wrap a page's skeletons in one `LoadingRegion` that says they are loading. */
|
|
14
|
+
export declare function Skeleton({ width, height, circle, count, className }: SkeletonProps): import("react").JSX.Element[];
|
|
15
|
+
/** Says, once, that what it holds is still loading, for skeletons or a chart
|
|
16
|
+
* drawing its first data. */
|
|
17
|
+
export declare function LoadingRegion({ label, className, children, }: {
|
|
18
|
+
/** Defaults to the provider's `loading` string. */
|
|
19
|
+
label?: string | undefined;
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { positionKeys } from "./keys.js";
|
|
3
|
+
import { useStrings } from "./Provider.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Skeleton.tsx
|
|
6
|
+
/** The shape of content still loading. Hidden from assistive technology, so
|
|
7
|
+
* wrap a page's skeletons in one `LoadingRegion` that says they are loading. */
|
|
8
|
+
function Skeleton({ width, height, circle, count = 1, className }) {
|
|
9
|
+
return positionKeys(count, "skeleton").map((key) => /* @__PURE__ */ jsx("span", {
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
className: cx("block animate-pulse bg-(--theme-muted-panel-bg) motion-reduce:animate-none", circle ? "rounded-full" : "rounded", height === void 0 && "h-[1em]", className),
|
|
12
|
+
style: {
|
|
13
|
+
width: width ?? (circle ? height : void 0),
|
|
14
|
+
height
|
|
15
|
+
}
|
|
16
|
+
}, key));
|
|
17
|
+
}
|
|
18
|
+
/** Says, once, that what it holds is still loading, for skeletons or a chart
|
|
19
|
+
* drawing its first data. */
|
|
20
|
+
function LoadingRegion({ label, className, children }) {
|
|
21
|
+
const { loading } = useStrings().common;
|
|
22
|
+
const name = label || loading;
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
role: "status",
|
|
25
|
+
"aria-label": name,
|
|
26
|
+
className,
|
|
27
|
+
children: [children, /* @__PURE__ */ jsx("span", {
|
|
28
|
+
className: "sr-only",
|
|
29
|
+
children: name
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { LoadingRegion, Skeleton };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface SliderProps {
|
|
2
|
+
value: number;
|
|
3
|
+
onValueChange: (value: number) => void;
|
|
4
|
+
min: number;
|
|
5
|
+
max: number;
|
|
6
|
+
step?: number | undefined;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
/** How the value reads to assistive technology, as Intl formats numbers. */
|
|
9
|
+
format?: Intl.NumberFormatOptions | undefined;
|
|
10
|
+
/** The thumb's name; a slider beside a field's own box shares the field's label. */
|
|
11
|
+
'aria-label'?: string | undefined;
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
/** A number picked by dragging along a range, or with the arrow keys. Pair it with a
|
|
15
|
+
* NumberInput when the exact value matters. */
|
|
16
|
+
export declare function Slider({ value, onValueChange, min, max, step, disabled, format, 'aria-label': ariaLabel, className, }: SliderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Slider } from "@base-ui/react/slider";
|
|
4
|
+
//#region src/components/Slider.tsx
|
|
5
|
+
/** A number picked by dragging along a range, or with the arrow keys. Pair it with a
|
|
6
|
+
* NumberInput when the exact value matters. */
|
|
7
|
+
function Slider$1({ value, onValueChange, min, max, step = 1, disabled = false, format, "aria-label": ariaLabel, className }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Slider.Root, {
|
|
9
|
+
value,
|
|
10
|
+
onValueChange: (next) => onValueChange(Array.isArray(next) ? next[0] ?? min : next),
|
|
11
|
+
min,
|
|
12
|
+
max,
|
|
13
|
+
step,
|
|
14
|
+
disabled,
|
|
15
|
+
format,
|
|
16
|
+
className: cx("w-full", className),
|
|
17
|
+
children: /* @__PURE__ */ jsx(Slider.Control, {
|
|
18
|
+
className: "flex w-full touch-none select-none items-center py-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
19
|
+
children: /* @__PURE__ */ jsxs(Slider.Track, {
|
|
20
|
+
className: "h-1 w-full rounded-full bg-(--theme-border)",
|
|
21
|
+
children: [/* @__PURE__ */ jsx(Slider.Indicator, { className: "rounded-full bg-(--theme-accent)" }), /* @__PURE__ */ jsx(Slider.Thumb, {
|
|
22
|
+
"aria-label": ariaLabel,
|
|
23
|
+
className: "size-4 rounded-full border-2 border-(--theme-accent) bg-(--theme-panel-bg) shadow-sm outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-(--theme-focus-ring)"
|
|
24
|
+
})]
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { Slider$1 as Slider };
|
package/dist/components/Sort.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TiArrowSortedUp } from "../icons/ti/TiArrowSortedUp.js";
|
|
3
|
-
import { TiArrowUnsorted } from "../icons/ti/TiArrowUnsorted.js";
|
|
1
|
+
import { SortDownIcon, SortUnsortedIcon, SortUpIcon } from "../icons.js";
|
|
4
2
|
import { useStrings } from "./Provider.js";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
6
4
|
//#region src/components/Sort.tsx
|
|
7
5
|
var SortIcon = ({ currentlySorted, currentDirection, name }) => {
|
|
8
6
|
const style = { transform: "translateY(2px)" };
|
|
9
7
|
if (currentlySorted === name) {
|
|
10
|
-
if (currentDirection === "ascending") return /* @__PURE__ */ jsx(
|
|
11
|
-
else if (currentDirection === "descending") return /* @__PURE__ */ jsx(
|
|
12
|
-
} else return /* @__PURE__ */ jsx(
|
|
8
|
+
if (currentDirection === "ascending") return /* @__PURE__ */ jsx(SortDownIcon, { style });
|
|
9
|
+
else if (currentDirection === "descending") return /* @__PURE__ */ jsx(SortUpIcon, { style });
|
|
10
|
+
} else return /* @__PURE__ */ jsx(SortUnsortedIcon, { style });
|
|
13
11
|
return null;
|
|
14
12
|
};
|
|
15
13
|
function Sort({ currentlySorted, name, setCurrentDirection, setCurrentlySorted, currentDirection }) {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { type Tone } from './tone.js';
|
|
3
|
+
/** A badge's tone. */
|
|
4
|
+
export type BadgeVariant = Tone;
|
|
3
5
|
interface StatusBadgeProps {
|
|
4
6
|
/** Badge content */
|
|
5
7
|
children: ReactNode;
|
|
@@ -1,57 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { toneFill, toneSurface, toneText } from "./tone.js";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/StatusBadge.tsx
|
|
4
|
-
var variantStyles = {
|
|
5
|
-
default: "bg-(--theme-muted-panel-bg) text-(--theme-app) border-(--theme-border)",
|
|
6
|
-
success: "bg-emerald-500/10 text-emerald-800 dark:text-emerald-400 border-emerald-500/20",
|
|
7
|
-
warning: "bg-amber-500/10 text-amber-800 dark:text-amber-400 border-amber-500/20",
|
|
8
|
-
error: "bg-red-500/10 text-red-800 dark:text-red-400 border-red-500/20",
|
|
9
|
-
info: "bg-blue-500/10 text-blue-800 dark:text-blue-400 border-blue-500/20",
|
|
10
|
-
muted: "bg-(--theme-muted-panel-bg)/50 text-(--theme-muted-text-color) border-(--theme-border)"
|
|
11
|
-
};
|
|
12
|
-
var pulseColors = {
|
|
13
|
-
default: "bg-(--theme-app)",
|
|
14
|
-
success: "bg-emerald-500",
|
|
15
|
-
warning: "bg-amber-500",
|
|
16
|
-
error: "bg-red-500",
|
|
17
|
-
info: "bg-blue-500",
|
|
18
|
-
muted: "bg-(--theme-muted-text-color)"
|
|
19
|
-
};
|
|
20
|
-
var textColors = {
|
|
21
|
-
default: "text-(--theme-app)",
|
|
22
|
-
success: "text-emerald-600 dark:text-emerald-400",
|
|
23
|
-
warning: "text-amber-600 dark:text-amber-400",
|
|
24
|
-
error: "text-red-600 dark:text-red-400",
|
|
25
|
-
info: "text-blue-600 dark:text-blue-400",
|
|
26
|
-
muted: "text-(--theme-muted-text-color)"
|
|
27
|
-
};
|
|
28
5
|
/** A line of text in a variant's colour, for a status that stands beside a
|
|
29
6
|
* dot rather than inside a badge. */
|
|
30
7
|
function statusTextClass(variant) {
|
|
31
|
-
return
|
|
8
|
+
return toneText[variant];
|
|
32
9
|
}
|
|
33
10
|
function StatusBadge({ children, variant = "default", pulse = false, dot = false, size = "sm", className }) {
|
|
34
11
|
return /* @__PURE__ */ jsxs("span", {
|
|
35
|
-
className:
|
|
12
|
+
className: cx("inline-flex items-center gap-1.5 rounded-full border font-medium", size === "sm" && "px-2 py-0.5 text-[10px]", size === "md" && "px-2.5 py-1 text-xs", toneSurface[variant], className),
|
|
36
13
|
children: [
|
|
37
14
|
pulse && /* @__PURE__ */ jsxs("span", {
|
|
38
15
|
className: "relative flex h-2 w-2",
|
|
39
|
-
children: [/* @__PURE__ */ jsx("span", { className:
|
|
16
|
+
children: [/* @__PURE__ */ jsx("span", { className: cx("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75", toneFill[variant]) }), /* @__PURE__ */ jsx("span", { className: cx("relative inline-flex h-2 w-2 rounded-full", toneFill[variant]) })]
|
|
40
17
|
}),
|
|
41
|
-
dot && !pulse && /* @__PURE__ */ jsx("span", { className:
|
|
18
|
+
dot && !pulse && /* @__PURE__ */ jsx("span", { className: cx("inline-flex h-1.5 w-1.5 rounded-full", toneFill[variant]) }),
|
|
42
19
|
children
|
|
43
20
|
]
|
|
44
21
|
});
|
|
45
22
|
}
|
|
46
23
|
function StatusDot({ variant = "default", pulse = false, size = 8, className }) {
|
|
47
24
|
return /* @__PURE__ */ jsxs("span", {
|
|
48
|
-
className:
|
|
25
|
+
className: cx("relative inline-flex", className),
|
|
49
26
|
style: {
|
|
50
27
|
width: size,
|
|
51
28
|
height: size
|
|
52
29
|
},
|
|
53
|
-
children: [pulse && /* @__PURE__ */ jsx("span", { className:
|
|
54
|
-
className:
|
|
30
|
+
children: [pulse && /* @__PURE__ */ jsx("span", { className: cx("absolute inline-flex h-full w-full animate-ping rounded-full opacity-75", toneFill[variant]) }), /* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: cx("relative inline-flex rounded-full", toneFill[variant]),
|
|
55
32
|
style: {
|
|
56
33
|
width: size,
|
|
57
34
|
height: size
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import type { IconBaseProps } from 'react-icons';
|
|
2
1
|
interface IBaseCheckmarkProps {
|
|
3
2
|
className?: string;
|
|
4
3
|
colored?: boolean;
|
|
5
4
|
}
|
|
6
5
|
export declare function SuccessCheckmark({ className, colored }: IBaseCheckmarkProps): import("react").JSX.Element;
|
|
7
6
|
export declare function ErrorCheckmark({ className, colored }: IBaseCheckmarkProps): import("react").JSX.Element;
|
|
8
|
-
export declare function LoaderIcon({ className, ...props }: IconBaseProps & {
|
|
9
|
-
className?: string;
|
|
10
|
-
}): import("react").JSX.Element;
|
|
11
7
|
export {};
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { FaCircleNotch } from "../icons/fa/FaCircleNotch.js";
|
|
4
|
-
import { clsx } from "clsx";
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { ErrorIcon, SuccessIcon } from "../icons.js";
|
|
5
3
|
import { jsx } from "react/jsx-runtime";
|
|
6
4
|
//#region src/components/StatusIcons.tsx
|
|
7
5
|
function SuccessCheckmark({ className, colored = true }) {
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
6
|
+
return /* @__PURE__ */ jsx(SuccessIcon, { className: cx(colored && "text-green-500", className) });
|
|
9
7
|
}
|
|
10
8
|
function ErrorCheckmark({ className, colored = true }) {
|
|
11
|
-
return /* @__PURE__ */ jsx(
|
|
12
|
-
}
|
|
13
|
-
function LoaderIcon({ className, ...props }) {
|
|
14
|
-
return /* @__PURE__ */ jsx(FaCircleNotch, {
|
|
15
|
-
className: clsx("animate-spin", className),
|
|
16
|
-
...props
|
|
17
|
-
});
|
|
9
|
+
return /* @__PURE__ */ jsx(ErrorIcon, { className: cx(colored && "text-red-400", className) });
|
|
18
10
|
}
|
|
19
11
|
//#endregion
|
|
20
|
-
export { ErrorCheckmark,
|
|
12
|
+
export { ErrorCheckmark, SuccessCheckmark };
|
|
@@ -12,11 +12,15 @@ declare const sizes: {
|
|
|
12
12
|
export interface SwitchProps extends Omit<BaseSwitch.Root.Props, 'className' | 'children'> {
|
|
13
13
|
size?: keyof typeof sizes;
|
|
14
14
|
className?: string | undefined;
|
|
15
|
+
/** The on state's own name, such as "Enabled", shown beside the switch while it's on. */
|
|
16
|
+
onLabel?: string | undefined;
|
|
17
|
+
/** The off state's own name, shown beside the switch while it's off. */
|
|
18
|
+
offLabel?: string | undefined;
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
17
21
|
* An on/off control. Name it with an enclosing `<label>`, or `aria-label`. A
|
|
18
22
|
* sibling `<label htmlFor>` needs `nativeButton render={<button />}`, which
|
|
19
23
|
* puts the id on the button the label points at.
|
|
20
24
|
*/
|
|
21
|
-
export declare function Switch({ size, className, ...props }: SwitchProps): import("react").JSX.Element;
|
|
25
|
+
export declare function Switch({ size, className, onLabel, offLabel, ...props }: SwitchProps): import("react").JSX.Element;
|
|
22
26
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Switch } from "@base-ui/react/switch";
|
|
4
4
|
//#region src/components/Switch.tsx
|
|
5
5
|
var sizes = {
|
|
@@ -17,11 +17,28 @@ var sizes = {
|
|
|
17
17
|
* sibling `<label htmlFor>` needs `nativeButton render={<button />}`, which
|
|
18
18
|
* puts the id on the button the label points at.
|
|
19
19
|
*/
|
|
20
|
-
function Switch$1({ size = "md", className, ...props }) {
|
|
21
|
-
|
|
20
|
+
function Switch$1({ size = "md", className, onLabel, offLabel, ...props }) {
|
|
21
|
+
const control = /* @__PURE__ */ jsx(Switch.Root, {
|
|
22
22
|
...props,
|
|
23
|
-
className:
|
|
24
|
-
children: /* @__PURE__ */ jsx(Switch.Thumb, { className:
|
|
23
|
+
className: cx("peer inline-flex shrink-0 items-center rounded-full p-0.5 bg-(--theme-border) transition-colors duration-200 cursor-pointer outline-none", "data-checked:bg-(--theme-accent)", "focus-visible:ring-2 focus-visible:ring-(--theme-focus-ring) aria-invalid:ring-2 aria-invalid:ring-(--theme-error)", "data-disabled:cursor-not-allowed data-disabled:opacity-50", sizes[size].root, className),
|
|
24
|
+
children: /* @__PURE__ */ jsx(Switch.Thumb, { className: cx("rounded-full bg-white shadow-sm transition-transform duration-200", sizes[size].thumb) })
|
|
25
|
+
});
|
|
26
|
+
if (onLabel === void 0 && offLabel === void 0) return control;
|
|
27
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
28
|
+
className: "inline-flex items-center gap-2 text-sm text-(--theme-app)",
|
|
29
|
+
children: [
|
|
30
|
+
control,
|
|
31
|
+
/* @__PURE__ */ jsx("span", {
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
className: "peer-data-checked:hidden",
|
|
34
|
+
children: offLabel
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ jsx("span", {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: "hidden peer-data-checked:inline",
|
|
39
|
+
children: onLabel
|
|
40
|
+
})
|
|
41
|
+
]
|
|
25
42
|
});
|
|
26
43
|
}
|
|
27
44
|
//#endregion
|
package/dist/components/Table.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import Loader from "./Loader.js";
|
|
3
|
-
import { clsx } from "clsx";
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { Loader } from "./Loader.js";
|
|
4
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import React from "react";
|
|
6
5
|
//#region src/components/Table.tsx
|
|
@@ -10,7 +9,7 @@ function Item({ wrap = false, children, className, colspan = 1, ...tdProps }) {
|
|
|
10
9
|
return /* @__PURE__ */ jsx("td", {
|
|
11
10
|
...tdProps,
|
|
12
11
|
colSpan: colspan,
|
|
13
|
-
className:
|
|
12
|
+
className: cx(yPadding, xPadding, wrap ? "" : "whitespace-nowrap", className),
|
|
14
13
|
children
|
|
15
14
|
});
|
|
16
15
|
}
|
|
@@ -18,7 +17,7 @@ function CompactItem({ wrap = false, children, className, colspan = 1, ...tdProp
|
|
|
18
17
|
return /* @__PURE__ */ jsx("td", {
|
|
19
18
|
...tdProps,
|
|
20
19
|
colSpan: colspan,
|
|
21
|
-
className:
|
|
20
|
+
className: cx("px-2 text-sm font-medium", !wrap && "whitespace-nowrap", className),
|
|
22
21
|
children
|
|
23
22
|
});
|
|
24
23
|
}
|
|
@@ -31,7 +30,7 @@ function Header({ children, className, style, colspan = 1, onClick, sort, caps =
|
|
|
31
30
|
colSpan: colspan,
|
|
32
31
|
style,
|
|
33
32
|
"aria-sort": sort === "unsorted" ? "none" : sort,
|
|
34
|
-
className:
|
|
33
|
+
className: cx(className, yPadding, xPadding, textAlign, "text-xs font-medium", caps ? "uppercase tracking-wider" : ""),
|
|
35
34
|
children: onClick ? /* @__PURE__ */ jsx("button", {
|
|
36
35
|
type: "button",
|
|
37
36
|
onClick,
|
|
@@ -46,25 +45,19 @@ var isHeaderChild = (child) => {
|
|
|
46
45
|
};
|
|
47
46
|
var getHeaders = (children) => children.filter(isHeaderChild);
|
|
48
47
|
function Table({ borderless = false, panel = true, className = "", wrapperClassName = "", tbodyClassName = "divide-y", theadClassName = "theme-muted-panel", children, roundedTop = false, rounded = false, roundedBottom = false, isLoading = false, tableProps }) {
|
|
49
|
-
const { loading } = useStrings();
|
|
50
48
|
const ChildrenArr = React.Children.toArray(children);
|
|
51
49
|
const Headers = getHeaders(ChildrenArr);
|
|
52
50
|
const hasOverflow = wrapperClassName.split(" ").some((cls) => cls.startsWith("overflow-"));
|
|
53
51
|
return /* @__PURE__ */ jsx("div", {
|
|
54
52
|
"aria-busy": isLoading,
|
|
55
|
-
className:
|
|
56
|
-
children: isLoading ? /* @__PURE__ */
|
|
57
|
-
role: "status",
|
|
58
|
-
"aria-label": loading,
|
|
53
|
+
className: cx("flex flex-col w-full", !hasOverflow && "overflow-hidden", wrapperClassName),
|
|
54
|
+
children: isLoading ? /* @__PURE__ */ jsx("div", {
|
|
59
55
|
className: "flex justify-center items-center h-32",
|
|
60
|
-
children:
|
|
61
|
-
className: "sr-only",
|
|
62
|
-
children: loading
|
|
63
|
-
})]
|
|
56
|
+
children: /* @__PURE__ */ jsx(Loader, {})
|
|
64
57
|
}) : /* @__PURE__ */ jsx("div", {
|
|
65
|
-
className:
|
|
58
|
+
className: cx("align-middle inline-block min-w-full overflow-x-auto", panel && "theme-panel", !borderless && "border theme-border", rounded && "rounded-2xl", roundedBottom && "rounded-b-2xl", roundedTop && "rounded-t-2xl"),
|
|
66
59
|
children: /* @__PURE__ */ jsxs("table", {
|
|
67
|
-
className:
|
|
60
|
+
className: cx(className, "min-w-full divide-y theme-border"),
|
|
68
61
|
...tableProps,
|
|
69
62
|
children: [/* @__PURE__ */ jsx("thead", {
|
|
70
63
|
className: theadClassName,
|
|
@@ -82,11 +75,11 @@ function CompactTable({ wrapperClassName = "", className = "", tbodyClassName =
|
|
|
82
75
|
const Headers = getHeaders(ChildrenArr);
|
|
83
76
|
const hasOverflow = wrapperClassName.split(" ").some((cls) => cls.startsWith("overflow-"));
|
|
84
77
|
return /* @__PURE__ */ jsx("div", {
|
|
85
|
-
className:
|
|
78
|
+
className: cx("flex flex-col w-full", !hasOverflow && "overflow-hidden", wrapperClassName),
|
|
86
79
|
children: /* @__PURE__ */ jsx("div", {
|
|
87
|
-
className:
|
|
80
|
+
className: cx("theme-panel inline-block min-w-full align-middle overflow-x-auto", rounded && "rounded-2xl", roundedBottom && "rounded-b-2xl pb-1", roundedTop && "rounded-t-2xl"),
|
|
88
81
|
children: /* @__PURE__ */ jsxs("table", {
|
|
89
|
-
className:
|
|
82
|
+
className: cx("min-w-full divide-y theme-border", className),
|
|
90
83
|
children: [/* @__PURE__ */ jsx("thead", {
|
|
91
84
|
className: "theme-muted-panel",
|
|
92
85
|
children: /* @__PURE__ */ jsx("tr", {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type SegmentLayout } from './segmented.js';
|
|
3
|
+
export interface TabItem<Value extends string = string> {
|
|
4
|
+
value: Value;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
/** Beside the label, or in the corner when only the icon shows. */
|
|
8
|
+
badge?: ReactNode;
|
|
9
|
+
/** Navigates instead of showing a panel, for tabs that are pages. */
|
|
10
|
+
href?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
testId?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const stickyClasses: {
|
|
15
|
+
underHeader: string;
|
|
16
|
+
underToolbar: string;
|
|
17
|
+
};
|
|
18
|
+
export interface TabsProps<Value extends string> extends SegmentLayout {
|
|
19
|
+
/** Names the set of tabs for assistive technology. */
|
|
20
|
+
label: string;
|
|
21
|
+
items: TabItem<Value>[];
|
|
22
|
+
/** The current tab. For tabs that are pages, the page being shown. */
|
|
23
|
+
value?: Value | undefined;
|
|
24
|
+
defaultValue?: Value | undefined;
|
|
25
|
+
onValueChange?: ((value: Value) => void) | undefined;
|
|
26
|
+
/** `line` underlines the current tab across a page; `segmented` matches a
|
|
27
|
+
* SegmentedControl, for a few views in a small space. `fill` and `iconOnly`
|
|
28
|
+
* apply to `segmented`. */
|
|
29
|
+
variant?: 'line' | 'segmented' | undefined;
|
|
30
|
+
/** At the tab row's far end, such as a picker for what the tabs show. */
|
|
31
|
+
end?: ReactNode;
|
|
32
|
+
/** Pins the tab row as the page scrolls. */
|
|
33
|
+
sticky?: keyof typeof stickyClasses | undefined;
|
|
34
|
+
/** On the tab row. */
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
testId?: string | undefined;
|
|
37
|
+
/** The `TabPanel`s; tabs that are pages leave this to the router. */
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
/** Views of one thing, one shown at a time: panels below the tabs, or pages
|
|
41
|
+
* the tabs link to. A lone tab would only repeat the page's title, so the row
|
|
42
|
+
* hides unless there are two or more, or something at its end. */
|
|
43
|
+
export declare function Tabs<Value extends string>({ label, items, value, defaultValue, onValueChange, variant, fill, iconOnly, end, sticky, className, testId, children, }: TabsProps<Value>): import("react").JSX.Element;
|
|
44
|
+
/** One tab's content, shown while its tab is current. */
|
|
45
|
+
export declare function TabPanel({ value, keepMounted, className, children, }: {
|
|
46
|
+
value: string;
|
|
47
|
+
/** Keeps the content, and its state, while another tab is shown. */
|
|
48
|
+
keepMounted?: boolean | undefined;
|
|
49
|
+
className?: string | undefined;
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
}): import("react").JSX.Element;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { Tooltip } from "./Tooltip.js";
|
|
3
|
+
import { useLink } from "./Provider.js";
|
|
4
|
+
import { SegmentContent, segmentClassName, segmentGroupClassName } from "./segmented.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { Tabs } from "@base-ui/react/tabs";
|
|
8
|
+
//#region src/components/Tabs.tsx
|
|
9
|
+
var stickyClasses = {
|
|
10
|
+
underHeader: "sticky top-10 z-(--layer-sticky) bg-(--theme-app-bg)",
|
|
11
|
+
underToolbar: "sticky top-22 z-(--layer-sticky) bg-(--theme-app-bg)"
|
|
12
|
+
};
|
|
13
|
+
/** Views of one thing, one shown at a time: panels below the tabs, or pages
|
|
14
|
+
* the tabs link to. A lone tab would only repeat the page's title, so the row
|
|
15
|
+
* hides unless there are two or more, or something at its end. */
|
|
16
|
+
function Tabs$1({ label, items, value, defaultValue, onValueChange, variant = "line", fill = false, iconOnly = false, end, sticky, className, testId, children }) {
|
|
17
|
+
const Link = useLink();
|
|
18
|
+
const segmented = variant === "segmented";
|
|
19
|
+
const layout = {
|
|
20
|
+
fill,
|
|
21
|
+
iconOnly: segmented && iconOnly
|
|
22
|
+
};
|
|
23
|
+
const [own, setOwn] = useState(defaultValue ?? items[0]?.value);
|
|
24
|
+
const current = value ?? own;
|
|
25
|
+
const showRow = items.length > 1 || !!end;
|
|
26
|
+
const tabs = items.map((item) => {
|
|
27
|
+
const tab = /* @__PURE__ */ jsx(Tabs.Tab, {
|
|
28
|
+
value: item.value,
|
|
29
|
+
disabled: item.disabled,
|
|
30
|
+
"data-testid": item.testId,
|
|
31
|
+
...item.href ? {
|
|
32
|
+
nativeButton: false,
|
|
33
|
+
render: /* @__PURE__ */ jsx(Link, { href: item.href })
|
|
34
|
+
} : {},
|
|
35
|
+
className: segmented ? segmentClassName(item.value === current, layout) : "flex cursor-pointer select-none items-center gap-1.5 whitespace-nowrap px-2 py-2 text-sm font-semibold theme-muted-text outline-none transition-colors hover:theme-text focus-visible:rounded-sm focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--theme-link) data-active:text-(--theme-link) data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
36
|
+
children: /* @__PURE__ */ jsx(SegmentContent, {
|
|
37
|
+
...item,
|
|
38
|
+
iconOnly: layout.iconOnly
|
|
39
|
+
})
|
|
40
|
+
}, item.value);
|
|
41
|
+
return layout.iconOnly ? /* @__PURE__ */ jsx(Tooltip, {
|
|
42
|
+
content: item.label,
|
|
43
|
+
side: "right",
|
|
44
|
+
children: tab
|
|
45
|
+
}, item.value) : tab;
|
|
46
|
+
});
|
|
47
|
+
return /* @__PURE__ */ jsxs(Tabs.Root, {
|
|
48
|
+
value: current ?? null,
|
|
49
|
+
onValueChange: (next) => {
|
|
50
|
+
setOwn(next);
|
|
51
|
+
onValueChange?.(next);
|
|
52
|
+
},
|
|
53
|
+
orientation: layout.iconOnly ? "vertical" : "horizontal",
|
|
54
|
+
"data-testid": testId,
|
|
55
|
+
children: [showRow && /* @__PURE__ */ jsxs("div", {
|
|
56
|
+
className: cx("flex items-center justify-between gap-2", !segmented && "border-b border-(--theme-border)", sticky && stickyClasses[sticky], className),
|
|
57
|
+
children: [/* @__PURE__ */ jsxs(Tabs.List, {
|
|
58
|
+
"aria-label": label,
|
|
59
|
+
className: cx(segmented ? segmentGroupClassName(layout) : "relative flex min-w-0 overflow-x-auto"),
|
|
60
|
+
children: [tabs, !segmented && /* @__PURE__ */ jsx(Tabs.Indicator, { className: "absolute bottom-0 left-0 h-0.5 w-(--active-tab-width) translate-x-(--active-tab-left) bg-(--theme-link) transition-[translate,width] duration-200 ease-in-out motion-reduce:transition-none" })]
|
|
61
|
+
}), end]
|
|
62
|
+
}), children]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/** One tab's content, shown while its tab is current. */
|
|
66
|
+
function TabPanel({ value, keepMounted, className, children }) {
|
|
67
|
+
return /* @__PURE__ */ jsx(Tabs.Panel, {
|
|
68
|
+
value,
|
|
69
|
+
keepMounted,
|
|
70
|
+
className: cx("outline-none", className),
|
|
71
|
+
children
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { TabPanel, Tabs$1 as Tabs };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ColorPreference, type Mode, type Theme } from '../theme/index.js';
|
|
2
|
+
export interface ThemeEditorProps {
|
|
3
|
+
/** The theme being edited, as a host stores it. */
|
|
4
|
+
value: Theme;
|
|
5
|
+
onChange: (theme: Theme) => void;
|
|
6
|
+
/** Which mode's colors the controls edit. Leave it out to let the editor keep its own. */
|
|
7
|
+
mode?: Mode | undefined;
|
|
8
|
+
onModeChange?: ((mode: Mode) => void) | undefined;
|
|
9
|
+
/** The person's light, dark or system choice; the Appearance control shows when this and its handler are given. */
|
|
10
|
+
preference?: ColorPreference | undefined;
|
|
11
|
+
onPreferenceChange?: ((preference: ColorPreference) => void) | undefined;
|
|
12
|
+
/** What Reset returns to; the default theme when left out. */
|
|
13
|
+
defaultValue?: Theme | undefined;
|
|
14
|
+
/** False drops the preview beside the controls, for a host that applies the theme app-wide as it changes (`useApplyTheme`). */
|
|
15
|
+
preview?: boolean | undefined;
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Edits a theme: a background, an accent and a contrast for light and for
|
|
20
|
+
* dark, an optional sidebar of its own and a code style. Everything else is
|
|
21
|
+
* generated, so any choice reads. It previews the result beside the controls,
|
|
22
|
+
* copies the theme as JSON, imports one pasted back, and resets.
|
|
23
|
+
*/
|
|
24
|
+
export declare function ThemeEditor({ value, onChange, mode, onModeChange, preference, onPreferenceChange, defaultValue, preview, className, }: ThemeEditorProps): import("react").JSX.Element;
|
|
25
|
+
/** The theme on a small page: a sidebar, a panel of text, a control, statuses and code. */
|
|
26
|
+
export declare function ThemePreview({ theme, mode }: {
|
|
27
|
+
theme: Theme;
|
|
28
|
+
mode: Mode;
|
|
29
|
+
}): import("react").JSX.Element;
|