@baishuyun/ai-design 1.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/.storybook/main.ts +29 -0
- package/.storybook/preview.ts +16 -0
- package/.turbo/turbo-build.log +14 -0
- package/CHANGELOG.md +12 -0
- package/components.json +22 -0
- package/debug-storybook.log +88 -0
- package/dist/ai-design.js +20482 -0
- package/dist/ai-design.js.map +1 -0
- package/dist/ai-design.umd.cjs +260 -0
- package/dist/ai-design.umd.cjs.map +1 -0
- package/dist/src/components/abs-fullscreen-gradient-bg.d.ts +10 -0
- package/dist/src/components/abs-fullscreen-gradient-bg.d.ts.map +1 -0
- package/dist/src/components/agent-scroll-selector.d.ts +11 -0
- package/dist/src/components/agent-scroll-selector.d.ts.map +1 -0
- package/dist/src/components/agent-select.d.ts +16 -0
- package/dist/src/components/agent-select.d.ts.map +1 -0
- package/dist/src/components/attachment-part-group.d.ts +16 -0
- package/dist/src/components/attachment-part-group.d.ts.map +1 -0
- package/dist/src/components/attachment-part.d.ts +19 -0
- package/dist/src/components/attachment-part.d.ts.map +1 -0
- package/dist/src/components/attachments-previewer.d.ts +18 -0
- package/dist/src/components/attachments-previewer.d.ts.map +1 -0
- package/dist/src/components/base-button.d.ts +8 -0
- package/dist/src/components/base-button.d.ts.map +1 -0
- package/dist/src/components/border-animation.d.ts +23 -0
- package/dist/src/components/border-animation.d.ts.map +1 -0
- package/dist/src/components/border-color-animation.d.ts +11 -0
- package/dist/src/components/border-color-animation.d.ts.map +1 -0
- package/dist/src/components/bot-avatar-name.d.ts +6 -0
- package/dist/src/components/bot-avatar-name.d.ts.map +1 -0
- package/dist/src/components/bot-icon.d.ts +5 -0
- package/dist/src/components/bot-icon.d.ts.map +1 -0
- package/dist/src/components/bs-entry-select.d.ts +18 -0
- package/dist/src/components/bs-entry-select.d.ts.map +1 -0
- package/dist/src/components/bs-icons.d.ts +75 -0
- package/dist/src/components/bs-icons.d.ts.map +1 -0
- package/dist/src/components/card-field.d.ts +11 -0
- package/dist/src/components/card-field.d.ts.map +1 -0
- package/dist/src/components/card.d.ts +11 -0
- package/dist/src/components/card.d.ts.map +1 -0
- package/dist/src/components/chat-area-header.d.ts +13 -0
- package/dist/src/components/chat-area-header.d.ts.map +1 -0
- package/dist/src/components/circle-checker.d.ts +10 -0
- package/dist/src/components/circle-checker.d.ts.map +1 -0
- package/dist/src/components/collapsible-txt-msg.d.ts +11 -0
- package/dist/src/components/collapsible-txt-msg.d.ts.map +1 -0
- package/dist/src/components/confirm-dialog.d.ts +26 -0
- package/dist/src/components/confirm-dialog.d.ts.map +1 -0
- package/dist/src/components/fake-bot-msg.d.ts +8 -0
- package/dist/src/components/fake-bot-msg.d.ts.map +1 -0
- package/dist/src/components/fields-design-info-table.d.ts +7 -0
- package/dist/src/components/fields-design-info-table.d.ts.map +1 -0
- package/dist/src/components/fields-generating-indicator.d.ts +6 -0
- package/dist/src/components/fields-generating-indicator.d.ts.map +1 -0
- package/dist/src/components/fields-portal.d.ts +8 -0
- package/dist/src/components/fields-portal.d.ts.map +1 -0
- package/dist/src/components/fields-previewer.d.ts +19 -0
- package/dist/src/components/fields-previewer.d.ts.map +1 -0
- package/dist/src/components/font-icon.d.ts +6 -0
- package/dist/src/components/font-icon.d.ts.map +1 -0
- package/dist/src/components/form-info-editor.d.ts +31 -0
- package/dist/src/components/form-info-editor.d.ts.map +1 -0
- package/dist/src/components/formula-tag.d.ts +8 -0
- package/dist/src/components/formula-tag.d.ts.map +1 -0
- package/dist/src/components/generate-animation.d.ts +5 -0
- package/dist/src/components/generate-animation.d.ts.map +1 -0
- package/dist/src/components/icon-btn.d.ts +9 -0
- package/dist/src/components/icon-btn.d.ts.map +1 -0
- package/dist/src/components/img-part.d.ts +10 -0
- package/dist/src/components/img-part.d.ts.map +1 -0
- package/dist/src/components/legacy-slot.d.ts +11 -0
- package/dist/src/components/legacy-slot.d.ts.map +1 -0
- package/dist/src/components/line-checker.d.ts +19 -0
- package/dist/src/components/line-checker.d.ts.map +1 -0
- package/dist/src/components/linear-gradient-border-btn.d.ts +10 -0
- package/dist/src/components/linear-gradient-border-btn.d.ts.map +1 -0
- package/dist/src/components/linear-gradient-color-bg-animation.d.ts +8 -0
- package/dist/src/components/linear-gradient-color-bg-animation.d.ts.map +1 -0
- package/dist/src/components/memoized-markdown.d.ts +5 -0
- package/dist/src/components/memoized-markdown.d.ts.map +1 -0
- package/dist/src/components/message-content.d.ts +6 -0
- package/dist/src/components/message-content.d.ts.map +1 -0
- package/dist/src/components/number-part.d.ts +9 -0
- package/dist/src/components/number-part.d.ts.map +1 -0
- package/dist/src/components/office-container.d.ts +12 -0
- package/dist/src/components/office-container.d.ts.map +1 -0
- package/dist/src/components/option-item.d.ts +9 -0
- package/dist/src/components/option-item.d.ts.map +1 -0
- package/dist/src/components/previewer-header.d.ts +21 -0
- package/dist/src/components/previewer-header.d.ts.map +1 -0
- package/dist/src/components/primary-confirm-btn.d.ts +10 -0
- package/dist/src/components/primary-confirm-btn.d.ts.map +1 -0
- package/dist/src/components/primary-entry-btn.d.ts +9 -0
- package/dist/src/components/primary-entry-btn.d.ts.map +1 -0
- package/dist/src/components/scroll-to-bottom-btn.d.ts +6 -0
- package/dist/src/components/scroll-to-bottom-btn.d.ts.map +1 -0
- package/dist/src/components/split-line.d.ts +5 -0
- package/dist/src/components/split-line.d.ts.map +1 -0
- package/dist/src/components/square-checker.d.ts +15 -0
- package/dist/src/components/square-checker.d.ts.map +1 -0
- package/dist/src/components/tab-radio-group.d.ts +20 -0
- package/dist/src/components/tab-radio-group.d.ts.map +1 -0
- package/dist/src/components/tooltip.d.ts +6 -0
- package/dist/src/components/tooltip.d.ts.map +1 -0
- package/dist/src/components/ui/button.d.ts +12 -0
- package/dist/src/components/ui/button.d.ts.map +1 -0
- package/dist/src/components/ui/dialog.d.ts +24 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/components/ui/icons.d.ts +176 -0
- package/dist/src/components/ui/icons.d.ts.map +1 -0
- package/dist/src/components/ui/popover.d.ts +10 -0
- package/dist/src/components/ui/popover.d.ts.map +1 -0
- package/dist/src/components/ui/spinner.d.ts +3 -0
- package/dist/src/components/ui/spinner.d.ts.map +1 -0
- package/dist/src/components/ui/tooltip.d.ts +13 -0
- package/dist/src/components/ui/tooltip.d.ts.map +1 -0
- package/dist/src/components/user-txt-msg-bubble.d.ts +6 -0
- package/dist/src/components/user-txt-msg-bubble.d.ts.map +1 -0
- package/dist/src/components/warning-msg.d.ts +6 -0
- package/dist/src/components/warning-msg.d.ts.map +1 -0
- package/dist/src/const/ui.d.ts +7 -0
- package/dist/src/const/ui.d.ts.map +1 -0
- package/dist/src/hooks/use-resizable-width.d.ts +24 -0
- package/dist/src/hooks/use-resizable-width.d.ts.map +1 -0
- package/dist/src/hooks/use-shadow.d.ts +25 -0
- package/dist/src/hooks/use-shadow.d.ts.map +1 -0
- package/dist/src/index.d.ts +66 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/utils.d.ts +4 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/stories/AbsFullscreenGradientBg.stories.d.ts +17 -0
- package/dist/src/stories/AbsFullscreenGradientBg.stories.d.ts.map +1 -0
- package/dist/src/stories/AgentScrollSelector.stories.d.ts +11 -0
- package/dist/src/stories/AgentScrollSelector.stories.d.ts.map +1 -0
- package/dist/src/stories/AgentSelect.stories.d.ts +14 -0
- package/dist/src/stories/AgentSelect.stories.d.ts.map +1 -0
- package/dist/src/stories/AttachmentPart.stories.d.ts +23 -0
- package/dist/src/stories/AttachmentPart.stories.d.ts.map +1 -0
- package/dist/src/stories/AttachmentPartGroup.stories.d.ts +21 -0
- package/dist/src/stories/AttachmentPartGroup.stories.d.ts.map +1 -0
- package/dist/src/stories/AttachmentsPreviewer.stories.d.ts +20 -0
- package/dist/src/stories/AttachmentsPreviewer.stories.d.ts.map +1 -0
- package/dist/src/stories/BaseButton.stories.d.ts +18 -0
- package/dist/src/stories/BaseButton.stories.d.ts.map +1 -0
- package/dist/src/stories/BorderAnimation.stories.d.ts +21 -0
- package/dist/src/stories/BorderAnimation.stories.d.ts.map +1 -0
- package/dist/src/stories/BorderColorAnimation.stories.d.ts +26 -0
- package/dist/src/stories/BorderColorAnimation.stories.d.ts.map +1 -0
- package/dist/src/stories/BotAvatarAndName.stories.d.ts +18 -0
- package/dist/src/stories/BotAvatarAndName.stories.d.ts.map +1 -0
- package/dist/src/stories/BotIcon.stories.d.ts +17 -0
- package/dist/src/stories/BotIcon.stories.d.ts.map +1 -0
- package/dist/src/stories/BsEntrySelect.stories.d.ts +13 -0
- package/dist/src/stories/BsEntrySelect.stories.d.ts.map +1 -0
- package/dist/src/stories/BsTooltip.stories.d.ts +7 -0
- package/dist/src/stories/BsTooltip.stories.d.ts.map +1 -0
- package/dist/src/stories/Card.stories.d.ts +14 -0
- package/dist/src/stories/Card.stories.d.ts.map +1 -0
- package/dist/src/stories/CardField.stories.d.ts +13 -0
- package/dist/src/stories/CardField.stories.d.ts.map +1 -0
- package/dist/src/stories/ChatAreaHeader.stories.d.ts +14 -0
- package/dist/src/stories/ChatAreaHeader.stories.d.ts.map +1 -0
- package/dist/src/stories/CircleChecker.stories.d.ts +21 -0
- package/dist/src/stories/CircleChecker.stories.d.ts.map +1 -0
- package/dist/src/stories/CollapsibleTextMsg.stories.d.ts +16 -0
- package/dist/src/stories/CollapsibleTextMsg.stories.d.ts.map +1 -0
- package/dist/src/stories/ConfirmDialog.stories.d.ts +61 -0
- package/dist/src/stories/ConfirmDialog.stories.d.ts.map +1 -0
- package/dist/src/stories/FakeBotMsg.stories.d.ts +21 -0
- package/dist/src/stories/FakeBotMsg.stories.d.ts.map +1 -0
- package/dist/src/stories/FormInfoEditor.stories.d.ts +15 -0
- package/dist/src/stories/FormInfoEditor.stories.d.ts.map +1 -0
- package/dist/src/stories/FormulaTag.stories.d.ts +37 -0
- package/dist/src/stories/FormulaTag.stories.d.ts.map +1 -0
- package/dist/src/stories/GenerateAnimation.stories.d.ts +17 -0
- package/dist/src/stories/GenerateAnimation.stories.d.ts.map +1 -0
- package/dist/src/stories/IconBtn.stories.d.ts +15 -0
- package/dist/src/stories/IconBtn.stories.d.ts.map +1 -0
- package/dist/src/stories/IconLib.d.ts +12 -0
- package/dist/src/stories/IconLib.d.ts.map +1 -0
- package/dist/src/stories/Icons.stories.d.ts +24 -0
- package/dist/src/stories/Icons.stories.d.ts.map +1 -0
- package/dist/src/stories/ImgMsgPart.stories.d.ts +20 -0
- package/dist/src/stories/ImgMsgPart.stories.d.ts.map +1 -0
- package/dist/src/stories/LegacySlot.stories.d.ts +16 -0
- package/dist/src/stories/LegacySlot.stories.d.ts.map +1 -0
- package/dist/src/stories/LineChecker.stories.d.ts +23 -0
- package/dist/src/stories/LineChecker.stories.d.ts.map +1 -0
- package/dist/src/stories/LinearGradientBorderBtn.stories.d.ts +22 -0
- package/dist/src/stories/LinearGradientBorderBtn.stories.d.ts.map +1 -0
- package/dist/src/stories/LinearGradientColorBgAnimation.stories.d.ts +23 -0
- package/dist/src/stories/LinearGradientColorBgAnimation.stories.d.ts.map +1 -0
- package/dist/src/stories/MemoizedMarkdown.stories.d.ts +23 -0
- package/dist/src/stories/MemoizedMarkdown.stories.d.ts.map +1 -0
- package/dist/src/stories/MessageContent.stories.d.ts +16 -0
- package/dist/src/stories/MessageContent.stories.d.ts.map +1 -0
- package/dist/src/stories/NumbersMsgPart.stories.d.ts +19 -0
- package/dist/src/stories/NumbersMsgPart.stories.d.ts.map +1 -0
- package/dist/src/stories/OfficeContainer.stories.d.ts +8 -0
- package/dist/src/stories/OfficeContainer.stories.d.ts.map +1 -0
- package/dist/src/stories/OptionItem.stories.d.ts +20 -0
- package/dist/src/stories/OptionItem.stories.d.ts.map +1 -0
- package/dist/src/stories/PreviewerHeader.stories.d.ts +12 -0
- package/dist/src/stories/PreviewerHeader.stories.d.ts.map +1 -0
- package/dist/src/stories/PrimaryConfirmBtn.stories.d.ts +19 -0
- package/dist/src/stories/PrimaryConfirmBtn.stories.d.ts.map +1 -0
- package/dist/src/stories/PrimaryEntryBtn.stories.d.ts +26 -0
- package/dist/src/stories/PrimaryEntryBtn.stories.d.ts.map +1 -0
- package/dist/src/stories/ScrollToBottom.stories.d.ts +15 -0
- package/dist/src/stories/ScrollToBottom.stories.d.ts.map +1 -0
- package/dist/src/stories/SplitLine.stories.d.ts +9 -0
- package/dist/src/stories/SplitLine.stories.d.ts.map +1 -0
- package/dist/src/stories/SquareChecker.stories.d.ts +26 -0
- package/dist/src/stories/SquareChecker.stories.d.ts.map +1 -0
- package/dist/src/stories/TabRadioGroup.stories.d.ts +18 -0
- package/dist/src/stories/TabRadioGroup.stories.d.ts.map +1 -0
- package/dist/src/stories/UserTextMsgBubble.stories.d.ts +14 -0
- package/dist/src/stories/UserTextMsgBubble.stories.d.ts.map +1 -0
- package/dist/src/stories/WarningMessage.stories.d.ts +16 -0
- package/dist/src/stories/WarningMessage.stories.d.ts.map +1 -0
- package/dist/src/stories/fields-design-info-table.stories.d.ts +14 -0
- package/dist/src/stories/fields-design-info-table.stories.d.ts.map +1 -0
- package/dist/src/stories/fields-generating.stories.d.ts +20 -0
- package/dist/src/stories/fields-generating.stories.d.ts.map +1 -0
- package/dist/src/stories/fields-previewer.stories.d.ts +19 -0
- package/dist/src/stories/fields-previewer.stories.d.ts.map +1 -0
- package/dist/src/types.d.ts +8 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +80 -0
- package/src/components/abs-fullscreen-gradient-bg.tsx +35 -0
- package/src/components/agent-scroll-selector.tsx +181 -0
- package/src/components/agent-select.tsx +149 -0
- package/src/components/attachment-part-group.tsx +35 -0
- package/src/components/attachment-part.tsx +179 -0
- package/src/components/attachments-previewer.tsx +324 -0
- package/src/components/base-button.tsx +49 -0
- package/src/components/border-animation.tsx +107 -0
- package/src/components/border-color-animation.tsx +66 -0
- package/src/components/bot-avatar-name.tsx +36 -0
- package/src/components/bot-icon.tsx +23 -0
- package/src/components/bs-entry-select.tsx +724 -0
- package/src/components/bs-icons.tsx +1201 -0
- package/src/components/card-field.tsx +23 -0
- package/src/components/card.tsx +36 -0
- package/src/components/chat-area-header.tsx +65 -0
- package/src/components/circle-checker.tsx +66 -0
- package/src/components/collapsible-txt-msg.tsx +63 -0
- package/src/components/confirm-dialog.tsx +139 -0
- package/src/components/fake-bot-msg.tsx +49 -0
- package/src/components/fields-design-info-table.tsx +160 -0
- package/src/components/fields-generating-indicator.tsx +95 -0
- package/src/components/fields-portal.tsx +18 -0
- package/src/components/fields-previewer.tsx +216 -0
- package/src/components/font-icon.tsx +17 -0
- package/src/components/form-info-editor.tsx +253 -0
- package/src/components/formula-tag.tsx +32 -0
- package/src/components/generate-animation.tsx +56 -0
- package/src/components/icon-btn.tsx +43 -0
- package/src/components/img-part.tsx +27 -0
- package/src/components/legacy-slot.tsx +103 -0
- package/src/components/line-checker.tsx +160 -0
- package/src/components/linear-gradient-border-btn.tsx +48 -0
- package/src/components/linear-gradient-color-bg-animation.tsx +103 -0
- package/src/components/memoized-markdown.tsx +32 -0
- package/src/components/message-content.tsx +21 -0
- package/src/components/number-part.tsx +46 -0
- package/src/components/office-container.tsx +83 -0
- package/src/components/option-item.tsx +28 -0
- package/src/components/previewer-header.tsx +270 -0
- package/src/components/primary-confirm-btn.tsx +58 -0
- package/src/components/primary-entry-btn.tsx +48 -0
- package/src/components/scroll-to-bottom-btn.tsx +28 -0
- package/src/components/split-line.tsx +9 -0
- package/src/components/square-checker.tsx +87 -0
- package/src/components/tab-radio-group.tsx +83 -0
- package/src/components/tooltip.tsx +53 -0
- package/src/components/ui/button.tsx +51 -0
- package/src/components/ui/dialog.tsx +104 -0
- package/src/components/ui/icons.tsx +1267 -0
- package/src/components/ui/popover.tsx +50 -0
- package/src/components/ui/spinner.tsx +17 -0
- package/src/components/ui/tooltip.tsx +53 -0
- package/src/components/user-txt-msg-bubble.tsx +19 -0
- package/src/components/warning-msg.tsx +27 -0
- package/src/const/ui.ts +52 -0
- package/src/hooks/use-resizable-width.ts +92 -0
- package/src/hooks/use-shadow.ts +127 -0
- package/src/index.ts +76 -0
- package/src/lib/utils.ts +52 -0
- package/src/stories/AbsFullscreenGradientBg.stories.tsx +36 -0
- package/src/stories/AgentScrollSelector.stories.tsx +95 -0
- package/src/stories/AgentSelect.stories.tsx +134 -0
- package/src/stories/AttachmentPart.stories.tsx +122 -0
- package/src/stories/AttachmentPartGroup.stories.tsx +152 -0
- package/src/stories/AttachmentsPreviewer.stories.tsx +306 -0
- package/src/stories/BaseButton.stories.tsx +33 -0
- package/src/stories/BorderAnimation.stories.tsx +116 -0
- package/src/stories/BorderColorAnimation.stories.tsx +63 -0
- package/src/stories/BotAvatarAndName.stories.ts +24 -0
- package/src/stories/BotIcon.stories.ts +22 -0
- package/src/stories/BsEntrySelect.stories.tsx +261 -0
- package/src/stories/BsTooltip.stories.tsx +32 -0
- package/src/stories/Card.stories.tsx +28 -0
- package/src/stories/CardField.stories.tsx +87 -0
- package/src/stories/ChatAreaHeader.stories.ts +26 -0
- package/src/stories/CircleChecker.stories.tsx +89 -0
- package/src/stories/CollapsibleTextMsg.stories.ts +44 -0
- package/src/stories/ConfirmDialog.stories.tsx +123 -0
- package/src/stories/FakeBotMsg.stories.tsx +36 -0
- package/src/stories/FormInfoEditor.stories.tsx +173 -0
- package/src/stories/FormulaTag.stories.tsx +68 -0
- package/src/stories/GenerateAnimation.stories.ts +20 -0
- package/src/stories/IconBtn.stories.tsx +32 -0
- package/src/stories/IconLib.tsx +45 -0
- package/src/stories/Icons.stories.ts +22 -0
- package/src/stories/ImgMsgPart.stories.tsx +42 -0
- package/src/stories/LegacySlot.stories.tsx +56 -0
- package/src/stories/LineChecker.stories.tsx +134 -0
- package/src/stories/LinearGradientBorderBtn.stories.tsx +86 -0
- package/src/stories/LinearGradientColorBgAnimation.stories.tsx +60 -0
- package/src/stories/MemoizedMarkdown.stories.tsx +102 -0
- package/src/stories/MessageContent.stories.tsx +36 -0
- package/src/stories/NumbersMsgPart.stories.tsx +42 -0
- package/src/stories/OfficeContainer.stories.tsx +82 -0
- package/src/stories/OptionItem.stories.tsx +77 -0
- package/src/stories/PreviewerHeader.stories.tsx +91 -0
- package/src/stories/PrimaryConfirmBtn.stories.tsx +60 -0
- package/src/stories/PrimaryEntryBtn.stories.tsx +74 -0
- package/src/stories/ScrollToBottom.stories.tsx +24 -0
- package/src/stories/SplitLine.stories.tsx +40 -0
- package/src/stories/SquareChecker.stories.tsx +96 -0
- package/src/stories/TabRadioGroup.stories.tsx +84 -0
- package/src/stories/UserTextMsgBubble.stories.ts +24 -0
- package/src/stories/WarningMessage.stories.tsx +23 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/demo.css +539 -0
- package/src/stories/assets/demo_index.html +7988 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/iconfont.css +1377 -0
- package/src/stories/assets/iconfont.eot +0 -0
- package/src/stories/assets/iconfont.json +2382 -0
- package/src/stories/assets/iconfont.svg +697 -0
- package/src/stories/assets/iconfont.ttf +0 -0
- package/src/stories/assets/iconfont.woff +0 -0
- package/src/stories/assets/iconfont.woff2 +0 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/fields-design-info-table.stories.tsx +203 -0
- package/src/stories/fields-generating.stories.tsx +41 -0
- package/src/stories/fields-previewer.stories.tsx +77 -0
- package/src/style.css +223 -0
- package/src/types.ts +8 -0
- package/tsconfig.json +12 -0
- package/vite.config.ts +42 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('../components/tab-radio-group').TabRadioGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
args: {};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
export declare const NormalSelected: Story;
|
|
15
|
+
export declare const ThreeOptions: Story;
|
|
16
|
+
export declare const WithCustomWidth: Story;
|
|
17
|
+
export declare const Controlled: Story;
|
|
18
|
+
//# sourceMappingURL=TabRadioGroup.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabRadioGroup.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/TabRadioGroup.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAK5D,QAAA,MAAM,IAAI;;;;;;;;CAQ4B,CAAC;AAEvC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAQ5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAS1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAS7B,CAAC;AAoBF,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ text, children }: import('../components/user-txt-msg-bubble').UserTextMsgBubbleProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
args: {};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Base: Story;
|
|
14
|
+
//# sourceMappingURL=UserTextMsgBubble.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserTextMsgBubble.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/UserTextMsgBubble.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI;;;;;;;;CAUgC,CAAC;AAE3C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,IAAI,EAAE,KAIlB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ message, className, }: import('../components/warning-msg').WarningMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
args: {
|
|
10
|
+
message: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const Base: Story;
|
|
16
|
+
//# sourceMappingURL=WarningMessage.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WarningMessage.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/WarningMessage.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI;;;;;;;;;;CAU6B,CAAC;AAExC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,IAAI,EAAE,KAElB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FieldsDesignInfoTable } from '../components/fields-design-info-table';
|
|
3
|
+
declare const meta: Meta<typeof FieldsDesignInfoTable>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
/** 基础表格 - 无子表单 */
|
|
7
|
+
export declare const Basic: Story;
|
|
8
|
+
/** 包含子表单 - 可展开/收起 */
|
|
9
|
+
export declare const WithSubForm: Story;
|
|
10
|
+
/** 空数据 */
|
|
11
|
+
export declare const Empty: Story;
|
|
12
|
+
/** 多个子表单 */
|
|
13
|
+
export declare const MultipleSubForms: Story;
|
|
14
|
+
//# sourceMappingURL=fields-design-info-table.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields-design-info-table.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/fields-design-info-table.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,qBAAqB,CAcC,CAAC;AAE/C,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAwFnC,kBAAkB;AAClB,eAAO,MAAM,KAAK,EAAE,KAInB,CAAC;AAEF,qBAAqB;AACrB,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC;AAEF,UAAU;AACV,eAAO,MAAM,KAAK,EAAE,KAInB,CAAC;AAEF,YAAY;AACZ,eAAO,MAAM,gBAAgB,EAAE,KAuE9B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ children, loading, }: {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
tags: string[];
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: string;
|
|
11
|
+
};
|
|
12
|
+
args: {};
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
export declare const Base: Story;
|
|
17
|
+
export declare const CustomText: Story;
|
|
18
|
+
export declare const LongText: Story;
|
|
19
|
+
export declare const ShortText: Story;
|
|
20
|
+
//# sourceMappingURL=fields-generating.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields-generating.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/fields-generating.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI;;;gBAqC4c,CAAC;eAA4B,CAAC;;;;;;;CA3Blc,CAAC;AAEnD,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,IAAI,EAAE,KAElB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAIxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<import('../components/fields-previewer').FieldsPreviewerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
args: {};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Base: Story;
|
|
14
|
+
export declare const WithSideSpace: Story;
|
|
15
|
+
export declare const streaming: Story;
|
|
16
|
+
export declare const Empty: Story;
|
|
17
|
+
export declare const Fullscreen: Story;
|
|
18
|
+
export declare const DataVariant: Story;
|
|
19
|
+
//# sourceMappingURL=fields-previewer.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields-previewer.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/fields-previewer.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,QAAA,MAAM,IAAI;;;;;;;;CAU8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAO3B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KASvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAQnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KASxB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,IAAI,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@baishuyun/ai-design",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "AI 功能 UI 组件库 - 所有 AI 功能的 UI 表现唯一真相来源",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"module": "src/index.ts",
|
|
8
|
+
"types": "src/index.ts",
|
|
9
|
+
"style": "src/style.css",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./src/index.ts",
|
|
13
|
+
"import": "./src/index.ts"
|
|
14
|
+
},
|
|
15
|
+
"./*": {
|
|
16
|
+
"types": "./src/components/*.tsx",
|
|
17
|
+
"import": "./src/components/*.tsx"
|
|
18
|
+
},
|
|
19
|
+
"./lib/*": {
|
|
20
|
+
"types": "./src/lib/*.ts",
|
|
21
|
+
"import": "./src/lib/*.ts"
|
|
22
|
+
},
|
|
23
|
+
"./hooks/*": {
|
|
24
|
+
"types": "./src/hooks/*.ts",
|
|
25
|
+
"import": "./src/hooks/*.ts"
|
|
26
|
+
},
|
|
27
|
+
"./const/*": {
|
|
28
|
+
"types": "./src/const/*.ts",
|
|
29
|
+
"import": "./src/const/*.ts"
|
|
30
|
+
},
|
|
31
|
+
"./style.css": "./src/style.css"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
35
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
36
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
37
|
+
"@radix-ui/react-radio-group": "^1.3.8",
|
|
38
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
39
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
40
|
+
"ai": "^5.0.101",
|
|
41
|
+
"class-variance-authority": "^0.7.1",
|
|
42
|
+
"marked": "^17.0.1",
|
|
43
|
+
"classnames": "^2.5.1",
|
|
44
|
+
"clsx": "^2.1.1",
|
|
45
|
+
"lucide-react": "^0.554.0",
|
|
46
|
+
"react": "^18.2.0",
|
|
47
|
+
"react-markdown": "^10.1.0",
|
|
48
|
+
"react-dom": "^18.2.0",
|
|
49
|
+
"tailwind-merge": "^3.4.0",
|
|
50
|
+
"tailwindcss-animate": "^1.0.7",
|
|
51
|
+
"tw-animate-css": "^1.4.0",
|
|
52
|
+
"@baishuyun/types": "2.0.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@storybook/addon-docs": "^10.1.11",
|
|
56
|
+
"@storybook/addon-vitest": "^10.1.11",
|
|
57
|
+
"@storybook/react-vite": "^10.1.11",
|
|
58
|
+
"@tailwindcss/vite": "^4.1.17",
|
|
59
|
+
"@types/react": "18.2.37",
|
|
60
|
+
"@types/react-dom": "18.2.15",
|
|
61
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
62
|
+
"storybook": "^10.1.11",
|
|
63
|
+
"tailwindcss": "^4.1.17",
|
|
64
|
+
"typescript": "^5.5.0",
|
|
65
|
+
"vite": "^5.1.4",
|
|
66
|
+
"vite-plugin-dts": "^4.5.4",
|
|
67
|
+
"@baishuyun/tailwind-config": "2.0.0",
|
|
68
|
+
"@baishuyun/types": "2.0.0",
|
|
69
|
+
"@baishuyun/typescript-config": "1.0.0"
|
|
70
|
+
},
|
|
71
|
+
"keywords": [],
|
|
72
|
+
"author": "",
|
|
73
|
+
"license": "ISC",
|
|
74
|
+
"scripts": {
|
|
75
|
+
"build": "vite build",
|
|
76
|
+
"dev": "vite build --watch",
|
|
77
|
+
"storybook": "storybook dev -p 6007",
|
|
78
|
+
"build-storybook": "storybook build"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface AbsFullscreenGradientBgProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
zIndex: number;
|
|
6
|
+
padding?: number;
|
|
7
|
+
bgColor?: string;
|
|
8
|
+
disableGradient?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const AbsFullscreenGradientBg = forwardRef<HTMLDivElement, AbsFullscreenGradientBgProps>(
|
|
12
|
+
({ children, zIndex, padding, disableGradient, bgColor = '#fff' }, ref) => {
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
ref={ref}
|
|
16
|
+
style={{
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
top: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
width: '100%',
|
|
21
|
+
height: '100%',
|
|
22
|
+
background: disableGradient
|
|
23
|
+
? bgColor
|
|
24
|
+
: 'linear-gradient(180deg, #DBE9FF 0%, #E9FFFD 100%)',
|
|
25
|
+
padding: padding || 0,
|
|
26
|
+
zIndex,
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
AbsFullscreenGradientBg.displayName = 'AbsFullscreenGradientBg';
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { useCallback, useState, useRef, useEffect } from 'react';
|
|
2
|
+
import { cn } from '../lib/utils';
|
|
3
|
+
import { transCls } from '../const/ui';
|
|
4
|
+
import { IconBtn } from './icon-btn';
|
|
5
|
+
import { LeftArrowIcon, MenuLinesIcon } from './bs-icons';
|
|
6
|
+
import { AgentSelect } from './agent-select';
|
|
7
|
+
import type { AgentSelectAgent } from './agent-select';
|
|
8
|
+
import { Popover, PopoverTrigger, PopoverContent } from './ui/popover';
|
|
9
|
+
|
|
10
|
+
export interface AgentScrollSelectorProps {
|
|
11
|
+
agents: Array<AgentSelectAgent>;
|
|
12
|
+
activeAgent?: { id: string } | null;
|
|
13
|
+
onSelect: (agent: AgentSelectAgent) => void | Promise<void>;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const AgentScrollSelector = ({
|
|
18
|
+
agents,
|
|
19
|
+
activeAgent,
|
|
20
|
+
onSelect,
|
|
21
|
+
className,
|
|
22
|
+
}: AgentScrollSelectorProps) => {
|
|
23
|
+
const scrollRef = useRef<HTMLDivElement>(null);
|
|
24
|
+
const [canScrollLeft, setCanScrollLeft] = useState(false);
|
|
25
|
+
const [canScrollRight, setCanScrollRight] = useState(false);
|
|
26
|
+
const [popoverOpen, setPopoverOpen] = useState(false);
|
|
27
|
+
|
|
28
|
+
const [portalContainer, setPortalContainer] = useState<HTMLElement | null>(null);
|
|
29
|
+
|
|
30
|
+
// 用 callback ref,在 DOM attach/detach 时触发
|
|
31
|
+
const setTriggerRef = useCallback((node: HTMLButtonElement | null) => {
|
|
32
|
+
if (!node) {
|
|
33
|
+
setPortalContainer(null);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const rootNode = node.getRootNode();
|
|
38
|
+
if (rootNode instanceof ShadowRoot) {
|
|
39
|
+
const existing = rootNode.querySelector<HTMLElement>('[data-bs-popover-portal]');
|
|
40
|
+
if (existing) {
|
|
41
|
+
setPortalContainer(existing);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const container = document.createElement('div');
|
|
45
|
+
container.setAttribute('data-bs-popover-portal', 'true');
|
|
46
|
+
rootNode.appendChild(container);
|
|
47
|
+
setPortalContainer(container);
|
|
48
|
+
} else {
|
|
49
|
+
setPortalContainer(null);
|
|
50
|
+
}
|
|
51
|
+
}, []);
|
|
52
|
+
|
|
53
|
+
const checkScroll = useCallback(() => {
|
|
54
|
+
const el = scrollRef.current;
|
|
55
|
+
if (!el) return;
|
|
56
|
+
setCanScrollLeft(el.scrollLeft > 0);
|
|
57
|
+
setCanScrollRight(el.scrollLeft + el.clientWidth < el.scrollWidth - 1);
|
|
58
|
+
}, []);
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
checkScroll();
|
|
62
|
+
const el = scrollRef.current;
|
|
63
|
+
if (!el) return;
|
|
64
|
+
|
|
65
|
+
const observer = new ResizeObserver(checkScroll);
|
|
66
|
+
observer.observe(el);
|
|
67
|
+
el.addEventListener('scroll', checkScroll, { passive: true });
|
|
68
|
+
return () => {
|
|
69
|
+
observer.disconnect();
|
|
70
|
+
el.removeEventListener('scroll', checkScroll);
|
|
71
|
+
};
|
|
72
|
+
}, [agents, checkScroll]);
|
|
73
|
+
|
|
74
|
+
const scroll = useCallback((direction: 'left' | 'right') => {
|
|
75
|
+
const el = scrollRef.current;
|
|
76
|
+
if (!el) return;
|
|
77
|
+
el.scrollBy({
|
|
78
|
+
left: direction === 'left' ? -150 : 150,
|
|
79
|
+
behavior: 'smooth',
|
|
80
|
+
});
|
|
81
|
+
}, []);
|
|
82
|
+
|
|
83
|
+
const handleSelect = useCallback(
|
|
84
|
+
(agent: AgentSelectAgent) => {
|
|
85
|
+
onSelect(agent);
|
|
86
|
+
setPopoverOpen(false);
|
|
87
|
+
},
|
|
88
|
+
[onSelect]
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<div className={cn('flex items-center gap-2.5 w-fit max-w-full min-w-0', className)}>
|
|
93
|
+
<IconBtn
|
|
94
|
+
rounded
|
|
95
|
+
disabled={!canScrollLeft}
|
|
96
|
+
icon={<LeftArrowIcon />}
|
|
97
|
+
onClick={() => scroll('left')}
|
|
98
|
+
/>
|
|
99
|
+
|
|
100
|
+
<div
|
|
101
|
+
ref={scrollRef}
|
|
102
|
+
className="flex-1 overflow-x-auto scrollbar-hide flex gap-[6px] min-w-0"
|
|
103
|
+
>
|
|
104
|
+
{agents.map((agent) => {
|
|
105
|
+
const isActive = activeAgent?.id === agent.id;
|
|
106
|
+
return (
|
|
107
|
+
<button
|
|
108
|
+
key={agent.id}
|
|
109
|
+
type="button"
|
|
110
|
+
onClick={() => onSelect(agent)}
|
|
111
|
+
className={cn(
|
|
112
|
+
'flex items-center gap-[6px] shrink-0 max-w-[240px]',
|
|
113
|
+
'px-[10px] py-[7px] rounded-[100px]',
|
|
114
|
+
transCls,
|
|
115
|
+
isActive
|
|
116
|
+
? 'border border-[#f0f6ff] bg-[#F0F6FF] text-[#0265FF]'
|
|
117
|
+
: 'border border-[#E0E0E0] text-[#121111] hover:bg-[#F0F6FF] hover:text-[#0265FF]'
|
|
118
|
+
)}
|
|
119
|
+
>
|
|
120
|
+
<img
|
|
121
|
+
src={agent.icon}
|
|
122
|
+
alt={agent.name}
|
|
123
|
+
className="h-4 w-4 rounded-[4px] object-cover shrink-0"
|
|
124
|
+
/>
|
|
125
|
+
<span className="text-[14px] leading-[normal] truncate">
|
|
126
|
+
{agent.name}
|
|
127
|
+
</span>
|
|
128
|
+
</button>
|
|
129
|
+
);
|
|
130
|
+
})}
|
|
131
|
+
</div>
|
|
132
|
+
|
|
133
|
+
<IconBtn
|
|
134
|
+
rounded
|
|
135
|
+
disabled={!canScrollRight}
|
|
136
|
+
icon={
|
|
137
|
+
<span className="rotate-180 inline-flex">
|
|
138
|
+
<LeftArrowIcon />
|
|
139
|
+
</span>
|
|
140
|
+
}
|
|
141
|
+
onClick={() => scroll('right')}
|
|
142
|
+
/>
|
|
143
|
+
|
|
144
|
+
{agents.length > 0 && (
|
|
145
|
+
<Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
|
|
146
|
+
<PopoverTrigger asChild>
|
|
147
|
+
<button
|
|
148
|
+
ref={setTriggerRef}
|
|
149
|
+
type="button"
|
|
150
|
+
className={cn(
|
|
151
|
+
'flex items-center gap-[6px] shrink-0 h-[34px]',
|
|
152
|
+
'px-[10px] py-[5px] rounded-[4px]',
|
|
153
|
+
'text-[14px] text-[#121111] leading-[normal]',
|
|
154
|
+
'hover:bg-[#EFF0F6]',
|
|
155
|
+
{
|
|
156
|
+
'bg-[#eff0f6]': popoverOpen,
|
|
157
|
+
},
|
|
158
|
+
transCls
|
|
159
|
+
)}
|
|
160
|
+
>
|
|
161
|
+
<MenuLinesIcon />
|
|
162
|
+
<span>全部</span>
|
|
163
|
+
</button>
|
|
164
|
+
</PopoverTrigger>
|
|
165
|
+
<PopoverContent
|
|
166
|
+
align="end"
|
|
167
|
+
sideOffset={4}
|
|
168
|
+
portalContainer={portalContainer}
|
|
169
|
+
>
|
|
170
|
+
<AgentSelect
|
|
171
|
+
agents={agents}
|
|
172
|
+
showSearch
|
|
173
|
+
activeAgent={activeAgent}
|
|
174
|
+
onSelect={handleSelect}
|
|
175
|
+
/>
|
|
176
|
+
</PopoverContent>
|
|
177
|
+
</Popover>
|
|
178
|
+
)}
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { useMemo, useState, useCallback } from 'react';
|
|
2
|
+
import { cn } from '../lib/utils';
|
|
3
|
+
import { transCls } from '../const/ui';
|
|
4
|
+
|
|
5
|
+
export interface AgentSelectAgent {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
builtIn?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface AgentSelectProps {
|
|
13
|
+
agents: Array<AgentSelectAgent>;
|
|
14
|
+
showSearch?: boolean;
|
|
15
|
+
activeAgent?: { id: string } | null;
|
|
16
|
+
onSelect: (agent: AgentSelectAgent) => void | Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface AgentGroup {
|
|
20
|
+
label: string;
|
|
21
|
+
agents: Array<AgentSelectAgent>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const AgentSelect = ({
|
|
25
|
+
agents,
|
|
26
|
+
showSearch = false,
|
|
27
|
+
activeAgent,
|
|
28
|
+
onSelect,
|
|
29
|
+
}: AgentSelectProps) => {
|
|
30
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
31
|
+
|
|
32
|
+
const groups = useMemo<AgentGroup[]>(() => {
|
|
33
|
+
const systemAgents = agents.filter((a) => a.builtIn);
|
|
34
|
+
const customAgents = agents.filter((a) => !a.builtIn);
|
|
35
|
+
return [
|
|
36
|
+
{ label: '系统智能体', agents: systemAgents },
|
|
37
|
+
{ label: '自定义智能体', agents: customAgents },
|
|
38
|
+
]
|
|
39
|
+
.map((g) => ({
|
|
40
|
+
...g,
|
|
41
|
+
agents: g.agents.filter((a) =>
|
|
42
|
+
a.name.toLowerCase().includes(searchQuery.toLowerCase())
|
|
43
|
+
),
|
|
44
|
+
}))
|
|
45
|
+
.filter((g) => g.agents.length > 0);
|
|
46
|
+
}, [agents, searchQuery]);
|
|
47
|
+
|
|
48
|
+
const handleSelect = useCallback(
|
|
49
|
+
(agent: AgentSelectAgent) => {
|
|
50
|
+
onSelect(agent);
|
|
51
|
+
},
|
|
52
|
+
[onSelect]
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<div className="flex flex-col">
|
|
57
|
+
{showSearch && (
|
|
58
|
+
<div className="px-1.5 pt-1 pb-0.5">
|
|
59
|
+
<div className="flex h-7.5 items-center gap-1.5 rounded-[4px] bg-white px-2.5 py-1.25 border border-[#E0E0E0]">
|
|
60
|
+
<svg
|
|
61
|
+
width="14"
|
|
62
|
+
height="14"
|
|
63
|
+
viewBox="0 0 14 14"
|
|
64
|
+
fill="none"
|
|
65
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
66
|
+
className="shrink-0 text-[#999999]"
|
|
67
|
+
>
|
|
68
|
+
<path
|
|
69
|
+
d="M6.41667 11.0833C8.994 11.0833 11.0833 8.994 11.0833 6.41667C11.0833 3.83934 8.994 1.75 6.41667 1.75C3.83934 1.75 1.75 3.83934 1.75 6.41667C1.75 8.994 3.83934 11.0833 6.41667 11.0833Z"
|
|
70
|
+
stroke="currentColor"
|
|
71
|
+
strokeWidth="1.2"
|
|
72
|
+
strokeLinecap="round"
|
|
73
|
+
strokeLinejoin="round"
|
|
74
|
+
/>
|
|
75
|
+
<path
|
|
76
|
+
d="M12.25 12.25L9.7125 9.7125"
|
|
77
|
+
stroke="currentColor"
|
|
78
|
+
strokeWidth="1.2"
|
|
79
|
+
strokeLinecap="round"
|
|
80
|
+
strokeLinejoin="round"
|
|
81
|
+
/>
|
|
82
|
+
</svg>
|
|
83
|
+
<input
|
|
84
|
+
type="text"
|
|
85
|
+
placeholder="搜索智能体"
|
|
86
|
+
value={searchQuery}
|
|
87
|
+
onChange={(e) => setSearchQuery(e.target.value)}
|
|
88
|
+
className="h-full flex-1 bg-transparent text-[12px] text-[#121111] placeholder:text-[#999999] outline-none"
|
|
89
|
+
/>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
)}
|
|
93
|
+
|
|
94
|
+
<div className="max-h-80 overflow-y-auto scrollbar-hide">
|
|
95
|
+
{groups.map((group, groupIndex) => (
|
|
96
|
+
<div key={group.label}>
|
|
97
|
+
<div
|
|
98
|
+
className={cn(
|
|
99
|
+
'flex h-8 items-start px-2.5 pt-2.25',
|
|
100
|
+
groupIndex > 0 && 'mt-0.5'
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
<div className="flex w-full flex-col gap-1.5">
|
|
104
|
+
<span className="text-[12px] font-medium text-[#666666] leading-4.25">
|
|
105
|
+
{group.label}
|
|
106
|
+
</span>
|
|
107
|
+
<div className="h-0 w-full border-b border-[#E0E0E0]" />
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<div className="px-1">
|
|
112
|
+
{group.agents.map((agent) => {
|
|
113
|
+
const isActive = activeAgent?.id === agent.id;
|
|
114
|
+
return (
|
|
115
|
+
<button
|
|
116
|
+
key={agent.id}
|
|
117
|
+
className={cn(
|
|
118
|
+
'flex h-8 w-full cursor-pointer items-center gap-1.5 rounded-[4px] px-2.5 py-1.5 text-left',
|
|
119
|
+
transCls,
|
|
120
|
+
isActive
|
|
121
|
+
? 'bg-[#F0F6FF] text-[#0265FF]'
|
|
122
|
+
: 'text-[#121111] hover:bg-[#EFF0F6]'
|
|
123
|
+
)}
|
|
124
|
+
onClick={() => handleSelect(agent)}
|
|
125
|
+
>
|
|
126
|
+
<img
|
|
127
|
+
src={agent.icon}
|
|
128
|
+
alt={agent.name}
|
|
129
|
+
className="h-4 w-4 rounded-[4px] object-cover shrink-0"
|
|
130
|
+
/>
|
|
131
|
+
<span className="truncate text-[14px] leading-5">
|
|
132
|
+
{agent.name}
|
|
133
|
+
</span>
|
|
134
|
+
</button>
|
|
135
|
+
);
|
|
136
|
+
})}
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
))}
|
|
140
|
+
|
|
141
|
+
{groups.length === 0 && (
|
|
142
|
+
<div className="flex h-15 items-center justify-center text-[12px] text-[#999999]">
|
|
143
|
+
未找到相关智能体
|
|
144
|
+
</div>
|
|
145
|
+
)}
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
);
|
|
149
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cn } from '../lib/utils';
|
|
2
|
+
import { AttachmentPart, FilePart } from './attachment-part';
|
|
3
|
+
import { FileUIPart } from 'ai';
|
|
4
|
+
|
|
5
|
+
export interface AttachmentPartGroupProps {
|
|
6
|
+
parts: FileUIPart[];
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Size in pixels for each item, defaults to 102 */
|
|
9
|
+
size?: number;
|
|
10
|
+
/** Gap between items in pixels, defaults to 10 */
|
|
11
|
+
gap?: number;
|
|
12
|
+
/** Show only icons without file names */
|
|
13
|
+
iconOnly?: boolean;
|
|
14
|
+
/** Click handler for individual parts */
|
|
15
|
+
onPartClick?: (part: FilePart) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const AttachmentPartGroup = ({
|
|
19
|
+
parts,
|
|
20
|
+
className,
|
|
21
|
+
size = 100,
|
|
22
|
+
gap = 10,
|
|
23
|
+
iconOnly,
|
|
24
|
+
onPartClick,
|
|
25
|
+
}: AttachmentPartGroupProps) => {
|
|
26
|
+
if (!parts.length) return null;
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<div className={cn('flex flex-wrap content-center items-center', className)} style={{ gap }}>
|
|
30
|
+
{parts.map((part, index) => (
|
|
31
|
+
<AttachmentPart key={part.url || index} part={part} size={size} iconOnly={iconOnly} onClick={onPartClick} />
|
|
32
|
+
))}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|