@seanyeh77/ui 0.43.1 → 0.44.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.
Files changed (129) hide show
  1. package/dist/bundle.js +14 -14
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/components/Alert/Alert.d.ts +1 -1
  4. package/dist/components/Alert/Alert.js +2 -1
  5. package/dist/components/Alert/Alert.js.map +1 -1
  6. package/dist/components/DangerZone/DangerZone.d.ts +1 -1
  7. package/dist/components/DangerZone/DangerZone.js +2 -1
  8. package/dist/components/DangerZone/DangerZone.js.map +1 -1
  9. package/dist/components/DataTable/DataTable.d.ts +8 -3
  10. package/dist/components/DataTable/DataTable.js +155 -63
  11. package/dist/components/DataTable/DataTable.js.map +1 -1
  12. package/dist/components/DatePicker/DatePicker.d.ts +2 -2
  13. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  14. package/dist/components/Dialog/Dialog.d.ts +1 -1
  15. package/dist/components/Dialog/Dialog.js +2 -1
  16. package/dist/components/Dialog/Dialog.js.map +1 -1
  17. package/dist/components/Drawer/Drawer.d.ts +1 -0
  18. package/dist/components/Drawer/Drawer.js +2 -1
  19. package/dist/components/Drawer/Drawer.js.map +1 -1
  20. package/dist/components/EmptyState/EmptyState.d.ts +2 -2
  21. package/dist/components/EmptyState/EmptyState.js +3 -2
  22. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  23. package/dist/components/ErrorPage/ErrorPage.d.ts +1 -0
  24. package/dist/components/ErrorPage/ErrorPage.js +2 -1
  25. package/dist/components/ErrorPage/ErrorPage.js.map +1 -1
  26. package/dist/components/EventTimeline/EventTimeline.d.ts +1 -1
  27. package/dist/components/EventTimeline/EventTimeline.js +2 -1
  28. package/dist/components/EventTimeline/EventTimeline.js.map +1 -1
  29. package/dist/components/FileUpload/FileUpload.d.ts +1 -1
  30. package/dist/components/FileUpload/FileUpload.js +2 -1
  31. package/dist/components/FileUpload/FileUpload.js.map +1 -1
  32. package/dist/components/InlineCode/InlineCode.js +10 -6
  33. package/dist/components/InlineCode/InlineCode.js.map +1 -1
  34. package/dist/components/KpiCard/KpiCard.d.ts +2 -2
  35. package/dist/components/KpiCard/KpiCard.js +5 -4
  36. package/dist/components/KpiCard/KpiCard.js.map +1 -1
  37. package/dist/components/LayerGraph/LayerGraph.js +19 -9
  38. package/dist/components/LayerGraph/LayerGraph.js.map +1 -1
  39. package/dist/components/LoginCard/LoginCard.d.ts +1 -1
  40. package/dist/components/LoginCard/LoginCard.js.map +1 -1
  41. package/dist/components/Markdown/Markdown.js +19 -1
  42. package/dist/components/Markdown/Markdown.js.map +1 -1
  43. package/dist/components/MultiSelect/MultiSelect.d.ts +1 -1
  44. package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
  45. package/dist/components/NotificationBell/NotificationBell.d.ts +1 -0
  46. package/dist/components/NotificationBell/NotificationBell.js +2 -1
  47. package/dist/components/NotificationBell/NotificationBell.js.map +1 -1
  48. package/dist/components/Select/Select.d.ts +1 -1
  49. package/dist/components/Select/Select.js.map +1 -1
  50. package/dist/components/SettingsLayout/SettingsLayout.d.ts +1 -1
  51. package/dist/components/SettingsLayout/SettingsLayout.js +2 -1
  52. package/dist/components/SettingsLayout/SettingsLayout.js.map +1 -1
  53. package/dist/components/Tabs/Tabs.d.ts +4 -1
  54. package/dist/components/Tabs/Tabs.js +5 -2
  55. package/dist/components/Tabs/Tabs.js.map +1 -1
  56. package/dist/components/TextArea/TextArea.d.ts +2 -1
  57. package/dist/components/TextArea/TextArea.js +3 -2
  58. package/dist/components/TextArea/TextArea.js.map +1 -1
  59. package/dist/components/TextField/TextField.d.ts +2 -2
  60. package/dist/components/TextField/TextField.js.map +1 -1
  61. package/dist/components/Toast/Toast.d.ts +1 -1
  62. package/dist/components/Toast/Toast.js +2 -1
  63. package/dist/components/Toast/Toast.js.map +1 -1
  64. package/dist/css/Alert.css +1 -0
  65. package/dist/css/Button.css +1 -0
  66. package/dist/css/Checkbox.css +1 -0
  67. package/dist/css/CodeView.css +1 -1
  68. package/dist/css/DangerZone.css +1 -0
  69. package/dist/css/DataTable.css +177 -38
  70. package/dist/css/DatePicker.css +1 -0
  71. package/dist/css/DateRangePicker.css +1 -0
  72. package/dist/css/Drawer.css +1 -0
  73. package/dist/css/EmptyState.css +1 -0
  74. package/dist/css/ErrorPage.css +1 -0
  75. package/dist/css/EventTimeline.css +1 -0
  76. package/dist/css/FileUpload.css +1 -0
  77. package/dist/css/KpiCard.css +1 -0
  78. package/dist/css/LoginCard.css +1 -0
  79. package/dist/css/Markdown.css +29 -1
  80. package/dist/css/MultiSelect.css +1 -0
  81. package/dist/css/NotificationBell.css +1 -0
  82. package/dist/css/ProjectSwitcher.css +6 -1
  83. package/dist/css/Select.css +1 -0
  84. package/dist/css/SettingsLayout.css +1 -0
  85. package/dist/css/Suggestion.css +1 -1
  86. package/dist/css/Tabs.css +6 -6
  87. package/dist/css/Term.css +1 -1
  88. package/dist/css/TextArea.css +1 -0
  89. package/dist/css/TextField.css +1 -0
  90. package/dist/css/Toast.css +1 -0
  91. package/dist/css/Tour.css +1 -1
  92. package/dist/css/TreeList.css +1 -0
  93. package/dist/css/Workbench.css +12 -0
  94. package/dist/format.js +3 -1
  95. package/dist/format.js.map +1 -1
  96. package/dist/index.js +2 -2
  97. package/dist/internal/Field.js +3 -2
  98. package/dist/internal/Field.js.map +1 -1
  99. package/dist/internal/codeSpans.js +20 -0
  100. package/dist/internal/codeSpans.js.map +1 -0
  101. package/dist/styles.css +316 -133
  102. package/docs/Alert.md +1 -0
  103. package/docs/Card.md +3 -3
  104. package/docs/DangerZone.md +1 -0
  105. package/docs/DataTable.md +29 -19
  106. package/docs/DatePicker.md +1 -0
  107. package/docs/Dialog.md +1 -0
  108. package/docs/Drawer.md +1 -0
  109. package/docs/EmptyState.md +1 -0
  110. package/docs/ErrorPage.md +1 -0
  111. package/docs/EventTimeline.md +1 -0
  112. package/docs/FileUpload.md +1 -0
  113. package/docs/Format.md +1 -1
  114. package/docs/KpiCard.md +1 -0
  115. package/docs/LoginCard.md +1 -0
  116. package/docs/Markdown.md +3 -0
  117. package/docs/MultiSelect.md +1 -0
  118. package/docs/NotificationBell.md +1 -0
  119. package/docs/Select.md +1 -0
  120. package/docs/SettingsLayout.md +1 -0
  121. package/docs/Tabs.md +2 -2
  122. package/docs/Term.md +1 -0
  123. package/docs/TextArea.md +1 -0
  124. package/docs/TextField.md +1 -0
  125. package/docs/Toast.md +1 -0
  126. package/docs/data.md +4 -3
  127. package/docs/guidelines.md +4 -4
  128. package/docs/layout.md +1 -1
  129. package/package.json +2 -2
package/dist/styles.css CHANGED
@@ -554,6 +554,94 @@ html.ui-theme-fade * {
554
554
  stroke: var(--surface);
555
555
  stroke-width: 2;
556
556
  }
557
+ /* Inline code */
558
+ .ui-code {
559
+ font-family: var(--font-mono);
560
+ font-size: 0.875em;
561
+ padding: 1px 5px;
562
+ border-radius: var(--radius-xs);
563
+ background: var(--surface-sub);
564
+ color: var(--ink);
565
+ overflow-wrap: anywhere;
566
+ }
567
+ /* In a table (DataTable rows and their details, Markdown tables) every other row is surface-sub, the same as the code
568
+ background, so code there is surface with a 1 px line border: it reads the same on both row colours and on the
569
+ hovered row. Inset shadow, not a border, so the size and line height do not change. */
570
+ :is(.ui-dt-body, .ui-dt-detail, .ui-md-table td) .ui-code {
571
+ background: var(--surface);
572
+ box-shadow: inset 0 0 0 1px var(--line);
573
+ }
574
+ .ui-code.is-short {
575
+ white-space: nowrap;
576
+ }
577
+ .ui-code.is-link {
578
+ border: 0;
579
+ color: var(--accent-text);
580
+ font-weight: inherit;
581
+ line-height: inherit;
582
+ text-decoration: underline;
583
+ text-underline-offset: 2px;
584
+ cursor: pointer;
585
+ }
586
+ .ui-code.is-link:hover {
587
+ text-decoration-thickness: 2px;
588
+ }
589
+ /* Dark: accent-text on the chip's surface-sub is 3.9:1; a quarter of ink brings it to 5:1 (at least 4.5:1 for 14 px text). */
590
+ [data-theme='dark'] .ui-code.is-link {
591
+ color: color-mix(in srgb, var(--accent-text), var(--ink) 25%);
592
+ }
593
+ /* A name (function, class, variable) and a location (file:line) that point somewhere: no chip, no underline until
594
+ hover or keyboard focus. Three classes so they win over the dark link colour and the table chip above. */
595
+ .ui-code.is-link.is-name,
596
+ .ui-code.is-link.is-location {
597
+ padding: 0;
598
+ background: none;
599
+ box-shadow: none;
600
+ text-decoration: none;
601
+ text-underline-offset: 3px;
602
+ text-decoration-thickness: 1px;
603
+ }
604
+ .ui-code.is-link.is-name {
605
+ color: var(--code-link-ink, var(--accent-text));
606
+ }
607
+ /* Dark: accent-text on a surface-sub table row is 3.9:1; a quarter of ink brings it above 4.5:1, as for the chip. */
608
+ [data-theme='dark'] :is(.ui-dt-body, .ui-dt-detail, .ui-md-table td) .ui-code.is-link:is(.is-name, .is-location) {
609
+ --code-link-ink: color-mix(in srgb, var(--accent-text), var(--ink) 25%);
610
+ }
611
+ /* One step smaller: the 13 px of secondary text. Never breaks inside. */
612
+ .ui-code.is-link.is-location {
613
+ color: var(--ink-muted);
614
+ font-size: var(--text-small);
615
+ white-space: nowrap;
616
+ }
617
+ .ui-code.is-link.is-name:is(:hover, :focus-visible),
618
+ .ui-code.is-link.is-location:is(:hover, :focus-visible) {
619
+ text-decoration: underline;
620
+ text-decoration-thickness: 1px;
621
+ }
622
+ .ui-code.is-link.is-location:is(:hover, :focus-visible) {
623
+ color: var(--code-link-ink, var(--accent-text));
624
+ }
625
+ .ui-code.is-link.is-name:focus-visible,
626
+ .ui-code.is-link.is-location:focus-visible {
627
+ border-radius: var(--radius-xs);
628
+ }
629
+ .ui-pal-detail .ui-code {
630
+ padding: 0;
631
+ background: transparent;
632
+ color: inherit;
633
+ }
634
+ .ui-sug-line .ui-code {
635
+ background: var(--surface);
636
+ }
637
+ .ui-md-table .ui-code {
638
+ white-space: normal;
639
+ overflow-wrap: break-word;
640
+ }
641
+ /* A command wraps at its spaces; a path or a name in code never breaks inside. */
642
+ .ui-md-table .ui-code.is-link {
643
+ white-space: nowrap;
644
+ }
557
645
  .ui-btn {
558
646
  display: inline-flex;
559
647
  align-items: center;
@@ -1119,15 +1207,15 @@ html.ui-theme-fade * {
1119
1207
  }
1120
1208
  }
1121
1209
  .ui-tab-count {
1122
- /* With the space before it: about 6 px from the name. */
1210
+ /* With the space before it: about 6 px from the name. A quiet number: the text font with figures of one width,
1211
+ muted and regular weight on every tab, so the names lead and the counts line up. */
1123
1212
  margin-left: 2px;
1124
- font-family: var(--font-mono);
1125
- font-size: var(--text-small);
1213
+ font-family: var(--font-sans);
1214
+ font-variant-numeric: tabular-nums;
1215
+ font-size: var(--text-compact);
1216
+ font-weight: 400;
1126
1217
  color: var(--ink-muted);
1127
1218
  }
1128
- .ui-tab.is-selected .ui-tab-count {
1129
- color: var(--ink);
1130
- }
1131
1219
  .ui-tabbar {
1132
1220
  position: relative;
1133
1221
  box-sizing: border-box;
@@ -3058,15 +3146,21 @@ html.ui-theme-fade * {
3058
3146
  .ui-dt-tools {
3059
3147
  flex-wrap: wrap;
3060
3148
  }
3061
- .ui-dt-tools > .ui-dt-search,
3149
+ /* The search field takes the room the buttons leave; when both do not fit, the buttons go to the next row,
3150
+ right-aligned, and the field fills its row. */
3151
+ .ui-dt-tools > .ui-dt-search {
3152
+ flex: 1 1 240px;
3153
+ min-width: 200px;
3154
+ }
3062
3155
  .ui-dt-tools > .ui-dt-search + .ui-dt-actions {
3063
- flex: 1 1 100%;
3064
- min-width: 0;
3156
+ flex: none;
3157
+ max-width: 100%;
3158
+ margin-left: auto;
3065
3159
  }
3066
3160
  }
3067
- /* Under 480 px: 「排序」 and the number of levels instead of the whole sort. With copy, columns and zoom as well (not
3068
- on phones, which hide them), 「篩選」「排序」「欄位」 keep only their icons and counts; the words stay in the
3069
- accessible names. The buttons wrap only when even that does not fit. */
3161
+ /* Under 480 px: the search field and the buttons back on one row, the field taking the room left. 「排序」 and the
3162
+ number of levels instead of the whole sort; 「篩選」「排序」 keep only their icons and counts, the words stay in the
3163
+ accessible names. */
3070
3164
  @container ui-dt (max-width: 479px) {
3071
3165
  .ui-dt-sortbtn-text {
3072
3166
  display: none;
@@ -3077,7 +3171,23 @@ html.ui-theme-fade * {
3077
3171
  .ui-dt-actions > .ui-dt-sortbtn {
3078
3172
  min-width: 0;
3079
3173
  }
3080
- .ui-dt-actions:has(> .ui-dt-menubtn) .ui-dt-btntext {
3174
+ /* One row: the search field takes the room left, the buttons keep to their icons. */
3175
+ .ui-dt-tools {
3176
+ flex-wrap: nowrap;
3177
+ }
3178
+ .ui-dt-tools > .ui-dt-search {
3179
+ flex: 1 1 0;
3180
+ min-width: 100px;
3181
+ }
3182
+ /* The summary tabs keep a row of their own above. */
3183
+ .ui-dt-tools.has-summary {
3184
+ flex-wrap: wrap;
3185
+ }
3186
+ .ui-dt-tools > .ui-dt-search + .ui-dt-actions {
3187
+ flex: none;
3188
+ flex-wrap: nowrap;
3189
+ }
3190
+ .ui-dt-actions .ui-dt-btntext {
3081
3191
  position: absolute;
3082
3192
  width: 1px;
3083
3193
  height: 1px;
@@ -3085,18 +3195,56 @@ html.ui-theme-fade * {
3085
3195
  clip: rect(0 0 0 0);
3086
3196
  white-space: nowrap;
3087
3197
  }
3088
- .ui-dt-actions:has(> .ui-dt-menubtn) :is(.ui-dt-filterbtn, .ui-dt-sortbtn) {
3198
+ .ui-dt-actions :is(.ui-dt-filterbtn, .ui-dt-sortbtn) {
3089
3199
  padding-inline: 10px;
3090
3200
  }
3091
3201
  .ui-dt-actions {
3092
3202
  flex-wrap: wrap;
3093
3203
  }
3094
3204
  }
3095
- /* Phones, also for tools that moved into a Card title row (outside the table, so not reached by the container). */
3205
+ /* With summary tabs: the tabs first. A row of their own (scrolling sideways when they are wider) unless the tabs, the
3206
+ search field at 240 px and the buttons all fit on one row (DataTable measures it: is-onerow). Every part is 40 px. */
3207
+ .ui-dt-tools.has-summary {
3208
+ flex-wrap: wrap;
3209
+ row-gap: var(--space-3);
3210
+ }
3211
+ .ui-dt-sumwrap {
3212
+ flex: 1 1 100%;
3213
+ min-width: 0;
3214
+ display: flex;
3215
+ }
3216
+ .ui-dt-tools.is-onerow {
3217
+ flex-wrap: nowrap;
3218
+ }
3219
+ .ui-dt-tools.is-onerow > .ui-dt-sumwrap {
3220
+ /* Measured to fit: the tabs keep their width, the search field gives way down to 240 px. */
3221
+ flex: none;
3222
+ margin-right: var(--space-2);
3223
+ }
3224
+ .ui-dt-tools.is-onerow > .ui-dt-search {
3225
+ flex: 1 1 320px;
3226
+ min-width: 240px;
3227
+ max-width: 400px;
3228
+ margin-left: auto;
3229
+ }
3230
+ .ui-dt-tools.is-onerow > .ui-dt-actions {
3231
+ flex: none;
3232
+ }
3233
+ .ui-dt-summary .ui-tab {
3234
+ min-width: 0;
3235
+ height: 32px;
3236
+ padding: 0 var(--space-3);
3237
+ }
3238
+ /* Phones, also for tools that moved into a Card title row (outside the table, so not reached by the container). The
3239
+ buttons are as tall as the 48 px search field beside them. */
3096
3240
  @media (max-width: 599px) {
3097
3241
  .ui-dt-sortbtn-text {
3098
3242
  display: none;
3099
3243
  }
3244
+ .ui-dt-tools:has(> .ui-dt-search) > .ui-dt-actions > :is(.ui-dt-filterbtn, .ui-dt-sortbtn),
3245
+ .ui-dt-tools:has(> .ui-dt-search) > .ui-dt-actions > .ui-dt-primary > * {
3246
+ height: var(--touch-target);
3247
+ }
3100
3248
  .ui-dt-sortbtn-short {
3101
3249
  display: inline-flex;
3102
3250
  }
@@ -3142,14 +3290,16 @@ html.ui-theme-fade * {
3142
3290
  min-width: min-content;
3143
3291
  }
3144
3292
  .ui-dt-row {
3293
+ /* The row's ground in one variable, so the row actions drawn over its end (.ui-dt-acts) take the same color. */
3294
+ --dt-row-bg: var(--surface);
3145
3295
  display: grid;
3146
3296
  align-items: center;
3147
3297
  min-height: 48px;
3148
3298
  border-bottom: 1px solid var(--line);
3149
- background: var(--surface);
3299
+ background: var(--dt-row-bg);
3150
3300
  }
3151
3301
  .ui-dt-body .ui-dt-row.is-even {
3152
- background: var(--dt-zebra);
3302
+ --dt-row-bg: var(--dt-zebra);
3153
3303
  }
3154
3304
  .ui-dt-body {
3155
3305
  position: relative;
@@ -3158,7 +3308,7 @@ html.ui-theme-fade * {
3158
3308
  transition: background-color 0.12s ease;
3159
3309
  }
3160
3310
  .ui-dt-body .ui-dt-row:hover {
3161
- background: var(--dt-hover);
3311
+ --dt-row-bg: var(--dt-hover);
3162
3312
  }
3163
3313
  /* EC: rows with details or a page (rowHref) are clickable as a whole; the hover above already shows it. */
3164
3314
  .ui-dt-body .ui-dt-row:is(.has-exp, .has-href) {
@@ -3175,7 +3325,7 @@ html.ui-theme-fade * {
3175
3325
  .ui-dt-body .ui-dt-row.is-selected,
3176
3326
  .ui-dt-body .ui-dt-row.is-selected:hover {
3177
3327
  --dt-mark: inset 3px 0 0 var(--accent);
3178
- background: var(--accent-soft);
3328
+ --dt-row-bg: var(--accent-soft);
3179
3329
  }
3180
3330
  .ui-dt-body .ui-dt-row > .ui-dt-cell:first-child {
3181
3331
  box-shadow: var(--dt-mark);
@@ -3254,9 +3404,14 @@ html.ui-theme-fade * {
3254
3404
  border-right: 1px solid var(--line);
3255
3405
  overflow: hidden;
3256
3406
  }
3257
- .ui-dt-cell:last-child {
3407
+ .ui-dt-cell:last-child,
3408
+ .ui-dt-cell.is-lastcol {
3258
3409
  border-right: 0;
3259
3410
  }
3411
+ /* An empty cell's 「—」: muted, so it does not read as content. */
3412
+ .ui-dt-none {
3413
+ color: var(--ink-muted);
3414
+ }
3260
3415
  .ui-dt-cell.is-num {
3261
3416
  justify-content: flex-end;
3262
3417
  text-align: right;
@@ -3341,36 +3496,73 @@ html.ui-theme-fade * {
3341
3496
  padding: 0;
3342
3497
  cursor: pointer;
3343
3498
  }
3344
- .ui-dt-sel > *,
3345
- .ui-dt-acts > * {
3346
- transition: opacity 0.12s ease;
3499
+ /* The checkbox column: 40 px, no border of its own (it belongs to the row, like the caret). The header's checkbox is
3500
+ always shown, so the column reads as a column of checkboxes; a row's shows when the row is hovered or has keyboard
3501
+ focus, and on every row once one is selected. */
3502
+ .ui-dt-cell.ui-dt-sel,
3503
+ .ui-dt-cell.ui-dt-exp {
3504
+ padding: 0;
3505
+ justify-content: center;
3506
+ border-right: 0;
3347
3507
  }
3348
- .ui-dt-sel > * {
3508
+ .ui-dt-body .ui-dt-sel > * {
3349
3509
  opacity: 0;
3510
+ transition: opacity 0.12s ease;
3350
3511
  }
3351
3512
  .ui-dt-row:hover .ui-dt-sel > *,
3352
3513
  .ui-dt-row:focus-within .ui-dt-sel > *,
3353
3514
  .ui-dt.has-sel .ui-dt-sel > * {
3354
3515
  opacity: 1;
3355
3516
  }
3356
- .ui-dt-acts {
3517
+ /* Row actions take no column: they are drawn over the row's right end while the row is hovered or has keyboard focus,
3518
+ on the row's own ground (zebra, hover, selected) with a short fade, so the text under them is covered cleanly. */
3519
+ .ui-dt-row.has-acts {
3520
+ position: relative;
3521
+ }
3522
+ .ui-dt-body .ui-dt-cell.ui-dt-acts {
3523
+ position: absolute;
3524
+ top: 0;
3525
+ right: 0;
3526
+ bottom: 0;
3357
3527
  justify-content: flex-end;
3358
3528
  gap: 2px;
3359
- padding: 0 8px;
3360
- }
3361
- .ui-dt-acts > * {
3529
+ padding: 0 var(--space-2) 0 var(--space-6);
3530
+ border-right: 0;
3531
+ background: linear-gradient(to right, transparent, var(--dt-row-bg) var(--space-6));
3362
3532
  opacity: 0;
3533
+ transition: opacity 0.12s ease;
3363
3534
  }
3364
- .ui-dt-row:hover .ui-dt-acts > *,
3365
- .ui-dt-row:focus-within .ui-dt-acts > * {
3535
+ .ui-dt-row:hover > .ui-dt-acts,
3536
+ .ui-dt-row:focus-within > .ui-dt-acts {
3366
3537
  opacity: 1;
3367
3538
  }
3539
+ /* IconButtons in a row are quiet whatever their variant: 32 px, no border, ink-muted until hovered. */
3540
+ .ui-dt-acts .ui-iconbtn {
3541
+ width: 32px;
3542
+ height: 32px;
3543
+ border: 0;
3544
+ border-radius: var(--radius-sm);
3545
+ color: var(--ink-muted);
3546
+ }
3547
+ .ui-dt-acts .ui-iconbtn:hover {
3548
+ color: var(--ink);
3549
+ background: color-mix(in srgb, var(--dt-row-bg), var(--ink) 8%);
3550
+ }
3551
+ /* Touch screens have no hover: the actions always show, and every row keeps their width free at its end. */
3368
3552
  @media (hover: none) {
3369
3553
  .ui-dt-sel > *,
3370
- .ui-dt-acts > *,
3554
+ .ui-dt-body .ui-dt-sel > *,
3371
3555
  .ui-dt-arrow {
3372
3556
  opacity: 1;
3373
3557
  }
3558
+ .ui-dt-body .ui-dt-cell.ui-dt-acts {
3559
+ opacity: 1;
3560
+ }
3561
+ }
3562
+ /* The last cell keeps the row actions' width (--dt-acts-w, measured) free at its end, in the header, the rows and the
3563
+ totals alike: the actions never cover a date or a number, and no empty column is drawn for them. */
3564
+ .ui-dt.has-acts .ui-dt-row > .ui-dt-cell.is-lastcol {
3565
+ padding-right: calc(12px + var(--dt-acts-w, 72px));
3374
3566
  }
3375
3567
  .ui-dt-bulk {
3376
3568
  display: flex;
@@ -3445,9 +3637,22 @@ html.ui-theme-fade * {
3445
3637
  cursor: default;
3446
3638
  }
3447
3639
 
3640
+ /* The summary tabs and the page's primary action (action) on one row, the action at its right end. */
3641
+ .ui-dt-top {
3642
+ display: flex;
3643
+ align-items: center;
3644
+ gap: var(--space-3);
3645
+ min-width: 0;
3646
+ }
3647
+ .ui-dt-primary {
3648
+ flex: none;
3649
+ margin-left: auto;
3650
+ display: flex;
3651
+ align-items: center;
3652
+ }
3448
3653
  .ui-dt-summary {
3449
- margin-bottom: var(--space-3);
3450
- align-self: flex-start;
3654
+ flex: 0 1 auto;
3655
+ min-width: 0;
3451
3656
  /* Wider than the table (phones): the row scrolls sideways, the edge with more tabs fades (Tabs), and it comes to rest
3452
3657
  on a whole tab rather than in the middle of a word. */
3453
3658
  scroll-snap-type: x mandatory;
@@ -3545,6 +3750,14 @@ html.ui-theme-fade * {
3545
3750
  width: auto;
3546
3751
  min-width: 0;
3547
3752
  }
3753
+ /* In a Card the cards' box is the Card itself: no second shadow, a line between the toolbar and the first row. */
3754
+ .ui-card .ui-dt-scroll {
3755
+ box-shadow: none;
3756
+ border-radius: 0;
3757
+ }
3758
+ .ui-card.is-flush > .ui-dt > .ui-dt-scroller > .ui-dt-scroll {
3759
+ border-top: 1px solid var(--line);
3760
+ }
3548
3761
  .ui-dt-head:not(.ui-dt-bulk) {
3549
3762
  display: none;
3550
3763
  }
@@ -3631,17 +3844,27 @@ html.ui-theme-fade * {
3631
3844
  .ui-dt-body .ui-dt-cell.is-m-hide {
3632
3845
  display: none;
3633
3846
  }
3847
+ /* Phone cards: the actions at the title row's end, always shown; the 32 px quiet buttons (48 px touch area) pull
3848
+ into the card's padding so they do not make the title row taller. */
3634
3849
  .ui-dt-body .ui-dt-cell.ui-dt-acts {
3850
+ position: static;
3635
3851
  grid-column: 4;
3636
3852
  grid-row: 1;
3637
3853
  display: flex;
3638
3854
  justify-content: flex-end;
3639
3855
  align-items: center;
3640
3856
  gap: 4px;
3641
- margin: 0 0 0 var(--space-2);
3857
+ width: auto;
3858
+ margin: -6px -8px -6px var(--space-1);
3859
+ padding: 0;
3860
+ background: none;
3861
+ opacity: 1;
3862
+ }
3863
+ .ui-dt.has-acts .ui-dt-row > .ui-dt-cell.is-lastcol {
3864
+ padding-right: 0;
3642
3865
  }
3643
3866
  .ui-dt-sel > *,
3644
- .ui-dt-acts > * {
3867
+ .ui-dt-body .ui-dt-sel > * {
3645
3868
  opacity: 1;
3646
3869
  }
3647
3870
  .ui-dt-body .ui-dt-cell.is-long > .ui-dt-long {
@@ -3651,9 +3874,9 @@ html.ui-theme-fade * {
3651
3874
  /* Equal widths while every tab fits; else each keeps its text whole and the row scrolls. */
3652
3875
  .ui-dt-summary {
3653
3876
  display: grid;
3877
+ flex: 1 1 auto;
3654
3878
  grid-auto-flow: column;
3655
3879
  grid-auto-columns: minmax(max-content, 1fr);
3656
- align-self: stretch;
3657
3880
  }
3658
3881
  }
3659
3882
  @media (max-width: 599px) {
@@ -3721,9 +3944,9 @@ html.ui-theme-fade * {
3721
3944
  background: var(--accent);
3722
3945
  }
3723
3946
  .ui-dt-view-n {
3724
- margin-left: 6px;
3725
- font-family: var(--font-mono);
3726
- font-size: var(--text-mini);
3947
+ margin-left: 2px;
3948
+ font-family: var(--font-sans);
3949
+ font-variant-numeric: tabular-nums;
3727
3950
  color: var(--ink-muted);
3728
3951
  font-weight: 400;
3729
3952
  }
@@ -4048,13 +4271,16 @@ html.ui-theme-fade * {
4048
4271
  .ui-card.is-flush > .ui-dt:first-child {
4049
4272
  padding-top: var(--space-4);
4050
4273
  }
4051
- .ui-card.is-flush > .ui-dt > :not(.ui-dt-scroller, .ui-dt-summary) {
4274
+ .ui-card.is-flush > .ui-dt > :not(.ui-dt-scroller) {
4052
4275
  padding-inline: var(--space-4);
4053
4276
  }
4054
- /* The summary tabs draw their own track: kept off the card's edges by a margin, not padded inside the track. */
4055
- .ui-card.is-flush > .ui-dt > .ui-dt-summary {
4056
- margin-inline: var(--space-4);
4057
- max-width: calc(100% - 2 * var(--space-4));
4277
+ /* Nothing under the table (no page numbers, no scroll hint): the last row ends at the card's edge, without an empty
4278
+ band and a second line under it. */
4279
+ .ui-card.is-flush > .ui-dt:not(:has(> .ui-dt-foot, > .ui-scroll-hint)) {
4280
+ padding-bottom: 0;
4281
+ }
4282
+ .ui-card.is-flush > .ui-dt:not(:has(> .ui-dt-foot, > .ui-scroll-hint)) > .ui-dt-scroller > .ui-dt-scroll {
4283
+ border-bottom: 0;
4058
4284
  }
4059
4285
  .ui-card.is-flush > .ui-dt .ui-dt-scroll {
4060
4286
  border-inline: 0;
@@ -4116,16 +4342,21 @@ html.ui-theme-fade * {
4116
4342
  min-width: 0;
4117
4343
  white-space: nowrap;
4118
4344
  }
4119
- /* The name keeps its room; the status gives way first, then the name is cut with 「…」. */
4345
+ /* The name keeps its room; the status gives way first, then the name is cut with 「…」, never below 3em. A name shorter
4346
+ than 3em keeps its own width: a 3em box would leave a gap before 「·」 (「web · production」). Browsers without
4347
+ calc-size() keep the 3em box. */
4120
4348
  .ui-projsw-name {
4121
4349
  flex: 0 1 auto;
4122
4350
  min-width: 3em;
4351
+ min-width: calc-size(max-content, min(size, 3em));
4123
4352
  overflow: hidden;
4124
4353
  text-overflow: ellipsis;
4125
4354
  }
4355
+ /* pre: the status starts with 「 · 」, and a flex item drops its leading space otherwise (「web· production」). */
4126
4356
  .ui-projsw-status {
4127
4357
  flex: 0 1000 auto;
4128
4358
  min-width: 0;
4359
+ white-space: pre;
4129
4360
  overflow: hidden;
4130
4361
  text-overflow: ellipsis;
4131
4362
  }
@@ -4598,94 +4829,6 @@ html.ui-theme-fade * {
4598
4829
  font-size: var(--text-compact);
4599
4830
  color: var(--ink-muted);
4600
4831
  }
4601
- /* Inline code */
4602
- .ui-code {
4603
- font-family: var(--font-mono);
4604
- font-size: 0.875em;
4605
- padding: 1px 5px;
4606
- border-radius: var(--radius-xs);
4607
- background: var(--surface-sub);
4608
- color: var(--ink);
4609
- overflow-wrap: anywhere;
4610
- }
4611
- /* In a table (DataTable rows and their details, Markdown tables) every other row is surface-sub, the same as the code
4612
- background, so code there is surface with a 1 px line border: it reads the same on both row colours and on the
4613
- hovered row. Inset shadow, not a border, so the size and line height do not change. */
4614
- :is(.ui-dt-body, .ui-dt-detail, .ui-md-table td) .ui-code {
4615
- background: var(--surface);
4616
- box-shadow: inset 0 0 0 1px var(--line);
4617
- }
4618
- .ui-code.is-short {
4619
- white-space: nowrap;
4620
- }
4621
- .ui-code.is-link {
4622
- border: 0;
4623
- color: var(--accent-text);
4624
- font-weight: inherit;
4625
- line-height: inherit;
4626
- text-decoration: underline;
4627
- text-underline-offset: 2px;
4628
- cursor: pointer;
4629
- }
4630
- .ui-code.is-link:hover {
4631
- text-decoration-thickness: 2px;
4632
- }
4633
- /* Dark: accent-text on the chip's surface-sub is 3.9:1; a quarter of ink brings it to 5:1 (at least 4.5:1 for 14 px text). */
4634
- [data-theme='dark'] .ui-code.is-link {
4635
- color: color-mix(in srgb, var(--accent-text), var(--ink) 25%);
4636
- }
4637
- /* A name (function, class, variable) and a location (file:line) that point somewhere: no chip, no underline until
4638
- hover or keyboard focus. Three classes so they win over the dark link colour and the table chip above. */
4639
- .ui-code.is-link.is-name,
4640
- .ui-code.is-link.is-location {
4641
- padding: 0;
4642
- background: none;
4643
- box-shadow: none;
4644
- text-decoration: none;
4645
- text-underline-offset: 3px;
4646
- text-decoration-thickness: 1px;
4647
- }
4648
- .ui-code.is-link.is-name {
4649
- color: var(--code-link-ink, var(--accent-text));
4650
- }
4651
- /* Dark: accent-text on a surface-sub table row is 3.9:1; a quarter of ink brings it above 4.5:1, as for the chip. */
4652
- [data-theme='dark'] :is(.ui-dt-body, .ui-dt-detail, .ui-md-table td) .ui-code.is-link:is(.is-name, .is-location) {
4653
- --code-link-ink: color-mix(in srgb, var(--accent-text), var(--ink) 25%);
4654
- }
4655
- /* One step smaller: the 13 px of secondary text. Never breaks inside. */
4656
- .ui-code.is-link.is-location {
4657
- color: var(--ink-muted);
4658
- font-size: var(--text-small);
4659
- white-space: nowrap;
4660
- }
4661
- .ui-code.is-link.is-name:is(:hover, :focus-visible),
4662
- .ui-code.is-link.is-location:is(:hover, :focus-visible) {
4663
- text-decoration: underline;
4664
- text-decoration-thickness: 1px;
4665
- }
4666
- .ui-code.is-link.is-location:is(:hover, :focus-visible) {
4667
- color: var(--code-link-ink, var(--accent-text));
4668
- }
4669
- .ui-code.is-link.is-name:focus-visible,
4670
- .ui-code.is-link.is-location:focus-visible {
4671
- border-radius: var(--radius-xs);
4672
- }
4673
- .ui-pal-detail .ui-code {
4674
- padding: 0;
4675
- background: transparent;
4676
- color: inherit;
4677
- }
4678
- .ui-sug-line .ui-code {
4679
- background: var(--surface);
4680
- }
4681
- .ui-md-table .ui-code {
4682
- white-space: normal;
4683
- overflow-wrap: break-word;
4684
- }
4685
- /* A command wraps at its spaces; a path or a name in code never breaks inside. */
4686
- .ui-md-table .ui-code.is-link {
4687
- white-space: nowrap;
4688
- }
4689
4832
  /* AiMark: a small gray 「AI 撰寫」 at the end of a sentence written by AI (A2), the same style as other source marks. */
4690
4833
  .ui-aimark {
4691
4834
  margin-left: 8px;
@@ -7435,6 +7578,34 @@ html.ui-theme-fade * {
7435
7578
  text-underline-offset: 2px;
7436
7579
  cursor: pointer;
7437
7580
  }
7581
+ /* A list item that is one link (a reference list): the link fills the row, so the whole row is clickable, with the
7582
+ hover ground of other rows. 32 px with a mouse, 48 px on touch screens. The marker stays outside the row, where the
7583
+ other items' markers are; the text starts where theirs does and the ground reaches 6 px to its left. */
7584
+ .ui-md li.ui-md-rowitem + li.ui-md-rowitem {
7585
+ margin-top: 2px;
7586
+ }
7587
+ .ui-md-link.is-row {
7588
+ display: flex;
7589
+ align-items: center;
7590
+ box-sizing: border-box;
7591
+ min-height: 32px;
7592
+ margin-left: -6px;
7593
+ padding: 3px 8px 3px 6px;
7594
+ border-radius: var(--radius-sm);
7595
+ text-align: left;
7596
+ transition: background-color var(--dur-hover) ease;
7597
+ }
7598
+ .ui-md-link.is-row:hover {
7599
+ background: var(--surface-sub);
7600
+ }
7601
+ button.ui-md-link.is-row {
7602
+ width: calc(100% + 6px);
7603
+ }
7604
+ @media (pointer: coarse) {
7605
+ .ui-md-link.is-row {
7606
+ min-height: var(--touch-target);
7607
+ }
7608
+ }
7438
7609
  .ui-md-table-wrap {
7439
7610
  max-width: 100%;
7440
7611
  overflow-x: auto;
@@ -8201,6 +8372,18 @@ html.ui-theme-fade * {
8201
8372
  .ui-wb-sheet > .ui-wb-split .ui-wb-split-line {
8202
8373
  display: none;
8203
8374
  }
8375
+ /* On touch screens the grip's touch area is 48 px tall: the 20 px grip plus a transparent area above it, over the
8376
+ bottom of the main view, so it never covers the panel's tab row below. */
8377
+ @media (pointer: coarse) {
8378
+ .ui-wb-sheet > .ui-wb-split.is-h::after {
8379
+ content: '';
8380
+ position: absolute;
8381
+ left: 0;
8382
+ right: 0;
8383
+ bottom: 0;
8384
+ height: var(--touch-target);
8385
+ }
8386
+ }
8204
8387
  .ui-wb-grab {
8205
8388
  flex: 0 0 20px;
8206
8389
  display: flex;
package/docs/Alert.md CHANGED
@@ -14,6 +14,7 @@
14
14
  - 只有 `info` 與 `success` 能關閉(傳 `onDismiss`);`warning` 與 `danger` 不能關閉。
15
15
  - 動作是右側的外框按鈕(`actionLabel`、`onAction`),文字只用動詞。
16
16
  - 本身就是卡片:單獨使用時不再包一層 Card;放進 Card 時自動拿掉陰影。
17
+ - 內容是字串時,反引號包住的文字顯示成行內程式碼(InlineCode),不顯示反引號。
17
18
 
18
19
  ## 細節
19
20
 
package/docs/Card.md CHANGED
@@ -12,13 +12,13 @@
12
12
 
13
13
  - 卡片裡不再放卡片。TreeList、KpiCard、Alert、SettingsSection 本身就有卡片樣式:單獨使用時直接當成區塊,不要再包一層;放進 Card 時會自動拿掉自己的陰影,TreeList 也拿掉底色。
14
14
  - 自己寫的區塊不要另外加陰影,改用 Card;卡片裡要再分區時用 `surface-sub` 底色或分隔線。
15
- - 卡片裡放表格時,標題寫在 Card 的 `title`,DataTable 不再給 `caption`,改給同樣文字的 `label`。
15
+ - 卡片裡放表格時,標題寫在 Card 的 `title`,DataTable 不再給 `caption`,改給同樣文字的 `label`。清單頁的主要操作(「新增」)給 DataTable 的 `action`,不放 Card 的 `actions`。
16
16
  - `padding={false}`:沒有內距,給整張卡片放表格或樹狀清單時用。
17
17
 
18
18
  ## 細節
19
19
 
20
- - `title` 和 `actions`:標題列,左邊標題,右邊按鈕。沒有 `title` 時按鈕一樣靠右(例如只有一個主要按鈕「新增」),左邊不留空位。
21
- - `padding: false` 時,標題列、DataTable 的工具列、頁碼和「向右捲動」提示仍留 16 px 左右內距,`summary` 分段控制左右各隔 16 px(外距,底色不碰到卡片邊緣),表格本身貼齊卡片左右兩邊(拿掉表格自己的左右框線與圓角)。
20
+ - `title` 和 `actions`:標題列,左邊標題,右邊按鈕。沒有 `title` 時按鈕一樣靠右,左邊不留空位。清單頁的「新增」不放這裡(一個按鈕單獨占一列):給 DataTable 的 `action`,放在工具列的右端。
21
+ - `padding: false` 時,標題列、DataTable 的工具列(含摘要)、頁碼和「向右捲動」提示仍留 16 px 左右內距,表格本身貼齊卡片左右兩邊(拿掉表格自己的左右框線與圓角)。表格下方沒有頁碼和提示時,最後一列直接到卡片底邊,不留空白,也不多一條底線。
22
22
  - DataTable 的 `label` 讓螢幕閱讀器念表格名稱,放大表格的對話框也用它當標題。`caption` 留給沒有包在 Card 裡、直接放在頁面上的表格。
23
23
 
24
24
  ```js
@@ -10,6 +10,7 @@
10
10
 
11
11
  - 左邊一句說明後果,右邊紅色實心按鈕。
12
12
  - `confirm` 是確認框的標題和說明,確認後才執行 `onAction`;沒給 `confirm` 時也先確認,標題是「<按鈕文字>?」。
13
+ - `description` 裡反引號包住的文字顯示成行內程式碼(InlineCode),不顯示反引號。
13
14
 
14
15
  ## 細節
15
16