@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,86 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { LinearGradientBorderBtn } from "../components/linear-gradient-border-btn";
|
|
4
|
+
import { LetterAIcon } from "../components/bs-icons";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Example/Button/LinearGradientBorderBtn",
|
|
8
|
+
component: LinearGradientBorderBtn,
|
|
9
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
10
|
+
tags: ["autodocs"],
|
|
11
|
+
parameters: {
|
|
12
|
+
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
13
|
+
layout: "centered",
|
|
14
|
+
},
|
|
15
|
+
args: {},
|
|
16
|
+
} satisfies Meta<typeof LinearGradientBorderBtn>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
children: "搭建供应商评估表",
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const ShortText: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
children: "确认",
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const LongText: Story = {
|
|
34
|
+
args: {
|
|
35
|
+
children: "创建新的供应商管理表单并提交审核",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Disabled: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
children: "搭建供应商评估表",
|
|
42
|
+
disabled: true,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const WithClickHandler: Story = {
|
|
47
|
+
args: {
|
|
48
|
+
children: "点击我",
|
|
49
|
+
onClick: () => alert("按钮被点击了!"),
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const CustomClassName: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
children: "自定义样式",
|
|
56
|
+
className: "w-[200px]",
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const MultipleButtons: Story = {
|
|
61
|
+
render: () => (
|
|
62
|
+
<div className="flex gap-2">
|
|
63
|
+
<LinearGradientBorderBtn>取消</LinearGradientBorderBtn>
|
|
64
|
+
<LinearGradientBorderBtn>确定</LinearGradientBorderBtn>
|
|
65
|
+
<LinearGradientBorderBtn>提交</LinearGradientBorderBtn>
|
|
66
|
+
</div>
|
|
67
|
+
),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const WithIcon: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
children: (
|
|
73
|
+
<div className="flex items-center gap-1">
|
|
74
|
+
<LetterAIcon />
|
|
75
|
+
<span>添加表单</span>
|
|
76
|
+
</div>
|
|
77
|
+
),
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const FixedWidth: Story = {
|
|
82
|
+
args: {
|
|
83
|
+
children: "固定宽度按钮",
|
|
84
|
+
className: "w-[160px]",
|
|
85
|
+
},
|
|
86
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { LinearGradientColorBgAnimation } from "../components/linear-gradient-color-bg-animation";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Example/Animation/LinearGradientColorBgAnimation",
|
|
7
|
+
component: LinearGradientColorBgAnimation,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
args: {},
|
|
13
|
+
} satisfies Meta<typeof LinearGradientColorBgAnimation>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
width: '976px',
|
|
21
|
+
height: '52px',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const WithContent: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
width: '100vw',
|
|
28
|
+
height: '400px',
|
|
29
|
+
},
|
|
30
|
+
render: (args) => (
|
|
31
|
+
<LinearGradientColorBgAnimation {...args}>
|
|
32
|
+
<div style={{
|
|
33
|
+
display: 'flex',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
height: '100%',
|
|
37
|
+
color: '#333',
|
|
38
|
+
}}>
|
|
39
|
+
<div style={{ textAlign: 'center' }}>
|
|
40
|
+
<h1 style={{ margin: '0 0 16px 0', fontSize: '48px' }}>Flowing Gradient</h1>
|
|
41
|
+
<p style={{ margin: 0, fontSize: '20px' }}>Natural animated background</p>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</LinearGradientColorBgAnimation>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const FixedSize: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
width: '800px',
|
|
51
|
+
height: '300px',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const TallSize: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
width: '600px',
|
|
58
|
+
height: '600px',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { MemoizedMarkdown } from "../components/memoized-markdown";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Example/Chat/MemoizedMarkdown",
|
|
7
|
+
component: MemoizedMarkdown,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
id: "story-demo",
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof MemoizedMarkdown>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const PlainText: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
id: "plain-text",
|
|
23
|
+
content: "这是一段普通的文本内容,支持 **加粗** 和 *斜体* 等 Markdown 格式。",
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const CodeBlock: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
id: "code-block",
|
|
30
|
+
content: `
|
|
31
|
+
\`\`\`typescript
|
|
32
|
+
interface User {
|
|
33
|
+
name: string;
|
|
34
|
+
age: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function greet(user: User): string {
|
|
38
|
+
return \`Hello, \${user.name}!\`;
|
|
39
|
+
}
|
|
40
|
+
\`\`\`
|
|
41
|
+
`.trim(),
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const WithTable: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
id: "with-table",
|
|
48
|
+
content: `
|
|
49
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
50
|
+
|--------|------|------|------|
|
|
51
|
+
| name | string | 是 | 用户名称 |
|
|
52
|
+
| age | number | 否 | 用户年龄 |
|
|
53
|
+
| email | string | 是 | 电子邮箱 |
|
|
54
|
+
`.trim(),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const LongContent: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
id: "long-content",
|
|
61
|
+
content: `
|
|
62
|
+
## 表单分析
|
|
63
|
+
|
|
64
|
+
根据供应商管理逻辑设计表单,先填写供应商基础信息(ID、名称、联系人等),再通过子表单填写关联的产品信息。
|
|
65
|
+
|
|
66
|
+
### 核心字段
|
|
67
|
+
|
|
68
|
+
- **供应商ID**:唯一标识,必填
|
|
69
|
+
- **供应商名称**:企业全称,必填
|
|
70
|
+
- **联系人**:主要对接人,必填
|
|
71
|
+
- **联系电话**:手机或座机,必填
|
|
72
|
+
|
|
73
|
+
### 产品信息(子表单)
|
|
74
|
+
|
|
75
|
+
| 字段名 | 类型 | 说明 |
|
|
76
|
+
|--------|------|------|
|
|
77
|
+
| 产品名称 | string | 产品名称 |
|
|
78
|
+
| 型号 | string | 产品型号 |
|
|
79
|
+
| 单价 | number | 单位价格 |
|
|
80
|
+
|
|
81
|
+
> 核心字段均设为必填确保信息完整。试试下面建议吧!
|
|
82
|
+
`.trim(),
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const JSONCodeBlock: Story = {
|
|
87
|
+
args: {
|
|
88
|
+
id: "json-block",
|
|
89
|
+
content: `
|
|
90
|
+
\`\`\`json
|
|
91
|
+
{
|
|
92
|
+
"formName": "供应商信息表",
|
|
93
|
+
"version": "1.0.0",
|
|
94
|
+
"fields": [
|
|
95
|
+
{ "name": "supplierId", "type": "string", "required": true },
|
|
96
|
+
{ "name": "supplierName", "type": "string", "required": true }
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
\`\`\`
|
|
100
|
+
`.trim(),
|
|
101
|
+
},
|
|
102
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { MessageContent } from "../components/message-content";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Example/Chat/MessageContent",
|
|
7
|
+
component: MessageContent,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
args: {},
|
|
13
|
+
} satisfies Meta<typeof MessageContent>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
children: "这是一条来自 AI 助手的消息内容",
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const WithLongContent: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
children:
|
|
27
|
+
"这是一条比较长的消息内容,用于测试组件在长文本场景下的显示效果。AI 助手可能会返回较长的文本内容,需要确保排版正确。",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const WithCustomClassName: Story = {
|
|
32
|
+
args: {
|
|
33
|
+
children: "自定义样式的消息内容",
|
|
34
|
+
className: "bg-blue-50 px-3 py-2 rounded-lg",
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { NumbersMsgPart } from '../components/number-part';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Example/Chat/NumbersMsgPart',
|
|
7
|
+
component: NumbersMsgPart,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
fileName: '生产小工单.excel',
|
|
14
|
+
},
|
|
15
|
+
} satisfies Meta<typeof NumbersMsgPart>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
args: {},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Small: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
size: 80,
|
|
28
|
+
fileName: undefined,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const LongFileName: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
fileName: '这是一个非常长的文件名需要截断显示.xlsx',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const IconOnly: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
fileName: undefined,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { OfficeContainer } from "../components/office-container";
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof OfficeContainer> = {
|
|
6
|
+
title: "AI Office/OfficeContainer",
|
|
7
|
+
component: OfficeContainer,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "fullscreen",
|
|
11
|
+
},
|
|
12
|
+
decorators: [
|
|
13
|
+
(Story) => (
|
|
14
|
+
<div style={{ height: "100vh", width: "100vw", overflow: "hidden" }}>
|
|
15
|
+
<Story />
|
|
16
|
+
</div>
|
|
17
|
+
),
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default meta;
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
|
|
24
|
+
const PlaceholderHeader = ({
|
|
25
|
+
children,
|
|
26
|
+
// bg = "bg-blue-500",
|
|
27
|
+
}: {
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
bg?: string;
|
|
30
|
+
}) => (
|
|
31
|
+
<div className={`h-full w-full flex items-center px-4`}>
|
|
32
|
+
<span className="text-sm font-semibold">{children}</span>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const PlaceholderContent = ({
|
|
37
|
+
children,
|
|
38
|
+
bg = "bg-blue-50",
|
|
39
|
+
}: {
|
|
40
|
+
children: React.ReactNode;
|
|
41
|
+
bg?: string;
|
|
42
|
+
}) => (
|
|
43
|
+
<div className={`h-500 rounded-lg border-2 border-dashed border-gray-300 p-4 text-gray-500 ${bg} m-4`}>
|
|
44
|
+
{children}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
export const Base: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
headerHeight: 64,
|
|
51
|
+
leftColHeaderElement: <PlaceholderHeader>Left Header</PlaceholderHeader>,
|
|
52
|
+
leftColContentElement: (
|
|
53
|
+
<PlaceholderContent>Left Content (scrollable)</PlaceholderContent>
|
|
54
|
+
),
|
|
55
|
+
rightColHeaderElement: (
|
|
56
|
+
<PlaceholderHeader bg="bg-emerald-500">Right Header</PlaceholderHeader>
|
|
57
|
+
),
|
|
58
|
+
rightColContentElement: (
|
|
59
|
+
<PlaceholderContent bg="bg-emerald-50">
|
|
60
|
+
Right Content (scrollable)
|
|
61
|
+
</PlaceholderContent>
|
|
62
|
+
),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const CustomHeaderHeight: Story = {
|
|
67
|
+
args: {
|
|
68
|
+
headerHeight: 96,
|
|
69
|
+
leftColHeaderElement: (
|
|
70
|
+
<PlaceholderHeader>Left Header (96px)</PlaceholderHeader>
|
|
71
|
+
),
|
|
72
|
+
leftColContentElement: <PlaceholderContent>Left Content</PlaceholderContent>,
|
|
73
|
+
rightColHeaderElement: (
|
|
74
|
+
<PlaceholderHeader bg="bg-emerald-500">
|
|
75
|
+
Right Header (96px)
|
|
76
|
+
</PlaceholderHeader>
|
|
77
|
+
),
|
|
78
|
+
rightColContentElement: (
|
|
79
|
+
<PlaceholderContent bg="bg-emerald-50">Right Content</PlaceholderContent>
|
|
80
|
+
),
|
|
81
|
+
},
|
|
82
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { OptionItem } from "../components/option-item";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Example/Chat/OptionItem",
|
|
7
|
+
component: OptionItem,
|
|
8
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
12
|
+
layout: "centered",
|
|
13
|
+
},
|
|
14
|
+
args: {},
|
|
15
|
+
} satisfies Meta<typeof OptionItem>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Default: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
label: "选项",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const WithBgColor: Story = {
|
|
27
|
+
args: {
|
|
28
|
+
label: "单行文本",
|
|
29
|
+
bgColor: "#E8F4FF",
|
|
30
|
+
color: "#0265FF",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const RedVariant: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
label: "错误",
|
|
37
|
+
bgColor: "#FFEBEE",
|
|
38
|
+
color: "#D32F2F",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const GreenVariant: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
label: "成功",
|
|
45
|
+
bgColor: "#E8F5E9",
|
|
46
|
+
color: "#388E3C",
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const WithChildren: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
children: <span>使用children</span>,
|
|
53
|
+
bgColor: "#F3E5F5",
|
|
54
|
+
color: "#7B1FA2",
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const WithIcon: Story = {
|
|
59
|
+
args: {
|
|
60
|
+
label: (
|
|
61
|
+
<div className="flex items-center gap-1">
|
|
62
|
+
<span>✓</span>
|
|
63
|
+
<span>已选择</span>
|
|
64
|
+
</div>
|
|
65
|
+
),
|
|
66
|
+
bgColor: "#E8F5E9",
|
|
67
|
+
color: "#388E3C",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const CustomColor: Story = {
|
|
72
|
+
args: {
|
|
73
|
+
label: "自定义颜色",
|
|
74
|
+
bgColor: "#FFF8DC",
|
|
75
|
+
color: "#8B4513",
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { PreviewerHeader } from '../components/previewer-header';
|
|
3
|
+
import { TooltipProvider } from '@radix-ui/react-tooltip';
|
|
4
|
+
|
|
5
|
+
const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof PreviewerHeader> = {
|
|
8
|
+
title: 'Example/Chat/PreviewerHeader',
|
|
9
|
+
component: PreviewerHeader,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: 'centered',
|
|
13
|
+
},
|
|
14
|
+
decorators: [
|
|
15
|
+
(Story) => (
|
|
16
|
+
<TooltipProvider delayDuration={100}>
|
|
17
|
+
<Story />
|
|
18
|
+
</TooltipProvider>
|
|
19
|
+
),
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
|
|
25
|
+
export const Default: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
title: '编辑表单',
|
|
28
|
+
onSave: () => alert('保存点击'),
|
|
29
|
+
onCancel: () => alert('取消点击'),
|
|
30
|
+
style: { width: 700 },
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const ActiveMode: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
title: '编辑表单',
|
|
37
|
+
onSave: () => alert('保存点击'),
|
|
38
|
+
onCancel: () => alert('取消点击'),
|
|
39
|
+
style: { width: 700 },
|
|
40
|
+
active: true,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const WithTips: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
title: '编辑表单',
|
|
47
|
+
onSave: () => alert('保存点击'),
|
|
48
|
+
onCancel: () => alert('取消点击'),
|
|
49
|
+
style: { width: 700 },
|
|
50
|
+
active: true,
|
|
51
|
+
tips: 'AI生成内容可能不准确,请谨慎使用',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const DataVariant: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
title: '数据预览',
|
|
58
|
+
onSave: () => alert('保存点击'),
|
|
59
|
+
active: false,
|
|
60
|
+
style: { width: 700 },
|
|
61
|
+
variant: 'data-previewer',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const LoadingOnSave: Story = {
|
|
66
|
+
args: {
|
|
67
|
+
title: '编辑表单',
|
|
68
|
+
onSave: async () => {
|
|
69
|
+
await delay(2000);
|
|
70
|
+
alert('保存完成');
|
|
71
|
+
},
|
|
72
|
+
onCancel: () => alert('取消点击'),
|
|
73
|
+
style: { width: 700 },
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
export const ShowClear: Story = {
|
|
79
|
+
args: {
|
|
80
|
+
title: '编辑表单',
|
|
81
|
+
onClear: () => {
|
|
82
|
+
alert('清除点击');
|
|
83
|
+
},
|
|
84
|
+
onSave: async () => {
|
|
85
|
+
await delay(2000);
|
|
86
|
+
alert('保存完成');
|
|
87
|
+
},
|
|
88
|
+
onCancel: () => alert('取消点击'),
|
|
89
|
+
style: { width: 700 },
|
|
90
|
+
},
|
|
91
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { PrimaryConfirmBtn } from '../components/primary-confirm-btn';
|
|
4
|
+
import { MagicIcon } from '../components/bs-icons';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Example/Button/PrimaryConfirmBtn',
|
|
8
|
+
component: PrimaryConfirmBtn,
|
|
9
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
parameters: {
|
|
12
|
+
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
|
|
13
|
+
layout: 'centered',
|
|
14
|
+
},
|
|
15
|
+
args: {},
|
|
16
|
+
} satisfies Meta<typeof PrimaryConfirmBtn>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
text: '确认',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const Light: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
text: '直接添加',
|
|
30
|
+
light: true,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const Disabled: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
text: '已确认',
|
|
37
|
+
disabled: true,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const CustomText: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
text: '提交',
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const WithIcon: Story = {
|
|
48
|
+
args: {
|
|
49
|
+
text: '提交',
|
|
50
|
+
icon: <MagicIcon />,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const DisabledWithInfo: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
text: '已确认 6 条数据',
|
|
57
|
+
icon: <MagicIcon />,
|
|
58
|
+
disabledWithInfo: true,
|
|
59
|
+
},
|
|
60
|
+
};
|