veryfront 0.1.997 → 0.1.998
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/esm/cli/templates/manifest.js +1 -1
- package/esm/deno.d.ts +7 -0
- package/esm/deno.js +11 -3
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts +2 -0
- package/esm/deps/esm.sh/react-dom@19.2.4.d.ts.map +1 -0
- package/esm/deps/esm.sh/react-dom@19.2.4.js +3 -0
- package/esm/react/react-dom.d.ts +3 -0
- package/esm/react/react-dom.d.ts.map +1 -0
- package/esm/react/react-dom.js +2 -0
- package/esm/src/agent/ag-ui/host-support.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/host-support.js +12 -0
- package/esm/src/agent/react/index.d.ts +4 -2
- package/esm/src/agent/react/index.d.ts.map +1 -1
- package/esm/src/agent/react/index.js +2 -1
- package/esm/src/agent/react/use-agent-metadata.d.ts +5 -0
- package/esm/src/agent/react/use-agent-metadata.d.ts.map +1 -1
- package/esm/src/agent/react/use-agent-metadata.js +18 -9
- package/esm/src/agent/react/use-agents.d.ts +33 -0
- package/esm/src/agent/react/use-agents.d.ts.map +1 -0
- package/esm/src/agent/react/use-agents.js +72 -0
- package/esm/src/agent/react/use-chat/index.d.ts +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +3 -2
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts +12 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +47 -7
- package/esm/src/agent/react/use-chat/utils.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/utils.js +4 -0
- package/esm/src/agent/runtime/message-adapter.d.ts.map +1 -1
- package/esm/src/agent/runtime/message-adapter.js +3 -1
- package/esm/src/agent/runtime/text-generation-runtime-message-converter.d.ts.map +1 -1
- package/esm/src/agent/runtime/text-generation-runtime-message-converter.js +6 -2
- package/esm/src/chat/index.d.ts +17 -7
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +33 -7
- package/esm/src/chat/protocol.d.ts +13 -1
- package/esm/src/chat/protocol.d.ts.map +1 -1
- package/esm/src/chat/upload-handler.d.ts +55 -0
- package/esm/src/chat/upload-handler.d.ts.map +1 -0
- package/esm/src/chat/upload-handler.js +180 -0
- package/esm/src/discovery/import-rewriter.d.ts +1 -1
- package/esm/src/discovery/import-rewriter.d.ts.map +1 -1
- package/esm/src/discovery/import-rewriter.js +2 -0
- package/esm/src/discovery/transpiler.d.ts.map +1 -1
- package/esm/src/discovery/transpiler.js +2 -0
- package/esm/src/react/components/chat/agent-card.d.ts +84 -11
- package/esm/src/react/components/chat/agent-card.d.ts.map +1 -1
- package/esm/src/react/components/chat/agent-card.js +151 -57
- package/esm/src/react/components/chat/agent-picker.d.ts +166 -0
- package/esm/src/react/components/chat/agent-picker.d.ts.map +1 -0
- package/esm/src/react/components/chat/agent-picker.js +183 -0
- package/esm/src/react/components/chat/chat/components/animations.js +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts +125 -3
- package/esm/src/react/components/chat/chat/components/attachment-pill.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/attachment-pill.js +209 -25
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +149 -0
- package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/attachments-panel.js +187 -0
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts +13 -2
- package/esm/src/react/components/chat/chat/components/branch-picker.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/branch-picker.js +6 -8
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts +20 -0
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/chat-messages-skeleton.js +31 -0
- package/esm/src/react/components/chat/chat/components/code-block.d.ts +9 -1
- package/esm/src/react/components/chat/chat/components/code-block.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/code-block.js +14 -6
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts +11 -4
- package/esm/src/react/components/chat/chat/components/drop-zone.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/drop-zone.js +10 -8
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts +2 -1
- package/esm/src/react/components/chat/chat/components/empty-state.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/empty-state.js +7 -8
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +6 -2
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.js +5 -4
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts +9 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inline-citation.js +19 -20
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts +28 -5
- package/esm/src/react/components/chat/chat/components/message-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-actions.js +24 -36
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts +7 -2
- package/esm/src/react/components/chat/chat/components/message-edit-form.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-edit-form.js +5 -5
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts +11 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/message-feedback.js +9 -11
- package/esm/src/react/components/chat/chat/components/quick-actions.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/quick-actions.js +3 -1
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts +66 -3
- package/esm/src/react/components/chat/chat/components/reasoning.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/reasoning.js +95 -21
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts +178 -12
- package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sidebar.js +228 -45
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts +6 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/skill-badge.js +6 -5
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts +37 -0
- package/esm/src/react/components/chat/chat/components/skill-tool.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/components/skill-tool.js +46 -0
- package/esm/src/react/components/chat/chat/components/sources.d.ts +55 -3
- package/esm/src/react/components/chat/chat/components/sources.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/sources.js +50 -16
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts +42 -3
- package/esm/src/react/components/chat/chat/components/step-indicator.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/step-indicator.js +55 -12
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tab-switcher.js +3 -3
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts +96 -3
- package/esm/src/react/components/chat/chat/components/tool-ui.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/tool-ui.js +158 -36
- package/esm/src/react/components/chat/chat/composition/api.d.ts +4 -2
- package/esm/src/react/components/chat/chat/composition/api.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/api.js +4 -2
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +112 -5
- package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-composer.js +251 -61
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts +78 -0
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/composition/chat-empty-state.js +63 -0
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts +4 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-empty.js +11 -10
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +11 -3
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.js +81 -111
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +4 -0
- package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-root.js +3 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts +4 -0
- package/esm/src/react/components/chat/chat/composition/error-banner.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/error-banner.js +10 -7
- package/esm/src/react/components/chat/chat/composition/message.d.ts +123 -5
- package/esm/src/react/components/chat/chat/composition/message.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/message.js +332 -53
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts +6 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/model-avatar.js +3 -4
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts +31 -0
- package/esm/src/react/components/chat/chat/composition/pending-message.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/composition/pending-message.js +31 -0
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +4 -0
- package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts +1 -0
- package/esm/src/react/components/chat/chat/contexts/composer-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +29 -0
- package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/contexts/conversations-context.js +39 -0
- package/esm/src/react/components/chat/chat/contexts/index.d.ts +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/contexts/index.js +1 -1
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts +2 -0
- package/esm/src/react/components/chat/chat/contexts/message-context.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts +10 -0
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-clipboard.js +34 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts +21 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversation.js +54 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts +67 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversations.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-conversations.js +317 -0
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts +27 -0
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-drop-zone.js +50 -0
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts +49 -0
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-stick-to-bottom.js +120 -0
- package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts +34 -0
- package/esm/src/react/components/chat/chat/hooks/use-upload.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-upload.js +147 -0
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts +37 -0
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/hooks/use-uploads-registry.js +178 -0
- package/esm/src/react/components/chat/chat/index.d.ts +171 -31
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/index.js +371 -77
- package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts +63 -0
- package/esm/src/react/components/chat/chat/persistence/conversation-store.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/persistence/conversation-store.js +1 -0
- package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts +13 -0
- package/esm/src/react/components/chat/chat/persistence/local-conversation-store.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/persistence/local-conversation-store.js +102 -0
- package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts +11 -0
- package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat/persistence/memory-conversation-store.js +33 -0
- package/esm/src/react/components/chat/chat/utils/message-parts.d.ts +4 -1
- package/esm/src/react/components/chat/chat/utils/message-parts.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/utils/message-parts.js +4 -0
- package/esm/src/react/components/chat/chat-actions.d.ts +164 -0
- package/esm/src/react/components/chat/chat-actions.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-actions.js +191 -0
- package/esm/src/react/components/chat/chat-agent-picker.d.ts +50 -0
- package/esm/src/react/components/chat/chat-agent-picker.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-agent-picker.js +40 -0
- package/esm/src/react/components/chat/chat-theme-scope.d.ts +26 -0
- package/esm/src/react/components/chat/chat-theme-scope.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-theme-scope.js +27 -0
- package/esm/src/react/components/chat/chat-tokens-style.d.ts +21 -0
- package/esm/src/react/components/chat/chat-tokens-style.d.ts.map +1 -0
- package/esm/src/react/components/chat/chat-tokens-style.js +24 -0
- package/esm/src/react/components/chat/chat.d.ts +5 -5
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.js +5 -5
- package/esm/src/react/components/chat/color-mode.d.ts +46 -0
- package/esm/src/react/components/chat/color-mode.d.ts.map +1 -0
- package/esm/src/react/components/chat/color-mode.js +123 -0
- package/esm/src/react/components/chat/error-boundary.js +2 -2
- package/esm/src/react/components/chat/icons/index.d.ts +8 -0
- package/esm/src/react/components/chat/icons/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/icons/index.js +64 -0
- package/esm/src/react/components/chat/markdown.d.ts +24 -1
- package/esm/src/react/components/chat/markdown.d.ts.map +1 -1
- package/esm/src/react/components/chat/markdown.js +122 -38
- package/esm/src/react/components/chat/model-selector.d.ts +130 -8
- package/esm/src/react/components/chat/model-selector.d.ts.map +1 -1
- package/esm/src/react/components/chat/model-selector.js +148 -121
- package/esm/src/react/components/chat/theme.d.ts +9 -12
- package/esm/src/react/components/chat/theme.d.ts.map +1 -1
- package/esm/src/react/components/chat/theme.js +149 -93
- package/esm/src/react/components/chat/ui/alert.d.ts +30 -0
- package/esm/src/react/components/chat/ui/alert.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/alert.js +35 -0
- package/esm/src/react/components/chat/ui/app-shell.d.ts +155 -0
- package/esm/src/react/components/chat/ui/app-shell.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/app-shell.js +276 -0
- package/esm/src/react/components/chat/ui/avatar.d.ts +24 -0
- package/esm/src/react/components/chat/ui/avatar.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/avatar.js +44 -0
- package/esm/src/react/components/chat/ui/badge.d.ts +24 -0
- package/esm/src/react/components/chat/ui/badge.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/badge.js +30 -0
- package/esm/src/react/components/chat/ui/button.d.ts +44 -0
- package/esm/src/react/components/chat/ui/button.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/button.js +108 -0
- package/esm/src/react/components/chat/ui/card.d.ts +42 -0
- package/esm/src/react/components/chat/ui/card.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/card.js +55 -0
- package/esm/src/react/components/chat/ui/checkbox.d.ts +28 -0
- package/esm/src/react/components/chat/ui/checkbox.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/checkbox.js +36 -0
- package/esm/src/react/components/chat/ui/code-block.d.ts +89 -0
- package/esm/src/react/components/chat/ui/code-block.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/code-block.js +277 -0
- package/esm/src/react/components/chat/ui/collapsible.d.ts +30 -0
- package/esm/src/react/components/chat/ui/collapsible.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/collapsible.js +44 -0
- package/esm/src/react/components/chat/ui/command.d.ts +65 -0
- package/esm/src/react/components/chat/ui/command.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/command.js +121 -0
- package/esm/src/react/components/chat/ui/cva.d.ts +36 -0
- package/esm/src/react/components/chat/ui/cva.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/cva.js +45 -0
- package/esm/src/react/components/chat/ui/dialog.d.ts +55 -0
- package/esm/src/react/components/chat/ui/dialog.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/dialog.js +116 -0
- package/esm/src/react/components/chat/ui/drawer.d.ts +41 -0
- package/esm/src/react/components/chat/ui/drawer.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/drawer.js +92 -0
- package/esm/src/react/components/chat/ui/dropdown-menu.d.ts +63 -0
- package/esm/src/react/components/chat/ui/dropdown-menu.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/dropdown-menu.js +76 -0
- package/esm/src/react/components/chat/ui/file-type.d.ts +26 -0
- package/esm/src/react/components/chat/ui/file-type.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/file-type.js +235 -0
- package/esm/src/react/components/chat/ui/floating.d.ts +29 -0
- package/esm/src/react/components/chat/ui/floating.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/floating.js +90 -0
- package/esm/src/react/components/chat/ui/icon-button.d.ts +19 -0
- package/esm/src/react/components/chat/ui/icon-button.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/icon-button.js +20 -0
- package/esm/src/react/components/chat/ui/index.d.ts +43 -0
- package/esm/src/react/components/chat/ui/index.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/index.js +42 -0
- package/esm/src/react/components/chat/ui/input.d.ts +27 -0
- package/esm/src/react/components/chat/ui/input.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/input.js +41 -0
- package/esm/src/react/components/chat/ui/label.d.ts +29 -0
- package/esm/src/react/components/chat/ui/label.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/label.js +40 -0
- package/esm/src/react/components/chat/ui/list.d.ts +47 -0
- package/esm/src/react/components/chat/ui/list.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/list.js +40 -0
- package/esm/src/react/components/chat/ui/pill.d.ts +26 -0
- package/esm/src/react/components/chat/ui/pill.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/pill.js +39 -0
- package/esm/src/react/components/chat/ui/popover.d.ts +47 -0
- package/esm/src/react/components/chat/ui/popover.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/popover.js +68 -0
- package/esm/src/react/components/chat/ui/progress-bar.d.ts +20 -0
- package/esm/src/react/components/chat/ui/progress-bar.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/progress-bar.js +31 -0
- package/esm/src/react/components/chat/ui/radio.d.ts +25 -0
- package/esm/src/react/components/chat/ui/radio.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/radio.js +29 -0
- package/esm/src/react/components/chat/ui/scroll-fade.d.ts +23 -0
- package/esm/src/react/components/chat/ui/scroll-fade.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/scroll-fade.js +40 -0
- package/esm/src/react/components/chat/ui/select.d.ts +64 -0
- package/esm/src/react/components/chat/ui/select.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/select.js +148 -0
- package/esm/src/react/components/chat/ui/shimmer.d.ts +25 -0
- package/esm/src/react/components/chat/ui/shimmer.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/shimmer.js +24 -0
- package/esm/src/react/components/chat/ui/skeleton.d.ts +14 -0
- package/esm/src/react/components/chat/ui/skeleton.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/skeleton.js +12 -0
- package/esm/src/react/components/chat/ui/slot.d.ts +21 -0
- package/esm/src/react/components/chat/ui/slot.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/slot.js +70 -0
- package/esm/src/react/components/chat/ui/status.d.ts +28 -0
- package/esm/src/react/components/chat/ui/status.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/status.js +23 -0
- package/esm/src/react/components/chat/ui/switch.d.ts +34 -0
- package/esm/src/react/components/chat/ui/switch.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/switch.js +58 -0
- package/esm/src/react/components/chat/ui/tabs.d.ts +44 -0
- package/esm/src/react/components/chat/ui/tabs.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/tabs.js +51 -0
- package/esm/src/react/components/chat/ui/tag.d.ts +22 -0
- package/esm/src/react/components/chat/ui/tag.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/tag.js +27 -0
- package/esm/src/react/components/chat/ui/textarea.d.ts +22 -0
- package/esm/src/react/components/chat/ui/textarea.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/textarea.js +35 -0
- package/esm/src/react/components/chat/ui/tooltip.d.ts +40 -0
- package/esm/src/react/components/chat/ui/tooltip.d.ts.map +1 -0
- package/esm/src/react/components/chat/ui/tooltip.js +132 -0
- package/esm/src/react/primitives/input-box.d.ts.map +1 -1
- package/esm/src/react/primitives/input-box.js +17 -4
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +9437 -1064
- package/esm/src/server/handlers/dev/projects/html-shell.d.ts +1 -1
- package/esm/src/server/handlers/dev/projects/html-shell.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/projects/html-shell.js +1 -12
- package/esm/src/server/handlers/request/public-agents-list.handler.d.ts +18 -0
- package/esm/src/server/handlers/request/public-agents-list.handler.d.ts.map +1 -0
- package/esm/src/server/handlers/request/public-agents-list.handler.js +44 -0
- package/esm/src/server/runtime-handler/index.d.ts +1 -1
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +3 -0
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.d.ts.map +1 -1
- package/esm/src/studio/bridge/bridge-bundle.generated.js +3 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/blob/local-storage.d.ts +32 -0
- package/esm/src/workflow/blob/local-storage.d.ts.map +1 -0
- package/esm/src/workflow/blob/local-storage.js +179 -0
- package/esm/src/workflow/blob/types.d.ts +5 -0
- package/esm/src/workflow/blob/types.d.ts.map +1 -1
- package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts +11 -0
- package/esm/src/workflow/blob/veryfront-cloud-storage.d.ts.map +1 -1
- package/esm/src/workflow/blob/veryfront-cloud-storage.js +36 -0
- package/package.json +5 -1
- package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts +0 -20
- package/esm/src/react/components/chat/chat/components/uploads-panel.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/components/uploads-panel.js +0 -49
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts +0 -28
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/contexts/thread-list-context.js +0 -27
- package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts +0 -28
- package/esm/src/react/components/chat/chat/hooks/use-threads.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/hooks/use-threads.js +0 -151
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts +0 -110
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat-with-sidebar.js +0 -167
- package/esm/src/react/components/chat/message.d.ts +0 -42
- package/esm/src/react/components/chat/message.d.ts.map +0 -1
- package/esm/src/react/components/chat/message.js +0 -69
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select — BASIC fork of @radix-ui/react-select with the same API shape (Root /
|
|
3
|
+
* Trigger / Value / Content / Item / Label / Separator / Group). Classes ported
|
|
4
|
+
* 1:1 from Studio's `Select` (tokens remapped). A single-select listbox that
|
|
5
|
+
* opens below the trigger and dismisses on outside-click / `Escape`.
|
|
6
|
+
*
|
|
7
|
+
* TODO(a11y): roving focus + arrow/typeahead keyboard nav, `aria-activedescendant`,
|
|
8
|
+
* portal + collision-aware positioning, scroll-into-view. The selected option's
|
|
9
|
+
* label is tracked once its Content has rendered at least once (basic). Private
|
|
10
|
+
* to the chat module.
|
|
11
|
+
*
|
|
12
|
+
* @module react/components/chat/ui/select
|
|
13
|
+
*/
|
|
14
|
+
import * as React from "../../../../../react/react.js";
|
|
15
|
+
import { type VariantProps } from "./cva.js";
|
|
16
|
+
declare const selectTriggerVariants: (props?: ({
|
|
17
|
+
size?: "md" | "lg" | "sm" | "xs" | null | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
class?: import("../../../../utils/clsx.js").ClassValue;
|
|
20
|
+
className?: import("../../../../utils/clsx.js").ClassValue;
|
|
21
|
+
}) | undefined) => string;
|
|
22
|
+
/** Props accepted by `<Select>`. */
|
|
23
|
+
export interface SelectProps {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
value?: string;
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
onValueChange?: (value: string) => void;
|
|
28
|
+
open?: boolean;
|
|
29
|
+
defaultOpen?: boolean;
|
|
30
|
+
onOpenChange?: (open: boolean) => void;
|
|
31
|
+
}
|
|
32
|
+
/** Select root — owns the selected value, open state, and label registry. */
|
|
33
|
+
export declare function Select({ children, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, }: SelectProps): React.ReactElement;
|
|
34
|
+
/** Props accepted by `<SelectTrigger>`. */
|
|
35
|
+
export interface SelectTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof selectTriggerVariants> {
|
|
36
|
+
}
|
|
37
|
+
/** Trigger — shows the current value and toggles the listbox. */
|
|
38
|
+
export declare function SelectTrigger({ className, children, size, onClick, ...props }: SelectTriggerProps): React.ReactElement;
|
|
39
|
+
/** Displays the selected option's label, or a placeholder. */
|
|
40
|
+
export declare function SelectValue({ placeholder }: {
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
}): React.ReactElement;
|
|
43
|
+
/** Listbox surface — rendered below the trigger while open. */
|
|
44
|
+
export declare function SelectContent({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement | null;
|
|
45
|
+
/** Props accepted by `<SelectItem>`. */
|
|
46
|
+
export interface SelectItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onSelect"> {
|
|
47
|
+
value: string;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/** A selectable option. Shows a check when it is the current value. */
|
|
51
|
+
export declare function SelectItem({ className, children, value, disabled, onClick, ...props }: SelectItemProps): React.ReactElement;
|
|
52
|
+
/** Non-interactive section label. */
|
|
53
|
+
export declare function SelectLabel({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.ReactElement;
|
|
54
|
+
/** Divider between option groups. */
|
|
55
|
+
export declare function SelectSeparator({ className }: {
|
|
56
|
+
className?: string;
|
|
57
|
+
}): React.ReactElement;
|
|
58
|
+
/** Groups related options (semantic only in this basic version). */
|
|
59
|
+
export declare function SelectGroup({ children, className }: {
|
|
60
|
+
children: React.ReactNode;
|
|
61
|
+
className?: string;
|
|
62
|
+
}): React.ReactElement;
|
|
63
|
+
export { selectTriggerVariants };
|
|
64
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/select.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAEvD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAIlD,QAAA,MAAM,qBAAqB;;;;;yBAoB1B,CAAC;AAmBF,oCAAoC;AACpC,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,6EAA6E;AAC7E,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,aAAa,EACb,IAAI,EACJ,WAAW,EACX,YAAY,GACb,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,CA4ClC;AAmBD,2CAA2C;AAC3C,MAAM,WAAW,kBACf,SACE,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,YAAY,CAAC,OAAO,qBAAqB,CAAC;CAAG;AAEjD,iEAAiE;AACjE,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,GAAG,KAAK,EACT,EAAE,kBAAkB,GAAG,KAAK,CAAC,YAAY,CAmBzC;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CACzB,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC,KAAK,CAAC,YAAY,CAQpB;AAED,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAoBlE;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC7F,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,OAAO,EACP,GAAG,KAAK,EACT,EAAE,eAAe,GAAG,KAAK,CAAC,YAAY,CA6BtC;AAED,qCAAqC;AACrC,wBAAgB,WAAW,CACzB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAC5D,KAAK,CAAC,YAAY,CAUpB;AAED,qCAAqC;AACrC,wBAAgB,eAAe,CAC7B,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACpC,KAAK,CAAC,YAAY,CAEpB;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CACzB,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GACzE,KAAK,CAAC,YAAY,CAEpB;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Select — BASIC fork of @radix-ui/react-select with the same API shape (Root /
|
|
3
|
+
* Trigger / Value / Content / Item / Label / Separator / Group). Classes ported
|
|
4
|
+
* 1:1 from Studio's `Select` (tokens remapped). A single-select listbox that
|
|
5
|
+
* opens below the trigger and dismisses on outside-click / `Escape`.
|
|
6
|
+
*
|
|
7
|
+
* TODO(a11y): roving focus + arrow/typeahead keyboard nav, `aria-activedescendant`,
|
|
8
|
+
* portal + collision-aware positioning, scroll-into-view. The selected option's
|
|
9
|
+
* label is tracked once its Content has rendered at least once (basic). Private
|
|
10
|
+
* to the chat module.
|
|
11
|
+
*
|
|
12
|
+
* @module react/components/chat/ui/select
|
|
13
|
+
*/
|
|
14
|
+
import * as React from "../../../../../react/react.js";
|
|
15
|
+
import { cn } from "../theme.js";
|
|
16
|
+
import { cva } from "./cva.js";
|
|
17
|
+
import { CheckIcon, ChevronDownIcon } from "../icons/index.js";
|
|
18
|
+
import { Floating } from "./floating.js";
|
|
19
|
+
const selectTriggerVariants = cva([
|
|
20
|
+
"flex w-full items-center justify-between text-[var(--foreground)]",
|
|
21
|
+
"transition-[background-color,box-shadow,border-color] duration-150 ease-in",
|
|
22
|
+
"focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
23
|
+
"[&>span]:line-clamp-1",
|
|
24
|
+
"bg-[var(--input-bg)] border border-[var(--background)] dark:border-transparent",
|
|
25
|
+
"data-[invalid=true]:border-[var(--status-error)]",
|
|
26
|
+
], {
|
|
27
|
+
variants: {
|
|
28
|
+
size: {
|
|
29
|
+
xs: "h-[32px] px-2.5 text-sm rounded-md",
|
|
30
|
+
sm: "h-[38px] px-3 text-base rounded-md",
|
|
31
|
+
md: "h-[42px] px-3 text-base rounded-md",
|
|
32
|
+
lg: "h-[50px] px-4 text-base rounded-md",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: { size: "lg" },
|
|
36
|
+
});
|
|
37
|
+
const SelectContext = React.createContext(null);
|
|
38
|
+
function useSelect() {
|
|
39
|
+
const ctx = React.useContext(SelectContext);
|
|
40
|
+
if (!ctx)
|
|
41
|
+
throw new Error("Select components must be used within <Select>");
|
|
42
|
+
return ctx;
|
|
43
|
+
}
|
|
44
|
+
/** Select root — owns the selected value, open state, and label registry. */
|
|
45
|
+
export function Select({ children, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, }) {
|
|
46
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue);
|
|
47
|
+
const [internalOpen, setInternalOpen] = React.useState(defaultOpen ?? false);
|
|
48
|
+
const anchorRef = React.useRef(null);
|
|
49
|
+
const isValueControlled = value !== undefined;
|
|
50
|
+
const isOpenControlled = open !== undefined;
|
|
51
|
+
const currentValue = isValueControlled ? value : internalValue;
|
|
52
|
+
const isOpen = isOpenControlled ? open : internalOpen;
|
|
53
|
+
const setValue = React.useCallback((next) => {
|
|
54
|
+
if (!isValueControlled)
|
|
55
|
+
setInternalValue(next);
|
|
56
|
+
onValueChange?.(next);
|
|
57
|
+
}, [isValueControlled, onValueChange]);
|
|
58
|
+
const setOpen = React.useCallback((next) => {
|
|
59
|
+
if (!isOpenControlled)
|
|
60
|
+
setInternalOpen(next);
|
|
61
|
+
onOpenChange?.(next);
|
|
62
|
+
}, [isOpenControlled, onOpenChange]);
|
|
63
|
+
// Collect value→label synchronously from the item children so the trigger
|
|
64
|
+
// shows the selected LABEL immediately — no flip from raw value on first open.
|
|
65
|
+
const labels = React.useMemo(() => {
|
|
66
|
+
const map = new Map();
|
|
67
|
+
collectSelectLabels(children, map);
|
|
68
|
+
return map;
|
|
69
|
+
}, [children]);
|
|
70
|
+
return (React.createElement("span", { ref: anchorRef, className: "relative inline-block w-full" },
|
|
71
|
+
React.createElement(SelectContext.Provider, { value: {
|
|
72
|
+
value: currentValue,
|
|
73
|
+
setValue,
|
|
74
|
+
open: isOpen,
|
|
75
|
+
setOpen,
|
|
76
|
+
labels,
|
|
77
|
+
anchorRef,
|
|
78
|
+
} }, children)));
|
|
79
|
+
}
|
|
80
|
+
/** Walk children for `SelectItem` elements, mapping `value` → label node. */
|
|
81
|
+
function collectSelectLabels(node, map) {
|
|
82
|
+
React.Children.forEach(node, (child) => {
|
|
83
|
+
if (!React.isValidElement(child))
|
|
84
|
+
return;
|
|
85
|
+
if (child.type === SelectItem) {
|
|
86
|
+
const p = child.props;
|
|
87
|
+
if (p.value !== undefined)
|
|
88
|
+
map.set(p.value, p.children);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const p = child.props;
|
|
92
|
+
if (p?.children)
|
|
93
|
+
collectSelectLabels(p.children, map);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/** Trigger — shows the current value and toggles the listbox. */
|
|
98
|
+
export function SelectTrigger({ className, children, size, onClick, ...props }) {
|
|
99
|
+
const ctx = useSelect();
|
|
100
|
+
return (React.createElement("button", { type: "button", role: "combobox", "aria-haspopup": "listbox", "aria-expanded": ctx.open, className: cn(selectTriggerVariants({ size }), className), onClick: (e) => {
|
|
101
|
+
onClick?.(e);
|
|
102
|
+
ctx.setOpen(!ctx.open);
|
|
103
|
+
}, ...props },
|
|
104
|
+
children,
|
|
105
|
+
React.createElement(ChevronDownIcon, { className: "size-3.5 opacity-50" })));
|
|
106
|
+
}
|
|
107
|
+
/** Displays the selected option's label, or a placeholder. */
|
|
108
|
+
export function SelectValue({ placeholder }) {
|
|
109
|
+
const ctx = useSelect();
|
|
110
|
+
const label = ctx.value !== undefined ? ctx.labels.get(ctx.value) ?? ctx.value : undefined;
|
|
111
|
+
return (React.createElement("span", { className: cn(label === undefined && "opacity-25") }, label ?? placeholder));
|
|
112
|
+
}
|
|
113
|
+
/** Listbox surface — rendered below the trigger while open. */
|
|
114
|
+
export function SelectContent({ className, children, ...props }) {
|
|
115
|
+
const ctx = useSelect();
|
|
116
|
+
return (React.createElement(Floating, { anchorRef: ctx.anchorRef, open: ctx.open, align: "start", matchTriggerWidth: true, onDismiss: () => ctx.setOpen(false), role: "listbox", className: cn("z-50 max-h-96 overflow-x-hidden overflow-y-auto rounded-lg bg-[var(--secondary)] text-[var(--foreground)] shadow-sm", "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden", className), ...props },
|
|
117
|
+
React.createElement("div", { className: "p-2.5" }, children)));
|
|
118
|
+
}
|
|
119
|
+
/** A selectable option. Shows a check when it is the current value. */
|
|
120
|
+
export function SelectItem({ className, children, value, disabled, onClick, ...props }) {
|
|
121
|
+
const ctx = useSelect();
|
|
122
|
+
const selected = ctx.value === value;
|
|
123
|
+
return (React.createElement("div", { role: "option", "aria-selected": selected, "aria-disabled": disabled || undefined, className: cn("relative flex w-full cursor-pointer select-none items-center rounded-md h-[38px] px-3 text-base outline-none transition-colors", "hover:bg-[var(--tertiary)] focus:bg-[var(--tertiary)]", "aria-disabled:pointer-events-none aria-disabled:opacity-50", className), ...props,
|
|
124
|
+
// Compose the caller's onClick with selection (caller runs first) so a
|
|
125
|
+
// consumer-supplied handler adds to — never overrides — selection.
|
|
126
|
+
onClick: (e) => {
|
|
127
|
+
if (disabled)
|
|
128
|
+
return;
|
|
129
|
+
onClick?.(e);
|
|
130
|
+
ctx.setValue(value);
|
|
131
|
+
ctx.setOpen(false);
|
|
132
|
+
} },
|
|
133
|
+
React.createElement("span", { className: "line-clamp-1" }, children),
|
|
134
|
+
selected && React.createElement(CheckIcon, { className: "ml-auto pl-2 size-3 shrink-0 box-content" })));
|
|
135
|
+
}
|
|
136
|
+
/** Non-interactive section label. */
|
|
137
|
+
export function SelectLabel({ className, ...props }) {
|
|
138
|
+
return (React.createElement("div", { className: cn("px-3 py-1.5 text-sm font-medium text-[var(--foreground)]", className), ...props }));
|
|
139
|
+
}
|
|
140
|
+
/** Divider between option groups. */
|
|
141
|
+
export function SelectSeparator({ className }) {
|
|
142
|
+
return React.createElement("div", { className: cn("-mx-2.5 my-1.5 h-px bg-[var(--tertiary)]", className) });
|
|
143
|
+
}
|
|
144
|
+
/** Groups related options (semantic only in this basic version). */
|
|
145
|
+
export function SelectGroup({ children, className }) {
|
|
146
|
+
return React.createElement("div", { role: "group", className: className }, children);
|
|
147
|
+
}
|
|
148
|
+
export { selectTriggerVariants };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shimmer — ported 1:1 from Veryfront Studio. Animates a light band across text
|
|
3
|
+
* via `bg-clip-text`, for streaming / loading states. Tokens remapped to
|
|
4
|
+
* veryfront's `[var(--token)]` vocabulary (`--background`, `--soft` both exist);
|
|
5
|
+
* Studio's app-only `can-hover:`/`touch:` variants are dropped in favour of the
|
|
6
|
+
* standard `motion-safe`/`motion-reduce` pair. The `shimmer-sweep` keyframes
|
|
7
|
+
* ship via chat `theme.ts`. Private to the chat module.
|
|
8
|
+
*
|
|
9
|
+
* @module react/components/chat/ui/shimmer
|
|
10
|
+
*/
|
|
11
|
+
import * as React from "../../../../../react/react.js";
|
|
12
|
+
/** Props accepted by `<Shimmer>`. */
|
|
13
|
+
export interface ShimmerProps {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/** Element to render as. @default "span" */
|
|
16
|
+
as?: React.ElementType;
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Sweep duration in seconds. @default 2 */
|
|
19
|
+
duration?: number;
|
|
20
|
+
/** Band spread multiplier (× content length). @default 2 */
|
|
21
|
+
spread?: number;
|
|
22
|
+
}
|
|
23
|
+
/** Render shimmering text. */
|
|
24
|
+
export declare function Shimmer({ children, as: Component, className, duration, spread, }: ShimmerProps): React.ReactElement;
|
|
25
|
+
//# sourceMappingURL=shimmer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shimmer.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/shimmer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAGvD,qCAAqC;AACrC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4CAA4C;IAC5C,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,8BAA8B;AAC9B,wBAAgB,OAAO,CAAC,EACtB,QAAQ,EACR,EAAE,EAAE,SAAkB,EACtB,SAAS,EACT,QAAY,EACZ,MAAU,GACX,EAAE,YAAY,GAAG,KAAK,CAAC,YAAY,CAuBnC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shimmer — ported 1:1 from Veryfront Studio. Animates a light band across text
|
|
3
|
+
* via `bg-clip-text`, for streaming / loading states. Tokens remapped to
|
|
4
|
+
* veryfront's `[var(--token)]` vocabulary (`--background`, `--soft` both exist);
|
|
5
|
+
* Studio's app-only `can-hover:`/`touch:` variants are dropped in favour of the
|
|
6
|
+
* standard `motion-safe`/`motion-reduce` pair. The `shimmer-sweep` keyframes
|
|
7
|
+
* ship via chat `theme.ts`. Private to the chat module.
|
|
8
|
+
*
|
|
9
|
+
* @module react/components/chat/ui/shimmer
|
|
10
|
+
*/
|
|
11
|
+
import * as React from "../../../../../react/react.js";
|
|
12
|
+
import { cn } from "../theme.js";
|
|
13
|
+
/** Render shimmering text. */
|
|
14
|
+
export function Shimmer({ children, as: Component = "span", className, duration = 2, spread = 2, }) {
|
|
15
|
+
const dynamicSpread = React.useMemo(() => {
|
|
16
|
+
const length = typeof children === "string" ? children.length : 20;
|
|
17
|
+
return length * spread;
|
|
18
|
+
}, [children, spread]);
|
|
19
|
+
return (React.createElement(Component, { className: cn("relative inline-block min-w-0 bg-[length:250%_100%,auto] bg-clip-text text-transparent [background-position:100%_center]", "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]", "motion-safe:animate-[shimmer-sweep_linear_infinite] motion-reduce:bg-none motion-reduce:text-current", className), style: {
|
|
20
|
+
"--spread": `${dynamicSpread}px`,
|
|
21
|
+
animationDuration: `${duration}s`,
|
|
22
|
+
backgroundImage: "var(--bg), linear-gradient(var(--soft), var(--soft))",
|
|
23
|
+
} }, children));
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton — ported 1:1 from Veryfront Studio. Animated placeholder bar; size
|
|
3
|
+
* it with `w-*` / `h-*` utilities. Private to the chat module.
|
|
4
|
+
*
|
|
5
|
+
* @module react/components/chat/ui/skeleton
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "../../../../../react/react.js";
|
|
8
|
+
/** Props accepted by `<Skeleton>`. */
|
|
9
|
+
export interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
11
|
+
}
|
|
12
|
+
/** Render an animated placeholder bar. */
|
|
13
|
+
export declare function Skeleton({ className, ref, ...props }: SkeletonProps): React.ReactElement;
|
|
14
|
+
//# sourceMappingURL=skeleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/skeleton.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAGvD,sCAAsC;AACtC,MAAM,WAAW,aAAc,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACzE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED,0CAA0C;AAC1C,wBAAgB,QAAQ,CACtB,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAC1C,KAAK,CAAC,YAAY,CAWpB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton — ported 1:1 from Veryfront Studio. Animated placeholder bar; size
|
|
3
|
+
* it with `w-*` / `h-*` utilities. Private to the chat module.
|
|
4
|
+
*
|
|
5
|
+
* @module react/components/chat/ui/skeleton
|
|
6
|
+
*/
|
|
7
|
+
import * as React from "../../../../../react/react.js";
|
|
8
|
+
import { cn } from "../theme.js";
|
|
9
|
+
/** Render an animated placeholder bar. */
|
|
10
|
+
export function Skeleton({ className, ref, ...props }) {
|
|
11
|
+
return (React.createElement("div", { ref: ref, className: cn("h-4 w-full animate-pulse rounded-md bg-[var(--accent)]", className), ...props }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Slot` — forked from @radix-ui/react-slot (MIT, © WorkOS), inlined so
|
|
3
|
+
* `veryfront/chat` takes no external Radix dependency. Merges its props onto a
|
|
4
|
+
* single child element (the `asChild` pattern): className is concatenated,
|
|
5
|
+
* style is shallow-merged, event handlers are chained (child first), and refs
|
|
6
|
+
* are composed.
|
|
7
|
+
*
|
|
8
|
+
* Scoped to the single-child case the chat primitives use — Radix's
|
|
9
|
+
* `Slottable`/lazy-children handling is intentionally omitted. Private to the
|
|
10
|
+
* chat module.
|
|
11
|
+
*
|
|
12
|
+
* @module react/components/chat/ui/slot
|
|
13
|
+
*/
|
|
14
|
+
import * as React from "../../../../../react/react.js";
|
|
15
|
+
/** Props accepted by `<Slot>`. */
|
|
16
|
+
export interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/** Render `Slot` — merge props onto its single child element. */
|
|
20
|
+
export declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
|
21
|
+
//# sourceMappingURL=slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/slot.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAkDvD,kCAAkC;AAClC,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAClE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,iEAAiE;AACjE,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,yBAAyB,CAChD,SAAS,GAAG,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,CAgB7C,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `Slot` — forked from @radix-ui/react-slot (MIT, © WorkOS), inlined so
|
|
3
|
+
* `veryfront/chat` takes no external Radix dependency. Merges its props onto a
|
|
4
|
+
* single child element (the `asChild` pattern): className is concatenated,
|
|
5
|
+
* style is shallow-merged, event handlers are chained (child first), and refs
|
|
6
|
+
* are composed.
|
|
7
|
+
*
|
|
8
|
+
* Scoped to the single-child case the chat primitives use — Radix's
|
|
9
|
+
* `Slottable`/lazy-children handling is intentionally omitted. Private to the
|
|
10
|
+
* chat module.
|
|
11
|
+
*
|
|
12
|
+
* @module react/components/chat/ui/slot
|
|
13
|
+
*/
|
|
14
|
+
import * as React from "../../../../../react/react.js";
|
|
15
|
+
/** Compose multiple refs into one callback ref. */
|
|
16
|
+
function composeRefs(...refs) {
|
|
17
|
+
return (node) => {
|
|
18
|
+
for (const ref of refs) {
|
|
19
|
+
if (typeof ref === "function") {
|
|
20
|
+
ref(node);
|
|
21
|
+
}
|
|
22
|
+
else if (ref != null) {
|
|
23
|
+
ref.current = node;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function mergeProps(slotProps, childProps) {
|
|
29
|
+
const overrideProps = { ...childProps };
|
|
30
|
+
for (const propName in childProps) {
|
|
31
|
+
const slotPropValue = slotProps[propName];
|
|
32
|
+
const childPropValue = childProps[propName];
|
|
33
|
+
if (/^on[A-Z]/.test(propName)) {
|
|
34
|
+
// Chain handlers: child runs first, then the slot's.
|
|
35
|
+
if (typeof slotPropValue === "function" &&
|
|
36
|
+
typeof childPropValue === "function") {
|
|
37
|
+
overrideProps[propName] = (...args) => {
|
|
38
|
+
childPropValue(...args);
|
|
39
|
+
slotPropValue(...args);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
else if (slotPropValue) {
|
|
43
|
+
overrideProps[propName] = slotPropValue;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (propName === "style") {
|
|
47
|
+
overrideProps[propName] = {
|
|
48
|
+
...slotPropValue,
|
|
49
|
+
...childPropValue,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
else if (propName === "className") {
|
|
53
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean)
|
|
54
|
+
.join(" ");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return { ...slotProps, ...overrideProps };
|
|
58
|
+
}
|
|
59
|
+
/** Render `Slot` — merge props onto its single child element. */
|
|
60
|
+
export const Slot = React.forwardRef(function Slot({ children, ...slotProps }, forwardedRef) {
|
|
61
|
+
if (React.isValidElement(children)) {
|
|
62
|
+
const childProps = (children.props ?? {});
|
|
63
|
+
const childRef = children.ref ??
|
|
64
|
+
childProps.ref;
|
|
65
|
+
const merged = mergeProps(slotProps, childProps);
|
|
66
|
+
merged.ref = forwardedRef ? composeRefs(forwardedRef, childRef) : childRef;
|
|
67
|
+
return React.cloneElement(children, merged);
|
|
68
|
+
}
|
|
69
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
70
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status — ported 1:1 from Veryfront Studio. A coloured status dot with a
|
|
3
|
+
* label (optionally pulsing / responsively hidden). Semantic classes remapped
|
|
4
|
+
* to veryfront's `[var(--token)]` vocabulary — the `--status-*` dot tokens all
|
|
5
|
+
* exist in `theme.ts`. Private to the chat module.
|
|
6
|
+
*
|
|
7
|
+
* @module react/components/chat/ui/status
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "../../../../../react/react.js";
|
|
10
|
+
/** Dot colour, keyed to the `--status-*` palette. */
|
|
11
|
+
export type StatusColor = "gray" | "blue" | "green" | "red" | "yellow";
|
|
12
|
+
/** Props accepted by `<Status>`. */
|
|
13
|
+
export interface StatusProps {
|
|
14
|
+
label: string;
|
|
15
|
+
color: StatusColor;
|
|
16
|
+
/** Pulse the dot (e.g. an in-progress run). */
|
|
17
|
+
pulse?: boolean;
|
|
18
|
+
/** Render the label (off → dot-only, label kept for screen readers). */
|
|
19
|
+
showLabel?: boolean;
|
|
20
|
+
/** Hide the label via container query when space is tight. */
|
|
21
|
+
responsive?: boolean;
|
|
22
|
+
/** `'sm'` (14px, default) or `'inherit'` to inherit the parent's size. */
|
|
23
|
+
size?: "sm" | "inherit";
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Render a status dot + label. */
|
|
27
|
+
export declare function Status({ label, color, pulse, showLabel, responsive, size, className, }: StatusProps): React.ReactElement;
|
|
28
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/status.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAGvD,qDAAqD;AACrD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEvE,oCAAoC;AACpC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,WAAW,CAAC;IACnB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD,mCAAmC;AACnC,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,KAAK,EACL,KAAK,EACL,SAAgB,EAChB,UAAU,EACV,IAAW,EACX,SAAS,GACV,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,CA4BlC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status — ported 1:1 from Veryfront Studio. A coloured status dot with a
|
|
3
|
+
* label (optionally pulsing / responsively hidden). Semantic classes remapped
|
|
4
|
+
* to veryfront's `[var(--token)]` vocabulary — the `--status-*` dot tokens all
|
|
5
|
+
* exist in `theme.ts`. Private to the chat module.
|
|
6
|
+
*
|
|
7
|
+
* @module react/components/chat/ui/status
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "../../../../../react/react.js";
|
|
10
|
+
import { cn } from "../theme.js";
|
|
11
|
+
const dotColorMap = {
|
|
12
|
+
gray: "bg-[var(--status-neutral)]",
|
|
13
|
+
blue: "bg-[var(--status-info)]",
|
|
14
|
+
green: "bg-[var(--status-success)]",
|
|
15
|
+
red: "bg-[var(--status-error)]",
|
|
16
|
+
yellow: "bg-[var(--status-warning)]",
|
|
17
|
+
};
|
|
18
|
+
/** Render a status dot + label. */
|
|
19
|
+
export function Status({ label, color, pulse, showLabel = true, responsive, size = "sm", className, }) {
|
|
20
|
+
return (React.createElement("div", { className: cn("flex items-center gap-1.5", responsive && "@container", className) },
|
|
21
|
+
React.createElement("span", { className: cn("size-2 rounded-full shrink-0", dotColorMap[color], pulse && "animate-pulse") }),
|
|
22
|
+
React.createElement("span", { className: cn(size === "sm" && "text-sm", "font-normal text-[var(--foreground)] truncate", !showLabel && "sr-only", showLabel && responsive && "hidden @[5rem]:inline") }, label)));
|
|
23
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Switch — Studio's Switch is built on `@radix-ui/react-switch`; here it's
|
|
3
|
+
* re-expressed on a native `<input type="checkbox" role="switch">` (full a11y
|
|
4
|
+
* for free) styled as a track + thumb, keeping Studio's exact sizes and
|
|
5
|
+
* transitions. Self-contained, no radix. Accepts the native API plus an
|
|
6
|
+
* optional radix-style `onCheckedChange`. Plus `SwitchField`.
|
|
7
|
+
*
|
|
8
|
+
* @module react/components/chat/ui/switch
|
|
9
|
+
*/
|
|
10
|
+
import * as React from "../../../../../react/react.js";
|
|
11
|
+
import { type VariantProps } from "./cva.js";
|
|
12
|
+
declare const switchTrackVariants: (props?: ({
|
|
13
|
+
size?: "md" | "lg" | "sm" | null | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
class?: import("../../../../utils/clsx.js").ClassValue;
|
|
16
|
+
className?: import("../../../../utils/clsx.js").ClassValue;
|
|
17
|
+
}) | undefined) => string;
|
|
18
|
+
/** Props accepted by `<Switch>`. */
|
|
19
|
+
export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "size">, VariantProps<typeof switchTrackVariants> {
|
|
20
|
+
/** Radix-style convenience callback fired with the next checked state. */
|
|
21
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
22
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
23
|
+
}
|
|
24
|
+
/** A toggle switch. */
|
|
25
|
+
export declare function Switch({ className, size, onChange, onCheckedChange, ref, ...props }: SwitchProps): React.ReactElement;
|
|
26
|
+
/** Props accepted by `<SwitchField>`. */
|
|
27
|
+
export interface SwitchFieldProps extends SwitchProps {
|
|
28
|
+
label: React.ReactNode;
|
|
29
|
+
description?: string;
|
|
30
|
+
}
|
|
31
|
+
/** A switch with a label + optional description, label-left / switch-right. */
|
|
32
|
+
export declare function SwitchField({ label, description, id, ref, ...props }: SwitchFieldProps): React.ReactElement;
|
|
33
|
+
export { switchTrackVariants };
|
|
34
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/switch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAEvD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAGlD,QAAA,MAAM,mBAAmB;;;;;yBAcxB,CAAC;AAmBF,oCAAoC;AACpC,MAAM,WAAW,WACf,SACE,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,EAClE,YAAY,CAAC,OAAO,mBAAmB,CAAC;IAC1C,0EAA0E;IAC1E,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;CACnC;AAED,uBAAuB;AACvB,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,CAiBlC;AAED,yCAAyC;AACzC,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,WAAW,EACX,EAAE,EACF,GAAG,EACH,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,KAAK,CAAC,YAAY,CAmBvC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Switch — Studio's Switch is built on `@radix-ui/react-switch`; here it's
|
|
3
|
+
* re-expressed on a native `<input type="checkbox" role="switch">` (full a11y
|
|
4
|
+
* for free) styled as a track + thumb, keeping Studio's exact sizes and
|
|
5
|
+
* transitions. Self-contained, no radix. Accepts the native API plus an
|
|
6
|
+
* optional radix-style `onCheckedChange`. Plus `SwitchField`.
|
|
7
|
+
*
|
|
8
|
+
* @module react/components/chat/ui/switch
|
|
9
|
+
*/
|
|
10
|
+
import * as React from "../../../../../react/react.js";
|
|
11
|
+
import { cn } from "../theme.js";
|
|
12
|
+
import { cva } from "./cva.js";
|
|
13
|
+
import { Label } from "./label.js";
|
|
14
|
+
const switchTrackVariants = cva([
|
|
15
|
+
"relative inline-flex items-center shrink-0 cursor-pointer rounded-full transition-colors",
|
|
16
|
+
"border border-[var(--background)] dark:border-transparent",
|
|
17
|
+
"bg-[var(--input-bg)] has-[:checked]:bg-[var(--primary)]",
|
|
18
|
+
"has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-[var(--edge-medium)]",
|
|
19
|
+
"has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50",
|
|
20
|
+
], {
|
|
21
|
+
variants: {
|
|
22
|
+
size: { sm: "h-6 w-10", md: "h-7 w-12", lg: "h-8 w-14" },
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: { size: "md" },
|
|
25
|
+
});
|
|
26
|
+
const switchThumbVariants = cva([
|
|
27
|
+
"pointer-events-none block rounded-full transition-transform duration-200 translate-x-0.5",
|
|
28
|
+
"bg-[var(--background)] peer-checked:bg-[var(--secondary)]",
|
|
29
|
+
], {
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
sm: "size-4 peer-checked:translate-x-[18px]",
|
|
33
|
+
md: "size-5 peer-checked:translate-x-[22px]",
|
|
34
|
+
lg: "size-6 peer-checked:translate-x-[26px]",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
defaultVariants: { size: "md" },
|
|
38
|
+
});
|
|
39
|
+
/** A toggle switch. */
|
|
40
|
+
export function Switch({ className, size, onChange, onCheckedChange, ref, ...props }) {
|
|
41
|
+
return (React.createElement("label", { className: cn(switchTrackVariants({ size }), className) },
|
|
42
|
+
React.createElement("input", { ref: ref, type: "checkbox", role: "switch", className: "peer sr-only", onChange: (e) => {
|
|
43
|
+
onChange?.(e);
|
|
44
|
+
onCheckedChange?.(e.currentTarget.checked);
|
|
45
|
+
}, ...props }),
|
|
46
|
+
React.createElement("span", { className: switchThumbVariants({ size }) })));
|
|
47
|
+
}
|
|
48
|
+
/** A switch with a label + optional description, label-left / switch-right. */
|
|
49
|
+
export function SwitchField({ label, description, id, ref, ...props }) {
|
|
50
|
+
const generatedId = React.useId();
|
|
51
|
+
const fieldId = id || generatedId;
|
|
52
|
+
return (React.createElement("div", { className: "flex items-center justify-between gap-4" },
|
|
53
|
+
React.createElement(Label, { htmlFor: fieldId, className: "cursor-pointer flex flex-col flex-1" },
|
|
54
|
+
React.createElement("span", { className: "mb-1.5" }, label),
|
|
55
|
+
description && (React.createElement("span", { className: "text-sm font-normal text-[var(--foreground)]" }, description))),
|
|
56
|
+
React.createElement(Switch, { id: fieldId, size: "sm", ref: ref, ...props })));
|
|
57
|
+
}
|
|
58
|
+
export { switchTrackVariants };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tabs — ported from Veryfront Studio `components/Tabs/Tabs.tsx`, with the
|
|
3
|
+
* `motion/react` spring-slide forked out: the active pill is a static
|
|
4
|
+
* background (no dependency, no layout animation), only the `transition-colors`
|
|
5
|
+
* CSS that Studio already ships. Semantic classes remapped to veryfront's
|
|
6
|
+
* `[var(--token)]` vocabulary. Private to the chat module.
|
|
7
|
+
*
|
|
8
|
+
* Flat, prefixed exports (`Tabs` + `TabsItem`) to match the other `ui/`
|
|
9
|
+
* primitives (`SelectItem`, `DialogTrigger`, …). Note: `cn` is clsx-only (no
|
|
10
|
+
* tailwind-merge), so overriding a base utility via `className` needs the `!`
|
|
11
|
+
* suffix (e.g. `px-8!`).
|
|
12
|
+
*
|
|
13
|
+
* Two sizes:
|
|
14
|
+
* - `default` — filled track (`--input-bg`), 34/38px, accent pill.
|
|
15
|
+
* - `sm` — flat, outlined, 32px, for panel headers.
|
|
16
|
+
*
|
|
17
|
+
* @module react/components/chat/ui/tabs
|
|
18
|
+
*/
|
|
19
|
+
import * as React from "../../../../../react/react.js";
|
|
20
|
+
type TabsSize = "default" | "sm";
|
|
21
|
+
/** Props accepted by `<Tabs>` (the tablist container). */
|
|
22
|
+
export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
23
|
+
value: string;
|
|
24
|
+
onValueChange: (value: string) => void;
|
|
25
|
+
size?: TabsSize;
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
}
|
|
28
|
+
/** Tablist container — manages active state and passes context to items. */
|
|
29
|
+
export declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
/** Props accepted by `<TabsItem>`. */
|
|
31
|
+
export interface TabsItemProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
32
|
+
value: string;
|
|
33
|
+
href?: string;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Individual tab — renders as a button, or an anchor when `href` is set.
|
|
38
|
+
* Forwards native props/ref and composes the caller's `onClick` with the
|
|
39
|
+
* internal selection (caller's runs first, then the tab activates), so a
|
|
40
|
+
* consumer-supplied handler adds to — never overrides — selection.
|
|
41
|
+
*/
|
|
42
|
+
export declare const TabsItem: React.ForwardRefExoticComponent<TabsItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../../../../src/src/react/components/chat/ui/tabs.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,KAAK,MAAM,+BAA+B,CAAC;AAGvD,KAAK,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC;AAUjC,0DAA0D;AAC1D,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACvF,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,4EAA4E;AAC5E,eAAO,MAAM,IAAI,kFAsBf,CAAC;AAGH,sCAAsC;AACtC,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,yFA8CpB,CAAC"}
|