@kitn.ai/ui 0.15.0 → 0.16.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 +9 -0
- package/bin/mcp.js +22 -0
- package/dist/bash-InADTalH.js +6 -1
- package/dist/components/artifact.d.ts +58 -0
- package/dist/components/attachments.d.ts +67 -0
- package/dist/components/card-fallback.d.ts +10 -0
- package/dist/components/card-renderer.d.ts +13 -0
- package/dist/components/card.d.ts +28 -0
- package/dist/components/chain-of-thought.d.ts +29 -0
- package/dist/components/chat-container.d.ts +19 -0
- package/dist/components/chat-scope-picker.d.ts +9 -0
- package/dist/components/chat-thread.d.ts +93 -0
- package/dist/components/checkpoint.d.ts +20 -0
- package/dist/components/choice-card.d.ts +77 -0
- package/dist/components/code-block.d.ts +16 -0
- package/dist/components/confirm-card.d.ts +57 -0
- package/dist/components/context.d.ts +65 -0
- package/dist/components/conversation-item.d.ts +8 -0
- package/dist/components/conversation-list.d.ts +11 -0
- package/dist/components/embed.d.ts +21 -0
- package/dist/components/empty.d.ts +43 -0
- package/dist/components/feedback-bar.d.ts +45 -0
- package/dist/components/file-tree.d.ts +57 -0
- package/dist/components/file-upload.d.ts +16 -0
- package/dist/components/form-widgets.d.ts +31 -0
- package/dist/components/form.d.ts +103 -0
- package/dist/components/image.d.ts +12 -0
- package/dist/components/link-preview.d.ts +23 -0
- package/dist/components/loader.d.ts +60 -0
- package/dist/components/markdown.d.ts +8 -0
- package/dist/components/message-skills.d.ts +15 -0
- package/dist/components/message.d.ts +54 -0
- package/dist/components/model-switcher.d.ts +8 -0
- package/dist/components/prompt-input.d.ts +38 -0
- package/dist/components/prompt-suggestion.d.ts +13 -0
- package/dist/components/reasoning.d.ts +20 -0
- package/dist/components/response-stream.d.ts +14 -0
- package/dist/components/scroll-button.d.ts +7 -0
- package/dist/components/slash-command.d.ts +15 -0
- package/dist/components/source.d.ts +23 -0
- package/dist/components/tasks-card.d.ts +71 -0
- package/dist/components/text-shimmer.d.ts +9 -0
- package/dist/components/thinking-bar.d.ts +10 -0
- package/dist/components/tool.d.ts +16 -0
- package/dist/components/use-card-resolution.d.ts +12 -0
- package/dist/components/voice-input.d.ts +7 -0
- package/dist/core-AYMC6_lb.js +5874 -12
- package/dist/css-M7EaDHN_.js +6 -1
- package/dist/elements/artifact.d.ts +1 -0
- package/dist/elements/attachments.d.ts +1 -0
- package/dist/elements/card.d.ts +1 -0
- package/dist/elements/cards.d.ts +0 -0
- package/dist/elements/chain-of-thought.d.ts +13 -0
- package/dist/elements/chat-scope-picker.d.ts +1 -0
- package/dist/elements/chat-types.d.ts +41 -0
- package/dist/elements/chat-workspace.d.ts +1 -0
- package/dist/elements/chat.d.ts +1 -0
- package/dist/elements/checkpoint.d.ts +1 -0
- package/dist/elements/choice.d.ts +1 -0
- package/dist/elements/code-block.d.ts +1 -0
- package/dist/elements/confirm-card.d.ts +1 -0
- package/dist/elements/context-meter.d.ts +1 -0
- package/dist/elements/conversation-list.d.ts +11 -0
- package/dist/elements/css.d.ts +1 -0
- package/dist/elements/default-input.d.ts +40 -0
- package/dist/elements/define.d.ts +42 -0
- package/dist/elements/embed.d.ts +1 -0
- package/dist/elements/empty.d.ts +1 -0
- package/dist/elements/feedback-bar.d.ts +1 -0
- package/dist/elements/file-tree.d.ts +1 -0
- package/dist/elements/file-upload.d.ts +1 -0
- package/dist/elements/form.d.ts +1 -0
- package/dist/elements/image.d.ts +1 -0
- package/dist/elements/link-preview.d.ts +1 -0
- package/dist/elements/loader.d.ts +1 -0
- package/dist/elements/markdown.d.ts +1 -0
- package/dist/elements/message-skills.d.ts +17 -0
- package/dist/elements/message.d.ts +1 -0
- package/dist/elements/model-switcher.d.ts +11 -0
- package/dist/elements/popover.d.ts +1 -0
- package/dist/elements/prompt-input.d.ts +9 -0
- package/dist/elements/prompt-suggestions.d.ts +7 -0
- package/dist/elements/reasoning.d.ts +1 -0
- package/dist/elements/register-impl.d.ts +0 -0
- package/dist/elements/register.d.ts +3 -0
- package/dist/elements/remote.d.ts +1 -0
- package/dist/elements/resizable.d.ts +17 -0
- package/dist/elements/response-stream.d.ts +1 -0
- package/dist/elements/scroll-button.d.ts +1 -0
- package/dist/elements/source.d.ts +18 -0
- package/dist/elements/switch.d.ts +1 -0
- package/dist/elements/tasks.d.ts +1 -0
- package/dist/elements/text-shimmer.d.ts +1 -0
- package/dist/elements/thinking-bar.d.ts +1 -0
- package/dist/elements/tool.d.ts +1 -0
- package/dist/elements/voice-input.d.ts +1 -0
- package/dist/elements.d.ts +732 -0
- package/dist/engine-javascript-vq0WuIJl.js +2516 -14
- package/dist/github-dark-dimmed-DUshB20C.js +4 -1
- package/dist/github-light-JYsPkUQd.js +4 -1
- package/dist/html-CPZ3oZQ7.js +10 -1
- package/dist/index.d.ts +112 -2
- package/dist/index.js +13551 -0
- package/dist/javascript-C25yR2R2.js +6 -1
- package/dist/json-DxJze_jm.js +6 -1
- package/dist/kitn-chat.es.js +1 -77
- package/dist/llms/llms-full.txt +1 -1
- package/dist/llms/llms.txt +1 -1
- package/dist/mcp.es.js +2140 -0
- package/dist/primitives/card-contract.d.ts +103 -0
- package/dist/primitives/card-host.d.ts +12 -0
- package/dist/primitives/card-registry.d.ts +17 -0
- package/dist/primitives/card-resolution.d.ts +8 -0
- package/dist/primitives/card-routing.d.ts +12 -0
- package/dist/primitives/card-validate.d.ts +25 -0
- package/dist/primitives/chat-config.d.ts +31 -0
- package/dist/primitives/controllable.d.ts +13 -0
- package/dist/primitives/embed-providers.d.ts +65 -0
- package/dist/primitives/highlighter.d.ts +23 -0
- package/dist/primitives/link-preview.d.ts +47 -0
- package/dist/primitives/pdf-preview.d.ts +50 -0
- package/dist/primitives/use-auto-resize.d.ts +8 -0
- package/dist/primitives/use-resize-observer.d.ts +1 -0
- package/dist/primitives/use-stick-to-bottom.d.ts +5 -0
- package/dist/primitives/use-text-stream.d.ts +19 -0
- package/dist/primitives/use-voice-recorder.d.ts +9 -0
- package/dist/react/index.d.ts +1118 -0
- package/dist/react/runtime.d.ts +15 -0
- package/dist/react.js +265 -0
- package/dist/register-impl-wCsFPoh9.js +77 -0
- package/dist/register-ujhr1nBS.js +1 -0
- package/dist/remote/host-embed.d.ts +33 -0
- package/dist/remote/index.d.ts +2 -0
- package/dist/remote/origin.d.ts +5 -0
- package/dist/remote/provider-runtime.d.ts +27 -0
- package/dist/remote/provider.d.ts +2 -0
- package/dist/remote/validate.d.ts +4 -0
- package/dist/remote/version.d.ts +4 -0
- package/dist/remote/wire.d.ts +53 -0
- package/dist/svelte--5p79yCD.js +15 -1
- package/dist/tsx-B8rCNbgL.js +6 -1
- package/dist/types.d.ts +42 -0
- package/dist/typescript-RycA9KXf.js +6 -1
- package/dist/ui/action-icons.d.ts +11 -0
- package/dist/ui/avatar.d.ts +8 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/button.d.ts +10 -0
- package/dist/ui/collapsible.d.ts +27 -0
- package/dist/ui/dropdown.d.ts +20 -0
- package/dist/ui/hover-card.d.ts +28 -0
- package/dist/ui/overlay.d.ts +67 -0
- package/dist/ui/popover.d.ts +32 -0
- package/dist/ui/resizable.d.ts +76 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/separator.d.ts +5 -0
- package/dist/ui/skeleton.d.ts +5 -0
- package/dist/ui/switch.d.ts +19 -0
- package/dist/ui/textarea.d.ts +6 -0
- package/dist/ui/tooltip.d.ts +8 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/vue-BmIZj4XD.js +33 -1
- package/frameworks/react/index.tsx +4 -0
- package/frameworks/react/runtime.tsx +16 -2
- package/llms-full.txt +1 -1
- package/llms.txt +1 -1
- package/package.json +29 -11
- package/src/agent-tooling/archetypes.ts +46 -0
- package/src/agent-tooling/integrations/cloudflare.ts +88 -0
- package/src/agent-tooling/integrations/langgraph.ts +60 -0
- package/src/agent-tooling/integrations/mastra.ts +27 -0
- package/src/agent-tooling/integrations/mock.ts +34 -0
- package/src/agent-tooling/integrations/ollama.ts +47 -0
- package/src/agent-tooling/integrations/openrouter.ts +26 -0
- package/src/agent-tooling/integrations/pi.ts +40 -0
- package/src/agent-tooling/integrations/pydantic-ai.ts +52 -0
- package/src/agent-tooling/integrations/vercel-ai-sdk.ts +44 -0
- package/src/agent-tooling/mcp/manifest.ts +128 -0
- package/src/agent-tooling/mcp/server.ts +59 -0
- package/src/agent-tooling/mcp/stdio.ts +18 -0
- package/src/agent-tooling/mcp/tools/debug.ts +305 -0
- package/src/agent-tooling/mcp/tools/reference.ts +132 -0
- package/src/agent-tooling/mcp/tools/scaffold.ts +1627 -0
- package/src/agent-tooling/mcp/tools/theme.ts +340 -0
- package/src/agent-tooling/mcp/tools/types.ts +14 -0
- package/src/agent-tooling/registry.ts +41 -0
- package/src/agent-tooling/types.ts +30 -0
- package/src/elements/compiled.css +1 -1
- package/src/elements/define.tsx +7 -1
- package/src/elements/element-types.d.ts +2 -1
- package/src/elements/register-impl.ts +55 -0
- package/src/elements/register.ts +17 -51
- package/theme.css +4 -2
- package/src/components/artifact.stories.tsx +0 -138
- package/src/components/attachments.stories.tsx +0 -303
- package/src/components/attachments.test.tsx +0 -64
- package/src/components/chain-of-thought.stories.tsx +0 -211
- package/src/components/chat-container.stories.tsx +0 -187
- package/src/components/chat-thread.test.tsx +0 -58
- package/src/components/checkpoint.stories.tsx +0 -102
- package/src/components/code-block.stories.tsx +0 -150
- package/src/components/confirm-card.stories.tsx +0 -74
- package/src/components/context.stories.tsx +0 -229
- package/src/components/context.test.tsx +0 -133
- package/src/components/conversation-item.stories.tsx +0 -125
- package/src/components/conversation-list.stories.tsx +0 -133
- package/src/components/default-input.test.tsx +0 -111
- package/src/components/empty.stories.tsx +0 -434
- package/src/components/feedback-bar.stories.tsx +0 -138
- package/src/components/feedback-bar.test.tsx +0 -103
- package/src/components/file-tree.stories.tsx +0 -73
- package/src/components/file-upload.stories.tsx +0 -156
- package/src/components/image.stories.tsx +0 -89
- package/src/components/loader.stories.tsx +0 -181
- package/src/components/markdown.stories.tsx +0 -180
- package/src/components/message-action-bar.test.tsx +0 -128
- package/src/components/message-narrow.stories.tsx +0 -329
- package/src/components/message-skills.stories.tsx +0 -211
- package/src/components/message.stories.tsx +0 -281
- package/src/components/model-switcher.stories.tsx +0 -123
- package/src/components/model-switcher.test.tsx +0 -65
- package/src/components/prompt-input.stories.tsx +0 -222
- package/src/components/prompt-suggestion.stories.tsx +0 -142
- package/src/components/reasoning.stories.tsx +0 -140
- package/src/components/resizable.test.tsx +0 -226
- package/src/components/scroll-button.stories.tsx +0 -100
- package/src/components/slash-command.stories.tsx +0 -163
- package/src/components/source-list.test.tsx +0 -152
- package/src/components/source.stories.tsx +0 -124
- package/src/components/tasks-card.stories.tsx +0 -78
- package/src/components/text-shimmer.stories.tsx +0 -87
- package/src/components/thinking-bar.stories.tsx +0 -87
- package/src/components/tool.stories.tsx +0 -153
- package/src/components/voice-input.stories.tsx +0 -83
- package/src/elements/artifact.stories.tsx +0 -506
- package/src/elements/attachments.stories.tsx +0 -190
- package/src/elements/card.stories.tsx +0 -113
- package/src/elements/cards.stories.tsx +0 -59
- package/src/elements/catalog.stories.tsx +0 -491
- package/src/elements/chain-of-thought.declarative.test.tsx +0 -153
- package/src/elements/chain-of-thought.stories.tsx +0 -113
- package/src/elements/chat-scope-picker.stories.tsx +0 -73
- package/src/elements/chat-workspace.stories.tsx +0 -288
- package/src/elements/chat.stories.tsx +0 -151
- package/src/elements/checkpoint.stories.tsx +0 -72
- package/src/elements/choice.stories.tsx +0 -240
- package/src/elements/code-block.stories.tsx +0 -83
- package/src/elements/composed-shell.stories.tsx +0 -316
- package/src/elements/confirm-card.stories.tsx +0 -227
- package/src/elements/context-meter.stories.tsx +0 -151
- package/src/elements/conversation-list.declarative.test.tsx +0 -137
- package/src/elements/conversation-list.stories.tsx +0 -243
- package/src/elements/embed.stories.tsx +0 -213
- package/src/elements/empty.stories.tsx +0 -111
- package/src/elements/feedback-bar.stories.tsx +0 -114
- package/src/elements/file-tree.stories.tsx +0 -134
- package/src/elements/file-upload.stories.tsx +0 -82
- package/src/elements/form.stories.tsx +0 -248
- package/src/elements/image.stories.tsx +0 -71
- package/src/elements/link-preview.stories.tsx +0 -209
- package/src/elements/loader.stories.tsx +0 -88
- package/src/elements/markdown.stories.tsx +0 -76
- package/src/elements/message-skills.declarative.test.tsx +0 -104
- package/src/elements/message-skills.stories.tsx +0 -114
- package/src/elements/message.stories.tsx +0 -218
- package/src/elements/model-switcher.declarative.test.tsx +0 -130
- package/src/elements/model-switcher.stories.tsx +0 -198
- package/src/elements/popover.stories.tsx +0 -80
- package/src/elements/prompt-input-slash-command.test.tsx +0 -128
- package/src/elements/prompt-input-stoppable.test.tsx +0 -88
- package/src/elements/prompt-input-toolbar-actions.test.tsx +0 -120
- package/src/elements/prompt-input.stories.tsx +0 -331
- package/src/elements/prompt-suggestions.declarative.test.tsx +0 -164
- package/src/elements/prompt-suggestions.stories.tsx +0 -213
- package/src/elements/reasoning.stories.tsx +0 -77
- package/src/elements/remote.stories.tsx +0 -314
- package/src/elements/resizable.stories.tsx +0 -426
- package/src/elements/response-stream.stories.tsx +0 -79
- package/src/elements/scroll-button.stories.tsx +0 -202
- package/src/elements/scroll-button.test.tsx +0 -148
- package/src/elements/source-list.stories.tsx +0 -143
- package/src/elements/source.stories.tsx +0 -88
- package/src/elements/switch.stories.tsx +0 -56
- package/src/elements/tasks.stories.tsx +0 -237
- package/src/elements/text-shimmer.stories.tsx +0 -64
- package/src/elements/thinking-bar.stories.tsx +0 -72
- package/src/elements/tool.stories.tsx +0 -89
- package/src/elements/voice-input.stories.tsx +0 -88
- package/src/primitives/controllable.test.ts +0 -47
- package/src/stories/chat-panel-layout.stories.tsx +0 -145
- package/src/stories/chat-scene.tsx +0 -571
- package/src/stories/checkpoint-restore.stories.tsx +0 -256
- package/src/stories/context-usage.stories.tsx +0 -212
- package/src/stories/conversation-with-reasoning.stories.tsx +0 -182
- package/src/stories/conversation-with-sources.stories.tsx +0 -471
- package/src/stories/docs/Accessibility.mdx +0 -119
- package/src/stories/docs/ChildElements.mdx +0 -269
- package/src/stories/docs/ForAIAgents.mdx +0 -162
- package/src/stories/docs/GettingStarted.mdx +0 -65
- package/src/stories/docs/Installation.mdx +0 -83
- package/src/stories/docs/Introduction.mdx +0 -50
- package/src/stories/docs/SolidJsAdvanced.mdx +0 -17
- package/src/stories/docs/Theming.mdx +0 -85
- package/src/stories/docs/element-controls.ts +0 -121
- package/src/stories/docs/frameworks/Angular.mdx +0 -245
- package/src/stories/docs/frameworks/Html.mdx +0 -227
- package/src/stories/docs/frameworks/Overview.mdx +0 -47
- package/src/stories/docs/frameworks/React.mdx +0 -227
- package/src/stories/docs/frameworks/Solid.mdx +0 -173
- package/src/stories/docs/frameworks/Svelte.mdx +0 -194
- package/src/stories/docs/frameworks/Vue.mdx +0 -238
- package/src/stories/docs/generative-ui-overview.mdx +0 -186
- package/src/stories/docs/recipes/SpeechToText.mdx +0 -7
- package/src/stories/docs/recipes/Streaming.mdx +0 -68
- package/src/stories/docs/recipes/TextToSpeech.mdx +0 -35
- package/src/stories/docs/theme-editor/canvas.tsx +0 -32
- package/src/stories/docs/theme-editor/inspector.tsx +0 -66
- package/src/stories/docs/theme-editor/presets.test.ts +0 -32
- package/src/stories/docs/theme-editor/presets.ts +0 -64
- package/src/stories/docs/theme-editor/theme-css.test.ts +0 -19
- package/src/stories/docs/theme-editor/theme-css.ts +0 -15
- package/src/stories/docs/theme-editor/theme-editor.tsx +0 -146
- package/src/stories/docs/theme-tokens.tsx +0 -174
- package/src/stories/examples/ChoosingComponents.mdx +0 -106
- package/src/stories/examples/sample-data.ts +0 -79
- package/src/stories/examples/usage/checkpoint-restore.ts +0 -156
- package/src/stories/examples/usage/context-usage.ts +0 -591
- package/src/stories/examples/usage/conversation-with-reasoning.ts +0 -224
- package/src/stories/examples/usage/conversation-with-sources.ts +0 -589
- package/src/stories/examples/usage/empty-state.ts +0 -144
- package/src/stories/examples/usage/full-chat-app.ts +0 -277
- package/src/stories/examples/usage/index.ts +0 -63
- package/src/stories/examples/usage/message-actions.ts +0 -704
- package/src/stories/examples/usage/pattern-centered-conversation.ts +0 -446
- package/src/stories/examples/usage/pattern-chat-panel-layout.ts +0 -442
- package/src/stories/examples/usage/pattern-docked-widget.ts +0 -479
- package/src/stories/examples/usage/prompt-input-variants.ts +0 -1356
- package/src/stories/examples/usage/streaming-response.ts +0 -687
- package/src/stories/examples/usage/types.ts +0 -33
- package/src/stories/full-chat.stories.tsx +0 -18
- package/src/stories/message-actions.stories.tsx +0 -230
- package/src/stories/pattern-centered-conversation.stories.tsx +0 -93
- package/src/stories/pattern-docked-widget.stories.tsx +0 -93
- package/src/stories/pattern-empty-state.stories.tsx +0 -76
- package/src/stories/prompt-input-variants.stories.tsx +0 -456
- package/src/stories/streaming-response.stories.tsx +0 -438
- package/src/stories/theme-editor.stories.tsx +0 -16
- package/src/stories/token-reference.stories.tsx +0 -18
- package/src/stories/typography.stories.tsx +0 -78
- package/src/ui/avatar.stories.tsx +0 -103
- package/src/ui/badge.stories.tsx +0 -86
- package/src/ui/button.stories.tsx +0 -145
- package/src/ui/collapsible.stories.tsx +0 -69
- package/src/ui/dropdown.stories.tsx +0 -59
- package/src/ui/hover-card.stories.tsx +0 -77
- package/src/ui/hover-card.test.tsx +0 -30
- package/src/ui/overlay.stories.tsx +0 -115
- package/src/ui/popover.stories.tsx +0 -81
- package/src/ui/popover.test.tsx +0 -99
- package/src/ui/resizable.stories.tsx +0 -236
- package/src/ui/scroll-area.stories.tsx +0 -50
- package/src/ui/separator.stories.tsx +0 -81
- package/src/ui/skeleton.stories.tsx +0 -337
- package/src/ui/switch.stories.tsx +0 -51
- package/src/ui/switch.test.tsx +0 -59
- package/src/ui/textarea.stories.tsx +0 -76
- package/src/ui/tooltip.stories.tsx +0 -74
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { AttachmentData } from './attachments';
|
|
2
|
+
import { SlashCommandItem } from './slash-command';
|
|
3
|
+
import { ChatMessage } from '../elements/chat-types';
|
|
4
|
+
import { ProseSize } from '../primitives/chat-config';
|
|
5
|
+
import { ModelOption } from '../types';
|
|
6
|
+
export interface ChatThreadContextUsage {
|
|
7
|
+
usedTokens: number;
|
|
8
|
+
maxTokens: number;
|
|
9
|
+
inputTokens?: number;
|
|
10
|
+
outputTokens?: number;
|
|
11
|
+
estimatedCost?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ChatThreadProps {
|
|
14
|
+
/** Extra classes for the thread root (e.g. `h-full`). */
|
|
15
|
+
class?: string;
|
|
16
|
+
/** The full message thread to render, newest last. Each entry carries its role,
|
|
17
|
+
* content, and optional reasoning/tools/attachments/actions. Set as a JS
|
|
18
|
+
* property (`el.messages = [...]`). */
|
|
19
|
+
messages: ChatMessage[];
|
|
20
|
+
/** Controlled value of the input. When set, the host owns the input text and
|
|
21
|
+
* must update it on `kai-value-change`; leave unset for uncontrolled behavior. */
|
|
22
|
+
value?: string;
|
|
23
|
+
/** Placeholder text shown in the empty input. */
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/** When true, shows the loading/streaming state and disables submit (use while
|
|
26
|
+
* awaiting the assistant's reply). */
|
|
27
|
+
loading?: boolean;
|
|
28
|
+
/** Starter prompts shown above the input when the thread is empty. Clicking one
|
|
29
|
+
* follows `suggestionMode`. Set as a JS property. */
|
|
30
|
+
suggestions?: string[];
|
|
31
|
+
/** What clicking a suggestion does: `'submit'` (default) sends it immediately
|
|
32
|
+
* as if typed and submitted; `'fill'` just places it in the input. */
|
|
33
|
+
suggestionMode?: 'submit' | 'fill';
|
|
34
|
+
/** Keep suggestions visible after the conversation starts. By default
|
|
35
|
+
* suggestions are conversation starters and hide once `messages` is
|
|
36
|
+
* non-empty; set this to keep them always shown. Default false. */
|
|
37
|
+
persistSuggestions?: boolean;
|
|
38
|
+
/** Body/prose font scale for rendered markdown (`'xs' | 'sm' | 'base' | 'lg'`).
|
|
39
|
+
* Defaults to `'sm'`. */
|
|
40
|
+
proseSize?: ProseSize;
|
|
41
|
+
/** Shiki theme name for syntax-highlighted code blocks (e.g.
|
|
42
|
+
* `'github-dark-dimmed'`). */
|
|
43
|
+
codeTheme?: string;
|
|
44
|
+
/** Enable Shiki syntax highlighting in code blocks. Turn off to render plain
|
|
45
|
+
* `<pre>` blocks (lighter, no highlighter load). Default true. */
|
|
46
|
+
codeHighlight?: boolean;
|
|
47
|
+
/** Optional header title shown on the left of the header. */
|
|
48
|
+
chatTitle?: string;
|
|
49
|
+
/** Optional model list. When set (>1 model) a ModelSwitcher is shown in the
|
|
50
|
+
* header and a `kai-model-change` event fires on selection. */
|
|
51
|
+
models?: ModelOption[];
|
|
52
|
+
/** The currently selected model id (pairs with `models`). */
|
|
53
|
+
currentModel?: string;
|
|
54
|
+
/** Optional context-window token usage. When set, a Context token meter is
|
|
55
|
+
* shown in the header. */
|
|
56
|
+
context?: ChatThreadContextUsage;
|
|
57
|
+
/** Show the scroll-to-bottom button inside the scroll area. Default true. */
|
|
58
|
+
scrollButton?: boolean;
|
|
59
|
+
/** Whether the host has `slot="header-start"` content (left of the title) —
|
|
60
|
+
* set by the `<kai-chat>` facade so a custom control forces the header open. */
|
|
61
|
+
headerStart?: boolean;
|
|
62
|
+
/** Whether the host has `slot="header-end"` content (right of the controls). */
|
|
63
|
+
headerEnd?: boolean;
|
|
64
|
+
/** Show a Search (Globe) button in the input toolbar; fires a `search` event. */
|
|
65
|
+
search?: boolean;
|
|
66
|
+
/** Show a Voice (Mic) button in the input toolbar; fires a `voice` event. */
|
|
67
|
+
voice?: boolean;
|
|
68
|
+
/** Slash commands — when set, typing `/` in the input opens the command
|
|
69
|
+
* palette and fires `kai-slash-select`. Set as a JS property. */
|
|
70
|
+
slashCommands?: SlashCommandItem[];
|
|
71
|
+
/** Command ids to highlight as active in the palette. */
|
|
72
|
+
slashActiveIds?: string[];
|
|
73
|
+
/** Single-line palette rows. */
|
|
74
|
+
slashCompact?: boolean;
|
|
75
|
+
/** Whether each message's action bar is always visible (`'always'`, default)
|
|
76
|
+
* or only revealed on hover of that message row (`'hover'`). */
|
|
77
|
+
actionsReveal?: 'always' | 'hover';
|
|
78
|
+
onValueChange?: (value: string) => void;
|
|
79
|
+
onSubmit?: (detail: {
|
|
80
|
+
value: string;
|
|
81
|
+
attachments: AttachmentData[];
|
|
82
|
+
}) => void;
|
|
83
|
+
onSuggestionClick?: (value: string) => void;
|
|
84
|
+
onModelChange?: (modelId: string) => void;
|
|
85
|
+
onMessageAction?: (detail: {
|
|
86
|
+
messageId: string;
|
|
87
|
+
action: string;
|
|
88
|
+
}) => void;
|
|
89
|
+
onSearch?: () => void;
|
|
90
|
+
onVoice?: () => void;
|
|
91
|
+
onSlashSelect?: (command: SlashCommandItem) => void;
|
|
92
|
+
}
|
|
93
|
+
export declare function ChatThread(props: ChatThreadProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface CheckpointProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
}
|
|
4
|
+
export declare function Checkpoint(props: CheckpointProps): JSX.Element;
|
|
5
|
+
export interface CheckpointIconProps {
|
|
6
|
+
class?: string;
|
|
7
|
+
children?: JSX.Element;
|
|
8
|
+
}
|
|
9
|
+
export declare function CheckpointIcon(props: CheckpointIconProps): JSX.Element;
|
|
10
|
+
export interface CheckpointTriggerProps {
|
|
11
|
+
tooltip?: string;
|
|
12
|
+
/** Accessible name for the button — required when it has no visible text (icon-only). */
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
onClick?: () => void;
|
|
15
|
+
children?: JSX.Element;
|
|
16
|
+
class?: string;
|
|
17
|
+
variant?: 'ghost' | 'default' | 'outline';
|
|
18
|
+
size?: 'sm' | 'md' | 'lg' | 'icon' | 'icon-sm';
|
|
19
|
+
}
|
|
20
|
+
export declare function CheckpointTrigger(props: CheckpointTriggerProps): JSX.Element;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { CardEnvelope, CardHost, CardResolution } from '../primitives/card-contract';
|
|
3
|
+
export interface ChoiceOptionMedia {
|
|
4
|
+
image?: string;
|
|
5
|
+
imageAlt?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ChoiceOption {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
media?: ChoiceOptionMedia;
|
|
13
|
+
meta?: string;
|
|
14
|
+
recommended?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
payload?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export type ChoiceAllowOther = boolean | {
|
|
19
|
+
label?: string;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
};
|
|
22
|
+
export interface ChoiceCardData {
|
|
23
|
+
prompt?: string;
|
|
24
|
+
options: ChoiceOption[];
|
|
25
|
+
allowOther?: ChoiceAllowOther;
|
|
26
|
+
submitLabel?: string;
|
|
27
|
+
}
|
|
28
|
+
export type ChoiceCardEnvelope = CardEnvelope<'choice', ChoiceCardData>;
|
|
29
|
+
export declare const CHOICE_CARD_TYPE: "choice";
|
|
30
|
+
/** The reserved action id emitted by the `allowOther` free-text submit. */
|
|
31
|
+
export declare const OTHER_ACTION: "__other__";
|
|
32
|
+
/** De-dupe options by id (first wins) and validate their shape. Returns the usable
|
|
33
|
+
* list + an optional error message when there's nothing renderable. Modeled on
|
|
34
|
+
* `normalizeActions`. */
|
|
35
|
+
export declare function normalizeOptions(options: unknown): {
|
|
36
|
+
options: ChoiceOption[];
|
|
37
|
+
error?: string;
|
|
38
|
+
};
|
|
39
|
+
/** Resolve the `allowOther` data field to a config (or null when off). */
|
|
40
|
+
export declare function resolveOtherConfig(allowOther: ChoiceAllowOther | undefined): {
|
|
41
|
+
label: string;
|
|
42
|
+
placeholder: string | undefined;
|
|
43
|
+
} | null;
|
|
44
|
+
/** Index of the next non-disabled option, moving by `dir` (+1/-1) from `from`,
|
|
45
|
+
* wrapping. Returns `from` when nothing else is focusable. */
|
|
46
|
+
export declare function nextEnabledIndex(options: ChoiceOption[], from: number, dir: 1 | -1): number;
|
|
47
|
+
/** The first non-disabled option index (the initial roving tab stop), or -1. */
|
|
48
|
+
export declare function firstEnabledIndex(options: ChoiceOption[]): number;
|
|
49
|
+
export interface ChoiceCardProps {
|
|
50
|
+
/** The choice definition (CardEnvelope.data). */
|
|
51
|
+
data?: ChoiceCardData;
|
|
52
|
+
/** The card id used to correlate every emitted CardEvent. */
|
|
53
|
+
cardId?: string;
|
|
54
|
+
/** The envelope title rendered in the card chrome. */
|
|
55
|
+
heading?: string;
|
|
56
|
+
/** Optional explicit CardHost (otherwise read from a CardProvider, otherwise the
|
|
57
|
+
* bubbling `kai-card` CustomEvent off `hostElement`). */
|
|
58
|
+
host?: CardHost;
|
|
59
|
+
/** The custom-element host node, for the bubbling `kai-card` fallback emit. */
|
|
60
|
+
hostElement?: HTMLElement;
|
|
61
|
+
class?: string;
|
|
62
|
+
/** When set, render the chromed read-only view instead of the interactive radiogroup. */
|
|
63
|
+
resolution?: CardResolution;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* `ChoiceCard` — a single-select "pick one of N rich options" card (plans, products,
|
|
67
|
+
* flights, quick replies) inside `Card` chrome. The options are a WAI-ARIA radiogroup
|
|
68
|
+
* (list rows) with roving tabindex: clicking a row (or Space/Enter on the focused row)
|
|
69
|
+
* **selects** it locally without emitting; a **Submit** button below the list then emits
|
|
70
|
+
* the Card contract's **`action`** verb (`{ kind:'action', cardId, action: option.id,
|
|
71
|
+
* payload }`) and resolves the card (chosen option shown read-only) so the same pick can't
|
|
72
|
+
* double-fire. An optional `allowOther` free-text escape appends a selectable "Other…" row;
|
|
73
|
+
* selecting it reveals an inline text input, and the same Submit emits `action:'__other__'`
|
|
74
|
+
* with `{ text }`. Emits `ready` on mount and `error` for an unusable definition (inline
|
|
75
|
+
* error state).
|
|
76
|
+
*/
|
|
77
|
+
export declare function ChoiceCard(props: ChoiceCardProps): JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface CodeBlockProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: JSX.Element;
|
|
4
|
+
}
|
|
5
|
+
declare function CodeBlock(props: CodeBlockProps): JSX.Element;
|
|
6
|
+
export interface CodeBlockCodeProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
code: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
theme?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function CodeBlockCode(props: CodeBlockCodeProps): JSX.Element;
|
|
12
|
+
export interface CodeBlockGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
children?: JSX.Element;
|
|
14
|
+
}
|
|
15
|
+
declare function CodeBlockGroup(props: CodeBlockGroupProps): JSX.Element;
|
|
16
|
+
export { CodeBlock, CodeBlockCode, CodeBlockGroup };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { CardEnvelope, CardHost, CardResolution } from '../primitives/card-contract';
|
|
3
|
+
export type ConfirmActionStyle = 'primary' | 'default' | 'destructive';
|
|
4
|
+
export type ConfirmTone = 'default' | 'warning' | 'danger';
|
|
5
|
+
export interface ConfirmAction {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
style?: ConfirmActionStyle;
|
|
9
|
+
payload?: unknown;
|
|
10
|
+
default?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ConfirmCardData {
|
|
13
|
+
heading?: string;
|
|
14
|
+
body?: string;
|
|
15
|
+
tone?: ConfirmTone;
|
|
16
|
+
actions: ConfirmAction[];
|
|
17
|
+
dismissible?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type ConfirmCardEnvelope = CardEnvelope<'confirm', ConfirmCardData>;
|
|
20
|
+
export declare const CONFIRM_CARD_TYPE: "confirm";
|
|
21
|
+
/** Map an action's `style` to a Button variant (falls back + warns on unknown). */
|
|
22
|
+
export declare function buttonVariantForStyle(style: ConfirmActionStyle | undefined): 'default' | 'outline' | 'destructive';
|
|
23
|
+
/** De-dupe actions by id (first wins) and validate their shape. Returns the usable
|
|
24
|
+
* list + an optional error message when there's nothing renderable. */
|
|
25
|
+
export declare function normalizeActions(actions: unknown): {
|
|
26
|
+
actions: ConfirmAction[];
|
|
27
|
+
error?: string;
|
|
28
|
+
};
|
|
29
|
+
/** The id of the default action (first with `default:true`), if any. */
|
|
30
|
+
export declare function defaultActionId(actions: ConfirmAction[]): string | undefined;
|
|
31
|
+
export interface ConfirmCardProps {
|
|
32
|
+
/** The confirm definition (CardEnvelope.data). */
|
|
33
|
+
data?: ConfirmCardData;
|
|
34
|
+
/** The card id used to correlate every emitted CardEvent. */
|
|
35
|
+
cardId?: string;
|
|
36
|
+
/** The envelope title rendered in the card chrome. */
|
|
37
|
+
heading?: string;
|
|
38
|
+
/** Optional explicit CardHost (otherwise read from a CardProvider, otherwise the
|
|
39
|
+
* bubbling `kai-card` CustomEvent off `hostElement`). */
|
|
40
|
+
host?: CardHost;
|
|
41
|
+
/** The custom-element host node, for the bubbling `kai-card` fallback emit. */
|
|
42
|
+
hostElement?: HTMLElement;
|
|
43
|
+
/** Focus the default action on mount. Default OFF (no focus-stealing mid-stream). */
|
|
44
|
+
autofocus?: boolean;
|
|
45
|
+
class?: string;
|
|
46
|
+
/** When set, render the chromed read-only view instead of the buttons. */
|
|
47
|
+
resolution?: CardResolution;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* `ConfirmCard` — a named-intent approval card. Renders a title + body + a small
|
|
51
|
+
* set of action buttons inside `Card` chrome. Activating an action emits the Card
|
|
52
|
+
* contract's `action` verb (`{ kind:'action', cardId, action, payload }`) and
|
|
53
|
+
* resolves the card (other actions disabled, the chosen one marked) so the same
|
|
54
|
+
* approval can't double-fire. Emits `ready` on mount, `dismiss` for the optional
|
|
55
|
+
* close affordance, and `error` for an unusable definition (inline error state).
|
|
56
|
+
*/
|
|
57
|
+
export declare function ConfirmCard(props: ConfirmCardProps): JSX.Element;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
/** Default fraction (0–1) at which the meter transitions to the warning colour. */
|
|
3
|
+
export declare const DEFAULT_WARN_THRESHOLD = 0.7;
|
|
4
|
+
/** Default fraction (0–1) at which the meter transitions to the danger colour. */
|
|
5
|
+
export declare const DEFAULT_DANGER_THRESHOLD = 0.9;
|
|
6
|
+
/**
|
|
7
|
+
* Compute the severity level for a given usage fraction and thresholds.
|
|
8
|
+
* `pct` is a 0–1 fraction (e.g. `usedTokens / maxTokens`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function computeSeverity(pct: number, warnThreshold?: number, dangerThreshold?: number): ContextSeverity;
|
|
11
|
+
export type ContextSeverity = 'ok' | 'warn' | 'danger';
|
|
12
|
+
export interface ContextProps {
|
|
13
|
+
usedTokens: number;
|
|
14
|
+
maxTokens: number;
|
|
15
|
+
inputTokens?: number;
|
|
16
|
+
outputTokens?: number;
|
|
17
|
+
reasoningTokens?: number;
|
|
18
|
+
cacheTokens?: number;
|
|
19
|
+
estimatedCost?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Fraction (0–1) above which the progress bar turns yellow.
|
|
22
|
+
* Defaults to `0.7` (70%).
|
|
23
|
+
*/
|
|
24
|
+
warnThreshold?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Fraction (0–1) above which the progress bar turns red.
|
|
27
|
+
* Defaults to `0.9` (90%).
|
|
28
|
+
*/
|
|
29
|
+
dangerThreshold?: number;
|
|
30
|
+
children?: JSX.Element;
|
|
31
|
+
}
|
|
32
|
+
export declare function Context(props: ContextProps): JSX.Element;
|
|
33
|
+
export interface ContextTriggerProps {
|
|
34
|
+
children?: JSX.Element;
|
|
35
|
+
class?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function ContextTrigger(props: ContextTriggerProps): JSX.Element;
|
|
38
|
+
export interface ContextContentProps {
|
|
39
|
+
class?: string;
|
|
40
|
+
children?: JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
export declare function ContextContent(props: ContextContentProps): JSX.Element;
|
|
43
|
+
export interface ContextContentHeaderProps {
|
|
44
|
+
class?: string;
|
|
45
|
+
children?: JSX.Element;
|
|
46
|
+
}
|
|
47
|
+
export declare function ContextContentHeader(props: ContextContentHeaderProps): JSX.Element;
|
|
48
|
+
export interface ContextContentBodyProps {
|
|
49
|
+
class?: string;
|
|
50
|
+
children?: JSX.Element;
|
|
51
|
+
}
|
|
52
|
+
export declare function ContextContentBody(props: ContextContentBodyProps): JSX.Element;
|
|
53
|
+
export interface ContextContentFooterProps {
|
|
54
|
+
class?: string;
|
|
55
|
+
children?: JSX.Element;
|
|
56
|
+
}
|
|
57
|
+
export declare function ContextContentFooter(props: ContextContentFooterProps): JSX.Element;
|
|
58
|
+
export interface ContextUsageRowProps {
|
|
59
|
+
class?: string;
|
|
60
|
+
children?: JSX.Element;
|
|
61
|
+
}
|
|
62
|
+
export declare function ContextInputUsage(props: ContextUsageRowProps): JSX.Element;
|
|
63
|
+
export declare function ContextOutputUsage(props: ContextUsageRowProps): JSX.Element;
|
|
64
|
+
export declare function ContextReasoningUsage(props: ContextUsageRowProps): JSX.Element;
|
|
65
|
+
export declare function ContextCacheUsage(props: ContextUsageRowProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ConversationSummary } from '../types';
|
|
2
|
+
export interface ConversationItemProps {
|
|
3
|
+
conversation: ConversationSummary;
|
|
4
|
+
isActive: boolean;
|
|
5
|
+
onSelect: (id: string) => void;
|
|
6
|
+
class?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ConversationItem(props: ConversationItemProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConversationSummary, ConversationGroup } from '../types';
|
|
2
|
+
export interface ConversationListProps {
|
|
3
|
+
groups: ConversationGroup[];
|
|
4
|
+
conversations: ConversationSummary[];
|
|
5
|
+
activeId?: string;
|
|
6
|
+
onSelect: (id: string) => void;
|
|
7
|
+
onNewChat: () => void;
|
|
8
|
+
onToggleSidebar?: () => void;
|
|
9
|
+
class?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function ConversationList(props: ConversationListProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { CardEvent } from '../primitives/card-contract';
|
|
3
|
+
import { EmbedCardData } from '../primitives/embed-providers';
|
|
4
|
+
export interface EmbedProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onError'> {
|
|
5
|
+
/** The card id correlating every emitted event. */
|
|
6
|
+
cardId: string;
|
|
7
|
+
/** The embed payload (data-down). */
|
|
8
|
+
data: EmbedCardData;
|
|
9
|
+
/** Emit a contract CardEvent up (host routes it). */
|
|
10
|
+
onEmit?: (event: CardEvent) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `Embed` — a privacy-first lazy media facade. Initial render is a poster + a play
|
|
14
|
+
* button: NO provider iframe, NO provider JS, NO cookies until the user opts in.
|
|
15
|
+
* On play it swaps in the provider `<iframe>` (youtube-nocookie / vimeo dnt /
|
|
16
|
+
* allowlisted generic). A persistent "Open on {provider}" affordance routes the
|
|
17
|
+
* contract `open` verb so a blocked embed is never a dead end. The only verbs it
|
|
18
|
+
* emits are lifecycle `ready`, `open`, and failure `error`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Embed(props: EmbedProps): JSX.Element;
|
|
21
|
+
export type { EmbedCardData } from '../primitives/embed-providers';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
/**
|
|
4
|
+
* Empty — a composable empty-state block, modeled on shadcn/ui's `Empty`.
|
|
5
|
+
* Structure:
|
|
6
|
+
* Empty
|
|
7
|
+
* ├── EmptyHeader
|
|
8
|
+
* │ ├── EmptyMedia (icon / avatar)
|
|
9
|
+
* │ ├── EmptyTitle
|
|
10
|
+
* │ └── EmptyDescription
|
|
11
|
+
* └── EmptyContent (actions / suggestions)
|
|
12
|
+
*
|
|
13
|
+
* Styling is token-driven (`--color-*`), so it themes with the rest of the kit.
|
|
14
|
+
* No visible border by default; add `border border-dashed` via `class` for a card.
|
|
15
|
+
*/
|
|
16
|
+
export interface EmptyProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
17
|
+
children: JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
declare function Empty(props: EmptyProps): JSX.Element;
|
|
20
|
+
export interface EmptyHeaderProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
children: JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
declare function EmptyHeader(props: EmptyHeaderProps): JSX.Element;
|
|
24
|
+
declare const emptyMediaVariants: (props?: ({
|
|
25
|
+
variant?: "default" | "icon" | null | undefined;
|
|
26
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
27
|
+
export interface EmptyMediaProps extends JSX.HTMLAttributes<HTMLDivElement>, VariantProps<typeof emptyMediaVariants> {
|
|
28
|
+
children: JSX.Element;
|
|
29
|
+
}
|
|
30
|
+
declare function EmptyMedia(props: EmptyMediaProps): JSX.Element;
|
|
31
|
+
export interface EmptyTitleProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
children: JSX.Element;
|
|
33
|
+
}
|
|
34
|
+
declare function EmptyTitle(props: EmptyTitleProps): JSX.Element;
|
|
35
|
+
export interface EmptyDescriptionProps extends JSX.HTMLAttributes<HTMLParagraphElement> {
|
|
36
|
+
children: JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
declare function EmptyDescription(props: EmptyDescriptionProps): JSX.Element;
|
|
39
|
+
export interface EmptyContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
40
|
+
children: JSX.Element;
|
|
41
|
+
}
|
|
42
|
+
declare function EmptyContent(props: EmptyContentProps): JSX.Element;
|
|
43
|
+
export { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent, emptyMediaVariants, };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export type FeedbackValue = 'helpful' | 'not-helpful';
|
|
3
|
+
/** Payload of the optional detail form (phase 2). */
|
|
4
|
+
export interface FeedbackDetail {
|
|
5
|
+
value: FeedbackValue;
|
|
6
|
+
/** The selected category chip, if any. */
|
|
7
|
+
category?: string;
|
|
8
|
+
/** The free-text comment, if entered. */
|
|
9
|
+
comment?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface FeedbackBarProps {
|
|
12
|
+
class?: string;
|
|
13
|
+
/** Prompt shown in the initial "ask" state. */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Optional leading icon shown before the title. */
|
|
16
|
+
icon?: JSX.Element;
|
|
17
|
+
/** When set, a not-helpful vote opens an optional detail form before the
|
|
18
|
+
* thank-you confirmation. Off → a vote goes straight to thanks. */
|
|
19
|
+
collectDetail?: boolean;
|
|
20
|
+
/** Optional category chips offered in the detail form. */
|
|
21
|
+
categories?: string[];
|
|
22
|
+
/** Heading for the detail form. */
|
|
23
|
+
detailTitle?: string;
|
|
24
|
+
/** Placeholder for the detail comment box. */
|
|
25
|
+
detailPlaceholder?: string;
|
|
26
|
+
/** Submit button label in the detail form. */
|
|
27
|
+
submitLabel?: string;
|
|
28
|
+
/** Confirmation copy shown after a vote/submit. */
|
|
29
|
+
thanksMessage?: string;
|
|
30
|
+
/** Fired immediately when a rating button is clicked (the vote is recorded
|
|
31
|
+
* even if the user never fills in the detail form). */
|
|
32
|
+
onFeedback?: (value: FeedbackValue) => void;
|
|
33
|
+
/** Fired when the optional detail form is submitted. */
|
|
34
|
+
onSubmitDetail?: (detail: FeedbackDetail) => void;
|
|
35
|
+
/** Fired when the bar is dismissed via the close (X) button. */
|
|
36
|
+
onClose?: () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* An inline thumbs up/down feedback bar that owns its own flow: it asks, then
|
|
40
|
+
* (optionally, on a not-helpful vote) collects a category + comment, then
|
|
41
|
+
* confirms with a thank-you — all in place, the way ChatGPT/Claude do it. The
|
|
42
|
+
* vote fires `onFeedback` immediately; the optional detail fires
|
|
43
|
+
* `onSubmitDetail`; `onClose` dismisses the bar.
|
|
44
|
+
*/
|
|
45
|
+
export declare function FeedbackBar(props: FeedbackBarProps): JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
/** A single artifact file the tree can show + the preview can load. */
|
|
3
|
+
export interface FileTreeFile {
|
|
4
|
+
/** Tree label/key. Folders are built from `/`-delimited segments. */
|
|
5
|
+
path: string;
|
|
6
|
+
/** Where the preview loads it (CDN/S3/dev-server/API). */
|
|
7
|
+
url?: string;
|
|
8
|
+
/** Source for the Code tab. */
|
|
9
|
+
code?: string;
|
|
10
|
+
/** Language id for syntax highlighting (e.g. `html`, `css`, `tsx`). */
|
|
11
|
+
language?: string;
|
|
12
|
+
/** Kind — drives the icon + whether Code applies. */
|
|
13
|
+
type?: 'html' | 'pdf' | 'image' | 'other';
|
|
14
|
+
}
|
|
15
|
+
/** A folder node in the built tree. */
|
|
16
|
+
export interface FileTreeFolderNode {
|
|
17
|
+
kind: 'folder';
|
|
18
|
+
/** Last path segment (the folder's display name). */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Full `/`-joined path to this folder (stable key). */
|
|
21
|
+
path: string;
|
|
22
|
+
children: FileTreeNode[];
|
|
23
|
+
}
|
|
24
|
+
/** A leaf (file) node in the built tree. */
|
|
25
|
+
export interface FileTreeFileNode {
|
|
26
|
+
kind: 'file';
|
|
27
|
+
name: string;
|
|
28
|
+
path: string;
|
|
29
|
+
file: FileTreeFile;
|
|
30
|
+
}
|
|
31
|
+
export type FileTreeNode = FileTreeFolderNode | FileTreeFileNode;
|
|
32
|
+
/**
|
|
33
|
+
* Build a nested folder/file tree from a flat list of `/`-delimited paths.
|
|
34
|
+
*
|
|
35
|
+
* - `a/b/c.html` nests `c.html` under `b` under `a`.
|
|
36
|
+
* - Folders are de-duplicated and reused across files.
|
|
37
|
+
* - Insertion order is preserved per level, with folders sorted before files
|
|
38
|
+
* and each group sorted alphabetically (case-insensitive) for a stable,
|
|
39
|
+
* readable tree regardless of input order.
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildFileTree(files: FileTreeFile[]): FileTreeNode[];
|
|
42
|
+
export interface FileTreeProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
43
|
+
/** Flat file list; folders are derived from `/`-delimited paths. */
|
|
44
|
+
files: FileTreeFile[];
|
|
45
|
+
/** Currently-selected file path (highlighted). */
|
|
46
|
+
activeFile?: string;
|
|
47
|
+
/** Called with a file's path when the user selects it. */
|
|
48
|
+
onSelect?: (path: string, file: FileTreeFile) => void;
|
|
49
|
+
/** Folder paths expanded by default. When omitted, all folders start open. */
|
|
50
|
+
defaultExpanded?: string[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* `FileTree` — a collapsible, keyboard-navigable file explorer built from a flat
|
|
54
|
+
* list of `/`-delimited paths. ARIA `tree`/`treeitem`/`group`. Selecting a file
|
|
55
|
+
* calls `onSelect(path, file)`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function FileTree(props: FileTreeProps): JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface FileUploadProps {
|
|
3
|
+
onFilesAdded: (files: File[]) => void;
|
|
4
|
+
children: JSX.Element;
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
accept?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function FileUpload(props: FileUploadProps): JSX.Element;
|
|
10
|
+
export interface FileUploadTriggerProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
|
+
}
|
|
12
|
+
declare function FileUploadTrigger(props: FileUploadTriggerProps): JSX.Element;
|
|
13
|
+
export interface FileUploadContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
}
|
|
15
|
+
declare function FileUploadContent(props: FileUploadContentProps): JSX.Element;
|
|
16
|
+
export { FileUpload, FileUploadTrigger, FileUploadContent };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { FormField } from './form';
|
|
3
|
+
/** The shared prop shape every leaf widget receives from FieldRow. */
|
|
4
|
+
export interface WidgetProps {
|
|
5
|
+
id: string;
|
|
6
|
+
value: unknown;
|
|
7
|
+
field: FormField;
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
invalid: boolean;
|
|
12
|
+
describedBy?: string;
|
|
13
|
+
label: string;
|
|
14
|
+
onInput: (value: unknown) => void;
|
|
15
|
+
onBlur: () => void;
|
|
16
|
+
}
|
|
17
|
+
/** text / email / url / date / datetime / time / password — all <input> variants. */
|
|
18
|
+
export declare function TextWidget(props: WidgetProps & {
|
|
19
|
+
variant: 'text' | 'email' | 'url' | 'date' | 'datetime' | 'time' | 'password';
|
|
20
|
+
}): JSX.Element;
|
|
21
|
+
export declare function TextareaWidget(props: WidgetProps): JSX.Element;
|
|
22
|
+
export declare function NumberWidget(props: WidgetProps): JSX.Element;
|
|
23
|
+
export declare function SliderWidget(props: WidgetProps): JSX.Element;
|
|
24
|
+
export declare function RatingWidget(props: WidgetProps): JSX.Element;
|
|
25
|
+
export declare function SwitchWidget(props: WidgetProps): JSX.Element;
|
|
26
|
+
export declare function CheckboxWidget(props: WidgetProps): JSX.Element;
|
|
27
|
+
export declare function RadioGroupWidget(props: WidgetProps): JSX.Element;
|
|
28
|
+
export declare function SelectWidget(props: WidgetProps): JSX.Element;
|
|
29
|
+
export declare function CheckboxGroupWidget(props: WidgetProps): JSX.Element;
|
|
30
|
+
export declare function MultiSelectWidget(props: WidgetProps): JSX.Element;
|
|
31
|
+
export declare function TagListWidget(props: WidgetProps): JSX.Element;
|