@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,49 @@
|
|
|
1
|
+
import { Button } from "../components/ui/button.js";
|
|
2
|
+
import "../components/ui/badge.js";
|
|
3
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../components/ui/dialog.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cn } from "cn";
|
|
6
|
+
import { CircleCheckIcon, InfoIcon, TriangleAlertIcon, XIcon } from "lucide-react";
|
|
7
|
+
//#region src/compositions/feedback.tsx
|
|
8
|
+
function Banner({ children, className, dismissLabel = "Dismiss notification", onDismiss, title, tone = "info", ...props }) {
|
|
9
|
+
const Icon = tone === "success" ? CircleCheckIcon : tone === "critical" || tone === "warning" || tone === "caution" ? TriangleAlertIcon : InfoIcon;
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
11
|
+
...props,
|
|
12
|
+
className: cn("soft-banner soft-tone", className),
|
|
13
|
+
"data-slot": "banner",
|
|
14
|
+
"data-tone": tone,
|
|
15
|
+
role: tone === "critical" ? "alert" : "status",
|
|
16
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "soft-banner-header",
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
size: 20
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ jsx("span", { children: title }),
|
|
24
|
+
onDismiss && /* @__PURE__ */ jsx(Button, {
|
|
25
|
+
"aria-label": dismissLabel,
|
|
26
|
+
onClick: onDismiss,
|
|
27
|
+
size: "icon-sm",
|
|
28
|
+
variant: "tertiary",
|
|
29
|
+
children: /* @__PURE__ */ jsx(XIcon, { "aria-hidden": "true" })
|
|
30
|
+
})
|
|
31
|
+
]
|
|
32
|
+
}), children && /* @__PURE__ */ jsx("div", {
|
|
33
|
+
className: "soft-banner-body",
|
|
34
|
+
children
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function Modal({ actions, children, description, title, trigger, ...props }) {
|
|
39
|
+
return /* @__PURE__ */ jsxs(Dialog, {
|
|
40
|
+
...props,
|
|
41
|
+
children: [trigger, /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
42
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [/* @__PURE__ */ jsx(DialogTitle, { children: title }), /* @__PURE__ */ jsx(DialogDescription, { children: description })] }),
|
|
43
|
+
children,
|
|
44
|
+
actions && /* @__PURE__ */ jsx(DialogFooter, { children: actions })
|
|
45
|
+
] })]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { Banner, Modal };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Input } from "../components/ui/input.js";
|
|
2
|
+
import { Checkbox } from "../components/ui/checkbox.js";
|
|
3
|
+
import { Switch } from "../components/ui/switch.js";
|
|
4
|
+
import { Textarea } from "../components/ui/textarea.js";
|
|
5
|
+
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
6
|
+
import { Locale } from "react-day-picker";
|
|
7
|
+
//#region src/compositions/fields.d.ts
|
|
8
|
+
export interface FieldProps {
|
|
9
|
+
readonly className?: string;
|
|
10
|
+
readonly error?: string;
|
|
11
|
+
readonly hint?: ReactNode;
|
|
12
|
+
readonly id?: string;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
}
|
|
15
|
+
type InputProps = Omit<ComponentProps<typeof Input>, "className" | "id" | "type">;
|
|
16
|
+
export interface StandaloneTextFieldProps extends FieldProps, InputProps {
|
|
17
|
+
readonly type?: "text" | "email" | "password" | "search" | "tel" | "url";
|
|
18
|
+
}
|
|
19
|
+
export declare function StandaloneTextField({ className, error, hint, id, label, ...props }: StandaloneTextFieldProps): ReactElement;
|
|
20
|
+
export interface NumberFieldProps extends FieldProps, InputProps {}
|
|
21
|
+
export declare function NumberField({ className, error, hint, id, label, ...props }: NumberFieldProps): ReactElement;
|
|
22
|
+
export interface MoneyFieldProps extends FieldProps, Omit<InputProps, "onChange" | "value" | "defaultValue" | "inputMode"> {
|
|
23
|
+
readonly currency?: string;
|
|
24
|
+
readonly currencyPosition?: "prefix" | "suffix";
|
|
25
|
+
readonly defaultValue?: string;
|
|
26
|
+
readonly onValueChange?: (value: string) => void;
|
|
27
|
+
readonly value?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function MoneyField({ className, currency, currencyPosition, defaultValue, error, hint, id, label, onValueChange, value, ...props }: MoneyFieldProps): ReactElement;
|
|
30
|
+
export interface TextAreaProps extends FieldProps, Omit<ComponentProps<typeof Textarea>, "className" | "id"> {}
|
|
31
|
+
export declare function TextArea({ className, error, hint, id, label, ...props }: TextAreaProps): ReactElement;
|
|
32
|
+
export interface SelectOption {
|
|
33
|
+
readonly disabled?: boolean;
|
|
34
|
+
readonly label: string;
|
|
35
|
+
readonly value: string;
|
|
36
|
+
}
|
|
37
|
+
export interface StandaloneSelectFieldProps extends FieldProps {
|
|
38
|
+
readonly defaultValue?: string;
|
|
39
|
+
readonly disabled?: boolean;
|
|
40
|
+
readonly name?: string;
|
|
41
|
+
readonly onValueChange?: (value: string | null) => void;
|
|
42
|
+
readonly options: readonly SelectOption[];
|
|
43
|
+
readonly placeholder?: string;
|
|
44
|
+
readonly required?: boolean;
|
|
45
|
+
readonly value?: string | null;
|
|
46
|
+
}
|
|
47
|
+
export declare function StandaloneSelectField({ className, defaultValue, disabled, error, hint, id, label, name, onValueChange, options, placeholder, required, value }: StandaloneSelectFieldProps): ReactElement;
|
|
48
|
+
export interface StandaloneCheckboxFieldProps extends FieldProps, Omit<ComponentProps<typeof Checkbox>, "className" | "id"> {}
|
|
49
|
+
export declare function StandaloneCheckboxField({ className, error, hint, id, label, ...props }: StandaloneCheckboxFieldProps): ReactElement;
|
|
50
|
+
export interface StandaloneSwitchFieldProps extends FieldProps, Omit<ComponentProps<typeof Switch>, "className" | "id"> {}
|
|
51
|
+
export declare function StandaloneSwitchField({ className, error, hint, id, label, ...props }: StandaloneSwitchFieldProps): ReactElement;
|
|
52
|
+
/** Parse local calendar parts, never UTC or an ISO timestamp. Invalid input is empty. */
|
|
53
|
+
export declare function parseDateOnly(value: string | undefined): Date | undefined;
|
|
54
|
+
export declare function formatDateOnly(date: Date): string;
|
|
55
|
+
export interface DatePickerProps extends FieldProps {
|
|
56
|
+
readonly defaultMonth?: Date;
|
|
57
|
+
readonly disabled?: boolean;
|
|
58
|
+
readonly locale?: Locale;
|
|
59
|
+
readonly name?: string;
|
|
60
|
+
readonly onValueChange: (value: string) => void;
|
|
61
|
+
readonly value?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare function DatePicker({ className, defaultMonth, disabled, error, hint, id, label, locale, name, onValueChange, value }: DatePickerProps): ReactElement;
|
|
64
|
+
//#endregion
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { Button } from "../components/ui/button.js";
|
|
2
|
+
import { Calendar } from "../components/ui/calendar.js";
|
|
3
|
+
import { Checkbox } from "../components/ui/checkbox.js";
|
|
4
|
+
import { Input } from "../components/ui/input.js";
|
|
5
|
+
import { Textarea } from "../components/ui/textarea.js";
|
|
6
|
+
import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from "../components/ui/input-group.js";
|
|
7
|
+
import { Label } from "../components/ui/label.js";
|
|
8
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../components/ui/popover.js";
|
|
9
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../components/ui/select.js";
|
|
10
|
+
import { Switch } from "../components/ui/switch.js";
|
|
11
|
+
import { useId, useState } from "react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { CalendarIcon } from "lucide-react";
|
|
14
|
+
import { enUS } from "date-fns/locale";
|
|
15
|
+
//#region src/compositions/fields.tsx
|
|
16
|
+
function FieldFrame({ children, className, disabled, error, hint, id, label }) {
|
|
17
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
18
|
+
className: className ? `soft-field ${className}` : "soft-field",
|
|
19
|
+
"data-disabled": disabled || void 0,
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx(Label, {
|
|
22
|
+
"data-disabled": disabled ? "" : void 0,
|
|
23
|
+
htmlFor: id,
|
|
24
|
+
children: label
|
|
25
|
+
}),
|
|
26
|
+
children,
|
|
27
|
+
hint && /* @__PURE__ */ jsx("p", {
|
|
28
|
+
className: "soft-field-message",
|
|
29
|
+
id: `${id}-hint`,
|
|
30
|
+
children: hint
|
|
31
|
+
}),
|
|
32
|
+
error && /* @__PURE__ */ jsx("p", {
|
|
33
|
+
className: "soft-field-error",
|
|
34
|
+
id: `${id}-error`,
|
|
35
|
+
role: "alert",
|
|
36
|
+
children: error
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function useFieldIds({ error, hint, id }) {
|
|
42
|
+
const generated = useId();
|
|
43
|
+
const controlId = id ?? generated;
|
|
44
|
+
return {
|
|
45
|
+
"aria-describedby": [hint ? `${controlId}-hint` : "", error ? `${controlId}-error` : ""].filter(Boolean).join(" ") || void 0,
|
|
46
|
+
"aria-invalid": Boolean(error),
|
|
47
|
+
id: controlId
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function StandaloneTextField({ className, error, hint, id, label, ...props }) {
|
|
51
|
+
const field = {
|
|
52
|
+
className,
|
|
53
|
+
error,
|
|
54
|
+
hint,
|
|
55
|
+
id,
|
|
56
|
+
label
|
|
57
|
+
};
|
|
58
|
+
const ids = useFieldIds(field);
|
|
59
|
+
return /* @__PURE__ */ jsx(FieldFrame, {
|
|
60
|
+
...field,
|
|
61
|
+
id: ids.id,
|
|
62
|
+
disabled: props.disabled,
|
|
63
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
64
|
+
...props,
|
|
65
|
+
...ids
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function NumberField({ className, error, hint, id, label, ...props }) {
|
|
70
|
+
const field = {
|
|
71
|
+
className,
|
|
72
|
+
error,
|
|
73
|
+
hint,
|
|
74
|
+
id,
|
|
75
|
+
label
|
|
76
|
+
};
|
|
77
|
+
const ids = useFieldIds(field);
|
|
78
|
+
return /* @__PURE__ */ jsx(FieldFrame, {
|
|
79
|
+
...field,
|
|
80
|
+
id: ids.id,
|
|
81
|
+
disabled: props.disabled,
|
|
82
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
83
|
+
...props,
|
|
84
|
+
...ids,
|
|
85
|
+
type: "number"
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function MoneyField({ className, currency = "$", currencyPosition = "prefix", defaultValue = "", error, hint, id, label, onValueChange, value, ...props }) {
|
|
90
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
91
|
+
const field = {
|
|
92
|
+
className,
|
|
93
|
+
error,
|
|
94
|
+
hint,
|
|
95
|
+
id,
|
|
96
|
+
label
|
|
97
|
+
};
|
|
98
|
+
const ids = useFieldIds(field);
|
|
99
|
+
return /* @__PURE__ */ jsx(FieldFrame, {
|
|
100
|
+
...field,
|
|
101
|
+
id: ids.id,
|
|
102
|
+
disabled: props.disabled,
|
|
103
|
+
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
104
|
+
"data-disabled": props.disabled || void 0,
|
|
105
|
+
children: [/* @__PURE__ */ jsx(InputGroupAddon, {
|
|
106
|
+
align: currencyPosition === "prefix" ? "inline-start" : "inline-end",
|
|
107
|
+
children: /* @__PURE__ */ jsx(InputGroupText, { children: currency })
|
|
108
|
+
}), /* @__PURE__ */ jsx(InputGroupInput, {
|
|
109
|
+
...props,
|
|
110
|
+
...ids,
|
|
111
|
+
inputMode: "decimal",
|
|
112
|
+
type: "text",
|
|
113
|
+
value: value ?? internalValue,
|
|
114
|
+
onChange: (event) => {
|
|
115
|
+
const next = event.target.value;
|
|
116
|
+
if (!/^\d*(?:\.\d*)?$/.test(next)) return;
|
|
117
|
+
setInternalValue(next);
|
|
118
|
+
onValueChange?.(next);
|
|
119
|
+
}
|
|
120
|
+
})]
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function TextArea({ className, error, hint, id, label, ...props }) {
|
|
125
|
+
const field = {
|
|
126
|
+
className,
|
|
127
|
+
error,
|
|
128
|
+
hint,
|
|
129
|
+
id,
|
|
130
|
+
label
|
|
131
|
+
};
|
|
132
|
+
const ids = useFieldIds(field);
|
|
133
|
+
return /* @__PURE__ */ jsx(FieldFrame, {
|
|
134
|
+
...field,
|
|
135
|
+
id: ids.id,
|
|
136
|
+
disabled: props.disabled,
|
|
137
|
+
children: /* @__PURE__ */ jsx(Textarea, {
|
|
138
|
+
...props,
|
|
139
|
+
...ids
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function StandaloneSelectField({ className, defaultValue, disabled, error, hint, id, label, name, onValueChange, options, placeholder = "Choose an option", required, value }) {
|
|
144
|
+
const field = {
|
|
145
|
+
className,
|
|
146
|
+
error,
|
|
147
|
+
hint,
|
|
148
|
+
id,
|
|
149
|
+
label
|
|
150
|
+
};
|
|
151
|
+
const ids = useFieldIds(field);
|
|
152
|
+
return /* @__PURE__ */ jsx(FieldFrame, {
|
|
153
|
+
...field,
|
|
154
|
+
id: ids.id,
|
|
155
|
+
disabled,
|
|
156
|
+
children: /* @__PURE__ */ jsxs(Select, {
|
|
157
|
+
defaultValue,
|
|
158
|
+
disabled,
|
|
159
|
+
items: options,
|
|
160
|
+
name,
|
|
161
|
+
onValueChange,
|
|
162
|
+
required,
|
|
163
|
+
value,
|
|
164
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
165
|
+
...ids,
|
|
166
|
+
className: "w-full",
|
|
167
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder })
|
|
168
|
+
}), /* @__PURE__ */ jsx(SelectContent, {
|
|
169
|
+
alignItemWithTrigger: false,
|
|
170
|
+
children: options.map((option) => /* @__PURE__ */ jsx(SelectItem, {
|
|
171
|
+
disabled: option.disabled,
|
|
172
|
+
value: option.value,
|
|
173
|
+
children: option.label
|
|
174
|
+
}, option.value))
|
|
175
|
+
})]
|
|
176
|
+
})
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function StandaloneCheckboxField({ className, error, hint, id, label, ...props }) {
|
|
180
|
+
const field = {
|
|
181
|
+
className,
|
|
182
|
+
error,
|
|
183
|
+
hint,
|
|
184
|
+
id,
|
|
185
|
+
label
|
|
186
|
+
};
|
|
187
|
+
const ids = useFieldIds(field);
|
|
188
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
189
|
+
className: "soft-choice",
|
|
190
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
191
|
+
...props,
|
|
192
|
+
...ids
|
|
193
|
+
}), /* @__PURE__ */ jsx(FieldFrame, {
|
|
194
|
+
...field,
|
|
195
|
+
id: ids.id,
|
|
196
|
+
disabled: props.disabled,
|
|
197
|
+
children: null
|
|
198
|
+
})]
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function StandaloneSwitchField({ className, error, hint, id, label, ...props }) {
|
|
202
|
+
const field = {
|
|
203
|
+
className,
|
|
204
|
+
error,
|
|
205
|
+
hint,
|
|
206
|
+
id,
|
|
207
|
+
label
|
|
208
|
+
};
|
|
209
|
+
const ids = useFieldIds(field);
|
|
210
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
211
|
+
className: "soft-choice",
|
|
212
|
+
children: [/* @__PURE__ */ jsx(Switch, {
|
|
213
|
+
...props,
|
|
214
|
+
...ids
|
|
215
|
+
}), /* @__PURE__ */ jsx(FieldFrame, {
|
|
216
|
+
...field,
|
|
217
|
+
id: ids.id,
|
|
218
|
+
disabled: props.disabled,
|
|
219
|
+
children: null
|
|
220
|
+
})]
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/** Parse local calendar parts, never UTC or an ISO timestamp. Invalid input is empty. */
|
|
224
|
+
function parseDateOnly(value) {
|
|
225
|
+
if (!value || !/^\d{4}-\d{2}-\d{2}$/.test(value)) return void 0;
|
|
226
|
+
const [year, month, day] = value.split("-").map(Number);
|
|
227
|
+
if (year === void 0 || month === void 0 || day === void 0) return void 0;
|
|
228
|
+
const date = /* @__PURE__ */ new Date(0);
|
|
229
|
+
date.setFullYear(year, month - 1, day);
|
|
230
|
+
date.setHours(12, 0, 0, 0);
|
|
231
|
+
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? date : void 0;
|
|
232
|
+
}
|
|
233
|
+
function formatDateOnly(date) {
|
|
234
|
+
return `${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
235
|
+
}
|
|
236
|
+
function DatePicker({ className, defaultMonth, disabled, error, hint, id, label, locale = enUS, name, onValueChange, value }) {
|
|
237
|
+
const [open, setOpen] = useState(false);
|
|
238
|
+
const field = {
|
|
239
|
+
className,
|
|
240
|
+
error,
|
|
241
|
+
hint,
|
|
242
|
+
id,
|
|
243
|
+
label
|
|
244
|
+
};
|
|
245
|
+
const ids = useFieldIds(field);
|
|
246
|
+
const selected = parseDateOnly(value);
|
|
247
|
+
return /* @__PURE__ */ jsxs(FieldFrame, {
|
|
248
|
+
...field,
|
|
249
|
+
id: ids.id,
|
|
250
|
+
disabled,
|
|
251
|
+
children: [name && /* @__PURE__ */ jsx("input", {
|
|
252
|
+
disabled,
|
|
253
|
+
name,
|
|
254
|
+
type: "hidden",
|
|
255
|
+
value: value ?? ""
|
|
256
|
+
}), /* @__PURE__ */ jsxs(Popover, {
|
|
257
|
+
open,
|
|
258
|
+
onOpenChange: setOpen,
|
|
259
|
+
children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
260
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
261
|
+
...ids,
|
|
262
|
+
disabled,
|
|
263
|
+
variant: "secondary",
|
|
264
|
+
className: "justify-between"
|
|
265
|
+
}),
|
|
266
|
+
children: [selected ? selected.toLocaleDateString(locale.code, {
|
|
267
|
+
day: "numeric",
|
|
268
|
+
month: "short",
|
|
269
|
+
year: "numeric"
|
|
270
|
+
}) : "Choose a date", /* @__PURE__ */ jsx(CalendarIcon, { "aria-hidden": "true" })]
|
|
271
|
+
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
272
|
+
"aria-label": `${label} calendar`,
|
|
273
|
+
className: "w-auto p-0",
|
|
274
|
+
align: "start",
|
|
275
|
+
children: /* @__PURE__ */ jsx(Calendar, {
|
|
276
|
+
autoFocus: true,
|
|
277
|
+
defaultMonth: selected ?? defaultMonth,
|
|
278
|
+
locale,
|
|
279
|
+
mode: "single",
|
|
280
|
+
onSelect: (date) => {
|
|
281
|
+
if (date) {
|
|
282
|
+
onValueChange(formatDateOnly(date));
|
|
283
|
+
setOpen(false);
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
selected
|
|
287
|
+
})
|
|
288
|
+
})]
|
|
289
|
+
})]
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
293
|
+
export { DatePicker, MoneyField, NumberField, StandaloneCheckboxField, StandaloneSelectField, StandaloneSwitchField, StandaloneTextField, TextArea, formatDateOnly, parseDateOnly };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/compositions/form-kit/form-context.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The React contexts the Form kit's field and form components read. They are
|
|
4
|
+
* exported so an app can build its own `createFormHook` with extra field
|
|
5
|
+
* components next to the kit's: pass these two contexts, spread the kit's
|
|
6
|
+
* components, and add yours. `@tanstack/react-form` is a peer dependency, so
|
|
7
|
+
* the app and the kit share one copy and therefore one set of contexts.
|
|
8
|
+
*/
|
|
9
|
+
export declare const fieldContext: import("react").Context<import("@tanstack/react-form").AnyFieldApi>, formContext: import("react").Context<import("@tanstack/react-form").AnyFormApi>, useFieldContext: <TData>() => import("@tanstack/react-form").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, useFormContext: () => import("@tanstack/react-form").ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createFormHookContexts } from "@tanstack/react-form";
|
|
2
|
+
//#region src/compositions/form-kit/form-context.ts
|
|
3
|
+
/**
|
|
4
|
+
* The React contexts the Form kit's field and form components read. They are
|
|
5
|
+
* exported so an app can build its own `createFormHook` with extra field
|
|
6
|
+
* components next to the kit's: pass these two contexts, spread the kit's
|
|
7
|
+
* components, and add yours. `@tanstack/react-form` is a peer dependency, so
|
|
8
|
+
* the app and the kit share one copy and therefore one set of contexts.
|
|
9
|
+
*/
|
|
10
|
+
const { fieldContext, formContext, useFieldContext, useFormContext } = createFormHookContexts();
|
|
11
|
+
//#endregion
|
|
12
|
+
export { fieldContext, formContext, useFieldContext, useFormContext };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/compositions/form-kit/form-fields.d.ts
|
|
3
|
+
/** One validation message, in the shape shadcn's `FieldError` renders. */
|
|
4
|
+
export interface FormFieldErrorMessage {
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Normalizes TanStack Form's `field.state.meta.errors` into the messages
|
|
9
|
+
* shadcn's `FieldError` renders. Validators return strings (function
|
|
10
|
+
* validators) or Standard Schema issues such as Zod's (`{ message }`);
|
|
11
|
+
* anything without a non-empty message is dropped.
|
|
12
|
+
*/
|
|
13
|
+
export declare function toFieldErrors(errors: readonly unknown[]): FormFieldErrorMessage[];
|
|
14
|
+
/** Props the Form kit sets on a field's control element. */
|
|
15
|
+
export interface FormFieldControlProps {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
"aria-invalid": boolean;
|
|
19
|
+
"aria-describedby": string | undefined;
|
|
20
|
+
}
|
|
21
|
+
export interface UseFormFieldOptions {
|
|
22
|
+
/** Whether the field renders a description, so the control is described by it. */
|
|
23
|
+
hasDescription: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Binds the field in the surrounding `form.AppField` to shadcn's `field`
|
|
27
|
+
* markup: the control, description and error ids, the invalid state, and the
|
|
28
|
+
* control's ARIA wiring. The kit's field components use it; an app uses it to
|
|
29
|
+
* write a field component of its own with the same error association.
|
|
30
|
+
*
|
|
31
|
+
* A field is invalid once it is touched and has errors, as in shadcn's
|
|
32
|
+
* TanStack Form guide. Submitting touches every field.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useFormField<TValue>({ hasDescription }: UseFormFieldOptions): {
|
|
35
|
+
field: import("@tanstack/react-form").FieldApi<any, string, TValue, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
36
|
+
value: TValue;
|
|
37
|
+
isInvalid: boolean;
|
|
38
|
+
errors: FormFieldErrorMessage[];
|
|
39
|
+
controlId: string;
|
|
40
|
+
descriptionId: string;
|
|
41
|
+
errorId: string;
|
|
42
|
+
controlProps: FormFieldControlProps;
|
|
43
|
+
};
|
|
44
|
+
/** Props every Form kit field takes besides its control's own props. */
|
|
45
|
+
export interface FormFieldChromeProps {
|
|
46
|
+
/** The visible label, bound to the control. */
|
|
47
|
+
label: React.ReactNode;
|
|
48
|
+
/** Help text under the control; the control is described by it. */
|
|
49
|
+
description?: React.ReactNode;
|
|
50
|
+
/** Classes for the wrapping shadcn `Field` (layout, grid spans). */
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
53
|
+
/** Control props the kit owns and therefore does not accept from the app. */
|
|
54
|
+
type BoundControlProp = "id" | "name" | "value" | "defaultValue" | "onChange" | "onBlur" | "aria-invalid" | "aria-describedby" | "children" | "className";
|
|
55
|
+
export type TextFieldProps = FormFieldChromeProps & Omit<React.ComponentProps<"input">, BoundControlProp | "type"> & {
|
|
56
|
+
/** A text-like input type. Numbers, dates and files need their own fields. */
|
|
57
|
+
type?: "text" | "email" | "password" | "search" | "tel" | "url";
|
|
58
|
+
};
|
|
59
|
+
/** A string field rendered as a shadcn `Input`. Use inside `form.AppField`. */
|
|
60
|
+
export declare function TextField({ label, description, className, type, ...inputProps }: TextFieldProps): React.JSX.Element;
|
|
61
|
+
export type TextareaFieldProps = FormFieldChromeProps & Omit<React.ComponentProps<"textarea">, BoundControlProp>;
|
|
62
|
+
/** A string field rendered as a shadcn `Textarea`. Use inside `form.AppField`. */
|
|
63
|
+
export declare function TextareaField({ label, description, className, ...textareaProps }: TextareaFieldProps): React.JSX.Element;
|
|
64
|
+
/** One choice of a `SelectField`. */
|
|
65
|
+
export interface SelectFieldOption {
|
|
66
|
+
value: string;
|
|
67
|
+
label: React.ReactNode;
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface SelectFieldProps extends FormFieldChromeProps {
|
|
71
|
+
options: readonly SelectFieldOption[];
|
|
72
|
+
/** Shown while the value is the empty string (no choice yet). */
|
|
73
|
+
placeholder?: React.ReactNode;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A string field rendered as a shadcn `Select`. The empty string means "no
|
|
78
|
+
* choice", so a schema rejects it to make the field required. The field
|
|
79
|
+
* counts as blurred when its popup closes. Use inside `form.AppField`.
|
|
80
|
+
*/
|
|
81
|
+
export declare function SelectField({ label, description, className, options, placeholder, disabled }: SelectFieldProps): React.JSX.Element;
|
|
82
|
+
export interface ToggleFieldProps extends FormFieldChromeProps {
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A boolean field rendered as a shadcn `Checkbox`, with the label, description
|
|
87
|
+
* and error beside it. Use inside `form.AppField`.
|
|
88
|
+
*/
|
|
89
|
+
export declare function CheckboxField({ label, description, className, disabled }: ToggleFieldProps): React.JSX.Element;
|
|
90
|
+
/**
|
|
91
|
+
* A boolean field rendered as a shadcn `Switch`, with the label, description
|
|
92
|
+
* and error before it. Use inside `form.AppField`.
|
|
93
|
+
*/
|
|
94
|
+
export declare function SwitchField({ label, description, className, disabled }: ToggleFieldProps): React.JSX.Element;
|
|
95
|
+
//#endregion
|