@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,216 +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 { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@chatsdk-dev/ui/components/select";
|
|
5
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
6
|
-
import { CheckIcon, CopyIcon } from "lucide-react";
|
|
7
|
-
import { createContext, memo, useCallback, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
8
|
-
import { createHighlighter } from "shiki";
|
|
9
|
-
// Shiki uses bitflags for font styles: 1=italic, 2=bold, 4=underline
|
|
10
|
-
// oxlint-disable-next-line eslint(no-bitwise)
|
|
11
|
-
const isItalic = (fontStyle) => fontStyle && fontStyle & 1;
|
|
12
|
-
// oxlint-disable-next-line eslint(no-bitwise)
|
|
13
|
-
const isBold = (fontStyle) => fontStyle && fontStyle & 2;
|
|
14
|
-
const isUnderline = (fontStyle) =>
|
|
15
|
-
// oxlint-disable-next-line eslint(no-bitwise)
|
|
16
|
-
fontStyle && fontStyle & 4;
|
|
17
|
-
const addKeysToTokens = (lines) => lines.map((line, lineIdx) => ({
|
|
18
|
-
key: `line-${lineIdx}`,
|
|
19
|
-
tokens: line.map((token, tokenIdx) => ({
|
|
20
|
-
key: `line-${lineIdx}-${tokenIdx}`,
|
|
21
|
-
token,
|
|
22
|
-
})),
|
|
23
|
-
}));
|
|
24
|
-
// Token rendering component
|
|
25
|
-
const TokenSpan = ({ token }) => (_jsx("span", { className: "dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]", style: {
|
|
26
|
-
backgroundColor: token.bgColor,
|
|
27
|
-
color: token.color,
|
|
28
|
-
fontStyle: isItalic(token.fontStyle) ? "italic" : undefined,
|
|
29
|
-
fontWeight: isBold(token.fontStyle) ? "bold" : undefined,
|
|
30
|
-
textDecoration: isUnderline(token.fontStyle) ? "underline" : undefined,
|
|
31
|
-
...token.htmlStyle,
|
|
32
|
-
}, children: token.content }));
|
|
33
|
-
// Line number styles using CSS counters
|
|
34
|
-
const LINE_NUMBER_CLASSES = cn("block", "before:content-[counter(line)]", "before:inline-block", "before:[counter-increment:line]", "before:w-8", "before:mr-4", "before:text-right", "before:text-muted-foreground/50", "before:font-mono", "before:select-none");
|
|
35
|
-
// Line rendering component
|
|
36
|
-
const LineSpan = ({ keyedLine, showLineNumbers, }) => (_jsx("span", { className: showLineNumbers ? LINE_NUMBER_CLASSES : "block", children: keyedLine.tokens.length === 0
|
|
37
|
-
? "\n"
|
|
38
|
-
: keyedLine.tokens.map(({ token, key }) => (_jsx(TokenSpan, { token: token }, key))) }));
|
|
39
|
-
// Context
|
|
40
|
-
const CodeBlockContext = createContext({
|
|
41
|
-
code: "",
|
|
42
|
-
});
|
|
43
|
-
// Highlighter cache (singleton per language)
|
|
44
|
-
const highlighterCache = new Map();
|
|
45
|
-
// Token cache
|
|
46
|
-
const tokensCache = new Map();
|
|
47
|
-
// Subscribers for async token updates
|
|
48
|
-
const subscribers = new Map();
|
|
49
|
-
const getTokensCacheKey = (code, language) => {
|
|
50
|
-
const start = code.slice(0, 100);
|
|
51
|
-
const end = code.length > 100 ? code.slice(-100) : "";
|
|
52
|
-
return `${language}:${code.length}:${start}:${end}`;
|
|
53
|
-
};
|
|
54
|
-
const getHighlighter = (language) => {
|
|
55
|
-
const cached = highlighterCache.get(language);
|
|
56
|
-
if (cached) {
|
|
57
|
-
return cached;
|
|
58
|
-
}
|
|
59
|
-
const highlighterPromise = createHighlighter({
|
|
60
|
-
langs: [language],
|
|
61
|
-
themes: ["github-light", "github-dark"],
|
|
62
|
-
});
|
|
63
|
-
highlighterCache.set(language, highlighterPromise);
|
|
64
|
-
return highlighterPromise;
|
|
65
|
-
};
|
|
66
|
-
// Create raw tokens for immediate display while highlighting loads
|
|
67
|
-
const createRawTokens = (code) => ({
|
|
68
|
-
bg: "transparent",
|
|
69
|
-
fg: "inherit",
|
|
70
|
-
tokens: code.split("\n").map((line) => line === ""
|
|
71
|
-
? []
|
|
72
|
-
: [
|
|
73
|
-
{
|
|
74
|
-
color: "inherit",
|
|
75
|
-
content: line,
|
|
76
|
-
},
|
|
77
|
-
]),
|
|
78
|
-
});
|
|
79
|
-
// Synchronous highlight with callback for async results
|
|
80
|
-
export const highlightCode = (code, language,
|
|
81
|
-
// oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-callbacks)
|
|
82
|
-
callback) => {
|
|
83
|
-
const tokensCacheKey = getTokensCacheKey(code, language);
|
|
84
|
-
// Return cached result if available
|
|
85
|
-
const cached = tokensCache.get(tokensCacheKey);
|
|
86
|
-
if (cached) {
|
|
87
|
-
return cached;
|
|
88
|
-
}
|
|
89
|
-
// Subscribe callback if provided
|
|
90
|
-
if (callback) {
|
|
91
|
-
if (!subscribers.has(tokensCacheKey)) {
|
|
92
|
-
subscribers.set(tokensCacheKey, new Set());
|
|
93
|
-
}
|
|
94
|
-
subscribers.get(tokensCacheKey)?.add(callback);
|
|
95
|
-
}
|
|
96
|
-
// Start highlighting in background - fire-and-forget async pattern
|
|
97
|
-
getHighlighter(language)
|
|
98
|
-
// oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then)
|
|
99
|
-
.then((highlighter) => {
|
|
100
|
-
const availableLangs = highlighter.getLoadedLanguages();
|
|
101
|
-
const langToUse = availableLangs.includes(language) ? language : "text";
|
|
102
|
-
const result = highlighter.codeToTokens(code, {
|
|
103
|
-
lang: langToUse,
|
|
104
|
-
themes: {
|
|
105
|
-
dark: "github-dark",
|
|
106
|
-
light: "github-light",
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
const tokenized = {
|
|
110
|
-
bg: result.bg ?? "transparent",
|
|
111
|
-
fg: result.fg ?? "inherit",
|
|
112
|
-
tokens: result.tokens,
|
|
113
|
-
};
|
|
114
|
-
// Cache the result
|
|
115
|
-
tokensCache.set(tokensCacheKey, tokenized);
|
|
116
|
-
// Notify all subscribers
|
|
117
|
-
const subs = subscribers.get(tokensCacheKey);
|
|
118
|
-
if (subs) {
|
|
119
|
-
for (const sub of subs) {
|
|
120
|
-
sub(tokenized);
|
|
121
|
-
}
|
|
122
|
-
subscribers.delete(tokensCacheKey);
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
// oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then), eslint-plugin-promise(prefer-await-to-callbacks)
|
|
126
|
-
.catch((error) => {
|
|
127
|
-
console.error("Failed to highlight code:", error);
|
|
128
|
-
subscribers.delete(tokensCacheKey);
|
|
129
|
-
});
|
|
130
|
-
return null;
|
|
131
|
-
};
|
|
132
|
-
const CodeBlockBody = memo(({ tokenized, showLineNumbers, className, }) => {
|
|
133
|
-
const preStyle = useMemo(() => ({
|
|
134
|
-
backgroundColor: tokenized.bg,
|
|
135
|
-
color: tokenized.fg,
|
|
136
|
-
}), [tokenized.bg, tokenized.fg]);
|
|
137
|
-
const keyedLines = useMemo(() => addKeysToTokens(tokenized.tokens), [tokenized.tokens]);
|
|
138
|
-
return (_jsx("pre", { className: cn("dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm", className), style: preStyle, children: _jsx("code", { className: cn("font-mono text-sm", showLineNumbers &&
|
|
139
|
-
"[counter-increment:line_0] [counter-reset:line]"), children: keyedLines.map((keyedLine) => (_jsx(LineSpan, { keyedLine: keyedLine, showLineNumbers: showLineNumbers }, keyedLine.key))) }) }));
|
|
140
|
-
}, (prevProps, nextProps) => prevProps.tokenized === nextProps.tokenized &&
|
|
141
|
-
prevProps.showLineNumbers === nextProps.showLineNumbers &&
|
|
142
|
-
prevProps.className === nextProps.className);
|
|
143
|
-
CodeBlockBody.displayName = "CodeBlockBody";
|
|
144
|
-
export const CodeBlockContainer = ({ className, language, style, ...props }) => (_jsx("div", { className: cn("group relative w-full overflow-hidden rounded-md border bg-background text-foreground", className), "data-language": language, style: {
|
|
145
|
-
containIntrinsicSize: "auto 200px",
|
|
146
|
-
contentVisibility: "auto",
|
|
147
|
-
...style,
|
|
148
|
-
}, ...props }));
|
|
149
|
-
export const CodeBlockHeader = ({ children, className, ...props }) => (_jsx("div", { className: cn("flex items-center justify-between border-b bg-muted/80 px-3 py-2 text-muted-foreground text-xs", className), ...props, children: children }));
|
|
150
|
-
export const CodeBlockTitle = ({ children, className, ...props }) => (_jsx("div", { className: cn("flex items-center gap-2", className), ...props, children: children }));
|
|
151
|
-
export const CodeBlockFilename = ({ children, className, ...props }) => (_jsx("span", { className: cn("font-mono", className), ...props, children: children }));
|
|
152
|
-
export const CodeBlockActions = ({ children, className, ...props }) => (_jsx("div", { className: cn("-my-1 -mr-1 flex items-center gap-2", className), ...props, children: children }));
|
|
153
|
-
export const CodeBlockContent = ({ code, language, showLineNumbers = false, }) => {
|
|
154
|
-
// Memoized raw tokens for immediate display
|
|
155
|
-
const rawTokens = useMemo(() => createRawTokens(code), [code]);
|
|
156
|
-
// Synchronous cache lookup — avoids setState in effect for cached results
|
|
157
|
-
const syncTokens = useMemo(() => highlightCode(code, language) ?? rawTokens, [code, language, rawTokens]);
|
|
158
|
-
// Async highlighting result (populated after shiki loads)
|
|
159
|
-
const [asyncTokens, setAsyncTokens] = useState(null);
|
|
160
|
-
const asyncKeyRef = useRef({ code, language });
|
|
161
|
-
// Invalidate stale async tokens synchronously during render
|
|
162
|
-
if (asyncKeyRef.current.code !== code ||
|
|
163
|
-
asyncKeyRef.current.language !== language) {
|
|
164
|
-
asyncKeyRef.current = { code, language };
|
|
165
|
-
setAsyncTokens(null);
|
|
166
|
-
}
|
|
167
|
-
useEffect(() => {
|
|
168
|
-
let cancelled = false;
|
|
169
|
-
highlightCode(code, language, (result) => {
|
|
170
|
-
if (!cancelled) {
|
|
171
|
-
setAsyncTokens(result);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
return () => {
|
|
175
|
-
cancelled = true;
|
|
176
|
-
};
|
|
177
|
-
}, [code, language]);
|
|
178
|
-
const tokenized = asyncTokens ?? syncTokens;
|
|
179
|
-
return (_jsx("div", { className: "relative overflow-auto", children: _jsx(CodeBlockBody, { showLineNumbers: showLineNumbers, tokenized: tokenized }) }));
|
|
180
|
-
};
|
|
181
|
-
export const CodeBlock = ({ code, language, showLineNumbers = false, className, children, ...props }) => {
|
|
182
|
-
const contextValue = useMemo(() => ({ code }), [code]);
|
|
183
|
-
return (_jsx(CodeBlockContext.Provider, { value: contextValue, children: _jsxs(CodeBlockContainer, { className: className, language: language, ...props, children: [children, _jsx(CodeBlockContent, { code: code, language: language, showLineNumbers: showLineNumbers })] }) }));
|
|
184
|
-
};
|
|
185
|
-
export const CodeBlockCopyButton = ({ onCopy, onError, timeout = 2000, children, className, ...props }) => {
|
|
186
|
-
const [isCopied, setIsCopied] = useState(false);
|
|
187
|
-
const timeoutRef = useRef(0);
|
|
188
|
-
const { code } = useContext(CodeBlockContext);
|
|
189
|
-
const copyToClipboard = useCallback(async () => {
|
|
190
|
-
if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
|
|
191
|
-
onError?.(new Error("Clipboard API not available"));
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
try {
|
|
195
|
-
if (!isCopied) {
|
|
196
|
-
await navigator.clipboard.writeText(code);
|
|
197
|
-
setIsCopied(true);
|
|
198
|
-
onCopy?.();
|
|
199
|
-
timeoutRef.current = window.setTimeout(() => setIsCopied(false), timeout);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
catch (error) {
|
|
203
|
-
onError?.(error);
|
|
204
|
-
}
|
|
205
|
-
}, [code, onCopy, onError, timeout, isCopied]);
|
|
206
|
-
useEffect(() => () => {
|
|
207
|
-
window.clearTimeout(timeoutRef.current);
|
|
208
|
-
}, []);
|
|
209
|
-
const Icon = isCopied ? CheckIcon : CopyIcon;
|
|
210
|
-
return (_jsx(Button, { className: cn("shrink-0", className), onClick: copyToClipboard, size: "icon", variant: "ghost", ...props, children: children ?? _jsx(Icon, { size: 14 }) }));
|
|
211
|
-
};
|
|
212
|
-
export const CodeBlockLanguageSelector = (props) => _jsx(Select, { ...props });
|
|
213
|
-
export const CodeBlockLanguageSelectorTrigger = ({ className, ...props }) => (_jsx(SelectTrigger, { className: cn("h-7 border-none bg-transparent px-2 text-xs shadow-none", className), size: "sm", ...props }));
|
|
214
|
-
export const CodeBlockLanguageSelectorValue = (props) => _jsx(SelectValue, { ...props });
|
|
215
|
-
export const CodeBlockLanguageSelectorContent = ({ align = "end", ...props }) => (_jsx(SelectContent, { align: align, ...props }));
|
|
216
|
-
export const CodeBlockLanguageSelectorItem = (props) => _jsx(SelectItem, { ...props });
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Avatar } from "@chatsdk-dev/ui/components/avatar";
|
|
2
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
3
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@chatsdk-dev/ui/components/collapsible";
|
|
4
|
-
import { FileIcon } from "lucide-react";
|
|
5
|
-
import type { ComponentProps, HTMLAttributes } from "react";
|
|
6
|
-
export type CommitProps = ComponentProps<typeof Collapsible>;
|
|
7
|
-
export declare const Commit: ({ className, children, ...props }: CommitProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export type CommitHeaderProps = ComponentProps<typeof CollapsibleTrigger>;
|
|
9
|
-
export declare const CommitHeader: ({ className, children, ...props }: CommitHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export type CommitHashProps = HTMLAttributes<HTMLSpanElement>;
|
|
11
|
-
export declare const CommitHash: ({ className, children, ...props }: CommitHashProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export type CommitMessageProps = HTMLAttributes<HTMLSpanElement>;
|
|
13
|
-
export declare const CommitMessage: ({ className, children, ...props }: CommitMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export type CommitMetadataProps = HTMLAttributes<HTMLDivElement>;
|
|
15
|
-
export declare const CommitMetadata: ({ className, children, ...props }: CommitMetadataProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export type CommitSeparatorProps = HTMLAttributes<HTMLSpanElement>;
|
|
17
|
-
export declare const CommitSeparator: ({ className, children, ...props }: CommitSeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export type CommitInfoProps = HTMLAttributes<HTMLDivElement>;
|
|
19
|
-
export declare const CommitInfo: ({ className, children, ...props }: CommitInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export type CommitAuthorProps = HTMLAttributes<HTMLDivElement>;
|
|
21
|
-
export declare const CommitAuthor: ({ className, children, ...props }: CommitAuthorProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export type CommitAuthorAvatarProps = ComponentProps<typeof Avatar> & {
|
|
23
|
-
initials: string;
|
|
24
|
-
};
|
|
25
|
-
export declare const CommitAuthorAvatar: ({ initials, className, ...props }: CommitAuthorAvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export type CommitTimestampProps = HTMLAttributes<HTMLTimeElement> & {
|
|
27
|
-
date: Date;
|
|
28
|
-
};
|
|
29
|
-
export declare const CommitTimestamp: ({ date, className, children, ...props }: CommitTimestampProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
export type CommitActionsProps = HTMLAttributes<HTMLDivElement>;
|
|
31
|
-
export declare const CommitActions: ({ className, children, ...props }: CommitActionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export type CommitCopyButtonProps = ComponentProps<typeof Button> & {
|
|
33
|
-
hash: string;
|
|
34
|
-
onCopy?: () => void;
|
|
35
|
-
onError?: (error: Error) => void;
|
|
36
|
-
timeout?: number;
|
|
37
|
-
};
|
|
38
|
-
export declare const CommitCopyButton: ({ hash, onCopy, onError, timeout, children, className, ...props }: CommitCopyButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
export type CommitContentProps = ComponentProps<typeof CollapsibleContent>;
|
|
40
|
-
export declare const CommitContent: ({ className, children, ...props }: CommitContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
export type CommitFilesProps = HTMLAttributes<HTMLDivElement>;
|
|
42
|
-
export declare const CommitFiles: ({ className, children, ...props }: CommitFilesProps) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
export type CommitFileProps = HTMLAttributes<HTMLDivElement>;
|
|
44
|
-
export declare const CommitFile: ({ className, children, ...props }: CommitFileProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
export type CommitFileInfoProps = HTMLAttributes<HTMLDivElement>;
|
|
46
|
-
export declare const CommitFileInfo: ({ className, children, ...props }: CommitFileInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
-
export type CommitFileStatusProps = HTMLAttributes<HTMLSpanElement> & {
|
|
48
|
-
status: "added" | "modified" | "deleted" | "renamed";
|
|
49
|
-
};
|
|
50
|
-
export declare const CommitFileStatus: ({ status, className, children, ...props }: CommitFileStatusProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
-
export type CommitFileIconProps = ComponentProps<typeof FileIcon>;
|
|
52
|
-
export declare const CommitFileIcon: ({ className, ...props }: CommitFileIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
-
export type CommitFilePathProps = HTMLAttributes<HTMLSpanElement>;
|
|
54
|
-
export declare const CommitFilePath: ({ className, children, ...props }: CommitFilePathProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
|
-
export type CommitFileChangesProps = HTMLAttributes<HTMLDivElement>;
|
|
56
|
-
export declare const CommitFileChanges: ({ className, children, ...props }: CommitFileChangesProps) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
-
export type CommitFileAdditionsProps = HTMLAttributes<HTMLSpanElement> & {
|
|
58
|
-
count: number;
|
|
59
|
-
};
|
|
60
|
-
export declare const CommitFileAdditions: ({ count, className, children, ...props }: CommitFileAdditionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
61
|
-
export type CommitFileDeletionsProps = HTMLAttributes<HTMLSpanElement> & {
|
|
62
|
-
count: number;
|
|
63
|
-
};
|
|
64
|
-
export declare const CommitFileDeletions: ({ count, className, children, ...props }: CommitFileDeletionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
65
|
-
//# sourceMappingURL=commit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/molecules/commit.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAkB,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAGL,QAAQ,EAIT,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5D,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;AAE7D,eAAO,MAAM,MAAM,GAAI,mCAAmC,WAAW,4CAOpE,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAA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CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;AAElE,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAIrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEpE,eAAO,MAAM,iBAAiB,GAAI,mCAI/B,sBAAsB,4CAUxB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,eAAe,CAAC,GAAG;IACvE,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,0CAKjC,wBAAwB,mDAkB1B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,eAAe,CAAC,GAAG;IACvE,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,0CAKjC,wBAAwB,mDAkB1B,CAAC"}
|
package/dist/molecules/commit.js
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Avatar, AvatarFallback } from "@chatsdk-dev/ui/components/avatar";
|
|
4
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
5
|
-
import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@chatsdk-dev/ui/components/collapsible";
|
|
6
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
7
|
-
import { CheckIcon, CopyIcon, FileIcon, GitCommitIcon, MinusIcon, PlusIcon, } from "lucide-react";
|
|
8
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
|
-
export const Commit = ({ className, children, ...props }) => (_jsx(Collapsible, { className: cn("rounded-lg border bg-background", className), ...props, children: children }));
|
|
10
|
-
export const CommitHeader = ({ className, children, ...props }) => (_jsx(CollapsibleTrigger, { render: () => (_jsx("div", { className: cn("group flex cursor-pointer items-center justify-between gap-4 p-3 text-left transition-colors hover:opacity-80", className), children: children })) }));
|
|
11
|
-
export const CommitHash = ({ className, children, ...props }) => (_jsxs("span", { className: cn("font-mono text-xs", className), ...props, children: [_jsx(GitCommitIcon, { className: "mr-1 inline-block size-3" }), children] }));
|
|
12
|
-
export const CommitMessage = ({ className, children, ...props }) => (_jsx("span", { className: cn("font-medium text-sm", className), ...props, children: children }));
|
|
13
|
-
export const CommitMetadata = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-2 text-muted-foreground text-xs", className), ...props, children: children }));
|
|
14
|
-
export const CommitSeparator = ({ className, children, ...props }) => (_jsx("span", { className: className, ...props, children: children ?? "•" }));
|
|
15
|
-
export const CommitInfo = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex flex-1 flex-col", className), ...props, children: children }));
|
|
16
|
-
export const CommitAuthor = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center", className), ...props, children: children }));
|
|
17
|
-
export const CommitAuthorAvatar = ({ initials, className, ...props }) => (_jsx(Avatar, { className: cn("size-8", className), ...props, children: _jsx(AvatarFallback, { className: "text-xs", children: initials }) }));
|
|
18
|
-
const relativeTimeFormat = new Intl.RelativeTimeFormat("en", {
|
|
19
|
-
numeric: "auto",
|
|
20
|
-
});
|
|
21
|
-
const formatRelativeDate = (date) => {
|
|
22
|
-
const days = Math.round((date.getTime() - Date.now()) / (1000 * 60 * 60 * 24));
|
|
23
|
-
return relativeTimeFormat.format(days, "day");
|
|
24
|
-
};
|
|
25
|
-
export const CommitTimestamp = ({ date, className, children, ...props }) => {
|
|
26
|
-
const [formatted, setFormatted] = useState("");
|
|
27
|
-
const updateFormatted = useCallback(() => {
|
|
28
|
-
setFormatted(formatRelativeDate(date));
|
|
29
|
-
}, [date]);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
updateFormatted();
|
|
32
|
-
}, [updateFormatted]);
|
|
33
|
-
return (_jsx("time", { className: cn("text-xs", className), dateTime: date.toISOString(), ...props, children: children ?? formatted }));
|
|
34
|
-
};
|
|
35
|
-
const handleActionsClick = (e) => e.stopPropagation();
|
|
36
|
-
const handleActionsKeyDown = (e) => e.stopPropagation();
|
|
37
|
-
export const CommitActions = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-1", className), onClick: handleActionsClick, onKeyDown: handleActionsKeyDown, role: "group", ...props, children: children }));
|
|
38
|
-
export const CommitCopyButton = ({ hash, onCopy, onError, timeout = 2000, children, className, ...props }) => {
|
|
39
|
-
const [isCopied, setIsCopied] = useState(false);
|
|
40
|
-
const timeoutRef = useRef(0);
|
|
41
|
-
const copyToClipboard = useCallback(async () => {
|
|
42
|
-
if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
|
|
43
|
-
onError?.(new Error("Clipboard API not available"));
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
if (!isCopied) {
|
|
48
|
-
await navigator.clipboard.writeText(hash);
|
|
49
|
-
setIsCopied(true);
|
|
50
|
-
onCopy?.();
|
|
51
|
-
timeoutRef.current = window.setTimeout(() => setIsCopied(false), timeout);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
onError?.(error);
|
|
56
|
-
}
|
|
57
|
-
}, [hash, onCopy, onError, timeout, isCopied]);
|
|
58
|
-
useEffect(() => () => {
|
|
59
|
-
window.clearTimeout(timeoutRef.current);
|
|
60
|
-
}, []);
|
|
61
|
-
const Icon = isCopied ? CheckIcon : CopyIcon;
|
|
62
|
-
return (_jsx(Button, { className: cn("size-7 shrink-0", className), onClick: copyToClipboard, size: "icon", variant: "ghost", ...props, children: children ?? _jsx(Icon, { size: 14 }) }));
|
|
63
|
-
};
|
|
64
|
-
export const CommitContent = ({ className, children, ...props }) => (_jsx(CollapsibleContent, { className: cn("border-t p-3", className), ...props, children: children }));
|
|
65
|
-
export const CommitFiles = ({ className, children, ...props }) => (_jsx("div", { className: cn("space-y-1", className), ...props, children: children }));
|
|
66
|
-
export const CommitFile = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center justify-between gap-2 rounded px-2 py-1 text-sm hover:bg-muted/50", className), ...props, children: children }));
|
|
67
|
-
export const CommitFileInfo = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex min-w-0 items-center gap-2", className), ...props, children: children }));
|
|
68
|
-
const fileStatusStyles = {
|
|
69
|
-
added: "text-green-600 dark:text-green-400",
|
|
70
|
-
deleted: "text-red-600 dark:text-red-400",
|
|
71
|
-
modified: "text-yellow-600 dark:text-yellow-400",
|
|
72
|
-
renamed: "text-blue-600 dark:text-blue-400",
|
|
73
|
-
};
|
|
74
|
-
const fileStatusLabels = {
|
|
75
|
-
added: "A",
|
|
76
|
-
deleted: "D",
|
|
77
|
-
modified: "M",
|
|
78
|
-
renamed: "R",
|
|
79
|
-
};
|
|
80
|
-
export const CommitFileStatus = ({ status, className, children, ...props }) => (_jsx("span", { className: cn("font-medium font-mono text-xs", fileStatusStyles[status], className), ...props, children: children ?? fileStatusLabels[status] }));
|
|
81
|
-
export const CommitFileIcon = ({ className, ...props }) => (_jsx(FileIcon, { className: cn("size-3.5 shrink-0 text-muted-foreground", className), ...props }));
|
|
82
|
-
export const CommitFilePath = ({ className, children, ...props }) => (_jsx("span", { className: cn("truncate font-mono text-xs", className), ...props, children: children }));
|
|
83
|
-
export const CommitFileChanges = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex shrink-0 items-center gap-1 font-mono text-xs", className), ...props, children: children }));
|
|
84
|
-
export const CommitFileAdditions = ({ count, className, children, ...props }) => {
|
|
85
|
-
if (count <= 0) {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
return (_jsx("span", { className: cn("text-green-600 dark:text-green-400", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(PlusIcon, { className: "inline-block size-3" }), count] })) }));
|
|
89
|
-
};
|
|
90
|
-
export const CommitFileDeletions = ({ count, className, children, ...props }) => {
|
|
91
|
-
if (count <= 0) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
return (_jsx("span", { className: cn("text-red-600 dark:text-red-400", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(MinusIcon, { className: "inline-block size-3" }), count] })) }));
|
|
95
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Alert, AlertDescription } from "@chatsdk-dev/ui/components/alert";
|
|
2
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
3
|
-
import type { ToolUIPart } from "ai";
|
|
4
|
-
import type { ComponentProps, ReactNode } from "react";
|
|
5
|
-
type ToolUIPartApproval = {
|
|
6
|
-
id: string;
|
|
7
|
-
approved?: never;
|
|
8
|
-
reason?: never;
|
|
9
|
-
} | {
|
|
10
|
-
id: string;
|
|
11
|
-
approved: boolean;
|
|
12
|
-
reason?: string;
|
|
13
|
-
} | {
|
|
14
|
-
id: string;
|
|
15
|
-
approved: true;
|
|
16
|
-
reason?: string;
|
|
17
|
-
} | {
|
|
18
|
-
id: string;
|
|
19
|
-
approved: true;
|
|
20
|
-
reason?: string;
|
|
21
|
-
} | {
|
|
22
|
-
id: string;
|
|
23
|
-
approved: false;
|
|
24
|
-
reason?: string;
|
|
25
|
-
} | undefined;
|
|
26
|
-
export type ConfirmationProps = ComponentProps<typeof Alert> & {
|
|
27
|
-
approval?: ToolUIPartApproval;
|
|
28
|
-
state: ToolUIPart["state"];
|
|
29
|
-
};
|
|
30
|
-
export declare const Confirmation: ({ className, approval, state, ...props }: ConfirmationProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
31
|
-
export type ConfirmationTitleProps = ComponentProps<typeof AlertDescription>;
|
|
32
|
-
export declare const ConfirmationTitle: ({ className, ...props }: ConfirmationTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export interface ConfirmationRequestProps {
|
|
34
|
-
children?: ReactNode;
|
|
35
|
-
}
|
|
36
|
-
export declare const ConfirmationRequest: ({ children }: ConfirmationRequestProps) => ReactNode;
|
|
37
|
-
export interface ConfirmationAcceptedProps {
|
|
38
|
-
children?: ReactNode;
|
|
39
|
-
}
|
|
40
|
-
export declare const ConfirmationAccepted: ({ children, }: ConfirmationAcceptedProps) => ReactNode;
|
|
41
|
-
export interface ConfirmationRejectedProps {
|
|
42
|
-
children?: ReactNode;
|
|
43
|
-
}
|
|
44
|
-
export declare const ConfirmationRejected: ({ children, }: ConfirmationRejectedProps) => ReactNode;
|
|
45
|
-
export type ConfirmationActionsProps = ComponentProps<"div">;
|
|
46
|
-
export declare const ConfirmationActions: ({ className, ...props }: ConfirmationActionsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
47
|
-
export type ConfirmationActionProps = ComponentProps<typeof Button>;
|
|
48
|
-
export declare const ConfirmationAction: (props: ConfirmationActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
-
export {};
|
|
50
|
-
//# sourceMappingURL=confirmation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"confirmation.d.ts","sourceRoot":"","sources":["../../src/molecules/confirmation.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvD,KAAK,kBAAkB,GACnB;IACE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GACD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,IAAI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,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,4CAEhE,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Alert, AlertDescription } from "@chatsdk-dev/ui/components/alert";
|
|
4
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
5
|
-
import { cn } from "@chatsdk-dev/ui/lib/utils";
|
|
6
|
-
import { createContext, useContext, useMemo } from "react";
|
|
7
|
-
const ConfirmationContext = createContext(null);
|
|
8
|
-
const useConfirmation = () => {
|
|
9
|
-
const context = useContext(ConfirmationContext);
|
|
10
|
-
if (!context) {
|
|
11
|
-
throw new Error("Confirmation components must be used within Confirmation");
|
|
12
|
-
}
|
|
13
|
-
return context;
|
|
14
|
-
};
|
|
15
|
-
export const Confirmation = ({ className, approval, state, ...props }) => {
|
|
16
|
-
const contextValue = useMemo(() => ({ approval, state }), [approval, state]);
|
|
17
|
-
if (!approval || state === "input-streaming" || state === "input-available") {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
return (_jsx(ConfirmationContext.Provider, { value: contextValue, children: _jsx(Alert, { className: cn("flex flex-col gap-2", className), ...props }) }));
|
|
21
|
-
};
|
|
22
|
-
export const ConfirmationTitle = ({ className, ...props }) => (_jsx(AlertDescription, { className: cn("inline", className), ...props }));
|
|
23
|
-
export const ConfirmationRequest = ({ children }) => {
|
|
24
|
-
const { state } = useConfirmation();
|
|
25
|
-
// Only show when approval is requested
|
|
26
|
-
if (state !== "approval-requested") {
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
return children;
|
|
30
|
-
};
|
|
31
|
-
export const ConfirmationAccepted = ({ children, }) => {
|
|
32
|
-
const { approval, state } = useConfirmation();
|
|
33
|
-
// Only show when approved and in response states
|
|
34
|
-
if (!approval?.approved ||
|
|
35
|
-
(state !== "approval-responded" &&
|
|
36
|
-
state !== "output-denied" &&
|
|
37
|
-
state !== "output-available")) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
return children;
|
|
41
|
-
};
|
|
42
|
-
export const ConfirmationRejected = ({ children, }) => {
|
|
43
|
-
const { approval, state } = useConfirmation();
|
|
44
|
-
// Only show when rejected and in response states
|
|
45
|
-
if (approval?.approved !== false ||
|
|
46
|
-
(state !== "approval-responded" &&
|
|
47
|
-
state !== "output-denied" &&
|
|
48
|
-
state !== "output-available")) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
return children;
|
|
52
|
-
};
|
|
53
|
-
export const ConfirmationActions = ({ className, ...props }) => {
|
|
54
|
-
const { state } = useConfirmation();
|
|
55
|
-
// Only show when approval is requested
|
|
56
|
-
if (state !== "approval-requested") {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
return (_jsx("div", { className: cn("flex items-center justify-end gap-2 self-end", className), ...props }));
|
|
60
|
-
};
|
|
61
|
-
export const ConfirmationAction = (props) => (_jsx(Button, { className: "h-8 px-3 text-sm", type: "button", ...props }));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/molecules/connection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,eAAO,MAAM,UAAU,EAAE,uBAuBxB,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
const HALF = 0.5;
|
|
3
|
-
export const Connection = ({ fromX, fromY, toX, toY, }) => (_jsxs("g", { children: [_jsx("path", { className: "animated", d: `M${fromX},${fromY} C ${fromX + (toX - fromX) * HALF},${fromY} ${fromX + (toX - fromX) * HALF},${toY} ${toX},${toY}`, fill: "none", stroke: "var(--color-ring)", strokeWidth: 1 }), _jsx("circle", { cx: toX, cy: toY, fill: "#fff", r: 3, stroke: "var(--color-ring)", strokeWidth: 1 })] }));
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Button } from "@chatsdk-dev/ui/components/button";
|
|
2
|
-
import { HoverCard, HoverCardContent } from "@chatsdk-dev/ui/components/hover-card";
|
|
3
|
-
import type { LanguageModelUsage } from "ai";
|
|
4
|
-
import type { ComponentProps } from "react";
|
|
5
|
-
type ModelId = string;
|
|
6
|
-
interface ContextSchema {
|
|
7
|
-
usedTokens: number;
|
|
8
|
-
maxTokens: number;
|
|
9
|
-
usage?: LanguageModelUsage;
|
|
10
|
-
modelId?: ModelId;
|
|
11
|
-
}
|
|
12
|
-
export type ContextProps = ComponentProps<typeof HoverCard> & ContextSchema;
|
|
13
|
-
export declare const Context: ({ usedTokens, maxTokens, usage, modelId, ...props }: ContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export type ContextTriggerProps = ComponentProps<typeof Button>;
|
|
15
|
-
export declare const ContextTrigger: ({ children, ...props }: ContextTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export type ContextContentProps = ComponentProps<typeof HoverCardContent>;
|
|
17
|
-
export declare const ContextContent: ({ className, ...props }: ContextContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export type ContextContentHeaderProps = ComponentProps<"div">;
|
|
19
|
-
export declare const ContextContentHeader: ({ children, className, ...props }: ContextContentHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export type ContextContentBodyProps = ComponentProps<"div">;
|
|
21
|
-
export declare const ContextContentBody: ({ children, className, ...props }: ContextContentBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export type ContextContentFooterProps = ComponentProps<"div">;
|
|
23
|
-
export declare const ContextContentFooter: ({ children, className, ...props }: ContextContentFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export type ContextInputUsageProps = ComponentProps<"div">;
|
|
25
|
-
export declare const ContextInputUsage: ({ className, children, ...props }: ContextInputUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
|
|
26
|
-
export type ContextOutputUsageProps = ComponentProps<"div">;
|
|
27
|
-
export declare const ContextOutputUsage: ({ className, children, ...props }: ContextOutputUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
|
|
28
|
-
export type ContextReasoningUsageProps = ComponentProps<"div">;
|
|
29
|
-
export declare const ContextReasoningUsage: ({ className, children, ...props }: ContextReasoningUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
|
|
30
|
-
export type ContextCacheUsageProps = ComponentProps<"div">;
|
|
31
|
-
export declare const ContextCacheUsage: ({ className, children, ...props }: ContextCacheUsageProps) => string | number | bigint | true | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null;
|
|
32
|
-
export {};
|
|
33
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/molecules/context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,SAAS,EACT,gBAAgB,EAEjB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,KAAK,EAAE,kBA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