ui-ux-next-kit 0.0.0-stage → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +167 -2
- package/SKILL.md +115 -0
- package/bin/cli.js +196 -0
- package/examples/admin-home/MASTER.md +36 -0
- package/examples/admin-home/dashboard.html +127 -0
- package/examples/admin-home/pages/dashboard.md +12 -0
- package/examples/admin-home/tokens.css +52 -0
- package/examples/admin-home/tokens.json +44 -0
- package/examples/site-home/MASTER.md +42 -0
- package/examples/site-home/home.html +222 -0
- package/examples/site-home/pages/home.md +13 -0
- package/examples/site-home/tokens.css +60 -0
- package/examples/site-home/tokens.json +48 -0
- package/package.json +39 -4
- package/references/audit-dimensions.md +60 -0
- package/references/exemplar-deploy.md +72 -0
- package/references/exemplar-rpa-architecture.md +38 -0
- package/references/exemplar-rpa-console.md +120 -0
- package/references/figma-handoff.md +36 -0
- package/references/public-components.md +950 -0
- package/references/rules-sediment.md +15 -0
- package/references/tech-stacks.md +48 -0
- package/scripts/check-globals.sh +37 -0
- package/scripts/check-tokens.sh +42 -0
- package/scripts/lib.sh +13 -0
- package/scripts/run-all.sh +7 -0
- package/skill.json +16 -0
- package/templates/cursor-rules/figma-handoff.mdc +21 -0
- package/templates/cursor-rules/frontend-stack.mdc +97 -0
- package/templates/fix-prompts/P-A-tokens.md +23 -0
- package/templates/fix-prompts/P-D-states.md +24 -0
- package/templates/fix-prompts/P-H-globals.md +21 -0
- package/templates/fix-prompts/base.md +26 -0
- package/templates/report-template.md +67 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 规则沉淀建议
|
|
2
|
+
|
|
3
|
+
| 维度 | rules 约束(示例) | 自动拦截 |
|
|
4
|
+
| --- | --- | --- |
|
|
5
|
+
| A Token | 颜色/间距/圆角只用 Token | Stylelint `color-no-hex`、`declaration-no-important` |
|
|
6
|
+
| 推荐栈 | 实施时复制 `frontend-stack.mdc` 和 `figma-handoff.mdc` 到目标 `.cursor/rules/`。前者锁版本和 antd 6 API,并写明 UI、UX 规范未尽事宜严格按照 antd 的规范实现。后者预防把 Arco 硬套成代码 | 范本 `pnpm verify:console-antd`;新项目拷扫描脚本后改目录 |
|
|
7
|
+
| B 组件 | 桌面列表只用一套 DataTable,筛选只用一套筛选条,操作列只用一套间距 | `no-restricted-imports` 禁桌面再引第二套 UI 库 |
|
|
8
|
+
| 列表 | 筛选控件高 34px;空状态文案说明是没数据还是筛选为空;满高表用剩余高度,不靠内容撑高反推 | 代码评审;有条件再加 verify |
|
|
9
|
+
| 动效 | 进场动画尊重 `prefers-reduced-motion` | 代码评审 |
|
|
10
|
+
| C 布局 | 统一 Layout;内边距用 Token | 代码评审 |
|
|
11
|
+
| D 交互 | 三态 + 防重 + 危险确认 | 评审 + 自查清单 |
|
|
12
|
+
| H 框架 | 禁全局覆盖组件库类名;弹层挂载统一。开工时复制 `templates/cursor-rules/figma-handoff.mdc`:Arco 不硬套,外观走 token,覆盖分批删,交互留 antd 原有行为 | Stylelint 禁 `.ant-*` 全局选择器;`scripts/check-globals.sh` 扫 `.ant-*` 当线索 |
|
|
13
|
+
| 发版 | 默认 Jenkins 构建镜像,目标机用生产 compose 拉起。见 `exemplar-deploy.md` | 流水线参数:推送默认开,上线默认关 |
|
|
14
|
+
|
|
15
|
+
规则要短、要能对应某次审计发现。
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 组织推荐栈与定档
|
|
2
|
+
|
|
3
|
+
## 固定推荐栈
|
|
4
|
+
|
|
5
|
+
**参考控制台**(`apps/console`)。细则、版本和「不要原样抄」的部分见 `exemplar-rpa-console.md`。
|
|
6
|
+
|
|
7
|
+
框架仍是 React 19 + Ant Design 6,并带上范本里的 ProComponents、ProLayout、React Router 7、TanStack Query、OpenAPI 类型生成。主色 `#1f6feb`,主题只走 `ConfigProvider`。
|
|
8
|
+
|
|
9
|
+
- 新项目、从无组件库迁入的项目:按范本起,不另选 UI 库,不采用更低的 React / Ant Design 主版本。
|
|
10
|
+
- 已在用 React + Ant Design 但低于 19 或 6,或没有 ProLayout / 统一主题:版本和壳的差距单独记一条,排期对齐范本。单次样式修复不顺手升级、不顺手换壳。
|
|
11
|
+
|
|
12
|
+
## 为什么固定这套
|
|
13
|
+
|
|
14
|
+
- 按钮、表格、表单、选择器、日期、空状态、确认、消息来自同一套组件。
|
|
15
|
+
- 品牌色 / 字号 / 圆角 / 暗色走 `ConfigProvider` theme。
|
|
16
|
+
- 弹层自带挂载与层级,避免手写 `z-index: 9999`。
|
|
17
|
+
- 危险操作用 `Button danger` + `Popconfirm` / `Modal.confirm`。
|
|
18
|
+
|
|
19
|
+
## 三档判定
|
|
20
|
+
|
|
21
|
+
1. **已经是 React + Ant Design**
|
|
22
|
+
基准 = 该项目 antd 版本与主题。问题写成「组件库没用好」。修复收回 Token 与组件,不换库。版本低于 19/6 时另记升级项。
|
|
23
|
+
|
|
24
|
+
2. **另一套完整组件库,且页面之间一致**(如 Vue + Element;或自研完整控件层 + Token 且页面大体一致)
|
|
25
|
+
记 Info:「与组织推荐栈不一致」。处置:需负责人确认是否迁移。页面内部一致时,不因未用 Ant Design 判 High。
|
|
26
|
+
但空状态 / 筛选 / 确认框若已各页不同,仍可单独成 Medium/High。
|
|
27
|
+
|
|
28
|
+
3. **没有组件库,或同一职责多套手写控件**
|
|
29
|
+
至少 Medium。空状态、筛选、表格、危险操作已各页不同 → High。修复方向:按 `exemplar-rpa-console.md` 迁到参考控制台那套前端。
|
|
30
|
+
|
|
31
|
+
## 仅线上、无仓库
|
|
32
|
+
|
|
33
|
+
1. DOM 中 `ant-` / `arco-` / `el-` 数量;脚本是打包产物还是按页自制组件。
|
|
34
|
+
2. Token 文件 vs 页面样式体积、选择器重合。Token 在、组件选择器几乎不重合 →「有调色板,没有组件层」。
|
|
35
|
+
3. 表 / 空状态 / 状态标签 / 筛选 / 输入各有几套类名;超过一套则组件不一致。
|
|
36
|
+
|
|
37
|
+
## 推荐映射
|
|
38
|
+
|
|
39
|
+
| 场景 | 使用 |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| 页面骨架 | `ProLayout`(`layout="mix"`,侧栏 220) |
|
|
42
|
+
| 列表 | `Table` |
|
|
43
|
+
| 筛选 | 公共筛选组件(`references/public-components.md`,源自 DESIGN.md §3.1) |
|
|
44
|
+
| 空数据 | `Empty`(区分无数据 vs 筛选为空) |
|
|
45
|
+
| 加载 / 失败 | `Spin` / `Skeleton`;失败提供重试 |
|
|
46
|
+
| 危险操作 | `Button danger` + `Popconfirm` / `Modal.confirm` |
|
|
47
|
+
| 反馈 | `message` / `notification` |
|
|
48
|
+
| 主题 | 只改 `ConfigProvider` theme |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Scan .ant-/.el-/.arco- overrides, native controls, z-index, confirm().
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
source "$DIR/lib.sh"
|
|
6
|
+
ROOT="${1:-.}"
|
|
7
|
+
cd "$ROOT"
|
|
8
|
+
TOOL="$(resolve_search)"
|
|
9
|
+
|
|
10
|
+
echo "=== ui-ux-next-kit: check-globals ==="
|
|
11
|
+
echo "cwd: $(pwd)"
|
|
12
|
+
echo "search: $TOOL"
|
|
13
|
+
echo
|
|
14
|
+
|
|
15
|
+
if [[ "$TOOL" != "grep" ]]; then
|
|
16
|
+
EX=(--glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' --glob '!**/.next/**')
|
|
17
|
+
echo "--- .ant- / .el- / .arco- ---"
|
|
18
|
+
"$TOOL" -n --count-matches '\.ant-|\.el-|\.arco-' --glob '*.{css,less,scss,tsx,vue}' "${EX[@]}" . 2>/dev/null | sort -t: -k2 -nr | head -40 || true
|
|
19
|
+
echo; "$TOOL" -n '\.ant-|\.el-|\.arco-' --glob '*.{css,less,scss,tsx,vue}' "${EX[@]}" . 2>/dev/null | head -25 || true
|
|
20
|
+
echo; echo "--- native table/button/select ---"
|
|
21
|
+
"$TOOL" -n --count-matches '<table|<button|<select' --glob '*.{tsx,jsx,vue}' "${EX[@]}" . 2>/dev/null | sort -t: -k2 -nr | head -30 || true
|
|
22
|
+
echo; echo "--- z-index ---"
|
|
23
|
+
"$TOOL" -n --count-matches 'z-index|zIndex' --glob '*.{css,less,scss,tsx,jsx,vue,ts,js}' "${EX[@]}" . 2>/dev/null | sort -t: -k2 -nr | head -30 || true
|
|
24
|
+
echo; echo "--- confirm / alert ---"
|
|
25
|
+
"$TOOL" -n 'window\.confirm\(|[^.\w]confirm\(|\balert\(' --glob '*.{tsx,jsx,ts,js,vue}' "${EX[@]}" . 2>/dev/null | head -40 || true
|
|
26
|
+
else
|
|
27
|
+
echo "(ripgrep not installed; using grep -RE)"
|
|
28
|
+
echo "--- .ant- / .el- / .arco- sample ---"
|
|
29
|
+
grep -REn --include='*.css' --include='*.less' --include='*.scss' --include='*.tsx' --include='*.vue' \
|
|
30
|
+
--exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.next \
|
|
31
|
+
'\.ant-|\.el-|\.arco-' . 2>/dev/null | head -40 || true
|
|
32
|
+
echo; echo "--- confirm / alert sample ---"
|
|
33
|
+
grep -REn --include='*.js' --include='*.ts' --include='*.tsx' --include='*.jsx' --include='*.vue' \
|
|
34
|
+
--exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.next \
|
|
35
|
+
'window\.confirm\|confirm(\|alert(' . 2>/dev/null | head -40 || true
|
|
36
|
+
fi
|
|
37
|
+
echo; echo "Done."
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Scan hardcoded colors, inline styles, !important, Tailwind arbitrary values.
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
# shellcheck source=lib.sh
|
|
6
|
+
source "$DIR/lib.sh"
|
|
7
|
+
ROOT="${1:-.}"
|
|
8
|
+
cd "$ROOT"
|
|
9
|
+
TOOL="$(resolve_search)"
|
|
10
|
+
|
|
11
|
+
echo "=== ui-ux-next-kit: check-tokens ==="
|
|
12
|
+
echo "cwd: $(pwd)"
|
|
13
|
+
echo "search: $TOOL"
|
|
14
|
+
echo
|
|
15
|
+
|
|
16
|
+
if [[ "$TOOL" != "grep" ]]; then
|
|
17
|
+
EX=(--glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' --glob '!**/.next/**')
|
|
18
|
+
echo "--- hardcoded #hex / rgb(a) ---"
|
|
19
|
+
"$TOOL" -n --count-matches '#[0-9a-fA-F]{3,8}\b|rgba?\(' --glob '*.{tsx,jsx,vue,css,less,scss}' "${EX[@]}" . 2>/dev/null | sort -t: -k2 -nr | head -40 || true
|
|
20
|
+
echo; echo "sample:"; "$TOOL" -n '#[0-9a-fA-F]{3,8}\b|rgba?\(' --glob '*.{tsx,jsx,vue,css,less,scss}' "${EX[@]}" . 2>/dev/null | head -30 || true
|
|
21
|
+
echo; echo "--- inline style ---"
|
|
22
|
+
"$TOOL" -n --count-matches 'style=\{\{|:style=' --glob '*.{tsx,jsx,vue}' "${EX[@]}" . 2>/dev/null | sort -t: -k2 -nr | head -30 || true
|
|
23
|
+
echo; echo "--- !important ---"
|
|
24
|
+
"$TOOL" -n --count-matches '!important' --glob '*.{css,less,scss,tsx,jsx,vue}' "${EX[@]}" . 2>/dev/null | sort -t: -k2 -nr | head -30 || true
|
|
25
|
+
echo; echo "--- Tailwind arbitrary ---"
|
|
26
|
+
"$TOOL" -n --count-matches '[a-z]+-\[[^\]]+\]' --glob '*.{tsx,jsx,vue}' "${EX[@]}" . 2>/dev/null | sort -t: -k2 -nr | head -20 || true
|
|
27
|
+
else
|
|
28
|
+
echo "(ripgrep not installed; using grep -RE. Prefer: brew install ripgrep)"
|
|
29
|
+
echo "--- hardcoded #hex / rgb(a) sample ---"
|
|
30
|
+
grep -REn --include='*.css' --include='*.tsx' --include='*.jsx' --include='*.vue' --include='*.less' --include='*.scss' \
|
|
31
|
+
--exclude-dir=node_modules --exclude-dir=dist --exclude-dir=build --exclude-dir=.next \
|
|
32
|
+
'#[0-9a-fA-F]{3,8}|rgba?\(' . 2>/dev/null | head -40 || true
|
|
33
|
+
echo; echo "--- inline style sample ---"
|
|
34
|
+
grep -REn --include='*.tsx' --include='*.jsx' --include='*.vue' \
|
|
35
|
+
--exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.next \
|
|
36
|
+
'style=\{\{|:style=' . 2>/dev/null | head -30 || true
|
|
37
|
+
echo; echo "--- !important sample ---"
|
|
38
|
+
grep -REn --include='*.css' --include='*.less' --include='*.scss' \
|
|
39
|
+
--exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.next \
|
|
40
|
+
'!important' . 2>/dev/null | head -30 || true
|
|
41
|
+
fi
|
|
42
|
+
echo; echo "Done. Exclude Token definition files when interpreting counts."
|
package/scripts/lib.sh
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Shared search helper: prefer ripgrep, fall back to grep -RE.
|
|
3
|
+
resolve_search() {
|
|
4
|
+
if command -v rg >/dev/null 2>&1; then
|
|
5
|
+
echo rg
|
|
6
|
+
elif [[ -x /opt/homebrew/bin/rg ]]; then
|
|
7
|
+
echo /opt/homebrew/bin/rg
|
|
8
|
+
elif [[ -x /usr/local/bin/rg ]]; then
|
|
9
|
+
echo /usr/local/bin/rg
|
|
10
|
+
else
|
|
11
|
+
echo grep
|
|
12
|
+
fi
|
|
13
|
+
}
|
package/skill.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ui-ux-next-kit",
|
|
3
|
+
"displayName": "UI/UX Next Kit",
|
|
4
|
+
"description": "Extensible UI/UX Agent Skill kit. Restoring a page starts at references/public-components.md and that section's checklist. Audits stay read-only and write YYYYMMDD-[project]UI-UX审计报告.md at the project root.",
|
|
5
|
+
"version": "0.0.2",
|
|
6
|
+
"author": "UI/UX Next Kit",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": ["ui", "ux", "audit", "kit", "antd", "react", "design-system", "agent-skill", "cursor"],
|
|
9
|
+
"platforms": ["cursor", "claude", "codex"],
|
|
10
|
+
"aliases": ["ui-ux-next-audit"],
|
|
11
|
+
"install": {
|
|
12
|
+
"npm": "npm install ui-ux-next-kit",
|
|
13
|
+
"cursor": "postinstall links the package to .cursor/skills/ui-ux-next-kit and the two rules into .cursor/rules. npm update refreshes both.",
|
|
14
|
+
"note": "Agent loads SKILL.md when the user asks to restore a page or run a UI/UX audit."
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Figma 交付是 Arco 时不要硬套;外观用 antd v6 token,保留组件交互
|
|
3
|
+
globs: "**/*.{tsx,ts,css,less,scss}"
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 设计稿不要硬套
|
|
8
|
+
|
|
9
|
+
Figma 交付若是 Arco,它只提供手绘视觉规格。界面代码用 antd v6 和项目里已有的公共组件。
|
|
10
|
+
|
|
11
|
+
已经出过的问题:按 Arco 稿改写了 antd `Button`,按钮只剩外观,`loading`、`disabled`、`danger`、`type`、`htmlType` 和图标按钮都不再按组件自己的行为走。不要再做。
|
|
12
|
+
|
|
13
|
+
不要做:
|
|
14
|
+
|
|
15
|
+
- 不要按 Arco 的组件名、图层结构生成页面,也不要再装一套 UI 库来还原设计稿。
|
|
16
|
+
- 不要重写 `.ant-btn` 的结构、指针和内部节点。按钮继续用 antd `Button`,高度、圆角、字号进 token。
|
|
17
|
+
- 不要为贴某一帧新增或加厚 `.ant-*` 内部类名覆盖。色、字号、间距、圆角写进 `ConfigProvider` token 或 `var(--ant-*)`。
|
|
18
|
+
- 已有覆盖分批删:一批只迁一类(颜色、圆角或控件高度),迁完再动下一屏。
|
|
19
|
+
- 不要改组件原有交互:焦点、键盘、展开、校验、确认保持 antd 默认。UI、UX 规范未尽事宜,严格按照 antd 的规范实现。
|
|
20
|
+
|
|
21
|
+
对不上名字时,选语义最近的 antd 组件,把规格里的尺寸放进 token。细则见套件 `references/figma-handoff.md`。
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 前端框架版本与 antd v6 API(写 UI 必读;弃用项用 verify:antd-v6 卡住)
|
|
3
|
+
globs: "**/*.{tsx,ts}"
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 前端框架版本
|
|
8
|
+
|
|
9
|
+
对齐参考控制台(`apps/console`)。版本以范本 `package.json` 的精确号为准,本文件不另定一套。当前范本是 **React 19.3**、**antd 6.6.5**、**@ant-design/pro-components 3.1.14-6**、**@ant-design/icons 6.3.4**。有手机壳时 **antd-mobile 5.43.0**。
|
|
10
|
+
|
|
11
|
+
- `package.json` 写精确版本,禁止 `^`,禁止顺手升级。要升级先改范本并跑过验证,再同步到本项目。
|
|
12
|
+
- 壳是 Vite + React Router 的 SPA。不要引入 Next.js,也不要使用 Ant Design Pro 的 Umi 脚手架。ProComponents 只当组件库用。
|
|
13
|
+
- 若前后端放在同一仓库:界面在 `apps/console`,接口在 `apps/api`,契约在 `contracts/openapi.yaml`。控制台不读库,API 不渲染页面。构建后的静态文件可以由 API 托管。细则见套件 `references/exemplar-rpa-architecture.md`。执行面(Worker、Temporal、Playwright)不是这套后台的必选项。
|
|
14
|
+
- 业务页不要直接铺一屏裸 `ProTable` / `ProForm`。走适配层(范本是 `DataTable`),Pro 的 beta 变更只改适配层。
|
|
15
|
+
- 主题只走 `ConfigProvider`。颜色优先 `var(--ant-*)`,不要为单页全局覆盖大片 `.ant-*`。
|
|
16
|
+
|
|
17
|
+
本文件来自范本 `.cursor/rules/console-antd-v6.mdc`。控制台专有路径(执行记录、队列)不抄进来;弃用 API 和版本纪律原样保留。
|
|
18
|
+
|
|
19
|
+
## 未尽事宜
|
|
20
|
+
|
|
21
|
+
UI、UX 规范未尽事宜,严格按照 antd 的规范实现。规范已经写了的尺寸、文案、顺序和状态仍以规范为准。
|
|
22
|
+
|
|
23
|
+
## 手机(视口 < 768px 时才做)
|
|
24
|
+
|
|
25
|
+
只做桌面的项目不要安装 `antd-mobile`。要做手机壳时:
|
|
26
|
+
|
|
27
|
+
- 断点只认一处:`useIsMobile()` 对齐 antd `md`。CSS 用 `@media (max-width: 767.98px)`,不另起断点。
|
|
28
|
+
- 外壳分开:桌面 `ProLayout`,手机单独的壳。业务请求和状态放共用 hook。页面入口只切换一次,不在一个文件里铺 `isMobile ?`。
|
|
29
|
+
- `antd-mobile` 只许出现在手机壳、`Responsive*`(手机一套、桌面 antd 一套)和 `*Mobile` 组件。桌面路径不得 import。
|
|
30
|
+
- 桌面右侧 Drawer,手机改为底部弹层。正文共用同一个内容组件。
|
|
31
|
+
- 触控目标至少 44px。改完先看手机主路径,再看桌面,桌面不得因手机适配回归。
|
|
32
|
+
|
|
33
|
+
## 动手前
|
|
34
|
+
|
|
35
|
+
1. 新页面优先用项目里的列表适配层和筛选条,不从 antd 5 项目原样粘贴 prop。
|
|
36
|
+
2. 从 antd 5 的页面拷 UI 时,先按下表改一轮。
|
|
37
|
+
3. 本地出现 `[antd: …] is deprecated` 或 TS `ts(6385)` 删除线,同一处必须改。禁止 `@ts-expect-error` 或忽略。
|
|
38
|
+
4. 提交前跑版本检查。范本脚本是 `scripts/verify-console-antd-v6.mts`(`pnpm verify:console-antd`)。新项目把它拷过来,把扫描目录改成自己的 `src`,脚本名可用 `verify:antd-v6`。只含 `antd-mobile`、没有 `from "antd"` 的文件,跳过那些在 antd-mobile 5 里仍合法的 prop(如 `visible`、`destroyOnClose`)。
|
|
39
|
+
|
|
40
|
+
## 弃用 API → antd 6
|
|
41
|
+
|
|
42
|
+
| 弃用 | 改用 |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| `Modal` / `Drawer` / `Dropdown` 等的 `visible` | `open` |
|
|
45
|
+
| `onVisibleChange` | `onOpenChange` |
|
|
46
|
+
| `Modal` / `Drawer` 的 `destroyOnClose` | `destroyOnHidden` |
|
|
47
|
+
| `Tabs` 的 `destroyInactiveTabPane` | `destroyOnHidden` |
|
|
48
|
+
| `Space` 的 `direction` | `orientation`(`vertical` / `horizontal`) |
|
|
49
|
+
| `Alert` 的 `message` | `title` |
|
|
50
|
+
| `Spin` 的 `tip` | `description` |
|
|
51
|
+
| `Drawer` 的 `width` | `size`(数字或 `default` / `large`) |
|
|
52
|
+
| `Drawer` / `Modal` 的 `maskClosable` | `mask={{ closable: false }}`(需要关掉遮罩点击时) |
|
|
53
|
+
| `Input` 的 `addonBefore` / `addonAfter` | `Space.Compact` |
|
|
54
|
+
| `dropdownClassName` / 部分 `overlayClassName` | `classNames` / `popupClassName`(按组件文档) |
|
|
55
|
+
| `Select` 的 `dropdownMatchSelectWidth` | `popupMatchSelectWidth` |
|
|
56
|
+
| `Card` / `Modal` / `Drawer` 的 `bodyStyle` / `headStyle` | `styles.body` / `styles.header` |
|
|
57
|
+
|
|
58
|
+
`Modal` 仍可用 `width`。`Drawer` 不要写 `width`。
|
|
59
|
+
|
|
60
|
+
`destroyOnHidden` 时 Form 会随层卸载:先打开,再在 `useEffect` 或打开回调里 `setFieldsValue` / `resetFields`。不要在层关着的时候写表单。
|
|
61
|
+
|
|
62
|
+
## 系统设置(基础框架)
|
|
63
|
+
|
|
64
|
+
后台要有「系统设置 → 系统配置」。站点名称和 Logo 不写死在壳里。范本页是 `SystemSettingsPage.tsx`,品牌数据是 `lib/siteBrand.ts`。
|
|
65
|
+
|
|
66
|
+
直出一整套后台时,先按套件 `references/public-components.md` 的「直出路由兜底」做菜单,不能只交登录和数据统计。系统配置的页签是:品牌标识、登录安全、登录验证码、列表刷新、界面动效、执行端发布。列表刷新和界面动效只存本机。「执行端发布」页签要在,不抄范本的发布命令。
|
|
67
|
+
|
|
68
|
+
品牌标识和登录页、顶栏是同一份,见套件 `references/public-components.md` 的「品牌」(范本 `docs/UI_SPEC_EXTRACTION.md` §15、`docs/DESIGN.md` §3.12)。四个槽:`logo`(登录页高 40px,桌面顶栏 28px,手机列表顶栏 26px;说明里的 32px 不是这三处高度)、`logo_dark`(只换深色顶栏;不传时只对 SVG 自动改浅色字,位图必须另传;登录页不用)、`logo_collapsed`(侧栏收起才用,现在的壳不显示)、`favicon`(浏览器标签)。另有 `site_name`(最长 40,可空)、`site_tag`(最长 16,可空,登录页和顶栏同一枚)、`logo_alt`(必填,最长 40,兼作页面标题)。上传立刻生效,文字要点保存。
|
|
69
|
+
|
|
70
|
+
- 公开 `GET /branding`。改文字 `PUT /settings/branding`。传图 `PUT /settings/branding/{slot}`。格式只收 SVG / PNG / JPG / WEBP / GIF / ICO。
|
|
71
|
+
- 上传成功后通知壳重新取品牌,不要求重新登录。每个槽可恢复默认。上传区可点击、可拖拽,并有 `aria-label`。
|
|
72
|
+
- 顶栏、登录页、favicon 都读这份配置。深色且没有 `logo_dark` 时,位图不要假装能自动变色。
|
|
73
|
+
|
|
74
|
+
当前任务和分组表用同一套圆标,见套件 `references/public-components.md` 的「机器人头像」(范本 `docs/UI_SPEC_EXTRACTION.md` §16、`docs/DESIGN.md` §3.13)。直出后台的顶栏默认不放这组圆,右侧停在通知、主题、用户。有执行机才加在通知左边,桌面 24px、手机 22px。当前任务的圆在标题下第二行,28px,叠距 8px,字号 18px,才从左撞入。离线用不透明灰。
|
|
75
|
+
|
|
76
|
+
## 列表
|
|
77
|
+
|
|
78
|
+
会随数据增长的列表都要分页,表格、卡片、抽屉里的子列表都算。
|
|
79
|
+
|
|
80
|
+
- 优先服务端分页(`limit` / `offset` + `total`)。接口没有就先补接口,不在前端拉全量再截断。
|
|
81
|
+
- 禁止「拉全量再只显示前 N 条」冒充分页。摘要卡若只看最近几条,必须有入口进完整分页列表。
|
|
82
|
+
- 桌面用表格分页;手机用上滑加载或简单分页,查询参数同一份。
|
|
83
|
+
- 轮询只刷当前页。有界且很小的枚举可以不分页,但要说得清上界。
|
|
84
|
+
|
|
85
|
+
## 发版
|
|
86
|
+
|
|
87
|
+
默认 Jenkins 构建 Docker 镜像,目标机 `docker compose -f docker-compose.prod.yml pull && up -d`。不把本机构建或拷贝 `dist` 当正式发版。上线参数默认关闭。凭据放 Jenkins Credentials。Dockerfile 不要写 `# syntax=docker/dockerfile`。纯前端镜像只留 nginx 和构建产物;同仓有 API 时仍是这一条流水线,由 API 托管静态文件。细则见套件 `references/exemplar-deploy.md`。
|
|
88
|
+
|
|
89
|
+
## 设计稿
|
|
90
|
+
|
|
91
|
+
Figma 交付若是 Arco,按同目录 `figma-handoff.mdc` 预防:不按 Arco 组件生成页面,不新增 `.ant-*` 覆盖贴像素,外观只进 token,交互留 antd 原有行为。
|
|
92
|
+
|
|
93
|
+
## 参考
|
|
94
|
+
|
|
95
|
+
- 范本规则:`.cursor/rules/console-antd-v6.mdc`
|
|
96
|
+
- 范本扫描:`scripts/verify-console-antd-v6.mts`
|
|
97
|
+
- 列表与筛选的成功做法:本套件 `references/public-components.md`。可复用的是筛选条加满高表;API执行记录只是填进去的一页,换列表时换列和文案。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# P-A · 样式收敛到 Token
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
仓库:[项目名]。只改前端,不动接口。
|
|
5
|
+
|
|
6
|
+
背景:硬编码颜色 [N] 处、内联 style [M] 处,分布在 [K] 个文件。
|
|
7
|
+
|
|
8
|
+
基准:Token 在 [路径];若无则先建最小 Token 集并接入 ConfigProvider。
|
|
9
|
+
|
|
10
|
+
要做:
|
|
11
|
+
1. 硬编码色 → 语义 Token;无法对应列入待设计确认。
|
|
12
|
+
2. 内联 style 中的色/间距/圆角迁出;仅运行时动态值可保留。
|
|
13
|
+
3. 不改变实际布局尺寸。
|
|
14
|
+
|
|
15
|
+
不要做:不改数据流;不重写整文件;不碰范围外;不新增 UI 依赖;不改组件库默认主题算法。设计稿是 Arco 时,不按它的组件重画,不用新的 `.ant-*` 覆盖贴像素。
|
|
16
|
+
|
|
17
|
+
自查清单:
|
|
18
|
+
[ ] 硬编码色剩余命中已说明
|
|
19
|
+
[ ] 内联剩余均为动态值
|
|
20
|
+
[ ] 主色单一 Token 来源
|
|
21
|
+
[ ] 代表页截图
|
|
22
|
+
[ ] 构建与 lint 通过
|
|
23
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# P-D · 交互状态补齐
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
仓库:[项目名]。只改前端,不动接口。
|
|
5
|
+
|
|
6
|
+
背景:缺 loading/empty/error;提交无防重;危险操作无确认。
|
|
7
|
+
|
|
8
|
+
基准:Empty / Spin|Skeleton / Modal.confirm|Popconfirm。
|
|
9
|
+
|
|
10
|
+
要做:
|
|
11
|
+
1. 异步页三态完整。
|
|
12
|
+
2. 提交中 loading 且不可再点。
|
|
13
|
+
3. 危险操作统一确认并说明后果。
|
|
14
|
+
4. 重复逻辑抽公共组件。
|
|
15
|
+
|
|
16
|
+
不要做:不改数据流;不重写整文件;不碰范围外;不新增 UI 依赖。
|
|
17
|
+
|
|
18
|
+
自查清单:
|
|
19
|
+
[ ] 错误可重试
|
|
20
|
+
[ ] 空数据与筛选为空文案区分
|
|
21
|
+
[ ] 连点只发一次请求
|
|
22
|
+
[ ] 取消确认不发请求
|
|
23
|
+
[ ] 构建与 lint 通过
|
|
24
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# P-H · 全局样式污染与弹层遮挡
|
|
2
|
+
|
|
3
|
+
```text
|
|
4
|
+
仓库:[项目名]。只改样式层与弹层配置。
|
|
5
|
+
|
|
6
|
+
背景:全局覆盖 .ant-* / .el-*;弹层遮挡或错位。
|
|
7
|
+
|
|
8
|
+
要做:
|
|
9
|
+
1. 可 Token 化的覆盖迁到主题。
|
|
10
|
+
2. 页面级改为局部样式。
|
|
11
|
+
3. 必须全局的集中存放并注明原因。
|
|
12
|
+
4. 统一挂载点;去掉硬编码大 z-index。
|
|
13
|
+
|
|
14
|
+
不要做:不改数据流;不重写整文件;不碰范围外;不新增 UI 依赖;不升级组件库。不把 Arco 画成一层新的 `.ant-*` 覆盖。删覆盖时保留组件原有交互。
|
|
15
|
+
|
|
16
|
+
自查清单:
|
|
17
|
+
[ ] 全局覆盖剩余均有说明
|
|
18
|
+
[ ] Drawer/Modal 内弹层正常
|
|
19
|
+
[ ] 无硬编码 z-index ≥ 1000(库内部除外)
|
|
20
|
+
[ ] 构建与 lint 通过
|
|
21
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# 修复 Prompt 通用底线
|
|
2
|
+
|
|
3
|
+
每个修复分组 Prompt 必须包含下列「不要做」前四条(迁栈组可按例外新增 React 19 + Ant Design 6):
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
不要做:
|
|
7
|
+
- 不改接口调用、数据流和状态逻辑(hooks / store / watch / effect 保持原样)。
|
|
8
|
+
- 不重写整个文件,只替换必要的 JSX / template / 样式片段。
|
|
9
|
+
- 不顺手调整范围外页面的样式、布局和文案。
|
|
10
|
+
- 不新增第三方 UI 依赖。例外:本组目标就是从「无组件库」迁到组织推荐栈时,可以新增 React 19 与 Ant Design 6,不另加第二套 UI 库。
|
|
11
|
+
- 设计稿是 Arco 时,不按它的组件硬套,不新增 `.ant-*` 覆盖去贴像素,不重写 `.ant-btn`。按钮继续用 antd `Button`,`loading`、`disabled`、`danger`、`type`、`htmlType` 必须仍然有效。外观只改 token。不改组件原有的焦点、键盘、展开、校验和确认。
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
完整骨架:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
仓库:[项目名]([框架 + UI 库 + 样式方案])。只改前端 [目录],不动后端和接口。
|
|
18
|
+
|
|
19
|
+
背景:…
|
|
20
|
+
基准:…
|
|
21
|
+
范围:…
|
|
22
|
+
问题:…
|
|
23
|
+
要做:…
|
|
24
|
+
不要做:…(含上方底线)
|
|
25
|
+
自查清单:…
|
|
26
|
+
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# [项目名] UI/UX 审计报告 - [日期]
|
|
2
|
+
|
|
3
|
+
**整体评级:[高 / 中 / 低] 风险。** [一句话结论]。建议优先处理 [H1、H2…]。
|
|
4
|
+
|
|
5
|
+
审计范围:[目录]([框架 + UI 库 + 样式方案])。提交基线 [hash]。[是否运行 / 截图]。未改产品代码;本文件为审计结论落盘。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 基准摘要
|
|
10
|
+
|
|
11
|
+
- 技术栈:
|
|
12
|
+
- 与模板推荐栈(参考控制台:React 19 + Ant Design 6 + ProLayout,见 `references/exemplar-rpa-console.md`)的关系:已经是且版本达到 / 已是这套但版本或壳低于范本 / 另一套完整库且内部一致 / 没有组件库或控件按页面手写
|
|
13
|
+
- Token 定义:
|
|
14
|
+
- 公共组件:
|
|
15
|
+
- Layout 骨架:
|
|
16
|
+
- 现有规则 / lint:
|
|
17
|
+
- 设计稿:(若为 Arco:交付是手绘视觉规格,代码基准是 antd v6,不按 Arco 组件硬套。见套件 `references/figma-handoff.md`)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 发现清单
|
|
22
|
+
|
|
23
|
+
### H1 · [一句话问题]
|
|
24
|
+
|
|
25
|
+
**级别 High | 置信度 高 | `路径` 的 `组件名`**
|
|
26
|
+
|
|
27
|
+
现状:[N 个文件 / M 处]
|
|
28
|
+
用户影响:[页面 + 操作 + 用户看到什么]
|
|
29
|
+
为什么没拦住:[原因]
|
|
30
|
+
修复方向:[方向]
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
(M1… L1… Info 同上格式)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 覆盖说明
|
|
39
|
+
|
|
40
|
+
**已覆盖并有结论**:
|
|
41
|
+
**查过未发现问题的重点**:
|
|
42
|
+
**未覆盖或受限**:
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 处置建议
|
|
47
|
+
|
|
48
|
+
**立即修复**:
|
|
49
|
+
**排期修复**:
|
|
50
|
+
**需设计 / 产品确认**:
|
|
51
|
+
**可接受 / 记录即可**:
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 修复分组(P1…Pn)
|
|
56
|
+
|
|
57
|
+
每组一个完整 Prompt,套用 `templates/fix-prompts/`。
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 规则沉淀建议
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 落盘声明
|
|
66
|
+
|
|
67
|
+
未修改产品代码、未提交、未开 PR。完整报告已写入:`[绝对路径]`
|