@q1travel/design-system 0.30.2 → 0.30.4

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.
@@ -3966,6 +3966,73 @@ a[href]:has(> .book):focus-visible {
3966
3966
  }
3967
3967
  }
3968
3968
 
3969
+ /* 统计卡由内容撑开高度,尺寸档位仅影响默认分段。 */
3970
+ .switch-control--cards {
3971
+ display: grid;
3972
+ /* 10rem 是统计卡可读的最小宽度。 */
3973
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
3974
+ align-items: stretch;
3975
+ gap: var(--q1-space-2);
3976
+ width: 100%;
3977
+ height: auto;
3978
+ padding: 0;
3979
+ border: 0;
3980
+ background: transparent;
3981
+ }
3982
+
3983
+ .switch-control--cards .switch-control__option-wrapper > .q1-tooltip,
3984
+ .switch-control--cards .switch-control__option,
3985
+ .switch-control--cards .switch-control__visual {
3986
+ width: 100%;
3987
+ }
3988
+
3989
+ .switch-control--cards .switch-control__option {
3990
+ border: calc(var(--q1-space-1) / 4) solid var(--q1-color-border);
3991
+ border-radius: var(--q1-radius-3);
3992
+ background: var(--q1-color-bg-panel);
3993
+ white-space: normal;
3994
+ }
3995
+
3996
+ .switch-control--cards .switch-control__visual {
3997
+ flex-direction: column;
3998
+ align-items: flex-start;
3999
+ justify-content: flex-start;
4000
+ min-height: 0;
4001
+ gap: 0;
4002
+ padding: var(--q1-space-2);
4003
+ border-radius: inherit;
4004
+ text-align: start;
4005
+ }
4006
+
4007
+ .switch-control--cards .switch-control__card-label {
4008
+ color: var(--q1-color-text-secondary);
4009
+ font-size: var(--q1-font-size-label-12);
4010
+ line-height: var(--q1-line-height-label-12);
4011
+ font-weight: var(--q1-font-weight-regular);
4012
+ }
4013
+
4014
+ .switch-control--cards .switch-control__option .switch-control__card-count {
4015
+ color: var(--q1-color-text-primary);
4016
+ font-size: var(--q1-font-size-label-14);
4017
+ line-height: var(--q1-line-height-label-14);
4018
+ font-weight: var(--q1-font-weight-regular);
4019
+ font-variant-numeric: tabular-nums;
4020
+ }
4021
+
4022
+ .switch-control--cards .switch-control__option:disabled {
4023
+ opacity: 1;
4024
+ }
4025
+
4026
+ .switch-control--cards .switch-control__option:disabled :is(.switch-control__card-label, .switch-control__card-count) {
4027
+ color: var(--q1-color-text-muted);
4028
+ }
4029
+
4030
+ @media (hover: hover) and (pointer: fine) {
4031
+ .switch-control--cards .switch-control__option[aria-checked='false']:hover:not(:disabled) {
4032
+ border-color: var(--q1-color-border-strong);
4033
+ }
4034
+ }
4035
+
3969
4036
  .tabs-root {
3970
4037
  display: grid;
3971
4038
  gap: var(--q1-space-4);
@@ -5398,6 +5465,33 @@ a[href]:has(> .book):focus-visible {
5398
5465
  margin-top: var(--q1-space-3);
5399
5466
  }
5400
5467
 
5468
+ .empty-state--inline {
5469
+ flex-direction: row;
5470
+ align-items: center;
5471
+ gap: var(--q1-space-3);
5472
+ max-width: none;
5473
+ padding-block: var(--q1-space-3);
5474
+ padding-inline: var(--q1-table-edge-padding-inline);
5475
+ text-align: start;
5476
+ }
5477
+
5478
+ .empty-state--inline .empty-state__icon {
5479
+ flex-shrink: 0;
5480
+ width: var(--q1-space-6);
5481
+ height: var(--q1-space-6);
5482
+ margin-bottom: 0;
5483
+ border-radius: 0;
5484
+ background: none;
5485
+ color: var(--q1-color-text-muted);
5486
+ }
5487
+
5488
+ .empty-state--inline .empty-state__title {
5489
+ font-size: var(--q1-font-size-copy-14);
5490
+ line-height: var(--q1-line-height-copy-14);
5491
+ font-weight: var(--q1-font-weight-regular);
5492
+ color: var(--q1-color-text-secondary);
5493
+ }
5494
+
5401
5495
  /* 外层只负责宽度约束与视觉样式;实际的 head/tail flex 布局交给 __visual——
5402
5496
  q1-sr-only 完整文本节点与 __visual 是并列的两个子节点,q1-sr-only 绝对定位不占布局空间。 */
5403
5497
  .middle-truncate {
@@ -12264,6 +12358,7 @@ a.q1-navigation__item[aria-disabled='true'] {
12264
12358
  .multi-select__trigger[aria-invalid='true'] { border-color: var(--q1-color-status-danger); box-shadow: var(--q1-shadow-focus-input-danger); }
12265
12359
  @media (hover: none), (pointer: coarse), (any-pointer: coarse) {
12266
12360
  .multi-combobox__control, .multi-combobox__option, .multi-combobox__remove { min-height: var(--q1-touch-target-min); }
12361
+ .multi-combobox__trigger { inset: calc(var(--q1-space-1) / -4); width: auto; }
12267
12362
  .multi-combobox__remove { min-width: var(--q1-touch-target-min); }
12268
12363
  .multi-combobox__search { font-size: var(--q1-font-size-copy-16); }
12269
12364
  }
@@ -13794,6 +13889,14 @@ a.q1-navigation__item[aria-disabled='true'] {
13794
13889
  animation: check-circle-fill-draw var(--q1-duration-press) var(--q1-ease-out) calc(var(--q1-duration-base) - var(--q1-duration-press)) both;
13795
13890
  }
13796
13891
 
13892
+ .check-circle-fill--success > svg {
13893
+ color: oklch(from var(--q1-color-status-success) 0.52 c h);
13894
+ }
13895
+
13896
+ .check-circle-fill--success path {
13897
+ color: var(--q1-color-action-on-primary);
13898
+ }
13899
+
13797
13900
  @keyframes check-circle-fill-enter {
13798
13901
  from { transform: scale(0.6); opacity: 0; }
13799
13902
  to { transform: scale(1); opacity: 1; }
@@ -13812,16 +13915,97 @@ a.q1-navigation__item[aria-disabled='true'] {
13812
13915
  }
13813
13916
 
13814
13917
  @media (forced-colors: active) {
13815
- .check-circle-fill > svg {
13918
+ .check-circle-fill > svg,
13919
+ .check-circle-fill--success > svg {
13816
13920
  forced-color-adjust: none;
13817
13921
  color: CanvasText;
13818
13922
  }
13819
13923
 
13820
- .check-circle-fill path {
13924
+ .check-circle-fill path,
13925
+ .check-circle-fill--success path {
13821
13926
  color: Canvas;
13822
13927
  }
13823
13928
  }
13824
13929
 
13930
+ .empty-state__illustration {
13931
+ display: grid;
13932
+ place-items: center;
13933
+ max-inline-size: calc(var(--q1-space-6) * 4);
13934
+ margin-block-end: var(--q1-space-2);
13935
+ }
13936
+
13937
+ .empty-list-illustration {
13938
+ position: relative;
13939
+ display: inline-block;
13940
+ inline-size: calc(var(--q1-space-6) * 4);
13941
+ max-inline-size: 100%;
13942
+ aspect-ratio: 96 / 104;
13943
+ }
13944
+
13945
+ .empty-list-illustration > svg {
13946
+ display: block;
13947
+ inline-size: 100%;
13948
+ block-size: 100%;
13949
+ }
13950
+
13951
+ .empty-list-illustration__back {
13952
+ fill: var(--q1-color-primary-200);
13953
+ opacity: 0.5;
13954
+ }
13955
+
13956
+ .empty-list-illustration__card {
13957
+ fill: var(--q1-color-primary-100);
13958
+ }
13959
+
13960
+ .empty-list-illustration__rows {
13961
+ fill: var(--q1-color-primary-300);
13962
+ }
13963
+
13964
+ .empty-list-illustration > .check-circle-fill {
13965
+ position: absolute;
13966
+ inset-inline-end: var(--q1-space-2);
13967
+ inset-block-end: var(--q1-space-1);
13968
+ inline-size: var(--q1-space-5);
13969
+ block-size: var(--q1-space-5);
13970
+ }
13971
+
13972
+ .empty-list-illustration > .check-circle-fill > svg {
13973
+ inline-size: 100%;
13974
+ block-size: 100%;
13975
+ }
13976
+
13977
+ /* 暗色面板上的卡面与列表行分别提高色阶,沿用局部主题边界。 */
13978
+ :is(:root[data-theme='dark'], [data-q1-theme='dark']) .empty-list-illustration__back:not(:where([data-q1-theme='light'], [data-q1-theme='light'] *)) {
13979
+ fill: var(--q1-color-primary-300);
13980
+ }
13981
+
13982
+ :is(:root[data-theme='dark'], [data-q1-theme='dark']) .empty-list-illustration__card:not(:where([data-q1-theme='light'], [data-q1-theme='light'] *)) {
13983
+ fill: var(--q1-color-primary-400);
13984
+ }
13985
+
13986
+ :is(:root[data-theme='dark'], [data-q1-theme='dark']) .empty-list-illustration__rows:not(:where([data-q1-theme='light'], [data-q1-theme='light'] *)) {
13987
+ fill: var(--q1-color-primary-600);
13988
+ }
13989
+
13990
+ @media (forced-colors: active) {
13991
+ .empty-list-illustration > svg {
13992
+ forced-color-adjust: none;
13993
+ }
13994
+
13995
+ .empty-list-illustration__back,
13996
+ .empty-list-illustration__card,
13997
+ :is(:root[data-theme='dark'], [data-q1-theme='dark']) .empty-list-illustration__back:not(:where([data-q1-theme='light'], [data-q1-theme='light'] *)),
13998
+ :is(:root[data-theme='dark'], [data-q1-theme='dark']) .empty-list-illustration__card:not(:where([data-q1-theme='light'], [data-q1-theme='light'] *)) {
13999
+ fill: Canvas;
14000
+ stroke: CanvasText;
14001
+ }
14002
+
14003
+ .empty-list-illustration__rows,
14004
+ :is(:root[data-theme='dark'], [data-q1-theme='dark']) .empty-list-illustration__rows:not(:where([data-q1-theme='light'], [data-q1-theme='light'] *)) {
14005
+ fill: CanvasText;
14006
+ }
14007
+ }
14008
+
13825
14009
  /* Private geometry derives from existing spacing; no new consumer token surface. */
13826
14010
  .control-option.checkbox-circle {
13827
14011
  --checkbox-circle-diameter: calc(var(--q1-space-4) + var(--q1-space-1) / 2);
@@ -14285,6 +14469,115 @@ a.q1-navigation__item[aria-disabled='true'] {
14285
14469
  }
14286
14470
  }
14287
14471
 
14472
+ .status-page {
14473
+ min-block-size: 100dvh;
14474
+ box-sizing: border-box;
14475
+ display: flex;
14476
+ align-items: center;
14477
+ justify-content: center;
14478
+ padding: var(--q1-space-6);
14479
+ background: var(--q1-color-bg-canvas);
14480
+ color: var(--q1-color-text-primary);
14481
+ }
14482
+ .status-page__content {
14483
+ inline-size: 100%;
14484
+ max-inline-size: calc(var(--q1-space-16) * 8);
14485
+ text-align: center;
14486
+ }
14487
+ .status-page__title {
14488
+ margin: 0;
14489
+ font-size: var(--q1-font-size-heading-24);
14490
+ line-height: var(--q1-line-height-heading-24);
14491
+ font-weight: var(--q1-font-weight-regular);
14492
+ overflow-wrap: anywhere;
14493
+ }
14494
+ .status-page__illustration { margin-block-start: var(--q1-space-16); }
14495
+ .status-page__description {
14496
+ display: flex;
14497
+ align-items: flex-start;
14498
+ justify-content: center;
14499
+ gap: var(--q1-space-4);
14500
+ margin-block-start: calc(var(--q1-space-10) + var(--q1-space-4));
14501
+ color: var(--q1-color-text-secondary);
14502
+ font-size: var(--q1-font-size-copy-14);
14503
+ line-height: var(--q1-line-height-copy-14);
14504
+ text-align: start;
14505
+ }
14506
+ .status-page__description p { margin: 0; overflow-wrap: anywhere; }
14507
+ .status-page__icon { display: inline-flex; flex: none; }
14508
+ .status-page__actions {
14509
+ display: flex;
14510
+ justify-content: center;
14511
+ flex-wrap: wrap;
14512
+ gap: var(--q1-space-3);
14513
+ margin-block-start: var(--q1-space-6);
14514
+ }
14515
+ .skeleton-illustration {
14516
+ inline-size: min(100%, calc(var(--q1-space-16) * 4 + var(--q1-space-6) * 2));
14517
+ margin-inline: auto;
14518
+ }
14519
+ .skeleton-illustration__row { display: flex; gap: var(--q1-space-1); margin-block-end: var(--q1-space-1-5); }
14520
+ .skeleton-illustration__row[data-indent] > :first-child { margin-inline-start: 10.6%; }
14521
+ .skeleton-illustration__bar {
14522
+ position: relative;
14523
+ display: block;
14524
+ flex: none;
14525
+ block-size: var(--q1-space-2);
14526
+ border-radius: var(--q1-radius-full);
14527
+ overflow: hidden;
14528
+ }
14529
+ /* 五档中性 token 随主题反转:400 为远景;500 为轻段;600 为中段;700 为近段;800 为重段。
14530
+ 既有中性阶保留明暗层次,装饰不占用状态色或品牌色。 */
14531
+ .skeleton-illustration__bar--0 { background: var(--q1-color-gray-400); }
14532
+ .skeleton-illustration__bar--1 { background: var(--q1-color-gray-500); }
14533
+ .skeleton-illustration__bar--2 { background: var(--q1-color-gray-600); }
14534
+ .skeleton-illustration__bar--3 { background: var(--q1-color-gray-700); }
14535
+ .skeleton-illustration__bar--4 { background: var(--q1-color-gray-800); }
14536
+ .skeleton-illustration__bar::after {
14537
+ content: '';
14538
+ position: absolute;
14539
+ inset: 0;
14540
+ background: linear-gradient(90deg, transparent, var(--q1-color-gray-100), transparent);
14541
+ transform: translateX(-100%);
14542
+ animation: skeleton-sweep 1.6s var(--q1-ease-in-out) infinite;
14543
+ }
14544
+ .skeleton-illustration__ground {
14545
+ block-size: var(--q1-space-2);
14546
+ margin-block-start: var(--q1-space-3);
14547
+ background: linear-gradient(var(--q1-color-bg-subtle), transparent);
14548
+ }
14549
+ @media (prefers-reduced-motion: reduce) {
14550
+ .skeleton-illustration__bar::after { animation: none; }
14551
+ }
14552
+
14553
+ .status-page--region {
14554
+ min-block-size: auto;
14555
+ padding: var(--q1-space-6);
14556
+ background: transparent;
14557
+ animation: status-page-enter var(--q1-duration-base) var(--q1-ease-out);
14558
+ }
14559
+ .status-page--region .status-page__illustration { margin-block-start: 0; }
14560
+ .status-page--region .status-page__illustration > svg {
14561
+ inline-size: var(--q1-space-6);
14562
+ block-size: var(--q1-space-6);
14563
+ color: var(--q1-color-text-secondary);
14564
+ }
14565
+ .status-page--region .status-page__title {
14566
+ margin-block-start: var(--q1-space-4);
14567
+ font-size: var(--q1-font-size-heading-20);
14568
+ line-height: var(--q1-line-height-heading-20);
14569
+ }
14570
+ .status-page--region .status-page__description {
14571
+ margin-block-start: var(--q1-space-3);
14572
+ text-align: center;
14573
+ }
14574
+ .status-page--region .status-page__actions { margin-block-start: var(--q1-space-4); }
14575
+ @keyframes status-page-enter { from { opacity: 0; } to { opacity: 1; } }
14576
+ @media (prefers-reduced-motion: reduce) {
14577
+ .status-page--region { animation: none; }
14578
+ .status-page--region .skeleton-illustration__bar::after { animation: none; }
14579
+ }
14580
+
14288
14581
  .hover-card-trigger { display: inline-flex; }
14289
14582
  .hover-card {
14290
14583
  max-width: min(calc(100vw - var(--q1-space-6)), calc(var(--q1-space-8) * 9));
@@ -15111,3 +15404,41 @@ a.q1-navigation__item[aria-disabled='true'] {
15111
15404
  ):not(:where([data-q1-theme='light'], [data-q1-theme='light'] *)) {
15112
15405
  background: var(--q1-color-bg-raised);
15113
15406
  }
15407
+
15408
+ /* 统计卡是唯一品牌色选中描边例外:无浅底,数字保持最高文字对比。 */
15409
+ .switch-control--cards .switch-control__visual,
15410
+ .switch-control--cards .switch-control__option[aria-checked='true'] .switch-control__visual,
15411
+ :is(:root[data-theme='dark'], [data-q1-theme='dark']) .switch-control--cards .switch-control__option[aria-checked='true']:not(:focus-visible) .switch-control__visual {
15412
+ box-shadow: none;
15413
+ background: transparent;
15414
+ }
15415
+
15416
+ /* 选中标签与选中描边同色,暗色取高亮品牌阶以保证文字对比 */
15417
+ .switch-control--cards .switch-control__option[aria-checked='true'] {
15418
+ border-color: var(--q1-color-border-active);
15419
+ box-shadow: inset 0 0 0 calc(var(--q1-space-1) / 4) var(--q1-color-border-active);
15420
+ }
15421
+
15422
+ .switch-control--cards .switch-control__option[aria-checked='true']:not(:disabled) .switch-control__card-label {
15423
+ color: var(--q1-color-border-active);
15424
+ }
15425
+
15426
+ .switch-control--cards .switch-control__option[aria-checked='true']:focus-visible {
15427
+ box-shadow: inset 0 0 0 calc(var(--q1-space-1) / 4) var(--q1-color-border-active), var(--q1-shadow-focus);
15428
+ }
15429
+
15430
+ .switch-control--cards .switch-control__option[aria-checked='true']:disabled {
15431
+ border-color: var(--q1-color-border-strong);
15432
+ box-shadow: inset 0 0 0 calc(var(--q1-space-1) / 4) var(--q1-color-border-strong);
15433
+ }
15434
+
15435
+ @media (forced-colors: active) {
15436
+ .switch-control--cards .switch-control__option[aria-checked='true'] {
15437
+ outline: calc(var(--q1-space-1) / 2) solid Highlight;
15438
+ outline-offset: calc(var(--q1-space-1) / -4);
15439
+ }
15440
+
15441
+ .switch-control--cards .switch-control__option[aria-checked='true']:disabled {
15442
+ outline-color: GrayText;
15443
+ }
15444
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q1travel/design-system",
3
- "version": "0.30.2",
3
+ "version": "0.30.4",
4
4
  "description": "React components, design tokens, and interface contracts for q1travel products.",
5
5
  "keywords": [
6
6
  "react",