@q1travel/design-system 0.7.2 → 0.8.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.
@@ -207,6 +207,8 @@
207
207
  --q1-shadow-popover: 0 8px 28px color-mix(in srgb, var(--q1-color-shadow) 16%, transparent);
208
208
  --q1-shadow-modal: 0 16px 48px color-mix(in srgb, var(--q1-color-shadow) 32%, transparent);
209
209
  --q1-z-popover: 1200;
210
+ --q1-z-overlay-root: 1300;
211
+ --q1-z-toast: 1400;
210
212
  }
211
213
 
212
214
  :root[data-theme='dark'] {
@@ -417,12 +419,47 @@
417
419
  opacity: 0.48;
418
420
  }
419
421
 
420
- .button--loading {
422
+ .button--loading,
423
+ .button--busy {
421
424
  cursor: progress;
422
425
  }
423
426
 
427
+ .button__spinner-slot {
428
+ display: inline-flex;
429
+ flex: none;
430
+ align-items: center;
431
+ }
432
+
424
433
  .button__spinner {
425
- animation: button-spin 0.7s linear infinite;
434
+ animation: none;
435
+ }
436
+
437
+ .button__label-slot {
438
+ display: inline-grid;
439
+ min-width: 0;
440
+ align-items: center;
441
+ }
442
+
443
+ .button__label {
444
+ grid-area: 1 / 1;
445
+ }
446
+
447
+ .button__label--original-hidden {
448
+ opacity: 0;
449
+ }
450
+
451
+ .button__label--busy-hidden {
452
+ visibility: hidden;
453
+ }
454
+
455
+ .button__label--busy-visible {
456
+ visibility: visible;
457
+ }
458
+
459
+ @media (prefers-reduced-motion: no-preference) {
460
+ .button__spinner {
461
+ animation: button-spin 0.7s linear infinite;
462
+ }
426
463
  }
427
464
 
428
465
  .button__affix {
@@ -1258,6 +1295,12 @@
1258
1295
 
1259
1296
  /* 组件自身样式。发布进 npm 包,foundations.css 之后加载。 */
1260
1297
 
1298
+ [data-q1-portal='overlay'] {
1299
+ position: relative;
1300
+ z-index: var(--q1-z-overlay-root);
1301
+ isolation: isolate;
1302
+ }
1303
+
1261
1304
  @keyframes button-spin {
1262
1305
  to {
1263
1306
  transform: rotate(360deg);
@@ -2386,7 +2429,7 @@ a.breadcrumb__link:hover {
2386
2429
  padding: var(--q1-space-6);
2387
2430
  }
2388
2431
 
2389
- /* 分段控件 Switch(对标外部参考 Switch):一组互斥选项,选中段抬起;底层 q1-sr-only 单选组,方向键原生可用。 */
2432
+ /* 分段控件 Switch:一组互斥选项,采用 radiogroup/radio 复合语义,选中段抬起。 */
2390
2433
  .switch-control {
2391
2434
  display: inline-flex;
2392
2435
  align-items: center;
@@ -2411,6 +2454,9 @@ a.breadcrumb__link:hover {
2411
2454
  padding: 0 var(--q1-space-3);
2412
2455
  border-radius: var(--q1-radius-1);
2413
2456
  color: var(--q1-color-text-secondary);
2457
+ border: 0;
2458
+ background: transparent;
2459
+ font: inherit;
2414
2460
  font-size: var(--q1-font-size-label-14);
2415
2461
  font-weight: var(--q1-font-weight-medium);
2416
2462
  line-height: var(--q1-line-height-label-14);
@@ -2422,22 +2468,22 @@ a.breadcrumb__link:hover {
2422
2468
  flex: 1 1 0;
2423
2469
  }
2424
2470
 
2425
- .switch-control__option:hover {
2471
+ .switch-control__option:hover:not(:disabled) {
2426
2472
  color: var(--q1-color-text-primary);
2427
2473
  }
2428
2474
 
2429
- .switch-control__option:has(input:checked) {
2475
+ .switch-control__option[aria-checked='true'] {
2430
2476
  background: var(--q1-color-bg-subtle);
2431
2477
  color: var(--q1-color-text-primary);
2432
2478
  box-shadow: inset 0 0 0 1px var(--q1-color-gray-400);
2433
2479
  }
2434
2480
 
2435
- .switch-control__option:has(input:focus-visible) {
2481
+ .switch-control__option:focus-visible {
2436
2482
  outline: none;
2437
2483
  box-shadow: var(--q1-shadow-focus);
2438
2484
  }
2439
2485
 
2440
- .switch-control__option:has(input:disabled) {
2486
+ .switch-control__option:disabled {
2441
2487
  cursor: not-allowed;
2442
2488
  opacity: 0.5;
2443
2489
  }
@@ -2457,6 +2503,16 @@ a.breadcrumb__link:hover {
2457
2503
  align-items: center;
2458
2504
  }
2459
2505
 
2506
+ .switch-control__meta {
2507
+ color: var(--q1-color-text-muted);
2508
+ font-size: var(--q1-font-size-label-13);
2509
+ font-weight: var(--q1-font-weight-regular);
2510
+ }
2511
+
2512
+ .switch-control__option[aria-checked='true'] .switch-control__meta {
2513
+ color: var(--q1-color-text-secondary);
2514
+ }
2515
+
2460
2516
  .tabs-root {
2461
2517
  display: grid;
2462
2518
  gap: var(--q1-space-4);
@@ -5206,52 +5262,124 @@ a.q1-card:focus-visible {
5206
5262
  .choicebox--checkbox:has(.choicebox__input:disabled:checked) .choicebox__indicator {
5207
5263
  background: var(--q1-color-gray-500);
5208
5264
  }
5209
- /* 实测外部参考:裸轨(无外框/无背景/无 padding),图标抽离文字块、绝对定位在 28px 凹槽外;
5210
- 悬停只把文字/图标从 text-secondary 加深到 text-primary,无背景浸染、无品牌色——
5211
- 这是页面间的纯导航链(chrome),不是行动号召,indigo 只守「动作」。 */
5265
+ /* 数据集分页:数字页码、已知总数与未知尾页。数据请求和 URL 状态由消费方控制。 */
5212
5266
  .pagination {
5267
+ display: flex;
5268
+ flex-wrap: wrap;
5269
+ align-items: center;
5270
+ justify-content: space-between;
5271
+ gap: var(--q1-space-3);
5272
+ width: 100%;
5273
+ }
5274
+ .pagination__summary {
5275
+ min-width: 0;
5276
+ font-size: 13px;
5277
+ line-height: 20px;
5278
+ color: var(--q1-color-text-secondary);
5279
+ }
5280
+ .pagination__controls {
5281
+ display: inline-flex;
5282
+ align-items: center;
5283
+ flex-wrap: wrap;
5284
+ gap: var(--q1-space-1);
5285
+ }
5286
+ .pagination__page-size {
5287
+ display: inline-flex;
5288
+ align-items: center;
5289
+ margin-right: var(--q1-space-2);
5290
+ }
5291
+ .pagination__button {
5292
+ display: inline-flex;
5293
+ align-items: center;
5294
+ justify-content: center;
5295
+ min-width: 32px;
5296
+ min-height: 32px;
5297
+ padding: 4px 8px;
5298
+ border: 1px solid transparent;
5299
+ border-radius: var(--q1-radius-2);
5300
+ background: transparent;
5301
+ color: var(--q1-color-text-secondary);
5302
+ font: inherit;
5303
+ font-size: 14px;
5304
+ line-height: 20px;
5305
+ font-variant-numeric: tabular-nums;
5306
+ cursor: pointer;
5307
+ }
5308
+ .pagination__button:hover:not(:disabled) {
5309
+ background: var(--q1-color-bg-subtle);
5310
+ color: var(--q1-color-text-primary);
5311
+ }
5312
+ .pagination__button:focus-visible {
5313
+ outline: none;
5314
+ box-shadow: var(--q1-shadow-focus);
5315
+ }
5316
+ .pagination__button--nav {
5317
+ border-color: var(--q1-color-border);
5318
+ }
5319
+ .pagination__button--current {
5320
+ color: var(--q1-color-text-primary);
5321
+ background: var(--q1-color-bg-subtle);
5322
+ font-weight: var(--q1-font-weight-medium);
5323
+ }
5324
+ .pagination__button:disabled {
5325
+ border-color: var(--q1-color-border);
5326
+ background: var(--q1-color-bg-subtle);
5327
+ color: var(--q1-color-text-muted);
5328
+ cursor: not-allowed;
5329
+ }
5330
+ .pagination__ellipsis {
5331
+ min-width: 24px;
5332
+ color: var(--q1-color-text-muted);
5333
+ text-align: center;
5334
+ }
5335
+ @media (pointer: coarse) {
5336
+ .pagination__button {
5337
+ min-width: 44px;
5338
+ min-height: 44px;
5339
+ }
5340
+ }
5341
+
5342
+ /* 文档顺序导航:裸轨,无外框/背景;图标锚在标题文字块内。 */
5343
+ .docs-pagination {
5213
5344
  display: flex;
5214
5345
  flex-wrap: wrap;
5215
5346
  align-items: flex-start;
5216
5347
  justify-content: space-between;
5217
5348
  width: 100%;
5218
5349
  }
5219
- .pagination__link {
5350
+ .docs-pagination__link {
5220
5351
  display: block;
5221
5352
  padding: 4px var(--q1-space-2);
5222
5353
  border-radius: var(--q1-radius-2);
5223
5354
  text-decoration: none;
5224
5355
  }
5225
- .pagination__link--prev {
5356
+ .docs-pagination__link--prev {
5226
5357
  padding-left: 28px;
5227
5358
  }
5228
- .pagination__link--next {
5359
+ .docs-pagination__link--next {
5229
5360
  padding-right: 28px;
5230
5361
  margin-left: auto;
5231
5362
  text-align: right;
5232
5363
  }
5233
- .pagination__link:focus-visible {
5364
+ .docs-pagination__link:focus-visible {
5234
5365
  outline: none;
5235
5366
  box-shadow: var(--q1-shadow-focus);
5236
5367
  }
5237
- .pagination__label {
5368
+ .docs-pagination__label {
5238
5369
  display: block;
5239
5370
  margin-bottom: 2px;
5240
5371
  font-size: 13px;
5241
5372
  color: var(--q1-color-text-secondary);
5242
- transition: color 0.2s ease-in-out;
5243
5373
  }
5244
- .pagination__link:hover .pagination__label {
5374
+ .docs-pagination__link:hover .docs-pagination__label {
5245
5375
  color: var(--q1-color-text-primary);
5246
5376
  }
5247
- /* 定位上下文钉在标题文字块(实测外部参考:图标是标题块的子节点,随文字宽度走,
5248
- 而不是钉在整条链接上)——否则图标会漂出链接可点/可聚焦的框外。 */
5249
- .pagination__title-frame {
5377
+ .docs-pagination__title-frame {
5250
5378
  position: relative;
5251
5379
  display: inline-block;
5252
5380
  max-width: 20em;
5253
5381
  }
5254
- .pagination__title {
5382
+ .docs-pagination__title {
5255
5383
  display: block;
5256
5384
  overflow: hidden;
5257
5385
  white-space: nowrap;
@@ -5261,28 +5389,27 @@ a.q1-card:focus-visible {
5261
5389
  font-weight: var(--q1-font-weight-medium);
5262
5390
  color: var(--q1-color-text-primary);
5263
5391
  }
5264
- .pagination__chevron-slot {
5392
+ .docs-pagination__chevron-slot {
5265
5393
  position: absolute;
5266
5394
  top: 2px;
5267
5395
  display: block;
5268
5396
  color: var(--q1-color-text-secondary);
5269
- transition: color 0.2s ease-in-out;
5270
5397
  }
5271
- .pagination__link--prev .pagination__chevron-slot {
5398
+ .docs-pagination__link--prev .docs-pagination__chevron-slot {
5272
5399
  left: -26px;
5273
5400
  }
5274
- .pagination__link--next .pagination__chevron-slot {
5401
+ .docs-pagination__link--next .docs-pagination__chevron-slot {
5275
5402
  right: -26px;
5276
5403
  }
5277
- .pagination__link:hover .pagination__chevron-slot {
5404
+ .docs-pagination__link:hover .docs-pagination__chevron-slot {
5278
5405
  color: var(--q1-color-text-primary);
5279
5406
  }
5280
- .pagination__chevron {
5407
+ .docs-pagination__chevron {
5281
5408
  display: block;
5282
5409
  width: 20px;
5283
5410
  height: 20px;
5284
5411
  }
5285
- .pagination__slot {
5412
+ .docs-pagination__slot {
5286
5413
  display: block;
5287
5414
  }
5288
5415
  .feedback {
@@ -5783,8 +5910,8 @@ a.q1-card:focus-visible {
5783
5910
  position: fixed;
5784
5911
  right: var(--q1-space-6);
5785
5912
  bottom: var(--q1-space-6);
5786
- /* 高于 Modal/Drawer/Command Palette(均为 80):全局通知即使在阻断式浮层打开时也应保持可见可点。 */
5787
- z-index: 90;
5913
+ /* 通知保持可见;blocking overlay 打开时由 ToastProvider 禁止 action/close 交互。 */
5914
+ z-index: var(--q1-z-toast);
5788
5915
  width: min(420px, calc(100vw - 2 * var(--q1-space-6)));
5789
5916
  height: var(--toast-stack-h, 0px);
5790
5917
  }
@@ -6947,7 +7074,6 @@ a.q1-card:focus-visible {
6947
7074
  .modal {
6948
7075
  position: fixed;
6949
7076
  inset: 0;
6950
- z-index: 80;
6951
7077
  display: flex;
6952
7078
  align-items: center;
6953
7079
  justify-content: center;
@@ -7125,7 +7251,6 @@ a.q1-card:focus-visible {
7125
7251
  .drawer {
7126
7252
  position: fixed;
7127
7253
  inset: 0;
7128
- z-index: 80;
7129
7254
  display: flex;
7130
7255
  flex-direction: column;
7131
7256
  justify-content: flex-end;
@@ -7210,7 +7335,6 @@ a.q1-card:focus-visible {
7210
7335
  .sheet__backdrop {
7211
7336
  position: fixed;
7212
7337
  inset: 0;
7213
- z-index: 69;
7214
7338
  background: color-mix(in srgb, var(--q1-color-shadow) 80%, transparent);
7215
7339
  }
7216
7340
 
@@ -7229,7 +7353,6 @@ a.q1-card:focus-visible {
7229
7353
  /* 悬浮圆角面板(对标外部参考形态):四边不贴屏,inset 12 + 圆角 + 全边框。 */
7230
7354
  .sheet__panel {
7231
7355
  position: fixed;
7232
- z-index: 70;
7233
7356
  display: flex;
7234
7357
  flex-direction: column;
7235
7358
  border: 1px solid var(--q1-color-border-overlay);
@@ -8037,6 +8160,10 @@ a.q1-navigation__item[aria-disabled='true'] {
8037
8160
  opacity: 0.64;
8038
8161
  }
8039
8162
 
8163
+ .q1-context-switcher__item[aria-disabled='true'] .q1-context-switcher__description {
8164
+ color: var(--q1-color-text-primary);
8165
+ }
8166
+
8040
8167
  .q1-context-switcher__item[aria-checked='true'] .q1-context-switcher__item-label,
8041
8168
  .q1-context-switcher__item[aria-selected='true'] .q1-context-switcher__item-label {
8042
8169
  color: var(--q1-color-text-primary);
@@ -8057,7 +8184,7 @@ a.q1-navigation__item[aria-disabled='true'] {
8057
8184
  border-radius: var(--q1-radius-2);
8058
8185
  background: color-mix(in srgb, var(--q1-color-status-danger) 10%, transparent);
8059
8186
  padding: var(--q1-space-2) var(--q1-space-3);
8060
- color: var(--q1-color-status-danger);
8187
+ color: color-mix(in srgb, var(--q1-color-status-danger) 70%, var(--q1-color-text-primary));
8061
8188
  font-size: var(--q1-font-size-label-13);
8062
8189
  line-height: var(--q1-line-height-label-13);
8063
8190
  }
@@ -201,6 +201,8 @@
201
201
  --q1-shadow-popover: 0 8px 28px color-mix(in srgb, var(--q1-color-shadow) 16%, transparent);
202
202
  --q1-shadow-modal: 0 16px 48px color-mix(in srgb, var(--q1-color-shadow) 32%, transparent);
203
203
  --q1-z-popover: 1200;
204
+ --q1-z-overlay-root: 1300;
205
+ --q1-z-toast: 1400;
204
206
  }
205
207
 
206
208
  :root[data-theme='dark'] {
@@ -406,4 +408,6 @@
406
408
  --q1-shadow-popover: 0 8px 28px color-mix(in srgb, var(--q1-color-shadow) 16%, transparent);
407
409
  --q1-shadow-modal: 0 16px 48px color-mix(in srgb, var(--q1-color-shadow) 32%, transparent);
408
410
  --q1-z-popover: 1200;
411
+ --q1-z-overlay-root: 1300;
412
+ --q1-z-toast: 1400;
409
413
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q1travel/design-system",
3
- "version": "0.7.2",
3
+ "version": "0.8.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist-pkg/design-system.js",
@@ -37,7 +37,7 @@
37
37
  "check:shell": "npm run sync:contracts && node scripts/check-shell.mjs && node scripts/check-token-package.mjs && npm run check:release-provenance",
38
38
  "check:browser:strictmode": "node scripts/check-browser.mjs --strictmode-ref",
39
39
  "check:browser": "npm run check:browser:strictmode && node scripts/check-browser.mjs",
40
- "check:package-api": "node scripts/check-package-api.mjs",
40
+ "check:package-api": "node scripts/check-package-api.mjs && node --test scripts/check-controls-contract.test.mjs && node --test scripts/check-pagination-contract.test.mjs",
41
41
  "check:release-provenance": "node --test scripts/check-release-provenance.test.mjs && node scripts/check-release-provenance.mjs",
42
42
  "check": "npm run build && npm run check:shell && npm run check:browser",
43
43
  "build:lib": "vite build --config vite.lib.config.ts",