@q1travel/design-system 0.15.3 → 0.16.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.
@@ -29,6 +29,15 @@ Examples:
29
29
 
30
30
  Reference color scales use numeric steps from `100` to `1000`.
31
31
 
32
+ #### Scale Steps
33
+
34
+ Non-color reference scales carry their own step rules, so a value that is off the scale shows up as a missing token rather than as a raw number in product CSS.
35
+
36
+ - **Spacing** — the step number is the pixel value divided by four: `--q1-space-4` is `16px`. Half steps fill the gaps inside the 4px grid where a whole step reads as too loose or too tight: `--q1-space-1-5` (`6px`), `--q1-space-2-5` (`10px`), `--q1-space-3-5` (`14px`). The scale runs `1`, `1-5`, `2`, `2-5`, `3`, `3-5`, `4`, `5`, `6`, `8`, `10`, `16`, `24`; it thins out above `20px` because a large gap is read as layout, not as fine adjustment.
37
+ - **Radius** — `--q1-radius-1` through `--q1-radius-5` (`4`, `6`, `8`, `12`, `16px`), plus `--q1-radius-full` (`9999px`) for a pill. The pill value is deliberately larger than any half-height it can meet: it is a shape, not a measurement, and it does not interpolate with the numbered steps.
38
+ - **Line height** — two families coexist. `--q1-line-height-<role>-<size>` is a pixel line box bound to one font-size step, and typography styles use it. `--q1-line-height-tight` (`1.2`), `-snug` (`1.35`), `-normal` (`1.5`), and `-relaxed` (`1.6`) are unitless and scale with whatever font size they land on; they serve text whose size is not one of the typography steps, such as a body block or a table cell.
39
+ - **Font weight** — `--q1-font-weight-regular` (`400`), `-medium` (`500`), `-semibold` (`600`), `-bold` (`700`). Four steps is the whole scale; a weight between two of them is not a distinction the font stack renders consistently.
40
+
32
41
  ### Motion Tokens
33
42
 
34
43
  Motion tokens are the single source for transition and animation values. They are split on the only two questions a motion value answers.
@@ -83,6 +92,9 @@ Examples:
83
92
  - `--q1-color-action-primary`
84
93
  - `--q1-color-status-danger`
85
94
  - `--q1-shadow-focus`
95
+ - `--q1-shadow-focus-danger`
96
+
97
+ `--q1-shadow-focus-danger` is the ring the field family already draws on an invalid control, now named: one step wider and one step lighter than `--q1-shadow-focus`, because red at the same opacity swallows the 1px red border it sits on. Both rings resolve their color through a semantic token, so light and dark need no separate declaration.
86
98
 
87
99
  ### Component Tokens
88
100
 
@@ -134,6 +134,7 @@
134
134
  --q1-font-weight-regular: 400;
135
135
  --q1-font-weight-medium: 500;
136
136
  --q1-font-weight-semibold: 600;
137
+ --q1-font-weight-bold: 700;
137
138
  --q1-font-size-heading-72: 72px;
138
139
  --q1-font-weight-heading-72: var(--q1-font-weight-medium);
139
140
  --q1-line-height-heading-72: 72px;
@@ -174,10 +175,22 @@
174
175
  --q1-line-height-copy-14: 20px;
175
176
  --q1-font-size-code-13: 13px;
176
177
  --q1-line-height-code-13: 18px;
178
+ /* 通用行高刻度:给字号档位之外的文本用(正文块、表格单元、长段落)。字号档位自带的
179
+ --q1-line-height-<role>-<size> 是像素行盒,两者并存——档位锁死行盒高度,这四档跟随字号缩放。 */
180
+ --q1-line-height-tight: 1.2;
181
+ --q1-line-height-snug: 1.35;
182
+ --q1-line-height-normal: 1.5;
183
+ --q1-line-height-relaxed: 1.6;
184
+ /* 间距编号 = 像素值 / 4。半步档(1-5、2-5、3-5)补 4px 网格之间的 6 / 10 / 14px,
185
+ 用于图标与标签、徽章内边距一类整步显得过松或过紧的小尺度处。 */
177
186
  --q1-space-1: 4px;
187
+ --q1-space-1-5: 6px;
178
188
  --q1-space-2: 8px;
189
+ --q1-space-2-5: 10px;
179
190
  --q1-space-3: 12px;
191
+ --q1-space-3-5: 14px;
180
192
  --q1-space-4: 16px;
193
+ --q1-space-5: 20px;
181
194
  --q1-space-6: 24px;
182
195
  --q1-space-8: 32px;
183
196
  --q1-space-10: 40px;
@@ -213,7 +226,13 @@
213
226
  --q1-radius-2: 6px;
214
227
  --q1-radius-3: 8px;
215
228
  --q1-radius-4: 12px;
229
+ --q1-radius-5: 16px;
230
+ /* 胶囊:半径大于任何可能的半高即可,具体数值不参与计算。 */
231
+ --q1-radius-full: 9999px;
216
232
  --q1-shadow-focus: 0 0 0 3px color-mix(in srgb, var(--q1-color-primary-700) 22%, transparent);
233
+ /* 危险态环:字段家族错误态与危险动作共用。比默认焦点环宽一档、淡一档——红色本身已经足够响,
234
+ 同样浓度会盖过 1px 红描边。取值沿用字段错误态的既有标定,status-danger 明暗各有取值。 */
235
+ --q1-shadow-focus-danger: 0 0 0 4px color-mix(in srgb, var(--q1-color-status-danger) 16%, transparent);
217
236
  /* 浮层阴影两档:popover=菜单/悬浮卡/小浮层,modal=模态级大浮层。方向性面板(drawer/sheet)例外,
218
237
  在组件内自持。恒黑 shadow token 混色,暗色靠 --q1-color-border-overlay 发丝边保证清晰度。 */
219
238
  /* 两档均为分层阴影(界面准则 · 设计「分层阴影」):近距接触阴影交代元件落在何处,
@@ -690,7 +709,7 @@
690
709
  .form-field--error .input-control,
691
710
  .input-control:has(.form-control[aria-invalid='true']) {
692
711
  border-color: var(--q1-color-status-danger);
693
- box-shadow: 0 0 0 4px color-mix(in srgb, var(--q1-color-status-danger) 16%, transparent);
712
+ box-shadow: var(--q1-shadow-focus-danger);
694
713
  }
695
714
 
696
715
  .input-control:has(.form-control:disabled) {
@@ -918,7 +937,7 @@
918
937
  .form-field--error .textarea-control,
919
938
  .textarea-control:has(.form-control[aria-invalid='true']) {
920
939
  border-color: var(--q1-color-status-danger);
921
- box-shadow: 0 0 0 4px color-mix(in srgb, var(--q1-color-status-danger) 16%, transparent);
940
+ box-shadow: var(--q1-shadow-focus-danger);
922
941
  }
923
942
 
924
943
  .textarea-control:has(.form-control:disabled) {
@@ -988,7 +1007,7 @@
988
1007
  .form-control[aria-invalid='true'],
989
1008
  .q1-verification-code:has(input[aria-invalid='true']) .q1-verification-code__slot {
990
1009
  border-color: var(--q1-color-status-danger);
991
- box-shadow: 0 0 0 4px color-mix(in srgb, var(--q1-color-status-danger) 16%, transparent);
1010
+ box-shadow: var(--q1-shadow-focus-danger);
992
1011
  }
993
1012
 
994
1013
  /* 禁用态:底色抬灰而非降透明度;opacity:1 归零 Chrome UA 对禁用控件的默认 0.7。 */
@@ -130,6 +130,7 @@
130
130
  --q1-font-weight-regular: 400;
131
131
  --q1-font-weight-medium: 500;
132
132
  --q1-font-weight-semibold: 600;
133
+ --q1-font-weight-bold: 700;
133
134
  --q1-font-size-heading-72: 72px;
134
135
  --q1-font-weight-heading-72: var(--q1-font-weight-medium);
135
136
  --q1-line-height-heading-72: 72px;
@@ -170,10 +171,18 @@
170
171
  --q1-line-height-copy-14: 20px;
171
172
  --q1-font-size-code-13: 13px;
172
173
  --q1-line-height-code-13: 18px;
174
+ --q1-line-height-tight: 1.2;
175
+ --q1-line-height-snug: 1.35;
176
+ --q1-line-height-normal: 1.5;
177
+ --q1-line-height-relaxed: 1.6;
173
178
  --q1-space-1: 4px;
179
+ --q1-space-1-5: 6px;
174
180
  --q1-space-2: 8px;
181
+ --q1-space-2-5: 10px;
175
182
  --q1-space-3: 12px;
183
+ --q1-space-3-5: 14px;
176
184
  --q1-space-4: 16px;
185
+ --q1-space-5: 20px;
177
186
  --q1-space-6: 24px;
178
187
  --q1-space-8: 32px;
179
188
  --q1-space-10: 40px;
@@ -206,7 +215,10 @@
206
215
  --q1-radius-2: 6px;
207
216
  --q1-radius-3: 8px;
208
217
  --q1-radius-4: 12px;
218
+ --q1-radius-5: 16px;
219
+ --q1-radius-full: 9999px;
209
220
  --q1-shadow-focus: 0 0 0 3px color-mix(in srgb, var(--q1-color-primary-700) 22%, transparent);
221
+ --q1-shadow-focus-danger: 0 0 0 4px color-mix(in srgb, var(--q1-color-status-danger) 16%, transparent);
210
222
  --q1-shadow-popover: 0 1px 3px color-mix(in srgb, var(--q1-color-shadow) 10%, transparent),
211
223
  0 8px 28px color-mix(in srgb, var(--q1-color-shadow) 14%, transparent);
212
224
  --q1-shadow-modal: 0 2px 6px color-mix(in srgb, var(--q1-color-shadow) 12%, transparent),
@@ -355,6 +367,7 @@
355
367
  --q1-font-weight-regular: 400;
356
368
  --q1-font-weight-medium: 500;
357
369
  --q1-font-weight-semibold: 600;
370
+ --q1-font-weight-bold: 700;
358
371
  --q1-font-size-heading-72: 72px;
359
372
  --q1-font-weight-heading-72: var(--q1-font-weight-medium);
360
373
  --q1-line-height-heading-72: 72px;
@@ -395,10 +408,18 @@
395
408
  --q1-line-height-copy-14: 20px;
396
409
  --q1-font-size-code-13: 13px;
397
410
  --q1-line-height-code-13: 18px;
411
+ --q1-line-height-tight: 1.2;
412
+ --q1-line-height-snug: 1.35;
413
+ --q1-line-height-normal: 1.5;
414
+ --q1-line-height-relaxed: 1.6;
398
415
  --q1-space-1: 4px;
416
+ --q1-space-1-5: 6px;
399
417
  --q1-space-2: 8px;
418
+ --q1-space-2-5: 10px;
400
419
  --q1-space-3: 12px;
420
+ --q1-space-3-5: 14px;
401
421
  --q1-space-4: 16px;
422
+ --q1-space-5: 20px;
402
423
  --q1-space-6: 24px;
403
424
  --q1-space-8: 32px;
404
425
  --q1-space-10: 40px;
@@ -431,7 +452,10 @@
431
452
  --q1-radius-2: 6px;
432
453
  --q1-radius-3: 8px;
433
454
  --q1-radius-4: 12px;
455
+ --q1-radius-5: 16px;
456
+ --q1-radius-full: 9999px;
434
457
  --q1-shadow-focus: 0 0 0 3px color-mix(in srgb, var(--q1-color-primary-700) 22%, transparent);
458
+ --q1-shadow-focus-danger: 0 0 0 4px color-mix(in srgb, var(--q1-color-status-danger) 16%, transparent);
435
459
  --q1-shadow-popover: 0 1px 3px color-mix(in srgb, var(--q1-color-shadow) 10%, transparent),
436
460
  0 8px 28px color-mix(in srgb, var(--q1-color-shadow) 14%, transparent);
437
461
  --q1-shadow-modal: 0 2px 6px color-mix(in srgb, var(--q1-color-shadow) 12%, transparent),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q1travel/design-system",
3
- "version": "0.15.3",
3
+ "version": "0.16.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist-pkg/design-system.js",