@q1travel/design-system 0.16.0 → 0.17.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/README.md +4 -1
- package/contracts/design.dark.md +5 -2
- package/contracts/design.md +5 -2
- package/contracts/implementation-map.md +1 -1
- package/dist-pkg/design-system.d.ts +333 -115
- package/dist-pkg/design-system.js +8562 -4702
- package/dist-pkg/style.css +4589 -1392
- package/dist-pkg/tokens.css +6 -0
- package/package.json +13 -6
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ q1travel 产品家族的设计权威上游仓,三件事集于一处:`@q1trav
|
|
|
12
12
|
- Generated mirrors(生成镜像,勿手改):`public/design.md`、`public/design.dark.md` 由 `scripts/sync-design-contracts.mjs` 从契约源逐字节复制;`public/design.css` 由 `scripts/build-design-css.mjs` 把两份契约 frontmatter 的取值注入 `contracts/design.css` 的类词汇后生成,因而自足、可被独立 HTML 页面直接加载。
|
|
13
13
|
- Runtime tokens:`src/styles/tokens.css`(canonical `--q1-*`,仅 `:root` 与 `:root[data-theme='dark']` 两个扁平 selector)。
|
|
14
14
|
- 发布台账:`contracts/releases/`(仅存于仓库,不进 npm 包)。
|
|
15
|
-
- npm
|
|
15
|
+
- npm 发布与下游自动更新:版本 tag 触发 GitHub Actions OIDC 免令牌发布,详见[发布操作说明](docs/npm-release.md)。
|
|
16
16
|
|
|
17
17
|
## Getting Started
|
|
18
18
|
|
|
@@ -35,6 +35,9 @@ npm run dev
|
|
|
35
35
|
| `npm run check:browser` | 基于 CDP 的浏览器行为契约(含 StrictMode 前置轮) |
|
|
36
36
|
| `npm run check:package-api` | 已构建包的声明与运行时 API + 组件契约 `node --test` 套件 |
|
|
37
37
|
| `npm run check:release-provenance` | 发布台账 vs `CHANGELOG.md`、origin tag 与 npm registry |
|
|
38
|
+
| `npm run check:release-sync` | 发布后 registry 完整性与四仓 Renovate 通知脚本测试 |
|
|
39
|
+
| `npm run release:verify -- <tarball>` | 只校验 workflow tarball 与 npm registry 完整性 |
|
|
40
|
+
| `npm run release:sync -- <tarball>` | 校验 registry 后通知四仓 Renovate;不具备发布能力 |
|
|
38
41
|
| `npm run build:pkg` | 库构建(产物 `dist-pkg/`)+ CSS 拼装 + 包 API 检查(`prepack` 同款) |
|
|
39
42
|
|
|
40
43
|
本仓没有独立的 test / lint script——规范由 `scripts/` 下的契约门禁脚本守护。
|
package/contracts/design.dark.md
CHANGED
|
@@ -120,9 +120,12 @@ semantic-colors:
|
|
|
120
120
|
action-primary-hover: "{colors.primary-hover}"
|
|
121
121
|
action-primary-press: "{colors.primary-press}"
|
|
122
122
|
action-on-primary: "#ffffff"
|
|
123
|
+
action-text: "{colors.primary-900}"
|
|
123
124
|
surface-canvas: "{colors.background-100}"
|
|
124
125
|
surface-subtle: "{colors.gray-100}"
|
|
125
126
|
surface-panel: "{colors.background-100}"
|
|
127
|
+
surface-media: "#0a0a0a"
|
|
128
|
+
text-on-media: "#ffffff"
|
|
126
129
|
border: "{colors.gray-200}"
|
|
127
130
|
border-strong: "{colors.gray-400}"
|
|
128
131
|
text-primary: "{colors.text-primary}"
|
|
@@ -385,8 +388,8 @@ These components ship in the package. Compose from this list before writing new
|
|
|
385
388
|
|
|
386
389
|
**Option fields.** ControlOption, Checkbox, Radio, Choicebox, Combobox, MultiSelect, Switch, Toggle, Slider, RangeSlider.
|
|
387
390
|
|
|
388
|
-
-
|
|
389
|
-
-
|
|
391
|
+
- Toggle represents one on/off setting and reports a requested change immediately. Checkbox stages a change that a submit applies. Choosing the wrong one misstates when the change takes effect.
|
|
392
|
+
- Switch selects among mutually exclusive views or modes.
|
|
390
393
|
- RangeSlider is two thumbs over one interval, paired with numeric inputs; Slider is a single value.
|
|
391
394
|
|
|
392
395
|
**Dates and ranges.** CalendarGrid, RangeInputs, RangeField, PeriodCombobox, addDays.
|
package/contracts/design.md
CHANGED
|
@@ -120,9 +120,12 @@ semantic-colors:
|
|
|
120
120
|
action-primary-hover: "{colors.primary-hover}"
|
|
121
121
|
action-primary-press: "{colors.primary-press}"
|
|
122
122
|
action-on-primary: "#ffffff"
|
|
123
|
+
action-text: "{colors.primary-700}"
|
|
123
124
|
surface-canvas: "{colors.background-100}"
|
|
124
125
|
surface-subtle: "{colors.background-200}"
|
|
125
126
|
surface-panel: "{colors.background-100}"
|
|
127
|
+
surface-media: "#0a0a0a"
|
|
128
|
+
text-on-media: "#ffffff"
|
|
126
129
|
border: "{colors.gray-400}"
|
|
127
130
|
border-strong: "{colors.gray-500}"
|
|
128
131
|
text-primary: "{colors.text-primary}"
|
|
@@ -385,8 +388,8 @@ These components ship in the package. Compose from this list before writing new
|
|
|
385
388
|
|
|
386
389
|
**Option fields.** ControlOption, Checkbox, Radio, Choicebox, Combobox, MultiSelect, Switch, Toggle, Slider, RangeSlider.
|
|
387
390
|
|
|
388
|
-
-
|
|
389
|
-
-
|
|
391
|
+
- Toggle represents one on/off setting and reports a requested change immediately. Checkbox stages a change that a submit applies. Choosing the wrong one misstates when the change takes effect.
|
|
392
|
+
- Switch selects among mutually exclusive views or modes.
|
|
390
393
|
- RangeSlider is two thumbs over one interval, paired with numeric inputs; Slider is a single value.
|
|
391
394
|
|
|
392
395
|
**Dates and ranges.** CalendarGrid, RangeInputs, RangeField, PeriodCombobox, addDays.
|
|
@@ -33,7 +33,7 @@ README owns the repository inventory and generated-file boundary. This file owns
|
|
|
33
33
|
|
|
34
34
|
Two component-page sections are q1travel supersets with no external counterpart, so their scope is defined here rather than inferred page by page.
|
|
35
35
|
|
|
36
|
-
- **设计 Token** — every Tier B native-semantic control page (Button, Input, Textarea, Select, Checkbox, Radio,
|
|
36
|
+
- **设计 Token** — every Tier B native-semantic control page (Button, Input, Textarea, Select, Checkbox, Radio, Toggle) MUST carry this section. Those controls take their whole surface from semantic tokens, so the role/token/usage table is the only place a consumer can see which tokens to override. Tier A and Tier C pages MUST NOT add it by default: their appearance comes mostly from structure, and a token table there restates the global palette without telling the reader anything component-specific. **Switch and Tabs are the two recorded exceptions** — these Tier A components are likewise entirely token-driven; they keep their tables, and they do not license other Tier A pages to add one.
|
|
37
37
|
- **API 与行为矩阵** — reserved for composite host components that the consumer assembles while the host owns the state (ContextSwitcher, Navigation, Sidebar). The table exists to state who owns what; a component that owns its own state does not need it.
|
|
38
38
|
|
|
39
39
|
Rows in these tables reference semantic tokens (`--q1-color-*`, `--q1-shadow-*`, `--q1-radius-*`), not component-private custom properties. Component-private properties driven by props (for example an avatar diameter) are implementation detail and MUST NOT be documented as a consumer-facing token contract.
|