@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,368 @@
|
|
|
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 { clamp } from "../utils/range.js";
|
|
6
|
+
import { safeHref } from "../utils/href.js";
|
|
7
|
+
import { useEffect, useState } from "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/assistant-ui/elements/data-table.tsx
|
|
10
|
+
var data_table_exports = /* @__PURE__ */ __exportAll({ DataTable: () => DataTable });
|
|
11
|
+
const ISO_DATE = /^\d{4}-\d{2}-\d{2}(?:T.*)?$/;
|
|
12
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
13
|
+
const isEmpty = (value) => value === null || value === void 0;
|
|
14
|
+
const textValue = (value) => Array.isArray(value) ? value.join(", ") : String(value);
|
|
15
|
+
const isCalendarDate = (value) => {
|
|
16
|
+
const [year, month, day] = value.slice(0, 10).split("-").map(Number);
|
|
17
|
+
if (year === void 0 || month === void 0 || day === void 0) return false;
|
|
18
|
+
if (month < 1 || month > 12 || day < 1) return false;
|
|
19
|
+
return day <= (month === 2 ? year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0) ? 29 : 28 : [
|
|
20
|
+
4,
|
|
21
|
+
6,
|
|
22
|
+
9,
|
|
23
|
+
11
|
|
24
|
+
].includes(month) ? 30 : 31);
|
|
25
|
+
};
|
|
26
|
+
const asDate = (value) => {
|
|
27
|
+
const timestamp = typeof value === "number" ? value : typeof value === "string" && ISO_DATE.test(value) && isCalendarDate(value) ? Date.parse(value) : NaN;
|
|
28
|
+
return Number.isNaN(timestamp) ? void 0 : new Date(timestamp);
|
|
29
|
+
};
|
|
30
|
+
const fractionDigits = (decimals) => decimals === void 0 || !Number.isFinite(decimals) ? {} : {
|
|
31
|
+
minimumFractionDigits: Math.floor(clamp(decimals, 0, 20)),
|
|
32
|
+
maximumFractionDigits: Math.floor(clamp(decimals, 0, 20))
|
|
33
|
+
};
|
|
34
|
+
const numberOptions = (decimals, compact) => ({
|
|
35
|
+
notation: compact ? "compact" : "standard",
|
|
36
|
+
...fractionDigits(decimals)
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Formats with Intl, falling back to the raw value: a model can send a
|
|
40
|
+
* currency code or locale that Intl rejects by throwing.
|
|
41
|
+
*/
|
|
42
|
+
const formatted = (value, format) => {
|
|
43
|
+
try {
|
|
44
|
+
return format();
|
|
45
|
+
} catch {
|
|
46
|
+
return textValue(value);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const numericValue = (value) => typeof value === "number" && !Number.isNaN(value) ? value : void 0;
|
|
50
|
+
const relativeDate = (date, locale, relativeTo) => {
|
|
51
|
+
const seconds = Math.round((date.getTime() - relativeTo) / 1e3);
|
|
52
|
+
const [unit, amount] = [
|
|
53
|
+
["year", 31536e3],
|
|
54
|
+
["month", 2592e3],
|
|
55
|
+
["week", 604800],
|
|
56
|
+
["day", 86400],
|
|
57
|
+
["hour", 3600],
|
|
58
|
+
["minute", 60],
|
|
59
|
+
["second", 1]
|
|
60
|
+
].find(([, size]) => Math.abs(seconds) >= size) ?? ["second", 1];
|
|
61
|
+
return new Intl.RelativeTimeFormat(locale, { numeric: "auto" }).format(Math.round(seconds / amount), unit);
|
|
62
|
+
};
|
|
63
|
+
const relativeRefreshDelay = (columns, rows, now) => {
|
|
64
|
+
const relativeKeys = columns.filter((column) => column.format?.kind === "date" && column.format.style === "relative").map((column) => column.key);
|
|
65
|
+
const freshestAge = rows.reduce((minimum, row) => {
|
|
66
|
+
for (const key of relativeKeys) {
|
|
67
|
+
const date = asDate(row[key]);
|
|
68
|
+
if (date) minimum = Math.min(minimum, Math.abs(now - date.getTime()));
|
|
69
|
+
}
|
|
70
|
+
return minimum;
|
|
71
|
+
}, Number.POSITIVE_INFINITY);
|
|
72
|
+
if (freshestAge < 6e4) return 1e3;
|
|
73
|
+
if (freshestAge < 36e5) return 3e4;
|
|
74
|
+
if (freshestAge < 864e5) return 6e4;
|
|
75
|
+
if (freshestAge < 6048e5) return 36e5;
|
|
76
|
+
return 864e5;
|
|
77
|
+
};
|
|
78
|
+
const withUnit = (text, unit) => unit === void 0 || unit === "" ? text : /^[%‰°]/.test(unit) ? `${text}${unit}` : `${text} ${unit}`;
|
|
79
|
+
const EmptyValue = () => /* @__PURE__ */ jsx("span", {
|
|
80
|
+
className: "text-muted-foreground",
|
|
81
|
+
children: "none"
|
|
82
|
+
});
|
|
83
|
+
function Value({ column, row, locale, relativeTo, suppressRelativeHydrationWarning }) {
|
|
84
|
+
const value = row[column.key];
|
|
85
|
+
if (isEmpty(value)) return /* @__PURE__ */ jsx(EmptyValue, {});
|
|
86
|
+
const format = column.format ?? { kind: "text" };
|
|
87
|
+
if (format.kind === "number") {
|
|
88
|
+
const number = numericValue(value);
|
|
89
|
+
if (number === void 0) return /* @__PURE__ */ jsx(Fragment$1, { children: textValue(value) });
|
|
90
|
+
const content = formatted(value, () => new Intl.NumberFormat(locale, numberOptions(format.decimals, format.compact === true)).format(number));
|
|
91
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: withUnit(content, format.unit) });
|
|
92
|
+
}
|
|
93
|
+
if (format.kind === "currency") {
|
|
94
|
+
const number = numericValue(value);
|
|
95
|
+
if (number === void 0) return /* @__PURE__ */ jsx(Fragment$1, { children: textValue(value) });
|
|
96
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: formatted(value, () => new Intl.NumberFormat(locale, {
|
|
97
|
+
style: "currency",
|
|
98
|
+
currency: format.currency,
|
|
99
|
+
...numberOptions(format.decimals, format.compact === true)
|
|
100
|
+
}).format(number)) });
|
|
101
|
+
}
|
|
102
|
+
if (format.kind === "percent") {
|
|
103
|
+
const number = numericValue(value);
|
|
104
|
+
if (number === void 0) return /* @__PURE__ */ jsx(Fragment$1, { children: textValue(value) });
|
|
105
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: formatted(value, () => new Intl.NumberFormat(locale, {
|
|
106
|
+
style: "percent",
|
|
107
|
+
...fractionDigits(format.decimals)
|
|
108
|
+
}).format(format.basis === "unit" ? number / 100 : number)) });
|
|
109
|
+
}
|
|
110
|
+
if (format.kind === "delta") {
|
|
111
|
+
const number = numericValue(value);
|
|
112
|
+
if (number === void 0) return /* @__PURE__ */ jsx(Fragment$1, { children: textValue(value) });
|
|
113
|
+
const direction = number > 0 ? "↑" : number < 0 ? "↓" : "→";
|
|
114
|
+
const good = number === 0 || number > 0 === (format.upIsGood ?? true);
|
|
115
|
+
const content = formatted(value, () => new Intl.NumberFormat(locale, {
|
|
116
|
+
signDisplay: "never",
|
|
117
|
+
...fractionDigits(format.decimals)
|
|
118
|
+
}).format(number));
|
|
119
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
120
|
+
className: cn(number === 0 ? "text-muted-foreground" : good ? "text-success dark:text-success" : "text-destructive dark:text-destructive"),
|
|
121
|
+
children: [
|
|
122
|
+
direction,
|
|
123
|
+
" ",
|
|
124
|
+
withUnit(content, format.unit)
|
|
125
|
+
]
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (format.kind === "date") {
|
|
129
|
+
const date = asDate(value);
|
|
130
|
+
if (!date) return /* @__PURE__ */ jsx(Fragment$1, { children: textValue(value) });
|
|
131
|
+
const style = format.style ?? "date";
|
|
132
|
+
const content = formatted(value, () => style === "relative" ? relativeDate(date, locale, relativeTo) : new Intl.DateTimeFormat(locale, style === "datetime" ? {
|
|
133
|
+
dateStyle: "medium",
|
|
134
|
+
timeStyle: "short"
|
|
135
|
+
} : {
|
|
136
|
+
dateStyle: "medium",
|
|
137
|
+
...typeof value === "string" && DATE_ONLY.test(value) ? { timeZone: "UTC" } : {}
|
|
138
|
+
}).format(date));
|
|
139
|
+
return /* @__PURE__ */ jsx("span", {
|
|
140
|
+
title: date.toISOString(),
|
|
141
|
+
...style === "relative" && suppressRelativeHydrationWarning ? { suppressHydrationWarning: true } : {},
|
|
142
|
+
children: content
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
if (format.kind === "boolean") {
|
|
146
|
+
if (typeof value !== "boolean") return /* @__PURE__ */ jsx(Fragment$1, { children: textValue(value) });
|
|
147
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: value ? format.trueLabel ?? "Yes" : format.falseLabel ?? "No" });
|
|
148
|
+
}
|
|
149
|
+
if (format.kind === "link") {
|
|
150
|
+
const hrefValue = format.hrefKey ? row[format.hrefKey] : value;
|
|
151
|
+
const href = safeHref(typeof hrefValue === "string" ? hrefValue : void 0);
|
|
152
|
+
if (!href) return /* @__PURE__ */ jsx(Fragment$1, { children: textValue(value) });
|
|
153
|
+
return /^https?:/.test(href) ? /* @__PURE__ */ jsxs("a", {
|
|
154
|
+
href,
|
|
155
|
+
target: "_blank",
|
|
156
|
+
rel: "noopener noreferrer",
|
|
157
|
+
className: "underline underline-offset-2",
|
|
158
|
+
children: [textValue(value), /* @__PURE__ */ jsx("span", {
|
|
159
|
+
className: "sr-only",
|
|
160
|
+
children: " (opens in a new tab)"
|
|
161
|
+
})]
|
|
162
|
+
}) : /* @__PURE__ */ jsx("a", {
|
|
163
|
+
href,
|
|
164
|
+
className: "underline underline-offset-2",
|
|
165
|
+
children: textValue(value)
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (format.kind === "badge") {
|
|
169
|
+
const tone = format.tones?.[textValue(value)] ?? "neutral";
|
|
170
|
+
return /* @__PURE__ */ jsx("span", {
|
|
171
|
+
className: cn("inline-flex rounded-full px-2 py-0.5 text-xs font-medium", tone === "neutral" && cn("bg-muted", "text-muted-foreground"), tone === "success" && "bg-success/12 text-success dark:text-success", tone === "warning" && "bg-warning/12 text-warning dark:text-warning", tone === "danger" && "bg-destructive/12 text-destructive dark:text-destructive"),
|
|
172
|
+
children: textValue(value)
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
if (format.kind === "list" && Array.isArray(value)) {
|
|
176
|
+
const max = Math.max(0, Math.floor(format.max ?? value.length));
|
|
177
|
+
const shown = value.slice(0, max);
|
|
178
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
179
|
+
className: "flex flex-wrap gap-1",
|
|
180
|
+
children: [shown.map((item, index) => /* @__PURE__ */ jsx("span", {
|
|
181
|
+
className: cn(field, "text-muted-foreground rounded-md px-1.5 py-0.5 text-xs"),
|
|
182
|
+
children: item
|
|
183
|
+
}, index)), value.length > shown.length ? /* @__PURE__ */ jsxs("span", {
|
|
184
|
+
className: "text-muted-foreground px-1.5 py-0.5 text-xs",
|
|
185
|
+
children: ["+", value.length - shown.length]
|
|
186
|
+
}) : null]
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: textValue(value) });
|
|
190
|
+
}
|
|
191
|
+
const isNumeric = (format) => format?.kind === "number" || format?.kind === "currency" || format?.kind === "percent" || format?.kind === "delta";
|
|
192
|
+
const compareValues = (a, b, column, collator) => {
|
|
193
|
+
if (isEmpty(a)) return isEmpty(b) ? 0 : 1;
|
|
194
|
+
if (isEmpty(b)) return -1;
|
|
195
|
+
if (column.format?.kind === "date") {
|
|
196
|
+
const first = asDate(a);
|
|
197
|
+
const second = asDate(b);
|
|
198
|
+
if (first && second) return first.getTime() - second.getTime();
|
|
199
|
+
}
|
|
200
|
+
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
201
|
+
if (typeof a === "boolean" && typeof b === "boolean") return Number(a) - Number(b);
|
|
202
|
+
if (Array.isArray(a) && Array.isArray(b)) return a.length - b.length;
|
|
203
|
+
return collator.compare(textValue(a), textValue(b));
|
|
204
|
+
};
|
|
205
|
+
const collatorFor = (locale) => {
|
|
206
|
+
try {
|
|
207
|
+
return new Intl.Collator(locale, {
|
|
208
|
+
numeric: true,
|
|
209
|
+
sensitivity: "base"
|
|
210
|
+
});
|
|
211
|
+
} catch {
|
|
212
|
+
return new Intl.Collator("en-US", {
|
|
213
|
+
numeric: true,
|
|
214
|
+
sensitivity: "base"
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
const rowIdentifier = (row, key, index) => {
|
|
219
|
+
const value = key === void 0 ? void 0 : row[key];
|
|
220
|
+
return value === null || value === void 0 ? index : textValue(value);
|
|
221
|
+
};
|
|
222
|
+
function DataTable({ columns, rows, rowKey, caption, defaultSort, sort, onSortChange, locale = "en-US", emptyMessage = "No rows", relativeTo, className, ...props }) {
|
|
223
|
+
const [internalSort, setInternalSort] = useState(defaultSort ?? null);
|
|
224
|
+
const [announcement, setAnnouncement] = useState("");
|
|
225
|
+
const activeSort = sort === void 0 ? internalSort : sort;
|
|
226
|
+
const hasRelativeDates = columns.some((column) => column.format?.kind === "date" && column.format.style === "relative");
|
|
227
|
+
const [, setTick] = useState(0);
|
|
228
|
+
const relativeTime = relativeTo ?? Date.now();
|
|
229
|
+
const refreshDelay = relativeTo === void 0 && hasRelativeDates ? relativeRefreshDelay(columns, rows, relativeTime) : void 0;
|
|
230
|
+
useEffect(() => {
|
|
231
|
+
if (refreshDelay === void 0) return;
|
|
232
|
+
const timeout = window.setTimeout(() => setTick((tick) => tick + 1), refreshDelay);
|
|
233
|
+
return () => window.clearTimeout(timeout);
|
|
234
|
+
});
|
|
235
|
+
const sortColumn = columns.find((column) => column.key === activeSort?.key);
|
|
236
|
+
const collator = collatorFor(locale);
|
|
237
|
+
const indexedRows = rows.map((row, index) => ({
|
|
238
|
+
row,
|
|
239
|
+
index
|
|
240
|
+
}));
|
|
241
|
+
const sortedRows = activeSort && sortColumn ? indexedRows.sort((a, b) => {
|
|
242
|
+
const result = compareValues(a.row[sortColumn.key], b.row[sortColumn.key], sortColumn, collator);
|
|
243
|
+
if (result === 0) return a.index - b.index;
|
|
244
|
+
if (isEmpty(a.row[sortColumn.key]) || isEmpty(b.row[sortColumn.key])) return result;
|
|
245
|
+
return activeSort.direction === "asc" ? result : -result;
|
|
246
|
+
}) : indexedRows;
|
|
247
|
+
const primaryColumn = columns.find((column) => column.priority === "primary") ?? columns[0];
|
|
248
|
+
const changeSort = (column) => {
|
|
249
|
+
const next = activeSort?.key !== column.key ? {
|
|
250
|
+
key: column.key,
|
|
251
|
+
direction: "asc"
|
|
252
|
+
} : activeSort.direction === "asc" ? {
|
|
253
|
+
key: column.key,
|
|
254
|
+
direction: "desc"
|
|
255
|
+
} : null;
|
|
256
|
+
if (sort === void 0) setInternalSort(next);
|
|
257
|
+
setAnnouncement(next ? `Sorted by ${column.label}, ${next.direction === "asc" ? "ascending" : "descending"}` : "Sorting cleared");
|
|
258
|
+
onSortChange?.(next);
|
|
259
|
+
};
|
|
260
|
+
const cellClass = (column) => cn("text-foreground/80 px-4 py-2.5 align-top text-[13px] leading-5", (column.align ?? (isNumeric(column.format) ? "end" : "start")) === "end" && "text-end tabular-nums");
|
|
261
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
262
|
+
"data-slot": "data-table",
|
|
263
|
+
className: cn(paper, "@container w-full overflow-hidden rounded-2xl", className),
|
|
264
|
+
...props,
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ jsxs("table", {
|
|
267
|
+
className: "hidden w-full border-collapse @md:table",
|
|
268
|
+
children: [
|
|
269
|
+
caption ? /* @__PURE__ */ jsx("caption", {
|
|
270
|
+
className: "sr-only",
|
|
271
|
+
children: caption
|
|
272
|
+
}) : null,
|
|
273
|
+
/* @__PURE__ */ jsx("thead", {
|
|
274
|
+
className: "border-foreground/10 border-b",
|
|
275
|
+
children: /* @__PURE__ */ jsx("tr", { children: columns.map((column) => {
|
|
276
|
+
const direction = activeSort?.key === column.key ? activeSort.direction : void 0;
|
|
277
|
+
const sortable = column.sortable !== false;
|
|
278
|
+
return /* @__PURE__ */ jsx("th", {
|
|
279
|
+
scope: "col",
|
|
280
|
+
...direction ? { "aria-sort": direction === "asc" ? "ascending" : "descending" } : {},
|
|
281
|
+
style: column.width ? { width: column.width } : void 0,
|
|
282
|
+
className: cn(mono, "text-muted-foreground px-4 py-3 font-medium", (column.align ?? (isNumeric(column.format) ? "end" : "start")) === "end" ? "text-end" : "text-start"),
|
|
283
|
+
children: sortable ? /* @__PURE__ */ jsxs("button", {
|
|
284
|
+
type: "button",
|
|
285
|
+
onClick: () => changeSort(column),
|
|
286
|
+
"aria-label": `Sort by ${column.label}`,
|
|
287
|
+
className: "focus-visible:ring-foreground/20 -mx-1 rounded px-1 outline-none focus-visible:ring-1",
|
|
288
|
+
children: [column.label, direction ? /* @__PURE__ */ jsx("span", {
|
|
289
|
+
"aria-hidden": true,
|
|
290
|
+
className: "ms-1",
|
|
291
|
+
children: direction === "asc" ? "↑" : "↓"
|
|
292
|
+
}) : null]
|
|
293
|
+
}) : column.label
|
|
294
|
+
}, column.key);
|
|
295
|
+
}) })
|
|
296
|
+
}),
|
|
297
|
+
/* @__PURE__ */ jsx("tbody", { children: sortedRows.length === 0 ? /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
298
|
+
colSpan: Math.max(columns.length, 1),
|
|
299
|
+
className: "text-muted-foreground px-4 py-6 text-center text-[13px]",
|
|
300
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
301
|
+
role: "status",
|
|
302
|
+
children: emptyMessage
|
|
303
|
+
})
|
|
304
|
+
}) }) : sortedRows.map(({ row, index }) => /* @__PURE__ */ jsx("tr", {
|
|
305
|
+
className: "hover:bg-foreground/[0.025] transition-colors motion-reduce:transition-none",
|
|
306
|
+
children: columns.map((column) => /* @__PURE__ */ jsx("td", {
|
|
307
|
+
className: cellClass(column),
|
|
308
|
+
children: /* @__PURE__ */ jsx(Value, {
|
|
309
|
+
column,
|
|
310
|
+
row,
|
|
311
|
+
locale,
|
|
312
|
+
relativeTo: relativeTime,
|
|
313
|
+
suppressRelativeHydrationWarning: relativeTo === void 0
|
|
314
|
+
})
|
|
315
|
+
}, column.key))
|
|
316
|
+
}, rowIdentifier(row, rowKey, index))) })
|
|
317
|
+
]
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ jsx("div", {
|
|
320
|
+
role: "list",
|
|
321
|
+
className: "space-y-2 p-2.5 @md:hidden",
|
|
322
|
+
children: sortedRows.length === 0 ? /* @__PURE__ */ jsx("div", {
|
|
323
|
+
role: "status",
|
|
324
|
+
className: "text-muted-foreground px-2 py-3 text-center text-[13px]",
|
|
325
|
+
children: emptyMessage
|
|
326
|
+
}) : sortedRows.map(({ row, index }) => /* @__PURE__ */ jsxs("div", {
|
|
327
|
+
role: "listitem",
|
|
328
|
+
className: "bg-foreground/[0.025] hover:bg-foreground/[0.04] rounded-xl px-3 py-2 transition-colors motion-reduce:transition-none",
|
|
329
|
+
children: [primaryColumn ? /* @__PURE__ */ jsx("div", {
|
|
330
|
+
className: "text-foreground/90 text-[13px] leading-5 font-medium",
|
|
331
|
+
children: /* @__PURE__ */ jsx(Value, {
|
|
332
|
+
column: primaryColumn,
|
|
333
|
+
row,
|
|
334
|
+
locale,
|
|
335
|
+
relativeTo: relativeTime,
|
|
336
|
+
suppressRelativeHydrationWarning: relativeTo === void 0
|
|
337
|
+
})
|
|
338
|
+
}) : null, columns.length > 1 ? /* @__PURE__ */ jsx("dl", {
|
|
339
|
+
className: "mt-1.5 grid grid-cols-2 gap-x-4 gap-y-1 text-[12px] leading-4",
|
|
340
|
+
children: columns.filter((column) => column.key !== primaryColumn?.key).map((column) => /* @__PURE__ */ jsxs("div", {
|
|
341
|
+
className: "flex min-w-0 items-baseline justify-between gap-2",
|
|
342
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
343
|
+
className: "text-muted-foreground truncate",
|
|
344
|
+
children: column.label
|
|
345
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
346
|
+
className: "text-foreground/75 shrink-0 text-end tabular-nums",
|
|
347
|
+
children: /* @__PURE__ */ jsx(Value, {
|
|
348
|
+
column,
|
|
349
|
+
row,
|
|
350
|
+
locale,
|
|
351
|
+
relativeTo: relativeTime,
|
|
352
|
+
suppressRelativeHydrationWarning: relativeTo === void 0
|
|
353
|
+
})
|
|
354
|
+
})]
|
|
355
|
+
}, column.key))
|
|
356
|
+
}) : null]
|
|
357
|
+
}, rowIdentifier(row, rowKey, index)))
|
|
358
|
+
}),
|
|
359
|
+
/* @__PURE__ */ jsx("p", {
|
|
360
|
+
"aria-live": "polite",
|
|
361
|
+
className: "sr-only",
|
|
362
|
+
children: announcement
|
|
363
|
+
})
|
|
364
|
+
]
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
//#endregion
|
|
368
|
+
export { DataTable, data_table_exports };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace day_separator_d_exports {
|
|
3
|
+
export { DatedMessage, DaySeparator };
|
|
4
|
+
}
|
|
5
|
+
export interface DatedMessage {
|
|
6
|
+
id: string;
|
|
7
|
+
day: string;
|
|
8
|
+
time: string;
|
|
9
|
+
role: "user" | "assistant";
|
|
10
|
+
text: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function DaySeparator({ messages, className, ...props }: Omit<ComponentProps<"div">, "children" | "messages"> & {
|
|
13
|
+
messages: readonly DatedMessage[];
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { day_separator_d_exports };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { mono } from "./surfaces.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/assistant-ui/elements/day-separator.tsx
|
|
7
|
+
var day_separator_exports = /* @__PURE__ */ __exportAll({ DaySeparator: () => DaySeparator });
|
|
8
|
+
function DaySeparator({ messages, className, ...props }) {
|
|
9
|
+
let lastDay = "";
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
"data-slot": "day-separator",
|
|
12
|
+
className: cn("flex w-full max-w-sm flex-col gap-2", className),
|
|
13
|
+
...props,
|
|
14
|
+
children: messages.map((message) => {
|
|
15
|
+
const newDay = message.day !== lastDay;
|
|
16
|
+
lastDay = message.day;
|
|
17
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
18
|
+
className: "flex flex-col gap-2",
|
|
19
|
+
children: [newDay && /* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: "flex items-center gap-2.5 py-1",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx("span", { className: "bg-foreground/[0.08] h-px flex-1" }),
|
|
23
|
+
/* @__PURE__ */ jsx("span", {
|
|
24
|
+
className: cn("font-mono text-[11px] tracking-tight", "text-muted-foreground"),
|
|
25
|
+
children: message.day
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsx("span", { className: "bg-foreground/[0.08] h-px flex-1" })
|
|
28
|
+
]
|
|
29
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: cn("group flex items-baseline gap-2", message.role === "user" && "flex-row-reverse"),
|
|
31
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
32
|
+
className: cn("max-w-[80%] text-[13.5px] leading-relaxed break-words", message.role === "user" ? "bg-foreground/[0.05] rounded-2xl px-3.5 py-2" : "text-foreground/75"),
|
|
33
|
+
children: message.text
|
|
34
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: cn(mono, "text-foreground/0 group-hover:text-muted-foreground shrink-0 tabular-nums transition-colors"),
|
|
36
|
+
children: message.time
|
|
37
|
+
})]
|
|
38
|
+
})]
|
|
39
|
+
}, message.id);
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { DaySeparator, day_separator_exports };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace diagram_d_exports {
|
|
3
|
+
export { Diagram };
|
|
4
|
+
}
|
|
5
|
+
export declare function Diagram({ title, zoom, children, onZoomIn, onZoomOut, onReset, onExpand, className, ...props }: Omit<ComponentProps<"div">, "title" | "zoom" | "children" | "onZoomIn" | "onZoomOut" | "onReset" | "onExpand"> & {
|
|
6
|
+
title: string;
|
|
7
|
+
zoom: number;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
onZoomIn?: () => void;
|
|
10
|
+
onZoomOut?: () => void;
|
|
11
|
+
onReset?: () => void;
|
|
12
|
+
onExpand?: () => void;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { diagram_d_exports };
|
|
@@ -0,0 +1,65 @@
|
|
|
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 { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { MaximizeIcon, MinusIcon, PlusIcon, RotateCcwIcon } from "lucide-react";
|
|
7
|
+
//#region src/components/assistant-ui/elements/diagram.tsx
|
|
8
|
+
var diagram_exports = /* @__PURE__ */ __exportAll({ Diagram: () => Diagram });
|
|
9
|
+
function Diagram({ title, zoom, children, onZoomIn, onZoomOut, onReset, onExpand, className, ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
"data-slot": "diagram",
|
|
12
|
+
className: cn(paper, "flex w-full max-w-md flex-col overflow-hidden rounded-2xl", className),
|
|
13
|
+
...props,
|
|
14
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
15
|
+
className: "flex items-center gap-1 px-3 py-2",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: "min-w-0 flex-1 truncate text-[13px] font-medium",
|
|
19
|
+
children: title
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ jsxs("span", {
|
|
22
|
+
className: cn(mono, "text-muted-foreground shrink-0 tabular-nums"),
|
|
23
|
+
children: [Math.round(zoom * 100), "%"]
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ jsx("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
"aria-label": "Zoom out",
|
|
28
|
+
onClick: onZoomOut,
|
|
29
|
+
className: cn(ghostButton, "size-7 shrink-0"),
|
|
30
|
+
children: /* @__PURE__ */ jsx(MinusIcon, { className: "size-3.5" })
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ jsx("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
"aria-label": "Zoom in",
|
|
35
|
+
onClick: onZoomIn,
|
|
36
|
+
className: cn(ghostButton, "size-7 shrink-0"),
|
|
37
|
+
children: /* @__PURE__ */ jsx(PlusIcon, { className: "size-3.5" })
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx("button", {
|
|
40
|
+
type: "button",
|
|
41
|
+
"aria-label": "Reset the view",
|
|
42
|
+
onClick: onReset,
|
|
43
|
+
className: cn(ghostButton, "size-7 shrink-0"),
|
|
44
|
+
children: /* @__PURE__ */ jsx(RotateCcwIcon, { className: "size-3.5" })
|
|
45
|
+
}),
|
|
46
|
+
onExpand ? /* @__PURE__ */ jsx("button", {
|
|
47
|
+
type: "button",
|
|
48
|
+
"aria-label": "Open full screen",
|
|
49
|
+
onClick: onExpand,
|
|
50
|
+
className: cn(ghostButton, "size-7 shrink-0"),
|
|
51
|
+
children: /* @__PURE__ */ jsx(MaximizeIcon, { className: "size-3.5" })
|
|
52
|
+
}) : null
|
|
53
|
+
]
|
|
54
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
55
|
+
className: "border-foreground/[0.07] flex min-h-[10rem] items-center justify-center overflow-hidden border-t p-4",
|
|
56
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: "origin-center transition-transform duration-200 ease-out motion-reduce:transition-none",
|
|
58
|
+
style: { transform: `scale(${zoom})` },
|
|
59
|
+
children
|
|
60
|
+
})
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { Diagram, diagram_exports };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CreateDirectiveTextOptions, DirectiveTextFormatter, DirectiveTextSegment } from "./directive-text.js";
|
|
2
|
+
import { TextMessagePartComponent, Unstable_DirectiveFormatter } from "@assistant-ui/react";
|
|
3
|
+
declare namespace directive_text_aui_d_exports {
|
|
4
|
+
export { CreateDirectiveTextOptions, DirectiveText, DirectiveTextFormatter, DirectiveTextSegment, createDirectiveText };
|
|
5
|
+
}
|
|
6
|
+
/** Creates a `Text` message part component that parses directive syntax and renders inline chips. */
|
|
7
|
+
export declare function createDirectiveText(formatter: Unstable_DirectiveFormatter, options?: CreateDirectiveTextOptions): TextMessagePartComponent;
|
|
8
|
+
/** `Text` message part component that renders directive syntax as inline chips. */
|
|
9
|
+
export declare const DirectiveText: TextMessagePartComponent;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { type CreateDirectiveTextOptions, type DirectiveTextFormatter, type DirectiveTextSegment, directive_text_aui_d_exports };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { createDirectiveText as createDirectiveText$1 } from "./directive-text.js";
|
|
4
|
+
import { memo } from "react";
|
|
5
|
+
import { unstable_defaultDirectiveFormatter } from "@assistant-ui/react";
|
|
6
|
+
//#region src/components/assistant-ui/elements/directive-text.aui.tsx
|
|
7
|
+
var directive_text_aui_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
DirectiveText: () => DirectiveText,
|
|
9
|
+
createDirectiveText: () => createDirectiveText
|
|
10
|
+
});
|
|
11
|
+
/** Creates a `Text` message part component that parses directive syntax and renders inline chips. */
|
|
12
|
+
function createDirectiveText(formatter, options) {
|
|
13
|
+
return createDirectiveText$1(formatter, options);
|
|
14
|
+
}
|
|
15
|
+
/** `Text` message part component that renders directive syntax as inline chips. */
|
|
16
|
+
const DirectiveText = memo(createDirectiveText$1(unstable_defaultDirectiveFormatter));
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DirectiveText, createDirectiveText, directive_text_aui_exports };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
declare namespace directive_text_d_exports {
|
|
3
|
+
export { CreateDirectiveTextOptions, DirectiveTextFormatter, DirectiveTextSegment, createDirectiveText };
|
|
4
|
+
}
|
|
5
|
+
type IconComponent = FC<{
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
8
|
+
export type DirectiveTextSegment = {
|
|
9
|
+
readonly kind: "text";
|
|
10
|
+
readonly text: string;
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: "mention";
|
|
13
|
+
readonly type: string;
|
|
14
|
+
readonly label: string;
|
|
15
|
+
readonly id: string;
|
|
16
|
+
};
|
|
17
|
+
export type DirectiveTextFormatter = {
|
|
18
|
+
/** Parse text into alternating text and directive segments. */
|
|
19
|
+
parse(text: string): readonly DirectiveTextSegment[];
|
|
20
|
+
};
|
|
21
|
+
export type CreateDirectiveTextOptions = {
|
|
22
|
+
/** Maps a directive `type` to an icon component. */
|
|
23
|
+
iconMap?: Record<string, IconComponent>;
|
|
24
|
+
/** Icon rendered when `iconMap` has no entry for the segment type. */
|
|
25
|
+
fallbackIcon?: IconComponent;
|
|
26
|
+
};
|
|
27
|
+
/** Creates a text component that parses directive syntax and renders inline chips. */
|
|
28
|
+
export declare function createDirectiveText(formatter: DirectiveTextFormatter, options?: CreateDirectiveTextOptions): FC<{
|
|
29
|
+
text: string;
|
|
30
|
+
}>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { directive_text_d_exports };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { Badge } from "../../ui/badge.js";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/assistant-ui/elements/directive-text.tsx
|
|
6
|
+
var directive_text_exports = /* @__PURE__ */ __exportAll({ createDirectiveText: () => createDirectiveText });
|
|
7
|
+
/** Creates a text component that parses directive syntax and renders inline chips. */
|
|
8
|
+
function createDirectiveText(formatter, options) {
|
|
9
|
+
const iconMap = options?.iconMap;
|
|
10
|
+
const fallbackIcon = options?.fallbackIcon;
|
|
11
|
+
const Component = ({ text }) => {
|
|
12
|
+
const segments = formatter.parse(text);
|
|
13
|
+
if (segments.length === 1 && segments[0].kind === "text") return /* @__PURE__ */ jsx(Fragment, { children: text });
|
|
14
|
+
return /* @__PURE__ */ jsx(Fragment, { children: segments.map((seg, i) => {
|
|
15
|
+
if (seg.kind === "text") return /* @__PURE__ */ jsx("span", {
|
|
16
|
+
className: "whitespace-pre-wrap",
|
|
17
|
+
children: seg.text
|
|
18
|
+
}, i);
|
|
19
|
+
const Icon = iconMap?.[seg.type] ?? fallbackIcon;
|
|
20
|
+
return /* @__PURE__ */ jsxs(Badge, {
|
|
21
|
+
variant: "secondary",
|
|
22
|
+
"data-slot": "directive-text-chip",
|
|
23
|
+
"data-directive-type": seg.type,
|
|
24
|
+
"data-directive-id": seg.id,
|
|
25
|
+
"aria-label": `${seg.type}: ${seg.label}`,
|
|
26
|
+
className: "aui-directive-chip border-border bg-background items-baseline border px-1.5 py-0.5 text-[13px] leading-none [&_svg]:self-center",
|
|
27
|
+
children: [Icon && /* @__PURE__ */ jsx(Icon, {}), seg.label]
|
|
28
|
+
}, i);
|
|
29
|
+
}) });
|
|
30
|
+
};
|
|
31
|
+
Component.displayName = "DirectiveText";
|
|
32
|
+
return Component;
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { createDirectiveText, directive_text_exports };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare namespace document_reference_d_exports {
|
|
3
|
+
export { DocumentAnchor, DocumentReference };
|
|
4
|
+
}
|
|
5
|
+
export interface DocumentAnchor {
|
|
6
|
+
page: number;
|
|
7
|
+
quote: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function DocumentReference({ title, pages, anchors, activePage, onJump, className, ...props }: Omit<ComponentProps<"div">, "children" | "title" | "pages" | "anchors" | "activePage" | "onJump"> & {
|
|
10
|
+
title: string;
|
|
11
|
+
pages: number;
|
|
12
|
+
anchors: readonly DocumentAnchor[];
|
|
13
|
+
activePage: number;
|
|
14
|
+
onJump?: (page: number) => void;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { document_reference_d_exports };
|