@baishuyun/ai-design 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +29 -0
- package/.storybook/preview.ts +16 -0
- package/.turbo/turbo-build.log +14 -0
- package/CHANGELOG.md +12 -0
- package/components.json +22 -0
- package/debug-storybook.log +88 -0
- package/dist/ai-design.js +20482 -0
- package/dist/ai-design.js.map +1 -0
- package/dist/ai-design.umd.cjs +260 -0
- package/dist/ai-design.umd.cjs.map +1 -0
- package/dist/src/components/abs-fullscreen-gradient-bg.d.ts +10 -0
- package/dist/src/components/abs-fullscreen-gradient-bg.d.ts.map +1 -0
- package/dist/src/components/agent-scroll-selector.d.ts +11 -0
- package/dist/src/components/agent-scroll-selector.d.ts.map +1 -0
- package/dist/src/components/agent-select.d.ts +16 -0
- package/dist/src/components/agent-select.d.ts.map +1 -0
- package/dist/src/components/attachment-part-group.d.ts +16 -0
- package/dist/src/components/attachment-part-group.d.ts.map +1 -0
- package/dist/src/components/attachment-part.d.ts +19 -0
- package/dist/src/components/attachment-part.d.ts.map +1 -0
- package/dist/src/components/attachments-previewer.d.ts +18 -0
- package/dist/src/components/attachments-previewer.d.ts.map +1 -0
- package/dist/src/components/base-button.d.ts +8 -0
- package/dist/src/components/base-button.d.ts.map +1 -0
- package/dist/src/components/border-animation.d.ts +23 -0
- package/dist/src/components/border-animation.d.ts.map +1 -0
- package/dist/src/components/border-color-animation.d.ts +11 -0
- package/dist/src/components/border-color-animation.d.ts.map +1 -0
- package/dist/src/components/bot-avatar-name.d.ts +6 -0
- package/dist/src/components/bot-avatar-name.d.ts.map +1 -0
- package/dist/src/components/bot-icon.d.ts +5 -0
- package/dist/src/components/bot-icon.d.ts.map +1 -0
- package/dist/src/components/bs-entry-select.d.ts +18 -0
- package/dist/src/components/bs-entry-select.d.ts.map +1 -0
- package/dist/src/components/bs-icons.d.ts +75 -0
- package/dist/src/components/bs-icons.d.ts.map +1 -0
- package/dist/src/components/card-field.d.ts +11 -0
- package/dist/src/components/card-field.d.ts.map +1 -0
- package/dist/src/components/card.d.ts +11 -0
- package/dist/src/components/card.d.ts.map +1 -0
- package/dist/src/components/chat-area-header.d.ts +13 -0
- package/dist/src/components/chat-area-header.d.ts.map +1 -0
- package/dist/src/components/circle-checker.d.ts +10 -0
- package/dist/src/components/circle-checker.d.ts.map +1 -0
- package/dist/src/components/collapsible-txt-msg.d.ts +11 -0
- package/dist/src/components/collapsible-txt-msg.d.ts.map +1 -0
- package/dist/src/components/confirm-dialog.d.ts +26 -0
- package/dist/src/components/confirm-dialog.d.ts.map +1 -0
- package/dist/src/components/fake-bot-msg.d.ts +8 -0
- package/dist/src/components/fake-bot-msg.d.ts.map +1 -0
- package/dist/src/components/fields-design-info-table.d.ts +7 -0
- package/dist/src/components/fields-design-info-table.d.ts.map +1 -0
- package/dist/src/components/fields-generating-indicator.d.ts +6 -0
- package/dist/src/components/fields-generating-indicator.d.ts.map +1 -0
- package/dist/src/components/fields-portal.d.ts +8 -0
- package/dist/src/components/fields-portal.d.ts.map +1 -0
- package/dist/src/components/fields-previewer.d.ts +19 -0
- package/dist/src/components/fields-previewer.d.ts.map +1 -0
- package/dist/src/components/font-icon.d.ts +6 -0
- package/dist/src/components/font-icon.d.ts.map +1 -0
- package/dist/src/components/form-info-editor.d.ts +31 -0
- package/dist/src/components/form-info-editor.d.ts.map +1 -0
- package/dist/src/components/formula-tag.d.ts +8 -0
- package/dist/src/components/formula-tag.d.ts.map +1 -0
- package/dist/src/components/generate-animation.d.ts +5 -0
- package/dist/src/components/generate-animation.d.ts.map +1 -0
- package/dist/src/components/icon-btn.d.ts +9 -0
- package/dist/src/components/icon-btn.d.ts.map +1 -0
- package/dist/src/components/img-part.d.ts +10 -0
- package/dist/src/components/img-part.d.ts.map +1 -0
- package/dist/src/components/legacy-slot.d.ts +11 -0
- package/dist/src/components/legacy-slot.d.ts.map +1 -0
- package/dist/src/components/line-checker.d.ts +19 -0
- package/dist/src/components/line-checker.d.ts.map +1 -0
- package/dist/src/components/linear-gradient-border-btn.d.ts +10 -0
- package/dist/src/components/linear-gradient-border-btn.d.ts.map +1 -0
- package/dist/src/components/linear-gradient-color-bg-animation.d.ts +8 -0
- package/dist/src/components/linear-gradient-color-bg-animation.d.ts.map +1 -0
- package/dist/src/components/memoized-markdown.d.ts +5 -0
- package/dist/src/components/memoized-markdown.d.ts.map +1 -0
- package/dist/src/components/message-content.d.ts +6 -0
- package/dist/src/components/message-content.d.ts.map +1 -0
- package/dist/src/components/number-part.d.ts +9 -0
- package/dist/src/components/number-part.d.ts.map +1 -0
- package/dist/src/components/office-container.d.ts +12 -0
- package/dist/src/components/office-container.d.ts.map +1 -0
- package/dist/src/components/option-item.d.ts +9 -0
- package/dist/src/components/option-item.d.ts.map +1 -0
- package/dist/src/components/previewer-header.d.ts +21 -0
- package/dist/src/components/previewer-header.d.ts.map +1 -0
- package/dist/src/components/primary-confirm-btn.d.ts +10 -0
- package/dist/src/components/primary-confirm-btn.d.ts.map +1 -0
- package/dist/src/components/primary-entry-btn.d.ts +9 -0
- package/dist/src/components/primary-entry-btn.d.ts.map +1 -0
- package/dist/src/components/scroll-to-bottom-btn.d.ts +6 -0
- package/dist/src/components/scroll-to-bottom-btn.d.ts.map +1 -0
- package/dist/src/components/split-line.d.ts +5 -0
- package/dist/src/components/split-line.d.ts.map +1 -0
- package/dist/src/components/square-checker.d.ts +15 -0
- package/dist/src/components/square-checker.d.ts.map +1 -0
- package/dist/src/components/tab-radio-group.d.ts +20 -0
- package/dist/src/components/tab-radio-group.d.ts.map +1 -0
- package/dist/src/components/tooltip.d.ts +6 -0
- package/dist/src/components/tooltip.d.ts.map +1 -0
- package/dist/src/components/ui/button.d.ts +12 -0
- package/dist/src/components/ui/button.d.ts.map +1 -0
- package/dist/src/components/ui/dialog.d.ts +24 -0
- package/dist/src/components/ui/dialog.d.ts.map +1 -0
- package/dist/src/components/ui/icons.d.ts +176 -0
- package/dist/src/components/ui/icons.d.ts.map +1 -0
- package/dist/src/components/ui/popover.d.ts +10 -0
- package/dist/src/components/ui/popover.d.ts.map +1 -0
- package/dist/src/components/ui/spinner.d.ts +3 -0
- package/dist/src/components/ui/spinner.d.ts.map +1 -0
- package/dist/src/components/ui/tooltip.d.ts +13 -0
- package/dist/src/components/ui/tooltip.d.ts.map +1 -0
- package/dist/src/components/user-txt-msg-bubble.d.ts +6 -0
- package/dist/src/components/user-txt-msg-bubble.d.ts.map +1 -0
- package/dist/src/components/warning-msg.d.ts +6 -0
- package/dist/src/components/warning-msg.d.ts.map +1 -0
- package/dist/src/const/ui.d.ts +7 -0
- package/dist/src/const/ui.d.ts.map +1 -0
- package/dist/src/hooks/use-resizable-width.d.ts +24 -0
- package/dist/src/hooks/use-resizable-width.d.ts.map +1 -0
- package/dist/src/hooks/use-shadow.d.ts +25 -0
- package/dist/src/hooks/use-shadow.d.ts.map +1 -0
- package/dist/src/index.d.ts +66 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/utils.d.ts +4 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/stories/AbsFullscreenGradientBg.stories.d.ts +17 -0
- package/dist/src/stories/AbsFullscreenGradientBg.stories.d.ts.map +1 -0
- package/dist/src/stories/AgentScrollSelector.stories.d.ts +11 -0
- package/dist/src/stories/AgentScrollSelector.stories.d.ts.map +1 -0
- package/dist/src/stories/AgentSelect.stories.d.ts +14 -0
- package/dist/src/stories/AgentSelect.stories.d.ts.map +1 -0
- package/dist/src/stories/AttachmentPart.stories.d.ts +23 -0
- package/dist/src/stories/AttachmentPart.stories.d.ts.map +1 -0
- package/dist/src/stories/AttachmentPartGroup.stories.d.ts +21 -0
- package/dist/src/stories/AttachmentPartGroup.stories.d.ts.map +1 -0
- package/dist/src/stories/AttachmentsPreviewer.stories.d.ts +20 -0
- package/dist/src/stories/AttachmentsPreviewer.stories.d.ts.map +1 -0
- package/dist/src/stories/BaseButton.stories.d.ts +18 -0
- package/dist/src/stories/BaseButton.stories.d.ts.map +1 -0
- package/dist/src/stories/BorderAnimation.stories.d.ts +21 -0
- package/dist/src/stories/BorderAnimation.stories.d.ts.map +1 -0
- package/dist/src/stories/BorderColorAnimation.stories.d.ts +26 -0
- package/dist/src/stories/BorderColorAnimation.stories.d.ts.map +1 -0
- package/dist/src/stories/BotAvatarAndName.stories.d.ts +18 -0
- package/dist/src/stories/BotAvatarAndName.stories.d.ts.map +1 -0
- package/dist/src/stories/BotIcon.stories.d.ts +17 -0
- package/dist/src/stories/BotIcon.stories.d.ts.map +1 -0
- package/dist/src/stories/BsEntrySelect.stories.d.ts +13 -0
- package/dist/src/stories/BsEntrySelect.stories.d.ts.map +1 -0
- package/dist/src/stories/BsTooltip.stories.d.ts +7 -0
- package/dist/src/stories/BsTooltip.stories.d.ts.map +1 -0
- package/dist/src/stories/Card.stories.d.ts +14 -0
- package/dist/src/stories/Card.stories.d.ts.map +1 -0
- package/dist/src/stories/CardField.stories.d.ts +13 -0
- package/dist/src/stories/CardField.stories.d.ts.map +1 -0
- package/dist/src/stories/ChatAreaHeader.stories.d.ts +14 -0
- package/dist/src/stories/ChatAreaHeader.stories.d.ts.map +1 -0
- package/dist/src/stories/CircleChecker.stories.d.ts +21 -0
- package/dist/src/stories/CircleChecker.stories.d.ts.map +1 -0
- package/dist/src/stories/CollapsibleTextMsg.stories.d.ts +16 -0
- package/dist/src/stories/CollapsibleTextMsg.stories.d.ts.map +1 -0
- package/dist/src/stories/ConfirmDialog.stories.d.ts +61 -0
- package/dist/src/stories/ConfirmDialog.stories.d.ts.map +1 -0
- package/dist/src/stories/FakeBotMsg.stories.d.ts +21 -0
- package/dist/src/stories/FakeBotMsg.stories.d.ts.map +1 -0
- package/dist/src/stories/FormInfoEditor.stories.d.ts +15 -0
- package/dist/src/stories/FormInfoEditor.stories.d.ts.map +1 -0
- package/dist/src/stories/FormulaTag.stories.d.ts +37 -0
- package/dist/src/stories/FormulaTag.stories.d.ts.map +1 -0
- package/dist/src/stories/GenerateAnimation.stories.d.ts +17 -0
- package/dist/src/stories/GenerateAnimation.stories.d.ts.map +1 -0
- package/dist/src/stories/IconBtn.stories.d.ts +15 -0
- package/dist/src/stories/IconBtn.stories.d.ts.map +1 -0
- package/dist/src/stories/IconLib.d.ts +12 -0
- package/dist/src/stories/IconLib.d.ts.map +1 -0
- package/dist/src/stories/Icons.stories.d.ts +24 -0
- package/dist/src/stories/Icons.stories.d.ts.map +1 -0
- package/dist/src/stories/ImgMsgPart.stories.d.ts +20 -0
- package/dist/src/stories/ImgMsgPart.stories.d.ts.map +1 -0
- package/dist/src/stories/LegacySlot.stories.d.ts +16 -0
- package/dist/src/stories/LegacySlot.stories.d.ts.map +1 -0
- package/dist/src/stories/LineChecker.stories.d.ts +23 -0
- package/dist/src/stories/LineChecker.stories.d.ts.map +1 -0
- package/dist/src/stories/LinearGradientBorderBtn.stories.d.ts +22 -0
- package/dist/src/stories/LinearGradientBorderBtn.stories.d.ts.map +1 -0
- package/dist/src/stories/LinearGradientColorBgAnimation.stories.d.ts +23 -0
- package/dist/src/stories/LinearGradientColorBgAnimation.stories.d.ts.map +1 -0
- package/dist/src/stories/MemoizedMarkdown.stories.d.ts +23 -0
- package/dist/src/stories/MemoizedMarkdown.stories.d.ts.map +1 -0
- package/dist/src/stories/MessageContent.stories.d.ts +16 -0
- package/dist/src/stories/MessageContent.stories.d.ts.map +1 -0
- package/dist/src/stories/NumbersMsgPart.stories.d.ts +19 -0
- package/dist/src/stories/NumbersMsgPart.stories.d.ts.map +1 -0
- package/dist/src/stories/OfficeContainer.stories.d.ts +8 -0
- package/dist/src/stories/OfficeContainer.stories.d.ts.map +1 -0
- package/dist/src/stories/OptionItem.stories.d.ts +20 -0
- package/dist/src/stories/OptionItem.stories.d.ts.map +1 -0
- package/dist/src/stories/PreviewerHeader.stories.d.ts +12 -0
- package/dist/src/stories/PreviewerHeader.stories.d.ts.map +1 -0
- package/dist/src/stories/PrimaryConfirmBtn.stories.d.ts +19 -0
- package/dist/src/stories/PrimaryConfirmBtn.stories.d.ts.map +1 -0
- package/dist/src/stories/PrimaryEntryBtn.stories.d.ts +26 -0
- package/dist/src/stories/PrimaryEntryBtn.stories.d.ts.map +1 -0
- package/dist/src/stories/ScrollToBottom.stories.d.ts +15 -0
- package/dist/src/stories/ScrollToBottom.stories.d.ts.map +1 -0
- package/dist/src/stories/SplitLine.stories.d.ts +9 -0
- package/dist/src/stories/SplitLine.stories.d.ts.map +1 -0
- package/dist/src/stories/SquareChecker.stories.d.ts +26 -0
- package/dist/src/stories/SquareChecker.stories.d.ts.map +1 -0
- package/dist/src/stories/TabRadioGroup.stories.d.ts +18 -0
- package/dist/src/stories/TabRadioGroup.stories.d.ts.map +1 -0
- package/dist/src/stories/UserTextMsgBubble.stories.d.ts +14 -0
- package/dist/src/stories/UserTextMsgBubble.stories.d.ts.map +1 -0
- package/dist/src/stories/WarningMessage.stories.d.ts +16 -0
- package/dist/src/stories/WarningMessage.stories.d.ts.map +1 -0
- package/dist/src/stories/fields-design-info-table.stories.d.ts +14 -0
- package/dist/src/stories/fields-design-info-table.stories.d.ts.map +1 -0
- package/dist/src/stories/fields-generating.stories.d.ts +20 -0
- package/dist/src/stories/fields-generating.stories.d.ts.map +1 -0
- package/dist/src/stories/fields-previewer.stories.d.ts +19 -0
- package/dist/src/stories/fields-previewer.stories.d.ts.map +1 -0
- package/dist/src/types.d.ts +8 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +80 -0
- package/src/components/abs-fullscreen-gradient-bg.tsx +35 -0
- package/src/components/agent-scroll-selector.tsx +181 -0
- package/src/components/agent-select.tsx +149 -0
- package/src/components/attachment-part-group.tsx +35 -0
- package/src/components/attachment-part.tsx +179 -0
- package/src/components/attachments-previewer.tsx +324 -0
- package/src/components/base-button.tsx +49 -0
- package/src/components/border-animation.tsx +107 -0
- package/src/components/border-color-animation.tsx +66 -0
- package/src/components/bot-avatar-name.tsx +36 -0
- package/src/components/bot-icon.tsx +23 -0
- package/src/components/bs-entry-select.tsx +724 -0
- package/src/components/bs-icons.tsx +1201 -0
- package/src/components/card-field.tsx +23 -0
- package/src/components/card.tsx +36 -0
- package/src/components/chat-area-header.tsx +65 -0
- package/src/components/circle-checker.tsx +66 -0
- package/src/components/collapsible-txt-msg.tsx +63 -0
- package/src/components/confirm-dialog.tsx +139 -0
- package/src/components/fake-bot-msg.tsx +49 -0
- package/src/components/fields-design-info-table.tsx +160 -0
- package/src/components/fields-generating-indicator.tsx +95 -0
- package/src/components/fields-portal.tsx +18 -0
- package/src/components/fields-previewer.tsx +216 -0
- package/src/components/font-icon.tsx +17 -0
- package/src/components/form-info-editor.tsx +253 -0
- package/src/components/formula-tag.tsx +32 -0
- package/src/components/generate-animation.tsx +56 -0
- package/src/components/icon-btn.tsx +43 -0
- package/src/components/img-part.tsx +27 -0
- package/src/components/legacy-slot.tsx +103 -0
- package/src/components/line-checker.tsx +160 -0
- package/src/components/linear-gradient-border-btn.tsx +48 -0
- package/src/components/linear-gradient-color-bg-animation.tsx +103 -0
- package/src/components/memoized-markdown.tsx +32 -0
- package/src/components/message-content.tsx +21 -0
- package/src/components/number-part.tsx +46 -0
- package/src/components/office-container.tsx +83 -0
- package/src/components/option-item.tsx +28 -0
- package/src/components/previewer-header.tsx +270 -0
- package/src/components/primary-confirm-btn.tsx +58 -0
- package/src/components/primary-entry-btn.tsx +48 -0
- package/src/components/scroll-to-bottom-btn.tsx +28 -0
- package/src/components/split-line.tsx +9 -0
- package/src/components/square-checker.tsx +87 -0
- package/src/components/tab-radio-group.tsx +83 -0
- package/src/components/tooltip.tsx +53 -0
- package/src/components/ui/button.tsx +51 -0
- package/src/components/ui/dialog.tsx +104 -0
- package/src/components/ui/icons.tsx +1267 -0
- package/src/components/ui/popover.tsx +50 -0
- package/src/components/ui/spinner.tsx +17 -0
- package/src/components/ui/tooltip.tsx +53 -0
- package/src/components/user-txt-msg-bubble.tsx +19 -0
- package/src/components/warning-msg.tsx +27 -0
- package/src/const/ui.ts +52 -0
- package/src/hooks/use-resizable-width.ts +92 -0
- package/src/hooks/use-shadow.ts +127 -0
- package/src/index.ts +76 -0
- package/src/lib/utils.ts +52 -0
- package/src/stories/AbsFullscreenGradientBg.stories.tsx +36 -0
- package/src/stories/AgentScrollSelector.stories.tsx +95 -0
- package/src/stories/AgentSelect.stories.tsx +134 -0
- package/src/stories/AttachmentPart.stories.tsx +122 -0
- package/src/stories/AttachmentPartGroup.stories.tsx +152 -0
- package/src/stories/AttachmentsPreviewer.stories.tsx +306 -0
- package/src/stories/BaseButton.stories.tsx +33 -0
- package/src/stories/BorderAnimation.stories.tsx +116 -0
- package/src/stories/BorderColorAnimation.stories.tsx +63 -0
- package/src/stories/BotAvatarAndName.stories.ts +24 -0
- package/src/stories/BotIcon.stories.ts +22 -0
- package/src/stories/BsEntrySelect.stories.tsx +261 -0
- package/src/stories/BsTooltip.stories.tsx +32 -0
- package/src/stories/Card.stories.tsx +28 -0
- package/src/stories/CardField.stories.tsx +87 -0
- package/src/stories/ChatAreaHeader.stories.ts +26 -0
- package/src/stories/CircleChecker.stories.tsx +89 -0
- package/src/stories/CollapsibleTextMsg.stories.ts +44 -0
- package/src/stories/ConfirmDialog.stories.tsx +123 -0
- package/src/stories/FakeBotMsg.stories.tsx +36 -0
- package/src/stories/FormInfoEditor.stories.tsx +173 -0
- package/src/stories/FormulaTag.stories.tsx +68 -0
- package/src/stories/GenerateAnimation.stories.ts +20 -0
- package/src/stories/IconBtn.stories.tsx +32 -0
- package/src/stories/IconLib.tsx +45 -0
- package/src/stories/Icons.stories.ts +22 -0
- package/src/stories/ImgMsgPart.stories.tsx +42 -0
- package/src/stories/LegacySlot.stories.tsx +56 -0
- package/src/stories/LineChecker.stories.tsx +134 -0
- package/src/stories/LinearGradientBorderBtn.stories.tsx +86 -0
- package/src/stories/LinearGradientColorBgAnimation.stories.tsx +60 -0
- package/src/stories/MemoizedMarkdown.stories.tsx +102 -0
- package/src/stories/MessageContent.stories.tsx +36 -0
- package/src/stories/NumbersMsgPart.stories.tsx +42 -0
- package/src/stories/OfficeContainer.stories.tsx +82 -0
- package/src/stories/OptionItem.stories.tsx +77 -0
- package/src/stories/PreviewerHeader.stories.tsx +91 -0
- package/src/stories/PrimaryConfirmBtn.stories.tsx +60 -0
- package/src/stories/PrimaryEntryBtn.stories.tsx +74 -0
- package/src/stories/ScrollToBottom.stories.tsx +24 -0
- package/src/stories/SplitLine.stories.tsx +40 -0
- package/src/stories/SquareChecker.stories.tsx +96 -0
- package/src/stories/TabRadioGroup.stories.tsx +84 -0
- package/src/stories/UserTextMsgBubble.stories.ts +24 -0
- package/src/stories/WarningMessage.stories.tsx +23 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/demo.css +539 -0
- package/src/stories/assets/demo_index.html +7988 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/iconfont.css +1377 -0
- package/src/stories/assets/iconfont.eot +0 -0
- package/src/stories/assets/iconfont.json +2382 -0
- package/src/stories/assets/iconfont.svg +697 -0
- package/src/stories/assets/iconfont.ttf +0 -0
- package/src/stories/assets/iconfont.woff +0 -0
- package/src/stories/assets/iconfont.woff2 +0 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/stories/fields-design-info-table.stories.tsx +203 -0
- package/src/stories/fields-generating.stories.tsx +41 -0
- package/src/stories/fields-previewer.stories.tsx +77 -0
- package/src/style.css +223 -0
- package/src/types.ts +8 -0
- package/tsconfig.json +12 -0
- package/vite.config.ts +42 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { LegacySlotRenderer } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface LegacySlotProps {
|
|
5
|
+
renderLegacy: LegacySlotRenderer;
|
|
6
|
+
props: unknown;
|
|
7
|
+
shadow?: boolean;
|
|
8
|
+
injectedStyles?: string;
|
|
9
|
+
withHostStyles?: boolean;
|
|
10
|
+
onSetRef?: (ref: HTMLDivElement) => void;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const STYLE_INJECTED_ATTR = 'data-style-injected';
|
|
14
|
+
|
|
15
|
+
const injectStylesIntoShadow = (currentElement: Node) => {
|
|
16
|
+
if (!currentElement) return;
|
|
17
|
+
|
|
18
|
+
let shadowRoot: ShadowRoot | null = null;
|
|
19
|
+
|
|
20
|
+
if (currentElement instanceof Element && currentElement.shadowRoot) {
|
|
21
|
+
shadowRoot = currentElement.shadowRoot;
|
|
22
|
+
} else {
|
|
23
|
+
let node: Node | null = currentElement.parentNode;
|
|
24
|
+
while (node) {
|
|
25
|
+
if (node instanceof ShadowRoot) {
|
|
26
|
+
shadowRoot = node;
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
node = node.parentNode;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (!shadowRoot) return;
|
|
34
|
+
if (shadowRoot.querySelector(`style[${STYLE_INJECTED_ATTR}]`)) return;
|
|
35
|
+
|
|
36
|
+
document.head.querySelectorAll('style').forEach((styleEl) => {
|
|
37
|
+
const cloned = styleEl.cloneNode(true) as HTMLElement;
|
|
38
|
+
cloned.setAttribute(STYLE_INJECTED_ATTR, '');
|
|
39
|
+
shadowRoot!.appendChild(cloned);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export function LegacySlot({
|
|
44
|
+
renderLegacy,
|
|
45
|
+
props,
|
|
46
|
+
shadow = false,
|
|
47
|
+
withHostStyles = false,
|
|
48
|
+
injectedStyles,
|
|
49
|
+
onSetRef,
|
|
50
|
+
}: LegacySlotProps) {
|
|
51
|
+
const hostRef = useRef<HTMLDivElement>(null);
|
|
52
|
+
const cleanupRef = useRef<(() => void) | null>(null);
|
|
53
|
+
const mountPointRef = useRef<HTMLDivElement | null>(null);
|
|
54
|
+
const targetRef = useRef<HTMLElement | ShadowRoot | null>(null);
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!hostRef.current) return;
|
|
58
|
+
|
|
59
|
+
const host = hostRef.current;
|
|
60
|
+
onSetRef?.(host);
|
|
61
|
+
let target: HTMLElement | ShadowRoot = host;
|
|
62
|
+
|
|
63
|
+
if (shadow) {
|
|
64
|
+
const shadowRoot = host.shadowRoot || host.attachShadow({ mode: 'open' });
|
|
65
|
+
target = shadowRoot;
|
|
66
|
+
|
|
67
|
+
if (withHostStyles) {
|
|
68
|
+
injectStylesIntoShadow(host);
|
|
69
|
+
}
|
|
70
|
+
if (typeof injectedStyles === 'string') {
|
|
71
|
+
const styleEl = document.createElement('style');
|
|
72
|
+
styleEl.setAttribute('data-legacy-injected-raw', '');
|
|
73
|
+
styleEl.textContent = injectedStyles;
|
|
74
|
+
shadowRoot.appendChild(styleEl);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
targetRef.current = target;
|
|
79
|
+
|
|
80
|
+
const mountPoint = document.createElement('div');
|
|
81
|
+
mountPoint.style.display = 'contents';
|
|
82
|
+
target.appendChild(mountPoint);
|
|
83
|
+
mountPointRef.current = mountPoint;
|
|
84
|
+
|
|
85
|
+
cleanupRef.current = renderLegacy(mountPoint, props as Record<string, any>);
|
|
86
|
+
|
|
87
|
+
return () => {
|
|
88
|
+
cleanupRef.current?.();
|
|
89
|
+
if (mountPointRef.current) {
|
|
90
|
+
mountPointRef.current.remove();
|
|
91
|
+
mountPointRef.current = null;
|
|
92
|
+
}
|
|
93
|
+
targetRef.current = null;
|
|
94
|
+
};
|
|
95
|
+
}, []);
|
|
96
|
+
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (!mountPointRef.current) return;
|
|
99
|
+
cleanupRef.current = renderLegacy(mountPointRef.current, props as Record<string, any>);
|
|
100
|
+
}, [props, renderLegacy]);
|
|
101
|
+
|
|
102
|
+
return <div ref={hostRef} style={{ display: 'contents' }} />;
|
|
103
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import React, { CSSProperties, useEffect, useState } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { cn } from '../lib/utils';
|
|
4
|
+
import { CheckerIcon } from './bs-icons';
|
|
5
|
+
import { SquareChecker } from './square-checker';
|
|
6
|
+
|
|
7
|
+
export interface LineCheckerProps {
|
|
8
|
+
defaultChecked?: boolean;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
12
|
+
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
title: string;
|
|
15
|
+
shortDesc?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
extra?: React.ReactNode;
|
|
18
|
+
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
streaming?: boolean;
|
|
21
|
+
confirmed?: boolean;
|
|
22
|
+
readonly?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const LineChecker: React.FC<LineCheckerProps> = ({
|
|
26
|
+
defaultChecked = false,
|
|
27
|
+
checked: checkedProp,
|
|
28
|
+
disabled = false,
|
|
29
|
+
onCheckedChange,
|
|
30
|
+
icon,
|
|
31
|
+
className,
|
|
32
|
+
title,
|
|
33
|
+
extra,
|
|
34
|
+
style,
|
|
35
|
+
streaming,
|
|
36
|
+
confirmed,
|
|
37
|
+
readonly,
|
|
38
|
+
shortDesc,
|
|
39
|
+
}) => {
|
|
40
|
+
const [checked, setChecked] = useState(defaultChecked);
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (checkedProp !== undefined) {
|
|
44
|
+
setChecked(checkedProp);
|
|
45
|
+
}
|
|
46
|
+
}, [checkedProp]);
|
|
47
|
+
|
|
48
|
+
const handleClick = () => {
|
|
49
|
+
if (streaming || disabled) return;
|
|
50
|
+
|
|
51
|
+
const newChecked = !checked;
|
|
52
|
+
setChecked(newChecked);
|
|
53
|
+
onCheckedChange?.(newChecked);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const hasExtra = Boolean(extra);
|
|
57
|
+
|
|
58
|
+
const checker =
|
|
59
|
+
confirmed && checked ? (
|
|
60
|
+
<CheckerIcon className="grow-0 shrink-0 text-[#0265ff]" />
|
|
61
|
+
) : (
|
|
62
|
+
<SquareChecker
|
|
63
|
+
className={classNames('outline-none grow-0 shrink-0 cursor-pointer', {
|
|
64
|
+
'mt-[2px]': hasExtra,
|
|
65
|
+
'opacity-80 cursor-not-allowed': disabled,
|
|
66
|
+
'opacity-50': streaming,
|
|
67
|
+
'pointer-events-none': streaming,
|
|
68
|
+
})}
|
|
69
|
+
id={title}
|
|
70
|
+
checked={checked}
|
|
71
|
+
disabled={disabled || confirmed}
|
|
72
|
+
onCheckedChange={handleClick}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div
|
|
78
|
+
className={cn(
|
|
79
|
+
'flex items-center gap-[10px] px-4 py-[10px] rounded-[4px]',
|
|
80
|
+
'w-full transition-colors cursor-pointer',
|
|
81
|
+
{
|
|
82
|
+
'cursor-not-allowed': disabled,
|
|
83
|
+
'hover:bg-[#EFF0F6]': !disabled,
|
|
84
|
+
'items-start': hasExtra,
|
|
85
|
+
'items-center': !hasExtra,
|
|
86
|
+
'pointer-events-none': streaming || disabled || readonly || confirmed,
|
|
87
|
+
},
|
|
88
|
+
className
|
|
89
|
+
)}
|
|
90
|
+
style={style}
|
|
91
|
+
onClick={() => {
|
|
92
|
+
handleClick();
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
{readonly ? null : checker}
|
|
96
|
+
|
|
97
|
+
<div
|
|
98
|
+
className={classNames('flex flex-col flex-1 min-w-0', {
|
|
99
|
+
'gap-2.5': hasExtra,
|
|
100
|
+
})}
|
|
101
|
+
>
|
|
102
|
+
<div
|
|
103
|
+
className={classNames('flex items-center justify-between w-full', {
|
|
104
|
+
'gap-1.5': !!icon,
|
|
105
|
+
'gap-2.5': !icon,
|
|
106
|
+
})}
|
|
107
|
+
>
|
|
108
|
+
<div
|
|
109
|
+
className={classNames('flex items-center gap-[6px] min-w-0', {
|
|
110
|
+
'flex-1': !!icon,
|
|
111
|
+
'w-[100px] flex-shrink-0': !icon,
|
|
112
|
+
})}
|
|
113
|
+
>
|
|
114
|
+
{/* Icon */}
|
|
115
|
+
{icon && (
|
|
116
|
+
<div className="w-4 h-4 flex-shrink-0 text-[#6F829E] leading-[16px]">{icon}</div>
|
|
117
|
+
)}
|
|
118
|
+
|
|
119
|
+
{/* Title - truncates */}
|
|
120
|
+
<p
|
|
121
|
+
className={classNames(' min-w-0 text-sm text-[#121111] truncate text-[12px]', {
|
|
122
|
+
'flex-1': !!icon,
|
|
123
|
+
'flex-grow-1 flex-shrink-0': !icon,
|
|
124
|
+
'!text-[#666]': readonly,
|
|
125
|
+
})}
|
|
126
|
+
>
|
|
127
|
+
{title}
|
|
128
|
+
</p>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
{shortDesc && (
|
|
132
|
+
<p
|
|
133
|
+
className={classNames('text-sm text-[#666] text-[12px]', {
|
|
134
|
+
'whitespace-nowrap flex-shrink-0': !!icon,
|
|
135
|
+
anywhere: !icon,
|
|
136
|
+
'!text-[#121111]': readonly,
|
|
137
|
+
})}
|
|
138
|
+
>
|
|
139
|
+
{shortDesc}
|
|
140
|
+
</p>
|
|
141
|
+
)}
|
|
142
|
+
</div>
|
|
143
|
+
{hasExtra ? (
|
|
144
|
+
<div
|
|
145
|
+
className={cn(
|
|
146
|
+
'overflow-x-auto whitespace-nowrap no-scrollbar flex items-center gap-2',
|
|
147
|
+
{
|
|
148
|
+
'!overflow-x-hidden': disabled || readonly || confirmed,
|
|
149
|
+
}
|
|
150
|
+
)}
|
|
151
|
+
>
|
|
152
|
+
{extra}
|
|
153
|
+
</div>
|
|
154
|
+
) : null}
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export default LineChecker;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cn } from '../lib/utils';
|
|
3
|
+
|
|
4
|
+
export interface LinearGradientBorderBtnProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const LinearGradientBorderBtn: React.FC<LinearGradientBorderBtnProps> = ({
|
|
12
|
+
children,
|
|
13
|
+
onClick,
|
|
14
|
+
disabled = false,
|
|
15
|
+
className,
|
|
16
|
+
}) => {
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
className={cn(
|
|
20
|
+
"relative rounded-[6px] p-[1px] cursor-pointer h-[34px] flex items-center justify-center",
|
|
21
|
+
"bg-gradient-to-b from-[#84B4FF] to-[#B1FAFF]",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
style={{
|
|
25
|
+
background: 'linear-gradient(180deg, #84B4FF 0%, #B1FAFF 100%)',
|
|
26
|
+
}}
|
|
27
|
+
>
|
|
28
|
+
<button
|
|
29
|
+
className={cn(
|
|
30
|
+
"w-full h-[32px] px-[10px]",
|
|
31
|
+
"bg-white rounded-[5px]",
|
|
32
|
+
"flex items-center justify-center",
|
|
33
|
+
"text-[#0265ff] text-[14px]",
|
|
34
|
+
"cursor-pointer",
|
|
35
|
+
"transition-all duration-200",
|
|
36
|
+
"hover:bg-[#f5f9ff]",
|
|
37
|
+
"disabled:opacity-95 disabled:cursor-not-allowed"
|
|
38
|
+
)}
|
|
39
|
+
onClick={onClick}
|
|
40
|
+
disabled={disabled}
|
|
41
|
+
>
|
|
42
|
+
{children}
|
|
43
|
+
</button>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default LinearGradientBorderBtn;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export const LinearGradientColorBgAnimation = ({
|
|
2
|
+
children,
|
|
3
|
+
width,
|
|
4
|
+
height,
|
|
5
|
+
style,
|
|
6
|
+
childrenContainerStyle,
|
|
7
|
+
}: {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
width?: string | number;
|
|
10
|
+
height?: string | number;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
childrenContainerStyle?: React.CSSProperties;
|
|
13
|
+
}) => {
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
style={{
|
|
17
|
+
position: 'relative',
|
|
18
|
+
width: width ?? '100%',
|
|
19
|
+
height: height ?? '100%',
|
|
20
|
+
overflow: 'hidden',
|
|
21
|
+
borderRadius: '10px 10px 0 0',
|
|
22
|
+
...style,
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
<div
|
|
26
|
+
style={{
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
width: '100%',
|
|
29
|
+
height: '100%',
|
|
30
|
+
top: 0,
|
|
31
|
+
left: 0,
|
|
32
|
+
background: '#F4FFFC',
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
<div
|
|
36
|
+
style={{
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
width: '100%',
|
|
39
|
+
height: '100%',
|
|
40
|
+
top: 0,
|
|
41
|
+
left: 0,
|
|
42
|
+
background: 'radial-gradient(circle at 25% -15%, #EEFFCE 0%, transparent 55%)',
|
|
43
|
+
filter: 'blur(70px)',
|
|
44
|
+
animation: 'floatCircle1 4s ease-in-out infinite',
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
<div
|
|
48
|
+
style={{
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
width: '100%',
|
|
51
|
+
height: '100%',
|
|
52
|
+
top: 0,
|
|
53
|
+
left: 0,
|
|
54
|
+
background: 'radial-gradient(circle at 80% 200%, #CEFFFB 0%, transparent 45%)',
|
|
55
|
+
filter: 'blur(70px)',
|
|
56
|
+
animation: 'floatCircle2 5s ease-in-out infinite 0.5s',
|
|
57
|
+
}}
|
|
58
|
+
/>
|
|
59
|
+
<div style={{ position: 'relative', zIndex: 1, width: '100%', height: '100%', ...childrenContainerStyle }}>
|
|
60
|
+
{children}
|
|
61
|
+
</div>
|
|
62
|
+
<style>{`
|
|
63
|
+
@keyframes floatCircle1 {
|
|
64
|
+
0%, 100% {
|
|
65
|
+
transform: translate(0%, 0%) scale(1.2);
|
|
66
|
+
opacity: 1;
|
|
67
|
+
}
|
|
68
|
+
25% {
|
|
69
|
+
transform: translate(-15%, 20%) scale(1.6);
|
|
70
|
+
opacity: 0.95;
|
|
71
|
+
}
|
|
72
|
+
50% {
|
|
73
|
+
transform: translate(12%, -15%) scale(0.9);
|
|
74
|
+
opacity: 1;
|
|
75
|
+
}
|
|
76
|
+
75% {
|
|
77
|
+
transform: translate(-10%, 10%) scale(1.4);
|
|
78
|
+
opacity: 0.9;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@keyframes floatCircle2 {
|
|
83
|
+
0%, 100% {
|
|
84
|
+
transform: translate(0%, 0%) scale(1.1);
|
|
85
|
+
opacity: 1;
|
|
86
|
+
}
|
|
87
|
+
30% {
|
|
88
|
+
transform: translate(18%, -12%) scale(1.5);
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
60% {
|
|
92
|
+
transform: translate(-12%, 15%) scale(0.85);
|
|
93
|
+
opacity: 0.95;
|
|
94
|
+
}
|
|
95
|
+
85% {
|
|
96
|
+
transform: translate(14%, -8%) scale(1.3);
|
|
97
|
+
opacity: 0.9;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
`}</style>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { marked } from "marked";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import ReactMarkdown from "react-markdown";
|
|
4
|
+
|
|
5
|
+
function parseMarkdownIntoBlocks(markdown: string): string[] {
|
|
6
|
+
const tokens = marked.lexer(markdown);
|
|
7
|
+
return tokens.map((token) => token.raw);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const MemoizedMarkdownBlock = memo(
|
|
11
|
+
({ content }: { content: string }) => {
|
|
12
|
+
return <ReactMarkdown>{content}</ReactMarkdown>;
|
|
13
|
+
},
|
|
14
|
+
(prevProps, nextProps) => {
|
|
15
|
+
if (prevProps.content !== nextProps.content) return false;
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
MemoizedMarkdownBlock.displayName = "MemoizedMarkdownBlock";
|
|
21
|
+
|
|
22
|
+
export const MemoizedMarkdown = memo(
|
|
23
|
+
({ content, id }: { content: string; id: string }) => {
|
|
24
|
+
const blocks = useMemo(() => parseMarkdownIntoBlocks(content), [content]);
|
|
25
|
+
|
|
26
|
+
return blocks.map((block, index) => (
|
|
27
|
+
<MemoizedMarkdownBlock content={block} key={`${id}-block_${index}`} />
|
|
28
|
+
));
|
|
29
|
+
},
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
MemoizedMarkdown.displayName = "MemoizedMarkdown";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { cn } from '../lib/utils';
|
|
3
|
+
|
|
4
|
+
export type MessageContentProps = HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const MessageContent = ({ children, className, ...props }: MessageContentProps) => (
|
|
9
|
+
<div
|
|
10
|
+
className={cn(
|
|
11
|
+
'flex flex-col gap-2.5 overflow-hidden p-0 text-foreground text-[14px]',
|
|
12
|
+
'group-[.is-user]:bg-primary group-[.is-user]:text-primary-foreground',
|
|
13
|
+
'group-[.is-assistant]:bg-secondary group-[.is-assistant]:text-foreground',
|
|
14
|
+
'is-user:dark overflow-visible',
|
|
15
|
+
className
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
{children}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn } from '../lib/utils';
|
|
2
|
+
import { XlsxIcon } from './bs-icons';
|
|
3
|
+
|
|
4
|
+
export interface NumbersMsgPartProps {
|
|
5
|
+
/** File name to display (optional) */
|
|
6
|
+
fileName?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Size in pixels (width & height), defaults to 102 */
|
|
9
|
+
size?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const NumbersMsgPart = ({ fileName, className, size = 102 }: NumbersMsgPartProps) => {
|
|
13
|
+
// Calculate icon size proportionally (52/102 ≈ 51% of container)
|
|
14
|
+
const iconScale = size / 102;
|
|
15
|
+
const hasFileName = Boolean(fileName);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
className={cn(
|
|
20
|
+
'relative flex flex-col items-center justify-center rounded-[10px] bg-[#EFF0F6] px-[10px]',
|
|
21
|
+
hasFileName && 'gap-[6px]',
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
style={{ width: size, height: size }}
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
className="shrink-0"
|
|
28
|
+
style={{
|
|
29
|
+
transform: iconScale !== 1 ? `scale(${iconScale})` : undefined,
|
|
30
|
+
transformOrigin: 'center',
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<XlsxIcon />
|
|
34
|
+
</div>
|
|
35
|
+
{hasFileName && (
|
|
36
|
+
<p
|
|
37
|
+
className="block max-w-full shrink-0 truncate text-center text-[14px] leading-normal text-[#030303]"
|
|
38
|
+
style={{ fontSize: 14 * iconScale, maxWidth: '100%', display: 'block' }}
|
|
39
|
+
title={fileName}
|
|
40
|
+
>
|
|
41
|
+
{fileName}
|
|
42
|
+
</p>
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { useResizableWidth } from '../hooks/use-resizable-width';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
|
|
5
|
+
export interface IOfficeContainerProps {
|
|
6
|
+
headerHeight?: number;
|
|
7
|
+
|
|
8
|
+
hideLeftCol?: boolean;
|
|
9
|
+
|
|
10
|
+
leftColWidthRange?: [number, number];
|
|
11
|
+
leftColHeaderElement?: React.ReactNode;
|
|
12
|
+
leftColContentElement?: React.ReactNode;
|
|
13
|
+
rightColHeaderElement?: React.ReactNode;
|
|
14
|
+
rightColContentElement?: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const OfficeContainer: FC<IOfficeContainerProps> = ({
|
|
18
|
+
headerHeight = 64,
|
|
19
|
+
hideLeftCol = false,
|
|
20
|
+
leftColWidthRange = [360, 500],
|
|
21
|
+
leftColHeaderElement,
|
|
22
|
+
leftColContentElement,
|
|
23
|
+
rightColHeaderElement,
|
|
24
|
+
rightColContentElement,
|
|
25
|
+
}) => {
|
|
26
|
+
const { width: leftColWidth, handleMouseDown, isDragging } = useResizableWidth({
|
|
27
|
+
range: leftColWidthRange,
|
|
28
|
+
initialWidth: leftColWidthRange[0]
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const borderColorCls = /* isAtEdge ? 'border-[#ff8888]' : */ 'border-[#0265fc]';
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<div className="relative h-full w-full flex overflow-hidden bg-white">
|
|
35
|
+
{/* left col */}
|
|
36
|
+
<div
|
|
37
|
+
className={classNames("shrink-0 h-full flex flex-col relative bg-[#F5F7FA]", {
|
|
38
|
+
"pointer-events-none": hideLeftCol,
|
|
39
|
+
"opacity-0": hideLeftCol,
|
|
40
|
+
})}
|
|
41
|
+
style={{ width: hideLeftCol ? 0 : leftColWidth }}
|
|
42
|
+
>
|
|
43
|
+
<div
|
|
44
|
+
className="shrink-0 w-full"
|
|
45
|
+
style={{ height: headerHeight }}
|
|
46
|
+
>
|
|
47
|
+
{leftColHeaderElement}
|
|
48
|
+
</div>
|
|
49
|
+
<div className="flex-1 min-h-0 overflow-auto">
|
|
50
|
+
{leftColContentElement}
|
|
51
|
+
</div>
|
|
52
|
+
{/* resizer */}
|
|
53
|
+
<div
|
|
54
|
+
className={classNames(`h-full w-5 cursor-col-resize z-10 flex justify-center group absolute top-0 right-0 hover:border-r hover:${borderColorCls}`, {
|
|
55
|
+
[`border-r ${borderColorCls}`]: isDragging,
|
|
56
|
+
})}
|
|
57
|
+
onMouseDown={handleMouseDown}
|
|
58
|
+
>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
{/* right col */}
|
|
65
|
+
<div className={
|
|
66
|
+
classNames("flex-1 h-full flex flex-col min-w-0", {
|
|
67
|
+
// "shadow-[0_0_16px_rgba(0,0,0,0.10)]": !isDragging,
|
|
68
|
+
// "shadow-[0_0_20px_rgba(0,0,0,0.10)]": isDragging,
|
|
69
|
+
})
|
|
70
|
+
}>
|
|
71
|
+
<div
|
|
72
|
+
className="shrink-0 w-full"
|
|
73
|
+
style={{ height: headerHeight }}
|
|
74
|
+
>
|
|
75
|
+
{rightColHeaderElement}
|
|
76
|
+
</div>
|
|
77
|
+
<div className="flex-1 min-h-0 overflow-auto">
|
|
78
|
+
{rightColContentElement}
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export interface OptionItemProps {
|
|
4
|
+
bgColor?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const OptionItem = ({
|
|
11
|
+
bgColor = "#E8F4FF",
|
|
12
|
+
color = "#0265FF",
|
|
13
|
+
label,
|
|
14
|
+
children,
|
|
15
|
+
}: OptionItemProps
|
|
16
|
+
) => {
|
|
17
|
+
return (
|
|
18
|
+
<div
|
|
19
|
+
className="flex items-center justify-center gap-1.5 px-1.5 h-[26px] rounded-[100px] text-[13px]"
|
|
20
|
+
style={{
|
|
21
|
+
backgroundColor: bgColor,
|
|
22
|
+
color: color,
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
{label || children}
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|