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 Alert to Base UI (#18316)

Inneif23574bf1003
diff --git a/.agents/skills/react/SKILL.md b/.agents/skills/react/SKILL.md
index 4ebdf905639..bc32c09af6e 100644
--- a/.agents/skills/react/SKILL.md
+++ b/.agents/skills/react/SKILL.md
@@ -28,6 +28,7 @@ If unsure about available components, search existing code or check `node_module
| Component | Import |
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
+| `Alert` (+ `AlertProps`) | `import { Alert, type AlertProps } from '@lobehub/ui/base-ui';` |
| `Select` (+ `SelectProps`, `SelectOption`) | `import { Select } from '@lobehub/ui/base-ui';` |
| `Modal` (imperative API) | `import { createModal, confirmModal, useModalContext, type ModalInstance } from '@lobehub/ui/base-ui';` |
| `DropdownMenu` | `import { DropdownMenu } from '@lobehub/ui/base-ui';` |
@@ -50,7 +51,6 @@ For Modal specifically, see the dedicated **modal** skill — use the imperative
| General | ActionIcon, ActionIconGroup, Block, Button, Icon |
| Data Display | Avatar, Collapse, Empty, Highlighter, Markdown, Tag, Tooltip |
| Data Entry | CodeEditor, CopyButton, EditableText, Form, Input, InputPassword, SearchBar, TextArea |
-| Feedback | Alert |
| Layout | Center, DraggablePanel, Flexbox, Grid, Header, MaskShadow |
| Navigation | Burger, Menu, SideNav, Tabs |
diff --git a/package.json b/package.json
index a5995939694..0c91065c33f 100644
--- a/package.json
+++ b/package.json
@@ -305,7 +305,7 @@
"@lobehub/icons": "^5.15.0",
"@lobehub/market-sdk": "0.39.2",
"@lobehub/tts": "^5.1.2",
- "@lobehub/ui": "^5.29.1",
+ "@lobehub/ui": "^5.30.0",
"@modelcontextprotocol/sdk": "^1.30.0",
"@neondatabase/serverless": "^1.1.0",
"@next/third-parties": "^16.3.0",
diff --git a/packages/builtin-tool-image-generation/src/client/Render/GenerateImage.tsx b/packages/builtin-tool-image-generation/src/client/Render/GenerateImage.tsx
index 92f2f638f7f..067282e6dbe 100644
--- a/packages/builtin-tool-image-generation/src/client/Render/GenerateImage.tsx
+++ b/packages/builtin-tool-image-generation/src/client/Render/GenerateImage.tsx
@@ -1,8 +1,8 @@
'use client';
import type { BuiltinRenderProps } from '@lobechat/types';
-import { Alert, Block, Text } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Block, Text } from '@lobehub/ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { memo, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-image-generation/src/client/Render/GetImageGenerationStatus.tsx b/packages/builtin-tool-image-generation/src/client/Render/GetImageGenerationStatus.tsx
index 43b1e5364ec..a1945cba032 100644
--- a/packages/builtin-tool-image-generation/src/client/Render/GetImageGenerationStatus.tsx
+++ b/packages/builtin-tool-image-generation/src/client/Render/GetImageGenerationStatus.tsx
@@ -1,7 +1,8 @@
'use client';
import type { BuiltinRenderProps } from '@lobechat/types';
-import { Alert, Block, Text } from '@lobehub/ui';
+import { Block, Text } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-image-generation/src/client/Render/GetImageModelParameters.tsx b/packages/builtin-tool-image-generation/src/client/Render/GetImageModelParameters.tsx
index 1b9f0baf68e..4ee8bc570c2 100644
--- a/packages/builtin-tool-image-generation/src/client/Render/GetImageModelParameters.tsx
+++ b/packages/builtin-tool-image-generation/src/client/Render/GetImageModelParameters.tsx
@@ -1,7 +1,8 @@
'use client';
import type { BuiltinRenderProps } from '@lobechat/types';
-import { Alert, Block, Flexbox, Text } from '@lobehub/ui';
+import { Block, Flexbox, Text } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-image-generation/src/client/Render/ListImageModels.tsx b/packages/builtin-tool-image-generation/src/client/Render/ListImageModels.tsx
index 90dcbe4f1ae..281e946b902 100644
--- a/packages/builtin-tool-image-generation/src/client/Render/ListImageModels.tsx
+++ b/packages/builtin-tool-image-generation/src/client/Render/ListImageModels.tsx
@@ -1,8 +1,8 @@
'use client';
import type { BuiltinRenderProps } from '@lobechat/types';
-import { Alert, Block, Flexbox, Text } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Block, Flexbox, Text } from '@lobehub/ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { ChevronDown, ChevronUp } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/FileCard.tsx b/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/FileCard.tsx
index 7d7070f0690..515d2b55e14 100644
--- a/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/FileCard.tsx
+++ b/packages/builtin-tool-knowledge-base/src/client/Render/ReadKnowledge/FileCard.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Alert, Flexbox, MaterialFileTypeIcon, Text } from '@lobehub/ui';
+import { Flexbox, MaterialFileTypeIcon, Text } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { Descriptions } from 'antd';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
diff --git a/packages/builtin-tool-local-system/src/client/Intervention/OutOfScopeWarning.tsx b/packages/builtin-tool-local-system/src/client/Intervention/OutOfScopeWarning.tsx
index f512fadb8f7..af7d67c5c46 100644
--- a/packages/builtin-tool-local-system/src/client/Intervention/OutOfScopeWarning.tsx
+++ b/packages/builtin-tool-local-system/src/client/Intervention/OutOfScopeWarning.tsx
@@ -1,5 +1,6 @@
import { isPathWithinScope } from '@lobechat/tool-runtime';
-import { Alert, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx b/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx
index ca16f56ab5f..38f85d4d763 100644
--- a/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx
+++ b/packages/builtin-tool-local-system/src/client/Render/EditLocalFile/index.tsx
@@ -1,6 +1,7 @@
import type { EditLocalFileState } from '@lobechat/builtin-tool-local-system';
import type { BuiltinRenderProps } from '@lobechat/types';
-import { Alert, Flexbox, PatchDiff, Skeleton } from '@lobehub/ui';
+import { Flexbox, PatchDiff, Skeleton } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import React, { memo } from 'react';
const EditLocalFile = memo<BuiltinRenderProps<any, EditLocalFileState>>(
diff --git a/packages/builtin-tool-web-browsing/src/client/Portal/PageContent/index.tsx b/packages/builtin-tool-web-browsing/src/client/Portal/PageContent/index.tsx
index afae42455e1..5c9950e7702 100644
--- a/packages/builtin-tool-web-browsing/src/client/Portal/PageContent/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Portal/PageContent/index.tsx
@@ -1,16 +1,15 @@
import type { CrawlResult } from '@lobechat/types';
import type { CrawlSuccessResult } from '@lobechat/web-crawler';
import {
- Alert,
CopyButton,
Flexbox,
Highlighter,
Icon,
Markdown,
- Segmented,
stopPropagation,
Text,
} from '@lobehub/ui';
+import { Alert, Segmented } from '@lobehub/ui/base-ui';
import { Descriptions } from 'antd';
import { createStaticStyles } from 'antd-style';
import { ExternalLink } from 'lucide-react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/PageContent/Result.tsx b/packages/builtin-tool-web-browsing/src/client/Render/PageContent/Result.tsx
index 8f493de7ed6..be06ec8d4bf 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/PageContent/Result.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/PageContent/Result.tsx
@@ -1,7 +1,8 @@
'use client';
import type { CrawlErrorResult, CrawlSuccessResult } from '@lobechat/web-crawler';
-import { ActionIcon, Alert, Block, Flexbox, stopPropagation, Text } from '@lobehub/ui';
+import { ActionIcon, Block, Flexbox, stopPropagation, Text } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { Descriptions } from 'antd';
import { createStaticStyles } from 'antd-style';
import { ExternalLink } from 'lucide-react';
diff --git a/packages/builtin-tool-web-browsing/src/client/Render/Search/index.tsx b/packages/builtin-tool-web-browsing/src/client/Render/Search/index.tsx
index 62b0888fa75..fe7bfc1f067 100644
--- a/packages/builtin-tool-web-browsing/src/client/Render/Search/index.tsx
+++ b/packages/builtin-tool-web-browsing/src/client/Render/Search/index.tsx
@@ -1,5 +1,6 @@
import type { BuiltinRenderProps, SearchQuery, UniformSearchResponse } from '@lobechat/types';
-import { Alert, Flexbox, Highlighter } from '@lobehub/ui';
+import { Flexbox, Highlighter } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { memo, useState } from 'react';
import ConfigForm from './ConfigForm';
diff --git a/src/business/client/hooks/useBusinessErrorAlertConfig.ts b/src/business/client/hooks/useBusinessErrorAlertConfig.ts
index d3b3a37c2a2..b6d7eb54c96 100644
--- a/src/business/client/hooks/useBusinessErrorAlertConfig.ts
+++ b/src/business/client/hooks/useBusinessErrorAlertConfig.ts
@@ -1,5 +1,5 @@
import { type ErrorType } from '@lobechat/types';
-import { type AlertProps } from '@lobehub/ui';
+import { type AlertProps } from '@lobehub/ui/base-ui';
export default function useBusinessErrorAlertConfig(
_errorType?: ErrorType,
diff --git a/src/components/ErrorBoundary/AlertFallback.tsx b/src/components/ErrorBoundary/AlertFallback.tsx
index 62507c245c5..510c5bc215d 100644
--- a/src/components/ErrorBoundary/AlertFallback.tsx
+++ b/src/components/ErrorBoundary/AlertFallback.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Alert, Highlighter } from '@lobehub/ui';
+import { Highlighter } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { memo } from 'react';
interface AlertFallbackProps {
diff --git a/src/features/AgentArtworkStudio/Content.tsx b/src/features/AgentArtworkStudio/Content.tsx
index b4284ce0fe7..7e652703b3d 100644
--- a/src/features/AgentArtworkStudio/Content.tsx
+++ b/src/features/AgentArtworkStudio/Content.tsx
@@ -6,8 +6,8 @@ import {
type AgentArtworkStyle,
DEFAULT_AGENT_ARTWORK_STYLE,
} from '@lobechat/prompts';
-import { Alert, Avatar, Center, Flexbox, Icon, Tag, Text } from '@lobehub/ui';
-import { Button, toast, useModalContext } from '@lobehub/ui/base-ui';
+import { Avatar, Center, Flexbox, Icon, Tag, Text } from '@lobehub/ui';
+import { Alert, Button, toast, useModalContext } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import { Check, SettingsIcon, UploadIcon, WandSparkles } from 'lucide-react';
import { memo, useCallback, useRef, useState } from 'react';
diff --git a/src/features/AgentPermission/PermissionForm.tsx b/src/features/AgentPermission/PermissionForm.tsx
index 28167152ccf..3c657dfc5e3 100644
--- a/src/features/AgentPermission/PermissionForm.tsx
+++ b/src/features/AgentPermission/PermissionForm.tsx
@@ -2,7 +2,8 @@
import type { AgentModelSelectionPolicy } from '@lobechat/types';
import type { FormGroupItemType } from '@lobehub/ui';
-import { Alert, Empty, Form, Icon } from '@lobehub/ui';
+import { Empty, Form, Icon } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { Bot, InfoIcon, LockIcon, MonitorSmartphone, UsersIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
diff --git a/src/features/AgentSetting/AgentGraphRuntime/index.tsx b/src/features/AgentSetting/AgentGraphRuntime/index.tsx
index cbf99efaa4c..d99c845ee7f 100644
--- a/src/features/AgentSetting/AgentGraphRuntime/index.tsx
+++ b/src/features/AgentSetting/AgentGraphRuntime/index.tsx
@@ -2,8 +2,8 @@
import type { ReasoningGraph } from '@lobechat/types';
import { ReasoningGraphSchema } from '@lobechat/types';
-import { Alert, Flexbox, TextArea } from '@lobehub/ui';
-import { Button, Switch } from '@lobehub/ui/base-ui';
+import { Flexbox, TextArea } from '@lobehub/ui';
+import { Alert, Button, Switch } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
diff --git a/src/features/AgentSkillEdit/index.tsx b/src/features/AgentSkillEdit/index.tsx
index 7890e9b2411..9030fa9d9d4 100644
--- a/src/features/AgentSkillEdit/index.tsx
+++ b/src/features/AgentSkillEdit/index.tsx
@@ -4,8 +4,8 @@ import { isDesktop } from '@lobechat/const';
import { TITLE_BAR_HEIGHT } from '@lobechat/desktop-bridge';
import { type SkillResourceTreeNode } from '@lobechat/types';
import { Flexbox } from '@lobehub/ui';
-import { Button, Drawer, toast } from '@lobehub/ui/base-ui';
-import { Alert, Form as AForm, Popconfirm, Skeleton } from 'antd';
+import { Alert, Button, Drawer, toast } from '@lobehub/ui/base-ui';
+import { Form as AForm, Popconfirm, Skeleton } from 'antd';
import { createStaticStyles } from 'antd-style';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Auth/OAuthConsent/ThirdPartyNotice.tsx b/src/features/Auth/OAuthConsent/ThirdPartyNotice.tsx
index 617c977f127..f0742f662a4 100644
--- a/src/features/Auth/OAuthConsent/ThirdPartyNotice.tsx
+++ b/src/features/Auth/OAuthConsent/ThirdPartyNotice.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Alert, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { cssVar } from 'antd-style';
import { ExternalLinkIcon } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/features/Auth/SignIn/SignInEmailStep.tsx b/src/features/Auth/SignIn/SignInEmailStep.tsx
index 9d8747813d6..26577e9cd86 100644
--- a/src/features/Auth/SignIn/SignInEmailStep.tsx
+++ b/src/features/Auth/SignIn/SignInEmailStep.tsx
@@ -1,6 +1,6 @@
import { BRANDING_NAME } from '@lobechat/business-const';
-import { Alert, Flexbox, Icon, Input, Text } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { type FormInstance, type InputRef } from 'antd';
import { Badge, Divider, Form } from 'antd';
import { createStaticStyles } from 'antd-style';
diff --git a/src/features/ChatInput/ChatInputNotice/index.tsx b/src/features/ChatInput/ChatInputNotice/index.tsx
index b7191ce207e..a1aca5ddb0a 100644
--- a/src/features/ChatInput/ChatInputNotice/index.tsx
+++ b/src/features/ChatInput/ChatInputNotice/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Alert } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ConnectAgent/index.tsx b/src/features/ConnectAgent/index.tsx
index a396932d5d5..177dc2dff25 100644
--- a/src/features/ConnectAgent/index.tsx
+++ b/src/features/ConnectAgent/index.tsx
@@ -9,8 +9,9 @@ import type {
import { isRemoteHeterogeneousType } from '@lobechat/heterogeneous-agents';
import type { DeviceListItem } from '@lobechat/types';
import { agentDisplayName } from '@lobechat/types';
-import { Alert, CopyButton, Flexbox, Icon, Input, Text, TextArea, Tooltip } from '@lobehub/ui';
+import { CopyButton, Flexbox, Icon, Input, Text, TextArea, Tooltip } from '@lobehub/ui';
import {
+ Alert,
Button,
Checkbox,
createModal,
diff --git a/src/features/Conversation/ChatInput/InputCompletionErrorAlert.tsx b/src/features/Conversation/ChatInput/InputCompletionErrorAlert.tsx
index ad3c0513ec9..b61866612b2 100644
--- a/src/features/Conversation/ChatInput/InputCompletionErrorAlert.tsx
+++ b/src/features/Conversation/ChatInput/InputCompletionErrorAlert.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Alert, Flexbox } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Alert, 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/Conversation/ChatInput/index.tsx b/src/features/Conversation/ChatInput/index.tsx
index 616fee10182..f7bd22021c2 100644
--- a/src/features/Conversation/ChatInput/index.tsx
+++ b/src/features/Conversation/ChatInput/index.tsx
@@ -3,7 +3,8 @@
import { type VoiceMessageRecording } from '@lobechat/types';
import { type SlashOptions } from '@lobehub/editor';
import { type ChatInputActionsProps } from '@lobehub/editor/react';
-import { Alert, Flexbox, type MenuProps } from '@lobehub/ui';
+import { Flexbox, type MenuProps } from '@lobehub/ui';
+import { Alert } 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.test.tsx b/src/features/Conversation/ChatItem/components/ErrorContent.test.tsx
index 6e0bcdadf4f..e46665405be 100644
--- a/src/features/Conversation/ChatItem/components/ErrorContent.test.tsx
+++ b/src/features/Conversation/ChatItem/components/ErrorContent.test.tsx
@@ -15,6 +15,10 @@ let isRegenerating = false;
// Drive the Alert's `afterClose` directly via a click, so we exercise
// ErrorContent's dismiss branching without the real close animation.
vi.mock('@lobehub/ui', () => ({
+ Skeleton: { Button: () => <div>loading</div> },
+}));
+
+vi.mock('@lobehub/ui/base-ui', () => ({
Alert: ({ action, afterClose }: { action?: ReactNode; afterClose?: () => void }) => (
<div>
<button type="button" onClick={() => afterClose?.()}>
@@ -23,11 +27,19 @@ vi.mock('@lobehub/ui', () => ({
{action}
</div>
),
- Skeleton: { Button: () => <div>loading</div> },
-}));
-
-vi.mock('antd', () => ({
- Button: ({ children }: { children?: ReactNode }) => <span>{children}</span>,
+ Button: ({
+ children,
+ disabled,
+ loading,
+ }: {
+ children?: ReactNode;
+ disabled?: boolean;
+ loading?: boolean;
+ }) => (
+ <button aria-busy={loading || undefined} disabled={disabled} type="button">
+ {children}
+ </button>
+ ),
}));
vi.mock('react-i18next', () => ({
diff --git a/src/features/Conversation/ChatItem/components/ErrorContent.tsx b/src/features/Conversation/ChatItem/components/ErrorContent.tsx
index b3666283813..73ecfadf1ae 100644
--- a/src/features/Conversation/ChatItem/components/ErrorContent.tsx
+++ b/src/features/Conversation/ChatItem/components/ErrorContent.tsx
@@ -1,5 +1,5 @@
-import { Alert, Skeleton } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Skeleton } from '@lobehub/ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { RotateCcw } from 'lucide-react';
import { memo, Suspense } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/ChatItem/type.ts b/src/features/Conversation/ChatItem/type.ts
index 4d1033ce920..95a6d4a7e7d 100644
--- a/src/features/Conversation/ChatItem/type.ts
+++ b/src/features/Conversation/ChatItem/type.ts
@@ -1,4 +1,5 @@
-import type { AlertProps, AvatarProps, DivProps, FlexboxProps } from '@lobehub/ui';
+import type { AvatarProps, DivProps, FlexboxProps } from '@lobehub/ui';
+import { type AlertProps } from '@lobehub/ui/base-ui';
import type { EditableMessageProps, MetaData } from '@lobehub/ui/chat';
import type { ReactNode } from 'react';
diff --git a/src/features/Conversation/Error/OllamaBizError/index.tsx b/src/features/Conversation/Error/OllamaBizError/index.tsx
index 5b2f0702c34..a189af7b7a4 100644
--- a/src/features/Conversation/Error/OllamaBizError/index.tsx
+++ b/src/features/Conversation/Error/OllamaBizError/index.tsx
@@ -1,6 +1,6 @@
import { type ChatMessageError } from '@lobechat/types';
-import { type AlertProps } from '@lobehub/ui';
import { Skeleton } from '@lobehub/ui';
+import { type AlertProps } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import ErrorContent from '@/features/Conversation/ChatItem/components/ErrorContent';
diff --git a/src/features/Conversation/Error/index.tsx b/src/features/Conversation/Error/index.tsx
index 8076ab8f7c5..6f0b3fe500f 100644
--- a/src/features/Conversation/Error/index.tsx
+++ b/src/features/Conversation/Error/index.tsx
@@ -5,8 +5,8 @@ import { AgentRuntimeErrorType, getErrorCodeSpec } from '@lobechat/model-runtime
import { type ChatMessageError, type ErrorType, type IToolErrorType } from '@lobechat/types';
import { ChatErrorType } from '@lobechat/types';
import { isRecord } from '@lobechat/utils/object';
-import { type AlertProps } from '@lobehub/ui';
import { Block, Highlighter, Skeleton } from '@lobehub/ui';
+import { type AlertProps } from '@lobehub/ui/base-ui';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/AbortResponse.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/AbortResponse.tsx
index 09bf46a1e0e..28d3c3f6e24 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/AbortResponse.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/AbortResponse.tsx
@@ -1,4 +1,4 @@
-import { Alert } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/SecurityBlacklistWarning.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/SecurityBlacklistWarning.tsx
index bbbaa136c4e..105834d5daf 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/SecurityBlacklistWarning.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/SecurityBlacklistWarning.tsx
@@ -1,5 +1,6 @@
import { DEFAULT_SECURITY_BLACKLIST, InterventionChecker } from '@lobechat/agent-runtime';
-import { Alert, Flexbox } from '@lobehub/ui';
+import { Flexbox } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/Messages/Tasks/shared/ErrorState.tsx b/src/features/Conversation/Messages/Tasks/shared/ErrorState.tsx
index aef903e12a9..3160194aff8 100644
--- a/src/features/Conversation/Messages/Tasks/shared/ErrorState.tsx
+++ b/src/features/Conversation/Messages/Tasks/shared/ErrorState.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Alert, Flexbox, Highlighter } from '@lobehub/ui';
+import { Flexbox, Highlighter } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { MessageSquare, Timer, Wrench } from 'lucide-react';
import { memo, useMemo } from 'react';
diff --git a/src/features/Conversation/Messages/Tool/index.tsx b/src/features/Conversation/Messages/Tool/index.tsx
index 7ee28981b55..a1110a857a2 100644
--- a/src/features/Conversation/Messages/Tool/index.tsx
+++ b/src/features/Conversation/Messages/Tool/index.tsx
@@ -1,6 +1,6 @@
import { type UIChatMessage } from '@lobechat/types';
-import { Alert, Flexbox } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Alert, 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/components/Extras/TTS/Player.tsx b/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx
index 282dce10fdb..b830aa31e18 100644
--- a/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx
+++ b/src/features/Conversation/Messages/components/Extras/TTS/Player.tsx
@@ -1,8 +1,8 @@
import { type ChatMessageError } from '@lobechat/types';
import { type AudioPlayerProps } from '@lobehub/tts/react';
import { AudioPlayer } from '@lobehub/tts/react';
-import { ActionIcon, Alert, Flexbox, Highlighter } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { ActionIcon, Flexbox, Highlighter } from '@lobehub/ui';
+import { Alert, 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/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.test.tsx b/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.test.tsx
index 417a00e3fc3..9b00e63e308 100644
--- a/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.test.tsx
+++ b/src/features/Conversation/WorkingSidebar/ResourcesSection/AgentDocumentsGroup.test.tsx
@@ -24,6 +24,12 @@ const useParamsMock = vi.hoisted(() => vi.fn());
const documentExplorerShouldThrow = vi.hoisted(() => ({ current: false }));
vi.mock('@lobehub/ui/base-ui', () => ({
+ Alert: ({ message, title }: { message?: ReactNode; title?: ReactNode }) => (
+ <div role="alert">
+ <div>{title}</div>
+ <div>{message}</div>
+ </div>
+ ),
confirmModal: modalConfirm,
toast: { error: messageError, success: messageSuccess },
}));
@@ -49,12 +55,6 @@ vi.mock('@lobehub/ui', async (importOriginal) => {
{title}
</button>
),
- Alert: ({ message, title }: { message?: ReactNode; title?: ReactNode }) => (
- <div role="alert">
- <div>{title}</div>
- <div>{message}</div>
- </div>
- ),
Center: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
Empty: ({ description }: { description?: ReactNode }) => <div>{description}</div>,
ErrorBoundary: actual.ErrorBoundary,
@@ -120,7 +120,7 @@ vi.mock('@/features/AgentDocumentsExplorer', () => ({
}: {
data: { documentId: string; id: string; title?: string }[];
onOpenDocument?: (documentId: string, agentDocumentId?: string) => void;
- }) => (
+ }) =>
documentExplorerShouldThrow.current ? (
(() => {
throw new Error('document tree render failed');
@@ -137,8 +137,7 @@ vi.mock('@/features/AgentDocumentsExplorer', () => ({
</button>
))}
</div>
- )
- ),
+ ),
}));
vi.mock('@/features/Workspace/useWorkspaceAwareNavigate', () => ({
diff --git a/src/features/DataImporter/Error.tsx b/src/features/DataImporter/Error.tsx
index 41aec804f91..5189b56131d 100644
--- a/src/features/DataImporter/Error.tsx
+++ b/src/features/DataImporter/Error.tsx
@@ -1,5 +1,5 @@
-import { Alert, Flexbox, Highlighter, Icon } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox, Highlighter, Icon } from '@lobehub/ui';
+import { Alert, 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/DesktopOnboarding/steps/LoginStep.tsx b/src/features/DesktopOnboarding/steps/LoginStep.tsx
index a76e0f13d56..ff9ad627d9b 100644
--- a/src/features/DesktopOnboarding/steps/LoginStep.tsx
+++ b/src/features/DesktopOnboarding/steps/LoginStep.tsx
@@ -2,8 +2,8 @@
import { type AuthorizationPhase, type AuthorizationProgress } from '@lobechat/electron-client-ipc';
import { useWatchBroadcast } from '@lobechat/electron-client-ipc';
-import { Alert, Center, Flexbox, Icon, Input, Text } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Center, Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { cssVar } from 'antd-style';
import { Cloud, LogOutIcon, Server, Undo2Icon } from 'lucide-react';
diff --git a/src/features/GroupPermission/PermissionForm.tsx b/src/features/GroupPermission/PermissionForm.tsx
index f6e97bed3f4..e16a9e8c4de 100644
--- a/src/features/GroupPermission/PermissionForm.tsx
+++ b/src/features/GroupPermission/PermissionForm.tsx
@@ -2,7 +2,8 @@
import type { AgentModelSelectionPolicy } from '@lobechat/types';
import type { FormGroupItemType } from '@lobehub/ui';
-import { Alert, Empty, Form, Icon } from '@lobehub/ui';
+import { Empty, Form, Icon } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { Bot, InfoIcon, LockIcon, MonitorSmartphone, UsersIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
diff --git a/src/features/LibraryModal/AssignKnowledgeBase/List.tsx b/src/features/LibraryModal/AssignKnowledgeBase/List.tsx
index 8c8c7aa9fdc..ad4295a82a1 100644
--- a/src/features/LibraryModal/AssignKnowledgeBase/List.tsx
+++ b/src/features/LibraryModal/AssignKnowledgeBase/List.tsx
@@ -1,4 +1,5 @@
-import { Alert, Center, Empty, Flexbox, Icon } from '@lobehub/ui';
+import { Center, Empty, Flexbox, Icon } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { VirtuosoMasonry } from '@virtuoso.dev/masonry';
import { BookOpen, ServerCrash } from 'lucide-react';
import React, { memo, useMemo, useState } from 'react';
diff --git a/src/features/MCP/MCPInstallProgress/InstallError/index.tsx b/src/features/MCP/MCPInstallProgress/InstallError/index.tsx
index af752f3c444..5a5d4da421c 100644
--- a/src/features/MCP/MCPInstallProgress/InstallError/index.tsx
+++ b/src/features/MCP/MCPInstallProgress/InstallError/index.tsx
@@ -1,5 +1,5 @@
-import { Alert, Flexbox } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Messenger/IntegrationDetail/MessengerPush.tsx b/src/features/Messenger/IntegrationDetail/MessengerPush.tsx
index 29f3788df1c..1fb0336ee99 100644
--- a/src/features/Messenger/IntegrationDetail/MessengerPush.tsx
+++ b/src/features/Messenger/IntegrationDetail/MessengerPush.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Alert, Block, Flexbox, Icon, Input, Text } from '@lobehub/ui';
-import { Button, Select, toast } from '@lobehub/ui/base-ui';
+import { Block, Flexbox, Icon, Input, Text } from '@lobehub/ui';
+import { Alert, Button, Select, toast } from '@lobehub/ui/base-ui';
import { SendIcon } from 'lucide-react';
import { memo, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Messenger/IntegrationDetail/Wechat.tsx b/src/features/Messenger/IntegrationDetail/Wechat.tsx
index ea32752a71b..28dff82a4ad 100644
--- a/src/features/Messenger/IntegrationDetail/Wechat.tsx
+++ b/src/features/Messenger/IntegrationDetail/Wechat.tsx
@@ -1,8 +1,8 @@
'use client';
import { InfoCircleOutlined } from '@ant-design/icons';
-import { Alert, Block, Flexbox, Icon, Text } from '@lobehub/ui';
-import { Button, toast } from '@lobehub/ui/base-ui';
+import { Block, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Alert, Button, toast } from '@lobehub/ui/base-ui';
import { QRCode } from 'antd';
import { createStaticStyles } from 'antd-style';
import { ExternalLinkIcon, QrCodeIcon, RefreshCwIcon, XIcon } from 'lucide-react';
diff --git a/src/features/OllamaModelDownloader/index.tsx b/src/features/OllamaModelDownloader/index.tsx
index f6eb71d0f9a..90080258e66 100644
--- a/src/features/OllamaModelDownloader/index.tsx
+++ b/src/features/OllamaModelDownloader/index.tsx
@@ -1,6 +1,6 @@
import { Ollama } from '@lobehub/icons';
-import { Alert, Center, Flexbox, Input } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Center, Flexbox, Input } from '@lobehub/ui';
+import { Alert, 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/PageEditor/LockStatusBanner.tsx b/src/features/PageEditor/LockStatusBanner.tsx
index 950196bdf2e..2fd16f2e183 100644
--- a/src/features/PageEditor/LockStatusBanner.tsx
+++ b/src/features/PageEditor/LockStatusBanner.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Alert } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/PageEditor/LockedAlert.tsx b/src/features/PageEditor/LockedAlert.tsx
index 0149c485193..5a131a4780a 100644
--- a/src/features/PageEditor/LockedAlert.tsx
+++ b/src/features/PageEditor/LockedAlert.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Alert } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx b/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx
index f3bc295c842..e8e4e09994b 100644
--- a/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx
+++ b/src/features/PluginDevModal/MCPManifestForm/QuickImportSection.tsx
@@ -1,5 +1,5 @@
-import { Alert, Flexbox, TextArea } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox, TextArea } from '@lobehub/ui';
+import { Alert, 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 8c8728fffda..01bdd885511 100644
--- a/src/features/PluginDevModal/MCPManifestForm/index.tsx
+++ b/src/features/PluginDevModal/MCPManifestForm/index.tsx
@@ -1,5 +1,5 @@
-import { Alert, Flexbox, FormItem, Input, InputPassword } from '@lobehub/ui';
-import { Button, RadioGroup } from '@lobehub/ui/base-ui';
+import { Flexbox, FormItem, Input, InputPassword } from '@lobehub/ui';
+import { Alert, Button, RadioGroup } from '@lobehub/ui/base-ui';
import { type FormInstance } from 'antd';
import { Divider, Form } from 'antd';
import isEqual from 'fast-deep-equal';
diff --git a/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx b/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx
index f413017af49..276a2a6d5f6 100644
--- a/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx
+++ b/src/features/ProtocolUrlHandler/InstallPlugin/CustomPluginInstallModal.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Alert, Block, Flexbox, Text } from '@lobehub/ui';
-import { toast } from '@lobehub/ui/base-ui';
+import { Block, Flexbox, Text } from '@lobehub/ui';
+import { Alert, toast } from '@lobehub/ui/base-ui';
import { memo, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ResourcePermission/ResourceAccessPage.tsx b/src/features/ResourcePermission/ResourceAccessPage.tsx
index d6d1e9b5ccf..8039a5f6f9d 100644
--- a/src/features/ResourcePermission/ResourceAccessPage.tsx
+++ b/src/features/ResourcePermission/ResourceAccessPage.tsx
@@ -1,8 +1,8 @@
'use client';
import type { FormGroupItemType } from '@lobehub/ui';
-import { Alert, Flexbox, Form, Icon, Text } from '@lobehub/ui';
-import { toast } from '@lobehub/ui/base-ui';
+import { Flexbox, Form, Icon, Text } from '@lobehub/ui';
+import { Alert, toast } from '@lobehub/ui/base-ui';
import { Breadcrumb as AntBreadcrumb } from 'antd';
import { createStaticStyles } from 'antd-style';
import { ChevronRight, InfoIcon, UsersIcon } from 'lucide-react';
diff --git a/src/features/Settings/creds/features/ViewCredModal/Content.tsx b/src/features/Settings/creds/features/ViewCredModal/Content.tsx
index 221cc292e1c..da7b74918f3 100644
--- a/src/features/Settings/creds/features/ViewCredModal/Content.tsx
+++ b/src/features/Settings/creds/features/ViewCredModal/Content.tsx
@@ -2,8 +2,9 @@
import { type UserCredSummary } from '@lobechat/types';
import { CopyButton, Flexbox } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { useQuery } from '@tanstack/react-query';
-import { Alert, Descriptions, Skeleton, Typography } from 'antd';
+import { Descriptions, Skeleton, Typography } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { Eye, EyeOff } from 'lucide-react';
import { type FC, useState } from 'react';
diff --git a/src/features/Settings/labs/index.test.tsx b/src/features/Settings/labs/index.test.tsx
index bc022933ee6..adc2bfbbc74 100644
--- a/src/features/Settings/labs/index.test.tsx
+++ b/src/features/Settings/labs/index.test.tsx
@@ -36,7 +36,6 @@ vi.mock('react-i18next', () => ({
}));
vi.mock('@lobehub/ui', () => ({
- Alert: ({ title }: { title: ReactNode }) => <div role={'note'}>{title}</div>,
Flexbox: ({ children }: { children: ReactNode }) => <div>{children}</div>,
Form: ({
items,
@@ -68,6 +67,7 @@ vi.mock('@lobehub/ui', () => ({
}));
vi.mock('@lobehub/ui/base-ui', () => ({
+ Alert: ({ title }: { title: ReactNode }) => <div role={'note'}>{title}</div>,
Switch: () => <button />,
}));
diff --git a/src/features/Settings/labs/index.tsx b/src/features/Settings/labs/index.tsx
index 3630093986b..0a7cd2e9417 100644
--- a/src/features/Settings/labs/index.tsx
+++ b/src/features/Settings/labs/index.tsx
@@ -2,8 +2,8 @@
import { isDesktop } from '@lobechat/const';
import { type FormGroupItemType, type FormItemProps } from '@lobehub/ui';
-import { Alert, Flexbox, Form, Skeleton, Tag, Tooltip } from '@lobehub/ui';
-import { Switch } from '@lobehub/ui/base-ui';
+import { Flexbox, Form, Skeleton, Tag, Tooltip } from '@lobehub/ui';
+import { Alert, Switch } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { FlaskConicalIcon } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/features/Settings/provider/features/ProviderConfig/Checker.tsx b/src/features/Settings/provider/features/ProviderConfig/Checker.tsx
index 8819735483c..e10aa762a41 100644
--- a/src/features/Settings/provider/features/ProviderConfig/Checker.tsx
+++ b/src/features/Settings/provider/features/ProviderConfig/Checker.tsx
@@ -5,8 +5,8 @@ import { type ChatMessageError } from '@lobechat/types';
import { TraceNameMap } from '@lobechat/types';
import { isRecord, pickTrimmedString } from '@lobechat/utils/object';
import { ModelIcon } from '@lobehub/icons';
-import { Alert, Flexbox, Highlighter, Icon } from '@lobehub/ui';
-import { Button, Select } from '@lobehub/ui/base-ui';
+import { Flexbox, Highlighter, Icon } from '@lobehub/ui';
+import { Alert, 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/features/SkillStore/SkillList/ImportFromGithubModal.tsx b/src/features/SkillStore/SkillList/ImportFromGithubModal.tsx
index 29ccf794202..69865f02137 100644
--- a/src/features/SkillStore/SkillList/ImportFromGithubModal.tsx
+++ b/src/features/SkillStore/SkillList/ImportFromGithubModal.tsx
@@ -1,8 +1,14 @@
'use client';
-import { Alert, Flexbox, Icon, Input } from '@lobehub/ui';
-import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
-import { toast } from '@lobehub/ui/base-ui';
+import { Flexbox, Icon, Input } from '@lobehub/ui';
+import {
+ Alert,
+ Button,
+ createModal,
+ type ModalInstance,
+ toast,
+ useModalContext,
+} from '@lobehub/ui/base-ui';
import { GithubIcon } from '@lobehub/ui/icons';
import { Typography } from 'antd';
import { ArrowLeftRight, Sparkles } from 'lucide-react';
diff --git a/src/features/SkillStore/SkillList/ImportFromUrlModal.tsx b/src/features/SkillStore/SkillList/ImportFromUrlModal.tsx
index a14867f9a30..4c2acdc85d9 100644
--- a/src/features/SkillStore/SkillList/ImportFromUrlModal.tsx
+++ b/src/features/SkillStore/SkillList/ImportFromUrlModal.tsx
@@ -1,8 +1,14 @@
'use client';
-import { Alert, Flexbox, Icon, Input } from '@lobehub/ui';
-import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
-import { toast } from '@lobehub/ui/base-ui';
+import { Flexbox, Icon, Input } from '@lobehub/ui';
+import {
+ Alert,
+ Button,
+ createModal,
+ type ModalInstance,
+ toast,
+ useModalContext,
+} from '@lobehub/ui/base-ui';
import { Typography } from 'antd';
import { ArrowLeftRight, Link, Sparkles } from 'lucide-react';
import { memo, useEffect, useState } from 'react';
diff --git a/src/features/SkillStore/SkillList/UploadSkillModal.tsx b/src/features/SkillStore/SkillList/UploadSkillModal.tsx
index c26424e62fc..30622def284 100644
--- a/src/features/SkillStore/SkillList/UploadSkillModal.tsx
+++ b/src/features/SkillStore/SkillList/UploadSkillModal.tsx
@@ -1,9 +1,14 @@
'use client';
import { LoadingOutlined } from '@ant-design/icons';
-import { Alert, Flexbox, Icon } from '@lobehub/ui';
-import { createModal, type ModalInstance, useModalContext } from '@lobehub/ui/base-ui';
-import { toast } from '@lobehub/ui/base-ui';
+import { Flexbox, Icon } from '@lobehub/ui';
+import {
+ Alert,
+ createModal,
+ type ModalInstance,
+ toast,
+ useModalContext,
+} from '@lobehub/ui/base-ui';
import { Spin, Typography, Upload } from 'antd';
import { sha256 } from 'js-sha256';
import { ArrowLeftRight, InboxIcon, Sparkles, Upload as UploadIcon } from 'lucide-react';
diff --git a/src/routes/(main)/(create)/features/GenerationInput/GenerationModelNotice/index.tsx b/src/routes/(main)/(create)/features/GenerationInput/GenerationModelNotice/index.tsx
index 69b7aefc447..fb9504eb843 100644
--- a/src/routes/(main)/(create)/features/GenerationInput/GenerationModelNotice/index.tsx
+++ b/src/routes/(main)/(create)/features/GenerationInput/GenerationModelNotice/index.tsx
@@ -1,6 +1,6 @@
'use client';
-import { Alert } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { createStaticStyles, cx } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/agent/channel/detail/Footer.tsx b/src/routes/(main)/agent/channel/detail/Footer.tsx
index 669168695df..1070d756d43 100644
--- a/src/routes/(main)/agent/channel/detail/Footer.tsx
+++ b/src/routes/(main)/agent/channel/detail/Footer.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Alert, Flexbox, Tag } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox, Tag } from '@lobehub/ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { Form as AntdForm, type FormInstance } from 'antd';
import { createStaticStyles } from 'antd-style';
import { RefreshCw, Trash2 } from 'lucide-react';
diff --git a/src/routes/(main)/agent/channel/detail/index.tsx b/src/routes/(main)/agent/channel/detail/index.tsx
index 021eb53d677..3ce4fdbdeb5 100644
--- a/src/routes/(main)/agent/channel/detail/index.tsx
+++ b/src/routes/(main)/agent/channel/detail/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Alert, Flexbox } from '@lobehub/ui';
-import { Button, confirmModal, toast } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Alert, Button, confirmModal, toast } from '@lobehub/ui/base-ui';
import { Form } from 'antd';
import { createStaticStyles } from 'antd-style';
import { ExternalLink } from 'lucide-react';
diff --git a/src/routes/(main)/agent/channel/detail/permission.test.tsx b/src/routes/(main)/agent/channel/detail/permission.test.tsx
index f963a79936f..275f4764048 100644
--- a/src/routes/(main)/agent/channel/detail/permission.test.tsx
+++ b/src/routes/(main)/agent/channel/detail/permission.test.tsx
@@ -130,22 +130,6 @@ vi.mock('@lobehub/ui', () => ({
{title}
</button>
),
- Alert: ({
- description,
- message,
- style,
- title,
- }: {
- description?: ReactNode;
- message?: ReactNode;
- style?: React.CSSProperties;
- title?: ReactNode;
- }) => (
- <div data-testid="channel-paid-alert" style={style}>
- <div data-testid="channel-paid-alert-title">{title || message}</div>
- <div data-testid="channel-paid-alert-description">{description}</div>
- </div>
- ),
Block: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
Flexbox: ({ children, ...props }: { children?: ReactNode; [key: string]: unknown }) => (
<div {...props}>{children}</div>
@@ -211,6 +195,22 @@ vi.mock('@lobehub/ui', () => ({
}));
vi.mock('@lobehub/ui/base-ui', () => ({
+ Alert: ({
+ description,
+ message,
+ style,
+ title,
+ }: {
+ description?: ReactNode;
+ message?: ReactNode;
+ style?: React.CSSProperties;
+ title?: ReactNode;
+ }) => (
+ <div data-testid="channel-paid-alert" style={style}>
+ <div data-testid="channel-paid-alert-title">{title || message}</div>
+ <div data-testid="channel-paid-alert-description">{description}</div>
+ </div>
+ ),
Button: ({
children,
disabled,
diff --git a/src/routes/(main)/agent/channel/platform/wechat/QrCodeAuth.tsx b/src/routes/(main)/agent/channel/platform/wechat/QrCodeAuth.tsx
index 97f409f9665..eb7eb0ca800 100644
--- a/src/routes/(main)/agent/channel/platform/wechat/QrCodeAuth.tsx
+++ b/src/routes/(main)/agent/channel/platform/wechat/QrCodeAuth.tsx
@@ -1,9 +1,8 @@
'use client';
import { InfoCircleOutlined } from '@ant-design/icons';
-import { Alert, Flexbox, Text } from '@lobehub/ui';
-import type { ButtonProps } from '@lobehub/ui/base-ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox, Text } from '@lobehub/ui';
+import { Alert, Button, type ButtonProps } from '@lobehub/ui/base-ui';
import { QRCode } from 'antd';
import { createStaticStyles } from 'antd-style';
import { QrCode, RefreshCw } from 'lucide-react';
diff --git a/src/routes/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx b/src/routes/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
index 0f7e63b9d2b..d7c32fe5796 100644
--- a/src/routes/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
+++ b/src/routes/(main)/agent/features/Conversation/AgentWelcome/ToolAuthAlert.tsx
@@ -2,8 +2,8 @@
import { type ComposioAppType } from '@lobechat/const';
import { COMPOSIO_APP_TYPES } from '@lobechat/const';
-import { ActionIcon, Alert, Avatar, Flexbox, Icon, Text } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { ActionIcon, Avatar, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { Divider } from 'antd';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import isEqual from 'fast-deep-equal';
diff --git a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx
index 7a9a9b78e97..8c25a813005 100644
--- a/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx
+++ b/src/routes/(main)/agent/features/Conversation/HeterogeneousChatInput/index.tsx
@@ -3,8 +3,8 @@
import { HETEROGENEOUS_TYPE_LABELS } from '@lobechat/heterogeneous-agents';
import { isHeteroSelectorAvailable } from '@lobechat/types';
import { type ChatInputActionsProps } from '@lobehub/editor/react';
-import { Alert, Flexbox } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox } from '@lobehub/ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { memo, type ReactNode, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/agent/features/Conversation/MainChatInput/AgentConfigError.tsx b/src/routes/(main)/agent/features/Conversation/MainChatInput/AgentConfigError.tsx
index 54746715865..97ef3274cca 100644
--- a/src/routes/(main)/agent/features/Conversation/MainChatInput/AgentConfigError.tsx
+++ b/src/routes/(main)/agent/features/Conversation/MainChatInput/AgentConfigError.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Alert } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Alert, Button } from '@lobehub/ui/base-ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/community/(detail)/mcp/features/Sidebar/ConnectionTypeAlert.tsx b/src/routes/(main)/community/(detail)/mcp/features/Sidebar/ConnectionTypeAlert.tsx
index c125b1edb3f..dbbde212fa2 100644
--- a/src/routes/(main)/community/(detail)/mcp/features/Sidebar/ConnectionTypeAlert.tsx
+++ b/src/routes/(main)/community/(detail)/mcp/features/Sidebar/ConnectionTypeAlert.tsx
@@ -1,4 +1,5 @@
-import { Alert, Flexbox, Icon } from '@lobehub/ui';
+import { Flexbox, Icon } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { Blend, Cloud, LaptopMinimalIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/group/profile/features/MemberProfile/index.tsx b/src/routes/(main)/group/profile/features/MemberProfile/index.tsx
index 002774da7e6..cb4447962a9 100644
--- a/src/routes/(main)/group/profile/features/MemberProfile/index.tsx
+++ b/src/routes/(main)/group/profile/features/MemberProfile/index.tsx
@@ -1,7 +1,7 @@
'use client';
-import { Alert, Flexbox, Icon } from '@lobehub/ui';
-import { Button } from '@lobehub/ui/base-ui';
+import { Flexbox, Icon } from '@lobehub/ui';
+import { Alert, 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)/memory/features/MemoryAnalysis/Status.tsx b/src/routes/(main)/memory/features/MemoryAnalysis/Status.tsx
index c63ee3a9b6b..69f6ee3bc6e 100644
--- a/src/routes/(main)/memory/features/MemoryAnalysis/Status.tsx
+++ b/src/routes/(main)/memory/features/MemoryAnalysis/Status.tsx
@@ -1,7 +1,8 @@
'use client';
import { AsyncTaskStatus } from '@lobechat/types';
-import { Alert, Flexbox, Icon, Text } from '@lobehub/ui';
+import { Flexbox, Icon, Text } from '@lobehub/ui';
+import { Alert } from '@lobehub/ui/base-ui';
import { Progress } from 'antd';
import { Loader2Icon, TriangleAlertIcon } from 'lucide-react';
import { memo } from 'react';