@q1travel/design-system 0.7.2 → 0.7.3

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);
@@ -5783,8 +5839,8 @@ a.q1-card:focus-visible {
5783
5839
  position: fixed;
5784
5840
  right: var(--q1-space-6);
5785
5841
  bottom: var(--q1-space-6);
5786
- /* 高于 Modal/Drawer/Command Palette(均为 80):全局通知即使在阻断式浮层打开时也应保持可见可点。 */
5787
- z-index: 90;
5842
+ /* 通知保持可见;blocking overlay 打开时由 ToastProvider 禁止 action/close 交互。 */
5843
+ z-index: var(--q1-z-toast);
5788
5844
  width: min(420px, calc(100vw - 2 * var(--q1-space-6)));
5789
5845
  height: var(--toast-stack-h, 0px);
5790
5846
  }
@@ -6947,7 +7003,6 @@ a.q1-card:focus-visible {
6947
7003
  .modal {
6948
7004
  position: fixed;
6949
7005
  inset: 0;
6950
- z-index: 80;
6951
7006
  display: flex;
6952
7007
  align-items: center;
6953
7008
  justify-content: center;
@@ -7125,7 +7180,6 @@ a.q1-card:focus-visible {
7125
7180
  .drawer {
7126
7181
  position: fixed;
7127
7182
  inset: 0;
7128
- z-index: 80;
7129
7183
  display: flex;
7130
7184
  flex-direction: column;
7131
7185
  justify-content: flex-end;
@@ -7210,7 +7264,6 @@ a.q1-card:focus-visible {
7210
7264
  .sheet__backdrop {
7211
7265
  position: fixed;
7212
7266
  inset: 0;
7213
- z-index: 69;
7214
7267
  background: color-mix(in srgb, var(--q1-color-shadow) 80%, transparent);
7215
7268
  }
7216
7269
 
@@ -7229,7 +7282,6 @@ a.q1-card:focus-visible {
7229
7282
  /* 悬浮圆角面板(对标外部参考形态):四边不贴屏,inset 12 + 圆角 + 全边框。 */
7230
7283
  .sheet__panel {
7231
7284
  position: fixed;
7232
- z-index: 70;
7233
7285
  display: flex;
7234
7286
  flex-direction: column;
7235
7287
  border: 1px solid var(--q1-color-border-overlay);
@@ -8037,6 +8089,10 @@ a.q1-navigation__item[aria-disabled='true'] {
8037
8089
  opacity: 0.64;
8038
8090
  }
8039
8091
 
8092
+ .q1-context-switcher__item[aria-disabled='true'] .q1-context-switcher__description {
8093
+ color: var(--q1-color-text-primary);
8094
+ }
8095
+
8040
8096
  .q1-context-switcher__item[aria-checked='true'] .q1-context-switcher__item-label,
8041
8097
  .q1-context-switcher__item[aria-selected='true'] .q1-context-switcher__item-label {
8042
8098
  color: var(--q1-color-text-primary);
@@ -8057,7 +8113,7 @@ a.q1-navigation__item[aria-disabled='true'] {
8057
8113
  border-radius: var(--q1-radius-2);
8058
8114
  background: color-mix(in srgb, var(--q1-color-status-danger) 10%, transparent);
8059
8115
  padding: var(--q1-space-2) var(--q1-space-3);
8060
- color: var(--q1-color-status-danger);
8116
+ color: color-mix(in srgb, var(--q1-color-status-danger) 70%, var(--q1-color-text-primary));
8061
8117
  font-size: var(--q1-font-size-label-13);
8062
8118
  line-height: var(--q1-line-height-label-13);
8063
8119
  }
@@ -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.7.3",
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",
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",