@flowdrop/flowdrop 1.0.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/LICENSE +21 -0
- package/README.md +252 -0
- package/dist/adapters/WorkflowAdapter.d.ts +167 -0
- package/dist/adapters/WorkflowAdapter.js +368 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.d.ts +96 -0
- package/dist/adapters/agentspec/AgentSpecAdapter.js +626 -0
- package/dist/adapters/agentspec/agentAdapter.d.ts +59 -0
- package/dist/adapters/agentspec/agentAdapter.js +91 -0
- package/dist/adapters/agentspec/autoLayout.d.ts +34 -0
- package/dist/adapters/agentspec/autoLayout.js +127 -0
- package/dist/adapters/agentspec/componentTypeDefaults.d.ts +73 -0
- package/dist/adapters/agentspec/componentTypeDefaults.js +238 -0
- package/dist/adapters/agentspec/defaultNodeTypes.d.ts +53 -0
- package/dist/adapters/agentspec/defaultNodeTypes.js +561 -0
- package/dist/adapters/agentspec/index.d.ts +37 -0
- package/dist/adapters/agentspec/index.js +39 -0
- package/dist/adapters/agentspec/validator.d.ts +34 -0
- package/dist/adapters/agentspec/validator.js +169 -0
- package/dist/api/enhanced-client.d.ts +183 -0
- package/dist/api/enhanced-client.js +430 -0
- package/dist/components/App.svelte +981 -0
- package/dist/components/App.svelte.d.ts +54 -0
- package/dist/components/CanvasBanner.stories.svelte +29 -0
- package/dist/components/CanvasBanner.stories.svelte.d.ts +27 -0
- package/dist/components/CanvasBanner.svelte +57 -0
- package/dist/components/CanvasBanner.svelte.d.ts +8 -0
- package/dist/components/ConfigForm.svelte +1138 -0
- package/dist/components/ConfigForm.svelte.d.ts +44 -0
- package/dist/components/ConfigModal.svelte +188 -0
- package/dist/components/ConfigModal.svelte.d.ts +13 -0
- package/dist/components/ConfigPanel.stories.svelte +47 -0
- package/dist/components/ConfigPanel.stories.svelte.d.ts +27 -0
- package/dist/components/ConfigPanel.svelte +182 -0
- package/dist/components/ConfigPanel.svelte.d.ts +32 -0
- package/dist/components/ConnectionLine.svelte +32 -0
- package/dist/components/ConnectionLine.svelte.d.ts +3 -0
- package/dist/components/EdgeRefresher.svelte +41 -0
- package/dist/components/EdgeRefresher.svelte.d.ts +9 -0
- package/dist/components/FlowDropZone.svelte +83 -0
- package/dist/components/FlowDropZone.svelte.d.ts +13 -0
- package/dist/components/LoadingSpinner.stories.svelte +30 -0
- package/dist/components/LoadingSpinner.stories.svelte.d.ts +27 -0
- package/dist/components/LoadingSpinner.svelte +36 -0
- package/dist/components/LoadingSpinner.svelte.d.ts +8 -0
- package/dist/components/Logo.stories.svelte +22 -0
- package/dist/components/Logo.stories.svelte.d.ts +27 -0
- package/dist/components/Logo.svelte +102 -0
- package/dist/components/Logo.svelte.d.ts +26 -0
- package/dist/components/LogsSidebar.svelte +563 -0
- package/dist/components/LogsSidebar.svelte.d.ts +17 -0
- package/dist/components/MarkdownDisplay.stories.svelte +36 -0
- package/dist/components/MarkdownDisplay.stories.svelte.d.ts +27 -0
- package/dist/components/MarkdownDisplay.svelte +29 -0
- package/dist/components/MarkdownDisplay.svelte.d.ts +7 -0
- package/dist/components/Navbar.stories.svelte +53 -0
- package/dist/components/Navbar.stories.svelte.d.ts +27 -0
- package/dist/components/Navbar.svelte +726 -0
- package/dist/components/Navbar.svelte.d.ts +29 -0
- package/dist/components/NodeSidebar.svelte +762 -0
- package/dist/components/NodeSidebar.svelte.d.ts +9 -0
- package/dist/components/NodeStatusOverlay.stories.svelte +85 -0
- package/dist/components/NodeStatusOverlay.stories.svelte.d.ts +27 -0
- package/dist/components/NodeStatusOverlay.svelte +327 -0
- package/dist/components/NodeStatusOverlay.svelte.d.ts +11 -0
- package/dist/components/PipelineStatus.svelte +314 -0
- package/dist/components/PipelineStatus.svelte.d.ts +20 -0
- package/dist/components/PortCoordinateTracker.svelte +58 -0
- package/dist/components/PortCoordinateTracker.svelte.d.ts +12 -0
- package/dist/components/ReadOnlyDetails.svelte +170 -0
- package/dist/components/ReadOnlyDetails.svelte.d.ts +25 -0
- package/dist/components/SchemaForm.stories.svelte +116 -0
- package/dist/components/SchemaForm.stories.svelte.d.ts +27 -0
- package/dist/components/SchemaForm.svelte +536 -0
- package/dist/components/SchemaForm.svelte.d.ts +83 -0
- package/dist/components/SettingsModal.svelte +279 -0
- package/dist/components/SettingsModal.svelte.d.ts +23 -0
- package/dist/components/SettingsPanel.svelte +638 -0
- package/dist/components/SettingsPanel.svelte.d.ts +21 -0
- package/dist/components/StatusIcon.stories.svelte +60 -0
- package/dist/components/StatusIcon.stories.svelte.d.ts +27 -0
- package/dist/components/StatusIcon.svelte +119 -0
- package/dist/components/StatusIcon.svelte.d.ts +10 -0
- package/dist/components/StatusLabel.stories.svelte +17 -0
- package/dist/components/StatusLabel.stories.svelte.d.ts +27 -0
- package/dist/components/StatusLabel.svelte +33 -0
- package/dist/components/StatusLabel.svelte.d.ts +7 -0
- package/dist/components/ThemeToggle.stories.svelte +25 -0
- package/dist/components/ThemeToggle.stories.svelte.d.ts +27 -0
- package/dist/components/ThemeToggle.svelte +185 -0
- package/dist/components/ThemeToggle.svelte.d.ts +14 -0
- package/dist/components/UniversalNode.svelte +155 -0
- package/dist/components/UniversalNode.svelte.d.ts +15 -0
- package/dist/components/WorkflowEditor.svelte +1035 -0
- package/dist/components/WorkflowEditor.svelte.d.ts +23 -0
- package/dist/components/form/FormArray.svelte +1049 -0
- package/dist/components/form/FormArray.svelte.d.ts +22 -0
- package/dist/components/form/FormAutocomplete.svelte +1009 -0
- package/dist/components/form/FormAutocomplete.svelte.d.ts +25 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte +28 -0
- package/dist/components/form/FormCheckboxGroup.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormCheckboxGroup.svelte +155 -0
- package/dist/components/form/FormCheckboxGroup.svelte.d.ts +17 -0
- package/dist/components/form/FormCodeEditor.svelte +458 -0
- package/dist/components/form/FormCodeEditor.svelte.d.ts +25 -0
- package/dist/components/form/FormField.svelte +417 -0
- package/dist/components/form/FormField.svelte.d.ts +29 -0
- package/dist/components/form/FormFieldLight.svelte +425 -0
- package/dist/components/form/FormFieldLight.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte +53 -0
- package/dist/components/form/FormFieldWrapper.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormFieldWrapper.svelte +125 -0
- package/dist/components/form/FormFieldWrapper.svelte.d.ts +18 -0
- package/dist/components/form/FormFieldset.svelte +142 -0
- package/dist/components/form/FormFieldset.svelte.d.ts +11 -0
- package/dist/components/form/FormMarkdownEditor.svelte +752 -0
- package/dist/components/form/FormMarkdownEditor.svelte.d.ts +33 -0
- package/dist/components/form/FormNumberField.stories.svelte +36 -0
- package/dist/components/form/FormNumberField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormNumberField.svelte +112 -0
- package/dist/components/form/FormNumberField.svelte.d.ts +25 -0
- package/dist/components/form/FormRangeField.stories.svelte +31 -0
- package/dist/components/form/FormRangeField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormRangeField.svelte +246 -0
- package/dist/components/form/FormRangeField.svelte.d.ts +23 -0
- package/dist/components/form/FormSelect.stories.svelte +50 -0
- package/dist/components/form/FormSelect.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormSelect.svelte +129 -0
- package/dist/components/form/FormSelect.svelte.d.ts +20 -0
- package/dist/components/form/FormTemplateEditor.svelte +825 -0
- package/dist/components/form/FormTemplateEditor.svelte.d.ts +41 -0
- package/dist/components/form/FormTextField.stories.svelte +30 -0
- package/dist/components/form/FormTextField.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextField.svelte +91 -0
- package/dist/components/form/FormTextField.svelte.d.ts +19 -0
- package/dist/components/form/FormTextarea.stories.svelte +34 -0
- package/dist/components/form/FormTextarea.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormTextarea.svelte +97 -0
- package/dist/components/form/FormTextarea.svelte.d.ts +21 -0
- package/dist/components/form/FormToggle.stories.svelte +30 -0
- package/dist/components/form/FormToggle.stories.svelte.d.ts +27 -0
- package/dist/components/form/FormToggle.svelte +126 -0
- package/dist/components/form/FormToggle.svelte.d.ts +19 -0
- package/dist/components/form/FormUISchemaRenderer.svelte +136 -0
- package/dist/components/form/FormUISchemaRenderer.svelte.d.ts +32 -0
- package/dist/components/form/index.d.ts +50 -0
- package/dist/components/form/index.js +54 -0
- package/dist/components/form/templateAutocomplete.d.ts +29 -0
- package/dist/components/form/templateAutocomplete.js +254 -0
- package/dist/components/form/types.d.ts +485 -0
- package/dist/components/form/types.js +73 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte +52 -0
- package/dist/components/interrupt/ChoicePrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +401 -0
- package/dist/components/interrupt/ChoicePrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte +71 -0
- package/dist/components/interrupt/ConfirmationPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte +292 -0
- package/dist/components/interrupt/ConfirmationPrompt.svelte.d.ts +25 -0
- package/dist/components/interrupt/FormPrompt.svelte +236 -0
- package/dist/components/interrupt/FormPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/InterruptBubble.svelte +601 -0
- package/dist/components/interrupt/InterruptBubble.svelte.d.ts +16 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte +67 -0
- package/dist/components/interrupt/ReviewPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/ReviewPrompt.svelte +861 -0
- package/dist/components/interrupt/ReviewPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte +47 -0
- package/dist/components/interrupt/TextInputPrompt.stories.svelte.d.ts +27 -0
- package/dist/components/interrupt/TextInputPrompt.svelte +346 -0
- package/dist/components/interrupt/TextInputPrompt.svelte.d.ts +23 -0
- package/dist/components/interrupt/index.d.ts +13 -0
- package/dist/components/interrupt/index.js +15 -0
- package/dist/components/layouts/MainLayout.svelte +718 -0
- package/dist/components/layouts/MainLayout.svelte.d.ts +62 -0
- package/dist/components/nodes/GatewayNode.stories.svelte +108 -0
- package/dist/components/nodes/GatewayNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/GatewayNode.svelte +591 -0
- package/dist/components/nodes/GatewayNode.svelte.d.ts +15 -0
- package/dist/components/nodes/IdeaNode.stories.svelte +52 -0
- package/dist/components/nodes/IdeaNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/IdeaNode.svelte +455 -0
- package/dist/components/nodes/IdeaNode.svelte.d.ts +24 -0
- package/dist/components/nodes/NotesNode.stories.svelte +76 -0
- package/dist/components/nodes/NotesNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/NotesNode.svelte +378 -0
- package/dist/components/nodes/NotesNode.svelte.d.ts +24 -0
- package/dist/components/nodes/SimpleNode.stories.svelte +159 -0
- package/dist/components/nodes/SimpleNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SimpleNode.svelte +451 -0
- package/dist/components/nodes/SimpleNode.svelte.d.ts +25 -0
- package/dist/components/nodes/SquareNode.stories.svelte +82 -0
- package/dist/components/nodes/SquareNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/SquareNode.svelte +407 -0
- package/dist/components/nodes/SquareNode.svelte.d.ts +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte +25 -0
- package/dist/components/nodes/TerminalNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/TerminalNode.svelte +690 -0
- package/dist/components/nodes/TerminalNode.svelte.d.ts +25 -0
- package/dist/components/nodes/ToolNode.stories.svelte +189 -0
- package/dist/components/nodes/ToolNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/ToolNode.svelte +471 -0
- package/dist/components/nodes/ToolNode.svelte.d.ts +36 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte +55 -0
- package/dist/components/nodes/WorkflowNode.stories.svelte.d.ts +26 -0
- package/dist/components/nodes/WorkflowNode.svelte +571 -0
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +15 -0
- package/dist/components/playground/ChatPanel.svelte +905 -0
- package/dist/components/playground/ChatPanel.svelte.d.ts +46 -0
- package/dist/components/playground/ExecutionLogs.svelte +488 -0
- package/dist/components/playground/ExecutionLogs.svelte.d.ts +14 -0
- package/dist/components/playground/InputCollector.svelte +444 -0
- package/dist/components/playground/InputCollector.svelte.d.ts +16 -0
- package/dist/components/playground/MessageBubble.stories.svelte +62 -0
- package/dist/components/playground/MessageBubble.stories.svelte.d.ts +27 -0
- package/dist/components/playground/MessageBubble.svelte +633 -0
- package/dist/components/playground/MessageBubble.svelte.d.ts +24 -0
- package/dist/components/playground/Playground.svelte +1075 -0
- package/dist/components/playground/Playground.svelte.d.ts +25 -0
- package/dist/components/playground/PlaygroundModal.svelte +220 -0
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +25 -0
- package/dist/components/playground/SessionManager.svelte +538 -0
- package/dist/components/playground/SessionManager.svelte.d.ts +20 -0
- package/dist/config/agentSpecEndpoints.d.ts +70 -0
- package/dist/config/agentSpecEndpoints.js +65 -0
- package/dist/config/constants.d.ts +43 -0
- package/dist/config/constants.js +31 -0
- package/dist/config/defaultCategories.d.ts +7 -0
- package/dist/config/defaultCategories.js +126 -0
- package/dist/config/defaultPortConfig.d.ts +6 -0
- package/dist/config/defaultPortConfig.js +201 -0
- package/dist/config/endpoints.d.ts +160 -0
- package/dist/config/endpoints.js +146 -0
- package/dist/config/runtimeConfig.d.ts +47 -0
- package/dist/config/runtimeConfig.js +80 -0
- package/dist/core/index.d.ts +75 -0
- package/dist/core/index.js +92 -0
- package/dist/display/index.d.ts +29 -0
- package/dist/display/index.js +36 -0
- package/dist/editor/index.d.ts +95 -0
- package/dist/editor/index.js +138 -0
- package/dist/form/code.d.ts +101 -0
- package/dist/form/code.js +168 -0
- package/dist/form/fieldRegistry.d.ts +169 -0
- package/dist/form/fieldRegistry.js +152 -0
- package/dist/form/full.d.ts +56 -0
- package/dist/form/full.js +80 -0
- package/dist/form/index.d.ts +77 -0
- package/dist/form/index.js +91 -0
- package/dist/form/markdown.d.ts +69 -0
- package/dist/form/markdown.js +103 -0
- package/dist/helpers/nodeLayoutHelper.d.ts +14 -0
- package/dist/helpers/nodeLayoutHelper.js +19 -0
- package/dist/helpers/proximityConnect.d.ts +94 -0
- package/dist/helpers/proximityConnect.js +314 -0
- package/dist/helpers/workflowEditorHelper.d.ts +183 -0
- package/dist/helpers/workflowEditorHelper.js +595 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +64 -0
- package/dist/mocks/app-environment.d.ts +8 -0
- package/dist/mocks/app-environment.js +16 -0
- package/dist/mocks/app-forms.d.ts +2 -0
- package/dist/mocks/app-forms.js +22 -0
- package/dist/mocks/app-navigation.d.ts +5 -0
- package/dist/mocks/app-navigation.js +36 -0
- package/dist/mocks/app-stores.d.ts +14 -0
- package/dist/mocks/app-stores.js +26 -0
- package/dist/playground/index.d.ts +131 -0
- package/dist/playground/index.js +172 -0
- package/dist/playground/mount.d.ts +203 -0
- package/dist/playground/mount.js +235 -0
- package/dist/registry/BaseRegistry.d.ts +92 -0
- package/dist/registry/BaseRegistry.js +124 -0
- package/dist/registry/builtinFormats.d.ts +23 -0
- package/dist/registry/builtinFormats.js +70 -0
- package/dist/registry/builtinNodes.d.ts +77 -0
- package/dist/registry/builtinNodes.js +211 -0
- package/dist/registry/index.d.ts +8 -0
- package/dist/registry/index.js +12 -0
- package/dist/registry/nodeComponentRegistry.d.ts +276 -0
- package/dist/registry/nodeComponentRegistry.js +262 -0
- package/dist/registry/plugin.d.ts +215 -0
- package/dist/registry/plugin.js +249 -0
- package/dist/registry/workflowFormatRegistry.d.ts +122 -0
- package/dist/registry/workflowFormatRegistry.js +96 -0
- package/dist/schema/index.d.ts +23 -0
- package/dist/schema/index.js +23 -0
- package/dist/schemas/v1/workflow.schema.json +1078 -0
- package/dist/services/agentSpecExecutionService.d.ts +106 -0
- package/dist/services/agentSpecExecutionService.js +334 -0
- package/dist/services/api.d.ts +115 -0
- package/dist/services/api.js +214 -0
- package/dist/services/apiVariableService.d.ts +114 -0
- package/dist/services/apiVariableService.js +338 -0
- package/dist/services/autoSaveService.d.ts +112 -0
- package/dist/services/autoSaveService.js +227 -0
- package/dist/services/categoriesApi.d.ts +14 -0
- package/dist/services/categoriesApi.js +49 -0
- package/dist/services/draftStorage.d.ts +171 -0
- package/dist/services/draftStorage.js +299 -0
- package/dist/services/dynamicSchemaService.d.ts +108 -0
- package/dist/services/dynamicSchemaService.js +444 -0
- package/dist/services/globalSave.d.ts +69 -0
- package/dist/services/globalSave.js +248 -0
- package/dist/services/historyService.d.ts +208 -0
- package/dist/services/historyService.js +321 -0
- package/dist/services/interruptService.d.ts +133 -0
- package/dist/services/interruptService.js +280 -0
- package/dist/services/nodeExecutionService.d.ts +63 -0
- package/dist/services/nodeExecutionService.js +266 -0
- package/dist/services/playgroundService.d.ts +130 -0
- package/dist/services/playgroundService.js +321 -0
- package/dist/services/portConfigApi.d.ts +14 -0
- package/dist/services/portConfigApi.js +54 -0
- package/dist/services/settingsService.d.ts +92 -0
- package/dist/services/settingsService.js +196 -0
- package/dist/services/toastService.d.ts +156 -0
- package/dist/services/toastService.js +265 -0
- package/dist/services/variableService.d.ts +141 -0
- package/dist/services/variableService.js +463 -0
- package/dist/services/workflowStorage.d.ts +37 -0
- package/dist/services/workflowStorage.js +116 -0
- package/dist/settings/index.d.ts +25 -0
- package/dist/settings/index.js +33 -0
- package/dist/stores/categoriesStore.svelte.d.ts +32 -0
- package/dist/stores/categoriesStore.svelte.js +77 -0
- package/dist/stores/editorStateMachine.svelte.d.ts +42 -0
- package/dist/stores/editorStateMachine.svelte.js +132 -0
- package/dist/stores/historyStore.svelte.d.ts +136 -0
- package/dist/stores/historyStore.svelte.js +207 -0
- package/dist/stores/interruptStore.svelte.d.ts +179 -0
- package/dist/stores/interruptStore.svelte.js +346 -0
- package/dist/stores/playgroundStore.svelte.d.ts +230 -0
- package/dist/stores/playgroundStore.svelte.js +515 -0
- package/dist/stores/portCoordinateStore.svelte.d.ts +66 -0
- package/dist/stores/portCoordinateStore.svelte.js +186 -0
- package/dist/stores/settingsStore.svelte.d.ts +158 -0
- package/dist/stores/settingsStore.svelte.js +544 -0
- package/dist/stores/workflowStore.svelte.d.ts +260 -0
- package/dist/stores/workflowStore.svelte.js +649 -0
- package/dist/stories/CanvasDecorator.svelte +49 -0
- package/dist/stories/CanvasDecorator.svelte.d.ts +8 -0
- package/dist/stories/NodeDecorator.svelte +73 -0
- package/dist/stories/NodeDecorator.svelte.d.ts +8 -0
- package/dist/stories/utils.d.ts +93 -0
- package/dist/stories/utils.js +122 -0
- package/dist/styles/base.css +1300 -0
- package/dist/styles/toast.css +35 -0
- package/dist/styles/tokens.css +475 -0
- package/dist/svelte-app.d.ts +150 -0
- package/dist/svelte-app.js +295 -0
- package/dist/types/agentspec.d.ts +318 -0
- package/dist/types/agentspec.js +48 -0
- package/dist/types/auth.d.ts +263 -0
- package/dist/types/auth.js +229 -0
- package/dist/types/config.d.ts +151 -0
- package/dist/types/config.js +7 -0
- package/dist/types/events.d.ts +190 -0
- package/dist/types/events.js +30 -0
- package/dist/types/index.d.ts +1234 -0
- package/dist/types/index.js +27 -0
- package/dist/types/interrupt.d.ts +390 -0
- package/dist/types/interrupt.js +145 -0
- package/dist/types/interruptState.d.ts +211 -0
- package/dist/types/interruptState.js +308 -0
- package/dist/types/playground.d.ts +351 -0
- package/dist/types/playground.js +95 -0
- package/dist/types/settings.d.ts +189 -0
- package/dist/types/settings.js +97 -0
- package/dist/types/uischema.d.ts +144 -0
- package/dist/types/uischema.js +51 -0
- package/dist/utils/colors.d.ts +288 -0
- package/dist/utils/colors.js +548 -0
- package/dist/utils/config.d.ts +37 -0
- package/dist/utils/config.js +226 -0
- package/dist/utils/connections.d.ts +125 -0
- package/dist/utils/connections.js +414 -0
- package/dist/utils/errors.d.ts +28 -0
- package/dist/utils/errors.js +44 -0
- package/dist/utils/fetchWithAuth.d.ts +25 -0
- package/dist/utils/fetchWithAuth.js +34 -0
- package/dist/utils/handleIds.d.ts +35 -0
- package/dist/utils/handleIds.js +58 -0
- package/dist/utils/handlePositioning.d.ts +31 -0
- package/dist/utils/handlePositioning.js +35 -0
- package/dist/utils/icons.d.ts +106 -0
- package/dist/utils/icons.js +157 -0
- package/dist/utils/logger.d.ts +47 -0
- package/dist/utils/logger.js +72 -0
- package/dist/utils/nodeStatus.d.ts +53 -0
- package/dist/utils/nodeStatus.js +183 -0
- package/dist/utils/nodeTypes.d.ts +117 -0
- package/dist/utils/nodeTypes.js +244 -0
- package/dist/utils/nodeWrapper.d.ts +39 -0
- package/dist/utils/nodeWrapper.js +62 -0
- package/dist/utils/performanceUtils.d.ts +30 -0
- package/dist/utils/performanceUtils.js +108 -0
- package/dist/utils/sanitize.d.ts +19 -0
- package/dist/utils/sanitize.js +31 -0
- package/dist/utils/uischema.d.ts +52 -0
- package/dist/utils/uischema.js +88 -0
- package/dist/utils/validation.d.ts +29 -0
- package/dist/utils/validation.js +39 -0
- package/package.json +292 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Field identifier */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Current value (markdown string) */
|
|
5
|
+
value: string;
|
|
6
|
+
/** Placeholder text shown when empty */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/** Whether the field is required */
|
|
9
|
+
required?: boolean;
|
|
10
|
+
/** Editor height - "auto" or specific value like "300px" */
|
|
11
|
+
height?: string;
|
|
12
|
+
/** Whether to show the toolbar */
|
|
13
|
+
showToolbar?: boolean;
|
|
14
|
+
/** Whether to show the status bar */
|
|
15
|
+
showStatusBar?: boolean;
|
|
16
|
+
/** Whether to enable spell checking */
|
|
17
|
+
spellChecker?: boolean;
|
|
18
|
+
/** Whether to enable autosave */
|
|
19
|
+
autosave?: boolean;
|
|
20
|
+
/** Autosave delay in milliseconds */
|
|
21
|
+
autosaveDelay?: number;
|
|
22
|
+
/** Whether the field is disabled (read-only) */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** Whether to use dark theme */
|
|
25
|
+
darkTheme?: boolean;
|
|
26
|
+
/** ARIA description ID */
|
|
27
|
+
ariaDescribedBy?: string;
|
|
28
|
+
/** Callback when value changes */
|
|
29
|
+
onChange: (value: string) => void;
|
|
30
|
+
}
|
|
31
|
+
declare const FormMarkdownEditor: import("svelte").Component<Props, {}, "">;
|
|
32
|
+
type FormMarkdownEditor = ReturnType<typeof FormMarkdownEditor>;
|
|
33
|
+
export default FormMarkdownEditor;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormNumberField from './FormNumberField.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Form/FormNumberField',
|
|
8
|
+
component: FormNumberField,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
value: { control: 'number' },
|
|
12
|
+
placeholder: { control: 'text' },
|
|
13
|
+
min: { control: 'number' },
|
|
14
|
+
max: { control: 'number' },
|
|
15
|
+
step: { control: 'number' },
|
|
16
|
+
required: { control: 'boolean' },
|
|
17
|
+
disabled: { control: 'boolean' }
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
id: 'demo-number-field',
|
|
21
|
+
value: '',
|
|
22
|
+
onChange: fn()
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<Story name="Default" args={{ placeholder: 'Enter a number...' }} />
|
|
28
|
+
|
|
29
|
+
<Story name="With Value" args={{ value: 42 }} />
|
|
30
|
+
|
|
31
|
+
<Story
|
|
32
|
+
name="With Constraints"
|
|
33
|
+
args={{ value: 50, min: 0, max: 100, step: 5, placeholder: '0-100, step 5' }}
|
|
34
|
+
/>
|
|
35
|
+
|
|
36
|
+
<Story name="Disabled" args={{ value: 10, disabled: true }} />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default FormNumberField;
|
|
2
|
+
type FormNumberField = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const FormNumberField: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
import FormNumberField from './FormNumberField.svelte';
|
|
15
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
+
$$bindings?: Bindings;
|
|
18
|
+
} & Exports;
|
|
19
|
+
(internal: unknown, props: {
|
|
20
|
+
$$events?: Events;
|
|
21
|
+
$$slots?: Slots;
|
|
22
|
+
}): Exports & {
|
|
23
|
+
$set?: any;
|
|
24
|
+
$on?: any;
|
|
25
|
+
};
|
|
26
|
+
z_$$bindings?: Bindings;
|
|
27
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FormNumberField Component
|
|
3
|
+
Number input field for numeric values
|
|
4
|
+
|
|
5
|
+
Features:
|
|
6
|
+
- Tabular numeric font for alignment
|
|
7
|
+
- Min/max/step support
|
|
8
|
+
- Proper ARIA attributes for accessibility
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
interface Props {
|
|
13
|
+
/** Field identifier */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Current value */
|
|
16
|
+
value: number | string;
|
|
17
|
+
/** Placeholder text */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Minimum allowed value */
|
|
20
|
+
min?: number;
|
|
21
|
+
/** Maximum allowed value */
|
|
22
|
+
max?: number;
|
|
23
|
+
/** Step increment */
|
|
24
|
+
step?: number;
|
|
25
|
+
/** Whether the field is required */
|
|
26
|
+
required?: boolean;
|
|
27
|
+
/** Whether the field is disabled (read-only) */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** ARIA description ID */
|
|
30
|
+
ariaDescribedBy?: string;
|
|
31
|
+
/** Callback when value changes */
|
|
32
|
+
onChange: (value: number | string) => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let {
|
|
36
|
+
id,
|
|
37
|
+
value = '',
|
|
38
|
+
placeholder = '',
|
|
39
|
+
min,
|
|
40
|
+
max,
|
|
41
|
+
step,
|
|
42
|
+
required = false,
|
|
43
|
+
disabled = false,
|
|
44
|
+
ariaDescribedBy,
|
|
45
|
+
onChange
|
|
46
|
+
}: Props = $props();
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Handle input changes
|
|
50
|
+
* Returns the value as a number if valid, otherwise as string
|
|
51
|
+
*/
|
|
52
|
+
function handleInput(event: Event): void {
|
|
53
|
+
const target = event.currentTarget as HTMLInputElement;
|
|
54
|
+
const inputValue = target.value;
|
|
55
|
+
|
|
56
|
+
if (inputValue === '') {
|
|
57
|
+
onChange('');
|
|
58
|
+
} else {
|
|
59
|
+
const numValue = Number(inputValue);
|
|
60
|
+
onChange(isNaN(numValue) ? inputValue : numValue);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<input
|
|
66
|
+
{id}
|
|
67
|
+
type="number"
|
|
68
|
+
class="form-number-field"
|
|
69
|
+
value={value ?? ''}
|
|
70
|
+
{placeholder}
|
|
71
|
+
{min}
|
|
72
|
+
{max}
|
|
73
|
+
{step}
|
|
74
|
+
{disabled}
|
|
75
|
+
aria-describedby={ariaDescribedBy}
|
|
76
|
+
aria-required={required}
|
|
77
|
+
oninput={handleInput}
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<style>
|
|
81
|
+
.form-number-field {
|
|
82
|
+
width: 100%;
|
|
83
|
+
padding: 0.625rem 0.875rem;
|
|
84
|
+
border: 1px solid var(--fd-border);
|
|
85
|
+
border-radius: var(--fd-radius-lg);
|
|
86
|
+
font-size: var(--fd-text-sm);
|
|
87
|
+
font-family: inherit;
|
|
88
|
+
font-variant-numeric: tabular-nums;
|
|
89
|
+
color: var(--fd-foreground);
|
|
90
|
+
background-color: var(--fd-muted);
|
|
91
|
+
transition: all var(--fd-transition-normal);
|
|
92
|
+
box-shadow: var(--fd-shadow-sm);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.form-number-field::placeholder {
|
|
96
|
+
color: var(--fd-muted-foreground);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.form-number-field:hover {
|
|
100
|
+
border-color: var(--fd-border-strong);
|
|
101
|
+
background-color: var(--fd-background);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.form-number-field:focus {
|
|
105
|
+
outline: none;
|
|
106
|
+
border-color: var(--fd-primary);
|
|
107
|
+
background-color: var(--fd-background);
|
|
108
|
+
box-shadow:
|
|
109
|
+
0 0 0 3px rgba(59, 130, 246, 0.12),
|
|
110
|
+
var(--fd-shadow-sm);
|
|
111
|
+
}
|
|
112
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Field identifier */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Current value */
|
|
5
|
+
value: number | string;
|
|
6
|
+
/** Placeholder text */
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/** Minimum allowed value */
|
|
9
|
+
min?: number;
|
|
10
|
+
/** Maximum allowed value */
|
|
11
|
+
max?: number;
|
|
12
|
+
/** Step increment */
|
|
13
|
+
step?: number;
|
|
14
|
+
/** Whether the field is required */
|
|
15
|
+
required?: boolean;
|
|
16
|
+
/** Whether the field is disabled (read-only) */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** ARIA description ID */
|
|
19
|
+
ariaDescribedBy?: string;
|
|
20
|
+
/** Callback when value changes */
|
|
21
|
+
onChange: (value: number | string) => void;
|
|
22
|
+
}
|
|
23
|
+
declare const FormNumberField: import("svelte").Component<Props, {}, "">;
|
|
24
|
+
type FormNumberField = ReturnType<typeof FormNumberField>;
|
|
25
|
+
export default FormNumberField;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormRangeField from './FormRangeField.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Form/FormRangeField',
|
|
8
|
+
component: FormRangeField,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
value: { control: { type: 'number' } },
|
|
12
|
+
min: { control: 'number' },
|
|
13
|
+
max: { control: 'number' },
|
|
14
|
+
step: { control: 'number' },
|
|
15
|
+
disabled: { control: 'boolean' }
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
id: 'demo-range-field',
|
|
19
|
+
value: 50,
|
|
20
|
+
onChange: fn()
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<Story name="Default" args={{ min: 0, max: 100, step: 1 }} />
|
|
26
|
+
|
|
27
|
+
<Story name="Temperature" args={{ value: 0.7, min: 0, max: 2, step: 0.05 }} />
|
|
28
|
+
|
|
29
|
+
<Story name="Small Range" args={{ value: 3, min: 1, max: 10, step: 1 }} />
|
|
30
|
+
|
|
31
|
+
<Story name="Disabled" args={{ value: 75, min: 0, max: 100, disabled: true }} />
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default FormRangeField;
|
|
2
|
+
type FormRangeField = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const FormRangeField: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
import FormRangeField from './FormRangeField.svelte';
|
|
15
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
+
$$bindings?: Bindings;
|
|
18
|
+
} & Exports;
|
|
19
|
+
(internal: unknown, props: {
|
|
20
|
+
$$events?: Events;
|
|
21
|
+
$$slots?: Slots;
|
|
22
|
+
}): Exports & {
|
|
23
|
+
$set?: any;
|
|
24
|
+
$on?: any;
|
|
25
|
+
};
|
|
26
|
+
z_$$bindings?: Bindings;
|
|
27
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
FormRangeField Component
|
|
3
|
+
Range slider input field for numeric values
|
|
4
|
+
|
|
5
|
+
Features:
|
|
6
|
+
- Modern styled range slider with custom track and thumb
|
|
7
|
+
- Min/max/step support for value constraints
|
|
8
|
+
- Real-time value display with tabular numeric font
|
|
9
|
+
- Proper ARIA attributes for accessibility
|
|
10
|
+
- Visual feedback for current value position
|
|
11
|
+
-->
|
|
12
|
+
|
|
13
|
+
<script lang="ts">
|
|
14
|
+
interface Props {
|
|
15
|
+
/** Field identifier */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Current value */
|
|
18
|
+
value: number | string;
|
|
19
|
+
/** Minimum allowed value */
|
|
20
|
+
min?: number;
|
|
21
|
+
/** Maximum allowed value */
|
|
22
|
+
max?: number;
|
|
23
|
+
/** Step increment */
|
|
24
|
+
step?: number;
|
|
25
|
+
/** Whether the field is required */
|
|
26
|
+
required?: boolean;
|
|
27
|
+
/** Whether the field is disabled (read-only) */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** ARIA description ID */
|
|
30
|
+
ariaDescribedBy?: string;
|
|
31
|
+
/** Callback when value changes */
|
|
32
|
+
onChange: (value: number) => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let {
|
|
36
|
+
id,
|
|
37
|
+
value = 0,
|
|
38
|
+
min = 0,
|
|
39
|
+
max = 100,
|
|
40
|
+
step = 1,
|
|
41
|
+
required = false,
|
|
42
|
+
disabled = false,
|
|
43
|
+
ariaDescribedBy,
|
|
44
|
+
onChange
|
|
45
|
+
}: Props = $props();
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Compute the current numeric value
|
|
49
|
+
* Handles string values and defaults
|
|
50
|
+
*/
|
|
51
|
+
const numericValue = $derived.by((): number => {
|
|
52
|
+
if (typeof value === 'number') {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
const parsed = Number(value);
|
|
56
|
+
return isNaN(parsed) ? min : parsed;
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Compute the percentage position for the filled track
|
|
61
|
+
* Used to show visual progress of the slider
|
|
62
|
+
*/
|
|
63
|
+
const progressPercentage = $derived.by((): number => {
|
|
64
|
+
const range = max - min;
|
|
65
|
+
if (range === 0) return 0;
|
|
66
|
+
return ((numericValue - min) / range) * 100;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Handle input changes
|
|
71
|
+
* Converts the value to a number and triggers onChange
|
|
72
|
+
*/
|
|
73
|
+
function handleInput(event: Event): void {
|
|
74
|
+
const target = event.currentTarget as HTMLInputElement;
|
|
75
|
+
const numValue = Number(target.value);
|
|
76
|
+
onChange(numValue);
|
|
77
|
+
}
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<div class="form-range-container">
|
|
81
|
+
<div class="form-range-slider">
|
|
82
|
+
<input
|
|
83
|
+
{id}
|
|
84
|
+
type="range"
|
|
85
|
+
class="form-range-field"
|
|
86
|
+
value={numericValue}
|
|
87
|
+
{min}
|
|
88
|
+
{max}
|
|
89
|
+
{step}
|
|
90
|
+
{disabled}
|
|
91
|
+
aria-describedby={ariaDescribedBy}
|
|
92
|
+
aria-valuemin={min}
|
|
93
|
+
aria-valuemax={max}
|
|
94
|
+
aria-valuenow={numericValue}
|
|
95
|
+
oninput={handleInput}
|
|
96
|
+
style="--progress: {progressPercentage}%"
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="form-range-values">
|
|
100
|
+
<span class="form-range-min">{min}</span>
|
|
101
|
+
<span class="form-range-current">{numericValue}</span>
|
|
102
|
+
<span class="form-range-max">{max}</span>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<style>
|
|
107
|
+
.form-range-container {
|
|
108
|
+
display: flex;
|
|
109
|
+
flex-direction: column;
|
|
110
|
+
gap: 0.5rem;
|
|
111
|
+
width: 100%;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.form-range-slider {
|
|
115
|
+
position: relative;
|
|
116
|
+
width: 100%;
|
|
117
|
+
padding: 0.25rem 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.form-range-field {
|
|
121
|
+
width: 100%;
|
|
122
|
+
height: 6px;
|
|
123
|
+
border-radius: 3px;
|
|
124
|
+
appearance: none;
|
|
125
|
+
-webkit-appearance: none;
|
|
126
|
+
background: linear-gradient(
|
|
127
|
+
to right,
|
|
128
|
+
var(--fd-primary) 0%,
|
|
129
|
+
var(--fd-primary) var(--progress, 0%),
|
|
130
|
+
var(--fd-border) var(--progress, 0%),
|
|
131
|
+
var(--fd-border) 100%
|
|
132
|
+
);
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
transition: background var(--fd-transition-fast);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Webkit (Chrome, Safari, Edge) - Track */
|
|
138
|
+
.form-range-field::-webkit-slider-runnable-track {
|
|
139
|
+
height: 6px;
|
|
140
|
+
border-radius: 3px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Webkit - Thumb */
|
|
144
|
+
.form-range-field::-webkit-slider-thumb {
|
|
145
|
+
-webkit-appearance: none;
|
|
146
|
+
appearance: none;
|
|
147
|
+
width: 18px;
|
|
148
|
+
height: 18px;
|
|
149
|
+
border-radius: 50%;
|
|
150
|
+
background: linear-gradient(135deg, var(--fd-background) 0%, var(--fd-muted) 100%);
|
|
151
|
+
border: 2px solid var(--fd-primary);
|
|
152
|
+
box-shadow:
|
|
153
|
+
0 2px 6px rgba(59, 130, 246, 0.25),
|
|
154
|
+
0 1px 2px rgba(0, 0, 0, 0.1);
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
margin-top: -6px;
|
|
157
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.form-range-field::-webkit-slider-thumb:hover {
|
|
161
|
+
transform: scale(1.1);
|
|
162
|
+
box-shadow:
|
|
163
|
+
0 4px 12px rgba(59, 130, 246, 0.35),
|
|
164
|
+
0 2px 4px rgba(0, 0, 0, 0.1);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.form-range-field:focus::-webkit-slider-thumb {
|
|
168
|
+
box-shadow:
|
|
169
|
+
0 0 0 3px rgba(59, 130, 246, 0.2),
|
|
170
|
+
0 4px 12px rgba(59, 130, 246, 0.35);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Firefox - Track */
|
|
174
|
+
.form-range-field::-moz-range-track {
|
|
175
|
+
height: 6px;
|
|
176
|
+
border-radius: 3px;
|
|
177
|
+
background: var(--fd-border);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.form-range-field::-moz-range-progress {
|
|
181
|
+
height: 6px;
|
|
182
|
+
border-radius: 3px;
|
|
183
|
+
background: var(--fd-primary);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Firefox - Thumb */
|
|
187
|
+
.form-range-field::-moz-range-thumb {
|
|
188
|
+
width: 18px;
|
|
189
|
+
height: 18px;
|
|
190
|
+
border-radius: 50%;
|
|
191
|
+
background: linear-gradient(135deg, var(--fd-background) 0%, var(--fd-muted) 100%);
|
|
192
|
+
border: 2px solid var(--fd-primary);
|
|
193
|
+
box-shadow:
|
|
194
|
+
0 2px 6px rgba(59, 130, 246, 0.25),
|
|
195
|
+
0 1px 2px rgba(0, 0, 0, 0.1);
|
|
196
|
+
cursor: pointer;
|
|
197
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.form-range-field::-moz-range-thumb:hover {
|
|
201
|
+
transform: scale(1.1);
|
|
202
|
+
box-shadow:
|
|
203
|
+
0 4px 12px rgba(59, 130, 246, 0.35),
|
|
204
|
+
0 2px 4px rgba(0, 0, 0, 0.1);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.form-range-field:focus::-moz-range-thumb {
|
|
208
|
+
box-shadow:
|
|
209
|
+
0 0 0 3px rgba(59, 130, 246, 0.2),
|
|
210
|
+
0 4px 12px rgba(59, 130, 246, 0.35);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Focus styles */
|
|
214
|
+
.form-range-field:focus {
|
|
215
|
+
outline: none;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.form-range-field:focus-visible {
|
|
219
|
+
outline: none;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* Value display row */
|
|
223
|
+
.form-range-values {
|
|
224
|
+
display: flex;
|
|
225
|
+
justify-content: space-between;
|
|
226
|
+
align-items: center;
|
|
227
|
+
font-size: var(--fd-text-xs);
|
|
228
|
+
font-variant-numeric: tabular-nums;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.form-range-min,
|
|
232
|
+
.form-range-max {
|
|
233
|
+
color: var(--fd-muted-foreground);
|
|
234
|
+
font-weight: 400;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.form-range-current {
|
|
238
|
+
font-weight: 600;
|
|
239
|
+
color: var(--fd-primary-hover);
|
|
240
|
+
background-color: var(--fd-primary-muted);
|
|
241
|
+
padding: 0.125rem 0.5rem;
|
|
242
|
+
border-radius: var(--fd-radius-sm);
|
|
243
|
+
min-width: 2.5rem;
|
|
244
|
+
text-align: center;
|
|
245
|
+
}
|
|
246
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Field identifier */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Current value */
|
|
5
|
+
value: number | string;
|
|
6
|
+
/** Minimum allowed value */
|
|
7
|
+
min?: number;
|
|
8
|
+
/** Maximum allowed value */
|
|
9
|
+
max?: number;
|
|
10
|
+
/** Step increment */
|
|
11
|
+
step?: number;
|
|
12
|
+
/** Whether the field is required */
|
|
13
|
+
required?: boolean;
|
|
14
|
+
/** Whether the field is disabled (read-only) */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** ARIA description ID */
|
|
17
|
+
ariaDescribedBy?: string;
|
|
18
|
+
/** Callback when value changes */
|
|
19
|
+
onChange: (value: number) => void;
|
|
20
|
+
}
|
|
21
|
+
declare const FormRangeField: import("svelte").Component<Props, {}, "">;
|
|
22
|
+
type FormRangeField = ReturnType<typeof FormRangeField>;
|
|
23
|
+
export default FormRangeField;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script module>
|
|
2
|
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
|
3
|
+
import FormSelect from './FormSelect.svelte';
|
|
4
|
+
import { fn } from 'storybook/test';
|
|
5
|
+
|
|
6
|
+
const { Story } = defineMeta({
|
|
7
|
+
title: 'Form/FormSelect',
|
|
8
|
+
component: FormSelect,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
argTypes: {
|
|
11
|
+
value: { control: 'text' },
|
|
12
|
+
required: { control: 'boolean' },
|
|
13
|
+
disabled: { control: 'boolean' }
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
id: 'demo-select',
|
|
17
|
+
value: '',
|
|
18
|
+
onChange: fn()
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<Story
|
|
24
|
+
name="String Options"
|
|
25
|
+
args={{
|
|
26
|
+
options: ['Option A', 'Option B', 'Option C'],
|
|
27
|
+
value: 'Option A'
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<Story
|
|
32
|
+
name="FieldOption Objects"
|
|
33
|
+
args={{
|
|
34
|
+
options: [
|
|
35
|
+
{ value: 'gpt-4', label: 'GPT-4' },
|
|
36
|
+
{ value: 'gpt-3.5', label: 'GPT-3.5 Turbo' },
|
|
37
|
+
{ value: 'claude-3', label: 'Claude 3 Opus' }
|
|
38
|
+
],
|
|
39
|
+
value: 'gpt-4'
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<Story
|
|
44
|
+
name="Disabled"
|
|
45
|
+
args={{
|
|
46
|
+
options: ['Read', 'Write', 'Admin'],
|
|
47
|
+
value: 'Read',
|
|
48
|
+
disabled: true
|
|
49
|
+
}}
|
|
50
|
+
/>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default FormSelect;
|
|
2
|
+
type FormSelect = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const FormSelect: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
import FormSelect from './FormSelect.svelte';
|
|
15
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
16
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
17
|
+
$$bindings?: Bindings;
|
|
18
|
+
} & Exports;
|
|
19
|
+
(internal: unknown, props: {
|
|
20
|
+
$$events?: Events;
|
|
21
|
+
$$slots?: Slots;
|
|
22
|
+
}): Exports & {
|
|
23
|
+
$set?: any;
|
|
24
|
+
$on?: any;
|
|
25
|
+
};
|
|
26
|
+
z_$$bindings?: Bindings;
|
|
27
|
+
}
|