@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,261 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
import { BsEntrySelect } from '../components/bs-entry-select';
|
|
4
|
+
import type { BsEntrySelectChangeResult } from '../components/bs-entry-select';
|
|
5
|
+
import type {
|
|
6
|
+
IAppDetail,
|
|
7
|
+
IEntryDetail,
|
|
8
|
+
IEntryAliasItem,
|
|
9
|
+
} from '@baishuyun/types';
|
|
10
|
+
|
|
11
|
+
type AppDetailEntryType = 'form' | 'dash' | 'report' | 'flow';
|
|
12
|
+
type AliasItemType = 'form' | 'dash' | 'group';
|
|
13
|
+
|
|
14
|
+
function makeEntry(
|
|
15
|
+
id: string,
|
|
16
|
+
name: string,
|
|
17
|
+
seq: number,
|
|
18
|
+
icon: number,
|
|
19
|
+
type: AppDetailEntryType = 'form',
|
|
20
|
+
): IEntryDetail {
|
|
21
|
+
return {
|
|
22
|
+
_id: id,
|
|
23
|
+
entryId: id,
|
|
24
|
+
name,
|
|
25
|
+
parent: '0',
|
|
26
|
+
seq,
|
|
27
|
+
icon,
|
|
28
|
+
type,
|
|
29
|
+
hasCoop: false,
|
|
30
|
+
hasFlow: false,
|
|
31
|
+
isEvent: false,
|
|
32
|
+
isFavorite: false,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function makeAlias(
|
|
37
|
+
parent: string,
|
|
38
|
+
type: AliasItemType,
|
|
39
|
+
): IEntryAliasItem {
|
|
40
|
+
return { formId: '', parent, type };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function makeAppDetail(
|
|
44
|
+
name: string,
|
|
45
|
+
aliasMap: Record<string, IEntryAliasItem>,
|
|
46
|
+
entryMap: Record<string, IEntryDetail>,
|
|
47
|
+
): IAppDetail {
|
|
48
|
+
return {
|
|
49
|
+
appType: 1,
|
|
50
|
+
dock_userid: '',
|
|
51
|
+
dock_username: '',
|
|
52
|
+
entryIdAliasMap: aliasMap,
|
|
53
|
+
entryList: Object.keys(entryMap).map((id) => ({ id })),
|
|
54
|
+
entryMap,
|
|
55
|
+
isFlow: false,
|
|
56
|
+
menu: null,
|
|
57
|
+
name,
|
|
58
|
+
status: 1,
|
|
59
|
+
timezone: { offset: 8, value: 'Asia/Shanghai' },
|
|
60
|
+
virtually_contacts_setting: false,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const mockAppDetails: Record<string, IAppDetail> = {
|
|
65
|
+
app1: makeAppDetail(
|
|
66
|
+
'客户管理',
|
|
67
|
+
{
|
|
68
|
+
entry1: makeAlias('0', 'form'),
|
|
69
|
+
entry2: makeAlias('0', 'form'),
|
|
70
|
+
group1: makeAlias('0', 'group'),
|
|
71
|
+
entry4: makeAlias('group1', 'form'),
|
|
72
|
+
entry6: makeAlias('group1', 'form'),
|
|
73
|
+
entry5: makeAlias('0', 'form'),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
entry1: makeEntry('entry1', '客户信息表', 1, 51),
|
|
77
|
+
entry2: makeEntry('entry2', '订单管理表', 2, 52),
|
|
78
|
+
group1: makeEntry('group1', '分组一', 3, 25),
|
|
79
|
+
entry4: makeEntry('entry4', '子表单A', 1, 53),
|
|
80
|
+
entry6: makeEntry('entry6', '子表单B', 2, 55),
|
|
81
|
+
entry5: makeEntry('entry5', '库存报表', 4, 54, 'report'),
|
|
82
|
+
},
|
|
83
|
+
),
|
|
84
|
+
app2: makeAppDetail(
|
|
85
|
+
'供应商管理',
|
|
86
|
+
{
|
|
87
|
+
entry7: makeAlias('0', 'form'),
|
|
88
|
+
entry8: makeAlias('0', 'form'),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
entry7: makeEntry('entry7', '供应商管理表', 1, 56),
|
|
92
|
+
entry8: makeEntry('entry8', '采购订单表', 2, 57),
|
|
93
|
+
},
|
|
94
|
+
),
|
|
95
|
+
app3: makeAppDetail(
|
|
96
|
+
'销售管理',
|
|
97
|
+
{
|
|
98
|
+
entry9: makeAlias('0', 'dash'),
|
|
99
|
+
entry10: makeAlias('0', 'form'),
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
entry9: makeEntry('entry9', '销售漏斗', 1, 58, 'dash'),
|
|
103
|
+
entry10: makeEntry('entry10', '合同审批流程', 2, 59, 'flow'),
|
|
104
|
+
},
|
|
105
|
+
),
|
|
106
|
+
app4: makeAppDetail(
|
|
107
|
+
'人事管理',
|
|
108
|
+
{
|
|
109
|
+
entry11: makeAlias('0', 'form'),
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
entry11: makeEntry('entry11', '考勤统计表', 1, 60, 'report'),
|
|
113
|
+
},
|
|
114
|
+
),
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const deepNestingAppDetails: Record<string, IAppDetail> = {
|
|
118
|
+
deep1: makeAppDetail(
|
|
119
|
+
'深层嵌套应用',
|
|
120
|
+
{
|
|
121
|
+
d1: makeAlias('0', 'form'),
|
|
122
|
+
group_d2: makeAlias('d1', 'group'),
|
|
123
|
+
d3: makeAlias('group_d2', 'form'),
|
|
124
|
+
group_d4: makeAlias('d3', 'group'),
|
|
125
|
+
d5: makeAlias('group_d4', 'form'),
|
|
126
|
+
d6: makeAlias('group_d2', 'form'),
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
d1: makeEntry('d1', '一级表单', 1, 51),
|
|
130
|
+
group_d2: makeEntry('group_d2', '二级分组', 1, 25),
|
|
131
|
+
d3: makeEntry('d3', '三级表单A', 1, 52),
|
|
132
|
+
group_d4: makeEntry('group_d4', '四级分组', 1, 25),
|
|
133
|
+
d5: makeEntry('d5', '五级表单', 1, 53),
|
|
134
|
+
d6: makeEntry('d6', '三级表单B', 2, 54),
|
|
135
|
+
},
|
|
136
|
+
),
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const emptyDetails: Record<string, IAppDetail> = {};
|
|
140
|
+
|
|
141
|
+
const meta: Meta<typeof BsEntrySelect> = {
|
|
142
|
+
title: 'AI Office/BsEntrySelect',
|
|
143
|
+
component: BsEntrySelect,
|
|
144
|
+
parameters: { layout: 'centered' },
|
|
145
|
+
args: {
|
|
146
|
+
appDetails: mockAppDetails,
|
|
147
|
+
currentAppId: 'app1',
|
|
148
|
+
placeholder: '请选择表单',
|
|
149
|
+
},
|
|
150
|
+
decorators: [
|
|
151
|
+
(Story) => (
|
|
152
|
+
<div style={{ padding: 60, minHeight: 400 }}>
|
|
153
|
+
<Story />
|
|
154
|
+
</div>
|
|
155
|
+
),
|
|
156
|
+
],
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export default meta;
|
|
160
|
+
type Story = StoryObj<typeof meta>;
|
|
161
|
+
|
|
162
|
+
export const Default: Story = {
|
|
163
|
+
args: {
|
|
164
|
+
appDetails: mockAppDetails,
|
|
165
|
+
currentAppId: 'app1',
|
|
166
|
+
placeholder: '请选择表单',
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const WithSelection: Story = {
|
|
171
|
+
args: {
|
|
172
|
+
appDetails: mockAppDetails,
|
|
173
|
+
currentAppId: 'app1',
|
|
174
|
+
defaultValue: 'entry1',
|
|
175
|
+
placeholder: '请选择表单',
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export const Open: Story = {
|
|
180
|
+
args: {
|
|
181
|
+
appDetails: mockAppDetails,
|
|
182
|
+
currentAppId: 'app1',
|
|
183
|
+
placeholder: '请选择表单',
|
|
184
|
+
},
|
|
185
|
+
play: async ({ canvasElement }) => {
|
|
186
|
+
const trigger = canvasElement.querySelector(
|
|
187
|
+
'[class*="rounded-[4px]"][class*="cursor-pointer"]',
|
|
188
|
+
) as HTMLElement;
|
|
189
|
+
if (trigger) trigger.click();
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export const DeepNesting: Story = {
|
|
194
|
+
args: {
|
|
195
|
+
appDetails: deepNestingAppDetails,
|
|
196
|
+
currentAppId: 'deep1',
|
|
197
|
+
placeholder: '请选择表单',
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export const Empty: Story = {
|
|
202
|
+
args: {
|
|
203
|
+
appDetails: emptyDetails,
|
|
204
|
+
currentAppId: undefined,
|
|
205
|
+
placeholder: '暂无可用表单',
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export const Disabled: Story = {
|
|
210
|
+
args: {
|
|
211
|
+
appDetails: mockAppDetails,
|
|
212
|
+
currentAppId: 'app1',
|
|
213
|
+
defaultValue: 'entry1',
|
|
214
|
+
placeholder: '请选择表单',
|
|
215
|
+
disabled: true,
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export const Interactive: Story = {
|
|
220
|
+
render: (args) => {
|
|
221
|
+
const [selected, setSelected] =
|
|
222
|
+
useState<BsEntrySelectChangeResult | null>(null);
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
|
|
226
|
+
<BsEntrySelect {...args} onChange={setSelected} />
|
|
227
|
+
{selected && (
|
|
228
|
+
<div
|
|
229
|
+
style={{
|
|
230
|
+
padding: 12,
|
|
231
|
+
background: '#F5F7FA',
|
|
232
|
+
borderRadius: 8,
|
|
233
|
+
fontSize: 14,
|
|
234
|
+
}}
|
|
235
|
+
>
|
|
236
|
+
<div>
|
|
237
|
+
<strong>选中条目:</strong> {selected.entry.name}
|
|
238
|
+
</div>
|
|
239
|
+
<div>
|
|
240
|
+
<strong>所属应用ID:</strong> {selected.appId}
|
|
241
|
+
</div>
|
|
242
|
+
<div>
|
|
243
|
+
<strong>所属分组:</strong> {selected.section === 'current' ? '当前应用表单' : '其他应用表单'}
|
|
244
|
+
</div>
|
|
245
|
+
<div>
|
|
246
|
+
<strong>条目ID:</strong> {selected.entry.entryId}
|
|
247
|
+
</div>
|
|
248
|
+
<div>
|
|
249
|
+
<strong>条目类型:</strong> {selected.entry.type}
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
)}
|
|
253
|
+
</div>
|
|
254
|
+
);
|
|
255
|
+
},
|
|
256
|
+
args: {
|
|
257
|
+
appDetails: mockAppDetails,
|
|
258
|
+
currentAppId: 'app1',
|
|
259
|
+
placeholder: '请选择表单',
|
|
260
|
+
},
|
|
261
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { BsTooltip } from '../components/tooltip';
|
|
4
|
+
import { TooltipProvider } from '../components/ui/tooltip';
|
|
5
|
+
import { IconBtn } from '../components/icon-btn';
|
|
6
|
+
import { ColorfulEditIcon } from '../components/bs-icons';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof BsTooltip> = {
|
|
9
|
+
title: 'Example/Chat/BsTooltip',
|
|
10
|
+
component: BsTooltip,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: 'centered',
|
|
14
|
+
},
|
|
15
|
+
decorators: [
|
|
16
|
+
(Story) => (
|
|
17
|
+
<TooltipProvider delayDuration={100}>
|
|
18
|
+
<Story />
|
|
19
|
+
</TooltipProvider>
|
|
20
|
+
),
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
26
|
+
|
|
27
|
+
export const Default: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
children: <IconBtn icon={<ColorfulEditIcon />} />,
|
|
30
|
+
content: '编辑消息',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { Card } from "../components/card";
|
|
4
|
+
import { UserIcon } from "../components/bs-icons";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Example/Chat/Card",
|
|
8
|
+
component: Card,
|
|
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 Card>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Base: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
title: "供应商管理,子表单为产品信息",
|
|
24
|
+
index: 1,
|
|
25
|
+
desc: "用于记录和管理企业供应商的基本信息、资质认证、合作状态等,便于采购部门进行供应商评估和选择。",
|
|
26
|
+
icon: <UserIcon />,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { CardField } from '../components/card-field';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof CardField> = {
|
|
6
|
+
title: 'Example/Chat/CardField',
|
|
7
|
+
component: CardField,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
args: {},
|
|
13
|
+
decorators: [
|
|
14
|
+
(Story) => (
|
|
15
|
+
<div className="w-[400px]">
|
|
16
|
+
<Story />
|
|
17
|
+
</div>
|
|
18
|
+
),
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof CardField>;
|
|
24
|
+
|
|
25
|
+
// 基础用法
|
|
26
|
+
export const Base: Story = {
|
|
27
|
+
args: {
|
|
28
|
+
label: '维度(行)',
|
|
29
|
+
children: '仓库、产品名称、产品编码、日期(年-月)',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// label 过长省略展示
|
|
34
|
+
export const LongLabel: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
label: '这是一个非常长的标签文字需要省略展示',
|
|
37
|
+
children: '内容区域',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// 无 children 时显示「无」
|
|
42
|
+
export const NoChildren: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
label: '空字段',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// children 为空字符串
|
|
49
|
+
export const EmptyChildren: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
label: '字段名称',
|
|
52
|
+
children: '',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// children 内容较长换行展示
|
|
57
|
+
export const LongContent: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
label: '详细描述',
|
|
60
|
+
children:
|
|
61
|
+
'这是一段很长的内容,用于测试换行效果。内容区域支持自动换行,确保文字不会溢出容器,保持良好的阅读体验。',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// 多个 CardField 组合使用
|
|
66
|
+
export const MultipleFields: Story = {
|
|
67
|
+
args: {
|
|
68
|
+
label: '维度(行)',
|
|
69
|
+
children: '仓库、产品名称、产品编码、日期(年-月)',
|
|
70
|
+
},
|
|
71
|
+
render: () => (
|
|
72
|
+
<div className="flex flex-col gap-2">
|
|
73
|
+
<CardField label="维度(行)">仓库、产品名称、产品编码、日期(年-月)</CardField>
|
|
74
|
+
<CardField label="维度(列)">产品类别</CardField>
|
|
75
|
+
<CardField label="指标">销售额、销售量、库存量</CardField>
|
|
76
|
+
<CardField label="筛选条件" />
|
|
77
|
+
</div>
|
|
78
|
+
),
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// children 为自定义 ReactNode
|
|
82
|
+
export const CustomChildren: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
label: '状态',
|
|
85
|
+
children: <span className="text-green-500 font-medium">已完成</span>,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
// import { Header } from "./Header";
|
|
4
|
+
import { ChatAreaHeader } from "../components/chat-area-header";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Example/Chat/ChatAreaHeader",
|
|
8
|
+
component: ChatAreaHeader,
|
|
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 ChatAreaHeader>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Base: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
title: "TEST",
|
|
24
|
+
width: 0,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import { CircleChecker } from '../components/circle-checker';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Example/Chat/CircleChecker',
|
|
8
|
+
component: CircleChecker,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered',
|
|
12
|
+
},
|
|
13
|
+
args: {},
|
|
14
|
+
} satisfies Meta<typeof CircleChecker>;
|
|
15
|
+
|
|
16
|
+
export default meta;
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
children: 'TEST',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Checked: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
defaultChecked: true,
|
|
28
|
+
children: 'TEST',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const Unchecked: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
defaultChecked: false,
|
|
35
|
+
children: 'TEST',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const WithoutLabel: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
defaultChecked: true,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Disabled: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
disabled: true,
|
|
48
|
+
children: 'Disabled',
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const DisabledChecked: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
disabled: true,
|
|
55
|
+
defaultChecked: true,
|
|
56
|
+
children: 'Disabled Checked',
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const ControlledComponent = () => {
|
|
61
|
+
const [checked, setChecked] = useState(false);
|
|
62
|
+
return (
|
|
63
|
+
<div className="flex flex-col gap-4">
|
|
64
|
+
<CircleChecker checked={checked} onCheckedChange={setChecked}>
|
|
65
|
+
Controlled: {checked ? 'Checked' : 'Unchecked'}
|
|
66
|
+
</CircleChecker>
|
|
67
|
+
<button
|
|
68
|
+
className="px-3 py-1 bg-gray-200 rounded text-sm"
|
|
69
|
+
onClick={() => setChecked(!checked)}
|
|
70
|
+
>
|
|
71
|
+
Toggle from outside
|
|
72
|
+
</button>
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const Controlled: Story = {
|
|
78
|
+
render: () => <ControlledComponent />,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const MultipleOptions: Story = {
|
|
82
|
+
render: () => (
|
|
83
|
+
<div className="flex flex-col gap-2">
|
|
84
|
+
<CircleChecker>Option A</CircleChecker>
|
|
85
|
+
<CircleChecker>Option B</CircleChecker>
|
|
86
|
+
<CircleChecker defaultChecked>Option C (default checked)</CircleChecker>
|
|
87
|
+
</div>
|
|
88
|
+
),
|
|
89
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { CollapsibleTxtMsg } from "../components/collapsible-txt-msg";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Example/Chat/CollapsibleTxtMsg",
|
|
7
|
+
component: CollapsibleTxtMsg,
|
|
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 CollapsibleTxtMsg>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Base: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
title: "表单分析",
|
|
23
|
+
content:
|
|
24
|
+
"一些文字描述,字段分析\n设计说明:表单按供应商管理逻辑设计,先填写供应商基础信息(ID、名称、联系人等),再通过子表单填写关联的产品信息(名称、型号、单价等),最后留备注补充。核心字段均设为必填确保信息完整。?试试下面建议吧!",
|
|
25
|
+
defaultOpen: true,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Collapsed: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
title: "表单分析",
|
|
32
|
+
content:
|
|
33
|
+
"一些文字描述,字段分析\n设计说明:表单按供应商管理逻辑设计,先填写供应商基础信息(ID、名称、联系人等),再通过子表单填写关联的产品信息(名称、型号、单价等),最后留备注补充。核心字段均设为必填确保信息完整。?试试下面建议吧!",
|
|
34
|
+
defaultOpen: false,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const ShortContent: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
title: "简短说明",
|
|
41
|
+
content: "这是一个简短的内容示例。",
|
|
42
|
+
defaultOpen: true,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { ConfirmDialog } from '../components/confirm-dialog';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Example/Chat/ConfirmDialog',
|
|
7
|
+
component: ConfirmDialog,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
},
|
|
12
|
+
args: {
|
|
13
|
+
open: true,
|
|
14
|
+
title: 'AI表单搭建有修改,是否保存?',
|
|
15
|
+
description: '您修改了AI表单搭建但没有保存,是否需要保存并继续?',
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
open: { control: 'boolean' },
|
|
19
|
+
title: { control: 'text' },
|
|
20
|
+
description: { control: 'text' },
|
|
21
|
+
linkText: { control: 'text' },
|
|
22
|
+
cancelText: { control: 'text' },
|
|
23
|
+
confirmText: { control: 'text' },
|
|
24
|
+
showLink: { control: 'boolean' },
|
|
25
|
+
showCancel: { control: 'boolean' },
|
|
26
|
+
onLinkClick: { action: 'onLinkClick' },
|
|
27
|
+
onCancel: { action: 'onCancel' },
|
|
28
|
+
onConfirm: { action: 'onConfirm' },
|
|
29
|
+
onOpenChange: { action: 'onOpenChange' },
|
|
30
|
+
},
|
|
31
|
+
} satisfies Meta<typeof ConfirmDialog>;
|
|
32
|
+
|
|
33
|
+
export default meta;
|
|
34
|
+
type Story = StoryObj<typeof meta>;
|
|
35
|
+
|
|
36
|
+
// Default story matching the Figma design
|
|
37
|
+
export const Default: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
open: true,
|
|
40
|
+
title: 'AI表单搭建有修改,是否保存?',
|
|
41
|
+
description: '您修改了AI表单搭建但没有保存,是否需要保存并继续?',
|
|
42
|
+
linkText: '留在此页',
|
|
43
|
+
cancelText: '不保存',
|
|
44
|
+
confirmText: '保存并继续',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// Without link button
|
|
49
|
+
export const WithoutLink: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
open: true,
|
|
52
|
+
title: '确认删除?',
|
|
53
|
+
description: '删除后将无法恢复,请确认是否继续。',
|
|
54
|
+
showLink: false,
|
|
55
|
+
cancelText: '取消',
|
|
56
|
+
confirmText: '删除',
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// Without cancel button
|
|
61
|
+
export const WithoutCancel: Story = {
|
|
62
|
+
args: {
|
|
63
|
+
open: true,
|
|
64
|
+
title: '操作成功',
|
|
65
|
+
description: '您的更改已保存。',
|
|
66
|
+
showLink: false,
|
|
67
|
+
showCancel: false,
|
|
68
|
+
confirmText: '确定',
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Simple confirmation
|
|
73
|
+
export const SimpleConfirm: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
open: true,
|
|
76
|
+
title: '确认退出?',
|
|
77
|
+
description: '退出后未保存的内容将会丢失。',
|
|
78
|
+
showLink: false,
|
|
79
|
+
cancelText: '取消',
|
|
80
|
+
confirmText: '确认退出',
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// Interactive example with state management
|
|
85
|
+
const InteractiveDialogWrapper = () => {
|
|
86
|
+
const [open, setOpen] = useState(false);
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div>
|
|
90
|
+
<button
|
|
91
|
+
onClick={() => setOpen(true)}
|
|
92
|
+
className="px-4 py-2 bg-[#0265ff] text-white rounded cursor-pointer"
|
|
93
|
+
>
|
|
94
|
+
打开对话框
|
|
95
|
+
</button>
|
|
96
|
+
<ConfirmDialog
|
|
97
|
+
open={open}
|
|
98
|
+
onOpenChange={setOpen}
|
|
99
|
+
title="AI表单搭建有修改,是否保存?"
|
|
100
|
+
description="您修改了AI表单搭建但没有保存,是否需要保存并继续?"
|
|
101
|
+
onLinkClick={() => {
|
|
102
|
+
console.log('Link clicked');
|
|
103
|
+
setOpen(false);
|
|
104
|
+
}}
|
|
105
|
+
onCancel={() => {
|
|
106
|
+
console.log('Cancel clicked');
|
|
107
|
+
setOpen(false);
|
|
108
|
+
}}
|
|
109
|
+
onConfirm={() => {
|
|
110
|
+
console.log('Confirm clicked');
|
|
111
|
+
setOpen(false);
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
114
|
+
</div>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const Interactive: Story = {
|
|
119
|
+
render: () => <InteractiveDialogWrapper />,
|
|
120
|
+
args: {
|
|
121
|
+
open: false,
|
|
122
|
+
},
|
|
123
|
+
};
|