@dungle-scrubs/admin-ui-soft 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GUIDE.md +110 -0
- package/LICENSE +21 -0
- package/README.md +36 -2
- package/THIRD-PARTY-NOTICES.md +25 -0
- package/UPSTREAM-VENDORED-CHANGES.md +317 -0
- package/VENDORED-CHANGES.md +60 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/ai/compositions/agent-console/agent-console.d.ts +109 -0
- package/dist/ai/compositions/agent-console/agent-console.js +644 -0
- package/dist/ai/compositions/attention-feed/attention-feed.d.ts +127 -0
- package/dist/ai/compositions/attention-feed/attention-feed.js +626 -0
- package/dist/ai/compositions/conversation-browser/conversation-browser.d.ts +126 -0
- package/dist/ai/compositions/conversation-browser/conversation-browser.js +364 -0
- package/dist/ai/compositions/redaction-marker/redaction-marker.d.ts +42 -0
- package/dist/ai/compositions/redaction-marker/redaction-marker.js +202 -0
- package/dist/ai/compositions/run-inspector/json-view.js +164 -0
- package/dist/ai/compositions/run-inspector/run-inspector.d.ts +66 -0
- package/dist/ai/compositions/run-inspector/run-inspector.js +703 -0
- package/dist/ai/compositions/run-inspector/run-model.js +155 -0
- package/dist/ai/compositions/tool-approval/json-args.js +54 -0
- package/dist/ai/compositions/tool-approval/tool-approval.d.ts +57 -0
- package/dist/ai/compositions/tool-approval/tool-approval.js +331 -0
- package/dist/ai/compositions/tool-call-row/tool-call-row.js +74 -0
- package/dist/ai/compositions/transcript-viewer/to-thread-messages.js +65 -0
- package/dist/ai/compositions/transcript-viewer/transcript-viewer.d.ts +63 -0
- package/dist/ai/compositions/transcript-viewer/transcript-viewer.js +471 -0
- package/dist/ai/compositions/usage-meter/usage-format.js +107 -0
- package/dist/ai/compositions/usage-meter/usage-meter.d.ts +32 -0
- package/dist/ai/compositions/usage-meter/usage-meter.js +258 -0
- package/dist/ai/testing/mock-clock.d.ts +31 -0
- package/dist/ai/testing/mock-clock.js +66 -0
- package/dist/ai/testing/mock-reply.d.ts +70 -0
- package/dist/ai/testing/mock-reply.js +100 -0
- package/dist/ai/testing/mock-runtime.d.ts +86 -0
- package/dist/ai/testing/mock-runtime.js +384 -0
- package/dist/ai/types.d.ts +323 -0
- package/dist/ai.css +1088 -0
- package/dist/ai.d.ts +160 -0
- package/dist/ai.js +158 -0
- package/dist/components/assistant-ui/elements/activity-graph.d.ts +14 -0
- package/dist/components/assistant-ui/elements/activity-graph.js +69 -0
- package/dist/components/assistant-ui/elements/agent-card.d.ts +21 -0
- package/dist/components/assistant-ui/elements/agent-card.js +75 -0
- package/dist/components/assistant-ui/elements/agent-handoff.d.ts +13 -0
- package/dist/components/assistant-ui/elements/agent-handoff.js +47 -0
- package/dist/components/assistant-ui/elements/agent-plan.d.ts +16 -0
- package/dist/components/assistant-ui/elements/agent-plan.js +93 -0
- package/dist/components/assistant-ui/elements/agent-status.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/agent-status.aui.js +161 -0
- package/dist/components/assistant-ui/elements/agent-status.d.ts +17 -0
- package/dist/components/assistant-ui/elements/agent-status.js +47 -0
- package/dist/components/assistant-ui/elements/approval-card.d.ts +31 -0
- package/dist/components/assistant-ui/elements/approval-card.js +99 -0
- package/dist/components/assistant-ui/elements/artifact-card.d.ts +12 -0
- package/dist/components/assistant-ui/elements/artifact-card.js +47 -0
- package/dist/components/assistant-ui/elements/assistant-modal.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/assistant-modal.aui.js +276 -0
- package/dist/components/assistant-ui/elements/assistant-sidebar.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/assistant-sidebar.aui.js +18 -0
- package/dist/components/assistant-ui/elements/attachment.aui.d.ts +9 -0
- package/dist/components/assistant-ui/elements/attachment.aui.js +143 -0
- package/dist/components/assistant-ui/elements/background-inbox.d.ts +18 -0
- package/dist/components/assistant-ui/elements/background-inbox.js +65 -0
- package/dist/components/assistant-ui/elements/canvas-split.d.ts +25 -0
- package/dist/components/assistant-ui/elements/canvas-split.js +106 -0
- package/dist/components/assistant-ui/elements/chart.d.ts +19 -0
- package/dist/components/assistant-ui/elements/chart.js +105 -0
- package/dist/components/assistant-ui/elements/chat-panel.d.ts +15 -0
- package/dist/components/assistant-ui/elements/chat-panel.js +82 -0
- package/dist/components/assistant-ui/elements/checkpoint-history.d.ts +17 -0
- package/dist/components/assistant-ui/elements/checkpoint-history.js +60 -0
- package/dist/components/assistant-ui/elements/code-diff.d.ts +18 -0
- package/dist/components/assistant-ui/elements/code-diff.js +89 -0
- package/dist/components/assistant-ui/elements/code-runner.d.ts +15 -0
- package/dist/components/assistant-ui/elements/code-runner.js +108 -0
- package/dist/components/assistant-ui/elements/command-palette.d.ts +20 -0
- package/dist/components/assistant-ui/elements/command-palette.js +129 -0
- package/dist/components/assistant-ui/elements/comparison-card.d.ts +18 -0
- package/dist/components/assistant-ui/elements/comparison-card.js +58 -0
- package/dist/components/assistant-ui/elements/composer-trigger-popover.aui.d.ts +51 -0
- package/dist/components/assistant-ui/elements/composer-trigger-popover.aui.js +104 -0
- package/dist/components/assistant-ui/elements/composer.d.ts +91 -0
- package/dist/components/assistant-ui/elements/composer.js +416 -0
- package/dist/components/assistant-ui/elements/computer-use.d.ts +19 -0
- package/dist/components/assistant-ui/elements/computer-use.js +84 -0
- package/dist/components/assistant-ui/elements/confidence-marker.d.ts +20 -0
- package/dist/components/assistant-ui/elements/confidence-marker.js +58 -0
- package/dist/components/assistant-ui/elements/connection-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/connection-state.js +59 -0
- package/dist/components/assistant-ui/elements/context-breakdown.d.ts +15 -0
- package/dist/components/assistant-ui/elements/context-breakdown.js +91 -0
- package/dist/components/assistant-ui/elements/context-display.aui.d.ts +25 -0
- package/dist/components/assistant-ui/elements/context-display.aui.js +26 -0
- package/dist/components/assistant-ui/elements/context-display.d.ts +43 -0
- package/dist/components/assistant-ui/elements/context-display.js +300 -0
- package/dist/components/assistant-ui/elements/conversation-map.aui.d.ts +9 -0
- package/dist/components/assistant-ui/elements/conversation-map.aui.js +177 -0
- package/dist/components/assistant-ui/elements/conversation-map.d.ts +19 -0
- package/dist/components/assistant-ui/elements/conversation-map.js +84 -0
- package/dist/components/assistant-ui/elements/conversation-search.d.ts +20 -0
- package/dist/components/assistant-ui/elements/conversation-search.js +75 -0
- package/dist/components/assistant-ui/elements/cost-meter.d.ts +19 -0
- package/dist/components/assistant-ui/elements/cost-meter.js +76 -0
- package/dist/components/assistant-ui/elements/data-table.d.ts +72 -0
- package/dist/components/assistant-ui/elements/data-table.js +368 -0
- package/dist/components/assistant-ui/elements/day-separator.d.ts +16 -0
- package/dist/components/assistant-ui/elements/day-separator.js +44 -0
- package/dist/components/assistant-ui/elements/diagram.d.ts +15 -0
- package/dist/components/assistant-ui/elements/diagram.js +65 -0
- package/dist/components/assistant-ui/elements/directive-text.aui.d.ts +11 -0
- package/dist/components/assistant-ui/elements/directive-text.aui.js +18 -0
- package/dist/components/assistant-ui/elements/directive-text.d.ts +32 -0
- package/dist/components/assistant-ui/elements/directive-text.js +35 -0
- package/dist/components/assistant-ui/elements/document-reference.d.ts +17 -0
- package/dist/components/assistant-ui/elements/document-reference.js +62 -0
- package/dist/components/assistant-ui/elements/draft-restore.d.ts +12 -0
- package/dist/components/assistant-ui/elements/draft-restore.js +43 -0
- package/dist/components/assistant-ui/elements/edit-message.d.ts +15 -0
- package/dist/components/assistant-ui/elements/edit-message.js +63 -0
- package/dist/components/assistant-ui/elements/elicitation-form.d.ts +23 -0
- package/dist/components/assistant-ui/elements/elicitation-form.js +112 -0
- package/dist/components/assistant-ui/elements/empty-state.d.ts +16 -0
- package/dist/components/assistant-ui/elements/empty-state.js +71 -0
- package/dist/components/assistant-ui/elements/error-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/error-state.js +52 -0
- package/dist/components/assistant-ui/elements/feedback-dialog.d.ts +15 -0
- package/dist/components/assistant-ui/elements/feedback-dialog.js +77 -0
- package/dist/components/assistant-ui/elements/file-tree.d.ts +20 -0
- package/dist/components/assistant-ui/elements/file-tree.js +74 -0
- package/dist/components/assistant-ui/elements/file.d.ts +52 -0
- package/dist/components/assistant-ui/elements/file.js +222 -0
- package/dist/components/assistant-ui/elements/flow-graph.d.ts +23 -0
- package/dist/components/assistant-ui/elements/flow-graph.js +72 -0
- package/dist/components/assistant-ui/elements/follow-up-suggestions.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/follow-up-suggestions.aui.js +30 -0
- package/dist/components/assistant-ui/elements/generative-ui.d.ts +8 -0
- package/dist/components/assistant-ui/elements/generative-ui.js +27 -0
- package/dist/components/assistant-ui/elements/geo-map.d.ts +29 -0
- package/dist/components/assistant-ui/elements/geo-map.js +190 -0
- package/dist/components/assistant-ui/elements/guardrail-notice.d.ts +15 -0
- package/dist/components/assistant-ui/elements/guardrail-notice.js +59 -0
- package/dist/components/assistant-ui/elements/heat-graph.d.ts +9 -0
- package/dist/components/assistant-ui/elements/heat-graph.js +90 -0
- package/dist/components/assistant-ui/elements/image-gallery.d.ts +22 -0
- package/dist/components/assistant-ui/elements/image-gallery.js +192 -0
- package/dist/components/assistant-ui/elements/image-generation.d.ts +11 -0
- package/dist/components/assistant-ui/elements/image-generation.js +64 -0
- package/dist/components/assistant-ui/elements/image.d.ts +59 -0
- package/dist/components/assistant-ui/elements/image.js +416 -0
- package/dist/components/assistant-ui/elements/inline-citation.d.ts +23 -0
- package/dist/components/assistant-ui/elements/inline-citation.js +90 -0
- package/dist/components/assistant-ui/elements/job-progress.d.ts +25 -0
- package/dist/components/assistant-ui/elements/job-progress.js +102 -0
- package/dist/components/assistant-ui/elements/launcher-bubble.d.ts +15 -0
- package/dist/components/assistant-ui/elements/launcher-bubble.js +71 -0
- package/dist/components/assistant-ui/elements/link-preview.d.ts +17 -0
- package/dist/components/assistant-ui/elements/link-preview.js +77 -0
- package/dist/components/assistant-ui/elements/loading-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/loading-state.js +33 -0
- package/dist/components/assistant-ui/elements/logos.d.ts +10 -0
- package/dist/components/assistant-ui/elements/logos.js +63 -0
- package/dist/components/assistant-ui/elements/map-answer.d.ts +19 -0
- package/dist/components/assistant-ui/elements/map-answer.js +120 -0
- package/dist/components/assistant-ui/elements/markdown-text.d.ts +11 -0
- package/dist/components/assistant-ui/elements/markdown-text.js +152 -0
- package/dist/components/assistant-ui/elements/math-block.d.ts +25 -0
- package/dist/components/assistant-ui/elements/math-block.js +60 -0
- package/dist/components/assistant-ui/elements/mcp-config.aui.d.ts +28 -0
- package/dist/components/assistant-ui/elements/mcp-config.aui.js +380 -0
- package/dist/components/assistant-ui/elements/mcp-server-panel.d.ts +20 -0
- package/dist/components/assistant-ui/elements/mcp-server-panel.js +114 -0
- package/dist/components/assistant-ui/elements/media-player.d.ts +21 -0
- package/dist/components/assistant-ui/elements/media-player.js +302 -0
- package/dist/components/assistant-ui/elements/memory-chips.d.ts +16 -0
- package/dist/components/assistant-ui/elements/memory-chips.js +44 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.aui.d.ts +14 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.aui.js +43 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.d.ts +20 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.js +258 -0
- package/dist/components/assistant-ui/elements/message-actions.d.ts +17 -0
- package/dist/components/assistant-ui/elements/message-actions.js +57 -0
- package/dist/components/assistant-ui/elements/message-attachment.d.ts +18 -0
- package/dist/components/assistant-ui/elements/message-attachment.js +58 -0
- package/dist/components/assistant-ui/elements/message-branches.d.ts +12 -0
- package/dist/components/assistant-ui/elements/message-branches.js +55 -0
- package/dist/components/assistant-ui/elements/message-pair.d.ts +16 -0
- package/dist/components/assistant-ui/elements/message-pair.js +63 -0
- package/dist/components/assistant-ui/elements/message-queue.d.ts +15 -0
- package/dist/components/assistant-ui/elements/message-queue.js +70 -0
- package/dist/components/assistant-ui/elements/message-timing.aui.d.ts +30 -0
- package/dist/components/assistant-ui/elements/message-timing.aui.js +98 -0
- package/dist/components/assistant-ui/elements/message-timing.d.ts +14 -0
- package/dist/components/assistant-ui/elements/message-timing.js +26 -0
- package/dist/components/assistant-ui/elements/mobile-composer.d.ts +18 -0
- package/dist/components/assistant-ui/elements/mobile-composer.js +76 -0
- package/dist/components/assistant-ui/elements/model-picker.d.ts +19 -0
- package/dist/components/assistant-ui/elements/model-picker.js +68 -0
- package/dist/components/assistant-ui/elements/model-selector.aui.d.ts +23 -0
- package/dist/components/assistant-ui/elements/model-selector.aui.js +79 -0
- package/dist/components/assistant-ui/elements/model-selector.d.ts +130 -0
- package/dist/components/assistant-ui/elements/model-selector.js +399 -0
- package/dist/components/assistant-ui/elements/number-ticker.d.ts +10 -0
- package/dist/components/assistant-ui/elements/number-ticker.js +41 -0
- package/dist/components/assistant-ui/elements/onboarding.d.ts +17 -0
- package/dist/components/assistant-ui/elements/onboarding.js +69 -0
- package/dist/components/assistant-ui/elements/option-list.d.ts +39 -0
- package/dist/components/assistant-ui/elements/option-list.js +176 -0
- package/dist/components/assistant-ui/elements/permission-grant.d.ts +14 -0
- package/dist/components/assistant-ui/elements/permission-grant.js +84 -0
- package/dist/components/assistant-ui/elements/prompt-library.d.ts +20 -0
- package/dist/components/assistant-ui/elements/prompt-library.js +121 -0
- package/dist/components/assistant-ui/elements/question-flow.d.ts +24 -0
- package/dist/components/assistant-ui/elements/question-flow.js +180 -0
- package/dist/components/assistant-ui/elements/quota-banner.d.ts +14 -0
- package/dist/components/assistant-ui/elements/quota-banner.js +68 -0
- package/dist/components/assistant-ui/elements/quote-reply.d.ts +20 -0
- package/dist/components/assistant-ui/elements/quote-reply.js +66 -0
- package/dist/components/assistant-ui/elements/quote.aui.d.ts +61 -0
- package/dist/components/assistant-ui/elements/quote.aui.js +170 -0
- package/dist/components/assistant-ui/elements/read-aloud.d.ts +16 -0
- package/dist/components/assistant-ui/elements/read-aloud.js +66 -0
- package/dist/components/assistant-ui/elements/reasoning-effort.d.ts +17 -0
- package/dist/components/assistant-ui/elements/reasoning-effort.js +67 -0
- package/dist/components/assistant-ui/elements/reasoning-panel.d.ts +20 -0
- package/dist/components/assistant-ui/elements/reasoning-panel.js +60 -0
- package/dist/components/assistant-ui/elements/reasoning.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/reasoning.aui.js +70 -0
- package/dist/components/assistant-ui/elements/reasoning.d.ts +38 -0
- package/dist/components/assistant-ui/elements/reasoning.js +194 -0
- package/dist/components/assistant-ui/elements/recommendation-card.d.ts +16 -0
- package/dist/components/assistant-ui/elements/recommendation-card.js +65 -0
- package/dist/components/assistant-ui/elements/regenerate-menu.d.ts +18 -0
- package/dist/components/assistant-ui/elements/regenerate-menu.js +46 -0
- package/dist/components/assistant-ui/elements/research-report.d.ts +19 -0
- package/dist/components/assistant-ui/elements/research-report.js +63 -0
- package/dist/components/assistant-ui/elements/retrieval-chunks.d.ts +19 -0
- package/dist/components/assistant-ui/elements/retrieval-chunks.js +86 -0
- package/dist/components/assistant-ui/elements/reviewable-diff.d.ts +21 -0
- package/dist/components/assistant-ui/elements/reviewable-diff.js +104 -0
- package/dist/components/assistant-ui/elements/schedule-card.d.ts +19 -0
- package/dist/components/assistant-ui/elements/schedule-card.js +80 -0
- package/dist/components/assistant-ui/elements/score-breakdown.d.ts +19 -0
- package/dist/components/assistant-ui/elements/score-breakdown.js +107 -0
- package/dist/components/assistant-ui/elements/scroll-anchor.d.ts +15 -0
- package/dist/components/assistant-ui/elements/scroll-anchor.js +104 -0
- package/dist/components/assistant-ui/elements/settings-panel.d.ts +23 -0
- package/dist/components/assistant-ui/elements/settings-panel.js +108 -0
- package/dist/components/assistant-ui/elements/shared-conversation.d.ts +18 -0
- package/dist/components/assistant-ui/elements/shared-conversation.js +56 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.aui.d.ts +29 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.aui.js +31 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.d.ts +26 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.js +49 -0
- package/dist/components/assistant-ui/elements/sources.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/sources.aui.js +121 -0
- package/dist/components/assistant-ui/elements/sources.d.ts +21 -0
- package/dist/components/assistant-ui/elements/sources.js +109 -0
- package/dist/components/assistant-ui/elements/speaker-identity.d.ts +17 -0
- package/dist/components/assistant-ui/elements/speaker-identity.js +45 -0
- package/dist/components/assistant-ui/elements/spec-sheet.d.ts +17 -0
- package/dist/components/assistant-ui/elements/spec-sheet.js +39 -0
- package/dist/components/assistant-ui/elements/stopped-run.d.ts +12 -0
- package/dist/components/assistant-ui/elements/stopped-run.js +44 -0
- package/dist/components/assistant-ui/elements/streaming-text.d.ts +15 -0
- package/dist/components/assistant-ui/elements/streaming-text.js +45 -0
- package/dist/components/assistant-ui/elements/subagent-list.d.ts +17 -0
- package/dist/components/assistant-ui/elements/subagent-list.js +74 -0
- package/dist/components/assistant-ui/elements/suggestions.d.ts +14 -0
- package/dist/components/assistant-ui/elements/suggestions.js +25 -0
- package/dist/components/assistant-ui/elements/surfaces.d.ts +42 -0
- package/dist/components/assistant-ui/elements/surfaces.js +87 -0
- package/dist/components/assistant-ui/elements/syntax-highlighter.d.ts +7 -0
- package/dist/components/assistant-ui/elements/syntax-highlighter.js +41 -0
- package/dist/components/assistant-ui/elements/task-card.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/task-card.aui.js +136 -0
- package/dist/components/assistant-ui/elements/task-card.d.ts +22 -0
- package/dist/components/assistant-ui/elements/task-card.js +104 -0
- package/dist/components/assistant-ui/elements/terminal-block.d.ts +27 -0
- package/dist/components/assistant-ui/elements/terminal-block.js +266 -0
- package/dist/components/assistant-ui/elements/thinking-indicator.d.ts +10 -0
- package/dist/components/assistant-ui/elements/thinking-indicator.js +30 -0
- package/dist/components/assistant-ui/elements/thread-list.aui.d.ts +39 -0
- package/dist/components/assistant-ui/elements/thread-list.aui.js +331 -0
- package/dist/components/assistant-ui/elements/thread-list.d.ts +19 -0
- package/dist/components/assistant-ui/elements/thread-list.js +72 -0
- package/dist/components/assistant-ui/elements/thread-search.d.ts +20 -0
- package/dist/components/assistant-ui/elements/thread-search.js +94 -0
- package/dist/components/assistant-ui/elements/thread.aui.d.ts +36 -0
- package/dist/components/assistant-ui/elements/thread.aui.js +625 -0
- package/dist/components/assistant-ui/elements/threadlist-sidebar.aui.d.ts +19 -0
- package/dist/components/assistant-ui/elements/threadlist-sidebar.aui.js +75 -0
- package/dist/components/assistant-ui/elements/timeline.d.ts +18 -0
- package/dist/components/assistant-ui/elements/timeline.js +40 -0
- package/dist/components/assistant-ui/elements/todo-list.d.ts +21 -0
- package/dist/components/assistant-ui/elements/todo-list.js +100 -0
- package/dist/components/assistant-ui/elements/tool-call.d.ts +17 -0
- package/dist/components/assistant-ui/elements/tool-call.js +70 -0
- package/dist/components/assistant-ui/elements/tool-error.d.ts +16 -0
- package/dist/components/assistant-ui/elements/tool-error.js +62 -0
- package/dist/components/assistant-ui/elements/tool-fallback.aui.d.ts +44 -0
- package/dist/components/assistant-ui/elements/tool-fallback.aui.js +542 -0
- package/dist/components/assistant-ui/elements/tool-group.aui.d.ts +37 -0
- package/dist/components/assistant-ui/elements/tool-group.aui.js +104 -0
- package/dist/components/assistant-ui/elements/tool-group.d.ts +20 -0
- package/dist/components/assistant-ui/elements/tool-group.js +71 -0
- package/dist/components/assistant-ui/elements/tool-timeline.d.ts +44 -0
- package/dist/components/assistant-ui/elements/tool-timeline.js +109 -0
- package/dist/components/assistant-ui/elements/tooltip-icon-button.d.ts +12 -0
- package/dist/components/assistant-ui/elements/tooltip-icon-button.js +30 -0
- package/dist/components/assistant-ui/elements/trace-waterfall.d.ts +33 -0
- package/dist/components/assistant-ui/elements/trace-waterfall.js +102 -0
- package/dist/components/assistant-ui/elements/typing-indicator.d.ts +9 -0
- package/dist/components/assistant-ui/elements/typing-indicator.js +45 -0
- package/dist/components/assistant-ui/elements/voice-conversation.aui.d.ts +11 -0
- package/dist/components/assistant-ui/elements/voice-conversation.aui.js +54 -0
- package/dist/components/assistant-ui/elements/voice-conversation.d.ts +21 -0
- package/dist/components/assistant-ui/elements/voice-conversation.js +110 -0
- package/dist/components/assistant-ui/elements/voice.aui.d.ts +22 -0
- package/dist/components/assistant-ui/elements/voice.aui.js +100 -0
- package/dist/components/assistant-ui/elements/voice.d.ts +15 -0
- package/dist/components/assistant-ui/elements/voice.js +400 -0
- package/dist/components/assistant-ui/elements/web-preview.d.ts +18 -0
- package/dist/components/assistant-ui/elements/web-preview.js +61 -0
- package/dist/components/assistant-ui/elements/web-search.d.ts +17 -0
- package/dist/components/assistant-ui/elements/web-search.js +54 -0
- package/dist/components/assistant-ui/utils/href.d.ts +13 -0
- package/dist/components/assistant-ui/utils/href.js +39 -0
- package/dist/components/assistant-ui/utils/range.d.ts +22 -0
- package/dist/components/assistant-ui/utils/range.js +48 -0
- package/dist/components/assistant-ui/utils/task.d.ts +14 -0
- package/dist/components/assistant-ui/utils/task.js +75 -0
- package/dist/components/icons/github.js +13 -0
- package/dist/components/theme-provider.d.ts +16 -0
- package/dist/components/theme-provider.js +116 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.js +53 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert-dialog.js +93 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +42 -0
- package/dist/components/ui/aspect-ratio.d.ts +6 -0
- package/dist/components/ui/aspect-ratio.js +13 -0
- package/dist/components/ui/attachment.d.ts +25 -0
- package/dist/components/ui/attachment.js +103 -0
- package/dist/components/ui/avatar.d.ts +13 -0
- package/dist/components/ui/avatar.js +50 -0
- package/dist/components/ui/badge.d.ts +14 -0
- package/dist/components/ui/badge.js +30 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.js +71 -0
- package/dist/components/ui/bubble.d.ts +18 -0
- package/dist/components/ui/bubble.js +72 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.js +41 -0
- package/dist/components/ui/button.d.ts +19 -0
- package/dist/components/ui/button.js +71 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/calendar.js +108 -0
- package/dist/components/ui/card.d.ts +13 -0
- package/dist/components/ui/card.js +55 -0
- package/dist/components/ui/carousel.d.ts +30 -0
- package/dist/components/ui/carousel.js +131 -0
- package/dist/components/ui/chart.d.ts +46 -0
- package/dist/components/ui/chart.js +148 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.js +20 -0
- package/dist/components/ui/collapsible.d.ts +7 -0
- package/dist/components/ui/collapsible.js +23 -0
- package/dist/components/ui/combobox.d.ts +26 -0
- package/dist/components/ui/combobox.js +161 -0
- package/dist/components/ui/command.d.ts +21 -0
- package/dist/components/ui/command.js +87 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/context-menu.js +132 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +91 -0
- package/dist/components/ui/diff-viewer.d.ts +100 -0
- package/dist/components/ui/diff-viewer.js +461 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.js +2 -0
- package/dist/components/ui/dot-matrix.d.ts +150 -0
- package/dist/components/ui/dot-matrix.js +248 -0
- package/dist/components/ui/drawer.d.ts +18 -0
- package/dist/components/ui/drawer.js +123 -0
- package/dist/components/ui/dropdown-menu.d.ts +31 -0
- package/dist/components/ui/dropdown-menu.js +136 -0
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.js +59 -0
- package/dist/components/ui/field.d.ts +26 -0
- package/dist/components/ui/field.js +109 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.js +36 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.js +77 -0
- package/dist/components/ui/input-otp.d.ts +13 -0
- package/dist/components/ui/input-otp.js +46 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +14 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.js +120 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.js +19 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.js +12 -0
- package/dist/components/ui/marker.d.ts +12 -0
- package/dist/components/ui/marker.js +42 -0
- package/dist/components/ui/menubar.d.ts +31 -0
- package/dist/components/ui/menubar.js +135 -0
- package/dist/components/ui/message-scroller.d.ts +12 -0
- package/dist/components/ui/message-scroller.js +59 -0
- package/dist/components/ui/message.d.ts +12 -0
- package/dist/components/ui/message.js +48 -0
- package/dist/components/ui/native-select.d.ts +10 -0
- package/dist/components/ui/native-select.js +37 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.js +82 -0
- package/dist/components/ui/number-roll.d.ts +21 -0
- package/dist/components/ui/number-roll.js +269 -0
- package/dist/components/ui/pagination.d.ts +19 -0
- package/dist/components/ui/pagination.js +79 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.js +54 -0
- package/dist/components/ui/progress.d.ts +9 -0
- package/dist/components/ui/progress.js +44 -0
- package/dist/components/ui/questionnaire.d.ts +21 -0
- package/dist/components/ui/questionnaire.js +169 -0
- package/dist/components/ui/radio-group.d.ts +7 -0
- package/dist/components/ui/radio-group.js +26 -0
- package/dist/components/ui/resizable.d.ts +9 -0
- package/dist/components/ui/resizable.js +28 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.js +35 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +96 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.js +14 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sheet.js +87 -0
- package/dist/components/ui/sidebar.d.ts +65 -0
- package/dist/components/ui/sidebar.js +386 -0
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.js +12 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.js +33 -0
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.js +15 -0
- package/dist/components/ui/switch.d.ts +7 -0
- package/dist/components/ui/switch.js +19 -0
- package/dist/components/ui/table.d.ts +12 -0
- package/dist/components/ui/table.js +65 -0
- package/dist/components/ui/tabs.d.ts +12 -0
- package/dist/components/ui/tabs.js +45 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +12 -0
- package/dist/components/ui/toast.d.ts +18 -0
- package/dist/components/ui/toast.js +121 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.js +51 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.js +35 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.js +43 -0
- package/dist/compositions/app-rail/app-rail.d.ts +19 -0
- package/dist/compositions/app-rail/app-rail.js +58 -0
- package/dist/compositions/app-shell/app-shell.d.ts +56 -0
- package/dist/compositions/app-shell/app-shell.js +143 -0
- package/dist/compositions/app-shell/theme-toggle.d.ts +10 -0
- package/dist/compositions/app-shell/theme-toggle.js +65 -0
- package/dist/compositions/confirm-action/confirm-action.d.ts +48 -0
- package/dist/compositions/confirm-action/confirm-action.js +48 -0
- package/dist/compositions/data-table/data-table-state.d.ts +23 -0
- package/dist/compositions/data-table/data-table-state.js +46 -0
- package/dist/compositions/data-table/data-table.d.ts +185 -0
- package/dist/compositions/data-table/data-table.js +615 -0
- package/dist/compositions/date-range-picker/date-range-options.d.ts +28 -0
- package/dist/compositions/date-range-picker/date-range-options.js +61 -0
- package/dist/compositions/date-range-picker/date-range-picker.d.ts +55 -0
- package/dist/compositions/date-range-picker/date-range-picker.js +409 -0
- package/dist/compositions/decision-queue/decision-queue.d.ts +114 -0
- package/dist/compositions/decision-queue/decision-queue.js +478 -0
- package/dist/compositions/event-feed/event-feed.d.ts +59 -0
- package/dist/compositions/event-feed/event-feed.js +105 -0
- package/dist/compositions/feedback.d.ts +20 -0
- package/dist/compositions/feedback.js +49 -0
- package/dist/compositions/fields.d.ts +64 -0
- package/dist/compositions/fields.js +293 -0
- package/dist/compositions/form-kit/form-context.d.ts +10 -0
- package/dist/compositions/form-kit/form-context.js +12 -0
- package/dist/compositions/form-kit/form-fields.d.ts +95 -0
- package/dist/compositions/form-kit/form-fields.js +233 -0
- package/dist/compositions/form-kit/form-kit.d.ts +128 -0
- package/dist/compositions/form-kit/form-kit.js +119 -0
- package/dist/compositions/inspector/inspector.d.ts +53 -0
- package/dist/compositions/inspector/inspector.js +80 -0
- package/dist/compositions/layout.d.ts +36 -0
- package/dist/compositions/layout.js +86 -0
- package/dist/compositions/state-blocks/state-blocks.d.ts +42 -0
- package/dist/compositions/state-blocks/state-blocks.js +81 -0
- package/dist/compositions/status-panel/status-panel.d.ts +94 -0
- package/dist/compositions/status-panel/status-panel.js +189 -0
- package/dist/fonts/InterVariable.woff2 +0 -0
- package/dist/fonts/inter.css +15 -0
- package/dist/hooks/use-attachment-src.js +35 -0
- package/dist/hooks/use-copy-to-clipboard.js +34 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +102 -0
- package/dist/lib/context-level.js +7 -0
- package/dist/lib/elapsed.js +61 -0
- package/dist/lib/iso-date.js +30 -0
- package/dist/lib/motion-loop.js +41 -0
- package/dist/lib/pointer.js +14 -0
- package/dist/lib/status-tone.d.ts +7 -0
- package/dist/lib/status-tone.js +55 -0
- package/dist/lib/triage-keys.js +229 -0
- package/dist/lib/utils.js +2 -0
- package/dist/motion/alert-toast/alert-toast.d.ts +51 -0
- package/dist/motion/alert-toast/alert-toast.js +226 -0
- package/dist/motion/branch-menu/branch-menu.d.ts +47 -0
- package/dist/motion/branch-menu/branch-menu.js +287 -0
- package/dist/motion/check-item/check-item.d.ts +24 -0
- package/dist/motion/check-item/check-item.js +110 -0
- package/dist/motion/dial/dial.d.ts +39 -0
- package/dist/motion/dial/dial.js +290 -0
- package/dist/motion/dictation-button/dictation-button.d.ts +45 -0
- package/dist/motion/dictation-button/dictation-button.js +232 -0
- package/dist/motion/hold-button/hold-button.d.ts +37 -0
- package/dist/motion/hold-button/hold-button.js +192 -0
- package/dist/motion/masonry-grid/masonry-grid.d.ts +42 -0
- package/dist/motion/masonry-grid/masonry-grid.js +145 -0
- package/dist/motion/prompt-composer/prompt-composer.d.ts +90 -0
- package/dist/motion/prompt-composer/prompt-composer.js +374 -0
- package/dist/motion/scrub-select/scrub-select.d.ts +33 -0
- package/dist/motion/scrub-select/scrub-select.js +346 -0
- package/dist/motion/spotlight-grid/spotlight-grid.d.ts +40 -0
- package/dist/motion/spotlight-grid/spotlight-grid.js +171 -0
- package/dist/motion/star-rating/star-rating.d.ts +32 -0
- package/dist/motion/star-rating/star-rating.js +191 -0
- package/dist/motion/status-glyph/status-glyph.d.ts +28 -0
- package/dist/motion/status-glyph/status-glyph.js +171 -0
- package/dist/motion/stepper/stepper.d.ts +56 -0
- package/dist/motion/stepper/stepper.js +211 -0
- package/dist/motion/swipe-row/swipe-row.d.ts +52 -0
- package/dist/motion/swipe-row/swipe-row.js +208 -0
- package/dist/motion/thinking-trace/thinking-trace.d.ts +32 -0
- package/dist/motion/thinking-trace/thinking-trace.js +186 -0
- package/dist/motion/tool-call-chip/tool-call-chip.d.ts +36 -0
- package/dist/motion/tool-call-chip/tool-call-chip.js +135 -0
- package/dist/motion/working-indicator/working-indicator.d.ts +38 -0
- package/dist/motion/working-indicator/working-indicator.js +171 -0
- package/dist/styles.css +828 -0
- package/dist/tokens.css +230 -0
- package/licenses/Inter-OFL.txt +92 -0
- package/licenses/assistant-ui-MIT.txt +21 -0
- package/licenses/shadcn-MIT.md +21 -0
- package/package.json +133 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/motion/swipe-row/swipe-row.d.ts
|
|
3
|
+
export type SwipeRowActionTone = "neutral" | "primary" | "destructive";
|
|
4
|
+
export interface SwipeRowAction {
|
|
5
|
+
/** Passed to `onAction`. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Visible label, and the action button's accessible name. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** A lucide icon, shown above the label. */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
/** Fill colour. Defaults to `neutral`. */
|
|
12
|
+
tone?: SwipeRowActionTone;
|
|
13
|
+
}
|
|
14
|
+
export interface SwipeRowProps {
|
|
15
|
+
/** The row's visible content. */
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/** Accessible name of the row, for example the item's title. */
|
|
18
|
+
label: string;
|
|
19
|
+
/**
|
|
20
|
+
* The actions a swipe reveals, primary first. The primary action sits at the
|
|
21
|
+
* row's outer edge, and a full swipe commits it.
|
|
22
|
+
*/
|
|
23
|
+
actions: readonly SwipeRowAction[];
|
|
24
|
+
/** Runs an action, from a button press or a full swipe. */
|
|
25
|
+
onAction: (actionId: string) => void;
|
|
26
|
+
/** Commit the primary action when the row is swiped most of the way across. Default `true`. */
|
|
27
|
+
fullSwipe?: boolean;
|
|
28
|
+
/** Width of each action button, in pixels. Default 72. */
|
|
29
|
+
actionWidth?: number;
|
|
30
|
+
/** Whether the actions are revealed (controlled). */
|
|
31
|
+
open?: boolean;
|
|
32
|
+
/** Whether the actions start revealed (uncontrolled). */
|
|
33
|
+
defaultOpen?: boolean;
|
|
34
|
+
onOpenChange?: (open: boolean) => void;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A list row whose actions a swipe toward the start edge reveals: the action
|
|
40
|
+
* tray follows the swipe in over the row's trailing edge, while the row's own
|
|
41
|
+
* content stays in place. A flick snaps it open or shut, and a swipe past most
|
|
42
|
+
* of the row's width commits the primary action, which stretches to fill the
|
|
43
|
+
* row as it arms.
|
|
44
|
+
*
|
|
45
|
+
* The actions are real buttons in the tab order: focusing one reveals the row,
|
|
46
|
+
* so keyboard and screen-reader users get the same actions. Tapping the row
|
|
47
|
+
* while it is open closes it.
|
|
48
|
+
*
|
|
49
|
+
* Behavior reference: reactbits swipe-row.
|
|
50
|
+
*/
|
|
51
|
+
export declare function SwipeRow(props: SwipeRowProps): React.JSX.Element;
|
|
52
|
+
//#endregion
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { useControllableValue, useLatest } from "ahooks";
|
|
5
|
+
import { animate, motion, useMotionValue, useMotionValueEvent, useReducedMotionConfig, useTransform } from "motion/react";
|
|
6
|
+
//#region src/motion/swipe-row/swipe-row.tsx
|
|
7
|
+
/** Share of the row's width past which a released swipe commits the primary action. */
|
|
8
|
+
const COMMIT_RATIO = .6;
|
|
9
|
+
/** Release velocity (px/s) that counts as a flick. */
|
|
10
|
+
const FLICK_VELOCITY = 600;
|
|
11
|
+
/** Reveal distance under which the action tray stays hidden. */
|
|
12
|
+
const TRAY_HIDDEN_PX = 8;
|
|
13
|
+
/** Width of the fade on the content's trailing edge while the row is open. */
|
|
14
|
+
const CONTENT_FADE_PX = 32;
|
|
15
|
+
const SPRING = {
|
|
16
|
+
type: "spring",
|
|
17
|
+
stiffness: 520,
|
|
18
|
+
damping: 44,
|
|
19
|
+
mass: .9
|
|
20
|
+
};
|
|
21
|
+
const INSTANT = { duration: 0 };
|
|
22
|
+
const toneClass = {
|
|
23
|
+
neutral: "bg-primary text-primary-foreground",
|
|
24
|
+
primary: "bg-primary text-primary-foreground",
|
|
25
|
+
destructive: "bg-(--soft-critical-fill) text-(--soft-critical-on-fill)"
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A list row whose actions a swipe toward the start edge reveals: the action
|
|
29
|
+
* tray follows the swipe in over the row's trailing edge, while the row's own
|
|
30
|
+
* content stays in place. A flick snaps it open or shut, and a swipe past most
|
|
31
|
+
* of the row's width commits the primary action, which stretches to fill the
|
|
32
|
+
* row as it arms.
|
|
33
|
+
*
|
|
34
|
+
* The actions are real buttons in the tab order: focusing one reveals the row,
|
|
35
|
+
* so keyboard and screen-reader users get the same actions. Tapping the row
|
|
36
|
+
* while it is open closes it.
|
|
37
|
+
*
|
|
38
|
+
* Behavior reference: reactbits swipe-row.
|
|
39
|
+
*/
|
|
40
|
+
function SwipeRow(props) {
|
|
41
|
+
const { children, label, actions, onAction, fullSwipe = true, actionWidth = 72, disabled = false, className } = props;
|
|
42
|
+
const [open, setOpen] = useControllableValue(props, {
|
|
43
|
+
defaultValue: false,
|
|
44
|
+
valuePropName: "open",
|
|
45
|
+
defaultValuePropName: "defaultOpen",
|
|
46
|
+
trigger: "onOpenChange"
|
|
47
|
+
});
|
|
48
|
+
const reduced = useReducedMotionConfig() ?? false;
|
|
49
|
+
const transition = reduced ? INSTANT : SPRING;
|
|
50
|
+
const rowRef = React.useRef(null);
|
|
51
|
+
const draggedRef = React.useRef(false);
|
|
52
|
+
const committingRef = React.useRef(false);
|
|
53
|
+
const onActionRef = useLatest(onAction);
|
|
54
|
+
const primary = actions[0];
|
|
55
|
+
const revealWidth = actions.length * actionWidth;
|
|
56
|
+
const x = useMotionValue(open ? -revealWidth : 0);
|
|
57
|
+
const trayWidth = useTransform(x, (value) => Math.max(revealWidth, -value));
|
|
58
|
+
const trayX = useTransform(x, (value) => Math.max(0, revealWidth + value));
|
|
59
|
+
const trayOpacity = useTransform(x, (value) => -value > TRAY_HIDDEN_PX ? 1 : 0);
|
|
60
|
+
const contentMask = useTransform(x, (value) => {
|
|
61
|
+
const offset = Math.max(0, -value);
|
|
62
|
+
return `linear-gradient(to left, transparent ${offset}px, black ${offset + Math.min(offset / 3, CONTENT_FADE_PX)}px)`;
|
|
63
|
+
});
|
|
64
|
+
const contentX = useTransform(x, (value) => Math.max(0, value));
|
|
65
|
+
const [armed, setArmed] = React.useState(false);
|
|
66
|
+
const rowWidth = () => rowRef.current?.offsetWidth ?? revealWidth / COMMIT_RATIO;
|
|
67
|
+
useMotionValueEvent(x, "change", (value) => {
|
|
68
|
+
const next = fullSwipe && primary !== void 0 && -value > rowWidth() * COMMIT_RATIO;
|
|
69
|
+
setArmed((previous) => previous === next ? previous : next);
|
|
70
|
+
});
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
if (committingRef.current) return;
|
|
73
|
+
const controls = animate(x, open ? -revealWidth : 0, transition);
|
|
74
|
+
return () => controls.stop();
|
|
75
|
+
}, [
|
|
76
|
+
open,
|
|
77
|
+
revealWidth,
|
|
78
|
+
transition,
|
|
79
|
+
x
|
|
80
|
+
]);
|
|
81
|
+
const settle = (next) => {
|
|
82
|
+
if (next === open) animate(x, next ? -revealWidth : 0, transition);
|
|
83
|
+
else setOpen(next);
|
|
84
|
+
};
|
|
85
|
+
const commit = (actionId) => {
|
|
86
|
+
committingRef.current = true;
|
|
87
|
+
animate(x, -rowWidth(), transition).then(() => {
|
|
88
|
+
onActionRef.current(actionId);
|
|
89
|
+
committingRef.current = false;
|
|
90
|
+
setOpen(false);
|
|
91
|
+
animate(x, 0, transition);
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
const panStartRef = React.useRef(0);
|
|
95
|
+
const handlePanStart = () => {
|
|
96
|
+
draggedRef.current = true;
|
|
97
|
+
panStartRef.current = x.get();
|
|
98
|
+
};
|
|
99
|
+
const handlePan = (_event, info) => {
|
|
100
|
+
if (committingRef.current) return;
|
|
101
|
+
const raw = panStartRef.current + info.offset.x;
|
|
102
|
+
if (raw > 0) x.set(raw * .15);
|
|
103
|
+
else if (!fullSwipe && raw < -revealWidth) x.set(-revealWidth + (raw + revealWidth) * .2);
|
|
104
|
+
else x.set(raw);
|
|
105
|
+
};
|
|
106
|
+
const handlePanEnd = (_event, info) => {
|
|
107
|
+
if (committingRef.current) return;
|
|
108
|
+
const offset = -x.get();
|
|
109
|
+
const velocity = -info.velocity.x;
|
|
110
|
+
if (fullSwipe && primary && offset > rowWidth() * COMMIT_RATIO) {
|
|
111
|
+
commit(primary.id);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (velocity > FLICK_VELOCITY) {
|
|
115
|
+
settle(true);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (velocity < -600) {
|
|
119
|
+
settle(false);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
settle(offset > revealWidth / 2);
|
|
123
|
+
};
|
|
124
|
+
const handleBlur = (event) => {
|
|
125
|
+
const next = event.relatedTarget;
|
|
126
|
+
if (next instanceof Node && event.currentTarget.contains(next)) return;
|
|
127
|
+
if (open) setOpen(false);
|
|
128
|
+
};
|
|
129
|
+
const handleContentClick = (event) => {
|
|
130
|
+
if (draggedRef.current) {
|
|
131
|
+
draggedRef.current = false;
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
event.stopPropagation();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (open) {
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
event.stopPropagation();
|
|
139
|
+
setOpen(false);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
const trayActions = [...actions].reverse();
|
|
143
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
144
|
+
ref: rowRef,
|
|
145
|
+
role: "group",
|
|
146
|
+
"aria-label": label,
|
|
147
|
+
"data-slot": "swipe-row",
|
|
148
|
+
"data-state": open ? "open" : "closed",
|
|
149
|
+
"data-armed": armed ? "" : void 0,
|
|
150
|
+
"data-reduced-motion": reduced ? "" : void 0,
|
|
151
|
+
onBlur: handleBlur,
|
|
152
|
+
className: cn("relative isolate overflow-clip rounded-md bg-card", className),
|
|
153
|
+
children: [/* @__PURE__ */ jsx(motion.div, {
|
|
154
|
+
"data-slot": "swipe-row-actions",
|
|
155
|
+
style: {
|
|
156
|
+
width: trayWidth,
|
|
157
|
+
x: trayX,
|
|
158
|
+
opacity: trayOpacity
|
|
159
|
+
},
|
|
160
|
+
className: "absolute inset-y-0 right-0 z-20 flex",
|
|
161
|
+
onFocus: () => {
|
|
162
|
+
if (!open) setOpen(true);
|
|
163
|
+
},
|
|
164
|
+
children: trayActions.map((action) => {
|
|
165
|
+
const isPrimary = action.id === primary?.id;
|
|
166
|
+
const grow = armed ? isPrimary ? 1 : 0 : 1;
|
|
167
|
+
return /* @__PURE__ */ jsx("button", {
|
|
168
|
+
type: "button",
|
|
169
|
+
disabled,
|
|
170
|
+
"data-slot": "swipe-row-action",
|
|
171
|
+
"data-primary": isPrimary ? "" : void 0,
|
|
172
|
+
onClick: () => onActionRef.current(action.id),
|
|
173
|
+
style: {
|
|
174
|
+
flexGrow: grow,
|
|
175
|
+
flexBasis: grow === 0 ? 0 : actionWidth
|
|
176
|
+
},
|
|
177
|
+
className: cn("relative flex min-w-0 shrink flex-col items-center justify-center overflow-hidden px-1 text-xs font-medium whitespace-nowrap outline-none", "before:pointer-events-none before:absolute before:inset-0 before:bg-black/10 before:opacity-0 enabled:hover:before:opacity-100 focus-visible:before:opacity-100 dark:before:bg-white/10", "after:pointer-events-none after:absolute after:inset-1.5 after:rounded-md after:ring-current/50 focus-visible:after:ring-2", "disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", reduced ? "transition-none" : "transition-[flex-grow,flex-basis] duration-200 ease-out", toneClass[action.tone ?? "neutral"]),
|
|
178
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
179
|
+
className: "relative flex min-w-0 flex-col items-center gap-1",
|
|
180
|
+
children: [action.icon, /* @__PURE__ */ jsx("span", {
|
|
181
|
+
className: "max-w-full truncate",
|
|
182
|
+
children: action.label
|
|
183
|
+
})]
|
|
184
|
+
})
|
|
185
|
+
}, action.id);
|
|
186
|
+
})
|
|
187
|
+
}), /* @__PURE__ */ jsx(motion.div, {
|
|
188
|
+
"data-slot": "swipe-row-content",
|
|
189
|
+
style: {
|
|
190
|
+
x: contentX,
|
|
191
|
+
touchAction: "pan-y",
|
|
192
|
+
maskImage: contentMask,
|
|
193
|
+
WebkitMaskImage: contentMask
|
|
194
|
+
},
|
|
195
|
+
onPanStart: disabled ? void 0 : handlePanStart,
|
|
196
|
+
onPan: disabled ? void 0 : handlePan,
|
|
197
|
+
onPanEnd: disabled ? void 0 : handlePanEnd,
|
|
198
|
+
onPointerDownCapture: () => {
|
|
199
|
+
draggedRef.current = false;
|
|
200
|
+
},
|
|
201
|
+
onClickCapture: handleContentClick,
|
|
202
|
+
className: cn("relative z-10 bg-card text-card-foreground", !disabled && "cursor-grab active:cursor-grabbing"),
|
|
203
|
+
children
|
|
204
|
+
})]
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
export { SwipeRow };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/motion/thinking-trace/thinking-trace.d.ts
|
|
3
|
+
export interface ThinkingTraceProps extends Omit<React.ComponentProps<"div">, "children"> {
|
|
4
|
+
/** True while the agent is still reasoning. */
|
|
5
|
+
working: boolean;
|
|
6
|
+
/** Reasoning steps, oldest first. The last one is the live step while working. */
|
|
7
|
+
steps: string[];
|
|
8
|
+
/** Label while working. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Label once settled, given the formatted elapsed time ("4.2s"). */
|
|
11
|
+
doneLabel?: (elapsed: string) => string;
|
|
12
|
+
/** Show the elapsed time while working. */
|
|
13
|
+
showTimer?: boolean;
|
|
14
|
+
/** Elapsed time in ms, from the app. When omitted the trace runs its own clock while working. */
|
|
15
|
+
elapsedMs?: number;
|
|
16
|
+
/** Whether the step list is open (controlled). */
|
|
17
|
+
expanded?: boolean;
|
|
18
|
+
/** Initial open state when uncontrolled. */
|
|
19
|
+
defaultExpanded?: boolean;
|
|
20
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
21
|
+
/** Close the step list when `working` turns false. */
|
|
22
|
+
collapseOnSettle?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Streaming reasoning: a "Thinking" label with an elapsed timer over a list
|
|
26
|
+
* of steps that grows as they arrive, collapsing to a settled label ("Thought
|
|
27
|
+
* for 4.2s") when the agent finishes. The header toggles the list.
|
|
28
|
+
*
|
|
29
|
+
* Behavior reference: reactbits thought-line.
|
|
30
|
+
*/
|
|
31
|
+
export declare function ThinkingTrace({ working, steps, label, doneLabel, showTimer, elapsedMs, expanded: _expanded, defaultExpanded: _defaultExpanded, onExpandedChange: _onExpandedChange, collapseOnSettle, className, ...props }: ThinkingTraceProps): React.JSX.Element;
|
|
32
|
+
//#endregion
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { useLoop } from "../../lib/motion-loop.js";
|
|
2
|
+
import { formatElapsed, useElapsed } from "../../lib/elapsed.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cn } from "cn";
|
|
6
|
+
import { CheckIcon, ChevronDownIcon, SparklesIcon } from "lucide-react";
|
|
7
|
+
import { useControllableValue, useUpdateEffect } from "ahooks";
|
|
8
|
+
import { AnimatePresence, motion, useReducedMotionConfig, useTransform } from "motion/react";
|
|
9
|
+
//#region src/motion/thinking-trace/thinking-trace.tsx
|
|
10
|
+
const defaultDoneLabel = (elapsed) => `Thought for ${elapsed}`;
|
|
11
|
+
/**
|
|
12
|
+
* Streaming reasoning: a "Thinking" label with an elapsed timer over a list
|
|
13
|
+
* of steps that grows as they arrive, collapsing to a settled label ("Thought
|
|
14
|
+
* for 4.2s") when the agent finishes. The header toggles the list.
|
|
15
|
+
*
|
|
16
|
+
* Behavior reference: reactbits thought-line.
|
|
17
|
+
*/
|
|
18
|
+
function ThinkingTrace({ working, steps, label = "Thinking", doneLabel = defaultDoneLabel, showTimer = true, elapsedMs, expanded: _expanded, defaultExpanded: _defaultExpanded, onExpandedChange: _onExpandedChange, collapseOnSettle = true, className, ...props }) {
|
|
19
|
+
const reduced = useReducedMotionConfig() ?? false;
|
|
20
|
+
const listId = React.useId();
|
|
21
|
+
const clock = useElapsed(working, elapsedMs, formatElapsed);
|
|
22
|
+
const [expanded, setExpanded] = useControllableValue(pickExpandedProps({
|
|
23
|
+
expanded: _expanded,
|
|
24
|
+
defaultExpanded: _defaultExpanded,
|
|
25
|
+
onExpandedChange: _onExpandedChange
|
|
26
|
+
}), {
|
|
27
|
+
valuePropName: "expanded",
|
|
28
|
+
defaultValuePropName: "defaultExpanded",
|
|
29
|
+
trigger: "onExpandedChange",
|
|
30
|
+
defaultValue: working
|
|
31
|
+
});
|
|
32
|
+
useUpdateEffect(() => {
|
|
33
|
+
if (!working && collapseOnSettle) setExpanded(false);
|
|
34
|
+
if (working) setExpanded(true);
|
|
35
|
+
}, [working]);
|
|
36
|
+
const elapsedText = clock.text;
|
|
37
|
+
const hasSteps = steps.length > 0;
|
|
38
|
+
const title = working ? `${label}…` : doneLabel(elapsedText);
|
|
39
|
+
const breath = useLoop([
|
|
40
|
+
1,
|
|
41
|
+
.45,
|
|
42
|
+
1
|
|
43
|
+
], { duration: 1.6 }, working && !reduced, 1);
|
|
44
|
+
const breathScale = useTransform(breath, [.45, 1], [.88, 1]);
|
|
45
|
+
const fade = reduced ? { duration: 0 } : {
|
|
46
|
+
duration: .2,
|
|
47
|
+
ease: "easeOut"
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
50
|
+
"data-slot": "thinking-trace",
|
|
51
|
+
"data-state": working ? "working" : "settled",
|
|
52
|
+
"data-motion": reduced ? "reduced" : "full",
|
|
53
|
+
className: cn("flex flex-col text-xs/relaxed", className),
|
|
54
|
+
...props,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsxs(Header, {
|
|
57
|
+
interactive: steps.length > 0,
|
|
58
|
+
expanded,
|
|
59
|
+
controls: expanded ? listId : void 0,
|
|
60
|
+
onToggle: () => setExpanded(!expanded),
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(motion.span, {
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
className: "inline-flex",
|
|
65
|
+
style: {
|
|
66
|
+
opacity: breath,
|
|
67
|
+
scale: breathScale
|
|
68
|
+
},
|
|
69
|
+
children: /* @__PURE__ */ jsx(SparklesIcon, { className: "size-3.5" })
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "font-medium",
|
|
73
|
+
children: title
|
|
74
|
+
}),
|
|
75
|
+
working && showTimer ? /* @__PURE__ */ jsx("span", {
|
|
76
|
+
ref: clock.textRef,
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
"data-slot": "thinking-trace-timer",
|
|
79
|
+
className: "font-mono text-[0.6875rem] tabular-nums",
|
|
80
|
+
children: elapsedText
|
|
81
|
+
}) : null,
|
|
82
|
+
hasSteps ? /* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
83
|
+
"aria-hidden": "true",
|
|
84
|
+
className: cn("size-3.5 transition-transform duration-200 motion-reduce:transition-none", reduced && "transition-none", expanded && "rotate-180")
|
|
85
|
+
}) : null
|
|
86
|
+
]
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ jsx(AnimatePresence, {
|
|
89
|
+
initial: false,
|
|
90
|
+
children: expanded && hasSteps ? /* @__PURE__ */ jsx(motion.div, {
|
|
91
|
+
id: listId,
|
|
92
|
+
"data-slot": "thinking-trace-steps",
|
|
93
|
+
className: "overflow-hidden",
|
|
94
|
+
initial: {
|
|
95
|
+
height: 0,
|
|
96
|
+
opacity: 0
|
|
97
|
+
},
|
|
98
|
+
animate: {
|
|
99
|
+
height: "auto",
|
|
100
|
+
opacity: 1
|
|
101
|
+
},
|
|
102
|
+
exit: {
|
|
103
|
+
height: 0,
|
|
104
|
+
opacity: 0
|
|
105
|
+
},
|
|
106
|
+
transition: reduced ? { duration: 0 } : {
|
|
107
|
+
duration: .22,
|
|
108
|
+
ease: "easeOut"
|
|
109
|
+
},
|
|
110
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
111
|
+
"aria-label": label,
|
|
112
|
+
className: "flex flex-col gap-0.5 pt-1 pl-5",
|
|
113
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
114
|
+
initial: false,
|
|
115
|
+
children: steps.map((text, index) => {
|
|
116
|
+
const live = working && index === steps.length - 1;
|
|
117
|
+
return /* @__PURE__ */ jsxs(motion.li, {
|
|
118
|
+
"data-slot": "thinking-trace-step",
|
|
119
|
+
"data-live": live || void 0,
|
|
120
|
+
className: cn("flex items-start gap-2", live ? "text-foreground" : "text-muted-foreground"),
|
|
121
|
+
initial: reduced ? false : {
|
|
122
|
+
opacity: 0,
|
|
123
|
+
y: 4
|
|
124
|
+
},
|
|
125
|
+
animate: {
|
|
126
|
+
opacity: 1,
|
|
127
|
+
y: 0
|
|
128
|
+
},
|
|
129
|
+
transition: fade,
|
|
130
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
131
|
+
"aria-hidden": "true",
|
|
132
|
+
className: "mt-0.75 flex size-3 shrink-0 items-center justify-center",
|
|
133
|
+
children: live ? /* @__PURE__ */ jsx(LiveDot, { reduced }) : /* @__PURE__ */ jsx(CheckIcon, { className: "size-3" })
|
|
134
|
+
}), /* @__PURE__ */ jsx("span", { children: text })]
|
|
135
|
+
}, index);
|
|
136
|
+
})
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
}, "steps") : null
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ jsx("span", {
|
|
142
|
+
role: "status",
|
|
143
|
+
className: "sr-only",
|
|
144
|
+
children: working ? `${label}…` : doneLabel(elapsedText)
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const HEADER = "-mx-1 inline-flex w-fit items-center gap-1.5 rounded-md px-1 py-0.5 text-muted-foreground";
|
|
150
|
+
/** The toggle button over the steps, or plain text while there are none. */
|
|
151
|
+
function Header({ interactive, expanded, controls, onToggle, children }) {
|
|
152
|
+
if (!interactive) return /* @__PURE__ */ jsx("div", {
|
|
153
|
+
"data-slot": "thinking-trace-header",
|
|
154
|
+
className: HEADER,
|
|
155
|
+
children
|
|
156
|
+
});
|
|
157
|
+
return /* @__PURE__ */ jsx("button", {
|
|
158
|
+
type: "button",
|
|
159
|
+
"data-slot": "thinking-trace-trigger",
|
|
160
|
+
"aria-expanded": expanded,
|
|
161
|
+
"aria-controls": controls,
|
|
162
|
+
onClick: onToggle,
|
|
163
|
+
className: cn(HEADER, "outline-none transition-colors hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/50"),
|
|
164
|
+
children
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/** The pulsing dot beside the live step; steady under reduced motion. */
|
|
168
|
+
function LiveDot({ reduced }) {
|
|
169
|
+
const opacity = useLoop([
|
|
170
|
+
.35,
|
|
171
|
+
1,
|
|
172
|
+
.35
|
|
173
|
+
], { duration: 1.2 }, !reduced, .7);
|
|
174
|
+
return /* @__PURE__ */ jsx(motion.span, {
|
|
175
|
+
className: "size-1.5 rounded-full bg-current",
|
|
176
|
+
style: { opacity }
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/** Only the keys the caller actually set, so useControllableValue sees uncontrolled use. */
|
|
180
|
+
function pickExpandedProps(props) {
|
|
181
|
+
const picked = {};
|
|
182
|
+
for (const [key, value] of Object.entries(props)) if (value !== void 0) picked[key] = value;
|
|
183
|
+
return picked;
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
export { ThinkingTrace };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/motion/tool-call-chip/tool-call-chip.d.ts
|
|
3
|
+
export type ToolCallChipStatus = "running" | "success" | "error";
|
|
4
|
+
export interface ToolCallChipProps extends Omit<React.ComponentProps<"span">, "children" | "ref"> {
|
|
5
|
+
/** The tool's name, for example "bash". */
|
|
6
|
+
name: string;
|
|
7
|
+
/** A short argument summary, for example "npm test". */
|
|
8
|
+
detail?: string;
|
|
9
|
+
status: ToolCallChipStatus;
|
|
10
|
+
/** Leading icon. Defaults to a terminal glyph. */
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Duration in ms, from the app. When omitted the chip runs its own
|
|
14
|
+
* millisecond counter while running and freezes it after.
|
|
15
|
+
*/
|
|
16
|
+
elapsedMs?: number;
|
|
17
|
+
/** Shows a retry button in the error state. */
|
|
18
|
+
onRetry?: () => void;
|
|
19
|
+
/** Accessible label of the retry button. Defaults to "Retry <name>". */
|
|
20
|
+
retryLabel?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Make the chip a polite live region that announces its outcome. Off by
|
|
23
|
+
* default: a thread holds many chips, and each one live would flood screen
|
|
24
|
+
* readers. Turn it on for a chip shown alone, or announce from the thread.
|
|
25
|
+
*/
|
|
26
|
+
announce?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* An inline tool-call chip for a conversation thread: a fill sweeps it while
|
|
30
|
+
* the call runs with a live millisecond counter, a success wash settles it, and
|
|
31
|
+
* an error shakes once and offers a retry.
|
|
32
|
+
*
|
|
33
|
+
* Behavior reference: reactbits call-chip.
|
|
34
|
+
*/
|
|
35
|
+
export declare function ToolCallChip({ name, detail, status, icon, elapsedMs, onRetry, retryLabel, announce, className, ...props }: ToolCallChipProps): React.JSX.Element;
|
|
36
|
+
//#endregion
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { formatMilliseconds, useElapsed } from "../../lib/elapsed.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { CheckIcon, RotateCcwIcon, SquareTerminalIcon, XIcon } from "lucide-react";
|
|
6
|
+
import { animate, motion, useAnimate, useMotionValue, useReducedMotionConfig } from "motion/react";
|
|
7
|
+
//#region src/motion/tool-call-chip/tool-call-chip.tsx
|
|
8
|
+
const FILL_TAU_MS = 2400;
|
|
9
|
+
/**
|
|
10
|
+
* An inline tool-call chip for a conversation thread: a fill sweeps it while
|
|
11
|
+
* the call runs with a live millisecond counter, a success wash settles it, and
|
|
12
|
+
* an error shakes once and offers a retry.
|
|
13
|
+
*
|
|
14
|
+
* Behavior reference: reactbits call-chip.
|
|
15
|
+
*/
|
|
16
|
+
function ToolCallChip({ name, detail, status, icon, elapsedMs, onRetry, retryLabel, announce = false, className, ...props }) {
|
|
17
|
+
const reduced = useReducedMotionConfig() ?? false;
|
|
18
|
+
const [scope, animate$1] = useAnimate();
|
|
19
|
+
const runFill = useMotionValue(0);
|
|
20
|
+
const clock = useElapsed(status === "running", elapsedMs, formatMilliseconds, {
|
|
21
|
+
tick: 47,
|
|
22
|
+
onTick: (ms) => runFill.set(1 - Math.exp(-ms / FILL_TAU_MS))
|
|
23
|
+
});
|
|
24
|
+
const time = clock.text;
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
if (status === "running") {
|
|
27
|
+
if (elapsedMs !== void 0) runFill.set(1 - Math.exp(-elapsedMs / FILL_TAU_MS));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (reduced) {
|
|
31
|
+
runFill.set(1);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const controls = animate(runFill, 1, {
|
|
35
|
+
duration: .18,
|
|
36
|
+
ease: "easeOut"
|
|
37
|
+
});
|
|
38
|
+
return () => controls.stop();
|
|
39
|
+
}, [
|
|
40
|
+
status,
|
|
41
|
+
reduced,
|
|
42
|
+
elapsedMs,
|
|
43
|
+
runFill
|
|
44
|
+
]);
|
|
45
|
+
const outcome = status === "running" ? `${name} running` : status === "success" ? `${name} succeeded in ${time}` : `${name} failed after ${time}`;
|
|
46
|
+
React.useEffect(() => {
|
|
47
|
+
if (status !== "error" || reduced || !scope.current) return;
|
|
48
|
+
const controls = animate$1(scope.current, { x: [
|
|
49
|
+
0,
|
|
50
|
+
-4,
|
|
51
|
+
4,
|
|
52
|
+
-3,
|
|
53
|
+
3,
|
|
54
|
+
0
|
|
55
|
+
] }, { duration: .36 });
|
|
56
|
+
return () => controls.stop();
|
|
57
|
+
}, [
|
|
58
|
+
status,
|
|
59
|
+
reduced,
|
|
60
|
+
animate$1,
|
|
61
|
+
scope
|
|
62
|
+
]);
|
|
63
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
64
|
+
ref: scope,
|
|
65
|
+
"data-slot": "tool-call-chip",
|
|
66
|
+
"data-status": status,
|
|
67
|
+
"data-motion": reduced ? "reduced" : "full",
|
|
68
|
+
className: cn("relative isolate inline-flex h-6 max-w-full items-center gap-1.5 overflow-hidden rounded-md border pl-2 align-middle text-xs/relaxed", status === "error" ? "border-destructive/40 bg-destructive/5 dark:bg-destructive/15" : "border-border bg-muted/60 dark:bg-input/30", onRetry && status === "error" ? "pr-0.5" : "pr-2", className),
|
|
69
|
+
...props,
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ jsx(motion.span, {
|
|
72
|
+
"aria-hidden": "true",
|
|
73
|
+
"data-slot": "tool-call-chip-fill",
|
|
74
|
+
className: "absolute inset-y-0 left-0 -z-10 w-full origin-left bg-linear-to-r from-foreground/6 from-60% to-transparent",
|
|
75
|
+
style: { scaleX: runFill },
|
|
76
|
+
initial: false,
|
|
77
|
+
animate: { opacity: status === "running" && !reduced ? 1 : 0 },
|
|
78
|
+
transition: reduced ? { duration: 0 } : {
|
|
79
|
+
duration: status === "running" ? .1 : .5,
|
|
80
|
+
delay: .18
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
status === "success" ? /* @__PURE__ */ jsx(motion.span, {
|
|
84
|
+
"aria-hidden": "true",
|
|
85
|
+
"data-slot": "tool-call-chip-wash",
|
|
86
|
+
className: "absolute inset-0 -z-10 bg-chart-2/15",
|
|
87
|
+
initial: { opacity: reduced ? 0 : 1 },
|
|
88
|
+
animate: { opacity: 0 },
|
|
89
|
+
transition: reduced ? { duration: 0 } : {
|
|
90
|
+
duration: .9,
|
|
91
|
+
delay: .15,
|
|
92
|
+
ease: "easeOut"
|
|
93
|
+
}
|
|
94
|
+
}) : null,
|
|
95
|
+
/* @__PURE__ */ jsx("span", {
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
className: cn("inline-flex shrink-0 [&_svg]:size-3.5", status === "success" && "text-chart-2", status === "error" && "text-destructive", status === "running" && "text-muted-foreground"),
|
|
98
|
+
children: status === "success" ? /* @__PURE__ */ jsx(CheckIcon, {}) : status === "error" ? /* @__PURE__ */ jsx(XIcon, {}) : icon ?? /* @__PURE__ */ jsx(SquareTerminalIcon, {})
|
|
99
|
+
}),
|
|
100
|
+
/* @__PURE__ */ jsx("span", {
|
|
101
|
+
className: "font-medium text-foreground",
|
|
102
|
+
children: name
|
|
103
|
+
}),
|
|
104
|
+
detail ? /* @__PURE__ */ jsx("span", {
|
|
105
|
+
className: "min-w-0 truncate text-muted-foreground",
|
|
106
|
+
children: detail
|
|
107
|
+
}) : null,
|
|
108
|
+
/* @__PURE__ */ jsx("span", {
|
|
109
|
+
"aria-hidden": "true",
|
|
110
|
+
ref: clock.textRef,
|
|
111
|
+
"data-slot": "tool-call-chip-time",
|
|
112
|
+
className: "shrink-0 font-mono text-[0.6875rem] text-muted-foreground tabular-nums",
|
|
113
|
+
children: time
|
|
114
|
+
}),
|
|
115
|
+
status === "error" && onRetry ? /* @__PURE__ */ jsx("button", {
|
|
116
|
+
type: "button",
|
|
117
|
+
"data-slot": "tool-call-chip-retry",
|
|
118
|
+
"aria-label": retryLabel ?? `Retry ${name}`,
|
|
119
|
+
onClick: onRetry,
|
|
120
|
+
className: "inline-flex size-[18px] shrink-0 items-center justify-center rounded-sm text-destructive outline-none transition-colors hover:bg-destructive/15 focus-visible:bg-destructive/15 focus-visible:ring-2 focus-visible:ring-destructive/50 focus-visible:ring-inset",
|
|
121
|
+
children: /* @__PURE__ */ jsx(RotateCcwIcon, {
|
|
122
|
+
"aria-hidden": "true",
|
|
123
|
+
className: "size-3"
|
|
124
|
+
})
|
|
125
|
+
}) : null,
|
|
126
|
+
/* @__PURE__ */ jsx("span", {
|
|
127
|
+
className: "sr-only",
|
|
128
|
+
...announce ? { role: "status" } : {},
|
|
129
|
+
children: outcome
|
|
130
|
+
})
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { ToolCallChip };
|