@q1travel/design-system 0.7.3 → 0.9.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.
@@ -1295,6 +1295,138 @@
1295
1295
 
1296
1296
  /* 组件自身样式。发布进 npm 包,foundations.css 之后加载。 */
1297
1297
 
1298
+ .table {
1299
+ width: 100%;
1300
+ border-collapse: collapse;
1301
+ color: var(--q1-color-text-primary);
1302
+ font-size: var(--q1-font-size-label-14);
1303
+ line-height: var(--q1-line-height-label-14);
1304
+ }
1305
+
1306
+ .table th,
1307
+ .table td {
1308
+ padding: var(--q1-space-3) var(--q1-space-2);
1309
+ border-bottom: 1px solid var(--q1-color-border);
1310
+ text-align: left;
1311
+ vertical-align: middle;
1312
+ }
1313
+
1314
+ .table thead th {
1315
+ color: var(--q1-color-text-secondary);
1316
+ font-weight: var(--q1-font-weight-medium);
1317
+ }
1318
+
1319
+ .table__head--hidden {
1320
+ position: absolute;
1321
+ width: 1px;
1322
+ height: 1px;
1323
+ overflow: hidden;
1324
+ clip: rect(0 0 0 0);
1325
+ clip-path: inset(50%);
1326
+ white-space: nowrap;
1327
+ }
1328
+
1329
+ .table--compact th,
1330
+ .table--compact td {
1331
+ padding-block: var(--q1-space-2);
1332
+ }
1333
+
1334
+ .table__scroll {
1335
+ max-width: 100%;
1336
+ overflow-x: auto;
1337
+ }
1338
+
1339
+ .table__scroll--vertical {
1340
+ overflow-y: auto;
1341
+ }
1342
+
1343
+ .table__scroll:focus-visible {
1344
+ outline: none;
1345
+ box-shadow: var(--q1-shadow-focus);
1346
+ }
1347
+
1348
+ .table--sticky-header thead th {
1349
+ position: sticky;
1350
+ top: 0;
1351
+ z-index: 1;
1352
+ background: var(--q1-color-bg-canvas);
1353
+ }
1354
+
1355
+ .table__sort {
1356
+ display: inline-flex;
1357
+ align-items: center;
1358
+ gap: var(--q1-space-1);
1359
+ margin: calc(-1 * var(--q1-space-1)) calc(-1 * var(--q1-space-2));
1360
+ border: 0;
1361
+ border-radius: var(--q1-radius-1);
1362
+ background: transparent;
1363
+ color: inherit;
1364
+ cursor: pointer;
1365
+ font: inherit;
1366
+ padding: var(--q1-space-1) var(--q1-space-2);
1367
+ }
1368
+
1369
+ .table__sort-state {
1370
+ display: inline-flex;
1371
+ align-items: center;
1372
+ color: currentColor;
1373
+ font-size: var(--q1-font-size-label-13);
1374
+ line-height: 1;
1375
+ white-space: nowrap;
1376
+ }
1377
+
1378
+ .table__sort:hover {
1379
+ background: var(--q1-color-bg-subtle);
1380
+ color: var(--q1-color-text-primary);
1381
+ }
1382
+
1383
+ .table__sort:focus-visible,
1384
+ .table input[type='checkbox']:focus-visible {
1385
+ outline: none;
1386
+ box-shadow: var(--q1-shadow-focus);
1387
+ }
1388
+
1389
+ .table__checkbox-control {
1390
+ display: inline-flex;
1391
+ align-items: center;
1392
+ justify-content: center;
1393
+ min-width: var(--q1-space-6);
1394
+ min-height: var(--q1-space-6);
1395
+ margin: calc(-1 * var(--q1-space-1)) calc(-1 * var(--q1-space-2));
1396
+ border-radius: var(--q1-radius-1);
1397
+ cursor: pointer;
1398
+ }
1399
+
1400
+ .table__checkbox-control:has(input:disabled) {
1401
+ cursor: not-allowed;
1402
+ }
1403
+
1404
+ .table tbody tr[tabindex='0']:focus-visible {
1405
+ outline: none;
1406
+ box-shadow: inset 0 0 0 2px var(--q1-color-action-primary);
1407
+ }
1408
+
1409
+ .table th[aria-sort='ascending'] .table__sort,
1410
+ .table th[aria-sort='descending'] .table__sort {
1411
+ color: var(--q1-color-action-primary);
1412
+ }
1413
+
1414
+ .table__bulk-actions {
1415
+ display: flex;
1416
+ flex-wrap: wrap;
1417
+ align-items: center;
1418
+ gap: var(--q1-space-2);
1419
+ margin-block-end: var(--q1-space-3);
1420
+ }
1421
+
1422
+ @media (pointer: coarse) {
1423
+ .table__checkbox-control,
1424
+ .table__sort {
1425
+ min-width: 44px;
1426
+ min-height: 44px;
1427
+ }
1428
+ }
1429
+
1298
1430
  [data-q1-portal='overlay'] {
1299
1431
  position: relative;
1300
1432
  z-index: var(--q1-z-overlay-root);
@@ -5262,52 +5394,125 @@ a.q1-card:focus-visible {
5262
5394
  .choicebox--checkbox:has(.choicebox__input:disabled:checked) .choicebox__indicator {
5263
5395
  background: var(--q1-color-gray-500);
5264
5396
  }
5265
- /* 实测外部参考:裸轨(无外框/无背景/无 padding),图标抽离文字块、绝对定位在 28px 凹槽外;
5266
- 悬停只把文字/图标从 text-secondary 加深到 text-primary,无背景浸染、无品牌色——
5267
- 这是页面间的纯导航链(chrome),不是行动号召,indigo 只守「动作」。 */
5397
+ /* 数据集分页:数字页码、已知总数与未知尾页。数据请求和 URL 状态由消费方控制。 */
5268
5398
  .pagination {
5399
+ display: flex;
5400
+ flex-wrap: wrap;
5401
+ align-items: center;
5402
+ justify-content: space-between;
5403
+ gap: var(--q1-space-3);
5404
+ width: 100%;
5405
+ }
5406
+ .pagination__summary {
5407
+ min-width: 0;
5408
+ font-size: 13px;
5409
+ line-height: 20px;
5410
+ color: var(--q1-color-text-secondary);
5411
+ }
5412
+ .pagination__controls {
5413
+ display: inline-flex;
5414
+ align-items: center;
5415
+ flex-wrap: wrap;
5416
+ gap: var(--q1-space-1);
5417
+ }
5418
+ .pagination__page-size {
5419
+ display: inline-flex;
5420
+ align-items: center;
5421
+ margin-right: var(--q1-space-2);
5422
+ }
5423
+ .pagination__button {
5424
+ display: inline-flex;
5425
+ align-items: center;
5426
+ justify-content: center;
5427
+ min-width: 32px;
5428
+ min-height: 32px;
5429
+ padding: 4px 8px;
5430
+ border: 1px solid transparent;
5431
+ border-radius: var(--q1-radius-2);
5432
+ background: transparent;
5433
+ color: var(--q1-color-text-secondary);
5434
+ font: inherit;
5435
+ font-size: 14px;
5436
+ line-height: 20px;
5437
+ font-variant-numeric: tabular-nums;
5438
+ cursor: pointer;
5439
+ }
5440
+ .pagination__button:hover:not(:disabled):not([aria-disabled='true']) {
5441
+ background: var(--q1-color-bg-subtle);
5442
+ color: var(--q1-color-text-primary);
5443
+ }
5444
+ .pagination__button:focus-visible {
5445
+ outline: none;
5446
+ box-shadow: var(--q1-shadow-focus);
5447
+ }
5448
+ .pagination__button--nav {
5449
+ border-color: var(--q1-color-border);
5450
+ }
5451
+ .pagination__button--current {
5452
+ color: var(--q1-color-text-primary);
5453
+ background: var(--q1-color-bg-subtle);
5454
+ font-weight: var(--q1-font-weight-medium);
5455
+ }
5456
+ .pagination__button:disabled,
5457
+ .pagination__button[aria-disabled='true'] {
5458
+ border-color: var(--q1-color-border);
5459
+ background: var(--q1-color-bg-subtle);
5460
+ color: var(--q1-color-text-muted);
5461
+ cursor: not-allowed;
5462
+ }
5463
+ .pagination__ellipsis {
5464
+ min-width: 24px;
5465
+ color: var(--q1-color-text-muted);
5466
+ text-align: center;
5467
+ }
5468
+ @media (pointer: coarse) {
5469
+ .pagination__button {
5470
+ min-width: 44px;
5471
+ min-height: 44px;
5472
+ }
5473
+ }
5474
+
5475
+ /* 文档顺序导航:裸轨,无外框/背景;图标锚在标题文字块内。 */
5476
+ .docs-pagination {
5269
5477
  display: flex;
5270
5478
  flex-wrap: wrap;
5271
5479
  align-items: flex-start;
5272
5480
  justify-content: space-between;
5273
5481
  width: 100%;
5274
5482
  }
5275
- .pagination__link {
5483
+ .docs-pagination__link {
5276
5484
  display: block;
5277
5485
  padding: 4px var(--q1-space-2);
5278
5486
  border-radius: var(--q1-radius-2);
5279
5487
  text-decoration: none;
5280
5488
  }
5281
- .pagination__link--prev {
5489
+ .docs-pagination__link--prev {
5282
5490
  padding-left: 28px;
5283
5491
  }
5284
- .pagination__link--next {
5492
+ .docs-pagination__link--next {
5285
5493
  padding-right: 28px;
5286
5494
  margin-left: auto;
5287
5495
  text-align: right;
5288
5496
  }
5289
- .pagination__link:focus-visible {
5497
+ .docs-pagination__link:focus-visible {
5290
5498
  outline: none;
5291
5499
  box-shadow: var(--q1-shadow-focus);
5292
5500
  }
5293
- .pagination__label {
5501
+ .docs-pagination__label {
5294
5502
  display: block;
5295
5503
  margin-bottom: 2px;
5296
5504
  font-size: 13px;
5297
5505
  color: var(--q1-color-text-secondary);
5298
- transition: color 0.2s ease-in-out;
5299
5506
  }
5300
- .pagination__link:hover .pagination__label {
5507
+ .docs-pagination__link:hover .docs-pagination__label {
5301
5508
  color: var(--q1-color-text-primary);
5302
5509
  }
5303
- /* 定位上下文钉在标题文字块(实测外部参考:图标是标题块的子节点,随文字宽度走,
5304
- 而不是钉在整条链接上)——否则图标会漂出链接可点/可聚焦的框外。 */
5305
- .pagination__title-frame {
5510
+ .docs-pagination__title-frame {
5306
5511
  position: relative;
5307
5512
  display: inline-block;
5308
5513
  max-width: 20em;
5309
5514
  }
5310
- .pagination__title {
5515
+ .docs-pagination__title {
5311
5516
  display: block;
5312
5517
  overflow: hidden;
5313
5518
  white-space: nowrap;
@@ -5317,28 +5522,27 @@ a.q1-card:focus-visible {
5317
5522
  font-weight: var(--q1-font-weight-medium);
5318
5523
  color: var(--q1-color-text-primary);
5319
5524
  }
5320
- .pagination__chevron-slot {
5525
+ .docs-pagination__chevron-slot {
5321
5526
  position: absolute;
5322
5527
  top: 2px;
5323
5528
  display: block;
5324
5529
  color: var(--q1-color-text-secondary);
5325
- transition: color 0.2s ease-in-out;
5326
5530
  }
5327
- .pagination__link--prev .pagination__chevron-slot {
5531
+ .docs-pagination__link--prev .docs-pagination__chevron-slot {
5328
5532
  left: -26px;
5329
5533
  }
5330
- .pagination__link--next .pagination__chevron-slot {
5534
+ .docs-pagination__link--next .docs-pagination__chevron-slot {
5331
5535
  right: -26px;
5332
5536
  }
5333
- .pagination__link:hover .pagination__chevron-slot {
5537
+ .docs-pagination__link:hover .docs-pagination__chevron-slot {
5334
5538
  color: var(--q1-color-text-primary);
5335
5539
  }
5336
- .pagination__chevron {
5540
+ .docs-pagination__chevron {
5337
5541
  display: block;
5338
5542
  width: 20px;
5339
5543
  height: 20px;
5340
5544
  }
5341
- .pagination__slot {
5545
+ .docs-pagination__slot {
5342
5546
  display: block;
5343
5547
  }
5344
5548
  .feedback {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q1travel/design-system",
3
- "version": "0.7.3",
3
+ "version": "0.9.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist-pkg/design-system.js",
@@ -37,9 +37,9 @@
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 && node --test scripts/check-controls-contract.test.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 && node --test scripts/check-table-core.test.mjs scripts/check-table-interaction.test.mjs scripts/check-table-layout.test.mjs",
41
41
  "check:release-provenance": "node --test scripts/check-release-provenance.test.mjs && node scripts/check-release-provenance.mjs",
42
- "check": "npm run build && npm run check:shell && npm run check:browser",
42
+ "check": "npm run build && npm run check:shell && npm run check:browser && npm run build:pkg",
43
43
  "build:lib": "vite build --config vite.lib.config.ts",
44
44
  "build:style": "node scripts/build-style.mjs",
45
45
  "build:pkg": "npm run build:lib && npm run build:style && npm run check:package-api",