@xihan-ui/styles 2.0.0 → 3.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.
- package/CHANGELOG.md +1328 -0
- package/README.md +6 -1
- package/component-tokens.d.ts +505 -111
- package/components.tokens.json +34750 -26291
- package/css/accordion.css +39 -13
- package/css/alert.css +61 -3
- package/css/anchor.css +49 -11
- package/css/approval.css +124 -84
- package/css/avatar-group.css +1 -1
- package/css/avatar.css +13 -5
- package/css/back-top.css +63 -44
- package/css/badge.css +63 -13
- package/css/bar-code.css +1 -1
- package/css/breadcrumb.css +63 -4
- package/css/button-group.css +5 -5
- package/css/button.css +69 -21
- package/css/calendar-picker.css +27 -8
- package/css/calendar-range-picker.css +48 -11
- package/css/card.css +116 -2
- package/css/carousel.css +153 -48
- package/css/cartesian-chart.css +830 -0
- package/css/cascader.css +184 -70
- package/css/checkbox-group.css +69 -99
- package/css/checkbox.css +21 -54
- package/css/citation.css +470 -0
- package/css/clipboard.css +23 -66
- package/css/code-view.css +103 -8
- package/css/collapsible.css +37 -11
- package/css/color-field.css +18 -0
- package/css/color-picker.css +57 -62
- package/css/color-slider.css +26 -19
- package/css/color-swatch-picker.css +8 -6
- package/css/combobox.css +82 -37
- package/css/command.css +48 -48
- package/css/context-menu.css +43 -28
- package/css/date-field.css +23 -0
- package/css/date-picker.css +57 -24
- package/css/date-range-picker.css +301 -14
- package/css/description.css +17 -1
- package/css/descriptions.css +43 -1
- package/css/dialog.css +99 -43
- package/css/diff-view.css +101 -16
- package/css/download-trigger.css +46 -80
- package/css/drawer.css +168 -133
- package/css/editable.css +19 -0
- package/css/empty-state.css +8 -7
- package/css/field-array.css +36 -0
- package/css/field.css +17 -19
- package/css/fieldset.css +1 -1
- package/css/file-upload.css +126 -136
- package/css/flex.css +324 -8
- package/css/float-button.css +168 -41
- package/css/floating-panel.css +59 -27
- package/css/form.css +26 -20
- package/css/funnel-chart.css +106 -0
- package/css/graph-chart.css +205 -0
- package/css/grid-list.css +235 -0
- package/css/grid.css +252 -1
- package/css/heatmap.css +119 -36
- package/css/hierarchy-chart.css +298 -0
- package/css/hover-card.css +33 -18
- package/css/icon.css +100 -0
- package/css/image-cropper.css +34 -8
- package/css/image-viewer.css +169 -26
- package/css/image.css +23 -4
- package/css/infinite-scroll.css +2 -2
- package/css/input-group.css +13 -15
- package/css/json-viewer.css +55 -7
- package/css/kbd.css +1 -1
- package/css/layout.css +71 -21
- package/css/liquid.css +106 -0
- package/css/list.css +2 -2
- package/css/listbox.css +72 -23
- package/css/loading-bar.css +27 -13
- package/css/log.css +131 -35
- package/css/markdown-stream.css +1 -1
- package/css/marquee.css +163 -7
- package/css/matrix-code.css +1 -1
- package/css/mention.css +35 -21
- package/css/menu.css +40 -28
- package/css/menubar.css +42 -28
- package/css/message-feed.css +174 -53
- package/css/navigation-menu.css +177 -18
- package/css/notification.css +431 -110
- package/css/number-field.css +22 -0
- package/css/page-header.css +4 -2
- package/css/pagination.css +129 -29
- package/css/password-input.css +40 -8
- package/css/pie-chart.css +247 -0
- package/css/popconfirm.css +50 -58
- package/css/popover.css +55 -21
- package/css/progress.css +308 -10
- package/css/prompt-input.css +37 -1
- package/css/question-flow.css +104 -64
- package/css/radar-chart.css +233 -0
- package/css/radio-group.css +372 -14
- package/css/rating.css +25 -27
- package/css/reasoning.css +62 -55
- package/css/reset.css +1 -1
- package/css/resizable.css +6 -1
- package/css/sankey-chart.css +174 -0
- package/css/scroll-area.css +32 -0
- package/css/scrollbar.css +1 -1
- package/css/select.css +76 -59
- package/css/side-nav.css +177 -30
- package/css/signature-pad.css +23 -8
- package/css/skeleton.css +13 -14
- package/css/slider.css +39 -17
- package/css/sortable.css +38 -8
- package/css/sparkline.css +164 -0
- package/css/spinner.css +50 -22
- package/css/splitter.css +8 -2
- package/css/statistic.css +10 -0
- package/css/steps.css +257 -38
- package/css/switch.css +30 -55
- package/css/table.css +168 -128
- package/css/tabs.css +243 -31
- package/css/tag-group.css +65 -37
- package/css/tag.css +55 -14
- package/css/tags-input.css +40 -3
- package/css/text-field.css +19 -0
- package/css/time-field.css +20 -1
- package/css/time-picker.css +44 -17
- package/css/time-range-picker.css +45 -18
- package/css/timeline.css +1 -1
- package/css/toggle-group.css +8 -8
- package/css/toggle.css +6 -5
- package/css/tool-call.css +64 -56
- package/css/toolbar.css +105 -7
- package/css/tooltip.css +18 -7
- package/css/tour.css +49 -21
- package/css/transfer.css +104 -81
- package/css/tree-select.css +235 -58
- package/css/tree.css +240 -147
- package/css/truncate.css +55 -12
- package/css/typography.css +93 -0
- package/css/virtualizer.css +57 -1
- package/css/watermark.css +23 -0
- package/family/action-control.css +14 -5
- package/family/chart.css +480 -0
- package/family/check-mark.css +94 -0
- package/family/choice-card.css +97 -0
- package/family/collection-item.css +70 -27
- package/family/field-chrome.css +1 -12
- package/family/loading-ring.css +95 -0
- package/family/material.css +72 -0
- package/family/menu-choice.css +56 -0
- package/family/motion.css +208 -11
- package/family/tag-list.css +59 -0
- package/index.css +23363 -14091
- package/index.unlayered.css +23198 -13922
- package/package.json +20 -8
- package/css/gradient-text.css +0 -91
- package/css/icon-wrapper.css +0 -81
- package/css/segmented.css +0 -280
- package/css/toast.css +0 -499
package/css/tree-select.css
CHANGED
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
@import '../family/field-chrome.css';
|
|
8
8
|
@import '../family/action-control.css';
|
|
9
9
|
@import '../family/collection-item.css';
|
|
10
|
+
@import '../family/loading-ring.css';
|
|
10
11
|
|
|
11
12
|
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立。 */
|
|
12
13
|
@import '../family/motion.css';
|
|
14
|
+
@import '../family/material.css';
|
|
15
|
+
@import '../family/tag-list.css';
|
|
13
16
|
|
|
14
17
|
@layer xihan.components {
|
|
15
18
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
@@ -25,8 +28,8 @@
|
|
|
25
28
|
/* 落定那一侧的可用宽度,同样由定位引擎经内联自定义属性写进来,行内轴据此夹取;
|
|
26
29
|
引擎没算(尚未落位 / 无引擎 / 贴边归零)时退到视口宽 */
|
|
27
30
|
--xh-_tree-select-available-w: 100vw;
|
|
28
|
-
/*
|
|
29
|
-
引擎没算(尚未落位 / 无引擎)时为 0
|
|
31
|
+
/* 字段盒实测宽度,由定位引擎经内联自定义属性写进来,内容层与它等宽;
|
|
32
|
+
引擎没算(尚未落位 / 无引擎)时为 0,面板取下界 */
|
|
30
33
|
--xh-_tree-select-anchor-w: 0px;
|
|
31
34
|
/* 独立浮层先截断祖先方向,再按自身 placement 开启一侧。 */
|
|
32
35
|
--xh-_overlay-enter-up: 0;
|
|
@@ -69,7 +72,7 @@
|
|
|
69
72
|
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner']) {
|
|
70
73
|
/* 作者塞进触发器指示符槽 / 清除钮的图标跟着尺寸档走,与皮肤画的兜底字形同一把尺。这支只管作者放进
|
|
71
74
|
盒与行里的图标:面板里自绘的状态字形(展开方向、行尾对号与半选杠)是指示符,各部件在自己身上
|
|
72
|
-
把 --xh-icon-size 改接到 --xh-control-indicator-*
|
|
75
|
+
把 --xh-icon-size 改接到 --xh-control-indicator-* 一族的盒尺 */
|
|
73
76
|
--xh-icon-size: var(--xh-tree-select-icon-size, var(--xh-glyph-size-md));
|
|
74
77
|
|
|
75
78
|
/* 尺寸档只换这几个私有槽,盒与树里的行都从这两处继承它们,换档不必给每个部件各写一条选择器;
|
|
@@ -216,6 +219,18 @@
|
|
|
216
219
|
color: var(--xh-fg-disabled);
|
|
217
220
|
}
|
|
218
221
|
|
|
222
|
+
/* 标签行:触发器里收着可见标签与 +N 那一枚的一行,行里每一枚都是 tag(data-scope="tag"),样子归 tag.css;
|
|
223
|
+
行怎么排、标签怎么进出归标签行家族配方(family/tag-list.css),这里只把使用者的间距槽接进去 */
|
|
224
|
+
[data-scope='tree-select'][data-part='tag-list'] {
|
|
225
|
+
--xh-tag-list-gap: var(--xh-tree-select-tag-list-gap, var(--xh-space-1));
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* 标签行露面时 value-text 让位:两者是触发器里的同一格,占位文字与标签不同屏。
|
|
229
|
+
value-text 留在 DOM 里,trigger 的可及名仍从它取到完整的选中项文本 */
|
|
230
|
+
[data-scope='tree-select'][data-part='trigger']:has([data-part='tag-list']:not([hidden])) [data-part='value-text'] {
|
|
231
|
+
display: none;
|
|
232
|
+
}
|
|
233
|
+
|
|
219
234
|
/* 有值时清空钮顶上来,箭头让位:两个图标并排堆着,用户分不清点哪个。
|
|
220
235
|
判据查的是盒里此刻真有一颗没收起的清空钮,不是「有没有值」——
|
|
221
236
|
作者没摆清空钮时箭头照常留着,不然让了位没人接,指示符整个消失 */
|
|
@@ -229,7 +244,7 @@
|
|
|
229
244
|
align-items: center;
|
|
230
245
|
justify-content: center;
|
|
231
246
|
color: var(--xh-tree-select-indicator-fg, var(--xh-fg-muted));
|
|
232
|
-
transition: rotate var(--xh-motion-duration-
|
|
247
|
+
transition: rotate var(--xh-motion-duration-nudge) var(--xh-motion-ease-enter-strong);
|
|
233
248
|
}
|
|
234
249
|
|
|
235
250
|
[data-scope='tree-select'][data-part='indicator'][hidden] {
|
|
@@ -275,45 +290,35 @@
|
|
|
275
290
|
}
|
|
276
291
|
|
|
277
292
|
[data-scope='tree-select'][data-part='content'] {
|
|
293
|
+
/* 材质由家族配方画(family/material.css 的 frosted 面:描边、底、1px 顶光、前景、投影与背景滤镜),
|
|
294
|
+
这里只把使用者槽接进来 */
|
|
295
|
+
--xh-frosted-bg: var(--xh-tree-select-content-bg, var(--xh-_material-bg));
|
|
296
|
+
--xh-frosted-border: var(--xh-tree-select-content-border, var(--xh-_material-border));
|
|
297
|
+
--xh-frosted-fg: var(--xh-tree-select-content-fg, var(--xh-_material-fg));
|
|
298
|
+
--xh-frosted-shadow: var(--xh-tree-select-content-shadow, var(--xh-_material-shadow));
|
|
299
|
+
--xh-frosted-backdrop: var(--xh-tree-select-content-backdrop, var(--xh-_material-backdrop));
|
|
300
|
+
--xh-frosted-highlight: var(--xh-tree-select-content-highlight, var(--xh-_material-highlight));
|
|
301
|
+
|
|
278
302
|
position: relative;
|
|
279
303
|
display: flex;
|
|
280
304
|
flex-direction: column;
|
|
281
|
-
/*
|
|
282
|
-
|
|
283
|
-
|
|
305
|
+
/* 列表型浮层与字段盒等宽:长选项在条目里截断,面板不随最长的一条变宽。锚点比下界还窄时取下界,
|
|
306
|
+
比可用区还宽时收成可用宽度;要封顶由作者另写上界槽 */
|
|
307
|
+
inline-size: min(
|
|
308
|
+
max(var(--xh-tree-select-content-min-w, var(--xh-overlay-menu-min-w)), var(--xh-_tree-select-anchor-w)),
|
|
284
309
|
var(--xh-_tree-select-available-w)
|
|
285
310
|
);
|
|
286
|
-
|
|
287
|
-
max-
|
|
288
|
-
max-block-size: min(var(--xh-tree-select-content-max-h, var(--xh-overlay-max-h)), var(--xh-_tree-select-available-h));
|
|
311
|
+
max-inline-size: var(--xh-tree-select-content-max-w, none);
|
|
312
|
+
max-block-size: min(var(--xh-tree-select-content-max-h, var(--xh-overlay-menu-max-h)), var(--xh-_tree-select-available-h));
|
|
289
313
|
padding-block: var(--xh-tree-select-content-py, var(--xh-space-1));
|
|
290
314
|
padding-inline: var(--xh-tree-select-content-px, var(--xh-space-1));
|
|
291
|
-
border: var(--xh-stroke-thin) solid var(--xh-tree-select-content-border, var(--xh-material-frosted-border));
|
|
292
315
|
border-radius: var(--xh-tree-select-content-radius, var(--xh-shape-overlay));
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
-webkit-backdrop-filter: var(--xh-tree-select-content-backdrop, var(--xh-material-frosted-backdrop));
|
|
297
|
-
backdrop-filter: var(--xh-tree-select-content-backdrop, var(--xh-material-frosted-backdrop));
|
|
298
|
-
/* 两轴一起给:深层节点靠缩进往行末推,横向溢出是常态,得够得着 */
|
|
299
|
-
overflow: auto;
|
|
300
|
-
/* 浮层滚动面:滚到头不把页面一起带走 */
|
|
301
|
-
overscroll-behavior: contain;
|
|
316
|
+
/* 面板只是外壳,滚动归树:搜索框与底部操作区因此钉在树的上下沿,不随行滚走。
|
|
317
|
+
行的悬停底色是方角,滚到两端时会探出外壳的圆角 */
|
|
318
|
+
overflow: hidden;
|
|
302
319
|
pointer-events: auto;
|
|
303
320
|
}
|
|
304
321
|
|
|
305
|
-
/* 顶光位于真实边框内侧,不参与布局或拦截树行操作。 */
|
|
306
|
-
[data-scope='tree-select'][data-part='content']::before {
|
|
307
|
-
content: '';
|
|
308
|
-
position: absolute;
|
|
309
|
-
inset-block-start: 0;
|
|
310
|
-
inset-inline: 0;
|
|
311
|
-
block-size: var(--xh-stroke-thin);
|
|
312
|
-
border-radius: inherit;
|
|
313
|
-
background: var(--xh-tree-select-content-highlight, var(--xh-material-frosted-highlight));
|
|
314
|
-
pointer-events: none;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
322
|
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 dialog 一致:
|
|
318
323
|
收起态连接层会给 content 打 hidden,而上面那条 display 正是要盖掉 UA 的
|
|
319
324
|
[hidden]{display:none}——退场动画得先能播。presence 读的是 content 的 animationName,
|
|
@@ -325,10 +330,9 @@
|
|
|
325
330
|
outline: none;
|
|
326
331
|
}
|
|
327
332
|
|
|
328
|
-
|
|
333
|
+
/* 挂载时就开着的那一段(data-instant)属于首帧,直接呈现 */
|
|
334
|
+
[data-scope='tree-select'][data-part='content'][data-state='open']:not([data-instant]) {
|
|
329
335
|
animation: xh-overlay-slide-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
330
|
-
/* 只在开着的这一档挂:合成层随 data-state 一起收走,收起后不再占着 */
|
|
331
|
-
will-change: opacity, translate;
|
|
332
336
|
}
|
|
333
337
|
|
|
334
338
|
/* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
|
|
@@ -337,17 +341,75 @@
|
|
|
337
341
|
animation: xh-overlay-slide-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
338
342
|
}
|
|
339
343
|
|
|
340
|
-
/*
|
|
344
|
+
/* 边框与底色归 content,树只管滚动并把行竖着排开。
|
|
345
|
+
两轴都滚:深层节点靠缩进往行末推,横向溢出是常态,得够得着。
|
|
346
|
+
min-block-size: 0 是弹性子项能真正滚动的前提——不给的话它按内容撑高,
|
|
347
|
+
外壳的 max-block-size 就只会把溢出的部分裁掉而不是交给它滚 */
|
|
341
348
|
[data-scope='tree-select'][data-part='tree'] {
|
|
342
349
|
display: flex;
|
|
350
|
+
flex: 1 1 auto;
|
|
343
351
|
flex-direction: column;
|
|
344
352
|
gap: var(--xh-tree-select-tree-gap, var(--xh-list-option-gap));
|
|
353
|
+
min-block-size: 0;
|
|
354
|
+
overflow: auto;
|
|
355
|
+
/* 浮层滚动面:滚到头不把页面一起带走 */
|
|
356
|
+
overscroll-behavior: contain;
|
|
357
|
+
transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* 刷新:已有节点时后台在取,保留上一帧,树按 micro 淡下,数据到了再淡回;在途占位此时让位 */
|
|
361
|
+
[data-scope='tree-select'][data-part='tree'][aria-busy='true'] {
|
|
362
|
+
opacity: var(--xh-state-disabled-opacity);
|
|
345
363
|
}
|
|
346
364
|
|
|
347
365
|
[data-scope='tree-select'][data-part='tree'][hidden] {
|
|
348
366
|
display: none;
|
|
349
367
|
}
|
|
350
368
|
|
|
369
|
+
/* 浮层内搜索框:排在树上方,框自己不画边不画底,只在底下画一道分隔线把它与树分开;边界归面板 */
|
|
370
|
+
/* 面板内嵌的搜索框:通栏一行,控件高与字号随尺寸档,只画一道面内分隔的下划线(取面材质的分隔令牌);
|
|
371
|
+
重置与占位前景由字段家族按 data-xh-field-input 给,占位与值文本的占位同一支组件槽 */
|
|
372
|
+
[data-scope='tree-select'][data-part='input'] {
|
|
373
|
+
--xh-field-placeholder-fg: var(--xh-tree-select-placeholder-fg, var(--xh-fg-subtle));
|
|
374
|
+
|
|
375
|
+
flex: none;
|
|
376
|
+
min-inline-size: 0;
|
|
377
|
+
block-size: var(--xh-tree-select-input-h, var(--xh-_tree-select-h));
|
|
378
|
+
margin-block-end: var(--xh-tree-select-input-gap, var(--xh-space-1));
|
|
379
|
+
padding-block: 0;
|
|
380
|
+
padding-inline: var(--xh-tree-select-input-px, var(--xh-_tree-select-px));
|
|
381
|
+
border: none;
|
|
382
|
+
border-block-end: var(--xh-stroke-thin) solid var(--xh-tree-select-search-divider, var(--xh-material-frosted-separator));
|
|
383
|
+
background: none;
|
|
384
|
+
color: inherit;
|
|
385
|
+
font-family: inherit;
|
|
386
|
+
font-size: var(--xh-tree-select-input-font-size, var(--xh-_tree-select-font-size));
|
|
387
|
+
line-height: var(--xh-leading-normal);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/* 聚焦不画环:插入符就是焦点指示。框没有外壳,全局那圈键盘焦点环只会压在通栏一行上 */
|
|
391
|
+
[data-scope='tree-select'][data-part='input']:focus-visible {
|
|
392
|
+
outline: none;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
[data-scope='tree-select'][data-part='input'][hidden] {
|
|
396
|
+
display: none;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* 自动填充:引擎给填过的框强加一套系统色,盖得过 background 与 color。
|
|
400
|
+
底改用 inset 阴影铺回来,字改用 -webkit-text-fill-color 接回来;
|
|
401
|
+
两个选择器名分写两条,一条列表里只要有一个名字不被认识整条就被丢弃。
|
|
402
|
+
搜索框排在浮层面里,铺的底取浮起面而不是页面底 */
|
|
403
|
+
[data-scope='tree-select'][data-part='input']:autofill {
|
|
404
|
+
box-shadow: inset 0 0 0 100vmax var(--xh-tree-select-input-autofill-bg, var(--xh-bg-surface));
|
|
405
|
+
-webkit-text-fill-color: var(--xh-tree-select-input-autofill-fg, var(--xh-fg-default));
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
[data-scope='tree-select'][data-part='input']:-webkit-autofill {
|
|
409
|
+
box-shadow: inset 0 0 0 100vmax var(--xh-tree-select-input-autofill-bg, var(--xh-bg-surface));
|
|
410
|
+
-webkit-text-fill-color: var(--xh-tree-select-input-autofill-fg, var(--xh-fg-default));
|
|
411
|
+
}
|
|
412
|
+
|
|
351
413
|
/* 空态占位:待在 content 里、tree 的兄弟(role=tree 只许拥有 treeitem 与 group)。
|
|
352
414
|
盒与阴影归 content,这里只画一句居中的次要文字 */
|
|
353
415
|
[data-scope='tree-select'][data-part='empty'] {
|
|
@@ -368,7 +430,10 @@
|
|
|
368
430
|
|
|
369
431
|
/* 在途占位:与空态占位同一个位置、同一副观感,两者不同屏 */
|
|
370
432
|
[data-scope='tree-select'][data-part='loading'] {
|
|
371
|
-
display:
|
|
433
|
+
display: flex;
|
|
434
|
+
align-items: center;
|
|
435
|
+
justify-content: center;
|
|
436
|
+
gap: var(--xh-_tree-select-gap);
|
|
372
437
|
flex: none;
|
|
373
438
|
padding-block: var(--xh-tree-select-loading-py, var(--xh-space-3));
|
|
374
439
|
padding-inline: var(--xh-tree-select-loading-px, var(--xh-_tree-select-row-px));
|
|
@@ -382,6 +447,15 @@
|
|
|
382
447
|
display: none;
|
|
383
448
|
}
|
|
384
449
|
|
|
450
|
+
/* 首次加载:文案前一枚加载环,由加载环配方画(连接层投影 data-xh-loading-ring 与 data-loading),
|
|
451
|
+
直径取所在尺寸档的图标档 */
|
|
452
|
+
[data-scope='tree-select'][data-part='loading']::before {
|
|
453
|
+
content: '';
|
|
454
|
+
flex: none;
|
|
455
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
456
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
457
|
+
}
|
|
458
|
+
|
|
385
459
|
/* 浮层底部的操作区:排在树下面,与树之间用一条分隔线断开;不参与收缩,行再多也压不扁它 */
|
|
386
460
|
[data-scope='tree-select'][data-part='footer'] {
|
|
387
461
|
display: flex;
|
|
@@ -434,7 +508,7 @@
|
|
|
434
508
|
--xh-collection-inline-padding: var(--xh-tree-select-item-px, var(--xh-_tree-select-row-px));
|
|
435
509
|
--xh-collection-gap: var(--xh-tree-select-item-gap, var(--xh-_tree-select-gap));
|
|
436
510
|
--xh-collection-font-size: var(--xh-tree-select-item-font-size, var(--xh-_tree-select-font-size));
|
|
437
|
-
--xh-collection-radius: var(--xh-tree-select-item-radius, var(--xh-shape-
|
|
511
|
+
--xh-collection-radius: var(--xh-tree-select-item-radius, var(--xh-shape-inset));
|
|
438
512
|
--xh-collection-glyph-size: var(--xh-tree-select-icon-size, var(--xh-_collection-glyph-size));
|
|
439
513
|
--xh-collection-fg-rest: var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg));
|
|
440
514
|
--xh-collection-fg-hover: var(--xh-tree-select-item-fg, var(--xh-material-frosted-fg));
|
|
@@ -552,7 +626,7 @@
|
|
|
552
626
|
/* 勾选标记落在家族网格的 indicator 列;未选中时占位不塌,切换选中不引起行宽抖动。
|
|
553
627
|
尺寸槽按各自部件取名:行内的勾与展开箭头分别是 item- 与 branch- 段,
|
|
554
628
|
触发器上那枚箭头是 --xh-tree-select-indicator-*,三处各调各的。
|
|
555
|
-
盒里的对号 /
|
|
629
|
+
盒里的对号 / 半选杠是指示符:在自己身上把 --xh-icon-size 改接到盒的尺,兜底字形与作者
|
|
556
630
|
塞进盒里的 XhIcon 读同一把尺、与盒同边长;不读家族按档下发到行的 --xh-icon-size——那支只管
|
|
557
631
|
作者放进行里的图标,按图标档取的 20px 会比 16 / 14 的盒还大 */
|
|
558
632
|
[data-scope='tree-select'][data-part='item-indicator'] {
|
|
@@ -572,7 +646,7 @@
|
|
|
572
646
|
/* 家族只按行的 aria-selected 显示对号:分支行的 aria-selected 在 branch 上、半选没有选中语义,
|
|
573
647
|
这两档按标记自身的 data-selected / data-indeterminate 显形 */
|
|
574
648
|
[data-scope='tree-select'][data-part='item-indicator']:is([data-selected], [data-indeterminate]) {
|
|
575
|
-
|
|
649
|
+
opacity: 1;
|
|
576
650
|
}
|
|
577
651
|
|
|
578
652
|
/* 分支行的禁用不在行的 aria-disabled 上(那在 branch 上),标记按自身的 data-disabled 降级 */
|
|
@@ -582,7 +656,7 @@
|
|
|
582
656
|
|
|
583
657
|
/* 展开箭头与方向指示符:两者都可能被作者用作「点这里展开」的把手,
|
|
584
658
|
所以尺寸与叶子的勾选标记一致,两种行的文字起点才对得齐。
|
|
585
|
-
盒里的 chevron
|
|
659
|
+
盒里的 chevron 是指示符:与盒同边长,--xh-icon-size 在自己身上改接到盒的尺 */
|
|
586
660
|
[data-scope='tree-select'][data-part='branch-trigger'],
|
|
587
661
|
[data-scope='tree-select'][data-part='branch-indicator'] {
|
|
588
662
|
--xh-icon-size: var(--xh-tree-select-branch-indicator-size, var(--xh-control-indicator-size));
|
|
@@ -593,7 +667,7 @@
|
|
|
593
667
|
justify-content: center;
|
|
594
668
|
inline-size: var(--xh-tree-select-branch-indicator-size, var(--xh-control-indicator-size));
|
|
595
669
|
color: var(--xh-tree-select-branch-indicator-fg, var(--xh-fg-subtle));
|
|
596
|
-
transition: rotate var(--xh-motion-duration-
|
|
670
|
+
transition: rotate var(--xh-motion-duration-nudge) var(--xh-motion-ease-enter-strong);
|
|
597
671
|
}
|
|
598
672
|
|
|
599
673
|
[data-scope='tree-select'][data-part='branch-trigger'][hidden],
|
|
@@ -601,20 +675,15 @@
|
|
|
601
675
|
display: none;
|
|
602
676
|
}
|
|
603
677
|
|
|
604
|
-
/*
|
|
605
|
-
rtl
|
|
606
|
-
[data-scope='tree-select'][data-part='branch-trigger']
|
|
607
|
-
[data-scope='tree-select'][data-part='branch-indicator']
|
|
608
|
-
rotate: 90deg;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
[dir='rtl'] [data-scope='tree-select'][data-part='branch-trigger'],
|
|
612
|
-
[dir='rtl'] [data-scope='tree-select'][data-part='branch-indicator'] {
|
|
613
|
-
rotate: 180deg;
|
|
678
|
+
/* 收起时指向行尾、展开时转向下方,与逻辑书写方向一致:rtl 下行尾在左侧,收起的箭头转半圈;
|
|
679
|
+
旋转角乘书写方向的符号(ltr 0deg、rtl 180deg),按就近的 dir 走 */
|
|
680
|
+
[data-scope='tree-select'][data-part='branch-trigger'],
|
|
681
|
+
[data-scope='tree-select'][data-part='branch-indicator'] {
|
|
682
|
+
rotate: calc(90deg - 90deg * var(--xh-direction-sign));
|
|
614
683
|
}
|
|
615
684
|
|
|
616
|
-
[
|
|
617
|
-
[
|
|
685
|
+
[data-scope='tree-select'][data-part='branch-trigger'][data-state='open'],
|
|
686
|
+
[data-scope='tree-select'][data-part='branch-indicator'][data-state='open'] {
|
|
618
687
|
rotate: 90deg;
|
|
619
688
|
}
|
|
620
689
|
|
|
@@ -632,6 +701,69 @@
|
|
|
632
701
|
padding-inline-start: var(--xh-tree-select-indent, var(--xh-space-4));
|
|
633
702
|
}
|
|
634
703
|
|
|
704
|
+
/* 分支首次展开取子项时的三种占位落在子层的位置(与子层同一缩进),与整树的占位同一副样子:
|
|
705
|
+
在途一枚加载环 + 文案、成功为空一句文案、失败一枚警示字形 + 说明。它们不是 treeitem,不接悬停与按下 */
|
|
706
|
+
[data-scope='tree-select']:is([data-part='branch-loading'], [data-part='branch-empty'], [data-part='branch-error']) {
|
|
707
|
+
display: flex;
|
|
708
|
+
align-items: center;
|
|
709
|
+
gap: var(--xh-_tree-select-gap);
|
|
710
|
+
padding-block: var(--xh-tree-select-branch-status-py, var(--xh-_tree-select-row-py));
|
|
711
|
+
padding-inline: calc(var(--xh-tree-select-indent, var(--xh-space-4)) + var(--xh-_tree-select-row-px)) var(--xh-_tree-select-row-px);
|
|
712
|
+
color: var(--xh-tree-select-branch-status-fg, var(--xh-material-frosted-fg-muted));
|
|
713
|
+
font-size: var(--xh-tree-select-branch-status-font-size, var(--xh-_tree-select-font-size));
|
|
714
|
+
line-height: var(--xh-leading-none);
|
|
715
|
+
user-select: none;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
[data-scope='tree-select'][data-part='branch-loading']::before {
|
|
719
|
+
content: '';
|
|
720
|
+
flex: none;
|
|
721
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
722
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/* 失败的非颜色通道:一枚警示字形,取危险色 */
|
|
726
|
+
[data-scope='tree-select'][data-part='branch-error']::before {
|
|
727
|
+
content: '';
|
|
728
|
+
flex: none;
|
|
729
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
730
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
731
|
+
background-color: var(--xh-tree-select-branch-error-fg, var(--xh-fg-danger));
|
|
732
|
+
-webkit-mask: var(--xh-glyph-mark-warning) center / contain no-repeat;
|
|
733
|
+
mask: var(--xh-glyph-mark-warning) center / contain no-repeat;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/* 重试钮排在失败说明之下、与说明同一缩进;指针入口,键盘在出错的分支行上按 Enter / Space 重试 */
|
|
737
|
+
[data-scope='tree-select'][data-part='branch-retry-trigger'] {
|
|
738
|
+
align-self: flex-start;
|
|
739
|
+
margin-inline-start: calc(var(--xh-tree-select-indent, var(--xh-space-4)) + var(--xh-_tree-select-row-px));
|
|
740
|
+
padding: 0;
|
|
741
|
+
border: 0;
|
|
742
|
+
background: none;
|
|
743
|
+
color: var(--xh-tree-select-branch-retry-fg, var(--xh-fg-brand));
|
|
744
|
+
font: inherit;
|
|
745
|
+
font-size: var(--xh-tree-select-branch-status-font-size, var(--xh-_tree-select-font-size));
|
|
746
|
+
line-height: var(--xh-leading-normal);
|
|
747
|
+
text-decoration-line: underline;
|
|
748
|
+
text-decoration-color: transparent;
|
|
749
|
+
text-underline-offset: var(--xh-space-0_5);
|
|
750
|
+
cursor: pointer;
|
|
751
|
+
transition: text-decoration-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
[data-scope='tree-select'][data-part='branch-retry-trigger']:hover {
|
|
755
|
+
text-decoration-color: currentColor;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
[data-scope='tree-select'][data-part='branch-retry-trigger']:disabled {
|
|
759
|
+
color: var(--xh-fg-disabled);
|
|
760
|
+
cursor: not-allowed;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
[data-scope='tree-select']:is([data-part='branch-loading'], [data-part='branch-empty'], [data-part='branch-error'], [data-part='branch-retry-trigger'])[hidden] {
|
|
764
|
+
display: none;
|
|
765
|
+
}
|
|
766
|
+
|
|
635
767
|
/* 收起态的唯一开关:display 盖掉了 UA 的 [hidden]{display:none},漏了这条整棵子树就收不起来 */
|
|
636
768
|
[data-scope='tree-select'][data-part='branch-content'][hidden],
|
|
637
769
|
[data-scope='tree-select'][data-part='branch-content'][data-state='closed'] {
|
|
@@ -652,6 +784,8 @@
|
|
|
652
784
|
mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
653
785
|
}
|
|
654
786
|
|
|
787
|
+
/* 勾与半选杠叠成两层遮罩,按状态只换两层的尺寸:离开半选淡出的那一段里横杠留着,
|
|
788
|
+
淡出播完才换回勾——不在淡出途中闪出一枚勾 */
|
|
655
789
|
[data-scope='tree-select'][data-part='item-indicator']:empty::before {
|
|
656
790
|
content: '';
|
|
657
791
|
display: inline-block;
|
|
@@ -659,13 +793,21 @@
|
|
|
659
793
|
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
660
794
|
vertical-align: var(--xh-glyph-baseline-shift);
|
|
661
795
|
background-color: currentColor;
|
|
662
|
-
-webkit-mask: var(--xh-glyph-mark-check) center /
|
|
663
|
-
mask: var(--xh-glyph-mark-check) center /
|
|
796
|
+
-webkit-mask: var(--xh-glyph-mark-check) center / 100% 100% no-repeat, var(--xh-glyph-mark-minus) center / 0 0 no-repeat;
|
|
797
|
+
mask: var(--xh-glyph-mark-check) center / 100% 100% no-repeat, var(--xh-glyph-mark-minus) center / 0 0 no-repeat;
|
|
798
|
+
transition:
|
|
799
|
+
-webkit-mask-size 0s var(--xh-motion-duration-micro),
|
|
800
|
+
mask-size 0s var(--xh-motion-duration-micro);
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
[data-scope='tree-select'][data-part='item-indicator'][data-selected]:empty::before {
|
|
804
|
+
transition-delay: 0s;
|
|
664
805
|
}
|
|
665
806
|
|
|
666
807
|
[data-scope='tree-select'][data-part='item-indicator'][data-indeterminate]:not([data-selected]):empty::before {
|
|
667
|
-
-webkit-mask-
|
|
668
|
-
mask-
|
|
808
|
+
-webkit-mask-size: 0 0, 100% 100%;
|
|
809
|
+
mask-size: 0 0, 100% 100%;
|
|
810
|
+
transition-delay: 0s;
|
|
669
811
|
}
|
|
670
812
|
|
|
671
813
|
[data-scope='tree-select'][data-part='branch-trigger']:empty::before,
|
|
@@ -698,4 +840,39 @@
|
|
|
698
840
|
display: none;
|
|
699
841
|
}
|
|
700
842
|
}
|
|
843
|
+
|
|
844
|
+
@media (forced-colors: active) {
|
|
845
|
+
/* 兜底字形是 mask 挖出来的一块底色,这一档里底色被系统换成 Canvas,字形跟着消失。
|
|
846
|
+
字形退出强制换色、直接写系统色(不能取 currentColor:退出强制换色的伪元素读到的是被系统换掉之前的作者色):
|
|
847
|
+
按钮面上取 ButtonText,悬停与按下时家族把按钮涂成 Highlight、字形换 HighlightText;
|
|
848
|
+
条目面上取 CanvasText;按下与没被高亮时的悬停,家族把条目涂成 Highlight,字形换 HighlightText;
|
|
849
|
+
字段面上取 CanvasText;
|
|
850
|
+
落在 Canvas 面上的取 CanvasText;
|
|
851
|
+
禁用取 GrayText */
|
|
852
|
+
[data-scope='tree-select'][data-part='branch-error']::before,
|
|
853
|
+
[data-scope='tree-select'][data-part='indicator']:empty::before,
|
|
854
|
+
[data-scope='tree-select'][data-part='item-indicator']:empty::before,
|
|
855
|
+
[data-scope='tree-select']:is([data-part='branch-trigger'], [data-part='branch-indicator']):empty::before {
|
|
856
|
+
forced-color-adjust: none;
|
|
857
|
+
background-color: CanvasText;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
[data-scope='tree-select'][data-part='clear-trigger']:empty::before {
|
|
861
|
+
forced-color-adjust: none;
|
|
862
|
+
background-color: ButtonText;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
[data-scope='tree-select'][data-part='item']:not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error]):is(:active, [data-pressed], :hover:not(:focus-visible, [data-highlighted])) [data-scope='tree-select'][data-part='item-indicator']:empty::before,
|
|
866
|
+
[data-scope='tree-select'][data-part='branch-control']:not([aria-disabled='true'], [data-disabled], [aria-busy='true'], [data-error]):is(:active, [data-pressed], :hover:not(:focus-visible, [data-highlighted])) [data-scope='tree-select']:is([data-part='branch-trigger'], [data-part='branch-indicator']):empty::before,
|
|
867
|
+
[data-scope='tree-select'][data-part='clear-trigger']:not([data-disabled]):not([data-loading]):is(:hover, :active, [data-pressed]):empty::before {
|
|
868
|
+
background-color: HighlightText;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
[data-scope='tree-select'][data-part='control'][data-disabled] [data-scope='tree-select'][data-part='indicator']:empty::before,
|
|
872
|
+
[data-scope='tree-select'][data-part='item']:is([aria-disabled='true'], [data-disabled]) [data-scope='tree-select'][data-part='item-indicator']:empty::before,
|
|
873
|
+
[data-scope='tree-select'][data-part='branch-control']:is([aria-disabled='true'], [data-disabled]) [data-scope='tree-select']:is([data-part='branch-trigger'], [data-part='branch-indicator']):empty::before,
|
|
874
|
+
[data-scope='tree-select'][data-part='clear-trigger'][data-disabled]:empty::before {
|
|
875
|
+
background-color: GrayText;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
701
878
|
}
|