@q1travel/design-system 0.30.11 → 0.30.13
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 +3 -2
- package/bin/lint-component-enums.mjs +42 -0
- package/bin/q1-design.mjs +28 -2
- package/contracts/cascader.md +10 -0
- package/contracts/design.dark.md +7 -0
- package/contracts/design.md +7 -0
- package/contracts/implementation-map.md +6 -1
- package/contracts/interface-guidelines.md +1 -0
- package/contracts/token-naming.md +2 -0
- package/dist-pkg/component-enums.json +284 -0
- package/dist-pkg/design-system.d.ts +12 -8
- package/dist-pkg/design-system.js +4471 -4439
- package/dist-pkg/style.css +72 -13
- package/dist-pkg/tokens.css +2 -0
- package/package.json +7 -5
- package/tooling/README.md +7 -1
- package/tooling/scripts/evals/rules-checklist.json +2 -1
package/dist-pkg/style.css
CHANGED
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
--q1-color-text-soft: #6e6e73;
|
|
158
158
|
--q1-color-text-disabled: #b7b7b7;
|
|
159
159
|
--q1-color-overlay-scrim: rgba(2, 6, 23, 0.44);
|
|
160
|
+
--q1-color-media-scrim: rgba(2, 6, 23, 0.56);
|
|
160
161
|
--q1-color-focus: var(--q1-color-shadow);
|
|
161
162
|
--q1-color-selection-bg: var(--q1-color-text-primary);
|
|
162
163
|
--q1-color-selection-fg: var(--q1-color-bg-canvas);
|
|
@@ -502,6 +503,7 @@
|
|
|
502
503
|
--q1-color-text-soft: #9a9a9c;
|
|
503
504
|
--q1-color-text-disabled: var(--q1-color-gray-500);
|
|
504
505
|
--q1-color-overlay-scrim: rgba(2, 6, 23, 0.44);
|
|
506
|
+
--q1-color-media-scrim: rgba(2, 6, 23, 0.56);
|
|
505
507
|
--q1-color-focus: var(--q1-color-action-on-primary);
|
|
506
508
|
--q1-color-status-success: var(--q1-color-green-900);
|
|
507
509
|
--q1-color-status-success-text: var(--q1-color-green-900);
|
|
@@ -1985,6 +1987,29 @@
|
|
|
1985
1987
|
text-overflow: ellipsis;
|
|
1986
1988
|
color: var(--q1-color-text-secondary);
|
|
1987
1989
|
}
|
|
1990
|
+
.menu__item--locked {
|
|
1991
|
+
height: auto;
|
|
1992
|
+
min-height: var(--q1-control-height-default);
|
|
1993
|
+
align-items: flex-start;
|
|
1994
|
+
padding-block: var(--q1-space-2);
|
|
1995
|
+
line-height: var(--q1-line-height-label-14);
|
|
1996
|
+
}
|
|
1997
|
+
.menu__item-content {
|
|
1998
|
+
display: flex;
|
|
1999
|
+
flex: 1;
|
|
2000
|
+
flex-direction: column;
|
|
2001
|
+
min-width: 0;
|
|
2002
|
+
}
|
|
2003
|
+
.menu__item--locked .menu__item-icon {
|
|
2004
|
+
margin-top: calc((var(--q1-line-height-label-14) - var(--q1-space-4)) / 2);
|
|
2005
|
+
}
|
|
2006
|
+
.menu__item-reason {
|
|
2007
|
+
font-size: var(--q1-font-size-label-13);
|
|
2008
|
+
line-height: var(--q1-line-height-label-13);
|
|
2009
|
+
white-space: normal;
|
|
2010
|
+
overflow-wrap: anywhere;
|
|
2011
|
+
color: var(--q1-color-text-secondary);
|
|
2012
|
+
}
|
|
1988
2013
|
.menu__section {
|
|
1989
2014
|
padding: var(--q1-space-2) var(--q1-space-3) var(--q1-space-1);
|
|
1990
2015
|
font-size: 12px;
|
|
@@ -2869,6 +2894,7 @@
|
|
|
2869
2894
|
}
|
|
2870
2895
|
|
|
2871
2896
|
.banner__close {
|
|
2897
|
+
font: inherit;
|
|
2872
2898
|
box-sizing: border-box;
|
|
2873
2899
|
display: inline-flex;
|
|
2874
2900
|
align-items: center;
|
|
@@ -3070,6 +3096,7 @@ a.breadcrumb__link:hover {
|
|
|
3070
3096
|
}
|
|
3071
3097
|
|
|
3072
3098
|
.breadcrumb__toggle {
|
|
3099
|
+
font: inherit;
|
|
3073
3100
|
display: inline-flex;
|
|
3074
3101
|
align-items: center;
|
|
3075
3102
|
justify-content: center;
|
|
@@ -3363,6 +3390,7 @@ a.breadcrumb__link:hover {
|
|
|
3363
3390
|
可见焦点环——它可聚焦,chrome 整体不再 aria-hidden 正是为了让它可达。
|
|
3364
3391
|
点击目标 24×24(WCAG 2.2 最小目标),图标仍 12px 居中——负 margin 抵消撑高,不改地址栏高度。 */
|
|
3365
3392
|
.browser__address-copy {
|
|
3393
|
+
font: inherit;
|
|
3366
3394
|
flex-shrink: 0;
|
|
3367
3395
|
display: grid;
|
|
3368
3396
|
place-items: center;
|
|
@@ -4313,6 +4341,7 @@ a[href]:has(> .book):focus-visible {
|
|
|
4313
4341
|
}
|
|
4314
4342
|
|
|
4315
4343
|
.cal-field__trigger {
|
|
4344
|
+
font: inherit;
|
|
4316
4345
|
display: inline-flex;
|
|
4317
4346
|
align-items: center;
|
|
4318
4347
|
gap: var(--q1-space-2);
|
|
@@ -4335,6 +4364,7 @@ a[href]:has(> .book):focus-visible {
|
|
|
4335
4364
|
|
|
4336
4365
|
.cal-field__clear,
|
|
4337
4366
|
.cal-field__caret {
|
|
4367
|
+
font: inherit;
|
|
4338
4368
|
display: grid;
|
|
4339
4369
|
place-items: center;
|
|
4340
4370
|
min-height: var(--q1-space-6);
|
|
@@ -4454,6 +4484,7 @@ a[href]:has(> .book):focus-visible {
|
|
|
4454
4484
|
}
|
|
4455
4485
|
|
|
4456
4486
|
.calendar__nav-btn {
|
|
4487
|
+
font: inherit;
|
|
4457
4488
|
display: grid;
|
|
4458
4489
|
place-items: center;
|
|
4459
4490
|
width: 28px;
|
|
@@ -4515,6 +4546,7 @@ a[href]:has(> .book):focus-visible {
|
|
|
4515
4546
|
}
|
|
4516
4547
|
|
|
4517
4548
|
.calendar__day {
|
|
4549
|
+
font: inherit;
|
|
4518
4550
|
position: relative;
|
|
4519
4551
|
display: grid;
|
|
4520
4552
|
place-items: center;
|
|
@@ -4576,6 +4608,7 @@ a[href]:has(> .book):focus-visible {
|
|
|
4576
4608
|
}
|
|
4577
4609
|
|
|
4578
4610
|
.cal-period__trigger {
|
|
4611
|
+
font: inherit;
|
|
4579
4612
|
display: inline-flex;
|
|
4580
4613
|
align-items: center;
|
|
4581
4614
|
gap: var(--q1-space-2);
|
|
@@ -4613,6 +4646,7 @@ a[href]:has(> .book):focus-visible {
|
|
|
4613
4646
|
}
|
|
4614
4647
|
|
|
4615
4648
|
.cal-period__option {
|
|
4649
|
+
font: inherit;
|
|
4616
4650
|
width: 100%;
|
|
4617
4651
|
text-align: left;
|
|
4618
4652
|
padding: var(--q1-space-2) var(--q1-space-3);
|
|
@@ -5037,6 +5071,7 @@ a[href]:has(> .book):focus-visible {
|
|
|
5037
5071
|
}
|
|
5038
5072
|
|
|
5039
5073
|
.snippet__copy {
|
|
5074
|
+
font: inherit;
|
|
5040
5075
|
position: absolute;
|
|
5041
5076
|
top: 50%;
|
|
5042
5077
|
right: var(--q1-space-1);
|
|
@@ -5310,6 +5345,7 @@ a[href]:has(> .book):focus-visible {
|
|
|
5310
5345
|
|
|
5311
5346
|
/* 行动按钮。 */
|
|
5312
5347
|
.note__action {
|
|
5348
|
+
font: inherit;
|
|
5313
5349
|
flex-shrink: 0;
|
|
5314
5350
|
display: inline-flex;
|
|
5315
5351
|
align-items: center;
|
|
@@ -6392,6 +6428,7 @@ a.q1-card:focus-visible {
|
|
|
6392
6428
|
}
|
|
6393
6429
|
|
|
6394
6430
|
.twc__copy {
|
|
6431
|
+
font: inherit;
|
|
6395
6432
|
display: grid;
|
|
6396
6433
|
place-items: center;
|
|
6397
6434
|
width: 24px;
|
|
@@ -6507,6 +6544,7 @@ a.q1-card:focus-visible {
|
|
|
6507
6544
|
|
|
6508
6545
|
/* 清除按钮:视觉走字段家族的通用 X;Esc 仍是即时键盘路径。 */
|
|
6509
6546
|
.search-input__clear {
|
|
6547
|
+
font: inherit;
|
|
6510
6548
|
position: absolute;
|
|
6511
6549
|
top: 50%;
|
|
6512
6550
|
right: var(--q1-space-2);
|
|
@@ -6716,6 +6754,7 @@ a.q1-card:focus-visible {
|
|
|
6716
6754
|
|
|
6717
6755
|
/* 药丸触发器:h32 / font 14/500 / 全圆角;颜色走家族 panel+border。 */
|
|
6718
6756
|
.show-more__trigger {
|
|
6757
|
+
font: inherit;
|
|
6719
6758
|
display: inline-flex;
|
|
6720
6759
|
align-items: center;
|
|
6721
6760
|
gap: var(--q1-space-1);
|
|
@@ -7512,6 +7551,7 @@ a.q1-card:focus-visible {
|
|
|
7512
7551
|
min-height: 0;
|
|
7513
7552
|
}
|
|
7514
7553
|
.scroller-buttons__control {
|
|
7554
|
+
font: inherit;
|
|
7515
7555
|
flex: none;
|
|
7516
7556
|
display: grid;
|
|
7517
7557
|
place-items: center;
|
|
@@ -7576,9 +7616,8 @@ a.q1-card:focus-visible {
|
|
|
7576
7616
|
place-items: center;
|
|
7577
7617
|
}
|
|
7578
7618
|
.theme-switcher__option:has(input:checked) {
|
|
7579
|
-
background: var(--q1-color-bg-
|
|
7619
|
+
background: var(--q1-color-bg-selected-neutral);
|
|
7580
7620
|
color: var(--q1-color-text-primary);
|
|
7581
|
-
box-shadow: inset 0 0 0 1px var(--q1-color-gray-400);
|
|
7582
7621
|
}
|
|
7583
7622
|
.theme-switcher__option:has(input:focus-visible) {
|
|
7584
7623
|
outline: none;
|
|
@@ -7935,6 +7974,7 @@ a.q1-card:focus-visible {
|
|
|
7935
7974
|
box-shadow: var(--q1-shadow-focus);
|
|
7936
7975
|
}
|
|
7937
7976
|
.q1-toast__close {
|
|
7977
|
+
font: inherit;
|
|
7938
7978
|
flex: none;
|
|
7939
7979
|
display: grid;
|
|
7940
7980
|
place-items: center;
|
|
@@ -8243,6 +8283,7 @@ a.q1-card:focus-visible {
|
|
|
8243
8283
|
display: inline-block;
|
|
8244
8284
|
}
|
|
8245
8285
|
.dots-menu__trigger {
|
|
8286
|
+
font: inherit;
|
|
8246
8287
|
display: grid;
|
|
8247
8288
|
place-items: center;
|
|
8248
8289
|
border: 0;
|
|
@@ -8548,6 +8589,7 @@ a.q1-card:focus-visible {
|
|
|
8548
8589
|
outline: none;
|
|
8549
8590
|
}
|
|
8550
8591
|
.combobox__clear {
|
|
8592
|
+
font: inherit;
|
|
8551
8593
|
flex: none;
|
|
8552
8594
|
display: grid;
|
|
8553
8595
|
place-items: center;
|
|
@@ -8862,6 +8904,7 @@ a.q1-card:focus-visible {
|
|
|
8862
8904
|
}
|
|
8863
8905
|
/* 遮罩颜色与 Modal 同源,见 overlay-surfaces.css:浅色为白纱,暗色压暗。 */
|
|
8864
8906
|
.search-dialog__backdrop {
|
|
8907
|
+
font: inherit;
|
|
8865
8908
|
position: absolute;
|
|
8866
8909
|
inset: 0;
|
|
8867
8910
|
border: 0;
|
|
@@ -8913,6 +8956,7 @@ a.q1-card:focus-visible {
|
|
|
8913
8956
|
}
|
|
8914
8957
|
/* 关闭入口以 Esc 键帽呈现:键盘优先、视觉更轻;粗指针下由 TouchTarget 扩展到 44px 命中区。 */
|
|
8915
8958
|
.search-dialog__close {
|
|
8959
|
+
font: inherit;
|
|
8916
8960
|
position: relative;
|
|
8917
8961
|
display: inline-flex;
|
|
8918
8962
|
flex: none;
|
|
@@ -9146,6 +9190,7 @@ a.q1-card:focus-visible {
|
|
|
9146
9190
|
padding: var(--q1-space-4);
|
|
9147
9191
|
}
|
|
9148
9192
|
.modal__backdrop {
|
|
9193
|
+
font: inherit;
|
|
9149
9194
|
position: absolute;
|
|
9150
9195
|
inset: 0;
|
|
9151
9196
|
border: 0;
|
|
@@ -9329,6 +9374,7 @@ a.q1-card:focus-visible {
|
|
|
9329
9374
|
align-items: center;
|
|
9330
9375
|
}
|
|
9331
9376
|
.drawer__backdrop {
|
|
9377
|
+
font: inherit;
|
|
9332
9378
|
position: absolute;
|
|
9333
9379
|
inset: 0;
|
|
9334
9380
|
border: 0;
|
|
@@ -9348,6 +9394,7 @@ a.q1-card:focus-visible {
|
|
|
9348
9394
|
/* 抓手把是真按钮(点击/Enter/Space 关闭,下滑手势保留给触屏)——原 role=button+tabIndex=-1
|
|
9349
9395
|
是读屏能发现却无法激活的矛盾信号。清按钮默认样式,触控目标保持至少 44px。 */
|
|
9350
9396
|
.drawer__handle {
|
|
9397
|
+
font: inherit;
|
|
9351
9398
|
display: grid;
|
|
9352
9399
|
place-items: center;
|
|
9353
9400
|
width: 100%;
|
|
@@ -9663,6 +9710,7 @@ a.q1-card:focus-visible {
|
|
|
9663
9710
|
color: var(--q1-color-text-primary);
|
|
9664
9711
|
}
|
|
9665
9712
|
.sheet__close {
|
|
9713
|
+
font: inherit;
|
|
9666
9714
|
flex: none;
|
|
9667
9715
|
display: grid;
|
|
9668
9716
|
place-items: center;
|
|
@@ -10532,6 +10580,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
10532
10580
|
|
|
10533
10581
|
.q1-context-switcher__popup[role='dialog'] input[type='search'],
|
|
10534
10582
|
.q1-context-switcher__popup--stacked input[type='search'] {
|
|
10583
|
+
font: inherit;
|
|
10535
10584
|
width: 100%;
|
|
10536
10585
|
min-width: 0;
|
|
10537
10586
|
min-height: var(--q1-space-8);
|
|
@@ -11466,7 +11515,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
11466
11515
|
|
|
11467
11516
|
.q1-cascader { display: grid; gap: var(--q1-space-2); min-inline-size: 0; }
|
|
11468
11517
|
.q1-cascader__label { color: var(--q1-color-text-primary); font-size: var(--q1-font-size-label-14); line-height: var(--q1-line-height-label-14); }
|
|
11469
|
-
.q1-cascader__control { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--q1-space-2); border: calc(var(--q1-space-1) / 4) solid var(--q1-color-border); border-radius: var(--q1-radius-2); background: var(--q1-color-bg-sunken); }
|
|
11518
|
+
.q1-cascader__control { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--q1-space-2); border: calc(var(--q1-space-1) / 4) solid var(--q1-color-border-control); border-radius: var(--q1-radius-2); background: var(--q1-color-bg-sunken); }
|
|
11470
11519
|
.q1-cascader__trigger { display: flex; align-items: center; justify-content: space-between; flex: 1; gap: var(--q1-space-2); min-inline-size: 0; min-block-size: var(--q1-control-height-default); padding: var(--q1-space-2) var(--q1-space-3); border: none; background: none; border-radius: var(--q1-radius-2); color: var(--q1-color-text-primary); font: inherit; font-size: var(--q1-font-size-label-14); line-height: var(--q1-line-height-label-14); cursor: pointer; text-align: start; overflow-wrap: anywhere; }
|
|
11471
11520
|
.q1-cascader__trigger svg, .q1-cascader__option svg { flex: none; }
|
|
11472
11521
|
.q1-cascader__control:focus-within { box-shadow: var(--q1-shadow-focus-input); }
|
|
@@ -11475,25 +11524,26 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
11475
11524
|
.q1-cascader__trigger:focus-visible { outline: none; }
|
|
11476
11525
|
.q1-cascader__placeholder, .q1-cascader__path { color: var(--q1-color-text-muted); }
|
|
11477
11526
|
.q1-cascader__control[data-disabled], .q1-cascader__trigger[aria-disabled], .q1-cascader__option[aria-disabled] { color: var(--q1-color-text-disabled); cursor: default; }
|
|
11527
|
+
.q1-cascader__control[data-disabled]:not([data-invalid]) { border-color: var(--q1-color-border); }
|
|
11478
11528
|
.q1-cascader__control[data-disabled] .q1-cascader__trigger { color: inherit; }
|
|
11479
11529
|
.q1-cascader__control[data-tags] { align-items: start; flex-wrap: nowrap; padding-inline-end: calc(var(--q1-control-height-default) + var(--q1-space-3)); }
|
|
11480
11530
|
.q1-cascader__control[data-tags] .q1-cascader__trigger { position: absolute; inset: 0; inline-size: 100%; padding: 0; }
|
|
11481
11531
|
.q1-cascader__control[data-tags][data-clearable] { padding-inline-end: calc(var(--q1-control-height-default) * 2 + var(--q1-space-3)); }
|
|
11482
11532
|
.q1-cascader__control[data-clearable]:not([data-tags]) .q1-cascader__trigger { margin-inline-end: var(--q1-control-height-default); }
|
|
11483
|
-
.q1-cascader__control[data-tags] .q1-cascader__trigger > svg { position: absolute; inset-block-start: var(--q1-space-2); inset-inline-end: var(--q1-space-2); }
|
|
11533
|
+
.q1-cascader__control[data-tags] .q1-cascader__trigger > svg { position: absolute; inset-block-start: calc((var(--q1-control-height-default) - var(--q1-space-4)) / 2); inset-inline-end: var(--q1-space-2); }
|
|
11484
11534
|
.q1-cascader__control[data-tags][data-clearable] .q1-cascader__trigger > svg { inset-inline-end: calc(var(--q1-control-height-default) + var(--q1-space-2)); }
|
|
11485
11535
|
.q1-cascader__remove { position: relative; z-index: 1; pointer-events: auto; }
|
|
11486
11536
|
.q1-cascader__control > .q1-cascader__remove { position: absolute; inset-block-start: 0; inset-inline-end: 0; }
|
|
11487
|
-
.q1-cascader__tags { position: relative; pointer-events: none; min-inline-size: 0; flex: 1; display: flex; flex-wrap: wrap; gap: var(--q1-space-
|
|
11488
|
-
.q1-cascader__tag { max-inline-size: 100%; min-inline-size: 0; display: inline-flex; align-items: center; gap: var(--q1-space-
|
|
11537
|
+
.q1-cascader__tags { position: relative; pointer-events: none; min-inline-size: 0; flex: 1; display: flex; flex-wrap: wrap; gap: var(--q1-space-1); padding: var(--q1-space-2); }
|
|
11538
|
+
.q1-cascader__tag { font-size: var(--q1-font-size-label-14); line-height: var(--q1-line-height-label-14); max-inline-size: 100%; min-inline-size: 0; display: inline-flex; align-items: center; gap: var(--q1-space-1); background: var(--q1-color-bg-hover); border-radius: var(--q1-radius-1); padding-inline-start: var(--q1-space-2); overflow-wrap: anywhere; }
|
|
11489
11539
|
.q1-cascader__tag > span { min-inline-size: 0; }
|
|
11490
|
-
.q1-cascader__tag .q1-cascader__remove { pointer-events: auto; flex: none; }
|
|
11540
|
+
.q1-cascader__tag .q1-cascader__remove { pointer-events: auto; flex: none; min-block-size: var(--q1-space-6); min-inline-size: var(--q1-space-6); padding: 0; border-radius: var(--q1-radius-1); color: inherit; }
|
|
11491
11541
|
.q1-cascader__option [data-selection-area] { display: inline-flex; align-items: center; justify-content: center; flex: none; align-self: stretch; inline-size: var(--q1-control-height-default); margin: calc(var(--q1-space-2) * -1) 0 calc(var(--q1-space-2) * -1) calc(var(--q1-space-3) * -1); }
|
|
11492
11542
|
.q1-cascader__remove, .q1-cascader__back { display: inline-flex; align-items: center; justify-content: center; min-block-size: var(--q1-control-height-default); min-inline-size: var(--q1-control-height-default); padding: var(--q1-space-2); border: none; border-radius: var(--q1-radius-2); background: none; color: var(--q1-color-text-secondary); font: inherit; cursor: pointer; }
|
|
11493
11543
|
.q1-cascader__remove:focus-visible, .q1-cascader__back:focus-visible, .q1-cascader__search:focus-visible, .q1-cascader__list:focus-visible { outline: none; box-shadow: var(--q1-shadow-focus-input); }
|
|
11494
11544
|
.q1-cascader__popup.popover-panel { max-inline-size: calc(100vw - var(--q1-space-6)); padding: var(--q1-space-2); border-radius: var(--q1-radius-3); background: var(--q1-color-bg-overlay); }
|
|
11495
11545
|
.q1-cascader__panel { display: grid; gap: var(--q1-space-2); min-inline-size: 0; }
|
|
11496
|
-
.q1-cascader__search { box-sizing: border-box; inline-size: 100%; min-block-size: var(--q1-control-height-default); padding: var(--q1-space-2) var(--q1-space-3); border: calc(var(--q1-space-1) / 4) solid var(--q1-color-border); border-radius: var(--q1-radius-2); background: var(--q1-color-bg-sunken); color: var(--q1-color-text-primary); font: inherit; font-size: var(--q1-font-size-label-14); }
|
|
11546
|
+
.q1-cascader__search { box-sizing: border-box; inline-size: 100%; min-block-size: var(--q1-control-height-default); padding: var(--q1-space-2) var(--q1-space-3); border: calc(var(--q1-space-1) / 4) solid var(--q1-color-border-control); border-radius: var(--q1-radius-2); background: var(--q1-color-bg-sunken); color: var(--q1-color-text-primary); font: inherit; font-size: var(--q1-font-size-label-14); }
|
|
11497
11547
|
.q1-cascader__columns { display: flex; overflow-x: auto; min-inline-size: 0; max-inline-size: calc(100vw - var(--q1-space-6) * 2); }
|
|
11498
11548
|
.q1-cascader__column { flex: 0 0 auto; inline-size: calc(var(--q1-space-10) * 6); min-inline-size: 0; max-inline-size: 100%; }
|
|
11499
11549
|
.q1-cascader__column[hidden] { display: none; }
|
|
@@ -11519,7 +11569,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
11519
11569
|
.q1-cascader__control[data-clearable]:not([data-tags]) .q1-cascader__trigger { margin-inline-end: var(--q1-touch-target-min); }
|
|
11520
11570
|
.q1-cascader__control[data-tags] .q1-cascader__trigger > svg { inset-block-start: calc((var(--q1-touch-target-min) - var(--q1-space-4)) / 2); }
|
|
11521
11571
|
.q1-cascader__control[data-tags][data-clearable] .q1-cascader__trigger > svg { inset-inline-end: calc(var(--q1-touch-target-min) + var(--q1-space-2)); }
|
|
11522
|
-
.q1-cascader__remove { min-inline-size: var(--q1-touch-target-min); }
|
|
11572
|
+
.q1-cascader__remove, .q1-cascader__tag .q1-cascader__remove { min-inline-size: var(--q1-touch-target-min); min-block-size: var(--q1-touch-target-min); }
|
|
11523
11573
|
}
|
|
11524
11574
|
|
|
11525
11575
|
/* 未知总量以往返移动表示持续等待;减弱动态时保留居中填充段,不伪装完成比例。 */
|
|
@@ -12449,7 +12499,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
12449
12499
|
|
|
12450
12500
|
.multi-combobox { min-width: 0; }
|
|
12451
12501
|
.multi-combobox__control { box-sizing: border-box; position: relative; display: flex; align-items: center; gap: var(--q1-space-2); min-height: var(--q1-control-height-default); padding: var(--q1-space-1) var(--q1-space-3); border: calc(var(--q1-space-1) / 4) solid var(--q1-color-border-control); border-radius: var(--q1-radius-2); background: var(--q1-color-bg-sunken); }
|
|
12452
|
-
.multi-combobox__trigger { position: absolute; inset: 0; width: 100%; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
|
|
12502
|
+
.multi-combobox__trigger { font: inherit; position: absolute; inset: 0; width: 100%; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
|
|
12453
12503
|
.multi-combobox__trigger:focus { outline: none; }
|
|
12454
12504
|
.multi-combobox__control:has(.multi-combobox__trigger:focus-visible) { box-shadow: var(--q1-shadow-focus); }
|
|
12455
12505
|
.multi-combobox__control[data-invalid] { border-color: var(--q1-color-status-danger); box-shadow: 0 0 0 calc(var(--q1-space-1) / 4) var(--q1-color-status-danger), 0 0 0 var(--q1-space-1) var(--q1-color-red-100); }
|
|
@@ -12459,7 +12509,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
12459
12509
|
.multi-combobox__values { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: var(--q1-space-1); min-width: 0; pointer-events: none; font-size: var(--q1-font-size-label-14); line-height: var(--q1-line-height-label-14); }
|
|
12460
12510
|
.multi-combobox__tag { position: relative; display: inline-flex; align-items: center; gap: var(--q1-space-1); max-width: 100%; padding-inline-start: var(--q1-space-2); border-radius: var(--q1-radius-1); background: var(--q1-color-bg-hover); color: var(--q1-color-text-primary); }
|
|
12461
12511
|
.multi-combobox__tag > span { min-width: 0; overflow-wrap: anywhere; }
|
|
12462
|
-
.multi-combobox__remove { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: var(--q1-space-6); min-height: var(--q1-space-6); padding: 0; border: 0; border-radius: var(--q1-radius-1); background: transparent; color: inherit; pointer-events: auto; cursor: pointer; }
|
|
12512
|
+
.multi-combobox__remove { font: inherit; position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: var(--q1-space-6); min-height: var(--q1-space-6); padding: 0; border: 0; border-radius: var(--q1-radius-1); background: transparent; color: inherit; pointer-events: auto; cursor: pointer; }
|
|
12463
12513
|
.multi-combobox__remove:disabled { cursor: default; }
|
|
12464
12514
|
.multi-combobox__remove:focus-visible { outline: none; box-shadow: var(--q1-shadow-focus); }
|
|
12465
12515
|
.multi-combobox__placeholder { color: var(--q1-color-text-muted); }
|
|
@@ -12535,6 +12585,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
12535
12585
|
.command-palette__hint,
|
|
12536
12586
|
.command-palette__close,
|
|
12537
12587
|
.command-palette__kbd {
|
|
12588
|
+
font: inherit;
|
|
12538
12589
|
border-radius: var(--q1-radius-1);
|
|
12539
12590
|
background: color-mix(in srgb, var(--q1-color-text-primary) 8%, transparent);
|
|
12540
12591
|
color: var(--q1-color-text-secondary);
|
|
@@ -12558,6 +12609,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
12558
12609
|
}
|
|
12559
12610
|
|
|
12560
12611
|
.command-palette__backdrop {
|
|
12612
|
+
font: inherit;
|
|
12561
12613
|
position: absolute;
|
|
12562
12614
|
inset: 0;
|
|
12563
12615
|
border: 0;
|
|
@@ -13048,6 +13100,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
13048
13100
|
}
|
|
13049
13101
|
|
|
13050
13102
|
.copy-button {
|
|
13103
|
+
font: inherit;
|
|
13051
13104
|
display: grid;
|
|
13052
13105
|
place-items: center;
|
|
13053
13106
|
width: var(--q1-space-8);
|
|
@@ -13172,6 +13225,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
13172
13225
|
}
|
|
13173
13226
|
|
|
13174
13227
|
.clearable__clear {
|
|
13228
|
+
font: inherit;
|
|
13175
13229
|
display: grid;
|
|
13176
13230
|
place-items: center;
|
|
13177
13231
|
width: var(--q1-space-6);
|
|
@@ -13265,6 +13319,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
13265
13319
|
}
|
|
13266
13320
|
|
|
13267
13321
|
.codeblock__tab {
|
|
13322
|
+
font: inherit;
|
|
13268
13323
|
min-height: var(--q1-space-6);
|
|
13269
13324
|
padding: calc(var(--q1-space-1) / 2) var(--q1-space-3);
|
|
13270
13325
|
border: none;
|
|
@@ -13461,6 +13516,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
13461
13516
|
}
|
|
13462
13517
|
|
|
13463
13518
|
.description__hint {
|
|
13519
|
+
font: inherit;
|
|
13464
13520
|
display: inline-grid;
|
|
13465
13521
|
place-items: center;
|
|
13466
13522
|
width: var(--q1-space-6);
|
|
@@ -13614,6 +13670,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
13614
13670
|
触屏下 TouchTarget 再扩到 --q1-touch-target-min。 */
|
|
13615
13671
|
.info-tip__trigger,
|
|
13616
13672
|
.info-tip__close {
|
|
13673
|
+
font: inherit;
|
|
13617
13674
|
position: relative;
|
|
13618
13675
|
display: inline-grid;
|
|
13619
13676
|
place-items: center;
|
|
@@ -13934,6 +13991,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
13934
13991
|
}
|
|
13935
13992
|
|
|
13936
13993
|
.corner-remove-button {
|
|
13994
|
+
font: inherit;
|
|
13937
13995
|
position: absolute;
|
|
13938
13996
|
top: 0;
|
|
13939
13997
|
right: 0;
|
|
@@ -14856,7 +14914,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
14856
14914
|
.composer textarea::placeholder { color: var(--q1-color-text-muted); }
|
|
14857
14915
|
.composer__tools { display: flex; align-items: center; gap: var(--q1-space-3); padding: var(--q1-space-2); }
|
|
14858
14916
|
.composer__tools > .button { margin-left: auto; }
|
|
14859
|
-
.composer__icon { position: relative; --touch-target-border-width: 0px; display: grid; place-items: center; border: 0; background: transparent; color: var(--q1-color-text-secondary); width: var(--q1-space-7); height: var(--q1-space-7); border-radius: var(--q1-radius-2); }
|
|
14917
|
+
.composer__icon { font: inherit; position: relative; --touch-target-border-width: 0px; display: grid; place-items: center; border: 0; background: transparent; color: var(--q1-color-text-secondary); width: var(--q1-space-7); height: var(--q1-space-7); border-radius: var(--q1-radius-2); }
|
|
14860
14918
|
.composer__icon:hover { background: var(--q1-color-bg-hover); }
|
|
14861
14919
|
.composer__icon:focus-visible { outline: none; box-shadow: var(--q1-shadow-focus); }
|
|
14862
14920
|
.composer__attachments { display: flex; flex-wrap: wrap; gap: var(--q1-space-2); padding: var(--q1-space-2); }
|
|
@@ -14884,7 +14942,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
14884
14942
|
.attachment__retry { position: relative; --touch-target-border-width: 0px; border: 0; padding: 0; background: transparent; color: var(--q1-color-text-primary); font: inherit; font-weight: var(--q1-font-weight-medium); border-radius: var(--q1-radius-1); cursor: pointer; }
|
|
14885
14943
|
.attachment__retry:hover { text-decoration: underline; }
|
|
14886
14944
|
.attachment__retry:focus-visible { outline: none; box-shadow: var(--q1-shadow-focus); }
|
|
14887
|
-
.attachment__remove { position: relative; --touch-target-border-width: 0px; border: 0; background: transparent; color: var(--q1-color-text-muted); display: grid; place-items: center; width: var(--q1-space-6); height: var(--q1-space-6); border-radius: var(--q1-radius-1); flex-shrink: 0; }
|
|
14945
|
+
.attachment__remove { font: inherit; position: relative; --touch-target-border-width: 0px; border: 0; background: transparent; color: var(--q1-color-text-muted); display: grid; place-items: center; width: var(--q1-space-6); height: var(--q1-space-6); border-radius: var(--q1-radius-1); flex-shrink: 0; }
|
|
14888
14946
|
.attachment__remove:hover { background: var(--q1-color-bg-hover); }
|
|
14889
14947
|
.attachment__remove:focus-visible { outline: none; box-shadow: var(--q1-shadow-focus); }
|
|
14890
14948
|
@media (pointer: coarse), (any-pointer: coarse) { .attachment { gap: var(--q1-space-4); padding: var(--q1-space-3); } }
|
|
@@ -14976,6 +15034,7 @@ a.q1-navigation__item[aria-disabled='true'] {
|
|
|
14976
15034
|
}
|
|
14977
15035
|
|
|
14978
15036
|
.feedback__emotion {
|
|
15037
|
+
font: inherit;
|
|
14979
15038
|
display: grid;
|
|
14980
15039
|
place-items: center;
|
|
14981
15040
|
width: var(--q1-space-8);
|
package/dist-pkg/tokens.css
CHANGED
|
@@ -144,6 +144,7 @@
|
|
|
144
144
|
--q1-color-text-soft: #6e6e73;
|
|
145
145
|
--q1-color-text-disabled: #b7b7b7;
|
|
146
146
|
--q1-color-overlay-scrim: rgba(2, 6, 23, 0.44);
|
|
147
|
+
--q1-color-media-scrim: rgba(2, 6, 23, 0.56);
|
|
147
148
|
--q1-color-focus: var(--q1-color-shadow);
|
|
148
149
|
--q1-color-selection-bg: var(--q1-color-text-primary);
|
|
149
150
|
--q1-color-selection-fg: var(--q1-color-bg-canvas);
|
|
@@ -470,6 +471,7 @@
|
|
|
470
471
|
--q1-color-text-soft: #9a9a9c;
|
|
471
472
|
--q1-color-text-disabled: var(--q1-color-gray-500);
|
|
472
473
|
--q1-color-overlay-scrim: rgba(2, 6, 23, 0.44);
|
|
474
|
+
--q1-color-media-scrim: rgba(2, 6, 23, 0.56);
|
|
473
475
|
--q1-color-focus: var(--q1-color-action-on-primary);
|
|
474
476
|
--q1-color-selection-bg: var(--q1-color-text-primary);
|
|
475
477
|
--q1-color-selection-fg: var(--q1-color-bg-canvas);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@q1travel/design-system",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.13",
|
|
4
4
|
"description": "React components, design tokens, and interface contracts for q1travel products.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,20 +49,21 @@
|
|
|
49
49
|
],
|
|
50
50
|
"scripts": {
|
|
51
51
|
"dev": "vite --host 127.0.0.1",
|
|
52
|
+
"changelog:assemble": "node scripts/changelog-assemble.mjs",
|
|
52
53
|
"sync:contracts": "node scripts/sync-design-contracts.mjs",
|
|
53
54
|
"build": "npm run sync:contracts && tsc -b && vite build",
|
|
54
55
|
"preview": "vite preview --host 127.0.0.1",
|
|
55
56
|
"check:shell": "npm run sync:contracts && node scripts/check-shell.mjs && node scripts/check-token-package.mjs && npm run check:release-provenance",
|
|
56
57
|
"check:browser:strictmode": "node scripts/check-browser.mjs --strictmode-ref",
|
|
57
|
-
"check:browser": "node --test scripts/devtools-connection.test.mjs scripts/browser-exit-deadline.test.mjs scripts/chromium-teardown.test.mjs scripts/vite-server-lifecycle.test.mjs scripts/chromium-launch.test.mjs scripts/chromium-recovery.test.mjs scripts/chromium-ownership.test.mjs scripts/cdp-recovery.test.mjs && npm run check:browser:strictmode && node scripts/check-browser.mjs --note && node scripts/check-browser.mjs --combobox-panel && node scripts/check-browser.mjs && node scripts/check-clearable-input-browser.mjs && node scripts/check-calendar-browser.mjs && node scripts/check-banner-browser.mjs && node scripts/check-button-link-browser.mjs && node scripts/check-button-browser.mjs && node scripts/check-trailing-icon-padding-browser.mjs && node scripts/check-overlay-theme-browser.mjs && node scripts/check-browser-component-browser.mjs",
|
|
58
|
-
"check:package-api": "node scripts/check-package-api.mjs && node --test scripts/check-combobox-required.test.mjs scripts/check-multi-combobox-contract.test.mjs && node --test scripts/check-q1-design-lint.test.mjs scripts/check-q1-design-bin-entry.test.mjs && node --test scripts/check-json-view-contract.test.mjs && node --test scripts/check-verification-code-input.test.mjs && node --test scripts/check-bare-field-error.test.mjs scripts/check-label-hidden-contract.test.mjs scripts/check-required-indicator-contract.test.mjs scripts/check-spinner-inherit-contract.test.mjs && node --test scripts/check-controls-contract.test.mjs && node --test scripts/check-pagination-contract.test.mjs && node --test scripts/check-table-core.test.mjs scripts/check-table-interaction.test.mjs scripts/check-table-layout.test.mjs && node --test scripts/check-contrast-contract.test.mjs && node --test scripts/check-optical-alignment-contract.test.mjs && node --test scripts/check-overlay-coordination.test.mjs scripts/check-sheet-contract.test.mjs && node --test scripts/check-choicebox-contract.test.mjs && node --test scripts/check-radio-group-contract.test.mjs && node --test scripts/check-clearable-input-contract.test.mjs && node --test scripts/check-card-contract.test.mjs && node --test scripts/check-book-contract.test.mjs && node --test scripts/check-breadcrumbs-contract.test.mjs && node --test scripts/check-description-contract.test.mjs && node --test scripts/check-error-message-contract.test.mjs && node --test scripts/check-show-more-contract.test.mjs && node --test scripts/check-load-more-button-contract.test.mjs && node --test scripts/check-banner-contract.test.mjs && node --test scripts/check-project-banner-contract.test.mjs && node --test scripts/check-note-contract.test.mjs && node --test scripts/check-feedback-contract.test.mjs && node --test scripts/check-page-feedback-contract.test.mjs && node --test scripts/check-drawer-gesture.test.mjs && node --test scripts/check-checkbox-circle-contract.test.mjs && node --test scripts/check-chat-contract.test.mjs && node --test scripts/check-calendar-single-contract.test.mjs && node --test scripts/check-hover-card-contract.test.mjs && node --test scripts/check-bare-field-error.test.mjs && node --test scripts/check-controls-contract.test.mjs scripts/check-control-size-contract.test.mjs && node --test scripts/check-composer-dots-menu-contract.test.mjs && node --test scripts/check-filter-option-panel-contract.test.mjs && npm run check:release-diff",
|
|
58
|
+
"check:browser": "node --test scripts/cascader-browser-lifecycle.test.mjs scripts/devtools-connection.test.mjs scripts/browser-exit-deadline.test.mjs scripts/chromium-teardown.test.mjs scripts/vite-server-lifecycle.test.mjs scripts/chromium-launch.test.mjs scripts/chromium-recovery.test.mjs scripts/chromium-ownership.test.mjs scripts/cdp-recovery.test.mjs && npm run check:browser:strictmode && node scripts/check-browser.mjs --note && node scripts/check-browser.mjs --combobox-panel && node scripts/check-browser.mjs && node scripts/check-clearable-input-browser.mjs && node scripts/check-calendar-browser.mjs && node scripts/check-banner-browser.mjs && node scripts/check-button-link-browser.mjs && node scripts/check-button-browser.mjs && node scripts/check-trailing-icon-padding-browser.mjs && node scripts/check-overlay-theme-browser.mjs && node scripts/check-browser-component-browser.mjs",
|
|
59
|
+
"check:package-api": "node scripts/check-package-api.mjs && node --test scripts/check-public-type-global-augmentations.test.mjs && node --test scripts/check-combobox-required.test.mjs scripts/check-multi-combobox-contract.test.mjs && node --test scripts/check-q1-design-lint.test.mjs scripts/check-q1-design-component-enums.test.mjs scripts/check-q1-design-bin-entry.test.mjs && node --test scripts/check-json-view-contract.test.mjs && node --test scripts/check-verification-code-input.test.mjs && node --test scripts/check-bare-field-error.test.mjs scripts/check-label-hidden-contract.test.mjs scripts/check-required-indicator-contract.test.mjs scripts/check-spinner-inherit-contract.test.mjs && node --test scripts/check-controls-contract.test.mjs && node --test scripts/check-pagination-contract.test.mjs && node --test scripts/check-table-core.test.mjs scripts/check-table-interaction.test.mjs scripts/check-table-layout.test.mjs && node --test scripts/check-contrast-contract.test.mjs && node --test scripts/check-optical-alignment-contract.test.mjs && node --test scripts/check-overlay-coordination.test.mjs scripts/check-sheet-contract.test.mjs && node --test scripts/check-choicebox-contract.test.mjs && node --test scripts/check-radio-group-contract.test.mjs && node --test scripts/check-clearable-input-contract.test.mjs && node --test scripts/check-card-contract.test.mjs && node --test scripts/check-book-contract.test.mjs && node --test scripts/check-breadcrumbs-contract.test.mjs && node --test scripts/check-description-contract.test.mjs && node --test scripts/check-error-message-contract.test.mjs && node --test scripts/check-show-more-contract.test.mjs && node --test scripts/check-load-more-button-contract.test.mjs && node --test scripts/check-banner-contract.test.mjs && node --test scripts/check-project-banner-contract.test.mjs && node --test scripts/check-note-contract.test.mjs && node --test scripts/check-feedback-contract.test.mjs && node --test scripts/check-page-feedback-contract.test.mjs && node --test scripts/check-drawer-gesture.test.mjs && node --test scripts/check-checkbox-circle-contract.test.mjs && node --test scripts/check-chat-contract.test.mjs && node --test scripts/check-calendar-single-contract.test.mjs && node --test scripts/check-hover-card-contract.test.mjs && node --test scripts/check-bare-field-error.test.mjs && node --test scripts/check-controls-contract.test.mjs scripts/check-control-size-contract.test.mjs && node --test scripts/check-composer-dots-menu-contract.test.mjs && node --test scripts/check-filter-option-panel-contract.test.mjs && npm run check:release-diff",
|
|
59
60
|
"check:release-diff": "node --test scripts/check-release-artifact-diff.test.mjs && node scripts/check-release-artifact-diff.mjs",
|
|
60
61
|
"check:release-provenance": "node --test scripts/check-release-provenance.test.mjs && node scripts/check-release-provenance.mjs",
|
|
61
62
|
"check:release-sync": "node --test scripts/release-sync.test.mjs scripts/release-preview-version.test.mjs",
|
|
62
63
|
"release:verify": "node scripts/release-sync.mjs --verify-only",
|
|
63
64
|
"release:sync": "node scripts/release-sync.mjs",
|
|
64
65
|
"check": "npm run check:release-sync && npm run build && npm run check:shell && npm run check:browser && npm run build:pkg",
|
|
65
|
-
"build:lib": "vite build --config vite.lib.config.ts",
|
|
66
|
+
"build:lib": "vite build --config vite.lib.config.ts && node scripts/build-component-enums.mjs",
|
|
66
67
|
"build:style": "node scripts/build-style.mjs",
|
|
67
68
|
"build:pkg": "npm run build:lib && npm run build:style && npm run check:package-api",
|
|
68
69
|
"prepack": "npm run build:pkg"
|
|
@@ -75,12 +76,13 @@
|
|
|
75
76
|
"react-dom": "^19.0.0"
|
|
76
77
|
},
|
|
77
78
|
"devDependencies": {
|
|
79
|
+
"@microsoft/api-extractor": "^7.60.1",
|
|
78
80
|
"@types/react": "^19.2.17",
|
|
79
81
|
"@types/react-dom": "^19.2.3",
|
|
80
82
|
"@vitejs/plugin-react": "^5.0.0",
|
|
81
83
|
"axe-core": "4.14.0",
|
|
82
84
|
"typescript": "^5.8.0",
|
|
83
85
|
"vite": "^7.3.6",
|
|
84
|
-
"vite-plugin-dts": "^
|
|
86
|
+
"vite-plugin-dts": "^5.1.2"
|
|
85
87
|
}
|
|
86
88
|
}
|
package/tooling/README.md
CHANGED
|
@@ -6,4 +6,10 @@
|
|
|
6
6
|
- `evals/fixtures.json` —— eval fixture 索引。
|
|
7
7
|
- `evals/<fixture>/{before,after}/` —— 每条规则的前后态样例,用来测 skill / linter 是否产出预期改动。
|
|
8
8
|
|
|
9
|
-
**现状**:`q1-design lint` 已实现 `Q1-DS-001`(`--ds-*`)/`Q1-DS-401`(`transition: all`)/`Q1-DS-404`(裸 duration/easing)/`Q1-DS-501`(裸颜色字面量)
|
|
9
|
+
**现状**:`q1-design lint` 已实现 `Q1-DS-001`(`--ds-*`)/`Q1-DS-401`(`transition: all`)/`Q1-DS-404`(裸 duration/easing)/`Q1-DS-501`(裸颜色字面量)与 `Q1-DS-002`(组件 `variant` / `size` 非法字符串字面量)五条纯机械规则;`q1-design eval` 已实现,对每个 fixture 校验 before 命中且 after 零命中。`q1-design overrides` 统计消费方对组件的 className 覆写并按「重画外观/仅布局」分类——它不是 pass/fail 规则,因为覆写布局是正当用法,拦它的规则最后会被整体关掉。其余 `kind=deterministic` 规则(含判断成分)与全部 `kind=judgment` 规则待后续批次。见 `../.agents/skills/product-design/references/coverage-gaps.md`。
|
|
10
|
+
|
|
11
|
+
`Q1-DS-002` 为 error:仅检查直接从 `@q1travel/design-system` 导入的组件(含命名别名、命名空间),不追踪消费方再导出或运行时赋值;局部同名组件不受影响。允许值来自随包 `dist-pkg/design-system.d.ts` 中组件 props 的有限字符串联合,覆盖 `Button` 及其他声明了此类 `variant` / `size` 的导出组件。`variant="quiet"`、`variant={'quiet'}` 会检查,`variant={value}` 与条件表达式交给消费方类型检查。诊断包含文件、行号、组件、属性、非法值和允许值;命中退出 1,支持现有文件、区间和下一行 pragma。检测到相关字面量却缺少类型声明时退出 1 并提示修复,不能静默跳过。
|
|
12
|
+
|
|
13
|
+
CLI 通过运行时依赖 TypeScript 解析 JSX 与词法绑定,避免把注释、字符串或被遮蔽的同名组件误当成包组件;不依赖消费方开发依赖或本仓源码。
|
|
14
|
+
|
|
15
|
+
在本仓直跑组件规则或对应 CLI 测试前,运行 `npm run build:lib` 生成类型声明;仅扫描 CSS 不要求该产物。
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"note": "q1travel 产品设计确定性规则清单。每条带稳定 ID + canonical 出处。kind=deterministic 的可由 linter 静态强制;kind=judgment 的留给 product-design skill / Review。linter CLI 与 eval runner 已实现:`q1-design lint`(Q1-DS-001/401/501)与 `q1-design eval`(bin/q1-design.mjs);覆盖缺口见 ../../../.agents/skills/product-design/references/coverage-gaps.md。",
|
|
2
|
+
"note": "q1travel 产品设计确定性规则清单。每条带稳定 ID + canonical 出处。kind=deterministic 的可由 linter 静态强制;kind=judgment 的留给 product-design skill / Review。linter CLI 与 eval runner 已实现:`q1-design lint`(Q1-DS-001/002/401/404/501)与 `q1-design eval`(bin/q1-design.mjs);覆盖缺口见 ../../../.agents/skills/product-design/references/coverage-gaps.md。",
|
|
3
3
|
"version": 0,
|
|
4
4
|
"idScheme": {
|
|
5
5
|
"0xx": "token 与事实源",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"rules": [
|
|
13
13
|
{ "id": "Q1-DS-001", "title": "新代码用 --q1-*,不用 --ds-*", "source": "contracts/token-naming.md", "severity": "error", "kind": "deterministic", "detect": "新增/改动代码里出现 --ds-* 声明或作为新决策源名", "fix": "改用 --q1-* canonical token" },
|
|
14
|
+
{ "id": "Q1-DS-002", "title": "组件枚举属性仅使用公开值", "source": "dist-pkg/design-system.d.ts", "severity": "error", "kind": "deterministic", "detect": "直接从包导入的组件,其 variant / size 字符串字面量不在 props 有限联合中", "fix": "使用诊断列出的公开允许值,动态表达式交给类型检查" },
|
|
14
15
|
{ "id": "Q1-DS-101", "title": "导航用原生 link、动作用原生 button", "source": "contracts/interface-guidelines.md#interactions", "severity": "error", "kind": "judgment", "detect": "用 div/span + onClick 承载导航或动作", "fix": "导航用 <a href>,动作用 <button>" },
|
|
15
16
|
{ "id": "Q1-DS-102", "title": "命中区 ≥24px(触摸 44px)", "source": "contracts/interface-guidelines.md#interactions", "severity": "warn", "kind": "judgment", "detect": "可点击元素视觉/命中区小于 24px 且未扩大命中区", "fix": "min-width/height + 负 margin 扩大命中区,不撑高容器" },
|
|
16
17
|
{ "id": "Q1-DS-301", "title": "icon-only 控件必须有可访问名", "source": "contracts/interface-guidelines.md#content-and-accessibility", "severity": "error", "kind": "judgment", "detect": "只含图标的 button/link 无 aria-label / 可访问名", "fix": "补 aria-label 或视觉隐藏文本" },
|