@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,13 +1,15 @@
|
|
|
1
1
|
import { Autocomplete, Combobox } from "../../components/Combobox.js";
|
|
2
|
+
import { Field } from "../../components/Field.js";
|
|
2
3
|
import { toFieldItems } from "../utils/fieldItems.js";
|
|
3
|
-
import {
|
|
4
|
+
import { fieldFrame } from "../fieldFrame.js";
|
|
4
5
|
import { useChoiceField } from "../useChoiceField.js";
|
|
5
6
|
import { useDependentOptions } from "../utils/dependentOptions.js";
|
|
6
7
|
import { getPlaceholder } from "../utils/getPlaceholder.js";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
9
|
import { useMemo } from "react";
|
|
9
10
|
//#region src/form/Fields/DropdownField.tsx
|
|
10
|
-
function DropdownField(
|
|
11
|
+
function DropdownField(props) {
|
|
12
|
+
const { field, disabled, onChange } = props;
|
|
11
13
|
const { options } = useDependentOptions(field.options, field.depends_on);
|
|
12
14
|
const items = useMemo(() => toFieldItems(options), [options]);
|
|
13
15
|
const [value, choose] = useChoiceField({
|
|
@@ -18,40 +20,22 @@ function DropdownField({ field, label, labelPosition, missing, disabled, onChang
|
|
|
18
20
|
onChange
|
|
19
21
|
});
|
|
20
22
|
const placeholder = getPlaceholder(field.placeholder, typeof field.default === "string" ? field.default : void 0);
|
|
21
|
-
return /* @__PURE__ */ jsx(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
className: "w-full",
|
|
38
|
-
placeholder,
|
|
39
|
-
items,
|
|
40
|
-
value: value == null ? "" : String(value),
|
|
41
|
-
onValueChange: choose
|
|
42
|
-
}) : /* @__PURE__ */ jsx(Combobox, {
|
|
43
|
-
id,
|
|
44
|
-
"aria-describedby": describedBy,
|
|
45
|
-
"aria-label": label,
|
|
46
|
-
"aria-invalid": missing,
|
|
47
|
-
required: !field.optional,
|
|
48
|
-
disabled,
|
|
49
|
-
className: "w-full",
|
|
50
|
-
placeholder,
|
|
51
|
-
items,
|
|
52
|
-
value: value ?? null,
|
|
53
|
-
onValueChange: choose
|
|
54
|
-
})
|
|
23
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
24
|
+
...fieldFrame(props),
|
|
25
|
+
children: (control) => field.allowCustomValue ? /* @__PURE__ */ jsx(Autocomplete, {
|
|
26
|
+
...control,
|
|
27
|
+
disabled,
|
|
28
|
+
placeholder,
|
|
29
|
+
items,
|
|
30
|
+
value: value == null ? "" : String(value),
|
|
31
|
+
onValueChange: choose
|
|
32
|
+
}) : /* @__PURE__ */ jsx(Combobox, {
|
|
33
|
+
...control,
|
|
34
|
+
disabled,
|
|
35
|
+
placeholder,
|
|
36
|
+
items,
|
|
37
|
+
value: value ?? null,
|
|
38
|
+
onValueChange: choose
|
|
55
39
|
})
|
|
56
40
|
});
|
|
57
41
|
}
|
|
@@ -9,4 +9,4 @@ export interface IDurationField extends BaseField {
|
|
|
9
9
|
disableValue?: number;
|
|
10
10
|
disableLabel?: string;
|
|
11
11
|
}
|
|
12
|
-
export default function DurationField(
|
|
12
|
+
export default function DurationField(props: FieldComponentProps<IDurationField>): import("react").JSX.Element;
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { useStrings } from "../../components/Provider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Checkbox } from "../../components/Checkbox.js";
|
|
3
|
+
import { fieldBox } from "../../components/fieldBox.js";
|
|
4
|
+
import { Field, FieldOption } from "../../components/Field.js";
|
|
5
|
+
import { fieldFrame } from "../fieldFrame.js";
|
|
3
6
|
import { useFieldValue } from "../useFieldValue.js";
|
|
4
|
-
import {
|
|
7
|
+
import { formatDurationText, parseDurationText } from "../utils/duration.js";
|
|
5
8
|
import { setDurationValidity } from "./durationValidity.js";
|
|
6
|
-
import { clsx } from "clsx";
|
|
7
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
10
|
import { useEffect, useRef, useState } from "react";
|
|
9
11
|
import { useFormContext } from "react-hook-form";
|
|
10
12
|
//#region src/form/Fields/DurationField.tsx
|
|
11
13
|
var isNumericString = (value) => typeof value === "string" && /^\d+$/.test(value.trim());
|
|
12
14
|
var toDisplay = (value) => {
|
|
13
|
-
if (typeof value === "number") return
|
|
14
|
-
if (isNumericString(value)) return
|
|
15
|
+
if (typeof value === "number") return formatDurationText(value);
|
|
16
|
+
if (isNumericString(value)) return formatDurationText(Number(value));
|
|
15
17
|
return "";
|
|
16
18
|
};
|
|
17
|
-
function DurationField(
|
|
19
|
+
function DurationField(props) {
|
|
20
|
+
const { field, disabled, onChange } = props;
|
|
18
21
|
const { form: t } = useStrings();
|
|
19
22
|
const name = field.name ?? "";
|
|
20
23
|
const [currentValue, change] = useFieldValue(name);
|
|
@@ -36,11 +39,11 @@ function DurationField({ field, label, labelPosition, missing, disabled, onChang
|
|
|
36
39
|
if (!focusedRef.current) setText(toDisplay(currentValue));
|
|
37
40
|
}, [currentValue]);
|
|
38
41
|
const trimmed = text.trim();
|
|
39
|
-
const parsed = trimmed === "" ? null :
|
|
42
|
+
const parsed = trimmed === "" ? null : parseDurationText(trimmed);
|
|
40
43
|
let error = null;
|
|
41
44
|
if (!isSentinel && trimmed !== "") {
|
|
42
45
|
if (parsed === null) error = t.invalidDuration;
|
|
43
|
-
else if (parsed < min || parsed > max) error = Number.isFinite(max) ? t.durationOutOfRange(
|
|
46
|
+
else if (parsed < min || parsed > max) error = Number.isFinite(max) ? t.durationOutOfRange(formatDurationText(Math.max(min, 0)), formatDurationText(max)) : t.durationBelowMin(formatDurationText(Math.max(min, 0)));
|
|
44
47
|
}
|
|
45
48
|
useEffect(() => {
|
|
46
49
|
setDurationValidity(name, error === null);
|
|
@@ -60,7 +63,7 @@ function DurationField({ field, label, labelPosition, missing, disabled, onChang
|
|
|
60
63
|
const raw = e.target.value;
|
|
61
64
|
setText(raw);
|
|
62
65
|
const rawTrimmed = raw.trim();
|
|
63
|
-
const value = rawTrimmed === "" ? "" :
|
|
66
|
+
const value = rawTrimmed === "" ? "" : parseDurationText(rawTrimmed);
|
|
64
67
|
if (value === "" || typeof value === "number" && value >= min && value <= max) set(value);
|
|
65
68
|
};
|
|
66
69
|
const handleFocus = () => {
|
|
@@ -72,51 +75,34 @@ function DurationField({ field, label, labelPosition, missing, disabled, onChang
|
|
|
72
75
|
setText("");
|
|
73
76
|
set("");
|
|
74
77
|
} else if (parsed !== null && parsed >= min && parsed <= max) {
|
|
75
|
-
setText(
|
|
78
|
+
setText(formatDurationText(parsed));
|
|
76
79
|
set(parsed);
|
|
77
80
|
}
|
|
78
81
|
};
|
|
79
|
-
return /* @__PURE__ */ jsx(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
82
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
83
|
+
...fieldFrame(props),
|
|
84
|
+
error: error ?? props.error,
|
|
85
|
+
children: (control) => /* @__PURE__ */ jsxs(Fragment, { children: [!isSentinel && /* @__PURE__ */ jsx("input", {
|
|
86
|
+
...control,
|
|
87
|
+
"data-1p-ignore": true,
|
|
88
|
+
className: fieldBox(),
|
|
89
|
+
name,
|
|
90
|
+
value: text,
|
|
91
|
+
type: "text",
|
|
92
|
+
disabled,
|
|
93
|
+
placeholder: field.placeholder ?? "DD-HH:MM:SS",
|
|
94
|
+
onChange: handleChange,
|
|
95
|
+
onFocus: handleFocus,
|
|
96
|
+
onBlur: handleBlur
|
|
97
|
+
}), hasDisableCheckbox && /* @__PURE__ */ jsxs(FieldOption, {
|
|
98
|
+
disabled,
|
|
99
|
+
className: "flex items-center gap-2 text-sm",
|
|
100
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
101
|
+
checked: isSentinel,
|
|
96
102
|
disabled,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
onBlur: handleBlur
|
|
101
|
-
}),
|
|
102
|
-
error && /* @__PURE__ */ jsx("div", {
|
|
103
|
-
className: "text-xs text-red-500 mt-1",
|
|
104
|
-
children: error
|
|
105
|
-
}),
|
|
106
|
-
hasDisableCheckbox && /* @__PURE__ */ jsxs("label", {
|
|
107
|
-
className: clsx("flex items-center gap-2 mt-1", disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"),
|
|
108
|
-
children: [/* @__PURE__ */ jsx("input", {
|
|
109
|
-
type: "checkbox",
|
|
110
|
-
checked: isSentinel,
|
|
111
|
-
disabled,
|
|
112
|
-
onChange: (e) => handleDisableToggle(e.target.checked),
|
|
113
|
-
className: clsx("h-4 w-4 accent-(--theme-link)", disabled ? "cursor-not-allowed" : "cursor-pointer")
|
|
114
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
115
|
-
className: "theme-text",
|
|
116
|
-
children: field.disableLabel
|
|
117
|
-
})]
|
|
118
|
-
})
|
|
119
|
-
] })
|
|
103
|
+
onCheckedChange: handleDisableToggle
|
|
104
|
+
}), field.disableLabel]
|
|
105
|
+
})] })
|
|
120
106
|
});
|
|
121
107
|
}
|
|
122
108
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx } from "../../cx.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/form/Fields/LabelField.tsx
|
|
4
4
|
function LabelField(props) {
|
|
@@ -10,7 +10,7 @@ function LabelField(props) {
|
|
|
10
10
|
whiteSpace: "pre-wrap",
|
|
11
11
|
...field.size ? { fontSize: `${field.size}px` } : {}
|
|
12
12
|
},
|
|
13
|
-
className:
|
|
13
|
+
className: cx("relative", "text-md", field.bold !== false ? "font-bold" : ""),
|
|
14
14
|
children: field.text?.toString().replace(/(\r)/g, "").replace(/(\\n)/g, "\n") || label
|
|
15
15
|
})
|
|
16
16
|
});
|
|
@@ -8,5 +8,5 @@ export interface IMultiDropdownField extends BaseField {
|
|
|
8
8
|
options: MultiDropdownOption[] | Record<string, MultiDropdownOption[]>;
|
|
9
9
|
parentValue?: string | boolean | number;
|
|
10
10
|
}
|
|
11
|
-
export default function MultiDropdownField(
|
|
11
|
+
export default function MultiDropdownField(props: FieldComponentProps<IMultiDropdownField>): import("react").JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { Combobox } from "../../components/Combobox.js";
|
|
2
|
+
import { Field } from "../../components/Field.js";
|
|
2
3
|
import { toFieldItems } from "../utils/fieldItems.js";
|
|
3
|
-
import {
|
|
4
|
+
import { fieldFrame } from "../fieldFrame.js";
|
|
4
5
|
import { useFieldValue } from "../useFieldValue.js";
|
|
5
6
|
import { useDependentOptions } from "../utils/dependentOptions.js";
|
|
6
7
|
import { usePrevious } from "../usePrevious.js";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
9
|
import { useEffect, useMemo } from "react";
|
|
9
10
|
//#region src/form/Fields/MultiDropdownField.tsx
|
|
10
|
-
function MultiDropdownField(
|
|
11
|
+
function MultiDropdownField(props) {
|
|
12
|
+
const { field, disabled, onChange } = props;
|
|
11
13
|
const [value, change] = useFieldValue(field.name ?? "");
|
|
12
14
|
const dependent = useDependentOptions(field.options, field.depends_on);
|
|
13
15
|
const items = useMemo(() => toFieldItems(dependent.options), [dependent.options]);
|
|
@@ -20,15 +22,10 @@ function MultiDropdownField({ field, label, tooltipComponent, labelPosition, spa
|
|
|
20
22
|
parentValue,
|
|
21
23
|
change
|
|
22
24
|
]);
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
labelPosition,
|
|
28
|
-
spaceCompact,
|
|
29
|
-
children: ({ id, describedBy }) => /* @__PURE__ */ jsx(Combobox, {
|
|
30
|
-
id,
|
|
31
|
-
"aria-describedby": describedBy,
|
|
25
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
26
|
+
...fieldFrame(props),
|
|
27
|
+
children: (control) => /* @__PURE__ */ jsx(Combobox, {
|
|
28
|
+
...control,
|
|
32
29
|
multiple: true,
|
|
33
30
|
items,
|
|
34
31
|
value: value ?? [],
|
|
@@ -36,9 +33,7 @@ function MultiDropdownField({ field, label, tooltipComponent, labelPosition, spa
|
|
|
36
33
|
change(next);
|
|
37
34
|
onChange?.(next);
|
|
38
35
|
},
|
|
39
|
-
|
|
40
|
-
disabled,
|
|
41
|
-
"aria-invalid": missing
|
|
36
|
+
disabled
|
|
42
37
|
})
|
|
43
38
|
});
|
|
44
39
|
}
|
|
@@ -10,4 +10,4 @@ export interface INumberField extends BaseField {
|
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
thousandsSeparator?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export default function NumberField(
|
|
13
|
+
export default function NumberField(props: FieldComponentProps<INumberField>): import("react").JSX.Element;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Field } from "../../components/Field.js";
|
|
2
|
+
import { NumberInput } from "../../components/NumberInput.js";
|
|
3
|
+
import { fieldFrame } from "../fieldFrame.js";
|
|
4
4
|
import { useFieldValue } from "../useFieldValue.js";
|
|
5
5
|
import { getPlaceholder } from "../utils/getPlaceholder.js";
|
|
6
|
-
import {
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
7
|
import { useEffect } from "react";
|
|
9
|
-
import { NumberField } from "@base-ui/react/number-field";
|
|
10
8
|
//#region src/form/Fields/NumberField.tsx
|
|
11
9
|
/** A value held as text, as one read from a workflow's inputs may be, still shows as its number. */
|
|
12
10
|
function toNumber(value) {
|
|
@@ -17,23 +15,18 @@ function toNumber(value) {
|
|
|
17
15
|
}
|
|
18
16
|
return null;
|
|
19
17
|
}
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
function NumberField(props) {
|
|
19
|
+
const { field, disabled, onChange } = props;
|
|
22
20
|
const [value, change] = useFieldValue(field.name ?? "");
|
|
23
21
|
const unset = value === void 0 || value === null || value === "";
|
|
24
22
|
const seed = field.prefillDefault && unset ? field.default : void 0;
|
|
25
23
|
useEffect(() => {
|
|
26
24
|
if (seed !== void 0) change(seed);
|
|
27
25
|
}, [seed, change]);
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
description: field.description,
|
|
33
|
-
labelPosition,
|
|
34
|
-
spaceCompact,
|
|
35
|
-
children: ({ id, describedBy }) => /* @__PURE__ */ jsx(NumberField.Root, {
|
|
36
|
-
id,
|
|
26
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
27
|
+
...fieldFrame(props),
|
|
28
|
+
children: (control) => /* @__PURE__ */ jsx(NumberInput, {
|
|
29
|
+
...control,
|
|
37
30
|
name: field.name,
|
|
38
31
|
value: toNumber(value),
|
|
39
32
|
onValueChange: (next) => {
|
|
@@ -45,38 +38,10 @@ function NumberField$1({ field, label, labelPosition, missing, disabled, onChang
|
|
|
45
38
|
max: field.max,
|
|
46
39
|
step: field.step,
|
|
47
40
|
disabled,
|
|
48
|
-
format: {
|
|
49
|
-
|
|
50
|
-
maximumFractionDigits: 20
|
|
51
|
-
},
|
|
52
|
-
children: /* @__PURE__ */ jsxs(NumberField.Group, {
|
|
53
|
-
className: "relative w-full",
|
|
54
|
-
children: [/* @__PURE__ */ jsx(NumberField.Input, {
|
|
55
|
-
"aria-describedby": describedBy,
|
|
56
|
-
"aria-required": field.optional ? void 0 : true,
|
|
57
|
-
"aria-invalid": missing || void 0,
|
|
58
|
-
"data-1p-ignore": true,
|
|
59
|
-
className: clsx("w-full pr-6 tabular-nums", disabled && "disabled", missing && "invalid"),
|
|
60
|
-
placeholder: getPlaceholder(field.placeholder, field.default)
|
|
61
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
62
|
-
className: "absolute inset-y-px right-px flex flex-col",
|
|
63
|
-
children: [/* @__PURE__ */ jsx(NumberField.Increment, {
|
|
64
|
-
className: stepperClassName,
|
|
65
|
-
children: /* @__PURE__ */ jsx(FaAngleUp, {
|
|
66
|
-
"aria-hidden": "true",
|
|
67
|
-
className: "size-3"
|
|
68
|
-
})
|
|
69
|
-
}), /* @__PURE__ */ jsx(NumberField.Decrement, {
|
|
70
|
-
className: stepperClassName,
|
|
71
|
-
children: /* @__PURE__ */ jsx(FaAngleDown, {
|
|
72
|
-
"aria-hidden": "true",
|
|
73
|
-
className: "size-3"
|
|
74
|
-
})
|
|
75
|
-
})]
|
|
76
|
-
})]
|
|
77
|
-
})
|
|
41
|
+
format: { useGrouping: field.thousandsSeparator ?? false },
|
|
42
|
+
placeholder: getPlaceholder(field.placeholder, field.default)
|
|
78
43
|
})
|
|
79
44
|
});
|
|
80
45
|
}
|
|
81
46
|
//#endregion
|
|
82
|
-
export { NumberField
|
|
47
|
+
export { NumberField as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Section } from "../../components/Section.js";
|
|
2
2
|
import { FieldsFromOptions, resolveMetaOverrides } from "../Form.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { useMemo } from "react";
|
|
@@ -7,9 +7,9 @@ function ObjectField({ field, label, tooltipComponent, labelPosition, spaceCompa
|
|
|
7
7
|
const fieldName = field.name ?? "";
|
|
8
8
|
const meta = resolveMetaOverrides(field.options, labelPosition, spaceCompact ?? false);
|
|
9
9
|
const parentInfo = useMemo(() => ({ fieldNamePrefix: `${fieldName}.` }), [fieldName]);
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
+
return /* @__PURE__ */ jsx(Section, {
|
|
11
11
|
title: field.label || label,
|
|
12
|
-
|
|
12
|
+
beside: tooltipComponent,
|
|
13
13
|
collapsible: !field.noCollapse,
|
|
14
14
|
defaultOpen: !field.collapsed,
|
|
15
15
|
children: /* @__PURE__ */ jsx(FieldsFromOptions, {
|
|
@@ -8,4 +8,4 @@ export interface IRadioField extends BaseField {
|
|
|
8
8
|
}>;
|
|
9
9
|
optionLabelPosition?: 'left' | 'top';
|
|
10
10
|
}
|
|
11
|
-
export default function RadioField(
|
|
11
|
+
export default function RadioField(props: FieldComponentProps<IRadioField>): import("react").JSX.Element;
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
+
import { cx } from "../../cx.js";
|
|
2
|
+
import { Field, FieldOption } from "../../components/Field.js";
|
|
1
3
|
import { Radio, RadioGroup } from "../../components/Radio.js";
|
|
2
|
-
import {
|
|
4
|
+
import { fieldFrame } from "../fieldFrame.js";
|
|
3
5
|
import { useFieldValue } from "../useFieldValue.js";
|
|
4
6
|
import { fieldOption } from "./fieldOption.js";
|
|
5
|
-
import { clsx } from "clsx";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
//#region src/form/Fields/RadioField.tsx
|
|
8
|
-
function RadioField(
|
|
9
|
+
function RadioField(props) {
|
|
10
|
+
const { field, error, disabled, onChange } = props;
|
|
9
11
|
const [value, change] = useFieldValue(field.name ?? "");
|
|
10
12
|
const options = (field.options ?? []).map((raw) => ({
|
|
11
13
|
...fieldOption(raw),
|
|
12
14
|
unlabelled: typeof raw !== "object" || raw.label === void 0
|
|
13
15
|
}));
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
labelPosition,
|
|
19
|
-
spaceCompact,
|
|
20
|
-
children: ({ labelId, describedBy }) => /* @__PURE__ */ jsx(RadioGroup, {
|
|
21
|
-
"aria-labelledby": labelId,
|
|
22
|
-
"aria-describedby": describedBy,
|
|
16
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
17
|
+
...fieldFrame(props, { group: true }),
|
|
18
|
+
children: (control) => /* @__PURE__ */ jsx(RadioGroup, {
|
|
19
|
+
...control,
|
|
23
20
|
name: field.name,
|
|
24
|
-
required: !field.optional,
|
|
25
21
|
disabled,
|
|
26
22
|
value: value === void 0 || value === null ? null : String(value),
|
|
27
23
|
onValueChange: (next) => {
|
|
@@ -29,14 +25,15 @@ function RadioField({ field, label, labelPosition, missing, disabled, onChange,
|
|
|
29
25
|
onChange?.(picked);
|
|
30
26
|
change(picked);
|
|
31
27
|
},
|
|
32
|
-
className:
|
|
33
|
-
children: options.map((option) => /* @__PURE__ */ jsxs(
|
|
34
|
-
|
|
28
|
+
className: cx("flex py-1.5", field.optionLabelPosition === "top" ? "flex-col gap-2" : "flex-row flex-wrap gap-x-5 gap-y-2"),
|
|
29
|
+
children: options.map((option) => /* @__PURE__ */ jsxs(FieldOption, {
|
|
30
|
+
disabled,
|
|
31
|
+
className: "flex items-center gap-2",
|
|
35
32
|
children: [/* @__PURE__ */ jsx(Radio, {
|
|
36
33
|
value: option.value,
|
|
37
|
-
"aria-invalid":
|
|
34
|
+
"aria-invalid": error !== void 0 || void 0
|
|
38
35
|
}), /* @__PURE__ */ jsx("span", {
|
|
39
|
-
className:
|
|
36
|
+
className: cx("theme-text", option.unlabelled && "capitalize"),
|
|
40
37
|
children: option.label
|
|
41
38
|
})]
|
|
42
39
|
}, option.value))
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Field } from "../../components/Field.js";
|
|
2
|
+
import { NumberInput } from "../../components/NumberInput.js";
|
|
3
|
+
import { Slider } from "../../components/Slider.js";
|
|
4
|
+
import { fieldFrame } from "../fieldFrame.js";
|
|
2
5
|
import { useFieldValue } from "../useFieldValue.js";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
7
|
import { useEffect } from "react";
|
|
6
8
|
import { useFormContext } from "react-hook-form";
|
|
7
9
|
//#region src/form/Fields/RangeField.tsx
|
|
10
|
+
/** A value held as text, as one read from a workflow's inputs may be, still places the slider. */
|
|
11
|
+
function toNumber(value) {
|
|
12
|
+
const number = typeof value === "string" && value.trim() !== "" ? Number(value) : value;
|
|
13
|
+
return typeof number === "number" && Number.isFinite(number) ? number : null;
|
|
14
|
+
}
|
|
8
15
|
function RangeField(props) {
|
|
9
|
-
const { field, label,
|
|
16
|
+
const { field, label, disabled, onChange } = props;
|
|
10
17
|
const name = field.name ?? "";
|
|
11
18
|
const [value, change] = useFieldValue(name);
|
|
12
19
|
const { setValue } = useFormContext();
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
onChange?.(val);
|
|
19
|
-
}
|
|
20
|
+
const set = (next) => {
|
|
21
|
+
if (next === null) return;
|
|
22
|
+
const clamped = Math.max(field.min, Math.min(field.max, next));
|
|
23
|
+
change(clamped);
|
|
24
|
+
onChange?.(clamped);
|
|
20
25
|
};
|
|
21
26
|
const seedValue = field.default ?? field.min;
|
|
22
27
|
const seed = (value === void 0 || value === null) && seedValue !== void 0;
|
|
@@ -28,36 +33,30 @@ function RangeField(props) {
|
|
|
28
33
|
name,
|
|
29
34
|
setValue
|
|
30
35
|
]);
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
id,
|
|
43
|
-
type: "number",
|
|
44
|
-
value: currentValue,
|
|
36
|
+
const current = toNumber(value) ?? seedValue;
|
|
37
|
+
const step = field.step || 1;
|
|
38
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
39
|
+
...fieldFrame(props),
|
|
40
|
+
children: (control) => /* @__PURE__ */ jsxs("div", {
|
|
41
|
+
className: "flex items-center gap-4",
|
|
42
|
+
children: [/* @__PURE__ */ jsx(NumberInput, {
|
|
43
|
+
...control,
|
|
44
|
+
name: field.name,
|
|
45
|
+
value: current,
|
|
46
|
+
onValueChange: set,
|
|
45
47
|
min: field.min,
|
|
46
48
|
max: field.max,
|
|
47
|
-
step
|
|
49
|
+
step,
|
|
48
50
|
disabled,
|
|
49
|
-
|
|
50
|
-
}), /* @__PURE__ */ jsx(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
type: "range",
|
|
55
|
-
"aria-labelledby": labelId,
|
|
51
|
+
className: "w-28 shrink-0"
|
|
52
|
+
}), /* @__PURE__ */ jsx(Slider, {
|
|
53
|
+
"aria-label": label,
|
|
54
|
+
value: current,
|
|
55
|
+
onValueChange: set,
|
|
56
56
|
min: field.min,
|
|
57
57
|
max: field.max,
|
|
58
|
-
step
|
|
59
|
-
disabled
|
|
60
|
-
onChange: handleChange
|
|
58
|
+
step,
|
|
59
|
+
disabled
|
|
61
60
|
})]
|
|
62
61
|
})
|
|
63
62
|
});
|
|
@@ -13,4 +13,4 @@ export interface IStringField extends BaseField {
|
|
|
13
13
|
sanitize?: string;
|
|
14
14
|
prefillDefault?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export default function StringField(
|
|
16
|
+
export default function StringField(props: FieldComponentProps<IStringField>): import("react").JSX.Element;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cx } from "../../cx.js";
|
|
2
|
+
import { fieldBox } from "../../components/fieldBox.js";
|
|
3
|
+
import { Field, RevealToggle } from "../../components/Field.js";
|
|
4
|
+
import { fieldFrame } from "../fieldFrame.js";
|
|
4
5
|
import { useFieldValue } from "../useFieldValue.js";
|
|
5
6
|
import { getPlaceholder } from "../utils/getPlaceholder.js";
|
|
6
|
-
import { clsx } from "clsx";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { useMemo, useState } from "react";
|
|
9
9
|
//#region src/form/Fields/StringField.tsx
|
|
10
|
-
function StringField(
|
|
10
|
+
function StringField(props) {
|
|
11
|
+
const { field, disabled, onChange } = props;
|
|
11
12
|
const [value, change] = useFieldValue(field.name ?? "");
|
|
12
13
|
const [revealed, setRevealed] = useState(false);
|
|
13
14
|
const password = field.type === "password";
|
|
@@ -28,23 +29,16 @@ function StringField({ field, label, labelPosition, missing, disabled, onChange,
|
|
|
28
29
|
onChange?.(next);
|
|
29
30
|
change(next);
|
|
30
31
|
};
|
|
31
|
-
return /* @__PURE__ */ jsx(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
tooltipComponent,
|
|
35
|
-
description: field.description,
|
|
36
|
-
labelPosition,
|
|
37
|
-
spaceCompact,
|
|
38
|
-
children: ({ id, describedBy }) => {
|
|
32
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
33
|
+
...fieldFrame(props),
|
|
34
|
+
children: (control) => {
|
|
39
35
|
const input = /* @__PURE__ */ jsx("input", {
|
|
40
|
-
|
|
41
|
-
"aria-describedby": describedBy,
|
|
36
|
+
...control,
|
|
42
37
|
"data-1p-ignore": true,
|
|
43
|
-
className:
|
|
38
|
+
className: cx(fieldBox(), password && "pr-9"),
|
|
44
39
|
name: field.name,
|
|
45
40
|
value: password && value === fallback ? "" : value ?? "",
|
|
46
41
|
type: password && !revealed ? "password" : "text",
|
|
47
|
-
"aria-required": field.optional ? void 0 : true,
|
|
48
42
|
disabled,
|
|
49
43
|
placeholder: password && field.placeholder === void 0 ? "•".repeat(fallback.toString().length > 0 ? 16 : 0) : getPlaceholder(field.placeholder, field.default),
|
|
50
44
|
minLength: field.minLength,
|
|
@@ -53,14 +47,10 @@ function StringField({ field, label, labelPosition, missing, disabled, onChange,
|
|
|
53
47
|
});
|
|
54
48
|
return password ? /* @__PURE__ */ jsxs("div", {
|
|
55
49
|
className: "relative w-full",
|
|
56
|
-
children: [input, /* @__PURE__ */ jsx(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
disabled,
|
|
61
|
-
tabIndex: -1,
|
|
62
|
-
"aria-label": revealed ? "Hide value" : "Show value",
|
|
63
|
-
children: revealed ? /* @__PURE__ */ jsx(LuEyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(LuEye, { className: "h-4 w-4" })
|
|
50
|
+
children: [input, /* @__PURE__ */ jsx(RevealToggle, {
|
|
51
|
+
revealed,
|
|
52
|
+
onRevealedChange: setRevealed,
|
|
53
|
+
disabled
|
|
64
54
|
})]
|
|
65
55
|
}) : input;
|
|
66
56
|
}
|