@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,192 @@
|
|
|
1
|
+
import { capturePointer } from "../../lib/pointer.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { CheckIcon } from "lucide-react";
|
|
6
|
+
import { useUnmount } from "ahooks";
|
|
7
|
+
import { animate, motion, useMotionValue, useReducedMotionConfig, useTransform } from "motion/react";
|
|
8
|
+
//#region src/motion/hold-button/hold-button.tsx
|
|
9
|
+
const HEIGHTS = {
|
|
10
|
+
sm: "h-6",
|
|
11
|
+
default: "h-7",
|
|
12
|
+
lg: "h-8"
|
|
13
|
+
};
|
|
14
|
+
const INNER = {
|
|
15
|
+
sm: "gap-1 px-2 [&_svg:not([class*='size-'])]:size-3",
|
|
16
|
+
default: "gap-1.5 px-2.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
17
|
+
lg: "gap-1.5 px-3 [&_svg:not([class*='size-'])]:size-4"
|
|
18
|
+
};
|
|
19
|
+
function seconds(ms) {
|
|
20
|
+
const value = ms / 1e3;
|
|
21
|
+
return `${Number.isInteger(value) ? value : value.toFixed(1)} second${value === 1 ? "" : "s"}`;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Press and hold to confirm. A fill sweeps across the button for
|
|
25
|
+
* `holdDuration`; releasing early retracts it, and a short tap calls `onTap`
|
|
26
|
+
* instead. Keyboard: hold Space or Enter, Escape cancels. Use it for
|
|
27
|
+
* dangerous tool calls and irreversible actions.
|
|
28
|
+
*
|
|
29
|
+
* Behavior reference: reactbits hold-button.
|
|
30
|
+
*/
|
|
31
|
+
function HoldButton({ children, doneLabel = "Done", icon, holdDuration = 1500, releaseDuration = 300, tapThreshold = 200, resetAfter = 1200, variant = "default", size = "default", onHold, onTap, disabled, className, style, onBlur, onPointerUp, onPointerCancel, "aria-describedby": describedBy, ...props }) {
|
|
32
|
+
const reduced = useReducedMotionConfig() ?? false;
|
|
33
|
+
const hintId = React.useId();
|
|
34
|
+
const progress = useMotionValue(0);
|
|
35
|
+
const [phase, setPhase] = React.useState("idle");
|
|
36
|
+
const phaseRef = React.useRef("idle");
|
|
37
|
+
const buttonRef = React.useRef(null);
|
|
38
|
+
const [doneWidth, setDoneWidth] = React.useState();
|
|
39
|
+
const pressStart = React.useRef(0);
|
|
40
|
+
const animation = React.useRef(null);
|
|
41
|
+
const resetTimer = React.useRef(null);
|
|
42
|
+
const activeKey = React.useRef(null);
|
|
43
|
+
const pressed = React.useRef(false);
|
|
44
|
+
const clip = useTransform(progress, (p) => `inset(0 ${(1 - p) * 100}% 0 0)`);
|
|
45
|
+
const fillOpacity = useTransform(progress, (p) => reduced ? p : 1);
|
|
46
|
+
const setPhaseBoth = (next) => {
|
|
47
|
+
phaseRef.current = next;
|
|
48
|
+
setPhase(next);
|
|
49
|
+
};
|
|
50
|
+
useUnmount(() => {
|
|
51
|
+
animation.current?.stop();
|
|
52
|
+
if (resetTimer.current) clearTimeout(resetTimer.current);
|
|
53
|
+
});
|
|
54
|
+
const complete = () => {
|
|
55
|
+
setDoneWidth(buttonRef.current?.offsetWidth);
|
|
56
|
+
setPhaseBoth("done");
|
|
57
|
+
onHold();
|
|
58
|
+
resetTimer.current = setTimeout(() => {
|
|
59
|
+
resetTimer.current = null;
|
|
60
|
+
progress.set(0);
|
|
61
|
+
setPhaseBoth("idle");
|
|
62
|
+
}, resetAfter);
|
|
63
|
+
};
|
|
64
|
+
/** Confirms at once. For assistive-tech activation, which arrives as a bare click and cannot hold. */
|
|
65
|
+
const confirmNow = () => {
|
|
66
|
+
if (disabled || phaseRef.current !== "idle") return;
|
|
67
|
+
animation.current?.stop();
|
|
68
|
+
progress.set(1);
|
|
69
|
+
complete();
|
|
70
|
+
};
|
|
71
|
+
const start = () => {
|
|
72
|
+
if (disabled || phaseRef.current !== "idle") return;
|
|
73
|
+
pressStart.current = performance.now();
|
|
74
|
+
setPhaseBoth("holding");
|
|
75
|
+
animation.current?.stop();
|
|
76
|
+
animation.current = animate(progress, 1, {
|
|
77
|
+
duration: (1 - progress.get()) * holdDuration / 1e3,
|
|
78
|
+
ease: "linear",
|
|
79
|
+
onComplete: complete
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
/** Ends a press. `asTap` is false for a cancel (Escape, blur, pointer leaving). */
|
|
83
|
+
const release = (asTap) => {
|
|
84
|
+
if (phaseRef.current !== "holding") return;
|
|
85
|
+
animation.current?.stop();
|
|
86
|
+
setPhaseBoth("idle");
|
|
87
|
+
animation.current = animate(progress, 0, {
|
|
88
|
+
duration: releaseDuration / 1e3,
|
|
89
|
+
ease: "easeOut"
|
|
90
|
+
});
|
|
91
|
+
if (asTap && performance.now() - pressStart.current < tapThreshold) onTap?.();
|
|
92
|
+
};
|
|
93
|
+
const filled = variant === "destructive" ? "bg-destructive text-background" : "bg-primary text-primary-foreground";
|
|
94
|
+
const content = (state) => state === "done" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CheckIcon, { "aria-hidden": "true" }), doneLabel] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [icon, children] });
|
|
95
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
96
|
+
/* @__PURE__ */ jsxs("button", {
|
|
97
|
+
ref: buttonRef,
|
|
98
|
+
type: "button",
|
|
99
|
+
"data-slot": "hold-button",
|
|
100
|
+
"data-phase": phase,
|
|
101
|
+
"data-variant": variant,
|
|
102
|
+
"data-motion": reduced ? "reduced" : "full",
|
|
103
|
+
disabled,
|
|
104
|
+
"aria-describedby": describedBy ? `${hintId} ${describedBy}` : hintId,
|
|
105
|
+
className: cn("relative isolate inline-flex shrink-0 touch-none items-center justify-center overflow-hidden rounded-md border text-xs/relaxed font-medium whitespace-nowrap outline-none select-none", "border-border bg-background text-foreground dark:bg-input/30", "transition-[color,box-shadow,border-color,scale] duration-150 hover:bg-input/50 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", !reduced && "data-[phase=holding]:scale-[0.97]", "disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", variant === "destructive" && "border-destructive/30 text-destructive focus-visible:border-destructive/50 focus-visible:ring-destructive/30", HEIGHTS[size], INNER[size], className),
|
|
106
|
+
onPointerDown: (event) => {
|
|
107
|
+
if (event.button !== 0) return;
|
|
108
|
+
pressed.current = true;
|
|
109
|
+
capturePointer(event.currentTarget, event.pointerId);
|
|
110
|
+
start();
|
|
111
|
+
},
|
|
112
|
+
onPointerUp: (event) => {
|
|
113
|
+
onPointerUp?.(event);
|
|
114
|
+
release(true);
|
|
115
|
+
},
|
|
116
|
+
onPointerCancel: (event) => {
|
|
117
|
+
onPointerCancel?.(event);
|
|
118
|
+
pressed.current = false;
|
|
119
|
+
release(false);
|
|
120
|
+
},
|
|
121
|
+
onClick: (event) => {
|
|
122
|
+
const fromPress = pressed.current && event.detail !== 0;
|
|
123
|
+
pressed.current = false;
|
|
124
|
+
if (!fromPress) confirmNow();
|
|
125
|
+
},
|
|
126
|
+
onKeyDown: (event) => {
|
|
127
|
+
if (event.key === "Escape") {
|
|
128
|
+
if (phaseRef.current === "holding") event.preventDefault();
|
|
129
|
+
release(false);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (event.key !== " " && event.key !== "Enter") return;
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
if (event.repeat || activeKey.current !== null) return;
|
|
135
|
+
activeKey.current = event.key;
|
|
136
|
+
pressed.current = true;
|
|
137
|
+
start();
|
|
138
|
+
},
|
|
139
|
+
onKeyUp: (event) => {
|
|
140
|
+
if (event.key !== activeKey.current) return;
|
|
141
|
+
event.preventDefault();
|
|
142
|
+
activeKey.current = null;
|
|
143
|
+
pressed.current = false;
|
|
144
|
+
release(true);
|
|
145
|
+
},
|
|
146
|
+
onBlur: (event) => {
|
|
147
|
+
onBlur?.(event);
|
|
148
|
+
activeKey.current = null;
|
|
149
|
+
pressed.current = false;
|
|
150
|
+
release(false);
|
|
151
|
+
},
|
|
152
|
+
style: phase === "done" && doneWidth ? {
|
|
153
|
+
...style,
|
|
154
|
+
minWidth: doneWidth
|
|
155
|
+
} : style,
|
|
156
|
+
...props,
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ jsx("span", {
|
|
159
|
+
className: "sr-only",
|
|
160
|
+
children
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ jsx("span", {
|
|
163
|
+
"aria-hidden": "true",
|
|
164
|
+
className: "contents",
|
|
165
|
+
children: content(phase)
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ jsx(motion.span, {
|
|
168
|
+
"aria-hidden": "true",
|
|
169
|
+
"data-slot": "hold-button-fill",
|
|
170
|
+
className: cn("pointer-events-none absolute inset-0 inline-flex items-center justify-center", INNER[size], filled),
|
|
171
|
+
style: {
|
|
172
|
+
clipPath: reduced ? void 0 : clip,
|
|
173
|
+
opacity: phase === "done" ? 1 : fillOpacity
|
|
174
|
+
},
|
|
175
|
+
children: content(phase)
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ jsx("span", {
|
|
180
|
+
id: hintId,
|
|
181
|
+
hidden: true,
|
|
182
|
+
children: `Press and hold for ${seconds(holdDuration)} to confirm.`
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ jsx("span", {
|
|
185
|
+
role: "status",
|
|
186
|
+
className: "sr-only",
|
|
187
|
+
children: phase === "done" ? doneLabel : ""
|
|
188
|
+
})
|
|
189
|
+
] });
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
export { HoldButton };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/motion/masonry-grid/masonry-grid.d.ts
|
|
3
|
+
export interface MasonryGridItem {
|
|
4
|
+
id: string;
|
|
5
|
+
src: string;
|
|
6
|
+
/** Required: describe the image, or pass "" for a purely decorative one. */
|
|
7
|
+
alt: string;
|
|
8
|
+
/** Intrinsic width, for the aspect ratio. */
|
|
9
|
+
width: number;
|
|
10
|
+
/** Intrinsic height, for the aspect ratio. */
|
|
11
|
+
height: number;
|
|
12
|
+
/** Renders the tile as a link. */
|
|
13
|
+
href?: string;
|
|
14
|
+
/** Accessible name of the tile's link or button. Defaults to `alt`. */
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface MasonryGridProps {
|
|
18
|
+
items: readonly MasonryGridItem[];
|
|
19
|
+
/** Renders tiles without `href` as buttons that call this. */
|
|
20
|
+
onSelect?: (item: MasonryGridItem) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Column count, or a function of the grid's width in pixels. Default: 2
|
|
23
|
+
* under 480px, 3 under 768px, 4 under 1100px, otherwise 5.
|
|
24
|
+
*/
|
|
25
|
+
columns?: number | ((width: number) => number);
|
|
26
|
+
/** Gap between tiles, in pixels. Default 12. */
|
|
27
|
+
gap?: number;
|
|
28
|
+
/** Accessible name of the list. */
|
|
29
|
+
label?: string;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A responsive masonry of images: each tile drops into the shortest column.
|
|
34
|
+
* Tiles fade up into place, glide to their new spots when the column count
|
|
35
|
+
* changes, and scale up a little under the pointer or keyboard focus. Tiles
|
|
36
|
+
* are real images with alt text, inside links (`href`) or buttons
|
|
37
|
+
* (`onSelect`) when they do something; DOM order is item order.
|
|
38
|
+
*
|
|
39
|
+
* Behavior reference: reactbits masonry.
|
|
40
|
+
*/
|
|
41
|
+
export declare function MasonryGrid({ items, onSelect, columns, gap, label, className }: MasonryGridProps): React.JSX.Element;
|
|
42
|
+
//#endregion
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { useLatest, useSize } from "ahooks";
|
|
5
|
+
import { motion, useReducedMotionConfig } from "motion/react";
|
|
6
|
+
//#region src/motion/masonry-grid/masonry-grid.tsx
|
|
7
|
+
const MOVE = {
|
|
8
|
+
type: "spring",
|
|
9
|
+
stiffness: 260,
|
|
10
|
+
damping: 32,
|
|
11
|
+
mass: .9
|
|
12
|
+
};
|
|
13
|
+
const HOVER = {
|
|
14
|
+
type: "spring",
|
|
15
|
+
stiffness: 400,
|
|
16
|
+
damping: 28
|
|
17
|
+
};
|
|
18
|
+
const LIFT = 1.02;
|
|
19
|
+
const FADE_S = .2;
|
|
20
|
+
const STAGGER_S = .03;
|
|
21
|
+
const STAGGER_MAX = 8;
|
|
22
|
+
function defaultColumns(width) {
|
|
23
|
+
if (width < 480) return 2;
|
|
24
|
+
if (width < 768) return 3;
|
|
25
|
+
if (width < 1100) return 4;
|
|
26
|
+
return 5;
|
|
27
|
+
}
|
|
28
|
+
/** Shortest-column placement: each item goes under the shortest column so far. */
|
|
29
|
+
function place(items, width, columns, gap) {
|
|
30
|
+
const count = Math.max(1, Math.floor(columns));
|
|
31
|
+
const w = (width - gap * (count - 1)) / count;
|
|
32
|
+
const heights = Array(count).fill(0);
|
|
33
|
+
return {
|
|
34
|
+
placed: items.map((item) => {
|
|
35
|
+
let column = 0;
|
|
36
|
+
for (let c = 1; c < count; c++) if ((heights[c] ?? 0) < (heights[column] ?? 0)) column = c;
|
|
37
|
+
const h = item.width > 0 ? w * item.height / item.width : w;
|
|
38
|
+
const y = heights[column] ?? 0;
|
|
39
|
+
heights[column] = y + h + gap;
|
|
40
|
+
return {
|
|
41
|
+
item,
|
|
42
|
+
x: column * (w + gap),
|
|
43
|
+
y,
|
|
44
|
+
w,
|
|
45
|
+
h
|
|
46
|
+
};
|
|
47
|
+
}),
|
|
48
|
+
height: Math.max(0, Math.max(...heights) - gap)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A responsive masonry of images: each tile drops into the shortest column.
|
|
53
|
+
* Tiles fade up into place, glide to their new spots when the column count
|
|
54
|
+
* changes, and scale up a little under the pointer or keyboard focus. Tiles
|
|
55
|
+
* are real images with alt text, inside links (`href`) or buttons
|
|
56
|
+
* (`onSelect`) when they do something; DOM order is item order.
|
|
57
|
+
*
|
|
58
|
+
* Behavior reference: reactbits masonry.
|
|
59
|
+
*/
|
|
60
|
+
function MasonryGrid({ items, onSelect, columns = defaultColumns, gap = 12, label, className }) {
|
|
61
|
+
const reduced = useReducedMotionConfig() ?? false;
|
|
62
|
+
const rootRef = React.useRef(null);
|
|
63
|
+
const width = useSize(rootRef)?.width ?? 0;
|
|
64
|
+
const count = typeof columns === "function" ? columns(width) : columns;
|
|
65
|
+
const { placed, height } = React.useMemo(() => place(items, width, count, gap), [
|
|
66
|
+
items,
|
|
67
|
+
width,
|
|
68
|
+
count,
|
|
69
|
+
gap
|
|
70
|
+
]);
|
|
71
|
+
const onSelectRef = useLatest(onSelect);
|
|
72
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
73
|
+
ref: rootRef,
|
|
74
|
+
"aria-label": label,
|
|
75
|
+
"data-slot": "masonry-grid",
|
|
76
|
+
"data-columns": count,
|
|
77
|
+
"data-reduced-motion": reduced ? "" : void 0,
|
|
78
|
+
className: cn("relative w-full", className),
|
|
79
|
+
style: { height },
|
|
80
|
+
children: width > 0 ? placed.map(({ item, x, y, w, h }, index) => {
|
|
81
|
+
const tileClass = "block size-full overflow-hidden rounded-lg bg-muted outline-none ring-1 ring-foreground/10 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background";
|
|
82
|
+
const image = /* @__PURE__ */ jsx("img", {
|
|
83
|
+
src: item.src,
|
|
84
|
+
alt: item.alt,
|
|
85
|
+
width: item.width,
|
|
86
|
+
height: item.height,
|
|
87
|
+
loading: "lazy",
|
|
88
|
+
draggable: false,
|
|
89
|
+
className: "size-full object-cover"
|
|
90
|
+
});
|
|
91
|
+
const lift = reduced ? {} : {
|
|
92
|
+
whileHover: { scale: LIFT },
|
|
93
|
+
whileFocus: { scale: LIFT },
|
|
94
|
+
transition: HOVER
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ jsx(motion.li, {
|
|
97
|
+
"data-slot": "masonry-grid-item",
|
|
98
|
+
className: "absolute top-0 left-0 hover:z-10 focus-within:z-10",
|
|
99
|
+
initial: reduced ? false : {
|
|
100
|
+
opacity: 0,
|
|
101
|
+
x,
|
|
102
|
+
y: y + 24,
|
|
103
|
+
width: w,
|
|
104
|
+
height: h
|
|
105
|
+
},
|
|
106
|
+
animate: {
|
|
107
|
+
opacity: 1,
|
|
108
|
+
x,
|
|
109
|
+
y,
|
|
110
|
+
width: w,
|
|
111
|
+
height: h
|
|
112
|
+
},
|
|
113
|
+
transition: reduced ? { duration: 0 } : {
|
|
114
|
+
...MOVE,
|
|
115
|
+
opacity: {
|
|
116
|
+
duration: FADE_S,
|
|
117
|
+
delay: Math.min(index, STAGGER_MAX) * STAGGER_S
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
children: item.href ? /* @__PURE__ */ jsx(motion.a, {
|
|
121
|
+
href: item.href,
|
|
122
|
+
"aria-label": item.label,
|
|
123
|
+
"data-slot": "masonry-grid-tile",
|
|
124
|
+
className: tileClass,
|
|
125
|
+
...lift,
|
|
126
|
+
children: image
|
|
127
|
+
}) : onSelect ? /* @__PURE__ */ jsx(motion.button, {
|
|
128
|
+
type: "button",
|
|
129
|
+
"aria-label": item.label,
|
|
130
|
+
"data-slot": "masonry-grid-tile",
|
|
131
|
+
className: tileClass,
|
|
132
|
+
onClick: () => onSelectRef.current?.(item),
|
|
133
|
+
...lift,
|
|
134
|
+
children: image
|
|
135
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
136
|
+
"data-slot": "masonry-grid-tile",
|
|
137
|
+
className: tileClass,
|
|
138
|
+
children: image
|
|
139
|
+
})
|
|
140
|
+
}, item.id);
|
|
141
|
+
}) : null
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
//#endregion
|
|
145
|
+
export { MasonryGrid };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/motion/prompt-composer/prompt-composer.d.ts
|
|
3
|
+
/** Something the prompt can reference with `@`, such as a file, a thread or a tool. */
|
|
4
|
+
export interface PromptComposerSource {
|
|
5
|
+
id: string;
|
|
6
|
+
/** Inserted after `@`, so keep it free of spaces to read as one token. */
|
|
7
|
+
label: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
/** A lucide icon. */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** A `/` command, valid at the start of the prompt. */
|
|
13
|
+
export interface PromptComposerCommand {
|
|
14
|
+
id: string;
|
|
15
|
+
/** Inserted after `/`. */
|
|
16
|
+
label: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
icon?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export interface PromptComposerOption {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Everything besides the text that `onSend` reports. */
|
|
26
|
+
export interface PromptComposerSendDetail {
|
|
27
|
+
/** Sources whose `@label` token is still in the text. */
|
|
28
|
+
sources: PromptComposerSource[];
|
|
29
|
+
/** The command the text starts with, if any. */
|
|
30
|
+
command: PromptComposerCommand | null;
|
|
31
|
+
model?: string;
|
|
32
|
+
effort?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface PromptComposerProps {
|
|
35
|
+
/** The prompt text (controlled). */
|
|
36
|
+
value?: string;
|
|
37
|
+
/** The starting prompt text (uncontrolled). */
|
|
38
|
+
defaultValue?: string;
|
|
39
|
+
onValueChange?: (value: string) => void;
|
|
40
|
+
/** Sends the prompt. Enter sends; Shift+Enter adds a line. Uncontrolled text clears after. */
|
|
41
|
+
onSend: (text: string, detail: PromptComposerSendDetail) => void;
|
|
42
|
+
/** A run is in flight: the send button becomes Stop and Enter no longer sends. */
|
|
43
|
+
busy?: boolean;
|
|
44
|
+
/** Stops the run in flight. */
|
|
45
|
+
onStop?: () => void;
|
|
46
|
+
/** Shows an attach button that calls this. The app opens its own picker. */
|
|
47
|
+
onAttach?: () => void;
|
|
48
|
+
/** What `@` offers. */
|
|
49
|
+
sources?: readonly PromptComposerSource[];
|
|
50
|
+
/** What `/` offers at the start of the prompt. */
|
|
51
|
+
commands?: readonly PromptComposerCommand[];
|
|
52
|
+
/** Model choices. The picker shows when there are any. */
|
|
53
|
+
models?: readonly PromptComposerOption[];
|
|
54
|
+
/**
|
|
55
|
+
* A model picker of the app's own, such as a ScrubSelect, shown where the
|
|
56
|
+
* built-in one goes. It replaces the built-in picker; the app owns its value.
|
|
57
|
+
*/
|
|
58
|
+
modelPicker?: React.ReactNode;
|
|
59
|
+
model?: string;
|
|
60
|
+
defaultModel?: string;
|
|
61
|
+
onModelChange?: (model: string) => void;
|
|
62
|
+
/** Reasoning-effort choices. The picker shows when there are any. */
|
|
63
|
+
efforts?: readonly PromptComposerOption[];
|
|
64
|
+
effort?: string;
|
|
65
|
+
defaultEffort?: string;
|
|
66
|
+
onEffortChange?: (effort: string) => void;
|
|
67
|
+
/** A slot before the send button, for a `DictationButton`. */
|
|
68
|
+
dictation?: React.ReactNode;
|
|
69
|
+
placeholder?: string;
|
|
70
|
+
/** Accessible name of the text box. Default "Prompt". */
|
|
71
|
+
label?: string;
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A chat composer: `@` opens a source menu and `/` (at the start) a command
|
|
77
|
+
* menu, with model and effort pickers, an attach button, a dictation slot and
|
|
78
|
+
* a send button that becomes Stop while a run is in flight. Enter sends and
|
|
79
|
+
* Shift+Enter adds a line.
|
|
80
|
+
*
|
|
81
|
+
* The text box drives the menus as an autocomplete text box: it carries
|
|
82
|
+
* `aria-autocomplete`, `aria-controls` and `aria-activedescendant`, so the
|
|
83
|
+
* highlighted option is announced while focus stays in the text.
|
|
84
|
+
*
|
|
85
|
+
* It does no I/O: `onSend(text, detail)`, `onStop` and `onAttach` go to the app.
|
|
86
|
+
*
|
|
87
|
+
* Behavior reference: reactbits prompt-bar.
|
|
88
|
+
*/
|
|
89
|
+
export declare function PromptComposer(props: PromptComposerProps): React.JSX.Element;
|
|
90
|
+
//#endregion
|