@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,95 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
import { AgentScrollSelector } from '../components/agent-scroll-selector';
|
|
4
|
+
import type { AgentSelectAgent } from '../components/agent-select';
|
|
5
|
+
|
|
6
|
+
const mockAgents: AgentSelectAgent[] = [
|
|
7
|
+
{ id: '1', name: 'AI助手', icon: 'https://picsum.photos/32/32?random=1', builtIn: true },
|
|
8
|
+
{ id: '2', name: '代码助手', icon: 'https://picsum.photos/32/32?random=2', builtIn: true },
|
|
9
|
+
{ id: '3', name: '翻译专家', icon: 'https://picsum.photos/32/32?random=3', builtIn: false },
|
|
10
|
+
{ id: '4', name: '文档写手', icon: 'https://picsum.photos/32/32?random=4', builtIn: false },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
const manyAgents: AgentSelectAgent[] = [
|
|
14
|
+
{ id: '1', name: 'AI助手', icon: 'https://picsum.photos/32/32?random=1', builtIn: true },
|
|
15
|
+
{ id: '2', name: '代码助手', icon: 'https://picsum.photos/32/32?random=2', builtIn: true },
|
|
16
|
+
{ id: '3', name: '翻译专家翻译专家', icon: 'https://picsum.photos/32/32?random=3', builtIn: false },
|
|
17
|
+
{ id: '4', name: '文档写手', icon: 'https://picsum.photos/32/32?random=4', builtIn: false },
|
|
18
|
+
{ id: '5', name: 'AI表单搭建', icon: 'https://picsum.photos/32/32?random=5', builtIn: true },
|
|
19
|
+
{ id: '6', name: '数据分析', icon: 'https://picsum.photos/32/32?random=6', builtIn: false },
|
|
20
|
+
{ id: '7', name: 'AI填写', icon: 'https://picsum.photos/32/32?random=7', builtIn: true },
|
|
21
|
+
{ id: '8', name: '智能搜索', icon: 'https://picsum.photos/32/32?random=8', builtIn: false },
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const meta: Meta<typeof AgentScrollSelector> = {
|
|
25
|
+
title: 'AI Office/AgentScrollSelector',
|
|
26
|
+
component: AgentScrollSelector,
|
|
27
|
+
tags: ['autodocs'],
|
|
28
|
+
parameters: { layout: 'centered' },
|
|
29
|
+
args: {
|
|
30
|
+
agents: mockAgents,
|
|
31
|
+
onSelect: () => {},
|
|
32
|
+
},
|
|
33
|
+
decorators: [
|
|
34
|
+
(Story) => (
|
|
35
|
+
<div style={{ width: 600, padding: 20 }}>
|
|
36
|
+
<Story />
|
|
37
|
+
</div>
|
|
38
|
+
),
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default meta;
|
|
43
|
+
type Story = StoryObj<typeof meta>;
|
|
44
|
+
|
|
45
|
+
export const Default: Story = {};
|
|
46
|
+
|
|
47
|
+
export const WithActiveAgent: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
activeAgent: { id: '2' },
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const ManyAgents: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
agents: manyAgents,
|
|
56
|
+
activeAgent: { id: '5' },
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const Empty: Story = {
|
|
61
|
+
args: {
|
|
62
|
+
agents: [],
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const Interactive: Story = {
|
|
67
|
+
render: (args) => {
|
|
68
|
+
const [selected, setSelected] = useState<AgentSelectAgent | null>(null);
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
|
72
|
+
<AgentScrollSelector
|
|
73
|
+
{...args}
|
|
74
|
+
onSelect={(agent) => setSelected(agent)}
|
|
75
|
+
activeAgent={selected}
|
|
76
|
+
/>
|
|
77
|
+
{selected && (
|
|
78
|
+
<div
|
|
79
|
+
style={{
|
|
80
|
+
padding: 12,
|
|
81
|
+
background: '#F5F7FA',
|
|
82
|
+
borderRadius: 8,
|
|
83
|
+
fontSize: 14,
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
<strong>已选择:</strong> {selected.name}
|
|
87
|
+
</div>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
},
|
|
92
|
+
args: {
|
|
93
|
+
agents: manyAgents,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
import { AgentSelect } from '../components/agent-select';
|
|
4
|
+
import type { AgentSelectAgent } from '../components/agent-select';
|
|
5
|
+
|
|
6
|
+
const mockAgents: AgentSelectAgent[] = [
|
|
7
|
+
{
|
|
8
|
+
id: '1',
|
|
9
|
+
name: 'AI助手',
|
|
10
|
+
icon: 'https://picsum.photos/32/32?random=1',
|
|
11
|
+
builtIn: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: '2',
|
|
15
|
+
name: '代码助手',
|
|
16
|
+
icon: 'https://picsum.photos/32/32?random=2',
|
|
17
|
+
builtIn: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: '3',
|
|
21
|
+
name: '翻译专家',
|
|
22
|
+
icon: 'https://picsum.photos/32/32?random=3',
|
|
23
|
+
builtIn: false,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: '4',
|
|
27
|
+
name: '文档写手',
|
|
28
|
+
icon: 'https://picsum.photos/32/32?random=4',
|
|
29
|
+
builtIn: false,
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const onlySystemAgents: AgentSelectAgent[] = [
|
|
34
|
+
{ id: '1', name: 'AI助手', icon: 'https://picsum.photos/32/32?random=1', builtIn: true },
|
|
35
|
+
{ id: '2', name: '代码助手', icon: 'https://picsum.photos/32/32?random=2', builtIn: true },
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const onlyCustomAgents: AgentSelectAgent[] = [
|
|
39
|
+
{ id: '3', name: '翻译专家', icon: 'https://picsum.photos/32/32?random=3', builtIn: false },
|
|
40
|
+
{ id: '4', name: '文档写手', icon: 'https://picsum.photos/32/32?random=4', builtIn: false },
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
const meta: Meta<typeof AgentSelect> = {
|
|
44
|
+
title: 'AI Office/AgentSelect',
|
|
45
|
+
component: AgentSelect,
|
|
46
|
+
tags: ['autodocs'],
|
|
47
|
+
parameters: { layout: 'centered' },
|
|
48
|
+
args: {
|
|
49
|
+
agents: mockAgents,
|
|
50
|
+
onSelect: () => {},
|
|
51
|
+
},
|
|
52
|
+
decorators: [
|
|
53
|
+
(Story) => (
|
|
54
|
+
<div style={{ width: 280, padding: 20 }}>
|
|
55
|
+
<Story />
|
|
56
|
+
</div>
|
|
57
|
+
),
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default meta;
|
|
62
|
+
type Story = StoryObj<typeof meta>;
|
|
63
|
+
|
|
64
|
+
export const Default: Story = {};
|
|
65
|
+
|
|
66
|
+
export const WithSearch: Story = {
|
|
67
|
+
args: {
|
|
68
|
+
showSearch: true,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const WithActiveAgent: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
activeAgent: { id: '2' },
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const WithSearchAndActiveAgent: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
showSearch: true,
|
|
81
|
+
activeAgent: { id: '1' },
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const Empty: Story = {
|
|
86
|
+
args: {
|
|
87
|
+
agents: [],
|
|
88
|
+
showSearch: true,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const OnlySystemAgents: Story = {
|
|
93
|
+
args: {
|
|
94
|
+
agents: onlySystemAgents,
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const OnlyCustomAgents: Story = {
|
|
99
|
+
args: {
|
|
100
|
+
agents: onlyCustomAgents,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const Interactive: Story = {
|
|
105
|
+
render: (args) => {
|
|
106
|
+
const [selected, setSelected] = useState<AgentSelectAgent | null>(null);
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
|
110
|
+
<AgentSelect
|
|
111
|
+
{...args}
|
|
112
|
+
onSelect={(agent) => setSelected(agent)}
|
|
113
|
+
activeAgent={selected}
|
|
114
|
+
showSearch={true}
|
|
115
|
+
/>
|
|
116
|
+
{selected && (
|
|
117
|
+
<div
|
|
118
|
+
style={{
|
|
119
|
+
padding: 12,
|
|
120
|
+
background: '#F5F7FA',
|
|
121
|
+
borderRadius: 8,
|
|
122
|
+
fontSize: 14,
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
<strong>已选择:</strong> {selected.name}
|
|
126
|
+
</div>
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
},
|
|
131
|
+
args: {
|
|
132
|
+
agents: mockAgents,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { AttachmentPart, FilePart } from '../components/attachment-part';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Example/Chat/AttachmentPart',
|
|
7
|
+
component: AttachmentPart,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
} satisfies Meta<typeof AttachmentPart>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
const imagePart: FilePart = {
|
|
19
|
+
type: 'file',
|
|
20
|
+
url: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400',
|
|
21
|
+
name: 'mountain.jpg',
|
|
22
|
+
mediaType: 'image/jpeg',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const excelPart: FilePart = {
|
|
26
|
+
type: 'file',
|
|
27
|
+
url: 'http://example.com/test.xlsx',
|
|
28
|
+
name: 'bot_files/uuid/test excel upload.xlsx',
|
|
29
|
+
mediaType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const csvPart: FilePart = {
|
|
33
|
+
type: 'file',
|
|
34
|
+
url: 'http://example.com/data.csv',
|
|
35
|
+
name: 'data.csv',
|
|
36
|
+
mediaType: 'text/csv',
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const txtPart: FilePart = {
|
|
40
|
+
type: 'file',
|
|
41
|
+
url: 'http://example.com/readme.txt',
|
|
42
|
+
name: 'readme.txt',
|
|
43
|
+
mediaType: 'text/plain',
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const tsPart: FilePart = {
|
|
47
|
+
type: 'file',
|
|
48
|
+
url: 'http://example.com/useFormChat.ts',
|
|
49
|
+
name: 'bot_files/uuid/useFormChat_Version3.ts',
|
|
50
|
+
mediaType: 'application/octet-stream',
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const unknownPart: FilePart = {
|
|
54
|
+
type: 'file',
|
|
55
|
+
url: 'http://example.com/unknown.bin',
|
|
56
|
+
name: 'unknown.bin',
|
|
57
|
+
mediaType: 'application/x-unknown',
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const Image: Story = {
|
|
61
|
+
args: {
|
|
62
|
+
part: imagePart,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const Excel: Story = {
|
|
67
|
+
args: {
|
|
68
|
+
part: excelPart,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const CSV: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
part: csvPart,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const TXT: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
part: txtPart,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const TypeScript: Story = {
|
|
85
|
+
args: {
|
|
86
|
+
part: tsPart,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const Unknown: Story = {
|
|
91
|
+
args: {
|
|
92
|
+
part: unknownPart,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const LargeSize: Story = {
|
|
97
|
+
args: {
|
|
98
|
+
part: excelPart,
|
|
99
|
+
size: 150,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const SmallSize: Story = {
|
|
104
|
+
args: {
|
|
105
|
+
part: csvPart,
|
|
106
|
+
size: 64,
|
|
107
|
+
iconOnly: true,
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const AllTypes = {
|
|
112
|
+
render: () => (
|
|
113
|
+
<div className="flex gap-4 flex-wrap">
|
|
114
|
+
<AttachmentPart part={imagePart} />
|
|
115
|
+
<AttachmentPart part={excelPart} />
|
|
116
|
+
<AttachmentPart part={csvPart} />
|
|
117
|
+
<AttachmentPart part={txtPart} />
|
|
118
|
+
<AttachmentPart part={tsPart} />
|
|
119
|
+
<AttachmentPart part={unknownPart} />
|
|
120
|
+
</div>
|
|
121
|
+
),
|
|
122
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
|
|
4
|
+
import { AttachmentPartGroup } from '../components/attachment-part-group';
|
|
5
|
+
import { FilePart } from '../components/attachment-part';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Example/Chat/AttachmentPartGroup',
|
|
9
|
+
component: AttachmentPartGroup,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
} satisfies Meta<typeof AttachmentPartGroup>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
const imageParts: FilePart[] = [
|
|
21
|
+
{
|
|
22
|
+
type: 'file',
|
|
23
|
+
url: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400',
|
|
24
|
+
name: 'mountain1.jpg',
|
|
25
|
+
mediaType: 'image/jpeg',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
type: 'file',
|
|
29
|
+
url: 'https://images.unsplash.com/photo-1519681393784-d120267933ba?w=400',
|
|
30
|
+
name: 'mountain2.jpg',
|
|
31
|
+
mediaType: 'image/jpeg',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'file',
|
|
35
|
+
url: 'https://images.unsplash.com/photo-1454496522488-7a8e488e8606?w=400',
|
|
36
|
+
name: 'mountain3.jpg',
|
|
37
|
+
mediaType: 'image/jpeg',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const mixedParts: FilePart[] = [
|
|
42
|
+
{
|
|
43
|
+
type: 'file',
|
|
44
|
+
url: 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=400',
|
|
45
|
+
name: 'photo1.jpg',
|
|
46
|
+
mediaType: 'image/jpeg',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: 'file',
|
|
50
|
+
url: 'https://images.unsplash.com/photo-1519681393784-d120267933ba?w=400',
|
|
51
|
+
name: 'photo2.jpg',
|
|
52
|
+
mediaType: 'image/jpeg',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
type: 'file',
|
|
56
|
+
url: 'https://images.unsplash.com/photo-1454496522488-7a8e488e8606?w=400',
|
|
57
|
+
name: 'photo3.jpg',
|
|
58
|
+
mediaType: 'image/jpeg',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: 'file',
|
|
62
|
+
url: 'https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=400',
|
|
63
|
+
name: 'photo4.jpg',
|
|
64
|
+
mediaType: 'image/jpeg',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'file',
|
|
68
|
+
url: 'https://images.unsplash.com/photo-1486870591958-9b9d0d1dda99?w=400',
|
|
69
|
+
name: 'photo5.jpg',
|
|
70
|
+
mediaType: 'image/jpeg',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'file',
|
|
74
|
+
url: 'http://example.com/test.xlsx',
|
|
75
|
+
name: '生产小工单.excel',
|
|
76
|
+
mediaType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
const fileParts: FilePart[] = [
|
|
81
|
+
{
|
|
82
|
+
type: 'file',
|
|
83
|
+
url: 'http://example.com/report.xlsx',
|
|
84
|
+
name: 'report.xlsx',
|
|
85
|
+
mediaType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: 'file',
|
|
89
|
+
url: 'http://example.com/data.csv',
|
|
90
|
+
name: 'data.csv',
|
|
91
|
+
mediaType: 'text/csv',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: 'file',
|
|
95
|
+
url: 'http://example.com/readme.txt',
|
|
96
|
+
name: 'readme.txt',
|
|
97
|
+
mediaType: 'text/plain',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: 'file',
|
|
101
|
+
url: 'http://example.com/unknown.bin',
|
|
102
|
+
name: 'unknown.bin',
|
|
103
|
+
mediaType: 'application/x-unknown',
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
export const ImagesOnly: Story = {
|
|
108
|
+
args: {
|
|
109
|
+
parts: imageParts,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export const MixedContent: Story = {
|
|
114
|
+
args: {
|
|
115
|
+
parts: mixedParts,
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const FilesOnly: Story = {
|
|
120
|
+
args: {
|
|
121
|
+
parts: fileParts,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export const IconOnly: Story = {
|
|
126
|
+
args: {
|
|
127
|
+
parts: fileParts,
|
|
128
|
+
iconOnly: true,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const SmallSize: Story = {
|
|
133
|
+
args: {
|
|
134
|
+
parts: mixedParts,
|
|
135
|
+
size: 80,
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const LargeGap: Story = {
|
|
140
|
+
args: {
|
|
141
|
+
parts: mixedParts,
|
|
142
|
+
gap: 20,
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const ConstrainedWidth = {
|
|
147
|
+
render: () => (
|
|
148
|
+
<div style={{ width: 330 }}>
|
|
149
|
+
<AttachmentPartGroup parts={mixedParts} />
|
|
150
|
+
</div>
|
|
151
|
+
),
|
|
152
|
+
};
|