@dungle-scrubs/admin-ui-soft 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GUIDE.md +110 -0
- package/LICENSE +21 -0
- package/README.md +36 -2
- package/THIRD-PARTY-NOTICES.md +25 -0
- package/UPSTREAM-VENDORED-CHANGES.md +317 -0
- package/VENDORED-CHANGES.md +60 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/ai/compositions/agent-console/agent-console.d.ts +109 -0
- package/dist/ai/compositions/agent-console/agent-console.js +644 -0
- package/dist/ai/compositions/attention-feed/attention-feed.d.ts +127 -0
- package/dist/ai/compositions/attention-feed/attention-feed.js +626 -0
- package/dist/ai/compositions/conversation-browser/conversation-browser.d.ts +126 -0
- package/dist/ai/compositions/conversation-browser/conversation-browser.js +364 -0
- package/dist/ai/compositions/redaction-marker/redaction-marker.d.ts +42 -0
- package/dist/ai/compositions/redaction-marker/redaction-marker.js +202 -0
- package/dist/ai/compositions/run-inspector/json-view.js +164 -0
- package/dist/ai/compositions/run-inspector/run-inspector.d.ts +66 -0
- package/dist/ai/compositions/run-inspector/run-inspector.js +703 -0
- package/dist/ai/compositions/run-inspector/run-model.js +155 -0
- package/dist/ai/compositions/tool-approval/json-args.js +54 -0
- package/dist/ai/compositions/tool-approval/tool-approval.d.ts +57 -0
- package/dist/ai/compositions/tool-approval/tool-approval.js +331 -0
- package/dist/ai/compositions/tool-call-row/tool-call-row.js +74 -0
- package/dist/ai/compositions/transcript-viewer/to-thread-messages.js +65 -0
- package/dist/ai/compositions/transcript-viewer/transcript-viewer.d.ts +63 -0
- package/dist/ai/compositions/transcript-viewer/transcript-viewer.js +471 -0
- package/dist/ai/compositions/usage-meter/usage-format.js +107 -0
- package/dist/ai/compositions/usage-meter/usage-meter.d.ts +32 -0
- package/dist/ai/compositions/usage-meter/usage-meter.js +258 -0
- package/dist/ai/testing/mock-clock.d.ts +31 -0
- package/dist/ai/testing/mock-clock.js +66 -0
- package/dist/ai/testing/mock-reply.d.ts +70 -0
- package/dist/ai/testing/mock-reply.js +100 -0
- package/dist/ai/testing/mock-runtime.d.ts +86 -0
- package/dist/ai/testing/mock-runtime.js +384 -0
- package/dist/ai/types.d.ts +323 -0
- package/dist/ai.css +1088 -0
- package/dist/ai.d.ts +160 -0
- package/dist/ai.js +158 -0
- package/dist/components/assistant-ui/elements/activity-graph.d.ts +14 -0
- package/dist/components/assistant-ui/elements/activity-graph.js +69 -0
- package/dist/components/assistant-ui/elements/agent-card.d.ts +21 -0
- package/dist/components/assistant-ui/elements/agent-card.js +75 -0
- package/dist/components/assistant-ui/elements/agent-handoff.d.ts +13 -0
- package/dist/components/assistant-ui/elements/agent-handoff.js +47 -0
- package/dist/components/assistant-ui/elements/agent-plan.d.ts +16 -0
- package/dist/components/assistant-ui/elements/agent-plan.js +93 -0
- package/dist/components/assistant-ui/elements/agent-status.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/agent-status.aui.js +161 -0
- package/dist/components/assistant-ui/elements/agent-status.d.ts +17 -0
- package/dist/components/assistant-ui/elements/agent-status.js +47 -0
- package/dist/components/assistant-ui/elements/approval-card.d.ts +31 -0
- package/dist/components/assistant-ui/elements/approval-card.js +99 -0
- package/dist/components/assistant-ui/elements/artifact-card.d.ts +12 -0
- package/dist/components/assistant-ui/elements/artifact-card.js +47 -0
- package/dist/components/assistant-ui/elements/assistant-modal.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/assistant-modal.aui.js +276 -0
- package/dist/components/assistant-ui/elements/assistant-sidebar.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/assistant-sidebar.aui.js +18 -0
- package/dist/components/assistant-ui/elements/attachment.aui.d.ts +9 -0
- package/dist/components/assistant-ui/elements/attachment.aui.js +143 -0
- package/dist/components/assistant-ui/elements/background-inbox.d.ts +18 -0
- package/dist/components/assistant-ui/elements/background-inbox.js +65 -0
- package/dist/components/assistant-ui/elements/canvas-split.d.ts +25 -0
- package/dist/components/assistant-ui/elements/canvas-split.js +106 -0
- package/dist/components/assistant-ui/elements/chart.d.ts +19 -0
- package/dist/components/assistant-ui/elements/chart.js +105 -0
- package/dist/components/assistant-ui/elements/chat-panel.d.ts +15 -0
- package/dist/components/assistant-ui/elements/chat-panel.js +82 -0
- package/dist/components/assistant-ui/elements/checkpoint-history.d.ts +17 -0
- package/dist/components/assistant-ui/elements/checkpoint-history.js +60 -0
- package/dist/components/assistant-ui/elements/code-diff.d.ts +18 -0
- package/dist/components/assistant-ui/elements/code-diff.js +89 -0
- package/dist/components/assistant-ui/elements/code-runner.d.ts +15 -0
- package/dist/components/assistant-ui/elements/code-runner.js +108 -0
- package/dist/components/assistant-ui/elements/command-palette.d.ts +20 -0
- package/dist/components/assistant-ui/elements/command-palette.js +129 -0
- package/dist/components/assistant-ui/elements/comparison-card.d.ts +18 -0
- package/dist/components/assistant-ui/elements/comparison-card.js +58 -0
- package/dist/components/assistant-ui/elements/composer-trigger-popover.aui.d.ts +51 -0
- package/dist/components/assistant-ui/elements/composer-trigger-popover.aui.js +104 -0
- package/dist/components/assistant-ui/elements/composer.d.ts +91 -0
- package/dist/components/assistant-ui/elements/composer.js +416 -0
- package/dist/components/assistant-ui/elements/computer-use.d.ts +19 -0
- package/dist/components/assistant-ui/elements/computer-use.js +84 -0
- package/dist/components/assistant-ui/elements/confidence-marker.d.ts +20 -0
- package/dist/components/assistant-ui/elements/confidence-marker.js +58 -0
- package/dist/components/assistant-ui/elements/connection-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/connection-state.js +59 -0
- package/dist/components/assistant-ui/elements/context-breakdown.d.ts +15 -0
- package/dist/components/assistant-ui/elements/context-breakdown.js +91 -0
- package/dist/components/assistant-ui/elements/context-display.aui.d.ts +25 -0
- package/dist/components/assistant-ui/elements/context-display.aui.js +26 -0
- package/dist/components/assistant-ui/elements/context-display.d.ts +43 -0
- package/dist/components/assistant-ui/elements/context-display.js +300 -0
- package/dist/components/assistant-ui/elements/conversation-map.aui.d.ts +9 -0
- package/dist/components/assistant-ui/elements/conversation-map.aui.js +177 -0
- package/dist/components/assistant-ui/elements/conversation-map.d.ts +19 -0
- package/dist/components/assistant-ui/elements/conversation-map.js +84 -0
- package/dist/components/assistant-ui/elements/conversation-search.d.ts +20 -0
- package/dist/components/assistant-ui/elements/conversation-search.js +75 -0
- package/dist/components/assistant-ui/elements/cost-meter.d.ts +19 -0
- package/dist/components/assistant-ui/elements/cost-meter.js +76 -0
- package/dist/components/assistant-ui/elements/data-table.d.ts +72 -0
- package/dist/components/assistant-ui/elements/data-table.js +368 -0
- package/dist/components/assistant-ui/elements/day-separator.d.ts +16 -0
- package/dist/components/assistant-ui/elements/day-separator.js +44 -0
- package/dist/components/assistant-ui/elements/diagram.d.ts +15 -0
- package/dist/components/assistant-ui/elements/diagram.js +65 -0
- package/dist/components/assistant-ui/elements/directive-text.aui.d.ts +11 -0
- package/dist/components/assistant-ui/elements/directive-text.aui.js +18 -0
- package/dist/components/assistant-ui/elements/directive-text.d.ts +32 -0
- package/dist/components/assistant-ui/elements/directive-text.js +35 -0
- package/dist/components/assistant-ui/elements/document-reference.d.ts +17 -0
- package/dist/components/assistant-ui/elements/document-reference.js +62 -0
- package/dist/components/assistant-ui/elements/draft-restore.d.ts +12 -0
- package/dist/components/assistant-ui/elements/draft-restore.js +43 -0
- package/dist/components/assistant-ui/elements/edit-message.d.ts +15 -0
- package/dist/components/assistant-ui/elements/edit-message.js +63 -0
- package/dist/components/assistant-ui/elements/elicitation-form.d.ts +23 -0
- package/dist/components/assistant-ui/elements/elicitation-form.js +112 -0
- package/dist/components/assistant-ui/elements/empty-state.d.ts +16 -0
- package/dist/components/assistant-ui/elements/empty-state.js +71 -0
- package/dist/components/assistant-ui/elements/error-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/error-state.js +52 -0
- package/dist/components/assistant-ui/elements/feedback-dialog.d.ts +15 -0
- package/dist/components/assistant-ui/elements/feedback-dialog.js +77 -0
- package/dist/components/assistant-ui/elements/file-tree.d.ts +20 -0
- package/dist/components/assistant-ui/elements/file-tree.js +74 -0
- package/dist/components/assistant-ui/elements/file.d.ts +52 -0
- package/dist/components/assistant-ui/elements/file.js +222 -0
- package/dist/components/assistant-ui/elements/flow-graph.d.ts +23 -0
- package/dist/components/assistant-ui/elements/flow-graph.js +72 -0
- package/dist/components/assistant-ui/elements/follow-up-suggestions.aui.d.ts +7 -0
- package/dist/components/assistant-ui/elements/follow-up-suggestions.aui.js +30 -0
- package/dist/components/assistant-ui/elements/generative-ui.d.ts +8 -0
- package/dist/components/assistant-ui/elements/generative-ui.js +27 -0
- package/dist/components/assistant-ui/elements/geo-map.d.ts +29 -0
- package/dist/components/assistant-ui/elements/geo-map.js +190 -0
- package/dist/components/assistant-ui/elements/guardrail-notice.d.ts +15 -0
- package/dist/components/assistant-ui/elements/guardrail-notice.js +59 -0
- package/dist/components/assistant-ui/elements/heat-graph.d.ts +9 -0
- package/dist/components/assistant-ui/elements/heat-graph.js +90 -0
- package/dist/components/assistant-ui/elements/image-gallery.d.ts +22 -0
- package/dist/components/assistant-ui/elements/image-gallery.js +192 -0
- package/dist/components/assistant-ui/elements/image-generation.d.ts +11 -0
- package/dist/components/assistant-ui/elements/image-generation.js +64 -0
- package/dist/components/assistant-ui/elements/image.d.ts +59 -0
- package/dist/components/assistant-ui/elements/image.js +416 -0
- package/dist/components/assistant-ui/elements/inline-citation.d.ts +23 -0
- package/dist/components/assistant-ui/elements/inline-citation.js +90 -0
- package/dist/components/assistant-ui/elements/job-progress.d.ts +25 -0
- package/dist/components/assistant-ui/elements/job-progress.js +102 -0
- package/dist/components/assistant-ui/elements/launcher-bubble.d.ts +15 -0
- package/dist/components/assistant-ui/elements/launcher-bubble.js +71 -0
- package/dist/components/assistant-ui/elements/link-preview.d.ts +17 -0
- package/dist/components/assistant-ui/elements/link-preview.js +77 -0
- package/dist/components/assistant-ui/elements/loading-state.d.ts +13 -0
- package/dist/components/assistant-ui/elements/loading-state.js +33 -0
- package/dist/components/assistant-ui/elements/logos.d.ts +10 -0
- package/dist/components/assistant-ui/elements/logos.js +63 -0
- package/dist/components/assistant-ui/elements/map-answer.d.ts +19 -0
- package/dist/components/assistant-ui/elements/map-answer.js +120 -0
- package/dist/components/assistant-ui/elements/markdown-text.d.ts +11 -0
- package/dist/components/assistant-ui/elements/markdown-text.js +152 -0
- package/dist/components/assistant-ui/elements/math-block.d.ts +25 -0
- package/dist/components/assistant-ui/elements/math-block.js +60 -0
- package/dist/components/assistant-ui/elements/mcp-config.aui.d.ts +28 -0
- package/dist/components/assistant-ui/elements/mcp-config.aui.js +380 -0
- package/dist/components/assistant-ui/elements/mcp-server-panel.d.ts +20 -0
- package/dist/components/assistant-ui/elements/mcp-server-panel.js +114 -0
- package/dist/components/assistant-ui/elements/media-player.d.ts +21 -0
- package/dist/components/assistant-ui/elements/media-player.js +302 -0
- package/dist/components/assistant-ui/elements/memory-chips.d.ts +16 -0
- package/dist/components/assistant-ui/elements/memory-chips.js +44 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.aui.d.ts +14 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.aui.js +43 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.d.ts +20 -0
- package/dist/components/assistant-ui/elements/mermaid-diagram.js +258 -0
- package/dist/components/assistant-ui/elements/message-actions.d.ts +17 -0
- package/dist/components/assistant-ui/elements/message-actions.js +57 -0
- package/dist/components/assistant-ui/elements/message-attachment.d.ts +18 -0
- package/dist/components/assistant-ui/elements/message-attachment.js +58 -0
- package/dist/components/assistant-ui/elements/message-branches.d.ts +12 -0
- package/dist/components/assistant-ui/elements/message-branches.js +55 -0
- package/dist/components/assistant-ui/elements/message-pair.d.ts +16 -0
- package/dist/components/assistant-ui/elements/message-pair.js +63 -0
- package/dist/components/assistant-ui/elements/message-queue.d.ts +15 -0
- package/dist/components/assistant-ui/elements/message-queue.js +70 -0
- package/dist/components/assistant-ui/elements/message-timing.aui.d.ts +30 -0
- package/dist/components/assistant-ui/elements/message-timing.aui.js +98 -0
- package/dist/components/assistant-ui/elements/message-timing.d.ts +14 -0
- package/dist/components/assistant-ui/elements/message-timing.js +26 -0
- package/dist/components/assistant-ui/elements/mobile-composer.d.ts +18 -0
- package/dist/components/assistant-ui/elements/mobile-composer.js +76 -0
- package/dist/components/assistant-ui/elements/model-picker.d.ts +19 -0
- package/dist/components/assistant-ui/elements/model-picker.js +68 -0
- package/dist/components/assistant-ui/elements/model-selector.aui.d.ts +23 -0
- package/dist/components/assistant-ui/elements/model-selector.aui.js +79 -0
- package/dist/components/assistant-ui/elements/model-selector.d.ts +130 -0
- package/dist/components/assistant-ui/elements/model-selector.js +399 -0
- package/dist/components/assistant-ui/elements/number-ticker.d.ts +10 -0
- package/dist/components/assistant-ui/elements/number-ticker.js +41 -0
- package/dist/components/assistant-ui/elements/onboarding.d.ts +17 -0
- package/dist/components/assistant-ui/elements/onboarding.js +69 -0
- package/dist/components/assistant-ui/elements/option-list.d.ts +39 -0
- package/dist/components/assistant-ui/elements/option-list.js +176 -0
- package/dist/components/assistant-ui/elements/permission-grant.d.ts +14 -0
- package/dist/components/assistant-ui/elements/permission-grant.js +84 -0
- package/dist/components/assistant-ui/elements/prompt-library.d.ts +20 -0
- package/dist/components/assistant-ui/elements/prompt-library.js +121 -0
- package/dist/components/assistant-ui/elements/question-flow.d.ts +24 -0
- package/dist/components/assistant-ui/elements/question-flow.js +180 -0
- package/dist/components/assistant-ui/elements/quota-banner.d.ts +14 -0
- package/dist/components/assistant-ui/elements/quota-banner.js +68 -0
- package/dist/components/assistant-ui/elements/quote-reply.d.ts +20 -0
- package/dist/components/assistant-ui/elements/quote-reply.js +66 -0
- package/dist/components/assistant-ui/elements/quote.aui.d.ts +61 -0
- package/dist/components/assistant-ui/elements/quote.aui.js +170 -0
- package/dist/components/assistant-ui/elements/read-aloud.d.ts +16 -0
- package/dist/components/assistant-ui/elements/read-aloud.js +66 -0
- package/dist/components/assistant-ui/elements/reasoning-effort.d.ts +17 -0
- package/dist/components/assistant-ui/elements/reasoning-effort.js +67 -0
- package/dist/components/assistant-ui/elements/reasoning-panel.d.ts +20 -0
- package/dist/components/assistant-ui/elements/reasoning-panel.js +60 -0
- package/dist/components/assistant-ui/elements/reasoning.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/reasoning.aui.js +70 -0
- package/dist/components/assistant-ui/elements/reasoning.d.ts +38 -0
- package/dist/components/assistant-ui/elements/reasoning.js +194 -0
- package/dist/components/assistant-ui/elements/recommendation-card.d.ts +16 -0
- package/dist/components/assistant-ui/elements/recommendation-card.js +65 -0
- package/dist/components/assistant-ui/elements/regenerate-menu.d.ts +18 -0
- package/dist/components/assistant-ui/elements/regenerate-menu.js +46 -0
- package/dist/components/assistant-ui/elements/research-report.d.ts +19 -0
- package/dist/components/assistant-ui/elements/research-report.js +63 -0
- package/dist/components/assistant-ui/elements/retrieval-chunks.d.ts +19 -0
- package/dist/components/assistant-ui/elements/retrieval-chunks.js +86 -0
- package/dist/components/assistant-ui/elements/reviewable-diff.d.ts +21 -0
- package/dist/components/assistant-ui/elements/reviewable-diff.js +104 -0
- package/dist/components/assistant-ui/elements/schedule-card.d.ts +19 -0
- package/dist/components/assistant-ui/elements/schedule-card.js +80 -0
- package/dist/components/assistant-ui/elements/score-breakdown.d.ts +19 -0
- package/dist/components/assistant-ui/elements/score-breakdown.js +107 -0
- package/dist/components/assistant-ui/elements/scroll-anchor.d.ts +15 -0
- package/dist/components/assistant-ui/elements/scroll-anchor.js +104 -0
- package/dist/components/assistant-ui/elements/settings-panel.d.ts +23 -0
- package/dist/components/assistant-ui/elements/settings-panel.js +108 -0
- package/dist/components/assistant-ui/elements/shared-conversation.d.ts +18 -0
- package/dist/components/assistant-ui/elements/shared-conversation.js +56 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.aui.d.ts +29 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.aui.js +31 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.d.ts +26 -0
- package/dist/components/assistant-ui/elements/shiki-highlighter.js +49 -0
- package/dist/components/assistant-ui/elements/sources.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/sources.aui.js +121 -0
- package/dist/components/assistant-ui/elements/sources.d.ts +21 -0
- package/dist/components/assistant-ui/elements/sources.js +109 -0
- package/dist/components/assistant-ui/elements/speaker-identity.d.ts +17 -0
- package/dist/components/assistant-ui/elements/speaker-identity.js +45 -0
- package/dist/components/assistant-ui/elements/spec-sheet.d.ts +17 -0
- package/dist/components/assistant-ui/elements/spec-sheet.js +39 -0
- package/dist/components/assistant-ui/elements/stopped-run.d.ts +12 -0
- package/dist/components/assistant-ui/elements/stopped-run.js +44 -0
- package/dist/components/assistant-ui/elements/streaming-text.d.ts +15 -0
- package/dist/components/assistant-ui/elements/streaming-text.js +45 -0
- package/dist/components/assistant-ui/elements/subagent-list.d.ts +17 -0
- package/dist/components/assistant-ui/elements/subagent-list.js +74 -0
- package/dist/components/assistant-ui/elements/suggestions.d.ts +14 -0
- package/dist/components/assistant-ui/elements/suggestions.js +25 -0
- package/dist/components/assistant-ui/elements/surfaces.d.ts +42 -0
- package/dist/components/assistant-ui/elements/surfaces.js +87 -0
- package/dist/components/assistant-ui/elements/syntax-highlighter.d.ts +7 -0
- package/dist/components/assistant-ui/elements/syntax-highlighter.js +41 -0
- package/dist/components/assistant-ui/elements/task-card.aui.d.ts +24 -0
- package/dist/components/assistant-ui/elements/task-card.aui.js +136 -0
- package/dist/components/assistant-ui/elements/task-card.d.ts +22 -0
- package/dist/components/assistant-ui/elements/task-card.js +104 -0
- package/dist/components/assistant-ui/elements/terminal-block.d.ts +27 -0
- package/dist/components/assistant-ui/elements/terminal-block.js +266 -0
- package/dist/components/assistant-ui/elements/thinking-indicator.d.ts +10 -0
- package/dist/components/assistant-ui/elements/thinking-indicator.js +30 -0
- package/dist/components/assistant-ui/elements/thread-list.aui.d.ts +39 -0
- package/dist/components/assistant-ui/elements/thread-list.aui.js +331 -0
- package/dist/components/assistant-ui/elements/thread-list.d.ts +19 -0
- package/dist/components/assistant-ui/elements/thread-list.js +72 -0
- package/dist/components/assistant-ui/elements/thread-search.d.ts +20 -0
- package/dist/components/assistant-ui/elements/thread-search.js +94 -0
- package/dist/components/assistant-ui/elements/thread.aui.d.ts +36 -0
- package/dist/components/assistant-ui/elements/thread.aui.js +625 -0
- package/dist/components/assistant-ui/elements/threadlist-sidebar.aui.d.ts +19 -0
- package/dist/components/assistant-ui/elements/threadlist-sidebar.aui.js +75 -0
- package/dist/components/assistant-ui/elements/timeline.d.ts +18 -0
- package/dist/components/assistant-ui/elements/timeline.js +40 -0
- package/dist/components/assistant-ui/elements/todo-list.d.ts +21 -0
- package/dist/components/assistant-ui/elements/todo-list.js +100 -0
- package/dist/components/assistant-ui/elements/tool-call.d.ts +17 -0
- package/dist/components/assistant-ui/elements/tool-call.js +70 -0
- package/dist/components/assistant-ui/elements/tool-error.d.ts +16 -0
- package/dist/components/assistant-ui/elements/tool-error.js +62 -0
- package/dist/components/assistant-ui/elements/tool-fallback.aui.d.ts +44 -0
- package/dist/components/assistant-ui/elements/tool-fallback.aui.js +542 -0
- package/dist/components/assistant-ui/elements/tool-group.aui.d.ts +37 -0
- package/dist/components/assistant-ui/elements/tool-group.aui.js +104 -0
- package/dist/components/assistant-ui/elements/tool-group.d.ts +20 -0
- package/dist/components/assistant-ui/elements/tool-group.js +71 -0
- package/dist/components/assistant-ui/elements/tool-timeline.d.ts +44 -0
- package/dist/components/assistant-ui/elements/tool-timeline.js +109 -0
- package/dist/components/assistant-ui/elements/tooltip-icon-button.d.ts +12 -0
- package/dist/components/assistant-ui/elements/tooltip-icon-button.js +30 -0
- package/dist/components/assistant-ui/elements/trace-waterfall.d.ts +33 -0
- package/dist/components/assistant-ui/elements/trace-waterfall.js +102 -0
- package/dist/components/assistant-ui/elements/typing-indicator.d.ts +9 -0
- package/dist/components/assistant-ui/elements/typing-indicator.js +45 -0
- package/dist/components/assistant-ui/elements/voice-conversation.aui.d.ts +11 -0
- package/dist/components/assistant-ui/elements/voice-conversation.aui.js +54 -0
- package/dist/components/assistant-ui/elements/voice-conversation.d.ts +21 -0
- package/dist/components/assistant-ui/elements/voice-conversation.js +110 -0
- package/dist/components/assistant-ui/elements/voice.aui.d.ts +22 -0
- package/dist/components/assistant-ui/elements/voice.aui.js +100 -0
- package/dist/components/assistant-ui/elements/voice.d.ts +15 -0
- package/dist/components/assistant-ui/elements/voice.js +400 -0
- package/dist/components/assistant-ui/elements/web-preview.d.ts +18 -0
- package/dist/components/assistant-ui/elements/web-preview.js +61 -0
- package/dist/components/assistant-ui/elements/web-search.d.ts +17 -0
- package/dist/components/assistant-ui/elements/web-search.js +54 -0
- package/dist/components/assistant-ui/utils/href.d.ts +13 -0
- package/dist/components/assistant-ui/utils/href.js +39 -0
- package/dist/components/assistant-ui/utils/range.d.ts +22 -0
- package/dist/components/assistant-ui/utils/range.js +48 -0
- package/dist/components/assistant-ui/utils/task.d.ts +14 -0
- package/dist/components/assistant-ui/utils/task.js +75 -0
- package/dist/components/icons/github.js +13 -0
- package/dist/components/theme-provider.d.ts +16 -0
- package/dist/components/theme-provider.js +116 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/accordion.js +53 -0
- package/dist/components/ui/alert-dialog.d.ts +20 -0
- package/dist/components/ui/alert-dialog.js +93 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +42 -0
- package/dist/components/ui/aspect-ratio.d.ts +6 -0
- package/dist/components/ui/aspect-ratio.js +13 -0
- package/dist/components/ui/attachment.d.ts +25 -0
- package/dist/components/ui/attachment.js +103 -0
- package/dist/components/ui/avatar.d.ts +13 -0
- package/dist/components/ui/avatar.js +50 -0
- package/dist/components/ui/badge.d.ts +14 -0
- package/dist/components/ui/badge.js +30 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.js +71 -0
- package/dist/components/ui/bubble.d.ts +18 -0
- package/dist/components/ui/bubble.js +72 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button-group.js +41 -0
- package/dist/components/ui/button.d.ts +19 -0
- package/dist/components/ui/button.js +71 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/calendar.js +108 -0
- package/dist/components/ui/card.d.ts +13 -0
- package/dist/components/ui/card.js +55 -0
- package/dist/components/ui/carousel.d.ts +30 -0
- package/dist/components/ui/carousel.js +131 -0
- package/dist/components/ui/chart.d.ts +46 -0
- package/dist/components/ui/chart.js +148 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.js +20 -0
- package/dist/components/ui/collapsible.d.ts +7 -0
- package/dist/components/ui/collapsible.js +23 -0
- package/dist/components/ui/combobox.d.ts +26 -0
- package/dist/components/ui/combobox.js +161 -0
- package/dist/components/ui/command.d.ts +21 -0
- package/dist/components/ui/command.js +87 -0
- package/dist/components/ui/context-menu.d.ts +31 -0
- package/dist/components/ui/context-menu.js +132 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +91 -0
- package/dist/components/ui/diff-viewer.d.ts +100 -0
- package/dist/components/ui/diff-viewer.js +461 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.js +2 -0
- package/dist/components/ui/dot-matrix.d.ts +150 -0
- package/dist/components/ui/dot-matrix.js +248 -0
- package/dist/components/ui/drawer.d.ts +18 -0
- package/dist/components/ui/drawer.js +123 -0
- package/dist/components/ui/dropdown-menu.d.ts +31 -0
- package/dist/components/ui/dropdown-menu.js +136 -0
- package/dist/components/ui/empty.d.ts +13 -0
- package/dist/components/ui/empty.js +59 -0
- package/dist/components/ui/field.d.ts +26 -0
- package/dist/components/ui/field.js +109 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/hover-card.js +36 -0
- package/dist/components/ui/input-group.d.ts +20 -0
- package/dist/components/ui/input-group.js +77 -0
- package/dist/components/ui/input-otp.d.ts +13 -0
- package/dist/components/ui/input-otp.js +46 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +14 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/item.js +120 -0
- package/dist/components/ui/kbd.d.ts +5 -0
- package/dist/components/ui/kbd.js +19 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/label.js +12 -0
- package/dist/components/ui/marker.d.ts +12 -0
- package/dist/components/ui/marker.js +42 -0
- package/dist/components/ui/menubar.d.ts +31 -0
- package/dist/components/ui/menubar.js +135 -0
- package/dist/components/ui/message-scroller.d.ts +12 -0
- package/dist/components/ui/message-scroller.js +59 -0
- package/dist/components/ui/message.d.ts +12 -0
- package/dist/components/ui/message.js +48 -0
- package/dist/components/ui/native-select.d.ts +10 -0
- package/dist/components/ui/native-select.js +37 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/navigation-menu.js +82 -0
- package/dist/components/ui/number-roll.d.ts +21 -0
- package/dist/components/ui/number-roll.js +269 -0
- package/dist/components/ui/pagination.d.ts +19 -0
- package/dist/components/ui/pagination.js +79 -0
- package/dist/components/ui/popover.d.ts +11 -0
- package/dist/components/ui/popover.js +54 -0
- package/dist/components/ui/progress.d.ts +9 -0
- package/dist/components/ui/progress.js +44 -0
- package/dist/components/ui/questionnaire.d.ts +21 -0
- package/dist/components/ui/questionnaire.js +169 -0
- package/dist/components/ui/radio-group.d.ts +7 -0
- package/dist/components/ui/radio-group.js +26 -0
- package/dist/components/ui/resizable.d.ts +9 -0
- package/dist/components/ui/resizable.js +28 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/scroll-area.js +35 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +96 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.js +14 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sheet.js +87 -0
- package/dist/components/ui/sidebar.d.ts +65 -0
- package/dist/components/ui/sidebar.js +386 -0
- package/dist/components/ui/skeleton.d.ts +4 -0
- package/dist/components/ui/skeleton.js +12 -0
- package/dist/components/ui/slider.d.ts +5 -0
- package/dist/components/ui/slider.js +33 -0
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.js +15 -0
- package/dist/components/ui/switch.d.ts +7 -0
- package/dist/components/ui/switch.js +19 -0
- package/dist/components/ui/table.d.ts +12 -0
- package/dist/components/ui/table.js +65 -0
- package/dist/components/ui/tabs.d.ts +12 -0
- package/dist/components/ui/tabs.js +45 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +12 -0
- package/dist/components/ui/toast.d.ts +18 -0
- package/dist/components/ui/toast.js +121 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle-group.js +51 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/toggle.js +35 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.js +43 -0
- package/dist/compositions/app-rail/app-rail.d.ts +19 -0
- package/dist/compositions/app-rail/app-rail.js +58 -0
- package/dist/compositions/app-shell/app-shell.d.ts +56 -0
- package/dist/compositions/app-shell/app-shell.js +143 -0
- package/dist/compositions/app-shell/theme-toggle.d.ts +10 -0
- package/dist/compositions/app-shell/theme-toggle.js +65 -0
- package/dist/compositions/confirm-action/confirm-action.d.ts +48 -0
- package/dist/compositions/confirm-action/confirm-action.js +48 -0
- package/dist/compositions/data-table/data-table-state.d.ts +23 -0
- package/dist/compositions/data-table/data-table-state.js +46 -0
- package/dist/compositions/data-table/data-table.d.ts +185 -0
- package/dist/compositions/data-table/data-table.js +615 -0
- package/dist/compositions/date-range-picker/date-range-options.d.ts +28 -0
- package/dist/compositions/date-range-picker/date-range-options.js +61 -0
- package/dist/compositions/date-range-picker/date-range-picker.d.ts +55 -0
- package/dist/compositions/date-range-picker/date-range-picker.js +409 -0
- package/dist/compositions/decision-queue/decision-queue.d.ts +114 -0
- package/dist/compositions/decision-queue/decision-queue.js +478 -0
- package/dist/compositions/event-feed/event-feed.d.ts +59 -0
- package/dist/compositions/event-feed/event-feed.js +105 -0
- package/dist/compositions/feedback.d.ts +20 -0
- package/dist/compositions/feedback.js +49 -0
- package/dist/compositions/fields.d.ts +64 -0
- package/dist/compositions/fields.js +293 -0
- package/dist/compositions/form-kit/form-context.d.ts +10 -0
- package/dist/compositions/form-kit/form-context.js +12 -0
- package/dist/compositions/form-kit/form-fields.d.ts +95 -0
- package/dist/compositions/form-kit/form-fields.js +233 -0
- package/dist/compositions/form-kit/form-kit.d.ts +128 -0
- package/dist/compositions/form-kit/form-kit.js +119 -0
- package/dist/compositions/inspector/inspector.d.ts +53 -0
- package/dist/compositions/inspector/inspector.js +80 -0
- package/dist/compositions/layout.d.ts +36 -0
- package/dist/compositions/layout.js +86 -0
- package/dist/compositions/state-blocks/state-blocks.d.ts +42 -0
- package/dist/compositions/state-blocks/state-blocks.js +81 -0
- package/dist/compositions/status-panel/status-panel.d.ts +94 -0
- package/dist/compositions/status-panel/status-panel.js +189 -0
- package/dist/fonts/InterVariable.woff2 +0 -0
- package/dist/fonts/inter.css +15 -0
- package/dist/hooks/use-attachment-src.js +35 -0
- package/dist/hooks/use-copy-to-clipboard.js +34 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +18 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +102 -0
- package/dist/lib/context-level.js +7 -0
- package/dist/lib/elapsed.js +61 -0
- package/dist/lib/iso-date.js +30 -0
- package/dist/lib/motion-loop.js +41 -0
- package/dist/lib/pointer.js +14 -0
- package/dist/lib/status-tone.d.ts +7 -0
- package/dist/lib/status-tone.js +55 -0
- package/dist/lib/triage-keys.js +229 -0
- package/dist/lib/utils.js +2 -0
- package/dist/motion/alert-toast/alert-toast.d.ts +51 -0
- package/dist/motion/alert-toast/alert-toast.js +226 -0
- package/dist/motion/branch-menu/branch-menu.d.ts +47 -0
- package/dist/motion/branch-menu/branch-menu.js +287 -0
- package/dist/motion/check-item/check-item.d.ts +24 -0
- package/dist/motion/check-item/check-item.js +110 -0
- package/dist/motion/dial/dial.d.ts +39 -0
- package/dist/motion/dial/dial.js +290 -0
- package/dist/motion/dictation-button/dictation-button.d.ts +45 -0
- package/dist/motion/dictation-button/dictation-button.js +232 -0
- package/dist/motion/hold-button/hold-button.d.ts +37 -0
- package/dist/motion/hold-button/hold-button.js +192 -0
- package/dist/motion/masonry-grid/masonry-grid.d.ts +42 -0
- package/dist/motion/masonry-grid/masonry-grid.js +145 -0
- package/dist/motion/prompt-composer/prompt-composer.d.ts +90 -0
- package/dist/motion/prompt-composer/prompt-composer.js +374 -0
- package/dist/motion/scrub-select/scrub-select.d.ts +33 -0
- package/dist/motion/scrub-select/scrub-select.js +346 -0
- package/dist/motion/spotlight-grid/spotlight-grid.d.ts +40 -0
- package/dist/motion/spotlight-grid/spotlight-grid.js +171 -0
- package/dist/motion/star-rating/star-rating.d.ts +32 -0
- package/dist/motion/star-rating/star-rating.js +191 -0
- package/dist/motion/status-glyph/status-glyph.d.ts +28 -0
- package/dist/motion/status-glyph/status-glyph.js +171 -0
- package/dist/motion/stepper/stepper.d.ts +56 -0
- package/dist/motion/stepper/stepper.js +211 -0
- package/dist/motion/swipe-row/swipe-row.d.ts +52 -0
- package/dist/motion/swipe-row/swipe-row.js +208 -0
- package/dist/motion/thinking-trace/thinking-trace.d.ts +32 -0
- package/dist/motion/thinking-trace/thinking-trace.js +186 -0
- package/dist/motion/tool-call-chip/tool-call-chip.d.ts +36 -0
- package/dist/motion/tool-call-chip/tool-call-chip.js +135 -0
- package/dist/motion/working-indicator/working-indicator.d.ts +38 -0
- package/dist/motion/working-indicator/working-indicator.js +171 -0
- package/dist/styles.css +828 -0
- package/dist/tokens.css +230 -0
- package/licenses/Inter-OFL.txt +92 -0
- package/licenses/assistant-ui-MIT.txt +21 -0
- package/licenses/shadcn-MIT.md +21 -0
- package/package.json +131 -3
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { ArrowLeftIcon } from "lucide-react";
|
|
4
|
+
//#region src/compositions/layout.tsx
|
|
5
|
+
function Page({ actions, backLink, children, className, subtitle, title, titleMetadata, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs("main", {
|
|
7
|
+
...props,
|
|
8
|
+
className: cn("soft-page", className),
|
|
9
|
+
children: [
|
|
10
|
+
backLink && /* @__PURE__ */ jsxs(Link, {
|
|
11
|
+
...backLink,
|
|
12
|
+
className: "mb-3 inline-flex items-center gap-1",
|
|
13
|
+
children: [/* @__PURE__ */ jsx(ArrowLeftIcon, {
|
|
14
|
+
"aria-hidden": "true",
|
|
15
|
+
size: 16
|
|
16
|
+
}), backLink.label]
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ jsxs("header", {
|
|
19
|
+
className: "soft-page-header",
|
|
20
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: "flex flex-wrap items-center gap-3",
|
|
22
|
+
children: [/* @__PURE__ */ jsx("h1", { children: title }), titleMetadata]
|
|
23
|
+
}), subtitle && /* @__PURE__ */ jsx("p", {
|
|
24
|
+
className: "mt-1 text-muted-foreground",
|
|
25
|
+
children: subtitle
|
|
26
|
+
})] }), actions && /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: "soft-page-actions",
|
|
28
|
+
children: actions
|
|
29
|
+
})]
|
|
30
|
+
}),
|
|
31
|
+
children
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function Section({ actions, children, className, title, ...props }) {
|
|
36
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
37
|
+
...props,
|
|
38
|
+
className: cn("soft-section", className),
|
|
39
|
+
children: [title && /* @__PURE__ */ jsxs("div", {
|
|
40
|
+
className: "mb-2 flex items-center justify-between gap-3",
|
|
41
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
42
|
+
className: "soft-section-title",
|
|
43
|
+
children: title
|
|
44
|
+
}), actions]
|
|
45
|
+
}), children]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const gaps = {
|
|
49
|
+
default: "var(--soft-space-4)",
|
|
50
|
+
large: "var(--soft-space-6)",
|
|
51
|
+
none: "0",
|
|
52
|
+
small: "var(--soft-space-2)"
|
|
53
|
+
};
|
|
54
|
+
function Stack({ align = "stretch", className, direction = "vertical", gap = "default", justify = "start", style, wrap = direction === "horizontal", ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
...props,
|
|
57
|
+
className: cn("soft-stack", className),
|
|
58
|
+
style: {
|
|
59
|
+
"--soft-gap": gaps[gap],
|
|
60
|
+
alignItems: align,
|
|
61
|
+
flexDirection: direction === "horizontal" ? "row" : "column",
|
|
62
|
+
flexWrap: wrap ? "wrap" : "nowrap",
|
|
63
|
+
justifyContent: justify === "between" ? "space-between" : justify,
|
|
64
|
+
...style
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function Grid({ className, columns = 2, gap = "default", style, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx("div", {
|
|
70
|
+
...props,
|
|
71
|
+
className: cn("soft-grid", className),
|
|
72
|
+
style: {
|
|
73
|
+
"--soft-columns": columns,
|
|
74
|
+
"--soft-gap": gaps[gap],
|
|
75
|
+
...style
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
function Link({ className, ...props }) {
|
|
80
|
+
return /* @__PURE__ */ jsx("a", {
|
|
81
|
+
...props,
|
|
82
|
+
className: cn("soft-link", className)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Grid, Link, Page, Section, Stack };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/compositions/state-blocks/state-blocks.d.ts
|
|
3
|
+
type EmptyStateProps = {
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
/** Icon shown in a muted tile above the title. */
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
/** Next step, such as a button that creates the first item. */
|
|
9
|
+
action?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Shown when a view has loaded and holds nothing. Exported as `EmptyState`
|
|
14
|
+
* because the `Empty` name belongs to the shadcn primitive it is built on.
|
|
15
|
+
*/
|
|
16
|
+
declare function EmptyState({ title, description, icon, action, className }: EmptyStateProps): React.JSX.Element;
|
|
17
|
+
type LoadingProps = {
|
|
18
|
+
/** Announced to assistive technology while the skeleton shows. */
|
|
19
|
+
label?: string;
|
|
20
|
+
/** Number of placeholder rows. */
|
|
21
|
+
rows?: number;
|
|
22
|
+
/** `list` draws an avatar and two lines per row; `text` draws paragraph lines. */
|
|
23
|
+
variant?: "list" | "text";
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
/** Skeleton placeholder shown while a view's data loads. */
|
|
27
|
+
declare function Loading({ label, rows, variant, className }: LoadingProps): React.JSX.Element;
|
|
28
|
+
type ErrorStateProps = {
|
|
29
|
+
title?: React.ReactNode;
|
|
30
|
+
/** What failed, in the words the owner needs to decide on a retry. */
|
|
31
|
+
description?: React.ReactNode;
|
|
32
|
+
/** Shows a retry button. Retrying is always the owner's action, never automatic. */
|
|
33
|
+
onRetry?: () => void;
|
|
34
|
+
retryLabel?: string;
|
|
35
|
+
/** Disables the retry button and shows a spinner while a retry runs. */
|
|
36
|
+
isRetrying?: boolean;
|
|
37
|
+
className?: string;
|
|
38
|
+
};
|
|
39
|
+
/** Destructive alert for a failed load or action, with an optional retry. */
|
|
40
|
+
declare function ErrorState({ title, description, onRetry, retryLabel, isRetrying, className }: ErrorStateProps): React.JSX.Element;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, Loading, type LoadingProps };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Alert, AlertAction, AlertDescription, AlertTitle } from "../../components/ui/alert.js";
|
|
2
|
+
import { Button } from "../../components/ui/button.js";
|
|
3
|
+
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "../../components/ui/empty.js";
|
|
4
|
+
import { Skeleton } from "../../components/ui/skeleton.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { cn } from "cn";
|
|
7
|
+
import { CircleAlertIcon, Loader2Icon, RotateCwIcon } from "lucide-react";
|
|
8
|
+
//#region src/compositions/state-blocks/state-blocks.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Shown when a view has loaded and holds nothing. Exported as `EmptyState`
|
|
11
|
+
* because the `Empty` name belongs to the shadcn primitive it is built on.
|
|
12
|
+
*/
|
|
13
|
+
function EmptyState({ title, description, icon, action, className }) {
|
|
14
|
+
return /* @__PURE__ */ jsxs(Empty, {
|
|
15
|
+
"data-slot": "empty-state",
|
|
16
|
+
className: cn("border border-dashed", className),
|
|
17
|
+
children: [/* @__PURE__ */ jsxs(EmptyHeader, { children: [
|
|
18
|
+
icon ? /* @__PURE__ */ jsx(EmptyMedia, {
|
|
19
|
+
variant: "icon",
|
|
20
|
+
children: icon
|
|
21
|
+
}) : null,
|
|
22
|
+
/* @__PURE__ */ jsx(EmptyTitle, { children: title }),
|
|
23
|
+
description ? /* @__PURE__ */ jsx(EmptyDescription, { children: description }) : null
|
|
24
|
+
] }), action ? /* @__PURE__ */ jsx(EmptyContent, { children: action }) : null]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
const TEXT_LINE_WIDTHS = [
|
|
28
|
+
"w-full",
|
|
29
|
+
"w-11/12",
|
|
30
|
+
"w-4/5",
|
|
31
|
+
"w-3/5"
|
|
32
|
+
];
|
|
33
|
+
/** Skeleton placeholder shown while a view's data loads. */
|
|
34
|
+
function Loading({ label = "Loading", rows = 3, variant = "list", className }) {
|
|
35
|
+
const rowKeys = Array.from({ length: Math.max(rows, 0) }, (_, row) => `loading-row-${row}`);
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
37
|
+
role: "status",
|
|
38
|
+
"aria-busy": "true",
|
|
39
|
+
"data-slot": "loading",
|
|
40
|
+
"data-variant": variant,
|
|
41
|
+
className: cn("flex w-full flex-col", variant === "list" ? "gap-4" : "gap-2.5", className),
|
|
42
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
43
|
+
className: "sr-only",
|
|
44
|
+
children: label
|
|
45
|
+
}), rowKeys.map((key, row) => variant === "list" ? /* @__PURE__ */ jsxs("div", {
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: "flex items-center gap-3",
|
|
48
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "size-8 shrink-0 rounded-full motion-reduce:animate-none" }), /* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: "flex flex-1 flex-col gap-2",
|
|
50
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-2/5 motion-reduce:animate-none" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-4/5 motion-reduce:animate-none" })]
|
|
51
|
+
})]
|
|
52
|
+
}, key) : /* @__PURE__ */ jsx(Skeleton, {
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
className: cn("h-3 motion-reduce:animate-none", TEXT_LINE_WIDTHS[row % TEXT_LINE_WIDTHS.length])
|
|
55
|
+
}, key))]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** Destructive alert for a failed load or action, with an optional retry. */
|
|
59
|
+
function ErrorState({ title = "Something went wrong", description, onRetry, retryLabel = "Retry", isRetrying = false, className }) {
|
|
60
|
+
return /* @__PURE__ */ jsxs(Alert, {
|
|
61
|
+
variant: "destructive",
|
|
62
|
+
"data-slot": "error-state",
|
|
63
|
+
className,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx(CircleAlertIcon, {}),
|
|
66
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: title }),
|
|
67
|
+
description ? /* @__PURE__ */ jsx(AlertDescription, { children: description }) : null,
|
|
68
|
+
onRetry ? /* @__PURE__ */ jsx(AlertAction, { children: /* @__PURE__ */ jsxs(Button, {
|
|
69
|
+
variant: "outline",
|
|
70
|
+
size: "xs",
|
|
71
|
+
className: "text-foreground",
|
|
72
|
+
onClick: () => onRetry(),
|
|
73
|
+
disabled: isRetrying,
|
|
74
|
+
"aria-busy": isRetrying || void 0,
|
|
75
|
+
children: [isRetrying ? /* @__PURE__ */ jsx(Loader2Icon, { className: "animate-spin motion-reduce:animate-none" }) : /* @__PURE__ */ jsx(RotateCwIcon, {}), retryLabel]
|
|
76
|
+
}) }) : null
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { EmptyState, ErrorState, Loading };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { StatusTone } from "../../lib/status-tone.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/compositions/status-panel/status-panel.d.ts
|
|
4
|
+
export type StatusPanelTone = StatusTone;
|
|
5
|
+
export interface StatusPanelState {
|
|
6
|
+
/** The state chip's text, for example "Granted" or "Revoked". */
|
|
7
|
+
label: string;
|
|
8
|
+
/** How the state reads at a glance. Defaults to `neutral`. */
|
|
9
|
+
tone?: StatusPanelTone;
|
|
10
|
+
}
|
|
11
|
+
export interface StatusPanelCounter {
|
|
12
|
+
label: string;
|
|
13
|
+
value: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/** What the confirmation says before a toggle runs. */
|
|
16
|
+
export interface StatusPanelConfirm {
|
|
17
|
+
/** The question, for example "Revoke sending?". */
|
|
18
|
+
title: string;
|
|
19
|
+
/** Plain text naming what happens if the owner confirms. */
|
|
20
|
+
consequence: string;
|
|
21
|
+
/** Label of the confirm button, for example "Revoke". */
|
|
22
|
+
confirmLabel: string;
|
|
23
|
+
/** Style the confirm button as a destructive action. */
|
|
24
|
+
destructive?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface StatusPanelToggle {
|
|
27
|
+
/** Whether the switch is on. The panel never flips it: the app does, once `onToggle` settles. */
|
|
28
|
+
checked: boolean;
|
|
29
|
+
/** The switch's visible label, for example "Sending allowed". */
|
|
30
|
+
label: string;
|
|
31
|
+
/**
|
|
32
|
+
* The confirmation for each direction: `on` before switching on, `off`
|
|
33
|
+
* before switching off. Every toggle confirms first.
|
|
34
|
+
*/
|
|
35
|
+
confirm: {
|
|
36
|
+
on: StatusPanelConfirm;
|
|
37
|
+
off: StatusPanelConfirm;
|
|
38
|
+
};
|
|
39
|
+
/** Disable the switch for a reason other than a pending toggle. */
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface StatusPanelItem {
|
|
43
|
+
id: string;
|
|
44
|
+
label: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
/** The item's current state, shown as a chip. */
|
|
47
|
+
state: StatusPanelState;
|
|
48
|
+
/** Small numbers about the item, for example "Sent today: 4". */
|
|
49
|
+
counters?: readonly StatusPanelCounter[];
|
|
50
|
+
/** A guarded on/off control. */
|
|
51
|
+
toggle?: StatusPanelToggle;
|
|
52
|
+
}
|
|
53
|
+
export interface StatusPanelToggleError {
|
|
54
|
+
/** The item whose toggle failed. */
|
|
55
|
+
itemId: string;
|
|
56
|
+
/** Plain-text error, for example the server's message. */
|
|
57
|
+
message: string;
|
|
58
|
+
}
|
|
59
|
+
export interface StatusPanelProps {
|
|
60
|
+
items: readonly StatusPanelItem[];
|
|
61
|
+
/** Runs a confirmed toggle. It is never called without the owner's confirmation. */
|
|
62
|
+
onToggle: (itemId: string, next: boolean) => void;
|
|
63
|
+
/** Whether an item's toggle is in flight. Its switch is disabled meanwhile. */
|
|
64
|
+
isPending?: (itemId: string) => boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The last failed toggle (FAILED). It shows on its item until the owner
|
|
67
|
+
* dismisses it. The panel never retries.
|
|
68
|
+
*/
|
|
69
|
+
toggleError?: StatusPanelToggleError | null;
|
|
70
|
+
/** The owner dismissed `toggleError` (FAILED to IDLE). Clear it here. */
|
|
71
|
+
onDismissToggleError?: () => void;
|
|
72
|
+
/** Accessible name of the panel. */
|
|
73
|
+
label?: string;
|
|
74
|
+
/** Show placeholder rows while the first load is in flight. */
|
|
75
|
+
isLoading?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Plain-text load error. With items on screen they stay visible below it,
|
|
78
|
+
* as the last good data.
|
|
79
|
+
*/
|
|
80
|
+
error?: string;
|
|
81
|
+
/** Offer a retry next to `error`. Retrying is the owner's action. */
|
|
82
|
+
onRetry?: () => void;
|
|
83
|
+
/** Text shown when there are no items. */
|
|
84
|
+
emptyLabel?: string;
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Status cards (the gate rail: grant, revoke, reopen), each with a state chip,
|
|
89
|
+
* counters and an optional switch. Every switch goes through ConfirmAction
|
|
90
|
+
* before `onToggle` runs; the switch is disabled while its toggle is pending,
|
|
91
|
+
* and a failed toggle shows on its card until the owner dismisses it.
|
|
92
|
+
*/
|
|
93
|
+
export declare function StatusPanel({ items, onToggle, isPending, toggleError, onDismissToggleError, label, isLoading, error, onRetry, emptyLabel, className }: StatusPanelProps): React.JSX.Element;
|
|
94
|
+
//#endregion
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { Alert, AlertAction, AlertDescription, AlertTitle } from "../../components/ui/alert.js";
|
|
2
|
+
import { Spinner } from "../../components/ui/spinner.js";
|
|
3
|
+
import { Button } from "../../components/ui/button.js";
|
|
4
|
+
import { Badge } from "../../components/ui/badge.js";
|
|
5
|
+
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../../components/ui/card.js";
|
|
6
|
+
import { Label } from "../../components/ui/label.js";
|
|
7
|
+
import { Switch } from "../../components/ui/switch.js";
|
|
8
|
+
import { ConfirmAction } from "../confirm-action/confirm-action.js";
|
|
9
|
+
import { ToneDot } from "../../lib/status-tone.js";
|
|
10
|
+
import { EmptyState, ErrorState, Loading } from "../state-blocks/state-blocks.js";
|
|
11
|
+
import * as React from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { cn } from "cn";
|
|
14
|
+
import { AlertCircleIcon } from "lucide-react";
|
|
15
|
+
//#region src/compositions/status-panel/status-panel.tsx
|
|
16
|
+
/**
|
|
17
|
+
* Status cards (the gate rail: grant, revoke, reopen), each with a state chip,
|
|
18
|
+
* counters and an optional switch. Every switch goes through ConfirmAction
|
|
19
|
+
* before `onToggle` runs; the switch is disabled while its toggle is pending,
|
|
20
|
+
* and a failed toggle shows on its card until the owner dismisses it.
|
|
21
|
+
*/
|
|
22
|
+
function StatusPanel({ items, onToggle, isPending, toggleError, onDismissToggleError, label = "Status", isLoading = false, error, onRetry, emptyLabel = "Nothing to show", className }) {
|
|
23
|
+
const baseId = React.useId();
|
|
24
|
+
const switches = React.useRef(/* @__PURE__ */ new Map());
|
|
25
|
+
const [confirmation, setConfirmation] = React.useState(null);
|
|
26
|
+
const [confirmOpen, setConfirmOpen] = React.useState(false);
|
|
27
|
+
const pending = (itemId) => isPending?.(itemId) ?? false;
|
|
28
|
+
const hasItems = items.length > 0;
|
|
29
|
+
const requestToggle = (item, next) => {
|
|
30
|
+
const toggle = item.toggle;
|
|
31
|
+
if (!toggle || toggle.disabled || pending(item.id)) return;
|
|
32
|
+
setConfirmation({
|
|
33
|
+
item,
|
|
34
|
+
toggle,
|
|
35
|
+
next
|
|
36
|
+
});
|
|
37
|
+
setConfirmOpen(true);
|
|
38
|
+
};
|
|
39
|
+
const registerSwitch = (itemId) => (element) => {
|
|
40
|
+
if (element) switches.current.set(itemId, element);
|
|
41
|
+
else switches.current.delete(itemId);
|
|
42
|
+
};
|
|
43
|
+
const dismissFailure = (itemId) => {
|
|
44
|
+
switches.current.get(itemId)?.focus();
|
|
45
|
+
onDismissToggleError?.();
|
|
46
|
+
};
|
|
47
|
+
const confirmText = confirmation ? confirmation.toggle.confirm[confirmation.next ? "on" : "off"] : void 0;
|
|
48
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
49
|
+
"aria-label": label,
|
|
50
|
+
"aria-busy": isLoading || void 0,
|
|
51
|
+
"data-slot": "status-panel",
|
|
52
|
+
className: cn("flex w-full flex-col gap-3 text-xs/relaxed", className),
|
|
53
|
+
children: [
|
|
54
|
+
error ? /* @__PURE__ */ jsx(ErrorState, {
|
|
55
|
+
title: error,
|
|
56
|
+
description: hasItems ? "Showing the last status loaded." : void 0,
|
|
57
|
+
onRetry
|
|
58
|
+
}) : null,
|
|
59
|
+
isLoading && !hasItems ? /* @__PURE__ */ jsx(Card, {
|
|
60
|
+
size: "sm",
|
|
61
|
+
"data-slot": "status-panel-loading",
|
|
62
|
+
children: /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(Loading, {
|
|
63
|
+
label: `Loading ${label.toLowerCase()}`,
|
|
64
|
+
variant: "text",
|
|
65
|
+
rows: 4
|
|
66
|
+
}) })
|
|
67
|
+
}) : null,
|
|
68
|
+
!isLoading && !hasItems && !error ? /* @__PURE__ */ jsx(EmptyState, { title: emptyLabel }) : null,
|
|
69
|
+
hasItems ? /* @__PURE__ */ jsx("ul", {
|
|
70
|
+
"aria-label": label,
|
|
71
|
+
className: "grid grid-cols-[repeat(auto-fill,minmax(min(100%,16rem),1fr))] gap-3",
|
|
72
|
+
children: items.map((item) => {
|
|
73
|
+
const tone = item.state.tone ?? "neutral";
|
|
74
|
+
const titleId = `${baseId}-${item.id}-title`;
|
|
75
|
+
const descriptionId = `${baseId}-${item.id}-description`;
|
|
76
|
+
const stateId = `${baseId}-${item.id}-state`;
|
|
77
|
+
const switchId = `${baseId}-${item.id}-switch`;
|
|
78
|
+
const errorId = `${baseId}-${item.id}-error`;
|
|
79
|
+
const isItemPending = pending(item.id);
|
|
80
|
+
const failure = toggleError?.itemId === item.id ? toggleError : null;
|
|
81
|
+
return /* @__PURE__ */ jsx("li", {
|
|
82
|
+
className: "flex",
|
|
83
|
+
children: /* @__PURE__ */ jsxs(Card, {
|
|
84
|
+
size: "sm",
|
|
85
|
+
role: "group",
|
|
86
|
+
"aria-labelledby": titleId,
|
|
87
|
+
"aria-describedby": item.description ? descriptionId : void 0,
|
|
88
|
+
"aria-busy": isItemPending || void 0,
|
|
89
|
+
"data-slot": "status-panel-item",
|
|
90
|
+
"data-pending": isItemPending || void 0,
|
|
91
|
+
"data-failed": failure ? true : void 0,
|
|
92
|
+
className: "w-full data-failed:ring-destructive/60",
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsxs(CardHeader, { children: [
|
|
95
|
+
/* @__PURE__ */ jsx(CardTitle, {
|
|
96
|
+
id: titleId,
|
|
97
|
+
children: item.label
|
|
98
|
+
}),
|
|
99
|
+
item.description ? /* @__PURE__ */ jsx(CardDescription, {
|
|
100
|
+
id: descriptionId,
|
|
101
|
+
children: item.description
|
|
102
|
+
}) : null,
|
|
103
|
+
/* @__PURE__ */ jsx(CardAction, { children: /* @__PURE__ */ jsxs(Badge, {
|
|
104
|
+
id: stateId,
|
|
105
|
+
"data-slot": "status-panel-state",
|
|
106
|
+
"data-tone": tone,
|
|
107
|
+
variant: tone === "critical" ? "destructive" : "outline",
|
|
108
|
+
children: [/* @__PURE__ */ jsx(ToneDot, { tone }), item.state.label]
|
|
109
|
+
}) })
|
|
110
|
+
] }),
|
|
111
|
+
item.counters && item.counters.length > 0 ? /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("dl", {
|
|
112
|
+
className: "grid grid-cols-[repeat(auto-fill,minmax(5rem,1fr))] gap-3",
|
|
113
|
+
children: item.counters.map((counter) => /* @__PURE__ */ jsxs("div", {
|
|
114
|
+
className: "flex flex-col gap-0.5",
|
|
115
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
116
|
+
className: "text-muted-foreground",
|
|
117
|
+
children: counter.label
|
|
118
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
119
|
+
className: "font-heading text-sm font-medium tabular-nums",
|
|
120
|
+
children: counter.value
|
|
121
|
+
})]
|
|
122
|
+
}, counter.label))
|
|
123
|
+
}) }) : null,
|
|
124
|
+
failure ? /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs(Alert, {
|
|
125
|
+
variant: "destructive",
|
|
126
|
+
"data-slot": "status-panel-toggle-error",
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsx(AlertCircleIcon, { "aria-hidden": "true" }),
|
|
129
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Change failed" }),
|
|
130
|
+
/* @__PURE__ */ jsx(AlertDescription, {
|
|
131
|
+
id: errorId,
|
|
132
|
+
children: failure.message
|
|
133
|
+
}),
|
|
134
|
+
onDismissToggleError ? /* @__PURE__ */ jsx(AlertAction, { children: /* @__PURE__ */ jsx(Button, {
|
|
135
|
+
type: "button",
|
|
136
|
+
size: "xs",
|
|
137
|
+
variant: "outline",
|
|
138
|
+
className: "text-foreground",
|
|
139
|
+
onClick: () => dismissFailure(item.id),
|
|
140
|
+
children: "Dismiss"
|
|
141
|
+
}) }) : null
|
|
142
|
+
]
|
|
143
|
+
}) }) : null,
|
|
144
|
+
item.toggle ? /* @__PURE__ */ jsxs(CardFooter, {
|
|
145
|
+
className: "mt-auto gap-2 border-t",
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx(Switch, {
|
|
148
|
+
ref: registerSwitch(item.id),
|
|
149
|
+
id: switchId,
|
|
150
|
+
checked: item.toggle.checked,
|
|
151
|
+
disabled: item.toggle.disabled || isItemPending,
|
|
152
|
+
"aria-describedby": failure ? `${stateId} ${errorId}` : stateId,
|
|
153
|
+
onCheckedChange: (next) => requestToggle(item, next)
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ jsx(Label, {
|
|
156
|
+
htmlFor: switchId,
|
|
157
|
+
children: item.toggle.label
|
|
158
|
+
}),
|
|
159
|
+
isItemPending ? /* @__PURE__ */ jsx(Spinner, {
|
|
160
|
+
"aria-label": "Pending",
|
|
161
|
+
className: "ml-auto size-3.5"
|
|
162
|
+
}) : null
|
|
163
|
+
]
|
|
164
|
+
}) : null
|
|
165
|
+
]
|
|
166
|
+
})
|
|
167
|
+
}, item.id);
|
|
168
|
+
})
|
|
169
|
+
}) : null,
|
|
170
|
+
/* @__PURE__ */ jsx(ConfirmAction, {
|
|
171
|
+
open: confirmOpen,
|
|
172
|
+
onOpenChange: setConfirmOpen,
|
|
173
|
+
title: confirmText?.title ?? "",
|
|
174
|
+
consequence: confirmText?.consequence ?? "",
|
|
175
|
+
confirmLabel: confirmText?.confirmLabel ?? "",
|
|
176
|
+
tone: confirmText?.destructive ? "destructive" : "default",
|
|
177
|
+
isPending: confirmation ? pending(confirmation.item.id) : false,
|
|
178
|
+
finalFocus: () => confirmation && switches.current.get(confirmation.item.id) || true,
|
|
179
|
+
onConfirm: () => {
|
|
180
|
+
if (!confirmation) return;
|
|
181
|
+
setConfirmOpen(false);
|
|
182
|
+
onToggle(confirmation.item.id, confirmation.next);
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
export { StatusPanel };
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Inter 4.1 variable, upright, by Rasmus Andersson (SIL OFL 1.1, see
|
|
3
|
+
* licenses/Inter-OFL.txt). Unmodified file from the official release:
|
|
4
|
+
* https://github.com/rsms/inter/releases/download/v4.1/Inter-4.1.zip
|
|
5
|
+
* archive SHA-256 9883fdd4a49d4fb66bd8177ba6625ef9a64aa45899767dde3d36aa425756b11e
|
|
6
|
+
* web/InterVariable.woff2 SHA-256 693b77d4f32ee9b8bfc995589b5fad5e99adf2832738661f5402f9978429a8e3
|
|
7
|
+
* The release ships no Latin-only subset; this is the full variable file.
|
|
8
|
+
*/
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: InterVariable;
|
|
11
|
+
font-style: normal;
|
|
12
|
+
font-weight: 100 900;
|
|
13
|
+
font-display: swap;
|
|
14
|
+
src: url("./InterVariable.woff2") format("woff2");
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { useAuiState } from "@assistant-ui/react";
|
|
4
|
+
import { useShallow } from "zustand/react/shallow";
|
|
5
|
+
//#region src/hooks/use-attachment-src.ts
|
|
6
|
+
const useFileSrc = (file) => {
|
|
7
|
+
const [entry, setEntry] = useState(void 0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (!file) {
|
|
10
|
+
setEntry(void 0);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const objectUrl = URL.createObjectURL(file);
|
|
14
|
+
setEntry({
|
|
15
|
+
file,
|
|
16
|
+
url: objectUrl
|
|
17
|
+
});
|
|
18
|
+
return () => {
|
|
19
|
+
URL.revokeObjectURL(objectUrl);
|
|
20
|
+
};
|
|
21
|
+
}, [file]);
|
|
22
|
+
return entry !== void 0 && entry.file === file ? entry.url : void 0;
|
|
23
|
+
};
|
|
24
|
+
const useAttachmentSrc = () => {
|
|
25
|
+
const { file, src } = useAuiState(useShallow((s) => {
|
|
26
|
+
if (s.attachment.type !== "image") return {};
|
|
27
|
+
if (s.attachment.file) return { file: s.attachment.file };
|
|
28
|
+
const src = s.attachment.content?.filter((c) => c.type === "image")[0]?.image;
|
|
29
|
+
if (!src) return {};
|
|
30
|
+
return { src };
|
|
31
|
+
}));
|
|
32
|
+
return useFileSrc(file) ?? src;
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { useAttachmentSrc };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
//#region src/hooks/use-copy-to-clipboard.ts
|
|
4
|
+
const useCopyToClipboard = ({ copiedDuration = 3e3 } = {}) => {
|
|
5
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
6
|
+
const copiedTimerRef = useRef(void 0);
|
|
7
|
+
const scopeGenerationRef = useRef(0);
|
|
8
|
+
useEffect(() => () => {
|
|
9
|
+
scopeGenerationRef.current += 1;
|
|
10
|
+
if (copiedTimerRef.current === void 0) return;
|
|
11
|
+
clearTimeout(copiedTimerRef.current);
|
|
12
|
+
copiedTimerRef.current = void 0;
|
|
13
|
+
setIsCopied(false);
|
|
14
|
+
}, []);
|
|
15
|
+
const copyToClipboard = (value) => {
|
|
16
|
+
if (!value || typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
17
|
+
const scopeGeneration = scopeGenerationRef.current;
|
|
18
|
+
navigator.clipboard.writeText(value).then(() => {
|
|
19
|
+
if (scopeGeneration !== scopeGenerationRef.current) return;
|
|
20
|
+
if (copiedTimerRef.current !== void 0) clearTimeout(copiedTimerRef.current);
|
|
21
|
+
setIsCopied(true);
|
|
22
|
+
copiedTimerRef.current = setTimeout(() => {
|
|
23
|
+
copiedTimerRef.current = void 0;
|
|
24
|
+
setIsCopied(false);
|
|
25
|
+
}, copiedDuration);
|
|
26
|
+
}, () => {});
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
isCopied,
|
|
30
|
+
copyToClipboard
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { useCopyToClipboard };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/hooks/use-mobile.ts
|
|
3
|
+
const MOBILE_BREAKPOINT = 768;
|
|
4
|
+
function useIsMobile() {
|
|
5
|
+
const [isMobile, setIsMobile] = React.useState(void 0);
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
const mql = window.matchMedia(`(max-width: 767px)`);
|
|
8
|
+
const onChange = () => {
|
|
9
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
10
|
+
};
|
|
11
|
+
mql.addEventListener("change", onChange);
|
|
12
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
13
|
+
return () => mql.removeEventListener("change", onChange);
|
|
14
|
+
}, []);
|
|
15
|
+
return !!isMobile;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { useIsMobile };
|