@baishuyun/chat-sdk 0.0.1-alpha.1
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 +21 -0
- package/.storybook/preview-head.html +1 -0
- package/.storybook/preview.ts +16 -0
- package/.turbo/turbo-build.log +82 -0
- package/components.json +22 -0
- package/dist/chat-sdk.js +55613 -0
- package/dist/chat-sdk.js.map +1 -0
- package/dist/chat-sdk.umd.cjs +661 -0
- package/dist/chat-sdk.umd.cjs.map +1 -0
- package/dist/chat.d.ts +5 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/components/biz-comp/FakeBotMsg.d.ts +7 -0
- package/dist/components/biz-comp/FakeBotMsg.d.ts.map +1 -0
- package/dist/components/biz-comp/FieldChecker.d.ts +16 -0
- package/dist/components/biz-comp/FieldChecker.d.ts.map +1 -0
- package/dist/components/biz-comp/FieldCheckerListMsg.d.ts +12 -0
- package/dist/components/biz-comp/FieldCheckerListMsg.d.ts.map +1 -0
- package/dist/components/biz-comp/FieldValueChecker.d.ts +14 -0
- package/dist/components/biz-comp/FieldValueChecker.d.ts.map +1 -0
- package/dist/components/biz-comp/SubformFieldsValueChecker.d.ts +20 -0
- package/dist/components/biz-comp/SubformFieldsValueChecker.d.ts.map +1 -0
- package/dist/components/biz-comp/chat-client.d.ts +13 -0
- package/dist/components/biz-comp/chat-client.d.ts.map +1 -0
- package/dist/components/biz-comp/chat-frame.d.ts +6 -0
- package/dist/components/biz-comp/chat-frame.d.ts.map +1 -0
- package/dist/components/biz-comp/conversation.d.ts +10 -0
- package/dist/components/biz-comp/conversation.d.ts.map +1 -0
- package/dist/components/biz-comp/dock-btn.d.ts +2 -0
- package/dist/components/biz-comp/dock-btn.d.ts.map +1 -0
- package/dist/components/biz-comp/field-icon.d.ts +5 -0
- package/dist/components/biz-comp/field-icon.d.ts.map +1 -0
- package/dist/components/biz-comp/markdown-part.d.ts +5 -0
- package/dist/components/biz-comp/markdown-part.d.ts.map +1 -0
- package/dist/components/biz-comp/markdown.d.ts +5 -0
- package/dist/components/biz-comp/markdown.d.ts.map +1 -0
- package/dist/components/biz-comp/message-content.d.ts +6 -0
- package/dist/components/biz-comp/message-content.d.ts.map +1 -0
- package/dist/components/biz-comp/messages.d.ts +3 -0
- package/dist/components/biz-comp/messages.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/attachment-btn.d.ts +9 -0
- package/dist/components/biz-comp/multi-modal-input/attachment-btn.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/clear-btn.d.ts +7 -0
- package/dist/components/biz-comp/multi-modal-input/clear-btn.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/index.d.ts +21 -0
- package/dist/components/biz-comp/multi-modal-input/index.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/preview-attachment.d.ts +12 -0
- package/dist/components/biz-comp/multi-modal-input/preview-attachment.d.ts.map +1 -0
- package/dist/components/biz-comp/multi-modal-input/prompt-input.d.ts +35 -0
- package/dist/components/biz-comp/multi-modal-input/prompt-input.d.ts.map +1 -0
- package/dist/components/biz-comp/opening-lines.d.ts +3 -0
- package/dist/components/biz-comp/opening-lines.d.ts.map +1 -0
- package/dist/components/biz-comp/preview-message-wrapper.d.ts +9 -0
- package/dist/components/biz-comp/preview-message-wrapper.d.ts.map +1 -0
- package/dist/components/biz-comp/preview-message.d.ts +11 -0
- package/dist/components/biz-comp/preview-message.d.ts.map +1 -0
- package/dist/components/biz-comp/response.d.ts +6 -0
- package/dist/components/biz-comp/response.d.ts.map +1 -0
- package/dist/components/biz-comp/suggestions.d.ts +7 -0
- package/dist/components/biz-comp/suggestions.d.ts.map +1 -0
- package/dist/components/bs-ui/abs-fullscreen-gradient-bg.d.ts +9 -0
- package/dist/components/bs-ui/abs-fullscreen-gradient-bg.d.ts.map +1 -0
- package/dist/components/bs-ui/attachments-previewer.d.ts +15 -0
- package/dist/components/bs-ui/attachments-previewer.d.ts.map +1 -0
- package/dist/components/bs-ui/border-color-animation.d.ts +9 -0
- package/dist/components/bs-ui/border-color-animation.d.ts.map +1 -0
- package/dist/components/bs-ui/bot-avatar-name.d.ts +6 -0
- package/dist/components/bs-ui/bot-avatar-name.d.ts.map +1 -0
- package/dist/components/bs-ui/bot-icon.d.ts +5 -0
- package/dist/components/bs-ui/bot-icon.d.ts.map +1 -0
- package/dist/components/bs-ui/bs-icons.d.ts +39 -0
- package/dist/components/bs-ui/bs-icons.d.ts.map +1 -0
- package/dist/components/bs-ui/card.d.ts +10 -0
- package/dist/components/bs-ui/card.d.ts.map +1 -0
- package/dist/components/bs-ui/chat-area-header.d.ts +9 -0
- package/dist/components/bs-ui/chat-area-header.d.ts.map +1 -0
- package/dist/components/bs-ui/collapsible-txt-msg.d.ts +10 -0
- package/dist/components/bs-ui/collapsible-txt-msg.d.ts.map +1 -0
- package/dist/components/bs-ui/confirm-dialog.d.ts +26 -0
- package/dist/components/bs-ui/confirm-dialog.d.ts.map +1 -0
- package/dist/components/bs-ui/fields-generating-indicator.d.ts +2 -0
- package/dist/components/bs-ui/fields-generating-indicator.d.ts.map +1 -0
- package/dist/components/bs-ui/fields-portal.d.ts +8 -0
- package/dist/components/bs-ui/fields-portal.d.ts.map +1 -0
- package/dist/components/bs-ui/fields-previewer.d.ts +12 -0
- package/dist/components/bs-ui/fields-previewer.d.ts.map +1 -0
- package/dist/components/bs-ui/font-icon.d.ts +6 -0
- package/dist/components/bs-ui/font-icon.d.ts.map +1 -0
- package/dist/components/bs-ui/form-info-editor.d.ts +37 -0
- package/dist/components/bs-ui/form-info-editor.d.ts.map +1 -0
- package/dist/components/bs-ui/generate-animation.d.ts +4 -0
- package/dist/components/bs-ui/generate-animation.d.ts.map +1 -0
- package/dist/components/bs-ui/icon-btn.d.ts +7 -0
- package/dist/components/bs-ui/icon-btn.d.ts.map +1 -0
- package/dist/components/bs-ui/line-checker.d.ts +15 -0
- package/dist/components/bs-ui/line-checker.d.ts.map +1 -0
- package/dist/components/bs-ui/linear-gradient-border-btn.d.ts +10 -0
- package/dist/components/bs-ui/linear-gradient-border-btn.d.ts.map +1 -0
- package/dist/components/bs-ui/linear-gradient-color-bg-animation.d.ts +8 -0
- package/dist/components/bs-ui/linear-gradient-color-bg-animation.d.ts.map +1 -0
- package/dist/components/bs-ui/option-item.d.ts +9 -0
- package/dist/components/bs-ui/option-item.d.ts.map +1 -0
- package/dist/components/bs-ui/previewer-header.d.ts +13 -0
- package/dist/components/bs-ui/previewer-header.d.ts.map +1 -0
- package/dist/components/bs-ui/primary-confirm-btn.d.ts +7 -0
- package/dist/components/bs-ui/primary-confirm-btn.d.ts.map +1 -0
- package/dist/components/bs-ui/primary-entry-btn.d.ts +9 -0
- package/dist/components/bs-ui/primary-entry-btn.d.ts.map +1 -0
- package/dist/components/bs-ui/tab-radio-group.d.ts +16 -0
- package/dist/components/bs-ui/tab-radio-group.d.ts.map +1 -0
- package/dist/components/bs-ui/tooltip.d.ts +5 -0
- package/dist/components/bs-ui/tooltip.d.ts.map +1 -0
- package/dist/components/bs-ui/user-txt-msg-bubble.d.ts +6 -0
- package/dist/components/bs-ui/user-txt-msg-bubble.d.ts.map +1 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/card.d.ts +9 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +24 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/icons.d.ts +176 -0
- package/dist/components/ui/icons.d.ts.map +1 -0
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/one-time-click-btn.d.ts +4 -0
- package/dist/components/ui/one-time-click-btn.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/web-comp/fields-previewer-web-component.d.ts +61 -0
- package/dist/components/web-comp/fields-previewer-web-component.d.ts.map +1 -0
- package/dist/const/index.d.ts +4 -0
- package/dist/const/index.d.ts.map +1 -0
- package/dist/const/ui.d.ts +4 -0
- package/dist/const/ui.d.ts.map +1 -0
- package/dist/hooks/use-evt-bus.d.ts +2 -0
- package/dist/hooks/use-evt-bus.d.ts.map +1 -0
- package/dist/hooks/use-evt.d.ts +3 -0
- package/dist/hooks/use-evt.d.ts.map +1 -0
- package/dist/hooks/use-frame-mode.d.ts +5 -0
- package/dist/hooks/use-frame-mode.d.ts.map +1 -0
- package/dist/hooks/use-plugin-component.d.ts +5 -0
- package/dist/hooks/use-plugin-component.d.ts.map +1 -0
- package/dist/hooks/use-plugin-ctx.d.ts +3 -0
- package/dist/hooks/use-plugin-ctx.d.ts.map +1 -0
- package/dist/hooks/use-plugin-custom-components.d.ts +4 -0
- package/dist/hooks/use-plugin-custom-components.d.ts.map +1 -0
- package/dist/hooks/use-plugin-life-cycle-chain-runner.d.ts +5 -0
- package/dist/hooks/use-plugin-life-cycle-chain-runner.d.ts.map +1 -0
- package/dist/hooks/use-plugin-list.d.ts +2 -0
- package/dist/hooks/use-plugin-list.d.ts.map +1 -0
- package/dist/hooks/use-plugin.d.ts +2 -0
- package/dist/hooks/use-plugin.d.ts.map +1 -0
- package/dist/hooks/use-shadow.d.ts +25 -0
- package/dist/hooks/use-shadow.d.ts.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/event-emitter.d.ts +39 -0
- package/dist/lib/event-emitter.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +30 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/plugins/form-builder-base-plugin/const.d.ts +3 -0
- package/dist/plugins/form-builder-base-plugin/const.d.ts.map +1 -0
- package/dist/plugins/form-builder-base-plugin/index.d.ts +7 -0
- package/dist/plugins/form-builder-base-plugin/index.d.ts.map +1 -0
- package/dist/plugins/form-builder-base-plugin/types.d.ts +12 -0
- package/dist/plugins/form-builder-base-plugin/types.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts +2 -0
- package/dist/plugins/form-filling-plugin/components/FormFillingOpeningLines.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/components/avatar.d.ts +5 -0
- package/dist/plugins/form-filling-plugin/components/avatar.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/components/entry-btn.d.ts +3 -0
- package/dist/plugins/form-filling-plugin/components/entry-btn.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/components/msg-part.d.ts +3 -0
- package/dist/plugins/form-filling-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/const.d.ts +612 -0
- package/dist/plugins/form-filling-plugin/const.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/index.d.ts +13 -0
- package/dist/plugins/form-filling-plugin/index.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/types.d.ts +8 -0
- package/dist/plugins/form-filling-plugin/types.d.ts.map +1 -0
- package/dist/plugins/form-filling-plugin/utils.d.ts +4 -0
- package/dist/plugins/form-filling-plugin/utils.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/components/confirmer.d.ts +9 -0
- package/dist/plugins/general-model-form-builder-plugin/components/confirmer.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/components/ghost-evt-dispatcher.d.ts +10 -0
- package/dist/plugins/general-model-form-builder-plugin/components/ghost-evt-dispatcher.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/components/msg-part.d.ts +3 -0
- package/dist/plugins/general-model-form-builder-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/components/new-confirmer.d.ts +10 -0
- package/dist/plugins/general-model-form-builder-plugin/components/new-confirmer.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/const.d.ts +3 -0
- package/dist/plugins/general-model-form-builder-plugin/const.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/index.d.ts +9 -0
- package/dist/plugins/general-model-form-builder-plugin/index.d.ts.map +1 -0
- package/dist/plugins/general-model-form-builder-plugin/types.d.ts +3 -0
- package/dist/plugins/general-model-form-builder-plugin/types.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/components/create-form-confirm.d.ts +7 -0
- package/dist/plugins/mcp-form-builder-plugin/components/create-form-confirm.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/components/entry-btn.d.ts +3 -0
- package/dist/plugins/mcp-form-builder-plugin/components/entry-btn.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/components/follow-up.d.ts +3 -0
- package/dist/plugins/mcp-form-builder-plugin/components/follow-up.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/components/msg-part.d.ts +3 -0
- package/dist/plugins/mcp-form-builder-plugin/components/msg-part.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/const/index.d.ts +12 -0
- package/dist/plugins/mcp-form-builder-plugin/const/index.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/hooks/index.d.ts +1 -0
- package/dist/plugins/mcp-form-builder-plugin/hooks/index.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/hooks/use-fields-confirmed.d.ts +2 -0
- package/dist/plugins/mcp-form-builder-plugin/hooks/use-fields-confirmed.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/index.d.ts +23 -0
- package/dist/plugins/mcp-form-builder-plugin/index.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/types.d.ts +17 -0
- package/dist/plugins/mcp-form-builder-plugin/types.d.ts.map +1 -0
- package/dist/plugins/mcp-form-builder-plugin/utils/index.d.ts +51 -0
- package/dist/plugins/mcp-form-builder-plugin/utils/index.d.ts.map +1 -0
- package/dist/sdk.impl.d.ts +21 -0
- package/dist/sdk.impl.d.ts.map +1 -0
- package/dist/store/context.d.ts +12 -0
- package/dist/store/context.d.ts.map +1 -0
- package/dist/store/index.d.ts +13 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/stories/AbsFullscreenGradientBg.stories.d.ts +17 -0
- package/dist/stories/AbsFullscreenGradientBg.stories.d.ts.map +1 -0
- package/dist/stories/AttachmentsPreviewer.stories.d.ts +16 -0
- package/dist/stories/AttachmentsPreviewer.stories.d.ts.map +1 -0
- package/dist/stories/BorderColorAnimation.stories.d.ts +24 -0
- package/dist/stories/BorderColorAnimation.stories.d.ts.map +1 -0
- package/dist/stories/BotAvatarAndName.stories.d.ts +18 -0
- package/dist/stories/BotAvatarAndName.stories.d.ts.map +1 -0
- package/dist/stories/BotIcon.stories.d.ts +17 -0
- package/dist/stories/BotIcon.stories.d.ts.map +1 -0
- package/dist/stories/BsTooltip.stories.d.ts +7 -0
- package/dist/stories/BsTooltip.stories.d.ts.map +1 -0
- package/dist/stories/Card.stories.d.ts +14 -0
- package/dist/stories/Card.stories.d.ts.map +1 -0
- package/dist/stories/ChatAreaHeader.stories.d.ts +14 -0
- package/dist/stories/ChatAreaHeader.stories.d.ts.map +1 -0
- package/dist/stories/CollapsibleTextMsg.stories.d.ts +16 -0
- package/dist/stories/CollapsibleTextMsg.stories.d.ts.map +1 -0
- package/dist/stories/ConfirmDialog.stories.d.ts +61 -0
- package/dist/stories/ConfirmDialog.stories.d.ts.map +1 -0
- package/dist/stories/FormInfoEditor.stories.d.ts +15 -0
- package/dist/stories/FormInfoEditor.stories.d.ts.map +1 -0
- package/dist/stories/GenerateAnimation.stories.d.ts +16 -0
- package/dist/stories/GenerateAnimation.stories.d.ts.map +1 -0
- package/dist/stories/IconBtn.stories.d.ts +14 -0
- package/dist/stories/IconBtn.stories.d.ts.map +1 -0
- package/dist/stories/IconLib.d.ts +12 -0
- package/dist/stories/IconLib.d.ts.map +1 -0
- package/dist/stories/Icons.stories.d.ts +24 -0
- package/dist/stories/Icons.stories.d.ts.map +1 -0
- package/dist/stories/LineChecker.stories.d.ts +23 -0
- package/dist/stories/LineChecker.stories.d.ts.map +1 -0
- package/dist/stories/LinearGradientBorderBtn.stories.d.ts +22 -0
- package/dist/stories/LinearGradientBorderBtn.stories.d.ts.map +1 -0
- package/dist/stories/LinearGradientColorBgAnimation.stories.d.ts +23 -0
- package/dist/stories/LinearGradientColorBgAnimation.stories.d.ts.map +1 -0
- package/dist/stories/OptionItem.stories.d.ts +20 -0
- package/dist/stories/OptionItem.stories.d.ts.map +1 -0
- package/dist/stories/PreviewerHeader.stories.d.ts +9 -0
- package/dist/stories/PreviewerHeader.stories.d.ts.map +1 -0
- package/dist/stories/PrimaryConfirmBtn.stories.d.ts +16 -0
- package/dist/stories/PrimaryConfirmBtn.stories.d.ts.map +1 -0
- package/dist/stories/PrimaryEntryBtn.stories.d.ts +26 -0
- package/dist/stories/PrimaryEntryBtn.stories.d.ts.map +1 -0
- package/dist/stories/TabRadioGroup.stories.d.ts +18 -0
- package/dist/stories/TabRadioGroup.stories.d.ts.map +1 -0
- package/dist/stories/UserTextMsgBubble.stories.d.ts +14 -0
- package/dist/stories/UserTextMsgBubble.stories.d.ts.map +1 -0
- package/dist/stories/fields-generating.stories.d.ts +14 -0
- package/dist/stories/fields-generating.stories.d.ts.map +1 -0
- package/dist/stories/fields-previewer.stories.d.ts +18 -0
- package/dist/stories/fields-previewer.stories.d.ts.map +1 -0
- package/package.json +76 -0
- package/scripts/inline-style-inject.ts +36 -0
- package/src/chat.tsx +56 -0
- package/src/components/biz-comp/FakeBotMsg.tsx +52 -0
- package/src/components/biz-comp/FieldChecker.tsx +114 -0
- package/src/components/biz-comp/FieldCheckerListMsg.tsx +34 -0
- package/src/components/biz-comp/FieldValueChecker.tsx +98 -0
- package/src/components/biz-comp/SubformFieldsValueChecker.tsx +166 -0
- package/src/components/biz-comp/chat-client.tsx +206 -0
- package/src/components/biz-comp/chat-frame.tsx +25 -0
- package/src/components/biz-comp/conversation.tsx +70 -0
- package/src/components/biz-comp/dock-btn.tsx +52 -0
- package/src/components/biz-comp/field-icon.tsx +8 -0
- package/src/components/biz-comp/markdown-part.tsx +48 -0
- package/src/components/biz-comp/markdown.tsx +36 -0
- package/src/components/biz-comp/message-content.tsx +21 -0
- package/src/components/biz-comp/messages.tsx +42 -0
- package/src/components/biz-comp/multi-modal-input/attachment-btn.tsx +30 -0
- package/src/components/biz-comp/multi-modal-input/clear-btn.tsx +42 -0
- package/src/components/biz-comp/multi-modal-input/index.tsx +422 -0
- package/src/components/biz-comp/multi-modal-input/preview-attachment.tsx +72 -0
- package/src/components/biz-comp/multi-modal-input/prompt-input.tsx +260 -0
- package/src/components/biz-comp/opening-lines.tsx +34 -0
- package/src/components/biz-comp/preview-message-wrapper.tsx +55 -0
- package/src/components/biz-comp/preview-message.tsx +91 -0
- package/src/components/biz-comp/response.tsx +23 -0
- package/src/components/biz-comp/suggestions.tsx +78 -0
- package/src/components/bs-ui/abs-fullscreen-gradient-bg.tsx +34 -0
- package/src/components/bs-ui/attachments-previewer.tsx +229 -0
- package/src/components/bs-ui/border-color-animation.tsx +58 -0
- package/src/components/bs-ui/bot-avatar-name.tsx +25 -0
- package/src/components/bs-ui/bot-icon.tsx +23 -0
- package/src/components/bs-ui/bs-icons.tsx +801 -0
- package/src/components/bs-ui/card.tsx +37 -0
- package/src/components/bs-ui/chat-area-header.tsx +41 -0
- package/src/components/bs-ui/collapsible-txt-msg.tsx +50 -0
- package/src/components/bs-ui/confirm-dialog.tsx +128 -0
- package/src/components/bs-ui/fields-generating-indicator.tsx +50 -0
- package/src/components/bs-ui/fields-portal.tsx +18 -0
- package/src/components/bs-ui/fields-previewer.tsx +109 -0
- package/src/components/bs-ui/font-icon.tsx +17 -0
- package/src/components/bs-ui/form-info-editor.tsx +286 -0
- package/src/components/bs-ui/generate-animation.tsx +54 -0
- package/src/components/bs-ui/icon-btn.tsx +31 -0
- package/src/components/bs-ui/line-checker.tsx +129 -0
- package/src/components/bs-ui/linear-gradient-border-btn.tsx +48 -0
- package/src/components/bs-ui/linear-gradient-color-bg-animation.tsx +103 -0
- package/src/components/bs-ui/option-item.tsx +28 -0
- package/src/components/bs-ui/previewer-header.tsx +134 -0
- package/src/components/bs-ui/primary-confirm-btn.tsx +46 -0
- package/src/components/bs-ui/primary-entry-btn.tsx +37 -0
- package/src/components/bs-ui/tab-radio-group.tsx +73 -0
- package/src/components/bs-ui/tooltip.tsx +18 -0
- package/src/components/bs-ui/user-txt-msg-bubble.tsx +19 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/button.tsx +51 -0
- package/src/components/ui/card.tsx +76 -0
- package/src/components/ui/checkbox.tsx +29 -0
- package/src/components/ui/collapsible.tsx +9 -0
- package/src/components/ui/dialog.tsx +104 -0
- package/src/components/ui/dropdown-menu.tsx +199 -0
- package/src/components/ui/icons.tsx +1288 -0
- package/src/components/ui/input-group.tsx +172 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/one-time-click-btn.tsx +32 -0
- package/src/components/ui/select.tsx +157 -0
- package/src/components/ui/spinner.tsx +17 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.tsx +22 -0
- package/src/components/ui/tooltip.tsx +34 -0
- package/src/components/web-comp/fields-previewer-web-component.ts +259 -0
- package/src/const/index.ts +61 -0
- package/src/const/ui.ts +7 -0
- package/src/global.d.ts +1 -0
- package/src/hooks/use-evt-bus.ts +11 -0
- package/src/hooks/use-evt.ts +17 -0
- package/src/hooks/use-frame-mode.ts +13 -0
- package/src/hooks/use-plugin-component.ts +12 -0
- package/src/hooks/use-plugin-ctx.ts +12 -0
- package/src/hooks/use-plugin-custom-components.ts +31 -0
- package/src/hooks/use-plugin-life-cycle-chain-runner.ts +26 -0
- package/src/hooks/use-plugin-list.ts +11 -0
- package/src/hooks/use-plugin.ts +11 -0
- package/src/hooks/use-shadow.ts +128 -0
- package/src/index.tsx +10 -0
- package/src/lib/event-emitter.ts +93 -0
- package/src/lib/utils.ts +222 -0
- package/src/plugins/form-builder-base-plugin/const.ts +27 -0
- package/src/plugins/form-builder-base-plugin/index.ts +45 -0
- package/src/plugins/form-builder-base-plugin/types.ts +13 -0
- package/src/plugins/form-filling-plugin/components/FormFillingOpeningLines.tsx +3 -0
- package/src/plugins/form-filling-plugin/components/avatar.tsx +14 -0
- package/src/plugins/form-filling-plugin/components/entry-btn.tsx +15 -0
- package/src/plugins/form-filling-plugin/components/msg-part.tsx +90 -0
- package/src/plugins/form-filling-plugin/const.ts +595 -0
- package/src/plugins/form-filling-plugin/index.ts +135 -0
- package/src/plugins/form-filling-plugin/types.ts +11 -0
- package/src/plugins/form-filling-plugin/utils.ts +63 -0
- package/src/plugins/general-model-form-builder-plugin/components/confirmer.tsx +90 -0
- package/src/plugins/general-model-form-builder-plugin/components/ghost-evt-dispatcher.tsx +69 -0
- package/src/plugins/general-model-form-builder-plugin/components/msg-part.tsx +147 -0
- package/src/plugins/general-model-form-builder-plugin/components/new-confirmer.tsx +191 -0
- package/src/plugins/general-model-form-builder-plugin/const.ts +3 -0
- package/src/plugins/general-model-form-builder-plugin/index.ts +20 -0
- package/src/plugins/general-model-form-builder-plugin/types.ts +1 -0
- package/src/plugins/mcp-form-builder-plugin/components/create-form-confirm.tsx +126 -0
- package/src/plugins/mcp-form-builder-plugin/components/entry-btn.tsx +9 -0
- package/src/plugins/mcp-form-builder-plugin/components/follow-up.tsx +15 -0
- package/src/plugins/mcp-form-builder-plugin/components/msg-part.tsx +135 -0
- package/src/plugins/mcp-form-builder-plugin/const/index.ts +13 -0
- package/src/plugins/mcp-form-builder-plugin/hooks/index.ts +0 -0
- package/src/plugins/mcp-form-builder-plugin/hooks/use-fields-confirmed.ts +12 -0
- package/src/plugins/mcp-form-builder-plugin/index.ts +225 -0
- package/src/plugins/mcp-form-builder-plugin/types.ts +21 -0
- package/src/plugins/mcp-form-builder-plugin/utils/index.ts +450 -0
- package/src/sdk.impl.tsx +108 -0
- package/src/store/context.tsx +22 -0
- package/src/store/index.ts +53 -0
- package/src/stories/AbsFullscreenGradientBg.stories.tsx +36 -0
- package/src/stories/AttachmentsPreviewer.stories.tsx +188 -0
- package/src/stories/BorderColorAnimation.stories.tsx +60 -0
- package/src/stories/BotAvatarAndName.stories.ts +24 -0
- package/src/stories/BotIcon.stories.ts +22 -0
- package/src/stories/BsTooltip.stories.tsx +32 -0
- package/src/stories/Card.stories.tsx +28 -0
- package/src/stories/ChatAreaHeader.stories.ts +26 -0
- package/src/stories/CollapsibleTextMsg.stories.ts +44 -0
- package/src/stories/ConfirmDialog.stories.tsx +123 -0
- package/src/stories/FormInfoEditor.stories.tsx +183 -0
- package/src/stories/GenerateAnimation.stories.ts +20 -0
- package/src/stories/IconBtn.stories.tsx +26 -0
- package/src/stories/IconLib.tsx +47 -0
- package/src/stories/Icons.stories.ts +22 -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/OptionItem.stories.tsx +77 -0
- package/src/stories/PreviewerHeader.stories.tsx +45 -0
- package/src/stories/PrimaryConfirmBtn.stories.ts +37 -0
- package/src/stories/PrimaryEntryBtn.stories.tsx +74 -0
- package/src/stories/TabRadioGroup.stories.tsx +84 -0
- package/src/stories/UserTextMsgBubble.stories.ts +24 -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-generating.stories.tsx +22 -0
- package/src/stories/fields-previewer.stories.tsx +67 -0
- package/src/style.css +172 -0
- package/stats.html +4949 -0
- package/tailwind.config.js +49 -0
- package/tsconfig.json +13 -0
- package/vite.config.ts +38 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { AttachmentsPreviewer, AttachmentItem } from '@/components/bs-ui/attachments-previewer';
|
|
4
|
+
|
|
5
|
+
const sampleImages: AttachmentItem[] = [
|
|
6
|
+
{
|
|
7
|
+
id: '1',
|
|
8
|
+
url: 'https://images.unsplash.com/photo-1509042239860-f550ce710b93?w=200&h=200&fit=crop',
|
|
9
|
+
alt: 'Coffee',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: '2',
|
|
13
|
+
url: 'https://images.unsplash.com/photo-1543466835-00a7907e9de1?w=200&h=200&fit=crop',
|
|
14
|
+
alt: 'Dog',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: '3',
|
|
18
|
+
url: 'https://images.unsplash.com/photo-1514888286974-6c03e2ca1dba?w=200&h=200&fit=crop',
|
|
19
|
+
alt: 'Cat',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: '4',
|
|
23
|
+
url: 'https://images.unsplash.com/photo-1495474472287-4d71bcdd2085?w=200&h=200&fit=crop',
|
|
24
|
+
alt: 'Coffee cup',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: '5',
|
|
28
|
+
url: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=200&h=200&fit=crop',
|
|
29
|
+
alt: 'Portrait',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const manyImages: AttachmentItem[] = [
|
|
34
|
+
...sampleImages,
|
|
35
|
+
{
|
|
36
|
+
id: '6',
|
|
37
|
+
url: 'https://images.unsplash.com/photo-1518770660439-4636190af475?w=200&h=200&fit=crop',
|
|
38
|
+
alt: 'Tech',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: '7',
|
|
42
|
+
url: 'https://images.unsplash.com/photo-1493976040374-85c8e12f0c0e?w=200&h=200&fit=crop',
|
|
43
|
+
alt: 'Japan',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: '8',
|
|
47
|
+
url: 'https://images.unsplash.com/photo-1501854140801-50d01698950b?w=200&h=200&fit=crop',
|
|
48
|
+
alt: 'Nature',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: '9',
|
|
52
|
+
url: 'https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=200&h=200&fit=crop',
|
|
53
|
+
alt: 'Fog',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: '10',
|
|
57
|
+
url: 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=200&h=200&fit=crop',
|
|
58
|
+
alt: 'Forest',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
const meta: Meta<typeof AttachmentsPreviewer> = {
|
|
63
|
+
title: 'Example/Chat/AttachmentsPreviewer',
|
|
64
|
+
component: AttachmentsPreviewer,
|
|
65
|
+
tags: ['autodocs'],
|
|
66
|
+
parameters: {
|
|
67
|
+
layout: 'centered',
|
|
68
|
+
},
|
|
69
|
+
args: {},
|
|
70
|
+
decorators: [
|
|
71
|
+
(Story) => (
|
|
72
|
+
<div style={{ width: 308 }}>
|
|
73
|
+
<Story />
|
|
74
|
+
</div>
|
|
75
|
+
),
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default meta;
|
|
80
|
+
type Story = StoryObj<typeof meta>;
|
|
81
|
+
|
|
82
|
+
export const Base: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
attachments: sampleImages,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const FewImages: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
attachments: sampleImages.slice(0, 3),
|
|
91
|
+
},
|
|
92
|
+
decorators: [
|
|
93
|
+
(Story) => (
|
|
94
|
+
<div style={{ width: 220 }}>
|
|
95
|
+
<Story />
|
|
96
|
+
</div>
|
|
97
|
+
),
|
|
98
|
+
],
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const ManyImages: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
attachments: manyImages,
|
|
104
|
+
onImageRemove: (attachment, index) => {
|
|
105
|
+
alert(`Remove image ${index + 1}: ${attachment.alt}`);
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
decorators: [
|
|
109
|
+
(Story) => (
|
|
110
|
+
<div style={{ width: 350 }}>
|
|
111
|
+
<Story />
|
|
112
|
+
</div>
|
|
113
|
+
),
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export const WithClickHandler: Story = {
|
|
118
|
+
args: {
|
|
119
|
+
attachments: sampleImages,
|
|
120
|
+
onImageClick: (attachment, index) => {
|
|
121
|
+
alert(`Clicked image ${index + 1}: ${attachment.alt}`);
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const WithRemoveHandler: Story = {
|
|
127
|
+
args: {
|
|
128
|
+
attachments: sampleImages,
|
|
129
|
+
onImageRemove: (attachment, index) => {
|
|
130
|
+
alert(`Remove image ${index + 1}: ${attachment.alt}`);
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const CustomSize: Story = {
|
|
136
|
+
args: {
|
|
137
|
+
attachments: sampleImages,
|
|
138
|
+
imageSize: 80,
|
|
139
|
+
gap: 12,
|
|
140
|
+
},
|
|
141
|
+
decorators: [
|
|
142
|
+
(Story) => (
|
|
143
|
+
<div style={{ width: 400 }}>
|
|
144
|
+
<Story />
|
|
145
|
+
</div>
|
|
146
|
+
),
|
|
147
|
+
],
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const SmallSize: Story = {
|
|
151
|
+
args: {
|
|
152
|
+
attachments: sampleImages,
|
|
153
|
+
imageSize: 40,
|
|
154
|
+
gap: 8,
|
|
155
|
+
},
|
|
156
|
+
decorators: [
|
|
157
|
+
(Story) => (
|
|
158
|
+
<div style={{ width: 250 }}>
|
|
159
|
+
<Story />
|
|
160
|
+
</div>
|
|
161
|
+
),
|
|
162
|
+
],
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export const SingleImage: Story = {
|
|
166
|
+
args: {
|
|
167
|
+
attachments: sampleImages.slice(0, 1),
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export const TwoImages: Story = {
|
|
172
|
+
args: {
|
|
173
|
+
attachments: sampleImages.slice(0, 2),
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const FullWidth: Story = {
|
|
178
|
+
args: {
|
|
179
|
+
attachments: manyImages,
|
|
180
|
+
},
|
|
181
|
+
decorators: [
|
|
182
|
+
(Story) => (
|
|
183
|
+
<div style={{ width: 600 }}>
|
|
184
|
+
<Story />
|
|
185
|
+
</div>
|
|
186
|
+
),
|
|
187
|
+
],
|
|
188
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { BorderColorAnimation } from "@/components/bs-ui/border-color-animation";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Example/Animation/BorderColorAnimation",
|
|
7
|
+
component: BorderColorAnimation,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
args: {},
|
|
13
|
+
} satisfies Meta<typeof BorderColorAnimation>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
width: '600px',
|
|
21
|
+
height: '400px',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const WithContent: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
width: '600px',
|
|
28
|
+
height: '400px',
|
|
29
|
+
},
|
|
30
|
+
render: (args) => (
|
|
31
|
+
<BorderColorAnimation {...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
|
+
<h2 style={{ margin: '0 0 12px 0' }}>Animated Border</h2>
|
|
41
|
+
<p style={{ margin: 0 }}>Content inside the animated border frame</p>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</BorderColorAnimation>
|
|
45
|
+
),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const SmallSize: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
width: '300px',
|
|
51
|
+
height: '200px',
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const SquareSize: Story = {
|
|
56
|
+
args: {
|
|
57
|
+
width: '400px',
|
|
58
|
+
height: '400px',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { BotAvatarAndName } from "@/components/bs-ui/bot-avatar-name";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Example/Chat/Bot Avatar And Name",
|
|
7
|
+
component: BotAvatarAndName,
|
|
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 BotAvatarAndName>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Base: Story = {
|
|
21
|
+
args: {
|
|
22
|
+
name: "AI表单搭建",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { BotIcon } from "@/components/bs-ui/bot-icon";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Example/Icons/BotIcon",
|
|
7
|
+
component: BotIcon,
|
|
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 BotIcon>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
export const Base: Story = {
|
|
21
|
+
args: {},
|
|
22
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { BsTooltip } from '@/components/bs-ui/tooltip';
|
|
4
|
+
import { TooltipProvider } from '@/components/ui/tooltip';
|
|
5
|
+
import { IconBtn } from '@/components/bs-ui/icon-btn';
|
|
6
|
+
import { ColorfulEditIcon } from '@/components/bs-ui/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/bs-ui/card";
|
|
4
|
+
import { UserIcon } from "@/components/bs-ui/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,26 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
// import { Header } from "./Header";
|
|
4
|
+
import { ChatAreaHeader } from "@/components/bs-ui/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,44 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
2
|
+
|
|
3
|
+
import { CollapsibleTxtMsg } from "@/components/bs-ui/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/bs-ui/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
|
+
};
|