feat: 合并代码后 系统设置 ui样式优化、bug修复、全局统一图标对齐等

This commit is contained in:
zhanjunhao
2026-11-10 17:27:36 +08:00
parent 43e7fbc20e
commit 6ea8a0f7c2
195 changed files with 3546 additions and 1984 deletions
+2
View File
@@ -4,6 +4,8 @@
## Ant Design 依赖统一(2026-11-10)
按钮组和操作按钮的通用图标优先使用 `src/components/common/icons/ActionIcons.js`(基于 `@ant-design/icons`,兼容既有 size / color / ref);旧 `components/ui/icons` 已复用该入口。无准确对应项的专业图标及品牌图标保留。按钮内图标与文字整体居中,公共对齐见 `src/styles/action-icons.css`;不改业务回调、权限或加载/禁用条件。本条覆盖旧页面规范中按钮图标沿用 Lucide 的约定,非按钮装饰不批量替换。
通用 UI 使用 `antd`;旧 `src/components/ui` 是 Ant Design 契约适配层,保留值回调、Form API 和分页语义。模型品牌图标使用 `src/assets/brand-icons/` 的固定版本本地 SVG:首页与 `helpers/render.jsx` 只导入 `primitives`,完整变体仍经 `LobeHubIcon` 懒加载;头像容器使用 Ant `Avatar`,主题复用现有 Theme Context。不得重装 `@lobehub/icons`、`@lobehub/ui`、Radix UI、Floating UI、leva、antd-style 或 react-layout-kit。生成资产须通过脚本维护并保留 MIT 许可证及 hash。运行 `npm run check:ui` 检查源码、完整 lock 图和资产 hash;专用图表、流程画布、编辑器与引导保留。方案、风险和验证结果见 `docs/ui/ANTD_UNIFICATION_PLAN.md`;证据仅放忽略目录 `report/ui-unification/`。
## 三中心表格列设置统一(2026-11-07)
+2
View File
@@ -4,6 +4,8 @@
## Ant Design 依赖统一(2026-11-10)
按钮组和操作按钮的通用图标优先使用 `src/components/common/icons/ActionIcons.js`(基于 `@ant-design/icons`,兼容既有 size / color / ref);旧 `components/ui/icons` 已复用该入口。无准确对应项的专业图标及品牌图标保留。按钮内图标与文字整体居中,公共对齐见 `src/styles/action-icons.css`;不改业务回调、权限或加载/禁用条件。本条覆盖旧页面规范中按钮图标沿用 Lucide 的约定,非按钮装饰不批量替换。
通用 UI 使用 `antd`;旧 `src/components/ui` 是 Ant Design 契约适配层,保留值回调、Form API 和分页语义。模型品牌图标使用 `src/assets/brand-icons/` 的固定版本本地 SVG:首页与 `helpers/render.jsx` 只导入 `primitives`,完整变体仍经 `LobeHubIcon` 懒加载;头像容器使用 Ant `Avatar`,主题复用现有 Theme Context。不得重装 `@lobehub/icons`、`@lobehub/ui`、Radix UI、Floating UI、leva、antd-style 或 react-layout-kit。生成资产须通过脚本维护并保留 MIT 许可证及 hash。运行 `npm run check:ui` 检查源码、完整 lock 图和资产 hash;专用图表、流程画布、编辑器与引导保留。方案、风险和验证结果见 `docs/ui/ANTD_UNIFICATION_PLAN.md`;证据仅放忽略目录 `report/ui-unification/`。
## 三中心表格列设置统一(2026-11-07)
+24
View File
@@ -121,3 +121,27 @@
| 差异检查 | `git diff --check` 通过 |
资源控制:重任务串行、单测并发为 1,Node 堆上限 2,944MB;开始前检查 CPU、物理内存及提交空间,CPU 高时延后启动,运行中每约 10 秒采样,低物理内存或提交空间时停止本任务。构建输出至系统临时目录,关闭压缩体积统计;构建进程采样工作集最高 2,475MB,可用物理内存最低 10,646MB,可用提交空间最低 15,944MB,未触发内存停止阈值。测试和浏览器记录的是包装进程工作集,不将其视为整个子进程树的内存峰值;未结束其他任务的进程。
## 10. 操作按钮图标统一(2026-11-10 后续)
按本轮要求,按钮组与操作按钮优先使用 Ant Design 图标,保留没有准确对应项的旧图标。此规则覆盖旧页面规范中按钮图标沿用 Lucide 的约定;导航、说明、品牌、图表和专业功能装饰不进行整库替换,继续保留 Lucide 依赖。
- 新增 `components/common/icons/ActionIcons.js`,使用 `@ant-design/icons` 公共导出,兼容旧 `size` 预设、数字尺寸、颜色、样式、className、DOM ref 和事件;收藏星标仍区分空心与实心,右上箭头保留方向。旧 `components/ui/icons.jsx` 保留原导出名称并接到该入口。将已在 Ant Design 依赖图中的 `@ant-design/icons` 声明为直接依赖,本次没有新增安装包或改变锁定版本。
- 首轮扫描覆盖 188 个文件、576 处按钮图标;459 处直接 Lucide 用法和 97 处旧兼容图标映射到 Ant Design。20 处专业/组合图形保留,例如 Sparkles、ImagePlus、Dices、Wand2、UserCheck、FileUp、Cpu 等,不用语义不符的近似图标替代。比较、实验、清除和侧栏展开分别使用 DiffOutlined、ExperimentOutlined、ClearOutlined、MenuUnfoldOutlined。完整位置清单保存在本地审计记录。
- 补充处理静态扫描不易识别的入口:富文本加粗、斜体、下划线、列表、撤销/重做与清除格式,主题切换的太阳/月亮,模板按钮的图片图标,以及密钥复制按钮的手写剪贴板 SVG。富文本引用和图片加号保留原图标,编辑器实现和命令保持原样。
- `styles/action-icons.css` 统一 Ant 按钮图标容器与旧原生操作按钮的对齐:图标与文字垂直居中,内容组在按钮内水平居中,单图标按钮双向居中。原生按钮默认规则放在 Tailwind components 层,保留页面布局、响应式隐藏及明确的间距;Ant 规则在层外,不新增 `!important` 或颜色值。已有局部 Lucide 尺寸规则同时支持新图标。
- AST 对照覆盖 151 个源码文件:API 调用及按钮处理、禁用、加载、链接与提交属性保持一致;只对新旧图标 JSX 别名做归一化,不放宽请求或回调比较。测试加载器接入实际图标模块;旧图标 ref 测试更新为 Ant/保留图标契约,并修正旧禁用原因测试的翻译插值 mock,保留原因和时间断言。
浏览器使用单个离屏有头 Chrome Context,覆盖 1920×1000 / 393×851 与浅/深色四种组合:136 项按钮几何对齐检查通过,覆盖大小、按钮组、链接、原生/兼容按钮、纯图标、加载、禁用和保留图标;另验证 Tooltip DOM ref、点击回调、收藏切换及实际 Quill 工具栏加粗操作。10 个富文本按钮均居中,其中 8 个使用 Ant 图标。浏览器运行错误与业务写请求均为 0。此为实际组件的隔离验证,不代表真实账号全站像素或业务验收。
本轮不执行生产构建或生产环境测试。快照、脚本、截图、单测/静态检查日志及 CPU/内存采样仅保存在忽略目录 `report/ui-unification/button-icons/`;重任务串行、单测并发 1、Node 堆上限 2,944MB,未结束其他任务进程。
| 检查 | 本轮结果 |
| ------------- | ------------------------------------------------------------------ |
| 全量串行单测 | 662/662 通过,失败、跳过和取消均为 0,约 159 秒 |
| 全仓 ESLint | 0 错误、0 警告,零警告门禁通过 |
| 全仓 Prettier | 所有匹配文件通过 |
| UI 审计 | 源码、完整 lock 图和品牌 SVG 资产 hash 检查通过 |
| 浏览器 | 浅深色 × 桌面/移动端,136 项对齐检查、真实组件交互和富文本加粗通过 |
| 源码契约 | 151 个文件的 API 与操作处理属性对照通过,图标 JSX 别名单独归一化 |
| 差异检查 | `git diff --check` 通过 |
+1
View File
@@ -8,6 +8,7 @@
"name": "react-template",
"version": "0.1.0",
"dependencies": {
"@ant-design/icons": "^5.6.1",
"@dagrejs/dagre": "^1.1.4",
"@visactor/react-vchart": "~1.8.8",
"@visactor/vchart": "~1.8.8",
+3 -2
View File
@@ -4,6 +4,7 @@
"private": true,
"type": "module",
"dependencies": {
"@ant-design/icons": "^5.6.1",
"@dagrejs/dagre": "^1.1.4",
"@visactor/react-vchart": "~1.8.8",
"@visactor/vchart": "~1.8.8",
@@ -82,6 +83,7 @@
"@playwright/test": "^1.64.1",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.21",
"esbuild": "0.21.5",
"eslint": "8.57.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-react": "^7.37.5",
@@ -91,8 +93,7 @@
"postcss": "^8.5.3",
"prettier": "^3.0.0",
"tailwindcss": "^3",
"vite": "5.4.21",
"esbuild": "0.21.5"
"vite": "5.4.21"
},
"proxy": "http://localhost:3000",
"engines": {
@@ -17,15 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { ChevronDown as ActionChevronDown } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { ChevronDown } from 'lucide-react';
import './collapsible-panel.css';
const CollapsibleHeader = ({ icon, title, isOpen, onToggle, extra }) => (
<button
type='button'
aria-expanded={isOpen}
className='w-full text-left flex items-center justify-between gap-2 cursor-pointer select-none px-5 py-4 bg-white dark:bg-gray-800 rounded-xl shadow-sm hover:shadow-md transition-all border border-gray-100 dark:border-gray-700'
className='app-action-button w-full text-left flex items-center justify-between gap-2 cursor-pointer select-none px-5 py-4 bg-white dark:bg-gray-800 rounded-xl shadow-sm hover:shadow-md transition-all border border-gray-100 dark:border-gray-700'
onClick={onToggle}
>
<span className='flex items-center gap-2 min-w-0 flex-wrap'>
@@ -35,7 +35,7 @@ const CollapsibleHeader = ({ icon, title, isOpen, onToggle, extra }) => (
</span>
{extra}
</span>
<ChevronDown
<ActionChevronDown
aria-hidden='true'
className={`w-5 h-5 flex-shrink-0 text-gray-400 transition-transform duration-300 ${isOpen ? 'rotate-180' : ''}`}
/>
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React from 'react';
import {
Button,
@@ -27,7 +28,7 @@ import {
Tag,
Typography,
} from '@/components/ui';
import { ClipboardList, Download } from 'lucide-react';
import { ClipboardList } from 'lucide-react';
import { ChangeText, OrgNameCell, ReasonTags, SectionCard } from './shared';
import {
daysSince,
@@ -471,7 +472,7 @@ export const ActionCenter = ({ lists, activeTab, onTabChange, cny, t }) => (
tabBarExtraContent={
<Button
size='small'
icon={<Download className='w-3.5 h-3.5' />}
icon={<ActionDownload className='w-3.5 h-3.5' />}
disabled={lists[activeTab].length === 0}
onClick={() =>
exportList(activeTab, lists[activeTab], cny, t, lists.atRisk)
@@ -17,13 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Banner, Button, Card, Tag, Tooltip } from '@/components/ui';
import {
AlertOctagon,
AlertTriangle,
CheckCircle2,
Download,
Info,
Lightbulb,
} from 'lucide-react';
@@ -58,7 +58,7 @@ export const ReportHeader = ({ report, onExport, t }) => {
</div>
</div>
<Button
icon={<Download className='w-4 h-4' />}
icon={<ActionDownload className='w-4 h-4' />}
onClick={onExport}
disabled={!report.orgs?.length}
>
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React, { useMemo } from 'react';
import {
Button,
@@ -27,7 +28,7 @@ import {
Tag,
Typography,
} from '@/components/ui';
import { Download, Search, Table2, UserCog } from 'lucide-react';
import { Search, Table2, UserCog } from 'lucide-react';
import { ChangeText, OrgNameCell, SectionCard } from './shared';
import {
ALERT_LEVELS,
@@ -429,7 +430,7 @@ export const OrgDetailTable = ({ report, filter, setFilter, cny, t }) => {
) : null}
<Button
className='ml-auto'
icon={<Download className='w-4 h-4' />}
icon={<ActionDownload className='w-4 h-4' />}
onClick={onExport}
disabled={rows.length === 0}
>
@@ -16,6 +16,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { MessageCircle as ActionMessageCircle } from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect } from 'react';
import { Avatar } from '@/components/ui';
import { MessageCircle, ScanLine } from 'lucide-react';
@@ -177,9 +178,9 @@ const AuthCustomerServiceFloat = () => {
) : agent.wecom_url ? (
<button
onClick={() => window.open(agent.wecom_url, '_blank')}
className='w-full flex items-center justify-center gap-1.5 px-3 py-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white text-xs font-medium rounded-lg transition-colors'
className='app-action-button w-full flex items-center justify-center gap-1.5 px-3 py-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white text-xs font-medium rounded-lg transition-colors'
>
<MessageCircle size={12} />
<ActionMessageCircle size={12} />
{t('联系客服')}
</button>
) : null}
+5 -4
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { ArrowRight as ActionArrowRight } from '@/components/common/icons/ActionIcons';
import React, {
useContext,
useEffect,
@@ -66,7 +67,7 @@ import DiscordIcon from '../common/logo/DiscordIcon';
import TwoFAVerification from './TwoFAVerification';
import { useTranslation } from 'react-i18next';
import AuthBackground from '../common/AuthBackground';
import { ArrowRight, Shield, Smartphone, QrCode } from 'lucide-react';
import { Shield, Smartphone, QrCode } from 'lucide-react';
import GlassCard from './GlassCard';
import AuthCardHeader from './AuthCardHeader';
import AuthLoginTabs from './AuthLoginTabs';
@@ -741,7 +742,7 @@ const LoginForm = () => {
{/* 邮箱登录按钮 */}
<button
onClick={handleEmailLoginClick}
className='group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 overflow-hidden'
className='app-action-button group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 overflow-hidden'
>
{/* 闪光效果 */}
<div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' />
@@ -750,7 +751,7 @@ const LoginForm = () => {
<span className='relative z-10 font-medium text-sm'>
{t('邮箱/用户名 登录')}
</span>
<ArrowRight
<ActionArrowRight
size={16}
className='relative z-10 group-hover:translate-x-1 transition-transform'
/>
@@ -946,7 +947,7 @@ const LoginForm = () => {
className='auth-login-submit'
>
<span className='font-semibold'>{t('登 录')}</span>
<ArrowRight size={16} />
<ActionArrowRight size={16} />
</Button>
<Button
+8 -3
View File
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Button, Toast, Banner } from '@/components/ui';
import { Copy } from 'lucide-react';
import { copy as copyText } from '../../helpers/utils';
/**
@@ -69,7 +69,7 @@ const OrgCredentialResult = ({ creds, onLogin }) => {
<Button
size='small'
theme='borderless'
icon={<Copy size={14} />}
icon={<ActionCopy size={14} />}
onClick={() => copy(value)}
aria-label={t('复制')}
/>
@@ -98,7 +98,12 @@ const OrgCredentialResult = ({ creds, onLogin }) => {
<Row label={t('登录名')} value={creds.owner_login_name} mono />
<Row label={t('初始密码')} value={creds.initial_password} mono />
</div>
<Button size='large' block icon={<Copy size={14} />} onClick={copyAll}>
<Button
size='large'
block
icon={<ActionCopy size={14} />}
onClick={copyAll}
>
{t('复制全部凭证')}
</Button>
{onLogin && (
+6 -5
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { ArrowRight as ActionArrowRight } from '@/components/common/icons/ActionIcons';
import React, {
useContext,
useEffect,
@@ -64,7 +65,7 @@ import AuthBackground from '../common/AuthBackground';
import GlassCard from './GlassCard';
import AuthCardHeader from './AuthCardHeader';
import AuthLoginTabs from './AuthLoginTabs';
import { ArrowRight, Shield, Smartphone, QrCode } from 'lucide-react';
import { Shield, Smartphone, QrCode } from 'lucide-react';
import AgreementModal from '../common/DocumentRenderer/AgreementModal';
import {
isMiniProgramWebView,
@@ -606,7 +607,7 @@ const RegisterForm = () => {
<button
onClick={handleEmailRegisterClick}
disabled={emailRegisterLoading}
className='group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 overflow-hidden'
className='app-action-button group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 overflow-hidden'
>
{/* 闪光效果 */}
<div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' />
@@ -615,7 +616,7 @@ const RegisterForm = () => {
<span className='relative z-10 font-medium text-sm'>
{t('使用 用户名 注册')}
</span>
<ArrowRight
<ActionArrowRight
size={16}
className='relative z-10 group-hover:translate-x-1 transition-transform'
/>
@@ -835,7 +836,7 @@ const RegisterForm = () => {
registerLoading ||
((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms)
}
className='group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to disabled:from-gray-400 disabled:to-gray-500 text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 disabled:cursor-not-allowed disabled:hover:translate-y-0 overflow-hidden'
className='app-action-button group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to disabled:from-gray-400 disabled:to-gray-500 text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 disabled:cursor-not-allowed disabled:hover:translate-y-0 overflow-hidden'
>
{/* 闪光效果 */}
<div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' />
@@ -847,7 +848,7 @@ const RegisterForm = () => {
<span className='relative z-10 font-semibold'>
{t('注 册')}
</span>
<ArrowRight
<ActionArrowRight
size={16}
className='relative z-10 group-hover:translate-x-1 transition-transform'
/>
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { X as ActionX } from '@/components/common/icons/ActionIcons';
import React, { useState, useCallback } from 'react';
import { Modal } from '@/components/ui';
import { X, Shield, Scale, ScrollText, ExternalLink } from 'lucide-react';
import { Shield, Scale, ScrollText, ExternalLink } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import DocumentRenderer from './index';
import { useIsMobile } from '../../../hooks/common/useIsMobile';
@@ -137,10 +138,10 @@ const AgreementModal = ({ visible, type, onClose }) => {
</a>
<button
onClick={onClose}
className='p-1.5 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100/80 dark:hover:bg-gray-800/80 transition-colors'
className='app-action-button p-1.5 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-gray-100/80 dark:hover:bg-gray-800/80 transition-colors'
aria-label={t('关闭')}
>
<X size={16} />
<ActionX size={16} />
</button>
</div>
</div>
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
ChevronUp as ActionChevronUp,
ArrowLeft as ActionArrowLeft,
Printer as ActionPrinter,
} from '@/components/common/icons/ActionIcons';
import { writeClipboardText } from '../../../helpers/clipboard';
import React, { useEffect, useState, useCallback, useRef } from 'react';
import { API, showError } from '../../../helpers';
@@ -26,11 +31,8 @@ import {
Shield,
ScrollText,
ExternalLink,
ChevronUp,
ArrowLeft,
BookOpen,
Scale,
Printer,
} from 'lucide-react';
import { useNavigate, useLocation } from 'react-router-dom';
@@ -509,12 +511,20 @@ const DocumentRenderer = ({
<button
onClick={scrollToTop}
className={`sticky bottom-3 ml-auto block p-2 bg-white/95 dark:bg-gray-800/95 backdrop-blur-md rounded-full shadow-lg border border-gray-200 dark:border-gray-700 hover:shadow-xl hover:-translate-y-0.5 hover:bg-white dark:hover:bg-gray-800 transition-all duration-200 ${
className={[
'app-action-button',
`sticky bottom-3 ml-auto block p-2 bg-white/95 dark:bg-gray-800/95 backdrop-blur-md rounded-full shadow-lg border border-gray-200 dark:border-gray-700 hover:shadow-xl hover:-translate-y-0.5 hover:bg-white dark:hover:bg-gray-800 transition-all duration-200 ${
showBackToTop ? 'opacity-100' : 'opacity-0 pointer-events-none'
}`}
}`,
]
.filter(Boolean)
.join(' ')}
aria-label={t('返回顶部')}
>
<ChevronUp size={16} className='text-gray-600 dark:text-gray-300' />
<ActionChevronUp
size={16}
className='text-gray-600 dark:text-gray-300'
/>
</button>
</div>
);
@@ -549,9 +559,9 @@ const DocumentRenderer = ({
<div className='max-w-3xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between gap-2'>
<button
onClick={smartBack}
className='group inline-flex items-center gap-1.5 px-2.5 py-1.5 -ml-2 text-sm font-medium text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800/80 rounded-md transition-colors shrink-0'
className='app-action-button group inline-flex items-center gap-1.5 px-2.5 py-1.5 -ml-2 text-sm font-medium text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800/80 rounded-md transition-colors shrink-0'
>
<ArrowLeft
<ActionArrowLeft
size={15}
className='transition-transform group-hover:-translate-x-0.5'
/>
@@ -573,11 +583,11 @@ const DocumentRenderer = ({
{/* 打印按钮 */}
<button
onClick={() => window.print()}
className='inline-flex items-center justify-center w-8 h-8 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800/80 rounded-md transition-colors shrink-0'
className='app-action-button inline-flex items-center justify-center w-8 h-8 text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800/80 rounded-md transition-colors shrink-0'
aria-label={t('打印')}
title={t('打印')}
>
<Printer size={15} />
<ActionPrinter size={15} />
</button>
</div>
</header>
@@ -612,9 +622,9 @@ const DocumentRenderer = ({
<div className='mt-8 flex justify-center doc-no-print'>
<button
onClick={smartBack}
className='group inline-flex items-center gap-2 px-5 py-2 text-sm bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800/80 border border-gray-200 dark:border-gray-800 hover:border-gray-300 dark:hover:border-gray-700 rounded-lg text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white shadow-sm transition-all'
className='app-action-button group inline-flex items-center gap-2 px-5 py-2 text-sm bg-white dark:bg-gray-900 hover:bg-gray-50 dark:hover:bg-gray-800/80 border border-gray-200 dark:border-gray-800 hover:border-gray-300 dark:hover:border-gray-700 rounded-lg text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white shadow-sm transition-all'
>
<ArrowLeft
<ActionArrowLeft
size={14}
className='transition-transform group-hover:-translate-x-0.5'
/>
@@ -627,14 +637,22 @@ const DocumentRenderer = ({
{/* 返回顶部 FAB */}
<button
onClick={scrollToTop}
className={`fixed bottom-6 right-6 z-50 p-2.5 bg-white/95 dark:bg-gray-800/95 backdrop-blur-md rounded-full shadow-lg border border-gray-200 dark:border-gray-700 hover:shadow-xl hover:-translate-y-0.5 hover:bg-white dark:hover:bg-gray-800 transition-all duration-200 doc-no-print ${
className={[
'app-action-button',
`fixed bottom-6 right-6 z-50 p-2.5 bg-white/95 dark:bg-gray-800/95 backdrop-blur-md rounded-full shadow-lg border border-gray-200 dark:border-gray-700 hover:shadow-xl hover:-translate-y-0.5 hover:bg-white dark:hover:bg-gray-800 transition-all duration-200 doc-no-print ${
showBackToTop
? 'opacity-100 translate-y-0'
: 'opacity-0 translate-y-2 pointer-events-none'
}`}
}`,
]
.filter(Boolean)
.join(' ')}
aria-label={t('返回顶部')}
>
<ChevronUp size={18} className='text-gray-600 dark:text-gray-300' />
<ActionChevronUp
size={18}
className='text-gray-600 dark:text-gray-300'
/>
</button>
</div>
);
+16 -12
View File
@@ -30,16 +30,15 @@ For commercial licensing, please contact support@quantumnous.com
* 页面只需 usePageGuide({...配置}) 后把三个组件放到对应位置;
* steps[].done 传布尔值即启用进度跟踪,不传则渲染为纯阅读步骤。
*/
import {
BookOpenText as ActionBookOpenText,
Compass as ActionCompass,
ChevronDown as ActionChevronDown,
} from '@/components/common/icons/ActionIcons';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Button, SideSheet } from '@/components/ui';
import { useTranslation } from 'react-i18next';
import {
BookOpenText,
CheckCircle2,
ChevronDown,
Compass,
Loader2,
} from 'lucide-react';
import { CheckCircle2, Loader2 } from 'lucide-react';
import './page-guide.css';
const seenKey = (guideKey) => `page-guide-seen-${guideKey}`;
@@ -162,7 +161,7 @@ export const PageGuideTrigger = ({ guide, className = '' }) => {
<Button
theme='borderless'
className={`page-guide-trigger ${className}`}
icon={<BookOpenText size={16} />}
icon={<ActionBookOpenText size={16} />}
onClick={() => guide.open()}
>
{t('使用指引')}
@@ -178,10 +177,12 @@ export const PageGuidePill = ({ guide, className = '' }) => {
return (
<button
type='button'
className={`page-guide-pill ${className}`}
className={['app-action-button', `page-guide-pill ${className}`]
.filter(Boolean)
.join(' ')}
onClick={() => guide.open(progress.nextIndex)}
>
<Compass size={14} className='page-guide-pill-icon' />
<ActionCompass size={14} className='page-guide-pill-icon' />
<span className='page-guide-pill-dots' aria-hidden='true'>
{config.steps.map((step, index) => (
<i
@@ -286,7 +287,7 @@ export const PageGuideDrawer = ({ guide }) => {
>
<button
type='button'
className='page-guide-step-head'
className='app-action-button page-guide-step-head'
aria-expanded={isOpen}
aria-controls={isOpen ? detailId : undefined}
onClick={() => setExpanded(isOpen ? -1 : index)}
@@ -313,7 +314,10 @@ export const PageGuideDrawer = ({ guide }) => {
</strong>
{step.detail && <small>{step.detail}</small>}
</span>
<ChevronDown size={15} className='page-guide-step-arrow' />
<ActionChevronDown
size={15}
className='page-guide-step-arrow'
/>
</button>
{isOpen && (
<div className='page-guide-step-detail' id={detailId}>
+606
View File
@@ -0,0 +1,606 @@
/*
Copyright (C) 2025 QuantumNous
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React, { forwardRef } from 'react';
import {
AccountBookOutlined,
DiffOutlined,
ExperimentOutlined,
ClearOutlined,
MenuUnfoldOutlined,
BoldOutlined,
ItalicOutlined,
UnderlineOutlined,
OrderedListOutlined,
SunOutlined,
MoonOutlined,
AppstoreOutlined,
ArrowDownOutlined,
ArrowLeftOutlined,
ArrowRightOutlined,
ArrowUpOutlined,
AudioMutedOutlined,
AudioOutlined,
BankOutlined,
BarChartOutlined,
BellOutlined,
BlockOutlined,
BookOutlined,
BorderOutlined,
CaretRightOutlined,
CheckCircleOutlined,
CheckOutlined,
CheckSquareOutlined,
ClockCircleOutlined,
CloseCircleOutlined,
CloseOutlined,
CloudServerOutlined,
CloudUploadOutlined,
CodeOutlined,
CompassOutlined,
ControlOutlined,
CopyOutlined,
CreditCardOutlined,
CustomerServiceOutlined,
DeleteOutlined,
DislikeOutlined,
DownOutlined,
DownloadOutlined,
EditOutlined,
ExclamationCircleOutlined,
ExpandAltOutlined,
ExportOutlined,
EyeInvisibleOutlined,
EyeOutlined,
FastForwardOutlined,
FieldTimeOutlined,
FileDoneOutlined,
FileOutlined,
FileTextOutlined,
FilterOutlined,
FontSizeOutlined,
GiftOutlined,
GithubOutlined,
GlobalOutlined,
HistoryOutlined,
HomeOutlined,
InfoCircleOutlined,
KeyOutlined,
LayoutOutlined,
LeftOutlined,
LikeOutlined,
LineChartOutlined,
LinkOutlined,
LockOutlined,
MailOutlined,
MenuOutlined,
MessageOutlined,
MinusOutlined,
MoreOutlined,
MutedOutlined,
PaperClipOutlined,
PictureOutlined,
PlayCircleOutlined,
PlusOutlined,
PrinterOutlined,
QuestionCircleOutlined,
ReadOutlined,
RedoOutlined,
ReloadOutlined,
RightOutlined,
RobotOutlined,
RocketOutlined,
SafetyCertificateOutlined,
SafetyOutlined,
SaveOutlined,
ScheduleOutlined,
SearchOutlined,
SendOutlined,
SettingOutlined,
ShareAltOutlined,
SoundOutlined,
StarFilled,
StarOutlined,
StopOutlined,
SwapOutlined,
TeamOutlined,
ThunderboltOutlined,
UndoOutlined,
UnorderedListOutlined,
UpOutlined,
UploadOutlined,
UserAddOutlined,
UserOutlined,
VideoCameraOutlined,
WalletOutlined,
WarningOutlined,
ZoomInOutlined,
ZoomOutOutlined,
} from '@ant-design/icons';
// Keep existing icon props and DOM refs while rendering the Ant Design glyph.
const createActionIcon = (Icon, displayName, options = {}) => {
const Component = forwardRef(function ActionIcon(
{
size,
color,
className = '',
style,
strokeWidth,
absoluteStrokeWidth,
fill,
...props
},
ref,
) {
const fontSize =
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] ?? size;
const Glyph =
fill && fill !== 'none' && options.filled ? options.filled : Icon;
return React.createElement(Glyph, {
...props,
ref,
rotate: props.rotate ?? options.rotate,
className: ['app-action-icon', className].filter(Boolean).join(' '),
style: { fontSize, color, ...style },
});
});
Component.displayName = displayName;
return Component;
};
export const Search = /* @__PURE__ */ createActionIcon(
SearchOutlined,
'Search',
);
export const Plus = /* @__PURE__ */ createActionIcon(PlusOutlined, 'Plus');
export const RefreshCw = /* @__PURE__ */ createActionIcon(
ReloadOutlined,
'RefreshCw',
);
export const RefreshCcw = /* @__PURE__ */ createActionIcon(
ReloadOutlined,
'RefreshCcw',
);
export const RotateCcw = /* @__PURE__ */ createActionIcon(
UndoOutlined,
'RotateCcw',
);
export const RotateCw = /* @__PURE__ */ createActionIcon(
RedoOutlined,
'RotateCw',
);
export const Trash2 = /* @__PURE__ */ createActionIcon(
DeleteOutlined,
'Trash2',
);
export const X = /* @__PURE__ */ createActionIcon(CloseOutlined, 'X');
export const Download = /* @__PURE__ */ createActionIcon(
DownloadOutlined,
'Download',
);
export const Upload = /* @__PURE__ */ createActionIcon(
UploadOutlined,
'Upload',
);
export const Copy = /* @__PURE__ */ createActionIcon(CopyOutlined, 'Copy');
export const ClipboardCopy = /* @__PURE__ */ createActionIcon(
CopyOutlined,
'ClipboardCopy',
);
export const Check = /* @__PURE__ */ createActionIcon(CheckOutlined, 'Check');
export const ChevronDown = /* @__PURE__ */ createActionIcon(
DownOutlined,
'ChevronDown',
);
export const ChevronUp = /* @__PURE__ */ createActionIcon(
UpOutlined,
'ChevronUp',
);
export const ChevronLeft = /* @__PURE__ */ createActionIcon(
LeftOutlined,
'ChevronLeft',
);
export const ChevronRight = /* @__PURE__ */ createActionIcon(
RightOutlined,
'ChevronRight',
);
export const ArrowRight = /* @__PURE__ */ createActionIcon(
ArrowRightOutlined,
'ArrowRight',
);
export const ArrowLeft = /* @__PURE__ */ createActionIcon(
ArrowLeftOutlined,
'ArrowLeft',
);
export const ArrowUp = /* @__PURE__ */ createActionIcon(
ArrowUpOutlined,
'ArrowUp',
);
export const ArrowDown = /* @__PURE__ */ createActionIcon(
ArrowDownOutlined,
'ArrowDown',
);
export const ArrowUpRight = /* @__PURE__ */ createActionIcon(
ArrowUpOutlined,
'ArrowUpRight',
{
rotate: 45,
},
);
export const Eye = /* @__PURE__ */ createActionIcon(EyeOutlined, 'Eye');
export const EyeOff = /* @__PURE__ */ createActionIcon(
EyeInvisibleOutlined,
'EyeOff',
);
export const Save = /* @__PURE__ */ createActionIcon(SaveOutlined, 'Save');
export const ExternalLink = /* @__PURE__ */ createActionIcon(
ExportOutlined,
'ExternalLink',
);
export const Star = /* @__PURE__ */ createActionIcon(StarOutlined, 'Star', {
filled: StarFilled,
});
export const Globe = /* @__PURE__ */ createActionIcon(GlobalOutlined, 'Globe');
export const Pencil = /* @__PURE__ */ createActionIcon(EditOutlined, 'Pencil');
export const Edit = /* @__PURE__ */ createActionIcon(EditOutlined, 'Edit');
export const Wallet = /* @__PURE__ */ createActionIcon(
WalletOutlined,
'Wallet',
);
export const Settings = /* @__PURE__ */ createActionIcon(
SettingOutlined,
'Settings',
);
export const Settings2 = /* @__PURE__ */ createActionIcon(
SettingOutlined,
'Settings2',
);
export const SlidersHorizontal = /* @__PURE__ */ createActionIcon(
ControlOutlined,
'SlidersHorizontal',
);
export const MoreHorizontal = /* @__PURE__ */ createActionIcon(
MoreOutlined,
'MoreHorizontal',
);
export const Ellipsis = /* @__PURE__ */ createActionIcon(
MoreOutlined,
'Ellipsis',
);
export const Zap = /* @__PURE__ */ createActionIcon(ThunderboltOutlined, 'Zap');
export const MessageCircle = /* @__PURE__ */ createActionIcon(
MessageOutlined,
'MessageCircle',
);
export const Send = /* @__PURE__ */ createActionIcon(SendOutlined, 'Send');
export const Ban = /* @__PURE__ */ createActionIcon(StopOutlined, 'Ban');
export const ShieldCheck = /* @__PURE__ */ createActionIcon(
SafetyCertificateOutlined,
'ShieldCheck',
);
export const Shield = /* @__PURE__ */ createActionIcon(
SafetyOutlined,
'Shield',
);
export const Lock = /* @__PURE__ */ createActionIcon(LockOutlined, 'Lock');
export const LockKeyhole = /* @__PURE__ */ createActionIcon(
LockOutlined,
'LockKeyhole',
);
export const History = /* @__PURE__ */ createActionIcon(
HistoryOutlined,
'History',
);
export const Code2 = /* @__PURE__ */ createActionIcon(CodeOutlined, 'Code2');
export const Code = /* @__PURE__ */ createActionIcon(CodeOutlined, 'Code');
export const KeyRound = /* @__PURE__ */ createActionIcon(
KeyOutlined,
'KeyRound',
);
export const Filter = /* @__PURE__ */ createActionIcon(
FilterOutlined,
'Filter',
);
export const Headphones = /* @__PURE__ */ createActionIcon(
CustomerServiceOutlined,
'Headphones',
);
export const Mic = /* @__PURE__ */ createActionIcon(AudioOutlined, 'Mic');
export const MicOff = /* @__PURE__ */ createActionIcon(
AudioMutedOutlined,
'MicOff',
);
export const Square = /* @__PURE__ */ createActionIcon(
BorderOutlined,
'Square',
);
export const CheckCircle2 = /* @__PURE__ */ createActionIcon(
CheckCircleOutlined,
'CheckCircle2',
);
export const CheckCircle = /* @__PURE__ */ createActionIcon(
CheckCircleOutlined,
'CheckCircle',
);
export const CircleCheck = /* @__PURE__ */ createActionIcon(
CheckCircleOutlined,
'CircleCheck',
);
export const LayoutGrid = /* @__PURE__ */ createActionIcon(
AppstoreOutlined,
'LayoutGrid',
);
export const Play = /* @__PURE__ */ createActionIcon(
CaretRightOutlined,
'Play',
);
export const CirclePlay = /* @__PURE__ */ createActionIcon(
PlayCircleOutlined,
'CirclePlay',
);
export const HelpCircle = /* @__PURE__ */ createActionIcon(
QuestionCircleOutlined,
'HelpCircle',
);
export const CircleHelp = /* @__PURE__ */ createActionIcon(
QuestionCircleOutlined,
'CircleHelp',
);
export const AlertCircle = /* @__PURE__ */ createActionIcon(
ExclamationCircleOutlined,
'AlertCircle',
);
export const CircleAlert = /* @__PURE__ */ createActionIcon(
ExclamationCircleOutlined,
'CircleAlert',
);
export const AlertTriangle = /* @__PURE__ */ createActionIcon(
WarningOutlined,
'AlertTriangle',
);
export const TriangleAlert = /* @__PURE__ */ createActionIcon(
WarningOutlined,
'TriangleAlert',
);
export const Layers = /* @__PURE__ */ createActionIcon(BlockOutlined, 'Layers');
export const UserPlus = /* @__PURE__ */ createActionIcon(
UserAddOutlined,
'UserPlus',
);
export const UserRound = /* @__PURE__ */ createActionIcon(
UserOutlined,
'UserRound',
);
export const User = /* @__PURE__ */ createActionIcon(UserOutlined, 'User');
export const Users = /* @__PURE__ */ createActionIcon(TeamOutlined, 'Users');
export const Printer = /* @__PURE__ */ createActionIcon(
PrinterOutlined,
'Printer',
);
export const Paperclip = /* @__PURE__ */ createActionIcon(
PaperClipOutlined,
'Paperclip',
);
export const ZoomOut = /* @__PURE__ */ createActionIcon(
ZoomOutOutlined,
'ZoomOut',
);
export const ZoomIn = /* @__PURE__ */ createActionIcon(
ZoomInOutlined,
'ZoomIn',
);
export const FileText = /* @__PURE__ */ createActionIcon(
FileTextOutlined,
'FileText',
);
export const File = /* @__PURE__ */ createActionIcon(FileOutlined, 'File');
export const FastForward = /* @__PURE__ */ createActionIcon(
FastForwardOutlined,
'FastForward',
);
export const Volume1 = /* @__PURE__ */ createActionIcon(
SoundOutlined,
'Volume1',
);
export const Volume2 = /* @__PURE__ */ createActionIcon(
SoundOutlined,
'Volume2',
);
export const VolumeX = /* @__PURE__ */ createActionIcon(
MutedOutlined,
'VolumeX',
);
export const Receipt = /* @__PURE__ */ createActionIcon(
AccountBookOutlined,
'Receipt',
);
export const ReceiptText = /* @__PURE__ */ createActionIcon(
AccountBookOutlined,
'ReceiptText',
);
export const BarChart3 = /* @__PURE__ */ createActionIcon(
BarChartOutlined,
'BarChart3',
);
export const ChartColumn = /* @__PURE__ */ createActionIcon(
BarChartOutlined,
'ChartColumn',
);
export const ChartLine = /* @__PURE__ */ createActionIcon(
LineChartOutlined,
'ChartLine',
);
export const Bell = /* @__PURE__ */ createActionIcon(BellOutlined, 'Bell');
export const Bot = /* @__PURE__ */ createActionIcon(RobotOutlined, 'Bot');
export const ThumbsUp = /* @__PURE__ */ createActionIcon(
LikeOutlined,
'ThumbsUp',
);
export const ThumbsDown = /* @__PURE__ */ createActionIcon(
DislikeOutlined,
'ThumbsDown',
);
export const Rows = /* @__PURE__ */ createActionIcon(
UnorderedListOutlined,
'Rows',
);
export const Layout = /* @__PURE__ */ createActionIcon(
LayoutOutlined,
'Layout',
);
export const Image = /* @__PURE__ */ createActionIcon(PictureOutlined, 'Image');
export const Share2 = /* @__PURE__ */ createActionIcon(
ShareAltOutlined,
'Share2',
);
export const Rocket = /* @__PURE__ */ createActionIcon(
RocketOutlined,
'Rocket',
);
export const BookOpen = /* @__PURE__ */ createActionIcon(
ReadOutlined,
'BookOpen',
);
export const BookOpenText = /* @__PURE__ */ createActionIcon(
ReadOutlined,
'BookOpenText',
);
export const Menu = /* @__PURE__ */ createActionIcon(MenuOutlined, 'Menu');
export const UploadCloud = /* @__PURE__ */ createActionIcon(
CloudUploadOutlined,
'UploadCloud',
);
export const Building2 = /* @__PURE__ */ createActionIcon(
BankOutlined,
'Building2',
);
export const FileCheck2 = /* @__PURE__ */ createActionIcon(
FileDoneOutlined,
'FileCheck2',
);
export const OctagonX = /* @__PURE__ */ createActionIcon(
CloseCircleOutlined,
'OctagonX',
);
export const Home = /* @__PURE__ */ createActionIcon(HomeOutlined, 'Home');
export const ArrowRightLeft = /* @__PURE__ */ createActionIcon(
SwapOutlined,
'ArrowRightLeft',
);
export const Maximize2 = /* @__PURE__ */ createActionIcon(
ExpandAltOutlined,
'Maximize2',
);
export const CheckSquare = /* @__PURE__ */ createActionIcon(
CheckSquareOutlined,
'CheckSquare',
);
export const ListFilter = /* @__PURE__ */ createActionIcon(
FilterOutlined,
'ListFilter',
);
export const CalendarClock = /* @__PURE__ */ createActionIcon(
ScheduleOutlined,
'CalendarClock',
);
export const CreditCard = /* @__PURE__ */ createActionIcon(
CreditCardOutlined,
'CreditCard',
);
export const Link = /* @__PURE__ */ createActionIcon(LinkOutlined, 'Link');
export const Mail = /* @__PURE__ */ createActionIcon(MailOutlined, 'Mail');
export const Github = /* @__PURE__ */ createActionIcon(
GithubOutlined,
'Github',
);
export const Gift = /* @__PURE__ */ createActionIcon(GiftOutlined, 'Gift');
export const Minus = /* @__PURE__ */ createActionIcon(MinusOutlined, 'Minus');
export const Video = /* @__PURE__ */ createActionIcon(
VideoCameraOutlined,
'Video',
);
export const Server = /* @__PURE__ */ createActionIcon(
CloudServerOutlined,
'Server',
);
export const Bookmark = /* @__PURE__ */ createActionIcon(
BookOutlined,
'Bookmark',
);
export const Info = /* @__PURE__ */ createActionIcon(
InfoCircleOutlined,
'Info',
);
export const Timer = /* @__PURE__ */ createActionIcon(
FieldTimeOutlined,
'Timer',
);
export const Type = /* @__PURE__ */ createActionIcon(FontSizeOutlined, 'Type');
export const Clock = /* @__PURE__ */ createActionIcon(
ClockCircleOutlined,
'Clock',
);
export const Compass = /* @__PURE__ */ createActionIcon(
CompassOutlined,
'Compass',
);
// Keep composite upload/user-check and heartbeat glyphs without an exact Ant equivalent.
export { Activity, FileUp, UserCheck } from 'lucide-react';
export const Bold = /* @__PURE__ */ createActionIcon(BoldOutlined, 'Bold');
export const Italic = /* @__PURE__ */ createActionIcon(
ItalicOutlined,
'Italic',
);
export const Underline = /* @__PURE__ */ createActionIcon(
UnderlineOutlined,
'Underline',
);
export const List = /* @__PURE__ */ createActionIcon(
UnorderedListOutlined,
'List',
);
export const ListOrdered = /* @__PURE__ */ createActionIcon(
OrderedListOutlined,
'ListOrdered',
);
export const Undo2 = /* @__PURE__ */ createActionIcon(UndoOutlined, 'Undo2');
export const Redo2 = /* @__PURE__ */ createActionIcon(RedoOutlined, 'Redo2');
export const Sun = /* @__PURE__ */ createActionIcon(SunOutlined, 'Sun');
export const Moon = /* @__PURE__ */ createActionIcon(MoonOutlined, 'Moon');
export const GitCompare = /* @__PURE__ */ createActionIcon(
DiffOutlined,
'GitCompare',
);
export const TestTube2 = /* @__PURE__ */ createActionIcon(
ExperimentOutlined,
'TestTube2',
);
export const Eraser = /* @__PURE__ */ createActionIcon(ClearOutlined, 'Eraser');
export const PanelLeftOpen = /* @__PURE__ */ createActionIcon(
MenuUnfoldOutlined,
'PanelLeftOpen',
);
export const LayoutTemplate = /* @__PURE__ */ createActionIcon(
LayoutOutlined,
'LayoutTemplate',
);
@@ -16,18 +16,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
X as ActionX,
ArrowRight as ActionArrowRight,
} from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Modal, Button, Typography } from '@/components/ui';
import { useTranslation } from 'react-i18next';
import {
Gift,
ArrowRight,
Sparkles,
X,
Wallet,
KeyRound,
Star,
} from 'lucide-react';
import { Gift, Sparkles, Wallet, KeyRound, Star } from 'lucide-react';
import { renderQuota } from '../../../helpers';
const { Text } = Typography;
@@ -65,10 +61,10 @@ const NewUserGiftModal = ({ visible, onClose, quota }) => {
{/* 关闭按钮 */}
<button
onClick={onClose}
className='absolute top-3.5 right-3.5 z-20 w-7 h-7 rounded-full bg-white/20 hover:bg-white/35 flex items-center justify-center transition-colors duration-150'
className='app-action-button absolute top-3.5 right-3.5 z-20 w-7 h-7 rounded-full bg-white/20 hover:bg-white/35 flex items-center justify-center transition-colors duration-150'
aria-label={t('关闭')}
>
<X size={14} className='text-white' />
<ActionX size={14} className='text-white' />
</button>
{/* 头部 */}
@@ -158,7 +154,7 @@ const NewUserGiftModal = ({ visible, onClose, quota }) => {
>
<span className='flex items-center justify-center gap-2 text-white'>
{t('马上试一试')}
<ArrowRight size={16} />
<ActionArrowRight size={16} />
</span>
</Button>
<p className='text-gray-400 dark:text-gray-500 text-xs text-center mt-2.5 leading-relaxed'>
@@ -17,6 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
X as ActionX,
ChevronRight as ActionChevronRight,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useContext } from 'react';
import { Modal, RadioGroup, Radio, Button, Typography } from '@/components/ui';
import { useTranslation } from 'react-i18next';
@@ -28,15 +32,7 @@ import {
showError,
showWarning,
} from '../../../helpers';
import {
Sparkles,
Briefcase,
Cpu,
ChevronRight,
UserCircle,
X,
LogOut,
} from 'lucide-react';
import { Sparkles, Briefcase, Cpu, UserCircle, LogOut } from 'lucide-react';
import { UserContext } from '../../../context/User';
const { Title, Text } = Typography;
@@ -148,10 +144,10 @@ const UserSurveyModal = ({ visible, onClose, onSuccess }) => {
{/* 关闭按钮 */}
<button
onClick={handleCloseClick}
className='absolute top-4 right-4 z-10 p-2 rounded-full bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 transition-colors duration-200 group'
className='app-action-button absolute top-4 right-4 z-10 p-2 rounded-full bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600 transition-colors duration-200 group'
title={t('暂不填写')}
>
<X
<ActionX
size={18}
className='text-gray-500 dark:text-gray-400 group-hover:text-gray-700 dark:group-hover:text-gray-200'
/>
@@ -326,7 +322,7 @@ const UserSurveyModal = ({ visible, onClose, onSuccess }) => {
>
<span className='flex items-center justify-center gap-2'>
{t('开始使用')}
<ChevronRight size={18} />
<ActionChevronRight size={18} />
</span>
</Button>
</div>
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Settings as ActionSettings } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react';
import { Alert, Button, Checkbox, Modal, Tooltip, theme } from 'antd';
import { Settings } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import './column-settings.css';
@@ -53,7 +53,7 @@ export function ColumnSettingsButton({ onClick, open = false }) {
aria-label={t('列设置')}
aria-haspopup='dialog'
aria-expanded={open}
icon={<Settings size={16} />}
icon={<ActionSettings size={16} />}
onClick={onClick}
/>
</Tooltip>
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Search as ActionSearch } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button } from 'antd';
import { Search } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import './filter-search-button.css';
@@ -37,7 +37,7 @@ export default function FilterSearchButton({
onClick={onClick}
size='middle'
loading={loading}
icon={<Search size={14} />}
icon={<ActionSearch size={14} />}
>
{t('搜索')}
</Button>
@@ -10,7 +10,7 @@
justify-content: center;
}
.console-page .filter-search-button .lucide {
.console-page .filter-search-button :is(.lucide, .app-action-icon) {
display: block;
width: 14px;
height: 14px;
+2 -10
View File
@@ -21,6 +21,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { Card, Button, Typography, Tag } from '@/components/ui';
import { copy, showError, showSuccess } from '../../../helpers';
import { Copy } from '../icons/ActionIcons';
/**
* 解析密钥数据,支持多种格式
@@ -175,16 +176,7 @@ const ChannelKeyDisplay = ({
size='small'
type='primary'
theme='outline'
icon={
<svg
className='w-3 h-3'
fill='currentColor'
viewBox='0 0 20 20'
>
<path d='M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z' />
<path d='M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z' />
</svg>
}
icon={<Copy size={12} />}
onClick={() => handleCopyKey(keyItem.content)}
>
{t('复制')}
+3 -3
View File
@@ -31,12 +31,11 @@ import {
Underline,
List,
ListOrdered,
Quote,
Undo2,
Redo2,
Eraser,
ImagePlus,
} from 'lucide-react';
} from '../icons/ActionIcons';
import { Quote, ImagePlus } from 'lucide-react';
import {
articleImageSource,
ARTICLE_IMAGE_TYPES,
@@ -470,6 +469,7 @@ export default function RichTextEditor({
</button>
))}
<button
className='app-action-button'
type='button'
title='插入正文图片(单张不超过 2 MB)'
aria-label='插入正文图片'
@@ -25,13 +25,41 @@ import './module-alignment.css';
// Labels belong to the module; this wrapper only supplies the shared layout.
export function ConsoleFilterField({ label, children }) {
const id = useId();
const generatedId = useId();
const isElement = React.isValidElement(children);
const isGroup =
!isElement ||
children.type === React.Fragment ||
(typeof children.type === 'string' &&
![
'input',
'select',
'textarea',
'button',
'meter',
'output',
'progress',
].includes(children.type));
const id = (isElement && children.props.id) || generatedId;
// Composite filters need a group name, not a label pointing at a container.
if (isGroup) {
return (
<div
className='console-module-field'
role='group'
aria-labelledby={generatedId}
>
<span className='console-module-field-label' id={generatedId}>
{label}
</span>
{children}
</div>
);
}
return (
<div className='console-module-field'>
<label htmlFor={id}>{label}</label>
{React.isValidElement(children)
? React.cloneElement(children, { id })
: children}
{React.cloneElement(children, { id })}
</div>
);
}
+13 -3
View File
@@ -31,6 +31,7 @@ import {
theme,
} from 'antd';
import { useTranslation } from 'react-i18next';
import TableEmpty from '../common/table/TableEmpty';
import {
ConsoleSearchContext,
useConsolePage,
@@ -41,13 +42,17 @@ const classes = (base, extra) => [base, extra].filter(Boolean).join(' ');
export function ConsoleAlert({ className, style, type = 'info', ...props }) {
const { token } = theme.useToken();
const semantic = type[0].toUpperCase() + type.slice(1);
const isSettings = useConsolePage()?.page.key === 'setting';
const semantic = isSettings ? 'Info' : type[0].toUpperCase() + type.slice(1);
return (
<Alert
{...props}
type={type}
showIcon
className={classes('console-alert', className)}
className={classes(
isSettings ? 'console-alert console-alert--settings' : 'console-alert',
className,
)}
style={{
...style,
marginBlock: style?.marginBlock ?? '0 16px',
@@ -56,6 +61,9 @@ export function ConsoleAlert({ className, style, type = 'info', ...props }) {
background: token[`color${semantic}Bg`],
borderColor: token[`color${semantic}Border`],
color: token.colorText,
...(isSettings
? { '--settings-alert-icon-color': token.colorInfo }
: {}),
}}
/>
);
@@ -135,15 +143,17 @@ export const ConsoleTable = forwardRef(function ConsoleTable(
{ className, scroll, locale, size = 'middle', ...props },
ref,
) {
const isSettings = useConsolePage()?.page.key === 'setting';
return (
<Table
{...props}
ref={ref}
size={size}
size={isSettings ? 'middle' : size}
scroll={{ x: 'max-content', ...scroll }}
locale={{
emptyText: <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />,
...locale,
...(isSettings ? { emptyText: <TableEmpty /> } : {}),
}}
className={classes('console-table', className)}
/>
+1 -1
View File
@@ -244,7 +244,7 @@
margin-bottom: var(--console-space-2);
}
.console-page .ant-tabs-tab .lucide,
.console-page .ant-btn .lucide {
.console-page .ant-btn :is(.lucide, .app-action-icon) {
width: 16px;
height: 16px;
}
+4 -2
View File
@@ -14,12 +14,14 @@
}
.console-page .console-module-filter-grid .ant-form-item-label > label,
.console-module-field > label {
.console-module-field > label,
.console-module-field-label {
color: var(--console-muted);
font-size: 13px;
}
.console-module-field > label {
.console-module-field > label,
.console-module-field-label {
display: block;
margin-bottom: 8px;
line-height: 22px;
+60 -37
View File
@@ -17,6 +17,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { LayoutTemplate as ActionLayoutTemplate } from '@/components/common/icons/ActionIcons';
import { Image as TemplateImageIcon } from '@/components/common/icons/ActionIcons';
import {
ChevronDown as ActionChevronDown,
Lock as ActionLock,
Wallet as ActionWallet,
ChevronUp as ActionChevronUp,
ArrowLeft as ActionArrowLeft,
Settings2 as ActionSettings2,
History as ActionHistory,
MoreHorizontal as ActionMoreHorizontal,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, {
useCallback,
useContext,
@@ -38,23 +51,13 @@ import {
} from '@/components/ui';
import {
AlertCircle,
ArrowLeft,
Bell,
BellOff,
ChevronDown,
ChevronUp,
Clapperboard,
History,
ImageIcon,
ImagePlus,
LayoutTemplate,
Lock,
MoreHorizontal,
Settings2,
Sparkles,
Wand2,
Wallet,
X,
} from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
@@ -330,7 +333,12 @@ const ParamChip = ({
trigger={
<button
type='button'
className={`cs-chip cs-param-chip${open ? ' is-active' : ''}`}
className={[
'app-action-button',
`cs-chip cs-param-chip${open ? ' is-active' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-haspopup='dialog'
aria-expanded={open}
aria-label={`${label}:${text}`}
@@ -338,7 +346,7 @@ const ParamChip = ({
onClick={() => setOpen((v) => !v)}
>
<span className='cs-chip-text'>{text}</span>
<ChevronDown size={12} aria-hidden />
<ActionChevronDown size={12} aria-hidden />
</button>
}
>
@@ -369,7 +377,7 @@ const TemplatePicker = ({ kind, isMobile, onApply }) => {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
const list = useMemo(() => templatesOf(kind), [kind]);
const Icon = kind === 'video' ? Clapperboard : ImageIcon;
const Icon = kind === 'video' ? Clapperboard : TemplateImageIcon;
if (!list.length) return null;
return (
<DockPopover
@@ -382,12 +390,17 @@ const TemplatePicker = ({ kind, isMobile, onApply }) => {
trigger={
<button
type='button'
className={`cs-chip cs-tool${open ? ' is-active' : ''}`}
className={[
'app-action-button',
`cs-chip cs-tool${open ? ' is-active' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-haspopup='dialog'
aria-expanded={open}
onClick={() => setOpen((v) => !v)}
>
<LayoutTemplate size={14} aria-hidden />
<ActionLayoutTemplate size={14} aria-hidden />
<span>{t('模板')}</span>
</button>
}
@@ -1014,7 +1027,7 @@ const CreationDock = ({ form, compare = null }) => {
<Button
type='warning'
theme='solid'
icon={<Lock size={16} aria-hidden />}
icon={<ActionLock size={16} aria-hidden />}
onClick={() => navigate(TOPUP_PATH)}
>
{t('升级')}
@@ -1026,7 +1039,7 @@ const CreationDock = ({ form, compare = null }) => {
<Button
type='warning'
theme='solid'
icon={<Wallet size={16} aria-hidden />}
icon={<ActionWallet size={16} aria-hidden />}
onClick={() => navigate(TOPUP_PATH)}
>
{t('去充值')}
@@ -1088,7 +1101,12 @@ const CreationDock = ({ form, compare = null }) => {
<div className='cs-dock cs-dock--collapsed' ref={dockRef}>
<button
type='button'
className={`cs-collapsed-prompt${prompt ? '' : ' is-placeholder'}`}
className={[
'app-action-button',
`cs-collapsed-prompt${prompt ? '' : ' is-placeholder'}`,
]
.filter(Boolean)
.join(' ')}
data-guide='prompt'
onClick={expand}
aria-label={t('展开创作台')}
@@ -1100,7 +1118,7 @@ const CreationDock = ({ form, compare = null }) => {
? t('描述你想要的画面…')
: t('描述你想要的视频画面与运动…'))}
</span>
<ChevronUp size={14} aria-hidden />
<ActionChevronUp size={14} aria-hidden />
</button>
<div className='cs-collapsed-model'>{modelPicker}</div>
{generateButton(true)}
@@ -1139,14 +1157,14 @@ const CreationDock = ({ form, compare = null }) => {
>
<button
type='button'
className='cs-chip cs-mode-chip'
className='app-action-button cs-chip cs-mode-chip'
aria-haspopup='menu'
aria-label={t('生成模式:{{mode}}', {
mode: t(modeLabels[mode] || mode),
})}
>
<span>{t(modeLabels[mode] || mode)}</span>
<ChevronDown size={12} aria-hidden />
<ActionChevronDown size={12} aria-hidden />
</button>
</Dropdown>
) : modeOptions.length === 1 ? (
@@ -1239,11 +1257,11 @@ const CreationDock = ({ form, compare = null }) => {
<span className='cs-dock-head-title'>{t('创作')}</span>
<button
type='button'
className='cs-icon-btn'
className='app-action-button cs-icon-btn'
onClick={collapse}
aria-label={t('收起创作台')}
>
<ChevronDown size={16} aria-hidden />
<ActionChevronDown size={16} aria-hidden />
</button>
</div>
) : null}
@@ -1294,7 +1312,7 @@ const CreationDock = ({ form, compare = null }) => {
{movable ? (
<button
type='button'
className='cs-slot-move'
className='app-action-button cs-slot-move'
onClick={() =>
handleMoveRef(entry.index, entry.index - 1)
}
@@ -1303,7 +1321,7 @@ const CreationDock = ({ form, compare = null }) => {
})}
title={t('前移')}
>
<ArrowLeft size={12} aria-hidden />
<ActionArrowLeft size={12} aria-hidden />
</button>
) : null}
</div>
@@ -1329,7 +1347,7 @@ const CreationDock = ({ form, compare = null }) => {
<>
<button
type='button'
className='cs-chip cs-tool'
className='app-action-button cs-chip cs-tool'
disabled={localUploadBlocked}
title={uploadBlockedReason || undefined}
onClick={() => addInputRef.current?.click()}
@@ -1431,12 +1449,17 @@ const CreationDock = ({ form, compare = null }) => {
trigger={
<button
type='button'
className={`cs-chip${advancedOpen ? ' is-active' : ''}`}
className={[
'app-action-button',
`cs-chip${advancedOpen ? ' is-active' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-haspopup='dialog'
aria-expanded={advancedOpen}
onClick={() => setAdvancedOpen((v) => !v)}
>
<Settings2 size={14} aria-hidden />
<ActionSettings2 size={14} aria-hidden />
{t('高级')}
</button>
}
@@ -1479,11 +1502,11 @@ const CreationDock = ({ form, compare = null }) => {
>
<button
type='button'
className='cs-chip cs-tool'
className='app-action-button cs-chip cs-tool'
aria-haspopup='menu'
title={t('提示词历史')}
>
<History size={14} aria-hidden />
<ActionHistory size={14} aria-hidden />
<span>{t('历史')}</span>
</button>
</Dropdown>
@@ -1495,7 +1518,7 @@ const CreationDock = ({ form, compare = null }) => {
/>
<button
type='button'
className='cs-chip cs-tool'
className='app-action-button cs-chip cs-tool'
onClick={handleOptimize}
aria-busy={optimizing || undefined}
title={
@@ -1550,12 +1573,12 @@ const CreationDock = ({ form, compare = null }) => {
>
<button
type='button'
className='cs-chip cs-tool cs-icon-chip'
className='app-action-button cs-chip cs-tool cs-icon-chip'
aria-haspopup='menu'
aria-label={t('更多')}
title={t('更多')}
>
<MoreHorizontal size={14} aria-hidden />
<ActionMoreHorizontal size={14} aria-hidden />
{notify.enabled ? (
<span className='cs-dot' aria-hidden />
) : null}
@@ -1593,11 +1616,11 @@ const CreationDock = ({ form, compare = null }) => {
</span>
<button
type='button'
className='cs-icon-btn'
className='app-action-button cs-icon-btn'
onClick={clearAdjustments}
aria-label={t('关闭提示')}
>
<X size={14} aria-hidden />
<ActionX size={14} aria-hidden />
</button>
</div>
) : null}
@@ -1624,11 +1647,11 @@ const CreationDock = ({ form, compare = null }) => {
) : null}
<button
type='button'
className='cs-icon-btn'
className='app-action-button cs-icon-btn'
onClick={clearError}
aria-label={t('关闭提示')}
>
<X size={14} aria-hidden />
<ActionX size={14} aria-hidden />
</button>
</div>
) : null}
@@ -17,9 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Lock as ActionLock,
ChevronDown as ActionChevronDown,
} from '@/components/common/icons/ActionIcons';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { Popover, SideSheet } from '@/components/ui';
import { ChevronDown, Lock } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useIsMobile } from '../../../hooks/common/useIsMobile';
import ModelPickerPanel from './ModelPickerPanel';
@@ -127,16 +130,21 @@ const ModelPicker = ({
<button
ref={triggerRef}
type='button'
className={`mp-trigger${comparing ? ' is-compare' : ''} ${className}`}
className={[
'app-action-button',
`mp-trigger${comparing ? ' is-compare' : ''} ${className}`,
]
.filter(Boolean)
.join(' ')}
aria-haspopup='listbox'
aria-expanded={open}
aria-label={t('选择模型:{{name}}', { name: label })}
disabled={disabled}
onClick={() => setOpen((v) => !v)}
>
{selected?.level_locked ? <Lock size={13} aria-hidden /> : null}
{selected?.level_locked ? <ActionLock size={13} aria-hidden /> : null}
<span className='mp-trigger-name'>{label}</span>
<ChevronDown size={14} aria-hidden className='mp-trigger-caret' />
<ActionChevronDown size={14} aria-hidden className='mp-trigger-caret' />
</button>
);
@@ -17,9 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Code2 as ActionCode2,
ChevronDown as ActionChevronDown,
Copy as ActionCopy,
KeyRound as ActionKeyRound,
} from '@/components/common/icons/ActionIcons';
import React, { useContext, useMemo, useState } from 'react';
import { Button } from '@/components/ui';
import { ChevronDown, Code2, Copy, KeyRound } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { StatusContext } from '../../../context/Status';
@@ -84,15 +89,15 @@ const ApiCodePanel = ({ task }) => {
<section className='wf-api'>
<button
type='button'
className='wf-api-toggle'
className='app-action-button wf-api-toggle'
aria-expanded={open}
aria-controls={panelId}
onClick={toggle}
>
<Code2 size={14} aria-hidden='true' />
<ActionCode2 size={14} aria-hidden='true' />
<span className='wf-api-title'>{t('获取 API 代码')}</span>
<span className='wf-api-badge'>{t('API 同价')}</span>
<ChevronDown
<ActionChevronDown
size={14}
aria-hidden='true'
className={`wf-api-caret${open ? ' is-open' : ''}`}
@@ -125,7 +130,7 @@ const ApiCodePanel = ({ task }) => {
<Button
size='small'
theme='borderless'
icon={<Copy size={12} aria-hidden='true' />}
icon={<ActionCopy size={12} aria-hidden='true' />}
onClick={async () => {
if (await copy(code)) showSuccess(t('已复制'));
}}
@@ -155,7 +160,7 @@ const ApiCodePanel = ({ task }) => {
<Button
size='small'
theme='solid'
icon={<KeyRound size={12} aria-hidden='true' />}
icon={<ActionKeyRound size={12} aria-hidden='true' />}
onClick={() => navigate(KEY_MANAGEMENT_FROM_STUDIO)}
>
{t('创建密钥')}
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { GitCompare as ActionGitCompare } from '@/components/common/icons/ActionIcons';
import {
Star as ActionStar,
Filter as ActionFilter,
} from '@/components/common/icons/ActionIcons';
import React, {
useEffect,
useMemo,
@@ -31,7 +36,7 @@ import {
Select,
SideSheet,
} from '@/components/ui';
import { Filter, GitCompare, Search, Star } from 'lucide-react';
import { Search } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useIsMobile } from '../../../hooks/common/useIsMobile';
import {
@@ -149,7 +154,7 @@ const Controls = ({ kind, api, facets, vertical, input, setInput }) => {
<Button
theme={filters.favoritesOnly ? 'solid' : 'light'}
type={filters.favoritesOnly ? 'warning' : 'tertiary'}
icon={<Star size={14} aria-hidden='true' />}
icon={<ActionStar size={14} aria-hidden='true' />}
aria-pressed={filters.favoritesOnly}
onClick={() => setFilters({ favoritesOnly: !filters.favoritesOnly })}
>
@@ -182,7 +187,7 @@ const FilterBar = ({ kind, api, selecting, onToggleSelecting }) => {
<Button
theme={selecting ? 'solid' : 'light'}
type={selecting ? 'primary' : 'tertiary'}
icon={<GitCompare size={14} aria-hidden='true' />}
icon={<ActionGitCompare size={14} aria-hidden='true' />}
aria-pressed={selecting}
aria-label={t('多选对比')}
title={t('多选对比')}
@@ -240,7 +245,7 @@ const FilterBar = ({ kind, api, selecting, onToggleSelecting }) => {
<Button
theme='light'
type='tertiary'
icon={<Filter size={16} aria-hidden='true' />}
icon={<ActionFilter size={16} aria-hidden='true' />}
aria-label={t('筛选')}
aria-expanded={open}
onClick={() => setOpen((v) => !v)}
+18 -11
View File
@@ -17,17 +17,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
RefreshCw as ActionRefreshCw,
Check as ActionCheck,
Star as ActionStar,
MoreHorizontal as ActionMoreHorizontal,
} from '@/components/common/icons/ActionIcons';
import React, { memo, useEffect, useRef, useState } from 'react';
import { Button, Dropdown } from '@/components/ui';
import {
AlertCircle,
Check,
Clapperboard,
Image as ImageIcon,
LayoutGrid,
MoreHorizontal,
RefreshCw,
Star,
} from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { renderQuota } from '../../../helpers';
@@ -98,7 +100,7 @@ export const ResultImage = ({ task, index, onRefresh, className, alt }) => {
<Button
size='small'
theme='borderless'
icon={<RefreshCw size={12} aria-hidden='true' />}
icon={<ActionRefreshCw size={12} aria-hidden='true' />}
loading={busy}
onClick={(e) => {
e.stopPropagation();
@@ -372,7 +374,7 @@ const WorkCard = ({
>
<button
type='button'
className='wf-media'
className='app-action-button wf-media'
style={{ aspectRatio: String(ratio) }}
onClick={handleMediaClick}
aria-label={mediaLabel}
@@ -402,7 +404,7 @@ const WorkCard = ({
) : null}
{selecting && selectable ? (
<span className='wf-check' aria-hidden='true'>
{selected ? <Check size={14} /> : null}
{selected ? <ActionCheck size={14} /> : null}
</span>
) : null}
</button>
@@ -422,13 +424,18 @@ const WorkCard = ({
{!active ? (
<button
type='button'
className={`wf-icon-btn${task.favorited ? ' is-on' : ''}`}
className={[
'app-action-button',
`wf-icon-btn${task.favorited ? ' is-on' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-pressed={task.favorited}
aria-label={task.favorited ? t('取消收藏') : t('收藏')}
title={task.favorited ? t('取消收藏') : t('收藏')}
onClick={() => onFavorite?.(task)}
>
<Star
<ActionStar
size={15}
aria-hidden='true'
fill={task.favorited ? 'currentColor' : 'none'}
@@ -456,11 +463,11 @@ const WorkCard = ({
>
<button
type='button'
className='wf-icon-btn'
className='app-action-button wf-icon-btn'
aria-label={t('更多操作')}
title={t('更多操作')}
>
<MoreHorizontal size={15} aria-hidden='true' />
<ActionMoreHorizontal size={15} aria-hidden='true' />
</button>
</Dropdown>
) : null}
@@ -17,9 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Star as ActionStar,
Copy as ActionCopy,
} from '@/components/common/icons/ActionIcons';
import React, { useEffect, useRef, useState } from 'react';
import { Button, SideSheet, Spin } from '@/components/ui';
import { Copy, Star } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
import { ERROR_ACTIONS } from '../../../helpers/creationError';
@@ -292,7 +295,7 @@ const WorkDetailDrawer = ({
{!active ? (
<Button
icon={
<Star
<ActionStar
size={14}
aria-hidden='true'
fill={task.favorited ? 'currentColor' : 'none'}
@@ -329,7 +332,7 @@ const WorkDetailDrawer = ({
<Button
size='small'
theme='borderless'
icon={<Copy size={12} aria-hidden='true' />}
icon={<ActionCopy size={12} aria-hidden='true' />}
onClick={async () => {
if (await copy(task.prompt)) showSuccess(t('已复制'));
}}
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Image as TemplateImageIcon } from '@/components/common/icons/ActionIcons';
import React, {
useCallback,
useEffect,
@@ -31,7 +32,6 @@ import {
Dices,
Download,
Film,
ImageIcon,
ImagePlus,
PenLine,
RotateCcw,
@@ -144,7 +144,7 @@ const useNow = (enabled) => {
const TemplateWall = ({ kind, onApply, onStart }) => {
const { t } = useTranslation();
const groups = useMemo(() => templateGroupsOf(kind), [kind]);
const Icon = kind === 'video' ? Clapperboard : ImageIcon;
const Icon = kind === 'video' ? Clapperboard : TemplateImageIcon;
return (
<div className='wf-wall'>
<div className='wf-wall-head'>
+9 -5
View File
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
RotateCcw as ActionRotateCcw,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, { useRef, useState } from 'react';
import { Spin, Tooltip } from '@/components/ui';
import { ImagePlus, RotateCcw, X } from 'lucide-react';
import { ImagePlus } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import './creation-params.css';
@@ -204,13 +208,13 @@ const ImageSlot = ({
{onRetry ? (
<button
type='button'
className='cp-slot-action'
className='app-action-button cp-slot-action'
onClick={(e) => {
e.stopPropagation();
onRetry();
}}
>
<RotateCcw size={14} aria-hidden='true' />
<ActionRotateCcw size={14} aria-hidden='true' />
<span>{t('重试')}</span>
</button>
) : null}
@@ -224,7 +228,7 @@ const ImageSlot = ({
{status !== 'empty' && onRemove && !disabled ? (
<button
type='button'
className='cp-slot-remove'
className='app-action-button cp-slot-remove'
aria-label={t('移除{{label}}', { label: labelText })}
title={t('移除')}
onClick={(e) => {
@@ -232,7 +236,7 @@ const ImageSlot = ({
onRemove();
}}
>
<X size={14} aria-hidden='true' />
<ActionX size={14} aria-hidden='true' />
</button>
) : null}
+1 -1
View File
@@ -81,7 +81,7 @@ const SeedInput = ({ param, value, onChange, disabledReason }) => {
/>
<button
type='button'
className='cp-icon-btn'
className='app-action-button cp-icon-btn'
disabled={disabled}
aria-label={t('随机生成一个种子并锁定')}
title={t('随机生成一个种子并锁定')}
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { MessageCircle as ActionMessageCircle } from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect } from 'react';
import { Avatar, Button } from '@/components/ui';
import {
@@ -213,7 +214,7 @@ const CustomerServiceQRCard = ({ agent }) => {
theme='light'
type='tertiary'
size='small'
icon={<MessageCircle size={12} />}
icon={<ActionMessageCircle size={12} />}
onClick={() => window.open(agent.wecom_url, '_blank')}
className='w-full !rounded-lg mt-2 !text-xs'
>
@@ -234,7 +235,7 @@ const CustomerServiceQRCard = ({ agent }) => {
<Button
theme='solid'
type='primary'
icon={<MessageCircle size={14} />}
icon={<ActionMessageCircle size={14} />}
onClick={() => window.open(agent.wecom_url, '_blank')}
className='w-full !bg-gradient-to-r !from-brand-from !to-brand-to hover:!from-brand-from hover:!to-brand-to !rounded-xl'
>
+19 -14
View File
@@ -16,15 +16,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Headphones as ActionHeadphones,
ChevronLeft as ActionChevronLeft,
ChevronRight as ActionChevronRight,
X as ActionX,
RefreshCw as ActionRefreshCw,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { Avatar, Tag, Spin, Empty, Button, Divider, theme } from 'antd';
import {
X,
RefreshCw,
Headphones,
ChevronLeft,
ChevronRight,
} from 'lucide-react';
import { API } from '../../helpers';
import { getServerURL } from '../../helpers/config';
import { useTranslation } from 'react-i18next';
@@ -287,7 +288,7 @@ const CustomerServiceFloat = () => {
title={t('联系客服')}
aria-label={t('联系客服')}
onClick={handleExpand}
icon={<Headphones size={16} strokeWidth={2} />}
icon={<ActionHeadphones size={16} strokeWidth={2} />}
/>
<Button
className='cs-float-tab-action'
@@ -296,7 +297,7 @@ const CustomerServiceFloat = () => {
aria-label={t('展开')}
aria-expanded={false}
onClick={() => setIsCollapsed(false)}
icon={<ChevronLeft size={16} strokeWidth={2} />}
icon={<ActionChevronLeft size={16} strokeWidth={2} />}
/>
</div>
) : (
@@ -308,7 +309,11 @@ const CustomerServiceFloat = () => {
aria-expanded={true}
onClick={() => setIsCollapsed(true)}
>
<ChevronRight size={16} strokeWidth={2} aria-hidden='true' />
<ActionChevronRight
size={16}
strokeWidth={2}
aria-hidden='true'
/>
</Button>
))}
<div
@@ -326,9 +331,9 @@ const CustomerServiceFloat = () => {
aria-label={isOpen ? t('关闭客服') : t('联系客服')}
icon={
isOpen ? (
<X size={22} strokeWidth={1.5} />
<ActionX size={22} strokeWidth={1.5} />
) : (
<Headphones size={22} strokeWidth={1.5} />
<ActionHeadphones size={22} strokeWidth={1.5} />
)
}
/>
@@ -356,7 +361,7 @@ const CustomerServiceFloat = () => {
className='cs-close-btn'
onClick={handleClose}
aria-label={t('关闭')}
icon={<X size={16} strokeWidth={1.5} />}
icon={<ActionX size={16} strokeWidth={1.5} />}
/>
</div>
</div>
@@ -370,7 +375,7 @@ const CustomerServiceFloat = () => {
<div className='cs-error'>
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={error} />
<Button
icon={<RefreshCw size={14} />}
icon={<ActionRefreshCw size={14} />}
onClick={fetchAllocatedAgent}
>
{t('重新获取')}
+6 -3
View File
@@ -17,9 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Search as ActionSearch,
RefreshCw as ActionRefreshCw,
} from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button } from '@/components/ui';
import { RefreshCw, Search } from 'lucide-react';
const DashboardHeader = ({
getGreeting,
@@ -42,13 +45,13 @@ const DashboardHeader = ({
<div className='flex gap-3'>
<Button
type='tertiary'
icon={<Search size={16} />}
icon={<ActionSearch size={16} />}
onClick={showSearchModal}
className={`bg-green-500 hover:bg-green-600 ${ICON_BUTTON_CLASS}`}
/>
<Button
type='tertiary'
icon={<RefreshCw size={16} />}
icon={<ActionRefreshCw size={16} />}
onClick={refresh}
loading={loading}
className={`bg-blue-500 hover:bg-blue-600 ${ICON_BUTTON_CLASS}`}
+3 -2
View File
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { RefreshCw as ActionRefreshCw } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Card, Button, Spin, Tabs, TabPane, Tag, Empty } from '@/components/ui';
import { Gauge, RefreshCw } from 'lucide-react';
import { Gauge } from 'lucide-react';
import {
IllustrationConstruction,
IllustrationConstructionDark,
@@ -49,7 +50,7 @@ const UptimePanel = ({
{t('服务可用性')}
</div>
<Button
icon={<RefreshCw size={14} />}
icon={<ActionRefreshCw size={14} />}
onClick={loadUptimeData}
loading={uptimeLoading}
size='small'
-1
View File
@@ -80,7 +80,6 @@ const Dashboard = () => {
dashboardData.consumeQuota,
dashboardData.consumeTokens,
dashboardData.times,
dashboardData.trendData,
dashboardData.performanceMetrics,
dashboardData.navigate,
dashboardData.t,
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
X as ActionX,
Search as ActionSearch,
} from '@/components/common/icons/ActionIcons';
import React, { useRef } from 'react';
import { Modal, Form, Button } from '@/components/ui';
import { Filter, Calendar, Clock, User, Search, X } from 'lucide-react';
import { Filter, Calendar, Clock, User } from 'lucide-react';
const SearchModal = ({
searchModalVisible,
@@ -65,7 +69,7 @@ const SearchModal = ({
onClick={handleCloseModal}
className='!rounded-xl !px-5 !h-10 !bg-gray-100 dark:!bg-gray-700 !border-0 hover:!bg-gray-200 dark:hover:!bg-gray-600 !transition-all'
style={{ color: '#4b5563' }}
icon={<X size={16} style={{ color: '#4b5563' }} />}
icon={<ActionX size={16} style={{ color: '#4b5563' }} />}
>
{t('取消')}
</Button>
@@ -74,7 +78,7 @@ const SearchModal = ({
onClick={handleSearchConfirm}
className='!rounded-xl !px-5 !h-10 !bg-gradient-to-r !from-blue-500 !to-brand-to !border-0 hover:!opacity-90 !transition-all !shadow-lg !shadow-blue-500/25'
style={{ color: '#ffffff' }}
icon={<Search size={16} style={{ color: '#ffffff' }} />}
icon={<ActionSearch size={16} style={{ color: '#ffffff' }} />}
>
{t('查询')}
</Button>
+3 -2
View File
@@ -16,9 +16,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { X as ActionX } from '@/components/common/icons/ActionIcons';
import React, { useContext, useMemo, useRef, useState, useEffect } from 'react';
import { StatusContext } from '../../context/Status';
import { Megaphone, X } from 'lucide-react';
import { Megaphone } from 'lucide-react';
import { Button } from 'antd';
import { useTranslation } from 'react-i18next';
import { useMarquee } from '../../hooks/common/useMarquee';
@@ -145,7 +146,7 @@ const Marquee = () => {
size='small'
className='marquee-close flex-shrink-0 ml-4 z-10'
aria-label={t('关闭')}
icon={<X size={14} aria-hidden />}
icon={<ActionX size={14} aria-hidden />}
onClick={dismiss}
/>
</div>
+13 -5
View File
@@ -17,12 +17,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
ChevronDown as ActionChevronDown,
ChevronRight as ActionChevronRight,
ChevronLeft as ActionChevronLeft,
} from '@/components/common/icons/ActionIcons';
import { consoleMenuPaths, getConsoleMenuKeys } from '../console/consoleRoutes';
import React, { useContext, useEffect, useMemo, useState } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { getLucideIcon } from '../../helpers/render';
import { ChevronDown, ChevronLeft, ChevronRight } from 'lucide-react';
import '../../styles/center-layout.css';
import { useSidebarCollapsed } from '../../hooks/common/useSidebarCollapsed';
import { useSidebar } from '../../hooks/common/useSidebar';
@@ -419,7 +423,7 @@ const SiderBar = ({ onNavigate = () => {}, forceExpanded = false }) => {
{!collapsed && (
<button
type='button'
className='ui-org-group-toggle'
className='app-action-button ui-org-group-toggle'
aria-expanded={!foldedGroups.includes(key)}
onClick={() =>
setFoldedGroups((previous) =>
@@ -430,7 +434,7 @@ const SiderBar = ({ onNavigate = () => {}, forceExpanded = false }) => {
}
>
<span>{label}</span>
<ChevronDown
<ActionChevronDown
size={13}
className={foldedGroups.includes(key) ? 'is-folded' : ''}
aria-hidden='true'
@@ -555,11 +559,15 @@ const SiderBar = ({ onNavigate = () => {}, forceExpanded = false }) => {
{!forceExpanded && (
<button
type='button'
className='ui-center-sidebar-collapse'
className='app-action-button ui-center-sidebar-collapse'
onClick={toggleCollapsed}
aria-label={collapsed ? t('展开导航') : t('收起导航')}
>
{collapsed ? <ChevronRight size={16} /> : <ChevronLeft size={16} />}
{collapsed ? (
<ActionChevronRight size={16} />
) : (
<ActionChevronLeft size={16} />
)}
{!collapsed && <span>{t('收起导航')}</span>}
</button>
)}
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Globe as ActionGlobe } from '@/components/common/icons/ActionIcons';
import React, { useEffect, useState } from 'react';
import { Button as AntButton } from 'antd';
import { Dropdown } from '@/components/ui';
import { Globe } from 'lucide-react';
import { CN, GB, JP, KR, TH, VN } from 'country-flag-icons/react/3x2';
import { normalizeLanguage } from '../../../i18n/language';
import { orderEnabledLanguages } from '../../../i18n/catalog';
@@ -80,7 +80,7 @@ const LanguageSelector = ({ currentLang, onLanguageChange, t }) => {
>
<AntButton
type='text'
icon={<Globe size={16} strokeWidth={1.5} aria-hidden />}
icon={<ActionGlobe size={16} strokeWidth={1.5} aria-hidden />}
aria-label={t('common.changeLanguage')}
className='ui-header-icon-action'
/>
@@ -17,10 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Compass as ActionCompass } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { Button, Dropdown } from '@/components/ui';
import { Compass, ExternalLink } from 'lucide-react';
import { ExternalLink } from 'lucide-react';
import { isNavigationPathActive } from '../../console/consoleRoutes';
/**
@@ -138,7 +139,7 @@ const MobileNavMenu = ({ mainNavLinks, userState, t }) => {
aria-label={t('主导航')}
aria-haspopup='menu'
aria-expanded={visible}
icon={<Compass size={16} />}
icon={<ActionCompass size={16} />}
className='!ml-1 !px-2 !h-8 max-w-[9rem] !rounded-xl !text-current hover:!bg-brand/10 dark:hover:!bg-brand/15 hover:!text-brand-deep dark:hover:!text-brand-from !transition-all !duration-200 active:!scale-95 [&_.ant-btn-content]:min-w-0'
>
<span className='ml-1 text-[13px] font-semibold truncate'>
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Volume1 as ActionVolume1 } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Badge, Button, Tooltip } from 'antd';
import { Volume1 } from 'lucide-react';
// 系统公告入口:34px text 按钮、16px 喇叭图标。
// 显隐(rightActions.notifications)、点击(打开 NoticeModal)与未读数均沿用原逻辑。
@@ -30,7 +30,7 @@ const NotificationButton = ({ unreadCount, onNoticeOpen, t }) => (
type='text'
className='ui-header-icon-action'
aria-label={t('系统公告')}
icon={<Volume1 size={16} strokeWidth={1.5} aria-hidden />}
icon={<ActionVolume1 size={16} strokeWidth={1.5} aria-hidden />}
onClick={onNoticeOpen}
/>
</Badge>
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
import React from 'react';
import { Button, Tooltip } from 'antd';
import { Moon, Sun } from 'lucide-react';
import { Moon, Sun } from '../../common/icons/ActionIcons';
import { useActualTheme } from '../../../context/Theme';
const ThemeToggle = ({ onThemeToggle, t }) => {
+3 -2
View File
@@ -17,11 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { ChevronDown as ActionChevronDown } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react';
import { Link, useLocation } from 'react-router-dom';
import { Avatar, Button as AntButton, Dropdown as AntDropdown } from 'antd';
import { Button } from '@/components/ui';
import { ChevronDown, UserRound, KeyRound, LogOut } from 'lucide-react';
import { UserRound, KeyRound, LogOut } from 'lucide-react';
import { getUserAvatarUrl, isAuthPagePath } from '../../../helpers';
import SkeletonWrapper from '../components/SkeletonWrapper';
import { isHeaderModuleEnabled } from '../../../constants/headerNavModules';
@@ -183,7 +184,7 @@ const UserArea = ({
{avatarInitial}
</Avatar>
<span className='ui-header-account-name'>{displayName}</span>
<ChevronDown
<ActionChevronDown
size={10}
strokeWidth={1.5}
aria-hidden
+16 -17
View File
@@ -17,6 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
EyeOff as ActionEyeOff,
Eye as ActionEye,
X as ActionX,
ArrowDown as ActionArrowDown,
} from '@/components/common/icons/ActionIcons';
import React, { useContext } from 'react';
import {
Card,
@@ -31,7 +37,6 @@ import {
import {
MessageSquare,
Eye,
EyeOff,
Sparkles,
Brain,
Code2,
@@ -44,8 +49,6 @@ import {
Layers,
Paintbrush,
Upload,
ArrowDown,
X,
ListChecks,
} from 'lucide-react';
import { useChatScroll } from '../../hooks/playground/useChatScroll';
@@ -597,7 +600,7 @@ const ChatArea = ({
type='button'
onClick={onEnterSelectionMode}
aria-label={t('多选导出')}
className='flex items-center gap-2 cursor-pointer px-4 py-2 rounded-xl bg-white/80 dark:bg-neutral-800/80 backdrop-blur-md border border-gray-200/60 dark:border-neutral-700/60 shadow-[0_2px_8px_rgba(0,0,0,0.04)] hover:shadow-[0_4px_16px_rgba(139,92,246,0.12)] hover:border-brand-from/80 dark:hover:border-brand-deep/60 transition-all duration-300'
className='app-action-button flex items-center gap-2 cursor-pointer px-4 py-2 rounded-xl bg-white/80 dark:bg-neutral-800/80 backdrop-blur-md border border-gray-200/60 dark:border-neutral-700/60 shadow-[0_2px_8px_rgba(0,0,0,0.04)] hover:shadow-[0_4px_16px_rgba(139,92,246,0.12)] hover:border-brand-from/80 dark:hover:border-brand-deep/60 transition-all duration-300'
>
<ListChecks size={14} className='text-brand flex-shrink-0' />
<span className='text-sm font-medium text-gray-700 dark:text-gray-200'>
@@ -626,7 +629,11 @@ const ChatArea = ({
<div className='flex items-center gap-2'>
<Button
icon={
showDebugPanel ? <EyeOff size={14} /> : <Eye size={14} />
showDebugPanel ? (
<ActionEyeOff size={14} />
) : (
<ActionEye size={14} />
)
}
onClick={onToggleDebugPanel}
theme='borderless'
@@ -935,10 +942,10 @@ const ChatArea = ({
<button
type='button'
onClick={() => setLongConvHintDismissed(true)}
className='flex-shrink-0 text-amber-500 hover:text-amber-700 dark:hover:text-amber-300'
className='app-action-button flex-shrink-0 text-amber-500 hover:text-amber-700 dark:hover:text-amber-300'
aria-label={t('关闭提示')}
>
<X size={14} />
<ActionX size={14} />
</button>
</div>
)}
@@ -982,18 +989,10 @@ const ChatArea = ({
type='button'
onClick={() => scrollToBottom()}
style={{ bottom: 'calc(var(--composer-height, 90px) + 14px)' }}
className='
absolute z-30 left-1/2 -translate-x-1/2
flex items-center gap-1.5 px-3 py-1.5 rounded-full
bg-white/95 dark:bg-neutral-800/95 backdrop-blur-sm
border border-gray-200/80 dark:border-neutral-700/80
text-xs font-medium text-gray-700 dark:text-gray-200
shadow-md hover:shadow-lg hover:scale-105 active:scale-95
transition-all duration-200
'
className='app-action-button \n absolute z-30 left-1/2 -translate-x-1/2\n flex items-center gap-1.5 px-3 py-1.5 rounded-full\n bg-white/95 dark:bg-neutral-800/95 backdrop-blur-sm\n border border-gray-200/80 dark:border-neutral-700/80\n text-xs font-medium text-gray-700 dark:text-gray-200\n shadow-md hover:shadow-lg hover:scale-105 active:scale-95\n transition-all duration-200\n '
title={t('回到最新消息')}
>
<ArrowDown size={13} className='text-brand' />
<ActionArrowDown size={13} className='text-brand' />
{t('回到最新')}
</button>
)}
+11 -3
View File
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Copy as ActionCopy,
ChevronUp as ActionChevronUp,
ChevronDown as ActionChevronDown,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useMemo, useCallback } from 'react';
import { Button, Tooltip, Toast } from '@/components/ui';
import { Copy, ChevronDown, ChevronUp } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { copy } from '../../helpers';
@@ -256,7 +260,7 @@ const CodeViewer = ({ content, title, language = 'json' }) => {
>
<Tooltip content={copied ? t('已复制') : t('复制代码')}>
<Button
icon={<Copy size={14} />}
icon={<ActionCopy size={14} />}
onClick={handleCopy}
size='small'
theme='borderless'
@@ -319,7 +323,11 @@ const CodeViewer = ({ content, title, language = 'json' }) => {
<Tooltip content={isExpanded ? t('收起内容') : t('显示完整内容')}>
<Button
icon={
isExpanded ? <ChevronUp size={14} /> : <ChevronDown size={14} />
isExpanded ? (
<ActionChevronUp size={14} />
) : (
<ActionChevronDown size={14} />
)
}
onClick={handleToggleExpand}
size='small'
+11 -5
View File
@@ -17,9 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Settings2 as ActionSettings2,
RotateCcw as ActionRotateCcw,
Download as ActionDownload,
Upload as ActionUpload,
} from '@/components/common/icons/ActionIcons';
import React, { useRef } from 'react';
import { Button, Typography, Toast, Modal, Dropdown } from '@/components/ui';
import { Download, Upload, RotateCcw, Settings2 } from 'lucide-react';
import { Download, Upload, RotateCcw } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import {
exportConfig,
@@ -205,7 +211,7 @@ const ConfigManager = ({
menu={dropdownItems}
>
<Button
icon={<Settings2 size={14} />}
icon={<ActionSettings2 size={14} />}
theme='borderless'
type='tertiary'
size='small'
@@ -233,7 +239,7 @@ const ConfigManager = ({
{getConfigStatus()}
</Typography.Text>
<Button
icon={<RotateCcw size={12} />}
icon={<ActionRotateCcw size={12} />}
size='small'
theme='borderless'
type='danger'
@@ -245,7 +251,7 @@ const ConfigManager = ({
{/* 导出和导入按钮 */}
<div className='flex gap-2'>
<Button
icon={<Download size={12} />}
icon={<ActionDownload size={12} />}
size='small'
theme='solid'
type='primary'
@@ -256,7 +262,7 @@ const ConfigManager = ({
</Button>
<Button
icon={<Upload size={12} />}
icon={<ActionUpload size={12} />}
size='small'
theme='outline'
type='primary'
+71 -34
View File
@@ -17,21 +17,23 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
AlertTriangle as ActionAlertTriangle,
RotateCw as ActionRotateCw,
X as ActionX,
Paperclip as ActionPaperclip,
MicOff as ActionMicOff,
Mic as ActionMic,
Globe as ActionGlobe,
} from '@/components/common/icons/ActionIcons';
import React, { useRef, useEffect, useCallback, useContext } from 'react';
import { Toast, Tooltip, Modal } from '@/components/ui';
import {
Globe,
Paperclip,
X,
FileText,
Image as ImageIcon,
Paintbrush,
RotateCw,
AlertCircle,
AlertTriangle,
Loader2,
Mic,
MicOff,
} from 'lucide-react';
import { useSpeechRecognition } from '../../hooks/playground/useSpeechRecognition';
import { useTranslation } from 'react-i18next';
@@ -242,9 +244,9 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => {
aria-label={t('查看 {{old}} 格式转换说明', {
old: legacyFormat.old,
})}
className='absolute -top-1 -right-1 w-4 h-4 flex items-center justify-center bg-amber-500 rounded-full ring-1 ring-white dark:ring-neutral-900 cursor-pointer hover:bg-amber-600 transition-colors z-10'
className='app-action-button absolute -top-1 -right-1 w-4 h-4 flex items-center justify-center bg-amber-500 rounded-full ring-1 ring-white dark:ring-neutral-900 cursor-pointer hover:bg-amber-600 transition-colors z-10'
>
<AlertTriangle size={9} className='text-white' />
<ActionAlertTriangle size={9} className='text-white' />
</button>
</Tooltip>
)}
@@ -295,10 +297,10 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => {
e.stopPropagation();
onRetry(file.id);
}}
className='w-5 h-5 flex items-center justify-center rounded text-red-500 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors'
className='app-action-button w-5 h-5 flex items-center justify-center rounded text-red-500 hover:bg-red-100 dark:hover:bg-red-900/30 transition-colors'
title={t('重试上传')}
>
<RotateCw size={11} />
<ActionRotateCw size={11} />
</button>
)}
<button
@@ -306,10 +308,10 @@ const AttachmentChip = ({ file, onRemove, onRestore, onRetry, t }) => {
e.stopPropagation();
handleRemoveWithUndo({ file, onRemove, onRestore, t });
}}
className='w-5 h-5 flex items-center justify-center rounded text-gray-400 hover:text-red-500 hover:bg-gray-100 dark:hover:bg-neutral-700 transition-colors'
className='app-action-button w-5 h-5 flex items-center justify-center rounded text-gray-400 hover:text-red-500 hover:bg-gray-100 dark:hover:bg-neutral-700 transition-colors'
title={isUploading ? t('取消上传') : t('移除')}
>
<X size={11} />
<ActionX size={11} />
</button>
</div>
@@ -719,14 +721,19 @@ const CustomInputRender = (props) => {
fileInputRef.current?.click();
}}
disabled={uploadDisabled}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl bg-gray-50 dark:bg-neutral-800 border border-gray-200/60 dark:border-neutral-700/60 transition-all duration-300 flex-shrink-0 ${
className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl bg-gray-50 dark:bg-neutral-800 border border-gray-200/60 dark:border-neutral-700/60 transition-all duration-300 flex-shrink-0 ${
uploadDisabled
? 'opacity-40 cursor-not-allowed text-gray-300 dark:text-neutral-600'
: 'text-gray-400 hover:text-blue-500 hover:bg-blue-50 dark:hover:bg-blue-900/30 hover:border-blue-200 dark:hover:border-blue-800 hover:scale-105 active:scale-95'
}`}
}`,
]
.filter(Boolean)
.join(' ')}
style={{ boxShadow: '0 1px 3px rgba(0,0,0,0.04)' }}
>
<Paperclip size={16} />
<ActionPaperclip size={16} />
</button>
</Tooltip>
);
@@ -818,11 +825,16 @@ const CustomInputRender = (props) => {
e.stopPropagation();
speech.toggle();
}}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
speech.isListening
? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30'
}`}
}`,
]
.filter(Boolean)
.join(' ')}
style={{
boxShadow: speech.isListening
? undefined
@@ -830,9 +842,9 @@ const CustomInputRender = (props) => {
}}
>
{speech.isListening ? (
<MicOff size={16} />
<ActionMicOff size={16} />
) : (
<Mic size={16} />
<ActionMic size={16} />
)}
</button>
</Tooltip>
@@ -851,18 +863,23 @@ const CustomInputRender = (props) => {
e.stopPropagation();
onToggleWebSearch && onToggleWebSearch();
}}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
enableWebSearch
? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30'
}`}
}`,
]
.filter(Boolean)
.join(' ')}
style={{
boxShadow: enableWebSearch
? undefined
: '0 1px 3px rgba(0,0,0,0.04)',
}}
>
<Globe size={16} />
<ActionGlobe size={16} />
</button>
</Tooltip>
)}
@@ -883,11 +900,16 @@ const CustomInputRender = (props) => {
onToggleImageGenMode && onToggleImageGenMode();
}}
disabled={isImageGenerating}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
imageGenMode
? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30'
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`}
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`,
]
.filter(Boolean)
.join(' ')}
style={{
boxShadow: imageGenMode
? undefined
@@ -939,11 +961,16 @@ const CustomInputRender = (props) => {
e.stopPropagation();
speech.toggle();
}}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
speech.isListening
? 'bg-red-50 dark:bg-red-900/30 text-red-500 dark:text-red-400 border-red-200 dark:border-red-800 shadow-sm shadow-red-500/10 animate-pulse'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-rose-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-rose-200 dark:hover:border-rose-800 hover:bg-rose-50 dark:hover:bg-rose-900/30'
}`}
}`,
]
.filter(Boolean)
.join(' ')}
style={{
boxShadow: speech.isListening
? undefined
@@ -951,9 +978,9 @@ const CustomInputRender = (props) => {
}}
>
{speech.isListening ? (
<MicOff size={16} />
<ActionMicOff size={16} />
) : (
<Mic size={16} />
<ActionMic size={16} />
)}
</button>
</Tooltip>
@@ -972,18 +999,23 @@ const CustomInputRender = (props) => {
e.stopPropagation();
onToggleWebSearch && onToggleWebSearch();
}}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
enableWebSearch
? 'bg-green-50 dark:bg-green-900/30 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 shadow-sm shadow-green-500/10'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-green-500 border-gray-200/60 dark:border-neutral-700/60 hover:border-green-200 dark:hover:border-green-800 hover:bg-green-50 dark:hover:bg-green-900/30'
}`}
}`,
]
.filter(Boolean)
.join(' ')}
style={{
boxShadow: enableWebSearch
? undefined
: '0 1px 3px rgba(0,0,0,0.04)',
}}
>
<Globe size={16} />
<ActionGlobe size={16} />
</button>
</Tooltip>
)}
@@ -1004,11 +1036,16 @@ const CustomInputRender = (props) => {
onToggleImageGenMode && onToggleImageGenMode();
}}
disabled={isImageGenerating}
className={`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
className={[
'app-action-button',
`w-[38px] h-[38px] min-w-[38px] flex items-center justify-center rounded-xl border transition-all duration-300 hover:scale-105 active:scale-95 flex-shrink-0 ${
imageGenMode
? 'bg-brand/5 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand/20 dark:border-brand-deep shadow-sm shadow-brand/10'
: 'bg-gray-50 dark:bg-neutral-800 text-gray-400 hover:text-brand border-gray-200/60 dark:border-neutral-700/60 hover:border-brand/20 dark:hover:border-brand-deep hover:bg-brand/5 dark:hover:bg-brand-deep/30'
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`}
} ${isImageGenerating ? 'opacity-50 cursor-not-allowed' : ''}`,
]
.filter(Boolean)
.join(' ')}
style={{
boxShadow: imageGenMode
? undefined
@@ -17,10 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Edit as ActionEdit } from '@/components/common/icons/ActionIcons';
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import React, { useState, useEffect } from 'react';
import { TextArea, Typography, Button, Switch, Banner } from '@/components/ui';
import { Code, Edit, Check, X, AlertTriangle } from 'lucide-react';
import { Code, Check, X, AlertTriangle } from 'lucide-react';
import { useTranslation } from 'react-i18next';
const CustomRequestEditor = ({
@@ -170,7 +171,7 @@ const CustomRequestEditor = ({
theme='borderless'
type='tertiary'
size='small'
icon={<Edit size={14} />}
icon={<ActionEdit size={14} />}
onClick={formatJson}
disabled={!isValid}
className='!rounded-lg'
+3 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { X as ActionX } from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect } from 'react';
import {
Card,
@@ -26,7 +27,7 @@ import {
Button,
Dropdown,
} from '@/components/ui';
import { Code, Zap, Clock, X, Eye, Send } from 'lucide-react';
import { Code, Zap, Clock, Eye, Send } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import CodeViewer from './CodeViewer';
import SSEViewer from './SSEViewer';
@@ -119,7 +120,7 @@ const DebugPanel = ({
{styleState.isMobile && onCloseDebugPanel && (
<Button
icon={<X size={16} />}
icon={<ActionX size={16} />}
onClick={onCloseDebugPanel}
theme='borderless'
type='tertiary'
+36 -11
View File
@@ -17,9 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
ExternalLink as ActionExternalLink,
Download as ActionDownload,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, { useCallback, useMemo } from 'react';
import { Modal, Toast } from '@/components/ui';
import { Download, ExternalLink, X, FileText } from 'lucide-react';
import { FileText } from 'lucide-react';
import { useTranslation } from 'react-i18next';
// 体验中心消息气泡里"点击附件 chip 弹出预览"的统一入口。
@@ -110,20 +115,30 @@ const FilePreviewModal = ({ visible, file, onClose }) => {
</span>
</div>
<div className='flex items-center gap-1.5'>
<button onClick={handleOpenInNewTab} className={btnClass}>
<ExternalLink size={14} />
<button
onClick={handleOpenInNewTab}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionExternalLink size={14} />
{t('新窗口打开')}
</button>
<button onClick={handleDownload} className={btnClass}>
<Download size={14} />
<button
onClick={handleDownload}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionDownload size={14} />
{t('下载')}
</button>
<button
onClick={onClose}
className='w-9 h-9 flex items-center justify-center rounded-lg bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all'
className='app-action-button w-9 h-9 flex items-center justify-center rounded-lg bg-white/10 hover:bg-white/20 text-white/80 hover:text-white transition-all'
title={t('关闭')}
>
<X size={20} />
<ActionX size={20} />
</button>
</div>
</div>
@@ -156,12 +171,22 @@ const FilePreviewModal = ({ visible, file, onClose }) => {
)}
</div>
<div className='flex items-center gap-2 mt-2'>
<button onClick={handleOpenInNewTab} className={btnClass}>
<ExternalLink size={14} />
<button
onClick={handleOpenInNewTab}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionExternalLink size={14} />
{t('新窗口打开')}
</button>
<button onClick={handleDownload} className={btnClass}>
<Download size={14} />
<button
onClick={handleDownload}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionDownload size={14} />
{t('下载')}
</button>
</div>
+13 -3
View File
@@ -17,9 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Settings as ActionSettings,
EyeOff as ActionEyeOff,
Eye as ActionEye,
} from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button } from '@/components/ui';
import { Settings, Eye, EyeOff } from 'lucide-react';
const FloatingButtons = ({
styleState,
@@ -36,7 +40,7 @@ const FloatingButtons = ({
{/* 设置按钮(体验模式下设置面板不渲染,按钮也隐藏,避免出现死按钮) */}
{!showSettings && !hideSettingsButton && (
<Button
icon={<Settings size={18} />}
icon={<ActionSettings size={18} />}
style={{
position: 'fixed',
right: 16,
@@ -62,7 +66,13 @@ const FloatingButtons = ({
{/* 调试按钮 */}
{!showSettings && (
<Button
icon={showDebugPanel ? <EyeOff size={18} /> : <Eye size={18} />}
icon={
showDebugPanel ? (
<ActionEyeOff size={18} />
) : (
<ActionEye size={18} />
)
}
onClick={onToggleDebugPanel}
theme='solid'
type={showDebugPanel ? 'danger' : 'primary'}
+43 -11
View File
@@ -17,9 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
ZoomOut as ActionZoomOut,
ZoomIn as ActionZoomIn,
RotateCw as ActionRotateCw,
Download as ActionDownload,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useCallback, useEffect } from 'react';
import { Modal } from '@/components/ui';
import { Download, ZoomIn, ZoomOut, X, RotateCw } from 'lucide-react';
const ImagePreviewModal = ({ visible, imageUrl, onClose }) => {
const [scale, setScale] = useState(1);
@@ -92,25 +98,51 @@ const ImagePreviewModal = ({ visible, imageUrl, onClose }) => {
}}
>
<div className='flex items-center gap-1.5'>
<button onClick={handleZoomOut} className={btnClass}>
<ZoomOut size={18} />
<button
onClick={handleZoomOut}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionZoomOut size={18} />
</button>
<span className='text-white/70 text-sm min-w-[48px] text-center'>
{Math.round(scale * 100)}%
</span>
<button onClick={handleZoomIn} className={btnClass}>
<ZoomIn size={18} />
<button
onClick={handleZoomIn}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionZoomIn size={18} />
</button>
<button onClick={handleResetZoom} className={btnClass} title='Reset'>
<RotateCw size={16} />
<button
onClick={handleResetZoom}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
title='Reset'
>
<ActionRotateCw size={16} />
</button>
</div>
<div className='flex items-center gap-1.5'>
<button onClick={handleDownload} className={btnClass}>
<Download size={18} />
<button
onClick={handleDownload}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionDownload size={18} />
</button>
<button onClick={handleClose} className={btnClass}>
<X size={20} />
<button
onClick={handleClose}
className={['app-action-button', btnClass]
.filter(Boolean)
.join(' ')}
>
<ActionX size={20} />
</button>
</div>
</div>
+7 -3
View File
@@ -17,10 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Plus as ActionPlus,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Input, Typography, Button, Switch } from '@/components/ui';
import { IconFile } from '@/components/ui/icons';
import { Plus, X, Image } from 'lucide-react';
import { Image } from 'lucide-react';
import { useTranslation } from 'react-i18next';
const ImageUrlInput = ({
@@ -77,7 +81,7 @@ const ImageUrlInput = ({
disabled={disabled}
/>
<Button
icon={<Plus size={14} />}
icon={<ActionPlus size={14} />}
size='small'
theme='solid'
type='primary'
@@ -124,7 +128,7 @@ const ImageUrlInput = ({
/>
</div>
<Button
icon={<X size={12} />}
icon={<ActionX size={12} />}
size='small'
theme='borderless'
type='danger'
+12 -6
View File
@@ -17,9 +17,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
RefreshCw as ActionRefreshCw,
Copy as ActionCopy,
Edit as ActionEdit,
UserCheck as ActionUserCheck,
Trash2 as ActionTrash2,
} from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button, Tooltip } from '@/components/ui';
import { RefreshCw, Copy, Trash2, UserCheck, Edit } from 'lucide-react';
import { useTranslation } from 'react-i18next';
const MessageActions = ({
@@ -57,7 +63,7 @@ const MessageActions = ({
theme='borderless'
type='tertiary'
size='small'
icon={<RefreshCw size={styleState.isMobile ? 12 : 14} />}
icon={<ActionRefreshCw size={styleState.isMobile ? 12 : 14} />}
onClick={() => !shouldDisableActions && onMessageReset(message)}
disabled={shouldDisableActions}
className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-blue-600 hover:!bg-blue-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
@@ -72,7 +78,7 @@ const MessageActions = ({
theme='borderless'
type='tertiary'
size='small'
icon={<Copy size={styleState.isMobile ? 12 : 14} />}
icon={<ActionCopy size={styleState.isMobile ? 12 : 14} />}
onClick={() => onMessageCopy(message)}
className={`!rounded-full !text-gray-400 hover:!text-green-600 hover:!bg-green-50 ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
aria-label={t('复制')}
@@ -89,7 +95,7 @@ const MessageActions = ({
theme='borderless'
type='tertiary'
size='small'
icon={<Edit size={styleState.isMobile ? 12 : 14} />}
icon={<ActionEdit size={styleState.isMobile ? 12 : 14} />}
onClick={() => !shouldDisableActions && onMessageEdit(message)}
disabled={shouldDisableActions}
className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-yellow-600 hover:!bg-yellow-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
@@ -113,7 +119,7 @@ const MessageActions = ({
theme='borderless'
type='tertiary'
size='small'
icon={<UserCheck size={styleState.isMobile ? 12 : 14} />}
icon={<ActionUserCheck size={styleState.isMobile ? 12 : 14} />}
onClick={() =>
!shouldDisableActions && onRoleToggle && onRoleToggle(message)
}
@@ -137,7 +143,7 @@ const MessageActions = ({
theme='borderless'
type='tertiary'
size='small'
icon={<Trash2 size={styleState.isMobile ? 12 : 14} />}
icon={<ActionTrash2 size={styleState.isMobile ? 12 : 14} />}
onClick={() => !shouldDisableActions && onMessageDelete(message)}
disabled={shouldDisableActions}
className={`!rounded-full ${shouldDisableActions ? '!text-gray-300 !cursor-not-allowed' : '!text-gray-400 hover:!text-red-600 hover:!bg-red-50'} ${styleState.isMobile ? '!w-6 !h-6' : '!w-7 !h-7'} !p-0 transition-all`}
+40 -27
View File
@@ -17,25 +17,23 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
X as ActionX,
Check as ActionCheck,
FileText as ActionFileText,
Globe as ActionGlobe,
ChevronDown as ActionChevronDown,
FastForward as ActionFastForward,
VolumeX as ActionVolumeX,
Volume2 as ActionVolume2,
} from '@/components/common/icons/ActionIcons';
import React, { useRef, useEffect, useState } from 'react';
import { Typography, TextArea, Button, Tooltip } from '@/components/ui';
import MarkdownRenderer from '../common/markdown/MarkdownRenderer';
import ThinkingContent from './ThinkingContent';
import ImagePreviewModal from './ImagePreviewModal';
import FilePreviewModal from './FilePreviewModal';
import {
Loader2,
Check,
X,
FileText,
Globe,
ExternalLink,
Volume2,
VolumeX,
Sparkles,
FastForward,
ChevronDown,
} from 'lucide-react';
import { Loader2, FileText, Globe, ExternalLink, Sparkles } from 'lucide-react';
import { useTranslation } from 'react-i18next';
// 注意:不要从 helpers/utils 里 import getTextContent —— 本组件下方有同名 const,
// 同名遮蔽在 Vite/terser 生产构建里会把两者缩成同一个变量名,触发 TDZ 错误:
@@ -417,7 +415,7 @@ const MessageContent = ({
size='small'
type='danger'
theme='light'
icon={<X size={14} />}
icon={<ActionX size={14} />}
onClick={onEditCancel}
className='flex-1'
>
@@ -427,7 +425,7 @@ const MessageContent = ({
size='small'
type='warning'
theme='solid'
icon={<Check size={14} />}
icon={<ActionCheck size={14} />}
onClick={onEditSave}
disabled={!editValue || editValue.trim() === ''}
className='flex-1'
@@ -572,7 +570,12 @@ const MessageContent = ({
key={index}
type='button'
onClick={() => setPreviewFile(fileItem.file)}
className={`flex items-center gap-2 px-3 py-2 rounded-xl ${s.bg} border border-gray-200/60 dark:border-neutral-700/60 shadow-sm hover:shadow-md hover:scale-[1.02] active:scale-100 transition-all duration-200 group cursor-pointer text-left ${isHistoricalAttachment ? 'opacity-60 grayscale' : ''}`}
className={[
'app-action-button',
`flex items-center gap-2 px-3 py-2 rounded-xl ${s.bg} border border-gray-200/60 dark:border-neutral-700/60 shadow-sm hover:shadow-md hover:scale-[1.02] active:scale-100 transition-all duration-200 group cursor-pointer text-left ${isHistoricalAttachment ? 'opacity-60 grayscale' : ''}`,
]
.filter(Boolean)
.join(' ')}
// 历史 chip 已用 Semi Tooltip 显示提示,不再加 native title 防止重影
title={
isHistoricalAttachment ? undefined : t('点击预览')
@@ -590,7 +593,7 @@ const MessageContent = ({
: t('附件 {{name}}', { name: fileName })
}
>
<FileText
<ActionFileText
size={16}
className={`${s.color} flex-shrink-0`}
/>
@@ -701,20 +704,25 @@ const MessageContent = ({
<button
type='button'
onClick={() => setSourcesExpanded((v) => !v)}
className={`flex items-center gap-1.5 w-full text-left transition-colors hover:opacity-80 ${sourcesExpanded ? 'mb-2' : ''}`}
className={[
'app-action-button',
`flex items-center gap-1.5 w-full text-left transition-colors hover:opacity-80 ${sourcesExpanded ? 'mb-2' : ''}`,
]
.filter(Boolean)
.join(' ')}
aria-expanded={sourcesExpanded}
aria-label={
sourcesExpanded ? t('收起参考来源') : t('展开参考来源')
}
>
<Globe
<ActionGlobe
size={13}
className='text-brand dark:text-brand-from flex-shrink-0'
/>
<span className='text-[11px] font-medium text-brand-deep dark:text-brand-from uppercase tracking-wide'>
{t('参考来源')} · {message.webSearchSources.length}
</span>
<ChevronDown
<ActionChevronDown
size={12}
className={`ml-auto text-brand-from dark:text-brand transition-transform duration-200 ${sourcesExpanded ? 'rotate-180' : ''}`}
/>
@@ -844,10 +852,10 @@ const MessageContent = ({
t('请接着上面的内容继续输出,不要重复已经写过的部分'),
)
}
className='inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-amber-50 dark:bg-amber-900/30 hover:bg-amber-100 dark:hover:bg-amber-900/50 text-amber-700 dark:text-amber-300 border border-amber-300/70 dark:border-amber-700/50 transition-colors font-medium'
className='app-action-button inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-amber-50 dark:bg-amber-900/30 hover:bg-amber-100 dark:hover:bg-amber-900/50 text-amber-700 dark:text-amber-300 border border-amber-300/70 dark:border-amber-700/50 transition-colors font-medium'
title={t('上次响应因长度限制被截断,点击让模型接着写')}
>
<FastForward size={11} />
<ActionFastForward size={11} />
{t('继续生成')}
</button>
)}
@@ -856,17 +864,22 @@ const MessageContent = ({
<button
type='button'
onClick={() => tts.speak(message.id, plainText)}
className={`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] transition-colors border ${
className={[
'app-action-button',
`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] transition-colors border ${
isThisSpeaking
? 'bg-brand/10 dark:bg-brand-deep/30 text-brand-deep dark:text-brand-from border-brand-from dark:border-brand-deep animate-pulse'
: 'bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border-gray-200/60 dark:border-neutral-700/60'
}`}
}`,
]
.filter(Boolean)
.join(' ')}
title={isThisSpeaking ? t('停止朗读') : t('朗读')}
>
{isThisSpeaking ? (
<VolumeX size={11} />
<ActionVolumeX size={11} />
) : (
<Volume2 size={11} />
<ActionVolume2 size={11} />
)}
{isThisSpeaking ? t('停止朗读') : t('朗读')}
</button>
@@ -879,7 +892,7 @@ const MessageContent = ({
key={idx}
type='button'
onClick={() => onSendQuickPrompt?.(prompt)}
className='inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border border-gray-200/60 dark:border-neutral-700/60 transition-colors'
className='app-action-button inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] bg-gray-50/80 dark:bg-neutral-800/60 hover:bg-brand/5 dark:hover:bg-brand-deep/30 text-gray-500 dark:text-gray-400 hover:text-brand-deep dark:hover:text-brand-from border border-gray-200/60 dark:border-neutral-700/60 transition-colors'
title={t('一键追问')}
>
<Sparkles size={11} />
@@ -19,9 +19,12 @@ For commercial licensing, please contact support@quantumnous.com
// 多选导出:底部悬浮操作条。展示型组件,状态由父级(Playground/index.jsx)持有。
import {
Download as ActionDownload,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react';
import { Button, RadioGroup, Radio } from '@/components/ui';
import { Download, X } from 'lucide-react';
import { useTranslation } from 'react-i18next';
const MessageSelectionBar = ({
@@ -76,7 +79,7 @@ const MessageSelectionBar = ({
size='small'
theme='solid'
type='primary'
icon={<Download size={14} />}
icon={<ActionDownload size={14} />}
disabled={selectedCount === 0 || exporting}
loading={exporting}
onClick={handleExport}
@@ -89,7 +92,7 @@ const MessageSelectionBar = ({
<Button
size='small'
theme='borderless'
icon={<X size={14} />}
icon={<ActionX size={14} />}
// 导出进行中禁用「取消」——否则 bar 被关闭但 docx 仍在 await 中,
// 最终仍会触发一次下载,对用户体感是「我已经取消了为什么还有文件」。
disabled={exporting}
+25 -20
View File
@@ -17,19 +17,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Check as ActionCheck,
X as ActionX,
} from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Input, Slider, Typography, Button, Tag } from '@/components/ui';
import { useTranslation } from 'react-i18next';
import {
Hash,
Thermometer,
Target,
Repeat,
Ban,
Shuffle,
Check,
X,
} from 'lucide-react';
import { Hash, Thermometer, Target, Repeat, Ban, Shuffle } from 'lucide-react';
const ParameterControl = ({
inputs,
@@ -62,9 +57,9 @@ const ParameterControl = ({
size='small'
icon={
parameterEnabled.temperature ? (
<Check size={10} />
<ActionCheck size={10} />
) : (
<X size={10} />
<ActionX size={10} />
)
}
onClick={() => onParameterToggle('temperature')}
@@ -105,7 +100,11 @@ const ParameterControl = ({
type={parameterEnabled.top_p ? 'primary' : 'tertiary'}
size='small'
icon={
parameterEnabled.top_p ? <Check size={10} /> : <X size={10} />
parameterEnabled.top_p ? (
<ActionCheck size={10} />
) : (
<ActionX size={10} />
)
}
onClick={() => onParameterToggle('top_p')}
className='!rounded-full !w-4 !h-4 !p-0 !min-w-0 param-toggle-hit'
@@ -146,9 +145,9 @@ const ParameterControl = ({
size='small'
icon={
parameterEnabled.frequency_penalty ? (
<Check size={10} />
<ActionCheck size={10} />
) : (
<X size={10} />
<ActionX size={10} />
)
}
onClick={() => onParameterToggle('frequency_penalty')}
@@ -190,9 +189,9 @@ const ParameterControl = ({
size='small'
icon={
parameterEnabled.presence_penalty ? (
<Check size={10} />
<ActionCheck size={10} />
) : (
<X size={10} />
<ActionX size={10} />
)
}
onClick={() => onParameterToggle('presence_penalty')}
@@ -231,9 +230,9 @@ const ParameterControl = ({
size='small'
icon={
parameterEnabled.max_tokens ? (
<Check size={10} />
<ActionCheck size={10} />
) : (
<X size={10} />
<ActionX size={10} />
)
}
onClick={() => onParameterToggle('max_tokens')}
@@ -272,7 +271,13 @@ const ParameterControl = ({
theme={parameterEnabled.seed ? 'solid' : 'borderless'}
type={parameterEnabled.seed ? 'primary' : 'tertiary'}
size='small'
icon={parameterEnabled.seed ? <Check size={10} /> : <X size={10} />}
icon={
parameterEnabled.seed ? (
<ActionCheck size={10} />
) : (
<ActionX size={10} />
)
}
onClick={() => onParameterToggle('seed')}
className='!rounded-full !w-4 !h-4 !p-0 !min-w-0 param-toggle-hit'
disabled={disabled}
+10 -12
View File
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Copy as ActionCopy,
ChevronUp as ActionChevronUp,
ChevronDown as ActionChevronDown,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useMemo, useCallback } from 'react';
import {
Button,
@@ -26,14 +31,7 @@ import {
Badge,
Typography,
} from '@/components/ui';
import {
Copy,
ChevronDown,
ChevronUp,
Zap,
CheckCircle,
XCircle,
} from 'lucide-react';
import { Zap, CheckCircle, XCircle } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { copy } from '../../helpers';
@@ -167,7 +165,7 @@ const SSEViewer = ({ sseData }) => {
{JSON.stringify(item.parsed, null, 2)}
</pre>
<Button
icon={<Copy size={12} />}
icon={<ActionCopy size={12} />}
size='small'
theme='borderless'
onClick={() => handleCopySingle(item)}
@@ -235,7 +233,7 @@ const SSEViewer = ({ sseData }) => {
<div className='flex items-center gap-2'>
<Tooltip content={t('复制全部')}>
<Button
icon={<Copy size={14} />}
icon={<ActionCopy size={14} />}
size='small'
onClick={handleCopyAll}
theme='borderless'
@@ -253,9 +251,9 @@ const SSEViewer = ({ sseData }) => {
<Button
icon={
expandedKeys.length === parsedSSEData.length ? (
<ChevronUp size={14} />
<ActionChevronUp size={14} />
) : (
<ChevronDown size={14} />
<ActionChevronDown size={14} />
)
}
size='small'
+14 -16
View File
@@ -17,6 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
ChevronRight as ActionChevronRight,
Plus as ActionPlus,
X as ActionX,
ChevronLeft as ActionChevronLeft,
MoreHorizontal as ActionMoreHorizontal,
} from '@/components/common/icons/ActionIcons';
import React, {
useMemo,
useState,
@@ -35,14 +42,9 @@ import {
Dropdown,
} from '@/components/ui';
import {
Plus,
MessageSquare,
Trash2,
ChevronLeft,
ChevronRight,
Search,
X,
MoreHorizontal,
Edit3,
Sparkles,
Download,
@@ -200,7 +202,7 @@ const SessionSidebar = ({
<div className='relative flex flex-col items-center pt-4 gap-2'>
<Tooltip content={t('展开会话列表')} position='right'>
<Button
icon={<ChevronRight size={16} />}
icon={<ActionChevronRight size={16} />}
theme='borderless'
type='tertiary'
onClick={onToggleCollapse}
@@ -209,7 +211,7 @@ const SessionSidebar = ({
</Tooltip>
<Tooltip content={t('新建对话')} position='right'>
<Button
icon={<Plus size={16} />}
icon={<ActionPlus size={16} />}
theme='solid'
type='primary'
loading={creating}
@@ -254,7 +256,7 @@ const SessionSidebar = ({
</div>
{isMobile && onClose ? (
<Button
icon={<X size={16} />}
icon={<ActionX size={16} />}
theme='borderless'
type='tertiary'
onClick={onClose}
@@ -265,7 +267,7 @@ const SessionSidebar = ({
onToggleCollapse && (
<Tooltip content={t('收起')} position='bottom'>
<Button
icon={<ChevronLeft size={16} />}
icon={<ActionChevronLeft size={16} />}
theme='borderless'
type='tertiary'
onClick={onToggleCollapse}
@@ -280,7 +282,7 @@ const SessionSidebar = ({
{/* 新建按钮 */}
<div className='relative px-3 pb-2'>
<Button
icon={<Plus size={16} />}
icon={<ActionPlus size={16} />}
theme='solid'
type='primary'
block
@@ -486,15 +488,11 @@ const SessionSidebar = ({
>
<button
type='button'
className='
opacity-0 group-hover:opacity-100 [@media(hover:none)]:opacity-100 transition-opacity
flex-shrink-0 p-1 rounded hover:bg-gray-200/80 dark:hover:bg-neutral-700/80
text-gray-400 hover:text-gray-700 dark:hover:text-gray-200
'
className='app-action-button \n opacity-0 group-hover:opacity-100 [@media(hover:none)]:opacity-100 transition-opacity\n flex-shrink-0 p-1 rounded hover:bg-gray-200/80 dark:hover:bg-neutral-700/80\n text-gray-400 hover:text-gray-700 dark:hover:text-gray-200\n '
onClick={(e) => e.stopPropagation()}
aria-label={t('更多操作')}
>
<MoreHorizontal size={14} />
<ActionMoreHorizontal size={14} />
</button>
</Dropdown>
)}
+3 -10
View File
@@ -17,17 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { X as ActionX } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Select, Typography, Button, Switch } from '@/components/ui';
import {
Users,
ToggleLeft,
X,
Settings,
Sliders,
Bot,
Zap,
} from 'lucide-react';
import { Users, ToggleLeft, Settings, Sliders, Bot, Zap } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import {
renderGroupOption,
@@ -133,7 +126,7 @@ const SettingsPanel = ({
{styleState.isMobile && onCloseSettings && (
<Button
icon={<X size={16} />}
icon={<ActionX size={16} />}
onClick={onCloseSettings}
theme='borderless'
type='tertiary'
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Copy as ActionCopy,
CheckCircle as ActionCheckCircle,
Download as ActionDownload,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useRef, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
@@ -31,8 +36,6 @@ import {
} from '@/components/ui';
import { QRCodeCanvas } from 'qrcode.react';
import {
Download,
Copy,
Share2,
Smartphone,
Monitor,
@@ -383,7 +386,7 @@ const PromotionPosterModal = ({ visible, onClose }) => {
theme='solid'
type='primary'
size='small'
icon={<Copy size={14} />}
icon={<ActionCopy size={14} />}
onClick={handleCopyLink}
className='!bg-gradient-to-r !from-brand-from !to-brand-to !border-0 !rounded-lg'
>
@@ -413,7 +416,7 @@ const PromotionPosterModal = ({ visible, onClose }) => {
<Button
theme='light'
type='tertiary'
icon={<Copy size={14} />}
icon={<ActionCopy size={14} />}
onClick={handleCopyCode}
className='!rounded-lg'
>
@@ -452,17 +455,22 @@ const PromotionPosterModal = ({ visible, onClose }) => {
<button
key={template.id}
onClick={() => setSelectedTemplate(template)}
className={`relative w-14 h-14 rounded-xl border-2 transition-all duration-300 overflow-hidden ${
className={[
'app-action-button',
`relative w-14 h-14 rounded-xl border-2 transition-all duration-300 overflow-hidden ${
selectedTemplate.id === template.id
? 'border-brand scale-110 shadow-lg shadow-brand/30'
: 'border-transparent hover:border-gray-300 hover:scale-105'
}`}
}`,
]
.filter(Boolean)
.join(' ')}
style={{ background: template.bgGradient }}
title={t(template.name)}
>
{selectedTemplate.id === template.id && (
<div className='absolute inset-0 flex items-center justify-center bg-black/20'>
<CheckCircle size={20} className='text-white' />
<ActionCheckCircle size={20} className='text-white' />
</div>
)}
</button>
@@ -556,7 +564,7 @@ const PromotionPosterModal = ({ visible, onClose }) => {
<Button
theme='solid'
type='primary'
icon={<Download size={16} />}
icon={<ActionDownload size={16} />}
onClick={handleDownload}
loading={downloading}
className='flex-1 !bg-gradient-to-r !from-brand-from !to-brand-to !border-0 !rounded-xl !h-10'
@@ -566,7 +574,7 @@ const PromotionPosterModal = ({ visible, onClose }) => {
<Button
theme='light'
type='tertiary'
icon={<Copy size={16} />}
icon={<ActionCopy size={16} />}
onClick={handleCopyLink}
className='flex-1 !rounded-xl !h-10'
>
+3 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Plus as ActionPlus } from '@/components/common/icons/ActionIcons';
import React, { useCallback, useEffect, useState } from 'react';
import {
Banner,
@@ -31,7 +32,7 @@ import {
Tag,
Toast,
} from '@/components/ui';
import { BellRing, Plus } from 'lucide-react';
import { BellRing } from 'lucide-react';
import { useIsMobile } from '../../hooks/common/useIsMobile';
import {
ALERT_DIM_TYPES,
@@ -337,7 +338,7 @@ const QualityAlerts = ({ quality, t }) => {
</span>
</span>
<Button
icon={<Plus size={14} />}
icon={<ActionPlus size={14} />}
theme='solid'
onClick={() => {
setTestResult(null);
+9 -4
View File
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
SlidersHorizontal as ActionSlidersHorizontal,
RotateCcw as ActionRotateCcw,
RefreshCw as ActionRefreshCw,
} from '@/components/common/icons/ActionIcons';
import React, {
useCallback,
useEffect,
@@ -33,7 +38,7 @@ import {
Select,
Tag,
} from '@/components/ui';
import { Filter, RefreshCw, RotateCcw, SlidersHorizontal } from 'lucide-react';
import { Filter } from 'lucide-react';
import {
FAULTS,
OUTCOMES,
@@ -286,17 +291,17 @@ const QualityFilterBar = ({ quality, t, onOpenDetail }) => {
/>
<div className='flex flex-wrap items-center gap-2 ml-auto'>
<Button
icon={<SlidersHorizontal size={14} />}
icon={<ActionSlidersHorizontal size={14} />}
theme={moreOpen ? 'solid' : 'light'}
onClick={() => setMoreOpen((v) => !v)}
>
{t('更多筛选')}
</Button>
<Button icon={<RotateCcw size={14} />} onClick={resetFilters}>
<Button icon={<ActionRotateCcw size={14} />} onClick={resetFilters}>
{t('重置')}
</Button>
<Button
icon={<RefreshCw size={14} />}
icon={<ActionRefreshCw size={14} />}
loading={loading}
onClick={refresh}
>
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { TestTube2 as ActionTestTube2 } from '@/components/common/icons/ActionIcons';
import {
RefreshCw as ActionRefreshCw,
Save as ActionSave,
} from '@/components/common/icons/ActionIcons';
import React, {
useCallback,
useEffect,
@@ -40,7 +45,7 @@ import {
Tag,
Typography,
} from '@/components/ui';
import { RefreshCw, Save, ShieldAlert, TestTube2 } from 'lucide-react';
import { ShieldAlert } from 'lucide-react';
import { API, showError, showSuccess } from '../../helpers';
import { useTranslation } from 'react-i18next';
import i18next from 'i18next';
@@ -394,7 +399,7 @@ export default function ContentGuardSetting() {
{statusTag(config, t)}
</Space>
<Button
icon={<RefreshCw size={16} />}
icon={<ActionRefreshCw size={16} />}
onClick={loadAll}
aria-label={t('刷新')}
/>
@@ -596,18 +601,18 @@ export default function ContentGuardSetting() {
htmlType='submit'
type='primary'
loading={saving}
icon={<Save size={16} />}
icon={<ActionSave size={16} />}
>
{t('保存配置')}
</Button>
<Button
icon={<TestTube2 size={16} />}
icon={<ActionTestTube2 size={16} />}
onClick={() => testPermission('moderate')}
>
moderate
</Button>
<Button
icon={<TestTube2 size={16} />}
icon={<ActionTestTube2 size={16} />}
onClick={() => testPermission('stream_moderate')}
>
stream_moderate
@@ -16,6 +16,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
RefreshCw as ActionRefreshCw,
Plus as ActionPlus,
Upload as ActionUpload,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useCallback } from 'react';
import {
Card,
@@ -33,16 +38,7 @@ import {
Spin,
Upload,
} from '@/components/ui';
import {
Plus,
Pencil,
Trash2,
Power,
PowerOff,
RefreshCw,
Users,
Upload as UploadIcon,
} from 'lucide-react';
import { Users } from 'lucide-react';
import { API, showError, showSuccess } from '../../helpers';
import { useTranslation } from 'react-i18next';
@@ -313,20 +309,14 @@ const CustomerServiceSetting = () => {
render: (_, record) => (
<Space>
<Button
icon={
record.status === 1 ? <PowerOff size={14} /> : <Power size={14} />
}
size='small'
type={record.status === 1 ? 'danger' : 'primary'}
onClick={() => handleToggleStatus(record)}
type='link'
size='small'
danger={(record.status === 1 ? 'danger' : 'primary') === 'danger'}
>
{record.status === 1 ? t('下线') : t('上线')}
</Button>
<Button
icon={<Pencil size={14} />}
size='small'
onClick={() => openModal(record)}
>
<Button onClick={() => openModal(record)} type='link' size='small'>
{t('编辑')}
</Button>
<Popconfirm
@@ -334,7 +324,7 @@ const CustomerServiceSetting = () => {
content={t('确定要删除这个客服吗?')}
onConfirm={() => handleDelete(record.id)}
>
<Button icon={<Trash2 size={14} />} size='small' type='danger'>
<Button type='link' size='small' danger>
{t('删除')}
</Button>
</Popconfirm>
@@ -392,14 +382,14 @@ const CustomerServiceSetting = () => {
</Space>
<Space>
<Button
icon={<RefreshCw size={14} />}
icon={<ActionRefreshCw size={14} />}
onClick={fetchAgents}
loading={loading}
>
{t('刷新')}
</Button>
<Button
icon={<Plus size={14} />}
icon={<ActionPlus size={14} />}
type='primary'
onClick={() => openModal()}
>
@@ -457,7 +447,7 @@ const CustomerServiceSetting = () => {
customRequest={(fileInfo) => handleUpload(fileInfo, 'avatar')}
>
<Button
icon={<UploadIcon size={14} />}
icon={<ActionUpload size={14} />}
loading={uploadingAvatar}
>
{t('上传')}
@@ -497,7 +487,7 @@ const CustomerServiceSetting = () => {
}
>
<Button
icon={<UploadIcon size={14} />}
icon={<ActionUpload size={14} />}
loading={uploadingQrcode}
>
{t('上传')}
@@ -511,14 +511,14 @@ export default function DataSecuritySetting() {
title: t('操作'),
render: (_, rule) => (
<Space>
<Button size='small' onClick={() => openEditRule(rule)}>
<Button onClick={() => openEditRule(rule)} type='link' size='small'>
{t('编辑')}
</Button>
<Popconfirm
title={t('确认删除该规则?')}
onConfirm={() => deleteRule(rule)}
>
<Button size='small' type='danger'>
<Button type='link' size='small' danger>
{t('删除')}
</Button>
</Popconfirm>
@@ -649,7 +649,7 @@ export default function DataSecuritySetting() {
)}
onConfirm={() => reviewRequest(r.id, 'approve')}
>
<Button size='small' theme='solid'>
<Button type='link' size='small'>
{t('通过')}
</Button>
</Popconfirm>
@@ -657,7 +657,7 @@ export default function DataSecuritySetting() {
title={t('确认驳回?')}
onConfirm={() => reviewRequest(r.id, 'reject')}
>
<Button size='small' type='danger'>
<Button type='link' size='small' danger>
{t('驳回')}
</Button>
</Popconfirm>
@@ -881,7 +881,7 @@ export default function DataSecuritySetting() {
)}
onConfirm={() => deleteRule(rule)}
>
<Button size='small' type='danger'>
<Button type='link' size='small' danger>
{t('删除')}
</Button>
</Popconfirm>
@@ -1191,8 +1191,9 @@ export default function DataSecuritySetting() {
render: (_, row) => (
<Space>
<Button
size='small'
onClick={() => openEditOrgConfig(row)}
type='link'
size='small'
>
{t('编辑')}
</Button>
@@ -1200,7 +1201,7 @@ export default function DataSecuritySetting() {
title={t('确认删除该企业覆盖(回到继承全局)?')}
onConfirm={() => deleteOrgConfig(row.org_id)}
>
<Button size='small' type='danger'>
<Button type='link' size='small' danger>
{t('删除')}
</Button>
</Popconfirm>
+33 -38
View File
@@ -16,6 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Eraser as ActionEraser } from '@/components/common/icons/ActionIcons';
import {
Plus as ActionPlus,
RefreshCw as ActionRefreshCw,
ChevronDown as ActionChevronDown,
ChevronRight as ActionChevronRight,
} from '@/components/common/icons/ActionIcons';
import React, { useState, useEffect, useCallback, useMemo } from 'react';
import {
Card,
@@ -37,17 +44,7 @@ import {
Empty,
Switch,
} from '@/components/ui';
import {
Plus,
Pencil,
Trash2,
RefreshCw,
Copy,
Search,
Eraser,
ChevronDown,
ChevronRight,
} from 'lucide-react';
import { Search } from 'lucide-react';
import { API, showError, showSuccess } from '../../helpers';
import { useTranslation } from 'react-i18next';
import './LevelPolicySetting.css';
@@ -131,7 +128,7 @@ const GroupModelDiscountEditor = ({
/>
<Button
size='small'
icon={<Plus size={14} />}
icon={<ActionPlus size={14} />}
disabled={!allowAdd || pendingModels.length === 0 || pendingInvalid}
onClick={() => {
onAdd(pendingModels, pendingTrim);
@@ -149,16 +146,15 @@ const GroupModelDiscountEditor = ({
</Text>
)}
</Space>
{rows.length === 0 ? (
{rows.length === 0 &&
// 已废弃分组不显示「按分组折扣计费」——该分组已无流量,顶部已有废弃提示
allowAdd ? (
(allowAdd ? (
<div className='mt-2'>
<Text type='tertiary' size='small'>
{t('未配置模型折扣:该分组所有模型按分组折扣系数计费')}
</Text>
</div>
) : null
) : (
) : null)}
<Table
// 嵌在 358px 的弹窗体里,列宽合计 460~480px,必须给横向滚动
scroll={{ x: 'max-content' }}
@@ -232,11 +228,7 @@ const GroupModelDiscountEditor = ({
title={t('确认移除该模型折扣?')}
onConfirm={() => onRemove(r.model)}
>
<Button
size='small'
type='danger'
icon={<Trash2 size={14} />}
>
<Button type='link' size='small' danger>
{t('移除')}
</Button>
</Popconfirm>
@@ -244,7 +236,6 @@ const GroupModelDiscountEditor = ({
},
]}
/>
)}
</div>
);
};
@@ -988,17 +979,17 @@ const LevelPolicySetting = () => {
render: (_, r) => (
<Space>
<Button
size='small'
icon={<Pencil size={14} />}
onClick={() => openEditor(type, r.code)}
type='link'
size='small'
>
{t('编辑')}
</Button>
<Tooltip content={t('以该等级为模板新建')}>
<Button
size='small'
icon={<Copy size={14} />}
onClick={() => duplicateLevel(type, r.code)}
type='link'
size='small'
>
{t('复制')}
</Button>
@@ -1009,10 +1000,10 @@ const LevelPolicySetting = () => {
onConfirm={() => deleteLevel(type, r.code)}
>
<Button
size='small'
type='danger'
icon={<Trash2 size={14} />}
loading={deletingCode === `${type}/${r.code}`}
type='link'
size='small'
danger
>
{t('删除')}
</Button>
@@ -1106,7 +1097,7 @@ const LevelPolicySetting = () => {
headerExtraContent={
<Button
theme='solid'
icon={<Plus size={14} />}
icon={<ActionPlus size={14} />}
onClick={() => openEditor(type, null)}
>
{t('新增等级')}
@@ -1147,7 +1138,7 @@ const LevelPolicySetting = () => {
headerExtraContent={
<Space>
<Button
icon={<RefreshCw size={14} />}
icon={<ActionRefreshCw size={14} />}
onClick={fetchAll}
disabled={loading}
>
@@ -1355,7 +1346,11 @@ const LevelPolicySetting = () => {
title={t('清空全部逐模型覆盖?')}
onConfirm={clearOverrides}
>
<Button size='small' type='tertiary' icon={<Eraser size={14} />}>
<Button
size='small'
type='tertiary'
icon={<ActionEraser size={14} />}
>
{t('清空全部')}
</Button>
</Popconfirm>
@@ -1391,7 +1386,7 @@ const LevelPolicySetting = () => {
/>
<Button
theme='solid'
icon={<Plus size={14} />}
icon={<ActionPlus size={14} />}
disabled={overrideModels.length === 0}
onClick={addOverrides}
>
@@ -1465,10 +1460,10 @@ const LevelPolicySetting = () => {
width: 110,
render: (_, r) => (
<Button
size='small'
type='danger'
icon={<Trash2 size={14} />}
onClick={() => removeOverride(r.model)}
type='link'
size='small'
danger
>
{t('移除')}
</Button>
@@ -1632,9 +1627,9 @@ const LevelPolicySetting = () => {
type={r.modelDiscountCount > 0 ? 'primary' : 'tertiary'}
icon={
expanded ? (
<ChevronDown size={14} />
<ActionChevronDown size={14} />
) : (
<ChevronRight size={14} />
<ActionChevronRight size={14} />
)
}
onClick={() => toggleGroupExpanded(r.key)}
+3 -3
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Check as ActionCheck } from '@/components/common/icons/ActionIcons';
import { useEffectEvent } from '../../hooks/common/useEffectEvent';
import { writeClipboardText } from '../../helpers/clipboard';
import React, { useContext, useEffect, useState } from 'react';
@@ -47,7 +48,6 @@ import { UserContext } from '../../context/User';
import { Tag as AntTag } from 'antd';
import { Avatar, Tooltip, Card, Tabs } from '@/components/ui';
import { useTranslation } from 'react-i18next';
import { Check } from 'lucide-react';
// 导入内容区组件
import AccountBindingSection from './personal/sections/AccountBindingSection';
@@ -631,11 +631,11 @@ const PersonalSetting = () => {
>
<button
type='button'
className='ui-profile-id'
className='app-action-button ui-profile-id'
onClick={copyUserId}
>
ID:{userState?.user?.id}
{userIdCopied && <Check size={12} />}
{userIdCopied && <ActionCheck size={12} />}
</button>
</Tooltip>
<span aria-hidden='true'>·</span>
@@ -33,14 +33,7 @@ import {
Progress,
Empty,
} from '@/components/ui';
import {
IconPlus,
IconDelete,
IconEdit,
IconUpload,
IconPlayCircle,
IconEyeOpened,
} from '@/components/ui/icons';
import { IconPlus, IconUpload, IconPlayCircle } from '@/components/ui/icons';
import { API } from '../../helpers';
const TutorialVideoSetting = () => {
@@ -271,28 +264,23 @@ const TutorialVideoSetting = () => {
render: (_, record) => (
<div style={{ display: 'flex', gap: 8 }}>
<Button
icon={<IconEyeOpened />}
size='small'
theme='borderless'
onClick={() => handlePreview(record)}
/>
<Button
icon={<IconEdit />}
type='link'
size='small'
theme='borderless'
onClick={() => handleEdit(record)}
/>
>
{t('预览')}
</Button>
<Button onClick={() => handleEdit(record)} type='link' size='small'>
{t('编辑')}
</Button>
<Popconfirm
title={t('确定删除这个视频吗?')}
content={t('删除后将无法恢复')}
onConfirm={() => handleDelete(record.id)}
>
<Button
icon={<IconDelete />}
size='small'
theme='borderless'
type='danger'
/>
<Button type='link' size='small' danger>
{t('删除')}
</Button>
</Popconfirm>
</div>
),
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Check as ActionCheck } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Segmented } from 'antd';
import { Button, Input } from '@/components/ui';
import { Check } from 'lucide-react';
import {
CARTOON_AVATAR_PRESETS,
USER_AVATAR_TYPES,
@@ -114,7 +114,12 @@ const AvatarSection = ({
);
handleAvatarSettingChange('avatarPreset', preset.id);
}}
className={`ui-avatar-option ${selected ? 'selected' : ''}`}
className={[
'app-action-button',
`ui-avatar-option ${selected ? 'selected' : ''}`,
]
.filter(Boolean)
.join(' ')}
>
<img
src={getCartoonAvatarDataUrl(preset.id, 96)}
@@ -122,7 +127,7 @@ const AvatarSection = ({
/>
<span>{t(preset.label)}</span>
{selected && (
<Check size={14} className='ui-avatar-check' />
<ActionCheck size={14} className='ui-avatar-check' />
)}
</button>
);
@@ -17,9 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Check as ActionCheck,
Copy as ActionCopy,
} from '@/components/common/icons/ActionIcons';
import React, { useRef, useEffect } from 'react';
import { Button, Form, Toast } from '@/components/ui';
import { Check, Copy } from 'lucide-react';
import { FormQuotaInput } from '../../../common/ui/QuotaInput';
import { copy } from '../../../../helpers';
import SectionHeader from '../components/SectionHeader';
@@ -127,14 +130,19 @@ const NotificationSection = ({
type='button'
aria-pressed={isSelected}
onClick={() => handleFormChange('warningType', option.value)}
className={`ui-notify-method ${isSelected ? 'selected' : ''}`}
className={[
'app-action-button',
`ui-notify-method ${isSelected ? 'selected' : ''}`,
]
.filter(Boolean)
.join(' ')}
>
<span className='ui-notify-method-text'>
<strong>{option.label}</strong>
<span>{option.desc}</span>
</span>
{isSelected && (
<Check size={16} className='ui-notify-method-check' />
<ActionCheck size={16} className='ui-notify-method-check' />
)}
</button>
);
@@ -212,11 +220,11 @@ const NotificationSection = ({
<span>{t('Webhook 请求结构说明')}</span>
<button
type='button'
className='ui-notify-copy'
className='app-action-button ui-notify-copy'
onClick={handleCopyExample}
>
{t('复制')}
<Copy size={14} />
<ActionCopy size={14} />
</button>
</div>
<pre className='ui-notify-code'>
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { RefreshCw as ActionRefreshCw } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button, Tag } from '@/components/ui';
import { RefreshCw } from 'lucide-react';
import { isAdmin } from '../../../helpers';
const AdminTokensActions = ({
@@ -58,7 +58,7 @@ const AdminTokensActions = ({
</Button>
</>
)}
<Button icon={<RefreshCw size={16} />} onClick={onRefresh}>
<Button icon={<ActionRefreshCw size={16} />} onClick={onRefresh}>
{t('刷新')}
</Button>
</div>
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Plus as ActionPlus } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Tabs, TabPane, Tag } from '@/components/ui';
import { Button } from 'antd';
import { Plus } from 'lucide-react';
import { CHANNEL_OPTIONS } from '../../../constants';
import { getChannelIcon, isRoot } from '../../../helpers';
import './channels-tabs.css';
@@ -45,7 +45,7 @@ const ChannelsTabs = ({
className='console-create-action'
type='primary'
size='middle'
icon={<Plus size={16} />}
icon={<ActionPlus size={16} />}
onClick={() => {
setEditingChannel({ id: undefined });
setShowEdit(true);
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Filter as ActionFilter } from '@/components/common/icons/ActionIcons';
import React, { useEffect, useMemo, useRef, useState } from 'react';
import { Alert, Button, Card } from 'antd';
import { Filter, Layers } from 'lucide-react';
import { Layers } from 'lucide-react';
import { calculateModelPrice } from '../../../../helpers';
import MarketModelCard from './MarketModelCard';
import MarketLogo from './MarketLogo';
@@ -224,7 +225,7 @@ const MarketCatalog = ({
)}
<Button
className='mm-mobile-filter'
icon={<Filter size={16} strokeWidth={1.65} />}
icon={<ActionFilter size={16} strokeWidth={1.65} />}
aria-expanded={filtersOpen}
aria-controls='mm-filter-panel'
onClick={onToggleFilters}
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Search as ActionSearch } from '@/components/common/icons/ActionIcons';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import { Button, Input } from 'antd';
import { Search, Zap } from 'lucide-react';
@@ -100,7 +101,7 @@ const MarketHero = ({ searchValue, setSearchValue, onReset, t }) => {
<Button
type='primary'
htmlType='submit'
icon={<Search size={16} strokeWidth={1.65} />}
icon={<ActionSearch size={16} strokeWidth={1.65} />}
>
{t('搜索')}
</Button>
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button, Card, Tag, Tooltip } from 'antd';
import { Copy, Lock } from 'lucide-react';
import { Lock } from 'lucide-react';
import { getDiscountBadgeText } from '../../../../helpers';
import MarketLogo from './MarketLogo';
@@ -146,7 +147,7 @@ const MarketModelCard = ({
<Button
type='text'
aria-label={t('复制模型名称')}
icon={<Copy size={16} strokeWidth={1.65} />}
icon={<ActionCopy size={16} strokeWidth={1.65} />}
onClick={(e) => {
e.stopPropagation();
onCopy(model.model_name);
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Copy as ActionCopy } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button as AntButton, Tooltip as AntTooltip } from 'antd';
import { Copy } from 'lucide-react';
import { Button, Space, Tag, Modal, Tooltip } from '@/components/ui';
import {
timestamp2string,
@@ -372,7 +372,7 @@ export const getModelsColumns = ({
size='small'
className='models-name-copy'
aria-label={t('复制模型名称')}
icon={<Copy size={14} />}
icon={<ActionCopy size={14} />}
onClick={() => copyText(text)}
/>
</AntTooltip>
+2 -2
View File
@@ -17,10 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Plus as ActionPlus } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Modal } from '@/components/ui';
import { Button } from 'antd';
import { Plus } from 'lucide-react';
import { IconEdit, IconClose } from '@/components/ui/icons';
import {
getLobeHubIcon,
@@ -165,7 +165,7 @@ const ModelsTabs = ({
className='console-create-action'
type='primary'
size='middle'
icon={<Plus size={16} />}
icon={<ActionPlus size={16} />}
onClick={() => setShowAddVendor(true)}
>
{t('新增供应商')}
@@ -85,7 +85,7 @@
color: var(--ui-color-primary);
}
.models-name-cell .models-name-copy.ant-btn .lucide {
.models-name-cell .models-name-copy.ant-btn :is(.lucide, .app-action-icon) {
width: 0.8em;
height: 0.8em;
}
@@ -17,16 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button } from '@/components/ui';
import {
ListTodo,
Clock,
CheckCircle2,
Download,
XCircle,
Loader2,
} from 'lucide-react';
import { ListTodo, Clock, CheckCircle2, XCircle, Loader2 } from 'lucide-react';
import { exportToCsv, formatTimestampForCsv } from '../../../helpers/exportCsv';
import { Space, Statistic } from 'antd';
import { useConsolePage } from '../../console/ConsoleContext';
@@ -120,7 +114,7 @@ const TaskLogsActions = ({
<Space wrap>
{stats.pendingCount > 0 && <span>{t('实时更新中')}</span>}
<Button
icon={<Download size={16} />}
icon={<ActionDownload size={16} />}
onClick={handleExportCsv}
disabled={!logs.length}
>
@@ -249,7 +243,7 @@ const TaskLogsActions = ({
{/* 导出当前页为 CSV,空列表时禁用避免生成只有表头的无用文件 */}
<Button
size='small'
icon={<Download className='w-3.5 h-3.5' />}
icon={<ActionDownload className='w-3.5 h-3.5' />}
onClick={handleExportCsv}
disabled={!logs || logs.length === 0}
className={exportButtonClass}
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Search as ActionSearch } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button, Form } from '@/components/ui';
import {
@@ -244,7 +245,7 @@ const TaskLogsFilters = ({
type='primary'
htmlType='submit'
loading={loading}
icon={<Search size={14} />}
icon={<ActionSearch size={14} />}
>
{t('搜索')}
</Button>
+3 -2
View File
@@ -17,9 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react';
import { Card, Tag as AntTag } from 'antd';
import { Clock, Download } from 'lucide-react';
import { Clock } from 'lucide-react';
import { Button, Pagination } from '@/components/ui';
import CardPro from '../../common/ui/CardPro';
import { ColumnSettingsButton } from '../../common/table/ColumnSettings';
@@ -102,7 +103,7 @@ const TaskLogsPage = ({
)}
{/* 导出当前页为 CSV,空列表时禁用避免生成只有表头的无用文件 */}
<Button
icon={<Download size={14} />}
icon={<ActionDownload size={14} />}
onClick={() => exportTaskLogsPageCsv(logs, isAdminUser, t)}
disabled={!logs || logs.length === 0}
>
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
X as ActionX,
Settings2 as ActionSettings2,
Check as ActionCheck,
} from '@/components/common/icons/ActionIcons';
import { useEffectEvent } from '../../../../hooks/common/useEffectEvent';
import React, { useEffect, useState, useContext, useRef } from 'react';
import {
@@ -42,9 +47,6 @@ import {
Key,
CreditCard,
Shield,
X,
Check,
Settings2,
Calendar,
Hash,
Layers,
@@ -480,9 +482,9 @@ const EditTokenModal = (props) => {
</div>
<button
onClick={handleCancel}
className='p-1.5 rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors'
className='app-action-button p-1.5 rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors'
>
<X size={18} />
<ActionX size={18} />
</button>
</div>
@@ -640,10 +642,10 @@ const EditTokenModal = (props) => {
<button
type='button'
onClick={() => setAdvancedOpen(!advancedOpen)}
className='w-full flex items-center justify-between px-4 py-3 bg-white dark:bg-neutral-900 hover:bg-gray-50 dark:hover:bg-neutral-800 transition-colors'
className='app-action-button w-full flex items-center justify-between px-4 py-3 bg-white dark:bg-neutral-900 hover:bg-gray-50 dark:hover:bg-neutral-800 transition-colors'
>
<div className='flex items-center gap-2'>
<Settings2 size={15} className='text-brand' />
<ActionSettings2 size={15} className='text-brand' />
<span className='text-sm font-medium text-gray-700 dark:text-gray-300'>
{t('高级设置')}
</span>
@@ -759,7 +761,7 @@ const EditTokenModal = (props) => {
theme='solid'
className='flex-1 !h-10 !rounded-xl !font-medium !border-0 !text-white !bg-gradient-to-r !from-brand-from !via-brand !to-brand-to shadow-lg shadow-brand/30 hover:!opacity-90'
onClick={() => formApiRef.current?.submitForm()}
icon={<Check size={16} />}
icon={<ActionCheck size={16} />}
loading={loading}
>
{isEdit ? t('保存修改') : t('创建密钥')}
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Search as ActionSearch } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button, Form } from '@/components/ui';
import { Search } from 'lucide-react';
import '../../common/table/log-filters.css';
import FilterSearchButton from '../../common/table/FilterSearchButton';
import { useFilterSearch } from '../../../hooks/common/useFilterSearch';
@@ -189,7 +189,7 @@ const LogsFilters = ({
type='primary'
htmlType='submit'
loading={loading}
icon={<Search size={14} />}
icon={<ActionSearch size={14} />}
>
{t('搜索')}
</Button>
+3 -3
View File
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Download as ActionDownload } from '@/components/common/icons/ActionIcons';
import React, { useState } from 'react';
import { Card } from 'antd';
import { Download } from 'lucide-react';
import { Button, Pagination } from '@/components/ui';
import CardPro from '../../common/ui/CardPro';
import { TableTitle } from '../../common/table/TableToolbar';
@@ -69,7 +69,7 @@ const LogsPage = ({ usageRecordMode = false }) => {
<TableTitle>{t('调用明细')}</TableTitle>
<div className='usage-record-table-actions'>
<Button
icon={<Download size={14} />}
icon={<ActionDownload size={14} />}
onClick={() => logsData.setShowExportModal(true)}
>
{t('导出')}
@@ -122,7 +122,7 @@ const LogsPage = ({ usageRecordMode = false }) => {
tableActions={
<>
<Button
icon={<Download size={14} />}
icon={<ActionDownload size={14} />}
onClick={() => logsData.setShowExportModal(true)}
>
{logsData.t('导出')}
+2 -2
View File
@@ -17,9 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Plus as ActionPlus } from '@/components/common/icons/ActionIcons';
import React from 'react';
import { Button } from 'antd';
import { Plus } from 'lucide-react';
import { isAdmin } from '../../../helpers';
const UsersActions = ({ setShowAddUser, t }) => {
@@ -34,7 +34,7 @@ const UsersActions = ({ setShowAddUser, t }) => {
<Button
className='console-create-action'
type='primary'
icon={<Plus size={16} />}
icon={<ActionPlus size={16} />}
onClick={handleAddUser}
size='middle'
>
+7 -3
View File
@@ -17,6 +17,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Zap as ActionZap,
Copy as ActionCopy,
} from '@/components/common/icons/ActionIcons';
import React from 'react';
import {
Avatar,
@@ -27,7 +31,7 @@ import {
Badge,
Space,
} from '@/components/ui';
import { Copy, Users, BarChart2, TrendingUp, Gift, Zap } from 'lucide-react';
import { Users, BarChart2, TrendingUp, Gift } from 'lucide-react';
const { Text } = Typography;
@@ -87,7 +91,7 @@ const InvitationCard = ({
onClick={() => setOpenTransfer(true)}
className='!rounded-lg'
>
<Zap size={12} className='mr-1' />
<ActionZap size={12} className='mr-1' />
{t('划转到余额')}
</Button>
</div>
@@ -184,7 +188,7 @@ const InvitationCard = ({
type='primary'
theme='solid'
onClick={handleAffLinkClick}
icon={<Copy size={14} />}
icon={<ActionCopy size={14} />}
className='!rounded-lg'
>
{t('复制')}
+3 -2
View File
@@ -17,6 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import { Receipt as ActionReceipt } from '@/components/common/icons/ActionIcons';
import React, { useRef } from 'react';
import {
Typography,
@@ -28,7 +29,7 @@ import {
Spin,
Tooltip,
} from '@/components/ui';
import { CreditCard, Coins, Wallet, Receipt } from 'lucide-react';
import { CreditCard, Coins, Wallet } from 'lucide-react';
import {
AlipayBrandIcon,
WechatBrandIcon,
@@ -103,7 +104,7 @@ const RechargeCard = ({
</div>
</div>
<Button
icon={<Receipt size={18} />}
icon={<ActionReceipt size={18} />}
theme='solid'
type='secondary'
className='!rounded-xl !px-4 hover:scale-105 transition-transform'
+8 -4
View File
@@ -17,6 +17,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Send as ActionSend,
Trash2 as ActionTrash2,
Square as ActionSquare,
} from '@/components/common/icons/ActionIcons';
import React, {
forwardRef,
useImperativeHandle,
@@ -24,7 +29,6 @@ import React, {
useState,
} from 'react';
import { Avatar, Button, Input, List } from 'antd';
import { Send, Square, Trash2 } from 'lucide-react';
import { useTranslation } from 'react-i18next';
// Only message presentation and the composer live here; the page owns all chat actions.
@@ -86,14 +90,14 @@ export const Chat = forwardRef(function Chat(
type='primary'
aria-label={t('发送')}
disabled={value.length === 0 || (showStopGenerate && generating)}
icon={<Send size={16} />}
icon={<ActionSend size={16} />}
onClick={send}
/>
),
clearContextNode: showClearContext ? (
<Button
aria-label={t('清空对话')}
icon={<Trash2 size={16} />}
icon={<ActionTrash2 size={16} />}
onClick={onClear}
/>
) : null,
@@ -101,7 +105,7 @@ export const Chat = forwardRef(function Chat(
showStopGenerate && generating ? (
<Button
aria-label={t('停止生成')}
icon={<Square size={16} />}
icon={<ActionSquare size={16} />}
onClick={onStopGenerator}
/>
) : null,
+18 -3
View File
@@ -188,7 +188,11 @@ function labelProps(label) {
typeof label === 'object' &&
!React.isValidElement(label) &&
'text' in label
? { label: label.text, required: label.required, htmlFor: label.name }
? {
label: label.text,
required: label.required,
...(label.name ? { htmlFor: label.name } : {}),
}
: { label };
}
@@ -273,16 +277,27 @@ export function withField(
if (error) throw new Error(String(error));
},
});
const fieldLabel = labelProps(label);
const control =
field === undefined && props.children && Component === Controls.Input ? (
props.children
) : (
<Component {...props} ref={ref} style={style} />
<Component
{...props}
id={props.id ?? fieldLabel.htmlFor}
ref={ref}
style={style}
/>
);
// Unnamed slots remain controlled by the page; named fields use Ant Form's store.
return (
<AntForm.Item
{...(noLabel ? {} : labelProps(label))}
{...(noLabel
? {}
: {
...fieldLabel,
...(control?.props?.id ? { htmlFor: control.props.id } : {}),
})}
name={field === undefined ? undefined : fieldPath(field)}
initialValue={initValue}
rules={normalizedRules}
+104 -521
View File
@@ -18,525 +18,108 @@ For commercial licensing, please contact support@quantumnous.com
*/
import React from 'react';
import * as Icons from 'lucide-react';
import * as Icons from '../common/icons/ActionIcons';
export const IconSearch = ({ size = 16, ...props }) => (
<Icons.Search
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconPlus = ({ size = 16, ...props }) => (
<Icons.Plus
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconRefresh = ({ size = 16, ...props }) => (
<Icons.RefreshCw
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconDelete = ({ size = 16, ...props }) => (
<Icons.Trash2
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconClose = ({ size = 16, ...props }) => (
<Icons.X
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconMail = ({ size = 16, ...props }) => (
<Icons.Mail
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconKey = ({ size = 16, ...props }) => (
<Icons.KeyRound
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconEdit = ({ size = 16, ...props }) => (
<Icons.Pencil
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconSave = ({ size = 16, ...props }) => (
<Icons.Save
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconLock = ({ size = 16, ...props }) => (
<Icons.LockKeyhole
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconCopy = ({ size = 16, ...props }) => (
<Icons.Copy
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconLink = ({ size = 16, ...props }) => (
<Icons.Link
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconUser = ({ size = 16, ...props }) => (
<Icons.User
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconChevronDown = ({ size = 16, ...props }) => (
<Icons.ChevronDown
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconAlertTriangle = ({ size = 16, ...props }) => (
<Icons.TriangleAlert
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconGithubLogo = ({ size = 16, ...props }) => (
<Icons.Github
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconEyeOpened = ({ size = 16, ...props }) => (
<Icons.Eye
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconChevronUp = ({ size = 16, ...props }) => (
<Icons.ChevronUp
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconCreditCard = ({ size = 16, ...props }) => (
<Icons.CreditCard
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconMore = ({ size = 16, ...props }) => (
<Icons.Ellipsis
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconFile = ({ size = 16, ...props }) => (
<Icons.File
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconShield = ({ size = 16, ...props }) => (
<Icons.Shield
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconCode = ({ size = 16, ...props }) => (
<Icons.Code
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconBolt = ({ size = 16, ...props }) => (
<Icons.Zap
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconFilter = ({ size = 16, ...props }) => (
<Icons.Filter
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconHelpCircle = ({ size = 16, ...props }) => (
<Icons.CircleHelp
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconGift = ({ size = 16, ...props }) => (
<Icons.Gift
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconEyeClosed = ({ size = 16, ...props }) => (
<Icons.EyeOff
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconPlayCircle = ({ size = 16, ...props }) => (
<Icons.CirclePlay
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconCheckCircleStroked = ({ size = 16, ...props }) => (
<Icons.CircleCheck
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconTreeTriangleDown = ({ size = 16, ...props }) => (
<Icons.ChevronDown
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconSetting = ({ size = 16, ...props }) => (
<Icons.Settings
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconLayers = ({ size = 16, ...props }) => (
<Icons.Layers
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconUserAdd = ({ size = 16, ...props }) => (
<Icons.UserPlus
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconPulse = ({ size = 16, ...props }) => (
<Icons.Activity
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconSend = ({ size = 16, ...props }) => (
<Icons.Send
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconVideo = ({ size = 16, ...props }) => (
<Icons.Video
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconActivity = ({ size = 16, ...props }) => (
<Icons.Activity
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconDownload = ({ size = 16, ...props }) => (
<Icons.Download
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconShieldStroked = ({ size = 16, ...props }) => (
<Icons.Shield
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconMinus = ({ size = 16, ...props }) => (
<Icons.Minus
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconMenu = ({ size = 16, ...props }) => (
<Icons.Menu
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconBell = ({ size = 16, ...props }) => (
<Icons.Bell
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconUpload = ({ size = 16, ...props }) => (
<Icons.Upload
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconHistory = ({ size = 16, ...props }) => (
<Icons.History
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconServer = ({ size = 16, ...props }) => (
<Icons.Server
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconGlobe = ({ size = 16, ...props }) => (
<Icons.Globe
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconBookmark = ({ size = 16, ...props }) => (
<Icons.Bookmark
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconInfoCircle = ({ size = 16, ...props }) => (
<Icons.Info
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconExternalOpen = ({ size = 16, ...props }) => (
<Icons.ExternalLink
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconUserGroup = ({ size = 16, ...props }) => (
<Icons.Users
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconMoneyExchangeStroked = ({ size = 16, ...props }) => (
<Icons.ArrowRightLeft
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconHistogram = ({ size = 16, ...props }) => (
<Icons.ChartColumn
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconStopwatchStroked = ({ size = 16, ...props }) => (
<Icons.Timer
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconTypograph = ({ size = 16, ...props }) => (
<Icons.Type
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconTickCircle = ({ size = 16, ...props }) => (
<Icons.CircleCheck
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconImage = ({ size = 16, ...props }) => (
<Icons.Image
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconAlertCircle = ({ size = 16, ...props }) => (
<Icons.CircleAlert
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconLineChart = ({ size = 16, ...props }) => (
<Icons.ChartLine
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconSaveStroked = ({ size = 16, ...props }) => (
<Icons.Save
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const Iconbolt = ({ size = 16, ...props }) => (
<Icons.Zap
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconClock = ({ size = 16, ...props }) => (
<Icons.Clock
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconTick = ({ size = 16, ...props }) => (
<Icons.Check
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconArrowRight = ({ size = 16, ...props }) => (
<Icons.ArrowRight
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
export const IconArticle = ({ size = 16, ...props }) => (
<Icons.FileText
{...props}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
// Tooltip and Popover need a ref to the DOM node to avoid findDOMNode in StrictMode.
const createIcon = (Icon, displayName) => {
const Component = React.forwardRef(function LegacyIcon(
{ size = 16, ...props },
ref,
) {
return (
<Icon
{...props}
ref={ref}
size={
{ small: 14, default: 16, large: 20, 'extra-large': 24 }[size] || size
}
/>
);
});
Component.displayName = displayName;
return Component;
};
export const IconSearch = createIcon(Icons.Search, 'IconSearch');
export const IconPlus = createIcon(Icons.Plus, 'IconPlus');
export const IconRefresh = createIcon(Icons.RefreshCw, 'IconRefresh');
export const IconDelete = createIcon(Icons.Trash2, 'IconDelete');
export const IconClose = createIcon(Icons.X, 'IconClose');
export const IconMail = createIcon(Icons.Mail, 'IconMail');
export const IconKey = createIcon(Icons.KeyRound, 'IconKey');
export const IconEdit = createIcon(Icons.Pencil, 'IconEdit');
export const IconSave = createIcon(Icons.Save, 'IconSave');
export const IconLock = createIcon(Icons.LockKeyhole, 'IconLock');
export const IconCopy = createIcon(Icons.Copy, 'IconCopy');
export const IconLink = createIcon(Icons.Link, 'IconLink');
export const IconUser = createIcon(Icons.User, 'IconUser');
export const IconChevronDown = createIcon(Icons.ChevronDown, 'IconChevronDown');
export const IconAlertTriangle = createIcon(
Icons.TriangleAlert,
'IconAlertTriangle',
);
export const IconGithubLogo = createIcon(Icons.Github, 'IconGithubLogo');
export const IconEyeOpened = createIcon(Icons.Eye, 'IconEyeOpened');
export const IconChevronUp = createIcon(Icons.ChevronUp, 'IconChevronUp');
export const IconCreditCard = createIcon(Icons.CreditCard, 'IconCreditCard');
export const IconMore = createIcon(Icons.Ellipsis, 'IconMore');
export const IconFile = createIcon(Icons.File, 'IconFile');
export const IconShield = createIcon(Icons.Shield, 'IconShield');
export const IconCode = createIcon(Icons.Code, 'IconCode');
export const IconBolt = createIcon(Icons.Zap, 'IconBolt');
export const IconFilter = createIcon(Icons.Filter, 'IconFilter');
export const IconHelpCircle = createIcon(Icons.CircleHelp, 'IconHelpCircle');
export const IconGift = createIcon(Icons.Gift, 'IconGift');
export const IconEyeClosed = createIcon(Icons.EyeOff, 'IconEyeClosed');
export const IconPlayCircle = createIcon(Icons.CirclePlay, 'IconPlayCircle');
export const IconCheckCircleStroked = createIcon(
Icons.CircleCheck,
'IconCheckCircleStroked',
);
export const IconTreeTriangleDown = createIcon(
Icons.ChevronDown,
'IconTreeTriangleDown',
);
export const IconSetting = createIcon(Icons.Settings, 'IconSetting');
export const IconLayers = createIcon(Icons.Layers, 'IconLayers');
export const IconUserAdd = createIcon(Icons.UserPlus, 'IconUserAdd');
export const IconPulse = createIcon(Icons.Activity, 'IconPulse');
export const IconSend = createIcon(Icons.Send, 'IconSend');
export const IconVideo = createIcon(Icons.Video, 'IconVideo');
export const IconActivity = createIcon(Icons.Activity, 'IconActivity');
export const IconDownload = createIcon(Icons.Download, 'IconDownload');
export const IconShieldStroked = createIcon(Icons.Shield, 'IconShieldStroked');
export const IconMinus = createIcon(Icons.Minus, 'IconMinus');
export const IconMenu = createIcon(Icons.Menu, 'IconMenu');
export const IconBell = createIcon(Icons.Bell, 'IconBell');
export const IconUpload = createIcon(Icons.Upload, 'IconUpload');
export const IconHistory = createIcon(Icons.History, 'IconHistory');
export const IconServer = createIcon(Icons.Server, 'IconServer');
export const IconGlobe = createIcon(Icons.Globe, 'IconGlobe');
export const IconBookmark = createIcon(Icons.Bookmark, 'IconBookmark');
export const IconInfoCircle = createIcon(Icons.Info, 'IconInfoCircle');
export const IconExternalOpen = createIcon(
Icons.ExternalLink,
'IconExternalOpen',
);
export const IconUserGroup = createIcon(Icons.Users, 'IconUserGroup');
export const IconMoneyExchangeStroked = createIcon(
Icons.ArrowRightLeft,
'IconMoneyExchangeStroked',
);
export const IconHistogram = createIcon(Icons.ChartColumn, 'IconHistogram');
export const IconStopwatchStroked = createIcon(
Icons.Timer,
'IconStopwatchStroked',
);
export const IconTypograph = createIcon(Icons.Type, 'IconTypograph');
export const IconTickCircle = createIcon(Icons.CircleCheck, 'IconTickCircle');
export const IconImage = createIcon(Icons.Image, 'IconImage');
export const IconAlertCircle = createIcon(Icons.CircleAlert, 'IconAlertCircle');
export const IconLineChart = createIcon(Icons.ChartLine, 'IconLineChart');
export const IconSaveStroked = createIcon(Icons.Save, 'IconSaveStroked');
export const Iconbolt = createIcon(Icons.Zap, 'Iconbolt');
export const IconClock = createIcon(Icons.Clock, 'IconClock');
export const IconTick = createIcon(Icons.Check, 'IconTick');
export const IconArrowRight = createIcon(Icons.ArrowRight, 'IconArrowRight');
export const IconArticle = createIcon(Icons.FileText, 'IconArticle');
+1
View File
@@ -29,6 +29,7 @@ import { bootstrapLanguage, createBrowserEnv } from './i18n/bootstrap';
import { API } from './helpers';
import './styles/tokens.css';
import './index.css';
import './styles/action-icons.css';
import './styles/org.css';
import './styles/prototype.css';
import './styles/user-center.css';
+14 -7
View File
@@ -17,6 +17,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import {
Eye as ActionEye,
Check as ActionCheck,
X as ActionX,
Ban as ActionBan,
RotateCw as ActionRotateCw,
} from '@/components/common/icons/ActionIcons';
import {
ConsoleCard,
ConsoleSearchBar,
@@ -35,7 +42,7 @@ import {
Spin,
Typography,
} from '@/components/ui';
import { Search, Eye, Check, X, RotateCw, Ban } from 'lucide-react';
import { Search } from 'lucide-react';
import { API, showError, showSuccess } from '../../helpers';
import {
INVOICE_STATUS,
@@ -298,7 +305,7 @@ const AdminInvoice = () => {
<Button
size='small'
theme='borderless'
icon={<Eye size={14} />}
icon={<ActionEye size={14} />}
onClick={() => handleViewDetail(record.id)}
/>
{record.status === INVOICE_STATUS.PENDING && (
@@ -307,7 +314,7 @@ const AdminInvoice = () => {
size='small'
theme='borderless'
type='primary'
icon={<Check size={14} />}
icon={<ActionCheck size={14} />}
onClick={() => {
setApproveId(record.id);
setApproveVisible(true);
@@ -319,7 +326,7 @@ const AdminInvoice = () => {
size='small'
theme='borderless'
type='danger'
icon={<X size={14} />}
icon={<ActionX size={14} />}
onClick={() => {
setRejectId(record.id);
setRejectVisible(true);
@@ -335,7 +342,7 @@ const AdminInvoice = () => {
size='small'
theme='borderless'
type='danger'
icon={<Ban size={14} />}
icon={<ActionBan size={14} />}
onClick={() => handleFailCancel(record.id)}
>
{t('取消')}
@@ -346,7 +353,7 @@ const AdminInvoice = () => {
<Button
size='small'
theme='borderless'
icon={<RotateCw size={14} />}
icon={<ActionRotateCw size={14} />}
onClick={() => handleRetry(record.id)}
>
{t('重试')}
@@ -355,7 +362,7 @@ const AdminInvoice = () => {
size='small'
theme='borderless'
type='danger'
icon={<Ban size={14} />}
icon={<ActionBan size={14} />}
onClick={() => handleFailCancel(record.id)}
>
{t('取消')}

Some files were not shown because too many files have changed in this diff Show More