@dungle-scrubs/admin-ui-soft 0.0.0-stage → 0.1.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 +131 -3
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { inkButton, mono, paper } from "./surfaces.js";
|
|
5
|
+
import { clamp } from "../utils/range.js";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { CheckIcon, Loader2Icon } from "lucide-react";
|
|
9
|
+
//#region src/components/assistant-ui/elements/option-list.tsx
|
|
10
|
+
var option_list_exports = /* @__PURE__ */ __exportAll({ OptionList: () => OptionList });
|
|
11
|
+
const row = "flex w-full items-start gap-2.5 rounded-xl px-2 py-2 text-start transition-colors outline-none focus-visible:ring-1 focus-visible:ring-foreground/20";
|
|
12
|
+
/** The control at the start of a row: a box to tick, or a radio to pick. */
|
|
13
|
+
function OptionMarker({ multiple, selected }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("span", {
|
|
15
|
+
"aria-hidden": true,
|
|
16
|
+
className: cn("flex size-3.5 items-center justify-center border transition-colors", multiple ? "rounded-[5px]" : "rounded-full", selected ? "border-foreground bg-foreground" : "border-muted-foreground/40"),
|
|
17
|
+
children: selected ? multiple ? /* @__PURE__ */ jsx(CheckIcon, { className: "fade-in zoom-in-90 animate-in text-background size-2.5 duration-200 motion-reduce:animate-none" }) : /* @__PURE__ */ jsx("span", { className: "fade-in zoom-in-50 animate-in bg-background size-1.5 rounded-full duration-200 motion-reduce:animate-none" }) : null
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function OptionText({ option }) {
|
|
21
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
22
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
23
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
24
|
+
className: "text-[13.5px] leading-5 break-words",
|
|
25
|
+
children: option.label
|
|
26
|
+
}), option.description ? /* @__PURE__ */ jsx("span", {
|
|
27
|
+
className: "text-muted-foreground text-xs leading-4 break-words",
|
|
28
|
+
children: option.description
|
|
29
|
+
}) : null]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function OptionList({ options, selectionMode = "single", defaultValue, minSelections = 1, maxSelections, onConfirm, confirmLabel = "Confirm", choice, className, ...props }) {
|
|
33
|
+
const multiple = selectionMode === "multiple";
|
|
34
|
+
const [selected, setSelected] = useState(() => (defaultValue ?? []).filter((id) => options.some((o) => o.id === id)));
|
|
35
|
+
const [pending, setPending] = useState(null);
|
|
36
|
+
const [confirmed, setConfirmed] = useState();
|
|
37
|
+
const [error, setError] = useState(null);
|
|
38
|
+
const root = cn(paper, "flex w-full max-w-sm flex-col gap-1 rounded-2xl p-2", className);
|
|
39
|
+
const confirmedChoice = choice ?? confirmed;
|
|
40
|
+
if (confirmedChoice !== void 0) {
|
|
41
|
+
const chosen = options.filter((option) => confirmedChoice.includes(option.id));
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
"data-slot": "option-list",
|
|
44
|
+
"data-state": "receipt",
|
|
45
|
+
className: root,
|
|
46
|
+
...props,
|
|
47
|
+
children: chosen.length === 0 ? /* @__PURE__ */ jsx("span", {
|
|
48
|
+
className: cn(mono, "text-muted-foreground px-2 py-2"),
|
|
49
|
+
children: "Nothing selected"
|
|
50
|
+
}) : chosen.map((option) => /* @__PURE__ */ jsxs("div", {
|
|
51
|
+
className: cn(row, "text-muted-foreground"),
|
|
52
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
53
|
+
className: "flex h-5 w-3.5 shrink-0 items-center justify-center",
|
|
54
|
+
children: [/* @__PURE__ */ jsx(CheckIcon, {
|
|
55
|
+
"aria-hidden": true,
|
|
56
|
+
className: "text-muted-foreground size-3.5"
|
|
57
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: "sr-only",
|
|
59
|
+
children: "Selected:"
|
|
60
|
+
})]
|
|
61
|
+
}), /* @__PURE__ */ jsx(OptionText, { option })]
|
|
62
|
+
}, option.id))
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
if (!onConfirm) return /* @__PURE__ */ jsx("div", {
|
|
66
|
+
"data-slot": "option-list",
|
|
67
|
+
className: root,
|
|
68
|
+
...props,
|
|
69
|
+
children: options.map((option) => /* @__PURE__ */ jsxs("div", {
|
|
70
|
+
className: cn(row, option.disabled && "text-muted-foreground"),
|
|
71
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
72
|
+
"aria-hidden": true,
|
|
73
|
+
className: "flex h-5 w-3.5 shrink-0 items-center justify-center",
|
|
74
|
+
children: /* @__PURE__ */ jsx(OptionMarker, {
|
|
75
|
+
multiple,
|
|
76
|
+
selected: false
|
|
77
|
+
})
|
|
78
|
+
}), /* @__PURE__ */ jsx(OptionText, { option })]
|
|
79
|
+
}, option.id))
|
|
80
|
+
});
|
|
81
|
+
const locked = pending !== null;
|
|
82
|
+
const max = Math.floor(clamp(maxSelections ?? options.length, 0, options.length));
|
|
83
|
+
const min = Math.floor(clamp(minSelections, 0, max));
|
|
84
|
+
const optionIds = new Set(options.map((option) => option.id));
|
|
85
|
+
const selectedIds = selected.filter((id) => optionIds.has(id));
|
|
86
|
+
const commit = (ids) => {
|
|
87
|
+
if (locked) return;
|
|
88
|
+
setPending(ids);
|
|
89
|
+
setError(null);
|
|
90
|
+
(async () => {
|
|
91
|
+
try {
|
|
92
|
+
await onConfirm(ids);
|
|
93
|
+
setConfirmed(ids);
|
|
94
|
+
} catch (commitError) {
|
|
95
|
+
setPending(null);
|
|
96
|
+
setError(commitError instanceof Error ? commitError.message : String(commitError));
|
|
97
|
+
}
|
|
98
|
+
})();
|
|
99
|
+
};
|
|
100
|
+
const toggle = (id) => {
|
|
101
|
+
if (locked) return;
|
|
102
|
+
setSelected((current) => {
|
|
103
|
+
const available = current.filter((value) => optionIds.has(value));
|
|
104
|
+
return available.includes(id) ? available.filter((value) => value !== id) : available.length < max ? [...available, id] : available;
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const count = selectedIds.length;
|
|
108
|
+
const canConfirm = !locked && count >= min && count <= max;
|
|
109
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
110
|
+
role: "group",
|
|
111
|
+
"data-slot": "option-list",
|
|
112
|
+
"data-state": locked ? "pending" : "open",
|
|
113
|
+
"aria-busy": locked || void 0,
|
|
114
|
+
className: root,
|
|
115
|
+
...props,
|
|
116
|
+
children: [
|
|
117
|
+
options.map((option) => {
|
|
118
|
+
const isSelected = multiple ? selectedIds.includes(option.id) : (pending ?? selected).includes(option.id);
|
|
119
|
+
const unavailable = option.disabled === true || multiple && !isSelected && count >= max;
|
|
120
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
121
|
+
type: "button",
|
|
122
|
+
...multiple ? {
|
|
123
|
+
role: "checkbox",
|
|
124
|
+
"aria-checked": isSelected
|
|
125
|
+
} : {},
|
|
126
|
+
"aria-disabled": unavailable || locked || void 0,
|
|
127
|
+
disabled: option.disabled,
|
|
128
|
+
onClick: () => {
|
|
129
|
+
if (unavailable) return;
|
|
130
|
+
if (multiple) toggle(option.id);
|
|
131
|
+
else commit([option.id]);
|
|
132
|
+
},
|
|
133
|
+
className: cn(row, isSelected ? "bg-foreground/[0.06]" : !unavailable && !locked && "hover:bg-foreground/[0.035]", unavailable ? "text-muted-foreground" : "text-foreground/90", (unavailable || locked) && "cursor-default"),
|
|
134
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
135
|
+
"aria-hidden": true,
|
|
136
|
+
className: "flex h-5 w-3.5 shrink-0 items-center justify-center",
|
|
137
|
+
children: pending?.includes(option.id) ? /* @__PURE__ */ jsx(Loader2Icon, { className: "text-muted-foreground size-3.5 animate-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx(OptionMarker, {
|
|
138
|
+
multiple,
|
|
139
|
+
selected: isSelected
|
|
140
|
+
})
|
|
141
|
+
}), /* @__PURE__ */ jsx(OptionText, { option })]
|
|
142
|
+
}, option.id);
|
|
143
|
+
}),
|
|
144
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
145
|
+
role: "alert",
|
|
146
|
+
className: "px-2 pb-1 text-xs break-words text-destructive dark:text-destructive",
|
|
147
|
+
children: error
|
|
148
|
+
}) : null,
|
|
149
|
+
multiple ? /* @__PURE__ */ jsxs("div", {
|
|
150
|
+
className: "flex items-center justify-between gap-3 px-2 pt-1.5 pb-1",
|
|
151
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
152
|
+
className: cn(mono, "text-muted-foreground tabular-nums"),
|
|
153
|
+
children: [
|
|
154
|
+
count,
|
|
155
|
+
" selected · up to ",
|
|
156
|
+
max
|
|
157
|
+
]
|
|
158
|
+
}), /* @__PURE__ */ jsxs("button", {
|
|
159
|
+
type: "button",
|
|
160
|
+
"aria-disabled": !canConfirm || void 0,
|
|
161
|
+
onClick: () => {
|
|
162
|
+
if (!canConfirm) return;
|
|
163
|
+
commit(options.filter((option) => selectedIds.includes(option.id)).map((option) => option.id));
|
|
164
|
+
},
|
|
165
|
+
className: cn(inkButton, "flex h-8 items-center gap-1.5 rounded-full px-3.5 text-xs font-medium", !canConfirm && "cursor-default opacity-40 hover:opacity-40"),
|
|
166
|
+
children: [locked ? /* @__PURE__ */ jsx(Loader2Icon, {
|
|
167
|
+
"aria-hidden": true,
|
|
168
|
+
className: "size-3.5 animate-spin motion-reduce:animate-none"
|
|
169
|
+
}) : null, confirmLabel]
|
|
170
|
+
})]
|
|
171
|
+
}) : null
|
|
172
|
+
]
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { OptionList, option_list_exports };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace permission_grant_d_exports {
|
|
3
|
+
export { GrantScope, PermissionGrant };
|
|
4
|
+
}
|
|
5
|
+
export type GrantScope = "session" | "always" | "denied";
|
|
6
|
+
export declare function PermissionGrant({ capability, requester, reach, scope, onGrant, className, ...props }: Omit<ComponentProps<"div">, "children" | "capability" | "requester" | "reach" | "scope" | "onGrant"> & {
|
|
7
|
+
capability: string;
|
|
8
|
+
requester: string;
|
|
9
|
+
reach: readonly string[];
|
|
10
|
+
scope: GrantScope | "pending";
|
|
11
|
+
onGrant?: (scope: GrantScope) => void;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { permission_grant_d_exports };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { inkButton, mono, paper } from "./surfaces.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { KeyRoundIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/assistant-ui/elements/permission-grant.tsx
|
|
8
|
+
var permission_grant_exports = /* @__PURE__ */ __exportAll({ PermissionGrant: () => PermissionGrant });
|
|
9
|
+
/** The settled or waiting decision, as a dot plus text rather than a pill. */
|
|
10
|
+
function Outcome({ scope }) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
12
|
+
className: "fade-in animate-in flex items-center gap-1.5 duration-300",
|
|
13
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
14
|
+
"aria-hidden": true,
|
|
15
|
+
className: cn("size-1.5 shrink-0 rounded-full", scope === "denied" ? "bg-destructive" : scope === "pending" ? "bg-foreground/30" : "bg-success")
|
|
16
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
17
|
+
className: cn(mono, "text-muted-foreground"),
|
|
18
|
+
children: scope === "denied" ? "denied" : scope === "pending" ? "pending" : `granted · ${scope}`
|
|
19
|
+
})]
|
|
20
|
+
}, scope);
|
|
21
|
+
}
|
|
22
|
+
function PermissionGrant({ capability, requester, reach, scope, onGrant, className, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
"data-slot": "permission-grant",
|
|
25
|
+
className: cn(paper, "flex w-full max-w-sm flex-col gap-3.5 rounded-[20px] p-4", className),
|
|
26
|
+
...props,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("div", {
|
|
29
|
+
className: "flex items-center gap-2.5",
|
|
30
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: "bg-foreground/[0.05] text-muted-foreground flex size-7 shrink-0 items-center justify-center rounded-lg",
|
|
32
|
+
children: /* @__PURE__ */ jsx(KeyRoundIcon, { className: "size-3.5" })
|
|
33
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
35
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
36
|
+
className: "truncate text-[13.5px] font-medium",
|
|
37
|
+
children: capability
|
|
38
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
39
|
+
className: "text-muted-foreground truncate text-xs",
|
|
40
|
+
children: ["requested by ", requester]
|
|
41
|
+
})]
|
|
42
|
+
})]
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: "flex flex-col gap-1",
|
|
46
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
47
|
+
className: cn(mono, "text-muted-foreground"),
|
|
48
|
+
children: "this grants"
|
|
49
|
+
}), reach.map((item) => /* @__PURE__ */ jsxs("span", {
|
|
50
|
+
className: "text-muted-foreground flex items-baseline gap-2 text-xs",
|
|
51
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
52
|
+
"aria-hidden": true,
|
|
53
|
+
className: "bg-foreground/20 size-1 rounded-full"
|
|
54
|
+
}), item]
|
|
55
|
+
}, item))]
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ jsx("div", {
|
|
58
|
+
className: "flex h-8 items-center justify-end gap-2",
|
|
59
|
+
children: scope === "pending" ? onGrant ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
+
/* @__PURE__ */ jsx("button", {
|
|
61
|
+
type: "button",
|
|
62
|
+
onClick: () => onGrant("denied"),
|
|
63
|
+
className: "text-muted-foreground hover:bg-foreground/[0.06] hover:text-foreground/90 h-8 rounded-full px-3 text-xs font-medium transition-[background-color,color,scale] duration-150 active:scale-[0.96]",
|
|
64
|
+
children: "Deny"
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ jsx("button", {
|
|
67
|
+
type: "button",
|
|
68
|
+
onClick: () => onGrant("session"),
|
|
69
|
+
className: "text-muted-foreground hover:bg-foreground/[0.06] hover:text-foreground/90 h-8 rounded-full px-3 text-xs font-medium transition-[background-color,color,scale] duration-150 active:scale-[0.96]",
|
|
70
|
+
children: "This session"
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ jsx("button", {
|
|
73
|
+
type: "button",
|
|
74
|
+
onClick: () => onGrant("always"),
|
|
75
|
+
className: cn(inkButton, "flex h-8 items-center rounded-full px-3 text-xs font-medium"),
|
|
76
|
+
children: "Always"
|
|
77
|
+
})
|
|
78
|
+
] }) : /* @__PURE__ */ jsx(Outcome, { scope }) : /* @__PURE__ */ jsx(Outcome, { scope })
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
export { PermissionGrant, permission_grant_exports };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace prompt_library_d_exports {
|
|
3
|
+
export { PromptLibrary, SavedPrompt };
|
|
4
|
+
}
|
|
5
|
+
export interface SavedPrompt {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
body: string;
|
|
9
|
+
variables: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function PromptLibrary({ prompts, query, selectedId, onQueryChange, onSelect, onInsert, className, ...props }: Omit<ComponentProps<"div">, "children" | "prompts" | "query" | "selectedId" | "onQueryChange" | "onSelect" | "onInsert"> & {
|
|
12
|
+
prompts: readonly SavedPrompt[];
|
|
13
|
+
query: string;
|
|
14
|
+
selectedId: string;
|
|
15
|
+
onQueryChange?: (query: string) => void;
|
|
16
|
+
onSelect?: (id: string) => void;
|
|
17
|
+
onInsert?: (id: string) => void;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { prompt_library_d_exports };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { field, paper } from "./surfaces.js";
|
|
5
|
+
import { useId } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { BookmarkIcon } from "lucide-react";
|
|
8
|
+
//#region src/components/assistant-ui/elements/prompt-library.tsx
|
|
9
|
+
var prompt_library_exports = /* @__PURE__ */ __exportAll({ PromptLibrary: () => PromptLibrary });
|
|
10
|
+
function PromptLibrary({ prompts, query, selectedId, onQueryChange, onSelect, onInsert, className, ...props }) {
|
|
11
|
+
const listId = useId();
|
|
12
|
+
const optionId = (id) => `${listId}-${id}`;
|
|
13
|
+
const matches = prompts.filter((prompt) => prompt.name.toLowerCase().includes(query.toLowerCase()));
|
|
14
|
+
const selected = matches.find((prompt) => prompt.id === selectedId);
|
|
15
|
+
const move = (delta) => {
|
|
16
|
+
if (matches.length === 0) return;
|
|
17
|
+
const at = matches.findIndex((prompt) => prompt.id === selectedId);
|
|
18
|
+
const next = matches[((at === -1 ? delta > 0 ? -1 : 0 : at) + delta + matches.length) % matches.length];
|
|
19
|
+
if (next && onSelect) onSelect(next.id);
|
|
20
|
+
};
|
|
21
|
+
const onKeyDown = (event) => {
|
|
22
|
+
if (event.nativeEvent.isComposing) return;
|
|
23
|
+
if (event.key === "ArrowDown") {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
move(1);
|
|
26
|
+
} else if (event.key === "ArrowUp") {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
move(-1);
|
|
29
|
+
} else if (event.key === "Enter" && selected && onInsert) {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
onInsert(selected.id);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
35
|
+
"data-slot": "prompt-library",
|
|
36
|
+
className: cn(paper, "flex w-full max-w-sm flex-col gap-2 rounded-2xl p-3", className),
|
|
37
|
+
...props,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsxs("div", {
|
|
40
|
+
className: cn(field, "flex items-center gap-2 rounded-xl px-2.5 py-1.5"),
|
|
41
|
+
children: [/* @__PURE__ */ jsx(BookmarkIcon, { className: "text-muted-foreground size-3.5 shrink-0" }), /* @__PURE__ */ jsx("input", {
|
|
42
|
+
value: query,
|
|
43
|
+
onChange: (event) => onQueryChange?.(event.target.value),
|
|
44
|
+
onKeyDown,
|
|
45
|
+
placeholder: "Search prompts",
|
|
46
|
+
"aria-label": "Search saved prompts",
|
|
47
|
+
role: "combobox",
|
|
48
|
+
"aria-expanded": matches.length > 0,
|
|
49
|
+
"aria-controls": listId,
|
|
50
|
+
"aria-autocomplete": "list",
|
|
51
|
+
"aria-activedescendant": selected ? optionId(selected.id) : void 0,
|
|
52
|
+
className: "text-foreground/85 placeholder:text-muted-foreground min-w-0 flex-1 bg-transparent text-[13px] outline-none"
|
|
53
|
+
})]
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ jsx("div", {
|
|
56
|
+
id: listId,
|
|
57
|
+
role: "listbox",
|
|
58
|
+
"aria-label": "Saved prompts",
|
|
59
|
+
className: "flex flex-col",
|
|
60
|
+
children: matches.map((prompt) => {
|
|
61
|
+
const className = cn("flex items-center gap-2 rounded-xl px-2 py-1.5 text-start transition-colors", prompt.id === selectedId ? "bg-foreground/[0.05]" : onSelect || onInsert ? "hover:bg-foreground/[0.03]" : void 0);
|
|
62
|
+
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: "min-w-0 flex-1 truncate text-[13px]",
|
|
64
|
+
children: prompt.name
|
|
65
|
+
}), prompt.variables.length > 0 && /* @__PURE__ */ jsxs("span", {
|
|
66
|
+
className: cn("font-mono text-[11px] tracking-tight", "text-muted-foreground shrink-0"),
|
|
67
|
+
children: [
|
|
68
|
+
prompt.variables.length,
|
|
69
|
+
" ",
|
|
70
|
+
prompt.variables.length === 1 ? "var" : "vars"
|
|
71
|
+
]
|
|
72
|
+
})] });
|
|
73
|
+
return onSelect || onInsert ? /* @__PURE__ */ jsx("button", {
|
|
74
|
+
id: optionId(prompt.id),
|
|
75
|
+
type: "button",
|
|
76
|
+
role: "option",
|
|
77
|
+
tabIndex: onSelect ? -1 : 0,
|
|
78
|
+
"aria-selected": prompt.id === selectedId,
|
|
79
|
+
onMouseDown: onSelect ? (event) => event.preventDefault() : void 0,
|
|
80
|
+
onClick: (event) => {
|
|
81
|
+
if (onSelect) onSelect(prompt.id);
|
|
82
|
+
else if (event.detail <= 1) onInsert?.(prompt.id);
|
|
83
|
+
},
|
|
84
|
+
onDoubleClick: onSelect && onInsert ? () => onInsert(prompt.id) : void 0,
|
|
85
|
+
className,
|
|
86
|
+
children: content
|
|
87
|
+
}, prompt.id) : /* @__PURE__ */ jsx("div", {
|
|
88
|
+
id: optionId(prompt.id),
|
|
89
|
+
role: "option",
|
|
90
|
+
"aria-selected": prompt.id === selectedId,
|
|
91
|
+
className,
|
|
92
|
+
children: content
|
|
93
|
+
}, prompt.id);
|
|
94
|
+
})
|
|
95
|
+
}),
|
|
96
|
+
matches.length === 0 && /* @__PURE__ */ jsx("span", {
|
|
97
|
+
className: "text-muted-foreground block px-2 py-3 text-center text-xs break-words",
|
|
98
|
+
children: query === "" ? "No saved prompts yet" : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
99
|
+
"Nothing matches “",
|
|
100
|
+
query,
|
|
101
|
+
"”"
|
|
102
|
+
] })
|
|
103
|
+
}),
|
|
104
|
+
selected && /* @__PURE__ */ jsxs("div", {
|
|
105
|
+
className: cn("bg-muted", "fade-in animate-in flex flex-col gap-2 rounded-xl p-2.5 duration-200"),
|
|
106
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
107
|
+
className: "text-muted-foreground text-xs leading-relaxed break-words",
|
|
108
|
+
children: selected.body
|
|
109
|
+
}), selected.variables.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
110
|
+
className: "flex flex-wrap gap-1",
|
|
111
|
+
children: selected.variables.map((variable) => /* @__PURE__ */ jsx("span", {
|
|
112
|
+
className: cn("font-mono text-[11px] tracking-tight", "bg-background/70 text-muted-foreground rounded px-1.5 py-0.5"),
|
|
113
|
+
children: `{${variable}}`
|
|
114
|
+
}, variable))
|
|
115
|
+
})]
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { PromptLibrary, prompt_library_exports };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OptionListOption } from "./option-list.js";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
declare namespace question_flow_d_exports {
|
|
4
|
+
export { QuestionFlow, QuestionFlowProps, QuestionFlowStep };
|
|
5
|
+
}
|
|
6
|
+
export interface QuestionFlowStep {
|
|
7
|
+
id: string;
|
|
8
|
+
question: string;
|
|
9
|
+
description?: string | undefined;
|
|
10
|
+
options: readonly OptionListOption[];
|
|
11
|
+
selectionMode?: "single" | "multiple" | undefined;
|
|
12
|
+
minSelections?: number | undefined;
|
|
13
|
+
maxSelections?: number | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface QuestionFlowProps extends Omit<ComponentProps<"div">, "children" | "defaultValue" | "onSubmit"> {
|
|
16
|
+
steps: readonly QuestionFlowStep[];
|
|
17
|
+
defaultValue?: Readonly<Record<string, readonly string[]>> | undefined;
|
|
18
|
+
onComplete?: ((answers: Record<string, string[]>) => void | Promise<void>) | undefined;
|
|
19
|
+
completeLabel?: string | undefined;
|
|
20
|
+
choice?: Readonly<Record<string, readonly string[]>> | undefined;
|
|
21
|
+
}
|
|
22
|
+
export declare function QuestionFlow({ steps, defaultValue, onComplete, completeLabel, choice, className, ...props }: QuestionFlowProps): import("react").JSX.Element;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { question_flow_d_exports };
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { ghostButton, mono, paper } from "./surfaces.js";
|
|
5
|
+
import { OptionList } from "./option-list.js";
|
|
6
|
+
import { useId, useLayoutEffect, useRef, useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/assistant-ui/elements/question-flow.tsx
|
|
9
|
+
var question_flow_exports = /* @__PURE__ */ __exportAll({ QuestionFlow: () => QuestionFlow });
|
|
10
|
+
function QuestionFlow({ steps, defaultValue, onComplete, completeLabel = "Submit", choice, className, ...props }) {
|
|
11
|
+
const [stepIndex, setStepIndex] = useState(0);
|
|
12
|
+
const [answers, setAnswers] = useState(() => {
|
|
13
|
+
const initial = {};
|
|
14
|
+
for (const [id, value] of Object.entries(defaultValue ?? {})) initial[id] = [...value];
|
|
15
|
+
return initial;
|
|
16
|
+
});
|
|
17
|
+
const [confirmedAnswers, setConfirmedAnswers] = useState();
|
|
18
|
+
const [isCompleting, setIsCompleting] = useState(false);
|
|
19
|
+
const questionPrefix = useId();
|
|
20
|
+
const optionListRef = useRef(null);
|
|
21
|
+
const currentIndex = Math.min(stepIndex, Math.max(0, steps.length - 1));
|
|
22
|
+
const currentStep = steps[currentIndex];
|
|
23
|
+
const previousStepId = useRef(currentStep?.id);
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
if (previousStepId.current === currentStep?.id) return;
|
|
26
|
+
previousStepId.current = currentStep?.id;
|
|
27
|
+
optionListRef.current?.querySelector("button:not([disabled]):not([aria-disabled=\"true\"])")?.focus();
|
|
28
|
+
}, [currentStep?.id]);
|
|
29
|
+
const root = cn(paper, "flex w-full max-w-sm flex-col rounded-2xl p-2", className);
|
|
30
|
+
const completedChoice = choice ?? confirmedAnswers;
|
|
31
|
+
if (completedChoice !== void 0) return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
...props,
|
|
33
|
+
"data-slot": "question-flow",
|
|
34
|
+
"data-state": "receipt",
|
|
35
|
+
className: cn(root, "gap-3"),
|
|
36
|
+
children: steps.flatMap((step) => {
|
|
37
|
+
const selected = completedChoice[step.id];
|
|
38
|
+
if (!selected?.length) return [];
|
|
39
|
+
const labels = step.options.filter((option) => selected.includes(option.id)).map((option) => option.label).join(", ");
|
|
40
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
41
|
+
className: "flex flex-col gap-0.5 px-2 py-1",
|
|
42
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
43
|
+
className: "text-muted-foreground text-xs leading-4",
|
|
44
|
+
children: step.question
|
|
45
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
46
|
+
className: "text-foreground/80 text-[13.5px] leading-5 break-words",
|
|
47
|
+
children: labels
|
|
48
|
+
})]
|
|
49
|
+
}, step.id);
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
if (!onComplete) return /* @__PURE__ */ jsx("div", {
|
|
53
|
+
...props,
|
|
54
|
+
"data-slot": "question-flow",
|
|
55
|
+
"data-state": "open",
|
|
56
|
+
className: cn(root, "gap-5"),
|
|
57
|
+
children: steps.map((step) => {
|
|
58
|
+
const questionId = `${questionPrefix}-${step.id}`;
|
|
59
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
60
|
+
className: "flex flex-col gap-3",
|
|
61
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
62
|
+
className: "flex flex-col gap-0.5 px-2 pt-1",
|
|
63
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
64
|
+
id: questionId,
|
|
65
|
+
className: "text-[13.5px] leading-5 font-medium",
|
|
66
|
+
children: step.question
|
|
67
|
+
}), step.description ? /* @__PURE__ */ jsx("p", {
|
|
68
|
+
className: "text-muted-foreground text-xs leading-4",
|
|
69
|
+
children: step.description
|
|
70
|
+
}) : null]
|
|
71
|
+
}), /* @__PURE__ */ jsx(OptionList, {
|
|
72
|
+
"aria-labelledby": questionId,
|
|
73
|
+
options: step.options,
|
|
74
|
+
selectionMode: step.selectionMode,
|
|
75
|
+
className: "max-w-none border-0 bg-transparent p-0 dark:bg-transparent"
|
|
76
|
+
})]
|
|
77
|
+
}, step.id);
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
if (!currentStep) return /* @__PURE__ */ jsx("div", {
|
|
81
|
+
...props,
|
|
82
|
+
"data-slot": "question-flow",
|
|
83
|
+
"data-state": "open",
|
|
84
|
+
className: root
|
|
85
|
+
});
|
|
86
|
+
const questionId = `${questionPrefix}-${currentStep.id}`;
|
|
87
|
+
const currentAnswer = answers[currentStep.id];
|
|
88
|
+
const finalStep = currentIndex === steps.length - 1;
|
|
89
|
+
const confirm = (ids) => {
|
|
90
|
+
const nextAnswers = {
|
|
91
|
+
...answers,
|
|
92
|
+
[currentStep.id]: ids
|
|
93
|
+
};
|
|
94
|
+
if (!finalStep) {
|
|
95
|
+
setAnswers(nextAnswers);
|
|
96
|
+
setStepIndex(currentIndex + 1);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const stepIds = new Set(steps.map((step) => step.id));
|
|
100
|
+
const completedAnswers = Object.fromEntries(Object.entries(nextAnswers).filter(([id]) => stepIds.has(id)));
|
|
101
|
+
setIsCompleting(true);
|
|
102
|
+
try {
|
|
103
|
+
return Promise.resolve(onComplete(completedAnswers)).then(() => {
|
|
104
|
+
setAnswers(nextAnswers);
|
|
105
|
+
setConfirmedAnswers(completedAnswers);
|
|
106
|
+
}, (error) => {
|
|
107
|
+
setIsCompleting(false);
|
|
108
|
+
throw error;
|
|
109
|
+
});
|
|
110
|
+
} catch (error) {
|
|
111
|
+
setIsCompleting(false);
|
|
112
|
+
return Promise.reject(error);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
116
|
+
...props,
|
|
117
|
+
"data-slot": "question-flow",
|
|
118
|
+
"data-state": "open",
|
|
119
|
+
className: cn(root, "gap-3"),
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ jsxs("div", {
|
|
122
|
+
className: "flex items-center justify-between gap-3 px-2 pt-1",
|
|
123
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
124
|
+
className: cn(mono, "text-muted-foreground tabular-nums"),
|
|
125
|
+
children: [
|
|
126
|
+
currentIndex + 1,
|
|
127
|
+
" of ",
|
|
128
|
+
steps.length
|
|
129
|
+
]
|
|
130
|
+
}), currentIndex > 0 ? /* @__PURE__ */ jsx("button", {
|
|
131
|
+
type: "button",
|
|
132
|
+
disabled: isCompleting,
|
|
133
|
+
onClick: () => setStepIndex(currentIndex - 1),
|
|
134
|
+
className: cn(ghostButton, "h-7 px-2.5 text-xs font-medium", isCompleting && "cursor-default opacity-40"),
|
|
135
|
+
children: "Back"
|
|
136
|
+
}) : null]
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ jsx("div", {
|
|
139
|
+
role: "progressbar",
|
|
140
|
+
"aria-label": "Progress",
|
|
141
|
+
"aria-valuenow": currentIndex + 1,
|
|
142
|
+
"aria-valuemin": 1,
|
|
143
|
+
"aria-valuemax": steps.length,
|
|
144
|
+
"aria-valuetext": `Question ${currentIndex + 1} of ${steps.length}`,
|
|
145
|
+
className: "bg-foreground/[0.08] mx-2 h-[3px] overflow-hidden rounded-full",
|
|
146
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
147
|
+
style: { width: `${(currentIndex + 1) / steps.length * 100}%` },
|
|
148
|
+
className: "bg-foreground/80 h-full transition-[width] duration-200 motion-reduce:transition-none"
|
|
149
|
+
})
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsxs("div", {
|
|
152
|
+
className: "flex flex-col gap-0.5 px-2",
|
|
153
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
154
|
+
id: questionId,
|
|
155
|
+
className: "text-[13.5px] leading-5 font-medium",
|
|
156
|
+
children: currentStep.question
|
|
157
|
+
}), currentStep.description ? /* @__PURE__ */ jsx("p", {
|
|
158
|
+
className: "text-muted-foreground text-xs leading-4",
|
|
159
|
+
children: currentStep.description
|
|
160
|
+
}) : null]
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ jsx("div", {
|
|
163
|
+
ref: optionListRef,
|
|
164
|
+
children: /* @__PURE__ */ jsx(OptionList, {
|
|
165
|
+
"aria-labelledby": questionId,
|
|
166
|
+
options: currentStep.options,
|
|
167
|
+
selectionMode: currentStep.selectionMode,
|
|
168
|
+
defaultValue: currentAnswer,
|
|
169
|
+
minSelections: currentStep.minSelections,
|
|
170
|
+
maxSelections: currentStep.maxSelections,
|
|
171
|
+
onConfirm: confirm,
|
|
172
|
+
confirmLabel: finalStep ? completeLabel : "Next",
|
|
173
|
+
className: "max-w-none border-0 bg-transparent p-0 dark:bg-transparent"
|
|
174
|
+
}, currentStep.id)
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
export { QuestionFlow, question_flow_exports };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace quota_banner_d_exports {
|
|
3
|
+
export { QuotaBanner };
|
|
4
|
+
}
|
|
5
|
+
export declare function QuotaBanner({ used, limit, unit, resetsIn, upgradeLabel, onUpgrade, className, ...props }: Omit<ComponentProps<"div">, "children" | "used" | "limit" | "unit" | "resetsIn" | "upgradeLabel" | "onUpgrade"> & {
|
|
6
|
+
used: number;
|
|
7
|
+
limit: number;
|
|
8
|
+
unit: string;
|
|
9
|
+
resetsIn: string;
|
|
10
|
+
upgradeLabel: string;
|
|
11
|
+
onUpgrade?: () => void;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { quota_banner_d_exports };
|