@xihan-ui/styles 1.0.0-alpha.3 → 1.0.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 (96) hide show
  1. package/CHANGELOG.md +1730 -0
  2. package/css/accordion.css +25 -2
  3. package/css/alert.css +13 -9
  4. package/css/anchor.css +1 -1
  5. package/css/avatar-group.css +5 -1
  6. package/css/avatar.css +6 -0
  7. package/css/back-top.css +6 -0
  8. package/css/badge.css +94 -36
  9. package/css/breadcrumb.css +1 -1
  10. package/css/button-group.css +4 -0
  11. package/css/button.css +6 -0
  12. package/css/calendar.css +39 -13
  13. package/css/card.css +15 -6
  14. package/css/cascader.css +29 -23
  15. package/css/checkbox-group.css +38 -10
  16. package/css/checkbox.css +21 -10
  17. package/css/collapsible.css +7 -1
  18. package/css/color-picker.css +22 -2
  19. package/css/combobox.css +18 -7
  20. package/css/context-menu.css +17 -6
  21. package/css/date-field.css +2 -2
  22. package/css/date-picker.css +27 -17
  23. package/css/descriptions.css +9 -3
  24. package/css/dialog.css +7 -1
  25. package/css/drawer.css +15 -5
  26. package/css/dynamic-input.css +7 -0
  27. package/css/ellipsis.css +6 -0
  28. package/css/empty-state.css +16 -6
  29. package/css/field.css +7 -0
  30. package/css/file-upload.css +1 -1
  31. package/css/flex.css +13 -7
  32. package/css/float-button.css +7 -0
  33. package/css/floating-panel.css +6 -0
  34. package/css/grid.css +11 -5
  35. package/css/heatmap.css +3 -2
  36. package/css/highlight.css +1 -1
  37. package/css/hotkeys.css +1 -1
  38. package/css/hover-card.css +3 -0
  39. package/css/image-cropper.css +4 -2
  40. package/css/image-viewer.css +18 -5
  41. package/css/json-viewer.css +34 -1
  42. package/css/layout.css +15 -7
  43. package/css/list.css +14 -5
  44. package/css/listbox.css +4 -2
  45. package/css/loading-bar.css +5 -4
  46. package/css/log.css +6 -2
  47. package/css/masonry.css +5 -5
  48. package/css/mention.css +13 -3
  49. package/css/menu.css +16 -5
  50. package/css/menubar.css +14 -6
  51. package/css/navigation-menu.css +2 -2
  52. package/css/notification.css +377 -0
  53. package/css/number-field.css +9 -3
  54. package/css/page-header.css +7 -0
  55. package/css/pagination.css +158 -1
  56. package/css/password-input.css +4 -4
  57. package/css/pin-input.css +2 -2
  58. package/css/popconfirm.css +9 -2
  59. package/css/popover.css +3 -0
  60. package/css/popselect.css +24 -4
  61. package/css/progress.css +8 -2
  62. package/css/radio-group.css +17 -6
  63. package/css/rating.css +2 -2
  64. package/css/result.css +15 -5
  65. package/css/scrollbar.css +3 -0
  66. package/css/segmented.css +1 -1
  67. package/css/select.css +25 -7
  68. package/css/side-nav.css +16 -5
  69. package/css/slider.css +4 -2
  70. package/css/space.css +6 -6
  71. package/css/steps.css +6 -6
  72. package/css/switch.css +9 -2
  73. package/css/table.css +16 -8
  74. package/css/tabs.css +9 -1
  75. package/css/tag.css +3 -1
  76. package/css/tags-input.css +3 -3
  77. package/css/text-field.css +3 -3
  78. package/css/thread.css +10 -2
  79. package/css/time-field.css +2 -2
  80. package/css/time-picker.css +6 -6
  81. package/css/timeline.css +7 -7
  82. package/css/toast.css +103 -53
  83. package/css/toggle-group.css +30 -4
  84. package/css/toggle.css +6 -0
  85. package/css/tone.css +47 -17
  86. package/css/tooltip.css +7 -1
  87. package/css/tour.css +9 -3
  88. package/css/transfer.css +38 -12
  89. package/css/tree-select.css +30 -5
  90. package/css/tree.css +46 -4
  91. package/css/typography.css +1 -1
  92. package/css/undefined.css +1 -0
  93. package/index.css +1 -1
  94. package/index.unlayered.css +1746 -505
  95. package/package.json +3 -3
  96. package/css/toaster.css +0 -74
@@ -1,3 +1,30 @@
1
+ @layer xihan.motion {
2
+ /* 动画名的查找只认「文档里有没有这个名字」:引用别处文件里的名字,那份文件不一定在场,
3
+ 动画会静默地整个不跑。每份皮肤都能单独引入,所以它用到的关键帧都写在自己身上。 */
4
+ @keyframes xh-pop-in {
5
+ from {
6
+ opacity: 0;
7
+ scale: var(--xh-motion-scale-enter);
8
+ }
9
+
10
+ to {
11
+ opacity: 1;
12
+ scale: 1;
13
+ }
14
+ }
15
+ @keyframes xh-pop-out {
16
+ from {
17
+ opacity: 1;
18
+ scale: 1;
19
+ }
20
+
21
+ to {
22
+ opacity: 0;
23
+ scale: var(--xh-motion-scale-enter);
24
+ }
25
+ }
26
+ }
27
+
1
28
  @layer xihan.components {
2
29
  /* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
3
30
  [data-scope='pagination'] {
@@ -8,11 +35,14 @@
8
35
  页数为 0 时连接层会打 data-empty,这里不拿它做隐藏:作者常把「第 x-y 条」这类
9
36
  区间回显也写在 nav 里,整块藏掉会连那行字一起吞了,是否隐藏交给作者决定 */
10
37
  [data-scope='pagination'][data-part='root'] {
38
+ /* 作者塞进上一页/下一页的图标跟着字号走,与皮肤画的兜底字形同一把尺 */
39
+ --xh-icon-size: var(--xh-pagination-icon-size, var(--xh-glyph-size-text));
40
+
11
41
  /* 尺寸档只换这三个私有槽,上一页/下一页、页码与省略号都从 root 继承它们,
12
42
  换档不必给每个部件各写一条选择器 */
13
43
  --xh-_pagination-item-size: var(--xh-control-h-md);
14
44
  --xh-_pagination-item-px: var(--xh-control-px-md);
15
- --xh-_pagination-font-size: var(--xh-text-label-size);
45
+ --xh-_pagination-font-size: var(--xh-control-font-md);
16
46
 
17
47
  /* 当前页的选中态随语气走。没写 data-tone 时这几个 --xh-_tone-* 都没被声明,
18
48
  退回原来的品牌底与其配色。聚焦环不在其列,它恒是 --xh-ring-focus */
@@ -150,4 +180,131 @@
150
180
  cursor: default;
151
181
  pointer-events: none;
152
182
  }
183
+ /* 每页条数控制器:原生 select,抹掉系统外观后与页码格子共用同一副骨架。
184
+ 箭头用背景图而非伪元素——原生 select 不生成 ::before */
185
+ [data-scope='pagination'][data-part='page-size-select'] {
186
+ flex: none;
187
+ block-size: var(--xh-pagination-item-h, var(--xh-_pagination-item-size));
188
+ padding-inline: var(--xh-pagination-item-px, var(--xh-_pagination-item-px));
189
+ /* 右侧让开箭头 */
190
+ padding-inline-end: calc(
191
+ var(--xh-pagination-item-px, var(--xh-_pagination-item-px)) +
192
+ var(--xh-icon-size, var(--xh-glyph-size-text)) + var(--xh-space-1)
193
+ );
194
+ border: var(--xh-stroke-thin) solid var(--xh-pagination-page-size-border, var(--xh-border-default));
195
+ border-radius: var(--xh-pagination-item-radius, var(--xh-shape-control));
196
+ background: var(--xh-pagination-page-size-bg, var(--xh-bg-surface));
197
+ color: var(--xh-pagination-item-fg, var(--xh-fg-default));
198
+ font-size: var(--xh-pagination-font-size, var(--xh-_pagination-font-size));
199
+ line-height: var(--xh-leading-none);
200
+ appearance: none;
201
+ cursor: pointer;
202
+ }
203
+
204
+ [data-scope='pagination'][data-part='page-size-select']:hover:not(:disabled) {
205
+ border-color: var(--xh-pagination-page-size-border-hover, var(--xh-border-strong));
206
+ }
207
+
208
+ [data-scope='pagination'][data-part='page-size-select']:focus-visible {
209
+ outline: var(--xh-ring-width) solid var(--xh-ring-focus);
210
+ outline-offset: var(--xh-ring-offset);
211
+ }
212
+
213
+ [data-scope='pagination'][data-part='page-size-select']:disabled {
214
+ color: var(--xh-fg-disabled);
215
+ cursor: not-allowed;
216
+ }
217
+
218
+ /* 摊开省略位的定位层。三处坐标系必须同为 fixed:机器交给引擎的 strategy、
219
+ 连接层的内联 position、这里 —— 差一处就会算在错的坐标系里 */
220
+ [data-scope='pagination'][data-part='positioner'] {
221
+ /* 落定那一侧的可用高度,由定位引擎经内联自定义属性写进来,面板继承它限高;
222
+ 引擎没算(尚未落位 / 无引擎 / 贴边归零)时不额外限高 */
223
+ --xh-_pagination-available-h: 100vh;
224
+
225
+ /* 页码面板的自绘条浮在内容之上:轨道不上底色,实色轨道会在面板右缘糊一条竖灰带 */
226
+ --xh-scrollbar-track-bg: transparent;
227
+
228
+ position: fixed;
229
+ z-index: var(--xh-pagination-layer, var(--xh-layer-popover));
230
+ /* 空壳不吃指针:省略位与面板之间那段间隙要能点得穿 */
231
+ pointer-events: none;
232
+ }
233
+
234
+ /* 锚点被滚出可视区:整个浮层随之收起 */
235
+ [data-scope='pagination'][data-part='positioner'][data-hidden] {
236
+ visibility: hidden;
237
+ }
238
+
239
+ /* 摊开的页码面板:一串页码格子,横着排、必要时折行 */
240
+ [data-scope='pagination'][data-part='content'] {
241
+ /* 浮层被搬到 portal 落点,继承不到 root 上那把尺,这里再声明一遍 */
242
+ --xh-icon-size: var(--xh-pagination-icon-size, var(--xh-glyph-size-text));
243
+
244
+ display: flex;
245
+ flex-flow: row wrap;
246
+ gap: var(--xh-pagination-gap, var(--xh-space-1));
247
+ /* 页码不可预知有多少:不限高就整块伸出视口且滚不到 */
248
+ max-inline-size: var(--xh-pagination-content-max-w, var(--xh-overlay-max-w));
249
+ max-block-size: min(
250
+ var(--xh-pagination-content-max-h, var(--xh-overlay-max-h)),
251
+ var(--xh-_pagination-available-h)
252
+ );
253
+ overflow-y: auto;
254
+ padding: var(--xh-pagination-content-p, var(--xh-space-1));
255
+ border: var(--xh-stroke-thin) solid var(--xh-pagination-content-border, var(--xh-border-default));
256
+ border-radius: var(--xh-pagination-content-radius, var(--xh-shape-surface));
257
+ background: var(--xh-pagination-content-bg, var(--xh-bg-surface));
258
+ box-shadow: var(--xh-pagination-content-shadow, var(--xh-elevation-floating));
259
+ /* 定位层不吃指针,面板本体必须吃:里面的页码要点得到 */
260
+ pointer-events: auto;
261
+ }
262
+
263
+ [data-scope='pagination'][data-part='content'][data-state='open'] {
264
+ animation: xh-pop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
265
+ }
266
+
267
+ /* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
268
+ 免得动画结束到真收起之间闪一下原样 */
269
+ [data-scope='pagination'][data-part='content'][data-state='closed'] {
270
+ animation: xh-pop-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
271
+ }
272
+
273
+ /* 这里刻意没有 [data-part='content'][hidden] { display: none }:
274
+ 补了退场就一帧都播不出来,真正的收起由适配器落成内联 display */
275
+
276
+ /* 没写内容就由皮肤画兜底字形:上一页/下一页默认就是两枚箭头,
277
+ 作者往部件里塞了自己的图形或文字,这两条即不命中 */
278
+ [data-scope='pagination'][data-part='prev-trigger']:empty::before {
279
+ content: '';
280
+ display: inline-block;
281
+ inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
282
+ block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
283
+ vertical-align: var(--xh-glyph-baseline-shift);
284
+ background-color: currentColor;
285
+ -webkit-mask: var(--xh-glyph-mark-chevron-left) center / contain no-repeat;
286
+ mask: var(--xh-glyph-mark-chevron-left) center / contain no-repeat;
287
+ }
288
+
289
+ [data-scope='pagination'][data-part='next-trigger']:empty::before {
290
+ content: '';
291
+ display: inline-block;
292
+ inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
293
+ block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
294
+ vertical-align: var(--xh-glyph-baseline-shift);
295
+ background-color: currentColor;
296
+ -webkit-mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
297
+ mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
298
+ }
299
+
300
+ /* rtl 下页序从右往左走,箭头跟着指向行进方向 */
301
+ [dir='rtl'] [data-scope='pagination'][data-part='prev-trigger']:empty::before {
302
+ -webkit-mask-image: var(--xh-glyph-mark-chevron-right);
303
+ mask-image: var(--xh-glyph-mark-chevron-right);
304
+ }
305
+
306
+ [dir='rtl'] [data-scope='pagination'][data-part='next-trigger']:empty::before {
307
+ -webkit-mask-image: var(--xh-glyph-mark-chevron-left);
308
+ mask-image: var(--xh-glyph-mark-chevron-left);
309
+ }
153
310
  }
@@ -17,11 +17,11 @@
17
17
  --xh-_password-input-h: var(--xh-control-h-md);
18
18
  --xh-_password-input-px: var(--xh-control-px-md);
19
19
  --xh-_password-input-gap: var(--xh-control-gap-md);
20
- --xh-_password-input-font-size: var(--xh-text-body-size);
21
- --xh-_password-input-label-font-size: var(--xh-text-label-size);
20
+ --xh-_password-input-font-size: var(--xh-control-font-md);
21
+ --xh-_password-input-label-font-size: var(--xh-control-font-md);
22
22
  /* 提示与切换钮里的字形都比正文小一档,三个尺寸档各自换过,不是一个恒等的中转 */
23
- --xh-_password-input-hint-font-size: var(--xh-text-secondary-size);
24
- --xh-_password-input-trigger-font-size: var(--xh-text-secondary-size);
23
+ --xh-_password-input-hint-font-size: var(--xh-control-caption-md);
24
+ --xh-_password-input-trigger-font-size: var(--xh-control-caption-md);
25
25
 
26
26
  /* 盒子的圆角 */
27
27
  --xh-_password-input-radius: var(--xh-password-input-input-radius, var(--xh-shape-control));
package/css/pin-input.css CHANGED
@@ -8,9 +8,9 @@
8
8
  [data-scope='pin-input'][data-part='root'] {
9
9
  /* 尺寸档只换这四个私有槽,标题与格子都从 root 继承它们,换档不必给每个部件各写一条选择器 */
10
10
  --xh-_pin-input-box-size: var(--xh-control-box-md);
11
- --xh-_pin-input-box-gap: var(--xh-space-2);
11
+ --xh-_pin-input-box-gap: var(--xh-control-gap-md);
12
12
  --xh-_pin-input-box-font-size: var(--xh-text-heading-3-size);
13
- --xh-_pin-input-label-font-size: var(--xh-text-label-size);
13
+ --xh-_pin-input-label-font-size: var(--xh-control-font-md);
14
14
  /* 形态档只换这三个私有槽,缺省这一份就是描边式(描边 + 画布底) */
15
15
  --xh-_pin-input-box-bg: var(--xh-bg-canvas);
16
16
  --xh-_pin-input-box-border: var(--xh-border-control);
@@ -141,9 +141,9 @@
141
141
  align-items: center;
142
142
  justify-content: center;
143
143
  block-size: var(--xh-control-h-sm);
144
- padding-inline: var(--xh-control-px-sm);
144
+ padding-inline: var(--xh-popconfirm-cancel-trigger-px, var(--xh-control-px-sm));
145
145
  border: var(--xh-stroke-thin) solid transparent;
146
- border-radius: var(--xh-shape-control);
146
+ border-radius: var(--xh-popconfirm-action-radius, var(--xh-shape-control));
147
147
  font-size: var(--xh-text-secondary-size);
148
148
  font-weight: var(--xh-text-label-weight);
149
149
  line-height: var(--xh-leading-none);
@@ -227,4 +227,11 @@
227
227
  border-color: currentColor;
228
228
  animation: none;
229
229
  }
230
+
231
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
232
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
233
+ [data-scope='popconfirm'][data-part='root'][hidden],
234
+ [data-scope='popconfirm'][data-part='cancel-trigger'][hidden] {
235
+ display: none;
236
+ }
230
237
  }
package/css/popover.css CHANGED
@@ -38,6 +38,9 @@
38
38
  引擎没算(尚未落位 / 无引擎 / 贴边归零)时不额外限高 */
39
39
  --xh-_popover-available-h: 100vh;
40
40
 
41
+ /* 面板内容的自绘条浮在内容之上:轨道不上底色,实色轨道会在面板右缘糊一条竖灰带 */
42
+ --xh-scrollbar-track-bg: transparent;
43
+
41
44
  position: fixed;
42
45
  z-index: var(--xh-popover-layer, var(--xh-layer-popover));
43
46
  /* 空壳不吃指针,交互只发生在 content 上 */
package/css/popselect.css CHANGED
@@ -37,6 +37,9 @@
37
37
  引擎没算(尚未落位 / 无引擎 / 贴边归零)时退回自己那档静态上限 */
38
38
  --xh-_popselect-available-h: 100vh;
39
39
 
40
+ /* 候选列表的自绘条浮在内容之上:轨道不上底色,实色轨道会在列表右缘糊一条竖灰带 */
41
+ --xh-scrollbar-track-bg: transparent;
42
+
40
43
  position: fixed;
41
44
  z-index: var(--xh-popselect-layer, var(--xh-layer-popover));
42
45
  /* 空壳不吃指针,交互只发生在 content 上 */
@@ -53,8 +56,10 @@
53
56
  /* 尺寸档只换这四个私有槽,触发器与条目都从这两处继承它们,换档不必给每个部件各写一条选择器 */
54
57
  --xh-_popselect-h: var(--xh-control-h-md);
55
58
  --xh-_popselect-px: var(--xh-control-px-md);
59
+ --xh-_popselect-item-py: var(--xh-list-option-py-md);
60
+ --xh-_popselect-item-px: var(--xh-control-px-md);
56
61
  --xh-_popselect-gap: var(--xh-control-gap-md);
57
- --xh-_popselect-font-size: var(--xh-text-body-size);
62
+ --xh-_popselect-font-size: var(--xh-control-font-md);
58
63
 
59
64
  /* 形态档只换这三个槽:缺省即 outline(描边 + 画布底) */
60
65
  --xh-_popselect-control-bg: var(--xh-bg-canvas);
@@ -64,7 +69,7 @@
64
69
  /* 聚焦环恒用固定环色;强调色随语气走,只落在勾选标记与选中文字上,正文文字色不动。
65
70
  没写 data-tone 时 --xh-_tone 没被声明,两处都退回原来的取值 */
66
71
  --xh-_popselect-ring: var(--xh-ring-focus);
67
- --xh-_popselect-accent: var(--xh-_tone, var(--xh-bg-brand));
72
+ --xh-_popselect-accent: var(--xh-_tone, var(--xh-fg-brand));
68
73
  --xh-_popselect-item-selected-fg: var(--xh-_tone-fg, var(--xh-fg-brand-strong));
69
74
  }
70
75
 
@@ -91,6 +96,8 @@
91
96
  [data-scope='popselect']:is([data-part='root'], [data-part='positioner'])[data-size='sm'] {
92
97
  --xh-_popselect-h: var(--xh-control-h-sm);
93
98
  --xh-_popselect-px: var(--xh-control-px-sm);
99
+ --xh-_popselect-item-py: var(--xh-list-option-py-sm);
100
+ --xh-_popselect-item-px: var(--xh-control-px-sm);
94
101
  --xh-_popselect-gap: var(--xh-control-gap-sm);
95
102
  --xh-_popselect-font-size: var(--xh-control-font-sm);
96
103
  }
@@ -98,6 +105,8 @@
98
105
  [data-scope='popselect']:is([data-part='root'], [data-part='positioner'])[data-size='lg'] {
99
106
  --xh-_popselect-h: var(--xh-control-h-lg);
100
107
  --xh-_popselect-px: var(--xh-control-px-lg);
108
+ --xh-_popselect-item-py: var(--xh-list-option-py-lg);
109
+ --xh-_popselect-item-px: var(--xh-control-px-lg);
101
110
  --xh-_popselect-gap: var(--xh-control-gap-lg);
102
111
  --xh-_popselect-font-size: var(--xh-control-font-lg);
103
112
  }
@@ -245,6 +254,7 @@
245
254
  [data-scope='popselect'][data-part='content'] {
246
255
  display: flex;
247
256
  flex-direction: column;
257
+ gap: var(--xh-popselect-content-gap, var(--xh-list-option-gap));
248
258
  min-inline-size: var(--xh-popselect-content-min-w, var(--xh-overlay-menu-min-w));
249
259
  max-inline-size: var(--xh-popselect-content-max-w, var(--xh-overlay-max-w));
250
260
  max-block-size: min(var(--xh-popselect-content-max-h, var(--xh-overlay-menu-max-h)), var(--xh-_popselect-available-h));
@@ -290,8 +300,8 @@
290
300
  display: flex;
291
301
  align-items: center;
292
302
  gap: var(--xh-popselect-item-gap, var(--xh-_popselect-gap));
293
- padding-block: var(--xh-popselect-item-py, var(--xh-space-1_5));
294
- padding-inline: var(--xh-popselect-item-px, var(--xh-control-px-md));
303
+ padding-block: var(--xh-popselect-item-py, var(--xh-_popselect-item-py));
304
+ padding-inline: var(--xh-popselect-item-px, var(--xh-_popselect-item-px));
295
305
  border-radius: var(--xh-popselect-item-radius, var(--xh-shape-control));
296
306
  color: var(--xh-popselect-item-fg, var(--xh-fg-default));
297
307
  font-size: var(--xh-popselect-item-font-size, var(--xh-_popselect-font-size));
@@ -368,4 +378,14 @@
368
378
  [data-scope='popselect'][data-part='item-indicator'][data-state='checked'] {
369
379
  visibility: visible;
370
380
  }
381
+
382
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
383
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
384
+ [data-scope='popselect'][data-part='root'][hidden],
385
+ [data-scope='popselect'][data-part='control'][hidden],
386
+ [data-scope='popselect'][data-part='trigger'][hidden],
387
+ [data-scope='popselect'][data-part='item'][hidden],
388
+ [data-scope='popselect'][data-part='item-indicator'][hidden] {
389
+ display: none;
390
+ }
371
391
  }
package/css/progress.css CHANGED
@@ -31,7 +31,7 @@
31
31
  overflow: hidden;
32
32
  inline-size: 100%;
33
33
  block-size: var(--xh-_thickness);
34
- border-radius: var(--xh-shape-pill);
34
+ border-radius: var(--xh-progress-track-radius, var(--xh-shape-pill));
35
35
  background: var(--xh-progress-track, var(--xh-bg-subtle-active));
36
36
  }
37
37
 
@@ -39,7 +39,7 @@
39
39
  轨道不跟着换族:只有已完成的那段换色,底槽保持中性才读得出"完成了多少"。 */
40
40
  [data-scope='progress'][data-part='range'] {
41
41
  block-size: 100%;
42
- border-radius: var(--xh-shape-pill);
42
+ border-radius: var(--xh-progress-range-radius, var(--xh-shape-pill));
43
43
  background: var(--xh-progress-range, var(--xh-_tone, var(--xh-bg-brand)));
44
44
  transition: inline-size var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
45
45
  }
@@ -146,4 +146,10 @@
146
146
  visibility: hidden;
147
147
  }
148
148
 
149
+
150
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
151
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
152
+ [data-scope='progress'][data-part='root'][hidden] {
153
+ display: none;
154
+ }
149
155
  }
@@ -7,7 +7,8 @@
7
7
  [data-scope='radio-group'][data-part='root'] {
8
8
  /* 尺寸档只换这两个私有槽,标题与条目都从 root 继承它们,换档不必给每个部件各写一条选择器 */
9
9
  --xh-_radio-group-item-gap: var(--xh-control-gap-md);
10
- --xh-_radio-group-font-size: var(--xh-text-label-size);
10
+ --xh-_radio-group-font-size: var(--xh-control-font-md);
11
+ --xh-_radio-group-indicator: var(--xh-control-indicator-md);
11
12
  /* 选中色随语气走。没写 data-tone 时 --xh-_tone 没被声明,退回原来的品牌色 */
12
13
  --xh-_radio-group-accent: var(--xh-_tone, var(--xh-bg-brand));
13
14
 
@@ -28,11 +29,13 @@
28
29
  [data-scope='radio-group'][data-part='root'][data-size='sm'] {
29
30
  --xh-_radio-group-item-gap: var(--xh-control-gap-sm);
30
31
  --xh-_radio-group-font-size: var(--xh-control-font-sm);
32
+ --xh-_radio-group-indicator: var(--xh-control-indicator-sm);
31
33
  }
32
34
 
33
35
  [data-scope='radio-group'][data-part='root'][data-size='lg'] {
34
36
  --xh-_radio-group-item-gap: var(--xh-control-gap-lg);
35
37
  --xh-_radio-group-font-size: var(--xh-control-font-lg);
38
+ --xh-_radio-group-indicator: var(--xh-control-indicator-lg);
36
39
  }
37
40
 
38
41
  [data-scope='radio-group'][data-part='label'] {
@@ -71,10 +74,10 @@
71
74
  flex: none;
72
75
  align-items: center;
73
76
  justify-content: center;
74
- inline-size: var(--xh-radio-group-indicator-size, var(--xh-control-indicator-size));
75
- block-size: var(--xh-radio-group-indicator-size, var(--xh-control-indicator-size));
77
+ inline-size: var(--xh-radio-group-indicator-size, var(--xh-_radio-group-indicator));
78
+ block-size: var(--xh-radio-group-indicator-size, var(--xh-_radio-group-indicator));
76
79
  border: var(--xh-stroke-thin) solid var(--xh-radio-group-indicator-border, var(--xh-border-control));
77
- border-radius: var(--xh-shape-pill);
80
+ border-radius: var(--xh-radio-group-indicator-radius, var(--xh-shape-pill));
78
81
  background: var(--xh-radio-group-indicator-bg, var(--xh-bg-canvas));
79
82
  transition: border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
80
83
  }
@@ -93,8 +96,8 @@
93
96
  直径取指示器的一半:换尺寸档时圈与点一起走,比例不散 */
94
97
  [data-scope='radio-group'][data-part='indicator']::before {
95
98
  content: '';
96
- inline-size: calc(var(--xh-radio-group-indicator-size, var(--xh-control-indicator-size)) / 2);
97
- block-size: calc(var(--xh-radio-group-indicator-size, var(--xh-control-indicator-size)) / 2);
99
+ inline-size: calc(var(--xh-radio-group-indicator-size, var(--xh-_radio-group-indicator)) / 2);
100
+ block-size: calc(var(--xh-radio-group-indicator-size, var(--xh-_radio-group-indicator)) / 2);
98
101
  border-radius: var(--xh-shape-pill);
99
102
  background: var(--xh-radio-group-indicator-dot, var(--xh-_radio-group-accent));
100
103
  scale: 0;
@@ -109,4 +112,12 @@
109
112
  color: inherit;
110
113
  user-select: none;
111
114
  }
115
+
116
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
117
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
118
+ [data-scope='radio-group'][data-part='root'][hidden],
119
+ [data-scope='radio-group'][data-part='item'][hidden],
120
+ [data-scope='radio-group'][data-part='indicator'][hidden] {
121
+ display: none;
122
+ }
112
123
  }
package/css/rating.css CHANGED
@@ -8,9 +8,9 @@
8
8
  根上不留基准它就会贴到更外层的定位祖先上,原生校验提示跟着飘到页面别处。 */
9
9
  [data-scope='rating'][data-part='root'] {
10
10
  /* 尺寸档只换这三个私有槽,标题与星星都从 root 继承它们,换档不必给每个部件各写一条选择器 */
11
- --xh-_rating-item-gap: var(--xh-space-1);
11
+ --xh-_rating-item-gap: var(--xh-control-gap-md);
12
12
  --xh-_rating-item-size: var(--xh-font-size-2xl);
13
- --xh-_rating-font-size: var(--xh-text-label-size);
13
+ --xh-_rating-font-size: var(--xh-control-font-md);
14
14
  /* 点亮色随语气走。没写 data-tone 时 --xh-_tone 没被声明,退回原来的警示色 */
15
15
  --xh-_rating-accent: var(--xh-_tone, var(--xh-color-warning-500));
16
16
 
package/css/result.css CHANGED
@@ -8,7 +8,7 @@
8
8
  /* 三个尺寸档只换这几个私有槽,图标与标题都从 root 继承它们,
9
9
  换档不必给每个部件各写一条选择器 */
10
10
  --xh-_result-gap: var(--xh-stack-gap-md);
11
- --xh-_result-py: var(--xh-section-py);
11
+ --xh-_result-py: var(--xh-section-py-md);
12
12
  --xh-_result-icon-size: var(--xh-glyph-size-3xl);
13
13
  --xh-_result-title-size: var(--xh-text-heading-3-size);
14
14
  /* 说明的读行宽度:整句话不收窄就会拉成一条难读的长行 */
@@ -34,15 +34,15 @@
34
34
 
35
35
  /* —— 尺寸 —— */
36
36
  [data-scope='result'][data-part='root'][data-size='sm'] {
37
- --xh-_result-gap: var(--xh-space-3);
38
- --xh-_result-py: var(--xh-space-6);
37
+ --xh-_result-gap: var(--xh-stack-gap-sm);
38
+ --xh-_result-py: var(--xh-section-py-sm);
39
39
  --xh-_result-icon-size: var(--xh-glyph-size-2xl);
40
40
  --xh-_result-title-size: var(--xh-control-font-lg);
41
41
  }
42
42
 
43
43
  [data-scope='result'][data-part='root'][data-size='lg'] {
44
- --xh-_result-gap: var(--xh-space-6);
45
- --xh-_result-py: var(--xh-space-8);
44
+ --xh-_result-gap: var(--xh-stack-gap-lg);
45
+ --xh-_result-py: var(--xh-section-py-lg);
46
46
  --xh-_result-icon-size: var(--xh-glyph-size-4xl);
47
47
  --xh-_result-title-size: var(--xh-text-heading-2-size);
48
48
  }
@@ -75,6 +75,9 @@
75
75
  align-items: center;
76
76
  justify-content: center;
77
77
  flex: none;
78
+ /* 作者塞进图标槽的 XhIcon 与皮肤画的字形同一把尺,都按展示档的图标框量 */
79
+ --xh-icon-size: var(--xh-result-icon-size, var(--xh-_result-icon-size));
80
+
78
81
  block-size: var(--xh-result-icon-size, var(--xh-_result-icon-size));
79
82
  inline-size: var(--xh-result-icon-size, var(--xh-_result-icon-size));
80
83
  color: var(--xh-result-icon-fg, var(--xh-_result-accent));
@@ -106,4 +109,11 @@
106
109
  justify-content: center;
107
110
  gap: var(--xh-result-action-gap, var(--xh-space-2));
108
111
  }
112
+
113
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
114
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
115
+ [data-scope='result'][data-part='icon'][hidden],
116
+ [data-scope='result'][data-part='action'][hidden] {
117
+ display: none;
118
+ }
109
119
  }
package/css/scrollbar.css CHANGED
@@ -27,6 +27,9 @@
27
27
  --xh-_scrollbar-thickness: var(--xh-scrollbar-thickness-md);
28
28
 
29
29
  position: absolute;
30
+ /* 浮层的 positioner 一律 pointer-events: none,条子作为它的子节点会继承到,拖不动也点不着;
31
+ 收起态那条规则优先级更高,仍旧穿透 */
32
+ pointer-events: auto;
30
33
  /* touch-action 关掉浏览器自己的手势:不关的话手指一按滑块页面就跟着滚,
31
34
  指针随即被系统收走(pointercancel),拖到一半的滑块停在原地。
32
35
  user-select 同理——拖动时选中页面文字会让滑块"粘"住。 */
package/css/segmented.css CHANGED
@@ -11,7 +11,7 @@
11
11
  --xh-_segmented-h: var(--xh-control-h-md);
12
12
  --xh-_segmented-px: var(--xh-control-px-md);
13
13
  --xh-_segmented-gap: var(--xh-control-gap-md);
14
- --xh-_segmented-font-size: var(--xh-text-label-size);
14
+ --xh-_segmented-font-size: var(--xh-control-font-md);
15
15
  /* 指示器底色与选中段的文字色;没写 data-tone 时就是这里的取值 */
16
16
  --xh-_segmented-indicator-bg: var(--xh-bg-surface);
17
17
  --xh-_segmented-fg-selected: var(--xh-fg-default);
package/css/select.css CHANGED
@@ -54,9 +54,11 @@
54
54
  换档不必给每个部件各写一条选择器 */
55
55
  --xh-_select-h: var(--xh-control-h-md);
56
56
  --xh-_select-px: var(--xh-control-px-md);
57
+ --xh-_select-item-py: var(--xh-list-option-py-md);
58
+ --xh-_select-item-px: var(--xh-control-px-md);
57
59
  --xh-_select-gap: var(--xh-control-gap-md);
58
- --xh-_select-font-size: var(--xh-text-body-size);
59
- --xh-_select-label-font-size: var(--xh-text-label-size);
60
+ --xh-_select-font-size: var(--xh-control-font-md);
61
+ --xh-_select-label-font-size: var(--xh-control-font-md);
60
62
 
61
63
  /* 形态档只换这三个槽:缺省即 outline(描边 + 画布底) */
62
64
  --xh-_select-control-bg: var(--xh-bg-canvas);
@@ -66,7 +68,7 @@
66
68
  /* 聚焦环恒用固定环色;强调色随语气走,只落在勾选标记与选中文字上,正文文字色不动。
67
69
  没写 data-tone 时 --xh-_tone 没被声明,两处都退回原来的取值 */
68
70
  --xh-_select-ring: var(--xh-ring-focus);
69
- --xh-_select-accent: var(--xh-_tone, var(--xh-bg-brand));
71
+ --xh-_select-accent: var(--xh-_tone, var(--xh-fg-brand));
70
72
  --xh-_select-item-selected-fg: var(--xh-_tone-fg, var(--xh-fg-brand-strong));
71
73
  }
72
74
 
@@ -86,6 +88,8 @@
86
88
  [data-scope='select']:is([data-part='root'], [data-part='positioner'])[data-size='sm'] {
87
89
  --xh-_select-h: var(--xh-control-h-sm);
88
90
  --xh-_select-px: var(--xh-control-px-sm);
91
+ --xh-_select-item-py: var(--xh-list-option-py-sm);
92
+ --xh-_select-item-px: var(--xh-control-px-sm);
89
93
  --xh-_select-gap: var(--xh-control-gap-sm);
90
94
  --xh-_select-font-size: var(--xh-control-font-sm);
91
95
  --xh-_select-label-font-size: var(--xh-control-font-sm);
@@ -103,6 +107,8 @@
103
107
  [data-scope='select']:is([data-part='root'], [data-part='positioner'])[data-size='lg'] {
104
108
  --xh-_select-h: var(--xh-control-h-lg);
105
109
  --xh-_select-px: var(--xh-control-px-lg);
110
+ --xh-_select-item-py: var(--xh-list-option-py-lg);
111
+ --xh-_select-item-px: var(--xh-control-px-lg);
106
112
  --xh-_select-gap: var(--xh-control-gap-lg);
107
113
  --xh-_select-font-size: var(--xh-control-font-lg);
108
114
  --xh-_select-label-font-size: var(--xh-control-font-lg);
@@ -151,8 +157,6 @@
151
157
  block-size: var(--xh-select-control-h, var(--xh-_select-h));
152
158
  padding-inline: var(--xh-select-control-px, var(--xh-_select-px));
153
159
  min-inline-size: var(--xh-select-control-min-w, var(--xh-control-min-w));
154
- /* 多选会把 N 项的文本连成一串,框宽必须封顶;与浮层同一个上限,两半看着才是一件东西 */
155
- max-inline-size: var(--xh-select-control-max-w, var(--xh-overlay-max-w));
156
160
  border: var(--xh-stroke-thin) solid var(--xh-select-control-border, var(--xh-_select-control-border));
157
161
  border-radius: var(--xh-select-control-radius, var(--xh-shape-control));
158
162
  background: var(--xh-select-control-bg, var(--xh-_select-control-bg));
@@ -399,6 +403,7 @@
399
403
  display: flex;
400
404
  flex: 1 1 auto;
401
405
  flex-direction: column;
406
+ gap: var(--xh-select-list-gap, var(--xh-list-option-gap));
402
407
  min-block-size: 0;
403
408
  overflow-y: auto;
404
409
  }
@@ -453,8 +458,8 @@
453
458
  display: flex;
454
459
  align-items: center;
455
460
  gap: var(--xh-select-item-gap, var(--xh-_select-gap));
456
- padding-block: var(--xh-select-item-py, var(--xh-space-1_5));
457
- padding-inline: var(--xh-select-item-px, var(--xh-control-px-md));
461
+ padding-block: var(--xh-select-item-py, var(--xh-_select-item-py));
462
+ padding-inline: var(--xh-select-item-px, var(--xh-_select-item-px));
458
463
  border-radius: var(--xh-select-item-radius, var(--xh-shape-control));
459
464
  color: var(--xh-select-item-fg, var(--xh-fg-default));
460
465
  font-size: var(--xh-select-item-font-size, var(--xh-_select-font-size));
@@ -560,4 +565,17 @@
560
565
  -webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
561
566
  mask: var(--xh-glyph-mark-close) center / contain no-repeat;
562
567
  }
568
+
569
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
570
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
571
+ [data-scope='select'][data-part='root'][hidden],
572
+ [data-scope='select'][data-part='control'][hidden],
573
+ [data-scope='select'][data-part='trigger'][hidden],
574
+ [data-scope='select'][data-part='tag'][hidden],
575
+ [data-scope='select'][data-part='indicator'][hidden],
576
+ [data-scope='select'][data-part='list'][hidden],
577
+ [data-scope='select'][data-part='item'][hidden],
578
+ [data-scope='select'][data-part='item-indicator'][hidden] {
579
+ display: none;
580
+ }
563
581
  }
package/css/side-nav.css CHANGED
@@ -76,8 +76,8 @@
76
76
  }
77
77
 
78
78
  [data-scope='side-nav'][data-part='group-label'] {
79
- padding-block: var(--xh-space-1);
80
- padding-inline: var(--xh-control-px-md);
79
+ padding-block: var(--xh-side-nav-group-label-py, var(--xh-space-1));
80
+ padding-inline: var(--xh-side-nav-group-label-px, var(--xh-control-px-md));
81
81
  font-size: var(--xh-text-caption-size);
82
82
  color: var(--xh-fg-subtle);
83
83
  user-select: none;
@@ -107,12 +107,12 @@
107
107
  [data-scope='side-nav'][data-part='link'] {
108
108
  display: flex;
109
109
  align-items: center;
110
- gap: var(--xh-control-gap-md);
110
+ gap: var(--xh-side-nav-link-gap, var(--xh-control-gap-md));
111
111
  inline-size: 100%;
112
112
  min-block-size: var(--xh-control-h-md);
113
- padding-inline: var(--xh-control-px-md);
113
+ padding-inline: var(--xh-side-nav-link-px, var(--xh-control-px-md));
114
114
  border: none;
115
- border-radius: var(--xh-shape-control);
115
+ border-radius: var(--xh-side-nav-link-radius, var(--xh-shape-control));
116
116
  background: none;
117
117
  color: inherit;
118
118
  font-size: var(--xh-text-body-size);
@@ -257,4 +257,15 @@
257
257
  -webkit-mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
258
258
  mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
259
259
  }
260
+
261
+ /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
262
+ 写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
263
+ [data-scope='side-nav'][data-part='root'][hidden],
264
+ [data-scope='side-nav'][data-part='group'][hidden],
265
+ [data-scope='side-nav'][data-part='branch'][hidden],
266
+ [data-scope='side-nav'][data-part='item'][hidden],
267
+ [data-scope='side-nav'][data-part='link'][hidden],
268
+ [data-scope='side-nav'][data-part='branch-indicator'][hidden] {
269
+ display: none;
270
+ }
260
271
  }
package/css/slider.css CHANGED
@@ -132,7 +132,9 @@
132
132
  background: var(--xh-slider-thumb-bg, var(--xh-_tone, var(--xh-bg-brand)));
133
133
  box-shadow: var(--xh-slider-thumb-shadow, var(--xh-elevation-raised));
134
134
  cursor: grab;
135
- transition: scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
135
+ transition:
136
+ scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
137
+ box-shadow var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
136
138
  }
137
139
 
138
140
  /* 内联样式把 inset-inline-start 定在值所在的比例上,那是拇指的**起始边**不是圆心;
@@ -203,7 +205,7 @@
203
205
  inset-block-start: 50%;
204
206
  inline-size: var(--xh-slider-mark-size, var(--xh-space-1));
205
207
  block-size: var(--xh-slider-mark-size, var(--xh-space-1));
206
- border-radius: var(--xh-shape-pill);
208
+ border-radius: var(--xh-slider-mark-radius, var(--xh-shape-pill));
207
209
  background: var(--xh-slider-mark-bg, var(--xh-border-strong));
208
210
  translate: -50% -50%;
209
211
  }