@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/popover.css
CHANGED
|
@@ -1,13 +1,27 @@
|
|
|
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
|
+
|
|
16
|
+
@keyframes xh-pop-out {
|
|
17
|
+
from {
|
|
18
|
+
opacity: 1;
|
|
19
|
+
scale: 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
to {
|
|
23
|
+
opacity: 0;
|
|
24
|
+
scale: var(--xh-motion-scale-enter);
|
|
11
25
|
}
|
|
12
26
|
}
|
|
13
27
|
}
|
|
@@ -20,8 +34,12 @@
|
|
|
20
34
|
|
|
21
35
|
/* 坐标由定位引擎写进 style(inset-inline-start / inset-block-start),这里只定位模式与层级 */
|
|
22
36
|
[data-scope='popover'][data-part='positioner'] {
|
|
37
|
+
/* 落定那一侧的可用高度,由定位引擎经内联自定义属性写进来,内容层继承它限高;
|
|
38
|
+
引擎没算(尚未落位 / 无引擎 / 贴边归零)时不额外限高 */
|
|
39
|
+
--xh-_popover-available-h: 100vh;
|
|
40
|
+
|
|
23
41
|
position: fixed;
|
|
24
|
-
z-index: var(--xh-layer-popover);
|
|
42
|
+
z-index: var(--xh-popover-layer, var(--xh-layer-popover));
|
|
25
43
|
/* 空壳不吃指针,交互只发生在 content 上 */
|
|
26
44
|
pointer-events: none;
|
|
27
45
|
}
|
|
@@ -32,6 +50,9 @@
|
|
|
32
50
|
}
|
|
33
51
|
|
|
34
52
|
[data-scope='popover'][data-part='content'] {
|
|
53
|
+
/* 作者塞进指示符槽的图标跟着字号走,与皮肤画的兜底字形同一把尺 */
|
|
54
|
+
--xh-icon-size: var(--xh-popover-icon-size, var(--xh-glyph-size-text));
|
|
55
|
+
|
|
35
56
|
/* 尺寸档只换这两个私有槽。popover 没有 root 部件,size 落在浮层树最外层的 content 上。
|
|
36
57
|
语气不接:面板是内容容器,语气该由里面的内容表达 */
|
|
37
58
|
--xh-_popover-py: var(--xh-space-3);
|
|
@@ -44,27 +65,37 @@
|
|
|
44
65
|
gap: var(--xh-popover-gap, var(--xh-space-2));
|
|
45
66
|
inline-size: max-content;
|
|
46
67
|
max-inline-size: var(--xh-popover-max-w, var(--xh-_popover-max-w));
|
|
68
|
+
/* 内容由作者给,长度不可预知:不限高就整块伸出视口且滚不到 */
|
|
69
|
+
max-block-size: min(var(--xh-popover-max-h, var(--xh-overlay-max-h)), var(--xh-_popover-available-h));
|
|
70
|
+
overflow-y: auto;
|
|
47
71
|
padding-block: var(--xh-popover-py, var(--xh-_popover-py));
|
|
48
72
|
padding-inline: var(--xh-popover-px, var(--xh-_popover-px));
|
|
49
73
|
border: var(--xh-stroke-thin) solid var(--xh-popover-border, var(--xh-border-default));
|
|
50
74
|
border-radius: var(--xh-popover-radius, var(--xh-shape-surface));
|
|
51
75
|
background: var(--xh-popover-bg, var(--xh-bg-surface));
|
|
52
76
|
color: var(--xh-popover-fg, var(--xh-fg-default));
|
|
53
|
-
box-shadow: var(--xh-popover-shadow, var(--xh-elevation-
|
|
77
|
+
box-shadow: var(--xh-popover-shadow, var(--xh-elevation-floating));
|
|
54
78
|
pointer-events: auto;
|
|
55
79
|
}
|
|
56
80
|
|
|
57
|
-
/*
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
81
|
+
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 dialog 一致:
|
|
82
|
+
收起态连接层会给 content 打 hidden,而上面那条 display 正是要盖掉 UA 的
|
|
83
|
+
[hidden]{display:none}——退场动画得先能播。presence 读的是 content 的 animationName,
|
|
84
|
+
真正的收起由宿主在退场结束后落成内联 display:none(Vue 那边直接不渲染)。
|
|
85
|
+
其余声明了 display 的角色节点仍补 [hidden],那几处没有退场动画。 */
|
|
61
86
|
|
|
62
87
|
[data-scope='popover'][data-part='content']:focus-visible {
|
|
63
88
|
outline: none;
|
|
64
89
|
}
|
|
65
90
|
|
|
66
91
|
[data-scope='popover'][data-part='content'][data-state='open'] {
|
|
67
|
-
animation: xh-
|
|
92
|
+
animation: xh-pop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
|
|
96
|
+
免得动画结束到 hidden 落下来之间闪一下原样 */
|
|
97
|
+
[data-scope='popover'][data-part='content'][data-state='closed'] {
|
|
98
|
+
animation: xh-pop-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
68
99
|
}
|
|
69
100
|
|
|
70
101
|
/* —— 尺寸 —— */
|
|
@@ -99,7 +130,7 @@
|
|
|
99
130
|
否则长标题会直接钻到按钮底下。只在真有关闭按钮时让位。 */
|
|
100
131
|
[data-scope='popover'][data-part='content']:has([data-scope='popover'][data-part='close-trigger'])
|
|
101
132
|
[data-scope='popover'][data-part='title'] {
|
|
102
|
-
padding-inline-end: calc(var(--xh-control-h-sm) + var(--xh-space-2));
|
|
133
|
+
padding-inline-end: calc(var(--xh-popover-close-size, var(--xh-control-h-sm)) + var(--xh-space-2));
|
|
103
134
|
}
|
|
104
135
|
|
|
105
136
|
[data-scope='popover'][data-part='close-trigger'] {
|
|
@@ -109,65 +140,59 @@
|
|
|
109
140
|
display: inline-flex;
|
|
110
141
|
align-items: center;
|
|
111
142
|
justify-content: center;
|
|
112
|
-
block-size: var(--xh-control-h-sm);
|
|
113
|
-
inline-size: var(--xh-control-h-sm);
|
|
143
|
+
block-size: var(--xh-popover-close-size, var(--xh-control-h-sm));
|
|
144
|
+
inline-size: var(--xh-popover-close-size, var(--xh-control-h-sm));
|
|
114
145
|
border: 0;
|
|
115
|
-
border-radius: var(--xh-shape-control);
|
|
146
|
+
border-radius: var(--xh-popover-close-radius, var(--xh-shape-control));
|
|
116
147
|
background: transparent;
|
|
117
148
|
color: var(--xh-fg-muted);
|
|
118
149
|
cursor: pointer;
|
|
150
|
+
transition:
|
|
151
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
152
|
+
scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
[data-scope='popover'][data-part='close-trigger'][hidden] {
|
|
156
|
+
display: none;
|
|
119
157
|
}
|
|
120
158
|
|
|
121
159
|
[data-scope='popover'][data-part='close-trigger']:hover {
|
|
122
|
-
background: var(--xh-bg-subtle);
|
|
160
|
+
background: var(--xh-popover-close-bg-hover, var(--xh-bg-subtle-hover));
|
|
123
161
|
color: var(--xh-fg-default);
|
|
124
162
|
}
|
|
125
163
|
|
|
164
|
+
[data-scope='popover'][data-part='close-trigger']:active {
|
|
165
|
+
background: var(--xh-popover-close-bg-active, var(--xh-bg-subtle-active));
|
|
166
|
+
scale: var(--xh-motion-scale-press);
|
|
167
|
+
}
|
|
168
|
+
|
|
126
169
|
[data-scope='popover'][data-part='close-trigger']:focus-visible {
|
|
127
170
|
outline: var(--xh-ring-width) solid var(--xh-ring-focus);
|
|
128
171
|
outline-offset: var(--xh-ring-offset);
|
|
129
172
|
}
|
|
130
173
|
|
|
131
|
-
/*
|
|
174
|
+
/* 箭头的底色与描边色,几何在 overlay-arrow.css。
|
|
132
175
|
交叉轴落点由定位引擎经内联自定义属性写进来,没给时退回居中 */
|
|
133
176
|
[data-scope='popover'][data-part='arrow'] {
|
|
134
|
-
--xh-_popover-arrow-size: var(--xh-popover-arrow-size, var(--xh-overlay-arrow-size));
|
|
135
177
|
--xh-_popover-arrow-x: 50%;
|
|
136
178
|
--xh-_popover-arrow-y: 50%;
|
|
179
|
+
--xh-_overlay-arrow-size: var(--xh-popover-arrow-size, var(--xh-overlay-arrow-size));
|
|
180
|
+
--xh-_overlay-arrow-x: var(--xh-_popover-arrow-x);
|
|
181
|
+
--xh-_overlay-arrow-y: var(--xh-_popover-arrow-y);
|
|
137
182
|
|
|
138
|
-
position: absolute;
|
|
139
|
-
inline-size: var(--xh-_popover-arrow-size);
|
|
140
|
-
block-size: var(--xh-_popover-arrow-size);
|
|
141
183
|
background: var(--xh-popover-bg, var(--xh-bg-surface));
|
|
142
184
|
border: var(--xh-stroke-thin) solid var(--xh-popover-border, var(--xh-border-default));
|
|
143
|
-
rotate: 45deg;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
[data-scope='popover'][data-part='arrow'][data-placement^='bottom'] {
|
|
147
|
-
inset-block-start: calc(var(--xh-_popover-arrow-size) / -2);
|
|
148
|
-
inset-inline-start: calc(var(--xh-_popover-arrow-x) - var(--xh-_popover-arrow-size) / 2);
|
|
149
|
-
border-block-end: 0;
|
|
150
|
-
border-inline-end: 0;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
[data-scope='popover'][data-part='arrow'][data-placement^='top'] {
|
|
154
|
-
inset-block-end: calc(var(--xh-_popover-arrow-size) / -2);
|
|
155
|
-
inset-inline-start: calc(var(--xh-_popover-arrow-x) - var(--xh-_popover-arrow-size) / 2);
|
|
156
|
-
border-block-start: 0;
|
|
157
|
-
border-inline-start: 0;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
[data-scope='popover'][data-part='arrow'][data-placement^='right'] {
|
|
161
|
-
inset-inline-start: calc(var(--xh-_popover-arrow-size) / -2);
|
|
162
|
-
inset-block-start: calc(var(--xh-_popover-arrow-y) - var(--xh-_popover-arrow-size) / 2);
|
|
163
|
-
border-block-start: 0;
|
|
164
|
-
border-inline-end: 0;
|
|
165
185
|
}
|
|
166
186
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
187
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
188
|
+
[data-scope='popover'][data-part='close-trigger']:empty::before {
|
|
189
|
+
content: '';
|
|
190
|
+
display: inline-block;
|
|
191
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
192
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
193
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
194
|
+
background-color: currentColor;
|
|
195
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
196
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
172
197
|
}
|
|
173
198
|
}
|
package/css/popselect.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,75 +31,143 @@
|
|
|
18
31
|
--xh-popselect-skin: 1;
|
|
19
32
|
}
|
|
20
33
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
34
|
+
/* 坐标由定位引擎写进 style(inset-inline-start / inset-block-start),这里只定位模式与层级 */
|
|
35
|
+
[data-scope='popselect'][data-part='positioner'] {
|
|
36
|
+
/* 落定那一侧的可用高度,由定位引擎经内联自定义属性写进来,内容层继承它限高;
|
|
37
|
+
引擎没算(尚未落位 / 无引擎 / 贴边归零)时退回自己那档静态上限 */
|
|
38
|
+
--xh-_popselect-available-h: 100vh;
|
|
39
|
+
|
|
40
|
+
position: fixed;
|
|
41
|
+
z-index: var(--xh-popselect-layer, var(--xh-layer-popover));
|
|
42
|
+
/* 空壳不吃指针,交互只发生在 content 上 */
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* 锚点被滚出可视区:整个浮层随之收起 */
|
|
47
|
+
[data-scope='popselect'][data-part='positioner'][data-hidden] {
|
|
48
|
+
visibility: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* 私有槽同时声明在根与 positioner 上:浮层被搬到 portal 落点,不是根的后代,继承不过去 */
|
|
52
|
+
[data-scope='popselect']:is([data-part='root'], [data-part='positioner']) {
|
|
53
|
+
/* 尺寸档只换这四个私有槽,触发器与条目都从这两处继承它们,换档不必给每个部件各写一条选择器 */
|
|
24
54
|
--xh-_popselect-h: var(--xh-control-h-md);
|
|
25
55
|
--xh-_popselect-px: var(--xh-control-px-md);
|
|
26
56
|
--xh-_popselect-gap: var(--xh-control-gap-md);
|
|
27
57
|
--xh-_popselect-font-size: var(--xh-text-body-size);
|
|
28
58
|
|
|
29
59
|
/* 形态档只换这三个槽:缺省即 outline(描边 + 画布底) */
|
|
30
|
-
--xh-_popselect-
|
|
31
|
-
--xh-_popselect-
|
|
32
|
-
--xh-_popselect-
|
|
60
|
+
--xh-_popselect-control-bg: var(--xh-bg-canvas);
|
|
61
|
+
--xh-_popselect-control-border: var(--xh-border-control);
|
|
62
|
+
--xh-_popselect-control-border-hover: var(--xh-border-control-hover);
|
|
33
63
|
|
|
34
64
|
/* 聚焦环恒用固定环色;强调色随语气走,只落在勾选标记与选中文字上,正文文字色不动。
|
|
35
65
|
没写 data-tone 时 --xh-_tone 没被声明,两处都退回原来的取值 */
|
|
36
66
|
--xh-_popselect-ring: var(--xh-ring-focus);
|
|
37
67
|
--xh-_popselect-accent: var(--xh-_tone, var(--xh-bg-brand));
|
|
38
68
|
--xh-_popselect-item-selected-fg: var(--xh-_tone-fg, var(--xh-fg-brand-strong));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-scope='popselect'][data-part='root'] {
|
|
72
|
+
/* 作者塞进指示符槽的图标跟着控件的尺寸档走;它自己写了 size 时仍以作者的为准 */
|
|
73
|
+
--xh-icon-size: var(--xh-popselect-icon-size, var(--xh-glyph-size-md));
|
|
39
74
|
|
|
40
75
|
display: inline-flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
gap: var(--xh-popselect-root-gap, var(--xh-space-1));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* 图标只跟着盒那一侧换档:浮层里的勾选标记有自己的指示符盒,换成整档图标会撑破它 */
|
|
81
|
+
[data-scope='popselect'][data-part='root'][data-size='sm'] {
|
|
82
|
+
--xh-icon-size: var(--xh-popselect-icon-size, var(--xh-glyph-size-sm));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
[data-scope='popselect'][data-part='root'][data-size='lg'] {
|
|
86
|
+
--xh-icon-size: var(--xh-popselect-icon-size, var(--xh-glyph-size-lg));
|
|
41
87
|
}
|
|
42
88
|
|
|
43
89
|
/* —— 尺寸 —— */
|
|
44
90
|
/* 缺省档写在上面的基础规则里 */
|
|
45
|
-
[data-scope='popselect'][data-part='root'][data-size='sm'] {
|
|
91
|
+
[data-scope='popselect']:is([data-part='root'], [data-part='positioner'])[data-size='sm'] {
|
|
46
92
|
--xh-_popselect-h: var(--xh-control-h-sm);
|
|
47
93
|
--xh-_popselect-px: var(--xh-control-px-sm);
|
|
48
94
|
--xh-_popselect-gap: var(--xh-control-gap-sm);
|
|
49
|
-
--xh-_popselect-font-size: var(--xh-font-
|
|
95
|
+
--xh-_popselect-font-size: var(--xh-control-font-sm);
|
|
50
96
|
}
|
|
51
97
|
|
|
52
|
-
[data-scope='popselect'][data-part='root'][data-size='lg'] {
|
|
98
|
+
[data-scope='popselect']:is([data-part='root'], [data-part='positioner'])[data-size='lg'] {
|
|
53
99
|
--xh-_popselect-h: var(--xh-control-h-lg);
|
|
54
100
|
--xh-_popselect-px: var(--xh-control-px-lg);
|
|
55
101
|
--xh-_popselect-gap: var(--xh-control-gap-lg);
|
|
56
|
-
--xh-_popselect-font-size: var(--xh-font-
|
|
102
|
+
--xh-_popselect-font-size: var(--xh-control-font-lg);
|
|
57
103
|
}
|
|
58
104
|
|
|
59
105
|
/* —— 形态 —— */
|
|
60
106
|
/* 形态只决定描边与底色怎么用,用哪族颜色由 data-tone 决定 */
|
|
61
|
-
[data-scope='popselect'][data-part='root'][data-variant='outline'] {
|
|
62
|
-
--xh-_popselect-
|
|
63
|
-
--xh-_popselect-
|
|
64
|
-
--xh-_popselect-
|
|
107
|
+
[data-scope='popselect']:is([data-part='root'], [data-part='positioner'])[data-variant='outline'] {
|
|
108
|
+
--xh-_popselect-control-bg: var(--xh-bg-canvas);
|
|
109
|
+
--xh-_popselect-control-border: var(--xh-border-control);
|
|
110
|
+
--xh-_popselect-control-border-hover: var(--xh-border-control-hover);
|
|
65
111
|
}
|
|
66
112
|
|
|
67
113
|
/* 填充式:底色顶替描边,悬停时才浮出一道淡边 */
|
|
68
|
-
[data-scope='popselect'][data-part='root'][data-variant='subtle'] {
|
|
69
|
-
--xh-_popselect-
|
|
70
|
-
--xh-_popselect-
|
|
71
|
-
--xh-_popselect-
|
|
114
|
+
[data-scope='popselect']:is([data-part='root'], [data-part='positioner'])[data-variant='subtle'] {
|
|
115
|
+
--xh-_popselect-control-bg: var(--xh-_tone-subtle, var(--xh-bg-subtle));
|
|
116
|
+
--xh-_popselect-control-border: transparent;
|
|
117
|
+
--xh-_popselect-control-border-hover: var(--xh-_tone-border, var(--xh-border-control-hover));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* 无框:底与常态描边透明,悬停浮出描边,聚焦由焦点环表达 */
|
|
121
|
+
[data-scope='popselect']:is([data-part='root'], [data-part='positioner'])[data-variant='ghost'] {
|
|
122
|
+
--xh-_popselect-control-bg: transparent;
|
|
123
|
+
--xh-_popselect-control-border: transparent;
|
|
124
|
+
--xh-_popselect-control-border-hover: var(--xh-_tone-border, var(--xh-border-control-hover));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* 盒:描边、底色、圆角、控件高度与行内内衬都长在这一层,触发器与清空按钮在里面并排。
|
|
128
|
+
聚焦环也画在它上面,焦点落在哪颗按钮上,看到的都是同一个框亮起来 */
|
|
129
|
+
[data-scope='popselect'][data-part='control'] {
|
|
130
|
+
display: inline-flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: var(--xh-popselect-control-gap, var(--xh-_popselect-gap));
|
|
133
|
+
block-size: var(--xh-popselect-control-h, var(--xh-_popselect-h));
|
|
134
|
+
padding-inline: var(--xh-popselect-control-px, var(--xh-_popselect-px));
|
|
135
|
+
min-inline-size: var(--xh-popselect-control-min-w, var(--xh-control-min-w));
|
|
136
|
+
border: var(--xh-stroke-thin) solid var(--xh-popselect-control-border, var(--xh-_popselect-control-border));
|
|
137
|
+
border-radius: var(--xh-popselect-control-radius, var(--xh-shape-control));
|
|
138
|
+
background: var(--xh-popselect-control-bg, var(--xh-_popselect-control-bg));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
[data-scope='popselect'][data-part='control']:hover:not([data-disabled]) {
|
|
142
|
+
border-color: var(--xh-popselect-control-border-hover, var(--xh-_popselect-control-border-hover));
|
|
72
143
|
}
|
|
73
144
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
--xh-
|
|
145
|
+
/* 焦点落在盒内任一颗按钮上都画同一圈环;禁用时按钮不可聚焦,守卫只是把这条说死。
|
|
146
|
+
描边色与环共用一族语气色 */
|
|
147
|
+
[data-scope='popselect'][data-part='control']:focus-within:not([data-disabled]) {
|
|
148
|
+
border-color: var(--xh-popselect-control-border-focus, var(--xh-_tone, var(--xh-border-control-focus)));
|
|
149
|
+
outline: var(--xh-ring-width) solid var(--xh-_popselect-ring);
|
|
150
|
+
outline-offset: var(--xh-ring-offset);
|
|
78
151
|
}
|
|
79
152
|
|
|
153
|
+
[data-scope='popselect'][data-part='control'][data-disabled] {
|
|
154
|
+
background: var(--xh-popselect-control-bg-disabled, var(--xh-bg-subtle));
|
|
155
|
+
color: var(--xh-fg-disabled);
|
|
156
|
+
cursor: not-allowed;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* 触发器退化成盒里那颗可聚焦的按钮:描边、底色与内衬归盒,它只占满剩余一行 */
|
|
80
160
|
[data-scope='popselect'][data-part='trigger'] {
|
|
81
161
|
display: inline-flex;
|
|
162
|
+
flex: 1 1 auto;
|
|
82
163
|
align-items: center;
|
|
83
164
|
justify-content: space-between;
|
|
84
165
|
gap: var(--xh-popselect-trigger-gap, var(--xh-_popselect-gap));
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
border
|
|
89
|
-
background:
|
|
166
|
+
/* 弹性子项默认最小尺寸是内容尺寸,不归零则长值把盒撑破 */
|
|
167
|
+
min-inline-size: 0;
|
|
168
|
+
padding: 0;
|
|
169
|
+
border: 0;
|
|
170
|
+
background: transparent;
|
|
90
171
|
color: var(--xh-popselect-trigger-fg, var(--xh-fg-default));
|
|
91
172
|
font-size: var(--xh-popselect-trigger-font-size, var(--xh-_popselect-font-size));
|
|
92
173
|
line-height: var(--xh-leading-none);
|
|
@@ -94,13 +175,9 @@
|
|
|
94
175
|
cursor: pointer;
|
|
95
176
|
}
|
|
96
177
|
|
|
97
|
-
|
|
98
|
-
border-color: var(--xh-popselect-trigger-border-hover, var(--xh-_popselect-trigger-border-hover));
|
|
99
|
-
}
|
|
100
|
-
|
|
178
|
+
/* 环画在盒上,按钮自己不再画:两圈套着的环读起来像两个控件 */
|
|
101
179
|
[data-scope='popselect'][data-part='trigger']:focus-visible {
|
|
102
|
-
outline:
|
|
103
|
-
outline-offset: var(--xh-ring-offset);
|
|
180
|
+
outline: none;
|
|
104
181
|
}
|
|
105
182
|
|
|
106
183
|
/* trigger 是单体控件,用原生 disabled(条目那边一律 aria-disabled) */
|
|
@@ -114,39 +191,79 @@
|
|
|
114
191
|
color: var(--xh-popselect-placeholder-fg, var(--xh-fg-subtle));
|
|
115
192
|
}
|
|
116
193
|
|
|
117
|
-
/*
|
|
118
|
-
[data-scope='popselect'][data-part='
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
194
|
+
/* 清空钮:盒里排在触发器之后的方形小钮,没值即 hidden 收起 */
|
|
195
|
+
[data-scope='popselect'][data-part='clear-trigger'] {
|
|
196
|
+
display: inline-grid;
|
|
197
|
+
flex: none;
|
|
198
|
+
place-items: center;
|
|
199
|
+
inline-size: var(--xh-popselect-action-size, var(--xh-control-action-size));
|
|
200
|
+
block-size: var(--xh-popselect-action-size, var(--xh-control-action-size));
|
|
201
|
+
padding: 0;
|
|
202
|
+
border: none;
|
|
203
|
+
border-radius: var(--xh-popselect-action-radius, var(--xh-shape-control));
|
|
204
|
+
background: none;
|
|
205
|
+
color: var(--xh-popselect-clear-fg, var(--xh-fg-subtle));
|
|
206
|
+
line-height: var(--xh-leading-none);
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
transition:
|
|
209
|
+
background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
210
|
+
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
211
|
+
scale var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
123
212
|
}
|
|
124
213
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
214
|
+
[data-scope='popselect'][data-part='clear-trigger']:hover {
|
|
215
|
+
background: var(--xh-popselect-clear-bg-hover, var(--xh-bg-subtle-hover));
|
|
216
|
+
color: var(--xh-popselect-clear-fg-hover, var(--xh-fg-default));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
[data-scope='popselect'][data-part='clear-trigger']:active {
|
|
220
|
+
background: var(--xh-popselect-clear-bg-active, var(--xh-bg-subtle-active));
|
|
221
|
+
scale: var(--xh-motion-scale-press);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
[data-scope='popselect'][data-part='clear-trigger']:focus-visible {
|
|
225
|
+
outline: var(--xh-ring-width) solid var(--xh-_popselect-ring);
|
|
226
|
+
outline-offset: var(--xh-ring-offset);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
[data-scope='popselect'][data-part='clear-trigger'][hidden] {
|
|
230
|
+
display: none;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* 没写内容就由皮肤画叉;作者往部件里塞了自己的图形,这条规则即不命中 */
|
|
234
|
+
[data-scope='popselect'][data-part='clear-trigger']:empty::before {
|
|
235
|
+
content: '';
|
|
236
|
+
display: inline-block;
|
|
237
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
238
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
239
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
240
|
+
background-color: currentColor;
|
|
241
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
242
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
128
243
|
}
|
|
129
244
|
|
|
130
245
|
[data-scope='popselect'][data-part='content'] {
|
|
131
246
|
display: flex;
|
|
132
247
|
flex-direction: column;
|
|
133
|
-
min-inline-size: var(--xh-popselect-content-min-w, var(--xh-overlay-min-w));
|
|
248
|
+
min-inline-size: var(--xh-popselect-content-min-w, var(--xh-overlay-menu-min-w));
|
|
134
249
|
max-inline-size: var(--xh-popselect-content-max-w, var(--xh-overlay-max-w));
|
|
135
|
-
max-block-size: var(--xh-popselect-content-max-h, var(--xh-overlay-max-h));
|
|
136
|
-
padding: var(--xh-popselect-content-
|
|
250
|
+
max-block-size: min(var(--xh-popselect-content-max-h, var(--xh-overlay-menu-max-h)), var(--xh-_popselect-available-h));
|
|
251
|
+
padding-block: var(--xh-popselect-content-py, var(--xh-space-1));
|
|
252
|
+
padding-inline: var(--xh-popselect-content-px, var(--xh-space-1));
|
|
137
253
|
border: var(--xh-stroke-thin) solid var(--xh-popselect-content-border, var(--xh-border-default));
|
|
138
254
|
border-radius: var(--xh-popselect-content-radius, var(--xh-shape-surface));
|
|
139
255
|
background: var(--xh-popselect-content-bg, var(--xh-bg-surface));
|
|
140
256
|
color: var(--xh-popselect-content-fg, var(--xh-fg-default));
|
|
141
|
-
box-shadow: var(--xh-popselect-content-shadow, var(--xh-elevation-
|
|
257
|
+
box-shadow: var(--xh-popselect-content-shadow, var(--xh-elevation-floating));
|
|
142
258
|
overflow-y: auto;
|
|
143
259
|
pointer-events: auto;
|
|
144
260
|
}
|
|
145
261
|
|
|
146
|
-
/*
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
262
|
+
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 dialog 一致:
|
|
263
|
+
收起态连接层会给 content 打 hidden,而上面那条 display 正是要盖掉 UA 的
|
|
264
|
+
[hidden]{display:none}——退场动画得先能播。presence 读的是 content 的 animationName,
|
|
265
|
+
真正的收起由宿主在退场结束后落成内联 display:none(Vue 那边直接不渲染)。
|
|
266
|
+
其余声明了 display 的角色节点仍补 [hidden],那几处没有退场动画。 */
|
|
150
267
|
|
|
151
268
|
/* 焦点落在容器上只有一种情形:指针打开、无选中值、还没有任何条目当锚点。
|
|
152
269
|
那一刻它认领着 Tab 位,环画在浮层内沿;有锚点时环长在条目上,容器不再画 */
|
|
@@ -160,7 +277,13 @@
|
|
|
160
277
|
}
|
|
161
278
|
|
|
162
279
|
[data-scope='popselect'][data-part='content'][data-state='open'] {
|
|
163
|
-
animation: xh-
|
|
280
|
+
animation: xh-pop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
|
|
284
|
+
免得动画结束到真收起之间闪一下原样 */
|
|
285
|
+
[data-scope='popselect'][data-part='content'][data-state='closed'] {
|
|
286
|
+
animation: xh-pop-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
164
287
|
}
|
|
165
288
|
|
|
166
289
|
[data-scope='popselect'][data-part='item'] {
|
|
@@ -232,7 +355,14 @@
|
|
|
232
355
|
|
|
233
356
|
/* 没写内容就由皮肤画勾;作者往部件里塞了自己的图形,这条规则即不命中 */
|
|
234
357
|
[data-scope='popselect'][data-part='item-indicator']:empty::before {
|
|
235
|
-
content: '
|
|
358
|
+
content: '';
|
|
359
|
+
display: inline-block;
|
|
360
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
361
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
362
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
363
|
+
background-color: currentColor;
|
|
364
|
+
-webkit-mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
365
|
+
mask: var(--xh-glyph-mark-check) center / contain no-repeat;
|
|
236
366
|
}
|
|
237
367
|
|
|
238
368
|
[data-scope='popselect'][data-part='item-indicator'][data-state='checked'] {
|
package/css/progress.css
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
@layer xihan.motion {
|
|
2
|
+
/* 动画名的查找只认「文档里有没有这个名字」:引用别处文件里的名字,那份文件不一定在场,
|
|
3
|
+
动画会静默地整个不跑。每份皮肤都能单独引入,所以它用到的关键帧都写在自己身上。 */
|
|
4
|
+
@keyframes xh-progress-indeterminate {
|
|
5
|
+
from {
|
|
6
|
+
inset-inline-start: -40%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
to {
|
|
10
|
+
inset-inline-start: 100%;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
1
15
|
@layer xihan.components {
|
|
2
16
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
3
17
|
[data-scope='progress'] {
|
|
@@ -7,7 +21,7 @@
|
|
|
7
21
|
/* 私有槽位:组件令牌 → 中档字面量两级回退。厚度写在 root 上而不是 track 上,
|
|
8
22
|
尺寸档才改得动一处就够,track 靠继承拿到值。 */
|
|
9
23
|
[data-scope='progress'][data-part='root'] {
|
|
10
|
-
--xh-_thickness: var(--xh-progress-thickness,
|
|
24
|
+
--xh-_thickness: var(--xh-progress-thickness, var(--xh-track-thickness));
|
|
11
25
|
|
|
12
26
|
display: inline-block;
|
|
13
27
|
inline-size: 100%;
|
|
@@ -95,15 +109,41 @@
|
|
|
95
109
|
transition: stroke-dashoffset var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
96
110
|
}
|
|
97
111
|
|
|
98
|
-
/*
|
|
99
|
-
|
|
100
|
-
|
|
112
|
+
/* 进度未知:线形条改为一小段来回扫。宽度交给动画,连接层算出的 inline-size 与
|
|
113
|
+
那条过渡都得让开,否则每帧都在跟动画抢同一个属性 */
|
|
114
|
+
[data-scope='progress'][data-part='track'][data-state='indeterminate'] {
|
|
115
|
+
position: relative;
|
|
116
|
+
overflow: hidden;
|
|
101
117
|
}
|
|
102
118
|
|
|
103
|
-
|
|
119
|
+
[data-scope='progress'][data-part='range'][data-state='indeterminate'] {
|
|
120
|
+
position: absolute;
|
|
121
|
+
inline-size: 40%;
|
|
122
|
+
transition: none;
|
|
123
|
+
animation: xh-progress-indeterminate var(--xh-progress-indeterminate-duration, calc(var(--xh-spin-duration) * 2)) var(--xh-ease-standard) infinite;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* 减弱动效档:不来回扫,改成一条铺满的静态条——进度仍然未知,只是不再动。
|
|
127
|
+
两条规则是同一件事的两个触发条件:系统偏好与作者打的 data-motion */
|
|
104
128
|
@media (prefers-reduced-motion: reduce) {
|
|
105
|
-
[data-scope='progress'][data-part='range'] {
|
|
106
|
-
|
|
129
|
+
[data-scope='progress'][data-part='range'][data-state='indeterminate'] {
|
|
130
|
+
position: static;
|
|
131
|
+
inline-size: 100%;
|
|
132
|
+
opacity: 0.5;
|
|
133
|
+
animation: none;
|
|
107
134
|
}
|
|
108
135
|
}
|
|
136
|
+
|
|
137
|
+
:where([data-motion='reduce']) [data-scope='progress'][data-part='range'][data-state='indeterminate'] {
|
|
138
|
+
position: static;
|
|
139
|
+
inline-size: 100%;
|
|
140
|
+
opacity: 0.5;
|
|
141
|
+
animation: none;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* 零进度:圆角端点会在长度为 0 处画出一个圆点,收掉它 */
|
|
145
|
+
[data-scope='progress'][data-part='range'][data-empty] {
|
|
146
|
+
visibility: hidden;
|
|
147
|
+
}
|
|
148
|
+
|
|
109
149
|
}
|
package/css/qr-code.css
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
[data-scope='qr-code'][data-part='root'] {
|
|
19
19
|
display: block;
|
|
20
|
-
border-radius: var(--xh-qr-code-radius, var(--xh-
|
|
20
|
+
border-radius: var(--xh-qr-code-radius, var(--xh-shape-control));
|
|
21
21
|
background: var(--xh-qr-code-bg, var(--xh-color-neutral-0));
|
|
22
22
|
|
|
23
23
|
/* 模块那条 path 不带自己的填充色,从这里继承下去 */
|