@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,290 @@
|
|
|
1
|
+
import { capturePointer } from "../../lib/pointer.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { useControllableValue } from "ahooks";
|
|
6
|
+
import { motion, useMotionValue, useReducedMotionConfig, useSpring, useTransform, useVelocity } from "motion/react";
|
|
7
|
+
//#region src/motion/dial/dial.tsx
|
|
8
|
+
const C = 50;
|
|
9
|
+
const R = 42;
|
|
10
|
+
const TRAIL = [
|
|
11
|
+
0,
|
|
12
|
+
1,
|
|
13
|
+
2,
|
|
14
|
+
3,
|
|
15
|
+
4,
|
|
16
|
+
5
|
|
17
|
+
];
|
|
18
|
+
function pointAt(angle) {
|
|
19
|
+
const rad = angle * Math.PI / 180;
|
|
20
|
+
return {
|
|
21
|
+
x: C + R * Math.sin(rad),
|
|
22
|
+
y: C - R * Math.cos(rad)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function arcPath(from, to) {
|
|
26
|
+
const a = pointAt(from);
|
|
27
|
+
const b = pointAt(to);
|
|
28
|
+
const large = to - from > 180 ? 1 : 0;
|
|
29
|
+
return `M ${a.x} ${a.y} A ${R} ${R} 0 ${large} 1 ${b.x} ${b.y}`;
|
|
30
|
+
}
|
|
31
|
+
function decimalsOf(step) {
|
|
32
|
+
const text = `${step}`;
|
|
33
|
+
return text.includes(".") ? text.split(".")[1]?.length ?? 0 : 0;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A circular value control for bounded settings (reasoning effort, a
|
|
37
|
+
* confidence floor). Tap a point, drag around the ring or flick it: the knob
|
|
38
|
+
* settles on a spring and leaves a short trail when it moves fast. A
|
|
39
|
+
* `role="slider"`: arrows step, Shift+arrows and PageUp/PageDown take large
|
|
40
|
+
* steps, Home and End go to the bounds.
|
|
41
|
+
*
|
|
42
|
+
* Behavior reference: reactbits comet-dial.
|
|
43
|
+
*/
|
|
44
|
+
function Dial({ value: _value, defaultValue: _defaultValue, onValueChange: _onValueChange, onValueCommit, min = 0, max = 100, step = 1, largeStep, label, unit, formatValue, size = 160, sweep = 270, disabled = false, className, ...props }) {
|
|
45
|
+
const reduced = useReducedMotionConfig() ?? false;
|
|
46
|
+
const labelId = React.useId();
|
|
47
|
+
const controllable = {};
|
|
48
|
+
if (_value !== void 0) controllable.value = _value;
|
|
49
|
+
if (_defaultValue !== void 0) controllable.defaultValue = _defaultValue;
|
|
50
|
+
if (_onValueChange) controllable.onValueChange = _onValueChange;
|
|
51
|
+
const [value, setValue] = useControllableValue(controllable, {
|
|
52
|
+
trigger: "onValueChange",
|
|
53
|
+
defaultValue: min
|
|
54
|
+
});
|
|
55
|
+
const start = -sweep / 2;
|
|
56
|
+
const range = max - min;
|
|
57
|
+
const big = largeStep ?? Math.max(step, Math.round(range / 10 / step) * step);
|
|
58
|
+
const decimals = decimalsOf(step);
|
|
59
|
+
const format = formatValue ?? ((v) => v.toFixed(decimals));
|
|
60
|
+
const snap = React.useCallback((raw) => {
|
|
61
|
+
const stepped = Math.round((raw - min) / step) * step + min;
|
|
62
|
+
return Number(Math.min(max, Math.max(min, stepped)).toFixed(decimals));
|
|
63
|
+
}, [
|
|
64
|
+
min,
|
|
65
|
+
max,
|
|
66
|
+
step,
|
|
67
|
+
decimals
|
|
68
|
+
]);
|
|
69
|
+
const target = useMotionValue(value);
|
|
70
|
+
const spring = useSpring(target, {
|
|
71
|
+
stiffness: 260,
|
|
72
|
+
damping: 26,
|
|
73
|
+
mass: .9
|
|
74
|
+
});
|
|
75
|
+
const display = reduced ? target : spring;
|
|
76
|
+
const velocity = useVelocity(display);
|
|
77
|
+
React.useEffect(() => {
|
|
78
|
+
target.set(value);
|
|
79
|
+
if (reduced) spring.jump(value);
|
|
80
|
+
}, [
|
|
81
|
+
value,
|
|
82
|
+
reduced,
|
|
83
|
+
target,
|
|
84
|
+
spring
|
|
85
|
+
]);
|
|
86
|
+
const fraction = useTransform(display, (v) => Math.min(1, Math.max(0, (v - min) / range)));
|
|
87
|
+
const angle = useTransform(fraction, (f) => start + f * sweep);
|
|
88
|
+
const knobX = useTransform(angle, (a) => pointAt(a).x);
|
|
89
|
+
const knobY = useTransform(angle, (a) => pointAt(a).y);
|
|
90
|
+
const spacing = useTransform(velocity, (v) => {
|
|
91
|
+
if (reduced) return 0;
|
|
92
|
+
const degPerSecond = v / range * sweep;
|
|
93
|
+
return Math.max(-7, Math.min(7, degPerSecond * .012));
|
|
94
|
+
});
|
|
95
|
+
const update = (next) => {
|
|
96
|
+
const snapped = snap(next);
|
|
97
|
+
if (snapped !== value) setValue(snapped);
|
|
98
|
+
return snapped;
|
|
99
|
+
};
|
|
100
|
+
const surface = React.useRef(null);
|
|
101
|
+
const drag = React.useRef(null);
|
|
102
|
+
const angleFromPointer = (event) => {
|
|
103
|
+
const rect = surface.current?.getBoundingClientRect();
|
|
104
|
+
if (!rect) return start;
|
|
105
|
+
const dx = event.clientX - (rect.left + rect.width / 2);
|
|
106
|
+
const dy = event.clientY - (rect.top + rect.height / 2);
|
|
107
|
+
return Math.atan2(dx, -dy) * 180 / Math.PI;
|
|
108
|
+
};
|
|
109
|
+
const valueFromAngle = (deg, previous) => {
|
|
110
|
+
const end = start + sweep;
|
|
111
|
+
let a = deg;
|
|
112
|
+
if (a < start || a > end) a = Math.abs((a - start + 540) % 360 - 180) < Math.abs((a - end + 540) % 360 - 180) ? start : end;
|
|
113
|
+
const raw = min + (a - start) / sweep * range;
|
|
114
|
+
if (drag.current && Math.abs(raw - previous) > range * .5) return previous > min + range / 2 ? max : min;
|
|
115
|
+
return raw;
|
|
116
|
+
};
|
|
117
|
+
const onPointerDown = (event) => {
|
|
118
|
+
if (disabled || event.button !== 0) return;
|
|
119
|
+
capturePointer(event.currentTarget, event.pointerId);
|
|
120
|
+
const deg = angleFromPointer(event);
|
|
121
|
+
const last = update(valueFromAngle(deg, value));
|
|
122
|
+
drag.current = {
|
|
123
|
+
samples: [{
|
|
124
|
+
t: performance.now(),
|
|
125
|
+
deg
|
|
126
|
+
}],
|
|
127
|
+
last
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
const onPointerMove = (event) => {
|
|
131
|
+
const state = drag.current;
|
|
132
|
+
if (!state) return;
|
|
133
|
+
const deg = angleFromPointer(event);
|
|
134
|
+
const now = performance.now();
|
|
135
|
+
state.samples.push({
|
|
136
|
+
t: now,
|
|
137
|
+
deg
|
|
138
|
+
});
|
|
139
|
+
state.samples = state.samples.filter((s, index, all) => now - s.t < 100 || index >= all.length - 2);
|
|
140
|
+
state.last = update(valueFromAngle(deg, state.last));
|
|
141
|
+
};
|
|
142
|
+
const onPointerUp = () => {
|
|
143
|
+
const state = drag.current;
|
|
144
|
+
drag.current = null;
|
|
145
|
+
if (!state) return;
|
|
146
|
+
let final = state.last;
|
|
147
|
+
const first = state.samples[0];
|
|
148
|
+
const last = state.samples[state.samples.length - 1];
|
|
149
|
+
if (first && last && performance.now() - last.t < 100 && last.t - first.t > 10) {
|
|
150
|
+
let delta = last.deg - first.deg;
|
|
151
|
+
if (delta > 180) delta -= 360;
|
|
152
|
+
if (delta < -180) delta += 360;
|
|
153
|
+
const degPerMs = delta / (last.t - first.t);
|
|
154
|
+
if (Math.abs(degPerMs) > .45) final = update(state.last + degPerMs * 140 / sweep * range);
|
|
155
|
+
}
|
|
156
|
+
onValueCommit?.(final);
|
|
157
|
+
};
|
|
158
|
+
const onKeyDown = (event) => {
|
|
159
|
+
if (disabled) return;
|
|
160
|
+
const unitStep = event.shiftKey ? big : step;
|
|
161
|
+
const next = {
|
|
162
|
+
ArrowRight: value + unitStep,
|
|
163
|
+
ArrowUp: value + unitStep,
|
|
164
|
+
ArrowLeft: value - unitStep,
|
|
165
|
+
ArrowDown: value - unitStep,
|
|
166
|
+
PageUp: value + big,
|
|
167
|
+
PageDown: value - big,
|
|
168
|
+
Home: min,
|
|
169
|
+
End: max
|
|
170
|
+
}[event.key];
|
|
171
|
+
if (next === void 0) return;
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
onValueCommit?.(update(next));
|
|
174
|
+
};
|
|
175
|
+
const readout = format(value);
|
|
176
|
+
const readoutSize = Math.round(Math.min(size * .2, size * .56 / (readout.length + (unit?.length ?? 0) * .5) / .6));
|
|
177
|
+
const labelSize = Math.max(9, Math.min(11, Math.round(size * .07)));
|
|
178
|
+
const end = start + sweep;
|
|
179
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
180
|
+
ref: surface,
|
|
181
|
+
role: "slider",
|
|
182
|
+
tabIndex: disabled ? void 0 : 0,
|
|
183
|
+
"aria-labelledby": labelId,
|
|
184
|
+
"aria-valuemin": min,
|
|
185
|
+
"aria-valuemax": max,
|
|
186
|
+
"aria-valuenow": value,
|
|
187
|
+
"aria-valuetext": unit ? `${readout}${unit}` : readout,
|
|
188
|
+
"aria-disabled": disabled || void 0,
|
|
189
|
+
"data-slot": "dial",
|
|
190
|
+
"data-motion": reduced ? "reduced" : "full",
|
|
191
|
+
className: cn("group/dial relative inline-flex shrink-0 touch-none items-center justify-center rounded-full outline-none select-none", disabled && "opacity-50", className),
|
|
192
|
+
style: {
|
|
193
|
+
width: size,
|
|
194
|
+
height: size
|
|
195
|
+
},
|
|
196
|
+
onPointerDown,
|
|
197
|
+
onPointerMove,
|
|
198
|
+
onPointerUp,
|
|
199
|
+
onPointerCancel: onPointerUp,
|
|
200
|
+
onKeyDown,
|
|
201
|
+
...props,
|
|
202
|
+
children: [/* @__PURE__ */ jsxs("svg", {
|
|
203
|
+
"aria-hidden": "true",
|
|
204
|
+
viewBox: "0 0 100 100",
|
|
205
|
+
className: "absolute inset-0 size-full overflow-visible",
|
|
206
|
+
children: [
|
|
207
|
+
/* @__PURE__ */ jsx("path", {
|
|
208
|
+
d: arcPath(start, end),
|
|
209
|
+
fill: "none",
|
|
210
|
+
strokeWidth: 4,
|
|
211
|
+
strokeLinecap: "round",
|
|
212
|
+
className: "stroke-foreground/12"
|
|
213
|
+
}),
|
|
214
|
+
/* @__PURE__ */ jsx(motion.path, {
|
|
215
|
+
"data-slot": "dial-value-arc",
|
|
216
|
+
d: arcPath(start, end),
|
|
217
|
+
fill: "none",
|
|
218
|
+
strokeWidth: 4,
|
|
219
|
+
strokeLinecap: "round",
|
|
220
|
+
className: "stroke-primary",
|
|
221
|
+
style: { pathLength: fraction }
|
|
222
|
+
}),
|
|
223
|
+
TRAIL.map((i) => /* @__PURE__ */ jsx(TrailDot, {
|
|
224
|
+
index: i,
|
|
225
|
+
angle,
|
|
226
|
+
spacing
|
|
227
|
+
}, i)),
|
|
228
|
+
/* @__PURE__ */ jsx(motion.circle, {
|
|
229
|
+
"data-slot": "dial-focus",
|
|
230
|
+
r: 9.5,
|
|
231
|
+
className: "fill-ring/50 opacity-0 group-focus-visible/dial:opacity-100",
|
|
232
|
+
style: {
|
|
233
|
+
cx: knobX,
|
|
234
|
+
cy: knobY
|
|
235
|
+
}
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ jsx(motion.circle, {
|
|
238
|
+
"data-slot": "dial-knob",
|
|
239
|
+
r: 6,
|
|
240
|
+
strokeWidth: 2.5,
|
|
241
|
+
className: "fill-primary stroke-background",
|
|
242
|
+
style: {
|
|
243
|
+
cx: knobX,
|
|
244
|
+
cy: knobY
|
|
245
|
+
}
|
|
246
|
+
})
|
|
247
|
+
]
|
|
248
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
249
|
+
className: "pointer-events-none relative flex flex-col items-center",
|
|
250
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
251
|
+
"aria-hidden": "true",
|
|
252
|
+
className: "flex items-baseline leading-none",
|
|
253
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
254
|
+
"data-slot": "dial-readout",
|
|
255
|
+
className: "font-semibold tracking-tight text-foreground tabular-nums",
|
|
256
|
+
style: { fontSize: readoutSize },
|
|
257
|
+
children: readout
|
|
258
|
+
}), unit ? /* @__PURE__ */ jsx("span", {
|
|
259
|
+
className: "ml-0.5 text-muted-foreground",
|
|
260
|
+
style: { fontSize: Math.round(size * .09) },
|
|
261
|
+
children: unit
|
|
262
|
+
}) : null]
|
|
263
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
264
|
+
id: labelId,
|
|
265
|
+
className: "mt-1.5 truncate text-center leading-none text-muted-foreground",
|
|
266
|
+
style: {
|
|
267
|
+
fontSize: labelSize,
|
|
268
|
+
maxWidth: size * .72
|
|
269
|
+
},
|
|
270
|
+
children: label
|
|
271
|
+
})]
|
|
272
|
+
})]
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
function TrailDot({ index, angle, spacing }) {
|
|
276
|
+
const cx = useTransform(() => pointAt(angle.get() - spacing.get() * (index + 1)).x);
|
|
277
|
+
const cy = useTransform(() => pointAt(angle.get() - spacing.get() * (index + 1)).y);
|
|
278
|
+
const opacity = useTransform(spacing, (s) => Math.min(1, Math.abs(s) / 3) * (.42 - index * .065));
|
|
279
|
+
return /* @__PURE__ */ jsx(motion.circle, {
|
|
280
|
+
r: 5 - index * .6,
|
|
281
|
+
className: "fill-primary",
|
|
282
|
+
style: {
|
|
283
|
+
cx,
|
|
284
|
+
cy,
|
|
285
|
+
opacity
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
//#endregion
|
|
290
|
+
export { Dial };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/motion/dictation-button/dictation-button.d.ts
|
|
3
|
+
export type DictationButtonMode = "toggle" | "hold";
|
|
4
|
+
export interface DictationButtonProps {
|
|
5
|
+
/** Whether dictation is running (controlled). */
|
|
6
|
+
recording?: boolean;
|
|
7
|
+
/** Whether dictation starts running (uncontrolled). */
|
|
8
|
+
defaultRecording?: boolean;
|
|
9
|
+
onRecordingChange?: (recording: boolean) => void;
|
|
10
|
+
/**
|
|
11
|
+
* `toggle` (default): press to start, press again to stop. `hold`: dictate
|
|
12
|
+
* while the pointer, Space or Enter is held, and slide left before letting
|
|
13
|
+
* go to cancel.
|
|
14
|
+
*/
|
|
15
|
+
mode?: DictationButtonMode;
|
|
16
|
+
/** The app's input level, 0 to 1. It drives the waveform; the button never opens a microphone. */
|
|
17
|
+
level?: number;
|
|
18
|
+
/** Dictation started. */
|
|
19
|
+
onStart?: () => void;
|
|
20
|
+
/** Dictation finished and should be kept. */
|
|
21
|
+
onStop?: () => void;
|
|
22
|
+
/** Dictation was cancelled (slide to cancel or Escape) and should be thrown away. */
|
|
23
|
+
onCancel?: () => void;
|
|
24
|
+
/** How far left, in pixels, a held pointer must slide to cancel. Default 64. */
|
|
25
|
+
cancelDistance?: number;
|
|
26
|
+
/** Accessible name. Default "Dictate". */
|
|
27
|
+
label?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A dictation control. Idle, it is a round microphone button; while
|
|
33
|
+
* dictating, it widens into a pill with a live waveform and a timer. The app
|
|
34
|
+
* owns the speech handling: it passes the input `level` and acts on
|
|
35
|
+
* `onStart`, `onStop` and `onCancel`.
|
|
36
|
+
*
|
|
37
|
+
* Toggle mode starts and stops on press (Enter or Space from the keyboard).
|
|
38
|
+
* Hold mode dictates while the pointer, Space or Enter is held; sliding the
|
|
39
|
+
* pointer left past `cancelDistance` before release cancels, and Escape
|
|
40
|
+
* cancels in either mode.
|
|
41
|
+
*
|
|
42
|
+
* Behavior reference: reactbits voice-pill.
|
|
43
|
+
*/
|
|
44
|
+
export declare function DictationButton(props: DictationButtonProps): React.JSX.Element;
|
|
45
|
+
//#endregion
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { ChevronLeftIcon, MicIcon } from "lucide-react";
|
|
5
|
+
import { useControllableValue, useInterval, useLatest } from "ahooks";
|
|
6
|
+
import { motion, useReducedMotionConfig } from "motion/react";
|
|
7
|
+
//#region src/motion/dictation-button/dictation-button.tsx
|
|
8
|
+
const BARS = 18;
|
|
9
|
+
const SAMPLE_MS = 70;
|
|
10
|
+
const PILL_SPRING = {
|
|
11
|
+
type: "spring",
|
|
12
|
+
stiffness: 520,
|
|
13
|
+
damping: 40
|
|
14
|
+
};
|
|
15
|
+
const clamp = (value) => Math.min(1, Math.max(0, Number.isFinite(value) ? value : 0));
|
|
16
|
+
function formatElapsed(ms) {
|
|
17
|
+
const total = Math.floor(ms / 1e3);
|
|
18
|
+
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
|
|
19
|
+
}
|
|
20
|
+
/** Centre bars stand taller, so a steady level still reads as a voice shape. */
|
|
21
|
+
const envelope = Array.from({ length: BARS }, (_, i) => {
|
|
22
|
+
const t = (i + .5) / BARS;
|
|
23
|
+
return .45 + .55 * Math.sin(Math.PI * t);
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* A dictation control. Idle, it is a round microphone button; while
|
|
27
|
+
* dictating, it widens into a pill with a live waveform and a timer. The app
|
|
28
|
+
* owns the speech handling: it passes the input `level` and acts on
|
|
29
|
+
* `onStart`, `onStop` and `onCancel`.
|
|
30
|
+
*
|
|
31
|
+
* Toggle mode starts and stops on press (Enter or Space from the keyboard).
|
|
32
|
+
* Hold mode dictates while the pointer, Space or Enter is held; sliding the
|
|
33
|
+
* pointer left past `cancelDistance` before release cancels, and Escape
|
|
34
|
+
* cancels in either mode.
|
|
35
|
+
*
|
|
36
|
+
* Behavior reference: reactbits voice-pill.
|
|
37
|
+
*/
|
|
38
|
+
function DictationButton(props) {
|
|
39
|
+
const { mode = "toggle", level = 0, onStart, onStop, onCancel, cancelDistance = 64, label = "Dictate", disabled = false, className } = props;
|
|
40
|
+
const [recording, setRecording] = useControllableValue(props, {
|
|
41
|
+
defaultValue: false,
|
|
42
|
+
valuePropName: "recording",
|
|
43
|
+
defaultValuePropName: "defaultRecording",
|
|
44
|
+
trigger: "onRecordingChange"
|
|
45
|
+
});
|
|
46
|
+
const reduced = useReducedMotionConfig() ?? false;
|
|
47
|
+
const levelRef = useLatest(level);
|
|
48
|
+
const callbacks = useLatest({
|
|
49
|
+
onStart,
|
|
50
|
+
onStop,
|
|
51
|
+
onCancel
|
|
52
|
+
});
|
|
53
|
+
const [history, setHistory] = React.useState(() => Array(BARS).fill(0));
|
|
54
|
+
const [startedAt, setStartedAt] = React.useState(null);
|
|
55
|
+
const [now, setNow] = React.useState(0);
|
|
56
|
+
const [slide, setSlide] = React.useState(0);
|
|
57
|
+
const [announcement, setAnnouncement] = React.useState("");
|
|
58
|
+
const pointerRef = React.useRef(null);
|
|
59
|
+
const keyHeldRef = React.useRef(false);
|
|
60
|
+
const [held, setHeld] = React.useState(false);
|
|
61
|
+
const hintId = React.useId();
|
|
62
|
+
const armedToCancel = slide <= -cancelDistance;
|
|
63
|
+
React.useEffect(() => {
|
|
64
|
+
if (recording) {
|
|
65
|
+
const t = performance.now();
|
|
66
|
+
setStartedAt(t);
|
|
67
|
+
setNow(t);
|
|
68
|
+
} else {
|
|
69
|
+
setStartedAt(null);
|
|
70
|
+
setSlide(0);
|
|
71
|
+
setHistory(Array(BARS).fill(0));
|
|
72
|
+
}
|
|
73
|
+
}, [recording]);
|
|
74
|
+
useInterval(() => {
|
|
75
|
+
setNow(performance.now());
|
|
76
|
+
if (!reduced) setHistory((previous) => [...previous.slice(1), clamp(levelRef.current)]);
|
|
77
|
+
}, recording ? SAMPLE_MS : void 0);
|
|
78
|
+
const start = () => {
|
|
79
|
+
if (disabled || recording) return;
|
|
80
|
+
setRecording(true);
|
|
81
|
+
setAnnouncement("Dictation started");
|
|
82
|
+
callbacks.current.onStart?.();
|
|
83
|
+
};
|
|
84
|
+
const stop = () => {
|
|
85
|
+
if (!recording) return;
|
|
86
|
+
setRecording(false);
|
|
87
|
+
setAnnouncement("Dictation stopped");
|
|
88
|
+
callbacks.current.onStop?.();
|
|
89
|
+
};
|
|
90
|
+
const cancel = () => {
|
|
91
|
+
if (!recording) return;
|
|
92
|
+
setRecording(false);
|
|
93
|
+
setAnnouncement("Dictation cancelled");
|
|
94
|
+
callbacks.current.onCancel?.();
|
|
95
|
+
};
|
|
96
|
+
const handleClick = () => {
|
|
97
|
+
if (mode !== "toggle") return;
|
|
98
|
+
if (recording) stop();
|
|
99
|
+
else start();
|
|
100
|
+
};
|
|
101
|
+
const handleKeyDown = (event) => {
|
|
102
|
+
if (event.key === "Escape" && recording) {
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
keyHeldRef.current = false;
|
|
105
|
+
setHeld(false);
|
|
106
|
+
cancel();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (mode === "hold" && (event.key === " " || event.key === "Enter")) {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
if (event.repeat || keyHeldRef.current) return;
|
|
112
|
+
keyHeldRef.current = true;
|
|
113
|
+
setHeld(true);
|
|
114
|
+
start();
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
const handleKeyUp = (event) => {
|
|
118
|
+
if (mode === "hold" && (event.key === " " || event.key === "Enter")) {
|
|
119
|
+
event.preventDefault();
|
|
120
|
+
if (!keyHeldRef.current) return;
|
|
121
|
+
keyHeldRef.current = false;
|
|
122
|
+
setHeld(false);
|
|
123
|
+
stop();
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const handlePointerDown = (event) => {
|
|
127
|
+
if (mode !== "hold" || disabled || event.button !== 0) return;
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
event.currentTarget.focus({ focusVisible: false });
|
|
130
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
131
|
+
pointerRef.current = {
|
|
132
|
+
id: event.pointerId,
|
|
133
|
+
x: event.clientX
|
|
134
|
+
};
|
|
135
|
+
setSlide(0);
|
|
136
|
+
setHeld(true);
|
|
137
|
+
start();
|
|
138
|
+
};
|
|
139
|
+
const handlePointerMove = (event) => {
|
|
140
|
+
const pointer = pointerRef.current;
|
|
141
|
+
if (!pointer || pointer.id !== event.pointerId) return;
|
|
142
|
+
setSlide(Math.min(0, event.clientX - pointer.x));
|
|
143
|
+
};
|
|
144
|
+
const endPointer = (event, cancelled) => {
|
|
145
|
+
const pointer = pointerRef.current;
|
|
146
|
+
if (!pointer || pointer.id !== event.pointerId) return;
|
|
147
|
+
pointerRef.current = null;
|
|
148
|
+
setHeld(false);
|
|
149
|
+
const dx = event.clientX - pointer.x;
|
|
150
|
+
if (cancelled || dx <= -cancelDistance) cancel();
|
|
151
|
+
else stop();
|
|
152
|
+
};
|
|
153
|
+
const bars = reduced ? envelope.map((shape) => shape * clamp(level)) : history;
|
|
154
|
+
const holding = mode === "hold" && recording && held;
|
|
155
|
+
const elapsed = startedAt === null ? 0 : now - startedAt;
|
|
156
|
+
const offset = reduced ? 0 : Math.max(slide, -cancelDistance * 1.25) * .5;
|
|
157
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
158
|
+
/* @__PURE__ */ jsx(motion.button, {
|
|
159
|
+
type: "button",
|
|
160
|
+
"aria-label": label,
|
|
161
|
+
"aria-pressed": recording,
|
|
162
|
+
"aria-describedby": hintId,
|
|
163
|
+
disabled,
|
|
164
|
+
"data-slot": "dictation-button",
|
|
165
|
+
"data-mode": mode,
|
|
166
|
+
"data-state": recording ? "recording" : "idle",
|
|
167
|
+
"data-cancel": armedToCancel ? "" : void 0,
|
|
168
|
+
"data-reduced-motion": reduced ? "" : void 0,
|
|
169
|
+
onClick: handleClick,
|
|
170
|
+
onKeyDown: handleKeyDown,
|
|
171
|
+
onKeyUp: handleKeyUp,
|
|
172
|
+
onPointerDown: handlePointerDown,
|
|
173
|
+
onPointerMove: handlePointerMove,
|
|
174
|
+
onPointerUp: (event) => endPointer(event, false),
|
|
175
|
+
onPointerCancel: (event) => endPointer(event, true),
|
|
176
|
+
onBlur: () => {
|
|
177
|
+
if (keyHeldRef.current) {
|
|
178
|
+
keyHeldRef.current = false;
|
|
179
|
+
setHeld(false);
|
|
180
|
+
stop();
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
initial: false,
|
|
184
|
+
animate: {
|
|
185
|
+
width: recording ? "auto" : 32,
|
|
186
|
+
x: offset
|
|
187
|
+
},
|
|
188
|
+
transition: reduced ? { duration: 0 } : PILL_SPRING,
|
|
189
|
+
className: cn("relative inline-flex h-8 shrink-0 touch-none items-center justify-center gap-2 overflow-hidden rounded-full outline-none select-none", "focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:opacity-50", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", recording ? "bg-muted px-2.5 text-foreground" : "bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground", armedToCancel && "bg-destructive/10 text-destructive", !reduced && "transition-colors", className),
|
|
190
|
+
children: recording ? /* @__PURE__ */ jsxs("span", {
|
|
191
|
+
"aria-hidden": "true",
|
|
192
|
+
className: "flex items-center gap-2 whitespace-nowrap",
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ jsxs("span", {
|
|
195
|
+
className: "relative flex size-2 shrink-0",
|
|
196
|
+
children: [reduced ? null : /* @__PURE__ */ jsx("span", {
|
|
197
|
+
"data-slot": "dictation-live-halo",
|
|
198
|
+
className: "absolute inset-0 animate-ping rounded-full bg-destructive/50"
|
|
199
|
+
}), /* @__PURE__ */ jsx("span", { className: "relative size-2 rounded-full bg-destructive" })]
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ jsx("span", {
|
|
202
|
+
"data-slot": "dictation-waveform",
|
|
203
|
+
className: "flex h-4 items-center gap-0.5",
|
|
204
|
+
children: bars.map((value, index) => /* @__PURE__ */ jsx("span", {
|
|
205
|
+
className: cn("w-0.5 rounded-full", armedToCancel ? "bg-destructive" : "bg-foreground/70"),
|
|
206
|
+
style: { height: `${Math.max(12, Math.round(value * 100))}%` }
|
|
207
|
+
}, index))
|
|
208
|
+
}),
|
|
209
|
+
holding ? /* @__PURE__ */ jsxs("span", {
|
|
210
|
+
className: cn("flex items-center text-xs", armedToCancel ? "text-destructive" : "text-muted-foreground"),
|
|
211
|
+
children: [/* @__PURE__ */ jsx(ChevronLeftIcon, { className: "size-3" }), armedToCancel ? "Release to cancel" : "Cancel"]
|
|
212
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
213
|
+
className: "min-w-7 text-xs text-muted-foreground tabular-nums",
|
|
214
|
+
children: formatElapsed(elapsed)
|
|
215
|
+
})
|
|
216
|
+
]
|
|
217
|
+
}) : /* @__PURE__ */ jsx(MicIcon, { "aria-hidden": "true" })
|
|
218
|
+
}),
|
|
219
|
+
/* @__PURE__ */ jsx("span", {
|
|
220
|
+
id: hintId,
|
|
221
|
+
className: "sr-only",
|
|
222
|
+
children: mode === "hold" ? "Hold to dictate, release to finish. Slide left or press Escape to cancel." : "Press to start or finish dictation. Escape cancels."
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsx("span", {
|
|
225
|
+
role: "status",
|
|
226
|
+
className: "sr-only",
|
|
227
|
+
children: announcement
|
|
228
|
+
})
|
|
229
|
+
] });
|
|
230
|
+
}
|
|
231
|
+
//#endregion
|
|
232
|
+
export { DictationButton };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/motion/hold-button/hold-button.d.ts
|
|
3
|
+
export type HoldButtonVariant = "default" | "destructive";
|
|
4
|
+
export type HoldButtonSize = "sm" | "default" | "lg";
|
|
5
|
+
export interface HoldButtonProps extends Omit<React.ComponentProps<"button">, "children" | "onClick" | "type" | "onPointerDown" | "onKeyDown" | "onKeyUp" | "ref"> {
|
|
6
|
+
/** The idle label, for example "Hold to delete". */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/** Shown once the hold completes. */
|
|
9
|
+
doneLabel?: React.ReactNode;
|
|
10
|
+
/** Leading icon in the idle state. */
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/** How long the press must last to confirm, in ms. */
|
|
13
|
+
holdDuration?: number;
|
|
14
|
+
/** How long an early release takes to retract the fill, in ms. */
|
|
15
|
+
releaseDuration?: number;
|
|
16
|
+
/** A press released sooner than this (ms) is a tap: `onTap` runs and the fill retracts. */
|
|
17
|
+
tapThreshold?: number;
|
|
18
|
+
/** How long the done state shows before the button resets, in ms. */
|
|
19
|
+
resetAfter?: number;
|
|
20
|
+
/** `destructive` fills with the destructive token. */
|
|
21
|
+
variant?: HoldButtonVariant;
|
|
22
|
+
size?: HoldButtonSize;
|
|
23
|
+
/** Runs once when a hold completes. */
|
|
24
|
+
onHold: () => void;
|
|
25
|
+
/** Runs on a short press: a tap, not a hold. Use it to explain the hold. */
|
|
26
|
+
onTap?: () => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Press and hold to confirm. A fill sweeps across the button for
|
|
30
|
+
* `holdDuration`; releasing early retracts it, and a short tap calls `onTap`
|
|
31
|
+
* instead. Keyboard: hold Space or Enter, Escape cancels. Use it for
|
|
32
|
+
* dangerous tool calls and irreversible actions.
|
|
33
|
+
*
|
|
34
|
+
* Behavior reference: reactbits hold-button.
|
|
35
|
+
*/
|
|
36
|
+
export declare function HoldButton({ children, doneLabel, icon, holdDuration, releaseDuration, tapThreshold, resetAfter, variant, size, onHold, onTap, disabled, className, style, onBlur, onPointerUp, onPointerCancel, "aria-describedby": describedBy, ...props }: HoldButtonProps): React.JSX.Element;
|
|
37
|
+
//#endregion
|