@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,190 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { field, mono, paper } from "./surfaces.js";
|
|
5
|
+
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/assistant-ui/elements/geo-map.tsx
|
|
8
|
+
var geo_map_exports = /* @__PURE__ */ __exportAll({ GeoMap: () => GeoMap });
|
|
9
|
+
const DEFAULT_ATTRIBUTION = "© OpenStreetMap contributors";
|
|
10
|
+
function isCoordinate(lat, lng) {
|
|
11
|
+
return Number.isFinite(lat) && Number.isFinite(lng) && lat >= -90 && lat <= 90 && lng >= -180 && lng <= 180;
|
|
12
|
+
}
|
|
13
|
+
function markerIcon(leaflet, selected) {
|
|
14
|
+
const size = selected ? 16 : 10;
|
|
15
|
+
return leaflet.divIcon({
|
|
16
|
+
className: "geo-map-marker",
|
|
17
|
+
html: selected ? "<span class=\"block size-4 rounded-full bg-blue-500 ring-2 ring-background\"></span>" : "<span class=\"block size-2.5 rounded-full bg-foreground/55 ring-2 ring-background\"></span>",
|
|
18
|
+
iconSize: [size, size],
|
|
19
|
+
iconAnchor: [size / 2, size / 2]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function useDarkTheme(theme) {
|
|
23
|
+
const subscribe = useCallback((notify) => {
|
|
24
|
+
if (theme !== "auto" || typeof window === "undefined") return () => {};
|
|
25
|
+
const media = typeof window.matchMedia === "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
26
|
+
const observer = typeof MutationObserver === "function" ? new MutationObserver(notify) : null;
|
|
27
|
+
observer?.observe(document.documentElement, {
|
|
28
|
+
attributes: true,
|
|
29
|
+
attributeFilter: ["class"]
|
|
30
|
+
});
|
|
31
|
+
media?.addEventListener("change", notify);
|
|
32
|
+
return () => {
|
|
33
|
+
observer?.disconnect();
|
|
34
|
+
media?.removeEventListener("change", notify);
|
|
35
|
+
};
|
|
36
|
+
}, [theme]);
|
|
37
|
+
const getSnapshot = useCallback(() => {
|
|
38
|
+
if (theme === "dark") return true;
|
|
39
|
+
if (theme === "light" || typeof document === "undefined") return false;
|
|
40
|
+
return document.documentElement.classList.contains("dark") || typeof window.matchMedia === "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
41
|
+
}, [theme]);
|
|
42
|
+
return useSyncExternalStore(subscribe, getSnapshot, () => theme === "dark");
|
|
43
|
+
}
|
|
44
|
+
function GeoMap({ places, routes, selectedId, onSelect, theme = "auto", tileUrl, attribution, height = 260, className, ...props }) {
|
|
45
|
+
const containerRef = useRef(null);
|
|
46
|
+
const mapRef = useRef(null);
|
|
47
|
+
const leafletRef = useRef(null);
|
|
48
|
+
const markersRef = useRef(/* @__PURE__ */ new Map());
|
|
49
|
+
const [mapReady, setMapReady] = useState(false);
|
|
50
|
+
const mapContent = useMemo(() => {
|
|
51
|
+
const validPlaces = places.filter((place) => isCoordinate(place.lat, place.lng));
|
|
52
|
+
const routePoints = [];
|
|
53
|
+
const validRoutes = routes?.map((route) => {
|
|
54
|
+
const points = route.points.filter(([lat, lng]) => isCoordinate(lat, lng)).map(([lat, lng]) => [lat, lng]);
|
|
55
|
+
routePoints.push(...points);
|
|
56
|
+
return {
|
|
57
|
+
...route,
|
|
58
|
+
points
|
|
59
|
+
};
|
|
60
|
+
}).filter((route) => route.points.length > 1) ?? [];
|
|
61
|
+
return {
|
|
62
|
+
signature: JSON.stringify([places.map((place) => [
|
|
63
|
+
place.id,
|
|
64
|
+
place.lat,
|
|
65
|
+
place.lng,
|
|
66
|
+
place.label,
|
|
67
|
+
place.description
|
|
68
|
+
]), routes?.map((route) => [route.id, route.points]) ?? []]),
|
|
69
|
+
validPlaces,
|
|
70
|
+
routePoints,
|
|
71
|
+
validRoutes
|
|
72
|
+
};
|
|
73
|
+
}, [places, routes]);
|
|
74
|
+
const { signature: contentSignature, validPlaces } = mapContent;
|
|
75
|
+
const mapContentRef = useRef(mapContent);
|
|
76
|
+
mapContentRef.current = mapContent;
|
|
77
|
+
const resolvedAttribution = attribution ?? DEFAULT_ATTRIBUTION;
|
|
78
|
+
const [uncontrolledSelectedId, setUncontrolledSelectedId] = useState(() => validPlaces[0]?.id);
|
|
79
|
+
const activeId = selectedId ?? (validPlaces.some((place) => place.id === uncontrolledSelectedId) ? uncontrolledSelectedId : validPlaces[0]?.id);
|
|
80
|
+
const activeIdRef = useRef(activeId);
|
|
81
|
+
activeIdRef.current = activeId;
|
|
82
|
+
const dark = useDarkTheme(theme);
|
|
83
|
+
const selectPlace = useCallback((place) => {
|
|
84
|
+
if (selectedId === void 0) setUncontrolledSelectedId(place.id);
|
|
85
|
+
onSelect?.(place.id);
|
|
86
|
+
mapRef.current?.panTo([place.lat, place.lng]);
|
|
87
|
+
}, [onSelect, selectedId]);
|
|
88
|
+
const selectPlaceRef = useRef(selectPlace);
|
|
89
|
+
selectPlaceRef.current = selectPlace;
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
const container = containerRef.current;
|
|
92
|
+
if (!container) return void 0;
|
|
93
|
+
let cancelled = false;
|
|
94
|
+
let map = null;
|
|
95
|
+
setMapReady(false);
|
|
96
|
+
(async () => {
|
|
97
|
+
const leaflet = await import("leaflet");
|
|
98
|
+
if (cancelled) return;
|
|
99
|
+
leafletRef.current = leaflet;
|
|
100
|
+
map = leaflet.map(container, { keyboard: true });
|
|
101
|
+
mapRef.current = map;
|
|
102
|
+
if (tileUrl !== void 0) leaflet.tileLayer(tileUrl, { attribution: resolvedAttribution }).addTo(map);
|
|
103
|
+
setMapReady(true);
|
|
104
|
+
})();
|
|
105
|
+
return () => {
|
|
106
|
+
cancelled = true;
|
|
107
|
+
if (mapRef.current === map) mapRef.current = null;
|
|
108
|
+
map?.remove();
|
|
109
|
+
};
|
|
110
|
+
}, [resolvedAttribution, tileUrl]);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
const leaflet = leafletRef.current;
|
|
113
|
+
const map = mapRef.current;
|
|
114
|
+
if (!leaflet || !map || !mapReady) return;
|
|
115
|
+
const { routePoints, validPlaces, validRoutes } = mapContentRef.current;
|
|
116
|
+
const layer = leaflet.layerGroup().addTo(map);
|
|
117
|
+
const points = [...validPlaces.map((place) => [place.lat, place.lng]), ...routePoints];
|
|
118
|
+
const [first] = points;
|
|
119
|
+
if (points.length === 1 && first) map.setView(first, 13);
|
|
120
|
+
else if (points.length > 1) map.fitBounds(leaflet.latLngBounds(points), { padding: [24, 24] });
|
|
121
|
+
else map.setView([0, 0], 2);
|
|
122
|
+
for (const route of validRoutes) leaflet.polyline(route.points, {
|
|
123
|
+
className: "stroke-foreground/70",
|
|
124
|
+
weight: 2
|
|
125
|
+
}).addTo(layer);
|
|
126
|
+
for (const place of validPlaces) {
|
|
127
|
+
const marker = leaflet.marker([place.lat, place.lng], {
|
|
128
|
+
icon: markerIcon(leaflet, place.id === activeIdRef.current),
|
|
129
|
+
title: place.label
|
|
130
|
+
}).addTo(layer).on("click", () => selectPlaceRef.current(place));
|
|
131
|
+
markersRef.current.set(place.id, marker);
|
|
132
|
+
}
|
|
133
|
+
return () => {
|
|
134
|
+
markersRef.current.clear();
|
|
135
|
+
layer.remove();
|
|
136
|
+
};
|
|
137
|
+
}, [contentSignature, mapReady]);
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
const leaflet = leafletRef.current;
|
|
140
|
+
if (!leaflet) return;
|
|
141
|
+
for (const place of mapContentRef.current.validPlaces) markersRef.current.get(place.id)?.setIcon(markerIcon(leaflet, place.id === activeId));
|
|
142
|
+
}, [activeId, contentSignature]);
|
|
143
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
144
|
+
"data-slot": "geo-map",
|
|
145
|
+
className: cn(paper, "flex w-full max-w-sm flex-col overflow-hidden rounded-2xl p-2", className),
|
|
146
|
+
...props,
|
|
147
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
148
|
+
ref: containerRef,
|
|
149
|
+
role: "region",
|
|
150
|
+
"aria-label": `Map of ${validPlaces.length} places`,
|
|
151
|
+
style: { height },
|
|
152
|
+
"data-theme": dark ? "dark" : "light",
|
|
153
|
+
className: cn(field, "relative overflow-hidden rounded-xl", "[&_.leaflet-bar]:border-foreground/10! [&_.leaflet-bar_a]:border-foreground/10! [&_.leaflet-bar_a]:bg-background! [&_.leaflet-bar_a]:text-foreground/80! [&_.leaflet-bar_a:hover]:bg-foreground/[0.06]! [&_.leaflet-bar]:shadow-none!", "[&_.leaflet-control-attribution]:bg-background/80! [&_.leaflet-control-attribution]:text-muted-foreground! [&_.leaflet-control-attribution_a]:text-muted-foreground!", tileUrl === void 0 && "bg-foreground/[0.04]! dark:bg-foreground/[0.06]!"),
|
|
154
|
+
children: !mapReady ? /* @__PURE__ */ jsx("span", {
|
|
155
|
+
className: "text-muted-foreground absolute inset-0 flex items-center justify-center text-xs",
|
|
156
|
+
children: "Loading map"
|
|
157
|
+
}) : null
|
|
158
|
+
}), /* @__PURE__ */ jsx("ol", {
|
|
159
|
+
className: "mt-2 flex flex-col gap-0.5",
|
|
160
|
+
children: validPlaces.map((place) => {
|
|
161
|
+
const selected = place.id === activeId;
|
|
162
|
+
return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs("button", {
|
|
163
|
+
type: "button",
|
|
164
|
+
"aria-current": selected || void 0,
|
|
165
|
+
onClick: () => selectPlace(place),
|
|
166
|
+
className: cn("group hover:bg-foreground/[0.035] focus-visible:ring-foreground/20 flex w-full items-start gap-3 rounded-lg px-2.5 py-2 text-start transition-colors outline-none focus-visible:ring-1", selected && "bg-foreground/[0.06]"),
|
|
167
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
168
|
+
className: "min-w-0 flex-1",
|
|
169
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
170
|
+
className: "text-foreground/90 block text-[13.5px] leading-5 break-words",
|
|
171
|
+
children: place.label
|
|
172
|
+
}), place.description ? /* @__PURE__ */ jsx("span", {
|
|
173
|
+
className: "text-muted-foreground group-aria-[current=true]:text-muted-foreground block text-xs leading-4 break-words",
|
|
174
|
+
children: place.description
|
|
175
|
+
}) : null]
|
|
176
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
177
|
+
className: cn(mono, "text-muted-foreground group-aria-[current=true]:text-muted-foreground shrink-0 pt-0.5 tabular-nums"),
|
|
178
|
+
children: [
|
|
179
|
+
place.lat.toFixed(4),
|
|
180
|
+
", ",
|
|
181
|
+
place.lng.toFixed(4)
|
|
182
|
+
]
|
|
183
|
+
})]
|
|
184
|
+
}) }, place.id);
|
|
185
|
+
})
|
|
186
|
+
})]
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
//#endregion
|
|
190
|
+
export { GeoMap, geo_map_exports };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
|
+
declare namespace guardrail_notice_d_exports {
|
|
3
|
+
export { GuardrailNotice };
|
|
4
|
+
}
|
|
5
|
+
export declare function GuardrailNotice({ title, explanation, policy, alternatives, onPick, children, className, ...props }: Omit<ComponentProps<"div">, "children" | "title" | "explanation" | "policy" | "alternatives" | "onPick"> & {
|
|
6
|
+
title: string;
|
|
7
|
+
explanation: string;
|
|
8
|
+
policy: string;
|
|
9
|
+
alternatives: readonly string[];
|
|
10
|
+
onPick?: (alternative: string) => void;
|
|
11
|
+
/** Detail rendered under the explanation, such as an expandable list. */
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { guardrail_notice_d_exports };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { mono, paper } from "./surfaces.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronRightIcon, ShieldIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/assistant-ui/elements/guardrail-notice.tsx
|
|
8
|
+
var guardrail_notice_exports = /* @__PURE__ */ __exportAll({ GuardrailNotice: () => GuardrailNotice });
|
|
9
|
+
function GuardrailNotice({ title, explanation, policy, alternatives, onPick, children, className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
"data-slot": "guardrail-notice",
|
|
12
|
+
className: cn(paper, "flex w-full max-w-sm flex-col gap-3 rounded-[20px] p-4", className),
|
|
13
|
+
...props,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsxs("div", {
|
|
16
|
+
className: "flex items-center gap-2.5",
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsx("span", {
|
|
19
|
+
className: "flex size-7 shrink-0 items-center justify-center rounded-lg bg-warning/12 text-warning dark:text-warning",
|
|
20
|
+
children: /* @__PURE__ */ jsx(ShieldIcon, { className: "size-3.5" })
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: "min-w-0 flex-1 truncate text-[13.5px] font-medium",
|
|
24
|
+
children: title
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsx("span", {
|
|
27
|
+
className: cn(mono, "text-muted-foreground max-w-1/2 min-w-0 truncate"),
|
|
28
|
+
children: policy
|
|
29
|
+
})
|
|
30
|
+
]
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ jsx("p", {
|
|
33
|
+
className: "text-muted-foreground text-xs leading-relaxed",
|
|
34
|
+
children: explanation
|
|
35
|
+
}),
|
|
36
|
+
children,
|
|
37
|
+
alternatives.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
38
|
+
className: "flex flex-col gap-1.5",
|
|
39
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
40
|
+
className: cn("font-mono text-[11px] tracking-tight", "text-muted-foreground"),
|
|
41
|
+
children: "try instead"
|
|
42
|
+
}), alternatives.map((alternative) => onPick ? /* @__PURE__ */ jsxs("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: () => onPick(alternative),
|
|
45
|
+
className: "hover:bg-accent focus-visible:bg-accent text-foreground/80 hover:text-foreground focus-visible:text-foreground focus-visible:ring-ring/40 flex items-center gap-1.5 rounded-lg px-1.5 py-1 text-start text-[13px] transition-colors outline-none focus-visible:ring-1 focus-visible:ring-inset",
|
|
46
|
+
children: [/* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
47
|
+
"aria-hidden": true,
|
|
48
|
+
className: "text-muted-foreground size-3 shrink-0"
|
|
49
|
+
}), alternative]
|
|
50
|
+
}, alternative) : /* @__PURE__ */ jsx("span", {
|
|
51
|
+
className: "text-muted-foreground block rounded-lg px-1.5 py-1 text-start text-[13px]",
|
|
52
|
+
children: alternative
|
|
53
|
+
}, alternative))]
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { GuardrailNotice, guardrail_notice_exports };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as HeatGraphPrimitive from "heat-graph";
|
|
2
|
+
declare namespace heat_graph_d_exports {
|
|
3
|
+
export { HeatGraph };
|
|
4
|
+
}
|
|
5
|
+
export declare function HeatGraph({ data }: {
|
|
6
|
+
data: HeatGraphPrimitive.DataPoint[];
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { heat_graph_d_exports };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import * as HeatGraphPrimitive from "heat-graph";
|
|
5
|
+
//#region src/components/assistant-ui/elements/heat-graph.tsx
|
|
6
|
+
var heat_graph_exports = /* @__PURE__ */ __exportAll({ HeatGraph: () => HeatGraph });
|
|
7
|
+
const EMPTY = "var(--aui-heat-empty)";
|
|
8
|
+
const COLORS = [
|
|
9
|
+
EMPTY,
|
|
10
|
+
`color-mix(in oklab, #2563eb 25%, ${EMPTY})`,
|
|
11
|
+
`color-mix(in oklab, #2563eb 50%, ${EMPTY})`,
|
|
12
|
+
`color-mix(in oklab, #2563eb 75%, ${EMPTY})`,
|
|
13
|
+
"#2563eb"
|
|
14
|
+
];
|
|
15
|
+
function HeatGraph({ data }) {
|
|
16
|
+
return /* @__PURE__ */ jsxs(HeatGraphPrimitive.Root, {
|
|
17
|
+
data,
|
|
18
|
+
weekStart: "monday",
|
|
19
|
+
colorScale: COLORS,
|
|
20
|
+
className: "flex flex-col gap-2",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx(MonthLabels, {}),
|
|
23
|
+
/* @__PURE__ */ jsxs("div", {
|
|
24
|
+
className: "flex gap-2",
|
|
25
|
+
children: [/* @__PURE__ */ jsx(DayLabels, {}), /* @__PURE__ */ jsx(CellGrid, {})]
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsx(GraphLegend, {}),
|
|
28
|
+
/* @__PURE__ */ jsx(CellTooltip, {})
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A label this many columns or fewer after the first one crowds it: the first
|
|
34
|
+
* column started late in its month, so the next month's label lands right
|
|
35
|
+
* beside it ("SepOct").
|
|
36
|
+
*/
|
|
37
|
+
const CROWDED_COLUMNS = 2;
|
|
38
|
+
function MonthLabels() {
|
|
39
|
+
return /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: "relative ms-10 h-5",
|
|
41
|
+
children: /* @__PURE__ */ jsx(HeatGraphPrimitive.MonthLabels, { children: ({ label, totalWeeks }) => /* @__PURE__ */ jsx("span", {
|
|
42
|
+
"data-crowds-first": label.column > 0 && label.column <= CROWDED_COLUMNS ? "" : void 0,
|
|
43
|
+
className: "absolute text-xs text-muted-foreground [&:has(+[data-crowds-first])]:hidden",
|
|
44
|
+
style: { left: `${label.column / totalWeeks * 100}%` },
|
|
45
|
+
children: HeatGraphPrimitive.MONTH_SHORT[label.month]
|
|
46
|
+
}) })
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function DayLabels() {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", {
|
|
51
|
+
className: "flex w-8 shrink-0 flex-col justify-between py-[2px]",
|
|
52
|
+
children: /* @__PURE__ */ jsx(HeatGraphPrimitive.DayLabels, { children: ({ label }) => /* @__PURE__ */ jsx("span", {
|
|
53
|
+
className: "flex h-[13px] items-center text-xs text-muted-foreground",
|
|
54
|
+
children: label.row % 2 === 0 ? HeatGraphPrimitive.DAY_SHORT[label.dayOfWeek] : ""
|
|
55
|
+
}) })
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function CellGrid() {
|
|
59
|
+
return /* @__PURE__ */ jsx(HeatGraphPrimitive.Grid, {
|
|
60
|
+
className: "flex-1 gap-[3px]",
|
|
61
|
+
children: () => /* @__PURE__ */ jsx(HeatGraphPrimitive.Cell, { className: "aspect-square w-full rounded-sm" })
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function CellTooltip() {
|
|
65
|
+
return /* @__PURE__ */ jsx(HeatGraphPrimitive.Tooltip, {
|
|
66
|
+
className: "pointer-events-none rounded-md bg-gray-900 px-3 py-1.5 text-xs whitespace-nowrap text-white",
|
|
67
|
+
children: ({ cell }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsxs("strong", { children: [cell.count, " contributions"] }),
|
|
69
|
+
" on",
|
|
70
|
+
" ",
|
|
71
|
+
cell.date.toLocaleDateString("en-US", {
|
|
72
|
+
month: "short",
|
|
73
|
+
day: "numeric",
|
|
74
|
+
year: "numeric"
|
|
75
|
+
})
|
|
76
|
+
] })
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function GraphLegend() {
|
|
80
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
81
|
+
className: "ms-auto flex items-center gap-1 text-xs text-muted-foreground",
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsx("span", { children: "Less" }),
|
|
84
|
+
/* @__PURE__ */ jsx(HeatGraphPrimitive.Legend, { children: () => /* @__PURE__ */ jsx(HeatGraphPrimitive.LegendLevel, { className: "h-[13px] w-[13px] rounded-sm" }) }),
|
|
85
|
+
/* @__PURE__ */ jsx("span", { children: "More" })
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { HeatGraph, heat_graph_exports };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace image_gallery_d_exports {
|
|
3
|
+
export { GalleryImage, ImageGallery, ImageGalleryProps };
|
|
4
|
+
}
|
|
5
|
+
export interface GalleryImage {
|
|
6
|
+
id: string;
|
|
7
|
+
src: string;
|
|
8
|
+
alt: string;
|
|
9
|
+
caption?: string | undefined;
|
|
10
|
+
source?: {
|
|
11
|
+
label?: string | undefined;
|
|
12
|
+
url?: string | undefined;
|
|
13
|
+
} | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface ImageGalleryProps extends Omit<ComponentProps<"div">, "children"> {
|
|
16
|
+
images: readonly GalleryImage[];
|
|
17
|
+
maxVisible?: number | undefined;
|
|
18
|
+
onOpen?: ((id: string) => void) | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare function ImageGallery({ images, maxVisible, onOpen, className, ...props }: ImageGalleryProps): import("react").JSX.Element | null;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { image_gallery_d_exports };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { Dialog, DialogContent, DialogTitle } from "../../ui/dialog.js";
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
|
+
import { field, ghostButton, mono } from "./surfaces.js";
|
|
6
|
+
import { clamp } from "../utils/range.js";
|
|
7
|
+
import { safeHref } from "../utils/href.js";
|
|
8
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { ChevronLeftIcon, ChevronRightIcon, ExternalLinkIcon, ImageOffIcon } from "lucide-react";
|
|
11
|
+
//#region src/components/assistant-ui/elements/image-gallery.tsx
|
|
12
|
+
var image_gallery_exports = /* @__PURE__ */ __exportAll({ ImageGallery: () => ImageGallery });
|
|
13
|
+
const keyForImage = (image) => `${image.id}\u0000${image.src}`;
|
|
14
|
+
function ImageGallery({ images, maxVisible = 6, onOpen, className, ...props }) {
|
|
15
|
+
const [activeId, setActiveId] = useState(null);
|
|
16
|
+
const [failedImages, setFailedImages] = useState(() => /* @__PURE__ */ new Set());
|
|
17
|
+
const triggerRef = useRef(null);
|
|
18
|
+
const index = images.findIndex((image) => image.id === activeId);
|
|
19
|
+
if (activeId !== null && index === -1) setActiveId(null);
|
|
20
|
+
const activeImage = index === -1 ? void 0 : images[index];
|
|
21
|
+
const sourceHref = safeHref(activeImage?.source?.url);
|
|
22
|
+
const visibleCount = Math.floor(clamp(maxVisible, 1, images.length));
|
|
23
|
+
const visibleImages = images.slice(0, visibleCount);
|
|
24
|
+
const close = useCallback(() => {
|
|
25
|
+
setActiveId(null);
|
|
26
|
+
triggerRef.current?.focus();
|
|
27
|
+
}, []);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (activeImage === void 0) return;
|
|
30
|
+
const onKeyDown = (event) => {
|
|
31
|
+
if (event.key === "ArrowLeft" && index > 0) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
setActiveId(images[index - 1]?.id ?? null);
|
|
34
|
+
} else if (event.key === "ArrowRight" && index < images.length - 1) {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
setActiveId(images[index + 1]?.id ?? null);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
document.addEventListener("keydown", onKeyDown, true);
|
|
40
|
+
return () => document.removeEventListener("keydown", onKeyDown, true);
|
|
41
|
+
}, [
|
|
42
|
+
activeImage,
|
|
43
|
+
images,
|
|
44
|
+
index
|
|
45
|
+
]);
|
|
46
|
+
const open = (nextIndex, trigger) => {
|
|
47
|
+
const image = images[nextIndex];
|
|
48
|
+
if (!image) return;
|
|
49
|
+
triggerRef.current = trigger;
|
|
50
|
+
setActiveId(image.id);
|
|
51
|
+
onOpen?.(image.id);
|
|
52
|
+
};
|
|
53
|
+
const markFailed = (image) => {
|
|
54
|
+
const key = keyForImage(image);
|
|
55
|
+
setFailedImages((current) => current.has(key) ? current : new Set(current).add(key));
|
|
56
|
+
};
|
|
57
|
+
if (images.length === 0) return null;
|
|
58
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
59
|
+
"data-slot": "image-gallery",
|
|
60
|
+
className: cn("@container w-full max-w-md", className),
|
|
61
|
+
...props,
|
|
62
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
63
|
+
className: "grid grid-cols-2 gap-2 @sm:grid-cols-3",
|
|
64
|
+
children: visibleImages.map((image, imageIndex) => {
|
|
65
|
+
const failed = failedImages.has(keyForImage(image));
|
|
66
|
+
const overflow = imageIndex === visibleCount - 1 && images.length > visibleCount;
|
|
67
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
"aria-label": `Open image: ${image.alt}`,
|
|
70
|
+
onClick: (event) => open(imageIndex, event.currentTarget),
|
|
71
|
+
className: cn(field, "focus-visible:ring-ring/50 relative aspect-square overflow-hidden rounded-xl ring-offset-background transition-[transform,background-color] duration-150 outline-none hover:scale-[1.01] focus-visible:ring-[3px] focus-visible:ring-offset-2 active:scale-[0.98] motion-reduce:transition-none"),
|
|
72
|
+
children: [failed ? /* @__PURE__ */ jsx("span", {
|
|
73
|
+
className: "text-muted-foreground flex size-full items-center justify-center",
|
|
74
|
+
children: /* @__PURE__ */ jsx(ImageOffIcon, {
|
|
75
|
+
"aria-hidden": true,
|
|
76
|
+
className: "size-6"
|
|
77
|
+
})
|
|
78
|
+
}) : /* @__PURE__ */ jsx("img", {
|
|
79
|
+
src: image.src,
|
|
80
|
+
alt: image.alt,
|
|
81
|
+
loading: "lazy",
|
|
82
|
+
className: "size-full object-cover",
|
|
83
|
+
onError: () => markFailed(image)
|
|
84
|
+
}), overflow ? /* @__PURE__ */ jsxs("span", {
|
|
85
|
+
className: "absolute inset-0 bg-black/60 text-white flex items-center justify-center text-lg font-medium",
|
|
86
|
+
children: ["+", images.length - visibleCount]
|
|
87
|
+
}) : null]
|
|
88
|
+
}, image.id);
|
|
89
|
+
})
|
|
90
|
+
}), activeImage ? /* @__PURE__ */ jsx(Dialog, {
|
|
91
|
+
open: true,
|
|
92
|
+
onOpenChange: (nextOpen) => {
|
|
93
|
+
if (!nextOpen) close();
|
|
94
|
+
},
|
|
95
|
+
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
96
|
+
className: "gap-3 p-3 duration-150 motion-reduce:animate-none sm:max-w-4xl",
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsxs(DialogTitle, {
|
|
99
|
+
className: "sr-only",
|
|
100
|
+
children: [
|
|
101
|
+
"Image ",
|
|
102
|
+
index + 1,
|
|
103
|
+
" of ",
|
|
104
|
+
images.length
|
|
105
|
+
]
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ jsx("div", {
|
|
108
|
+
className: "flex min-h-0 items-center justify-center px-10",
|
|
109
|
+
children: failedImages.has(keyForImage(activeImage)) ? /* @__PURE__ */ jsx("div", {
|
|
110
|
+
className: "text-muted-foreground flex h-[min(75vh,32rem)] w-full items-center justify-center",
|
|
111
|
+
children: /* @__PURE__ */ jsx(ImageOffIcon, {
|
|
112
|
+
"aria-hidden": true,
|
|
113
|
+
className: "size-8"
|
|
114
|
+
})
|
|
115
|
+
}) : /* @__PURE__ */ jsx("img", {
|
|
116
|
+
src: activeImage.src,
|
|
117
|
+
alt: activeImage.alt,
|
|
118
|
+
className: "max-h-[75vh] max-w-full object-contain",
|
|
119
|
+
onError: () => markFailed(activeImage)
|
|
120
|
+
})
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ jsxs("div", {
|
|
123
|
+
className: "flex min-w-0 items-center gap-2",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsx("button", {
|
|
126
|
+
type: "button",
|
|
127
|
+
"aria-label": "Previous image",
|
|
128
|
+
disabled: index === 0,
|
|
129
|
+
onClick: () => setActiveId(images[index - 1]?.id ?? null),
|
|
130
|
+
className: cn(ghostButton, "size-8 shrink-0 disabled:pointer-events-none disabled:opacity-30"),
|
|
131
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
132
|
+
"aria-hidden": true,
|
|
133
|
+
className: "size-4"
|
|
134
|
+
})
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ jsxs("div", {
|
|
137
|
+
className: "flex min-w-0 flex-1 items-center gap-2 text-sm",
|
|
138
|
+
children: [activeImage.caption ? /* @__PURE__ */ jsx("p", {
|
|
139
|
+
className: "text-foreground/75 truncate",
|
|
140
|
+
children: activeImage.caption
|
|
141
|
+
}) : null, activeImage.source?.label ? sourceHref ? /* @__PURE__ */ jsxs("a", {
|
|
142
|
+
href: sourceHref,
|
|
143
|
+
target: "_blank",
|
|
144
|
+
rel: "noopener noreferrer",
|
|
145
|
+
className: "text-muted-foreground hover:text-foreground/80 flex min-w-0 items-center gap-1 truncate transition-colors",
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx("span", {
|
|
148
|
+
className: "truncate",
|
|
149
|
+
children: activeImage.source.label
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ jsx(ExternalLinkIcon, {
|
|
152
|
+
"aria-hidden": true,
|
|
153
|
+
className: "size-3 shrink-0"
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ jsx("span", {
|
|
156
|
+
className: "sr-only",
|
|
157
|
+
children: "(opens in a new tab)"
|
|
158
|
+
})
|
|
159
|
+
]
|
|
160
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
161
|
+
className: "text-muted-foreground truncate",
|
|
162
|
+
children: activeImage.source.label
|
|
163
|
+
}) : null]
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ jsxs("span", {
|
|
166
|
+
className: cn(mono, "text-muted-foreground shrink-0"),
|
|
167
|
+
children: [
|
|
168
|
+
index + 1,
|
|
169
|
+
" / ",
|
|
170
|
+
images.length
|
|
171
|
+
]
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ jsx("button", {
|
|
174
|
+
type: "button",
|
|
175
|
+
"aria-label": "Next image",
|
|
176
|
+
disabled: index === images.length - 1,
|
|
177
|
+
onClick: () => setActiveId(images[index + 1]?.id ?? null),
|
|
178
|
+
className: cn(ghostButton, "size-8 shrink-0 disabled:pointer-events-none disabled:opacity-30"),
|
|
179
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
180
|
+
"aria-hidden": true,
|
|
181
|
+
className: "size-4"
|
|
182
|
+
})
|
|
183
|
+
})
|
|
184
|
+
]
|
|
185
|
+
})
|
|
186
|
+
]
|
|
187
|
+
})
|
|
188
|
+
}) : null]
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
export { ImageGallery, image_gallery_exports };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace image_generation_d_exports {
|
|
3
|
+
export { ImageGeneration };
|
|
4
|
+
}
|
|
5
|
+
export declare function ImageGeneration({ prompt, generating, onRegenerate, className, ...props }: Omit<ComponentProps<"div">, "children" | "prompt" | "generating" | "onRegenerate"> & {
|
|
6
|
+
prompt: string;
|
|
7
|
+
generating: boolean;
|
|
8
|
+
onRegenerate?: () => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { image_generation_d_exports };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { ShimmerLabel, mono, paper } from "./surfaces.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { RefreshCwIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/assistant-ui/elements/image-generation.tsx
|
|
8
|
+
var image_generation_exports = /* @__PURE__ */ __exportAll({ ImageGeneration: () => ImageGeneration });
|
|
9
|
+
const DOTS = Array.from({ length: 64 }, (_, i) => i);
|
|
10
|
+
function ImageGeneration({ prompt, generating, onRegenerate, className, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
"data-slot": "image-generation",
|
|
13
|
+
className: cn("flex w-52 flex-col gap-2.5", className),
|
|
14
|
+
...props,
|
|
15
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
16
|
+
className: cn(paper, "relative aspect-square w-full overflow-hidden rounded-2xl"),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: "absolute inset-0 grid grid-cols-8 place-items-center p-6",
|
|
20
|
+
"aria-hidden": true,
|
|
21
|
+
children: DOTS.map((dot) => {
|
|
22
|
+
const row = Math.floor(dot / 8);
|
|
23
|
+
const col = dot % 8;
|
|
24
|
+
return /* @__PURE__ */ jsx("span", {
|
|
25
|
+
className: cn("bg-foreground/20 size-1 rounded-full transition-opacity duration-500", generating ? "animate-pulse motion-reduce:animate-none" : "opacity-0"),
|
|
26
|
+
style: { animationDelay: `${(row + col) * 90}ms` }
|
|
27
|
+
}, dot);
|
|
28
|
+
})
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ jsx("div", {
|
|
31
|
+
"aria-hidden": true,
|
|
32
|
+
className: cn("absolute inset-0 transition-[opacity,filter] duration-1000 ease-out motion-reduce:transition-none", generating ? "opacity-0 blur-xl" : "blur-0 opacity-100"),
|
|
33
|
+
style: { background: "radial-gradient(120% 90% at 20% 100%, oklch(0.45 0.09 265) 0%, transparent 55%), radial-gradient(110% 80% at 85% 90%, oklch(0.62 0.1 300 / 0.8) 0%, transparent 60%), radial-gradient(130% 100% at 60% 0%, oklch(0.88 0.06 60) 0%, oklch(0.74 0.09 25 / 0.9) 45%, transparent 75%), linear-gradient(to top, oklch(0.35 0.06 275), oklch(0.82 0.07 50))" }
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ jsx("span", {
|
|
36
|
+
className: cn(mono, "absolute end-2.5 top-2.5 rounded-full px-1.5 py-0.5 tabular-nums", generating ? "text-muted-foreground" : "bg-black/60 text-white"),
|
|
37
|
+
children: "1024 × 1024"
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
41
|
+
className: "flex items-start justify-between gap-2",
|
|
42
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
43
|
+
className: "text-muted-foreground min-w-0 flex-1 text-xs leading-snug",
|
|
44
|
+
children: generating ? /* @__PURE__ */ jsx(ShimmerLabel, {
|
|
45
|
+
className: "relative",
|
|
46
|
+
children: "Generating"
|
|
47
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
48
|
+
className: "line-clamp-2",
|
|
49
|
+
children: prompt
|
|
50
|
+
})
|
|
51
|
+
}), onRegenerate && /* @__PURE__ */ jsx("button", {
|
|
52
|
+
type: "button",
|
|
53
|
+
"aria-label": "Regenerate image",
|
|
54
|
+
"aria-hidden": generating || void 0,
|
|
55
|
+
disabled: generating,
|
|
56
|
+
onClick: onRegenerate,
|
|
57
|
+
className: cn("flex items-center justify-center rounded-full text-muted-foreground outline-none transition-[background-color,color,scale] duration-150 hover:bg-foreground/[0.06] hover:text-foreground/90 active:scale-[0.96] focus-visible:ring-1 focus-visible:ring-foreground/20 motion-reduce:transition-none dark:hover:bg-foreground/[0.09]", "size-6 shrink-0", generating && "pointer-events-none opacity-0"),
|
|
58
|
+
children: /* @__PURE__ */ jsx(RefreshCwIcon, { className: "size-3" })
|
|
59
|
+
})]
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { ImageGeneration, image_generation_exports };
|