@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,134 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { IconBtn } from './icon-btn';
|
|
4
|
+
import { BackIcon, InfoIcon } from './bs-icons';
|
|
5
|
+
import { LinearGradientColorBgAnimation } from './linear-gradient-color-bg-animation';
|
|
6
|
+
import { ConfirmDialog } from './confirm-dialog';
|
|
7
|
+
|
|
8
|
+
export interface PreviewerHeaderProps {
|
|
9
|
+
title: string;
|
|
10
|
+
tips?: string;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
onBackClick?: () => void;
|
|
14
|
+
onSave?: () => void;
|
|
15
|
+
onCancel?: () => void;
|
|
16
|
+
style?: React.CSSProperties;
|
|
17
|
+
|
|
18
|
+
dialogContainer?: HTMLElement;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const PreviewerHeader = ({
|
|
22
|
+
title,
|
|
23
|
+
tips,
|
|
24
|
+
style,
|
|
25
|
+
className,
|
|
26
|
+
active,
|
|
27
|
+
onBackClick,
|
|
28
|
+
onSave,
|
|
29
|
+
onCancel,
|
|
30
|
+
dialogContainer,
|
|
31
|
+
}: PreviewerHeaderProps) => {
|
|
32
|
+
const [showConfirmDialog, setShowConfirmDialog] = useState(false);
|
|
33
|
+
|
|
34
|
+
const btnResetStyle = classNames(
|
|
35
|
+
'w-[94px] h-[34px] flex items-center justify-center rounded-[4px]'
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
const contentJsx = (
|
|
39
|
+
<>
|
|
40
|
+
<div className="flex items-center gap-3">
|
|
41
|
+
<IconBtn
|
|
42
|
+
icon={<BackIcon />}
|
|
43
|
+
onClick={() => setShowConfirmDialog(true)}
|
|
44
|
+
className="text-[#0265FF] hover:text-[#0265FF]"
|
|
45
|
+
/>
|
|
46
|
+
<span className="text-[#121111] text-[16px] font-[700]">{title}</span>
|
|
47
|
+
{tips && active && (
|
|
48
|
+
<div className="flex items-center gap-[6px] text-[#999999] text-[12px]">
|
|
49
|
+
<InfoIcon />
|
|
50
|
+
{tips}
|
|
51
|
+
</div>
|
|
52
|
+
)}
|
|
53
|
+
</div>
|
|
54
|
+
<div className="flex items-center gap-[10px]">
|
|
55
|
+
{onSave && (
|
|
56
|
+
<button
|
|
57
|
+
onClick={onSave}
|
|
58
|
+
className={classNames(
|
|
59
|
+
btnResetStyle,
|
|
60
|
+
'bg-[#0265FF] hover:opacity-90 text-white text-[14px]'
|
|
61
|
+
)}
|
|
62
|
+
>
|
|
63
|
+
保存
|
|
64
|
+
</button>
|
|
65
|
+
)}
|
|
66
|
+
{onCancel && (
|
|
67
|
+
<button
|
|
68
|
+
onClick={() => {
|
|
69
|
+
setShowConfirmDialog(true);
|
|
70
|
+
console.log('click onCancel');
|
|
71
|
+
}}
|
|
72
|
+
className={classNames(
|
|
73
|
+
btnResetStyle,
|
|
74
|
+
'text-[#121111] text-[14px] bg-[#fff] border border-solid border-[#e0e0e0] hover:bg-[#f0f0f0]'
|
|
75
|
+
)}
|
|
76
|
+
>
|
|
77
|
+
取消
|
|
78
|
+
</button>
|
|
79
|
+
)}
|
|
80
|
+
</div>
|
|
81
|
+
<ConfirmDialog
|
|
82
|
+
container={dialogContainer}
|
|
83
|
+
open={showConfirmDialog}
|
|
84
|
+
onOpenChange={setShowConfirmDialog}
|
|
85
|
+
title="AI表单搭建有修改,是否保存?"
|
|
86
|
+
description="您修改了AI表单搭建但没有保存,是否需要保存并继续?"
|
|
87
|
+
onLinkClick={() => setShowConfirmDialog(false)}
|
|
88
|
+
onCancel={() => {
|
|
89
|
+
setShowConfirmDialog(false);
|
|
90
|
+
onCancel?.();
|
|
91
|
+
onBackClick?.();
|
|
92
|
+
}}
|
|
93
|
+
onConfirm={() => {
|
|
94
|
+
setShowConfirmDialog(false);
|
|
95
|
+
onSave?.();
|
|
96
|
+
}}
|
|
97
|
+
/>
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const borderCls = classNames({
|
|
102
|
+
'border-b border-solid border-[#e0e0e0]': !active,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (active) {
|
|
106
|
+
return (
|
|
107
|
+
<LinearGradientColorBgAnimation
|
|
108
|
+
height={52}
|
|
109
|
+
style={style}
|
|
110
|
+
childrenContainerStyle={{
|
|
111
|
+
display: 'flex',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
justifyContent: 'space-between',
|
|
114
|
+
padding: '0 20px',
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{contentJsx}
|
|
118
|
+
</LinearGradientColorBgAnimation>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<div
|
|
124
|
+
style={style}
|
|
125
|
+
className={classNames(
|
|
126
|
+
'w-full h-[52px] flex items-center justify-between px-[20px]',
|
|
127
|
+
className,
|
|
128
|
+
borderCls
|
|
129
|
+
)}
|
|
130
|
+
>
|
|
131
|
+
{contentJsx}
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Button, ButtonProps } from "../ui/button";
|
|
2
|
+
import { cn } from "@/lib/utils";
|
|
3
|
+
import { transCls } from "@/const/ui";
|
|
4
|
+
|
|
5
|
+
export interface PrimaryConfirmBtnProps extends ButtonProps {
|
|
6
|
+
text?: string;
|
|
7
|
+
prefixDesc?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const PrimaryConfirmBtn = ({
|
|
11
|
+
text = "确认",
|
|
12
|
+
prefixDesc,
|
|
13
|
+
className,
|
|
14
|
+
disabled,
|
|
15
|
+
...rest
|
|
16
|
+
}: PrimaryConfirmBtnProps) => {
|
|
17
|
+
const btn = (
|
|
18
|
+
<Button
|
|
19
|
+
{...rest}
|
|
20
|
+
variant="default"
|
|
21
|
+
disabled={disabled}
|
|
22
|
+
className={cn(
|
|
23
|
+
"px-2.5 py-0 rounded-[100px] text-[14px] leading-normal h-[34px] min-w-[300px] cursor-pointer w-full",
|
|
24
|
+
disabled
|
|
25
|
+
? "bg-[#f0f0f0] text-[#999] cursor-not-allowed"
|
|
26
|
+
: "bg-[#0265ff] text-white hover:bg-[#0265ff]/80",
|
|
27
|
+
|
|
28
|
+
transCls,
|
|
29
|
+
className
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
{text}
|
|
33
|
+
</Button>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
if (!prefixDesc) {
|
|
37
|
+
return btn;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div className="flex flex-col items-start gap-2.5">
|
|
42
|
+
<p className="text-[#4D609F]">{prefixDesc}</p>
|
|
43
|
+
{btn}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Button, ButtonProps } from '../ui/button';
|
|
3
|
+
import { BotIcon } from './bot-icon';
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
|
|
6
|
+
export interface PrimaryEntryBtnProps extends ButtonProps {
|
|
7
|
+
minimal?: boolean;
|
|
8
|
+
entryVariant?: 'default' | 'ghost' | 'selected';
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const PrimaryEntryBtn = ({
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
minimal,
|
|
16
|
+
entryVariant = 'default',
|
|
17
|
+
icon,
|
|
18
|
+
...rest
|
|
19
|
+
}: PrimaryEntryBtnProps) => {
|
|
20
|
+
const variantStyles = {
|
|
21
|
+
default: 'bg-[linear-gradient(180deg,#DBE9FF_0%,#E9FFFD_100%)]',
|
|
22
|
+
ghost: 'bg-transparent text-[#030303] font-[400] px-[10px] hover:bg-[#EFF0F6]',
|
|
23
|
+
selected: 'bg-[#EFF0F6] text-[#030303] font-[400] px-[10px]',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Button
|
|
28
|
+
{...rest}
|
|
29
|
+
variant="entry"
|
|
30
|
+
size="entry"
|
|
31
|
+
className={cn('rounded-[4px] cursor-pointer', variantStyles[entryVariant], className)}
|
|
32
|
+
>
|
|
33
|
+
{icon ?? <BotIcon />}
|
|
34
|
+
{minimal ? null : children}
|
|
35
|
+
</Button>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
|
|
6
|
+
export interface TabRadioOption {
|
|
7
|
+
value: string;
|
|
8
|
+
label: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface TabRadioGroupProps extends Omit<
|
|
12
|
+
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>,
|
|
13
|
+
'children'
|
|
14
|
+
> {
|
|
15
|
+
options: TabRadioOption[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const TabRadioGroup = React.forwardRef<
|
|
19
|
+
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
20
|
+
TabRadioGroupProps
|
|
21
|
+
>(({ className, options, ...props }, ref) => {
|
|
22
|
+
return (
|
|
23
|
+
<RadioGroupPrimitive.Root
|
|
24
|
+
ref={ref}
|
|
25
|
+
className={cn(
|
|
26
|
+
'flex flex-col items-start justify-center p-[2px] rounded-[4px] bg-[#EFF0F6]',
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
<div className="flex gap-[2px] items-center w-full">
|
|
32
|
+
{options.map((option) => (
|
|
33
|
+
<TabRadioItem key={option.value} value={option.value}>
|
|
34
|
+
{option.label}
|
|
35
|
+
</TabRadioItem>
|
|
36
|
+
))}
|
|
37
|
+
</div>
|
|
38
|
+
</RadioGroupPrimitive.Root>
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
TabRadioGroup.displayName = 'TabRadioGroup';
|
|
42
|
+
|
|
43
|
+
interface TabRadioItemProps extends React.ComponentPropsWithoutRef<
|
|
44
|
+
typeof RadioGroupPrimitive.Item
|
|
45
|
+
> {
|
|
46
|
+
children: React.ReactNode;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const TabRadioItem = React.forwardRef<
|
|
50
|
+
React.ElementRef<typeof RadioGroupPrimitive.Item>,
|
|
51
|
+
TabRadioItemProps
|
|
52
|
+
>(({ className, children, ...props }, ref) => {
|
|
53
|
+
return (
|
|
54
|
+
<RadioGroupPrimitive.Item
|
|
55
|
+
ref={ref}
|
|
56
|
+
className={cn(
|
|
57
|
+
'flex-1 h-[30px] flex items-center justify-center px-[10px] py-[7px] rounded-[4px] text-[14px] text-[#121111] cursor-pointer',
|
|
58
|
+
'border border-solid border-[#EFF0F6] bg-transparent',
|
|
59
|
+
'transition-all ease-out duration-200',
|
|
60
|
+
'outline-none',
|
|
61
|
+
'hover:text-[#121111] hover:border-[#E0E0E0] hover:bg-white',
|
|
62
|
+
'data-[state=checked]:text-[#0265FF] data-[state=checked]:border-[#E0E0E0] data-[state=checked]:bg-white',
|
|
63
|
+
className
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
>
|
|
67
|
+
{children}
|
|
68
|
+
</RadioGroupPrimitive.Item>
|
|
69
|
+
);
|
|
70
|
+
});
|
|
71
|
+
TabRadioItem.displayName = 'TabRadioItem';
|
|
72
|
+
|
|
73
|
+
export { TabRadioGroup, TabRadioItem };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
|
|
2
|
+
|
|
3
|
+
export const BsTooltip = ({
|
|
4
|
+
children,
|
|
5
|
+
content,
|
|
6
|
+
}: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
}) => {
|
|
10
|
+
return (
|
|
11
|
+
<Tooltip>
|
|
12
|
+
<TooltipTrigger asChild>{children}</TooltipTrigger>
|
|
13
|
+
<TooltipContent className="z-50 rounded-[4px] bg-[#525867] px-[10px] py-[6px] text-[14px] text-white leading-normal max-w-[288px]">
|
|
14
|
+
{content}
|
|
15
|
+
</TooltipContent>
|
|
16
|
+
</Tooltip>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UserTextMsgBubbleProps {
|
|
2
|
+
text?: string;
|
|
3
|
+
children?: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const UserTextMsgBubble = ({ text, children }: UserTextMsgBubbleProps) => {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
className="px-2.5 py-[7px] text-[#0265FF] text-[14px]"
|
|
10
|
+
style={{
|
|
11
|
+
borderRadius: `10px 0 10px 10px`,
|
|
12
|
+
wordWrap: 'break-word',
|
|
13
|
+
background: `linear-gradient(180deg, #DBE9FF 0%, #E9FFFD 100%)`,
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
16
|
+
{text || children}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const badgeVariants = cva(
|
|
7
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
13
|
+
secondary:
|
|
14
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
+
destructive:
|
|
16
|
+
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
17
|
+
outline: "text-foreground",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
export interface BadgeProps
|
|
27
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
28
|
+
VariantProps<typeof badgeVariants> {}
|
|
29
|
+
|
|
30
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { Badge, badgeVariants }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
import { cn } from '@/lib/utils';
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
|
|
13
|
+
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
|
|
14
|
+
outline:
|
|
15
|
+
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
|
|
16
|
+
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
|
|
17
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
18
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
19
|
+
entry: '',
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
default: 'h-[34px] px-4 py-2',
|
|
23
|
+
sm: 'h-8 rounded-md px-3 text-xs',
|
|
24
|
+
lg: 'h-10 rounded-md px-8',
|
|
25
|
+
icon: 'h-[24px] w-[24px]',
|
|
26
|
+
entry: 'h-[30px] px-1.5 py-0 gap-1.5',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: 'default',
|
|
31
|
+
size: 'default',
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export interface ButtonProps
|
|
37
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
38
|
+
asChild?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
42
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
43
|
+
const Comp = asChild ? Slot : 'button';
|
|
44
|
+
return (
|
|
45
|
+
<Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
Button.displayName = 'Button';
|
|
50
|
+
|
|
51
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const Card = React.forwardRef<
|
|
6
|
+
HTMLDivElement,
|
|
7
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
8
|
+
>(({ className, ...props }, ref) => (
|
|
9
|
+
<div
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn(
|
|
12
|
+
"rounded-xl border bg-card text-card-foreground shadow",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
))
|
|
18
|
+
Card.displayName = "Card"
|
|
19
|
+
|
|
20
|
+
const CardHeader = React.forwardRef<
|
|
21
|
+
HTMLDivElement,
|
|
22
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
23
|
+
>(({ className, ...props }, ref) => (
|
|
24
|
+
<div
|
|
25
|
+
ref={ref}
|
|
26
|
+
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
))
|
|
30
|
+
CardHeader.displayName = "CardHeader"
|
|
31
|
+
|
|
32
|
+
const CardTitle = React.forwardRef<
|
|
33
|
+
HTMLDivElement,
|
|
34
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
35
|
+
>(({ className, ...props }, ref) => (
|
|
36
|
+
<div
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn("font-semibold leading-none tracking-tight", className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
))
|
|
42
|
+
CardTitle.displayName = "CardTitle"
|
|
43
|
+
|
|
44
|
+
const CardDescription = React.forwardRef<
|
|
45
|
+
HTMLDivElement,
|
|
46
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
47
|
+
>(({ className, ...props }, ref) => (
|
|
48
|
+
<div
|
|
49
|
+
ref={ref}
|
|
50
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
))
|
|
54
|
+
CardDescription.displayName = "CardDescription"
|
|
55
|
+
|
|
56
|
+
const CardContent = React.forwardRef<
|
|
57
|
+
HTMLDivElement,
|
|
58
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
59
|
+
>(({ className, ...props }, ref) => (
|
|
60
|
+
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
61
|
+
))
|
|
62
|
+
CardContent.displayName = "CardContent"
|
|
63
|
+
|
|
64
|
+
const CardFooter = React.forwardRef<
|
|
65
|
+
HTMLDivElement,
|
|
66
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
67
|
+
>(({ className, ...props }, ref) => (
|
|
68
|
+
<div
|
|
69
|
+
ref={ref}
|
|
70
|
+
className={cn("flex items-center p-6 pt-0", className)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
))
|
|
74
|
+
CardFooter.displayName = "CardFooter"
|
|
75
|
+
|
|
76
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
import { Check } from "lucide-react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
const Checkbox = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof CheckboxPrimitive.Root>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
|
|
10
|
+
>(({ className, ...props }, ref) => (
|
|
11
|
+
<CheckboxPrimitive.Root
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn(
|
|
14
|
+
"grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
<CheckboxPrimitive.Indicator
|
|
20
|
+
className={cn("grid place-content-center text-current")}
|
|
21
|
+
>
|
|
22
|
+
{/* @ts-ignore */}
|
|
23
|
+
<Check className="h-4 w-4" />
|
|
24
|
+
</CheckboxPrimitive.Indicator>
|
|
25
|
+
</CheckboxPrimitive.Root>
|
|
26
|
+
));
|
|
27
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
28
|
+
|
|
29
|
+
export { Checkbox };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
|
|
2
|
+
|
|
3
|
+
const Collapsible = CollapsiblePrimitive.Root
|
|
4
|
+
|
|
5
|
+
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger
|
|
6
|
+
|
|
7
|
+
const CollapsibleContent = CollapsiblePrimitive.CollapsibleContent
|
|
8
|
+
|
|
9
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
|
|
4
|
+
import { cn } from '@/lib/utils';
|
|
5
|
+
|
|
6
|
+
const Dialog = DialogPrimitive.Root;
|
|
7
|
+
|
|
8
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
9
|
+
|
|
10
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
11
|
+
|
|
12
|
+
const DialogClose = DialogPrimitive.Close;
|
|
13
|
+
|
|
14
|
+
const DialogOverlay = React.forwardRef<
|
|
15
|
+
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
16
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay> & {
|
|
17
|
+
position?: 'fixed' | 'absolute';
|
|
18
|
+
}
|
|
19
|
+
>(({ className, position = 'fixed', ...props }, ref) => (
|
|
20
|
+
<DialogPrimitive.Overlay
|
|
21
|
+
ref={ref}
|
|
22
|
+
className={cn(
|
|
23
|
+
'inset-0 z-50 bg-black/30 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
24
|
+
position === 'absolute' ? 'absolute' : 'fixed',
|
|
25
|
+
className
|
|
26
|
+
)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
));
|
|
30
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
31
|
+
|
|
32
|
+
const DialogContent = React.forwardRef<
|
|
33
|
+
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
34
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & { container?: HTMLElement }
|
|
35
|
+
>(({ className, children, container, ...props }, ref) => {
|
|
36
|
+
return (
|
|
37
|
+
<DialogPortal container={container}>
|
|
38
|
+
<DialogOverlay position={container ? 'absolute' : 'fixed'} />
|
|
39
|
+
<DialogPrimitive.Content
|
|
40
|
+
style={{ padding: 0 }}
|
|
41
|
+
ref={ref}
|
|
42
|
+
className={cn(
|
|
43
|
+
'left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
|
|
44
|
+
container ? 'absolute' : 'fixed',
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
{children}
|
|
50
|
+
</DialogPrimitive.Content>
|
|
51
|
+
</DialogPortal>
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
55
|
+
|
|
56
|
+
const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
57
|
+
<div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />
|
|
58
|
+
);
|
|
59
|
+
DialogHeader.displayName = 'DialogHeader';
|
|
60
|
+
|
|
61
|
+
const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
62
|
+
<div
|
|
63
|
+
className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
67
|
+
DialogFooter.displayName = 'DialogFooter';
|
|
68
|
+
|
|
69
|
+
const DialogTitle = React.forwardRef<
|
|
70
|
+
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
71
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
72
|
+
>(({ className, ...props }, ref) => (
|
|
73
|
+
<DialogPrimitive.Title
|
|
74
|
+
ref={ref}
|
|
75
|
+
className={cn('text-lg font-semibold leading-none tracking-tight', className)}
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
78
|
+
));
|
|
79
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
80
|
+
|
|
81
|
+
const DialogDescription = React.forwardRef<
|
|
82
|
+
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
83
|
+
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
84
|
+
>(({ className, ...props }, ref) => (
|
|
85
|
+
<DialogPrimitive.Description
|
|
86
|
+
ref={ref}
|
|
87
|
+
className={cn('text-sm text-muted-foreground', className)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
));
|
|
91
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
Dialog,
|
|
95
|
+
DialogPortal,
|
|
96
|
+
DialogOverlay,
|
|
97
|
+
DialogTrigger,
|
|
98
|
+
DialogClose,
|
|
99
|
+
DialogContent,
|
|
100
|
+
DialogHeader,
|
|
101
|
+
DialogFooter,
|
|
102
|
+
DialogTitle,
|
|
103
|
+
DialogDescription,
|
|
104
|
+
};
|