@xihan-ui/styles 1.0.0-alpha.2 → 1.0.0-alpha.3
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 +447 -0
- package/README.md +1 -1
- package/css/accordion.css +56 -5
- package/css/alert.css +30 -5
- package/css/anchor.css +7 -7
- package/css/avatar-group.css +3 -3
- package/css/avatar.css +3 -3
- package/css/back-top.css +16 -1
- package/css/badge.css +16 -2
- package/css/breadcrumb.css +24 -4
- package/css/button-group.css +14 -13
- package/css/button.css +42 -11
- package/css/calendar.css +119 -2
- package/css/card.css +5 -5
- package/css/carousel.css +36 -5
- package/css/cascader.css +183 -102
- package/css/checkbox-group.css +41 -19
- package/css/checkbox.css +54 -8
- package/css/clipboard.css +2 -1
- package/css/code-block.css +12 -7
- package/css/collapsible.css +42 -2
- package/css/color-picker.css +111 -45
- package/css/combobox.css +114 -53
- package/css/composer.css +5 -3
- package/css/context-menu.css +97 -69
- package/css/date-field.css +91 -14
- package/css/date-picker.css +276 -65
- package/css/descriptions.css +2 -2
- package/css/dialog.css +40 -13
- package/css/download-trigger.css +76 -0
- package/css/drawer.css +45 -14
- package/css/dynamic-input.css +68 -17
- package/css/editable.css +12 -10
- package/css/ellipsis.css +1 -1
- package/css/empty-state.css +7 -7
- package/css/field.css +9 -6
- package/css/fieldset.css +69 -0
- package/css/file-upload.css +45 -7
- package/css/float-button.css +16 -1
- package/css/floating-panel.css +310 -0
- package/css/form.css +4 -4
- package/css/heatmap.css +410 -0
- package/css/highlight.css +1 -1
- package/css/hotkeys.css +90 -0
- package/css/hover-card.css +40 -45
- package/css/image-cropper.css +231 -0
- package/css/image-viewer.css +137 -12
- package/css/image.css +2 -2
- package/css/infinite-scroll.css +1 -1
- package/css/json-viewer.css +241 -0
- package/css/layout.css +6 -10
- package/css/list.css +8 -8
- package/css/listbox.css +20 -4
- package/css/loading-bar.css +7 -1
- package/css/log.css +1 -1
- package/css/marquee.css +9 -0
- package/css/masonry.css +63 -0
- package/css/mention.css +87 -33
- package/css/menu.css +113 -47
- package/css/menubar.css +146 -60
- package/css/navigation-menu.css +54 -29
- package/css/number-animation.css +3 -3
- package/css/number-field.css +173 -16
- package/css/overlay-arrow.css +51 -0
- package/css/page-header.css +5 -5
- package/css/pagination.css +13 -13
- package/css/password-input.css +356 -0
- package/css/pin-input.css +13 -10
- package/css/popconfirm.css +46 -10
- package/css/popover.css +70 -45
- package/css/popselect.css +183 -53
- package/css/progress.css +47 -7
- package/css/qr-code.css +1 -1
- package/css/radio-group.css +14 -8
- package/css/rating.css +2 -2
- package/css/reset.css +17 -0
- package/css/result.css +6 -6
- package/css/scroll-area.css +61 -89
- package/css/scrollbar.css +167 -0
- package/css/segmented.css +215 -0
- package/css/select.css +274 -125
- package/css/separator.css +2 -2
- package/css/side-nav.css +111 -19
- package/css/signature-pad.css +144 -0
- package/css/skeleton.css +7 -1
- package/css/slider.css +10 -10
- package/css/space.css +117 -0
- package/css/spinner.css +22 -10
- package/css/statistic.css +9 -9
- package/css/steps.css +25 -8
- package/css/switch.css +48 -6
- package/css/table.css +131 -37
- package/css/tabs.css +4 -4
- package/css/tag.css +177 -0
- package/css/tags-input.css +78 -40
- package/css/text-field.css +149 -36
- package/css/thread.css +1 -1
- package/css/time-field.css +97 -16
- package/css/time-picker.css +259 -69
- package/css/timeline.css +10 -10
- package/css/timer.css +119 -0
- package/css/toast.css +34 -10
- package/css/toaster.css +1 -1
- package/css/toggle.css +6 -6
- package/css/tone.css +10 -5
- package/css/toolbar.css +1 -1
- package/css/tooltip.css +36 -33
- package/css/tour.css +103 -58
- package/css/transfer.css +68 -17
- package/css/tree-select.css +185 -84
- package/css/tree.css +85 -1
- package/css/typography.css +4 -4
- package/css/undefined.css +11 -1
- package/css/virtualizer.css +3 -1
- package/css/watermark.css +1 -2
- package/index.css +17 -0
- package/index.unlayered.css +8659 -2799
- package/package.json +19 -3
package/css/tree-select.css
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
@layer xihan.motion {
|
|
2
2
|
/* 动画名的查找只认「文档里有没有这个名字」:引用别处文件里的名字,那份文件不一定在场,
|
|
3
3
|
动画会静默地整个不跑。每份皮肤都能单独引入,所以它用到的关键帧都写在自己身上。 */
|
|
4
|
-
@keyframes xh-
|
|
4
|
+
@keyframes xh-pop-in {
|
|
5
5
|
from {
|
|
6
6
|
opacity: 0;
|
|
7
|
+
scale: var(--xh-motion-scale-enter);
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
to {
|
|
10
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);
|
|
11
24
|
}
|
|
12
25
|
}
|
|
13
26
|
}
|
|
@@ -18,11 +31,29 @@
|
|
|
18
31
|
--xh-tree-select-skin: 1;
|
|
19
32
|
}
|
|
20
33
|
|
|
21
|
-
/*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
/* 坐标由定位引擎写进 style(inset-inline-start / inset-block-start),这里只定位模式与层级 */
|
|
35
|
+
[data-scope='tree-select'][data-part='positioner'] {
|
|
36
|
+
/* 落定那一侧的可用高度,由定位引擎经内联自定义属性写进来,内容层继承它限高;
|
|
37
|
+
引擎没算(尚未落位 / 无引擎)时不额外限高 */
|
|
38
|
+
--xh-_tree-select-available-h: 100vh;
|
|
39
|
+
|
|
40
|
+
position: fixed;
|
|
41
|
+
z-index: var(--xh-tree-select-layer, var(--xh-layer-popover));
|
|
42
|
+
/* 空壳不吃指针,交互只发生在 content 里 */
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* 锚点被滚出可视区:整个浮层随之收起 */
|
|
47
|
+
[data-scope='tree-select'][data-part='positioner'][data-hidden] {
|
|
48
|
+
visibility: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* 私有槽同时声明在根与 positioner 上:浮层被搬到 portal 落点,不是根的后代,继承不过去 */
|
|
52
|
+
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner']) {
|
|
53
|
+
/* 作者塞进指示符槽的图标跟着尺寸档走,与皮肤画的兜底字形同一把尺 */
|
|
54
|
+
--xh-icon-size: var(--xh-tree-select-icon-size, var(--xh-glyph-size-md));
|
|
55
|
+
|
|
56
|
+
/* 尺寸档只换这几个私有槽,盒与树里的行都从这两处继承它们,换档不必给每个部件各写一条选择器 */
|
|
26
57
|
--xh-_tree-select-h: var(--xh-control-h-md);
|
|
27
58
|
--xh-_tree-select-px: var(--xh-control-px-md);
|
|
28
59
|
--xh-_tree-select-gap: var(--xh-control-gap-md);
|
|
@@ -38,9 +69,14 @@
|
|
|
38
69
|
/* 选中行的文字色随语气走,没写 data-tone 时退回品牌强调色 */
|
|
39
70
|
--xh-_tree-select-selected-fg: var(--xh-_tone-fg, var(--xh-fg-brand-strong));
|
|
40
71
|
|
|
72
|
+
/* 聚焦环恒用固定环色;校验失败时换成告警环色 */
|
|
73
|
+
--xh-_tree-select-ring: var(--xh-ring-focus);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* 标签一行、盒一行的两行堆叠 */
|
|
77
|
+
[data-scope='tree-select'][data-part='root'] {
|
|
41
78
|
display: inline-flex;
|
|
42
|
-
flex-
|
|
43
|
-
align-items: center;
|
|
79
|
+
flex-direction: column;
|
|
44
80
|
gap: var(--xh-tree-select-gap, var(--xh-space-1));
|
|
45
81
|
}
|
|
46
82
|
|
|
@@ -52,48 +88,48 @@
|
|
|
52
88
|
/* —— 形态 —— */
|
|
53
89
|
/* 形态只决定描边与底色怎么用;用哪族颜色由 data-tone 决定,没写 tone 就沿用原来的中性配色 */
|
|
54
90
|
/* outline 就是缺省那一身:描边加画布底,写出来只为让三档并列可读 */
|
|
55
|
-
[data-scope='tree-select'][data-part='root'][data-variant='outline'] {
|
|
91
|
+
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-variant='outline'] {
|
|
56
92
|
--xh-_tree-select-border: var(--xh-border-control);
|
|
57
93
|
--xh-_tree-select-border-hover: var(--xh-border-control-hover);
|
|
58
94
|
--xh-_tree-select-bg: var(--xh-bg-canvas);
|
|
59
95
|
}
|
|
60
96
|
|
|
61
97
|
/* subtle 是填充式:底色接过「这里能点」的表达,描边随之让位 */
|
|
62
|
-
[data-scope='tree-select'][data-part='root'][data-variant='subtle'] {
|
|
98
|
+
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-variant='subtle'] {
|
|
63
99
|
--xh-_tree-select-border: transparent;
|
|
64
100
|
--xh-_tree-select-border-hover: var(--xh-_tone-border, var(--xh-border-control-hover));
|
|
65
101
|
--xh-_tree-select-bg: var(--xh-_tone-subtle, var(--xh-bg-subtle));
|
|
66
102
|
}
|
|
67
103
|
|
|
68
|
-
/*
|
|
69
|
-
[data-scope='tree-select'][data-part='root'][data-variant='ghost'] {
|
|
104
|
+
/* 无框:底与常态描边透明,悬停浮出描边,聚焦由焦点环表达 */
|
|
105
|
+
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-variant='ghost'] {
|
|
70
106
|
--xh-_tree-select-border: transparent;
|
|
71
|
-
--xh-_tree-select-border-hover:
|
|
107
|
+
--xh-_tree-select-border-hover: var(--xh-_tone-border, var(--xh-border-control-hover));
|
|
72
108
|
--xh-_tree-select-bg: transparent;
|
|
73
109
|
}
|
|
74
110
|
|
|
75
111
|
/* —— 尺寸 —— */
|
|
76
112
|
/* 缺省档写在上面的基础规则里 */
|
|
77
|
-
[data-scope='tree-select'][data-part='root'][data-size='sm'] {
|
|
113
|
+
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-size='sm'] {
|
|
114
|
+
--xh-icon-size: var(--xh-tree-select-icon-size, var(--xh-glyph-size-sm));
|
|
78
115
|
--xh-_tree-select-h: var(--xh-control-h-sm);
|
|
79
116
|
--xh-_tree-select-px: var(--xh-control-px-sm);
|
|
80
117
|
--xh-_tree-select-gap: var(--xh-control-gap-sm);
|
|
81
|
-
--xh-_tree-select-font-size: var(--xh-font-
|
|
82
|
-
--xh-_tree-select-label-font-size: var(--xh-font-
|
|
118
|
+
--xh-_tree-select-font-size: var(--xh-control-font-sm);
|
|
119
|
+
--xh-_tree-select-label-font-size: var(--xh-control-font-sm);
|
|
83
120
|
}
|
|
84
121
|
|
|
85
|
-
[data-scope='tree-select'][data-part='root'][data-size='lg'] {
|
|
122
|
+
[data-scope='tree-select']:is([data-part='root'], [data-part='positioner'])[data-size='lg'] {
|
|
123
|
+
--xh-icon-size: var(--xh-tree-select-icon-size, var(--xh-glyph-size-lg));
|
|
86
124
|
--xh-_tree-select-h: var(--xh-control-h-lg);
|
|
87
125
|
--xh-_tree-select-px: var(--xh-control-px-lg);
|
|
88
126
|
--xh-_tree-select-gap: var(--xh-control-gap-lg);
|
|
89
|
-
--xh-_tree-select-font-size: var(--xh-font-
|
|
90
|
-
--xh-_tree-select-label-font-size: var(--xh-font-
|
|
127
|
+
--xh-_tree-select-font-size: var(--xh-control-font-lg);
|
|
128
|
+
--xh-_tree-select-label-font-size: var(--xh-control-font-lg);
|
|
91
129
|
}
|
|
92
130
|
|
|
93
131
|
[data-scope='tree-select'][data-part='label'] {
|
|
94
|
-
|
|
95
|
-
flex-basis: 100%;
|
|
96
|
-
color: var(--xh-tree-select-label-fg, var(--xh-fg-muted));
|
|
132
|
+
color: var(--xh-tree-select-label-fg, var(--xh-fg-default));
|
|
97
133
|
font-size: var(--xh-tree-select-label-font-size, var(--xh-_tree-select-label-font-size));
|
|
98
134
|
font-weight: var(--xh-tree-select-label-font-weight, var(--xh-text-label-weight));
|
|
99
135
|
line-height: var(--xh-leading-none);
|
|
@@ -104,63 +140,88 @@
|
|
|
104
140
|
color: var(--xh-fg-subtle);
|
|
105
141
|
}
|
|
106
142
|
|
|
107
|
-
/*
|
|
108
|
-
|
|
109
|
-
[data-scope='tree-select'][data-part='trigger'] {
|
|
143
|
+
/* 盒:描边、底色、控件高度与行内内衬都落在这一层,触发按钮与清空按钮在里面并排 */
|
|
144
|
+
[data-scope='tree-select'][data-part='control'] {
|
|
110
145
|
display: inline-flex;
|
|
111
|
-
flex: 1;
|
|
112
146
|
align-items: center;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
border: var(--xh-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
color: var(--xh-tree-select-trigger-fg, var(--xh-fg-default));
|
|
122
|
-
font-family: inherit;
|
|
123
|
-
font-size: var(--xh-tree-select-trigger-font-size, var(--xh-_tree-select-font-size));
|
|
124
|
-
line-height: var(--xh-leading-none);
|
|
125
|
-
text-align: start;
|
|
147
|
+
gap: var(--xh-tree-select-control-gap, var(--xh-_tree-select-gap));
|
|
148
|
+
min-inline-size: var(--xh-tree-select-control-min-w, var(--xh-control-min-w));
|
|
149
|
+
block-size: var(--xh-tree-select-control-h, var(--xh-_tree-select-h));
|
|
150
|
+
padding-inline: var(--xh-tree-select-control-px, var(--xh-_tree-select-px));
|
|
151
|
+
border: var(--xh-stroke-thin) solid var(--xh-tree-select-control-border, var(--xh-_tree-select-border));
|
|
152
|
+
border-radius: var(--xh-tree-select-control-radius, var(--xh-shape-control));
|
|
153
|
+
background: var(--xh-tree-select-control-bg, var(--xh-_tree-select-bg));
|
|
154
|
+
color: var(--xh-tree-select-control-fg, var(--xh-fg-default));
|
|
126
155
|
cursor: pointer;
|
|
127
156
|
transition: border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
128
157
|
}
|
|
129
158
|
|
|
130
|
-
[data-scope='tree-select'][data-part='
|
|
159
|
+
[data-scope='tree-select'][data-part='control'][hidden] {
|
|
131
160
|
display: none;
|
|
132
161
|
}
|
|
133
162
|
|
|
134
163
|
/* hover 只在中性态换描边:invalid 正拿边框颜色说事,被 hover 盖掉那条信息就没了 */
|
|
135
|
-
[data-scope='tree-select'][data-part='
|
|
136
|
-
border-color: var(--xh-tree-select-
|
|
164
|
+
[data-scope='tree-select'][data-part='control']:hover:not([data-disabled], [data-invalid]) {
|
|
165
|
+
border-color: var(--xh-tree-select-control-border-hover, var(--xh-_tree-select-border-hover));
|
|
137
166
|
}
|
|
138
167
|
|
|
139
|
-
/*
|
|
140
|
-
[data-scope='tree-select'][data-part='
|
|
141
|
-
|
|
168
|
+
/* Tab 停靠点是盒里的 trigger(展开后才移进树里),环画在盒上 */
|
|
169
|
+
[data-scope='tree-select'][data-part='control']:focus-within:not([data-disabled]) {
|
|
170
|
+
border-color: var(--xh-tree-select-control-border-focus, var(--xh-_tone, var(--xh-border-control-focus)));
|
|
171
|
+
outline: var(--xh-ring-width) solid var(--xh-_tree-select-ring);
|
|
142
172
|
outline-offset: var(--xh-ring-offset);
|
|
143
173
|
}
|
|
144
174
|
|
|
145
|
-
[data-scope='tree-select'][data-part='
|
|
146
|
-
border-color: var(--xh-tree-select-
|
|
175
|
+
[data-scope='tree-select'][data-part='control'][data-invalid] {
|
|
176
|
+
border-color: var(--xh-tree-select-control-border-invalid, var(--xh-border-invalid));
|
|
177
|
+
|
|
178
|
+
/* 校验失败时环也跟着变红:两圈等宽相邻却一红一蓝,读的人不知道哪个才是当前状态 */
|
|
179
|
+
--xh-_tree-select-ring: var(--xh-ring-invalid);
|
|
147
180
|
}
|
|
148
181
|
|
|
149
182
|
/* 只读仍可聚焦、浮层仍展得开、树仍能浏览,所以不置灰,只把底色压下去表示「改不动」 */
|
|
150
|
-
[data-scope='tree-select'][data-part='
|
|
151
|
-
background: var(--xh-tree-select-
|
|
183
|
+
[data-scope='tree-select'][data-part='control'][data-readonly] {
|
|
184
|
+
background: var(--xh-tree-select-control-bg-readonly, var(--xh-bg-subtle));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
[data-scope='tree-select'][data-part='control'][data-disabled] {
|
|
188
|
+
background: var(--xh-tree-select-control-bg-disabled, var(--xh-bg-subtle));
|
|
189
|
+
color: var(--xh-fg-disabled);
|
|
190
|
+
cursor: not-allowed;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* 盒内那颗可聚焦的按钮:不画描边不铺底也不自带高度,只占满剩余宽度、排布回显与箭头 */
|
|
194
|
+
[data-scope='tree-select'][data-part='trigger'] {
|
|
195
|
+
display: inline-flex;
|
|
196
|
+
flex: 1 1 auto;
|
|
197
|
+
align-items: center;
|
|
198
|
+
justify-content: space-between;
|
|
199
|
+
gap: var(--xh-tree-select-trigger-gap, var(--xh-_tree-select-gap));
|
|
200
|
+
min-inline-size: 0;
|
|
201
|
+
padding: 0;
|
|
202
|
+
border: 0;
|
|
203
|
+
background: transparent;
|
|
204
|
+
color: var(--xh-tree-select-trigger-fg, var(--xh-fg-default));
|
|
205
|
+
font-family: inherit;
|
|
206
|
+
font-size: var(--xh-tree-select-trigger-font-size, var(--xh-_tree-select-font-size));
|
|
207
|
+
line-height: var(--xh-leading-none);
|
|
208
|
+
text-align: start;
|
|
209
|
+
cursor: pointer;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
[data-scope='tree-select'][data-part='trigger'][hidden] {
|
|
213
|
+
display: none;
|
|
152
214
|
}
|
|
153
215
|
|
|
154
216
|
/* trigger 是单体控件,用原生 disabled(树里的集合条目一律 aria-disabled,写 :disabled 永不命中) */
|
|
155
217
|
[data-scope='tree-select'][data-part='trigger']:disabled {
|
|
156
|
-
background: var(--xh-tree-select-trigger-bg-disabled, var(--xh-bg-subtle));
|
|
157
218
|
color: var(--xh-fg-disabled);
|
|
158
219
|
cursor: not-allowed;
|
|
159
220
|
}
|
|
160
221
|
|
|
161
|
-
/*
|
|
222
|
+
/* 多选时值会连成很长一串,必须能截断;框宽由盒定,这里得允许自己被压缩 */
|
|
162
223
|
[data-scope='tree-select'][data-part='value-text'] {
|
|
163
|
-
flex: 1;
|
|
224
|
+
flex: 1 1 auto;
|
|
164
225
|
min-inline-size: 0;
|
|
165
226
|
overflow: hidden;
|
|
166
227
|
/* 行高留出文字的上下伸展空间,本行那层 overflow:hidden 才不会把字削掉;
|
|
@@ -179,6 +240,12 @@
|
|
|
179
240
|
color: var(--xh-fg-disabled);
|
|
180
241
|
}
|
|
181
242
|
|
|
243
|
+
/* 有值时清空钮顶上来,箭头让位:两个图标并排堆着,用户分不清点哪个。
|
|
244
|
+
让位而不是禁用——禁用的图标还占着位置,看着像坏了 */
|
|
245
|
+
[data-scope='tree-select'][data-part='indicator'][data-clearable] {
|
|
246
|
+
display: none;
|
|
247
|
+
}
|
|
248
|
+
|
|
182
249
|
[data-scope='tree-select'][data-part='indicator'] {
|
|
183
250
|
display: inline-flex;
|
|
184
251
|
flex: none;
|
|
@@ -200,7 +267,7 @@
|
|
|
200
267
|
color: var(--xh-fg-disabled);
|
|
201
268
|
}
|
|
202
269
|
|
|
203
|
-
/*
|
|
270
|
+
/* 盒内靠右的小方钮,不撑高那一行 */
|
|
204
271
|
[data-scope='tree-select'][data-part='clear-trigger'] {
|
|
205
272
|
display: inline-flex;
|
|
206
273
|
flex: none;
|
|
@@ -214,24 +281,25 @@
|
|
|
214
281
|
background: var(--xh-tree-select-action-bg, transparent);
|
|
215
282
|
color: var(--xh-tree-select-action-fg, var(--xh-fg-muted));
|
|
216
283
|
font-family: inherit;
|
|
217
|
-
font-size: var(--xh-tree-select-action-font-size, var(--xh-
|
|
284
|
+
font-size: var(--xh-tree-select-action-font-size, var(--xh-text-secondary-size));
|
|
218
285
|
line-height: var(--xh-leading-none);
|
|
219
286
|
cursor: pointer;
|
|
220
287
|
user-select: none;
|
|
221
|
-
transition: background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
288
|
+
transition: background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter), scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
222
289
|
}
|
|
223
290
|
|
|
224
291
|
[data-scope='tree-select'][data-part='clear-trigger'][hidden] {
|
|
225
292
|
display: none;
|
|
226
293
|
}
|
|
227
294
|
|
|
228
|
-
[data-scope='tree-select'][data-part='clear-trigger']:hover
|
|
295
|
+
[data-scope='tree-select'][data-part='clear-trigger']:hover {
|
|
229
296
|
background: var(--xh-tree-select-action-bg-hover, var(--xh-bg-subtle-hover));
|
|
230
297
|
color: var(--xh-tree-select-action-fg-hover, var(--xh-fg-default));
|
|
231
298
|
}
|
|
232
299
|
|
|
233
|
-
[data-scope='tree-select'][data-part='clear-trigger']:active
|
|
300
|
+
[data-scope='tree-select'][data-part='clear-trigger']:active {
|
|
234
301
|
background: var(--xh-tree-select-action-bg-active, var(--xh-bg-subtle-active));
|
|
302
|
+
scale: var(--xh-motion-scale-press);
|
|
235
303
|
}
|
|
236
304
|
|
|
237
305
|
/* 清空按钮退出了 Tab 序列(tabindex=-1),正常操作走不到这里;
|
|
@@ -241,48 +309,29 @@
|
|
|
241
309
|
outline-offset: var(--xh-ring-offset);
|
|
242
310
|
}
|
|
243
311
|
|
|
244
|
-
/* 无选中、只读、整控件禁用三种情况下都按不动,用的是原生 disabled */
|
|
245
|
-
[data-scope='tree-select'][data-part='clear-trigger']:disabled {
|
|
246
|
-
background: var(--xh-tree-select-action-bg, transparent);
|
|
247
|
-
color: var(--xh-fg-disabled);
|
|
248
|
-
cursor: not-allowed;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
/* 坐标由定位引擎写进 style(inset-inline-start / inset-block-start),这里只定位模式与层级 */
|
|
252
|
-
[data-scope='tree-select'][data-part='positioner'] {
|
|
253
|
-
position: fixed;
|
|
254
|
-
z-index: var(--xh-layer-popover);
|
|
255
|
-
/* 空壳不吃指针,交互只发生在 content 里 */
|
|
256
|
-
pointer-events: none;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/* 锚点被滚出可视区:整个浮层随之收起 */
|
|
260
|
-
[data-scope='tree-select'][data-part='positioner'][data-hidden] {
|
|
261
|
-
visibility: hidden;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
312
|
[data-scope='tree-select'][data-part='content'] {
|
|
265
313
|
display: flex;
|
|
266
314
|
flex-direction: column;
|
|
267
315
|
min-inline-size: var(--xh-tree-select-content-min-w, var(--xh-overlay-min-w));
|
|
268
316
|
max-inline-size: var(--xh-tree-select-content-max-w, var(--xh-overlay-max-w));
|
|
269
|
-
max-block-size: var(--xh-tree-select-content-max-h, var(--xh-overlay-max-h));
|
|
317
|
+
max-block-size: min(var(--xh-tree-select-content-max-h, var(--xh-overlay-max-h)), var(--xh-_tree-select-available-h));
|
|
270
318
|
padding-block: var(--xh-tree-select-content-py, var(--xh-space-1));
|
|
271
319
|
padding-inline: var(--xh-tree-select-content-px, var(--xh-space-1));
|
|
272
320
|
border: var(--xh-stroke-thin) solid var(--xh-tree-select-content-border, var(--xh-border-default));
|
|
273
321
|
border-radius: var(--xh-tree-select-content-radius, var(--xh-shape-surface));
|
|
274
322
|
background: var(--xh-tree-select-content-bg, var(--xh-bg-surface));
|
|
275
323
|
color: var(--xh-tree-select-content-fg, var(--xh-fg-default));
|
|
276
|
-
box-shadow: var(--xh-tree-select-content-shadow, var(--xh-elevation-
|
|
324
|
+
box-shadow: var(--xh-tree-select-content-shadow, var(--xh-elevation-floating));
|
|
277
325
|
/* 两轴一起给:深层节点靠缩进往行末推,横向溢出是常态,得够得着 */
|
|
278
326
|
overflow: auto;
|
|
279
327
|
pointer-events: auto;
|
|
280
328
|
}
|
|
281
329
|
|
|
282
|
-
/*
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
330
|
+
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 dialog 一致:
|
|
331
|
+
收起态连接层会给 content 打 hidden,而上面那条 display 正是要盖掉 UA 的
|
|
332
|
+
[hidden]{display:none}——退场动画得先能播。presence 读的是 content 的 animationName,
|
|
333
|
+
真正的收起由宿主在退场结束后落成内联 display:none(Vue 那边直接不渲染)。
|
|
334
|
+
其余声明了 display 的角色节点仍补 [hidden],那几处没有退场动画。 */
|
|
286
335
|
|
|
287
336
|
/* 容器只是焦点域的兜底落点,落焦不画环:高亮永远长在行上 */
|
|
288
337
|
[data-scope='tree-select'][data-part='content']:focus-visible {
|
|
@@ -290,7 +339,13 @@
|
|
|
290
339
|
}
|
|
291
340
|
|
|
292
341
|
[data-scope='tree-select'][data-part='content'][data-state='open'] {
|
|
293
|
-
animation: xh-
|
|
342
|
+
animation: xh-pop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
|
|
346
|
+
免得动画结束到真收起之间闪一下原样 */
|
|
347
|
+
[data-scope='tree-select'][data-part='content'][data-state='closed'] {
|
|
348
|
+
animation: xh-pop-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
294
349
|
}
|
|
295
350
|
|
|
296
351
|
/* 边框、底色与滚动都归 content,树本身只把行竖着排开 */
|
|
@@ -465,4 +520,50 @@
|
|
|
465
520
|
[data-scope='tree-select'][data-part='branch-content'][hidden] {
|
|
466
521
|
display: none;
|
|
467
522
|
}
|
|
523
|
+
|
|
524
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
525
|
+
[data-scope='tree-select'][data-part='indicator']:empty::before {
|
|
526
|
+
content: '';
|
|
527
|
+
display: inline-block;
|
|
528
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
529
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
530
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
531
|
+
background-color: currentColor;
|
|
532
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
533
|
+
mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
[data-scope='tree-select'][data-part='item-indicator']:empty::before {
|
|
537
|
+
content: '';
|
|
538
|
+
display: inline-block;
|
|
539
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
540
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
541
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
542
|
+
background-color: currentColor;
|
|
543
|
+
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
544
|
+
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
[data-scope='tree-select'][data-part='branch-trigger']:empty::before,
|
|
548
|
+
[data-scope='tree-select'][data-part='branch-indicator']:empty::before {
|
|
549
|
+
content: '';
|
|
550
|
+
display: inline-block;
|
|
551
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
552
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
553
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
554
|
+
background-color: currentColor;
|
|
555
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
|
|
556
|
+
mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
[data-scope='tree-select'][data-part='clear-trigger']:empty::before {
|
|
560
|
+
content: '';
|
|
561
|
+
display: inline-block;
|
|
562
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
563
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
564
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
565
|
+
background-color: currentColor;
|
|
566
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
567
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
568
|
+
}
|
|
468
569
|
}
|
package/css/tree.css
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
[data-scope='tree'][data-part='root'] {
|
|
8
|
+
/* 作者塞进指示符槽的图标跟着字号走,与皮肤画的兜底字形同一把尺 */
|
|
9
|
+
--xh-icon-size: var(--xh-tree-icon-size, var(--xh-glyph-size-text));
|
|
10
|
+
|
|
8
11
|
display: flex;
|
|
9
12
|
flex-direction: column;
|
|
10
13
|
gap: var(--xh-tree-gap, var(--xh-space-2));
|
|
@@ -30,7 +33,7 @@
|
|
|
30
33
|
[data-scope='tree'][data-part='tree'] {
|
|
31
34
|
display: flex;
|
|
32
35
|
flex-direction: column;
|
|
33
|
-
max-block-size: var(--xh-tree-max-h,
|
|
36
|
+
max-block-size: var(--xh-tree-max-h, var(--xh-viewport-h-lg));
|
|
34
37
|
padding-block: var(--xh-tree-py, var(--xh-space-1));
|
|
35
38
|
padding-inline: var(--xh-tree-px, var(--xh-space-1));
|
|
36
39
|
border: var(--xh-stroke-thin) solid var(--xh-tree-border, var(--xh-border-default));
|
|
@@ -102,6 +105,63 @@
|
|
|
102
105
|
background: var(--xh-tree-row-bg-hover, var(--xh-bg-subtle));
|
|
103
106
|
}
|
|
104
107
|
|
|
108
|
+
/* 勾选把手:勾选态只画在它身上,不碰行底色——底色那条通道归高亮 */
|
|
109
|
+
[data-scope='tree'][data-part='item-checkbox'],
|
|
110
|
+
[data-scope='tree'][data-part='branch-checkbox'] {
|
|
111
|
+
display: inline-grid;
|
|
112
|
+
place-items: center;
|
|
113
|
+
flex: none;
|
|
114
|
+
inline-size: var(--xh-tree-checkbox-size, var(--xh-control-indicator-size));
|
|
115
|
+
block-size: var(--xh-tree-checkbox-size, var(--xh-control-indicator-size));
|
|
116
|
+
border: var(--xh-stroke-thin) solid var(--xh-tree-checkbox-border, var(--xh-border-control));
|
|
117
|
+
border-radius: var(--xh-tree-checkbox-radius, var(--xh-shape-inset));
|
|
118
|
+
background: var(--xh-tree-checkbox-bg, var(--xh-bg-canvas));
|
|
119
|
+
color: var(--xh-tree-checkbox-fg, var(--xh-fg-on-brand));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
[data-scope='tree'][data-part='item-checkbox'][data-selected],
|
|
123
|
+
[data-scope='tree'][data-part='branch-checkbox'][data-selected] {
|
|
124
|
+
border-color: var(--xh-tree-checkbox-border-checked, var(--xh-bg-brand));
|
|
125
|
+
background: var(--xh-tree-checkbox-bg-checked, var(--xh-bg-brand));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* 半选:级联勾选下「子树勾了一部分」的第三态,此前发了 data-indeterminate 却没人画 */
|
|
129
|
+
[data-scope='tree'][data-part='item-checkbox'][data-indeterminate]:not([data-selected]),
|
|
130
|
+
[data-scope='tree'][data-part='branch-checkbox'][data-indeterminate]:not([data-selected]) {
|
|
131
|
+
border-color: var(--xh-tree-checkbox-border-checked, var(--xh-bg-brand));
|
|
132
|
+
background: var(--xh-tree-checkbox-bg-checked, var(--xh-bg-brand));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* 没写内容就由皮肤画;作者往把手里塞了自己的图形,这条规则即不命中 */
|
|
136
|
+
[data-scope='tree'][data-part='item-checkbox'][data-selected]:empty::before,
|
|
137
|
+
[data-scope='tree'][data-part='branch-checkbox'][data-selected]:empty::before {
|
|
138
|
+
content: '';
|
|
139
|
+
display: inline-block;
|
|
140
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
141
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
142
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
143
|
+
background-color: currentColor;
|
|
144
|
+
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
145
|
+
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
[data-scope='tree'][data-part='item-checkbox'][data-indeterminate]:not([data-selected]):empty::before,
|
|
149
|
+
[data-scope='tree'][data-part='branch-checkbox'][data-indeterminate]:not([data-selected]):empty::before {
|
|
150
|
+
content: '';
|
|
151
|
+
display: inline-block;
|
|
152
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
153
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
154
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
155
|
+
background-color: currentColor;
|
|
156
|
+
-webkit-mask: var(--xh-glyph-mark-minus) center / contain no-repeat;
|
|
157
|
+
mask: var(--xh-glyph-mark-minus) center / contain no-repeat;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
[data-scope='tree'][data-part='item-checkbox'][data-disabled],
|
|
161
|
+
[data-scope='tree'][data-part='branch-checkbox'][data-disabled] {
|
|
162
|
+
border-color: var(--xh-tree-checkbox-border-disabled, var(--xh-border-subtle));
|
|
163
|
+
}
|
|
164
|
+
|
|
105
165
|
/* 选中只换文字色与字重,配合行尾的 ✓ 标记;底色整条通道留给高亮,
|
|
106
166
|
两者因此能同时看见 */
|
|
107
167
|
[data-scope='tree'][data-part='item'][data-selected],
|
|
@@ -209,4 +269,28 @@
|
|
|
209
269
|
[data-scope='tree'][data-part='branch-content'][hidden] {
|
|
210
270
|
display: none;
|
|
211
271
|
}
|
|
272
|
+
|
|
273
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
274
|
+
[data-scope='tree'][data-part='branch-trigger']:empty::before,
|
|
275
|
+
[data-scope='tree'][data-part='branch-indicator']:empty::before {
|
|
276
|
+
content: '';
|
|
277
|
+
display: inline-block;
|
|
278
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
279
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
280
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
281
|
+
background-color: currentColor;
|
|
282
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
|
|
283
|
+
mask: var(--xh-glyph-mark-chevron-right) center / contain no-repeat;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
[data-scope='tree'][data-part='item-indicator']:empty::before {
|
|
287
|
+
content: '';
|
|
288
|
+
display: inline-block;
|
|
289
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
290
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
291
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
292
|
+
background-color: currentColor;
|
|
293
|
+
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
294
|
+
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
295
|
+
}
|
|
212
296
|
}
|
package/css/typography.css
CHANGED
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
--xh-_typography-h6: var(--xh-font-size-sm);
|
|
18
18
|
/* 读行宽度:整块正文不收窄就会拉成一行行难读的长句 */
|
|
19
19
|
--xh-_typography-measure: 68ch;
|
|
20
|
-
/*
|
|
21
|
-
--xh-_typography-code-size: 0.
|
|
20
|
+
/* 行内代码跟着所在那行的字号缩:以「随文字走」的字形尺寸为基数按比例收一点,不取固定档位 */
|
|
21
|
+
--xh-_typography-code-size: calc(var(--xh-glyph-size-text) * 0.9);
|
|
22
22
|
|
|
23
23
|
/* 建块级格式化上下文,段落的外边距不越过根往外塌 */
|
|
24
24
|
display: flow-root;
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
[data-scope='typography'][data-part='text'][data-variant='code'] {
|
|
124
124
|
padding-block: var(--xh-typography-code-py, var(--xh-space-0_5));
|
|
125
125
|
padding-inline: var(--xh-typography-code-px, var(--xh-space-1));
|
|
126
|
-
border-radius: var(--xh-typography-code-radius, var(--xh-
|
|
126
|
+
border-radius: var(--xh-typography-code-radius, var(--xh-shape-inset));
|
|
127
127
|
background: var(--xh-typography-code-bg, var(--xh-bg-subtle));
|
|
128
128
|
font-family: var(--xh-font-family-mono);
|
|
129
129
|
font-size: var(--xh-typography-code-font-size, var(--xh-_typography-code-size));
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
|
|
137
137
|
/* —— 行内链接 —— */
|
|
138
138
|
[data-scope='typography'][data-part='link'] {
|
|
139
|
-
border-radius: var(--xh-typography-link-radius, var(--xh-
|
|
139
|
+
border-radius: var(--xh-typography-link-radius, var(--xh-shape-inset));
|
|
140
140
|
color: var(--xh-typography-link-fg, var(--xh-fg-brand));
|
|
141
141
|
text-decoration: underline;
|
|
142
142
|
text-underline-offset: var(--xh-typography-link-underline-offset, var(--xh-space-0_5));
|
package/css/undefined.css
CHANGED
|
@@ -2,26 +2,36 @@
|
|
|
2
2
|
* 元素升级前的形态。
|
|
3
3
|
*
|
|
4
4
|
* 收起态由元素在 wire() 里用内联 display 做,而 data-scope / data-part 也是那一刻才打上,
|
|
5
|
-
* 所以 JS
|
|
5
|
+
* 所以 JS 到达之前这段子树既没有皮肤也没有收起——内容会以裸文本堆在页面流里,
|
|
6
6
|
* 并被搜索引擎与读屏当作正文。SSR / SSG 直出时这段时间尤其长。
|
|
7
7
|
*
|
|
8
8
|
* 这里按作者写的 data-xh-part 选中,那是升级前唯一存在的标记。
|
|
9
|
+
* 名单与元素的对应由 check-undefined-guard.mjs 双向守着。
|
|
9
10
|
*/
|
|
10
11
|
@layer xihan.components {
|
|
11
12
|
:where(
|
|
13
|
+
xh-accordion,
|
|
12
14
|
xh-cascader,
|
|
15
|
+
xh-collapsible,
|
|
13
16
|
xh-color-picker,
|
|
14
17
|
xh-combobox,
|
|
15
18
|
xh-context-menu,
|
|
16
19
|
xh-date-picker,
|
|
17
20
|
xh-dialog,
|
|
18
21
|
xh-drawer,
|
|
22
|
+
xh-floating-panel,
|
|
19
23
|
xh-hover-card,
|
|
24
|
+
xh-image-viewer,
|
|
25
|
+
xh-mention,
|
|
20
26
|
xh-menu,
|
|
21
27
|
xh-menubar,
|
|
22
28
|
xh-navigation-menu,
|
|
29
|
+
xh-popconfirm,
|
|
23
30
|
xh-popover,
|
|
31
|
+
xh-popselect,
|
|
24
32
|
xh-select,
|
|
33
|
+
xh-side-nav,
|
|
34
|
+
xh-steps,
|
|
25
35
|
xh-time-picker,
|
|
26
36
|
xh-tooltip,
|
|
27
37
|
xh-tour,
|
package/css/virtualizer.css
CHANGED