@ant-design/cli 6.4.5 → 6.5.0
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/data/design-v6.md +66 -22
- package/data/v6.5.0.json.gz +0 -0
- package/data/v6.json.gz +0 -0
- package/data/versions.json +2 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/data/design-v6.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
version: alpha
|
|
2
3
|
name: Ant Design
|
|
3
4
|
description: Enterprise-grade React UI design system from Ant Group, built around the values Natural, Certain, Meaningful, and Growing.
|
|
4
5
|
colors:
|
|
@@ -8,6 +9,7 @@ colors:
|
|
|
8
9
|
error: '#FF4D4F'
|
|
9
10
|
info: '#1677FF'
|
|
10
11
|
blue: '#1677FF'
|
|
12
|
+
blue-7: '#0958D9'
|
|
11
13
|
purple: '#722ED1'
|
|
12
14
|
cyan: '#13C2C2'
|
|
13
15
|
green: '#52C41A'
|
|
@@ -168,6 +170,37 @@ components:
|
|
|
168
170
|
dropdown-item-hover:
|
|
169
171
|
backgroundColor: '{colors.surface-container}'
|
|
170
172
|
textColor: '{colors.on-surface}'
|
|
173
|
+
alert-success:
|
|
174
|
+
backgroundColor: '#F6FFED'
|
|
175
|
+
textColor: '{colors.on-surface}'
|
|
176
|
+
rounded: '{rounded.lg}'
|
|
177
|
+
padding: 8px 12px
|
|
178
|
+
alert-warning:
|
|
179
|
+
backgroundColor: '#FFFBE6'
|
|
180
|
+
textColor: '{colors.on-surface}'
|
|
181
|
+
rounded: '{rounded.lg}'
|
|
182
|
+
padding: 8px 12px
|
|
183
|
+
alert-error:
|
|
184
|
+
backgroundColor: '#FFF2F0'
|
|
185
|
+
textColor: '{colors.on-surface}'
|
|
186
|
+
rounded: '{rounded.lg}'
|
|
187
|
+
padding: 8px 12px
|
|
188
|
+
alert-info:
|
|
189
|
+
backgroundColor: '#E6F4FF'
|
|
190
|
+
textColor: '{colors.on-surface}'
|
|
191
|
+
rounded: '{rounded.lg}'
|
|
192
|
+
padding: 8px 12px
|
|
193
|
+
badge-status-error:
|
|
194
|
+
backgroundColor: '{colors.error}'
|
|
195
|
+
rounded: '{rounded.full}'
|
|
196
|
+
width: 6px
|
|
197
|
+
height: 6px
|
|
198
|
+
tag-blue:
|
|
199
|
+
backgroundColor: '#E6F4FF'
|
|
200
|
+
textColor: '{colors.blue-7}'
|
|
201
|
+
typography: '{typography.body-sm}'
|
|
202
|
+
rounded: '{rounded.md}'
|
|
203
|
+
padding: 0 7px
|
|
171
204
|
---
|
|
172
205
|
|
|
173
206
|
## Overview
|
|
@@ -183,27 +216,17 @@ Four values guide every decision in the system:
|
|
|
183
216
|
- **Meaningful.** Visual emphasis is reserved for action. Decoration that does not communicate is removed.
|
|
184
217
|
- **Growing.** The system scales from small forms to dense tables to multi-tenant admin consoles without losing coherence.
|
|
185
218
|
|
|
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
219
|
## Colors
|
|
199
220
|
|
|
200
|
-
The palette is built from
|
|
221
|
+
The palette is built from one **primary** brand seed, four semantic state seeds (`success`, `warning`, `error`, `info`), and neutral base colors for text and surfaces. Color seeds expand automatically through `@ant-design/colors` into gradient steps covering background tint, hover, active, and outline variants — change the seed, and the entire derived palette moves with it.
|
|
201
222
|
|
|
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
|
|
223
|
+
`#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 is the default brand color for actions, links, focus rings, selected navigation, and active tabs.
|
|
224
|
+
|
|
225
|
+
Accessibility note: this file records Ant Design's default visual tokens. Some brand-color pairs, especially white text on `#1677FF` and primary text on pale selected backgrounds, are below WCAG AA's 4.5:1 contrast threshold for small text. For strict accessibility targets, darken `colorPrimary` through `ConfigProvider` or use component-specific token overrides rather than inventing one-off colors.
|
|
203
226
|
|
|
204
227
|
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
228
|
|
|
206
|
-
The
|
|
229
|
+
The preset colors (`blue`, `purple`, `cyan`, `green`, `magenta`, `red`, `orange`, `yellow`, `volcano`, `geekblue`, `gold`, `lime`; `pink` is a deprecated alias of `magenta` in runtime tokens) are reserved for tags, 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
230
|
|
|
208
231
|
## Typography
|
|
209
232
|
|
|
@@ -229,12 +252,13 @@ Never hard-code `#FFF` or `#FAFAFA` in product code. Read the token. The three-l
|
|
|
229
252
|
|
|
230
253
|
Ant Design is **flat-first**. Borders and tonal contrast carry hierarchy. Shadows appear only on surfaces that genuinely float above their context.
|
|
231
254
|
|
|
232
|
-
|
|
255
|
+
Shadow tokens are generated from `colorShadow`, so the same names adapt across light and dark themes. The core tiers are:
|
|
233
256
|
|
|
234
|
-
- **Tertiary** —
|
|
235
|
-
- **
|
|
236
|
-
- **
|
|
237
|
-
- **
|
|
257
|
+
- **Tertiary** (`boxShadowTertiary`) — the light raised-surface shadow: `0 1px 2px 0 rgba(0,0,0,0.05), 0 1px 6px -1px rgba(0,0,0,0.03), 0 2px 4px 0 rgba(0,0,0,0.03)`.
|
|
258
|
+
- **Popup** (`boxShadow` and `boxShadowSecondary`) — the standard floating-layer shadow: `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)`.
|
|
259
|
+
- **Card** (`boxShadowCard`) — a card-specific raised shadow with tighter spread, used when cards need separation from the container.
|
|
260
|
+
- **Directional drawer and overflow shadows** (`boxShadowDrawer*`, `boxShadowTabsOverflow*`) — specialized tokens for edge-attached surfaces and scroll affordances.
|
|
261
|
+
- **Popover arrow** (`boxShadowPopoverArrow`) — used only for the small triangular pointer on tooltip and popover arrows.
|
|
238
262
|
|
|
239
263
|
Motion uses three durations and a small library of cubic-bezier easings, all exposed as tokens:
|
|
240
264
|
|
|
@@ -259,18 +283,20 @@ Full-pill (`rounded.full`, 9999 px) is reserved for circular avatars, badges, an
|
|
|
259
283
|
|
|
260
284
|
## Components
|
|
261
285
|
|
|
262
|
-
|
|
286
|
+
Component archetypes capture the system's most common surfaces and states. Each entry below maps to the token references in the YAML front-matter.
|
|
263
287
|
|
|
264
288
|
- **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
289
|
- **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
290
|
- **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
291
|
- **Select** — visually identical to Input. The trigger reads as an input until interacted with.
|
|
268
|
-
- **Card** — the workhorse container. White surface, 8 px radius,
|
|
292
|
+
- **Card** — the workhorse container. White surface, 8 px radius, optional `boxShadowCard` elevation. Internal padding is 24 px on all sides; nested controls maintain 16 px gaps.
|
|
269
293
|
- **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
294
|
- **Menu (selected item)** — `#E6F4FF` background, `primary` text. This is the single visual cue for "you are here" in navigation.
|
|
271
295
|
- **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
296
|
- **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
297
|
- **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.
|
|
298
|
+
- **Alert** — semantic feedback surface. Success, warning, error, and info alerts use pale semantic backgrounds with normal text color; the status is communicated by icon and tint, not by low-contrast colored body text.
|
|
299
|
+
- **Badge status dot** — compact status indicator. Critical status may use `error` fill, but the dot is not a substitute for text in accessibility-critical flows.
|
|
274
300
|
- **Tooltip** — high-contrast inverse surface: `rgba(0,0,0,0.85)` background, white text. Always positioned by the framework, never manually pinned.
|
|
275
301
|
- **Dropdown menu (item hover)** — `surface-container` fill on hover, no text-color change. The hover affordance is enough.
|
|
276
302
|
|
|
@@ -286,3 +312,21 @@ Twelve component archetypes capture most of the system's surface area. Each entr
|
|
|
286
312
|
- **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
313
|
- **Do** snap every gap, inset, and gutter to the 4 px grid through the spacing scale.
|
|
288
314
|
- **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.
|
|
315
|
+
|
|
316
|
+
## Customization
|
|
317
|
+
|
|
318
|
+
Every value in the YAML front-matter above is a **default** produced by `defaultAlgorithm` — the light theme. Ant Design theming is broader than Design Token replacement: it includes algorithmic derivation, component-scoped overrides, dynamic switching, nested theme scopes, CSS variable output, static token consumption, and zero-runtime CSS extraction. See [Customize Theme](https://ant.design/docs/react/customize-theme.md) for the complete runtime API and examples.
|
|
319
|
+
|
|
320
|
+
The primary theme configuration entry is `ConfigProvider`'s `theme` prop:
|
|
321
|
+
|
|
322
|
+
1. **Seed token overrides.** Pass `theme.token` to `ConfigProvider` to replace any seed. The primary and semantic color seeds (`colorPrimary`, `colorSuccess`, `colorWarning`, `colorError`, `colorInfo`) expand into derived gradients, while `colorBgBase` and `colorTextBase` drive neutral surfaces and text. Spacing, radius, and font-size seeds work the same way.
|
|
323
|
+
|
|
324
|
+
2. **Algorithm switching.** Set `theme.algorithm` to swap the derivation logic. `defaultAlgorithm`, `darkAlgorithm`, and `compactAlgorithm` can be used alone or composed as an array — do not invert colors manually; the algorithms account for non-linear palette, surface, shadow, and size relationships.
|
|
325
|
+
|
|
326
|
+
3. **Component-level overrides.** `theme.components.Button` (or any component's token namespace) can override a single component's Component Token and consumed Alias Token without affecting others. In component config, `algorithm` can opt that component into token derivation when the override should still follow seed-token relationships.
|
|
327
|
+
|
|
328
|
+
4. **Runtime scope.** Themes can switch dynamically by changing `ConfigProvider.theme`, and nested `ConfigProvider` instances create local themes that inherit unchanged tokens from their parent. Static APIs such as `message.xxx`, `Modal.xxx`, and `notification.xxx` do not automatically receive the surrounding context; use hook-based APIs, `App`, or explicit context holders when themed static feedback is required.
|
|
329
|
+
|
|
330
|
+
5. **Token consumption and output.** Use `theme.useToken()` inside React and `theme.getDesignToken()` outside React to consume resolved tokens. Use `theme.cssVar` when CSS variables are needed, and `theme.zeroRuntime` with prebuilt or extracted CSS when runtime style generation must be disabled.
|
|
331
|
+
|
|
332
|
+
For custom theme generation, keep Ant Design's interaction structure, density, state feedback, and component semantics first. Then change the smallest necessary seed set: usually `colorPrimary`, status colors, `borderRadius`, `fontFamily`, `fontSize`, and neutral surface bases. Brand pages may look distinct, but forms, tables, navigation, overlays, focus states, and validation feedback should still feel like Ant Design. Avoid generating custom CSS rules that bypass tokens, algorithms, `theme.components`, CSS variables, or extracted static styles; if a theme cannot be expressed through those official layers, treat that as a design-system extension rather than a one-off page style.
|
|
Binary file
|
package/data/v6.json.gz
CHANGED
|
Binary file
|
package/data/versions.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -19306,7 +19306,7 @@ function collectAntdEnv(cwd, versionOverride) {
|
|
|
19306
19306
|
function collectCliEnv() {
|
|
19307
19307
|
let cliVersion;
|
|
19308
19308
|
try {
|
|
19309
|
-
cliVersion = "6.
|
|
19309
|
+
cliVersion = "6.5.0";
|
|
19310
19310
|
} catch (err) {
|
|
19311
19311
|
console.error("Failed to get CLI version:", err);
|
|
19312
19312
|
cliVersion = "unknown";
|
|
@@ -21519,7 +21519,7 @@ function printUpdateNotice(currentVersion, latestVersion) {
|
|
|
21519
21519
|
}
|
|
21520
21520
|
async function checkForUpdate() {
|
|
21521
21521
|
if (process.env.CI || process.env.NO_UPDATE_CHECK) return;
|
|
21522
|
-
const currentVersion = "6.
|
|
21522
|
+
const currentVersion = "6.5.0";
|
|
21523
21523
|
if (!valid(currentVersion)) return;
|
|
21524
21524
|
const now = Date.now();
|
|
21525
21525
|
const cache = cacheStore.get("updateCache") ?? null;
|
|
@@ -21572,7 +21572,7 @@ function runUpgrade(cmd, args) {
|
|
|
21572
21572
|
function registerUpgradeCommand(program2) {
|
|
21573
21573
|
program2.command("upgrade").description("Upgrade the CLI to the latest version").action(async () => {
|
|
21574
21574
|
const opts = program2.opts();
|
|
21575
|
-
const currentVersion = "6.
|
|
21575
|
+
const currentVersion = "6.5.0";
|
|
21576
21576
|
let latestVersion;
|
|
21577
21577
|
try {
|
|
21578
21578
|
latestVersion = await fetchLatestVersion();
|
|
@@ -36021,7 +36021,7 @@ function registerMcpCommand(program2) {
|
|
|
36021
36021
|
const opts = program2.opts();
|
|
36022
36022
|
const versionInfo = detectVersion(opts.version);
|
|
36023
36023
|
const server = new Server(
|
|
36024
|
-
{ name: "antd", version: "6.
|
|
36024
|
+
{ name: "antd", version: "6.5.0" },
|
|
36025
36025
|
{ capabilities: { tools: {}, prompts: {} } }
|
|
36026
36026
|
);
|
|
36027
36027
|
const handleTool = createToolHandler({
|
|
@@ -36506,7 +36506,7 @@ function registerSetupCommand(program2) {
|
|
|
36506
36506
|
}
|
|
36507
36507
|
|
|
36508
36508
|
// src/index.ts
|
|
36509
|
-
var CLI_VERSION = "6.
|
|
36509
|
+
var CLI_VERSION = "6.5.0";
|
|
36510
36510
|
function createProgram() {
|
|
36511
36511
|
const program2 = new Command();
|
|
36512
36512
|
program2.name("antd").description("CLI tool for querying antd knowledge and analyzing antd usage").option("--format <format>", "Output format: json, text, or markdown", "text").option("--version <version>", "Target antd version (e.g. 5.20.0)").option("--lang <lang>", "Output language: en or zh", "en").option("--detail", "Full information output", false);
|