Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

♻️ refactor(ui): migrate @lobehub/ui components to base-ui (#16909)

Innei5befbdd968ae
diff --git a/e2e/src/steps/agent/conversation-mgmt.steps.ts b/e2e/src/steps/agent/conversation-mgmt.steps.ts
index 3c53f6b2569..b30b30f6fc4 100644
--- a/e2e/src/steps/agent/conversation-mgmt.steps.ts
+++ b/e2e/src/steps/agent/conversation-mgmt.steps.ts
@@ -435,7 +435,7 @@ When('用户确认删除', async function (this: CustomWorld) {
const confirmButton = this.page
.getByRole('dialog')
- .getByRole('button', { name: /^(ok|delete|删除|确认|确定)$/i });
+ .getByRole('button', { name: /^(ok|delete( topic)?|删除(话题)?|确认|确定)$/i });
await expect(confirmButton).toBeVisible({ timeout: 5000 });
await confirmButton.click();
diff --git a/e2e/src/steps/agent/scroll.steps.ts b/e2e/src/steps/agent/scroll.steps.ts
index f8ced1c9ab4..f50b60892fb 100644
--- a/e2e/src/steps/agent/scroll.steps.ts
+++ b/e2e/src/steps/agent/scroll.steps.ts
@@ -275,15 +275,21 @@ When('用户在流式响应进行中向上滚动 {int} 像素', async function (
await this.page.waitForTimeout(400);
});
-When('等待流式响应结束', { timeout: 30_000 }, async function (this: CustomWorld) {
+When('等待流式响应结束', { timeout: 60_000 }, async function (this: CustomWorld) {
const assistantMessage = this.page
.locator('.message-wrapper')
.filter({ has: this.page.locator('text=Lobe AI') })
.last();
+ // With the slowed mock (streamDelay 60ms × 8-char chunks) a long article
+ // genuinely streams for ~25s now that the mock delivers real token-by-token
+ // SSE. Returning before the stream ends makes the next send get queued
+ // instead of appended, so exhaust the deadline and fail loudly instead of
+ // silently moving on.
+ const deadline = Date.now() + 55_000;
let prevLen = 0;
let stableTicks = 0;
- for (let i = 0; i < 60; i++) {
+ while (Date.now() < deadline) {
const len =
(await assistantMessage
.innerText()
@@ -292,9 +298,11 @@ When('等待流式响应结束', { timeout: 30_000 }, async function (this: Cust
if (len > 200 && len === prevLen) stableTicks += 1;
else stableTicks = 0;
prevLen = len;
- if (stableTicks >= 3) break;
+ if (stableTicks >= 3) return;
await this.page.waitForTimeout(250);
}
+
+ throw new Error(`streaming did not settle before deadline (last length: ${prevLen})`);
});
// ---------------------------------------------------------------------------
diff --git a/eslint-suppressions.json b/eslint-suppressions.json
index bce827e0bcb..a985d398c49 100644
--- a/eslint-suppressions.json
+++ b/eslint-suppressions.json
@@ -1,1404 +1,9 @@
{
- "src/components/404/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/Error/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/FeedbackModal/FeedbackContent.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/FileParsingStatus/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/HighlightNotification/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/HtmlPreview/PreviewDrawer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/InvalidAPIKey/Bedrock.tsx": {
- "no-restricted-imports": {
- "count": 2
- }
- },
- "src/components/InvalidAPIKey/ComfyUIForm.tsx": {
- "no-restricted-imports": {
- "count": 2
- }
- },
- "src/components/InvalidAPIKey/ProviderApiKeyForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/InvalidAPIKey/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/JSONSchemaConfig/ItemRender.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/KeyValueEditor/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/components/RenameModal/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentDocumentsExplorer/ConvertToSkillModal.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentMockDevtools/Popover.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentMockDevtools/views/FixtureView.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentSetting/AgentMeta/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentSetting/AgentOpening/OpeningMessage.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentSetting/AgentOpening/OpeningQuestions.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentSetting/AgentPlugin/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentSetting/AgentPrompt/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentSkillEdit/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTasks/AgentTaskDetail/TaskDetailPage.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTasks/AgentTaskDetail/TaskDetailRunPauseAction.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTasks/AgentTaskDetail/TaskParentBar.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTasks/AgentTaskDetail/TaskScheduleConfig.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx": {
- "no-restricted-imports": {
- "count": 2
- }
- },
- "src/features/AgentTasks/AgentTaskDetail/TopicChatDrawer/FeedbackInput.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTasks/AgentTaskDetail/VerifyCriterionModal/VerifyCriterionForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTasks/AgentTaskList/TasksGroupConfig.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTasks/features/TaskListHeader.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTopicManager/EmptyState.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AgentTopicManager/MoveTopicsModal/Content.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/AlertBanner/CloudBanner.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/AuthError/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/MarketAuthCallback/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/OAuthCallback/Error.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/OAuthConsent/Consent/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/OAuthConsent/Login.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/OAuthDevice/DeviceCodeConfirm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/OAuthDevice/DeviceCodeInput.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/ResetPassword/ResetPasswordContent.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/ResetPassword/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/SignIn/SignInEmailStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/SignIn/SignInPasswordStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/SignUp/BetterAuthSignUpForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/VerifyEmail/VerifyEmailContent.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Auth/VerifyEmail/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Billboard/Carousel.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ChatInput/ActionBar/Params/Controls.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ChatInput/ControlBar/ApprovalMode.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ChatInput/ControlBar/CreateBranchModal.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ChatInput/ControlBar/RenameBranchModal.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/CommunityWorkspaceSettings/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/ChatInput/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Error/ChatInvalidApiKey.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Error/OllamaBizError/InvalidOllamaModel.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Error/OllamaSetupGuide/Desktop.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Error/PlanLimitCard/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
"src/features/Conversation/Error/index.test.tsx": {
"no-restricted-imports": {
"count": 1
}
},
- "src/features/Conversation/Messages/AgentCouncil/components/ScrollShadowWithButton.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/KeyValueEditor.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Messages/AssistantGroup/Tool/Detail/PluginSettings.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Messages/AssistantGroup/components/CollapsedMessage.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Messages/TaskCallback/index.tsx": {
- "no-restricted-imports": {
- "count": 2
- }
- },
- "src/features/Conversation/Messages/Tool/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Messages/User/components/ContentPreview.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Messages/Verify/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/Messages/components/Extras/TTS/Player.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/components/ShareMessageModal/ShareImage/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Conversation/components/ShareMessageModal/ShareText/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/CreatePlatformAgent/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/DailyBrief/BriefCardActions.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/DailyBrief/BriefCardSummary.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/DailyBrief/CommentInput.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/DailyBrief/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/DataImporter/Error.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/DataImporter/SuccessResult.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/DevFeatureFlagPanel/Panel.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/DeviceManager/DeviceDetailPanel.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/DeviceManager/DeviceManager.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/EditorCanvas/LinearFilePlugin.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Electron/AuthRequiredModal/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Electron/HeterogeneousAgent/StatusGuide/GuideActions.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Electron/HeterogeneousAgent/StatusGuide/states/OverloadedState.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Electron/connection/ConnectionMode.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Electron/connection/Waiting.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/FileViewer/NotSupport/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Fleet/AgentColumn.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Fleet/RunningTaskSidebar.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/LibraryModal/AssignKnowledgeBase/Item/Action.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/LibraryModal/CreateNew/CreateForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/LocalFile/LocalFile.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/MCP/MCPInstallProgress/InstallError/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/MCP/MCPInstallProgress/MCPConfigForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/MCP/MCPSettings/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/MCPPluginDetail/Header.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/MCPPluginDetail/Score/GithubBadge/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Messenger/IntegrationDetail/Discord.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Messenger/IntegrationDetail/Slack.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Messenger/IntegrationDetail/Telegram.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Messenger/IntegrationDetail/shared.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Messenger/LinkModal/Discord.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Messenger/LinkModal/Slack.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Messenger/LinkModal/Telegram.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Messenger/Verify/Body/shared.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Messenger/Verify/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/NavPanel/components/BackNav.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/OllamaModelDownloader/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Onboarding/Agent/CompletionPanel.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Onboarding/Agent/DebugExportButton.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Onboarding/Agent/FeedbackPanel.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Onboarding/Agent/HistoryPanel.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Onboarding/Agent/MessengerIntegrations.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Onboarding/Agent/WrapUpHint.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Onboarding/Agent/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PageEditor/History/CompareModal/CompareContent.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PageEditor/History/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PageEditor/PageEditor.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PageEditor/TitleSection.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PluginDevModal/MCPManifestForm/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PluginDevModal/PluginPreview/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PluginDevModal/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/PluginTag/PluginStatus.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Portal/Artifacts/Body/Renderer/SVG.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Portal/Document/Body.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Portal/VerifyResult/Body.tsx": {
- "no-restricted-imports": {
- "count": 2
- }
- },
- "src/features/Portal/VerifyResult/Title.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ProfileEditor/AgentTool.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/RecommendTaskTemplates/ConnectorAuthRow.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/RecommendTaskTemplates/TaskTemplateCard.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/RecommendTaskTemplates/TaskTemplateDetailModal.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Recommendations/RecommendationCard.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Recommendations/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/ListView/ListItem/FileListItemActions.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/ListView/ListViewSelectAllHint.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/MasonryView/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Explorer/ToolBar/MultiSelectActions.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ResourceManager/components/Header/AddButton.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ShareModal/ShareImage/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ShareModal/ShareJSON/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ShareModal/SharePdf/PdfPreview.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ShareModal/SharePdf/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/ShareModal/ShareText/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/SharePopover/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/SkillStore/SkillList/AddSkillButton.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/SkillsList/RenameSkillModal.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/TopicPopupGuard/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/User/UserLoginOrSignup/Community.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Verify/CheckerDock.tsx": {
- "no-restricted-imports": {
- "count": 2
- }
- },
- "src/features/Verify/RunResult.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/WorkingDirectory/AddWorkingDirModal.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/Workspace/WorkspaceSlugBoundary.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/features/WorkspaceSetting/Storage/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/layout/GlobalProvider/ServerVersionOutdatedAlert.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(desktop)/desktop-onboarding/features/DataModeStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(desktop)/desktop-onboarding/features/PermissionsStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/(create)/features/GenerationInput/GenerationInvalidAPIKey.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/(create)/image/features/ConfigPanel/components/InputNumber/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/(create)/image/features/ConfigPanel/components/ModelSelect/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/(create)/image/features/ConfigPanel/components/QualitySelect.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/(create)/image/features/ConfigPanel/components/Select/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/(create)/video/features/ConfigPanel/components/ModelSelect/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx": {
- "no-restricted-imports": {
- "count": 2
- }
- },
- "src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/agent/features/Conversation/MainChatInput/AgentConfigError.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/agent/features/Conversation/WorkingSidebar/AgentSummary.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/agent/features/TelemetryNotification.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/agent/features/Header.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/agent/features/Sidebar/ActionButton/AddAgent.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/agent/features/StatusPage/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/features/Block.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/features/FollowButton.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/group_agent/features/Header.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/AddGroupAgent.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/ForkGroupAndChat.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/mcp/features/Sidebar/ActionButton/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/model/features/Sidebar/ActionButton/ChatWithModel.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/provider/features/Sidebar/ActionButton/ProviderConfig.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/skill/features/Header.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/skill/features/Sidebar/Platform.tsx": {
- "no-restricted-imports": {
- "count": 2
- }
- },
- "src/routes/(main)/community/(detail)/user/features/Header/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/workspace/features/Header/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/workspace/features/WorkspaceContent.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(detail)/workspace/features/WorkspaceProfileModal/Content.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(list)/(home)/features/CreatorRewardBanner.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(list)/_layout/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(list)/agent/features/MarketSourceSwitch.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/(list)/features/SortButton/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/components/Title.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/features/CreateButton/Inner.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/features/LikeButton.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/community/features/UserAvatar/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/datasets/[datasetId]/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/features/BenchmarkHeader/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/DatasetCard.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/EmptyState.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseEmptyState.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/features/RunEditModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/EmptyState.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/IdleState/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/RunInfo/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/BenchmarkCard/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/BenchmarkEditModal/Content.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/BenchmarkEditModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/CreateBenchmarkModal/Content.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/CreateBenchmarkModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/DatasetCreateModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/DatasetEditModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/DatasetImportModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/TestCaseCreateModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/features/TestCaseEditModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/eval/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/group/features/TelemetryNotification.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/group/profile/features/GroupProfile/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/group/profile/features/MemberProfile/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/home/features/InputArea/StarterList.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/home/features/components/ScrollShadowWithButton/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/memory/features/ActionBar/PurgeButton.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/memory/features/FilterBar.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/memory/features/MemoryAnalysis/AnalysisTrigger.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/memory/features/SourceLink.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/about/features/Version.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/agent/features/SystemAgentForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/apikey/features/ApiKey.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/apikey/features/ApiKeyModal/Content.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/creds/features/CreateCredModal/FileCredForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/creds/features/CreateCredModal/KVCredForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/creds/features/CredItem.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/creds/features/CredsList.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/creds/features/EditCredModal/EditKVForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/creds/features/EditCredModal/EditMetaForm.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/creds/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/features/UpgradeAlert.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/profile/features/EmailRow.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/profile/features/PasswordRow.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/profile/features/UsernameRow.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/detail/bedrock/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/detail/comfyui/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/detail/vertexai/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/features/CreateNewProvider/Content.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/features/ModelList/EmptyModels.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/Footer.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/features/ModelList/ModelTitle/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/skill/features/BuiltinSkillItem.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/skill/features/LeftPanel.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/storage/features/Advanced.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/system-tools/features/CliTestSection.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(main)/settings/system-tools/features/ToolDetectorSection.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/(mobile)/(home)/features/SessionListContent/List/AddButton.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/onboarding/features/AgentPickerStep/index.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/onboarding/features/FullNameStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/onboarding/features/InterestsStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/onboarding/features/ModeSelectionStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/onboarding/features/ProSettingsStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "src/routes/onboarding/features/ResponseLanguageStep.tsx": {
- "no-restricted-imports": {
- "count": 2
- }
- },
- "src/routes/onboarding/features/TelemetryStep.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
"src/store/chat/slices/message/action.test.ts": {
"no-restricted-imports": {
"count": 1
diff --git a/src/components/404/index.tsx b/src/components/404/index.tsx
index 95b9ad0728a..ebe3e4bba07 100644
--- a/src/components/404/index.tsx
+++ b/src/components/404/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, FluentEmoji } from '@lobehub/ui';
+import { Flexbox, FluentEmoji } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type ReactNode } from 'react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/components/ChatGroupWizard/ChatGroupWizard.tsx b/src/components/ChatGroupWizard/ChatGroupWizard.tsx
index 8eb9c2dbb1f..4f315bb53f3 100644
--- a/src/components/ChatGroupWizard/ChatGroupWizard.tsx
+++ b/src/components/ChatGroupWizard/ChatGroupWizard.tsx
@@ -12,8 +12,7 @@ import {
Text,
Tooltip,
} from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
-import { Switch } from 'antd';
+import { Button, Switch } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { omit } from 'es-toolkit/compat';
import { Users } from 'lucide-react';
diff --git a/src/components/DragUpload/useDragUpload.test.tsx b/src/components/DragUpload/useDragUpload.test.tsx
index 66db8a57e17..279f1bc7e6a 100644
--- a/src/components/DragUpload/useDragUpload.test.tsx
+++ b/src/components/DragUpload/useDragUpload.test.tsx
@@ -9,15 +9,14 @@ import { agentSelectors } from '@/store/agent/selectors';
import { getContainer, useDragUpload } from './useDragUpload';
-interface AntdMockModule {
- App: typeof App;
-}
-
// Mock the hooks and components
vi.mock('@/hooks/useVisualMediaUploadAbility');
vi.mock('@/store/agent');
vi.mock('antd', async () => {
- const actual = await vi.importActual<AntdMockModule>('antd');
+ const actual = (await vi.importActual('antd')) as { App: Record<string, unknown> } & Record<
+ string,
+ unknown
+ >;
const mockWarning = vi.fn();
return {
diff --git a/src/components/Error/index.tsx b/src/components/Error/index.tsx
index 05d6990f714..94498509c0d 100644
--- a/src/components/Error/index.tsx
+++ b/src/components/Error/index.tsx
@@ -1,14 +1,7 @@
'use client';
-import {
- Accordion,
- AccordionItem,
- Block,
- Button,
- Flexbox,
- FluentEmoji,
- Highlighter,
-} from '@lobehub/ui';
+import { Accordion, AccordionItem, Block, Flexbox, FluentEmoji, Highlighter } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import type { Key } from 'react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/components/FeedbackModal/FeedbackContent.tsx b/src/components/FeedbackModal/FeedbackContent.tsx
index a1df5d78194..b15af166436 100644
--- a/src/components/FeedbackModal/FeedbackContent.tsx
+++ b/src/components/FeedbackModal/FeedbackContent.tsx
@@ -1,8 +1,8 @@
'use client';
import { BRANDING_EMAIL } from '@lobechat/business-const';
-import { Button, Flexbox, Icon } from '@lobehub/ui';
-import { useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Icon } from '@lobehub/ui';
+import { Button, useModalContext } from '@lobehub/ui/base-ui';
import { App, Form, Input, Upload } from 'antd';
import { ImagePlus, Send } from 'lucide-react';
import { memo, useCallback, useState } from 'react';
diff --git a/src/components/FileParsingStatus/index.tsx b/src/components/FileParsingStatus/index.tsx
index 4d98615ec98..d68a288a04d 100644
--- a/src/components/FileParsingStatus/index.tsx
+++ b/src/components/FileParsingStatus/index.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Icon, Tag, Tooltip } from '@lobehub/ui';
+import { Flexbox, Icon, Tag, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Badge } from 'antd';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { BoltIcon, Loader2Icon, RotateCwIcon } from 'lucide-react';
diff --git a/src/components/HighlightNotification/index.tsx b/src/components/HighlightNotification/index.tsx
index 963a97eec9c..19799edff70 100644
--- a/src/components/HighlightNotification/index.tsx
+++ b/src/components/HighlightNotification/index.tsx
@@ -1,7 +1,8 @@
'use client';
import { HeartFilled } from '@ant-design/icons';
-import { ActionIcon, Button, Flexbox } from '@lobehub/ui';
+import { ActionIcon, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { X } from 'lucide-react';
import type { HTMLAttributeAnchorTarget, ReactNode } from 'react';
diff --git a/src/components/HtmlPreview/PreviewDrawer.tsx b/src/components/HtmlPreview/PreviewDrawer.tsx
index 0e287d9b027..161cc4fb822 100644
--- a/src/components/HtmlPreview/PreviewDrawer.tsx
+++ b/src/components/HtmlPreview/PreviewDrawer.tsx
@@ -1,7 +1,7 @@
import { TITLE_BAR_HEIGHT } from '@lobechat/desktop-bridge';
import { exportFile } from '@lobechat/utils/client';
-import { Block, Button, Flexbox, Highlighter, HtmlPreview } from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
+import { Block, Flexbox, Highlighter, HtmlPreview } from '@lobehub/ui';
+import { Button, Tabs } from '@lobehub/ui/base-ui';
import { Drawer } from 'antd';
import { createStaticStyles } from 'antd-style';
import { Code2, Download, Eye } from 'lucide-react';
@@ -76,12 +76,7 @@ const HtmlPreviewDrawer = memo<HtmlPreviewDrawerProps>(({ content, open, onClose
]}
onChange={(key) => setMode(key as 'preview' | 'code')}
/>
- <Button
- color={'default'}
- icon={<Download size={16} />}
- variant={'filled'}
- onClick={onDownload}
- >
+ <Button icon={<Download size={16} />} type={'fill'} onClick={onDownload}>
{t('HtmlPreview.actions.download')}
</Button>
</Flexbox>
diff --git a/src/components/InstantSwitch/index.tsx b/src/components/InstantSwitch/index.tsx
index 1489b1b0d2a..2b8087b5a85 100644
--- a/src/components/InstantSwitch/index.tsx
+++ b/src/components/InstantSwitch/index.tsx
@@ -1,5 +1,5 @@
-import { type SwitchProps } from 'antd';
-import { Switch } from 'antd';
+import type { SwitchProps } from '@lobehub/ui/base-ui';
+import { Switch } from '@lobehub/ui/base-ui';
import { memo, useState } from 'react';
interface InstantSwitchProps {
diff --git a/src/components/InvalidAPIKey/Bedrock.tsx b/src/components/InvalidAPIKey/Bedrock.tsx
index 30f21a2a6c1..a4a5a89a580 100644
--- a/src/components/InvalidAPIKey/Bedrock.tsx
+++ b/src/components/InvalidAPIKey/Bedrock.tsx
@@ -1,6 +1,6 @@
import { Aws } from '@lobehub/icons';
-import { Button, Icon, InputPassword, Select } from '@lobehub/ui';
-import { Tabs, type TabsItem } from '@lobehub/ui/base-ui';
+import { Icon, InputPassword } from '@lobehub/ui';
+import { Button, Select, Tabs, type TabsItem } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Network, ShieldPlus } from 'lucide-react';
import { ModelProvider } from 'model-bank';
diff --git a/src/components/InvalidAPIKey/ComfyUIForm.tsx b/src/components/InvalidAPIKey/ComfyUIForm.tsx
index 85f8f3add3e..81159e7192d 100644
--- a/src/components/InvalidAPIKey/ComfyUIForm.tsx
+++ b/src/components/InvalidAPIKey/ComfyUIForm.tsx
@@ -1,7 +1,8 @@
'use client';
import { ComfyUI } from '@lobehub/icons';
-import { Button, Center, Flexbox, Icon, Select } from '@lobehub/ui';
+import { Center, Flexbox, Icon } from '@lobehub/ui';
+import { Button, Select } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { Loader2Icon, Network } from 'lucide-react';
import { memo, use, useEffect, useState } from 'react';
diff --git a/src/components/InvalidAPIKey/ProviderApiKeyForm.tsx b/src/components/InvalidAPIKey/ProviderApiKeyForm.tsx
index c68a30715f6..7d158c3be95 100644
--- a/src/components/InvalidAPIKey/ProviderApiKeyForm.tsx
+++ b/src/components/InvalidAPIKey/ProviderApiKeyForm.tsx
@@ -1,4 +1,5 @@
-import { Button, Icon } from '@lobehub/ui';
+import { Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Loader2Icon, Network } from 'lucide-react';
import { type ReactNode } from 'react';
import { memo, use, useState } from 'react';
diff --git a/src/components/InvalidAPIKey/index.tsx b/src/components/InvalidAPIKey/index.tsx
index d41e792dac1..ef77c77d668 100644
--- a/src/components/InvalidAPIKey/index.tsx
+++ b/src/components/InvalidAPIKey/index.tsx
@@ -1,5 +1,6 @@
import { ProviderIcon } from '@lobehub/icons';
-import { Button, Center, Flexbox } from '@lobehub/ui';
+import { Center, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { ModelProvider } from 'model-bank';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/components/JSONSchemaConfig/ItemRender.tsx b/src/components/JSONSchemaConfig/ItemRender.tsx
index 907367587f0..c33a19f5662 100644
--- a/src/components/JSONSchemaConfig/ItemRender.tsx
+++ b/src/components/JSONSchemaConfig/ItemRender.tsx
@@ -1,5 +1,6 @@
-import { Input, InputNumber, InputPassword, Select } from '@lobehub/ui';
-import { Slider, Switch } from 'antd';
+import { Input, InputNumber, InputPassword } from '@lobehub/ui';
+import { Select, Switch } from '@lobehub/ui/base-ui';
+import { Slider } from 'antd';
import { type JSONSchema7Type } from 'json-schema';
import { memo } from 'react';
diff --git a/src/components/KeyValueEditor/index.tsx b/src/components/KeyValueEditor/index.tsx
index 04b71105951..f903bb596be 100644
--- a/src/components/KeyValueEditor/index.tsx
+++ b/src/components/KeyValueEditor/index.tsx
@@ -1,4 +1,5 @@
-import { ActionIcon, Button, Flexbox, Icon } from '@lobehub/ui';
+import { ActionIcon, Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import fastDeepEqual from 'fast-deep-equal';
import { LucidePlus, LucideTrash } from 'lucide-react';
diff --git a/src/components/MemberSelectionModal/MemberSelectionModal.tsx b/src/components/MemberSelectionModal/MemberSelectionModal.tsx
index 8c68f9ff8b9..91ee1a67338 100644
--- a/src/components/MemberSelectionModal/MemberSelectionModal.tsx
+++ b/src/components/MemberSelectionModal/MemberSelectionModal.tsx
@@ -1,9 +1,9 @@
'use client';
import { ActionIcon, Avatar, Checkbox, Flexbox, List, SearchBar, Text, Tooltip } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Button, Switch } from '@lobehub/ui/base-ui';
import { useHover } from 'ahooks';
-import { List as AntdList, Switch } from 'antd';
+import { List as AntdList } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { X } from 'lucide-react';
import { type ChangeEvent } from 'react';
diff --git a/src/components/RenameModal/index.tsx b/src/components/RenameModal/index.tsx
index ea79ffa1dbd..22043c406d9 100644
--- a/src/components/RenameModal/index.tsx
+++ b/src/components/RenameModal/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Input, Text } from '@lobehub/ui';
-import { createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Input, Text } from '@lobehub/ui';
+import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
import { type InputRef } from 'antd';
import { t } from 'i18next';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
diff --git a/src/features/AgentBreadcrumb/index.test.tsx b/src/features/AgentBreadcrumb/index.test.tsx
index 37786c55d21..253ccfe1ed3 100644
--- a/src/features/AgentBreadcrumb/index.test.tsx
+++ b/src/features/AgentBreadcrumb/index.test.tsx
@@ -21,12 +21,8 @@ vi.mock('@lobehub/ui', () => ({
Text: ({ children }: { children?: ReactNode }) => <span>{children}</span>,
}));
-interface AntdMockModule {
- Breadcrumb: (props: { items: Array<{ title: ReactNode }> }) => ReactNode;
-}
-
vi.mock('antd', async (importOriginal) => {
- const actual = await importOriginal<AntdMockModule>();
+ const actual = (await importOriginal()) as Record<string, unknown>;
return {
...actual,
diff --git a/src/features/AgentDocumentsExplorer/ConvertToSkillModal.tsx b/src/features/AgentDocumentsExplorer/ConvertToSkillModal.tsx
index b684dc44f7f..9c2fac6ce3e 100644
--- a/src/features/AgentDocumentsExplorer/ConvertToSkillModal.tsx
+++ b/src/features/AgentDocumentsExplorer/ConvertToSkillModal.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Input, Text, TextArea } from '@lobehub/ui';
-import { createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Input, Text, TextArea } from '@lobehub/ui';
+import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
import { type InputRef } from 'antd';
import { cssVar } from 'antd-style';
import { t } from 'i18next';
diff --git a/src/features/AgentMockDevtools/Popover.tsx b/src/features/AgentMockDevtools/Popover.tsx
index 15cda267e6d..0400c8c70da 100644
--- a/src/features/AgentMockDevtools/Popover.tsx
+++ b/src/features/AgentMockDevtools/Popover.tsx
@@ -1,4 +1,5 @@
-import { ActionIcon, Button, Flexbox, toast } from '@lobehub/ui';
+import { ActionIcon, Flexbox, toast } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import {
GripHorizontal,
diff --git a/src/features/AgentMockDevtools/views/FixtureView.tsx b/src/features/AgentMockDevtools/views/FixtureView.tsx
index 7397a8e4c9f..0c89418c75f 100644
--- a/src/features/AgentMockDevtools/views/FixtureView.tsx
+++ b/src/features/AgentMockDevtools/views/FixtureView.tsx
@@ -1,4 +1,5 @@
-import { Button, Center, Flexbox, Text } from '@lobehub/ui';
+import { Center, Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { Copy } from 'lucide-react';
import { memo, useMemo } from 'react';
diff --git a/src/features/AgentSetting/AgentConnectors/index.tsx b/src/features/AgentSetting/AgentConnectors/index.tsx
index 9a3d0ab6488..74825cce371 100644
--- a/src/features/AgentSetting/AgentConnectors/index.tsx
+++ b/src/features/AgentSetting/AgentConnectors/index.tsx
@@ -1,5 +1,5 @@
import { getActivePluginIds } from '@lobechat/types';
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import { LinkIcon } from 'lucide-react';
import { memo, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx b/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx
index 1b555eb7030..40ae21f709b 100644
--- a/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx
+++ b/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx
@@ -1,5 +1,5 @@
-import { type SelectProps } from '@lobehub/ui';
-import { ActionIcon, Select } from '@lobehub/ui';
+import { ActionIcon } from '@lobehub/ui';
+import { Select, type SelectProps } from '@lobehub/ui/base-ui';
import { isString } from 'es-toolkit/compat';
import { Wand2 } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/features/AgentSetting/AgentMeta/index.tsx b/src/features/AgentSetting/AgentMeta/index.tsx
index 0d00b0df13f..3c6dec62c48 100644
--- a/src/features/AgentSetting/AgentMeta/index.tsx
+++ b/src/features/AgentSetting/AgentMeta/index.tsx
@@ -1,7 +1,8 @@
'use client';
import { type FormGroupItemType, type FormItemProps } from '@lobehub/ui';
-import { Button, Form, Tooltip } from '@lobehub/ui';
+import { Form, Icon, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useUpdateEffect } from 'ahooks';
import isEqual from 'fast-deep-equal';
import { Wand2 } from 'lucide-react';
@@ -126,13 +127,10 @@ const AgentMeta = memo(() => {
>
<Button
disabled={disabled || !hasSystemRole}
- icon={Wand2}
- iconPlacement={'end'}
+ icon={<Icon icon={Wand2} size={12} />}
+ iconPosition={'end'}
loading={Object.values(loadingState as any).some((i) => !!i)}
size={'small'}
- iconProps={{
- size: 12,
- }}
onClick={(e: any) => {
e.stopPropagation();
if (disabled) return;
diff --git a/src/features/AgentSetting/AgentOpening/OpeningMessage.tsx b/src/features/AgentSetting/AgentOpening/OpeningMessage.tsx
index f65bccf6ba5..6169fff5d0c 100644
--- a/src/features/AgentSetting/AgentOpening/OpeningMessage.tsx
+++ b/src/features/AgentSetting/AgentOpening/OpeningMessage.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { EditableMessage } from '@lobehub/ui/chat';
import { createStaticStyles } from 'antd-style';
import { PencilLine } from 'lucide-react';
diff --git a/src/features/AgentSetting/AgentOpening/OpeningQuestions.tsx b/src/features/AgentSetting/AgentOpening/OpeningQuestions.tsx
index 7453273b69f..f98cf40994a 100644
--- a/src/features/AgentSetting/AgentOpening/OpeningQuestions.tsx
+++ b/src/features/AgentSetting/AgentOpening/OpeningQuestions.tsx
@@ -1,6 +1,7 @@
'use client';
-import { ActionIcon, Button, Empty, Flexbox, Input, SortableList } from '@lobehub/ui';
+import { ActionIcon, Empty, Flexbox, Input, SortableList } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Space } from 'antd';
import { createStaticStyles } from 'antd-style';
import { MessageCircle, PlusIcon, Trash } from 'lucide-react';
diff --git a/src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx b/src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx
index 0294f745536..684fee81fe9 100644
--- a/src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx
+++ b/src/features/AgentSetting/AgentPlugin/AddPluginButton.tsx
@@ -1,5 +1,4 @@
-import { type ButtonProps } from '@lobehub/ui';
-import { Button } from '@lobehub/ui';
+import { Button, type ButtonProps } from '@lobehub/ui/base-ui';
import { Grid2x2Plus } from 'lucide-react';
import { type Ref } from 'react';
import { useState } from 'react';
diff --git a/src/features/AgentSetting/AgentPlugin/LocalPluginItem.tsx b/src/features/AgentSetting/AgentPlugin/LocalPluginItem.tsx
index 0d3c9800aa0..38dd2470209 100644
--- a/src/features/AgentSetting/AgentPlugin/LocalPluginItem.tsx
+++ b/src/features/AgentSetting/AgentPlugin/LocalPluginItem.tsx
@@ -1,6 +1,6 @@
import { getActivePluginIds } from '@lobechat/types';
import { Flexbox } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useStore } from '../store';
diff --git a/src/features/AgentSetting/AgentPlugin/PluginAction/index.tsx b/src/features/AgentSetting/AgentPlugin/PluginAction/index.tsx
index a1abe54d8bc..92e69c97262 100644
--- a/src/features/AgentSetting/AgentPlugin/PluginAction/index.tsx
+++ b/src/features/AgentSetting/AgentPlugin/PluginAction/index.tsx
@@ -1,6 +1,6 @@
import { getActivePluginIds } from '@lobechat/types';
import { Flexbox } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import isEqual from 'fast-deep-equal';
import { memo } from 'react';
diff --git a/src/features/AgentSetting/AgentPlugin/index.tsx b/src/features/AgentSetting/AgentPlugin/index.tsx
index 1432819c5a7..c731d111fc3 100644
--- a/src/features/AgentSetting/AgentPlugin/index.tsx
+++ b/src/features/AgentSetting/AgentPlugin/index.tsx
@@ -2,8 +2,9 @@
import { getActivePluginIds } from '@lobechat/types';
import { type FormGroupItemType } from '@lobehub/ui';
-import { Avatar, Button, Center, Empty, Flexbox, Form, Tag, Tooltip } from '@lobehub/ui';
-import { Space, Switch } from 'antd';
+import { Avatar, Center, Empty, Flexbox, Form, Tag, Tooltip } from '@lobehub/ui';
+import { Button, Switch } from '@lobehub/ui/base-ui';
+import { Space } from 'antd';
import isEqual from 'fast-deep-equal';
import { BlocksIcon, LucideTrash2, Store } from 'lucide-react';
import { memo, useCallback } from 'react';
diff --git a/src/features/AgentSetting/AgentPrompt/index.tsx b/src/features/AgentSetting/AgentPrompt/index.tsx
index 3d7c8785b90..271554e2f5f 100644
--- a/src/features/AgentSetting/AgentPrompt/index.tsx
+++ b/src/features/AgentSetting/AgentPrompt/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Form } from '@lobehub/ui';
+import { Flexbox, Form, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { EditableMessage } from '@lobehub/ui/chat';
import { PenLineIcon } from 'lucide-react';
import { memo, useState } from 'react';
@@ -24,13 +25,10 @@ const AgentPrompt = memo(() => {
const editButton = !editing && !!systemRole && !disabled && (
<Button
- icon={PenLineIcon}
- iconPlacement={'end'}
+ icon={<Icon icon={PenLineIcon} size={12} />}
+ iconPosition={'end'}
size={'small'}
type={'primary'}
- iconProps={{
- size: 12,
- }}
onClick={(e) => {
e.stopPropagation();
setEditing(true);
diff --git a/src/features/AgentSetting/AgentSelfIteration/index.tsx b/src/features/AgentSetting/AgentSelfIteration/index.tsx
index 439b292338f..59faeb43934 100644
--- a/src/features/AgentSetting/AgentSelfIteration/index.tsx
+++ b/src/features/AgentSetting/AgentSelfIteration/index.tsx
@@ -1,7 +1,7 @@
'use client';
import { Form } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import isEqual from 'fast-deep-equal';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentSkillEdit/index.tsx b/src/features/AgentSkillEdit/index.tsx
index 9242ad7aec2..04965884dbf 100644
--- a/src/features/AgentSkillEdit/index.tsx
+++ b/src/features/AgentSkillEdit/index.tsx
@@ -3,7 +3,8 @@
import { isDesktop } from '@lobechat/const';
import { TITLE_BAR_HEIGHT } from '@lobechat/desktop-bridge';
import { type SkillResourceTreeNode } from '@lobechat/types';
-import { Button, Drawer, Flexbox } from '@lobehub/ui';
+import { Drawer, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Alert, App, Form as AForm, Popconfirm, Skeleton } from 'antd';
import { createStaticStyles } from 'antd-style';
import { memo, useMemo, useState } from 'react';
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskDetailPage.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskDetailPage.tsx
index a35f381fc50..f35621808e9 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskDetailPage.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskDetailPage.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router';
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskDetailRunPauseAction.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskDetailRunPauseAction.tsx
index 44b78d1c81a..1c8af10de39 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskDetailRunPauseAction.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskDetailRunPauseAction.tsx
@@ -1,4 +1,5 @@
-import { Button, DropdownMenu, Flexbox, Text } from '@lobehub/ui';
+import { DropdownMenu, Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Space } from 'antd';
import { CalendarOffIcon, ChevronDown, PlayIcon, RotateCcwIcon } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskParentBar.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskParentBar.tsx
index 357c778cf39..558e024819a 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskParentBar.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskParentBar.tsx
@@ -1,5 +1,6 @@
import type { TaskDetailData, TaskDetailSubtask } from '@lobechat/types';
-import { Button, Flexbox, Text } from '@lobehub/ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskScheduleConfig.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskScheduleConfig.tsx
index d08622d1bd0..e63901009bc 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskScheduleConfig.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskScheduleConfig.tsx
@@ -1,7 +1,6 @@
import type { TaskAutomationMode } from '@lobechat/types';
-import { ActionIcon, Avatar, Button, Flexbox, Icon, InputNumber, Popover, Text } from '@lobehub/ui';
-import { Select, Tabs } from '@lobehub/ui/base-ui';
-import { Switch } from 'antd';
+import { ActionIcon, Avatar, Flexbox, Icon, InputNumber, Popover, Text } from '@lobehub/ui';
+import { Button, Select, Switch, Tabs } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import dayjs from 'dayjs';
import { CalendarClockIcon, CalendarDays, Clock, RefreshCw, TimerIcon, Zap } from 'lucide-react';
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx
index 6079fc0ffa5..acf8bde1f67 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx
@@ -3,18 +3,16 @@
import {
ActionIcon,
Block,
- Button,
type DropdownItem,
DropdownMenu,
Flexbox,
Icon,
- Select,
SortableList,
Tag,
Text,
TextArea,
} from '@lobehub/ui';
-import { Switch } from '@lobehub/ui/base-ui';
+import { Button, Select, Switch } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import {
diff --git a/src/features/AgentTasks/AgentTaskDetail/TopicChatDrawer/FeedbackInput.tsx b/src/features/AgentTasks/AgentTaskDetail/TopicChatDrawer/FeedbackInput.tsx
index 31691b5c7cb..90e6a17a546 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TopicChatDrawer/FeedbackInput.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TopicChatDrawer/FeedbackInput.tsx
@@ -1,5 +1,6 @@
import { ChatInput, ChatInputActionBar, SendButton, useEditor } from '@lobehub/editor/react';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { $getRoot } from 'lexical';
import { ChevronDownIcon, MessageCirclePlus } from 'lucide-react';
import { memo, useCallback, useEffect, useState } from 'react';
@@ -86,7 +87,7 @@ const FeedbackInput = memo(() => {
return (
<Flexbox gap={8}>
<OpStatusTray seamless />
- <Button block icon={MessageCirclePlus} variant={'filled'} onClick={() => setExpanded(true)}>
+ <Button block icon={MessageCirclePlus} type={'fill'} onClick={() => setExpanded(true)}>
{t('taskDetail.sendFollowUp')}
</Button>
</Flexbox>
diff --git a/src/features/AgentTasks/AgentTaskDetail/VerifyCriterionModal/VerifyCriterionForm.tsx b/src/features/AgentTasks/AgentTaskDetail/VerifyCriterionModal/VerifyCriterionForm.tsx
index d817fb4abba..394bb26d8a4 100644
--- a/src/features/AgentTasks/AgentTaskDetail/VerifyCriterionModal/VerifyCriterionForm.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/VerifyCriterionModal/VerifyCriterionForm.tsx
@@ -1,8 +1,8 @@
'use client';
import { type VerifierType, verifierTypes } from '@lobechat/types';
-import { Button, Flexbox, Input, Text, TextArea } from '@lobehub/ui';
-import { Select, Switch, useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Input, Text, TextArea } from '@lobehub/ui';
+import { Button, Select, Switch, useModalContext } from '@lobehub/ui/base-ui';
import { useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/AgentTaskList/TasksGroupConfig.tsx b/src/features/AgentTasks/AgentTaskList/TasksGroupConfig.tsx
index 29616277f35..adaac172574 100644
--- a/src/features/AgentTasks/AgentTaskList/TasksGroupConfig.tsx
+++ b/src/features/AgentTasks/AgentTaskList/TasksGroupConfig.tsx
@@ -1,7 +1,6 @@
import { type FormItemProps } from '@lobehub/ui';
-import { ActionIcon, Flexbox, Form, Icon, Popover, Select } from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
-import { Switch } from 'antd';
+import { ActionIcon, Flexbox, Form, Icon, Popover } from '@lobehub/ui';
+import { Select, Switch, Tabs } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import {
ArrowDownWideNarrow,
diff --git a/src/features/AgentTasks/features/TaskListHeader.tsx b/src/features/AgentTasks/features/TaskListHeader.tsx
index 9eb4f1b7226..eacbe2ac5c5 100644
--- a/src/features/AgentTasks/features/TaskListHeader.tsx
+++ b/src/features/AgentTasks/features/TaskListHeader.tsx
@@ -1,4 +1,5 @@
-import { ActionIcon, Button, Flexbox, Text } from '@lobehub/ui';
+import { ActionIcon, Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { ClipboardList } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/features/AgentTopicManager/EmptyState.tsx b/src/features/AgentTopicManager/EmptyState.tsx
index 9d7c952c465..93cb0a12a1c 100644
--- a/src/features/AgentTopicManager/EmptyState.tsx
+++ b/src/features/AgentTopicManager/EmptyState.tsx
@@ -1,7 +1,8 @@
'use client';
import { AGENT_CHAT_URL } from '@lobechat/const';
-import { Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { MessagesSquare } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/features/AgentTopicManager/MoveTopicsModal/Content.tsx b/src/features/AgentTopicManager/MoveTopicsModal/Content.tsx
index 64fe9185e40..03e923a1335 100644
--- a/src/features/AgentTopicManager/MoveTopicsModal/Content.tsx
+++ b/src/features/AgentTopicManager/MoveTopicsModal/Content.tsx
@@ -1,8 +1,8 @@
'use client';
import { AGENT_CHAT_URL, DEFAULT_INBOX_AVATAR } from '@lobechat/const';
-import { Button, Flexbox, Icon, Text } from '@lobehub/ui';
-import { useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button, useModalContext } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { CircleCheck } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
diff --git a/src/features/AlertBanner/CloudBanner.tsx b/src/features/AlertBanner/CloudBanner.tsx
index e745e96b303..e9bc48835ee 100644
--- a/src/features/AlertBanner/CloudBanner.tsx
+++ b/src/features/AlertBanner/CloudBanner.tsx
@@ -1,7 +1,8 @@
'use client';
import { LOBE_CHAT_CLOUD, UTM_SOURCE } from '@lobechat/business-const';
-import { Button, Center, Flexbox, Icon, lobeStaticStylish } from '@lobehub/ui';
+import { Center, Flexbox, Icon, lobeStaticStylish } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useSize } from 'ahooks';
import { createStaticStyles, cx } from 'antd-style';
import { ArrowRightIcon } from 'lucide-react';
@@ -82,7 +83,11 @@ const CloudBanner = memo<{ mobile?: boolean }>(({ mobile }) => {
<div className={styles.background} />
<Center horizontal className={styles.wrapper} gap={16} width={'100%'}>
{isTruncated ? <Marquee pauseOnHover>{content}</Marquee> : content}
- <a href={`${OFFICIAL_URL}?utm_source=${UTM_SOURCE}&utm_medium=banner`} rel="noreferrer" target="_blank">
+ <a
+ href={`${OFFICIAL_URL}?utm_source=${UTM_SOURCE}&utm_medium=banner`}
+ rel="noreferrer"
+ target="_blank"
+ >
<Button size={'small'} type="primary">
{t('alert.cloud.action')} <Icon icon={ArrowRightIcon} />
</Button>
diff --git a/src/features/Auth/AuthError/index.tsx b/src/features/Auth/AuthError/index.tsx
index 7c462312e9f..c3634e46f69 100644
--- a/src/features/Auth/AuthError/index.tsx
+++ b/src/features/Auth/AuthError/index.tsx
@@ -2,7 +2,8 @@
import { SiDiscord } from '@icons-pack/react-simple-icons';
import { SOCIAL_URL } from '@lobechat/business-const';
-import { Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/MarketAuthCallback/index.tsx b/src/features/Auth/MarketAuthCallback/index.tsx
index 2fc04686ad8..28ff1d65b21 100644
--- a/src/features/Auth/MarketAuthCallback/index.tsx
+++ b/src/features/Auth/MarketAuthCallback/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, FluentEmoji, Text } from '@lobehub/ui';
+import { FluentEmoji, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Result } from 'antd';
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/OAuthCallback/Error.tsx b/src/features/Auth/OAuthCallback/Error.tsx
index 30f8415977e..c44dbea6d09 100644
--- a/src/features/Auth/OAuthCallback/Error.tsx
+++ b/src/features/Auth/OAuthCallback/Error.tsx
@@ -1,7 +1,8 @@
'use client';
// Highlighter is intentionally avoided: it pulls every shiki grammar (~10 MB) into the auth bundle
-import { Block, Button, Flexbox, FluentEmoji, Text } from '@lobehub/ui';
+import { Block, Flexbox, FluentEmoji, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Result } from 'antd';
import { useTranslation } from 'react-i18next';
import { useSearchParams } from 'react-router';
diff --git a/src/features/Auth/OAuthConsent/Consent/index.tsx b/src/features/Auth/OAuthConsent/Consent/index.tsx
index 27655018e52..d1b11940d38 100644
--- a/src/features/Auth/OAuthConsent/Consent/index.tsx
+++ b/src/features/Auth/OAuthConsent/Consent/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Block, Button, Flexbox, Text } from '@lobehub/ui';
+import { Block, Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import React, { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/OAuthConsent/Login.tsx b/src/features/Auth/OAuthConsent/Login.tsx
index 7a0b2de94b3..7060d73fa45 100644
--- a/src/features/Auth/OAuthConsent/Login.tsx
+++ b/src/features/Auth/OAuthConsent/Login.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Avatar, Block, Button, Flexbox, Skeleton, Text } from '@lobehub/ui';
+import { Avatar, Block, Flexbox, Skeleton, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/OAuthDevice/DeviceCodeConfirm.tsx b/src/features/Auth/OAuthDevice/DeviceCodeConfirm.tsx
index 1c1b6b6ac2a..10f7a6f5b59 100644
--- a/src/features/Auth/OAuthDevice/DeviceCodeConfirm.tsx
+++ b/src/features/Auth/OAuthDevice/DeviceCodeConfirm.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Block, Button, Flexbox, Text } from '@lobehub/ui';
+import { Block, Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import React, { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/OAuthDevice/DeviceCodeInput.tsx b/src/features/Auth/OAuthDevice/DeviceCodeInput.tsx
index e57a919197f..3fa46f288da 100644
--- a/src/features/Auth/OAuthDevice/DeviceCodeInput.tsx
+++ b/src/features/Auth/OAuthDevice/DeviceCodeInput.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Block, Button, Flexbox, Input, Text } from '@lobehub/ui';
+import { Block, Flexbox, Input, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import React, { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/ResetPassword/ResetPasswordContent.tsx b/src/features/Auth/ResetPassword/ResetPasswordContent.tsx
index 22b840e2a0f..66837b0d748 100644
--- a/src/features/Auth/ResetPassword/ResetPasswordContent.tsx
+++ b/src/features/Auth/ResetPassword/ResetPasswordContent.tsx
@@ -1,4 +1,5 @@
-import { Block, Button, Icon, InputPassword, Text } from '@lobehub/ui';
+import { Block, Icon, InputPassword, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Form } from 'antd';
import { Lock } from 'lucide-react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/ResetPassword/index.tsx b/src/features/Auth/ResetPassword/index.tsx
index c6ceadd943b..3364c9b1281 100644
--- a/src/features/Auth/ResetPassword/index.tsx
+++ b/src/features/Auth/ResetPassword/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { ChevronLeftIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { Link, Navigate, useNavigate, useSearchParams } from 'react-router';
diff --git a/src/features/Auth/SignIn/SignInEmailStep.tsx b/src/features/Auth/SignIn/SignInEmailStep.tsx
index 75d7b93fcca..9b136768227 100644
--- a/src/features/Auth/SignIn/SignInEmailStep.tsx
+++ b/src/features/Auth/SignIn/SignInEmailStep.tsx
@@ -1,5 +1,6 @@
import { BRANDING_NAME } from '@lobechat/business-const';
-import { Alert, Button, Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Alert, Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type FormInstance, type InputRef } from 'antd';
import { Badge, Divider, Form } from 'antd';
import { createStaticStyles } from 'antd-style';
@@ -96,7 +97,6 @@ export const SignInEmailStep = ({
<Button
block
icon={<Icon icon={AuthIcons(provider, 18)} style={PROVIDER_ICON_STYLE} />}
- iconProps={{ size: 18, style: PROVIDER_ICON_STYLE }}
key={provider}
loading={socialLoading === provider}
size="large"
diff --git a/src/features/Auth/SignIn/SignInPasswordStep.tsx b/src/features/Auth/SignIn/SignInPasswordStep.tsx
index 0eadebd7511..75f88ebdfae 100644
--- a/src/features/Auth/SignIn/SignInPasswordStep.tsx
+++ b/src/features/Auth/SignIn/SignInPasswordStep.tsx
@@ -1,4 +1,5 @@
-import { Button, Icon, InputPassword, Text } from '@lobehub/ui';
+import { Icon, InputPassword, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type FormInstance, type InputRef } from 'antd';
import { Form } from 'antd';
import { Lock } from 'lucide-react';
diff --git a/src/features/Auth/SignUp/BetterAuthSignUpForm.tsx b/src/features/Auth/SignUp/BetterAuthSignUpForm.tsx
index 44efe3e4293..0c07b2c1302 100644
--- a/src/features/Auth/SignUp/BetterAuthSignUpForm.tsx
+++ b/src/features/Auth/SignUp/BetterAuthSignUpForm.tsx
@@ -1,7 +1,8 @@
'use client';
import { BRANDING_NAME } from '@lobechat/business-const';
-import { Button, Icon, Text } from '@lobehub/ui';
+import { Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Form, Input, type InputRef } from 'antd';
import { Lock, Mail } from 'lucide-react';
import { useEffect, useRef } from 'react';
diff --git a/src/features/Auth/VerifyEmail/VerifyEmailContent.tsx b/src/features/Auth/VerifyEmail/VerifyEmailContent.tsx
index 788562cc2dd..a9bf49b9b7c 100644
--- a/src/features/Auth/VerifyEmail/VerifyEmailContent.tsx
+++ b/src/features/Auth/VerifyEmail/VerifyEmailContent.tsx
@@ -1,4 +1,5 @@
-import { Block, Button, Flexbox, Text } from '@lobehub/ui';
+import { Block, Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { RefreshCw } from 'lucide-react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/VerifyEmail/index.tsx b/src/features/Auth/VerifyEmail/index.tsx
index a89a2adf4cf..773ca27ae33 100644
--- a/src/features/Auth/VerifyEmail/index.tsx
+++ b/src/features/Auth/VerifyEmail/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { ChevronLeftIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { Link, useSearchParams } from 'react-router';
diff --git a/src/features/Billboard/Carousel.tsx b/src/features/Billboard/Carousel.tsx
index 644ed094071..b8dbceb024e 100644
--- a/src/features/Billboard/Carousel.tsx
+++ b/src/features/Billboard/Carousel.tsx
@@ -1,7 +1,8 @@
'use client';
import { useAnalytics } from '@lobehub/analytics/react';
-import { ActionIcon, Button, Flexbox, Tooltip } from '@lobehub/ui';
+import { ActionIcon, Flexbox, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Carousel as AntCarousel } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { X } from 'lucide-react';
diff --git a/src/features/ChatInput/ActionBar/History/Controls.tsx b/src/features/ChatInput/ActionBar/History/Controls.tsx
index c75ad131774..36824dc9c9c 100644
--- a/src/features/ChatInput/ActionBar/History/Controls.tsx
+++ b/src/features/ChatInput/ActionBar/History/Controls.tsx
@@ -1,6 +1,7 @@
import { type FormItemProps } from '@lobehub/ui';
import { Form, SliderWithInput } from '@lobehub/ui';
-import { Form as AntdForm, Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
+import { Form as AntdForm } from 'antd';
import { debounce } from 'es-toolkit/compat';
import { memo, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ChatInput/ActionBar/Params/Controls.tsx b/src/features/ChatInput/ActionBar/Params/Controls.tsx
index d50ecf08a4e..58a3f3a6e1a 100644
--- a/src/features/ChatInput/ActionBar/Params/Controls.tsx
+++ b/src/features/ChatInput/ActionBar/Params/Controls.tsx
@@ -1,6 +1,7 @@
import { DEFAULT_AGENT_CONFIG } from '@lobechat/const';
-import { Flexbox, Icon, Select, SliderWithInput, TextArea } from '@lobehub/ui';
-import { Form as AntdForm, Switch } from 'antd';
+import { Flexbox, Icon, SliderWithInput, TextArea } from '@lobehub/ui';
+import { Select, Switch } from '@lobehub/ui/base-ui';
+import { Form as AntdForm } from 'antd';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { debounce } from 'es-toolkit/compat';
import isEqual from 'fast-deep-equal';
diff --git a/src/features/ChatInput/ActionBar/Search/ModelBuiltinSearch.tsx b/src/features/ChatInput/ActionBar/Search/ModelBuiltinSearch.tsx
index 01e1b73dfbc..054a0b7db71 100644
--- a/src/features/ChatInput/ActionBar/Search/ModelBuiltinSearch.tsx
+++ b/src/features/ChatInput/ActionBar/Search/ModelBuiltinSearch.tsx
@@ -1,6 +1,6 @@
import { Exa, Google } from '@lobehub/icons';
import { Flexbox, Icon } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import { Search } from 'lucide-react';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ChatInput/ActionBar/Tools/useControls.tsx b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
index 7a6b8e61453..2f4ba21adae 100644
--- a/src/features/ChatInput/ActionBar/Tools/useControls.tsx
+++ b/src/features/ChatInput/ActionBar/Tools/useControls.tsx
@@ -7,9 +7,8 @@ import {
import { type AgentPluginMode, getDisabledPluginIds } from '@lobechat/types';
import type { ItemType } from '@lobehub/ui';
import { Avatar, Icon, Popover, SearchBar, stopPropagation, Tag, Tooltip } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { confirmModal, Switch } from '@lobehub/ui/base-ui';
import { McpIcon, SkillsIcon } from '@lobehub/ui/icons';
-import { Switch } from 'antd';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import isEqual from 'fast-deep-equal';
import {
diff --git a/src/features/ChatInput/ControlBar/ApprovalMode.tsx b/src/features/ChatInput/ControlBar/ApprovalMode.tsx
index 1465ae8bcec..a66237b1665 100644
--- a/src/features/ChatInput/ControlBar/ApprovalMode.tsx
+++ b/src/features/ChatInput/ControlBar/ApprovalMode.tsx
@@ -1,5 +1,6 @@
import { type MenuProps } from '@lobehub/ui';
-import { Button, Center, DropdownMenu, Flexbox, Icon, Tooltip } from '@lobehub/ui';
+import { Center, DropdownMenu, Flexbox, Icon, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { Check, ChevronDown, Hand, ListChecks, Zap } from 'lucide-react';
import { type LucideIcon } from 'lucide-react';
@@ -135,12 +136,11 @@ const ModeSelector = memo(() => {
const button = (
<Button
className={styles.modeButton}
- color={'default'}
disabled={!canCreateContent}
icon={ChevronDown}
- iconPlacement="end"
+ iconPosition="end"
size="small"
- variant={'text'}
+ type={'text'}
>
{modeLabels[approvalMode]}
</Button>
diff --git a/src/features/ChatInput/ControlBar/CreateBranchModal.tsx b/src/features/ChatInput/ControlBar/CreateBranchModal.tsx
index 849ee195acc..00f8285c271 100644
--- a/src/features/ChatInput/ControlBar/CreateBranchModal.tsx
+++ b/src/features/ChatInput/ControlBar/CreateBranchModal.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Input, Text } from '@lobehub/ui';
-import { createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Input, Text } from '@lobehub/ui';
+import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
import { type InputRef } from 'antd';
import { cssVar } from 'antd-style';
import { t } from 'i18next';
diff --git a/src/features/ChatInput/ControlBar/RenameBranchModal.tsx b/src/features/ChatInput/ControlBar/RenameBranchModal.tsx
index 42616f676df..27c717b8a7e 100644
--- a/src/features/ChatInput/ControlBar/RenameBranchModal.tsx
+++ b/src/features/ChatInput/ControlBar/RenameBranchModal.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Input, Text } from '@lobehub/ui';
-import { createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Input, Text } from '@lobehub/ui';
+import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
import { type InputRef } from 'antd';
import { cssVar } from 'antd-style';
import { t } from 'i18next';
diff --git a/src/features/CommunityWorkspaceSettings/index.tsx b/src/features/CommunityWorkspaceSettings/index.tsx
index 473f4259f2d..dc4ac69ddd3 100644
--- a/src/features/CommunityWorkspaceSettings/index.tsx
+++ b/src/features/CommunityWorkspaceSettings/index.tsx
@@ -4,7 +4,6 @@ import { OFFICIAL_URL } from '@lobechat/const';
import {
Avatar,
Block,
- Button,
Center,
Flexbox,
Icon,
@@ -14,7 +13,7 @@ import {
TextArea,
Tooltip,
} from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
+import { Button, Tabs } from '@lobehub/ui/base-ui';
import type { TableColumnsType, UploadProps } from 'antd';
import { App, Input as AntInput, Table, Upload } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
diff --git a/src/features/Conversation/ChatInput/index.tsx b/src/features/Conversation/ChatInput/index.tsx
index e2e4bdee0d1..dfe5d78d518 100644
--- a/src/features/Conversation/ChatInput/index.tsx
+++ b/src/features/Conversation/ChatInput/index.tsx
@@ -2,7 +2,8 @@
import { type SlashOptions } from '@lobehub/editor';
import { type ChatInputActionsProps } from '@lobehub/editor/react';
-import { Alert, Button, Flexbox, type MenuProps } from '@lobehub/ui';
+import { Alert, Flexbox, type MenuProps } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type ReactNode } from 'react';
import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/ChatItem/components/ErrorContent.tsx b/src/features/Conversation/ChatItem/components/ErrorContent.tsx
index 9535085d6c4..63662c4d088 100644
--- a/src/features/Conversation/ChatItem/components/ErrorContent.tsx
+++ b/src/features/Conversation/ChatItem/components/ErrorContent.tsx
@@ -43,13 +43,7 @@ const ErrorContent = memo<ErrorContentProps>(({ customErrorRender, error, id, on
type={'secondary'}
action={
onRegenerate && (
- <Button
- color="default"
- icon={<RotateCcw size={14} />}
- size="small"
- type="fill"
- onClick={onRegenerate}
- >
+ <Button icon={<RotateCcw size={14} />} size="small" type="fill" onClick={onRegenerate}>
{t('regenerate')}
</Button>
)
diff --git a/src/features/Conversation/Error/ChatInvalidApiKey.tsx b/src/features/Conversation/Error/ChatInvalidApiKey.tsx
index ee730d2f190..913472f8e22 100644
--- a/src/features/Conversation/Error/ChatInvalidApiKey.tsx
+++ b/src/features/Conversation/Error/ChatInvalidApiKey.tsx
@@ -1,5 +1,5 @@
import { ProviderIcon } from '@lobehub/icons';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { ModelProvider } from 'model-bank';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/Error/OllamaBizError/InvalidOllamaModel.tsx b/src/features/Conversation/Error/OllamaBizError/InvalidOllamaModel.tsx
index 8570c265b67..2cf99d8652a 100644
--- a/src/features/Conversation/Error/OllamaBizError/InvalidOllamaModel.tsx
+++ b/src/features/Conversation/Error/OllamaBizError/InvalidOllamaModel.tsx
@@ -1,4 +1,4 @@
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/Error/OllamaSetupGuide/Desktop.tsx b/src/features/Conversation/Error/OllamaSetupGuide/Desktop.tsx
index e1d1f7cbc1d..dbe7d1e06f9 100644
--- a/src/features/Conversation/Error/OllamaSetupGuide/Desktop.tsx
+++ b/src/features/Conversation/Error/OllamaSetupGuide/Desktop.tsx
@@ -1,5 +1,5 @@
import { Ollama } from '@lobehub/icons';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { Trans, useTranslation } from 'react-i18next';
@@ -29,9 +29,12 @@ const OllamaDesktopSetupGuide = memo<{ id?: string }>(({ id }) => {
}
desc={
<Trans
- components={[<span key="0" />, <a href={'https://ollama.com/download'} key="1" rel="noreferrer" target="_blank" />]}
i18nKey={'OllamaSetupGuide.install.description'}
ns={'components'}
+ components={[
+ <span key="0" />,
+ <a href={'https://ollama.com/download'} key="1" rel="noreferrer" target="_blank" />,
+ ]}
/>
}
/>
diff --git a/src/features/Conversation/Error/PlanLimitCard/index.tsx b/src/features/Conversation/Error/PlanLimitCard/index.tsx
index 90879bd66c3..b1f1fb4d58d 100644
--- a/src/features/Conversation/Error/PlanLimitCard/index.tsx
+++ b/src/features/Conversation/Error/PlanLimitCard/index.tsx
@@ -1,6 +1,7 @@
import { BRANDING_URL } from '@lobechat/business-const';
import { ChatErrorType, Plans } from '@lobechat/types';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx b/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
index f1d2a6bd441..abe85c91766 100644
--- a/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
+++ b/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
@@ -86,11 +86,7 @@ export const InternalEntityLink = memo<InternalEntityLinkProps>(({ href, label,
event.preventDefault();
- if (
- 'workspaceSlug' in reference &&
- reference.workspaceSlug &&
- reference.type !== 'verify'
- ) {
+ if ('workspaceSlug' in reference && reference.workspaceSlug && reference.type !== 'verify') {
navigate(reference.pathname, { escape: true });
return;
}
diff --git a/src/features/Conversation/Messages/AgentCouncil/components/ScrollShadowWithButton.tsx b/src/features/Conversation/Messages/AgentCouncil/components/ScrollShadowWithButton.tsx
index fca707a38b1..36c29bf9c5b 100644
--- a/src/features/Conversation/Messages/AgentCouncil/components/ScrollShadowWithButton.tsx
+++ b/src/features/Conversation/Messages/AgentCouncil/components/ScrollShadowWithButton.tsx
@@ -1,5 +1,6 @@
import { type FlexboxProps } from '@lobehub/ui';
-import { Button, Flexbox, ScrollShadow } from '@lobehub/ui';
+import { Flexbox, ScrollShadow } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { ChevronLeft, ChevronRight } from 'lucide-react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx
index 78d32f72ac2..b32816372db 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx
@@ -1,6 +1,6 @@
import { type ToolIntervention } from '@lobechat/types';
-import { type TabsProps } from '@lobehub/ui';
-import { Block, Highlighter, Icon, Tabs } from '@lobehub/ui';
+import { Block, Highlighter, Icon } from '@lobehub/ui';
+import { Tabs, type TabsProps } from '@lobehub/ui/base-ui';
import {
BracesIcon,
CircleAlertIcon,
@@ -153,11 +153,11 @@ const Debug = memo<DebugProps>(
return (
<Block variant={'outlined'}>
<Tabs
- compact
items={items}
- tabPlacement={'start'}
+ orientation={'vertical'}
+ size={'small'}
styles={{
- content: {
+ panel: {
height: 300,
padding: 0,
},
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx
index b91f6aed8f9..54786015f1a 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { CornerDownLeft } from 'lucide-react';
import type { KeyboardEvent as ReactKeyboardEvent } from 'react';
@@ -117,11 +118,9 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
color: ${cssVar.colorTextTertiary};
`,
submitButton: css`
- &.ant-btn {
- min-width: 88px;
- height: 36px;
- border-radius: calc(${cssVar.borderRadiusLG} - 2px);
- }
+ min-width: 88px;
+ height: 36px;
+ border-radius: calc(${cssVar.borderRadiusLG} - 2px);
`,
}));
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/KeyValueEditor.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/KeyValueEditor.tsx
index adba682a107..af8ff568bbf 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/KeyValueEditor.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/KeyValueEditor.tsx
@@ -1,4 +1,5 @@
-import { ActionIcon, Button, Flexbox, Icon, Input } from '@lobehub/ui';
+import { ActionIcon, Flexbox, Icon, Input } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type FormInstance } from 'antd';
import { App, Form } from 'antd';
import { createStaticStyles } from 'antd-style';
@@ -183,10 +184,9 @@ const KeyValueEditor = memo<KeyValueEditorProps>(({ initialValue = {}, onFinish,
<Form.Item style={{ marginBottom: 0, marginTop: 8 }}>
<Flexbox horizontal gap={8} justify={'space-between'}>
<Button
- color={'default'}
icon={<Icon icon={LucidePlus} />}
size={'small'}
- variant="filled"
+ type="fill"
onClick={() => add({ id: `new-${Date.now()}`, key: '', value: '' })}
>
{t('updateArgs.form.add')}
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/PluginSettings.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/PluginSettings.tsx
index 405f972e5d9..e598e1fd160 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/PluginSettings.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/PluginSettings.tsx
@@ -1,5 +1,6 @@
import { type ChatPluginPayload } from '@lobechat/types';
-import { Avatar, Button, Center, Flexbox } from '@lobehub/ui';
+import { Avatar, Center, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { cssVar } from 'antd-style';
import isEqual from 'fast-deep-equal';
diff --git a/src/features/Conversation/Messages/AssistantGroup/components/CollapsedMessage.tsx b/src/features/Conversation/Messages/AssistantGroup/components/CollapsedMessage.tsx
index 478ad8aae9a..25f8cde6688 100644
--- a/src/features/Conversation/Messages/AssistantGroup/components/CollapsedMessage.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/components/CollapsedMessage.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, MaskShadow } from '@lobehub/ui';
+import { Flexbox, MaskShadow } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -23,9 +24,8 @@ export const CollapsedMessage = memo<CollapsedMessageProps>(({ id, content }) =>
<Flexbox padding={4}>
<Button
block
- color={'default'}
size={'small'}
- variant={'filled'}
+ type={'fill'}
onClick={() => {
toggleMessageCollapsed(id, false);
}}
diff --git a/src/features/Conversation/Messages/TaskCallback/index.tsx b/src/features/Conversation/Messages/TaskCallback/index.tsx
index 302fb7a1d24..da568dc68ab 100644
--- a/src/features/Conversation/Messages/TaskCallback/index.tsx
+++ b/src/features/Conversation/Messages/TaskCallback/index.tsx
@@ -1,7 +1,8 @@
'use client';
-import { Button, Flexbox, Icon, Markdown, Text } from '@lobehub/ui';
-import { createStyles } from 'antd-style';
+import { Flexbox, Icon, Markdown, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
+import { createStaticStyles, cssVar } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { CircleAlert, CircleCheck, CircleSlash, SquareArrowOutUpRight } from 'lucide-react';
import { memo } from 'react';
@@ -11,20 +12,20 @@ import { useChatStore } from '@/store/chat';
import { dataSelectors, useConversationStore } from '../../store';
-const useStyles = createStyles(({ css, token }) => ({
+const styles = createStaticStyles(({ css, cssVar }) => ({
card: css`
overflow: hidden;
padding-block: 12px;
padding-inline: 16px;
- border: 1px solid ${token.colorBorderSecondary};
+ border: 1px solid ${cssVar.colorBorderSecondary};
border-radius: 16px;
- background: ${token.colorBgElevated};
+ background: ${cssVar.colorBgElevated};
`,
identifier: css`
- font-family: ${token.fontFamilyCode};
- color: ${token.colorTextSecondary};
+ font-family: ${cssVar.fontFamilyCode};
+ color: ${cssVar.colorTextSecondary};
`,
}));
@@ -38,7 +39,7 @@ type CallbackReason = 'done' | 'error' | 'interrupted';
const reasonMeta: Record<
CallbackReason,
{
- color: string;
+ color: keyof typeof cssVar;
i18nKey: 'taskCallback.done' | 'taskCallback.error' | 'taskCallback.interrupted';
icon: typeof CircleCheck;
}
@@ -56,7 +57,6 @@ const reasonMeta: Record<
* Renders as a standalone card (no avatar bubble), like the verify card.
*/
const TaskCallbackMessage = memo<TaskCallbackMessageProps>(({ id }) => {
- const { styles, theme } = useStyles();
const { t } = useTranslation('chat');
// Open the task in the right-side detail portal (in-context), instead of
// navigating away from the conversation to the full task page.
@@ -75,7 +75,7 @@ const TaskCallbackMessage = memo<TaskCallbackMessageProps>(({ id }) => {
<Flexbox className={styles.card} gap={8}>
<Flexbox horizontal align={'center'} gap={8} justify={'space-between'}>
<Flexbox horizontal align={'center'} gap={8}>
- <Icon color={(theme as any)[color]} icon={icon} size={18} />
+ <Icon color={cssVar[color]} icon={icon} size={18} />
<Text strong>{t(i18nKey)}</Text>
<span className={styles.identifier}>{callback.identifier}</span>
</Flexbox>
diff --git a/src/features/Conversation/Messages/Tool/index.tsx b/src/features/Conversation/Messages/Tool/index.tsx
index 1deeeb0e0db..7ee28981b55 100644
--- a/src/features/Conversation/Messages/Tool/index.tsx
+++ b/src/features/Conversation/Messages/Tool/index.tsx
@@ -1,5 +1,6 @@
import { type UIChatMessage } from '@lobechat/types';
-import { Alert, Button, Flexbox } from '@lobehub/ui';
+import { Alert, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import isEqual from 'fast-deep-equal';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/Messages/User/components/ContentPreview.tsx b/src/features/Conversation/Messages/User/components/ContentPreview.tsx
index 301ad676428..3fca1f11326 100644
--- a/src/features/Conversation/Messages/User/components/ContentPreview.tsx
+++ b/src/features/Conversation/Messages/User/components/ContentPreview.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, MaskShadow } from '@lobehub/ui';
+import { Flexbox, MaskShadow } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useTranslation } from 'react-i18next';
import MarkdownMessage from '@/features/Conversation/Markdown';
@@ -22,9 +23,8 @@ const ContentPreview = ({ content, id }: ContentPreviewProps) => {
<Flexbox padding={4}>
<Button
block
- color={'default'}
size={'small'}
- variant={'filled'}
+ type={'fill'}
onClick={() => {
openMessageDetail(id);
}}
diff --git a/src/features/Conversation/Messages/Verify/index.tsx b/src/features/Conversation/Messages/Verify/index.tsx
index fe5b8430602..f6b29bb680c 100644
--- a/src/features/Conversation/Messages/Verify/index.tsx
+++ b/src/features/Conversation/Messages/Verify/index.tsx
@@ -1,7 +1,7 @@
'use client';
import { Flexbox } from '@lobehub/ui';
-import { createStyles } from 'antd-style';
+import { createStaticStyles, cssVar } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { memo } from 'react';
@@ -11,12 +11,12 @@ import { phaseCardBackground, phaseFromStatus } from '@/features/Verify/utils';
import { dataSelectors, useConversationStore } from '../../store';
-const useStyles = createStyles(({ css, token }) => ({
+const styles = createStaticStyles(({ css, cssVar }) => ({
card: css`
overflow: hidden;
- border: 1px solid ${token.colorBorderSecondary};
+ border: 1px solid ${cssVar.colorBorderSecondary};
border-radius: 16px;
- background: ${token.colorBgElevated};
+ background: ${cssVar.colorBgElevated};
`,
}));
@@ -33,7 +33,6 @@ interface VerifyMessageProps {
* group (no avatar bubble).
*/
const VerifyMessage = memo<VerifyMessageProps>(({ id }) => {
- const { styles, theme } = useStyles();
const item = useConversationStore(dataSelectors.getDisplayMessageById(id), isEqual);
const operationId = item?.metadata?.verifyOperationId;
// Sequence number among all verify messages in the thread (not the repair round).
@@ -46,7 +45,7 @@ const VerifyMessage = memo<VerifyMessageProps>(({ id }) => {
return (
<Flexbox paddingBlock={8}>
- <div className={styles.card} style={{ background: phaseCardBackground(phase, theme) }}>
+ <div className={styles.card} style={{ background: phaseCardBackground(phase, cssVar) }}>
<RunResult embedded operationId={operationId} round={ordinal} />
<CheckerDock embedded operationId={operationId} />
</div>
diff --git a/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx b/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx
index e611385b99a..282dce10fdb 100644
--- a/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx
+++ b/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx
@@ -1,7 +1,8 @@
import { type ChatMessageError } from '@lobechat/types';
import { type AudioPlayerProps } from '@lobehub/tts/react';
import { AudioPlayer } from '@lobehub/tts/react';
-import { ActionIcon, Alert, Button, Flexbox, Highlighter } from '@lobehub/ui';
+import { ActionIcon, Alert, Flexbox, Highlighter } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { TrashIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/components/ShareMessageModal/ShareImage/index.tsx b/src/features/Conversation/components/ShareMessageModal/ShareImage/index.tsx
index 00a21ae1898..a2fd91e45d0 100644
--- a/src/features/Conversation/components/ShareMessageModal/ShareImage/index.tsx
+++ b/src/features/Conversation/components/ShareMessageModal/ShareImage/index.tsx
@@ -1,8 +1,7 @@
import { type UIChatMessage } from '@lobechat/types';
import { type FormItemProps } from '@lobehub/ui';
-import { Button, Flexbox, Form } from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
-import { Switch } from 'antd';
+import { Flexbox, Form } from '@lobehub/ui';
+import { Button, Switch, Tabs } from '@lobehub/ui/base-ui';
import { CopyIcon } from 'lucide-react';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/components/ShareMessageModal/ShareText/index.tsx b/src/features/Conversation/components/ShareMessageModal/ShareText/index.tsx
index 9ef30c3e81d..2c5b548fe3b 100644
--- a/src/features/Conversation/components/ShareMessageModal/ShareText/index.tsx
+++ b/src/features/Conversation/components/ShareMessageModal/ShareText/index.tsx
@@ -1,5 +1,6 @@
import { type UIChatMessage } from '@lobechat/types';
-import { Button, copyToClipboard, Flexbox } from '@lobehub/ui';
+import { copyToClipboard, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import isEqual from 'fast-deep-equal';
import { CopyIcon } from 'lucide-react';
diff --git a/src/features/CreatePlatformAgent/index.tsx b/src/features/CreatePlatformAgent/index.tsx
index 0e2f5b76ef4..5b3b21092e2 100644
--- a/src/features/CreatePlatformAgent/index.tsx
+++ b/src/features/CreatePlatformAgent/index.tsx
@@ -4,9 +4,10 @@ import {
REMOTE_HETEROGENEOUS_AGENT_CONFIGS,
type RemoteHeterogeneousAgentType,
} from '@lobechat/heterogeneous-agents';
-import { Button, Flexbox, Icon } from '@lobehub/ui';
+import { Flexbox, Icon } from '@lobehub/ui';
import {
Button as BaseButton,
+ Button,
createModal,
type ModalInstance,
Select,
diff --git a/src/features/DailyBrief/BriefCardActions.tsx b/src/features/DailyBrief/BriefCardActions.tsx
index 364477bf440..e0af1cc8991 100644
--- a/src/features/DailyBrief/BriefCardActions.tsx
+++ b/src/features/DailyBrief/BriefCardActions.tsx
@@ -1,5 +1,6 @@
import { type BriefAction, DEFAULT_BRIEF_ACTIONS, type TaskStatus } from '@lobechat/types';
-import { Button, Flexbox, Icon, Text, Tooltip } from '@lobehub/ui';
+import { Flexbox, Icon, Text, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Check, SquarePen, Workflow } from 'lucide-react';
import { memo, useCallback, useState } from 'react';
@@ -236,7 +237,6 @@ const BriefCardActions = memo<BriefCardActionsProps>(
)}
{primaryActions && (
<Button
- shadow
className={styles.actionBtnPrimary}
disabled={loadingKey === primaryActions.key}
shape={'round'}
diff --git a/src/features/DailyBrief/BriefCardSummary.tsx b/src/features/DailyBrief/BriefCardSummary.tsx
index a29f6c6e31c..21a5bc28832 100644
--- a/src/features/DailyBrief/BriefCardSummary.tsx
+++ b/src/features/DailyBrief/BriefCardSummary.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Markdown, MaskShadow } from '@lobehub/ui';
+import { Flexbox, Markdown, MaskShadow } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useSize } from 'ahooks';
import { ChevronsDownUpIcon, ChevronsUpDownIcon } from 'lucide-react';
import { memo, useEffect, useRef, useState } from 'react';
@@ -50,7 +51,7 @@ const BriefCardSummary = memo<BriefCardSummaryProps>(({ summary }) => {
block
className={styles.expandLink}
icon={expanded ? ChevronsDownUpIcon : ChevronsUpDownIcon}
- iconPlacement={'end'}
+ iconPosition={'end'}
size={'small'}
type={'text'}
onClick={() => setExpanded(!expanded)}
diff --git a/src/features/DailyBrief/CommentInput.tsx b/src/features/DailyBrief/CommentInput.tsx
index d9b3a6546d5..7414732a185 100644
--- a/src/features/DailyBrief/CommentInput.tsx
+++ b/src/features/DailyBrief/CommentInput.tsx
@@ -1,5 +1,6 @@
import { ChatInput, Editor, SendButton, useEditor } from '@lobehub/editor/react';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { ChevronLeft } from 'lucide-react';
import { memo, useCallback, useState } from 'react';
diff --git a/src/features/DailyBrief/index.tsx b/src/features/DailyBrief/index.tsx
index de4d5baf357..a015be2f6e4 100644
--- a/src/features/DailyBrief/index.tsx
+++ b/src/features/DailyBrief/index.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Newspaper } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/DailyBrief/style.ts b/src/features/DailyBrief/style.ts
index 9f9907092a4..ec24eb5dc36 100644
--- a/src/features/DailyBrief/style.ts
+++ b/src/features/DailyBrief/style.ts
@@ -8,10 +8,8 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({
}
`,
actionBtnPrimary: css`
- &.ant-btn {
- width: auto !important;
- padding-inline: 12px !important;
- }
+ width: auto !important;
+ padding-inline: 12px !important;
`,
expandLink: css`
border: 1px solid ${cssVar.colorFillTertiary} !important;
diff --git a/src/features/DataImporter/Error.tsx b/src/features/DataImporter/Error.tsx
index 3f20a12161e..41aec804f91 100644
--- a/src/features/DataImporter/Error.tsx
+++ b/src/features/DataImporter/Error.tsx
@@ -1,4 +1,5 @@
-import { Alert, Button, Flexbox, Highlighter, Icon } from '@lobehub/ui';
+import { Alert, Flexbox, Highlighter, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Result } from 'antd';
import { ShieldAlert } from 'lucide-react';
import React, { memo } from 'react';
diff --git a/src/features/DataImporter/SuccessResult.tsx b/src/features/DataImporter/SuccessResult.tsx
index 3bbfce5813d..11cbc3b673e 100644
--- a/src/features/DataImporter/SuccessResult.tsx
+++ b/src/features/DataImporter/SuccessResult.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Icon } from '@lobehub/ui';
+import { Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Result, Table } from 'antd';
import { createStaticStyles } from 'antd-style';
import { CheckCircle } from 'lucide-react';
diff --git a/src/features/DevFeatureFlagPanel/Panel.tsx b/src/features/DevFeatureFlagPanel/Panel.tsx
index d054ebcab03..a1ce94b3353 100644
--- a/src/features/DevFeatureFlagPanel/Panel.tsx
+++ b/src/features/DevFeatureFlagPanel/Panel.tsx
@@ -1,7 +1,7 @@
'use client';
-import { ActionIcon, Button, Flexbox, Input, Text } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { ActionIcon, Flexbox, Input, Text } from '@lobehub/ui';
+import { Button, Switch } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { snakeCase } from 'es-toolkit/compat';
import { ListRestartIcon, XIcon } from 'lucide-react';
diff --git a/src/features/DevPanel/FeatureFlagViewer/Form.tsx b/src/features/DevPanel/FeatureFlagViewer/Form.tsx
index ba71b9e4d23..fd37784a24a 100644
--- a/src/features/DevPanel/FeatureFlagViewer/Form.tsx
+++ b/src/features/DevPanel/FeatureFlagViewer/Form.tsx
@@ -1,7 +1,7 @@
'use client';
import { Flexbox, Form, Highlighter } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { snakeCase } from 'es-toolkit/compat';
import { ListRestartIcon } from 'lucide-react';
diff --git a/src/features/DeviceManager/DeviceDetailPanel.tsx b/src/features/DeviceManager/DeviceDetailPanel.tsx
index 2148f278e56..2666e9ffd78 100644
--- a/src/features/DeviceManager/DeviceDetailPanel.tsx
+++ b/src/features/DeviceManager/DeviceDetailPanel.tsx
@@ -2,18 +2,8 @@
import { isDesktop } from '@lobechat/const';
import type { DeviceListItem, DeviceWorkspaceShare } from '@lobechat/types';
-import {
- ActionIcon,
- Avatar,
- Button,
- Flexbox,
- Icon,
- Input,
- SortableList,
- Tag,
- Text,
-} from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { ActionIcon, Avatar, Flexbox, Icon, Input, SortableList, Tag, Text } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import dayjs from 'dayjs';
import { FolderOpenIcon, FolderPlusIcon, LockIcon, XIcon } from 'lucide-react';
diff --git a/src/features/DeviceManager/DeviceManager.tsx b/src/features/DeviceManager/DeviceManager.tsx
index d705ba5d086..5856d1798cb 100644
--- a/src/features/DeviceManager/DeviceManager.tsx
+++ b/src/features/DeviceManager/DeviceManager.tsx
@@ -2,8 +2,8 @@
import { isDesktop } from '@lobechat/const';
import type { DeviceScope, DeviceVisibility } from '@lobechat/types';
-import { ActionIcon, Button, Checkbox, Flexbox, Icon, Skeleton, Text } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { ActionIcon, Checkbox, Flexbox, Icon, Skeleton, Text } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import {
ChevronRightIcon,
diff --git a/src/features/EditorCanvas/DiffAllToolbar.tsx b/src/features/EditorCanvas/DiffAllToolbar.tsx
index 37a27f6081e..d7956b67e3b 100644
--- a/src/features/EditorCanvas/DiffAllToolbar.tsx
+++ b/src/features/EditorCanvas/DiffAllToolbar.tsx
@@ -148,7 +148,6 @@ const DiffAllToolbar = memo<DiffAllToolbarProps>(({ documentId, editor }) => {
{t('modifier.rejectAll')}
</Button>
<Button
- color={'default'}
size={'small'}
type="fill"
onClick={async () => {
diff --git a/src/features/EditorCanvas/LinearFilePlugin.tsx b/src/features/EditorCanvas/LinearFilePlugin.tsx
index 83f082b07c1..fd09e37e1c4 100644
--- a/src/features/EditorCanvas/LinearFilePlugin.tsx
+++ b/src/features/EditorCanvas/LinearFilePlugin.tsx
@@ -3,7 +3,7 @@
import { downloadFile } from '@lobechat/utils/client';
import { FilePlugin, UploadPlugin, useLexicalComposerContext } from '@lobehub/editor';
import { ActionIcon } from '@lobehub/ui';
-import { createStyles } from 'antd-style';
+import { createStaticStyles } from 'antd-style';
import { DownloadIcon } from 'lucide-react';
import { type FC, memo, useLayoutEffect } from 'react';
import { useTranslation } from 'react-i18next';
@@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next';
import FileIcon from '@/components/FileIcon';
import { formatSize } from '@/utils/format';
-const useStyles = createStyles(({ css, cssVar, token }) => ({
+const styles = createStaticStyles(({ css, cssVar }) => ({
card: css`
cursor: pointer;
@@ -23,17 +23,17 @@ const useStyles = createStyles(({ css, cssVar, token }) => ({
width: 100%;
padding-block: 10px;
padding-inline: 12px;
- border: 1px solid ${token.colorBorderSecondary};
- border-radius: ${token.borderRadiusLG}px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadiusLG};
- color: ${token.colorText};
+ color: ${cssVar.colorText};
- background: ${token.colorBgContainer};
+ background: ${cssVar.colorBgContainer};
transition: background ${cssVar.motionDurationMid};
&:hover {
- background: ${token.colorFillTertiary};
+ background: ${cssVar.colorFillTertiary};
}
&:hover [data-lobehub-file-download] {
@@ -53,18 +53,18 @@ const useStyles = createStyles(({ css, cssVar, token }) => ({
name: css`
overflow: hidden;
- font-size: ${token.fontSize}px;
+ font-size: ${cssVar.fontSize};
font-weight: 500;
line-height: 1.4;
- color: ${token.colorText};
+ color: ${cssVar.colorText};
text-overflow: ellipsis;
white-space: nowrap;
`,
size: css`
margin-block-start: 2px;
- font-size: ${token.fontSizeSM}px;
+ font-size: ${cssVar.fontSizeSM};
line-height: 1.4;
- color: ${token.colorTextTertiary};
+ color: ${cssVar.colorTextTertiary};
`,
state: css`
display: flex;
@@ -73,12 +73,12 @@ const useStyles = createStyles(({ css, cssVar, token }) => ({
padding-block: 10px;
padding-inline: 12px;
- border: 1px solid ${token.colorBorderSecondary};
- border-radius: ${token.borderRadiusLG}px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadiusLG};
- color: ${token.colorTextSecondary};
+ color: ${cssVar.colorTextSecondary};
- background: ${token.colorBgContainer};
+ background: ${cssVar.colorBgContainer};
`,
}));
@@ -95,7 +95,6 @@ interface LinearFileCardProps {
}
export const LinearFileCard = memo<LinearFileCardProps>(({ node }) => {
- const { styles } = useStyles();
const { t } = useTranslation('editor');
const { fileUrl, message, name, size, status } = node;
diff --git a/src/features/Electron/AuthRequiredModal/index.test.tsx b/src/features/Electron/AuthRequiredModal/index.test.tsx
index 6149552a49c..cc8037b1c5b 100644
--- a/src/features/Electron/AuthRequiredModal/index.test.tsx
+++ b/src/features/Electron/AuthRequiredModal/index.test.tsx
@@ -56,6 +56,21 @@ vi.mock('@lobehub/ui', () => ({
}));
vi.mock('@lobehub/ui/base-ui', () => ({
+ Button: ({
+ children,
+ disabled,
+ loading,
+ onClick,
+ }: {
+ children?: ReactNode;
+ disabled?: boolean;
+ loading?: boolean;
+ onClick?: () => void;
+ }) => (
+ <button disabled={disabled || loading} type="button" onClick={onClick}>
+ {children}
+ </button>
+ ),
createModal: (props: ModalProps) => {
createModalMock(props);
diff --git a/src/features/Electron/AuthRequiredModal/index.tsx b/src/features/Electron/AuthRequiredModal/index.tsx
index 65cae6daddb..86bd93be613 100644
--- a/src/features/Electron/AuthRequiredModal/index.tsx
+++ b/src/features/Electron/AuthRequiredModal/index.tsx
@@ -1,9 +1,9 @@
'use client';
import { useWatchBroadcast } from '@lobechat/electron-client-ipc';
-import { Button, Flexbox, Icon } from '@lobehub/ui';
+import { Flexbox, Icon } from '@lobehub/ui';
import type { ImperativeModalProps, ModalInstance } from '@lobehub/ui/base-ui';
-import { createModal, ModalFooter } from '@lobehub/ui/base-ui';
+import { Button, createModal, ModalFooter } from '@lobehub/ui/base-ui';
import debug from 'debug';
import { AlertCircle, LogIn } from 'lucide-react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
diff --git a/src/features/Electron/HeterogeneousAgent/StatusGuide/GuideActions.tsx b/src/features/Electron/HeterogeneousAgent/StatusGuide/GuideActions.tsx
index 3870f678d4d..c43a002278d 100644
--- a/src/features/Electron/HeterogeneousAgent/StatusGuide/GuideActions.tsx
+++ b/src/features/Electron/HeterogeneousAgent/StatusGuide/GuideActions.tsx
@@ -1,5 +1,6 @@
import { isDesktop } from '@lobechat/const';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { ExternalLink, RotateCcw, Settings2 } from 'lucide-react';
import { electronSystemService } from '@/services/electron/system';
diff --git a/src/features/Electron/HeterogeneousAgent/StatusGuide/states/OverloadedState.tsx b/src/features/Electron/HeterogeneousAgent/StatusGuide/states/OverloadedState.tsx
index c60293ed64d..b174eba5a58 100644
--- a/src/features/Electron/HeterogeneousAgent/StatusGuide/states/OverloadedState.tsx
+++ b/src/features/Electron/HeterogeneousAgent/StatusGuide/states/OverloadedState.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Highlighter, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Highlighter, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Ban, Loader2, RotateCcw } from 'lucide-react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Electron/connection/ConnectionMode.tsx b/src/features/Electron/connection/ConnectionMode.tsx
index 259c62d2f59..af8583780fc 100644
--- a/src/features/Electron/connection/ConnectionMode.tsx
+++ b/src/features/Electron/connection/ConnectionMode.tsx
@@ -1,6 +1,7 @@
import { type StorageMode } from '@lobechat/electron-client-ipc';
import { StorageModeEnum } from '@lobechat/electron-client-ipc';
-import { Button, Center, Flexbox, Input, stopPropagation } from '@lobehub/ui';
+import { Center, Flexbox, Input, stopPropagation } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { LobeHub } from '@lobehub/ui/brand';
import { createStaticStyles } from 'antd-style';
import { Server } from 'lucide-react';
diff --git a/src/features/Electron/connection/DeviceGateway.tsx b/src/features/Electron/connection/DeviceGateway.tsx
index c5b244d4622..6545d2cfc35 100644
--- a/src/features/Electron/connection/DeviceGateway.tsx
+++ b/src/features/Electron/connection/DeviceGateway.tsx
@@ -1,6 +1,7 @@
import { useWatchBroadcast } from '@lobechat/electron-client-ipc';
import { ActionIcon, Flexbox } from '@lobehub/ui';
-import { Input, Popover, Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
+import { Input, Popover } from 'antd';
import { createStaticStyles } from 'antd-style';
import { HardDrive } from 'lucide-react';
import { memo, useCallback, useState } from 'react';
diff --git a/src/features/Electron/connection/Waiting.tsx b/src/features/Electron/connection/Waiting.tsx
index b507215c947..3a4c5d89e56 100644
--- a/src/features/Electron/connection/Waiting.tsx
+++ b/src/features/Electron/connection/Waiting.tsx
@@ -1,7 +1,8 @@
'use client';
import { useWatchBroadcast } from '@lobechat/electron-client-ipc';
-import { Button, Flexbox, Highlighter, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Highlighter, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { ShieldX } from 'lucide-react';
import { memo, useEffect, useState } from 'react';
diff --git a/src/features/FileViewer/NotSupport/index.tsx b/src/features/FileViewer/NotSupport/index.tsx
index 8c74f384025..bb24393668e 100644
--- a/src/features/FileViewer/NotSupport/index.tsx
+++ b/src/features/FileViewer/NotSupport/index.tsx
@@ -1,4 +1,5 @@
-import { Button, Center, Flexbox, FluentEmoji } from '@lobehub/ui';
+import { Center, Flexbox, FluentEmoji } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { type ComponentType, type CSSProperties } from 'react';
import { useState } from 'react';
diff --git a/src/features/Fleet/AgentColumn.tsx b/src/features/Fleet/AgentColumn.tsx
index 8fd0da1f6fd..b24cb84cada 100644
--- a/src/features/Fleet/AgentColumn.tsx
+++ b/src/features/Fleet/AgentColumn.tsx
@@ -2,7 +2,8 @@
import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
-import { ActionIcon, Avatar, Button, DropdownMenu, Flexbox, Icon, Text } from '@lobehub/ui';
+import { ActionIcon, Avatar, DropdownMenu, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import {
ChevronDownIcon,
@@ -277,12 +278,7 @@ const ReplyArea = memo(() => {
<ReplyPanel onCollapse={isEmptyConversation ? undefined : () => setReplyOpen(false)} />
) : (
<Flexbox className={styles.replyBar}>
- <Button
- block
- icon={MessageCirclePlus}
- variant={'filled'}
- onClick={() => setReplyOpen(true)}
- >
+ <Button block icon={MessageCirclePlus} type={'fill'} onClick={() => setReplyOpen(true)}>
{t('fleet.reply')}
</Button>
</Flexbox>
diff --git a/src/features/Fleet/RunningTaskSidebar.tsx b/src/features/Fleet/RunningTaskSidebar.tsx
index 0b129922e7e..974ecab8018 100644
--- a/src/features/Fleet/RunningTaskSidebar.tsx
+++ b/src/features/Fleet/RunningTaskSidebar.tsx
@@ -1,7 +1,8 @@
'use client';
import { formatElapsedClockTime } from '@lobechat/utils';
-import { ActionIcon, Avatar, Button, Flexbox, Skeleton, Tag, Text } from '@lobehub/ui';
+import { ActionIcon, Avatar, Flexbox, Skeleton, Tag, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, useTheme } from 'antd-style';
import { ListXIcon, PlusIcon } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
diff --git a/src/features/LibraryModal/AssignKnowledgeBase/Item/Action.tsx b/src/features/LibraryModal/AssignKnowledgeBase/Item/Action.tsx
index 65738d35104..683bcddf28f 100644
--- a/src/features/LibraryModal/AssignKnowledgeBase/Item/Action.tsx
+++ b/src/features/LibraryModal/AssignKnowledgeBase/Item/Action.tsx
@@ -1,4 +1,5 @@
-import { ActionIcon, Button, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
+import { ActionIcon, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { InfoIcon, MoreVerticalIcon, Trash2 } from 'lucide-react';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/LibraryModal/CreateNew/CreateForm.tsx b/src/features/LibraryModal/CreateNew/CreateForm.tsx
index a874fb8887b..254cd96291e 100644
--- a/src/features/LibraryModal/CreateNew/CreateForm.tsx
+++ b/src/features/LibraryModal/CreateNew/CreateForm.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Input, TextArea } from '@lobehub/ui';
+import { Flexbox, Input, TextArea } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/LocalFile/LocalFile.tsx b/src/features/LocalFile/LocalFile.tsx
index ff0995ab581..de562670b97 100644
--- a/src/features/LocalFile/LocalFile.tsx
+++ b/src/features/LocalFile/LocalFile.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Popover } from '@lobehub/ui';
+import { Flexbox, Popover } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Space } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { ExternalLink, FolderOpen } from 'lucide-react';
@@ -45,7 +46,12 @@ interface LocalFileProps {
readonly?: boolean;
}
-export const LocalFile = ({ name, path, isDirectory = false, readonly = false }: LocalFileProps) => {
+export const LocalFile = ({
+ name,
+ path,
+ isDirectory = false,
+ readonly = false,
+}: LocalFileProps) => {
const { t } = useTranslation('components');
const handleOpenFile = () => {
diff --git a/src/features/MCP/MCPInstallProgress/InstallError/index.tsx b/src/features/MCP/MCPInstallProgress/InstallError/index.tsx
index 347ac2a70ab..af752f3c444 100644
--- a/src/features/MCP/MCPInstallProgress/InstallError/index.tsx
+++ b/src/features/MCP/MCPInstallProgress/InstallError/index.tsx
@@ -1,4 +1,5 @@
-import { Alert, Button, Flexbox } from '@lobehub/ui';
+import { Alert, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -25,9 +26,8 @@ const InstallError = memo<InstallErrorProps>(({ errorInfo, identifier }) => {
action={
<Flexbox>
<Button
- color={'default'}
size={'small'}
- variant={'filled'}
+ type={'fill'}
onClick={() => {
cancelInstallMCPPlugin(identifier);
}}
diff --git a/src/features/MCP/MCPInstallProgress/MCPConfigForm.tsx b/src/features/MCP/MCPInstallProgress/MCPConfigForm.tsx
index 046913b98ab..922c861eecf 100644
--- a/src/features/MCP/MCPInstallProgress/MCPConfigForm.tsx
+++ b/src/features/MCP/MCPInstallProgress/MCPConfigForm.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Form, Markdown } from '@lobehub/ui';
+import { Flexbox, Form, Markdown } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Form as AForm } from 'antd';
import { createStaticStyles } from 'antd-style';
import * as m from 'motion/react-m';
diff --git a/src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx b/src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx
index a47ef83a97d..a92c331e44a 100644
--- a/src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx
+++ b/src/features/MCP/MCPInstallProgress/MCPDependenciesGuide.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Markdown, Snippet, Text } from '@lobehub/ui';
+import { Flexbox, Markdown, Snippet, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Card, Space } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { AlertTriangle, CheckCircle, ExternalLink, Terminal } from 'lucide-react';
diff --git a/src/features/MCP/MCPSettings/index.tsx b/src/features/MCP/MCPSettings/index.tsx
index 66e83220345..868a6aae660 100644
--- a/src/features/MCP/MCPSettings/index.tsx
+++ b/src/features/MCP/MCPSettings/index.tsx
@@ -1,5 +1,6 @@
-import { Button, Flexbox, Icon, Input, Text } from '@lobehub/ui';
-import { App,Form as AForm } from 'antd';
+import { Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
+import { App, Form as AForm } from 'antd';
import { createStaticStyles } from 'antd-style';
import { EditIcon, LinkIcon, Settings2Icon, TerminalIcon } from 'lucide-react';
import { useImperativeHandle, useState } from 'react';
@@ -158,7 +159,11 @@ interface SettingsProps {
identifier: string;
}
-const Settings = ({ ref, identifier, hideFooter }: SettingsProps & { ref?: React.RefObject<SettingsRef | null> }) => {
+const Settings = ({
+ ref,
+ identifier,
+ hideFooter,
+}: SettingsProps & { ref?: React.RefObject<SettingsRef | null> }) => {
const { t } = useTranslation(['plugin', 'common']);
const [connectionForm] = AForm.useForm();
const [envForm] = AForm.useForm();
diff --git a/src/features/MCPPluginDetail/Header.tsx b/src/features/MCPPluginDetail/Header.tsx
index dc6f8f00c5a..1830bd3897c 100644
--- a/src/features/MCPPluginDetail/Header.tsx
+++ b/src/features/MCPPluginDetail/Header.tsx
@@ -4,7 +4,6 @@ import { Github } from '@lobehub/icons';
import {
ActionIcon,
Avatar,
- Button,
Flexbox,
Icon,
stopPropagation,
@@ -12,6 +11,7 @@ import {
Text,
Tooltip,
} from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
import {
@@ -149,7 +149,7 @@ const Header = memo<{ inModal?: boolean; mobile?: boolean }>(({ mobile: isMobile
url: '/community/mcp',
})}
>
- <Button icon={cate?.icon} size={'middle'} variant={'outlined'}>
+ <Button icon={cate?.icon} size={'middle'}>
{cate?.label}
</Button>
</Link>
diff --git a/src/features/MCPPluginDetail/Score/GithubBadge/index.tsx b/src/features/MCPPluginDetail/Score/GithubBadge/index.tsx
index 942b0c60f02..c40393e287a 100644
--- a/src/features/MCPPluginDetail/Score/GithubBadge/index.tsx
+++ b/src/features/MCPPluginDetail/Score/GithubBadge/index.tsx
@@ -1,4 +1,5 @@
-import { Markdown, Select, Snippet, Tag } from '@lobehub/ui';
+import { Markdown, Snippet, Tag } from '@lobehub/ui';
+import { Select } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { cssVar } from 'antd-style';
import { memo, useState } from 'react';
@@ -58,7 +59,7 @@ const GithubBadge = memo(() => {
<Snippet language={'md'} style={{ fontSize: 12 }} variant={'outlined'}>
{badgeLite}
</Snippet>
- { }
+ {}
<img
alt="MCP Badge"
height={selectedStyle === 'for-the-badge' ? 28 : 20}
@@ -74,7 +75,7 @@ const GithubBadge = memo(() => {
<Snippet language={'md'} style={{ fontSize: 12 }} variant={'outlined'}>
{badge}
</Snippet>
- { }
+ {}
<img alt="MCP Badge" src={styledBadgeFullUrl} />
</>
);
diff --git a/src/features/Messenger/IntegrationDetail/Discord.tsx b/src/features/Messenger/IntegrationDetail/Discord.tsx
index 90a48ca8d5a..abbc1719f5b 100644
--- a/src/features/Messenger/IntegrationDetail/Discord.tsx
+++ b/src/features/Messenger/IntegrationDetail/Discord.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Icon, Text } from '@lobehub/ui';
+import { Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { LinkIcon, ServerIcon, Trash2Icon, UserIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Messenger/IntegrationDetail/Slack.tsx b/src/features/Messenger/IntegrationDetail/Slack.tsx
index 11ab9706cd5..30f6a488d3d 100644
--- a/src/features/Messenger/IntegrationDetail/Slack.tsx
+++ b/src/features/Messenger/IntegrationDetail/Slack.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Icon } from '@lobehub/ui';
+import { Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { BriefcaseIcon, LinkIcon, Trash2Icon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Messenger/IntegrationDetail/Telegram.tsx b/src/features/Messenger/IntegrationDetail/Telegram.tsx
index 1182d07c550..c7200859e12 100644
--- a/src/features/Messenger/IntegrationDetail/Telegram.tsx
+++ b/src/features/Messenger/IntegrationDetail/Telegram.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Icon } from '@lobehub/ui';
+import { Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { LinkIcon, Trash2Icon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Messenger/IntegrationDetail/shared.test.tsx b/src/features/Messenger/IntegrationDetail/shared.test.tsx
index 52f49dec222..c8fb0e33724 100644
--- a/src/features/Messenger/IntegrationDetail/shared.test.tsx
+++ b/src/features/Messenger/IntegrationDetail/shared.test.tsx
@@ -32,6 +32,19 @@ vi.mock('@lobehub/ui', () => ({
}));
vi.mock('@lobehub/ui/base-ui', () => ({
+ Button: ({
+ children,
+ disabled,
+ onClick,
+ }: {
+ children?: ReactNode;
+ disabled?: boolean;
+ onClick?: () => void;
+ }) => (
+ <button disabled={disabled} type="button" onClick={onClick}>
+ {children}
+ </button>
+ ),
Select: ({
classNames,
options,
diff --git a/src/features/Messenger/IntegrationDetail/shared.tsx b/src/features/Messenger/IntegrationDetail/shared.tsx
index 48f4f196719..70a4894896a 100644
--- a/src/features/Messenger/IntegrationDetail/shared.tsx
+++ b/src/features/Messenger/IntegrationDetail/shared.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Block, Button, Flexbox, Icon, Skeleton, Tag, Text } from '@lobehub/ui';
-import { confirmModal, Select } from '@lobehub/ui/base-ui';
+import { Block, Flexbox, Icon, Skeleton, Tag, Text } from '@lobehub/ui';
+import { Button, confirmModal, Select } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles } from 'antd-style';
import { ArrowLeftIcon, CheckCircle2Icon, Trash2Icon, UserIcon } from 'lucide-react';
diff --git a/src/features/Messenger/LinkModal/Discord.tsx b/src/features/Messenger/LinkModal/Discord.tsx
index f67d2bd299b..0bcb19d0830 100644
--- a/src/features/Messenger/LinkModal/Discord.tsx
+++ b/src/features/Messenger/LinkModal/Discord.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { LinkIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Messenger/LinkModal/Slack.tsx b/src/features/Messenger/LinkModal/Slack.tsx
index 9ee9839362a..561859726b0 100644
--- a/src/features/Messenger/LinkModal/Slack.tsx
+++ b/src/features/Messenger/LinkModal/Slack.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Text } from '@lobehub/ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Messenger/LinkModal/Telegram.tsx b/src/features/Messenger/LinkModal/Telegram.tsx
index 89ef54412c3..862f68f1021 100644
--- a/src/features/Messenger/LinkModal/Telegram.tsx
+++ b/src/features/Messenger/LinkModal/Telegram.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { QRCode } from 'antd';
import { createStaticStyles } from 'antd-style';
import { LinkIcon } from 'lucide-react';
diff --git a/src/features/Messenger/Verify/Body/shared.tsx b/src/features/Messenger/Verify/Body/shared.tsx
index 49ce4f7f85b..a63f3251c3f 100644
--- a/src/features/Messenger/Verify/Body/shared.tsx
+++ b/src/features/Messenger/Verify/Body/shared.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui';
-import { Select } from '@lobehub/ui/base-ui';
+import { Block, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button, Select } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles } from 'antd-style';
import { AlertTriangleIcon, CheckCircle2Icon, LinkIcon } from 'lucide-react';
diff --git a/src/features/Messenger/Verify/index.tsx b/src/features/Messenger/Verify/index.tsx
index c22a8dd2388..9b83062fd06 100644
--- a/src/features/Messenger/Verify/index.tsx
+++ b/src/features/Messenger/Verify/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { useSearchParams } from 'react-router';
diff --git a/src/features/ModelSwitchPanel/components/ControlsForm/ContextCachingSwitch.tsx b/src/features/ModelSwitchPanel/components/ControlsForm/ContextCachingSwitch.tsx
index 7b63009e96b..43f6976227d 100644
--- a/src/features/ModelSwitchPanel/components/ControlsForm/ContextCachingSwitch.tsx
+++ b/src/features/ModelSwitchPanel/components/ControlsForm/ContextCachingSwitch.tsx
@@ -1,4 +1,4 @@
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import { memo } from 'react';
interface ContextCachingSwitchProps {
diff --git a/src/features/ModelSwitchPanel/components/ControlsForm/ControlsForm.tsx b/src/features/ModelSwitchPanel/components/ControlsForm/ControlsForm.tsx
index d8626982ef4..a814afb1b73 100644
--- a/src/features/ModelSwitchPanel/components/ControlsForm/ControlsForm.tsx
+++ b/src/features/ModelSwitchPanel/components/ControlsForm/ControlsForm.tsx
@@ -1,7 +1,8 @@
import type { LobeAgentChatConfig } from '@lobechat/types';
import { type FormItemProps } from '@lobehub/ui';
import { Form } from '@lobehub/ui';
-import { Form as AntdForm, Grid, Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
+import { Form as AntdForm, Grid } from 'antd';
import isEqual from 'fast-deep-equal';
import { memo, useEffect, useMemo } from 'react';
import { Trans, useTranslation } from 'react-i18next';
diff --git a/src/features/NavPanel/components/BackNav.tsx b/src/features/NavPanel/components/BackNav.tsx
index 0d24e62aabf..c45b6adc6fa 100644
--- a/src/features/NavPanel/components/BackNav.tsx
+++ b/src/features/NavPanel/components/BackNav.tsx
@@ -1,4 +1,5 @@
-import { ActionIcon, Button, Flexbox } from '@lobehub/ui';
+import { ActionIcon, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { ChevronLeftIcon } from 'lucide-react';
import { type MouseEvent, type PropsWithChildren, type ReactNode, useCallback } from 'react';
diff --git a/src/features/OllamaModelDownloader/index.tsx b/src/features/OllamaModelDownloader/index.tsx
index c330292feed..f6eb71d0f9a 100644
--- a/src/features/OllamaModelDownloader/index.tsx
+++ b/src/features/OllamaModelDownloader/index.tsx
@@ -1,5 +1,6 @@
import { Ollama } from '@lobehub/icons';
-import { Alert, Button, Center, Flexbox, Input } from '@lobehub/ui';
+import { Alert, Center, Flexbox, Input } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Progress } from 'antd';
import { cssVar } from 'antd-style';
import { type ReactNode } from 'react';
diff --git a/src/features/Onboarding/Agent/CompletionPanel.tsx b/src/features/Onboarding/Agent/CompletionPanel.tsx
index e59ae748dc9..bd89fe59ce4 100644
--- a/src/features/Onboarding/Agent/CompletionPanel.tsx
+++ b/src/features/Onboarding/Agent/CompletionPanel.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Center, Flexbox, Text } from '@lobehub/ui';
+import { Center, Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Onboarding/Agent/DebugExportButton.tsx b/src/features/Onboarding/Agent/DebugExportButton.tsx
index 230cdb6ae74..51fe17a4f71 100644
--- a/src/features/Onboarding/Agent/DebugExportButton.tsx
+++ b/src/features/Onboarding/Agent/DebugExportButton.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, copyToClipboard } from '@lobehub/ui';
+import { copyToClipboard } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { LogsIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
diff --git a/src/features/Onboarding/Agent/FeedbackPanel.tsx b/src/features/Onboarding/Agent/FeedbackPanel.tsx
index 693e41db592..8d959086f69 100644
--- a/src/features/Onboarding/Agent/FeedbackPanel.tsx
+++ b/src/features/Onboarding/Agent/FeedbackPanel.tsx
@@ -1,7 +1,8 @@
'use client';
import { useAnalytics } from '@lobehub/analytics/react';
-import { Button, Flexbox, Icon, Text, TextArea } from '@lobehub/ui';
+import { Flexbox, Icon, Text, TextArea } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { ThumbsDownIcon, ThumbsUpIcon } from 'lucide-react';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Onboarding/Agent/HistoryPanel.tsx b/src/features/Onboarding/Agent/HistoryPanel.tsx
index 138ce47f816..fbc9b13073f 100644
--- a/src/features/Onboarding/Agent/HistoryPanel.tsx
+++ b/src/features/Onboarding/Agent/HistoryPanel.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Tag, Text } from '@lobehub/ui';
+import { Flexbox, Tag, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Onboarding/Agent/MessengerIntegrations.tsx b/src/features/Onboarding/Agent/MessengerIntegrations.tsx
index e5c01b317b3..dfe22486b3d 100644
--- a/src/features/Onboarding/Agent/MessengerIntegrations.tsx
+++ b/src/features/Onboarding/Agent/MessengerIntegrations.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Popover, Skeleton, Text } from '@lobehub/ui';
+import { Flexbox, Popover, Skeleton, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Discord, Slack, Telegram } from '@lobehub/ui/icons';
import { Divider, QRCode } from 'antd';
import { createStaticStyles } from 'antd-style';
diff --git a/src/features/Onboarding/Agent/WrapUpHint.tsx b/src/features/Onboarding/Agent/WrapUpHint.tsx
index 6033753bc14..c1e84345fc2 100644
--- a/src/features/Onboarding/Agent/WrapUpHint.tsx
+++ b/src/features/Onboarding/Agent/WrapUpHint.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Onboarding/Agent/index.tsx b/src/features/Onboarding/Agent/index.tsx
index 74a525bed5f..5680eff8e00 100644
--- a/src/features/Onboarding/Agent/index.tsx
+++ b/src/features/Onboarding/Agent/index.tsx
@@ -5,7 +5,8 @@ import { setAgentTemplatesFetcher } from '@lobechat/builtin-tool-web-onboarding/
import { AGENT_CHAT_TOPIC_URL } from '@lobechat/const';
import type { SendMessageParams } from '@lobechat/types';
import { RequestTrigger } from '@lobechat/types';
-import { Button, ErrorBoundary, Flexbox } from '@lobehub/ui';
+import { ErrorBoundary, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Drawer } from 'antd';
import { History } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
diff --git a/src/features/PageEditor/History/CompareModal/CompareContent.tsx b/src/features/PageEditor/History/CompareModal/CompareContent.tsx
index 0dc2a1ad1e8..204d93afa4c 100644
--- a/src/features/PageEditor/History/CompareModal/CompareContent.tsx
+++ b/src/features/PageEditor/History/CompareModal/CompareContent.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Text } from '@lobehub/ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import dayjs from 'dayjs';
import { RotateCcwIcon } from 'lucide-react';
diff --git a/src/features/PageEditor/History/index.tsx b/src/features/PageEditor/History/index.tsx
index 7f3a9a7ba0e..120a742b478 100644
--- a/src/features/PageEditor/History/index.tsx
+++ b/src/features/PageEditor/History/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Empty, Flexbox, Text } from '@lobehub/ui';
-import { confirmModal, type ModalInstance } from '@lobehub/ui/base-ui';
+import { Empty, Flexbox, Text } from '@lobehub/ui';
+import { Button, confirmModal, type ModalInstance } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import dayjs from 'dayjs';
diff --git a/src/features/PageEditor/PageEditor.tsx b/src/features/PageEditor/PageEditor.tsx
index edc5ffae5b6..ceed5e8a98b 100644
--- a/src/features/PageEditor/PageEditor.tsx
+++ b/src/features/PageEditor/PageEditor.tsx
@@ -2,7 +2,7 @@
import { DEFAULT_BLOCK_ANCHOR_PADDING, EditorProvider } from '@lobehub/editor/react';
import { Flexbox } from '@lobehub/ui';
-import { createStyles, cssVar } from 'antd-style';
+import { createStaticStyles, cssVar } from 'antd-style';
import type { CSSProperties, FC, ReactNode, UIEvent } from 'react';
import { memo, useCallback, useEffect, useRef } from 'react';
@@ -81,7 +81,7 @@ const styles = StyleSheet.create({
},
});
-const useTableOverrideStyles = createStyles(({ css }) => ({
+const overrideStyles = createStaticStyles(({ css }) => ({
editorContent: css`
.lobe-editor-table-scroll-wrapper.lobe-editor-table-scroll-wrapper {
--lobe-block-anchor-padding: var(--lobe-pageeditor-table-bleed-inline);
@@ -149,7 +149,6 @@ const PageEditorCanvas = memo<PageEditorCanvasProps>(({ header, fullWidthHeader,
const editor = usePageEditorStore((s) => s.editor);
const documentId = usePageEditorStore((s) => s.documentId);
const wideScreen = useGlobalStore(systemStatusSelectors.wideScreen);
- const { styles: overrideStyles } = useTableOverrideStyles();
const tableBleedInline = wideScreen
? `${TABLE_BASE_BLEED}px`
: `calc(${TABLE_BASE_BLEED}px + max((100cqi - ${CONVERSATION_MIN_WIDTH}px) / 2, 0px))`;
diff --git a/src/features/PageEditor/TitleSection.tsx b/src/features/PageEditor/TitleSection.tsx
index ad2ecab39f2..e4582387296 100644
--- a/src/features/PageEditor/TitleSection.tsx
+++ b/src/features/PageEditor/TitleSection.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Icon, Skeleton, TextArea } from '@lobehub/ui';
+import { Flexbox, Icon, Skeleton, TextArea } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { SmilePlus } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx b/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx
index 06827946b5c..eb4c8e15f9c 100644
--- a/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx
+++ b/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx
@@ -1,5 +1,6 @@
import { type InputProps } from '@lobehub/ui';
-import { ActionIcon, Button, Flexbox, Input } from '@lobehub/ui';
+import { ActionIcon, Flexbox, Input } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Plus, X } from 'lucide-react';
import React, { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx b/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx
index ca0f79ecabf..f3bc295c842 100644
--- a/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx
+++ b/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx
@@ -1,4 +1,5 @@
-import { Alert, Button, Flexbox, TextArea } from '@lobehub/ui';
+import { Alert, Flexbox, TextArea } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type FormInstance } from 'antd';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/PluginDevModal/MCPManifestForm/index.tsx b/src/features/PluginDevModal/MCPManifestForm/index.tsx
index 137591e54fa..d0715bb9473 100644
--- a/src/features/PluginDevModal/MCPManifestForm/index.tsx
+++ b/src/features/PluginDevModal/MCPManifestForm/index.tsx
@@ -1,4 +1,5 @@
-import { Alert, Button, Flexbox, FormItem, Input, InputPassword } from '@lobehub/ui';
+import { Alert, Flexbox, FormItem, Input, InputPassword } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type FormInstance } from 'antd';
import { Divider, Form, Radio } from 'antd';
import isEqual from 'fast-deep-equal';
diff --git a/src/features/PluginDevModal/PluginPreview/index.tsx b/src/features/PluginDevModal/PluginPreview/index.tsx
index 25a80bc64b5..f7baa7a4fd7 100644
--- a/src/features/PluginDevModal/PluginPreview/index.tsx
+++ b/src/features/PluginDevModal/PluginPreview/index.tsx
@@ -1,5 +1,6 @@
import { type ToolManifest } from '@lobechat/types';
-import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Block, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type FormInstance } from 'antd';
import { Form as AForm } from 'antd';
import { cssVar } from 'antd-style';
diff --git a/src/features/PluginDevModal/index.tsx b/src/features/PluginDevModal/index.tsx
index 77f52e8551a..5e0b6628d2d 100644
--- a/src/features/PluginDevModal/index.tsx
+++ b/src/features/PluginDevModal/index.tsx
@@ -1,7 +1,8 @@
import { isDesktop } from '@lobechat/const';
import { TITLE_BAR_HEIGHT } from '@lobechat/desktop-bridge';
import { type LobeToolCustomPlugin } from '@lobechat/types';
-import { Button, Drawer, Flexbox } from '@lobehub/ui';
+import { Drawer, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App, Form, Popconfirm } from 'antd';
import { useResponsive } from 'antd-style';
import { memo, useEffect, useRef, useState } from 'react';
diff --git a/src/features/PluginTag/PluginStatus.tsx b/src/features/PluginTag/PluginStatus.tsx
index 9357721565b..97cd8430380 100644
--- a/src/features/PluginTag/PluginStatus.tsx
+++ b/src/features/PluginTag/PluginStatus.tsx
@@ -1,4 +1,5 @@
-import { ActionIcon, Button, Flexbox, Tag } from '@lobehub/ui';
+import { ActionIcon, Flexbox, Tag } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Badge } from 'antd';
import isEqual from 'fast-deep-equal';
import { LucideRotateCw, LucideTrash2, RotateCwIcon } from 'lucide-react';
diff --git a/src/features/Portal/Artifacts/Body/Renderer/SVG.tsx b/src/features/Portal/Artifacts/Body/Renderer/SVG.tsx
index 3e50cd2f43b..950ed7267c3 100644
--- a/src/features/Portal/Artifacts/Body/Renderer/SVG.tsx
+++ b/src/features/Portal/Artifacts/Body/Renderer/SVG.tsx
@@ -1,6 +1,7 @@
import { BRANDING_NAME } from '@lobechat/business-const';
import { copyImageToClipboard, sanitizeSVGContent } from '@lobechat/utils/client';
-import { Button, Center, DropdownMenu, Flexbox, Tooltip } from '@lobehub/ui';
+import { Center, DropdownMenu, Flexbox, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { snapdom } from '@zumer/snapdom';
import { App, Space } from 'antd';
import { css, cx } from 'antd-style';
diff --git a/src/features/Portal/Document/Body.test.tsx b/src/features/Portal/Document/Body.test.tsx
index ac4dc9c9c83..10424d5f02d 100644
--- a/src/features/Portal/Document/Body.test.tsx
+++ b/src/features/Portal/Document/Body.test.tsx
@@ -4,17 +4,22 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import DocumentBody from './Body';
-vi.mock('antd-style', () => ({
- createStaticStyles: () => ({
- content: 'content',
- }),
- cssVar: {
- colorBgContainer: 'var(--color-bg-container)',
- colorBorderSecondary: 'var(--color-border-secondary)',
- colorTextSecondary: 'var(--color-text-secondary)',
- fontFamilyCode: 'monospace',
- },
-}));
+vi.mock('antd-style', async (importOriginal) => {
+ const actual = (await importOriginal()) as Record<string, unknown>;
+
+ return {
+ ...actual,
+ createStaticStyles: () => ({
+ content: 'content',
+ }),
+ cssVar: {
+ colorBgContainer: 'var(--color-bg-container)',
+ colorBorderSecondary: 'var(--color-border-secondary)',
+ colorTextSecondary: 'var(--color-text-secondary)',
+ fontFamilyCode: 'monospace',
+ },
+ };
+});
vi.mock('react-i18next', () => ({
useTranslation: () => ({
diff --git a/src/features/Portal/Document/Body.tsx b/src/features/Portal/Document/Body.tsx
index 6a6c4de03cb..1b778c06ed2 100644
--- a/src/features/Portal/Document/Body.tsx
+++ b/src/features/Portal/Document/Body.tsx
@@ -1,7 +1,8 @@
'use client';
import { EDITOR_DEBOUNCE_TIME, EDITOR_MAX_WAIT } from '@lobechat/const';
-import { ActionIcon, Button, Flexbox, Text, TextArea } from '@lobehub/ui';
+import { ActionIcon, Flexbox, Text, TextArea } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { debounce } from 'es-toolkit/compat';
import { CheckIcon, PencilIcon, XIcon } from 'lucide-react';
@@ -156,7 +157,7 @@ const SkillFrontmatterBlock = memo<SkillFrontmatterBlockProps>(({ documentId, fr
<Text type="secondary">{t('skillFrontmatter.title')}</Text>
{editing ? (
<Flexbox horizontal gap={8}>
- <Button icon={XIcon} size="small" variant="outlined" onClick={handleCancel}>
+ <Button icon={XIcon} size="small" onClick={handleCancel}>
{t('cancel')}
</Button>
<Button
diff --git a/src/features/Portal/Thread/Header/New.tsx b/src/features/Portal/Thread/Header/New.tsx
index 01e881efecf..8e881dde635 100644
--- a/src/features/Portal/Thread/Header/New.tsx
+++ b/src/features/Portal/Thread/Header/New.tsx
@@ -1,5 +1,5 @@
import { Flexbox, Icon, Text } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import { GitBranch } from 'lucide-react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Portal/VerifyResult/Body.tsx b/src/features/Portal/VerifyResult/Body.tsx
index 37bc28e2c7b..2f9cc8f4c98 100644
--- a/src/features/Portal/VerifyResult/Body.tsx
+++ b/src/features/Portal/VerifyResult/Body.tsx
@@ -1,6 +1,7 @@
import type { VerifierType } from '@lobechat/types';
-import { Button, Flexbox, Markdown, Text } from '@lobehub/ui';
-import { createStyles } from 'antd-style';
+import { Flexbox, Markdown, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
+import { createStaticStyles, cssVar } from 'antd-style';
import { ListTree } from 'lucide-react';
import type { ReactNode } from 'react';
import { memo } from 'react';
@@ -16,12 +17,12 @@ import { verifyService } from '@/services/verify';
import { useChatStore } from '@/store/chat';
import { chatPortalSelectors, threadSelectors } from '@/store/chat/selectors';
-const useStyles = createStyles(({ css, token }) => ({
+const styles = createStaticStyles(({ css, cssVar }) => ({
confidenceCard: css`
padding: 12px;
- border: 1px solid ${token.colorBorderSecondary};
- border-radius: ${token.borderRadiusLG}px;
- background: ${token.colorFillQuaternary};
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadiusLG};
+ background: ${cssVar.colorFillQuaternary};
`,
confidenceValue: css`
font-size: 20px;
@@ -31,16 +32,16 @@ const useStyles = createStyles(({ css, token }) => ({
fill: css`
height: 100%;
border-radius: 999px;
- transition: width 300ms ${token.motionEaseOut};
+ transition: width 300ms ${cssVar.motionEaseOut};
`,
label: css`
margin-block-end: 6px;
font-size: 12px;
font-weight: 600;
- color: ${token.colorTextSecondary};
+ color: ${cssVar.colorTextSecondary};
`,
metaKey: css`
- color: ${token.colorTextTertiary};
+ color: ${cssVar.colorTextTertiary};
`,
metaRow: css`
display: flex;
@@ -52,14 +53,14 @@ const useStyles = createStyles(({ css, token }) => ({
`,
metaValue: css`
overflow: hidden;
- color: ${token.colorText};
+ color: ${cssVar.colorText};
text-overflow: ellipsis;
white-space: nowrap;
`,
text: css`
font-size: 13px;
line-height: 1.7;
- color: ${token.colorText};
+ color: ${cssVar.colorText};
`,
track: css`
overflow: hidden;
@@ -68,12 +69,12 @@ const useStyles = createStyles(({ css, token }) => ({
height: 8px;
border-radius: 999px;
- background: ${token.colorFillSecondary};
+ background: ${cssVar.colorFillSecondary};
`,
}));
/** Score zone → theme color token, mirroring the A/B/F grade bands. */
-const confidenceColor = (ratio: number) => {
+const confidenceColor = (ratio: number): keyof typeof cssVar => {
if (ratio >= 0.8) return 'colorSuccess';
if (ratio >= 0.6) return 'colorWarning';
return 'colorError';
@@ -90,7 +91,6 @@ const formatDuration = (started?: Date | string | null, completed?: Date | strin
};
const Field = memo<{ children: ReactNode; label: string }>(({ label, children }) => {
- const { styles } = useStyles();
return (
<Flexbox>
<div className={styles.label}>{label}</div>
@@ -100,7 +100,6 @@ const Field = memo<{ children: ReactNode; label: string }>(({ label, children })
});
const Body = () => {
- const { styles, theme } = useStyles();
const { t } = useTranslation('verify');
const operationId = useChatStore(chatPortalSelectors.verifyResultOperationId);
const checkItemId = useChatStore(chatPortalSelectors.verifyResultCheckItemId);
@@ -116,8 +115,6 @@ const Body = () => {
if (!item) return null;
- const colorOf = (key: string) => (theme as unknown as Record<string, string>)[key];
-
const ratio = typeof result?.confidence === 'number' ? result.confidence : undefined;
const duration = formatDuration(result?.startedAt, result?.completedAt);
const instruction = instructionDoc?.content;
@@ -182,7 +179,7 @@ const Body = () => {
</span>
<span
className={styles.confidenceValue}
- style={{ color: colorOf(confidenceColor(ratio)) }}
+ style={{ color: cssVar[confidenceColor(ratio)] }}
>
{Math.round(ratio * 100)}%
</span>
@@ -191,7 +188,7 @@ const Body = () => {
<div
className={styles.fill}
style={{
- background: colorOf(confidenceColor(ratio)),
+ background: cssVar[confidenceColor(ratio)],
width: `${Math.round(ratio * 100)}%`,
}}
/>
diff --git a/src/features/Portal/VerifyResult/Title.tsx b/src/features/Portal/VerifyResult/Title.tsx
index c5c60b2fa9d..6af12ce6099 100644
--- a/src/features/Portal/VerifyResult/Title.tsx
+++ b/src/features/Portal/VerifyResult/Title.tsx
@@ -1,5 +1,5 @@
import { Flexbox, Icon, Text } from '@lobehub/ui';
-import { createStyles } from 'antd-style';
+import { createStaticStyles, cssVar } from 'antd-style';
import { CheckCircle2, Circle, CircleAlert, LoaderCircle, XCircle } from 'lucide-react';
import type { VerifyCheckResultItem } from '@/database/schemas/verify';
@@ -8,7 +8,7 @@ import { useChatStore } from '@/store/chat';
import { chatPortalSelectors } from '@/store/chat/selectors';
import { oneLineEllipsis } from '@/styles';
-const useStyles = createStyles(({ css }) => ({
+const styles = createStaticStyles(({ css }) => ({
badge: css`
display: inline-flex;
flex: none;
@@ -24,28 +24,29 @@ const useStyles = createStyles(({ css }) => ({
`,
}));
-const statusMeta = (status: VerifyCheckResultItem['status'] | undefined) => {
+const statusMeta = (
+ status: VerifyCheckResultItem['status'] | undefined,
+): { bg: keyof typeof cssVar; icon: typeof CheckCircle2; text: keyof typeof cssVar } => {
switch (status) {
case 'passed': {
- return { bg: 'colorSuccess', icon: CheckCircle2, text: 'colorSuccessTextActive' } as const;
+ return { bg: 'colorSuccess', icon: CheckCircle2, text: 'colorSuccessTextActive' };
}
case 'running': {
- return { bg: 'colorInfo', icon: LoaderCircle, text: 'colorInfoTextActive' } as const;
+ return { bg: 'colorInfo', icon: LoaderCircle, text: 'colorInfoTextActive' };
}
case 'failed': {
- return { bg: 'colorError', icon: XCircle, text: 'colorErrorTextActive' } as const;
+ return { bg: 'colorError', icon: XCircle, text: 'colorErrorTextActive' };
}
case 'skipped': {
- return { bg: 'colorTextQuaternary', icon: CircleAlert, text: 'colorTextSecondary' } as const;
+ return { bg: 'colorTextQuaternary', icon: CircleAlert, text: 'colorTextSecondary' };
}
default: {
- return { bg: 'colorTextQuaternary', icon: Circle, text: 'colorTextSecondary' } as const;
+ return { bg: 'colorTextQuaternary', icon: Circle, text: 'colorTextSecondary' };
}
}
};
const Title = () => {
- const { styles, theme } = useStyles();
const operationId = useChatStore(chatPortalSelectors.verifyResultOperationId);
const checkItemId = useChatStore(chatPortalSelectors.verifyResultCheckItemId);
const { data: state } = useVerifyState(operationId ?? null);
@@ -55,7 +56,6 @@ const Title = () => {
const result = (results ?? []).find((r) => r.checkItemId === checkItemId);
const sIcon = statusMeta(result?.status);
- const colorOf = (key: string) => (theme as unknown as Record<string, string>)[key];
const label = result?.verdict ?? result?.status;
return (
@@ -67,8 +67,8 @@ const Title = () => {
<span
className={styles.badge}
style={{
- background: `color-mix(in srgb, ${colorOf(sIcon.bg)} 12%, transparent)`,
- color: colorOf(sIcon.text),
+ background: `color-mix(in srgb, ${cssVar[sIcon.bg]} 12%, transparent)`,
+ color: cssVar[sIcon.text],
}}
>
<Icon icon={sIcon.icon} size={13} spin={result?.status === 'running'} />
diff --git a/src/features/ProfileEditor/AgentTool.tsx b/src/features/ProfileEditor/AgentTool.tsx
index ce8ac2ace9e..5ed35ddcb86 100644
--- a/src/features/ProfileEditor/AgentTool.tsx
+++ b/src/features/ProfileEditor/AgentTool.tsx
@@ -3,7 +3,8 @@
import { COMPOSIO_APP_TYPES, LOBEHUB_SKILL_PROVIDERS } from '@lobechat/const';
import { getActivePluginIds, parsePluginEntry, upsertPluginMode } from '@lobechat/types';
import { type ItemType } from '@lobehub/ui';
-import { Avatar, Button, Flexbox, Icon } from '@lobehub/ui';
+import { Avatar, Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { McpIcon, SkillsIcon } from '@lobehub/ui/icons';
import { cssVar } from 'antd-style';
import isEqual from 'fast-deep-equal';
diff --git a/src/features/RecommendTaskTemplates/ConnectorAuthRow.tsx b/src/features/RecommendTaskTemplates/ConnectorAuthRow.tsx
index 2a9adc2e5da..9875ecbe134 100644
--- a/src/features/RecommendTaskTemplates/ConnectorAuthRow.tsx
+++ b/src/features/RecommendTaskTemplates/ConnectorAuthRow.tsx
@@ -1,5 +1,6 @@
import type { TaskTemplateConnectorReference } from '@lobechat/const';
-import { Button, Flexbox, Icon, Image, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Image, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -55,7 +56,7 @@ export const ConnectorAuthRow = memo<ConnectorAuthRowProps>(({ disabled, spec, o
disabled={disabled}
loading={isConnecting}
size={'small'}
- variant={'text'}
+ type={'text'}
onClick={handleConnect}
>
{t('taskTemplate.action.connect.short')}
diff --git a/src/features/RecommendTaskTemplates/TaskTemplateCard.tsx b/src/features/RecommendTaskTemplates/TaskTemplateCard.tsx
index f3f4106e51f..dd9b714e4a1 100644
--- a/src/features/RecommendTaskTemplates/TaskTemplateCard.tsx
+++ b/src/features/RecommendTaskTemplates/TaskTemplateCard.tsx
@@ -1,5 +1,6 @@
import type { TaskTemplate } from '@lobechat/const';
-import { ActionIcon, Block, Button, Center, Flexbox, Tag, Text } from '@lobehub/ui';
+import { ActionIcon, Block, Center, Flexbox, Tag, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { cssVar, cx } from 'antd-style';
import { Clock, X } from 'lucide-react';
@@ -68,7 +69,6 @@ export const TaskTemplateCard = memo<TaskTemplateCardProps>(
const primaryButton = (
<Button
- shadow
className={briefStyles.actionBtnPrimary}
disabled={disabled}
loading={loading || pendingCreate}
diff --git a/src/features/RecommendTaskTemplates/TaskTemplateDetailModal.tsx b/src/features/RecommendTaskTemplates/TaskTemplateDetailModal.tsx
index 91527e13a6a..3911485a141 100644
--- a/src/features/RecommendTaskTemplates/TaskTemplateDetailModal.tsx
+++ b/src/features/RecommendTaskTemplates/TaskTemplateDetailModal.tsx
@@ -1,8 +1,8 @@
'use client';
import type { TaskTemplate } from '@lobechat/const';
-import { ActionIcon, Button, Flexbox, Icon, Markdown, Text } from '@lobehub/ui';
-import { createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
+import { ActionIcon, Flexbox, Icon, Markdown, Text } from '@lobehub/ui';
+import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { cssVar } from 'antd-style';
import { Clock, X } from 'lucide-react';
diff --git a/src/features/Recommendations/RecommendationCard.tsx b/src/features/Recommendations/RecommendationCard.tsx
index 36f4d795dc9..e0e04878617 100644
--- a/src/features/Recommendations/RecommendationCard.tsx
+++ b/src/features/Recommendations/RecommendationCard.tsx
@@ -1,4 +1,5 @@
-import { Block, Button, Flexbox, Tag, Text } from '@lobehub/ui';
+import { Block, Flexbox, Tag, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App, Divider } from 'antd';
import { cssVar, cx } from 'antd-style';
import { memo, type ReactNode, useCallback, useState } from 'react';
@@ -77,7 +78,6 @@ export const RecommendationCard = memo<RecommendationCardProps>(
</Flexbox>
<Flexbox horizontal align={'center'} gap={8}>
<Button
- shadow
className={briefStyles.actionBtnPrimary}
loading={loading}
shape={'round'}
diff --git a/src/features/Recommendations/index.tsx b/src/features/Recommendations/index.tsx
index 4391a77197b..1c63fd39072 100644
--- a/src/features/Recommendations/index.tsx
+++ b/src/features/Recommendations/index.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Text } from '@lobehub/ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { RefreshCw } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListItem/FileListItemActions.tsx b/src/features/ResourceManager/components/Explorer/ListView/ListItem/FileListItemActions.tsx
index 5c65cb83c97..bae67870889 100644
--- a/src/features/ResourceManager/components/Explorer/ListView/ListItem/FileListItemActions.tsx
+++ b/src/features/ResourceManager/components/Explorer/ListView/ListItem/FileListItemActions.tsx
@@ -1,5 +1,6 @@
import type { IAsyncTaskError } from '@lobechat/types';
-import { Button, Flexbox, stopPropagation } from '@lobehub/ui';
+import { Flexbox, stopPropagation } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import type { ItemType } from 'antd/es/menu/interface';
import { isNull } from 'es-toolkit/compat';
import { FileBoxIcon } from 'lucide-react';
diff --git a/src/features/ResourceManager/components/Explorer/ListView/ListViewSelectAllHint.tsx b/src/features/ResourceManager/components/Explorer/ListView/ListViewSelectAllHint.tsx
index a8e60189d0d..de6941d8014 100644
--- a/src/features/ResourceManager/components/Explorer/ListView/ListViewSelectAllHint.tsx
+++ b/src/features/ResourceManager/components/Explorer/ListView/ListViewSelectAllHint.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useTranslation } from 'react-i18next';
import type { SelectAllState } from '@/routes/(main)/resource/features/store/initialState';
diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx
index 0701d7e6011..15cf42914c0 100644
--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx
+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/DefaultFileItem.tsx
@@ -1,5 +1,6 @@
import { CUSTOM_FOLDER_FILE_TYPE } from '@lobechat/const';
-import { Button, Flexbox, stopPropagation, Tooltip } from '@lobehub/ui';
+import { Flexbox, stopPropagation, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { isNull } from 'es-toolkit/compat';
import { FileBoxIcon, Folder } from 'lucide-react';
diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx
index 4335102d1c9..67d07c64321 100644
--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx
+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/ImageFileItem.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, stopPropagation, Tooltip } from '@lobehub/ui';
+import { Flexbox, stopPropagation, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Image } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { isNull } from 'es-toolkit/compat';
diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx
index 8ff504df1e6..a258e24eb3e 100644
--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx
+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/MarkdownFileItem.tsx
@@ -1,4 +1,5 @@
-import { Button, stopPropagation, Tooltip } from '@lobehub/ui';
+import { stopPropagation, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { isNull } from 'es-toolkit/compat';
import { FileBoxIcon } from 'lucide-react';
diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx
index 0f3f2e8ee13..4662dd64f8f 100644
--- a/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx
+++ b/src/features/ResourceManager/components/Explorer/MasonryView/MasonryItem/NoteFileItem.tsx
@@ -1,4 +1,5 @@
-import { Button, stopPropagation, Tooltip } from '@lobehub/ui';
+import { stopPropagation, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { isNull } from 'es-toolkit/compat';
import { FileBoxIcon } from 'lucide-react';
diff --git a/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx b/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx
index fe588a9a664..71dda84b153 100644
--- a/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx
+++ b/src/features/ResourceManager/components/Explorer/MasonryView/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Center, Checkbox, Flexbox } from '@lobehub/ui';
+import { Center, Checkbox, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { VirtuosoMasonry } from '@virtuoso.dev/masonry';
import { createStaticStyles, cssVar } from 'antd-style';
import { type UIEvent } from 'react';
diff --git a/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx b/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx
index 14acf359917..895059d49f4 100644
--- a/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx
+++ b/src/features/ResourceManager/components/Explorer/ToolBar/ActionIconWithChevron.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Icon } from '@lobehub/ui';
+import { Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { type LucideIcon } from 'lucide-react';
import { ChevronDownIcon } from 'lucide-react';
diff --git a/src/features/ResourceManager/components/Explorer/ToolBar/Config.tsx b/src/features/ResourceManager/components/Explorer/ToolBar/Config.tsx
index c16c31f5d95..c07362d3e89 100644
--- a/src/features/ResourceManager/components/Explorer/ToolBar/Config.tsx
+++ b/src/features/ResourceManager/components/Explorer/ToolBar/Config.tsx
@@ -1,5 +1,5 @@
import { Flexbox } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ResourceManager/components/Explorer/ToolBar/MultiSelectActions.tsx b/src/features/ResourceManager/components/Explorer/ToolBar/MultiSelectActions.tsx
index 8e91c71a485..4a6773aef35 100644
--- a/src/features/ResourceManager/components/Explorer/ToolBar/MultiSelectActions.tsx
+++ b/src/features/ResourceManager/components/Explorer/ToolBar/MultiSelectActions.tsx
@@ -1,5 +1,5 @@
-import { Button, Checkbox, Flexbox, Icon, Skeleton } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { Checkbox, Flexbox, Icon, Skeleton } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { BookMinusIcon, BookPlusIcon, FileBoxIcon, Trash2Icon } from 'lucide-react';
@@ -104,10 +104,9 @@ const MultiSelectActions = memo<MultiSelectActionsProps>(
{t('FileManager.actions.removeFromLibrary')}
</Button>
<Button
- color={'default'}
icon={<Icon icon={BookPlusIcon} />}
size={'small'}
- variant={'filled'}
+ type={'fill'}
onClick={() => {
onActionClick('moveToOtherKnowledgeBase');
}}
@@ -117,10 +116,9 @@ const MultiSelectActions = memo<MultiSelectActionsProps>(
</>
) : (
<Button
- color={'default'}
icon={<Icon icon={BookPlusIcon} />}
size={'small'}
- variant={'filled'}
+ type={'fill'}
onClick={() => {
onActionClick('addToKnowledgeBase');
}}
@@ -129,10 +127,9 @@ const MultiSelectActions = memo<MultiSelectActionsProps>(
</Button>
)}
<Button
- color={'default'}
icon={<Icon icon={FileBoxIcon} />}
size={'small'}
- variant={'filled'}
+ type={'fill'}
onClick={async () => {
await onActionClick('batchChunking');
}}
@@ -141,10 +138,9 @@ const MultiSelectActions = memo<MultiSelectActionsProps>(
</Button>
<Button
danger
- color={'danger'}
icon={<Icon icon={Trash2Icon} />}
size={'small'}
- variant={'filled'}
+ type={'fill'}
onClick={async () => {
confirmModal({
cancelText: t('cancel', { ns: 'common' }),
diff --git a/src/features/ResourceManager/components/Header/AddButton.tsx b/src/features/ResourceManager/components/Header/AddButton.tsx
index 444901f3b08..072e1717cd7 100644
--- a/src/features/ResourceManager/components/Header/AddButton.tsx
+++ b/src/features/ResourceManager/components/Header/AddButton.tsx
@@ -7,7 +7,8 @@ import {
} from '@lobechat/const';
import { Notion } from '@lobehub/icons';
import { type DropdownItem } from '@lobehub/ui';
-import { Button, DropdownMenu, Icon, Tooltip } from '@lobehub/ui';
+import { DropdownMenu, Icon, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Upload } from 'antd';
import { FilePenLine, FileUp, FolderIcon, FolderUp, Link, Plus } from 'lucide-react';
import { type ChangeEvent } from 'react';
diff --git a/src/features/ShareModal/ShareImage/index.tsx b/src/features/ShareModal/ShareImage/index.tsx
index 02b901dcbf7..f11ba679aec 100644
--- a/src/features/ShareModal/ShareImage/index.tsx
+++ b/src/features/ShareModal/ShareImage/index.tsx
@@ -1,7 +1,6 @@
import { type FormItemProps } from '@lobehub/ui';
-import { Button, Flexbox, Form } from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
-import { Switch } from 'antd';
+import { Flexbox, Form } from '@lobehub/ui';
+import { Button, Switch, Tabs } from '@lobehub/ui/base-ui';
import { CopyIcon } from 'lucide-react';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ShareModal/ShareJSON/index.tsx b/src/features/ShareModal/ShareJSON/index.tsx
index 53cbd4757e8..b76539e738c 100644
--- a/src/features/ShareModal/ShareJSON/index.tsx
+++ b/src/features/ShareModal/ShareJSON/index.tsx
@@ -2,9 +2,9 @@ import { FORM_STYLE } from '@lobechat/const';
import { type TopicExportMode } from '@lobechat/types';
import { exportFile } from '@lobechat/utils/client';
import { type FormItemProps } from '@lobehub/ui';
-import { Button, copyToClipboard, Flexbox, Form } from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
-import { App, Switch } from 'antd';
+import { copyToClipboard, Flexbox, Form } from '@lobehub/ui';
+import { Button, Switch, Tabs } from '@lobehub/ui/base-ui';
+import { App } from 'antd';
import { CopyIcon } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ShareModal/SharePdf/PdfPreview.tsx b/src/features/ShareModal/SharePdf/PdfPreview.tsx
index 61ad6912776..98945c6b0a8 100644
--- a/src/features/ShareModal/SharePdf/PdfPreview.tsx
+++ b/src/features/ShareModal/SharePdf/PdfPreview.tsx
@@ -1,8 +1,8 @@
'use client';
import { LoadingOutlined } from '@ant-design/icons';
-import { Button, Flexbox } from '@lobehub/ui';
-import { createModal } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button, createModal } from '@lobehub/ui/base-ui';
import { Input, Spin } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { ChevronLeft, ChevronRight, Expand, FileText } from 'lucide-react';
diff --git a/src/features/ShareModal/SharePdf/index.tsx b/src/features/ShareModal/SharePdf/index.tsx
index c811158bb40..e685e55da0a 100644
--- a/src/features/ShareModal/SharePdf/index.tsx
+++ b/src/features/ShareModal/SharePdf/index.tsx
@@ -1,7 +1,8 @@
import { type UIChatMessage } from '@lobechat/types';
import { type FormItemProps } from '@lobehub/ui';
-import { Button, Flexbox, Form } from '@lobehub/ui';
-import { App, Switch } from 'antd';
+import { Flexbox, Form } from '@lobehub/ui';
+import { Button, Switch } from '@lobehub/ui/base-ui';
+import { App } from 'antd';
import { cx } from 'antd-style';
import { DownloadIcon, FileText } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/features/ShareModal/ShareText/index.tsx b/src/features/ShareModal/ShareText/index.tsx
index f348db68cf7..83af458c7ab 100644
--- a/src/features/ShareModal/ShareText/index.tsx
+++ b/src/features/ShareModal/ShareText/index.tsx
@@ -1,8 +1,9 @@
import { FORM_STYLE } from '@lobechat/const';
import { exportFile } from '@lobechat/utils/client';
import { type FormItemProps } from '@lobehub/ui';
-import { Button, copyToClipboard, Flexbox, Form } from '@lobehub/ui';
-import { App, Switch } from 'antd';
+import { copyToClipboard, Flexbox, Form } from '@lobehub/ui';
+import { Button, Switch } from '@lobehub/ui/base-ui';
+import { App } from 'antd';
import { CopyIcon } from 'lucide-react';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/SharePopover/index.tsx b/src/features/SharePopover/index.tsx
index d0430097503..387e137c4ab 100644
--- a/src/features/SharePopover/index.tsx
+++ b/src/features/SharePopover/index.tsx
@@ -1,7 +1,6 @@
'use client';
import {
- Button,
Checkbox,
copyToClipboard,
Flexbox,
@@ -10,7 +9,7 @@ import {
Text,
usePopoverContext,
} from '@lobehub/ui';
-import { confirmModal, Select } from '@lobehub/ui/base-ui';
+import { Button, confirmModal, Select } from '@lobehub/ui/base-ui';
import { App, Divider } from 'antd';
import {
FileOutputIcon,
@@ -251,13 +250,7 @@ const SharePopoverContent = memo<SharePopoverContentProps>(({ onOpenModal, topic
<Divider style={{ margin: '4px 0' }} />
<Flexbox horizontal align="center" justify="space-between">
- <Button
- icon={FileOutputIcon}
- size="small"
- type="text"
- variant="text"
- onClick={handleOpenModal}
- >
+ <Button icon={FileOutputIcon} size="small" type="text" onClick={handleOpenModal}>
{t('shareModal.popover.export')}
</Button>
{currentVisibility !== 'private' && (
diff --git a/src/features/SkillStore/SkillList/AddSkillButton.tsx b/src/features/SkillStore/SkillList/AddSkillButton.tsx
index f958d407d9e..3943168776d 100644
--- a/src/features/SkillStore/SkillList/AddSkillButton.tsx
+++ b/src/features/SkillStore/SkillList/AddSkillButton.tsx
@@ -1,4 +1,5 @@
-import { Button, DropdownMenu, Flexbox, Icon, Text } from '@lobehub/ui';
+import { DropdownMenu, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { GithubIcon } from '@lobehub/ui/icons';
import { ChevronDown, FileArchive, Grid2x2Plus, Link, PenLine } from 'lucide-react';
import { type ReactNode, useState } from 'react';
diff --git a/src/features/SkillsList/RenameSkillModal.tsx b/src/features/SkillsList/RenameSkillModal.tsx
index 8e4e9318c6f..70041823ca9 100644
--- a/src/features/SkillsList/RenameSkillModal.tsx
+++ b/src/features/SkillsList/RenameSkillModal.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Input, Text } from '@lobehub/ui';
-import { createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Input, Text } from '@lobehub/ui';
+import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
import { type InputRef } from 'antd';
import { cssVar } from 'antd-style';
import { t } from 'i18next';
diff --git a/src/features/TopicPopupGuard/index.tsx b/src/features/TopicPopupGuard/index.tsx
index 670eaa64e5f..615ad582ba7 100644
--- a/src/features/TopicPopupGuard/index.tsx
+++ b/src/features/TopicPopupGuard/index.tsx
@@ -1,7 +1,8 @@
'use client';
import { type TopicPopupInfo } from '@lobechat/electron-client-ipc';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { ExternalLinkIcon } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/features/User/UserLoginOrSignup/Community.tsx b/src/features/User/UserLoginOrSignup/Community.tsx
index d19cb42c205..3cf36f6f5c1 100644
--- a/src/features/User/UserLoginOrSignup/Community.tsx
+++ b/src/features/User/UserLoginOrSignup/Community.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Verify/CheckerDock.tsx b/src/features/Verify/CheckerDock.tsx
index c887f31deaf..8460f4e6af0 100644
--- a/src/features/Verify/CheckerDock.tsx
+++ b/src/features/Verify/CheckerDock.tsx
@@ -1,6 +1,7 @@
import type { VerifyCheckItem } from '@lobechat/types';
-import { ActionIcon, Button, Flexbox, Icon, Input, TextArea } from '@lobehub/ui';
-import { createStyles } from 'antd-style';
+import { ActionIcon, Flexbox, Icon, Input, TextArea } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
+import { createStaticStyles, cssVar, cx, useThemeMode } from 'antd-style';
import {
Check,
CheckCircle2,
@@ -27,15 +28,15 @@ import { useChatStore } from '@/store/chat';
import { useVerifyResults, useVerifyState } from './hooks';
import { countResults, phaseFromStatus } from './utils';
-const useStyles = createStyles(({ css, token }) => ({
+const styles = createStaticStyles(({ css, cssVar }) => ({
actions: css`
margin-block-start: 12px;
- border-block-start: 1px solid ${token.colorBorderSecondary};
+ border-block-start: 1px solid ${cssVar.colorBorderSecondary};
`,
body: css`
padding-block: 0 12px;
padding-inline: 12px;
- border-block-start: 1px solid ${token.colorBorderSecondary};
+ border-block-start: 1px solid ${cssVar.colorBorderSecondary};
`,
/* In the merged verify card the RunResult header already draws the divider —
drop our own top border so they don't stack into a 2px line. */
@@ -51,32 +52,32 @@ const useStyles = createStyles(({ css, token }) => ({
padding-block: 12px;
&:not(:last-child) {
- border-block-end: 1px solid ${token.colorBorderSecondary};
+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};
}
`,
chevron: css`
flex: none;
- color: ${token.colorTextQuaternary};
+ color: ${cssVar.colorTextQuaternary};
`,
clickable: css`
cursor: pointer;
- transition: background 150ms ${token.motionEaseOut};
+ transition: background 150ms ${cssVar.motionEaseOut};
&:hover {
- background: ${token.colorFillQuaternary};
+ background: ${cssVar.colorFillQuaternary};
}
`,
desc: css`
margin-block-start: 3px;
font-size: 12px;
line-height: 1.45;
- color: ${token.colorTextTertiary};
+ color: ${cssVar.colorTextTertiary};
`,
dock: css`
overflow: hidden;
- border: 1px solid ${token.colorBorder};
+ border: 1px solid ${cssVar.colorBorder};
border-radius: 16px;
- background: ${token.colorBgElevated};
+ background: ${cssVar.colorBgElevated};
`,
head: css`
cursor: pointer;
@@ -92,42 +93,44 @@ const useStyles = createStyles(({ css, token }) => ({
inputPanel: css`
margin-block-start: 10px;
padding: 10px;
- border: 1px solid ${token.colorBorderSecondary};
+ border: 1px solid ${cssVar.colorBorderSecondary};
border-radius: 12px;
- background: ${token.colorFillQuaternary};
+ background: ${cssVar.colorFillQuaternary};
`,
sub: css`
overflow: hidden;
font-size: 12px;
- color: ${token.colorTextTertiary};
+ color: ${cssVar.colorTextTertiary};
text-overflow: ellipsis;
white-space: nowrap;
`,
title: css`
font-size: 13px;
font-weight: 700;
- color: ${token.colorText};
+ color: ${cssVar.colorText};
`,
}));
-const statusIcon = (status: VerifyCheckResultItem['status'] | undefined) => {
+const statusIcon = (
+ status: VerifyCheckResultItem['status'] | undefined,
+): { color: keyof typeof cssVar; icon: typeof CheckCircle2; spin: boolean } => {
switch (status) {
case 'passed': {
- return { color: 'colorSuccess', icon: CheckCircle2, spin: false } as const;
+ return { color: 'colorSuccess', icon: CheckCircle2, spin: false };
}
case 'running': {
- return { color: 'colorInfo', icon: LoaderCircle, spin: true } as const;
+ return { color: 'colorInfo', icon: LoaderCircle, spin: true };
}
case 'failed': {
- return { color: 'colorError', icon: XCircle, spin: false } as const;
+ return { color: 'colorError', icon: XCircle, spin: false };
}
case 'skipped': {
- return { color: 'colorTextQuaternary', icon: CircleAlert, spin: false } as const;
+ return { color: 'colorTextQuaternary', icon: CircleAlert, spin: false };
}
default: {
- return { color: 'colorTextQuaternary', icon: Circle, spin: false } as const;
+ return { color: 'colorTextQuaternary', icon: Circle, spin: false };
}
}
};
@@ -145,7 +148,7 @@ interface CheckerDockProps {
* and a failure feedback panel.
*/
const CheckerDock = memo<CheckerDockProps>(({ operationId, embedded }) => {
- const { styles, cx, theme } = useStyles();
+ const { isDarkMode } = useThemeMode();
const { t } = useTranslation('verify');
const { data: state, mutate: mutateState } = useVerifyState(operationId);
const { data: results, mutate: mutateResults } = useVerifyResults(operationId);
@@ -164,8 +167,6 @@ const CheckerDock = memo<CheckerDockProps>(({ operationId, embedded }) => {
if (phase === 'idle' || plan.length === 0) return null;
- const colorOf = (key: string) => (theme as unknown as Record<string, string>)[key];
-
const run = async (fn: () => Promise<unknown>) => {
setBusy(true);
try {
@@ -219,15 +220,15 @@ const CheckerDock = memo<CheckerDockProps>(({ operationId, embedded }) => {
{result?.status === 'running' ? (
<RingLoadingIcon
size={16}
- style={{ color: theme.colorWarning }}
+ style={{ color: cssVar.colorWarning }}
ringColor={
- theme.isDarkMode
- ? theme.colorWarningBorder
- : `color-mix(in srgb, ${theme.colorWarning} 45%, transparent)`
+ isDarkMode
+ ? cssVar.colorWarningBorder
+ : `color-mix(in srgb, ${cssVar.colorWarning} 45%, transparent)`
}
/>
) : (
- <Icon color={colorOf(sIcon.color)} icon={sIcon.icon} size={16} spin={sIcon.spin} />
+ <Icon color={cssVar[sIcon.color]} icon={sIcon.icon} size={16} spin={sIcon.spin} />
)}
<Flexbox style={{ minWidth: 0 }}>
<span className={styles.title} style={{ fontWeight: 600 }}>
@@ -387,7 +388,11 @@ const CheckerDock = memo<CheckerDockProps>(({ operationId, embedded }) => {
<span className={styles.sub}>{subText}</span>
</Flexbox>
</Flexbox>
- <Icon color={theme.colorTextTertiary} icon={expanded ? ChevronDown : ChevronUp} size={16} />
+ <Icon
+ color={cssVar.colorTextTertiary}
+ icon={expanded ? ChevronDown : ChevronUp}
+ size={16}
+ />
</div>
{expanded && body}
</div>
diff --git a/src/features/Verify/RunResult.tsx b/src/features/Verify/RunResult.tsx
index 78bae37329d..fe70f96a760 100644
--- a/src/features/Verify/RunResult.tsx
+++ b/src/features/Verify/RunResult.tsx
@@ -1,5 +1,5 @@
import { Flexbox, Icon } from '@lobehub/ui';
-import { createStyles } from 'antd-style';
+import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Check, Info, RefreshCw, Shield, ShieldCheck, X } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
import { useVerifyResults, useVerifyState } from './hooks';
import { countResults, type DockPhase, phaseFromStatus } from './utils';
-const useStyles = createStyles(({ css, token }) => ({
+const styles = createStaticStyles(({ css, cssVar }) => ({
badge: css`
display: inline-flex;
flex: none;
@@ -27,16 +27,16 @@ const useStyles = createStyles(({ css, token }) => ({
font-size: 13px;
line-height: 1.7;
- color: ${token.colorTextSecondary};
+ color: ${cssVar.colorTextSecondary};
`,
card: css`
overflow: hidden;
- border: 1px solid ${token.colorBorderSecondary};
+ border: 1px solid ${cssVar.colorBorderSecondary};
border-radius: 16px;
- background: ${token.colorBgContainer};
+ background: ${cssVar.colorBgContainer};
`,
cardFailed: css`
- border-color: ${token.colorErrorBorder};
+ border-color: ${cssVar.colorErrorBorder};
`,
foot: css`
display: flex;
@@ -45,10 +45,10 @@ const useStyles = createStyles(({ css, token }) => ({
padding-block: 10px;
padding-inline: 16px;
- border-block-start: 1px solid ${token.colorBorderSecondary};
+ border-block-start: 1px solid ${cssVar.colorBorderSecondary};
font-size: 12px;
- color: ${token.colorTextTertiary};
+ color: ${cssVar.colorTextTertiary};
`,
head: css`
display: flex;
@@ -58,18 +58,18 @@ const useStyles = createStyles(({ css, token }) => ({
padding-block: 14px;
padding-inline: 16px;
- border-block-end: 1px solid ${token.colorBorderSecondary};
+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};
`,
sub: css`
margin-block-start: 4px;
font-size: 12px;
line-height: 1.5;
- color: ${token.colorTextTertiary};
+ color: ${cssVar.colorTextTertiary};
`,
title: css`
font-size: 15px;
font-weight: 700;
- color: ${token.colorText};
+ color: ${cssVar.colorText};
`,
}));
@@ -126,7 +126,6 @@ interface RunResultProps {
* result snapshot, so failures are never overwritten by later success.
*/
const RunResult = memo<RunResultProps>(({ operationId, round = 1, embedded }) => {
- const { styles, cx, theme } = useStyles();
const { t } = useTranslation('verify');
const { data: state } = useVerifyState(operationId);
const { data: results } = useVerifyResults(operationId);
@@ -137,17 +136,17 @@ const RunResult = memo<RunResultProps>(({ operationId, round = 1, embedded }) =>
const counts = countResults(results ?? []);
const badgeColorMap = {
- default: theme.colorTextTertiary,
- error: theme.colorError,
- success: theme.colorSuccess,
- warning: theme.colorWarning,
+ default: cssVar.colorTextTertiary,
+ error: cssVar.colorError,
+ success: cssVar.colorSuccess,
+ warning: cssVar.colorWarning,
} as const;
// Deeper, more readable text color over the tinted badge fill.
const badgeTextMap = {
- default: theme.colorTextSecondary,
- error: theme.colorErrorTextActive,
- success: theme.colorSuccessTextActive,
- warning: theme.colorWarningTextActive,
+ default: cssVar.colorTextSecondary,
+ error: cssVar.colorErrorTextActive,
+ success: cssVar.colorSuccessTextActive,
+ warning: cssVar.colorWarningTextActive,
} as const;
const header = (
diff --git a/src/features/WorkingDirectory/AddWorkingDirModal.tsx b/src/features/WorkingDirectory/AddWorkingDirModal.tsx
index 740c2e97f08..25034055899 100644
--- a/src/features/WorkingDirectory/AddWorkingDirModal.tsx
+++ b/src/features/WorkingDirectory/AddWorkingDirModal.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Input, Text } from '@lobehub/ui';
-import { createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Input, Text } from '@lobehub/ui';
+import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
import { type InputRef } from 'antd';
import { cssVar } from 'antd-style';
import { t } from 'i18next';
diff --git a/src/features/Workspace/WorkspaceSlugBoundary.tsx b/src/features/Workspace/WorkspaceSlugBoundary.tsx
index 4c9a6df64eb..5b917191659 100644
--- a/src/features/Workspace/WorkspaceSlugBoundary.tsx
+++ b/src/features/Workspace/WorkspaceSlugBoundary.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Center } from '@lobehub/ui';
+import { Center } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
import { Outlet, useNavigate } from 'react-router';
diff --git a/src/features/WorkspaceSetting/Storage/index.tsx b/src/features/WorkspaceSetting/Storage/index.tsx
index 9e1a46f2185..0d1500b5728 100644
--- a/src/features/WorkspaceSetting/Storage/index.tsx
+++ b/src/features/WorkspaceSetting/Storage/index.tsx
@@ -2,8 +2,8 @@
import { BRANDING_NAME } from '@lobechat/business-const';
import type { FormGroupItemType } from '@lobehub/ui';
-import { Button, Form, Icon } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { Form, Icon } from '@lobehub/ui';
+import { Button, Switch } from '@lobehub/ui/base-ui';
import { HardDriveDownload, HardDriveUpload } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/layout/GlobalProvider/ServerVersionOutdatedAlert.tsx b/src/layout/GlobalProvider/ServerVersionOutdatedAlert.tsx
index f84fcf1bce7..46e5575ab9d 100644
--- a/src/layout/GlobalProvider/ServerVersionOutdatedAlert.tsx
+++ b/src/layout/GlobalProvider/ServerVersionOutdatedAlert.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Icon } from '@lobehub/ui';
+import { Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, useTheme } from 'antd-style';
import { TriangleAlert, X } from 'lucide-react';
import { useMemo, useState } from 'react';
diff --git a/src/routes/(desktop)/desktop-onboarding/features/DataModeStep.tsx b/src/routes/(desktop)/desktop-onboarding/features/DataModeStep.tsx
index a02650fe80f..1005fb19965 100644
--- a/src/routes/(desktop)/desktop-onboarding/features/DataModeStep.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/features/DataModeStep.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Block, Button, Checkbox, Empty, Flexbox, Text } from '@lobehub/ui';
+import { Block, Checkbox, Empty, Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { HeartHandshake, Undo2Icon } from 'lucide-react';
import { memo, useCallback, useState } from 'react';
diff --git a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsx b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsx
index 2a87c56a719..97400c4873d 100644
--- a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.test.tsx
@@ -53,13 +53,19 @@ vi.mock('antd', () => ({
Divider: ({ children }: { children: ReactNode }) => <div>{children}</div>,
}));
-vi.mock('antd-style', () => ({
- cssVar: {
- colorFillSecondary: '#eee',
- colorTextDescription: '#888',
- colorTextSecondary: '#666',
- },
-}));
+vi.mock('antd-style', async (importOriginal) => {
+ const actual = (await importOriginal()) as Record<string, unknown>;
+
+ return {
+ ...actual,
+ createStaticStyles: () => ({}),
+ cssVar: {
+ colorFillSecondary: '#eee',
+ colorTextDescription: '#888',
+ colorTextSecondary: '#666',
+ },
+ };
+});
vi.mock('react-i18next', () => ({
useTranslation: () => ({
diff --git a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx
index ee9e0343ef2..e6db8dd21f1 100644
--- a/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/features/LoginStep.tsx
@@ -2,7 +2,8 @@
import { type AuthorizationPhase, type AuthorizationProgress } from '@lobechat/electron-client-ipc';
import { useWatchBroadcast } from '@lobechat/electron-client-ipc';
-import { Alert, Button, Center, Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Alert, Center, Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { cssVar } from 'antd-style';
import { Cloud, Server, Undo2Icon } from 'lucide-react';
diff --git a/src/routes/(desktop)/desktop-onboarding/features/PermissionsStep.tsx b/src/routes/(desktop)/desktop-onboarding/features/PermissionsStep.tsx
index b08430a9c32..e236c716175 100644
--- a/src/routes/(desktop)/desktop-onboarding/features/PermissionsStep.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/features/PermissionsStep.tsx
@@ -1,7 +1,8 @@
'use client';
import { useWatchBroadcast } from '@lobechat/electron-client-ipc';
-import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Block, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import {
Bell,
diff --git a/src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx b/src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx
index 826d4256729..0bfedbe79b0 100644
--- a/src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx
+++ b/src/routes/(desktop)/desktop-onboarding/features/WelcomeStep.tsx
@@ -1,8 +1,9 @@
'use client';
import { type IconProps } from '@lobehub/ui';
-import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Block, Flexbox, Icon, Text } from '@lobehub/ui';
import { TypewriterEffect } from '@lobehub/ui/awesome';
+import { Button } from '@lobehub/ui/base-ui';
import { LoadingDots } from '@lobehub/ui/chat';
import { Steps } from 'antd';
import { cssVar } from 'antd-style';
diff --git a/src/routes/(main)/(create)/features/GenerationInput/GenerationInvalidAPIKey.tsx b/src/routes/(main)/(create)/features/GenerationInput/GenerationInvalidAPIKey.tsx
index b8572600a1e..b0a8fb47b2b 100644
--- a/src/routes/(main)/(create)/features/GenerationInput/GenerationInvalidAPIKey.tsx
+++ b/src/routes/(main)/(create)/features/GenerationInput/GenerationInvalidAPIKey.tsx
@@ -1,7 +1,7 @@
'use client';
import { ProviderIcon } from '@lobehub/icons';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { ModelProvider } from 'model-bank';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/InputNumber/index.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/InputNumber/index.tsx
index 75508f06b9d..37988578269 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/InputNumber/index.tsx
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/InputNumber/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, InputNumber, Tooltip } from '@lobehub/ui';
+import { Flexbox, InputNumber, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Dices } from 'lucide-react';
import { MAX_SEED } from 'model-bank';
import { type CSSProperties } from 'react';
@@ -39,12 +40,7 @@ const SeedNumberInput = memo<SeedNumberInputProps>(
{...rest}
/>
<Tooltip title={t('config.seed.random')}>
- <Button
- icon={Dices}
- style={{ flex: 'none', width: 48 }}
- variant={'outlined'}
- onClick={handleClick}
- />
+ <Button icon={Dices} style={{ flex: 'none', width: 48 }} onClick={handleClick} />
</Tooltip>
</Flexbox>
);
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/ModelSelect/index.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/ModelSelect/index.tsx
deleted file mode 100644
index 8d77d70f3ca..00000000000
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/ModelSelect/index.tsx
+++ /dev/null
@@ -1,177 +0,0 @@
-import { type SelectProps } from '@lobehub/ui';
-import { ActionIcon, Flexbox, Icon, Select } from '@lobehub/ui';
-import { createStaticStyles, cssVar } from 'antd-style';
-import { LucideArrowRight, LucideBolt } from 'lucide-react';
-import { memo, useMemo } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { ProviderItemRender } from '@/components/ModelSelect';
-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
-import { useAiInfraStore } from '@/store/aiInfra';
-import { aiProviderSelectors } from '@/store/aiInfra/slices/aiProvider/selectors';
-import { useImageStore } from '@/store/image';
-import { imageGenerationConfigSelectors } from '@/store/image/selectors';
-import { type EnabledProviderWithModels } from '@/types/index';
-
-import ImageModelItem from './ImageModelItem';
-
-const prefixCls = 'ant';
-
-const styles = createStaticStyles(({ css, cssVar }) => ({
- popup: css`
- &.${prefixCls}-select-dropdown .${prefixCls}-select-item-option {
- margin-block: 1px;
- margin-inline: 4px;
- padding-block: 8px;
- padding-inline: 8px;
- border-radius: ${cssVar.borderRadiusSM};
- }
- &.${prefixCls}-select-dropdown .${prefixCls}-select-item-option-selected {
- background: ${cssVar.colorFillTertiary};
- }
- &.${prefixCls}-select-dropdown .${prefixCls}-select-item-option-grouped {
- padding-inline-start: 12px;
- }
- `,
-}));
-
-interface ModelOption {
- label: any;
- provider: string;
- value: string;
-}
-
-const ModelSelect = memo(() => {
- const { t } = useTranslation('components');
- const navigate = useWorkspaceAwareNavigate();
-
- const [currentModel, currentProvider] = useImageStore((s) => [
- imageGenerationConfigSelectors.model(s),
- imageGenerationConfigSelectors.provider(s),
- ]);
- const setModelAndProviderOnSelect = useImageStore((s) => s.setModelAndProviderOnSelect);
-
- const enabledImageModelList = useAiInfraStore(aiProviderSelectors.enabledImageModelList);
-
- const options = useMemo<SelectProps['options']>(() => {
- const getImageModels = (provider: EnabledProviderWithModels) => {
- const modelOptions = provider.children.map((model) => ({
- label: <ImageModelItem {...model} providerId={provider.id} />,
- provider: provider.id,
- value: `${provider.id}/${model.id}`,
- }));
-
- // if there are no models, add a placeholder guide
- if (modelOptions.length === 0) {
- return [
- {
- disabled: true,
- label: (
- <Flexbox horizontal gap={8} style={{ color: cssVar.colorTextTertiary }}>
- {t('ModelSwitchPanel.emptyModel')}
- <Icon icon={LucideArrowRight} />
- </Flexbox>
- ),
- onClick: () => {
- navigate(`/settings/provider/${provider.id}`);
- },
- value: `${provider.id}/empty`,
- },
- ];
- }
-
- return modelOptions;
- };
-
- // if there are no providers at all
- if (enabledImageModelList.length === 0) {
- return [
- {
- disabled: true,
- label: (
- <Flexbox horizontal gap={8} style={{ color: cssVar.colorTextTertiary }}>
- {t('ModelSwitchPanel.emptyProvider')}
- <Icon icon={LucideArrowRight} />
- </Flexbox>
- ),
- onClick: () => {
- navigate('/settings/provider/all');
- },
- value: 'no-provider',
- },
- ];
- }
-
- if (enabledImageModelList.length === 1) {
- const provider = enabledImageModelList[0];
- return getImageModels(provider);
- }
-
- return enabledImageModelList.map((provider) => ({
- label: (
- <Flexbox horizontal justify="space-between">
- <ProviderItemRender
- logo={provider.logo}
- name={provider.name}
- provider={provider.id}
- source={provider.source}
- />
- <ActionIcon
- icon={LucideBolt}
- size={'small'}
- title={t('ModelSwitchPanel.goToSettings')}
- onClick={(e) => {
- e.stopPropagation();
- navigate(`/settings/provider/${provider.id}`);
- }}
- />
- </Flexbox>
- ),
- options: getImageModels(provider),
- }));
- }, [enabledImageModelList, t, navigate]);
-
- const labelRender: SelectProps['labelRender'] = (props) => {
- const modelInfo = enabledImageModelList
- .flatMap((provider) =>
- provider.children.map((model) => ({ ...model, providerId: provider.id })),
- )
- .find((model) => props.value === `${model.providerId}/${model.id}`);
-
- if (!modelInfo) return props.label;
-
- return (
- <ImageModelItem
- {...modelInfo}
- providerId={modelInfo.providerId}
- showBadge={false}
- showPopover={false}
- />
- );
- };
-
- return (
- <Select
- shadow
- labelRender={labelRender}
- options={options}
- popupClassName={styles.popup}
- size={'large'}
- value={currentProvider && currentModel ? `${currentProvider}/${currentModel}` : undefined}
- style={{
- width: '100%',
- }}
- onChange={(value, option) => {
- // Skip onChange for disabled options (empty states)
- if (value === 'no-provider' || value.includes('/empty')) return;
- const model = value.split('/').slice(1).join('/');
- const provider = (option as unknown as ModelOption).provider;
- if (model !== currentModel || provider !== currentProvider) {
- setModelAndProviderOnSelect(model, provider);
- }
- }}
- />
- );
-});
-
-export default ModelSelect;
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/QualitySelect.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/QualitySelect.tsx
index 98c544fcad2..84877b1814a 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/QualitySelect.tsx
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/QualitySelect.tsx
@@ -1,4 +1,4 @@
-import { Select } from '@lobehub/ui';
+import { Select } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/Select/index.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/Select/index.tsx
index 3a39bc02f86..639f0ba833e 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/Select/index.tsx
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/Select/index.tsx
@@ -1,7 +1,8 @@
'use client';
import { type GridProps } from '@lobehub/ui';
-import { Block, Center, Grid, Select, Text } from '@lobehub/ui';
+import { Block, Center, Grid, Text } from '@lobehub/ui';
+import { Select } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { type ReactNode } from 'react';
import { memo } from 'react';
@@ -43,7 +44,12 @@ const SizeSelect = memo<SizeSelectProps>(({ options, onChange, value, defaultVal
// If any option cannot be parsed as ratio, fallback to regular Select
if (hasInvalidRatio) {
return (
- <Select options={options} style={{ width: '100%' }} value={active} onChange={onChange} />
+ <Select
+ options={options?.map((item) => ({ ...item, label: item.label || item.value }))}
+ style={{ width: '100%' }}
+ value={active}
+ onChange={onChange}
+ />
);
}
return (
diff --git a/src/routes/(main)/(create)/image/features/PromptInput/index.tsx b/src/routes/(main)/(create)/image/features/PromptInput/index.tsx
index 4894b6596bc..192e384a514 100644
--- a/src/routes/(main)/(create)/image/features/PromptInput/index.tsx
+++ b/src/routes/(main)/(create)/image/features/PromptInput/index.tsx
@@ -2,8 +2,8 @@
import { ModelIcon } from '@lobehub/icons';
import { ActionIcon, Flexbox, Text } from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
-import { Divider, Switch } from 'antd';
+import { Switch, Tabs } from '@lobehub/ui/base-ui';
+import { Divider } from 'antd';
import { Images } from 'lucide-react';
import { memo, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/(create)/video/features/ConfigPanel/components/ModelSelect/index.tsx b/src/routes/(main)/(create)/video/features/ConfigPanel/components/ModelSelect/index.tsx
deleted file mode 100644
index 274d9b164ec..00000000000
--- a/src/routes/(main)/(create)/video/features/ConfigPanel/components/ModelSelect/index.tsx
+++ /dev/null
@@ -1,174 +0,0 @@
-import type { SelectProps } from '@lobehub/ui';
-import { ActionIcon, Flexbox, Icon, Select } from '@lobehub/ui';
-import { createStaticStyles, cssVar } from 'antd-style';
-import { LucideArrowRight, LucideBolt } from 'lucide-react';
-import { memo, useMemo } from 'react';
-import { useTranslation } from 'react-i18next';
-
-import { ProviderItemRender } from '@/components/ModelSelect';
-import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
-import { useAiInfraStore } from '@/store/aiInfra';
-import { aiProviderSelectors } from '@/store/aiInfra/slices/aiProvider/selectors';
-import { useVideoStore } from '@/store/video';
-import { videoGenerationConfigSelectors } from '@/store/video/selectors';
-import type { EnabledProviderWithModels } from '@/types/index';
-
-import VideoModelItem from './VideoModelItem';
-
-const prefixCls = 'ant';
-
-const styles = createStaticStyles(({ css, cssVar }) => ({
- popup: css`
- &.${prefixCls}-select-dropdown .${prefixCls}-select-item-option {
- margin-block: 1px;
- margin-inline: 4px;
- padding-block: 8px;
- padding-inline: 8px;
- border-radius: ${cssVar.borderRadiusSM};
- }
- &.${prefixCls}-select-dropdown .${prefixCls}-select-item-option-selected {
- background: ${cssVar.colorFillTertiary};
- }
- &.${prefixCls}-select-dropdown .${prefixCls}-select-item-option-grouped {
- padding-inline-start: 12px;
- }
- `,
-}));
-
-interface ModelOption {
- label: any;
- provider: string;
- value: string;
-}
-
-const ModelSelect = memo(() => {
- const { t } = useTranslation('components');
- const navigate = useWorkspaceAwareNavigate();
-
- const [currentModel, currentProvider] = useVideoStore((s) => [
- videoGenerationConfigSelectors.model(s),
- videoGenerationConfigSelectors.provider(s),
- ]);
- const setModelAndProviderOnSelect = useVideoStore((s) => s.setModelAndProviderOnSelect);
-
- const enabledVideoModelList = useAiInfraStore(aiProviderSelectors.enabledVideoModelList);
-
- const options = useMemo<SelectProps['options']>(() => {
- const getVideoModels = (provider: EnabledProviderWithModels) => {
- const modelOptions = provider.children.map((model) => ({
- label: <VideoModelItem {...model} providerId={provider.id} />,
- provider: provider.id,
- value: `${provider.id}/${model.id}`,
- }));
-
- if (modelOptions.length === 0) {
- return [
- {
- disabled: true,
- label: (
- <Flexbox horizontal gap={8} style={{ color: cssVar.colorTextTertiary }}>
- {t('ModelSwitchPanel.emptyModel')}
- <Icon icon={LucideArrowRight} />
- </Flexbox>
- ),
- onClick: () => {
- navigate(`/settings/provider/${provider.id}`);
- },
- value: `${provider.id}/empty`,
- },
- ];
- }
-
- return modelOptions;
- };
-
- if (enabledVideoModelList.length === 0) {
- return [
- {
- disabled: true,
- label: (
- <Flexbox horizontal gap={8} style={{ color: cssVar.colorTextTertiary }}>
- {t('ModelSwitchPanel.emptyProvider')}
- <Icon icon={LucideArrowRight} />
- </Flexbox>
- ),
- onClick: () => {
- navigate('/settings/provider/all');
- },
- value: 'no-provider',
- },
- ];
- }
-
- if (enabledVideoModelList.length === 1) {
- const provider = enabledVideoModelList[0];
- return getVideoModels(provider);
- }
-
- return enabledVideoModelList.map((provider) => ({
- label: (
- <Flexbox horizontal justify="space-between">
- <ProviderItemRender
- logo={provider.logo}
- name={provider.name}
- provider={provider.id}
- source={provider.source}
- />
- <ActionIcon
- icon={LucideBolt}
- size={'small'}
- title={t('ModelSwitchPanel.goToSettings')}
- onClick={(e) => {
- e.stopPropagation();
- navigate(`/settings/provider/${provider.id}`);
- }}
- />
- </Flexbox>
- ),
- options: getVideoModels(provider),
- }));
- }, [enabledVideoModelList, t, navigate]);
-
- const labelRender: SelectProps['labelRender'] = (props) => {
- const modelInfo = enabledVideoModelList
- .flatMap((provider) =>
- provider.children.map((model) => ({ ...model, providerId: provider.id })),
- )
- .find((model) => props.value === `${model.providerId}/${model.id}`);
-
- if (!modelInfo) return props.label;
-
- return (
- <VideoModelItem
- {...modelInfo}
- providerId={modelInfo.providerId}
- showBadge={false}
- showPopover={false}
- />
- );
- };
-
- return (
- <Select
- shadow
- labelRender={labelRender}
- options={options}
- popupClassName={styles.popup}
- size={'large'}
- value={currentProvider && currentModel ? `${currentProvider}/${currentModel}` : undefined}
- style={{
- width: '100%',
- }}
- onChange={(value, option) => {
- if (value === 'no-provider' || value.includes('/empty')) return;
- const model = value.split('/').slice(1).join('/');
- const provider = (option as unknown as ModelOption).provider;
- if (model !== currentModel || provider !== currentProvider) {
- setModelAndProviderOnSelect(model, provider);
- }
- }}
- />
- );
-});
-
-export default ModelSelect;
diff --git a/src/routes/(main)/(create)/video/features/PromptInput/index.tsx b/src/routes/(main)/(create)/video/features/PromptInput/index.tsx
index c4847225d1e..3a2be86924e 100644
--- a/src/routes/(main)/(create)/video/features/PromptInput/index.tsx
+++ b/src/routes/(main)/(create)/video/features/PromptInput/index.tsx
@@ -2,8 +2,8 @@
import { ModelIcon } from '@lobehub/icons';
import { ActionIcon, Flexbox, InputNumber, SliderWithInput, Text } from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
-import { Divider, Switch } from 'antd';
+import { Switch, Tabs } from '@lobehub/ui/base-ui';
+import { Divider } from 'antd';
import { Clock3, Dices } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/agent/channel/detail/permission.test.tsx b/src/routes/(main)/agent/channel/detail/permission.test.tsx
index be95950a905..c065a957291 100644
--- a/src/routes/(main)/agent/channel/detail/permission.test.tsx
+++ b/src/routes/(main)/agent/channel/detail/permission.test.tsx
@@ -18,10 +18,6 @@ const mocks = vi.hoisted(() => ({
navigate: vi.fn(),
}));
-interface AntdMockModule {
- App: Record<PropertyKey, unknown>;
-}
-
vi.mock('react-i18next', () => ({
Trans: ({ i18nKey }: { i18nKey: string }) => <span>{i18nKey}</span>,
useTranslation: () => ({
@@ -31,7 +27,10 @@ vi.mock('react-i18next', () => ({
}));
vi.mock('antd', async (importOriginal) => {
- const actual = await importOriginal<AntdMockModule>();
+ const actual = (await importOriginal()) as { App: Record<string, unknown> } & Record<
+ string,
+ unknown
+ >;
return {
...actual,
diff --git a/src/routes/(main)/agent/channel/platform/imessage/CredentialExtras.tsx b/src/routes/(main)/agent/channel/platform/imessage/CredentialExtras.tsx
index 37005bdd510..30c00569ee2 100644
--- a/src/routes/(main)/agent/channel/platform/imessage/CredentialExtras.tsx
+++ b/src/routes/(main)/agent/channel/platform/imessage/CredentialExtras.tsx
@@ -3,8 +3,8 @@
import { isDesktop } from '@lobechat/const';
import type { ImessageBridgeConfig, ImessageBridgeStatus } from '@lobechat/electron-client-ipc';
import { Flexbox, FormItem, Tag, Text } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
-import { App, Form as AntdForm, Switch } from 'antd';
+import { Button, Switch } from '@lobehub/ui/base-ui';
+import { App, Form as AntdForm } from 'antd';
import { createStaticStyles } from 'antd-style';
import { Info, Wrench } from 'lucide-react';
import { memo, use, useCallback, useEffect, useState } from 'react';
diff --git a/src/routes/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx b/src/routes/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
index d5718a957a6..0f7e63b9d2b 100644
--- a/src/routes/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
+++ b/src/routes/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
@@ -2,9 +2,10 @@
import { type ComposioAppType } from '@lobechat/const';
import { COMPOSIO_APP_TYPES } from '@lobechat/const';
-import { ActionIcon, Alert, Avatar, Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { ActionIcon, Alert, Avatar, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
-import { createStyles, cssVar } from 'antd-style';
+import { createStaticStyles, cssVar, cx } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { PlusIcon, XIcon } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
@@ -20,7 +21,7 @@ import { ComposioServerStatus, composioStoreSelectors } from '@/store/tool/slice
import { useUserStore } from '@/store/user';
import { userProfileSelectors } from '@/store/user/selectors';
-const useStyles = createStyles(({ css }) => ({
+const styles = createStaticStyles(({ css }) => ({
// Reveal the remove icon only when the row is hovered.
row: css`
&:hover .tool-auth-remove {
@@ -66,7 +67,6 @@ interface ComposioToolAuthItemProps {
const ComposioToolAuthItem = memo<ComposioToolAuthItemProps>(({ tool, onAuthComplete }) => {
const { t } = useTranslation('chat');
- const { styles, cx } = useStyles();
const [isConnecting, setIsConnecting] = useState(false);
const [isWaitingAuth, setIsWaitingAuth] = useState(false);
@@ -274,7 +274,6 @@ interface MarketToolAuthItemProps {
const MarketToolAuthItem = memo<MarketToolAuthItemProps>(({ tool }) => {
const { t } = useTranslation('chat');
- const { styles, cx } = useStyles();
const { signIn, isLoading } = useMarketAuth();
const removePlugin = useAgentStore((s) => s.removePlugin);
diff --git a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx
index d7ac0628b43..aef33eb8bab 100644
--- a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx
+++ b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx
@@ -5,7 +5,8 @@ import {
isRemoteHeterogeneousType,
} from '@lobechat/heterogeneous-agents';
import { type ChatInputActionsProps } from '@lobehub/editor/react';
-import { Alert, Button, Flexbox } from '@lobehub/ui';
+import { Alert, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo, type ReactNode, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate, useParams } from 'react-router';
@@ -163,7 +164,7 @@ const HeterogeneousChatInput = memo(() => {
title={title}
action={
<Flexbox horizontal gap={4}>
- <Button size={'small'} variant={'filled'} onClick={refresh}>
+ <Button size={'small'} type={'fill'} onClick={refresh}>
{t('platformAgent.deviceGuard.refresh')}
</Button>
<Button size={'small'} type={'primary'} onClick={goToAgentProfile}>
diff --git a/src/routes/(main)/agent/features/Conversation/MainChatInput/AgentConfigError.tsx b/src/routes/(main)/agent/features/Conversation/MainChatInput/AgentConfigError.tsx
index 9dee97e4044..54746715865 100644
--- a/src/routes/(main)/agent/features/Conversation/MainChatInput/AgentConfigError.tsx
+++ b/src/routes/(main)/agent/features/Conversation/MainChatInput/AgentConfigError.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Alert, Button } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/agent/features/Conversation/WorkingSidebar/AgentSummary.tsx b/src/routes/(main)/agent/features/Conversation/WorkingSidebar/AgentSummary.tsx
index 82fd36f6dcd..63dfa5618e0 100644
--- a/src/routes/(main)/agent/features/Conversation/WorkingSidebar/AgentSummary.tsx
+++ b/src/routes/(main)/agent/features/Conversation/WorkingSidebar/AgentSummary.tsx
@@ -1,4 +1,5 @@
-import { Avatar, Button, Flexbox } from '@lobehub/ui';
+import { Avatar, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -91,7 +92,7 @@ const AgentSummary = memo(() => {
shape={'round'}
size={'small'}
style={{ color: cssVar.colorTextTertiary, width: 'fit-content' }}
- variant={'filled'}
+ type={'fill'}
onClick={() => activeAgentId && navigate(`/agent/${activeAgentId}/profile`)}
>
{t('user.editProfile', { ns: 'discover' })}
diff --git a/src/routes/(main)/agent/features/TelemetryNotification.tsx b/src/routes/(main)/agent/features/TelemetryNotification.tsx
index 8874c3c8e99..c76d3c6ee99 100644
--- a/src/routes/(main)/agent/features/TelemetryNotification.tsx
+++ b/src/routes/(main)/agent/features/TelemetryNotification.tsx
@@ -1,7 +1,8 @@
'use client';
import { BRANDING_NAME } from '@lobechat/business-const';
-import { Avatar, Button, Flexbox, Icon } from '@lobehub/ui';
+import { Avatar, Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { LucideArrowUpRightFromSquare, TelescopeIcon } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/agent/profile/features/Header/index.test.tsx b/src/routes/(main)/agent/profile/features/Header/index.test.tsx
index bf4200fc999..ae61fb9945e 100644
--- a/src/routes/(main)/agent/profile/features/Header/index.test.tsx
+++ b/src/routes/(main)/agent/profile/features/Header/index.test.tsx
@@ -85,13 +85,11 @@ vi.mock('@lobehub/ui/base-ui', () => ({
confirmModal: vi.fn(),
}));
-interface AntdMockModule {
- App: Record<PropertyKey, unknown>;
- Modal: Record<PropertyKey, unknown>;
-}
-
vi.mock('antd', async (importOriginal) => {
- const actual = await importOriginal<AntdMockModule>();
+ const actual = (await importOriginal()) as {
+ App: Record<string, unknown>;
+ Modal: Record<string, unknown>;
+ } & Record<string, unknown>;
return {
...actual,
@@ -229,7 +227,6 @@ describe('Agent profile Header', () => {
vi.spyOn(URL, 'revokeObjectURL').mockImplementation(() => {});
mocks.agentState.isCurrentAgentHeterogeneous = false;
mocks.agentState.systemRole = 'You are helpful.';
- mocks.agentState.config.plugins = ['lobe-web-browsing'];
mocks.globalState.showAgentBuilderPanel = false;
mocks.profileState.editor = undefined;
});
@@ -268,25 +265,6 @@ describe('Agent profile Header', () => {
expect(URL.revokeObjectURL).toHaveBeenCalledWith('blob:agent-profile');
});
- it('excludes disabled entries from the exported markdown plugin list, in a mixed-shape array', async () => {
- mocks.agentState.config.plugins = [
- 'lobe-web-browsing',
- { identifier: 'lobe-image-generation', mode: 'disabled' } as any,
- ];
-
- render(<Header />);
-
- fireEvent.click(screen.getByRole('button', { name: 'pageEditor.menu.export.markdown' }));
-
- await waitFor(() => expect(URL.createObjectURL).toHaveBeenCalled());
-
- const exportedBlob = getLatestExportedBlob();
- const exportedMarkdown = await exportedBlob.text();
-
- expect(exportedMarkdown).toContain('lobe-web-browsing');
- expect(exportedMarkdown).not.toContain('lobe-image-generation');
- });
-
it('should preserve an empty prompt from the mounted editor when exporting markdown', async () => {
mocks.profileState.editor = {
getDocument: vi.fn().mockReturnValue(''),
diff --git a/src/routes/(main)/agent/profile/features/ProfileEditor/RemoteAgentConfigCard.tsx b/src/routes/(main)/agent/profile/features/ProfileEditor/RemoteAgentConfigCard.tsx
index e84c92ed6cf..2f89bd27d69 100644
--- a/src/routes/(main)/agent/profile/features/ProfileEditor/RemoteAgentConfigCard.tsx
+++ b/src/routes/(main)/agent/profile/features/ProfileEditor/RemoteAgentConfigCard.tsx
@@ -6,7 +6,13 @@ import {
} from '@lobechat/heterogeneous-agents';
import type { HeterogeneousProviderConfig } from '@lobechat/types';
import { ActionIcon, Flexbox, Icon, Text, Tooltip } from '@lobehub/ui';
-import { Button, createModal, Select, useModalContext } from '@lobehub/ui/base-ui';
+import {
+ Button as BaseButton,
+ Button,
+ createModal,
+ Select,
+ useModalContext,
+} from '@lobehub/ui/base-ui';
import { Tag } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { t as i18nT } from 'i18next';
@@ -198,17 +204,17 @@ const ChangeDeviceContent = memo<ChangeDeviceContentProps>(
)}
</Flexbox>
<Flexbox horizontal gap={8} justify={'flex-end'}>
- <Button disabled={saving} onClick={close}>
+ <BaseButton disabled={saving} onClick={close}>
{t('cancel', { ns: 'common' })}
- </Button>
- <Button
+ </BaseButton>
+ <BaseButton
disabled={!selectedDeviceId || checkingCapability || capabilityBad}
loading={saving}
type={'primary'}
onClick={handleSave}
>
{t('platformAgentConfig.changeDevice')}
- </Button>
+ </BaseButton>
</Flexbox>
</Flexbox>
);
diff --git a/src/routes/(main)/community/(detail)/agent/features/Header.tsx b/src/routes/(main)/community/(detail)/agent/features/Header.tsx
index 8a039082b8a..dc148cd4cf4 100644
--- a/src/routes/(main)/community/(detail)/agent/features/Header.tsx
+++ b/src/routes/(main)/community/(detail)/agent/features/Header.tsx
@@ -1,17 +1,8 @@
'use client';
import { MCP } from '@lobehub/icons';
-import {
- ActionIcon,
- Avatar,
- Button,
- Flexbox,
- Icon,
- Tag,
- Text,
- Tooltip,
- TooltipGroup,
-} from '@lobehub/ui';
+import { ActionIcon, Avatar, Flexbox, Icon, Tag, Text, Tooltip, TooltipGroup } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
import {
@@ -117,7 +108,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
url: '/community/agent',
})}
>
- <Button icon={cate?.icon} size={'middle'} variant={'outlined'}>
+ <Button icon={cate?.icon} size={'middle'}>
{cate?.label}
</Button>
</WorkspaceLink>
diff --git a/src/routes/(main)/community/(detail)/agent/features/Sidebar/ActionButton/AddAgent.tsx b/src/routes/(main)/community/(detail)/agent/features/Sidebar/ActionButton/AddAgent.tsx
index 00c5e6fa228..504e5056bae 100644
--- a/src/routes/(main)/community/(detail)/agent/features/Sidebar/ActionButton/AddAgent.tsx
+++ b/src/routes/(main)/community/(detail)/agent/features/Sidebar/ActionButton/AddAgent.tsx
@@ -1,8 +1,8 @@
'use client';
import { AGENT_CHAT_URL } from '@lobechat/const';
-import { Button, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles } from 'antd-style';
import { ChevronDownIcon } from 'lucide-react';
diff --git a/src/routes/(main)/community/(detail)/agent/features/StatusPage/index.tsx b/src/routes/(main)/community/(detail)/agent/features/StatusPage/index.tsx
index 3873ef08728..3333255de37 100644
--- a/src/routes/(main)/community/(detail)/agent/features/StatusPage/index.tsx
+++ b/src/routes/(main)/community/(detail)/agent/features/StatusPage/index.tsx
@@ -1,7 +1,8 @@
'use client';
import { ExclamationCircleOutlined, FolderOpenOutlined } from '@ant-design/icons';
-import { Button, FluentEmoji, Text } from '@lobehub/ui';
+import { FluentEmoji, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Result } from 'antd';
import { memo } from 'react';
import { Trans, useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/features/Block.tsx b/src/routes/(main)/community/(detail)/features/Block.tsx
index edfabdde611..d5294ba2c36 100644
--- a/src/routes/(main)/community/(detail)/features/Block.tsx
+++ b/src/routes/(main)/community/(detail)/features/Block.tsx
@@ -1,5 +1,6 @@
import { type FlexboxProps } from '@lobehub/ui';
-import { Button, Flexbox, Icon } from '@lobehub/ui';
+import { Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { ChevronRight } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/community/(detail)/features/FollowButton.tsx b/src/routes/(main)/community/(detail)/features/FollowButton.tsx
index 7b57d762ebc..5352ce18d22 100644
--- a/src/routes/(main)/community/(detail)/features/FollowButton.tsx
+++ b/src/routes/(main)/community/(detail)/features/FollowButton.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/group_agent/features/Header.tsx b/src/routes/(main)/community/(detail)/group_agent/features/Header.tsx
index 40ad52a0d65..041ee3c0809 100644
--- a/src/routes/(main)/community/(detail)/group_agent/features/Header.tsx
+++ b/src/routes/(main)/community/(detail)/group_agent/features/Header.tsx
@@ -1,16 +1,7 @@
'use client';
-import {
- ActionIcon,
- Avatar,
- Button,
- Flexbox,
- Icon,
- Tag,
- Text,
- Tooltip,
- TooltipGroup,
-} from '@lobehub/ui';
+import { ActionIcon, Avatar, Flexbox, Icon, Tag, Text, Tooltip, TooltipGroup } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
import { BookmarkCheckIcon, BookmarkIcon, DotIcon, GitBranchIcon, UsersIcon } from 'lucide-react';
@@ -107,9 +98,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile: isMobile }) => {
url: '/community/group_agent',
})}
>
- <Button size={'middle'} variant={'outlined'}>
- {category}
- </Button>
+ <Button size={'middle'}>{category}</Button>
</WorkspaceLink>
) : null;
diff --git a/src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/AddGroupAgent.tsx b/src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/AddGroupAgent.tsx
index fee75f92b13..bd4145a13d3 100644
--- a/src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/AddGroupAgent.tsx
+++ b/src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/AddGroupAgent.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles } from 'antd-style';
import { ChevronDownIcon } from 'lucide-react';
diff --git a/src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/ForkGroupAndChat.tsx b/src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/ForkGroupAndChat.tsx
index 5d9f15af228..6ef70c73f26 100644
--- a/src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/ForkGroupAndChat.tsx
+++ b/src/routes/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/ForkGroupAndChat.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox } from '@lobehub/ui';
-import { Select } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button, Select } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles } from 'antd-style';
import { customAlphabet } from 'nanoid/non-secure';
diff --git a/src/routes/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx b/src/routes/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx
index dc8b1e4f9d0..0371eea2ef6 100644
--- a/src/routes/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx
+++ b/src/routes/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx
@@ -1,7 +1,8 @@
'use client';
import { ExclamationCircleOutlined, FolderOpenOutlined } from '@ant-design/icons';
-import { Button, FluentEmoji, Text } from '@lobehub/ui';
+import { FluentEmoji, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Result } from 'antd';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/mcp/features/Sidebar/ActionButton/index.tsx b/src/routes/(main)/community/(detail)/mcp/features/Sidebar/ActionButton/index.tsx
index 9db6634c949..2ea27e97d27 100644
--- a/src/routes/(main)/community/(detail)/mcp/features/Sidebar/ActionButton/index.tsx
+++ b/src/routes/(main)/community/(detail)/mcp/features/Sidebar/ActionButton/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Icon } from '@lobehub/ui';
+import { Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { Trash2Icon } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/routes/(main)/community/(detail)/model/features/Sidebar/ActionButton/ChatWithModel.tsx b/src/routes/(main)/community/(detail)/model/features/Sidebar/ActionButton/ChatWithModel.tsx
index 06893162ff2..a420bec81ad 100644
--- a/src/routes/(main)/community/(detail)/model/features/Sidebar/ActionButton/ChatWithModel.tsx
+++ b/src/routes/(main)/community/(detail)/model/features/Sidebar/ActionButton/ChatWithModel.tsx
@@ -1,8 +1,8 @@
'use client';
import { ProviderIcon } from '@lobehub/icons';
-import { Button, DropdownMenu } from '@lobehub/ui';
-import { SplitButton } from '@lobehub/ui/base-ui';
+import { DropdownMenu } from '@lobehub/ui';
+import { Button, SplitButton } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/provider/features/Sidebar/ActionButton/ProviderConfig.tsx b/src/routes/(main)/community/(detail)/provider/features/Sidebar/ActionButton/ProviderConfig.tsx
index 0efabf15bb1..c2d6c4f7bf2 100644
--- a/src/routes/(main)/community/(detail)/provider/features/Sidebar/ActionButton/ProviderConfig.tsx
+++ b/src/routes/(main)/community/(detail)/provider/features/Sidebar/ActionButton/ProviderConfig.tsx
@@ -1,8 +1,8 @@
'use client';
import { isDesktop } from '@lobechat/const';
-import { Button, Icon } from '@lobehub/ui';
-import { SplitButton } from '@lobehub/ui/base-ui';
+import { Icon } from '@lobehub/ui';
+import { Button, SplitButton } from '@lobehub/ui/base-ui';
import { SquareArrowOutUpRight } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/skill/features/Header.tsx b/src/routes/(main)/community/(detail)/skill/features/Header.tsx
index ebcb76295ab..23a12edb175 100644
--- a/src/routes/(main)/community/(detail)/skill/features/Header.tsx
+++ b/src/routes/(main)/community/(detail)/skill/features/Header.tsx
@@ -1,7 +1,8 @@
'use client';
import { Github } from '@lobehub/icons';
-import { ActionIcon, Avatar, Button, Flexbox, Icon, stopPropagation, Text } from '@lobehub/ui';
+import { ActionIcon, Avatar, Flexbox, Icon, stopPropagation, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import {
DotIcon,
@@ -95,7 +96,7 @@ const Header = memo<{ mobile?: boolean }>(({ mobile }) => {
url: '/community/skill',
})}
>
- <Button icon={<Icon icon={cate.icon} />} size={'middle'} variant={'outlined'}>
+ <Button icon={<Icon icon={cate.icon} />} size={'middle'}>
{cate.label}
</Button>
</WorkspaceLink>
diff --git a/src/routes/(main)/community/(detail)/skill/features/Sidebar/Platform.tsx b/src/routes/(main)/community/(detail)/skill/features/Sidebar/Platform.tsx
index 34f0cfadb7c..bd1a32a57b8 100644
--- a/src/routes/(main)/community/(detail)/skill/features/Sidebar/Platform.tsx
+++ b/src/routes/(main)/community/(detail)/skill/features/Sidebar/Platform.tsx
@@ -2,18 +2,8 @@
import { AGENT_CHAT_URL, DEFAULT_INBOX_AVATAR } from '@lobechat/const';
import { Claude, Cline, Cursor, OpenAI } from '@lobehub/icons';
-import {
- Avatar,
- Block,
- Button,
- Flexbox,
- Highlighter,
- Icon,
- Markdown,
- Select,
- Text,
-} from '@lobehub/ui';
-import { Tabs } from '@lobehub/ui/base-ui';
+import { Avatar, Block, Flexbox, Highlighter, Icon, Markdown, Text } from '@lobehub/ui';
+import { Button, Select, Tabs } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { BotIcon, UserRoundIcon } from 'lucide-react';
diff --git a/src/routes/(main)/community/(detail)/user/features/Header/index.tsx b/src/routes/(main)/community/(detail)/user/features/Header/index.tsx
index 3a05d90cccf..746eb82ade5 100644
--- a/src/routes/(main)/community/(detail)/user/features/Header/index.tsx
+++ b/src/routes/(main)/community/(detail)/user/features/Header/index.tsx
@@ -1,7 +1,8 @@
'use client';
import { SiGithub, SiX } from '@icons-pack/react-simple-icons';
-import { ActionIcon, Avatar, Button, Flexbox, Tag, Text, Tooltip, TooltipGroup } from '@lobehub/ui';
+import { ActionIcon, Avatar, Flexbox, Tag, Text, Tooltip, TooltipGroup } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Globe } from 'lucide-react';
import { memo, useMemo } from 'react';
diff --git a/src/routes/(main)/community/(detail)/workspace/features/Header/index.tsx b/src/routes/(main)/community/(detail)/workspace/features/Header/index.tsx
index db0f6b9f69f..3390873346d 100644
--- a/src/routes/(main)/community/(detail)/workspace/features/Header/index.tsx
+++ b/src/routes/(main)/community/(detail)/workspace/features/Header/index.tsx
@@ -1,15 +1,7 @@
'use client';
-import {
- ActionIcon,
- Avatar,
- Button,
- Flexbox,
- Skeleton,
- Text,
- Tooltip,
- TooltipGroup,
-} from '@lobehub/ui';
+import { ActionIcon, Avatar, Flexbox, Skeleton, Text, Tooltip, TooltipGroup } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { ExternalLink, Globe, Settings } from 'lucide-react';
import { memo, useCallback, useMemo } from 'react';
diff --git a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceContent.tsx b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceContent.tsx
index dc41b7ea739..9287d4c7eae 100644
--- a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceContent.tsx
+++ b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceContent.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Center, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Center, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Building2 } from 'lucide-react';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceProfileModal/Content.tsx b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceProfileModal/Content.tsx
index 418735941ca..cb18b4fe6ea 100644
--- a/src/routes/(main)/community/(detail)/workspace/features/WorkspaceProfileModal/Content.tsx
+++ b/src/routes/(main)/community/(detail)/workspace/features/WorkspaceProfileModal/Content.tsx
@@ -2,18 +2,8 @@
import { OFFICIAL_URL } from '@lobechat/const';
import type { CollapseProps } from '@lobehub/ui';
-import {
- Button,
- Center,
- Collapse,
- Flexbox,
- Icon,
- Input,
- Text,
- TextArea,
- Tooltip,
-} from '@lobehub/ui';
-import { useModalContext } from '@lobehub/ui/base-ui';
+import { Center, Collapse, Flexbox, Icon, Input, Text, TextArea, Tooltip } from '@lobehub/ui';
+import { Button, useModalContext } from '@lobehub/ui/base-ui';
import type { UploadProps } from 'antd';
import { App, Form, Input as AntInput, Upload } from 'antd';
import { cssVar } from 'antd-style';
diff --git a/src/routes/(main)/community/(list)/(home)/features/CreatorRewardBanner.tsx b/src/routes/(main)/community/(list)/(home)/features/CreatorRewardBanner.tsx
index 2bf3fd7d05c..137d3d98c9a 100644
--- a/src/routes/(main)/community/(list)/(home)/features/CreatorRewardBanner.tsx
+++ b/src/routes/(main)/community/(list)/(home)/features/CreatorRewardBanner.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx, responsive } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -96,7 +97,11 @@ const CreatorRewardBanner = memo(() => {
{t('home.creatorReward.subtitle')}
</p>
<div style={{ marginBlockStart: 4 }}>
- <a href={'https://lobehub.com/creator?utm_source=lobehub'} rel={'noopener noreferrer'} target={'_blank'}>
+ <a
+ href={'https://lobehub.com/creator?utm_source=lobehub'}
+ rel={'noopener noreferrer'}
+ target={'_blank'}
+ >
<Button type={'primary'}>{t('home.creatorReward.action')}</Button>
</a>
</div>
diff --git a/src/routes/(main)/community/(list)/_layout/Footer.tsx b/src/routes/(main)/community/(list)/_layout/Footer.tsx
index 655dbd2f69e..4a4c40e9642 100644
--- a/src/routes/(main)/community/(list)/_layout/Footer.tsx
+++ b/src/routes/(main)/community/(list)/_layout/Footer.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Text } from '@lobehub/ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { memo, useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(list)/agent/features/MarketSourceSwitch.tsx b/src/routes/(main)/community/(list)/agent/features/MarketSourceSwitch.tsx
index 9739191760b..f7f01d17183 100644
--- a/src/routes/(main)/community/(list)/agent/features/MarketSourceSwitch.tsx
+++ b/src/routes/(main)/community/(list)/agent/features/MarketSourceSwitch.tsx
@@ -1,7 +1,8 @@
'use client';
import { type DropdownItem, type DropdownMenuCheckboxItem } from '@lobehub/ui';
-import { Button, DropdownMenu, Icon } from '@lobehub/ui';
+import { DropdownMenu, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { ChevronDown, Store } from 'lucide-react';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -46,20 +47,18 @@ const MarketSourceSwitch = memo(() => {
const menuItems = useMemo<DropdownMenuCheckboxItem[]>(
() =>
- items.map(
- (item): DropdownMenuCheckboxItem => ({
- checked: item.key === currentSource,
- closeOnClick: true,
- key: item.key,
- label: item.label,
- onCheckedChange: (checked: boolean) => {
- if (checked) {
- handleChange(item.key);
- }
- },
- type: 'checkbox',
- }),
- ),
+ items.map((item): DropdownMenuCheckboxItem => ({
+ checked: item.key === currentSource,
+ closeOnClick: true,
+ key: item.key,
+ label: item.label,
+ onCheckedChange: (checked: boolean) => {
+ if (checked) {
+ handleChange(item.key);
+ }
+ },
+ type: 'checkbox',
+ })),
[currentSource, handleChange, items],
);
diff --git a/src/routes/(main)/community/(list)/features/SortButton/index.tsx b/src/routes/(main)/community/(list)/features/SortButton/index.tsx
index 14f3cfd4da9..d5a25b2a326 100644
--- a/src/routes/(main)/community/(list)/features/SortButton/index.tsx
+++ b/src/routes/(main)/community/(list)/features/SortButton/index.tsx
@@ -1,5 +1,6 @@
import { type DropdownItem, type DropdownMenuCheckboxItem } from '@lobehub/ui';
-import { Button, DropdownMenu, Icon } from '@lobehub/ui';
+import { DropdownMenu, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { ArrowDownWideNarrow, ChevronDown } from 'lucide-react';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -184,20 +185,18 @@ const SortButton = memo(() => {
const menuItems = useMemo<DropdownMenuCheckboxItem[]>(
() =>
- items.map(
- (item): DropdownMenuCheckboxItem => ({
- checked: item.key === activeItem?.key,
- closeOnClick: true,
- key: item.key,
- label: item.label,
- onCheckedChange: (checked: boolean) => {
- if (checked) {
- handleSort(String(item.key));
- }
- },
- type: 'checkbox',
- }),
- ),
+ items.map((item): DropdownMenuCheckboxItem => ({
+ checked: item.key === activeItem?.key,
+ closeOnClick: true,
+ key: item.key,
+ label: item.label,
+ onCheckedChange: (checked: boolean) => {
+ if (checked) {
+ handleSort(String(item.key));
+ }
+ },
+ type: 'checkbox',
+ })),
[activeItem?.key, handleSort, items],
);
diff --git a/src/routes/(main)/community/components/Title.tsx b/src/routes/(main)/community/components/Title.tsx
index a07fe33c64b..d20a38ab953 100644
--- a/src/routes/(main)/community/components/Title.tsx
+++ b/src/routes/(main)/community/components/Title.tsx
@@ -1,7 +1,8 @@
'use client';
import { type FlexboxProps } from '@lobehub/ui';
-import { Button, Flexbox, Icon, Tag } from '@lobehub/ui';
+import { Flexbox, Icon, Tag } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, responsive, useResponsive } from 'antd-style';
import { ChevronRight } from 'lucide-react';
import { type ReactNode } from 'react';
diff --git a/src/routes/(main)/community/features/CreateButton/Inner.tsx b/src/routes/(main)/community/features/CreateButton/Inner.tsx
index b9597f711fc..634e82ffc8a 100644
--- a/src/routes/(main)/community/features/CreateButton/Inner.tsx
+++ b/src/routes/(main)/community/features/CreateButton/Inner.tsx
@@ -1,4 +1,5 @@
-import { Button, Icon, Tag, Typography } from '@lobehub/ui';
+import { Icon, Tag, Typography } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { GithubIcon } from '@lobehub/ui/icons';
import { Divider } from 'antd';
import { Settings, Share2 } from 'lucide-react';
diff --git a/src/routes/(main)/community/features/LikeButton.tsx b/src/routes/(main)/community/features/LikeButton.tsx
index 8df53b427ee..de251df400f 100644
--- a/src/routes/(main)/community/features/LikeButton.tsx
+++ b/src/routes/(main)/community/features/LikeButton.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Icon, Tooltip, TooltipGroup } from '@lobehub/ui';
+import { Flexbox, Icon, Tooltip, TooltipGroup } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Space } from 'antd';
import { ThumbsDownIcon, ThumbsUpIcon } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/community/features/UserAvatar/index.tsx b/src/routes/(main)/community/features/UserAvatar/index.tsx
index 25302892b08..aa59369e111 100644
--- a/src/routes/(main)/community/features/UserAvatar/index.tsx
+++ b/src/routes/(main)/community/features/UserAvatar/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Avatar, Button, Skeleton } from '@lobehub/ui';
+import { Avatar, Skeleton } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { UserCircleIcon } from 'lucide-react';
import { memo, useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/datasets/[datasetId]/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/datasets/[datasetId]/index.tsx
index 4483708b661..99226e5107e 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/datasets/[datasetId]/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/datasets/[datasetId]/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Text } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { ArrowLeft, Database, Pencil, Plus, Trash2 } from 'lucide-react';
@@ -242,12 +242,11 @@ const DatasetDetail = memo(() => {
<Button
icon={Pencil}
size="small"
- variant="outlined"
onClick={() => createDatasetEditModal({ dataset, onSuccess: handleRefresh })}
>
{t('common.edit')}
</Button>
- <Button danger icon={Trash2} size="small" variant="outlined" onClick={handleDelete}>
+ <Button danger icon={Trash2} size="small" onClick={handleDelete}>
{t('common.delete')}
</Button>
</Flexbox>
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/BenchmarkHeader/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/BenchmarkHeader/index.tsx
index 0addaf9222b..0912150fc5e 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/BenchmarkHeader/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/BenchmarkHeader/index.tsx
@@ -2,8 +2,8 @@
import type { AgentEvalRunListItem } from '@lobechat/types';
import { formatCost } from '@lobechat/utils';
-import { Button, type DropdownItem, DropdownMenu, Flexbox, Icon, Text } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { type DropdownItem, DropdownMenu, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import {
CircleDollarSign,
@@ -33,7 +33,6 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
heroBand: css`
padding: 20px;
border-radius: ${cssVar.borderRadiusLG};
-
background: ${cssVar.colorFillQuaternary};
`,
heroValue: css`
@@ -245,11 +244,11 @@ const BenchmarkHeader = memo<BenchmarkHeaderProps>(
</Flexbox>
<Flexbox horizontal gap={8}>
- <Button icon={Edit} size="small" variant="outlined" onClick={handleEdit}>
+ <Button icon={Edit} size="small" onClick={handleEdit}>
{t('common.edit')}
</Button>
<DropdownMenu items={menuItems} placement="bottomRight">
- <Button icon={EllipsisVertical} size="small" variant="outlined" />
+ <Button icon={EllipsisVertical} size="small" />
</DropdownMenu>
</Flexbox>
</Flexbox>
@@ -374,9 +373,7 @@ const BenchmarkHeader = memo<BenchmarkHeaderProps>(
<div className={styles.statIcon} style={{ background: cssVar.colorPrimaryBg }}>
<Layers size={16} style={{ color: cssVar.colorPrimary }} />
</div>
- <span className={styles.statLabel}>
- {t('benchmark.detail.stats.dataScale')}
- </span>
+ <span className={styles.statLabel}>{t('benchmark.detail.stats.dataScale')}</span>
{totalCases === 0 && (
<span
style={{
@@ -431,9 +428,7 @@ const BenchmarkHeader = memo<BenchmarkHeaderProps>(
<div className={styles.statIcon} style={{ background: cssVar.colorInfoBg }}>
<Clock size={16} style={{ color: cssVar.colorInfo }} />
</div>
- <span className={styles.statLabel}>
- {t('benchmark.detail.stats.avgDuration')}
- </span>
+ <span className={styles.statLabel}>{t('benchmark.detail.stats.avgDuration')}</span>
</Flexbox>
{avgDuration == null ? (
@@ -464,7 +459,9 @@ const BenchmarkHeader = memo<BenchmarkHeaderProps>(
</span>
</Flexbox>
{p99Duration != null && (
- <span style={{ color: cssVar.colorTextQuaternary, fontSize: cssVar.fontSizeSM }}>
+ <span
+ style={{ color: cssVar.colorTextQuaternary, fontSize: cssVar.fontSizeSM }}
+ >
P99: {formatDuration(p99Duration)}
</span>
)}
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/DatasetCard.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/DatasetCard.tsx
index 2ed16b14108..594cb52f4b1 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/DatasetCard.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/DatasetCard.tsx
@@ -1,5 +1,5 @@
-import { ActionIcon, Button, DropdownMenu, Flexbox, Tag } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { ActionIcon, DropdownMenu, Flexbox, Tag } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { App, Card } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { ArrowRight, ChevronRight, Database, Ellipsis, Pencil, Play, Trash2 } from 'lucide-react';
@@ -24,8 +24,8 @@ const styles = createStaticStyles(({ css }) => ({
// test-case count — given mono weight so it reads as a result at a glance.
caseCount: css`
display: flex;
- flex-shrink: 0;
flex-direction: column;
+ flex-shrink: 0;
gap: 2px;
align-items: flex-end;
@@ -49,9 +49,7 @@ const styles = createStaticStyles(({ css }) => ({
`,
chevron: css`
flex-shrink: 0;
-
color: ${cssVar.colorTextTertiary};
-
transition: transform 0.15s ease;
@media (prefers-reduced-motion: reduce) {
@@ -290,7 +288,7 @@ const DatasetCard = memo<DatasetCardProps>(
className={styles.footerLink}
to={`/eval/bench/${benchmarkId}/datasets/${dataset.id}`}
>
- <Button icon={ArrowRight} iconPosition="end" size="small" variant="text">
+ <Button icon={ArrowRight} iconPosition="end" size="small" type="text">
{t('dataset.detail.viewDetail')}
</Button>
</WorkspaceLink>
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/EmptyState.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/EmptyState.tsx
index 4f2b43a4127..5205e912e11 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/EmptyState.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/EmptyState.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Card } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { Database, Plus } from 'lucide-react';
@@ -49,7 +50,13 @@ const EmptyState = memo<EmptyStateProps>(({ onAddDataset }) => {
{t('dataset.empty.description')}
</Text>
</Flexbox>
- <Button icon={Plus} size="small" style={{ marginTop: 16 }} type="primary" onClick={onAddDataset}>
+ <Button
+ icon={Plus}
+ size="small"
+ style={{ marginTop: 16 }}
+ type="primary"
+ onClick={onAddDataset}
+ >
{t('dataset.actions.addDataset')}
</Button>
</Card>
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseEmptyState.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseEmptyState.tsx
index b190826a846..c3d8944d0b2 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseEmptyState.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseEmptyState.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Text } from '@lobehub/ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { Database, FileUp, Plus } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx
index 8737d25f496..3dcecfc2d17 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx
@@ -1,4 +1,5 @@
-import { ActionIcon, Button, DropdownMenu, Flexbox, Input, Text } from '@lobehub/ui';
+import { ActionIcon, DropdownMenu, Flexbox, Input, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Pagination, Table } from 'antd';
import { type ColumnsType } from 'antd/es/table';
import { createStaticStyles, cssVar } from 'antd-style';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/index.tsx
index 593e5e58cc5..2b2502abd71 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Text } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { App, Card, Skeleton } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { Plus } from 'lucide-react';
@@ -223,6 +223,7 @@ const DatasetsTab = memo<DatasetsTabProps>(
total={isExpanded ? total : 0}
onDeleteCase={handleDeleteCase}
onDiffFilterChange={handleDiffFilterChange}
+ onEdit={(dataset) => createDatasetEditModal({ dataset, onSuccess: onRefresh })}
onExpand={() => handleExpand(ds.id)}
onImport={() => handleImportDataset(ds)}
onPageChange={(page, pageSize) => setPagination({ current: page, pageSize })}
@@ -235,7 +236,6 @@ const DatasetsTab = memo<DatasetsTabProps>(
onSuccess: handleRefreshTestCases,
})
}
- onEdit={(dataset) => createDatasetEditModal({ dataset, onSuccess: onRefresh })}
/>
);
})}
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunCreateModal/Content.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunCreateModal/Content.tsx
index cb56f3dd5f2..a056a3b6a30 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunCreateModal/Content.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunCreateModal/Content.tsx
@@ -113,37 +113,26 @@ const RunCreateContent: FC<RunCreateContentProps> = ({
const allAgents = useMemo(() => [inboxAgent, ...agents], [inboxAgent, agents]);
- const agentMap = useMemo(() => new Map(allAgents.map((agent) => [agent.id, agent])), [allAgents]);
-
const agentOptions = useMemo(
() =>
allAgents.map((agent) => ({
- label: agent.title || agent.id,
+ label: (
+ <span style={{ alignItems: 'center', display: 'inline-flex', gap: 8 }}>
+ <Avatar
+ avatar={agent.avatar || undefined}
+ background={agent.backgroundColor || undefined}
+ size={20}
+ title={agent.title || ''}
+ />
+ <span>{agent.title}</span>
+ </span>
+ ),
title: agent.title || '',
value: agent.id,
})),
[allAgents],
);
- const renderAgentLabel = useCallback(
- (agentId: string, fallback: React.ReactNode) => {
- const agent = agentMap.get(agentId);
-
- return (
- <span style={{ alignItems: 'center', display: 'inline-flex', gap: 8 }}>
- <Avatar
- avatar={agent?.avatar || undefined}
- background={agent?.backgroundColor || undefined}
- size={20}
- title={agent?.title || String(fallback)}
- />
- <span>{agent?.title || fallback}</span>
- </span>
- );
- },
- [agentMap],
- );
-
const handleOpenAgent = useCallback((agentId: string, e: React.MouseEvent) => {
e.stopPropagation();
e.preventDefault();
@@ -233,7 +222,6 @@ const RunCreateContent: FC<RunCreateContentProps> = ({
allowClear
showSearch
className={styles.agentSelect}
- labelRender={(option) => renderAgentLabel(String(option.value), option.label)}
loading={loadingAgents}
options={agentOptions}
placeholder={t('run.create.agent.placeholder')}
@@ -247,7 +235,7 @@ const RunCreateContent: FC<RunCreateContentProps> = ({
justifyContent: 'space-between',
}}
>
- {renderAgentLabel(String(option.value), option.label)}
+ {option.label}
<ActionIcon
icon={SquareArrowOutUpRight}
size="small"
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunEditModal/Content.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunEditModal/Content.tsx
index 544f01f80d3..aac49bae407 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunEditModal/Content.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunEditModal/Content.tsx
@@ -107,37 +107,26 @@ const RunEditContent: FC<RunEditContentProps> = ({ formId, onLoadingChange, run
const allAgents = useMemo(() => [inboxAgent, ...agents], [inboxAgent, agents]);
- const agentMap = useMemo(() => new Map(allAgents.map((agent) => [agent.id, agent])), [allAgents]);
-
const agentOptions = useMemo(
() =>
allAgents.map((agent) => ({
- label: agent.title || agent.id,
+ label: (
+ <span style={{ alignItems: 'center', display: 'inline-flex', gap: 8 }}>
+ <Avatar
+ avatar={agent.avatar || undefined}
+ background={agent.backgroundColor || undefined}
+ size={20}
+ title={agent.title || ''}
+ />
+ <span>{agent.title}</span>
+ </span>
+ ),
title: agent.title || '',
value: agent.id,
})),
[allAgents],
);
- const renderAgentLabel = useCallback(
- (agentId: string, fallback: React.ReactNode) => {
- const agent = agentMap.get(agentId);
-
- return (
- <span style={{ alignItems: 'center', display: 'inline-flex', gap: 8 }}>
- <Avatar
- avatar={agent?.avatar || undefined}
- background={agent?.backgroundColor || undefined}
- size={20}
- title={agent?.title || String(fallback)}
- />
- <span>{agent?.title || fallback}</span>
- </span>
- );
- },
- [agentMap],
- );
-
const handleOpenAgent = useCallback((agentId: string, e: React.MouseEvent) => {
e.stopPropagation();
e.preventDefault();
@@ -204,7 +193,6 @@ const RunEditContent: FC<RunEditContentProps> = ({ formId, onLoadingChange, run
allowClear
showSearch
className={styles.agentSelect}
- labelRender={(option) => renderAgentLabel(String(option.value), option.label)}
loading={loadingAgents}
options={agentOptions}
placeholder={t('run.create.agent.placeholder')}
@@ -218,7 +206,7 @@ const RunEditContent: FC<RunEditContentProps> = ({ formId, onLoadingChange, run
justifyContent: 'space-between',
}}
>
- {renderAgentLabel(String(option.value), option.label)}
+ {option.label}
<ActionIcon
icon={SquareArrowOutUpRight}
size="small"
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunEditModal/Footer.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunEditModal/Footer.tsx
index ac21d0efccc..9e7e57447b3 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunEditModal/Footer.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunEditModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/EmptyState.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/EmptyState.tsx
index d979c5ca233..abc7f7c08cb 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/EmptyState.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/EmptyState.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { Activity, Plus } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/index.tsx
index e7e61bceb98..58b03865797 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Text } from '@lobehub/ui';
-import { Select } from '@lobehub/ui/base-ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button, Select } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { Plus } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
@@ -19,10 +19,10 @@ const styles = createStaticStyles(({ css }) => ({
// column on narrow viewports.
grid: css`
display: grid;
- gap: 12px;
grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
+ gap: 12px;
- @media (max-width: 640px) {
+ @media (width <= 640px) {
grid-template-columns: 1fr;
}
`,
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Footer.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Footer.tsx
index a23ba5a9992..7a1d3b4fde5 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Footer.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/IdleState/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/IdleState/index.tsx
index 590fa09c140..fa438984a98 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/IdleState/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/IdleState/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Icon } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { Icon } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Brain, ChartBar, MessageSquare, Play } from 'lucide-react';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/RunInfo/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/RunInfo/index.tsx
index 8f18d290a95..2f9127b193a 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/RunInfo/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/RunInfo/index.tsx
@@ -1,7 +1,8 @@
'use client';
import { AGENT_PROFILE_URL } from '@lobechat/const';
-import { Avatar, Button, Flexbox } from '@lobehub/ui';
+import { Avatar, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Descriptions, Tag, Typography } from 'antd';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -78,7 +79,7 @@ const RunInfo = memo<RunInfoProps>(({ benchmarkId, run }) => {
<Button
size="small"
style={{ height: 'auto', padding: 0 }}
- variant="text"
+ type="text"
onClick={handleOpenAgent}
>
{agentTitle}
diff --git a/src/routes/(main)/eval/features/BenchmarkCard/index.tsx b/src/routes/(main)/eval/features/BenchmarkCard/index.tsx
index 2e5c40e54de..40dc85a9082 100644
--- a/src/routes/(main)/eval/features/BenchmarkCard/index.tsx
+++ b/src/routes/(main)/eval/features/BenchmarkCard/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Icon, Tag, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Tag, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import {
Activity,
@@ -71,7 +72,6 @@ const styles = createStaticStyles(({ css }) => ({
metricBand: css`
padding: 16px;
border-radius: ${cssVar.borderRadius};
-
background: ${cssVar.colorFillQuaternary};
`,
metricValue: css`
@@ -258,7 +258,7 @@ const BenchmarkCard = memo<BenchmarkCardProps>(
</Text>
</Flexbox>
<WorkspaceLink style={{ textDecoration: 'none' }} to={`/eval/bench/${id}`}>
- <Button icon={Upload} size={'small'} variant={'filled'}>
+ <Button icon={Upload} size={'small'} type={'fill'}>
{t('benchmark.card.importDataset')}
</Button>
</WorkspaceLink>
@@ -291,7 +291,7 @@ const BenchmarkCard = memo<BenchmarkCardProps>(
</Text>
</Flexbox>
<WorkspaceLink style={{ textDecoration: 'none' }} to={`/eval/bench/${id}?tab=runs`}>
- <Button icon={Play} size={'small'} variant={'filled'}>
+ <Button icon={Play} size={'small'} type={'fill'}>
{t('benchmark.card.startFirst')}
</Button>
</WorkspaceLink>
diff --git a/src/routes/(main)/eval/features/BenchmarkEditModal/Content.tsx b/src/routes/(main)/eval/features/BenchmarkEditModal/Content.tsx
index cc70ce6ad89..efd42bab8a6 100644
--- a/src/routes/(main)/eval/features/BenchmarkEditModal/Content.tsx
+++ b/src/routes/(main)/eval/features/BenchmarkEditModal/Content.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Input, Select, TextArea } from '@lobehub/ui';
-import { useModalContext } from '@lobehub/ui/base-ui';
+import { Input, TextArea } from '@lobehub/ui';
+import { Select, useModalContext } from '@lobehub/ui/base-ui';
import { App, Form } from 'antd';
import { cssVar } from 'antd-style';
import { type FC, useEffect, useState } from 'react';
diff --git a/src/routes/(main)/eval/features/BenchmarkEditModal/Footer.tsx b/src/routes/(main)/eval/features/BenchmarkEditModal/Footer.tsx
index 9a3ba41bfb6..2c36ceafd17 100644
--- a/src/routes/(main)/eval/features/BenchmarkEditModal/Footer.tsx
+++ b/src/routes/(main)/eval/features/BenchmarkEditModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/features/CreateBenchmarkModal/Content.tsx b/src/routes/(main)/eval/features/CreateBenchmarkModal/Content.tsx
index 4a8ba5c4ada..2e73a5a9728 100644
--- a/src/routes/(main)/eval/features/CreateBenchmarkModal/Content.tsx
+++ b/src/routes/(main)/eval/features/CreateBenchmarkModal/Content.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Input, Select, TextArea } from '@lobehub/ui';
-import { useModalContext } from '@lobehub/ui/base-ui';
+import { Input, TextArea } from '@lobehub/ui';
+import { Select, useModalContext } from '@lobehub/ui/base-ui';
import { App, Form } from 'antd';
import { cssVar } from 'antd-style';
import { type FC, useEffect, useState } from 'react';
diff --git a/src/routes/(main)/eval/features/CreateBenchmarkModal/Footer.tsx b/src/routes/(main)/eval/features/CreateBenchmarkModal/Footer.tsx
index f7c8d583550..d39211447c4 100644
--- a/src/routes/(main)/eval/features/CreateBenchmarkModal/Footer.tsx
+++ b/src/routes/(main)/eval/features/CreateBenchmarkModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/features/DatasetCreateModal/Footer.tsx b/src/routes/(main)/eval/features/DatasetCreateModal/Footer.tsx
index 03f6f686b2d..f415364586c 100644
--- a/src/routes/(main)/eval/features/DatasetCreateModal/Footer.tsx
+++ b/src/routes/(main)/eval/features/DatasetCreateModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/features/DatasetEditModal/Footer.tsx b/src/routes/(main)/eval/features/DatasetEditModal/Footer.tsx
index 2b1c129f842..d2dffbf88b4 100644
--- a/src/routes/(main)/eval/features/DatasetEditModal/Footer.tsx
+++ b/src/routes/(main)/eval/features/DatasetEditModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/features/DatasetImportModal/Footer.tsx b/src/routes/(main)/eval/features/DatasetImportModal/Footer.tsx
index 41837683f40..b6bb7691854 100644
--- a/src/routes/(main)/eval/features/DatasetImportModal/Footer.tsx
+++ b/src/routes/(main)/eval/features/DatasetImportModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/features/TestCaseCreateModal/Footer.tsx b/src/routes/(main)/eval/features/TestCaseCreateModal/Footer.tsx
index fde3140d621..f3d16eb6d97 100644
--- a/src/routes/(main)/eval/features/TestCaseCreateModal/Footer.tsx
+++ b/src/routes/(main)/eval/features/TestCaseCreateModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/features/TestCaseEditModal/Footer.tsx b/src/routes/(main)/eval/features/TestCaseEditModal/Footer.tsx
index e6ad83e82b8..94e5e1596e3 100644
--- a/src/routes/(main)/eval/features/TestCaseEditModal/Footer.tsx
+++ b/src/routes/(main)/eval/features/TestCaseEditModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/index.tsx b/src/routes/(main)/eval/index.tsx
index 6300b54956d..97df1e6f10d 100644
--- a/src/routes/(main)/eval/index.tsx
+++ b/src/routes/(main)/eval/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Empty, Flexbox, Skeleton, Text } from '@lobehub/ui';
+import { Empty, Flexbox, Skeleton, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { FlaskConical, Plus } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/group/features/TelemetryNotification.tsx b/src/routes/(main)/group/features/TelemetryNotification.tsx
index 8874c3c8e99..c76d3c6ee99 100644
--- a/src/routes/(main)/group/features/TelemetryNotification.tsx
+++ b/src/routes/(main)/group/features/TelemetryNotification.tsx
@@ -1,7 +1,8 @@
'use client';
import { BRANDING_NAME } from '@lobechat/business-const';
-import { Avatar, Button, Flexbox, Icon } from '@lobehub/ui';
+import { Avatar, Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { LucideArrowUpRightFromSquare, TelescopeIcon } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/group/profile/features/GroupProfile/index.tsx b/src/routes/(main)/group/profile/features/GroupProfile/index.tsx
index 27c1b9e37e5..a1f6c7b9281 100644
--- a/src/routes/(main)/group/profile/features/GroupProfile/index.tsx
+++ b/src/routes/(main)/group/profile/features/GroupProfile/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import { ActionIcon, Button, DropdownMenu, Flexbox } from '@lobehub/ui';
-import { type ModalInstance } from '@lobehub/ui/base-ui';
+import { ActionIcon, DropdownMenu, Flexbox } from '@lobehub/ui';
+import { Button, type ModalInstance } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { useTheme } from 'antd-style';
import { MoreHorizontalIcon, PlayIcon, Settings2Icon } from 'lucide-react';
diff --git a/src/routes/(main)/group/profile/features/MemberProfile/index.tsx b/src/routes/(main)/group/profile/features/MemberProfile/index.tsx
index 836c2ee9551..002774da7e6 100644
--- a/src/routes/(main)/group/profile/features/MemberProfile/index.tsx
+++ b/src/routes/(main)/group/profile/features/MemberProfile/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Alert, Button, Flexbox, Icon } from '@lobehub/ui';
+import { Alert, Flexbox, Icon } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import isEqual from 'fast-deep-equal';
import { InfoIcon, PlayIcon } from 'lucide-react';
diff --git a/src/routes/(main)/home/features/InputArea/StarterList.tsx b/src/routes/(main)/home/features/InputArea/StarterList.tsx
index ad2177a324b..bd6bb4ed5f6 100644
--- a/src/routes/(main)/home/features/InputArea/StarterList.tsx
+++ b/src/routes/(main)/home/features/InputArea/StarterList.tsx
@@ -1,5 +1,6 @@
import { ModelIcon } from '@lobehub/icons';
-import { Button, Center, Skeleton, Tag, Tooltip } from '@lobehub/ui';
+import { Center, Skeleton, Tag, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { memo, useCallback, useState } from 'react';
@@ -157,7 +158,6 @@ const StarterList = memo(() => {
key={key}
loading={isSwitching}
shape={'round'}
- variant={'outlined'}
onClick={() => handleClick(item)}
>
{item.title}
diff --git a/src/routes/(main)/home/features/components/ScrollShadowWithButton/index.tsx b/src/routes/(main)/home/features/components/ScrollShadowWithButton/index.tsx
index cc7c1f55a40..ac78242b056 100644
--- a/src/routes/(main)/home/features/components/ScrollShadowWithButton/index.tsx
+++ b/src/routes/(main)/home/features/components/ScrollShadowWithButton/index.tsx
@@ -1,5 +1,6 @@
import { type FlexboxProps } from '@lobehub/ui';
-import { Button, Flexbox, ScrollShadow } from '@lobehub/ui';
+import { Flexbox, ScrollShadow } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { ChevronLeft, ChevronRight } from 'lucide-react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
diff --git a/src/routes/(main)/memory/features/ActionBar/PurgeButton.tsx b/src/routes/(main)/memory/features/ActionBar/PurgeButton.tsx
index 5072a01a009..c2c13096b86 100644
--- a/src/routes/(main)/memory/features/ActionBar/PurgeButton.tsx
+++ b/src/routes/(main)/memory/features/ActionBar/PurgeButton.tsx
@@ -1,7 +1,7 @@
'use client';
-import { ActionIcon, Button, Icon, Tooltip } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { ActionIcon, Icon, Tooltip } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { Trash2Icon } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/routes/(main)/memory/features/FilterBar.tsx b/src/routes/(main)/memory/features/FilterBar.tsx
index fc4f833bac6..726aaba0041 100644
--- a/src/routes/(main)/memory/features/FilterBar.tsx
+++ b/src/routes/(main)/memory/features/FilterBar.tsx
@@ -1,4 +1,5 @@
-import { Flexbox, Icon, SearchBar, Select } from '@lobehub/ui';
+import { Flexbox, Icon, SearchBar } from '@lobehub/ui';
+import { Select } from '@lobehub/ui/base-ui';
import { ArrowDownNarrowWide, Search } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/memory/features/MemoryAnalysis/AnalysisTrigger.tsx b/src/routes/(main)/memory/features/MemoryAnalysis/AnalysisTrigger.tsx
index c4019e75f64..da1f4ddf1d9 100644
--- a/src/routes/(main)/memory/features/MemoryAnalysis/AnalysisTrigger.tsx
+++ b/src/routes/(main)/memory/features/MemoryAnalysis/AnalysisTrigger.tsx
@@ -1,6 +1,7 @@
'use client';
-import { ActionIcon, Button, Tooltip } from '@lobehub/ui';
+import { ActionIcon, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { CalendarClockIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/memory/features/SourceLink.tsx b/src/routes/(main)/memory/features/SourceLink.tsx
index 054c7300cbf..72b6d06e329 100644
--- a/src/routes/(main)/memory/features/SourceLink.tsx
+++ b/src/routes/(main)/memory/features/SourceLink.tsx
@@ -1,5 +1,6 @@
import { AGENT_CHAT_TOPIC_URL } from '@lobechat/const';
-import { Button, Icon, Text } from '@lobehub/ui';
+import { Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Link2 } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/settings/about/features/Version.tsx b/src/routes/(main)/settings/about/features/Version.tsx
index 3cd229f7a4c..d357ece6aeb 100644
--- a/src/routes/(main)/settings/about/features/Version.tsx
+++ b/src/routes/(main)/settings/about/features/Version.tsx
@@ -4,7 +4,8 @@ import {
type UpdaterState,
useWatchBroadcast,
} from '@lobechat/electron-client-ipc';
-import { Block, Button, Flexbox, Tag } from '@lobehub/ui';
+import { Block, Flexbox, Tag } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/agent/features/SystemAgentForm.tsx b/src/routes/(main)/settings/agent/features/SystemAgentForm.tsx
index 4f6a4c6dc03..30eb3b71cd6 100644
--- a/src/routes/(main)/settings/agent/features/SystemAgentForm.tsx
+++ b/src/routes/(main)/settings/agent/features/SystemAgentForm.tsx
@@ -1,8 +1,9 @@
'use client';
import { type FormGroupItemType, type FormItemProps } from '@lobehub/ui';
-import { Button, Flexbox, Form, Icon, Skeleton } from '@lobehub/ui';
-import { Form as AntForm, Switch } from 'antd';
+import { Flexbox, Form, Icon, Skeleton } from '@lobehub/ui';
+import { Button, Switch } from '@lobehub/ui/base-ui';
+import { Form as AntForm } from 'antd';
import isEqual from 'fast-deep-equal';
import { Loader2Icon, PencilIcon } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/routes/(main)/settings/apikey/features/ApiKey.tsx b/src/routes/(main)/settings/apikey/features/ApiKey.tsx
index ae63cac4824..fb91548c825 100644
--- a/src/routes/(main)/settings/apikey/features/ApiKey.tsx
+++ b/src/routes/(main)/settings/apikey/features/ApiKey.tsx
@@ -2,9 +2,9 @@
import { type ActionType, type ProColumns } from '@ant-design/pro-components';
import { ProTable } from '@ant-design/pro-components';
-import { Button } from '@lobehub/ui';
+import { Button, Switch } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
-import { Popconfirm, Switch } from 'antd';
+import { Popconfirm } from 'antd';
import { createStaticStyles } from 'antd-style';
import { Trash } from 'lucide-react';
import { type FC } from 'react';
diff --git a/src/routes/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx b/src/routes/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx
index 9ed677f0a2c..48ddb346d1b 100644
--- a/src/routes/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx
+++ b/src/routes/(main)/settings/apikey/features/ApiKeyDisplay/index.tsx
@@ -1,5 +1,5 @@
import { CopyOutlined, EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App, Flex } from 'antd';
import { type FC } from 'react';
import { useState } from 'react';
diff --git a/src/routes/(main)/settings/apikey/features/ApiKeyModal/Content.tsx b/src/routes/(main)/settings/apikey/features/ApiKeyModal/Content.tsx
index df302b1ec4c..e2d18239e58 100644
--- a/src/routes/(main)/settings/apikey/features/ApiKeyModal/Content.tsx
+++ b/src/routes/(main)/settings/apikey/features/ApiKeyModal/Content.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Button, Flexbox, Input } from '@lobehub/ui';
-import { useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Input } from '@lobehub/ui';
+import { Button, useModalContext } from '@lobehub/ui/base-ui';
import { Form } from 'antd';
import { type Dayjs } from 'dayjs';
import { type FC, useState } from 'react';
diff --git a/src/routes/(main)/settings/creds/features/CreateCredModal/FileCredForm.tsx b/src/routes/(main)/settings/creds/features/CreateCredModal/FileCredForm.tsx
index 1fa6b4b2e9c..ddc058192b8 100644
--- a/src/routes/(main)/settings/creds/features/CreateCredModal/FileCredForm.tsx
+++ b/src/routes/(main)/settings/creds/features/CreateCredModal/FileCredForm.tsx
@@ -1,7 +1,7 @@
'use client';
import { InboxOutlined } from '@ant-design/icons';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
import { Form, Input, message, Upload } from 'antd';
import { createStaticStyles } from 'antd-style';
diff --git a/src/routes/(main)/settings/creds/features/CreateCredModal/KVCredForm.tsx b/src/routes/(main)/settings/creds/features/CreateCredModal/KVCredForm.tsx
index 1c417f62cca..601d962fa0f 100644
--- a/src/routes/(main)/settings/creds/features/CreateCredModal/KVCredForm.tsx
+++ b/src/routes/(main)/settings/creds/features/CreateCredModal/KVCredForm.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
import { Form, Input } from 'antd';
import { createStaticStyles } from 'antd-style';
diff --git a/src/routes/(main)/settings/creds/features/CredItem.tsx b/src/routes/(main)/settings/creds/features/CredItem.tsx
index 203920891d3..20aa81f7b8b 100644
--- a/src/routes/(main)/settings/creds/features/CredItem.tsx
+++ b/src/routes/(main)/settings/creds/features/CredItem.tsx
@@ -1,8 +1,8 @@
'use client';
import { type UserCredSummary } from '@lobechat/types';
-import { Avatar, Button, DropdownMenu, Flexbox, Icon, stopPropagation } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { Avatar, DropdownMenu, Flexbox, Icon, stopPropagation } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { Tag } from 'antd';
import {
Eye,
diff --git a/src/routes/(main)/settings/creds/features/CredsList.tsx b/src/routes/(main)/settings/creds/features/CredsList.tsx
index 06a836add00..a6897ad7ed2 100644
--- a/src/routes/(main)/settings/creds/features/CredsList.tsx
+++ b/src/routes/(main)/settings/creds/features/CredsList.tsx
@@ -1,7 +1,8 @@
'use client';
import { type UserCredSummary } from '@lobechat/types';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
import { TRPCClientError } from '@trpc/client';
import { Empty, Spin } from 'antd';
diff --git a/src/routes/(main)/settings/creds/features/EditCredModal/EditKVForm.tsx b/src/routes/(main)/settings/creds/features/EditCredModal/EditKVForm.tsx
index 98e8767fa08..9c5f4e6ae4a 100644
--- a/src/routes/(main)/settings/creds/features/EditCredModal/EditKVForm.tsx
+++ b/src/routes/(main)/settings/creds/features/EditCredModal/EditKVForm.tsx
@@ -1,7 +1,8 @@
'use client';
import { type UserCredSummary } from '@lobechat/types';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
import { Form, Input, Spin } from 'antd';
import { createStaticStyles } from 'antd-style';
diff --git a/src/routes/(main)/settings/creds/features/EditCredModal/EditMetaForm.tsx b/src/routes/(main)/settings/creds/features/EditCredModal/EditMetaForm.tsx
index b3505573865..885842143a6 100644
--- a/src/routes/(main)/settings/creds/features/EditCredModal/EditMetaForm.tsx
+++ b/src/routes/(main)/settings/creds/features/EditCredModal/EditMetaForm.tsx
@@ -1,7 +1,7 @@
'use client';
import { type UserCredSummary } from '@lobechat/types';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useMutation } from '@tanstack/react-query';
import { Form, Input } from 'antd';
import { createStaticStyles } from 'antd-style';
diff --git a/src/routes/(main)/settings/creds/index.tsx b/src/routes/(main)/settings/creds/index.tsx
index 0b41628cf51..c8677dd869b 100644
--- a/src/routes/(main)/settings/creds/index.tsx
+++ b/src/routes/(main)/settings/creds/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Icon, Tooltip } from '@lobehub/ui';
+import { Icon, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Plus } from 'lucide-react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/features/UpgradeAlert.tsx b/src/routes/(main)/settings/features/UpgradeAlert.tsx
index 0f37236c77f..91a2a8eaa83 100644
--- a/src/routes/(main)/settings/features/UpgradeAlert.tsx
+++ b/src/routes/(main)/settings/features/UpgradeAlert.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Alert, Button, Flexbox } from '@lobehub/ui';
+import { Alert, Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/memory/features/Memory.tsx b/src/routes/(main)/settings/memory/features/Memory.tsx
index 27e6f52a396..d6857b3e993 100644
--- a/src/routes/(main)/settings/memory/features/Memory.tsx
+++ b/src/routes/(main)/settings/memory/features/Memory.tsx
@@ -3,7 +3,7 @@
import { type UserMemoryEffort } from '@lobechat/types';
import { type FormGroupItemType } from '@lobehub/ui';
import { Form, Skeleton, Tooltip } from '@lobehub/ui';
-import { Switch } from 'antd';
+import { Switch } from '@lobehub/ui/base-ui';
import isEqual from 'fast-deep-equal';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/profile/features/EmailRow.tsx b/src/routes/(main)/settings/profile/features/EmailRow.tsx
index 96e35b307b0..db20730af6a 100644
--- a/src/routes/(main)/settings/profile/features/EmailRow.tsx
+++ b/src/routes/(main)/settings/profile/features/EmailRow.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Input, Text } from '@lobehub/ui';
+import { Flexbox, Input, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { AnimatePresence, m } from 'motion/react';
import { useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/profile/features/PasswordRow.tsx b/src/routes/(main)/settings/profile/features/PasswordRow.tsx
index f518bc89e76..a5f35e2e452 100644
--- a/src/routes/(main)/settings/profile/features/PasswordRow.tsx
+++ b/src/routes/(main)/settings/profile/features/PasswordRow.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/profile/features/UsernameRow.tsx b/src/routes/(main)/settings/profile/features/UsernameRow.tsx
index 8f7d9fa5a90..7c414937e1c 100644
--- a/src/routes/(main)/settings/profile/features/UsernameRow.tsx
+++ b/src/routes/(main)/settings/profile/features/UsernameRow.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { type InputRef } from 'antd';
import { Loader2Icon } from 'lucide-react';
import { type ChangeEvent } from 'react';
@@ -101,7 +102,6 @@ const UsernameRow = () => {
{dirty && !saving && (
<Button
size="small"
- variant="outlined"
onMouseDown={(e) => {
e.preventDefault();
handleCancel();
diff --git a/src/routes/(main)/settings/provider/detail/bedrock/index.tsx b/src/routes/(main)/settings/provider/detail/bedrock/index.tsx
index ba64fcd2a1d..0a801e06b8e 100644
--- a/src/routes/(main)/settings/provider/detail/bedrock/index.tsx
+++ b/src/routes/(main)/settings/provider/detail/bedrock/index.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Select } from '@lobehub/ui';
-import { Tabs, type TabsItem } from '@lobehub/ui/base-ui';
+import { Select, Tabs, type TabsItem } from '@lobehub/ui/base-ui';
import { BedrockProviderCard } from 'model-bank/modelProviders';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/provider/detail/comfyui/index.tsx b/src/routes/(main)/settings/provider/detail/comfyui/index.tsx
index 2f9666a2634..b630970bfed 100644
--- a/src/routes/(main)/settings/provider/detail/comfyui/index.tsx
+++ b/src/routes/(main)/settings/provider/detail/comfyui/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Select } from '@lobehub/ui';
+import { Select } from '@lobehub/ui/base-ui';
import { ComfyUIProviderCard } from 'model-bank/modelProviders';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/provider/detail/vertexai/index.tsx b/src/routes/(main)/settings/provider/detail/vertexai/index.tsx
index 5bfc5d69664..8d5660dae39 100644
--- a/src/routes/(main)/settings/provider/detail/vertexai/index.tsx
+++ b/src/routes/(main)/settings/provider/detail/vertexai/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Markdown, Select } from '@lobehub/ui';
+import { Markdown } from '@lobehub/ui';
+import { Select } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { VertexAIProviderCard } from 'model-bank/modelProviders';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/provider/features/CreateNewProvider/Content.tsx b/src/routes/(main)/settings/provider/features/CreateNewProvider/Content.tsx
index 33ddefbe1b9..2f6de9106c1 100644
--- a/src/routes/(main)/settings/provider/features/CreateNewProvider/Content.tsx
+++ b/src/routes/(main)/settings/provider/features/CreateNewProvider/Content.tsx
@@ -1,8 +1,8 @@
'use client';
import { ProviderIcon } from '@lobehub/icons';
-import { Button, Flexbox, Input, InputPassword, Text, TextArea } from '@lobehub/ui';
-import { Select, useModalContext } from '@lobehub/ui/base-ui';
+import { Flexbox, Input, InputPassword, Text, TextArea } from '@lobehub/ui';
+import { Button, Select, useModalContext } from '@lobehub/ui/base-ui';
import { App, Form } from 'antd';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx b/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx
index c907310362d..ac1a23225f4 100644
--- a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx
+++ b/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx
@@ -1,6 +1,6 @@
import { Flexbox, Popover } from '@lobehub/ui';
-import { Select } from '@lobehub/ui/base-ui';
-import { Space, Switch, Tag, theme, Typography } from 'antd';
+import { Select, Switch } from '@lobehub/ui/base-ui';
+import { Space, Tag, theme, Typography } from 'antd';
import { type ExtendParamsType } from 'model-bank';
import { memo, type ReactNode, type SyntheticEvent, useMemo } from 'react';
import { Trans, useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Footer.tsx b/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Footer.tsx
index 9f45ed94edc..9b1abb4ab2c 100644
--- a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Footer.tsx
+++ b/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import type { FormInstance } from 'antd';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/provider/features/ModelList/EmptyModels.tsx b/src/routes/(main)/settings/provider/features/ModelList/EmptyModels.tsx
index 02de16b7d4f..0ccf8b34373 100644
--- a/src/routes/(main)/settings/provider/features/ModelList/EmptyModels.tsx
+++ b/src/routes/(main)/settings/provider/features/ModelList/EmptyModels.tsx
@@ -1,4 +1,5 @@
-import { Button, Center, Flexbox, Icon, Tooltip } from '@lobehub/ui';
+import { Center, Flexbox, Icon, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { App } from 'antd';
import { createStaticStyles } from 'antd-style';
import { BrainIcon, LucideRefreshCcwDot, PlusIcon } from 'lucide-react';
diff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/Footer.tsx b/src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/Footer.tsx
index 72316ec319d..b62dd8bcf7e 100644
--- a/src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/Footer.tsx
+++ b/src/routes/(main)/settings/provider/features/ModelList/ModelConfigModal/Footer.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Button } from '@lobehub/ui';
-import { ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
+import { Button, ModalFooter, useModalContext } from '@lobehub/ui/base-ui';
import { type FormInstance } from 'antd';
import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelItem.tsx b/src/routes/(main)/settings/provider/features/ModelList/ModelItem.tsx
index 6e50702ffe4..689caeaa1eb 100644
--- a/src/routes/(main)/settings/provider/features/ModelList/ModelItem.tsx
+++ b/src/routes/(main)/settings/provider/features/ModelList/ModelItem.tsx
@@ -1,7 +1,7 @@
import { ModelIcon } from '@lobehub/icons';
import { ActionIcon, copyToClipboard, Flexbox, Tag, Text } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
-import { App, Switch } from 'antd';
+import { confirmModal, Switch } from '@lobehub/ui/base-ui';
+import { App } from 'antd';
import { createStaticStyles, cssVar } from 'antd-style';
import { LucidePencil, TrashIcon } from 'lucide-react';
import { type AiProviderModelListItem } from 'model-bank';
diff --git a/src/routes/(main)/settings/provider/features/ModelList/ModelTitle/index.tsx b/src/routes/(main)/settings/provider/features/ModelList/ModelTitle/index.tsx
index b85b623d0f0..1bb35bf7e16 100644
--- a/src/routes/(main)/settings/provider/features/ModelList/ModelTitle/index.tsx
+++ b/src/routes/(main)/settings/provider/features/ModelList/ModelTitle/index.tsx
@@ -1,5 +1,5 @@
-import { ActionIcon, Button, DropdownMenu, Flexbox, Skeleton, Text, Tooltip } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { ActionIcon, DropdownMenu, Flexbox, Skeleton, Text, Tooltip } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { App, Space } from 'antd';
import { cssVar } from 'antd-style';
import { CircleX, EllipsisVertical, LucideRefreshCcwDot, PlusIcon } from 'lucide-react';
diff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx b/src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx
index 06657e15aee..721a79142f4 100644
--- a/src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx
+++ b/src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx
@@ -4,8 +4,8 @@ import { CheckCircleFilled } from '@ant-design/icons';
import { type ChatMessageError } from '@lobechat/types';
import { TraceNameMap } from '@lobechat/types';
import { ModelIcon } from '@lobehub/icons';
-import { Alert, Button, Flexbox, Highlighter, Icon } from '@lobehub/ui';
-import { Select } from '@lobehub/ui/base-ui';
+import { Alert, Flexbox, Highlighter, Icon } from '@lobehub/ui';
+import { Button, Select } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Loader2Icon } from 'lucide-react';
import { type ReactNode } from 'react';
diff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsx b/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsx
index b96342f4466..400e154598a 100644
--- a/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsx
+++ b/src/routes/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/index.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Tooltip } from '@lobehub/ui';
+import { Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import isEqual from 'fast-deep-equal';
import { SettingsIcon } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/index.tsx b/src/routes/(main)/settings/provider/features/ProviderConfig/index.tsx
index a7a232ac538..a7ec40381a6 100644
--- a/src/routes/(main)/settings/provider/features/ProviderConfig/index.tsx
+++ b/src/routes/(main)/settings/provider/features/ProviderConfig/index.tsx
@@ -14,8 +14,9 @@ import {
stopPropagation,
Tooltip,
} from '@lobehub/ui';
+import { Switch } from '@lobehub/ui/base-ui';
import { useDebounceFn } from 'ahooks';
-import { Form as AntdForm, Switch } from 'antd';
+import { Form as AntdForm } from 'antd';
import { createStaticStyles, cssVar, cx, responsive } from 'antd-style';
import { Loader2Icon, LockIcon } from 'lucide-react';
import { type ReactNode } from 'react';
diff --git a/src/routes/(main)/settings/proxy/features/ProxyForm.test.tsx b/src/routes/(main)/settings/proxy/features/ProxyForm.test.tsx
index 858862ceeab..be2bab14775 100644
--- a/src/routes/(main)/settings/proxy/features/ProxyForm.test.tsx
+++ b/src/routes/(main)/settings/proxy/features/ProxyForm.test.tsx
@@ -92,6 +92,23 @@ vi.mock('@lobehub/ui/base-ui', () => ({
{children}
</button>
),
+ Switch: ({
+ checked,
+ disabled,
+ onChange,
+ }: {
+ checked?: boolean;
+ disabled?: boolean;
+ onChange?: (checked: boolean) => void;
+ }) => (
+ <button
+ aria-checked={!!checked}
+ disabled={disabled}
+ role="switch"
+ type="button"
+ onClick={() => onChange?.(!checked)}
+ />
+ ),
}));
vi.mock('@lobehub/ui', async () => {
diff --git a/src/routes/(main)/settings/proxy/features/ProxyForm.tsx b/src/routes/(main)/settings/proxy/features/ProxyForm.tsx
index e1c36fd1139..373b81270ba 100644
--- a/src/routes/(main)/settings/proxy/features/ProxyForm.tsx
+++ b/src/routes/(main)/settings/proxy/features/ProxyForm.tsx
@@ -3,8 +3,8 @@
import { type NetworkProxySettings } from '@lobechat/electron-client-ipc';
import { type FormGroupItemType } from '@lobehub/ui';
import { Form, Skeleton, toast } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
-import { Form as AntdForm, Input, Radio, Space, Switch } from 'antd';
+import { Button, Switch } from '@lobehub/ui/base-ui';
+import { Form as AntdForm, Input, Radio, Space } from 'antd';
import { useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/skill/features/BuiltinSkillItem.tsx b/src/routes/(main)/settings/skill/features/BuiltinSkillItem.tsx
index 403eb8de317..d8a27739e18 100644
--- a/src/routes/(main)/settings/skill/features/BuiltinSkillItem.tsx
+++ b/src/routes/(main)/settings/skill/features/BuiltinSkillItem.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Avatar, Button, DropdownMenu, Flexbox, Icon, stopPropagation } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
+import { Avatar, DropdownMenu, Flexbox, Icon, stopPropagation } from '@lobehub/ui';
+import { Button, confirmModal } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { MoreHorizontalIcon, Plus, Trash2 } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/routes/(main)/settings/skill/features/ComposioSkillItem.tsx b/src/routes/(main)/settings/skill/features/ComposioSkillItem.tsx
index 4a5727e70ab..8bb1c9589e4 100644
--- a/src/routes/(main)/settings/skill/features/ComposioSkillItem.tsx
+++ b/src/routes/(main)/settings/skill/features/ComposioSkillItem.tsx
@@ -2,7 +2,7 @@
import { type ComposioAppType } from '@lobechat/const';
import { Avatar, Center, DropdownMenu, Flexbox, Icon, Tooltip } from '@lobehub/ui';
-import { Button, confirmModal } from '@lobehub/ui/base-ui';
+import { Button, Button as LobeButton, confirmModal } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import {
CircleCheck,
@@ -297,7 +297,7 @@ const ComposioSkillItem = memo<ComposioSkillItemProps>(
]}
>
<Tooltip title={editReason}>
- <Button disabled={!canEdit} icon={<Icon icon={MoreHorizontalIcon} />} />
+ <LobeButton disabled={!canEdit} icon={MoreHorizontalIcon} />
</Tooltip>
</DropdownMenu>
);
@@ -319,7 +319,7 @@ const ComposioSkillItem = memo<ComposioSkillItemProps>(
]}
>
<Tooltip title={editReason}>
- <Button disabled={!canEdit} icon={<Icon icon={MoreHorizontalIcon} />} />
+ <LobeButton disabled={!canEdit} icon={MoreHorizontalIcon} />
</Tooltip>
</DropdownMenu>
);
diff --git a/src/routes/(main)/settings/skill/features/LeftPanel.tsx b/src/routes/(main)/settings/skill/features/LeftPanel.tsx
index 05c046421dd..d48982c480e 100644
--- a/src/routes/(main)/settings/skill/features/LeftPanel.tsx
+++ b/src/routes/(main)/settings/skill/features/LeftPanel.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, DropdownMenu, Flexbox, Icon, Text } from '@lobehub/ui';
+import { DropdownMenu, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { GithubIcon } from '@lobehub/ui/icons';
import { createStaticStyles } from 'antd-style';
import { FileArchive, Grid2x2Plus, Link, Store } from 'lucide-react';
diff --git a/src/routes/(main)/settings/skill/features/LobehubSkillItem.tsx b/src/routes/(main)/settings/skill/features/LobehubSkillItem.tsx
index 1ef55678c1b..189275ff2a3 100644
--- a/src/routes/(main)/settings/skill/features/LobehubSkillItem.tsx
+++ b/src/routes/(main)/settings/skill/features/LobehubSkillItem.tsx
@@ -2,7 +2,7 @@
import { type LobehubSkillProviderType } from '@lobechat/const';
import { Avatar, Center, DropdownMenu, Flexbox, Icon, Tooltip } from '@lobehub/ui';
-import { Button, confirmModal } from '@lobehub/ui/base-ui';
+import { Button, Button as LobeButton, confirmModal } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import {
CircleCheck,
@@ -274,7 +274,7 @@ const LobehubSkillItem = memo<LobehubSkillItemProps>(
]}
>
<Tooltip title={editReason}>
- <Button disabled={!canEdit} icon={<Icon icon={MoreHorizontalIcon} />} />
+ <LobeButton disabled={!canEdit} icon={MoreHorizontalIcon} />
</Tooltip>
</DropdownMenu>
);
diff --git a/src/routes/(main)/settings/storage/features/Advanced.tsx b/src/routes/(main)/settings/storage/features/Advanced.tsx
index 956ed0ef99d..f8114e27684 100644
--- a/src/routes/(main)/settings/storage/features/Advanced.tsx
+++ b/src/routes/(main)/settings/storage/features/Advanced.tsx
@@ -2,9 +2,9 @@
import { BRANDING_NAME } from '@lobechat/business-const';
import type { FormGroupItemType } from '@lobehub/ui';
-import { Button, Form, Icon } from '@lobehub/ui';
-import { confirmModal } from '@lobehub/ui/base-ui';
-import { App, Switch } from 'antd';
+import { Form, Icon } from '@lobehub/ui';
+import { Button, confirmModal, Switch } from '@lobehub/ui/base-ui';
+import { App } from 'antd';
import { HardDriveDownload, HardDriveUpload } from 'lucide-react';
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/system-tools/features/CliTestSection.tsx b/src/routes/(main)/settings/system-tools/features/CliTestSection.tsx
index c313f6c5bfc..4c005502c2a 100644
--- a/src/routes/(main)/settings/system-tools/features/CliTestSection.tsx
+++ b/src/routes/(main)/settings/system-tools/features/CliTestSection.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox, Input, Text } from '@lobehub/ui';
+import { Flexbox, Input, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { memo, useCallback, useState } from 'react';
import { electronSystemService } from '@/services/electron/system';
diff --git a/src/routes/(main)/settings/system-tools/features/ToolDetectorSection.tsx b/src/routes/(main)/settings/system-tools/features/ToolDetectorSection.tsx
index 761b5df629a..1eb7a0128ff 100644
--- a/src/routes/(main)/settings/system-tools/features/ToolDetectorSection.tsx
+++ b/src/routes/(main)/settings/system-tools/features/ToolDetectorSection.tsx
@@ -2,7 +2,8 @@
import { type BinaryStatus } from '@lobechat/electron-client-ipc';
import { type FormGroupItemType } from '@lobehub/ui';
-import { Button, CopyButton, Flexbox, Form, Icon, Tag, Text, Tooltip } from '@lobehub/ui';
+import { CopyButton, Flexbox, Form, Icon, Tag, Text, Tooltip } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { CheckCircle2, Loader2Icon, RefreshCw, XCircle } from 'lucide-react';
import { memo, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(mobile)/(home)/features/SessionListContent/List/AddButton.tsx b/src/routes/(mobile)/(home)/features/SessionListContent/List/AddButton.tsx
index 58a981bcc4e..6d09e859cb3 100644
--- a/src/routes/(mobile)/(home)/features/SessionListContent/List/AddButton.tsx
+++ b/src/routes/(mobile)/(home)/features/SessionListContent/List/AddButton.tsx
@@ -1,4 +1,5 @@
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { Plus } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
@@ -22,7 +23,7 @@ const AddButton = memo<{ groupId?: string }>(({ groupId }) => {
block
icon={Plus}
loading={isValidating}
- variant={'filled'}
+ type={'fill'}
style={{
marginTop: 8,
}}
diff --git a/src/routes/onboarding/features/AgentPickerStep/index.tsx b/src/routes/onboarding/features/AgentPickerStep/index.tsx
index dfc484ca026..97b1a6f73aa 100644
--- a/src/routes/onboarding/features/AgentPickerStep/index.tsx
+++ b/src/routes/onboarding/features/AgentPickerStep/index.tsx
@@ -5,7 +5,8 @@ import type {
MarketplaceCategory,
} from '@lobechat/builtin-tool-web-onboarding/agentMarketplace';
import { getTemplatesByCategoryPriority } from '@lobechat/builtin-tool-web-onboarding/agentMarketplace';
-import { Button, Flexbox, Text } from '@lobehub/ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Undo2Icon } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
diff --git a/src/routes/onboarding/features/FullNameStep.tsx b/src/routes/onboarding/features/FullNameStep.tsx
index ea3450c0073..afd66952453 100644
--- a/src/routes/onboarding/features/FullNameStep.tsx
+++ b/src/routes/onboarding/features/FullNameStep.tsx
@@ -1,7 +1,8 @@
'use client';
import { SendButton } from '@lobehub/editor/react';
-import { Button, Flexbox, Icon, Input } from '@lobehub/ui';
+import { Flexbox, Icon, Input } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { SignatureIcon, Undo2Icon } from 'lucide-react';
import { memo, useCallback, useRef, useState } from 'react';
diff --git a/src/routes/onboarding/features/InterestsStep.tsx b/src/routes/onboarding/features/InterestsStep.tsx
index 9a18438b7af..3e2f75453c8 100644
--- a/src/routes/onboarding/features/InterestsStep.tsx
+++ b/src/routes/onboarding/features/InterestsStep.tsx
@@ -1,7 +1,8 @@
'use client';
import { normalizeInterestsForStorage } from '@lobechat/const';
-import { Block, Button, Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Block, Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { BriefcaseIcon, Undo2Icon } from 'lucide-react';
import { memo, useCallback, useMemo, useRef, useState } from 'react';
diff --git a/src/routes/onboarding/features/ModeSelectionStep.tsx b/src/routes/onboarding/features/ModeSelectionStep.tsx
index 80bcaec8e5e..80143d0b4e3 100644
--- a/src/routes/onboarding/features/ModeSelectionStep.tsx
+++ b/src/routes/onboarding/features/ModeSelectionStep.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Block, Button, Flexbox, Text } from '@lobehub/ui';
+import { Block, Flexbox, Text } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Undo2Icon } from 'lucide-react';
import React, { memo, useMemo } from 'react';
diff --git a/src/routes/onboarding/features/ProSettingsStep.tsx b/src/routes/onboarding/features/ProSettingsStep.tsx
index 85566270d5b..64af6900c13 100644
--- a/src/routes/onboarding/features/ProSettingsStep.tsx
+++ b/src/routes/onboarding/features/ProSettingsStep.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Button, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Button } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Undo2Icon } from 'lucide-react';
import { memo, useCallback, useRef, useState } from 'react';
diff --git a/src/routes/onboarding/features/ResponseLanguageStep.tsx b/src/routes/onboarding/features/ResponseLanguageStep.tsx
index e74170b38fd..976b3eb3efc 100644
--- a/src/routes/onboarding/features/ResponseLanguageStep.tsx
+++ b/src/routes/onboarding/features/ResponseLanguageStep.tsx
@@ -1,7 +1,8 @@
'use client';
import { SendButton } from '@lobehub/editor/react';
-import { Button, Flexbox, Select, Text } from '@lobehub/ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Button, Select } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { Undo2Icon } from 'lucide-react';
import { memo, useCallback, useRef, useState } from 'react';
diff --git a/src/routes/onboarding/features/TelemetryStep.tsx b/src/routes/onboarding/features/TelemetryStep.tsx
index 97419168587..1c04bffc142 100644
--- a/src/routes/onboarding/features/TelemetryStep.tsx
+++ b/src/routes/onboarding/features/TelemetryStep.tsx
@@ -2,10 +2,11 @@
import { BRANDING_NAME } from '@lobechat/business-const';
import { type IconProps } from '@lobehub/ui';
-import { Block, Button, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Block, Flexbox, Icon, Text } from '@lobehub/ui';
import { TypewriterEffect } from '@lobehub/ui/awesome';
+import { Button, Switch } from '@lobehub/ui/base-ui';
import { LoadingDots } from '@lobehub/ui/chat';
-import { Steps, Switch } from 'antd';
+import { Steps } from 'antd';
import { cssVar } from 'antd-style';
import { BrainIcon, HeartHandshakeIcon, PencilRulerIcon, ShieldCheck } from 'lucide-react';
import { memo, useCallback, useRef, useState } from 'react';
diff --git a/tests/setup.ts b/tests/setup.ts
index 1165084bc3d..59ad6edec54 100644
--- a/tests/setup.ts
+++ b/tests/setup.ts
@@ -6,6 +6,7 @@ import 'fake-indexeddb/auto';
import { theme } from 'antd';
import i18n from 'i18next';
import { enableMapSet, enablePatches } from 'immer';
+import type { ButtonHTMLAttributes, ComponentType, ElementType, ReactNode } from 'react';
import React from 'react';
import { beforeEach, vi } from 'vitest';
@@ -85,6 +86,145 @@ vi.mock('@/auth', () => ({
},
}));
+type NativeButtonType = 'button' | 'submit' | 'reset';
+type TestButtonIcon = ComponentType<{ size?: number }> | ReactNode;
+
+interface TestBaseUIButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
+ block?: boolean;
+ color?: string;
+ danger?: boolean;
+ fill?: string;
+ ghost?: boolean;
+ htmlType?: NativeButtonType;
+ icon?: TestButtonIcon;
+ iconPosition?: 'end' | 'start';
+ iconProps?: Record<string, unknown>;
+ loading?: boolean;
+ shadow?: boolean;
+ size?: string;
+ type?: string;
+ variant?: string;
+}
+
+interface TestBaseUISwitchProps extends Omit<
+ ButtonHTMLAttributes<HTMLButtonElement>,
+ 'defaultValue' | 'onChange' | 'onClick' | 'value'
+> {
+ checked?: boolean;
+ checkedChildren?: ReactNode;
+ defaultChecked?: boolean;
+ defaultValue?: boolean;
+ loading?: boolean;
+ onChange?: (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
+ onClick?: (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
+ size?: string;
+ unCheckedChildren?: ReactNode;
+ value?: boolean;
+}
+
+const getNativeButtonType = (type?: string): NativeButtonType =>
+ type === 'submit' || type === 'reset' ? type : 'button';
+
+const renderTestButtonIcon = (icon?: TestButtonIcon) => {
+ if (!icon) return null;
+
+ if (React.isValidElement(icon)) return icon;
+
+ return typeof icon === 'function' || (typeof icon === 'object' && '$$typeof' in icon)
+ ? React.createElement(icon as ElementType<{ size?: number }>, { size: 16 })
+ : icon;
+};
+
+const TestBaseUIButton = (props: TestBaseUIButtonProps) => {
+ const {
+ block: _block,
+ children,
+ color: _color,
+ danger: _danger,
+ disabled,
+ fill: _fill,
+ ghost: _ghost,
+ htmlType,
+ icon,
+ iconPosition = 'start',
+ iconProps: _iconProps,
+ loading,
+ shadow: _shadow,
+ size: _size,
+ type,
+ variant: _variant,
+ ...buttonProps
+ } = props;
+ const renderedIcon = renderTestButtonIcon(icon);
+ const nativeType = htmlType ?? getNativeButtonType(type);
+
+ return React.createElement(
+ 'button',
+ {
+ ...buttonProps,
+ 'aria-busy': loading || undefined,
+ 'disabled': disabled || loading,
+ 'type': nativeType,
+ },
+ iconPosition === 'end' ? children : renderedIcon,
+ iconPosition === 'end' ? renderedIcon : children,
+ );
+};
+
+const TestBaseUISwitch = (props: TestBaseUISwitchProps) => {
+ const {
+ checked,
+ checkedChildren,
+ defaultChecked,
+ defaultValue,
+ disabled,
+ loading,
+ onChange,
+ onClick,
+ size: _size,
+ unCheckedChildren,
+ value,
+ ...buttonProps
+ } = props;
+ const [innerChecked, setInnerChecked] = React.useState(defaultValue ?? defaultChecked ?? false);
+ const currentChecked = value ?? checked ?? innerChecked;
+
+ return React.createElement(
+ 'button',
+ {
+ ...buttonProps,
+ 'aria-busy': loading || undefined,
+ 'aria-checked': currentChecked,
+ 'disabled': disabled || loading,
+ 'role': 'switch',
+ 'type': 'button',
+ 'onClick': (event: React.MouseEvent<HTMLButtonElement>) => {
+ const nextChecked = !currentChecked;
+
+ if (value === undefined && checked === undefined) {
+ setInnerChecked(nextChecked);
+ }
+
+ onChange?.(nextChecked, event);
+ onClick?.(nextChecked, event);
+ },
+ },
+ currentChecked ? checkedChildren : unCheckedChildren,
+ );
+};
+
+// base-ui Button requires the app-level motion provider. Unit tests exercise
+// consuming components, so a native button keeps interaction behavior stable.
+vi.mock('@lobehub/ui/base-ui', async (importOriginal) => {
+ const actual = (await importOriginal()) as Record<string, unknown>;
+
+ return {
+ ...actual,
+ Button: TestBaseUIButton,
+ Switch: TestBaseUISwitch,
+ };
+});
+
// node runtime
if (typeof globalThis.window === 'undefined') {
// test with polyfill crypto