@parallelworks/ui 0.44.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 +5 -1
- package/dist/components/Select.js +43 -44
- 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,32 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { LuChevronRight } from "../icons/lu/LuChevronRight.js";
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { ChevronDownIcon, FavoriteIcon, FavoriteOutlineIcon } from "../icons.js";
|
|
3
|
+
import { buttonClasses } from "./buttonClasses.js";
|
|
5
4
|
import { Tooltip } from "./Tooltip.js";
|
|
6
5
|
import { useStrings } from "./Provider.js";
|
|
7
6
|
import { ActionMenu } from "./ActionMenu.js";
|
|
7
|
+
import { Button } from "./Button.js";
|
|
8
8
|
import { comboboxLeaves } from "./comboboxItems.js";
|
|
9
|
-
import {
|
|
10
|
-
import { ghostButtonClasses } from "./ghostButton.js";
|
|
9
|
+
import { Combobox } from "./Combobox.js";
|
|
11
10
|
import { Modal } from "./Modal.js";
|
|
12
|
-
import {
|
|
11
|
+
import { Disclosure } from "./Disclosure.js";
|
|
13
12
|
import { Switch } from "./Switch.js";
|
|
14
|
-
import { clsx } from "clsx";
|
|
15
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
-
import { useEffect,
|
|
17
|
-
import { Button } from "@base-ui/react/button";
|
|
14
|
+
import { useEffect, useRef, useState } from "react";
|
|
18
15
|
import { Toggle } from "@base-ui/react/toggle";
|
|
19
16
|
//#region src/components/CreateModal.tsx
|
|
20
17
|
/** Submits on Enter in the name field or ⌘/Ctrl+Enter from anywhere in the panel. */
|
|
21
18
|
function CreateModal({ open, onClose, typeIcon, typeLabel, typeMenu, namePlaceholder, hideName = false, initialName, showDescription = true, descriptionPlaceholder, submitLabel, submittingLabel, validateName, sanitizeName, nameHint, children, properties, advanced, submitDisabled = false, hideSubmit = false, nameOptional = false, onNameChange, dirty = false, showFavorite = false, onSubmit }) {
|
|
22
19
|
const t = useStrings().modal;
|
|
23
|
-
const
|
|
20
|
+
const { common } = useStrings();
|
|
21
|
+
const submitText = submitLabel ?? common.create;
|
|
24
22
|
const submittingText = submittingLabel ?? t.creating;
|
|
25
23
|
const descriptionText = descriptionPlaceholder ?? t.addDescription;
|
|
26
24
|
const [name, setName] = useState("");
|
|
27
25
|
const [description, setDescription] = useState("");
|
|
28
26
|
const [submitting, setSubmitting] = useState(false);
|
|
29
|
-
const [advancedOpen, setAdvancedOpen] = useState(false);
|
|
30
27
|
const [favorite, setFavorite] = useState(false);
|
|
31
28
|
const [nameFlash, setNameFlash] = useState(false);
|
|
32
29
|
const [nameTouched, setNameTouched] = useState(false);
|
|
@@ -37,7 +34,6 @@ function CreateModal({ open, onClose, typeIcon, typeLabel, typeMenu, namePlaceho
|
|
|
37
34
|
setName(initialName ?? "");
|
|
38
35
|
setDescription("");
|
|
39
36
|
setSubmitting(false);
|
|
40
|
-
setAdvancedOpen(false);
|
|
41
37
|
setFavorite(false);
|
|
42
38
|
setNameTouched(false);
|
|
43
39
|
setInteracted(false);
|
|
@@ -97,7 +93,7 @@ function CreateModal({ open, onClose, typeIcon, typeLabel, typeMenu, namePlaceho
|
|
|
97
93
|
children: [
|
|
98
94
|
typeIcon,
|
|
99
95
|
typeLabel,
|
|
100
|
-
/* @__PURE__ */ jsx(
|
|
96
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { className: "w-3 h-3 opacity-60" })
|
|
101
97
|
]
|
|
102
98
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
103
99
|
className: "inline-flex items-center gap-1.5 px-1.5 py-1 rounded-md bg-(--theme-muted-panel-bg) text-xs font-medium text-(--theme-muted-text-color)",
|
|
@@ -128,7 +124,7 @@ function CreateModal({ open, onClose, typeIcon, typeLabel, typeMenu, namePlaceho
|
|
|
128
124
|
placeholder: namePlaceholder,
|
|
129
125
|
"aria-label": namePlaceholder,
|
|
130
126
|
onAnimationEnd: () => setNameFlash(false),
|
|
131
|
-
className:
|
|
127
|
+
className: cx("mt-2 -mb-1 -mx-1.5 w-[calc(100%+0.75rem)] rounded-md border-0 px-1.5 py-1 bg-transparent shadow-none text-lg font-medium text-(--theme-app) placeholder:text-(--theme-muted-text-color) focus:outline-none", nameFlash && "animate-field-flash", nameMissing ? "ring-1 ring-(--theme-error)" : "focus:ring-0")
|
|
132
128
|
}),
|
|
133
129
|
nameError && /* @__PURE__ */ jsx("p", {
|
|
134
130
|
className: "mt-1 text-xs text-(--theme-error)",
|
|
@@ -149,24 +145,24 @@ function CreateModal({ open, onClose, typeIcon, typeLabel, typeMenu, namePlaceho
|
|
|
149
145
|
className: "mt-1.5 w-full border-0 p-0 bg-transparent shadow-none resize-none text-sm text-(--theme-app) placeholder:text-(--theme-muted-text-color) focus:outline-none focus:ring-0"
|
|
150
146
|
}) : /* @__PURE__ */ jsx("div", { className: "mt-3" })
|
|
151
147
|
] }),
|
|
152
|
-
children
|
|
148
|
+
children && /* @__PURE__ */ jsx("div", {
|
|
149
|
+
className: "mb-3 flex flex-col gap-3",
|
|
150
|
+
children
|
|
151
|
+
})
|
|
153
152
|
]
|
|
154
153
|
}),
|
|
155
154
|
properties && /* @__PURE__ */ jsx("div", {
|
|
156
155
|
className: "flex flex-wrap items-center gap-1.5 px-4 pt-1 pb-3",
|
|
157
156
|
children: properties
|
|
158
157
|
}),
|
|
159
|
-
advanced && /* @__PURE__ */
|
|
158
|
+
advanced && /* @__PURE__ */ jsx("div", {
|
|
160
159
|
className: "px-4 pb-3",
|
|
161
|
-
children:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
children: [/* @__PURE__ */ jsx(LuChevronRight, { className: clsx("w-3 h-3 transition-transform", advancedOpen && "rotate-90") }), t.advanced]
|
|
166
|
-
}), advancedOpen && /* @__PURE__ */ jsx("div", {
|
|
167
|
-
className: "mt-2",
|
|
160
|
+
children: /* @__PURE__ */ jsx(Disclosure, {
|
|
161
|
+
summary: t.advanced,
|
|
162
|
+
summaryClassName: "text-xs font-medium text-(--theme-muted-text-color) transition-colors hover:text-(--theme-app)",
|
|
163
|
+
panelClassName: "pt-2",
|
|
168
164
|
children: advanced
|
|
169
|
-
})
|
|
165
|
+
})
|
|
170
166
|
})
|
|
171
167
|
]
|
|
172
168
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -177,105 +173,41 @@ function CreateModal({ open, onClose, typeIcon, typeLabel, typeMenu, namePlaceho
|
|
|
177
173
|
pressed: favorite,
|
|
178
174
|
onPressedChange: setFavorite,
|
|
179
175
|
"aria-label": t.favorite,
|
|
180
|
-
className:
|
|
181
|
-
|
|
176
|
+
className: buttonClasses({
|
|
177
|
+
variant: "ghost",
|
|
178
|
+
size: "md"
|
|
179
|
+
}),
|
|
180
|
+
children: [favorite ? /* @__PURE__ */ jsx(FavoriteIcon, { className: "text-(--theme-favorite)" }) : /* @__PURE__ */ jsx(FavoriteOutlineIcon, {}), favorite ? t.favorited : t.favorite]
|
|
182
181
|
})
|
|
183
182
|
}) : /* @__PURE__ */ jsx("span", {}), /* @__PURE__ */ jsxs("div", {
|
|
184
183
|
className: "flex items-center gap-2",
|
|
185
|
-
children: [/* @__PURE__ */ jsx(
|
|
186
|
-
|
|
184
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
185
|
+
variant: "ghost",
|
|
186
|
+
size: "sm",
|
|
187
187
|
onClick: onClose,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
children: hideSubmit ? common.close : common.cancel
|
|
189
|
+
}), !hideSubmit && /* @__PURE__ */ jsx(Button, {
|
|
190
|
+
variant: "primary",
|
|
191
|
+
size: "sm",
|
|
192
192
|
onClick: handleSubmit,
|
|
193
193
|
"aria-disabled": !canSubmit,
|
|
194
|
-
|
|
194
|
+
loading: submitting,
|
|
195
195
|
children: submitting ? submittingText : submitText
|
|
196
196
|
})]
|
|
197
197
|
})]
|
|
198
198
|
})]
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
-
var
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
function FieldLabel({ id, label, tooltip }) {
|
|
206
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
207
|
-
className: clsx(fieldLabelClasses, "flex items-center gap-1"),
|
|
208
|
-
children: [/* @__PURE__ */ jsx("label", {
|
|
209
|
-
htmlFor: id,
|
|
210
|
-
children: label
|
|
211
|
-
}), tooltip && /* @__PURE__ */ jsx(InfoTip, { text: tooltip })]
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
/** Labeled single-line input row for the dialog's extra fields. */
|
|
215
|
-
function CreateModalField({ label, tooltip, id, ...props }) {
|
|
216
|
-
const fallbackId = useId();
|
|
217
|
-
const fieldId = id ?? fallbackId;
|
|
218
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
219
|
-
className: "mb-3",
|
|
220
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
221
|
-
id: fieldId,
|
|
222
|
-
label,
|
|
223
|
-
tooltip
|
|
224
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
225
|
-
type: "text",
|
|
226
|
-
autoComplete: "off",
|
|
227
|
-
"data-1p-ignore": true,
|
|
228
|
-
...props,
|
|
229
|
-
id: fieldId,
|
|
230
|
-
className: fieldInputClasses
|
|
231
|
-
})]
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
/** Labeled multi-line field for credential blobs (JSON keys, PEM keys). */
|
|
235
|
-
function CreateModalTextarea({ label, tooltip, rows = 4, id, ...props }) {
|
|
236
|
-
const fallbackId = useId();
|
|
237
|
-
const fieldId = id ?? fallbackId;
|
|
238
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
239
|
-
className: "mb-3",
|
|
240
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
241
|
-
id: fieldId,
|
|
242
|
-
label,
|
|
243
|
-
tooltip
|
|
244
|
-
}), /* @__PURE__ */ jsx("textarea", {
|
|
245
|
-
autoComplete: "off",
|
|
246
|
-
"data-1p-ignore": true,
|
|
247
|
-
rows,
|
|
248
|
-
...props,
|
|
249
|
-
id: fieldId,
|
|
250
|
-
className: clsx(fieldInputClasses, "h-auto py-2 font-mono text-xs leading-relaxed resize-y")
|
|
251
|
-
})]
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
/** Labeled input with suggestions; any text is allowed. */
|
|
255
|
-
function CreateModalAutocompleteField({ label, tooltip, value, onValueChange, items, placeholder }) {
|
|
256
|
-
const id = useId();
|
|
257
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
258
|
-
className: "mb-3",
|
|
259
|
-
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
260
|
-
id,
|
|
261
|
-
label,
|
|
262
|
-
tooltip
|
|
263
|
-
}), /* @__PURE__ */ jsx(Autocomplete, {
|
|
264
|
-
id,
|
|
265
|
-
items,
|
|
266
|
-
value,
|
|
267
|
-
onValueChange,
|
|
268
|
-
placeholder
|
|
269
|
-
})]
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
var pillClasses = "inline-flex h-7 items-center gap-1.5 rounded-md border border-(--theme-border) px-2 text-xs font-medium transition-colors";
|
|
201
|
+
var pillClasses = (set) => buttonClasses({
|
|
202
|
+
variant: set ? "secondary" : "outline",
|
|
203
|
+
size: "sm"
|
|
204
|
+
});
|
|
273
205
|
/** Compact property pill with an on/off switch. */
|
|
274
206
|
function CreateModalSwitch({ label, checked, onCheckedChange, tooltip }) {
|
|
275
207
|
return /* @__PURE__ */ jsx(Tooltip, {
|
|
276
208
|
content: tooltip,
|
|
277
209
|
children: /* @__PURE__ */ jsxs("label", {
|
|
278
|
-
className:
|
|
210
|
+
className: pillClasses(checked),
|
|
279
211
|
children: [/* @__PURE__ */ jsx(Switch, {
|
|
280
212
|
size: "sm",
|
|
281
213
|
checked,
|
|
@@ -287,7 +219,7 @@ function CreateModalSwitch({ label, checked, onCheckedChange, tooltip }) {
|
|
|
287
219
|
/** Compact property pill that picks one value from a searchable list. Items may carry
|
|
288
220
|
* icons, descriptions and group headings (e.g. Clusters vs Kubernetes). */
|
|
289
221
|
function CreateModalSelect({ label, icon, value, items, onValueChange, disabled = false, disabledReason, tooltip }) {
|
|
290
|
-
const
|
|
222
|
+
const { common } = useStrings();
|
|
291
223
|
const selected = comboboxLeaves(items).map((item) => typeof item === "string" ? {
|
|
292
224
|
value: item,
|
|
293
225
|
label: item
|
|
@@ -299,7 +231,7 @@ function CreateModalSelect({ label, icon, value, items, onValueChange, disabled
|
|
|
299
231
|
className: "font-normal text-(--theme-muted-text-color)",
|
|
300
232
|
children: label
|
|
301
233
|
}), selectedLabel] }) : label,
|
|
302
|
-
/* @__PURE__ */ jsx(
|
|
234
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { className: "w-3 h-3 opacity-60" })
|
|
303
235
|
] });
|
|
304
236
|
if (disabled) return /* @__PURE__ */ jsx(Tooltip, {
|
|
305
237
|
content: disabledReason ?? tooltip,
|
|
@@ -307,7 +239,8 @@ function CreateModalSelect({ label, icon, value, items, onValueChange, disabled
|
|
|
307
239
|
disabled: true,
|
|
308
240
|
focusableWhenDisabled: true,
|
|
309
241
|
"aria-label": label,
|
|
310
|
-
|
|
242
|
+
variant: "outline",
|
|
243
|
+
size: "sm",
|
|
311
244
|
children: pillContent
|
|
312
245
|
})
|
|
313
246
|
});
|
|
@@ -319,14 +252,14 @@ function CreateModalSelect({ label, icon, value, items, onValueChange, disabled
|
|
|
319
252
|
},
|
|
320
253
|
itemToStringLabel: (next) => next,
|
|
321
254
|
"aria-label": label,
|
|
322
|
-
placeholder:
|
|
255
|
+
placeholder: common.filter,
|
|
323
256
|
triggerTooltip: tooltip,
|
|
324
257
|
trigger: /* @__PURE__ */ jsx("button", {
|
|
325
258
|
type: "button",
|
|
326
|
-
className:
|
|
259
|
+
className: pillClasses(!!selectedLabel),
|
|
327
260
|
children: pillContent
|
|
328
261
|
})
|
|
329
262
|
});
|
|
330
263
|
}
|
|
331
264
|
//#endregion
|
|
332
|
-
export { CreateModal,
|
|
265
|
+
export { CreateModal, CreateModalSelect, CreateModalSwitch };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface DatePickerProps {
|
|
2
|
+
/** As a native date input holds it: `yyyy-MM-dd`, or with `withTime` the local
|
|
3
|
+
* `yyyy-MM-ddTHH:mm` of `datetime-local`. Empty while nothing is chosen. */
|
|
4
|
+
value: string;
|
|
5
|
+
onValueChange: (value: string) => void;
|
|
6
|
+
/** A time beside the date. */
|
|
7
|
+
withTime?: boolean | undefined;
|
|
8
|
+
/** The earliest and latest days, and with `withTime` times, that can be chosen, in the value's
|
|
9
|
+
* format. */
|
|
10
|
+
min?: string | undefined;
|
|
11
|
+
max?: string | undefined;
|
|
12
|
+
/** Seconds the time steps by, such as 900 for quarter hours. */
|
|
13
|
+
timeStep?: number | undefined;
|
|
14
|
+
/** Leaves out the clear button, for a field that always holds a date. */
|
|
15
|
+
required?: boolean | undefined;
|
|
16
|
+
disabled?: boolean | undefined;
|
|
17
|
+
placeholder?: string | undefined;
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
'aria-label'?: string | undefined;
|
|
20
|
+
'aria-labelledby'?: string | undefined;
|
|
21
|
+
'aria-describedby'?: string | undefined;
|
|
22
|
+
'aria-invalid'?: boolean | undefined;
|
|
23
|
+
'aria-required'?: boolean | undefined;
|
|
24
|
+
className?: string | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A day from a calendar, and with `withTime` a time beside it. The value is a string as a native
|
|
28
|
+
* date or datetime-local input holds it, so it reads the same in forms and URLs; months, weekdays
|
|
29
|
+
* and the shown date follow the reader's locale.
|
|
30
|
+
*/
|
|
31
|
+
export declare function DatePicker({ value, onValueChange, withTime, min, max, timeStep, required, disabled, placeholder, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, 'aria-required': ariaRequired, className, }: DatePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { CalendarIcon, ChevronLeftIcon, ChevronRightIcon } from "../icons.js";
|
|
3
|
+
import { panelClassName, positionerClassName } from "./floating.js";
|
|
4
|
+
import { buttonClasses } from "./buttonClasses.js";
|
|
5
|
+
import { useStrings } from "./Provider.js";
|
|
6
|
+
import { fieldBox } from "./fieldBox.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { Popover } from "@base-ui/react/popover";
|
|
10
|
+
import { DayPicker } from "@daypicker/react";
|
|
11
|
+
//#region src/components/DatePicker.tsx
|
|
12
|
+
var pad = (n) => String(n).padStart(2, "0");
|
|
13
|
+
var toDay = (date) => `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
14
|
+
/** The local calendar day a value names, or undefined for none or nonsense. */
|
|
15
|
+
function parseDay(value) {
|
|
16
|
+
const match = value?.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
17
|
+
if (!match) return;
|
|
18
|
+
const [, y, m, d] = match.map(Number);
|
|
19
|
+
const date = new Date(y, m - 1, d);
|
|
20
|
+
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
21
|
+
}
|
|
22
|
+
var timeOf = (value) => value?.match(/T(\d{2}:\d{2}(?::\d{2})?)/)?.[1];
|
|
23
|
+
/** The locale's first day of the week, where the browser reports it; Sunday otherwise. */
|
|
24
|
+
function firstWeekday() {
|
|
25
|
+
try {
|
|
26
|
+
const locale = new Intl.Locale(navigator.language);
|
|
27
|
+
const firstDay = (locale.getWeekInfo?.() ?? locale.weekInfo)?.firstDay;
|
|
28
|
+
return firstDay === void 0 ? 0 : firstDay % 7;
|
|
29
|
+
} catch {
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
var caption = new Intl.DateTimeFormat(void 0, {
|
|
34
|
+
month: "long",
|
|
35
|
+
year: "numeric"
|
|
36
|
+
});
|
|
37
|
+
var weekday = new Intl.DateTimeFormat(void 0, { weekday: "narrow" });
|
|
38
|
+
var longDay = new Intl.DateTimeFormat(void 0, { dateStyle: "full" });
|
|
39
|
+
var shownDay = new Intl.DateTimeFormat(void 0, { dateStyle: "medium" });
|
|
40
|
+
var calendarClassNames = {
|
|
41
|
+
root: "relative p-3",
|
|
42
|
+
months: "flex flex-col",
|
|
43
|
+
month: "flex flex-col gap-2",
|
|
44
|
+
month_caption: "flex h-7 items-center px-1",
|
|
45
|
+
caption_label: "text-sm font-semibold",
|
|
46
|
+
nav: "absolute top-3 right-3 flex items-center gap-1",
|
|
47
|
+
button_previous: buttonClasses({
|
|
48
|
+
variant: "ghost",
|
|
49
|
+
size: "sm",
|
|
50
|
+
iconOnly: true
|
|
51
|
+
}),
|
|
52
|
+
button_next: buttonClasses({
|
|
53
|
+
variant: "ghost",
|
|
54
|
+
size: "sm",
|
|
55
|
+
iconOnly: true
|
|
56
|
+
}),
|
|
57
|
+
month_grid: "border-collapse",
|
|
58
|
+
weekdays: "",
|
|
59
|
+
weekday: "size-9 text-center text-xs font-normal text-(--theme-muted-text-color)",
|
|
60
|
+
week: "",
|
|
61
|
+
day: "size-9 p-0 text-center text-sm",
|
|
62
|
+
day_button: "size-9 rounded-md cursor-pointer outline-none hover:bg-(--theme-hover) focus-visible:ring-2 focus-visible:ring-(--theme-focus-ring) disabled:cursor-not-allowed disabled:hover:bg-transparent",
|
|
63
|
+
selected: "[&>button]:bg-(--theme-accent) [&>button]:text-(--theme-accent-text) [&>button]:hover:bg-(--theme-accent)",
|
|
64
|
+
today: "font-semibold [&>button]:underline [&>button]:underline-offset-4",
|
|
65
|
+
outside: "text-(--theme-muted-text-color) opacity-60",
|
|
66
|
+
disabled: "text-(--theme-muted-text-color) opacity-40"
|
|
67
|
+
};
|
|
68
|
+
var triggerClassName = cx(fieldBox(), "flex flex-1 min-w-40 cursor-pointer items-center gap-2 text-left");
|
|
69
|
+
/**
|
|
70
|
+
* A day from a calendar, and with `withTime` a time beside it. The value is a string as a native
|
|
71
|
+
* date or datetime-local input holds it, so it reads the same in forms and URLs; months, weekdays
|
|
72
|
+
* and the shown date follow the reader's locale.
|
|
73
|
+
*/
|
|
74
|
+
function DatePicker({ value, onValueChange, withTime = false, min, max, timeStep = 60, required = false, disabled = false, placeholder, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, className }) {
|
|
75
|
+
const t = useStrings().datePicker;
|
|
76
|
+
const { common } = useStrings();
|
|
77
|
+
const [open, setOpen] = useState(false);
|
|
78
|
+
const [weekStartsOn] = useState(firstWeekday);
|
|
79
|
+
const day = parseDay(value);
|
|
80
|
+
const time = timeOf(value) ?? timeOf(min) ?? "00:00";
|
|
81
|
+
const earliest = parseDay(min);
|
|
82
|
+
const latest = parseDay(max);
|
|
83
|
+
const outOfRange = [...earliest ? [{ before: earliest }] : [], ...latest ? [{ after: latest }] : []];
|
|
84
|
+
const emit = (next, nextTime = time) => {
|
|
85
|
+
if (!next) {
|
|
86
|
+
onValueChange("");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
onValueChange(withTime ? `${toDay(next)}T${nextTime}` : toDay(next));
|
|
90
|
+
};
|
|
91
|
+
const opensOn = day ?? earliest;
|
|
92
|
+
const pick = (next) => {
|
|
93
|
+
emit(next);
|
|
94
|
+
setOpen(false);
|
|
95
|
+
};
|
|
96
|
+
const sameDay = (bound) => day !== void 0 && parseDay(bound)?.getTime() === day.getTime();
|
|
97
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
98
|
+
className: cx("flex w-full items-center gap-2", className),
|
|
99
|
+
children: [/* @__PURE__ */ jsxs(Popover.Root, {
|
|
100
|
+
open,
|
|
101
|
+
onOpenChange: setOpen,
|
|
102
|
+
children: [/* @__PURE__ */ jsxs(Popover.Trigger, {
|
|
103
|
+
id,
|
|
104
|
+
disabled,
|
|
105
|
+
"aria-label": ariaLabel,
|
|
106
|
+
"aria-labelledby": ariaLabelledBy,
|
|
107
|
+
"aria-describedby": ariaDescribedBy,
|
|
108
|
+
"aria-invalid": ariaInvalid || void 0,
|
|
109
|
+
"aria-required": ariaRequired || void 0,
|
|
110
|
+
className: triggerClassName,
|
|
111
|
+
children: [/* @__PURE__ */ jsx(CalendarIcon, {
|
|
112
|
+
"aria-hidden": "true",
|
|
113
|
+
className: "size-3.5 shrink-0 text-(--theme-muted-text-color)"
|
|
114
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
115
|
+
className: cx("truncate", !day && "text-(--theme-muted-text-color)"),
|
|
116
|
+
children: day ? shownDay.format(day) : placeholder ?? t.pickDate
|
|
117
|
+
})]
|
|
118
|
+
}), /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
119
|
+
align: "start",
|
|
120
|
+
sideOffset: 4,
|
|
121
|
+
className: positionerClassName,
|
|
122
|
+
children: /* @__PURE__ */ jsxs(Popover.Popup, {
|
|
123
|
+
className: panelClassName,
|
|
124
|
+
children: [/* @__PURE__ */ jsx(DayPicker, {
|
|
125
|
+
...required ? {
|
|
126
|
+
mode: "single",
|
|
127
|
+
required: true,
|
|
128
|
+
selected: day,
|
|
129
|
+
onSelect: pick
|
|
130
|
+
} : {
|
|
131
|
+
mode: "single",
|
|
132
|
+
selected: day,
|
|
133
|
+
onSelect: pick
|
|
134
|
+
},
|
|
135
|
+
...opensOn && { defaultMonth: opensOn },
|
|
136
|
+
...earliest && { startMonth: earliest },
|
|
137
|
+
...latest && { endMonth: latest },
|
|
138
|
+
disabled: outOfRange,
|
|
139
|
+
weekStartsOn,
|
|
140
|
+
autoFocus: true,
|
|
141
|
+
showOutsideDays: true,
|
|
142
|
+
fixedWeeks: true,
|
|
143
|
+
classNames: calendarClassNames,
|
|
144
|
+
formatters: {
|
|
145
|
+
formatCaption: (month) => caption.format(month),
|
|
146
|
+
formatWeekdayName: (date) => weekday.format(date)
|
|
147
|
+
},
|
|
148
|
+
labels: {
|
|
149
|
+
labelDayButton: (date) => longDay.format(date),
|
|
150
|
+
labelPrevious: () => t.previousMonth,
|
|
151
|
+
labelNext: () => t.nextMonth,
|
|
152
|
+
labelGrid: (month) => caption.format(month),
|
|
153
|
+
labelWeekday: (date) => new Intl.DateTimeFormat(void 0, { weekday: "long" }).format(date)
|
|
154
|
+
},
|
|
155
|
+
components: { Chevron: ({ orientation }) => orientation === "left" ? /* @__PURE__ */ jsx(ChevronLeftIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronRightIcon, { "aria-hidden": "true" }) }
|
|
156
|
+
}), !required && day && /* @__PURE__ */ jsx("div", {
|
|
157
|
+
className: "flex justify-end border-t border-(--theme-border) px-3 py-2",
|
|
158
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
159
|
+
type: "button",
|
|
160
|
+
className: buttonClasses({
|
|
161
|
+
variant: "ghost",
|
|
162
|
+
size: "xs"
|
|
163
|
+
}),
|
|
164
|
+
onClick: () => {
|
|
165
|
+
emit(void 0);
|
|
166
|
+
setOpen(false);
|
|
167
|
+
},
|
|
168
|
+
children: common.clear
|
|
169
|
+
})
|
|
170
|
+
})]
|
|
171
|
+
})
|
|
172
|
+
}) })]
|
|
173
|
+
}), withTime && /* @__PURE__ */ jsx("input", {
|
|
174
|
+
type: "time",
|
|
175
|
+
"aria-label": t.time,
|
|
176
|
+
value: day ? time : "",
|
|
177
|
+
step: timeStep,
|
|
178
|
+
min: sameDay(min) ? timeOf(min) : void 0,
|
|
179
|
+
max: sameDay(max) ? timeOf(max) : void 0,
|
|
180
|
+
disabled,
|
|
181
|
+
"aria-invalid": ariaInvalid || void 0,
|
|
182
|
+
onChange: (event) => {
|
|
183
|
+
const next = event.target.value;
|
|
184
|
+
if (next) emit(day ?? earliest ?? /* @__PURE__ */ new Date(), next);
|
|
185
|
+
},
|
|
186
|
+
className: cx(fieldBox(), "w-auto tabular-nums")
|
|
187
|
+
})]
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
//#endregion
|
|
191
|
+
export { DatePicker };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
1
2
|
import { InfoTip } from "./InfoTip.js";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import React from "react";
|
|
5
5
|
//#region src/components/DescriptionList.tsx
|
|
6
6
|
function DescriptionListItem({ label, children, tooltip, className, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("dt", {
|
|
8
|
-
className:
|
|
8
|
+
className: cx("text-[13px] leading-6 col-span-1 font-normal flex gap-1", className),
|
|
9
9
|
children: [/* @__PURE__ */ jsx("span", {
|
|
10
10
|
className: "min-w-0 truncate",
|
|
11
11
|
children: label
|
|
@@ -21,7 +21,7 @@ function DescriptionListItem({ label, children, tooltip, className, ...props })
|
|
|
21
21
|
}
|
|
22
22
|
function DescriptionList({ children, title, separators = true, subtitle, className, wrapperClassName, vertical = false }) {
|
|
23
23
|
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
-
className:
|
|
24
|
+
className: cx("w-full", wrapperClassName),
|
|
25
25
|
children: [
|
|
26
26
|
title && /* @__PURE__ */ jsx("h2", {
|
|
27
27
|
className: "text-sm font-semibold w-full mb-1",
|
|
@@ -32,7 +32,7 @@ function DescriptionList({ children, title, separators = true, subtitle, classNa
|
|
|
32
32
|
children: subtitle
|
|
33
33
|
}),
|
|
34
34
|
/* @__PURE__ */ jsx("dl", {
|
|
35
|
-
className:
|
|
35
|
+
className: cx("grid", separators && "*:not-last-of-type:border-b-1", vertical ? "grid-cols-1" : "grid-cols-5 gap-x-4 gap-y-0.5 *:pb-0.5", className),
|
|
36
36
|
children: Array.isArray(children) ? React.Children.toArray(children) : children
|
|
37
37
|
})
|
|
38
38
|
]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/** The height a collapsible panel animates as it opens and closes. It clips
|
|
3
|
+
* only while it moves, so focus rings and overflowing content show once open. */
|
|
4
|
+
export declare const collapsePanelClassName = "h-(--collapsible-panel-height) transition-[height,opacity] duration-200 ease-out motion-reduce:transition-none data-starting-style:h-0 data-starting-style:overflow-hidden data-starting-style:opacity-0 data-ending-style:h-0 data-ending-style:overflow-hidden data-ending-style:opacity-0";
|
|
5
|
+
export interface DisclosureProps {
|
|
6
|
+
/** The line that toggles the detail: a label, or a row of status and label. */
|
|
7
|
+
summary: ReactNode;
|
|
8
|
+
open?: boolean | undefined;
|
|
9
|
+
onOpenChange?: ((open: boolean) => void) | undefined;
|
|
10
|
+
defaultOpen?: boolean | undefined;
|
|
11
|
+
/** Nothing to reveal: the summary shows without a toggle. */
|
|
12
|
+
disabled?: boolean | undefined;
|
|
13
|
+
/** Keep the detail mounted while folded, so its own state survives. */
|
|
14
|
+
keepMounted?: boolean | undefined;
|
|
15
|
+
className?: string | undefined;
|
|
16
|
+
/** On the toggle: its width (`w-full` for a whole row), text size and color. */
|
|
17
|
+
summaryClassName?: string | undefined;
|
|
18
|
+
/** On the revealed detail: its indent and spacing. */
|
|
19
|
+
panelClassName?: string | undefined;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
/** A line inside content that reveals more detail beneath it, such as a tool
|
|
23
|
+
* call's arguments or a model's reasoning. For a titled part of a page or
|
|
24
|
+
* form, which belongs in the page's outline, use Section. */
|
|
25
|
+
export declare function Disclosure({ summary, open, onOpenChange, defaultOpen, disabled, keepMounted, className, summaryClassName, panelClassName, children, }: DisclosureProps): import("react").JSX.Element;
|
|
26
|
+
/** The revealing panel alone, for a toggle that lives elsewhere, such as a
|
|
27
|
+
* tree row's chevron that names this panel with `aria-controls`. */
|
|
28
|
+
export declare function DisclosurePanel({ open, id, keepMounted, className, children, }: {
|
|
29
|
+
open: boolean;
|
|
30
|
+
id?: string | undefined;
|
|
31
|
+
keepMounted?: boolean | undefined;
|
|
32
|
+
className?: string | undefined;
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { ChevronRightIcon } from "../icons.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Collapsible } from "@base-ui/react/collapsible";
|
|
5
|
+
//#region src/components/Disclosure.tsx
|
|
6
|
+
/** The height a collapsible panel animates as it opens and closes. It clips
|
|
7
|
+
* only while it moves, so focus rings and overflowing content show once open. */
|
|
8
|
+
var collapsePanelClassName = "h-(--collapsible-panel-height) transition-[height,opacity] duration-200 ease-out motion-reduce:transition-none data-starting-style:h-0 data-starting-style:overflow-hidden data-starting-style:opacity-0 data-ending-style:h-0 data-ending-style:overflow-hidden data-ending-style:opacity-0";
|
|
9
|
+
/** A line inside content that reveals more detail beneath it, such as a tool
|
|
10
|
+
* call's arguments or a model's reasoning. For a titled part of a page or
|
|
11
|
+
* form, which belongs in the page's outline, use Section. */
|
|
12
|
+
function Disclosure({ summary, open, onOpenChange, defaultOpen = false, disabled = false, keepMounted = false, className, summaryClassName, panelClassName, children }) {
|
|
13
|
+
return /* @__PURE__ */ jsxs(Collapsible.Root, {
|
|
14
|
+
open,
|
|
15
|
+
onOpenChange: (next) => onOpenChange?.(next),
|
|
16
|
+
defaultOpen,
|
|
17
|
+
disabled,
|
|
18
|
+
className,
|
|
19
|
+
children: [/* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
20
|
+
className: cx("group/disclosure flex min-w-0 items-start gap-2 text-left", disabled ? "cursor-default" : "cursor-pointer", summaryClassName),
|
|
21
|
+
children: [summary, !disabled && /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
22
|
+
"aria-hidden": "true",
|
|
23
|
+
className: "mt-1 h-3.5 w-3.5 shrink-0 opacity-70 transition-transform group-data-panel-open/disclosure:rotate-90 motion-reduce:transition-none"
|
|
24
|
+
})]
|
|
25
|
+
}), /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
26
|
+
keepMounted,
|
|
27
|
+
className: cx(collapsePanelClassName, panelClassName),
|
|
28
|
+
children
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** The revealing panel alone, for a toggle that lives elsewhere, such as a
|
|
33
|
+
* tree row's chevron that names this panel with `aria-controls`. */
|
|
34
|
+
function DisclosurePanel({ open, id, keepMounted = false, className, children }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
36
|
+
open,
|
|
37
|
+
children: /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
38
|
+
id,
|
|
39
|
+
keepMounted,
|
|
40
|
+
className: cx(collapsePanelClassName, className),
|
|
41
|
+
children
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Disclosure, DisclosurePanel, collapsePanelClassName };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Drawer as BaseDrawer } from '@base-ui/react/drawer';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export interface DrawerProps extends Omit<BaseDrawer.Popup.Props, 'className' | 'children' | 'render' | 'title'> {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
/** The header's heading, which names the drawer. Without one, name it with `aria-label`. */
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
/** A line under the title. */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** Actions along the bottom edge, such as Cancel and Save; they stay in view as the body scrolls. */
|
|
11
|
+
footer?: ReactNode;
|
|
12
|
+
/** The edge it slides in from, and the way a swipe dismisses it. */
|
|
13
|
+
side?: 'left' | 'right';
|
|
14
|
+
/** Its width: pixels, or any CSS length such as `'100%'` for as wide as the space allows. */
|
|
15
|
+
width?: number | string;
|
|
16
|
+
/** Adds a handle on the inner edge that drags, or arrow keys move, to change the width. */
|
|
17
|
+
resizable?: boolean;
|
|
18
|
+
/** The narrowest a drag leaves it, in pixels. */
|
|
19
|
+
minWidth?: number;
|
|
20
|
+
/** False ignores the backdrop and Escape, so typed input isn't lost to a stray
|
|
21
|
+
* click; the drawer's own buttons still close it. */
|
|
22
|
+
dismissible?: boolean;
|
|
23
|
+
/** True dims the page behind it, locks its scroll and keeps focus inside;
|
|
24
|
+
* `'trap-focus'` dims and keeps focus but leaves the page's scroll alone, as an
|
|
25
|
+
* embedded panel wants; false is a side panel the page stays usable beside. */
|
|
26
|
+
modal?: boolean | 'trap-focus';
|
|
27
|
+
/** False drops the header's close button, for a drawer whose footer closes it. */
|
|
28
|
+
closeButton?: boolean;
|
|
29
|
+
/** Covers its nearest positioned ancestor instead of the window, as a drawer
|
|
30
|
+
* inside an embedded panel does. */
|
|
31
|
+
contained?: boolean;
|
|
32
|
+
/** Keeps the content mounted while closed, so its scroll and state survive. */
|
|
33
|
+
keepMounted?: boolean;
|
|
34
|
+
/** False drops the body's padding, for content that fills the drawer edge to edge. */
|
|
35
|
+
padded?: boolean;
|
|
36
|
+
/** On the body. */
|
|
37
|
+
className?: string;
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
/** A panel that slides in from an edge over the page. A swipe toward that edge,
|
|
41
|
+
* Escape or a press outside closes it, and focus returns where it was.
|
|
42
|
+
*
|
|
43
|
+
* It leaves the host's fixed chrome uncovered: it starts below
|
|
44
|
+
* `--app-inset-top` (a top bar's height), and at its widest leaves the strip
|
|
45
|
+
* `--app-inset-start` (a start-side sidebar's width, at least 2.5rem). Set both
|
|
46
|
+
* on the document root. */
|
|
47
|
+
export declare function Drawer({ open, onClose, title, description, footer, side, width, resizable, minWidth, dismissible, modal, closeButton, contained, keepMounted, padded, className, children, ...popupProps }: DrawerProps): import("react").JSX.Element;
|