@ant-design/cli 6.4.2 → 6.4.4

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.
Files changed (81) hide show
  1. package/README.md +86 -4
  2. package/README.zh-CN.md +72 -3
  3. package/data/design-v6.md +288 -0
  4. package/data/v3.26.20.json.gz +0 -0
  5. package/data/v3.json.gz +0 -0
  6. package/data/v4.0.4.json.gz +0 -0
  7. package/data/v4.1.5.json.gz +0 -0
  8. package/data/v4.10.3.json.gz +0 -0
  9. package/data/v4.11.3.json.gz +0 -0
  10. package/data/v4.12.3.json.gz +0 -0
  11. package/data/v4.13.1.json.gz +0 -0
  12. package/data/v4.14.1.json.gz +0 -0
  13. package/data/v4.15.6.json.gz +0 -0
  14. package/data/v4.16.13.json.gz +0 -0
  15. package/data/v4.17.4.json.gz +0 -0
  16. package/data/v4.18.9.json.gz +0 -0
  17. package/data/v4.19.5.json.gz +0 -0
  18. package/data/v4.2.5.json.gz +0 -0
  19. package/data/v4.20.7.json.gz +0 -0
  20. package/data/v4.21.7.json.gz +0 -0
  21. package/data/v4.22.8.json.gz +0 -0
  22. package/data/v4.23.6.json.gz +0 -0
  23. package/data/v4.24.16.json.gz +0 -0
  24. package/data/v4.3.5.json.gz +0 -0
  25. package/data/v4.4.3.json.gz +0 -0
  26. package/data/v4.5.4.json.gz +0 -0
  27. package/data/v4.6.6.json.gz +0 -0
  28. package/data/v4.7.3.json.gz +0 -0
  29. package/data/v4.8.6.json.gz +0 -0
  30. package/data/v4.9.4.json.gz +0 -0
  31. package/data/v4.json.gz +0 -0
  32. package/data/v5.0.7.json.gz +0 -0
  33. package/data/v5.1.7.json.gz +0 -0
  34. package/data/v5.10.3.json.gz +0 -0
  35. package/data/v5.11.5.json.gz +0 -0
  36. package/data/v5.12.8.json.gz +0 -0
  37. package/data/v5.13.3.json.gz +0 -0
  38. package/data/v5.14.2.json.gz +0 -0
  39. package/data/v5.15.4.json.gz +0 -0
  40. package/data/v5.16.5.json.gz +0 -0
  41. package/data/v5.17.4.json.gz +0 -0
  42. package/data/v5.18.3.json.gz +0 -0
  43. package/data/v5.19.4.json.gz +0 -0
  44. package/data/v5.2.3.json.gz +0 -0
  45. package/data/v5.20.6.json.gz +0 -0
  46. package/data/v5.21.6.json.gz +0 -0
  47. package/data/v5.22.7.json.gz +0 -0
  48. package/data/v5.23.4.json.gz +0 -0
  49. package/data/v5.24.9.json.gz +0 -0
  50. package/data/v5.25.4.json.gz +0 -0
  51. package/data/v5.26.7.json.gz +0 -0
  52. package/data/v5.27.6.json.gz +0 -0
  53. package/data/v5.28.1.json.gz +0 -0
  54. package/data/v5.29.3.json.gz +0 -0
  55. package/data/v5.3.3.json.gz +0 -0
  56. package/data/v5.4.7.json.gz +0 -0
  57. package/data/v5.5.2.json.gz +0 -0
  58. package/data/v5.6.4.json.gz +0 -0
  59. package/data/v5.7.3.json.gz +0 -0
  60. package/data/v5.8.6.json.gz +0 -0
  61. package/data/v5.9.4.json.gz +0 -0
  62. package/data/v5.json.gz +0 -0
  63. package/data/v6.0.1.json.gz +0 -0
  64. package/data/v6.1.4.json.gz +0 -0
  65. package/data/v6.2.3.json.gz +0 -0
  66. package/data/v6.3.7.json.gz +0 -0
  67. package/data/v6.4.4.json.gz +0 -0
  68. package/data/v6.json.gz +0 -0
  69. package/data/versions.json +1 -1
  70. package/dist/index.d.ts +4 -1
  71. package/dist/index.js +8912 -10143
  72. package/package.json +10 -4
  73. package/skills/antd/SKILL.md +25 -6
  74. package/data/v6.3.1.json.gz +0 -0
  75. package/data/v6.3.3.json.gz +0 -0
  76. package/data/v6.3.4.json.gz +0 -0
  77. package/data/v6.3.5.json.gz +0 -0
  78. package/data/v6.3.6.json.gz +0 -0
  79. package/data/v6.4.0.json.gz +0 -0
  80. package/data/v6.4.1.json.gz +0 -0
  81. package/data/v6.4.2.json.gz +0 -0
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <img src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" alt="Ant Design" width="72">
6
6
 
7
- <h1>@ant-design/cli</h1>
7
+ <h1>Ant Design CLI</h1>
8
8
 
9
9
  **Ant Design on your command line.**<br>
10
10
  Query component knowledge, analyze project usage, and guide migrations — fully offline.
@@ -41,8 +41,8 @@ npx skills add ant-design/ant-design-cli # install as an agent skill
41
41
  - 🤖 **Agent-optimized** — `--format json` on every command. Structured errors with codes and suggestions. Clean stdout/stderr separation.
42
42
  - 🌍 **Bilingual** — Every component name, description, and doc has both English and Chinese. Switch with `--lang zh`.
43
43
  - 🔮 **Smart matching** — Typo `Buttn`? The CLI suggests `Button` using Levenshtein distance, with first-letter preference.
44
- - 🧩 **15 commands** — From prop lookup to project-wide lint, from design token queries to cross-version API diffing.
45
- - 🔌 **MCP server** — `antd mcp` starts a stdio server for native IDE integration (Claude Desktop, Cursor).
44
+ - 🧩 **17 commands** — From prop lookup to project-wide lint, from design token queries to cross-version API diffing.
45
+ - 🔌 **MCP server** — `antd mcp` starts a stdio server for native IDE integration (Claude Code, Cursor, VS Code, etc.).
46
46
 
47
47
  <br>
48
48
 
@@ -84,6 +84,19 @@ Works with [Claude Code](https://claude.ai/code), [Cursor](https://cursor.sh), [
84
84
 
85
85
  For IDEs that support [Model Context Protocol](https://modelcontextprotocol.io), the CLI can run as an MCP server:
86
86
 
87
+ ```json
88
+ {
89
+ "mcpServers": {
90
+ "antd": {
91
+ "command": "npx",
92
+ "args": ["-y", "@ant-design/cli", "mcp"]
93
+ }
94
+ }
95
+ }
96
+ ```
97
+
98
+ Or if you have the CLI installed globally (`npm i -g @ant-design/cli`):
99
+
87
100
  ```json
88
101
  {
89
102
  "mcpServers": {
@@ -97,7 +110,7 @@ For IDEs that support [Model Context Protocol](https://modelcontextprotocol.io),
97
110
 
98
111
  To pin a specific antd version, add `"--version", "5.20.0"` to the `args` array.
99
112
 
100
- This exposes 7 tools (`antd_list`, `antd_info`, `antd_doc`, `antd_demo`, `antd_token`, `antd_semantic`, `antd_changelog`) and 2 prompts (`antd-expert`, `antd-page-generator`) for native IDE integration.
113
+ This exposes 8 tools (`antd_list`, `antd_info`, `antd_doc`, `antd_demo`, `antd_token`, `antd_design_md`, `antd_semantic`, `antd_changelog`) and 2 prompts (`antd-expert`, `antd-page-generator`) for native IDE integration.
101
114
 
102
115
  <br>
103
116
 
@@ -109,6 +122,7 @@ antd info Button # Component props, types, defaults
109
122
  antd doc Button # Full markdown documentation
110
123
  antd demo Select basic # Runnable demo source code
111
124
  antd token DatePicker # Design Token values (v5+)
125
+ antd design.md # Design-language document (design.md)
112
126
  antd semantic Table # classNames / styles structure
113
127
  antd changelog 4.24.0 5.0.0 Select # API diff across versions
114
128
  antd doctor # Diagnose project issues
@@ -117,6 +131,8 @@ antd usage ./src # Analyze antd imports in project
117
131
  antd lint ./src # Check deprecated APIs & best practices
118
132
  antd migrate 3 4 # v3 → v4 migration guide
119
133
  antd migrate 4 5 --apply ./src # Agent-ready migration prompt
134
+ antd mcp # Start MCP server for IDE integration
135
+ antd upgrade # Upgrade CLI to latest version
120
136
  ```
121
137
 
122
138
  <br>
@@ -132,6 +148,7 @@ antd migrate 4 5 --apply ./src # Agent-ready migration prompt
132
148
  | [`antd doc <Component>`](#antd-doc-component) | Full markdown documentation for a component |
133
149
  | [`antd demo <Component> [name]`](#antd-demo-component-name) | Runnable demo source code (TSX) |
134
150
  | [`antd token [Component]`](#antd-token-component) | Global or component-level Design Tokens |
151
+ | [`antd design.md`](#antd-designmd) | Design-language document (`design.md`) for AI design tools |
135
152
  | [`antd semantic <Component>`](#antd-semantic-component) | Semantic `classNames` / `styles` structure with usage examples |
136
153
  | [`antd changelog`](#antd-changelog-v1-v2-component) | Changelog entries, version ranges, or cross-version API diff |
137
154
 
@@ -152,6 +169,13 @@ antd migrate 4 5 --apply ./src # Agent-ready migration prompt
152
169
  | [`antd bug`](#antd-bug) | File a bug to ant-design/ant-design with auto-collected environment info |
153
170
  | [`antd bug-cli`](#antd-bug-cli) | File a bug to ant-design/ant-design-cli |
154
171
 
172
+ ### 🔧 CLI Management
173
+
174
+ | Command | Description |
175
+ |---|---|
176
+ | [`antd mcp`](#antd-mcp) | Start MCP stdio server for IDE agent integration |
177
+ | [`antd upgrade`](#antd-upgrade) | Upgrade the CLI to the latest version |
178
+
155
179
  <br>
156
180
 
157
181
  ---
@@ -233,6 +257,18 @@ antd token # global tokens (colorPrimary, borderRadius,
233
257
  antd token Button # component-level tokens
234
258
  ```
235
259
 
260
+ ### `antd design.md`
261
+
262
+ Output the antd **design-language document** (`design.md`) — a curated description of antd's default light theme, conformant with the [google-labs-code/design.md](https://github.com/google-labs-code/design.md) spec. Where `antd token` lists individual token names, `antd design.md` describes the design language as a whole (color/typography/spacing/radius values plus the principles behind them), so AI design tools (Figma Make, Stitch, etc.) and agents can consume antd's design language directly.
263
+
264
+ ```bash
265
+ antd design.md # design.md for the detected version
266
+ antd design.md --version 6.4.0 # design.md for a specific version
267
+ antd design.md --format json # { doc }
268
+ ```
269
+
270
+ `design.md` is **major-grained** (antd rewrites it only across major releases), so it is resolved by major version. A `design.md` is currently published only for **antd v6** — requesting a major without one (v3/v4/v5) returns `UNSUPPORTED_VERSION_FEATURE`. It mirrors the canonical `DESIGN.md` published at [`https://ant.design/design.md`](https://ant.design/design.md).
271
+
236
272
  ### `antd semantic <Component>`
237
273
 
238
274
  ```bash
@@ -389,6 +425,52 @@ antd bug-cli --title "info command crashes on v4"
389
425
  antd bug-cli --title "..." --submit
390
426
  ```
391
427
 
428
+ ### `antd mcp`
429
+
430
+ Start an MCP (Model Context Protocol) stdio server for IDE agent integration. Exposes 8 tools and 2 prompts for native IDE integration (Claude Code, Cursor, VS Code, Codex, etc.).
431
+
432
+ ```bash
433
+ antd mcp # start with auto-detected version
434
+ antd mcp --version 5.20.0 --lang zh # pin version and language
435
+ ```
436
+
437
+ Configuration:
438
+
439
+ ```json
440
+ {
441
+ "mcpServers": {
442
+ "antd": {
443
+ "command": "npx",
444
+ "args": ["-y", "@ant-design/cli", "mcp"]
445
+ }
446
+ }
447
+ }
448
+ ```
449
+
450
+ **MCP Tools (8):** `antd_list`, `antd_info`, `antd_doc`, `antd_demo`, `antd_token`, `antd_design_md`, `antd_semantic`, `antd_changelog`
451
+
452
+ **MCP Prompts (2):** `antd-expert`, `antd-page-generator`
453
+
454
+ ### `antd upgrade`
455
+
456
+ Upgrade the CLI itself to the latest version published on npm. Automatically detects which package manager installed the CLI (npm, yarn, pnpm, bun, cnpm, utoo) and runs the corresponding upgrade command.
457
+
458
+ ```bash
459
+ antd upgrade # upgrade to latest version
460
+ ```
461
+
462
+ <details>
463
+ <summary>Example output</summary>
464
+
465
+ ```text
466
+ Upgrading @ant-design/cli: v6.4.3 → v6.4.4
467
+ Running: npm install -g @ant-design/cli@latest
468
+ ... (passthrough package manager output) ...
469
+ Successfully upgraded to v6.4.4
470
+ ```
471
+
472
+ </details>
473
+
392
474
  <br>
393
475
 
394
476
  ## ⚙️ Global Flags
package/README.zh-CN.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <img src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" alt="Ant Design" width="72">
6
6
 
7
- <h1>@ant-design/cli</h1>
7
+ <h1>Ant Design CLI</h1>
8
8
 
9
9
  **命令行上的 Ant Design。**<br>
10
10
  查询组件知识、分析项目用量、指导版本迁移 — 完全离线。
@@ -41,7 +41,7 @@ npx skills add ant-design/ant-design-cli # 安装为 Agent Skill
41
41
  - 🤖 **Agent 优化** — 所有命令支持 `--format json`。结构化错误码与修复建议。stdout/stderr 严格分离。
42
42
  - 🌍 **双语输出** — 每个组件名、描述和文档均有中英文。通过 `--lang zh` 切换。
43
43
  - 🔮 **智能纠错** — 输入 `Buttn`?CLI 基于 Levenshtein 距离建议 `Button`,优先匹配首字母相同的候选。
44
- - 🧩 **15 条命令** — 从 Prop 查询到项目级 Lint,从 Design Token 到跨版本 API 对比。
44
+ - 🧩 **17 条命令** — 从 Prop 查询到项目级 Lint,从 Design Token 到跨版本 API 对比。
45
45
  - 🔌 **MCP 服务** — `antd mcp` 启动 stdio 服务,原生集成 Claude Desktop、Cursor 等 IDE。
46
46
 
47
47
  <br>
@@ -95,7 +95,7 @@ Agent 会自动完成 `npm install`、`npx skills add`,并开始使用 CLI。
95
95
 
96
96
  如需固定 antd 版本,在 `args` 数组中添加 `"--version", "5.20.0"`。
97
97
 
98
- 提供 7 个工具(`antd_list`、`antd_info`、`antd_doc`、`antd_demo`、`antd_token`、`antd_semantic`、`antd_changelog`)和 2 个提示词(`antd-expert`、`antd-page-generator`)。
98
+ 提供 8 个工具(`antd_list`、`antd_info`、`antd_doc`、`antd_demo`、`antd_token`、`antd_design_md`、`antd_semantic`、`antd_changelog`)和 2 个提示词(`antd-expert`、`antd-page-generator`)。
99
99
 
100
100
  支持 [Claude Code](https://claude.ai/code)、[Cursor](https://cursor.sh)、[Codex](https://openai.com/codex)、[Gemini CLI](https://github.com/google-gemini/gemini-cli) 等所有兼容 [skills](https://github.com/nicepkg/agent-skills) 协议的 Agent。
101
101
 
@@ -109,6 +109,7 @@ antd info Button # 组件 Props、类型、默认值
109
109
  antd doc Button # 完整 Markdown 文档
110
110
  antd demo Select basic # 可运行的 Demo 源码
111
111
  antd token DatePicker # Design Token 值(v5+)
112
+ antd design.md # 设计语言文档(design.md)
112
113
  antd semantic Table # classNames / styles 结构
113
114
  antd changelog 4.24.0 5.0.0 Select # 跨版本 API 差异对比
114
115
  antd doctor # 诊断项目配置问题
@@ -117,6 +118,8 @@ antd usage ./src # 分析项目中的 antd 导入
117
118
  antd lint ./src # 检查废弃 API 和最佳实践
118
119
  antd migrate 3 4 # v3 → v4 迁移指南
119
120
  antd migrate 4 5 --apply ./src # 生成 Agent 迁移提示
121
+ antd mcp # 启动 MCP 服务,供 IDE 集成
122
+ antd upgrade # 升级 CLI 到最新版本
120
123
  ```
121
124
 
122
125
  <br>
@@ -132,6 +135,7 @@ antd migrate 4 5 --apply ./src # 生成 Agent 迁移提示
132
135
  | [`antd doc <Component>`](#antd-doc-component) | 组件完整 Markdown 文档 |
133
136
  | [`antd demo <Component> [name]`](#antd-demo-component-name) | 可运行的 Demo 源码(TSX) |
134
137
  | [`antd token [Component]`](#antd-token-component) | 全局或组件级 Design Token |
138
+ | [`antd design.md`](#antd-designmd) | 设计语言文档(`design.md`),供 AI 设计工具消费 |
135
139
  | [`antd semantic <Component>`](#antd-semantic-component) | 语义化 `classNames` / `styles` 结构及用法示例 |
136
140
  | [`antd changelog`](#antd-changelog-v1-v2-component) | Changelog 条目、版本范围或跨版本 API 对比 |
137
141
 
@@ -152,6 +156,13 @@ antd migrate 4 5 --apply ./src # 生成 Agent 迁移提示
152
156
  | [`antd bug`](#antd-bug) | 向 ant-design/ant-design 报告 Bug,自动收集环境信息 |
153
157
  | [`antd bug-cli`](#antd-bug-cli) | 向 ant-design/ant-design-cli 报告 Bug |
154
158
 
159
+ ### 🔧 CLI 管理
160
+
161
+ | 命令 | 说明 |
162
+ |---|---|
163
+ | [`antd mcp`](#antd-mcp) | 启动 MCP stdio 服务,供 IDE Agent 集成 |
164
+ | [`antd upgrade`](#antd-upgrade) | 升级 CLI 到最新版本 |
165
+
155
166
  <br>
156
167
 
157
168
  ---
@@ -233,6 +244,18 @@ antd token # 全局 Token(colorPrimary、borderRadius
233
244
  antd token Button # 组件级 Token
234
245
  ```
235
246
 
247
+ ### `antd design.md`
248
+
249
+ 输出 antd **设计语言文档**(`design.md`)—— 对 antd 默认 Light 主题的精心编写的描述,遵循 [google-labs-code/design.md](https://github.com/google-labs-code/design.md) 规范。`antd token` 列举单个 Token 名称,而 `antd design.md` 整体描述设计语言(颜色 / 字体 / 间距 / 圆角的取值及其背后的设计原则),可被 AI 设计工具(Figma Make、Stitch 等)和 Agent 直接消费。
250
+
251
+ ```bash
252
+ antd design.md # 输出当前检测版本的 design.md
253
+ antd design.md --version 6.4.0 # 指定版本的 design.md
254
+ antd design.md --format json # { doc }
255
+ ```
256
+
257
+ `design.md` 按**大版本**区分(antd 只在大版本升级时重写它),因此按 major 解析。目前**仅 antd v6** 提供 `design.md` —— 查询没有该文档的大版本(v3/v4/v5)会返回 `UNSUPPORTED_VERSION_FEATURE`。它与发布在 [`https://ant.design/design.md`](https://ant.design/design.md) 的官方 `DESIGN.md` 保持一致。
258
+
236
259
  ### `antd semantic <Component>`
237
260
 
238
261
  ```bash
@@ -389,6 +412,52 @@ antd bug-cli --title "info 命令在 v4 组件上崩溃"
389
412
  antd bug-cli --title "..." --submit
390
413
  ```
391
414
 
415
+ ### `antd mcp`
416
+
417
+ 启动 MCP(Model Context Protocol)stdio 服务,供 IDE Agent 集成。提供 8 个工具和 2 个提示词,支持 Claude Desktop、Cursor 等 IDE 原生集成。
418
+
419
+ ```bash
420
+ antd mcp # 使用自动检测的版本启动
421
+ antd mcp --version 5.20.0 --lang zh # 指定版本和语言
422
+ ```
423
+
424
+ IDE 配置(`claude_desktop_config.json`):
425
+
426
+ ```json
427
+ {
428
+ "mcpServers": {
429
+ "antd": {
430
+ "command": "antd",
431
+ "args": ["mcp"]
432
+ }
433
+ }
434
+ }
435
+ ```
436
+
437
+ **MCP 工具(8 个):** `antd_list`、`antd_info`、`antd_doc`、`antd_demo`、`antd_token`、`antd_design_md`、`antd_semantic`、`antd_changelog`
438
+
439
+ **MCP 提示词(2 个):** `antd-expert`、`antd-page-generator`
440
+
441
+ ### `antd upgrade`
442
+
443
+ 升级 CLI 自身到 npm 上发布的最新版本。自动检测安装 CLI 的包管理器(npm、yarn、pnpm、bun、cnpm、utoo)并执行对应的升级命令。
444
+
445
+ ```bash
446
+ antd upgrade # 升级到最新版本
447
+ ```
448
+
449
+ <details>
450
+ <summary>示例输出</summary>
451
+
452
+ ```text
453
+ 正在升级 @ant-design/cli: v6.4.3 → v6.4.4
454
+ 执行: npm install -g @ant-design/cli@latest
455
+ ... (包管理器输出透传) ...
456
+ 成功升级到 v6.4.4
457
+ ```
458
+
459
+ </details>
460
+
392
461
  <br>
393
462
 
394
463
  ## ⚙️ 全局参数
@@ -0,0 +1,288 @@
1
+ ---
2
+ name: Ant Design
3
+ description: Enterprise-grade React UI design system from Ant Group, built around the values Natural, Certain, Meaningful, and Growing.
4
+ colors:
5
+ primary: '#1677FF'
6
+ success: '#52C41A'
7
+ warning: '#FAAD14'
8
+ error: '#FF4D4F'
9
+ info: '#1677FF'
10
+ blue: '#1677FF'
11
+ purple: '#722ED1'
12
+ cyan: '#13C2C2'
13
+ green: '#52C41A'
14
+ magenta: '#EB2F96'
15
+ red: '#F5222D'
16
+ orange: '#FA8C16'
17
+ yellow: '#FADB14'
18
+ volcano: '#FA541C'
19
+ geekblue: '#2F54EB'
20
+ gold: '#FAAD14'
21
+ lime: '#A0D911'
22
+ surface: '#FFFFFF'
23
+ surface-container: '#FAFAFA'
24
+ surface-layout: '#F5F5F5'
25
+ on-surface: '#1F1F1F'
26
+ on-surface-variant: '#595959'
27
+ on-surface-disabled: '#BFBFBF'
28
+ outline: '#D9D9D9'
29
+ outline-variant: '#F0F0F0'
30
+ typography:
31
+ display-lg:
32
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif"
33
+ fontSize: 38px
34
+ fontWeight: '600'
35
+ lineHeight: 46px
36
+ headline-lg:
37
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif"
38
+ fontSize: 30px
39
+ fontWeight: '600'
40
+ lineHeight: 38px
41
+ headline-md:
42
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif"
43
+ fontSize: 24px
44
+ fontWeight: '600'
45
+ lineHeight: 32px
46
+ headline-sm:
47
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif"
48
+ fontSize: 20px
49
+ fontWeight: '600'
50
+ lineHeight: 28px
51
+ title-lg:
52
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif"
53
+ fontSize: 16px
54
+ fontWeight: '600'
55
+ lineHeight: 24px
56
+ title-md:
57
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif"
58
+ fontSize: 14px
59
+ fontWeight: '600'
60
+ lineHeight: 22px
61
+ body-lg:
62
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif"
63
+ fontSize: 16px
64
+ fontWeight: '400'
65
+ lineHeight: 24px
66
+ body-md:
67
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif"
68
+ fontSize: 14px
69
+ fontWeight: '400'
70
+ lineHeight: 22px
71
+ body-sm:
72
+ fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif"
73
+ fontSize: 12px
74
+ fontWeight: '400'
75
+ lineHeight: 20px
76
+ code:
77
+ fontFamily: "'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace"
78
+ fontSize: 13px
79
+ fontWeight: '400'
80
+ lineHeight: 20px
81
+ rounded:
82
+ none: 0px
83
+ sm: 2px
84
+ md: 4px
85
+ DEFAULT: 6px
86
+ lg: 8px
87
+ xl: 16px
88
+ full: 9999px
89
+ spacing:
90
+ unit: 4px
91
+ xs: 4px
92
+ sm: 8px
93
+ md: 16px
94
+ lg: 24px
95
+ xl: 32px
96
+ control-height: 32px
97
+ components:
98
+ button-primary:
99
+ backgroundColor: '{colors.primary}'
100
+ textColor: '#FFFFFF'
101
+ typography: '{typography.body-md}'
102
+ rounded: '{rounded.DEFAULT}'
103
+ height: 32px
104
+ padding: 0 15px
105
+ button-primary-hover:
106
+ backgroundColor: '#4096FF'
107
+ button-primary-active:
108
+ backgroundColor: '#0958D9'
109
+ button-default:
110
+ backgroundColor: '{colors.surface}'
111
+ textColor: '{colors.on-surface}'
112
+ typography: '{typography.body-md}'
113
+ rounded: '{rounded.DEFAULT}'
114
+ height: 32px
115
+ padding: 0 15px
116
+ button-default-hover:
117
+ textColor: '#4096FF'
118
+ input-field:
119
+ backgroundColor: '{colors.surface}'
120
+ textColor: '{colors.on-surface}'
121
+ typography: '{typography.body-md}'
122
+ rounded: '{rounded.DEFAULT}'
123
+ height: 32px
124
+ padding: 4px 11px
125
+ input-field-focus:
126
+ backgroundColor: '{colors.surface}'
127
+ select-field:
128
+ backgroundColor: '{colors.surface}'
129
+ textColor: '{colors.on-surface}'
130
+ typography: '{typography.body-md}'
131
+ rounded: '{rounded.DEFAULT}'
132
+ height: 32px
133
+ padding: 0 11px
134
+ card:
135
+ backgroundColor: '{colors.surface}'
136
+ textColor: '{colors.on-surface}'
137
+ rounded: '{rounded.lg}'
138
+ padding: 24px
139
+ modal:
140
+ backgroundColor: '{colors.surface}'
141
+ textColor: '{colors.on-surface}'
142
+ rounded: '{rounded.lg}'
143
+ padding: 20px 24px
144
+ menu-item-selected:
145
+ backgroundColor: '#E6F4FF'
146
+ textColor: '{colors.primary}'
147
+ typography: '{typography.body-md}'
148
+ tabs-tab-active:
149
+ textColor: '{colors.primary}'
150
+ typography: '{typography.body-md}'
151
+ table-header:
152
+ backgroundColor: '{colors.surface-container}'
153
+ textColor: '{colors.on-surface}'
154
+ typography: '{typography.title-md}'
155
+ padding: 16px
156
+ tag:
157
+ backgroundColor: '{colors.surface-container}'
158
+ textColor: '{colors.on-surface}'
159
+ typography: '{typography.body-sm}'
160
+ rounded: '{rounded.md}'
161
+ padding: 0 7px
162
+ tooltip:
163
+ backgroundColor: 'rgba(0, 0, 0, 0.85)'
164
+ textColor: '#FFFFFF'
165
+ typography: '{typography.body-md}'
166
+ rounded: '{rounded.md}'
167
+ padding: 6px 8px
168
+ dropdown-item-hover:
169
+ backgroundColor: '{colors.surface-container}'
170
+ textColor: '{colors.on-surface}'
171
+ ---
172
+
173
+ ## Overview
174
+
175
+ This document describes the default light theme of **Ant Design v6**. The system follows semantic versioning: major releases (v5 → v6) signal an overhaul of the design language, while minor and patch releases keep this document stable. Refer to [CHANGELOG.en-US.md](https://github.com/ant-design/ant-design/blob/master/CHANGELOG.en-US.md) for the per-release token drift inside a major.
176
+
177
+ Ant Design is the open-source design system Ant Group uses to ship enterprise software — primarily mid- and back-office consoles, dashboards, and operational tools. The system was created in 2015 to give large product teams a shared, opinionated foundation so they could ship dense, data-rich interfaces without re-deciding the basics on every screen.
178
+
179
+ Four values guide every decision in the system:
180
+
181
+ - **Natural.** The interface follows established conventions; nothing surprises a returning user. Patterns that already exist in operating systems and prior generations of enterprise software are preferred over novel inventions.
182
+ - **Certain.** Users always know what state they're in, what their inputs did, and what the next step is. Hover, focus, loading, and error states are explicit and consistent.
183
+ - **Meaningful.** Visual emphasis is reserved for action. Decoration that does not communicate is removed.
184
+ - **Growing.** The system scales from small forms to dense tables to multi-tenant admin consoles without losing coherence.
185
+
186
+ ## Customization
187
+
188
+ Every value in the YAML front-matter above is a **default** produced by `defaultAlgorithm` — the light theme. The system is designed to be re-skinned without editing this file or overriding individual tokens by hand.
189
+
190
+ Three layers of customization exist:
191
+
192
+ 1. **Seed token overrides.** Pass `theme.token` to `ConfigProvider` to replace any seed. The six color seeds (`colorPrimary`, `colorSuccess`, `colorWarning`, `colorError`, `colorInfo`, plus the neutral base) each expand automatically through `@ant-design/colors` into a ten-step gradient covering background tint, hover, active, and outline variants — change the seed, and the entire derived palette moves with it. Spacing, radius, and font-size seeds work the same way.
193
+
194
+ 2. **Algorithm switching.** Set `theme.algorithm` to swap the entire derivation logic. `darkAlgorithm` derives a dark surface ladder, inverted text alphas, and adjusted shadow values from the same seeds — do not invert colors manually; the algorithm accounts for non-linear gradient stops that flat inversion cannot reproduce. `compactAlgorithm` reduces control heights and spacing while preserving the same palette.
195
+
196
+ 3. **Component-level overrides.** `theme.components.Button` (or any component's token namespace) can override a single component's derived tokens without affecting others — for example, changing the Button border radius without touching Input or Select.
197
+
198
+ ## Colors
199
+
200
+ The palette is built from six functional seeds: a single **primary** brand color and five semantic states (`success`, `warning`, `error`, `info`, plus the neutral background). Each seed expands automatically through `@ant-design/colors` into a ten-step gradient covering background tint, hover, active, and outline variants — change the seed, and the entire derived palette moves with it.
201
+
202
+ `#1677FF` was chosen as the primary because blue reads as trustworthy and focused without the corporate flatness of a darker navy or the playfulness of a saturated cyan. It also remains legible against both white and pale-grey surfaces — the two surfaces enterprise consoles use most.
203
+
204
+ Neutral text and overlays in the runtime token system are expressed as `rgba(0, 0, 0, α)` rather than flat grey hex values. The reason is overlay: when text sits above a tinted card or a colored cell highlight, an opaque grey breaks the tint, while a transparent black blends naturally. The four standard alpha steps are `0.88` (primary text, exported here as `#1F1F1F`), `0.65` (secondary text, `#595959`), `0.45` (tertiary / description text), and `0.25` (placeholder / disabled, `#BFBFBF`). The hex values listed in this document are the equivalent composited result on a white surface, suitable for static export targets that require hex; downstream consumers that support alpha should prefer the `rgba()` form from `@ant-design/cssinjs`.
205
+
206
+ The thirteen preset colors (`blue`, `purple`, `cyan`, `green`, `magenta`, `red`, `orange`, `yellow`, `volcano`, `geekblue`, `gold`, `lime`, plus the same brand `blue`) are reserved for tagging, charts, and categorical visualization — never for primary UI affordances. Use functional colors (`success`/`warning`/`error`/`info`) for status, and reserve `primary` for the single most important action on each screen.
207
+
208
+ ## Typography
209
+
210
+ The base font size is **14 px**, not 16. Enterprise consoles trade legibility headroom for information density — a 1440 px-wide window has to comfortably fit a sidebar, a header, a data table with eight columns, and a detail pane. At 14 px, a row of body copy reaches the eye-saccade sweet spot of ~75 characters at the column widths these layouts demand.
211
+
212
+ The font stack prioritizes the OS UI font in order: Apple's `-apple-system`, then `BlinkMacSystemFont`, then Windows' `Segoe UI`, then Android/ChromeOS' `Roboto`, then `Helvetica Neue`, then `Arial`, with `Noto Sans` covering Linux. Emoji fallbacks are kept short. The code font uses `SFMono-Regular`, `Consolas`, `Liberation Mono`, `Menlo`, and `Courier` in the same order.
213
+
214
+ Only **two font weights** appear in product UI: 400 (body, controls, menu items, tab labels) and 600 (`fontWeightStrong` — headings, table headers, and any title-grade typography). Thin (100–300), bold (700+), and italics are not used in interface chrome — they fight the calm, certain tone the system targets. Italics are acceptable only inside long-form documentation prose. Visual emphasis on selected/active states comes from color and stroke (border, underline), not weight.
215
+
216
+ ## Layout
217
+
218
+ All spacing snaps to a **4 px grid**. The six-step spacing scale (`unit`, `xs`, `sm`, `md`, `lg`, `xl` → 4 / 4 / 8 / 16 / 24 / 32 px) covers every gap, gutter, and inset in the system. Magic numbers — `padding: 11px`, `gap: 13px` — do not appear in token-driven code; the input field's 11 px horizontal padding exists only because the design pre-dates the 4 px grid and a one-pixel migration would shift millions of existing screens.
219
+
220
+ Surfaces use a **three-layer model**:
221
+
222
+ 1. **`bg-layout`** (`#F5F5F5`) — the page background. It surrounds and contains everything else.
223
+ 2. **`bg-container`** (`#FFFFFF`) — the surface for cards, panels, tables, and forms. This is where most content lives.
224
+ 3. **`bg-elevated`** (`#FFFFFF`, same hex as `bg-container`) — the surface for modals, dropdowns, popovers. Distinguished from `bg-container` not by color but by shadow.
225
+
226
+ Never hard-code `#FFF` or `#FAFAFA` in product code. Read the token. The three-layer model is what lets a dark-mode algorithm flip the surface ladder without breaking layouts.
227
+
228
+ ## Elevation & Depth
229
+
230
+ Ant Design is **flat-first**. Borders and tonal contrast carry hierarchy. Shadows appear only on surfaces that genuinely float above their context.
231
+
232
+ Four shadow tiers exist (CSS variables `--ant-box-shadow-tertiary`, `--ant-box-shadow-secondary`, `--ant-box-shadow`, `--ant-box-shadow-popover-arrow`). In ascending strength:
233
+
234
+ - **Tertiary** — inset hairline, used for input internal stroke.
235
+ - **Default** — `0 1px 2px 0 rgba(0,0,0,0.03), 0 1px 6px -1px rgba(0,0,0,0.02), 0 2px 4px 0 rgba(0,0,0,0.02)` — for raised cards and floating action surfaces.
236
+ - **Secondary** — `0 6px 16px 0 rgba(0,0,0,0.08), 0 3px 6px -4px rgba(0,0,0,0.12), 0 9px 28px 8px rgba(0,0,0,0.05)` — for modals, drawers, and dropdowns.
237
+ - **Popover arrow** — used only for the small triangular pointer on tooltip and popover arrows.
238
+
239
+ Motion uses three durations and a small library of cubic-bezier easings, all exposed as tokens:
240
+
241
+ - `motionDurationFast` — 0.1 s, for state changes (hover, focus, press).
242
+ - `motionDurationMid` — 0.2 s, for component-internal transitions (collapse, fade).
243
+ - `motionDurationSlow` — 0.3 s, for surface-level changes (modal enter, drawer slide).
244
+
245
+ Easings are pre-defined: `motionEaseInOut`, `motionEaseOut`, `motionEaseIn`, `motionEaseOutBack`, `motionEaseOutCirc`, etc. Do not pick a `transition-timing-function` arbitrarily. If the design need does not match an existing easing, use `motionEaseInOut` and move on.
246
+
247
+ ## Shapes
248
+
249
+ The default corner radius is **6 px**. It is round enough to read as modern and friendly, but small enough that a 32-pixel-tall button still presents a clean, almost-rectangular silhouette suitable for dense forms.
250
+
251
+ By component class:
252
+
253
+ - **Controls** (button, input, select, dropdown trigger) — 6 px (`rounded.DEFAULT`).
254
+ - **Surfaces** (card, modal, drawer, notification) — 8 px (`rounded.lg`).
255
+ - **Tags and small chips** — 4 px (`rounded.md`).
256
+ - **Tooltip and popover** — 4 px (`rounded.md`).
257
+
258
+ Full-pill (`rounded.full`, 9999 px) is reserved for circular avatars, badges, and dots — not for buttons or tags. Square (0 px) is reserved for tables and the inner edges of segmented controls. Mixing radii on adjacent elements is a smell: a card with 8 px corners should not contain a button with 16 px corners.
259
+
260
+ ## Components
261
+
262
+ Twelve component archetypes capture most of the system's surface area. Each entry below maps to the token references in the YAML front-matter.
263
+
264
+ - **Button (primary)** — the single dominant action per screen. Solid `primary` fill, white text, 32 px tall, 6 px radius. Hover lightens the fill to `#4096FF`; active darkens to `#0958D9`. Do not stack two `primary` buttons in one decision.
265
+ - **Button (default)** — secondary actions. Transparent background on a white surface, dark text, 1 px outline border. Hover changes text color to `#4096FF`; the border tints to match.
266
+ - **Input field** — 32 px tall to match buttons. Subtle 1 px outline border; focus state thickens the border to `primary` and adds an inset glow. Placeholder text uses `on-surface-disabled`.
267
+ - **Select** — visually identical to Input. The trigger reads as an input until interacted with.
268
+ - **Card** — the workhorse container. White surface, 8 px radius, default shadow tier. Internal padding is 24 px on all sides; nested controls maintain 16 px gaps.
269
+ - **Modal** — same surface and radius as Card, but uses the secondary shadow tier and is centered on a `rgba(0, 0, 0, 0.45)` mask. Body padding is 20 px top/bottom × 24 px left/right.
270
+ - **Menu (selected item)** — `#E6F4FF` background, `primary` text. This is the single visual cue for "you are here" in navigation.
271
+ - **Tabs (active tab)** — `primary` text and a 2 px `primary` underline. Inactive tabs are `on-surface-variant`. No background fill on tabs at any state.
272
+ - **Table (header row)** — `surface-container` background, `title-md` typography (14 px / 600). Body rows alternate on hover only, not by default — the system trusts users to read dense data without zebra striping.
273
+ - **Tag** — small categorical label. 4 px radius, 12 px font, low-saturation pastel fills from the preset palette. Never use a tag for a critical state — use Alert or Badge.
274
+ - **Tooltip** — high-contrast inverse surface: `rgba(0,0,0,0.85)` background, white text. Always positioned by the framework, never manually pinned.
275
+ - **Dropdown menu (item hover)** — `surface-container` fill on hover, no text-color change. The hover affordance is enough.
276
+
277
+ ## Do's and Don'ts
278
+
279
+ - **Do** use the four design values as a tie-breaker. When two approaches conflict, the one that produces a more certain, more legible state for the user wins.
280
+ - **Don't** stack two `primary`-colored buttons on the same surface. Pick one. Demote the rest to `default`.
281
+ - **Do** read surfaces from `colors.surface`, `colors.surface-container`, and `colors.surface-layout`. They reflect the three-layer model.
282
+ - **Don't** hard-code `#FFFFFF` or `#FAFAFA`. The hex is incidental; the role is what matters.
283
+ - **Do** use `motionDurationMid` (0.2 s) for any component-level transition you cannot find a more specific token for.
284
+ - **Don't** invent custom `cubic-bezier` curves. Use the named easings.
285
+ - **Do** reserve the preset color palette (`blue` through `lime`) for tags, charts, and categorical visualization.
286
+ - **Don't** mint accent colors outside the preset palette for one-off UI surfaces. If a screen seems to need one, the design probably needs a different layout instead.
287
+ - **Do** snap every gap, inset, and gutter to the 4 px grid through the spacing scale.
288
+ - **Don't** use magic numbers in product code. If the scale lacks a step you need, the design needs revisiting, not a one-pixel override.
Binary file
package/data/v3.json.gz CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/data/v4.json.gz CHANGED
Binary file
Binary file
Binary file