@chatsdk-dev/ui 0.0.1 → 0.1.2
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 +7 -7
- package/dist/atoms/accordion.d.ts +7 -0
- package/dist/atoms/accordion.d.ts.map +1 -0
- package/dist/atoms/accordion.js +18 -0
- package/dist/atoms/alert-dialog.d.ts +19 -0
- package/dist/atoms/alert-dialog.d.ts.map +1 -0
- package/dist/atoms/alert-dialog.js +42 -0
- package/dist/atoms/alert.d.ts +11 -0
- package/dist/atoms/alert.d.ts.map +1 -0
- package/dist/atoms/alert.js +27 -0
- package/dist/atoms/avatar.d.ts +12 -0
- package/dist/atoms/avatar.d.ts.map +1 -0
- package/dist/atoms/avatar.js +23 -0
- package/dist/atoms/badge.d.ts +8 -0
- package/dist/atoms/badge.d.ts.map +1 -0
- package/dist/atoms/badge.js +44 -0
- package/dist/atoms/button-group.d.ts +11 -0
- package/dist/atoms/button-group.d.ts.map +1 -0
- package/dist/atoms/button-group.js +36 -0
- package/dist/atoms/button-loader.d.ts +9 -0
- package/dist/atoms/button-loader.d.ts.map +1 -0
- package/dist/atoms/button-loader.js +10 -0
- package/dist/atoms/button.d.ts +9 -0
- package/dist/atoms/button.d.ts.map +1 -0
- package/dist/atoms/button.js +32 -0
- package/dist/atoms/card.d.ts +12 -0
- package/dist/atoms/card.d.ts.map +1 -0
- package/dist/atoms/card.js +25 -0
- package/dist/atoms/carousel.d.ts +29 -0
- package/dist/atoms/carousel.d.ts.map +1 -0
- package/dist/atoms/carousel.js +91 -0
- package/dist/atoms/collapsible.d.ts +6 -0
- package/dist/atoms/collapsible.d.ts.map +1 -0
- package/dist/atoms/collapsible.js +13 -0
- package/dist/atoms/command.d.ts +20 -0
- package/dist/atoms/command.d.ts.map +1 -0
- package/dist/atoms/command.js +35 -0
- package/dist/atoms/container.d.ts +8 -0
- package/dist/atoms/container.d.ts.map +1 -0
- package/dist/atoms/container.js +5 -0
- package/dist/atoms/dialog.d.ts +19 -0
- package/dist/atoms/dialog.d.ts.map +1 -0
- package/dist/atoms/dialog.js +38 -0
- package/dist/atoms/dots-loader.d.ts +15 -0
- package/dist/atoms/dots-loader.d.ts.map +1 -0
- package/dist/atoms/dots-loader.js +21 -0
- package/dist/atoms/drawer.d.ts +14 -0
- package/dist/atoms/drawer.d.ts.map +1 -0
- package/dist/atoms/drawer.js +35 -0
- package/dist/atoms/dropdown-menu.d.ts +26 -0
- package/dist/atoms/dropdown-menu.d.ts.map +1 -0
- package/dist/atoms/dropdown-menu.js +51 -0
- package/dist/atoms/empty.d.ts +12 -0
- package/dist/atoms/empty.d.ts.map +1 -0
- package/dist/atoms/empty.js +33 -0
- package/dist/atoms/field.d.ts +25 -0
- package/dist/atoms/field.d.ts.map +1 -0
- package/dist/atoms/field.js +68 -0
- package/dist/atoms/form.d.ts +23 -0
- package/dist/atoms/form.d.ts.map +1 -0
- package/dist/atoms/form.js +68 -0
- package/dist/atoms/header.d.ts +6 -0
- package/dist/atoms/header.d.ts.map +1 -0
- package/dist/atoms/header.js +6 -0
- package/dist/atoms/hover-card.d.ts +6 -0
- package/dist/atoms/hover-card.d.ts.map +1 -0
- package/dist/atoms/hover-card.js +14 -0
- package/dist/atoms/index.d.ts +5 -0
- package/dist/atoms/index.d.ts.map +1 -0
- package/dist/atoms/index.js +5 -0
- package/dist/atoms/input-group.d.ts +19 -0
- package/dist/atoms/input-group.d.ts.map +1 -0
- package/dist/atoms/input-group.js +57 -0
- package/dist/atoms/input.d.ts +7 -0
- package/dist/atoms/input.d.ts.map +1 -0
- package/dist/atoms/input.js +6 -0
- package/dist/atoms/label.d.ts +3 -0
- package/dist/atoms/label.d.ts.map +1 -0
- package/dist/atoms/label.js +7 -0
- package/dist/atoms/logo.d.ts +7 -0
- package/dist/atoms/logo.d.ts.map +1 -0
- package/dist/atoms/logo.js +6 -0
- package/dist/atoms/number-flow.d.ts +3 -0
- package/dist/atoms/number-flow.d.ts.map +1 -0
- package/dist/atoms/number-flow.js +6 -0
- package/dist/atoms/popover.d.ts +10 -0
- package/dist/atoms/popover.d.ts.map +1 -0
- package/dist/atoms/popover.js +23 -0
- package/dist/atoms/progress.d.ts +8 -0
- package/dist/atoms/progress.d.ts.map +1 -0
- package/dist/atoms/progress.js +20 -0
- package/dist/atoms/radio-group.d.ts +6 -0
- package/dist/atoms/radio-group.d.ts.map +1 -0
- package/dist/atoms/radio-group.js +13 -0
- package/dist/atoms/scroll-area.d.ts +5 -0
- package/dist/atoms/scroll-area.d.ts.map +1 -0
- package/dist/atoms/scroll-area.js +11 -0
- package/dist/atoms/select.d.ts +17 -0
- package/dist/atoms/select.d.ts.map +1 -0
- package/dist/atoms/select.js +34 -0
- package/dist/atoms/separator.d.ts +3 -0
- package/dist/atoms/separator.d.ts.map +1 -0
- package/dist/atoms/separator.js +7 -0
- package/dist/atoms/sheet.d.ts +15 -0
- package/dist/atoms/sheet.d.ts.map +1 -0
- package/dist/atoms/sheet.js +37 -0
- package/dist/atoms/sidebar.d.ts +65 -0
- package/dist/atoms/sidebar.d.ts.map +1 -0
- package/dist/atoms/sidebar.js +258 -0
- package/dist/atoms/skeleton.d.ts +2 -0
- package/dist/atoms/skeleton.d.ts.map +1 -0
- package/dist/atoms/skeleton.js +5 -0
- package/dist/atoms/spinner.d.ts +3 -0
- package/dist/atoms/spinner.d.ts.map +1 -0
- package/dist/atoms/spinner.js +7 -0
- package/dist/atoms/switch.d.ts +5 -0
- package/dist/atoms/switch.d.ts.map +1 -0
- package/dist/atoms/switch.js +7 -0
- package/dist/atoms/table.d.ts +13 -0
- package/dist/atoms/table.d.ts.map +1 -0
- package/dist/atoms/table.js +28 -0
- package/dist/atoms/tabs.d.ts +12 -0
- package/dist/atoms/tabs.d.ts.map +1 -0
- package/dist/atoms/tabs.js +32 -0
- package/dist/atoms/textarea.d.ts +3 -0
- package/dist/atoms/textarea.d.ts.map +1 -0
- package/dist/atoms/textarea.js +5 -0
- package/dist/atoms/toggle.d.ts +9 -0
- package/dist/atoms/toggle.d.ts.map +1 -0
- package/dist/atoms/toggle.js +26 -0
- package/dist/atoms/tooltip.d.ts +7 -0
- package/dist/atoms/tooltip.d.ts.map +1 -0
- package/dist/atoms/tooltip.js +17 -0
- package/dist/atoms/typography/h1.d.ts +10 -0
- package/dist/atoms/typography/h1.d.ts.map +1 -0
- package/dist/atoms/typography/h1.js +6 -0
- package/dist/atoms/typography/paragraph.d.ts +6 -0
- package/dist/atoms/typography/paragraph.d.ts.map +1 -0
- package/dist/atoms/typography/paragraph.js +6 -0
- package/dist/atoms/typography/text.d.ts +14 -0
- package/dist/atoms/typography/text.d.ts.map +1 -0
- package/dist/atoms/typography/text.js +41 -0
- package/dist/components/responsive-alert-dialog.d.ts +16 -0
- package/dist/components/responsive-alert-dialog.d.ts.map +1 -0
- package/dist/components/responsive-alert-dialog.js +20 -0
- package/dist/components/responsive-dialog.d.ts +11 -0
- package/dist/components/responsive-dialog.d.ts.map +1 -0
- package/dist/components/responsive-dialog.js +21 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +2 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
- package/dist/hooks/use-copy-to-clipboard.js +31 -0
- package/dist/index.css +1580 -39
- package/dist/molecules/actions.d.ts +10 -0
- package/dist/molecules/actions.d.ts.map +1 -0
- package/dist/molecules/actions.js +13 -0
- package/dist/molecules/agent.d.ts +27 -0
- package/dist/molecules/agent.d.ts.map +1 -0
- package/dist/molecules/agent.js +27 -0
- package/dist/molecules/ai/actions.d.ts +10 -0
- package/dist/molecules/ai/actions.d.ts.map +1 -0
- package/dist/molecules/ai/actions.js +13 -0
- package/dist/molecules/ai/agent.d.ts +27 -0
- package/dist/molecules/ai/agent.d.ts.map +1 -0
- package/dist/molecules/ai/agent.js +27 -0
- package/dist/molecules/ai/artifact.d.ts +24 -0
- package/dist/molecules/ai/artifact.d.ts.map +1 -0
- package/dist/molecules/ai/artifact.js +20 -0
- package/dist/molecules/ai/attachments.d.ts +55 -0
- package/dist/molecules/ai/attachments.d.ts.map +1 -0
- package/dist/molecules/ai/attachments.js +125 -0
- package/dist/molecules/ai/audio-player.d.ts +30 -0
- package/dist/molecules/ai/audio-player.d.ts.map +1 -0
- package/dist/molecules/ai/audio-player.js +43 -0
- package/dist/molecules/ai/canvas.d.ts +9 -0
- package/dist/molecules/ai/canvas.d.ts.map +1 -0
- package/dist/molecules/ai/canvas.js +5 -0
- package/dist/molecules/ai/chain-of-thought.d.ts +30 -0
- package/dist/molecules/ai/chain-of-thought.d.ts.map +1 -0
- package/dist/molecules/ai/chain-of-thought.js +49 -0
- package/dist/molecules/ai/checkpoint.d.ts +12 -0
- package/dist/molecules/ai/checkpoint.d.ts.map +1 -0
- package/dist/molecules/ai/checkpoint.js +10 -0
- package/dist/molecules/ai/code-block.d.ts +46 -0
- package/dist/molecules/ai/code-block.d.ts.map +1 -0
- package/dist/molecules/ai/code-block.js +216 -0
- package/dist/molecules/ai/commit.d.ts +65 -0
- package/dist/molecules/ai/commit.d.ts.map +1 -0
- package/dist/molecules/ai/commit.js +95 -0
- package/dist/molecules/ai/confirmation.d.ts +50 -0
- package/dist/molecules/ai/confirmation.d.ts.map +1 -0
- package/dist/molecules/ai/confirmation.js +61 -0
- package/dist/molecules/ai/connection.d.ts +3 -0
- package/dist/molecules/ai/connection.d.ts.map +1 -0
- package/dist/molecules/ai/connection.js +3 -0
- package/dist/molecules/ai/context.d.ts +33 -0
- package/dist/molecules/ai/context.d.ts.map +1 -0
- package/dist/molecules/ai/context.js +164 -0
- package/dist/molecules/ai/controls.d.ts +5 -0
- package/dist/molecules/ai/controls.d.ts.map +1 -0
- package/dist/molecules/ai/controls.js +5 -0
- package/dist/molecules/ai/conversation.d.ts +24 -0
- package/dist/molecules/ai/conversation.d.ts.map +1 -0
- package/dist/molecules/ai/conversation.js +41 -0
- package/dist/molecules/ai/edge.d.ts +6 -0
- package/dist/molecules/ai/edge.d.ts.map +1 -0
- package/dist/molecules/ai/edge.js +87 -0
- package/dist/molecules/ai/environment-variables.d.ts +39 -0
- package/dist/molecules/ai/environment-variables.d.ts.map +1 -0
- package/dist/molecules/ai/environment-variables.js +87 -0
- package/dist/molecules/ai/file-tree.d.ts +27 -0
- package/dist/molecules/ai/file-tree.d.ts.map +1 -0
- package/dist/molecules/ai/file-tree.js +71 -0
- package/dist/molecules/ai/image.d.ts +7 -0
- package/dist/molecules/ai/image.d.ts.map +1 -0
- package/dist/molecules/ai/image.js +3 -0
- package/dist/molecules/ai/inline-citation.d.ts +39 -0
- package/dist/molecules/ai/inline-citation.d.ts.map +1 -0
- package/dist/molecules/ai/inline-citation.js +68 -0
- package/dist/molecules/ai/jsx-preview.d.ts +30 -0
- package/dist/molecules/ai/jsx-preview.d.ts.map +1 -0
- package/dist/molecules/ai/jsx-preview.js +167 -0
- package/dist/molecules/ai/loader.d.ts +6 -0
- package/dist/molecules/ai/loader.d.ts.map +1 -0
- package/dist/molecules/ai/loader.js +4 -0
- package/dist/molecules/ai/message.d.ts +38 -0
- package/dist/molecules/ai/message.d.ts.map +1 -0
- package/dist/molecules/ai/message.js +92 -0
- package/dist/molecules/ai/mic-selector.d.ts +46 -0
- package/dist/molecules/ai/mic-selector.d.ts.map +1 -0
- package/dist/molecules/ai/mic-selector.js +184 -0
- package/dist/molecules/ai/model-selector.d.ts +36 -0
- package/dist/molecules/ai/model-selector.d.ts.map +1 -0
- package/dist/molecules/ai/model-selector.js +18 -0
- package/dist/molecules/ai/node.d.ts +22 -0
- package/dist/molecules/ai/node.d.ts.map +1 -0
- package/dist/molecules/ai/node.js +11 -0
- package/dist/molecules/ai/open-in-chat.d.ts +29 -0
- package/dist/molecules/ai/open-in-chat.d.ts.map +1 -0
- package/dist/molecules/ai/open-in-chat.js +100 -0
- package/dist/molecules/ai/package-info.d.ts +30 -0
- package/dist/molecules/ai/package-info.d.ts.map +1 -0
- package/dist/molecules/ai/package-info.js +50 -0
- package/dist/molecules/ai/panel.d.ts +6 -0
- package/dist/molecules/ai/panel.d.ts.map +1 -0
- package/dist/molecules/ai/panel.js +4 -0
- package/dist/molecules/ai/persona.d.ts +49 -0
- package/dist/molecules/ai/persona.d.ts.map +1 -0
- package/dist/molecules/ai/persona.js +189 -0
- package/dist/molecules/ai/plan.d.ts +26 -0
- package/dist/molecules/ai/plan.d.ts.map +1 -0
- package/dist/molecules/ai/plan.js +34 -0
- package/dist/molecules/ai/prompt-input.d.ts +149 -0
- package/dist/molecules/ai/prompt-input.d.ts.map +1 -0
- package/dist/molecules/ai/prompt-input.js +702 -0
- package/dist/molecules/ai/queue.d.ts +62 -0
- package/dist/molecules/ai/queue.d.ts.map +1 -0
- package/dist/molecules/ai/queue.js +28 -0
- package/dist/molecules/ai/reasoning.d.ts +27 -0
- package/dist/molecules/ai/reasoning.d.ts.map +1 -0
- package/dist/molecules/ai/reasoning.js +95 -0
- package/dist/molecules/ai/response.d.ts +6 -0
- package/dist/molecules/ai/response.d.ts.map +1 -0
- package/dist/molecules/ai/response.js +18 -0
- package/dist/molecules/ai/sandbox.d.ts +25 -0
- package/dist/molecules/ai/sandbox.d.ts.map +1 -0
- package/dist/molecules/ai/sandbox.js +15 -0
- package/dist/molecules/ai/schema-display.d.ts +56 -0
- package/dist/molecules/ai/schema-display.d.ts.map +1 -0
- package/dist/molecules/ai/schema-display.js +73 -0
- package/dist/molecules/ai/shimmer.d.ts +10 -0
- package/dist/molecules/ai/shimmer.d.ts.map +1 -0
- package/dist/molecules/ai/shimmer.js +28 -0
- package/dist/molecules/ai/snippet.d.ts +19 -0
- package/dist/molecules/ai/snippet.d.ts.map +1 -0
- package/dist/molecules/ai/snippet.js +46 -0
- package/dist/molecules/ai/sources.d.ts +13 -0
- package/dist/molecules/ai/sources.d.ts.map +1 -0
- package/dist/molecules/ai/sources.js +9 -0
- package/dist/molecules/ai/speech-input.d.ts +55 -0
- package/dist/molecules/ai/speech-input.d.ts.map +1 -0
- package/dist/molecules/ai/speech-input.js +187 -0
- package/dist/molecules/ai/stack-trace.d.ts +38 -0
- package/dist/molecules/ai/stack-trace.d.ts.map +1 -0
- package/dist/molecules/ai/stack-trace.js +194 -0
- package/dist/molecules/ai/suggestion.d.ts +11 -0
- package/dist/molecules/ai/suggestion.d.ts.map +1 -0
- package/dist/molecules/ai/suggestion.js +13 -0
- package/dist/molecules/ai/task.d.ts +15 -0
- package/dist/molecules/ai/task.d.ts.map +1 -0
- package/dist/molecules/ai/task.js +10 -0
- package/dist/molecules/ai/terminal.d.ts +28 -0
- package/dist/molecules/ai/terminal.d.ts.map +1 -0
- package/dist/molecules/ai/terminal.js +68 -0
- package/dist/molecules/ai/test-results.d.ts +59 -0
- package/dist/molecules/ai/test-results.d.ts.map +1 -0
- package/dist/molecules/ai/test-results.js +97 -0
- package/dist/molecules/ai/tool.d.ts +32 -0
- package/dist/molecules/ai/tool.d.ts.map +1 -0
- package/dist/molecules/ai/tool.js +49 -0
- package/dist/molecules/ai/toolbar.d.ts +6 -0
- package/dist/molecules/ai/toolbar.d.ts.map +1 -0
- package/dist/molecules/ai/toolbar.js +4 -0
- package/dist/molecules/ai/transcription.d.ts +17 -0
- package/dist/molecules/ai/transcription.d.ts.map +1 -0
- package/dist/molecules/ai/transcription.js +36 -0
- package/dist/molecules/ai/voice-selector.d.ts +64 -0
- package/dist/molecules/ai/voice-selector.d.ts.map +1 -0
- package/dist/molecules/ai/voice-selector.js +224 -0
- package/dist/molecules/ai/web-preview.d.ts +35 -0
- package/dist/molecules/ai/web-preview.d.ts.map +1 -0
- package/dist/molecules/ai/web-preview.js +65 -0
- package/dist/molecules/artifact.d.ts +24 -0
- package/dist/molecules/artifact.d.ts.map +1 -0
- package/dist/molecules/artifact.js +20 -0
- package/dist/molecules/attachments.d.ts +55 -0
- package/dist/molecules/attachments.d.ts.map +1 -0
- package/dist/molecules/attachments.js +125 -0
- package/dist/molecules/audio-player.d.ts +30 -0
- package/dist/molecules/audio-player.d.ts.map +1 -0
- package/dist/molecules/audio-player.js +43 -0
- package/dist/molecules/canvas.d.ts +9 -0
- package/dist/molecules/canvas.d.ts.map +1 -0
- package/dist/molecules/canvas.js +5 -0
- package/dist/molecules/chain-of-thought.d.ts +30 -0
- package/dist/molecules/chain-of-thought.d.ts.map +1 -0
- package/dist/molecules/chain-of-thought.js +49 -0
- package/dist/molecules/chat-message.d.ts +10 -0
- package/dist/molecules/chat-message.d.ts.map +1 -0
- package/dist/molecules/chat-message.js +53 -0
- package/dist/molecules/checkpoint.d.ts +12 -0
- package/dist/molecules/checkpoint.d.ts.map +1 -0
- package/dist/molecules/checkpoint.js +10 -0
- package/dist/molecules/code-block.d.ts +46 -0
- package/dist/molecules/code-block.d.ts.map +1 -0
- package/dist/molecules/code-block.js +216 -0
- package/dist/molecules/commit.d.ts +65 -0
- package/dist/molecules/commit.d.ts.map +1 -0
- package/dist/molecules/commit.js +95 -0
- package/dist/molecules/confirmation.d.ts +50 -0
- package/dist/molecules/confirmation.d.ts.map +1 -0
- package/dist/molecules/confirmation.js +61 -0
- package/dist/molecules/connection.d.ts +3 -0
- package/dist/molecules/connection.d.ts.map +1 -0
- package/dist/molecules/connection.js +3 -0
- package/dist/molecules/context.d.ts +33 -0
- package/dist/molecules/context.d.ts.map +1 -0
- package/dist/molecules/context.js +164 -0
- package/dist/molecules/controls.d.ts +5 -0
- package/dist/molecules/controls.d.ts.map +1 -0
- package/dist/molecules/controls.js +5 -0
- package/dist/molecules/conversation.d.ts +24 -0
- package/dist/molecules/conversation.d.ts.map +1 -0
- package/dist/molecules/conversation.js +41 -0
- package/dist/molecules/edge.d.ts +6 -0
- package/dist/molecules/edge.d.ts.map +1 -0
- package/dist/molecules/edge.js +87 -0
- package/dist/molecules/environment-variables.d.ts +39 -0
- package/dist/molecules/environment-variables.d.ts.map +1 -0
- package/dist/molecules/environment-variables.js +87 -0
- package/dist/molecules/file-tree.d.ts +27 -0
- package/dist/molecules/file-tree.d.ts.map +1 -0
- package/dist/molecules/file-tree.js +71 -0
- package/dist/molecules/image.d.ts +7 -0
- package/dist/molecules/image.d.ts.map +1 -0
- package/dist/molecules/image.js +3 -0
- package/dist/molecules/inline-citation.d.ts +39 -0
- package/dist/molecules/inline-citation.d.ts.map +1 -0
- package/dist/molecules/inline-citation.js +68 -0
- package/dist/molecules/jsx-preview.d.ts +30 -0
- package/dist/molecules/jsx-preview.d.ts.map +1 -0
- package/dist/molecules/jsx-preview.js +167 -0
- package/dist/molecules/loader.d.ts +6 -0
- package/dist/molecules/loader.d.ts.map +1 -0
- package/dist/molecules/loader.js +4 -0
- package/dist/molecules/message.d.ts +38 -0
- package/dist/molecules/message.d.ts.map +1 -0
- package/dist/molecules/message.js +92 -0
- package/dist/molecules/mic-selector.d.ts +46 -0
- package/dist/molecules/mic-selector.d.ts.map +1 -0
- package/dist/molecules/mic-selector.js +184 -0
- package/dist/molecules/model-selector.d.ts +36 -0
- package/dist/molecules/model-selector.d.ts.map +1 -0
- package/dist/molecules/model-selector.js +18 -0
- package/dist/molecules/node.d.ts +22 -0
- package/dist/molecules/node.d.ts.map +1 -0
- package/dist/molecules/node.js +11 -0
- package/dist/molecules/open-in-chat.d.ts +29 -0
- package/dist/molecules/open-in-chat.d.ts.map +1 -0
- package/dist/molecules/open-in-chat.js +100 -0
- package/dist/molecules/package-info.d.ts +30 -0
- package/dist/molecules/package-info.d.ts.map +1 -0
- package/dist/molecules/package-info.js +50 -0
- package/dist/molecules/panel.d.ts +6 -0
- package/dist/molecules/panel.d.ts.map +1 -0
- package/dist/molecules/panel.js +4 -0
- package/dist/molecules/persona.d.ts +49 -0
- package/dist/molecules/persona.d.ts.map +1 -0
- package/dist/molecules/persona.js +189 -0
- package/dist/molecules/plan.d.ts +26 -0
- package/dist/molecules/plan.d.ts.map +1 -0
- package/dist/molecules/plan.js +34 -0
- package/dist/molecules/prompt-input.d.ts +149 -0
- package/dist/molecules/prompt-input.d.ts.map +1 -0
- package/dist/molecules/prompt-input.js +702 -0
- package/dist/molecules/queue.d.ts +62 -0
- package/dist/molecules/queue.d.ts.map +1 -0
- package/dist/molecules/queue.js +28 -0
- package/dist/molecules/reasoning.d.ts +27 -0
- package/dist/molecules/reasoning.d.ts.map +1 -0
- package/dist/molecules/reasoning.js +95 -0
- package/dist/molecules/response.d.ts +6 -0
- package/dist/molecules/response.d.ts.map +1 -0
- package/dist/molecules/response.js +18 -0
- package/dist/molecules/responsive-alert-dialog.d.ts +16 -0
- package/dist/molecules/responsive-alert-dialog.d.ts.map +1 -0
- package/dist/molecules/responsive-alert-dialog.js +20 -0
- package/dist/molecules/responsive-dialog.d.ts +11 -0
- package/dist/molecules/responsive-dialog.d.ts.map +1 -0
- package/dist/molecules/responsive-dialog.js +21 -0
- package/dist/molecules/sandbox.d.ts +25 -0
- package/dist/molecules/sandbox.d.ts.map +1 -0
- package/dist/molecules/sandbox.js +15 -0
- package/dist/molecules/schema-display.d.ts +56 -0
- package/dist/molecules/schema-display.d.ts.map +1 -0
- package/dist/molecules/schema-display.js +73 -0
- package/dist/molecules/shimmer.d.ts +10 -0
- package/dist/molecules/shimmer.d.ts.map +1 -0
- package/dist/molecules/shimmer.js +28 -0
- package/dist/molecules/snippet.d.ts +19 -0
- package/dist/molecules/snippet.d.ts.map +1 -0
- package/dist/molecules/snippet.js +46 -0
- package/dist/molecules/sources.d.ts +13 -0
- package/dist/molecules/sources.d.ts.map +1 -0
- package/dist/molecules/sources.js +9 -0
- package/dist/molecules/speech-input.d.ts +55 -0
- package/dist/molecules/speech-input.d.ts.map +1 -0
- package/dist/molecules/speech-input.js +187 -0
- package/dist/molecules/stack-trace.d.ts +38 -0
- package/dist/molecules/stack-trace.d.ts.map +1 -0
- package/dist/molecules/stack-trace.js +194 -0
- package/dist/molecules/suggestion.d.ts +11 -0
- package/dist/molecules/suggestion.d.ts.map +1 -0
- package/dist/molecules/suggestion.js +13 -0
- package/dist/molecules/task.d.ts +15 -0
- package/dist/molecules/task.d.ts.map +1 -0
- package/dist/molecules/task.js +10 -0
- package/dist/molecules/terminal.d.ts +28 -0
- package/dist/molecules/terminal.d.ts.map +1 -0
- package/dist/molecules/terminal.js +68 -0
- package/dist/molecules/test-results.d.ts +59 -0
- package/dist/molecules/test-results.d.ts.map +1 -0
- package/dist/molecules/test-results.js +97 -0
- package/dist/molecules/tool.d.ts +32 -0
- package/dist/molecules/tool.d.ts.map +1 -0
- package/dist/molecules/tool.js +49 -0
- package/dist/molecules/toolbar.d.ts +6 -0
- package/dist/molecules/toolbar.d.ts.map +1 -0
- package/dist/molecules/toolbar.js +4 -0
- package/dist/molecules/transcription.d.ts +17 -0
- package/dist/molecules/transcription.d.ts.map +1 -0
- package/dist/molecules/transcription.js +36 -0
- package/dist/molecules/voice-selector.d.ts +64 -0
- package/dist/molecules/voice-selector.d.ts.map +1 -0
- package/dist/molecules/voice-selector.js +224 -0
- package/dist/molecules/web-preview.d.ts +35 -0
- package/dist/molecules/web-preview.d.ts.map +1 -0
- package/dist/molecules/web-preview.js +65 -0
- package/package.json +27 -8
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
2
|
+
import { ButtonGroup } from "@chatsdk-dev/ui/components/button-group";
|
|
3
|
+
import type { UIMessage } from "ai";
|
|
4
|
+
import type { ComponentProps, HTMLAttributes } from "react";
|
|
5
|
+
import { Streamdown } from "streamdown";
|
|
6
|
+
export type MessageProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
from: UIMessage["role"];
|
|
8
|
+
};
|
|
9
|
+
export declare const Message: ({ className, from, ...props }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export type MessageContentProps = HTMLAttributes<HTMLDivElement>;
|
|
11
|
+
export declare const MessageContent: ({ children, className, ...props }: MessageContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export type MessageActionsProps = ComponentProps<"div">;
|
|
13
|
+
export declare const MessageActions: ({ className, children, ...props }: MessageActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export type MessageActionProps = ComponentProps<typeof Button> & {
|
|
15
|
+
tooltip?: string;
|
|
16
|
+
label?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const MessageAction: ({ tooltip, children, label, variant, size, ...props }: MessageActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export type MessageBranchProps = HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
defaultBranch?: number;
|
|
21
|
+
onBranchChange?: (branchIndex: number) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare const MessageBranch: ({ defaultBranch, onBranchChange, className, ...props }: MessageBranchProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export type MessageBranchContentProps = HTMLAttributes<HTMLDivElement>;
|
|
25
|
+
export declare const MessageBranchContent: ({ children, ...props }: MessageBranchContentProps) => import("react/jsx-runtime").JSX.Element[];
|
|
26
|
+
export type MessageBranchSelectorProps = ComponentProps<typeof ButtonGroup>;
|
|
27
|
+
export declare const MessageBranchSelector: ({ className, ...props }: MessageBranchSelectorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
+
export type MessageBranchPreviousProps = ComponentProps<typeof Button>;
|
|
29
|
+
export declare const MessageBranchPrevious: ({ children, ...props }: MessageBranchPreviousProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export type MessageBranchNextProps = ComponentProps<typeof Button>;
|
|
31
|
+
export declare const MessageBranchNext: ({ children, ...props }: MessageBranchNextProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export type MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;
|
|
33
|
+
export declare const MessageBranchPage: ({ className, ...props }: MessageBranchPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export type MessageResponseProps = ComponentProps<typeof Streamdown>;
|
|
35
|
+
export declare const MessageResponse: import("react").MemoExoticComponent<({ className, ...props }: MessageResponseProps) => import("react/jsx-runtime").JSX.Element>;
|
|
36
|
+
export type MessageToolbarProps = ComponentProps<"div">;
|
|
37
|
+
export declare const MessageToolbar: ({ className, children, ...props }: MessageToolbarProps) => import("react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K,IAAI,CAAC;CAChD,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,wDAK3B,kBAAkB,4CA4CpB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEvE,eAAO,MAAM,oBAAoB,GAAI,wBAGlC,yBAAyB,8CA0B3B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;AAE5E,eAAO,MAAM,qBAAqB,GAAI,yBAGnC,0BAA0B,mDAkB5B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAEvE,eAAO,MAAM,qBAAqB,GAAI,wBAGnC,0BAA0B,4CAgB5B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAEnE,eAAO,MAAM,iBAAiB,GAAI,wBAG/B,sBAAsB,4CAgBxB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAErE,eAAO,MAAM,iBAAiB,GAAI,yBAG/B,sBAAsB,4CAcxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAIrE,eAAO,MAAM,eAAe,gEACA,oBAAoB,6CAa/C,CAAC;AAIF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAUrB,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
4
|
+
import { ButtonGroup, ButtonGroupText, } from "@chatsdk-dev/ui/components/button-group";
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@chatsdk-dev/ui/components/tooltip";
|
|
6
|
+
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
7
|
+
import { cjk } from "@streamdown/cjk";
|
|
8
|
+
import { code } from "@streamdown/code";
|
|
9
|
+
import { math } from "@streamdown/math";
|
|
10
|
+
import { mermaid } from "@streamdown/mermaid";
|
|
11
|
+
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
|
|
12
|
+
import { createContext, memo, useCallback, useContext, useEffect, useMemo, useState, } from "react";
|
|
13
|
+
import { Streamdown } from "streamdown";
|
|
14
|
+
export const Message = ({ className, from, ...props }) => (_jsx("div", { className: cn("group flex w-full max-w-[95%] flex-col gap-2", from === "user" ? "is-user ml-auto justify-end" : "is-assistant", className), ...props }));
|
|
15
|
+
export const MessageContent = ({ children, className, ...props }) => (_jsx("div", { className: cn("is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm", "group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground", "group-[.is-assistant]:text-foreground", className), ...props, children: children }));
|
|
16
|
+
export const MessageActions = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-1", className), ...props, children: children }));
|
|
17
|
+
export const MessageAction = ({ tooltip, children, label, variant = "ghost", size = "icon", ...props }) => {
|
|
18
|
+
const button = (_jsxs(Button, { size: size, type: "button", variant: variant, ...props, children: [children, _jsx("span", { className: "sr-only", children: label || tooltip })] }));
|
|
19
|
+
if (tooltip) {
|
|
20
|
+
return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: () => button }), _jsx(TooltipContent, { children: _jsx("p", { children: tooltip }) })] }) }));
|
|
21
|
+
}
|
|
22
|
+
return button;
|
|
23
|
+
};
|
|
24
|
+
const MessageBranchContext = createContext(null);
|
|
25
|
+
const useMessageBranch = () => {
|
|
26
|
+
const context = useContext(MessageBranchContext);
|
|
27
|
+
if (!context) {
|
|
28
|
+
throw new Error("MessageBranch components must be used within MessageBranch");
|
|
29
|
+
}
|
|
30
|
+
return context;
|
|
31
|
+
};
|
|
32
|
+
export const MessageBranch = ({ defaultBranch = 0, onBranchChange, className, ...props }) => {
|
|
33
|
+
const [currentBranch, setCurrentBranch] = useState(defaultBranch);
|
|
34
|
+
const [branches, setBranches] = useState([]);
|
|
35
|
+
const handleBranchChange = useCallback((newBranch) => {
|
|
36
|
+
setCurrentBranch(newBranch);
|
|
37
|
+
onBranchChange?.(newBranch);
|
|
38
|
+
}, [onBranchChange]);
|
|
39
|
+
const goToPrevious = useCallback(() => {
|
|
40
|
+
const newBranch = currentBranch > 0 ? currentBranch - 1 : branches.length - 1;
|
|
41
|
+
handleBranchChange(newBranch);
|
|
42
|
+
}, [currentBranch, branches.length, handleBranchChange]);
|
|
43
|
+
const goToNext = useCallback(() => {
|
|
44
|
+
const newBranch = currentBranch < branches.length - 1 ? currentBranch + 1 : 0;
|
|
45
|
+
handleBranchChange(newBranch);
|
|
46
|
+
}, [currentBranch, branches.length, handleBranchChange]);
|
|
47
|
+
const contextValue = useMemo(() => ({
|
|
48
|
+
branches,
|
|
49
|
+
currentBranch,
|
|
50
|
+
goToNext,
|
|
51
|
+
goToPrevious,
|
|
52
|
+
setBranches,
|
|
53
|
+
totalBranches: branches.length,
|
|
54
|
+
}), [branches, currentBranch, goToNext, goToPrevious]);
|
|
55
|
+
return (_jsx(MessageBranchContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("grid w-full gap-2 [&>div]:pb-0", className), ...props }) }));
|
|
56
|
+
};
|
|
57
|
+
export const MessageBranchContent = ({ children, ...props }) => {
|
|
58
|
+
const { currentBranch, setBranches, branches } = useMessageBranch();
|
|
59
|
+
const childrenArray = useMemo(() => (Array.isArray(children) ? children : [children]), [children]);
|
|
60
|
+
// Use useEffect to update branches when they change
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (branches.length !== childrenArray.length) {
|
|
63
|
+
setBranches(childrenArray);
|
|
64
|
+
}
|
|
65
|
+
}, [childrenArray, branches, setBranches]);
|
|
66
|
+
return childrenArray.map((branch, index) => (_jsx("div", { className: cn("grid gap-2 overflow-hidden [&>div]:pb-0", index === currentBranch ? "block" : "hidden"), ...props, children: branch }, branch.key)));
|
|
67
|
+
};
|
|
68
|
+
export const MessageBranchSelector = ({ className, ...props }) => {
|
|
69
|
+
const { totalBranches } = useMessageBranch();
|
|
70
|
+
// Don't render if there's only one branch
|
|
71
|
+
if (totalBranches <= 1) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return (_jsx(ButtonGroup, { className: cn("[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md", className), orientation: "horizontal", ...props }));
|
|
75
|
+
};
|
|
76
|
+
export const MessageBranchPrevious = ({ children, ...props }) => {
|
|
77
|
+
const { goToPrevious, totalBranches } = useMessageBranch();
|
|
78
|
+
return (_jsx(Button, { "aria-label": "Previous branch", disabled: totalBranches <= 1, onClick: goToPrevious, size: "icon", type: "button", variant: "ghost", ...props, children: children ?? _jsx(ChevronLeftIcon, { size: 14 }) }));
|
|
79
|
+
};
|
|
80
|
+
export const MessageBranchNext = ({ children, ...props }) => {
|
|
81
|
+
const { goToNext, totalBranches } = useMessageBranch();
|
|
82
|
+
return (_jsx(Button, { "aria-label": "Next branch", disabled: totalBranches <= 1, onClick: goToNext, size: "icon", type: "button", variant: "ghost", ...props, children: children ?? _jsx(ChevronRightIcon, { size: 14 }) }));
|
|
83
|
+
};
|
|
84
|
+
export const MessageBranchPage = ({ className, ...props }) => {
|
|
85
|
+
const { currentBranch, totalBranches } = useMessageBranch();
|
|
86
|
+
return (_jsxs(ButtonGroupText, { className: cn("border-none bg-transparent text-muted-foreground shadow-none", className), ...props, children: [currentBranch + 1, " of ", totalBranches] }));
|
|
87
|
+
};
|
|
88
|
+
const streamdownPlugins = { cjk, code, math, mermaid };
|
|
89
|
+
export const MessageResponse = memo(({ className, ...props }) => (_jsx(Streamdown, { className: cn("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className), plugins: streamdownPlugins, ...props })), (prevProps, nextProps) => prevProps.children === nextProps.children &&
|
|
90
|
+
nextProps.isAnimating === prevProps.isAnimating);
|
|
91
|
+
MessageResponse.displayName = "MessageResponse";
|
|
92
|
+
export const MessageToolbar = ({ className, children, ...props }) => (_jsx("div", { className: cn("mt-4 flex w-full items-center justify-between gap-4", className), ...props, children: children }));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
2
|
+
import { Command, CommandEmpty, CommandInput, CommandItem, CommandList } from "@chatsdk-dev/ui/components/command";
|
|
3
|
+
import { Popover, PopoverContent } from "@chatsdk-dev/ui/components/popover";
|
|
4
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
5
|
+
export declare const useAudioDevices: () => {
|
|
6
|
+
devices: MediaDeviceInfo[];
|
|
7
|
+
error: string | null;
|
|
8
|
+
hasPermission: boolean;
|
|
9
|
+
loadDevices: () => Promise<void>;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type MicSelectorProps = ComponentProps<typeof Popover> & {
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
value?: string | undefined;
|
|
15
|
+
onValueChange?: (value: string | undefined) => void;
|
|
16
|
+
open?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const MicSelector: ({ defaultValue, value: controlledValue, onValueChange: controlledOnValueChange, defaultOpen, open: controlledOpen, onOpenChange: controlledOnOpenChange, ...props }: MicSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export type MicSelectorTriggerProps = ComponentProps<typeof Button>;
|
|
21
|
+
export declare const MicSelectorTrigger: ({ children, ...props }: MicSelectorTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export type MicSelectorContentProps = ComponentProps<typeof Command> & {
|
|
23
|
+
popoverOptions?: ComponentProps<typeof PopoverContent>;
|
|
24
|
+
};
|
|
25
|
+
export declare const MicSelectorContent: ({ className, popoverOptions, ...props }: MicSelectorContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export type MicSelectorInputProps = ComponentProps<typeof CommandInput> & {
|
|
27
|
+
value?: string;
|
|
28
|
+
defaultValue?: string;
|
|
29
|
+
onValueChange?: (value: string) => void;
|
|
30
|
+
};
|
|
31
|
+
export declare const MicSelectorInput: ({ ...props }: MicSelectorInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export type MicSelectorListProps = Omit<ComponentProps<typeof CommandList>, "children"> & {
|
|
33
|
+
children: (devices: MediaDeviceInfo[]) => ReactNode;
|
|
34
|
+
};
|
|
35
|
+
export declare const MicSelectorList: ({ children, ...props }: MicSelectorListProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export type MicSelectorEmptyProps = ComponentProps<typeof CommandEmpty>;
|
|
37
|
+
export declare const MicSelectorEmpty: ({ children, ...props }: MicSelectorEmptyProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export type MicSelectorItemProps = ComponentProps<typeof CommandItem>;
|
|
39
|
+
export declare const MicSelectorItem: (props: MicSelectorItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export type MicSelectorLabelProps = ComponentProps<"span"> & {
|
|
41
|
+
device: MediaDeviceInfo;
|
|
42
|
+
};
|
|
43
|
+
export declare const MicSelectorLabel: ({ device, className, ...props }: MicSelectorLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export type MicSelectorValueProps = ComponentProps<"span">;
|
|
45
|
+
export declare const MicSelectorValue: ({ className, ...props }: MicSelectorValueProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
//# sourceMappingURL=mic-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mic-selector.d.ts","s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AY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,cAAc,qBAAqB,4CAEnE,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,cAAc,CAAC,OAAO,WAAW,CAAC,EAClC,UAAU,CACX,GAAG;IACF,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,CAAC;CACrD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,wBAG7B,oBAAoB,4CAItB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAC;AAExE,eAAO,MAAM,gBAAgB,GAAI,wBAG9B,qBAAqB,4CAAuD,CAAC;AAEhF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtE,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,4CAY1D,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAC3D,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,iCAI9B,qBAAqB,4CAoBvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAE3D,eAAO,MAAM,gBAAgB,GAAI,yBAG9B,qBAAqB,4CAmBvB,CAAC"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
4
|
+
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
5
|
+
import { Command, CommandEmpty, CommandInput, CommandItem, CommandList, } from "@chatsdk-dev/ui/components/command";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger, } from "@chatsdk-dev/ui/components/popover";
|
|
7
|
+
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
8
|
+
import { ChevronsUpDownIcon } from "lucide-react";
|
|
9
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
10
|
+
const deviceIdRegex = /\(([\da-fA-F]{4}:[\da-fA-F]{4})\)$/;
|
|
11
|
+
const MicSelectorContext = createContext({
|
|
12
|
+
data: [],
|
|
13
|
+
onOpenChange: undefined,
|
|
14
|
+
onValueChange: undefined,
|
|
15
|
+
open: false,
|
|
16
|
+
setWidth: undefined,
|
|
17
|
+
value: undefined,
|
|
18
|
+
width: 200,
|
|
19
|
+
});
|
|
20
|
+
export const useAudioDevices = () => {
|
|
21
|
+
const [devices, setDevices] = useState([]);
|
|
22
|
+
const [loading, setLoading] = useState(true);
|
|
23
|
+
const [error, setError] = useState(null);
|
|
24
|
+
const [hasPermission, setHasPermission] = useState(false);
|
|
25
|
+
const loadDevicesWithoutPermission = useCallback(async () => {
|
|
26
|
+
try {
|
|
27
|
+
setLoading(true);
|
|
28
|
+
setError(null);
|
|
29
|
+
const deviceList = await navigator.mediaDevices.enumerateDevices();
|
|
30
|
+
const audioInputs = deviceList.filter((device) => device.kind === "audioinput");
|
|
31
|
+
setDevices(audioInputs);
|
|
32
|
+
}
|
|
33
|
+
catch (caughtError) {
|
|
34
|
+
const message = caughtError instanceof Error
|
|
35
|
+
? caughtError.message
|
|
36
|
+
: "Failed to get audio devices";
|
|
37
|
+
setError(message);
|
|
38
|
+
console.error("Error getting audio devices:", message);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
setLoading(false);
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
const loadDevicesWithPermission = useCallback(async () => {
|
|
45
|
+
if (loading) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
setLoading(true);
|
|
50
|
+
setError(null);
|
|
51
|
+
const tempStream = await navigator.mediaDevices.getUserMedia({
|
|
52
|
+
audio: true,
|
|
53
|
+
});
|
|
54
|
+
for (const track of tempStream.getTracks()) {
|
|
55
|
+
track.stop();
|
|
56
|
+
}
|
|
57
|
+
const deviceList = await navigator.mediaDevices.enumerateDevices();
|
|
58
|
+
const audioInputs = deviceList.filter((device) => device.kind === "audioinput");
|
|
59
|
+
setDevices(audioInputs);
|
|
60
|
+
setHasPermission(true);
|
|
61
|
+
}
|
|
62
|
+
catch (caughtError) {
|
|
63
|
+
const message = caughtError instanceof Error
|
|
64
|
+
? caughtError.message
|
|
65
|
+
: "Failed to get audio devices";
|
|
66
|
+
setError(message);
|
|
67
|
+
console.error("Error getting audio devices:", message);
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
setLoading(false);
|
|
71
|
+
}
|
|
72
|
+
}, [loading]);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
loadDevicesWithoutPermission();
|
|
75
|
+
}, [loadDevicesWithoutPermission]);
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
const handleDeviceChange = () => {
|
|
78
|
+
if (hasPermission) {
|
|
79
|
+
loadDevicesWithPermission();
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
loadDevicesWithoutPermission();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
navigator.mediaDevices.addEventListener("devicechange", handleDeviceChange);
|
|
86
|
+
return () => {
|
|
87
|
+
navigator.mediaDevices.removeEventListener("devicechange", handleDeviceChange);
|
|
88
|
+
};
|
|
89
|
+
}, [hasPermission, loadDevicesWithPermission, loadDevicesWithoutPermission]);
|
|
90
|
+
return {
|
|
91
|
+
devices,
|
|
92
|
+
error,
|
|
93
|
+
hasPermission,
|
|
94
|
+
loadDevices: loadDevicesWithPermission,
|
|
95
|
+
loading,
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export const MicSelector = ({ defaultValue, value: controlledValue, onValueChange: controlledOnValueChange, defaultOpen = false, open: controlledOpen, onOpenChange: controlledOnOpenChange, ...props }) => {
|
|
99
|
+
const [value, onValueChange] = useControllableState({
|
|
100
|
+
defaultProp: defaultValue,
|
|
101
|
+
onChange: controlledOnValueChange,
|
|
102
|
+
prop: controlledValue,
|
|
103
|
+
});
|
|
104
|
+
const [open, onOpenChange] = useControllableState({
|
|
105
|
+
defaultProp: defaultOpen,
|
|
106
|
+
onChange: controlledOnOpenChange,
|
|
107
|
+
prop: controlledOpen,
|
|
108
|
+
});
|
|
109
|
+
const [width, setWidth] = useState(200);
|
|
110
|
+
const { devices, loading, hasPermission, loadDevices } = useAudioDevices();
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (open && !hasPermission && !loading) {
|
|
113
|
+
loadDevices();
|
|
114
|
+
}
|
|
115
|
+
}, [open, hasPermission, loading, loadDevices]);
|
|
116
|
+
const contextValue = useMemo(() => ({
|
|
117
|
+
data: devices,
|
|
118
|
+
onOpenChange,
|
|
119
|
+
onValueChange,
|
|
120
|
+
open,
|
|
121
|
+
setWidth,
|
|
122
|
+
value,
|
|
123
|
+
width,
|
|
124
|
+
}), [devices, onOpenChange, onValueChange, open, setWidth, value, width]);
|
|
125
|
+
return (_jsx(MicSelectorContext.Provider, { value: contextValue, children: _jsx(Popover, { ...props, onOpenChange: onOpenChange, open: open }) }));
|
|
126
|
+
};
|
|
127
|
+
export const MicSelectorTrigger = ({ children, ...props }) => {
|
|
128
|
+
const { setWidth } = useContext(MicSelectorContext);
|
|
129
|
+
const ref = useRef(null);
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
// Create a ResizeObserver to detect width changes
|
|
132
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
133
|
+
for (const entry of entries) {
|
|
134
|
+
const newWidth = entry.target.offsetWidth;
|
|
135
|
+
if (newWidth) {
|
|
136
|
+
setWidth?.(newWidth);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
if (ref.current) {
|
|
141
|
+
resizeObserver.observe(ref.current);
|
|
142
|
+
}
|
|
143
|
+
// Clean up the observer when component unmounts
|
|
144
|
+
return () => {
|
|
145
|
+
resizeObserver.disconnect();
|
|
146
|
+
};
|
|
147
|
+
}, [setWidth]);
|
|
148
|
+
return (_jsx(PopoverTrigger, { render: () => (_jsxs(Button, { variant: "outline", ...props, ref: ref, children: [children, _jsx(ChevronsUpDownIcon, { className: "shrink-0 text-muted-foreground", size: 16 })] })) }));
|
|
149
|
+
};
|
|
150
|
+
export const MicSelectorContent = ({ className, popoverOptions, ...props }) => {
|
|
151
|
+
const { width, onValueChange, value } = useContext(MicSelectorContext);
|
|
152
|
+
return (_jsx(PopoverContent, { className: cn("p-0", className), style: { width }, ...popoverOptions, children: _jsx(Command, { onValueChange: onValueChange, value: value, ...props }) }));
|
|
153
|
+
};
|
|
154
|
+
export const MicSelectorInput = ({ ...props }) => (_jsx(CommandInput, { placeholder: "Search microphones...", ...props }));
|
|
155
|
+
export const MicSelectorList = ({ children, ...props }) => {
|
|
156
|
+
const { data } = useContext(MicSelectorContext);
|
|
157
|
+
return _jsx(CommandList, { ...props, children: children(data) });
|
|
158
|
+
};
|
|
159
|
+
export const MicSelectorEmpty = ({ children = "No microphone found.", ...props }) => _jsx(CommandEmpty, { ...props, children: children });
|
|
160
|
+
export const MicSelectorItem = (props) => {
|
|
161
|
+
const { onValueChange, onOpenChange } = useContext(MicSelectorContext);
|
|
162
|
+
const handleSelect = useCallback((currentValue) => {
|
|
163
|
+
onValueChange?.(currentValue);
|
|
164
|
+
onOpenChange?.(false);
|
|
165
|
+
}, [onValueChange, onOpenChange]);
|
|
166
|
+
return _jsx(CommandItem, { onSelect: handleSelect, ...props });
|
|
167
|
+
};
|
|
168
|
+
export const MicSelectorLabel = ({ device, className, ...props }) => {
|
|
169
|
+
const matches = device.label.match(deviceIdRegex);
|
|
170
|
+
if (!matches) {
|
|
171
|
+
return (_jsx("span", { className: className, ...props, children: device.label }));
|
|
172
|
+
}
|
|
173
|
+
const [, deviceId] = matches;
|
|
174
|
+
const name = device.label.replace(deviceIdRegex, "");
|
|
175
|
+
return (_jsxs("span", { className: className, ...props, children: [_jsx("span", { children: name }), _jsxs("span", { className: "text-muted-foreground", children: [" (", deviceId, ")"] })] }));
|
|
176
|
+
};
|
|
177
|
+
export const MicSelectorValue = ({ className, ...props }) => {
|
|
178
|
+
const { data, value } = useContext(MicSelectorContext);
|
|
179
|
+
const currentDevice = data.find((d) => d.deviceId === value);
|
|
180
|
+
if (!currentDevice) {
|
|
181
|
+
return (_jsx("span", { className: cn("flex-1 text-left", className), ...props, children: "Select microphone..." }));
|
|
182
|
+
}
|
|
183
|
+
return (_jsx(MicSelectorLabel, { className: cn("flex-1 text-left", className), device: currentDevice, ...props }));
|
|
184
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from "@chatsdk-dev/ui/components/command";
|
|
2
|
+
import { Dialog, DialogContent, DialogTrigger } from "@chatsdk-dev/ui/components/dialog";
|
|
3
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
4
|
+
export type ModelSelectorProps = ComponentProps<typeof Dialog>;
|
|
5
|
+
export declare const ModelSelector: (props: ModelSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export type ModelSelectorTriggerProps = ComponentProps<typeof DialogTrigger>;
|
|
7
|
+
export declare const ModelSelectorTrigger: (props: ModelSelectorTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export type ModelSelectorContentProps = ComponentProps<typeof DialogContent> & {
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare const ModelSelectorContent: ({ className, children, title, ...props }: ModelSelectorContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export type ModelSelectorDialogProps = ComponentProps<typeof CommandDialog>;
|
|
13
|
+
export declare const ModelSelectorDialog: (props: ModelSelectorDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export type ModelSelectorInputProps = ComponentProps<typeof CommandInput>;
|
|
15
|
+
export declare const ModelSelectorInput: ({ className, ...props }: ModelSelectorInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export type ModelSelectorListProps = ComponentProps<typeof CommandList>;
|
|
17
|
+
export declare const ModelSelectorList: (props: ModelSelectorListProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export type ModelSelectorEmptyProps = ComponentProps<typeof CommandEmpty>;
|
|
19
|
+
export declare const ModelSelectorEmpty: (props: ModelSelectorEmptyProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export type ModelSelectorGroupProps = ComponentProps<typeof CommandGroup>;
|
|
21
|
+
export declare const ModelSelectorGroup: (props: ModelSelectorGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export type ModelSelectorItemProps = ComponentProps<typeof CommandItem>;
|
|
23
|
+
export declare const ModelSelectorItem: (props: ModelSelectorItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export type ModelSelectorShortcutProps = ComponentProps<typeof CommandShortcut>;
|
|
25
|
+
export declare const ModelSelectorShortcut: (props: ModelSelectorShortcutProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export type ModelSelectorSeparatorProps = ComponentProps<typeof CommandSeparator>;
|
|
27
|
+
export declare const ModelSelectorSeparator: (props: ModelSelectorSeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export type ModelSelectorLogoProps = Omit<ComponentProps<"img">, "src" | "alt"> & {
|
|
29
|
+
provider: "moonshotai-cn" | "lucidquery" | "moonshotai" | "zai-coding-plan" | "alibaba" | "xai" | "vultr" | "nvidia" | "upstage" | "groq" | "github-copilot" | "mistral" | "vercel" | "nebius" | "deepseek" | "alibaba-cn" | "google-vertex-anthropic" | "venice" | "chutes" | "cortecs" | "github-models" | "togetherai" | "azure" | "baseten" | "huggingface" | "opencode" | "fastrouter" | "google" | "google-vertex" | "cloudflare-workers-ai" | "inception" | "wandb" | "openai" | "zhipuai-coding-plan" | "perplexity" | "openrouter" | "zenmux" | "v0" | "iflowcn" | "synthetic" | "deepinfra" | "zhipuai" | "submodel" | "zai" | "inference" | "requesty" | "morph" | "lmstudio" | "anthropic" | "aihubmix" | "fireworks-ai" | "modelscope" | "llama" | "scaleway" | "amazon-bedrock" | "cerebras" | (string & {});
|
|
30
|
+
};
|
|
31
|
+
export declare const ModelSelectorLogo: ({ provider, className, ...props }: ModelSelectorLogoProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export type ModelSelectorLogoGroupProps = ComponentProps<"div">;
|
|
33
|
+
export declare const ModelSelectorLogoGroup: ({ className, ...props }: ModelSelectorLogoGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export type ModelSelectorNameProps = ComponentProps<"span">;
|
|
35
|
+
export declare const ModelSelectorName: ({ className, ...props }: ModelSelectorNameProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=model-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-selector.d.ts","sourceRoot":"","sources":["../../src/molecules/model-selector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,MAAM,EACN,aAAa,EAEb,aAAa,EACd,MAAM,mCAAmC,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAE/D,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,4CAEtD,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC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 -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "@chatsdk-dev/ui/components/command";
|
|
3
|
+
import { Dialog, DialogContent, DialogTitle, DialogTrigger, } from "@chatsdk-dev/ui/components/dialog";
|
|
4
|
+
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
5
|
+
export const ModelSelector = (props) => (_jsx(Dialog, { ...props }));
|
|
6
|
+
export const ModelSelectorTrigger = (props) => (_jsx(DialogTrigger, { ...props }));
|
|
7
|
+
export const ModelSelectorContent = ({ className, children, title = "Model Selector", ...props }) => (_jsxs(DialogContent, { "aria-describedby": undefined, className: cn("outline! border-none! p-0 outline-border! outline-solid!", className), ...props, children: [_jsx(DialogTitle, { className: "sr-only", children: title }), _jsx(Command, { className: "**:data-[slot=command-input-wrapper]:h-auto", children: children })] }));
|
|
8
|
+
export const ModelSelectorDialog = (props) => (_jsx(CommandDialog, { ...props }));
|
|
9
|
+
export const ModelSelectorInput = ({ className, ...props }) => (_jsx(CommandInput, { className: cn("h-auto py-3.5", className), ...props }));
|
|
10
|
+
export const ModelSelectorList = (props) => (_jsx(CommandList, { ...props }));
|
|
11
|
+
export const ModelSelectorEmpty = (props) => (_jsx(CommandEmpty, { ...props }));
|
|
12
|
+
export const ModelSelectorGroup = (props) => (_jsx(CommandGroup, { ...props }));
|
|
13
|
+
export const ModelSelectorItem = (props) => (_jsx(CommandItem, { ...props }));
|
|
14
|
+
export const ModelSelectorShortcut = (props) => (_jsx(CommandShortcut, { ...props }));
|
|
15
|
+
export const ModelSelectorSeparator = (props) => (_jsx(CommandSeparator, { ...props }));
|
|
16
|
+
export const ModelSelectorLogo = ({ provider, className, ...props }) => (_jsx("img", { ...props, alt: `${provider} logo`, className: cn("size-3 dark:invert", className), height: 12, src: `https://models.dev/logos/${provider}.svg`, width: 12 }));
|
|
17
|
+
export const ModelSelectorLogoGroup = ({ className, ...props }) => (_jsx("div", { className: cn("flex shrink-0 items-center -space-x-1 [&>img]:rounded-full [&>img]:bg-background [&>img]:p-px [&>img]:ring-1 dark:[&>img]:bg-foreground", className), ...props }));
|
|
18
|
+
export const ModelSelectorName = ({ className, ...props }) => (_jsx("span", { className: cn("flex-1 truncate text-left", className), ...props }));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@chatsdk-dev/ui/components/card";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export type NodeProps = ComponentProps<typeof Card> & {
|
|
4
|
+
handles: {
|
|
5
|
+
target: boolean;
|
|
6
|
+
source: boolean;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const Node: ({ handles, className, ...props }: NodeProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export type NodeHeaderProps = ComponentProps<typeof CardHeader>;
|
|
11
|
+
export declare const NodeHeader: ({ className, ...props }: NodeHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export type NodeTitleProps = ComponentProps<typeof CardTitle>;
|
|
13
|
+
export declare const NodeTitle: (props: NodeTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export type NodeDescriptionProps = ComponentProps<typeof CardDescription>;
|
|
15
|
+
export declare const NodeDescription: (props: NodeDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export type NodeActionProps = ComponentProps<typeof CardAction>;
|
|
17
|
+
export declare const NodeAction: (props: NodeActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export type NodeContentProps = ComponentProps<typeof CardContent>;
|
|
19
|
+
export declare const NodeContent: ({ className, ...props }: NodeContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export type NodeFooterProps = ComponentProps<typeof CardFooter>;
|
|
21
|
+
export declare const NodeFooter: ({ className, ...props }: NodeFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/molecules/node.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,UAAU,EACV,WAAW,EACX,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACV,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,IAAI,CAAC,GAAG;IACpD,OAAO,EAAE;QACP,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,OAAO,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,kCAAkC,SAAS,4CAY/D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEhE,eAAO,MAAM,UAAU,GAAI,yBAAyB,eAAe,4CAKlE,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAE9D,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,4CAA6B,CAAC;AAE7E,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,CAAC;AAE1E,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,4CAE1D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEhE,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,4CAA8B,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;AAElE,eAAO,MAAM,WAAW,GAAI,yBAAyB,gBAAgB,4CAEpE,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC;AAEhE,eAAO,MAAM,UAAU,GAAI,yBAAyB,eAAe,4CAKlE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@chatsdk-dev/ui/components/card";
|
|
3
|
+
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
4
|
+
import { Handle, Position } from "@xyflow/react";
|
|
5
|
+
export const Node = ({ handles, className, ...props }) => (_jsxs(Card, { className: cn("node-container relative size-full h-auto w-sm gap-0 rounded-md p-0", className), ...props, children: [handles.target && _jsx(Handle, { position: Position.Left, type: "target" }), handles.source && _jsx(Handle, { position: Position.Right, type: "source" }), props.children] }));
|
|
6
|
+
export const NodeHeader = ({ className, ...props }) => (_jsx(CardHeader, { className: cn("gap-0.5 rounded-t-md border-b bg-secondary p-3!", className), ...props }));
|
|
7
|
+
export const NodeTitle = (props) => _jsx(CardTitle, { ...props });
|
|
8
|
+
export const NodeDescription = (props) => (_jsx(CardDescription, { ...props }));
|
|
9
|
+
export const NodeAction = (props) => _jsx(CardAction, { ...props });
|
|
10
|
+
export const NodeContent = ({ className, ...props }) => (_jsx(CardContent, { className: cn("p-3", className), ...props }));
|
|
11
|
+
export const NodeFooter = ({ className, ...props }) => (_jsx(CardFooter, { className: cn("rounded-b-md border-t bg-secondary p-3!", className), ...props }));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@chatsdk-dev/ui/components/dropdown-menu";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export type OpenInProps = ComponentProps<typeof DropdownMenu> & {
|
|
4
|
+
query: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const OpenIn: ({ query, ...props }: OpenInProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export type OpenInContentProps = ComponentProps<typeof DropdownMenuContent>;
|
|
8
|
+
export declare const OpenInContent: ({ className, ...props }: OpenInContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export type OpenInItemProps = ComponentProps<typeof DropdownMenuItem>;
|
|
10
|
+
export declare const OpenInItem: (props: OpenInItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export type OpenInLabelProps = ComponentProps<typeof DropdownMenuLabel>;
|
|
12
|
+
export declare const OpenInLabel: (props: OpenInLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export type OpenInSeparatorProps = ComponentProps<typeof DropdownMenuSeparator>;
|
|
14
|
+
export declare const OpenInSeparator: (props: OpenInSeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export type OpenInTriggerProps = ComponentProps<typeof DropdownMenuTrigger>;
|
|
16
|
+
export declare const OpenInTrigger: ({ children, ...props }: OpenInTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export type OpenInChatGPTProps = ComponentProps<typeof DropdownMenuItem>;
|
|
18
|
+
export declare const OpenInChatGPT: (props: OpenInChatGPTProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export type OpenInClaudeProps = ComponentProps<typeof DropdownMenuItem>;
|
|
20
|
+
export declare const OpenInClaude: (props: OpenInClaudeProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export type OpenInT3Props = ComponentProps<typeof DropdownMenuItem>;
|
|
22
|
+
export declare const OpenInT3: (props: OpenInT3Props) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export type OpenInSciraProps = ComponentProps<typeof DropdownMenuItem>;
|
|
24
|
+
export declare const OpenInScira: (props: OpenInSciraProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export type OpenInv0Props = ComponentProps<typeof DropdownMenuItem>;
|
|
26
|
+
export declare const OpenInv0: (props: OpenInv0Props) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export type OpenInCursorProps = ComponentProps<typeof DropdownMenuItem>;
|
|
28
|
+
export declare const OpenInCursor: (props: OpenInCursorProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=open-in-chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-in-chat.d.ts","sourceRoot":"","sources":["../../src/molecules/open-in-chat.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,0CAA0C,CAAC;AAOlD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAmL5C,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,GAAG;IAC9D,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,qBAAqB,WAAW,4CAQtD,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE5E,eAAO,MAAM,aAAa,GAAI,yBAAyB,kBAAkB,4CAMxE,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEtE,eAAO,MAAM,UAAU,GAAI,OAAO,eAAe,4CAEhD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAExE,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CAElD,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEhF,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,4CAE1D,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OA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