@chatsdk-dev/ui 0.1.2 → 0.2.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/dist/atoms/accordion.d.ts +4 -4
- package/dist/atoms/accordion.d.ts.map +1 -1
- package/dist/atoms/alert-dialog.d.ts +22 -14
- package/dist/atoms/alert-dialog.d.ts.map +1 -1
- package/dist/atoms/alert-dialog.js +13 -8
- package/dist/atoms/alert.d.ts +4 -4
- package/dist/atoms/alert.d.ts.map +1 -1
- package/dist/atoms/attachment.d.ts +24 -0
- package/dist/atoms/attachment.d.ts.map +1 -0
- package/dist/atoms/attachment.js +76 -0
- package/dist/atoms/avatar.d.ts +6 -6
- package/dist/atoms/avatar.d.ts.map +1 -1
- package/dist/atoms/badge.d.ts +1 -1
- package/dist/atoms/bubble.d.ts +17 -0
- package/dist/atoms/bubble.d.ts.map +1 -0
- package/dist/atoms/bubble.js +59 -0
- package/dist/atoms/button-group.d.ts +2 -2
- package/dist/atoms/button-group.d.ts.map +1 -1
- package/dist/atoms/button-loader.d.ts +2 -2
- package/dist/atoms/button-loader.d.ts.map +1 -1
- package/dist/atoms/button.d.ts +2 -2
- package/dist/atoms/button.d.ts.map +1 -1
- package/dist/atoms/button.js +2 -1
- package/dist/atoms/card.d.ts +7 -7
- package/dist/atoms/card.d.ts.map +1 -1
- package/dist/atoms/carousel.d.ts +5 -5
- package/dist/atoms/carousel.d.ts.map +1 -1
- package/dist/atoms/carousel.js +1 -0
- package/dist/atoms/collapsible.d.ts +3 -3
- package/dist/atoms/collapsible.d.ts.map +1 -1
- package/dist/atoms/command.d.ts +9 -9
- package/dist/atoms/command.d.ts.map +1 -1
- package/dist/atoms/container.d.ts +1 -1
- package/dist/atoms/container.d.ts.map +1 -1
- package/dist/atoms/dialog.d.ts +10 -10
- package/dist/atoms/dialog.d.ts.map +1 -1
- package/dist/atoms/dialog.js +4 -2
- package/dist/atoms/dots-loader.d.ts +1 -1
- package/dist/atoms/dots-loader.d.ts.map +1 -1
- package/dist/atoms/drawer.d.ts +10 -10
- package/dist/atoms/drawer.d.ts.map +1 -1
- package/dist/atoms/drawer.js +6 -4
- package/dist/atoms/dropdown-menu.d.ts +15 -15
- package/dist/atoms/dropdown-menu.d.ts.map +1 -1
- package/dist/atoms/dropdown-menu.js +8 -5
- package/dist/atoms/empty.d.ts +6 -6
- package/dist/atoms/empty.d.ts.map +1 -1
- package/dist/atoms/field.d.ts +10 -10
- package/dist/atoms/field.d.ts.map +1 -1
- package/dist/atoms/form.d.ts +6 -6
- package/dist/atoms/form.d.ts.map +1 -1
- package/dist/atoms/form.js +4 -2
- package/dist/atoms/header.d.ts +1 -1
- package/dist/atoms/header.d.ts.map +1 -1
- package/dist/atoms/hover-card.d.ts +3 -3
- package/dist/atoms/hover-card.d.ts.map +1 -1
- package/dist/atoms/hover-card.js +3 -1
- package/dist/atoms/input-group.d.ts +7 -7
- package/dist/atoms/input-group.d.ts.map +1 -1
- package/dist/atoms/input.d.ts +1 -1
- package/dist/atoms/input.d.ts.map +1 -1
- package/dist/atoms/input.js +1 -1
- package/dist/atoms/label.d.ts +1 -1
- package/dist/atoms/label.d.ts.map +1 -1
- package/dist/atoms/logo.d.ts +1 -1
- package/dist/atoms/logo.d.ts.map +1 -1
- package/dist/atoms/marker.d.ts +11 -0
- package/dist/atoms/marker.d.ts.map +1 -0
- package/dist/atoms/marker.js +34 -0
- package/dist/atoms/message-scroller.d.ts +11 -0
- package/dist/atoms/message-scroller.d.ts.map +1 -0
- package/dist/atoms/message-scroller.js +25 -0
- package/dist/atoms/message.d.ts +11 -0
- package/dist/atoms/message.d.ts.map +1 -0
- package/dist/atoms/message.js +21 -0
- package/dist/atoms/number-flow.d.ts +1 -1
- package/dist/atoms/number-flow.d.ts.map +1 -1
- package/dist/atoms/popover.d.ts +6 -6
- package/dist/atoms/popover.d.ts.map +1 -1
- package/dist/atoms/popover.js +3 -1
- package/dist/atoms/progress.d.ts +5 -5
- package/dist/atoms/progress.d.ts.map +1 -1
- package/dist/atoms/radio-group.d.ts +2 -2
- package/dist/atoms/radio-group.d.ts.map +1 -1
- package/dist/atoms/scroll-area.d.ts +2 -2
- package/dist/atoms/scroll-area.d.ts.map +1 -1
- package/dist/atoms/select.d.ts +9 -9
- package/dist/atoms/select.d.ts.map +1 -1
- package/dist/atoms/select.js +5 -3
- package/dist/atoms/separator.d.ts +1 -1
- package/dist/atoms/separator.d.ts.map +1 -1
- package/dist/atoms/sheet.d.ts +8 -8
- package/dist/atoms/sheet.d.ts.map +1 -1
- package/dist/atoms/sheet.js +5 -3
- package/dist/atoms/sidebar.d.ts +19 -19
- package/dist/atoms/sidebar.d.ts.map +1 -1
- package/dist/atoms/sidebar.js +1 -1
- package/dist/atoms/skeleton.d.ts +1 -1
- package/dist/atoms/skeleton.d.ts.map +1 -1
- package/dist/atoms/spinner.d.ts +1 -1
- package/dist/atoms/spinner.d.ts.map +1 -1
- package/dist/atoms/switch.d.ts +1 -1
- package/dist/atoms/switch.d.ts.map +1 -1
- package/dist/atoms/table.d.ts +8 -8
- package/dist/atoms/table.d.ts.map +1 -1
- package/dist/atoms/table.js +1 -1
- package/dist/atoms/tabs.d.ts +8 -5
- package/dist/atoms/tabs.d.ts.map +1 -1
- package/dist/atoms/tabs.js +10 -6
- package/dist/atoms/textarea.d.ts +1 -1
- package/dist/atoms/textarea.d.ts.map +1 -1
- package/dist/atoms/toggle.d.ts +2 -2
- package/dist/atoms/toggle.d.ts.map +1 -1
- package/dist/atoms/toggle.js +1 -0
- package/dist/atoms/tooltip.d.ts +7 -5
- package/dist/atoms/tooltip.d.ts.map +1 -1
- package/dist/atoms/tooltip.js +6 -4
- package/dist/atoms/typography/h1.d.ts +1 -1
- package/dist/atoms/typography/h1.d.ts.map +1 -1
- package/dist/atoms/typography/paragraph.d.ts +1 -1
- package/dist/atoms/typography/paragraph.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +1 -0
- package/dist/hooks/use-controllable-state.js +1 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -1
- package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -1
- package/dist/hooks/use-copy-to-clipboard.js +9 -6
- package/dist/index.css +1693 -996
- package/dist/lib/portal-container.d.ts +12 -0
- package/dist/lib/portal-container.d.ts.map +1 -0
- package/dist/lib/portal-container.js +15 -0
- package/dist/lib/utils.d.ts +8 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +27 -0
- package/dist/molecules/ai/action.d.ts +7 -0
- package/dist/molecules/ai/action.d.ts.map +1 -0
- package/dist/molecules/ai/action.js +13 -0
- package/dist/molecules/ai/agent.d.ts +7 -7
- package/dist/molecules/ai/agent.d.ts.map +1 -1
- package/dist/molecules/ai/artifact.d.ts +8 -8
- package/dist/molecules/ai/artifact.d.ts.map +1 -1
- package/dist/molecules/ai/artifact.js +2 -2
- package/dist/molecules/ai/audio-player.d.ts +11 -11
- package/dist/molecules/ai/audio-player.d.ts.map +1 -1
- package/dist/molecules/ai/audio-player.js +1 -3
- package/dist/molecules/ai/canvas.d.ts +1 -2
- package/dist/molecules/ai/canvas.d.ts.map +1 -1
- package/dist/molecules/ai/canvas.js +0 -1
- package/dist/molecules/ai/chain-of-thought.d.ts +7 -7
- package/dist/molecules/ai/chain-of-thought.d.ts.map +1 -1
- package/dist/molecules/ai/checkpoint.d.ts +3 -3
- package/dist/molecules/ai/checkpoint.d.ts.map +1 -1
- package/dist/molecules/ai/code-block.d.ts +13 -13
- package/dist/molecules/ai/code-block.d.ts.map +1 -1
- package/dist/molecules/ai/commit.d.ts +22 -22
- package/dist/molecules/ai/commit.d.ts.map +1 -1
- package/dist/molecules/ai/confirmation.d.ts +4 -12
- package/dist/molecules/ai/confirmation.d.ts.map +1 -1
- package/dist/molecules/ai/context.d.ts +10 -10
- package/dist/molecules/ai/context.d.ts.map +1 -1
- package/dist/molecules/ai/controls.d.ts +1 -1
- package/dist/molecules/ai/controls.d.ts.map +1 -1
- package/dist/molecules/ai/edge.d.ts +2 -2
- package/dist/molecules/ai/environment-variables.d.ts +11 -11
- package/dist/molecules/ai/environment-variables.d.ts.map +1 -1
- package/dist/molecules/ai/file-tree.d.ts +6 -6
- package/dist/molecules/ai/file-tree.d.ts.map +1 -1
- package/dist/molecules/ai/image.d.ts +1 -1
- package/dist/molecules/ai/image.d.ts.map +1 -1
- package/dist/molecules/ai/inline-citation.d.ts +14 -14
- package/dist/molecules/ai/inline-citation.d.ts.map +1 -1
- package/dist/molecules/ai/jsx-preview.d.ts +3 -3
- package/dist/molecules/ai/jsx-preview.d.ts.map +1 -1
- package/dist/molecules/ai/loader.d.ts +1 -1
- package/dist/molecules/ai/loader.d.ts.map +1 -1
- package/dist/molecules/ai/mic-selector.d.ts +9 -9
- package/dist/molecules/ai/mic-selector.d.ts.map +1 -1
- package/dist/molecules/ai/model-selector.d.ts +14 -14
- package/dist/molecules/ai/model-selector.d.ts.map +1 -1
- package/dist/molecules/ai/node.d.ts +7 -7
- package/dist/molecules/ai/node.d.ts.map +1 -1
- package/dist/molecules/ai/open-in-chat.d.ts +12 -12
- package/dist/molecules/ai/open-in-chat.d.ts.map +1 -1
- package/dist/molecules/ai/package-info.d.ts +9 -9
- package/dist/molecules/ai/package-info.d.ts.map +1 -1
- package/dist/molecules/ai/panel.d.ts +1 -1
- package/dist/molecules/ai/panel.d.ts.map +1 -1
- package/dist/molecules/ai/persona.d.ts.map +1 -1
- package/dist/molecules/ai/plan.d.ts +8 -8
- package/dist/molecules/ai/plan.d.ts.map +1 -1
- package/dist/molecules/ai/plan.js +3 -4
- package/dist/molecules/ai/prompt-input.d.ts +35 -35
- package/dist/molecules/ai/prompt-input.d.ts.map +1 -1
- package/dist/molecules/ai/prompt-input.js +5 -15
- package/dist/molecules/ai/queue.d.ts +15 -15
- package/dist/molecules/ai/queue.d.ts.map +1 -1
- package/dist/molecules/ai/reasoning.d.ts +3 -3
- package/dist/molecules/ai/reasoning.d.ts.map +1 -1
- package/dist/molecules/ai/reasoning.js +7 -34
- package/dist/molecules/ai/response.d.ts +3 -4
- package/dist/molecules/ai/response.d.ts.map +1 -1
- package/dist/molecules/ai/response.js +10 -14
- package/dist/molecules/ai/sandbox.d.ts +8 -8
- package/dist/molecules/ai/sandbox.d.ts.map +1 -1
- package/dist/molecules/ai/sandbox.js +1 -1
- package/dist/molecules/ai/schema-display.d.ts +13 -13
- package/dist/molecules/ai/schema-display.d.ts.map +1 -1
- package/dist/molecules/ai/snippet.d.ts +5 -5
- package/dist/molecules/ai/snippet.d.ts.map +1 -1
- package/dist/molecules/ai/sources.d.ts +6 -5
- package/dist/molecules/ai/sources.d.ts.map +1 -1
- package/dist/molecules/ai/sources.js +2 -2
- package/dist/molecules/ai/speech-input.d.ts +1 -1
- package/dist/molecules/ai/speech-input.d.ts.map +1 -1
- package/dist/molecules/ai/stack-trace.d.ts +10 -10
- package/dist/molecules/ai/stack-trace.d.ts.map +1 -1
- package/dist/molecules/ai/stack-trace.js +1 -1
- package/dist/molecules/ai/suggestion.d.ts +2 -2
- package/dist/molecules/ai/suggestion.d.ts.map +1 -1
- package/dist/molecules/ai/task.d.ts +5 -5
- package/dist/molecules/ai/task.d.ts.map +1 -1
- package/dist/molecules/ai/terminal.d.ts +8 -8
- package/dist/molecules/ai/terminal.d.ts.map +1 -1
- package/dist/molecules/ai/test-results.d.ts +17 -17
- package/dist/molecules/ai/test-results.d.ts.map +1 -1
- package/dist/molecules/ai/tool.d.ts +21 -8
- package/dist/molecules/ai/tool.d.ts.map +1 -1
- package/dist/molecules/ai/tool.js +15 -11
- package/dist/molecules/ai/toolbar.d.ts +1 -1
- package/dist/molecules/ai/toolbar.d.ts.map +1 -1
- package/dist/molecules/ai/transcription.d.ts +2 -2
- package/dist/molecules/ai/transcription.d.ts.map +1 -1
- package/dist/molecules/ai/voice-selector.d.ts +19 -19
- package/dist/molecules/ai/voice-selector.d.ts.map +1 -1
- package/dist/molecules/ai/web-preview.d.ts +6 -6
- package/dist/molecules/ai/web-preview.d.ts.map +1 -1
- package/dist/molecules/ai/web-preview.js +2 -2
- package/package.json +27 -27
- package/dist/components/accordion.d.ts +0 -7
- package/dist/components/accordion.d.ts.map +0 -1
- package/dist/components/accordion.js +0 -18
- package/dist/components/alert-dialog.d.ts +0 -19
- package/dist/components/alert-dialog.d.ts.map +0 -1
- package/dist/components/alert-dialog.js +0 -42
- package/dist/components/alert.d.ts +0 -11
- package/dist/components/alert.d.ts.map +0 -1
- package/dist/components/alert.js +0 -27
- package/dist/components/avatar.d.ts +0 -12
- package/dist/components/avatar.d.ts.map +0 -1
- package/dist/components/avatar.js +0 -23
- package/dist/components/badge.d.ts +0 -8
- package/dist/components/badge.d.ts.map +0 -1
- package/dist/components/badge.js +0 -44
- package/dist/components/button-group.d.ts +0 -11
- package/dist/components/button-group.d.ts.map +0 -1
- package/dist/components/button-group.js +0 -36
- package/dist/components/button-loader.d.ts +0 -9
- package/dist/components/button-loader.d.ts.map +0 -1
- package/dist/components/button-loader.js +0 -10
- package/dist/components/button.d.ts +0 -9
- package/dist/components/button.d.ts.map +0 -1
- package/dist/components/button.js +0 -32
- package/dist/components/card.d.ts +0 -12
- package/dist/components/card.d.ts.map +0 -1
- package/dist/components/card.js +0 -25
- package/dist/components/carousel.d.ts +0 -29
- package/dist/components/carousel.d.ts.map +0 -1
- package/dist/components/carousel.js +0 -91
- package/dist/components/collapsible.d.ts +0 -6
- package/dist/components/collapsible.d.ts.map +0 -1
- package/dist/components/collapsible.js +0 -13
- package/dist/components/command.d.ts +0 -20
- package/dist/components/command.d.ts.map +0 -1
- package/dist/components/command.js +0 -35
- package/dist/components/container.d.ts +0 -8
- package/dist/components/container.d.ts.map +0 -1
- package/dist/components/container.js +0 -5
- package/dist/components/dialog.d.ts +0 -19
- package/dist/components/dialog.d.ts.map +0 -1
- package/dist/components/dialog.js +0 -38
- package/dist/components/dots-loader.d.ts +0 -15
- package/dist/components/dots-loader.d.ts.map +0 -1
- package/dist/components/dots-loader.js +0 -21
- package/dist/components/drawer.d.ts +0 -14
- package/dist/components/drawer.d.ts.map +0 -1
- package/dist/components/drawer.js +0 -35
- package/dist/components/dropdown-menu.d.ts +0 -26
- package/dist/components/dropdown-menu.d.ts.map +0 -1
- package/dist/components/dropdown-menu.js +0 -51
- package/dist/components/empty.d.ts +0 -12
- package/dist/components/empty.d.ts.map +0 -1
- package/dist/components/empty.js +0 -33
- package/dist/components/field.d.ts +0 -25
- package/dist/components/field.d.ts.map +0 -1
- package/dist/components/field.js +0 -68
- package/dist/components/form.d.ts +0 -23
- package/dist/components/form.d.ts.map +0 -1
- package/dist/components/form.js +0 -68
- package/dist/components/header.d.ts +0 -6
- package/dist/components/header.d.ts.map +0 -1
- package/dist/components/header.js +0 -6
- package/dist/components/hover-card.d.ts +0 -6
- package/dist/components/hover-card.d.ts.map +0 -1
- package/dist/components/hover-card.js +0 -14
- package/dist/components/index.d.ts +0 -5
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -5
- package/dist/components/input-group.d.ts +0 -19
- package/dist/components/input-group.d.ts.map +0 -1
- package/dist/components/input-group.js +0 -57
- package/dist/components/input.d.ts +0 -7
- package/dist/components/input.d.ts.map +0 -1
- package/dist/components/input.js +0 -6
- package/dist/components/label.d.ts +0 -3
- package/dist/components/label.d.ts.map +0 -1
- package/dist/components/label.js +0 -7
- package/dist/components/logo.d.ts +0 -7
- package/dist/components/logo.d.ts.map +0 -1
- package/dist/components/logo.js +0 -6
- package/dist/components/number-flow.d.ts +0 -3
- package/dist/components/number-flow.d.ts.map +0 -1
- package/dist/components/number-flow.js +0 -6
- package/dist/components/popover.d.ts +0 -10
- package/dist/components/popover.d.ts.map +0 -1
- package/dist/components/popover.js +0 -23
- package/dist/components/progress.d.ts +0 -8
- package/dist/components/progress.d.ts.map +0 -1
- package/dist/components/progress.js +0 -20
- package/dist/components/radio-group.d.ts +0 -6
- package/dist/components/radio-group.d.ts.map +0 -1
- package/dist/components/radio-group.js +0 -13
- package/dist/components/responsive-alert-dialog.d.ts +0 -16
- package/dist/components/responsive-alert-dialog.d.ts.map +0 -1
- package/dist/components/responsive-alert-dialog.js +0 -20
- package/dist/components/responsive-dialog.d.ts +0 -11
- package/dist/components/responsive-dialog.d.ts.map +0 -1
- package/dist/components/responsive-dialog.js +0 -21
- package/dist/components/scroll-area.d.ts +0 -5
- package/dist/components/scroll-area.d.ts.map +0 -1
- package/dist/components/scroll-area.js +0 -11
- package/dist/components/select.d.ts +0 -17
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/select.js +0 -34
- package/dist/components/separator.d.ts +0 -3
- package/dist/components/separator.d.ts.map +0 -1
- package/dist/components/separator.js +0 -7
- package/dist/components/sheet.d.ts +0 -15
- package/dist/components/sheet.d.ts.map +0 -1
- package/dist/components/sheet.js +0 -37
- package/dist/components/sidebar.d.ts +0 -65
- package/dist/components/sidebar.d.ts.map +0 -1
- package/dist/components/sidebar.js +0 -258
- package/dist/components/skeleton.d.ts +0 -2
- package/dist/components/skeleton.d.ts.map +0 -1
- package/dist/components/skeleton.js +0 -5
- package/dist/components/spinner.d.ts +0 -3
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/spinner.js +0 -7
- package/dist/components/switch.d.ts +0 -5
- package/dist/components/switch.d.ts.map +0 -1
- package/dist/components/switch.js +0 -7
- package/dist/components/table.d.ts +0 -13
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/table.js +0 -28
- package/dist/components/tabs.d.ts +0 -12
- package/dist/components/tabs.d.ts.map +0 -1
- package/dist/components/tabs.js +0 -32
- package/dist/components/textarea.d.ts +0 -3
- package/dist/components/textarea.d.ts.map +0 -1
- package/dist/components/textarea.js +0 -5
- package/dist/components/toggle.d.ts +0 -9
- package/dist/components/toggle.d.ts.map +0 -1
- package/dist/components/toggle.js +0 -26
- package/dist/components/tooltip.d.ts +0 -7
- package/dist/components/tooltip.d.ts.map +0 -1
- package/dist/components/tooltip.js +0 -17
- package/dist/components/typography/h1.d.ts +0 -10
- package/dist/components/typography/h1.d.ts.map +0 -1
- package/dist/components/typography/h1.js +0 -6
- package/dist/components/typography/paragraph.d.ts +0 -6
- package/dist/components/typography/paragraph.d.ts.map +0 -1
- package/dist/components/typography/paragraph.js +0 -6
- package/dist/components/typography/text.d.ts +0 -14
- package/dist/components/typography/text.d.ts.map +0 -1
- package/dist/components/typography/text.js +0 -41
- package/dist/molecules/actions.d.ts +0 -10
- package/dist/molecules/actions.d.ts.map +0 -1
- package/dist/molecules/actions.js +0 -13
- package/dist/molecules/agent.d.ts +0 -27
- package/dist/molecules/agent.d.ts.map +0 -1
- package/dist/molecules/agent.js +0 -27
- package/dist/molecules/ai/actions.d.ts +0 -10
- package/dist/molecules/ai/actions.d.ts.map +0 -1
- package/dist/molecules/ai/actions.js +0 -13
- package/dist/molecules/ai/attachments.d.ts +0 -55
- package/dist/molecules/ai/attachments.d.ts.map +0 -1
- package/dist/molecules/ai/attachments.js +0 -125
- package/dist/molecules/ai/conversation.d.ts +0 -24
- package/dist/molecules/ai/conversation.d.ts.map +0 -1
- package/dist/molecules/ai/conversation.js +0 -41
- package/dist/molecules/ai/message.d.ts +0 -38
- package/dist/molecules/ai/message.d.ts.map +0 -1
- package/dist/molecules/ai/message.js +0 -92
- package/dist/molecules/ai/shimmer.d.ts +0 -10
- package/dist/molecules/ai/shimmer.d.ts.map +0 -1
- package/dist/molecules/ai/shimmer.js +0 -28
- package/dist/molecules/artifact.d.ts +0 -24
- package/dist/molecules/artifact.d.ts.map +0 -1
- package/dist/molecules/artifact.js +0 -20
- package/dist/molecules/attachments.d.ts +0 -55
- package/dist/molecules/attachments.d.ts.map +0 -1
- package/dist/molecules/attachments.js +0 -125
- package/dist/molecules/audio-player.d.ts +0 -30
- package/dist/molecules/audio-player.d.ts.map +0 -1
- package/dist/molecules/audio-player.js +0 -43
- package/dist/molecules/canvas.d.ts +0 -9
- package/dist/molecules/canvas.d.ts.map +0 -1
- package/dist/molecules/canvas.js +0 -5
- package/dist/molecules/chain-of-thought.d.ts +0 -30
- package/dist/molecules/chain-of-thought.d.ts.map +0 -1
- package/dist/molecules/chain-of-thought.js +0 -49
- package/dist/molecules/chat-message.d.ts +0 -10
- package/dist/molecules/chat-message.d.ts.map +0 -1
- package/dist/molecules/chat-message.js +0 -53
- package/dist/molecules/checkpoint.d.ts +0 -12
- package/dist/molecules/checkpoint.d.ts.map +0 -1
- package/dist/molecules/checkpoint.js +0 -10
- package/dist/molecules/code-block.d.ts +0 -46
- package/dist/molecules/code-block.d.ts.map +0 -1
- package/dist/molecules/code-block.js +0 -216
- package/dist/molecules/commit.d.ts +0 -65
- package/dist/molecules/commit.d.ts.map +0 -1
- package/dist/molecules/commit.js +0 -95
- package/dist/molecules/confirmation.d.ts +0 -50
- package/dist/molecules/confirmation.d.ts.map +0 -1
- package/dist/molecules/confirmation.js +0 -61
- package/dist/molecules/connection.d.ts +0 -3
- package/dist/molecules/connection.d.ts.map +0 -1
- package/dist/molecules/connection.js +0 -3
- package/dist/molecules/context.d.ts +0 -33
- package/dist/molecules/context.d.ts.map +0 -1
- package/dist/molecules/context.js +0 -164
- package/dist/molecules/controls.d.ts +0 -5
- package/dist/molecules/controls.d.ts.map +0 -1
- package/dist/molecules/controls.js +0 -5
- package/dist/molecules/conversation.d.ts +0 -24
- package/dist/molecules/conversation.d.ts.map +0 -1
- package/dist/molecules/conversation.js +0 -41
- package/dist/molecules/edge.d.ts +0 -6
- package/dist/molecules/edge.d.ts.map +0 -1
- package/dist/molecules/edge.js +0 -87
- package/dist/molecules/environment-variables.d.ts +0 -39
- package/dist/molecules/environment-variables.d.ts.map +0 -1
- package/dist/molecules/environment-variables.js +0 -87
- package/dist/molecules/file-tree.d.ts +0 -27
- package/dist/molecules/file-tree.d.ts.map +0 -1
- package/dist/molecules/file-tree.js +0 -71
- package/dist/molecules/image.d.ts +0 -7
- package/dist/molecules/image.d.ts.map +0 -1
- package/dist/molecules/image.js +0 -3
- package/dist/molecules/inline-citation.d.ts +0 -39
- package/dist/molecules/inline-citation.d.ts.map +0 -1
- package/dist/molecules/inline-citation.js +0 -68
- package/dist/molecules/jsx-preview.d.ts +0 -30
- package/dist/molecules/jsx-preview.d.ts.map +0 -1
- package/dist/molecules/jsx-preview.js +0 -167
- package/dist/molecules/loader.d.ts +0 -6
- package/dist/molecules/loader.d.ts.map +0 -1
- package/dist/molecules/loader.js +0 -4
- package/dist/molecules/message.d.ts +0 -38
- package/dist/molecules/message.d.ts.map +0 -1
- package/dist/molecules/message.js +0 -92
- package/dist/molecules/mic-selector.d.ts +0 -46
- package/dist/molecules/mic-selector.d.ts.map +0 -1
- package/dist/molecules/mic-selector.js +0 -184
- package/dist/molecules/model-selector.d.ts +0 -36
- package/dist/molecules/model-selector.d.ts.map +0 -1
- package/dist/molecules/model-selector.js +0 -18
- package/dist/molecules/node.d.ts +0 -22
- package/dist/molecules/node.d.ts.map +0 -1
- package/dist/molecules/node.js +0 -11
- package/dist/molecules/open-in-chat.d.ts +0 -29
- package/dist/molecules/open-in-chat.d.ts.map +0 -1
- package/dist/molecules/open-in-chat.js +0 -100
- package/dist/molecules/package-info.d.ts +0 -30
- package/dist/molecules/package-info.d.ts.map +0 -1
- package/dist/molecules/package-info.js +0 -50
- package/dist/molecules/panel.d.ts +0 -6
- package/dist/molecules/panel.d.ts.map +0 -1
- package/dist/molecules/panel.js +0 -4
- package/dist/molecules/persona.d.ts +0 -49
- package/dist/molecules/persona.d.ts.map +0 -1
- package/dist/molecules/persona.js +0 -189
- package/dist/molecules/plan.d.ts +0 -26
- package/dist/molecules/plan.d.ts.map +0 -1
- package/dist/molecules/plan.js +0 -34
- package/dist/molecules/prompt-input.d.ts +0 -149
- package/dist/molecules/prompt-input.d.ts.map +0 -1
- package/dist/molecules/prompt-input.js +0 -702
- package/dist/molecules/queue.d.ts +0 -62
- package/dist/molecules/queue.d.ts.map +0 -1
- package/dist/molecules/queue.js +0 -28
- package/dist/molecules/reasoning.d.ts +0 -27
- package/dist/molecules/reasoning.d.ts.map +0 -1
- package/dist/molecules/reasoning.js +0 -95
- package/dist/molecules/response.d.ts +0 -6
- package/dist/molecules/response.d.ts.map +0 -1
- package/dist/molecules/response.js +0 -18
- package/dist/molecules/responsive-alert-dialog.d.ts +0 -16
- package/dist/molecules/responsive-alert-dialog.d.ts.map +0 -1
- package/dist/molecules/responsive-alert-dialog.js +0 -20
- package/dist/molecules/responsive-dialog.d.ts +0 -11
- package/dist/molecules/responsive-dialog.d.ts.map +0 -1
- package/dist/molecules/responsive-dialog.js +0 -21
- package/dist/molecules/sandbox.d.ts +0 -25
- package/dist/molecules/sandbox.d.ts.map +0 -1
- package/dist/molecules/sandbox.js +0 -15
- package/dist/molecules/schema-display.d.ts +0 -56
- package/dist/molecules/schema-display.d.ts.map +0 -1
- package/dist/molecules/schema-display.js +0 -73
- package/dist/molecules/shimmer.d.ts +0 -10
- package/dist/molecules/shimmer.d.ts.map +0 -1
- package/dist/molecules/shimmer.js +0 -28
- package/dist/molecules/snippet.d.ts +0 -19
- package/dist/molecules/snippet.d.ts.map +0 -1
- package/dist/molecules/snippet.js +0 -46
- package/dist/molecules/sources.d.ts +0 -13
- package/dist/molecules/sources.d.ts.map +0 -1
- package/dist/molecules/sources.js +0 -9
- package/dist/molecules/speech-input.d.ts +0 -55
- package/dist/molecules/speech-input.d.ts.map +0 -1
- package/dist/molecules/speech-input.js +0 -187
- package/dist/molecules/stack-trace.d.ts +0 -38
- package/dist/molecules/stack-trace.d.ts.map +0 -1
- package/dist/molecules/stack-trace.js +0 -194
- package/dist/molecules/suggestion.d.ts +0 -11
- package/dist/molecules/suggestion.d.ts.map +0 -1
- package/dist/molecules/suggestion.js +0 -13
- package/dist/molecules/task.d.ts +0 -15
- package/dist/molecules/task.d.ts.map +0 -1
- package/dist/molecules/task.js +0 -10
- package/dist/molecules/terminal.d.ts +0 -28
- package/dist/molecules/terminal.d.ts.map +0 -1
- package/dist/molecules/terminal.js +0 -68
- package/dist/molecules/test-results.d.ts +0 -59
- package/dist/molecules/test-results.d.ts.map +0 -1
- package/dist/molecules/test-results.js +0 -97
- package/dist/molecules/tool.d.ts +0 -32
- package/dist/molecules/tool.d.ts.map +0 -1
- package/dist/molecules/tool.js +0 -49
- package/dist/molecules/toolbar.d.ts +0 -6
- package/dist/molecules/toolbar.d.ts.map +0 -1
- package/dist/molecules/toolbar.js +0 -4
- package/dist/molecules/transcription.d.ts +0 -17
- package/dist/molecules/transcription.d.ts.map +0 -1
- package/dist/molecules/transcription.js +0 -36
- package/dist/molecules/voice-selector.d.ts +0 -64
- package/dist/molecules/voice-selector.d.ts.map +0 -1
- package/dist/molecules/voice-selector.js +0 -224
- package/dist/molecules/web-preview.d.ts +0 -35
- package/dist/molecules/web-preview.d.ts.map +0 -1
- package/dist/molecules/web-preview.js +0 -65
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
export const textVariants = cva("font-body", {
|
|
6
|
-
variants: {
|
|
7
|
-
variant: {
|
|
8
|
-
default: "text-sm",
|
|
9
|
-
h1: "font-heading text-2xl font-medium",
|
|
10
|
-
h2: "font-heading leading-none font-semibold text-xl",
|
|
11
|
-
paragraph1: "text-base",
|
|
12
|
-
paragraph2: "text-sm text-zinc-600",
|
|
13
|
-
small: "text-sm",
|
|
14
|
-
button: "text-button leading-none font-medium",
|
|
15
|
-
mono: "font-mono text-[13px] leading-none translate-y-[1px]",
|
|
16
|
-
tiny: "text-xs text-zinc-600",
|
|
17
|
-
},
|
|
18
|
-
color: {
|
|
19
|
-
default: "text-foreground",
|
|
20
|
-
primary: "text-primary-foreground",
|
|
21
|
-
secondary: "text-secondary-foreground",
|
|
22
|
-
muted: "text-muted-foreground",
|
|
23
|
-
accent: "text-accent-foreground",
|
|
24
|
-
popover: "text-popover-foreground",
|
|
25
|
-
meta: "text-zinc-400",
|
|
26
|
-
disabled: "text-zinc-400",
|
|
27
|
-
destructive: "text-destructive",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
defaultVariants: {
|
|
31
|
-
variant: "default",
|
|
32
|
-
color: "default",
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
export function Text({ className, render, as = "div", variant, color, ...props }) {
|
|
36
|
-
return useRender({
|
|
37
|
-
defaultTagName: as,
|
|
38
|
-
render,
|
|
39
|
-
props: mergeProps({ className: cn(textVariants({ variant, color }), className) }, props),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
import { type ButtonProps } from "@chatsdk-dev/ui/components/button";
|
|
3
|
-
export type ActionsProps = ComponentProps<"div">;
|
|
4
|
-
export declare const Actions: ({ className, children, ...props }: ActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export type ActionProps = ButtonProps & {
|
|
6
|
-
tooltip?: string;
|
|
7
|
-
label?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const Action: ({ tooltip, children, label, className, variant, size, ...props }: ActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/molecules/actions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAS7E,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEjD,eAAO,MAAM,OAAO,GAAI,mCAAmC,YAAY,4CAItE,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,kEAQpB,WAAW,4CA+Bb,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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 { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@chatsdk-dev/ui/components/tooltip";
|
|
5
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
6
|
-
export const Actions = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-", className), ...props, children: children }));
|
|
7
|
-
export const Action = ({ tooltip, children, label, className, variant = "ghost", size = "sm", ...props }) => {
|
|
8
|
-
const button = (_jsxs(Button, { className: cn("size-9 p-1.5 bg-transparent text-muted-foreground hover:text-foreground hover:bg-transparent relative", className), size: size, type: "button", variant: variant, ...props, children: [children, _jsx("span", { className: "sr-only", children: label || tooltip })] }));
|
|
9
|
-
if (tooltip) {
|
|
10
|
-
return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { children: button }), _jsx(TooltipContent, { children: _jsx("p", { children: tooltip }) })] }) }));
|
|
11
|
-
}
|
|
12
|
-
return button;
|
|
13
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Accordion, AccordionItem } from "@chatsdk-dev/ui/components/accordion";
|
|
2
|
-
import type { Tool } from "ai";
|
|
3
|
-
import type { ComponentProps } from "react";
|
|
4
|
-
export type AgentProps = ComponentProps<"div">;
|
|
5
|
-
export declare const Agent: import("react").MemoExoticComponent<({ className, ...props }: AgentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
6
|
-
export type AgentHeaderProps = ComponentProps<"div"> & {
|
|
7
|
-
name: string;
|
|
8
|
-
model?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const AgentHeader: import("react").MemoExoticComponent<({ className, name, model, ...props }: AgentHeaderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
-
export type AgentContentProps = ComponentProps<"div">;
|
|
12
|
-
export declare const AgentContent: import("react").MemoExoticComponent<({ className, ...props }: AgentContentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
|
-
export type AgentInstructionsProps = ComponentProps<"div"> & {
|
|
14
|
-
children: string;
|
|
15
|
-
};
|
|
16
|
-
export declare const AgentInstructions: import("react").MemoExoticComponent<({ className, children, ...props }: AgentInstructionsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
17
|
-
export type AgentToolsProps = ComponentProps<typeof Accordion>;
|
|
18
|
-
export declare const AgentTools: import("react").MemoExoticComponent<({ className, ...props }: AgentToolsProps) => import("react/jsx-runtime").JSX.Element>;
|
|
19
|
-
export type AgentToolProps = ComponentProps<typeof AccordionItem> & {
|
|
20
|
-
tool: Tool;
|
|
21
|
-
};
|
|
22
|
-
export declare const AgentTool: import("react").MemoExoticComponent<({ className, tool, value, ...props }: AgentToolProps) => import("react/jsx-runtime").JSX.Element>;
|
|
23
|
-
export type AgentOutputProps = ComponentProps<"div"> & {
|
|
24
|
-
schema: string;
|
|
25
|
-
};
|
|
26
|
-
export declare const AgentOutput: import("react").MemoExoticComponent<({ className, schema, ...props }: AgentOutputProps) => import("react/jsx-runtime").JSX.Element>;
|
|
27
|
-
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/molecules/agent.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EAET,aAAa,EAEd,MAAM,sCAAsC,CAAC;AAG9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAE/C,eAAO,MAAM,KAAK,gEAAkC,UAAU,6CAK5D,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,WAAW,6EACiB,gBAAgB,6CAmBxD,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEtD,eAAO,MAAM,YAAY,gEACG,iBAAiB,6CAG5C,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC3D,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,iBAAiB,0EACQ,sBAAsB,6CAU3D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAE/D,eAAO,MAAM,UAAU,gEAAkC,eAAe,6CAKtE,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,GAAG;IAClE,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,SAAS,6EACmB,cAAc,6CAuBtD,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACrD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,WAAW,wEACY,gBAAgB,6CAUnD,CAAC"}
|
package/dist/molecules/agent.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@chatsdk-dev/ui/components/accordion";
|
|
4
|
-
import { Badge } from "@chatsdk-dev/ui/components/badge";
|
|
5
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
6
|
-
import { BotIcon } from "lucide-react";
|
|
7
|
-
import { memo } from "react";
|
|
8
|
-
import { CodeBlock } from "./code-block";
|
|
9
|
-
export const Agent = memo(({ className, ...props }) => (_jsx("div", { className: cn("not-prose w-full rounded-md border", className), ...props })));
|
|
10
|
-
export const AgentHeader = memo(({ className, name, model, ...props }) => (_jsx("div", { className: cn("flex w-full items-center justify-between gap-4 p-3", className), ...props, children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(BotIcon, { className: "size-4 text-muted-foreground" }), _jsx("span", { className: "font-medium text-sm", children: name }), model && (_jsx(Badge, { className: "font-mono text-xs", variant: "secondary", children: model }))] }) })));
|
|
11
|
-
export const AgentContent = memo(({ className, ...props }) => (_jsx("div", { className: cn("space-y-4 p-4 pt-0", className), ...props })));
|
|
12
|
-
export const AgentInstructions = memo(({ className, children, ...props }) => (_jsxs("div", { className: cn("space-y-2", className), ...props, children: [_jsx("span", { className: "font-medium text-muted-foreground text-sm", children: "Instructions" }), _jsx("div", { className: "rounded-md bg-muted/50 p-3 text-muted-foreground text-sm", children: _jsx("p", { children: children }) })] })));
|
|
13
|
-
export const AgentTools = memo(({ className, ...props }) => (_jsxs("div", { className: cn("space-y-2", className), children: [_jsx("span", { className: "font-medium text-muted-foreground text-sm", children: "Tools" }), _jsx(Accordion, { className: "rounded-md border", ...props })] })));
|
|
14
|
-
export const AgentTool = memo(({ className, tool, value, ...props }) => {
|
|
15
|
-
const schema = "jsonSchema" in tool && tool.jsonSchema
|
|
16
|
-
? tool.jsonSchema
|
|
17
|
-
: tool.inputSchema;
|
|
18
|
-
return (_jsxs(AccordionItem, { className: cn("border-b last:border-b-0", className), value: value, ...props, children: [_jsx(AccordionTrigger, { className: "px-3 py-2 text-sm hover:no-underline", children: tool.description ?? "No description" }), _jsx(AccordionContent, { className: "px-3 pb-3", children: _jsx("div", { className: "rounded-md bg-muted/50", children: _jsx(CodeBlock, { code: JSON.stringify(schema, null, 2), language: "json" }) }) })] }));
|
|
19
|
-
});
|
|
20
|
-
export const AgentOutput = memo(({ className, schema, ...props }) => (_jsxs("div", { className: cn("space-y-2", className), ...props, children: [_jsx("span", { className: "font-medium text-muted-foreground text-sm", children: "Output Schema" }), _jsx("div", { className: "rounded-md bg-muted/50", children: _jsx(CodeBlock, { code: schema, language: "typescript" }) })] })));
|
|
21
|
-
Agent.displayName = "Agent";
|
|
22
|
-
AgentHeader.displayName = "AgentHeader";
|
|
23
|
-
AgentContent.displayName = "AgentContent";
|
|
24
|
-
AgentInstructions.displayName = "AgentInstructions";
|
|
25
|
-
AgentTools.displayName = "AgentTools";
|
|
26
|
-
AgentTool.displayName = "AgentTool";
|
|
27
|
-
AgentOutput.displayName = "AgentOutput";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "react";
|
|
2
|
-
import { type ButtonProps } from "@chatsdk-dev/ui/atoms/button";
|
|
3
|
-
export type ActionsProps = ComponentProps<"div">;
|
|
4
|
-
export declare const Actions: ({ className, children, ...props }: ActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export type ActionProps = ButtonProps & {
|
|
6
|
-
tooltip?: string;
|
|
7
|
-
label?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const Action: ({ tooltip, children, label, className, variant, size, ...props }: ActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/molecules/ai/actions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAC;AASxE,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEjD,eAAO,MAAM,OAAO,GAAI,mCAAmC,YAAY,4CAItE,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,kEAQpB,WAAW,4CA+Bb,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from "@chatsdk-dev/ui/atoms/button";
|
|
4
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@chatsdk-dev/ui/atoms/tooltip";
|
|
5
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
6
|
-
export const Actions = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-", className), ...props, children: children }));
|
|
7
|
-
export const Action = ({ tooltip, children, label, className, variant = "ghost", size = "sm", ...props }) => {
|
|
8
|
-
const button = (_jsxs(Button, { className: cn("size-9 p-1.5 bg-transparent text-muted-foreground hover:text-foreground hover:bg-transparent relative", className), size: size, type: "button", variant: variant, ...props, children: [children, _jsx("span", { className: "sr-only", children: label || tooltip })] }));
|
|
9
|
-
if (tooltip) {
|
|
10
|
-
return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { children: button }), _jsx(TooltipContent, { children: _jsx("p", { children: tooltip }) })] }) }));
|
|
11
|
-
}
|
|
12
|
-
return button;
|
|
13
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Button } from "@chatsdk-dev/ui/atoms/button";
|
|
2
|
-
import { HoverCard, HoverCardContent, HoverCardTrigger } from "@chatsdk-dev/ui/atoms/hover-card";
|
|
3
|
-
import type { FileUIPart, SourceDocumentUIPart } from "ai";
|
|
4
|
-
import type { ComponentProps, HTMLAttributes, ReactNode } from "react";
|
|
5
|
-
export type AttachmentData = (FileUIPart & {
|
|
6
|
-
id: string;
|
|
7
|
-
}) | (SourceDocumentUIPart & {
|
|
8
|
-
id: string;
|
|
9
|
-
});
|
|
10
|
-
export type AttachmentMediaCategory = "image" | "video" | "audio" | "document" | "source" | "unknown";
|
|
11
|
-
export type AttachmentVariant = "grid" | "inline" | "list";
|
|
12
|
-
export declare const getMediaCategory: (data: AttachmentData) => AttachmentMediaCategory;
|
|
13
|
-
export declare const getAttachmentLabel: (data: AttachmentData) => string;
|
|
14
|
-
interface AttachmentsContextValue {
|
|
15
|
-
variant: AttachmentVariant;
|
|
16
|
-
}
|
|
17
|
-
interface AttachmentContextValue {
|
|
18
|
-
data: AttachmentData;
|
|
19
|
-
mediaCategory: AttachmentMediaCategory;
|
|
20
|
-
onRemove?: () => void;
|
|
21
|
-
variant: AttachmentVariant;
|
|
22
|
-
}
|
|
23
|
-
export declare const useAttachmentsContext: () => AttachmentsContextValue;
|
|
24
|
-
export declare const useAttachmentContext: () => AttachmentContextValue;
|
|
25
|
-
export type AttachmentsProps = HTMLAttributes<HTMLDivElement> & {
|
|
26
|
-
variant?: AttachmentVariant;
|
|
27
|
-
};
|
|
28
|
-
export declare const Attachments: ({ variant, className, children, ...props }: AttachmentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export type AttachmentProps = HTMLAttributes<HTMLDivElement> & {
|
|
30
|
-
data: AttachmentData;
|
|
31
|
-
onRemove?: () => void;
|
|
32
|
-
};
|
|
33
|
-
export declare const Attachment: ({ data, onRemove, className, children, ...props }: AttachmentProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
export type AttachmentPreviewProps = HTMLAttributes<HTMLDivElement> & {
|
|
35
|
-
fallbackIcon?: ReactNode;
|
|
36
|
-
};
|
|
37
|
-
export declare const AttachmentPreview: ({ fallbackIcon, className, ...props }: AttachmentPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
export type AttachmentInfoProps = HTMLAttributes<HTMLDivElement> & {
|
|
39
|
-
showMediaType?: boolean;
|
|
40
|
-
};
|
|
41
|
-
export declare const AttachmentInfo: ({ showMediaType, className, ...props }: AttachmentInfoProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
42
|
-
export type AttachmentRemoveProps = ComponentProps<typeof Button> & {
|
|
43
|
-
label?: string;
|
|
44
|
-
};
|
|
45
|
-
export declare const AttachmentRemove: ({ label, className, children, ...props }: AttachmentRemoveProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
46
|
-
export type AttachmentHoverCardProps = ComponentProps<typeof HoverCard>;
|
|
47
|
-
export declare const AttachmentHoverCard: ({ ...props }: AttachmentHoverCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
-
export type AttachmentHoverCardTriggerProps = ComponentProps<typeof HoverCardTrigger>;
|
|
49
|
-
export declare const AttachmentHoverCardTrigger: ({ delay, closeDelay, ...props }: AttachmentHoverCardTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
export type AttachmentHoverCardContentProps = ComponentProps<typeof HoverCardContent>;
|
|
51
|
-
export declare const AttachmentHoverCardContent: ({ align, className, ...props }: AttachmentHoverCardContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
-
export type AttachmentEmptyProps = HTMLAttributes<HTMLDivElement>;
|
|
53
|
-
export declare const AttachmentEmpty: ({ className, children, ...props }: AttachmentEmptyProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../../src/molecules/ai/attachments.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAU3D,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvE,MAAM,MAAM,cAAc,GACtB,CAAC,UAAU,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7B,CAAC,oBAAoB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE5C,MAAM,MAAM,uBAAuB,GAC/B,OAAO,GACP,OAAO,GACP,OAAO,GACP,UAAU,GACV,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAe3D,eAAO,MAAM,gBAAgB,GAC3B,MAAM,cAAc,KACnB,uBAqBF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,MAAM,cAAc,KAAG,MAOzD,CAAC;AA6BF,UAAU,uBAAuB;IAC/B,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAID,UAAU,sBAAsB;IAC9B,IAAI,EAAE,cAAc,CAAC;IACrB,aAAa,EAAE,uBAAuB,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAQD,eAAO,MAAM,qBAAqB,+BAC8B,CAAC;AAEjE,eAAO,MAAM,oBAAoB,8BAMhC,CAAC;AAMF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC9D,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,4CAKzB,gBAAgB,4CAkBlB,CAAC;AAMF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC7D,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,mDAMxB,eAAe,4CAiCjB,CAAC;AAMF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACpE,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,uCAI/B,sBAAsB,4CAoCxB,CAAC;AAMF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACjE,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,wCAI5B,mBAAmB,mDAkBrB,CAAC;AAMF,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,0CAK9B,qBAAqB,mDA2CvB,CAAC;AAMF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAExE,eAAO,MAAM,mBAAmB,GAAI,cAAc,wBAAwB,4CAEzE,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAC1D,OAAO,gBAAgB,CACxB,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,iCAIxC,+BAA+B,4CAEjC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAC1D,OAAO,gBAAgB,CACxB,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,gCAIxC,+BAA+B,4CAMjC,CAAC;AAMF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAElE,eAAO,MAAM,eAAe,GAAI,mCAI7B,oBAAoB,4CAUtB,CAAC"}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from "@chatsdk-dev/ui/atoms/button";
|
|
4
|
-
import { HoverCard, HoverCardContent, HoverCardTrigger, } from "@chatsdk-dev/ui/atoms/hover-card";
|
|
5
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
6
|
-
import { FileTextIcon, GlobeIcon, ImageIcon, Music2Icon, PaperclipIcon, VideoIcon, XIcon, } from "lucide-react";
|
|
7
|
-
import { createContext, useCallback, useContext, useMemo } from "react";
|
|
8
|
-
const mediaCategoryIcons = {
|
|
9
|
-
audio: Music2Icon,
|
|
10
|
-
document: FileTextIcon,
|
|
11
|
-
image: ImageIcon,
|
|
12
|
-
source: GlobeIcon,
|
|
13
|
-
unknown: PaperclipIcon,
|
|
14
|
-
video: VideoIcon,
|
|
15
|
-
};
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// Utility Functions
|
|
18
|
-
// ============================================================================
|
|
19
|
-
export const getMediaCategory = (data) => {
|
|
20
|
-
if (data.type === "source-document") {
|
|
21
|
-
return "source";
|
|
22
|
-
}
|
|
23
|
-
const mediaType = data.mediaType ?? "";
|
|
24
|
-
if (mediaType.startsWith("image/")) {
|
|
25
|
-
return "image";
|
|
26
|
-
}
|
|
27
|
-
if (mediaType.startsWith("video/")) {
|
|
28
|
-
return "video";
|
|
29
|
-
}
|
|
30
|
-
if (mediaType.startsWith("audio/")) {
|
|
31
|
-
return "audio";
|
|
32
|
-
}
|
|
33
|
-
if (mediaType.startsWith("application/") || mediaType.startsWith("text/")) {
|
|
34
|
-
return "document";
|
|
35
|
-
}
|
|
36
|
-
return "unknown";
|
|
37
|
-
};
|
|
38
|
-
export const getAttachmentLabel = (data) => {
|
|
39
|
-
if (data.type === "source-document") {
|
|
40
|
-
return data.title || data.filename || "Source";
|
|
41
|
-
}
|
|
42
|
-
const category = getMediaCategory(data);
|
|
43
|
-
return data.filename || (category === "image" ? "Image" : "Attachment");
|
|
44
|
-
};
|
|
45
|
-
const renderAttachmentImage = (url, filename, isGrid) => isGrid ? (_jsx("img", { alt: filename || "Image", className: "size-full object-cover", height: 96, src: url, width: 96 })) : (_jsx("img", { alt: filename || "Image", className: "size-full rounded object-cover", height: 20, src: url, width: 20 }));
|
|
46
|
-
const AttachmentsContext = createContext(null);
|
|
47
|
-
const AttachmentContext = createContext(null);
|
|
48
|
-
// ============================================================================
|
|
49
|
-
// Hooks
|
|
50
|
-
// ============================================================================
|
|
51
|
-
export const useAttachmentsContext = () => useContext(AttachmentsContext) ?? { variant: "grid" };
|
|
52
|
-
export const useAttachmentContext = () => {
|
|
53
|
-
const ctx = useContext(AttachmentContext);
|
|
54
|
-
if (!ctx) {
|
|
55
|
-
throw new Error("Attachment components must be used within <Attachment>");
|
|
56
|
-
}
|
|
57
|
-
return ctx;
|
|
58
|
-
};
|
|
59
|
-
export const Attachments = ({ variant = "grid", className, children, ...props }) => {
|
|
60
|
-
const contextValue = useMemo(() => ({ variant }), [variant]);
|
|
61
|
-
return (_jsx(AttachmentsContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("flex items-start", variant === "list" ? "flex-col gap-2" : "flex-wrap gap-2", variant === "grid" && "ml-auto w-fit", className), ...props, children: children }) }));
|
|
62
|
-
};
|
|
63
|
-
export const Attachment = ({ data, onRemove, className, children, ...props }) => {
|
|
64
|
-
const { variant } = useAttachmentsContext();
|
|
65
|
-
const mediaCategory = getMediaCategory(data);
|
|
66
|
-
const contextValue = useMemo(() => ({ data, mediaCategory, onRemove, variant }), [data, mediaCategory, onRemove, variant]);
|
|
67
|
-
return (_jsx(AttachmentContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("group relative", variant === "grid" && "size-24 overflow-hidden rounded-lg", variant === "inline" && [
|
|
68
|
-
"flex h-8 cursor-pointer select-none items-center gap-1.5",
|
|
69
|
-
"rounded-md border border-border px-1.5",
|
|
70
|
-
"font-medium text-sm transition-all",
|
|
71
|
-
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
72
|
-
], variant === "list" && [
|
|
73
|
-
"flex w-full items-center gap-3 rounded-lg border p-3",
|
|
74
|
-
"hover:bg-accent/50",
|
|
75
|
-
], className), ...props, children: children }) }));
|
|
76
|
-
};
|
|
77
|
-
export const AttachmentPreview = ({ fallbackIcon, className, ...props }) => {
|
|
78
|
-
const { data, mediaCategory, variant } = useAttachmentContext();
|
|
79
|
-
const iconSize = variant === "inline" ? "size-3" : "size-4";
|
|
80
|
-
const renderIcon = (Icon) => (_jsx(Icon, { className: cn(iconSize, "text-muted-foreground") }));
|
|
81
|
-
const renderContent = () => {
|
|
82
|
-
if (mediaCategory === "image" && data.type === "file" && data.url) {
|
|
83
|
-
return renderAttachmentImage(data.url, data.filename, variant === "grid");
|
|
84
|
-
}
|
|
85
|
-
if (mediaCategory === "video" && data.type === "file" && data.url) {
|
|
86
|
-
return _jsx("video", { className: "size-full object-cover", muted: true, src: data.url });
|
|
87
|
-
}
|
|
88
|
-
const Icon = mediaCategoryIcons[mediaCategory];
|
|
89
|
-
return fallbackIcon ?? renderIcon(Icon);
|
|
90
|
-
};
|
|
91
|
-
return (_jsx("div", { className: cn("flex shrink-0 items-center justify-center overflow-hidden", variant === "grid" && "size-full bg-muted", variant === "inline" && "size-5 rounded bg-background", variant === "list" && "size-12 rounded bg-muted", className), ...props, children: renderContent() }));
|
|
92
|
-
};
|
|
93
|
-
export const AttachmentInfo = ({ showMediaType = false, className, ...props }) => {
|
|
94
|
-
const { data, variant } = useAttachmentContext();
|
|
95
|
-
const label = getAttachmentLabel(data);
|
|
96
|
-
if (variant === "grid") {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
return (_jsxs("div", { className: cn("min-w-0 flex-1", className), ...props, children: [_jsx("span", { className: "block truncate", children: label }), showMediaType && data.mediaType && (_jsx("span", { className: "block truncate text-muted-foreground text-xs", children: data.mediaType }))] }));
|
|
100
|
-
};
|
|
101
|
-
export const AttachmentRemove = ({ label = "Remove", className, children, ...props }) => {
|
|
102
|
-
const { onRemove, variant } = useAttachmentContext();
|
|
103
|
-
const handleClick = useCallback((e) => {
|
|
104
|
-
e.stopPropagation();
|
|
105
|
-
onRemove?.();
|
|
106
|
-
}, [onRemove]);
|
|
107
|
-
if (!onRemove) {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
return (_jsxs(Button, { "aria-label": label, className: cn(variant === "grid" && [
|
|
111
|
-
"absolute top-2 right-2 size-6 rounded-full p-0",
|
|
112
|
-
"bg-background/80 backdrop-blur-sm",
|
|
113
|
-
"opacity-0 transition-opacity group-hover:opacity-100",
|
|
114
|
-
"hover:bg-background",
|
|
115
|
-
"[&>svg]:size-3",
|
|
116
|
-
], variant === "inline" && [
|
|
117
|
-
"size-5 rounded p-0",
|
|
118
|
-
"opacity-0 transition-opacity group-hover:opacity-100",
|
|
119
|
-
"[&>svg]:size-2.5",
|
|
120
|
-
], variant === "list" && ["size-8 shrink-0 rounded p-0", "[&>svg]:size-4"], className), onClick: handleClick, type: "button", variant: "ghost", ...props, children: [children ?? _jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: label })] }));
|
|
121
|
-
};
|
|
122
|
-
export const AttachmentHoverCard = ({ ...props }) => (_jsx(HoverCard, { ...props }));
|
|
123
|
-
export const AttachmentHoverCardTrigger = ({ delay = 0, closeDelay = 0, ...props }) => (_jsx(HoverCardTrigger, { delay: delay, closeDelay: closeDelay, ...props }));
|
|
124
|
-
export const AttachmentHoverCardContent = ({ align = "start", className, ...props }) => (_jsx(HoverCardContent, { align: align, className: cn("w-auto p-2", className), ...props }));
|
|
125
|
-
export const AttachmentEmpty = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center justify-center p-4 text-muted-foreground text-sm", className), ...props, children: children ?? "No attachments" }));
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Button } from "@chatsdk-dev/ui/atoms/button";
|
|
2
|
-
import type { UIMessage } from "ai";
|
|
3
|
-
import type { ComponentProps } from "react";
|
|
4
|
-
import { StickToBottom } from "use-stick-to-bottom";
|
|
5
|
-
export type ConversationProps = ComponentProps<typeof StickToBottom>;
|
|
6
|
-
export declare const Conversation: ({ className, ...props }: ConversationProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export type ConversationContentProps = ComponentProps<typeof StickToBottom.Content>;
|
|
8
|
-
export declare const ConversationContent: ({ className, ...props }: ConversationContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export type ConversationEmptyStateProps = ComponentProps<"div"> & {
|
|
10
|
-
title?: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
icon?: React.ReactNode;
|
|
13
|
-
};
|
|
14
|
-
export declare const ConversationEmptyState: ({ className, title, description, icon, children, ...props }: ConversationEmptyStateProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export type ConversationScrollButtonProps = ComponentProps<typeof Button>;
|
|
16
|
-
export declare const ConversationScrollButton: ({ className, ...props }: ConversationScrollButtonProps) => false | import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export type ConversationDownloadProps = Omit<ComponentProps<typeof Button>, "onClick"> & {
|
|
18
|
-
messages: UIMessage[];
|
|
19
|
-
filename?: string;
|
|
20
|
-
formatMessage?: (message: UIMessage, index: number) => string;
|
|
21
|
-
};
|
|
22
|
-
export declare const messagesToMarkdown: (messages: UIMessage[], formatMessage?: (message: UIMessage, index: number) => string) => string;
|
|
23
|
-
export declare const ConversationDownload: ({ messages, filename, formatMessage, className, children, ...props }: ConversationDownloadProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/molecules/ai/conversation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,aAAa,EAA2B,MAAM,qBAAqB,CAAC;AAE7E,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,aAAa,CAAC,CAAC;AAErE,eAAO,MAAM,YAAY,GAAI,yBAAyB,iBAAiB,4CAQtE,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CACnD,OAAO,aAAa,CAAC,OAAO,CAC7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,yBAGjC,wBAAwB,4CAK1B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,6DAOpC,2BAA2B,4CAoB7B,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC;AAE1E,eAAO,MAAM,wBAAwB,GAAI,yBAGtC,6BAA6B,oDAwB/B,CAAC;AAQF,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,cAAc,CAAC,OAAO,MAAM,CAAC,EAC7B,SAAS,CACV,GAAG;IACF,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/D,CAAC;AAQF,eAAO,MAAM,kBAAkB,GAC7B,UAAU,SAAS,EAAE,EACrB,gBAAe,CACb,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,MAAM,KACV,MAA6B,KACjC,MAAsE,CAAC;AAE1E,eAAO,MAAM,oBAAoB,GAAI,sEAOlC,yBAAyB,4CA6B3B,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from "@chatsdk-dev/ui/atoms/button";
|
|
4
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
5
|
-
import { ArrowDownIcon, DownloadIcon } from "lucide-react";
|
|
6
|
-
import { useCallback } from "react";
|
|
7
|
-
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
|
|
8
|
-
export const Conversation = ({ className, ...props }) => (_jsx(StickToBottom, { className: cn("relative flex-1 overflow-y-hidden", className), initial: "smooth", resize: "smooth", role: "log", ...props }));
|
|
9
|
-
export const ConversationContent = ({ className, ...props }) => (_jsx(StickToBottom.Content, { className: cn("flex flex-col gap-8 p-4", className), ...props }));
|
|
10
|
-
export const ConversationEmptyState = ({ className, title = "No messages yet", description = "Start a conversation to see messages here", icon, children, ...props }) => (_jsx("div", { className: cn("flex size-full flex-col items-center justify-center gap-3 p-8 text-center", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [icon && _jsx("div", { className: "text-muted-foreground", children: icon }), _jsxs("div", { className: "space-y-1", children: [_jsx("h3", { className: "font-medium text-sm", children: title }), description && (_jsx("p", { className: "text-muted-foreground text-sm", children: description }))] })] })) }));
|
|
11
|
-
export const ConversationScrollButton = ({ className, ...props }) => {
|
|
12
|
-
const { isAtBottom, scrollToBottom } = useStickToBottomContext();
|
|
13
|
-
const handleScrollToBottom = useCallback(() => {
|
|
14
|
-
scrollToBottom();
|
|
15
|
-
}, [scrollToBottom]);
|
|
16
|
-
return (!isAtBottom && (_jsx(Button, { className: cn("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted", className), onClick: handleScrollToBottom, size: "icon", type: "button", variant: "outline", ...props, children: _jsx(ArrowDownIcon, { className: "size-4" }) })));
|
|
17
|
-
};
|
|
18
|
-
const getMessageText = (message) => message.parts
|
|
19
|
-
.filter((part) => part.type === "text")
|
|
20
|
-
.map((part) => part.text)
|
|
21
|
-
.join("");
|
|
22
|
-
const defaultFormatMessage = (message) => {
|
|
23
|
-
const roleLabel = message.role.charAt(0).toUpperCase() + message.role.slice(1);
|
|
24
|
-
return `**${roleLabel}:** ${getMessageText(message)}`;
|
|
25
|
-
};
|
|
26
|
-
export const messagesToMarkdown = (messages, formatMessage = defaultFormatMessage) => messages.map((msg, i) => formatMessage(msg, i)).join("\n\n");
|
|
27
|
-
export const ConversationDownload = ({ messages, filename = "conversation.md", formatMessage = defaultFormatMessage, className, children, ...props }) => {
|
|
28
|
-
const handleDownload = useCallback(() => {
|
|
29
|
-
const markdown = messagesToMarkdown(messages, formatMessage);
|
|
30
|
-
const blob = new Blob([markdown], { type: "text/markdown" });
|
|
31
|
-
const url = URL.createObjectURL(blob);
|
|
32
|
-
const link = document.createElement("a");
|
|
33
|
-
link.href = url;
|
|
34
|
-
link.download = filename;
|
|
35
|
-
document.body.append(link);
|
|
36
|
-
link.click();
|
|
37
|
-
link.remove();
|
|
38
|
-
URL.revokeObjectURL(url);
|
|
39
|
-
}, [messages, filename, formatMessage]);
|
|
40
|
-
return (_jsx(Button, { className: cn("absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-muted", className), onClick: handleDownload, size: "icon", type: "button", variant: "outline", ...props, children: children ?? _jsx(DownloadIcon, { className: "size-4" }) }));
|
|
41
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Button } from "@chatsdk-dev/ui/atoms/button";
|
|
2
|
-
import { ButtonGroup } from "@chatsdk-dev/ui/atoms/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/jsx-runtime").JSX.Element;
|
|
38
|
-
//# sourceMappingURL=message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/molecules/ai/message.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EACL,WAAW,EAEZ,MAAM,oCAAoC,CAAC;AAY5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAgB,MAAM,OAAO,CAAC;AAU1E,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAC1D,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,+BAA+B,YAAY,4CASlE,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEjE,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAYrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAIrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,uDAO3B,kBAAkB,4CAsBpB,CAAC;AA2BF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,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"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from "@chatsdk-dev/ui/atoms/button";
|
|
4
|
-
import { ButtonGroup, ButtonGroupText, } from "@chatsdk-dev/ui/atoms/button-group";
|
|
5
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@chatsdk-dev/ui/atoms/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 }));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ElementType } from "react";
|
|
2
|
-
export interface TextShimmerProps {
|
|
3
|
-
children: string;
|
|
4
|
-
as?: ElementType;
|
|
5
|
-
className?: string;
|
|
6
|
-
duration?: number;
|
|
7
|
-
spread?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare const Shimmer: import("react").MemoExoticComponent<({ children, as: Component, className, duration, spread, }: TextShimmerProps) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
-
//# sourceMappingURL=shimmer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shimmer.d.ts","sourceRoot":"","sources":["../../../src/molecules/ai/shimmer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAiB,WAAW,EAAO,MAAM,OAAO,CAAC;AAoB7D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AA6CD,eAAO,MAAM,OAAO,kGArCjB,gBAAgB,6CAqC0B,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
4
|
-
import { motion } from "motion/react";
|
|
5
|
-
import { memo, useMemo } from "react";
|
|
6
|
-
// Cache motion components at module level to avoid creating during render
|
|
7
|
-
const motionComponentCache = new Map();
|
|
8
|
-
const getMotionComponent = (element) => {
|
|
9
|
-
let component = motionComponentCache.get(element);
|
|
10
|
-
if (!component) {
|
|
11
|
-
component = motion.create(element);
|
|
12
|
-
motionComponentCache.set(element, component);
|
|
13
|
-
}
|
|
14
|
-
return component;
|
|
15
|
-
};
|
|
16
|
-
const ShimmerComponent = ({ children, as: Component = "p", className, duration = 2, spread = 2, }) => {
|
|
17
|
-
const MotionComponent = getMotionComponent(Component);
|
|
18
|
-
const dynamicSpread = useMemo(() => (children?.length ?? 0) * spread, [children, spread]);
|
|
19
|
-
return (_jsx(MotionComponent, { animate: { backgroundPosition: "0% center" }, className: cn("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent", "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]", className), initial: { backgroundPosition: "100% center" }, style: {
|
|
20
|
-
"--spread": `${dynamicSpread}px`,
|
|
21
|
-
backgroundImage: "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))",
|
|
22
|
-
}, transition: {
|
|
23
|
-
duration,
|
|
24
|
-
ease: "linear",
|
|
25
|
-
repeat: Number.POSITIVE_INFINITY,
|
|
26
|
-
}, children: children }));
|
|
27
|
-
};
|
|
28
|
-
export const Shimmer = memo(ShimmerComponent);
|