@flowdrop/flowdrop 2.13.0 → 2.15.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/CHANGELOG.md +82 -0
- package/dist/commands/executor.js +58 -8
- package/dist/commands/parser.js +3 -3
- package/dist/commands/types.d.ts +8 -2
- package/dist/commands/uiActionTarget.d.ts +24 -0
- package/dist/commands/uiActionTarget.js +31 -0
- package/dist/commands/validate.d.ts +15 -0
- package/dist/commands/validate.js +115 -0
- package/dist/components/App.svelte +44 -2
- package/dist/components/App.svelte.d.ts +3 -1
- package/dist/components/Button.svelte +7 -7
- package/dist/components/Button.svelte.d.ts +10 -0
- package/dist/components/CanvasBanner.svelte +19 -6
- package/dist/components/CanvasBanner.svelte.d.ts +15 -3
- package/dist/components/CanvasContextMenu.svelte +9 -9
- package/dist/components/CanvasContextMenu.svelte.d.ts +10 -0
- package/dist/components/CanvasToolbar.svelte +8 -7
- package/dist/components/CanvasToolbar.svelte.d.ts +10 -0
- package/dist/components/CanvasZoomControls.svelte +10 -9
- package/dist/components/CanvasZoomControls.svelte.d.ts +13 -0
- package/dist/components/ConfigForm.svelte +51 -18
- package/dist/components/ConfigForm.svelte.d.ts +20 -1
- package/dist/components/ConfigPanel.svelte +9 -5
- package/dist/components/ConfigPanel.svelte.d.ts +10 -0
- package/dist/components/EditorStatusBar.svelte +6 -5
- package/dist/components/EditorStatusBar.svelte.d.ts +7 -0
- package/dist/components/ExternalLinkRow.svelte +16 -1
- package/dist/components/ExternalLinkRow.svelte.d.ts +5 -0
- package/dist/components/FlowDropEdge.svelte +15 -12
- package/dist/components/FlowDropEdge.svelte.d.ts +16 -0
- package/dist/components/InterfaceTag.svelte +13 -15
- package/dist/components/InterfaceTag.svelte.d.ts +19 -0
- package/dist/components/LoadingSpinner.svelte +8 -2
- package/dist/components/LoadingSpinner.svelte.d.ts +9 -0
- package/dist/components/Logo.svelte +11 -0
- package/dist/components/Logo.svelte.d.ts +9 -0
- package/dist/components/LogoWordmark.svelte +8 -3
- package/dist/components/LogoWordmark.svelte.d.ts +9 -0
- package/dist/components/LoopbackLanes.svelte +12 -6
- package/dist/components/LoopbackLanes.svelte.d.ts +13 -0
- package/dist/components/MarkdownDisplay.svelte +10 -3
- package/dist/components/MarkdownDisplay.svelte.d.ts +11 -0
- package/dist/components/Navbar.svelte +13 -5
- package/dist/components/Navbar.svelte.d.ts +14 -0
- package/dist/components/NodeInspector.svelte +7 -8
- package/dist/components/NodeInspector.svelte.d.ts +10 -0
- package/dist/components/NodeSidebar.svelte +9 -3
- package/dist/components/NodeSidebar.svelte.d.ts +10 -0
- package/dist/components/NodeStatusOverlay.svelte +30 -19
- package/dist/components/NodeStatusOverlay.svelte.d.ts +19 -0
- package/dist/components/NodeSwapPicker.svelte +1 -1
- package/dist/components/RunBar.svelte +10 -13
- package/dist/components/RunBar.svelte.d.ts +15 -0
- package/dist/components/RunsMenu.svelte +14 -13
- package/dist/components/RunsMenu.svelte.d.ts +15 -0
- package/dist/components/SchemaForm.svelte +10 -13
- package/dist/components/SchemaForm.svelte.d.ts +51 -0
- package/dist/components/SettingsPanel.svelte +5 -5
- package/dist/components/StatusIcon.svelte +14 -3
- package/dist/components/StatusIcon.svelte.d.ts +15 -0
- package/dist/components/StatusLabel.svelte +10 -2
- package/dist/components/StatusLabel.svelte.d.ts +11 -0
- package/dist/components/ThemeToggle.svelte +8 -5
- package/dist/components/ThemeToggle.svelte.d.ts +10 -0
- package/dist/components/UniversalNode.svelte +13 -5
- package/dist/components/UniversalNode.svelte.d.ts +15 -0
- package/dist/components/WorkflowInterfaceEntryCard.svelte +1 -1
- package/dist/components/WorkflowInterfaceEntryComposer.svelte +1 -2
- package/dist/components/ZoomTier.svelte +13 -10
- package/dist/components/ZoomTier.svelte.d.ts +14 -0
- package/dist/components/console/CommandConsole.svelte +9 -3
- package/dist/components/console/CommandConsole.svelte.d.ts +10 -0
- package/dist/components/console/ConsoleAutocomplete.svelte +4 -4
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +5 -0
- package/dist/components/console/ConsoleInput.svelte +6 -4
- package/dist/components/console/ConsoleInput.svelte.d.ts +7 -0
- package/dist/components/console/ConsoleOutput.svelte +5 -3
- package/dist/components/console/ConsoleOutput.svelte.d.ts +6 -0
- package/dist/components/console/ConsoleStrip.svelte +9 -5
- package/dist/components/console/ConsoleStrip.svelte.d.ts +10 -0
- package/dist/components/form/FieldFactory.svelte +6 -2
- package/dist/components/form/FieldFactory.svelte.d.ts +46 -0
- package/dist/components/form/FormArray.svelte +9 -16
- package/dist/components/form/FormArray.svelte.d.ts +10 -0
- package/dist/components/form/FormArrayRows.svelte +8 -8
- package/dist/components/form/FormArrayRows.svelte.d.ts +11 -0
- package/dist/components/form/FormAutocomplete.svelte +6 -3
- package/dist/components/form/FormAutocomplete.svelte.d.ts +23 -0
- package/dist/components/form/FormCheckboxGroup.svelte +5 -5
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +6 -0
- package/dist/components/form/FormCodeEditor.svelte +8 -13
- package/dist/components/form/FormCodeEditor.svelte.d.ts +9 -0
- package/dist/components/form/FormField.svelte +7 -8
- package/dist/components/form/FormField.svelte.d.ts +10 -0
- package/dist/components/form/FormFieldLight.svelte +6 -5
- package/dist/components/form/FormFieldLight.svelte.d.ts +8 -0
- package/dist/components/form/FormFieldWrapper.svelte +8 -8
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +9 -0
- package/dist/components/form/FormFieldset.svelte +6 -12
- package/dist/components/form/FormFieldset.svelte.d.ts +7 -0
- package/dist/components/form/FormMarkdownEditor.svelte +8 -15
- package/dist/components/form/FormMarkdownEditor.svelte.d.ts +9 -0
- package/dist/components/form/FormNumberField.svelte +5 -7
- package/dist/components/form/FormNumberField.svelte.d.ts +6 -0
- package/dist/components/form/FormPorts.svelte +133 -27
- package/dist/components/form/FormPorts.svelte.d.ts +19 -0
- package/dist/components/form/FormRangeField.svelte +5 -9
- package/dist/components/form/FormRangeField.svelte.d.ts +6 -0
- package/dist/components/form/FormSelect.svelte +5 -7
- package/dist/components/form/FormSelect.svelte.d.ts +6 -0
- package/dist/components/form/FormTemplateEditor.svelte +8 -16
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +9 -0
- package/dist/components/form/FormTextField.svelte +5 -7
- package/dist/components/form/FormTextField.svelte.d.ts +6 -0
- package/dist/components/form/FormTextarea.svelte +5 -7
- package/dist/components/form/FormTextarea.svelte.d.ts +6 -0
- package/dist/components/form/FormToggle.svelte +6 -8
- package/dist/components/form/FormToggle.svelte.d.ts +7 -0
- package/dist/components/form/FormUISchemaRenderer.svelte +5 -9
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +7 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +6 -6
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +7 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte +6 -5
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +7 -0
- package/dist/components/interrupt/FormPrompt.svelte +6 -6
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +7 -0
- package/dist/components/interrupt/InterruptBubble.svelte +10 -9
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +11 -0
- package/dist/components/interrupt/ReviewPrompt.svelte +5 -6
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +7 -0
- package/dist/components/interrupt/TextInputPrompt.svelte +6 -6
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +7 -0
- package/dist/components/nodes/AtomNode.svelte +31 -6
- package/dist/components/nodes/AtomNode.svelte.d.ts +15 -0
- package/dist/components/nodes/CaptionNode.svelte +50 -7
- package/dist/components/nodes/CaptionNode.svelte.d.ts +13 -0
- package/dist/components/nodes/GatewayNode.svelte +18 -11
- package/dist/components/nodes/GatewayNode.svelte.d.ts +21 -0
- package/dist/components/nodes/IdeaNode.svelte +47 -6
- package/dist/components/nodes/IdeaNode.svelte.d.ts +17 -0
- package/dist/components/nodes/NodeCard.svelte +26 -18
- package/dist/components/nodes/NodeCard.svelte.d.ts +20 -0
- package/dist/components/nodes/NodeConfigButton.svelte +15 -2
- package/dist/components/nodes/NodeConfigButton.svelte.d.ts +11 -0
- package/dist/components/nodes/NodeProblemMark.svelte +15 -10
- package/dist/components/nodes/NodeProblemMark.svelte.d.ts +16 -0
- package/dist/components/nodes/NodeTip.svelte +10 -7
- package/dist/components/nodes/NodeTip.svelte.d.ts +13 -0
- package/dist/components/nodes/NotesNode.svelte +30 -0
- package/dist/components/nodes/NotesNode.svelte.d.ts +14 -0
- package/dist/components/nodes/SimpleNode.svelte +35 -8
- package/dist/components/nodes/SimpleNode.svelte.d.ts +17 -0
- package/dist/components/nodes/SquareNode.svelte +38 -8
- package/dist/components/nodes/SquareNode.svelte.d.ts +17 -0
- package/dist/components/nodes/TerminalNode.svelte +24 -10
- package/dist/components/nodes/TerminalNode.svelte.d.ts +17 -0
- package/dist/components/nodes/ToolNode.svelte +14 -5
- package/dist/components/nodes/ToolNode.svelte.d.ts +15 -0
- package/dist/components/nodes/WorkflowNode.svelte +18 -15
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +21 -0
- package/dist/components/playground/ChatBubble.svelte +4 -3
- package/dist/components/playground/ChatBubble.svelte.d.ts +5 -0
- package/dist/components/playground/ChatInput.svelte +11 -6
- package/dist/components/playground/ChatInput.svelte.d.ts +14 -0
- package/dist/components/playground/ChatPanel.svelte +15 -7
- package/dist/components/playground/ChatPanel.svelte.d.ts +17 -0
- package/dist/components/playground/ControlPanel.svelte +26 -9
- package/dist/components/playground/ControlPanel.svelte.d.ts +29 -0
- package/dist/components/playground/DockedPlayground.svelte +7 -10
- package/dist/components/playground/DockedPlayground.svelte.d.ts +10 -0
- package/dist/components/playground/ExecutionConsole.svelte +10 -5
- package/dist/components/playground/ExecutionConsole.svelte.d.ts +12 -0
- package/dist/components/playground/ExecutionList.svelte +13 -0
- package/dist/components/playground/ExecutionList.svelte.d.ts +11 -0
- package/dist/components/playground/ExecutionLogs.svelte +6 -9
- package/dist/components/playground/ExecutionLogs.svelte.d.ts +7 -0
- package/dist/components/playground/HeaderMenu.svelte +6 -8
- package/dist/components/playground/HeaderMenu.svelte.d.ts +9 -0
- package/dist/components/playground/HierarchyTrail.svelte +6 -6
- package/dist/components/playground/HierarchyTrail.svelte.d.ts +8 -0
- package/dist/components/playground/InputCollector.svelte +6 -5
- package/dist/components/playground/InputCollector.svelte.d.ts +7 -0
- package/dist/components/playground/InputFields.svelte +8 -12
- package/dist/components/playground/InputFields.svelte.d.ts +9 -0
- package/dist/components/playground/InterfaceInputForm.svelte +6 -13
- package/dist/components/playground/InterfaceInputForm.svelte.d.ts +9 -0
- package/dist/components/playground/InterfaceJsonInput.svelte +6 -5
- package/dist/components/playground/InterfaceJsonInput.svelte.d.ts +8 -0
- package/dist/components/playground/LogRow.svelte +4 -5
- package/dist/components/playground/LogRow.svelte.d.ts +6 -0
- package/dist/components/playground/MessageBubble.svelte +13 -7
- package/dist/components/playground/MessageBubble.svelte.d.ts +15 -0
- package/dist/components/playground/MessageCard.svelte +5 -2
- package/dist/components/playground/MessageCard.svelte.d.ts +6 -0
- package/dist/components/playground/MessageMarkdown.svelte +8 -9
- package/dist/components/playground/MessageMarkdown.svelte.d.ts +11 -0
- package/dist/components/playground/MessageNotice.svelte +7 -0
- package/dist/components/playground/MessageNotice.svelte.d.ts +5 -0
- package/dist/components/playground/MessageStream.svelte +8 -6
- package/dist/components/playground/MessageStream.svelte.d.ts +11 -0
- package/dist/components/playground/MessageTagChip.svelte +7 -7
- package/dist/components/playground/MessageTagChip.svelte.d.ts +10 -0
- package/dist/components/playground/MessageTagStrip.svelte +6 -3
- package/dist/components/playground/MessageTagStrip.svelte.d.ts +8 -0
- package/dist/components/playground/OriginBadge.svelte +7 -4
- package/dist/components/playground/OriginBadge.svelte.d.ts +8 -0
- package/dist/components/playground/PipelineKanbanView.svelte +14 -0
- package/dist/components/playground/PipelineKanbanView.svelte.d.ts +12 -0
- package/dist/components/playground/PipelinePanel.svelte +14 -0
- package/dist/components/playground/PipelinePanel.svelte.d.ts +12 -0
- package/dist/components/playground/PipelineTableView.svelte +14 -0
- package/dist/components/playground/PipelineTableView.svelte.d.ts +12 -0
- package/dist/components/playground/Playground.svelte +17 -11
- package/dist/components/playground/Playground.svelte.d.ts +20 -0
- package/dist/components/playground/PlaygroundApp.svelte +24 -10
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +26 -0
- package/dist/components/playground/PlaygroundHeader.svelte +8 -12
- package/dist/components/playground/PlaygroundHeader.svelte.d.ts +11 -0
- package/dist/components/playground/PlaygroundModal.svelte +6 -8
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +7 -0
- package/dist/components/playground/PlaygroundStudio.svelte +9 -0
- package/dist/components/playground/PlaygroundStudio.svelte.d.ts +7 -0
- package/dist/components/playground/PlaygroundSurface.svelte +19 -14
- package/dist/components/playground/PlaygroundSurface.svelte.d.ts +20 -0
- package/dist/components/playground/SessionManager.svelte +6 -5
- package/dist/components/playground/SessionManager.svelte.d.ts +7 -0
- package/dist/components/playground/StepsSummary.svelte +8 -9
- package/dist/components/playground/StepsSummary.svelte.d.ts +10 -0
- package/dist/components/primitives/Button.svelte +15 -7
- package/dist/components/primitives/Button.svelte.d.ts +18 -1
- package/dist/components/primitives/Card.svelte +8 -6
- package/dist/components/primitives/Card.svelte.d.ts +11 -0
- package/dist/components/primitives/Checkbox.svelte +8 -5
- package/dist/components/primitives/Checkbox.svelte.d.ts +11 -0
- package/dist/components/primitives/Chip.svelte +8 -4
- package/dist/components/primitives/Chip.svelte.d.ts +11 -0
- package/dist/components/primitives/Combobox.svelte +27 -18
- package/dist/components/primitives/Combobox.svelte.d.ts +33 -0
- package/dist/components/primitives/Composer.svelte +15 -16
- package/dist/components/primitives/Composer.svelte.d.ts +20 -0
- package/dist/components/primitives/EmptyState.svelte +9 -3
- package/dist/components/primitives/EmptyState.svelte.d.ts +11 -0
- package/dist/components/primitives/Field.svelte +12 -9
- package/dist/components/primitives/Field.svelte.d.ts +16 -0
- package/dist/components/primitives/IconButton.svelte +10 -5
- package/dist/components/primitives/IconButton.svelte.d.ts +13 -0
- package/dist/components/primitives/Menu.svelte +15 -14
- package/dist/components/primitives/Menu.svelte.d.ts +20 -0
- package/dist/components/primitives/Notice.svelte +11 -8
- package/dist/components/primitives/Notice.svelte.d.ts +14 -0
- package/dist/components/primitives/PanelHeader.svelte +10 -7
- package/dist/components/primitives/PanelHeader.svelte.d.ts +13 -0
- package/dist/components/primitives/Segmented.svelte +11 -4
- package/dist/components/primitives/Segmented.svelte.d.ts +14 -0
- package/dist/components/primitives/Select.svelte +13 -16
- package/dist/components/primitives/Select.svelte.d.ts +18 -0
- package/dist/components/primitives/StatusPill.svelte +11 -8
- package/dist/components/primitives/StatusPill.svelte.d.ts +15 -0
- package/dist/components/primitives/Switch.svelte +9 -6
- package/dist/components/primitives/Switch.svelte.d.ts +12 -0
- package/dist/components/primitives/Tabs.svelte +16 -15
- package/dist/components/primitives/Tabs.svelte.d.ts +22 -0
- package/dist/components/primitives/Toolbar.svelte +14 -13
- package/dist/components/primitives/Toolbar.svelte.d.ts +18 -0
- package/dist/components/primitives/ToolbarSeparator.svelte +5 -4
- package/dist/components/primitives/ToolbarSeparator.svelte.d.ts +7 -0
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/editor/index.d.ts +3 -3
- package/dist/index.d.ts +3 -2
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/layout/toWorkflow.d.ts +8 -7
- package/dist/layout/toWorkflow.js +20 -40
- package/dist/messages/defaults.d.ts +24 -0
- package/dist/messages/defaults.js +15 -0
- package/dist/skins/graphite.d.ts +1 -1
- package/dist/skins/graphite.js +1 -1
- package/dist/stores/settingsStore.svelte.js +3 -0
- package/dist/stores/workflowStore.svelte.d.ts +10 -0
- package/dist/stores/workflowStore.svelte.js +65 -20
- package/dist/styles/base.css +2 -126
- package/dist/styles/tokenAliases.js +1 -0
- package/dist/styles/tokens.css +9 -5
- package/dist/svelte-app.d.ts +63 -2
- package/dist/svelte-app.js +144 -1
- package/dist/themes/classic.d.ts +9 -0
- package/dist/themes/classic.js +16 -0
- package/dist/themes/index.d.ts +7 -2
- package/dist/themes/index.js +20 -10
- package/dist/types/events.d.ts +18 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/types/settings.d.ts +6 -2
- package/dist/types/theme.d.ts +6 -2
- package/dist/utils/externalEdit.svelte.d.ts +48 -0
- package/dist/utils/externalEdit.svelte.js +62 -0
- package/dist/utils/inspectorContext.d.ts +5 -0
- package/dist/utils/playgroundChat.d.ts +10 -0
- package/dist/utils/playgroundChat.js +25 -0
- package/dist/utils/portExposure.d.ts +24 -1
- package/dist/utils/portExposure.js +46 -13
- package/dist/utils/portUtils.d.ts +5 -1
- package/dist/utils/portUtils.js +15 -4
- package/package.json +2 -1
- package/dist/components/IconButton.svelte +0 -80
- package/dist/components/IconButton.svelte.d.ts +0 -30
- package/dist/themes/default.d.ts +0 -2
- package/dist/themes/default.js +0 -9
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
2
|
+
@component
|
|
3
|
+
Combobox: the searchable rendering of `Select`.
|
|
3
4
|
|
|
4
|
-
An ARIA 1.2 editable combobox with a listbox popup
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"n of m"; options with a `group` are listed under their title.
|
|
5
|
+
An ARIA 1.2 editable combobox with a listbox popup. The input keeps focus the whole time and
|
|
6
|
+
the highlighted option is named by `aria-activedescendant`. Typing filters by label,
|
|
7
|
+
description and group (every word has to match) and bolds what matched. A status line
|
|
8
|
+
says "n of m". Options with a `group` are listed under their title.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
the editor clears the selection on Escape), Tab closes without choosing.
|
|
14
|
-
A click outside closes it.
|
|
10
|
+
Keys: ArrowDown/ArrowUp open the list and move the highlight (disabled options are
|
|
11
|
+
skipped), Home/End jump to the ends, Enter chooses, Escape closes and drops the query, Tab
|
|
12
|
+
closes without choosing. A click outside closes it.
|
|
15
13
|
|
|
16
|
-
Closed, the field shows the chosen
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
clips it (the same as `Menu`).
|
|
14
|
+
Closed, the field shows the chosen label. Open, it is the search box and the label moves
|
|
15
|
+
to the placeholder. The popup sits under the field and is as wide as it. It is not
|
|
16
|
+
portalled, so a host that clips overflow clips it too (same as `Menu`).
|
|
20
17
|
|
|
21
|
-
Use it through `Select
|
|
22
|
-
|
|
18
|
+
**Use it** through `Select`, which picks this rendering for long, grouped or described lists.
|
|
19
|
+
**Not for** a short flat list; use `Select`, which then renders the browser's own `<select>`.
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
Not exported from the package; the API may still change.
|
|
25
22
|
-->
|
|
26
23
|
|
|
27
24
|
<script lang="ts">
|
|
@@ -37,21 +34,33 @@
|
|
|
37
34
|
} from '../../utils/selectOptions.js';
|
|
38
35
|
|
|
39
36
|
interface Props {
|
|
37
|
+
/** The options, optionally with a `description` and a `group`. */
|
|
40
38
|
options: SelectOption[];
|
|
41
39
|
/** The chosen option's value; '' (or any unknown value) is "nothing chosen". */
|
|
42
40
|
value?: string;
|
|
41
|
+
/** Runs with the new value when the user chooses an option. */
|
|
43
42
|
onValueChange?: (value: string) => void;
|
|
43
|
+
/** Id of the input, for a `<label for>`. */
|
|
44
44
|
id?: string;
|
|
45
|
+
/** Form field name. */
|
|
45
46
|
name?: string;
|
|
47
|
+
/** Disables the field. */
|
|
46
48
|
disabled?: boolean;
|
|
49
|
+
/** Shows the error border. */
|
|
47
50
|
invalid?: boolean;
|
|
51
|
+
/** Field height, matching Button: `sm` 24, `md` 28, `lg` 32. */
|
|
48
52
|
size?: 'sm' | 'md' | 'lg';
|
|
49
53
|
/** Shown when nothing is chosen. */
|
|
50
54
|
placeholder?: string;
|
|
55
|
+
/** Extra classes on the input. */
|
|
51
56
|
class?: string;
|
|
57
|
+
/** Accessible name when there is no visible label. */
|
|
52
58
|
'aria-label'?: string;
|
|
59
|
+
/** Id of the element that names the field. */
|
|
53
60
|
'aria-labelledby'?: string;
|
|
61
|
+
/** Id(s) of help or error text for the field. */
|
|
54
62
|
'aria-describedby'?: string;
|
|
63
|
+
/** Marks the field as required for screen readers. */
|
|
55
64
|
'aria-required'?: boolean | 'true' | 'false';
|
|
56
65
|
}
|
|
57
66
|
|
|
@@ -1,22 +1,55 @@
|
|
|
1
1
|
import { type SelectOption } from '../../utils/selectOptions.js';
|
|
2
2
|
interface Props {
|
|
3
|
+
/** The options, optionally with a `description` and a `group`. */
|
|
3
4
|
options: SelectOption[];
|
|
4
5
|
/** The chosen option's value; '' (or any unknown value) is "nothing chosen". */
|
|
5
6
|
value?: string;
|
|
7
|
+
/** Runs with the new value when the user chooses an option. */
|
|
6
8
|
onValueChange?: (value: string) => void;
|
|
9
|
+
/** Id of the input, for a `<label for>`. */
|
|
7
10
|
id?: string;
|
|
11
|
+
/** Form field name. */
|
|
8
12
|
name?: string;
|
|
13
|
+
/** Disables the field. */
|
|
9
14
|
disabled?: boolean;
|
|
15
|
+
/** Shows the error border. */
|
|
10
16
|
invalid?: boolean;
|
|
17
|
+
/** Field height, matching Button: `sm` 24, `md` 28, `lg` 32. */
|
|
11
18
|
size?: 'sm' | 'md' | 'lg';
|
|
12
19
|
/** Shown when nothing is chosen. */
|
|
13
20
|
placeholder?: string;
|
|
21
|
+
/** Extra classes on the input. */
|
|
14
22
|
class?: string;
|
|
23
|
+
/** Accessible name when there is no visible label. */
|
|
15
24
|
'aria-label'?: string;
|
|
25
|
+
/** Id of the element that names the field. */
|
|
16
26
|
'aria-labelledby'?: string;
|
|
27
|
+
/** Id(s) of help or error text for the field. */
|
|
17
28
|
'aria-describedby'?: string;
|
|
29
|
+
/** Marks the field as required for screen readers. */
|
|
18
30
|
'aria-required'?: boolean | 'true' | 'false';
|
|
19
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Combobox: the searchable rendering of `Select`.
|
|
34
|
+
*
|
|
35
|
+
* An ARIA 1.2 editable combobox with a listbox popup. The input keeps focus the whole time and
|
|
36
|
+
* the highlighted option is named by `aria-activedescendant`. Typing filters by label,
|
|
37
|
+
* description and group (every word has to match) and bolds what matched. A status line
|
|
38
|
+
* says "n of m". Options with a `group` are listed under their title.
|
|
39
|
+
*
|
|
40
|
+
* Keys: ArrowDown/ArrowUp open the list and move the highlight (disabled options are
|
|
41
|
+
* skipped), Home/End jump to the ends, Enter chooses, Escape closes and drops the query, Tab
|
|
42
|
+
* closes without choosing. A click outside closes it.
|
|
43
|
+
*
|
|
44
|
+
* Closed, the field shows the chosen label. Open, it is the search box and the label moves
|
|
45
|
+
* to the placeholder. The popup sits under the field and is as wide as it. It is not
|
|
46
|
+
* portalled, so a host that clips overflow clips it too (same as `Menu`).
|
|
47
|
+
*
|
|
48
|
+
* **Use it** through `Select`, which picks this rendering for long, grouped or described lists.
|
|
49
|
+
* **Not for** a short flat list; use `Select`, which then renders the browser's own `<select>`.
|
|
50
|
+
*
|
|
51
|
+
* Not exported from the package; the API may still change.
|
|
52
|
+
*/
|
|
20
53
|
declare const Combobox: import("svelte").Component<Props, {}, "">;
|
|
21
54
|
type Combobox = ReturnType<typeof Combobox>;
|
|
22
55
|
export default Combobox;
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
2
|
+
@component
|
|
3
|
+
Composer: an auto-growing message box with a send (or stop) button.
|
|
3
4
|
|
|
4
|
-
The textarea grows from one
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
clear `value` after sending; the caller decides (clear it in `onsubmit`).
|
|
5
|
+
The textarea grows from one row up to `maxRows`, then scrolls. Enter sends, Shift+Enter adds
|
|
6
|
+
a newline, and Enter during IME composition never sends. The component does not clear
|
|
7
|
+
`value` after sending; clear it in `onsubmit`.
|
|
8
8
|
|
|
9
|
-
`busy` turns
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
`busy` turns send into stop (`onstop`) and blocks sending. The stop button stays enabled
|
|
10
|
+
even when `disabled` is set, so a run in flight can always be stopped. `sendDisabled` blocks
|
|
11
|
+
send on top of the built-in checks, and `sendLabel` renames the button.
|
|
12
12
|
|
|
13
|
-
A host can
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
a command palette). `sendDisabled` blocks the send button on top of the
|
|
17
|
-
built-in blank/busy/disabled checks, and `sendLabel` renames it ("Save & send").
|
|
18
|
-
The stop button is never greyed out by `disabled`: a run in flight must stay
|
|
19
|
-
stoppable while the field is locked.
|
|
13
|
+
A host can listen to keys (`onkeydown` runs first; `preventDefault()` keeps the composer's
|
|
14
|
+
own Enter handling out), `oninput` and `onblur`, and set extra textarea attributes with
|
|
15
|
+
`inputProps` (for example combobox ARIA for a command palette).
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
**Use it for** the Playground chat, the AI assistant and the Console prompt.
|
|
18
|
+
**Not for** a short single-line field; use a plain input inside `Field`.
|
|
19
|
+
|
|
20
|
+
Not exported from the package; the API may still change.
|
|
22
21
|
-->
|
|
23
22
|
|
|
24
23
|
<script lang="ts">
|
|
@@ -42,6 +42,26 @@ interface Props {
|
|
|
42
42
|
/** Extra classes on the root. */
|
|
43
43
|
class?: string;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Composer: an auto-growing message box with a send (or stop) button.
|
|
47
|
+
*
|
|
48
|
+
* The textarea grows from one row up to `maxRows`, then scrolls. Enter sends, Shift+Enter adds
|
|
49
|
+
* a newline, and Enter during IME composition never sends. The component does not clear
|
|
50
|
+
* `value` after sending; clear it in `onsubmit`.
|
|
51
|
+
*
|
|
52
|
+
* `busy` turns send into stop (`onstop`) and blocks sending. The stop button stays enabled
|
|
53
|
+
* even when `disabled` is set, so a run in flight can always be stopped. `sendDisabled` blocks
|
|
54
|
+
* send on top of the built-in checks, and `sendLabel` renames the button.
|
|
55
|
+
*
|
|
56
|
+
* A host can listen to keys (`onkeydown` runs first; `preventDefault()` keeps the composer's
|
|
57
|
+
* own Enter handling out), `oninput` and `onblur`, and set extra textarea attributes with
|
|
58
|
+
* `inputProps` (for example combobox ARIA for a command palette).
|
|
59
|
+
*
|
|
60
|
+
* **Use it for** the Playground chat, the AI assistant and the Console prompt.
|
|
61
|
+
* **Not for** a short single-line field; use a plain input inside `Field`.
|
|
62
|
+
*
|
|
63
|
+
* Not exported from the package; the API may still change.
|
|
64
|
+
*/
|
|
45
65
|
declare const Composer: import("svelte").Component<Props, {}, "value" | "element">;
|
|
46
66
|
type Composer = ReturnType<typeof Composer>;
|
|
47
67
|
export default Composer;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
@component
|
|
3
|
+
EmptyState: a quiet, centred "nothing here yet" block with an optional icon, title,
|
|
4
|
+
description and actions row.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
`size="sm"` is for lists and small panels (the runs list uses it); `md` is for a whole pane.
|
|
7
|
+
|
|
8
|
+
**Use it for** an empty list or panel, and say what the user can do next.
|
|
9
|
+
**Not for** an error or a warning; use `Notice`.
|
|
10
|
+
|
|
11
|
+
Not exported from the package; the API may still change.
|
|
6
12
|
-->
|
|
7
13
|
|
|
8
14
|
<script lang="ts">
|
|
@@ -13,6 +13,17 @@ interface Props {
|
|
|
13
13
|
/** Extra classes on the root. */
|
|
14
14
|
class?: string;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* EmptyState: a quiet, centred "nothing here yet" block with an optional icon, title,
|
|
18
|
+
* description and actions row.
|
|
19
|
+
*
|
|
20
|
+
* `size="sm"` is for lists and small panels (the runs list uses it); `md` is for a whole pane.
|
|
21
|
+
*
|
|
22
|
+
* **Use it for** an empty list or panel, and say what the user can do next.
|
|
23
|
+
* **Not for** an error or a warning; use `Notice`.
|
|
24
|
+
*
|
|
25
|
+
* Not exported from the package; the API may still change.
|
|
26
|
+
*/
|
|
16
27
|
declare const EmptyState: import("svelte").Component<Props, {}, "">;
|
|
17
28
|
type EmptyState = ReturnType<typeof EmptyState>;
|
|
18
29
|
export default EmptyState;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
2
|
+
@component
|
|
3
|
+
Field: one form control with its label, type tag, help text and error.
|
|
3
4
|
|
|
4
|
-
The control is
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
shows a marker next to the label (the caller sets the control's `required`).
|
|
5
|
+
The control is yours. `children` receives `{ id, describedBy, invalid }`; put `id`,
|
|
6
|
+
`aria-describedby` and `aria-invalid` on your own input. Help and error are both announced
|
|
7
|
+
(both ids are in `describedBy`) and the error shows in the error colour. `required` shows
|
|
8
|
+
a marker next to the label (set `required` on the control yourself).
|
|
9
9
|
|
|
10
|
-
`examples` renders a row of small
|
|
11
|
-
|
|
10
|
+
`examples` renders a row of small buttons; clicking one calls `onexample(value)`, for
|
|
11
|
+
example to fill a JSON field from the interface definition.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**Use it for** every labelled input in a config form.
|
|
14
|
+
**Not for** a checkbox or switch that carries its own label.
|
|
15
|
+
|
|
16
|
+
Not exported from the package; the API may still change.
|
|
14
17
|
-->
|
|
15
18
|
|
|
16
19
|
<script lang="ts">
|
|
@@ -25,6 +25,22 @@ interface Props {
|
|
|
25
25
|
invalid: boolean;
|
|
26
26
|
}]>;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Field: one form control with its label, type tag, help text and error.
|
|
30
|
+
*
|
|
31
|
+
* The control is yours. `children` receives `{ id, describedBy, invalid }`; put `id`,
|
|
32
|
+
* `aria-describedby` and `aria-invalid` on your own input. Help and error are both announced
|
|
33
|
+
* (both ids are in `describedBy`) and the error shows in the error colour. `required` shows
|
|
34
|
+
* a marker next to the label (set `required` on the control yourself).
|
|
35
|
+
*
|
|
36
|
+
* `examples` renders a row of small buttons; clicking one calls `onexample(value)`, for
|
|
37
|
+
* example to fill a JSON field from the interface definition.
|
|
38
|
+
*
|
|
39
|
+
* **Use it for** every labelled input in a config form.
|
|
40
|
+
* **Not for** a checkbox or switch that carries its own label.
|
|
41
|
+
*
|
|
42
|
+
* Not exported from the package; the API may still change.
|
|
43
|
+
*/
|
|
28
44
|
declare const Field: import("svelte").Component<Props, {}, "">;
|
|
29
45
|
type Field = ReturnType<typeof Field>;
|
|
30
46
|
export default Field;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
2
|
+
@component
|
|
3
|
+
IconButton: a square, icon-only button.
|
|
3
4
|
|
|
4
|
-
`ariaLabel` is required because there is no visible text. `active`
|
|
5
|
-
toggle
|
|
6
|
-
|
|
5
|
+
`ariaLabel` is required because there is no visible text. Pass `active` (true or false)
|
|
6
|
+
to make it a toggle; it then exposes `aria-pressed`. Sizes are 24px (`sm`) and 28px
|
|
7
|
+
(`md`); the editor uses `sm` in rows and panel headers.
|
|
8
|
+
It is the library's only icon button.
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
**Use it for** close, delete, move up/down, show/hide and other single-glyph actions.
|
|
11
|
+
**Not for** an action that needs a text label; use `Button`.
|
|
12
|
+
|
|
13
|
+
Not exported from the package; internal to the editor.
|
|
9
14
|
-->
|
|
10
15
|
|
|
11
16
|
<script lang="ts">
|
|
@@ -22,6 +22,19 @@ interface Props extends Omit<HTMLButtonAttributes, 'children' | 'class' | 'type'
|
|
|
22
22
|
/** The glyph (icon, inline SVG or character) */
|
|
23
23
|
children: Snippet;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* IconButton: a square, icon-only button.
|
|
27
|
+
*
|
|
28
|
+
* `ariaLabel` is required because there is no visible text. Pass `active` (true or false)
|
|
29
|
+
* to make it a toggle; it then exposes `aria-pressed`. Sizes are 24px (`sm`) and 28px
|
|
30
|
+
* (`md`); the editor uses `sm` in rows and panel headers.
|
|
31
|
+
* It is the library's only icon button.
|
|
32
|
+
*
|
|
33
|
+
* **Use it for** close, delete, move up/down, show/hide and other single-glyph actions.
|
|
34
|
+
* **Not for** an action that needs a text label; use `Button`.
|
|
35
|
+
*
|
|
36
|
+
* Not exported from the package; internal to the editor.
|
|
37
|
+
*/
|
|
25
38
|
declare const IconButton: import("svelte").Component<Props, {}, "">;
|
|
26
39
|
type IconButton = ReturnType<typeof IconButton>;
|
|
27
40
|
export default IconButton;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
2
|
+
@component
|
|
3
|
+
Menu: a dropdown with a trigger button and a popup of items.
|
|
3
4
|
|
|
4
|
-
Items come from `items` (
|
|
5
|
-
|
|
6
|
-
`
|
|
7
|
-
`menuitemradio` takes part in keyboard navigation).
|
|
5
|
+
Items come from `items` (actions, checkable and radio items, separators, group labels)
|
|
6
|
+
and/or from free-form `children`, which receive `close`. Any element with
|
|
7
|
+
`role="menuitem"`, `menuitemcheckbox` or `menuitemradio` joins keyboard navigation.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
editor clears the selection on Escape); Tab closes it. A click outside closes
|
|
14
|
-
it without taking focus back.
|
|
9
|
+
Keys: Enter, Space or ArrowDown open it and focus the first item (ArrowUp the last).
|
|
10
|
+
Arrow keys, Home and End move between items (disabled ones are skipped). Typing jumps to
|
|
11
|
+
the next item that starts with that letter. Escape closes it and returns focus to the
|
|
12
|
+
trigger. Tab closes it. A click outside closes it without taking focus back.
|
|
15
13
|
|
|
16
|
-
The trigger is an `IconButton` showing
|
|
17
|
-
|
|
14
|
+
The trigger is an `IconButton` showing the three dots, unless you pass a `trigger` snippet.
|
|
15
|
+
The editor uses `size="sm"` and `align="end"` for row menus.
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
**Use it for** a list of actions behind one control.
|
|
18
|
+
**Not for** choosing a value for a field; use `Select`.
|
|
19
|
+
|
|
20
|
+
Not exported from the package; the API may still change.
|
|
20
21
|
-->
|
|
21
22
|
|
|
22
23
|
<script lang="ts" module>
|
|
@@ -56,6 +56,26 @@ interface Props {
|
|
|
56
56
|
/** Extra classes on the root. */
|
|
57
57
|
class?: string;
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Menu: a dropdown with a trigger button and a popup of items.
|
|
61
|
+
*
|
|
62
|
+
* Items come from `items` (actions, checkable and radio items, separators, group labels)
|
|
63
|
+
* and/or from free-form `children`, which receive `close`. Any element with
|
|
64
|
+
* `role="menuitem"`, `menuitemcheckbox` or `menuitemradio` joins keyboard navigation.
|
|
65
|
+
*
|
|
66
|
+
* Keys: Enter, Space or ArrowDown open it and focus the first item (ArrowUp the last).
|
|
67
|
+
* Arrow keys, Home and End move between items (disabled ones are skipped). Typing jumps to
|
|
68
|
+
* the next item that starts with that letter. Escape closes it and returns focus to the
|
|
69
|
+
* trigger. Tab closes it. A click outside closes it without taking focus back.
|
|
70
|
+
*
|
|
71
|
+
* The trigger is an `IconButton` showing the three dots, unless you pass a `trigger` snippet.
|
|
72
|
+
* The editor uses `size="sm"` and `align="end"` for row menus.
|
|
73
|
+
*
|
|
74
|
+
* **Use it for** a list of actions behind one control.
|
|
75
|
+
* **Not for** choosing a value for a field; use `Select`.
|
|
76
|
+
*
|
|
77
|
+
* Not exported from the package; the API may still change.
|
|
78
|
+
*/
|
|
59
79
|
declare const Menu: import("svelte").Component<Props, {}, "open">;
|
|
60
80
|
type Menu = ReturnType<typeof Menu>;
|
|
61
81
|
export default Menu;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
@component
|
|
3
|
+
Notice: an inline message (info, success, warning or error) with an optional title, body,
|
|
4
|
+
actions and a dismiss button.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"note".
|
|
6
|
+
Error and warning use `role="alert"` (read out at once: the user has to act or just lost
|
|
7
|
+
something). Info and success use `role="status"` (polite). Pass `role` to change that: a
|
|
8
|
+
warning that is on screen from the start should be `"status"` or `"note"` so it is not
|
|
9
|
+
announced on load.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**Use it for** a message that belongs to a part of the page: a failed save, a missing setting.
|
|
12
|
+
**Not for** an empty list; use `EmptyState`. Not for run status; use `StatusPill`.
|
|
13
|
+
|
|
14
|
+
Not exported from the package; the API may still change.
|
|
12
15
|
-->
|
|
13
16
|
|
|
14
17
|
<script lang="ts">
|
|
@@ -17,6 +17,20 @@ interface Props {
|
|
|
17
17
|
/** Extra classes on the root. */
|
|
18
18
|
class?: string;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Notice: an inline message (info, success, warning or error) with an optional title, body,
|
|
22
|
+
* actions and a dismiss button.
|
|
23
|
+
*
|
|
24
|
+
* Error and warning use `role="alert"` (read out at once: the user has to act or just lost
|
|
25
|
+
* something). Info and success use `role="status"` (polite). Pass `role` to change that: a
|
|
26
|
+
* warning that is on screen from the start should be `"status"` or `"note"` so it is not
|
|
27
|
+
* announced on load.
|
|
28
|
+
*
|
|
29
|
+
* **Use it for** a message that belongs to a part of the page: a failed save, a missing setting.
|
|
30
|
+
* **Not for** an empty list; use `EmptyState`. Not for run status; use `StatusPill`.
|
|
31
|
+
*
|
|
32
|
+
* Not exported from the package; the API may still change.
|
|
33
|
+
*/
|
|
20
34
|
declare const Notice: import("svelte").Component<Props, {}, "">;
|
|
21
35
|
type Notice = ReturnType<typeof Notice>;
|
|
22
36
|
export default Notice;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
3
|
-
chat, Console, inspector
|
|
2
|
+
@component
|
|
3
|
+
PanelHeader: the 40px strip at the top of a panel (Playground, AI chat, Console, inspector).
|
|
4
4
|
|
|
5
|
-
Left: a `title` string or a free-form `leading` snippet (a workflow chip, a
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
Left side: a `title` string, or a free-form `leading` snippet (a workflow chip, a back
|
|
6
|
+
button). Right side: an `actions` snippet. An optional `subtitle` sits under the title.
|
|
7
|
+
The title is a real heading (`as`, default h2) drawn small, so panels stay easy to
|
|
8
|
+
navigate with a screen reader.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**Use it for** the top of a docked panel or a sheet.
|
|
11
|
+
**Not for** a section title inside a form; use a heading or `Field`.
|
|
12
|
+
|
|
13
|
+
Not exported from the package; the API may still change.
|
|
11
14
|
-->
|
|
12
15
|
|
|
13
16
|
<script lang="ts">
|
|
@@ -18,6 +18,19 @@ interface Props extends Omit<HTMLAttributes<HTMLElement>, 'class' | 'title' | 'c
|
|
|
18
18
|
/** Extra classes on the root. */
|
|
19
19
|
class?: string;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* PanelHeader: the 40px strip at the top of a panel (Playground, AI chat, Console, inspector).
|
|
23
|
+
*
|
|
24
|
+
* Left side: a `title` string, or a free-form `leading` snippet (a workflow chip, a back
|
|
25
|
+
* button). Right side: an `actions` snippet. An optional `subtitle` sits under the title.
|
|
26
|
+
* The title is a real heading (`as`, default h2) drawn small, so panels stay easy to
|
|
27
|
+
* navigate with a screen reader.
|
|
28
|
+
*
|
|
29
|
+
* **Use it for** the top of a docked panel or a sheet.
|
|
30
|
+
* **Not for** a section title inside a form; use a heading or `Field`.
|
|
31
|
+
*
|
|
32
|
+
* Not exported from the package; the API may still change.
|
|
33
|
+
*/
|
|
21
34
|
declare const PanelHeader: import("svelte").Component<Props, {}, "">;
|
|
22
35
|
type PanelHeader = ReturnType<typeof PanelHeader>;
|
|
23
36
|
export default PanelHeader;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
2
|
+
@component
|
|
3
|
+
Segmented: a switch that picks one option, for example Edit | Test.
|
|
3
4
|
|
|
4
|
-
role="radiogroup" with role="radio" items
|
|
5
|
-
|
|
5
|
+
`role="radiogroup"` with `role="radio"` items. Tab enters on the selected option; Left/Right
|
|
6
|
+
(or Up/Down) move and select; Home/End jump to the ends.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
**Segmented, Tabs or Toolbar?** Use Segmented to switch a MODE (Edit | Test). Use `Tabs` to
|
|
9
|
+
switch a VIEW of the same content (Form | JSON | Steps). Use `Toolbar` to group several
|
|
10
|
+
different controls so arrow keys move between them.
|
|
11
|
+
|
|
12
|
+
`float` draws the switch as its own floating control, as in the canvas toolbar.
|
|
13
|
+
|
|
14
|
+
Not exported from the package; not public API yet.
|
|
8
15
|
-->
|
|
9
16
|
|
|
10
17
|
<script lang="ts">
|
|
@@ -27,6 +27,20 @@ interface Props {
|
|
|
27
27
|
/** Extra classes appended to the root */
|
|
28
28
|
class?: string;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Segmented: a switch that picks one option, for example Edit | Test.
|
|
32
|
+
*
|
|
33
|
+
* `role="radiogroup"` with `role="radio"` items. Tab enters on the selected option; Left/Right
|
|
34
|
+
* (or Up/Down) move and select; Home/End jump to the ends.
|
|
35
|
+
*
|
|
36
|
+
* **Segmented, Tabs or Toolbar?** Use Segmented to switch a MODE (Edit | Test). Use `Tabs` to
|
|
37
|
+
* switch a VIEW of the same content (Form | JSON | Steps). Use `Toolbar` to group several
|
|
38
|
+
* different controls so arrow keys move between them.
|
|
39
|
+
*
|
|
40
|
+
* `float` draws the switch as its own floating control, as in the canvas toolbar.
|
|
41
|
+
*
|
|
42
|
+
* Not exported from the package; not public API yet.
|
|
43
|
+
*/
|
|
30
44
|
declare const Segmented: import("svelte").Component<Props, {}, "value">;
|
|
31
45
|
type Segmented = ReturnType<typeof Segmented>;
|
|
32
46
|
export default Segmented;
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
2
|
+
@component
|
|
3
|
+
Select: a dropdown that picks one value from a list.
|
|
3
4
|
|
|
4
|
-
One API, two renderings. Give it `options` and it
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
One API, two renderings. Give it `options` and it chooses. A short, flat list of plain
|
|
6
|
+
options (10 or fewer, no groups, no descriptions) is the browser's own `<select>`.
|
|
7
|
+
A longer, grouped or described list becomes a searchable `Combobox` (type to filter, matches
|
|
8
|
+
highlighted, "n of m"). `searchable` forces one or the other. Without `options`, pass
|
|
9
|
+
`<option>` and `<optgroup>` children; that is always the native rendering.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`appearance: base-select` its list is styled to match (base.css); elsewhere
|
|
14
|
-
it keeps the platform's list, which follows the editor's `color-scheme`.
|
|
15
|
-
Native attributes (value, disabled, id, aria-*, onchange…) forward to the
|
|
16
|
-
underlying <select>.
|
|
11
|
+
The native rendering uses the same field look as Input and Textarea (base.css), with a
|
|
12
|
+
built-in chevron. Native attributes (`value`, `disabled`, `id`, `aria-*`, `onchange`) go to
|
|
13
|
+
the underlying `<select>`. `onValueChange` runs with the new value in either rendering.
|
|
17
14
|
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
**Use it for** choosing one value in a config form.
|
|
16
|
+
**Not for** a list of actions; use `Menu`. Not for a two or three way mode; use `Segmented`.
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
Not exported from the package; internal for now.
|
|
22
19
|
-->
|
|
23
20
|
|
|
24
21
|
<script lang="ts">
|
|
@@ -21,6 +21,24 @@ interface Props extends Omit<HTMLSelectAttributes, 'size' | 'children' | 'value'
|
|
|
21
21
|
/** Shown in the closed field when nothing is selected. */
|
|
22
22
|
placeholder?: string;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Select: a dropdown that picks one value from a list.
|
|
26
|
+
*
|
|
27
|
+
* One API, two renderings. Give it `options` and it chooses. A short, flat list of plain
|
|
28
|
+
* options (10 or fewer, no groups, no descriptions) is the browser's own `<select>`.
|
|
29
|
+
* A longer, grouped or described list becomes a searchable `Combobox` (type to filter, matches
|
|
30
|
+
* highlighted, "n of m"). `searchable` forces one or the other. Without `options`, pass
|
|
31
|
+
* `<option>` and `<optgroup>` children; that is always the native rendering.
|
|
32
|
+
*
|
|
33
|
+
* The native rendering uses the same field look as Input and Textarea (base.css), with a
|
|
34
|
+
* built-in chevron. Native attributes (`value`, `disabled`, `id`, `aria-*`, `onchange`) go to
|
|
35
|
+
* the underlying `<select>`. `onValueChange` runs with the new value in either rendering.
|
|
36
|
+
*
|
|
37
|
+
* **Use it for** choosing one value in a config form.
|
|
38
|
+
* **Not for** a list of actions; use `Menu`. Not for a two or three way mode; use `Segmented`.
|
|
39
|
+
*
|
|
40
|
+
* Not exported from the package; internal for now.
|
|
41
|
+
*/
|
|
24
42
|
declare const Select: import("svelte").Component<Props, {}, "">;
|
|
25
43
|
type Select = ReturnType<typeof Select>;
|
|
26
44
|
export default Select;
|