@q1travel/design-system 0.8.0 → 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);
@@ -5305,7 +5437,7 @@ a.q1-card:focus-visible {
5305
5437
  font-variant-numeric: tabular-nums;
5306
5438
  cursor: pointer;
5307
5439
  }
5308
- .pagination__button:hover:not(:disabled) {
5440
+ .pagination__button:hover:not(:disabled):not([aria-disabled='true']) {
5309
5441
  background: var(--q1-color-bg-subtle);
5310
5442
  color: var(--q1-color-text-primary);
5311
5443
  }
@@ -5321,7 +5453,8 @@ a.q1-card:focus-visible {
5321
5453
  background: var(--q1-color-bg-subtle);
5322
5454
  font-weight: var(--q1-font-weight-medium);
5323
5455
  }
5324
- .pagination__button:disabled {
5456
+ .pagination__button:disabled,
5457
+ .pagination__button[aria-disabled='true'] {
5325
5458
  border-color: var(--q1-color-border);
5326
5459
  background: var(--q1-color-bg-subtle);
5327
5460
  color: var(--q1-color-text-muted);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q1travel/design-system",
3
- "version": "0.8.0",
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 && node --test scripts/check-pagination-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",