@xihan-ui/styles 3.0.0 → 3.2.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 +63 -0
- package/README.md +1 -1
- package/component-tokens.d.ts +29 -0
- package/components.tokens.json +683 -27
- package/css/alert.css +2 -2
- package/css/approval.css +4 -4
- package/css/button.css +9 -5
- package/css/calendar-picker.css +3 -3
- package/css/calendar-range-picker.css +7 -7
- package/css/carousel.css +45 -13
- package/css/cartesian-chart.css +11 -11
- package/css/cascader.css +10 -10
- package/css/citation.css +2 -2
- package/css/code-view.css +6 -6
- package/css/color-picker.css +81 -0
- package/css/color-swatch-picker.css +9 -4
- package/css/combobox.css +12 -4
- package/css/command.css +1 -1
- package/css/date-field.css +39 -0
- package/css/date-picker.css +86 -9
- package/css/date-range-picker.css +47 -7
- package/css/diff-view.css +8 -8
- package/css/field-array.css +1 -1
- package/css/field.css +4 -0
- package/css/file-upload.css +1 -1
- package/css/float-button.css +140 -27
- package/css/form.css +14 -6
- package/css/graph-chart.css +2 -2
- package/css/highlight.css +1 -1
- package/css/image.css +1 -1
- package/css/mention.css +1 -1
- package/css/message-feed.css +1 -1
- package/css/notification.css +26 -20
- package/css/number-field.css +18 -18
- package/css/page-header.css +2 -2
- package/css/password-input.css +2 -2
- package/css/popconfirm.css +3 -3
- package/css/question-flow.css +8 -8
- package/css/radar-chart.css +6 -6
- package/css/rating.css +1 -1
- package/css/select.css +2 -2
- package/css/separator.css +2 -2
- package/css/side-nav.css +13 -13
- package/css/skeleton.css +5 -5
- package/css/slider.css +6 -6
- package/css/sortable.css +2 -2
- package/css/table.css +19 -2
- package/css/tags-input.css +1 -1
- package/css/time-picker.css +59 -2
- package/css/tool-call.css +7 -7
- package/css/tooltip.css +1 -1
- package/css/tree-select.css +2 -2
- package/css/tree.css +81 -11
- package/dist/css/accordion.css +269 -0
- package/dist/css/affix.css +47 -0
- package/dist/css/alert.css +247 -0
- package/dist/css/anchor.css +252 -0
- package/dist/css/approval.css +501 -0
- package/dist/css/avatar-group.css +99 -0
- package/dist/css/avatar.css +98 -0
- package/dist/css/back-top.css +161 -0
- package/dist/css/badge.css +205 -0
- package/dist/css/bar-code.css +62 -0
- package/dist/css/breadcrumb.css +230 -0
- package/dist/css/button-group.css +263 -0
- package/dist/css/button.css +219 -0
- package/dist/css/calendar-picker.css +467 -0
- package/dist/css/calendar-range-picker.css +554 -0
- package/dist/css/card.css +221 -0
- package/dist/css/carousel.css +710 -0
- package/dist/css/cartesian-chart.css +830 -0
- package/dist/css/cascader.css +961 -0
- package/dist/css/checkbox-group.css +358 -0
- package/dist/css/checkbox.css +257 -0
- package/dist/css/citation.css +470 -0
- package/dist/css/clipboard.css +315 -0
- package/dist/css/code-view.css +374 -0
- package/dist/css/collapsible.css +185 -0
- package/dist/css/color-field.css +176 -0
- package/dist/css/color-picker.css +595 -0
- package/dist/css/color-slider.css +281 -0
- package/dist/css/color-swatch-picker.css +250 -0
- package/dist/css/color-swatch.css +35 -0
- package/dist/css/combobox.css +574 -0
- package/dist/css/command.css +399 -0
- package/dist/css/context-menu.css +420 -0
- package/dist/css/date-field.css +317 -0
- package/dist/css/date-picker.css +868 -0
- package/dist/css/date-range-picker.css +886 -0
- package/dist/css/description.css +67 -0
- package/dist/css/descriptions.css +299 -0
- package/dist/css/dialog.css +455 -0
- package/dist/css/diff-view.css +513 -0
- package/dist/css/download-trigger.css +151 -0
- package/dist/css/drawer.css +552 -0
- package/dist/css/editable.css +295 -0
- package/dist/css/empty-state.css +163 -0
- package/dist/css/field-array.css +226 -0
- package/dist/css/field.css +166 -0
- package/dist/css/fieldset.css +102 -0
- package/dist/css/file-upload.css +429 -0
- package/dist/css/flex.css +441 -0
- package/dist/css/float-button.css +569 -0
- package/dist/css/floating-panel.css +429 -0
- package/dist/css/focus.css +46 -0
- package/dist/css/forced-colors.css +93 -0
- package/dist/css/form.css +393 -0
- package/dist/css/funnel-chart.css +106 -0
- package/dist/css/graph-chart.css +205 -0
- package/dist/css/grid-list.css +235 -0
- package/dist/css/grid.css +1201 -0
- package/dist/css/heatmap.css +552 -0
- package/dist/css/hierarchy-chart.css +298 -0
- package/dist/css/highlight.css +41 -0
- package/dist/css/hover-card.css +226 -0
- package/dist/css/icon.css +225 -0
- package/dist/css/image-cropper.css +373 -0
- package/dist/css/image-viewer.css +538 -0
- package/dist/css/image.css +98 -0
- package/dist/css/infinite-scroll.css +77 -0
- package/dist/css/input-group.css +275 -0
- package/dist/css/json-viewer.css +379 -0
- package/dist/css/kbd.css +72 -0
- package/dist/css/label.css +78 -0
- package/dist/css/layers.css +7 -0
- package/dist/css/layout.css +372 -0
- package/dist/css/liquid.css +106 -0
- package/dist/css/list.css +152 -0
- package/dist/css/listbox.css +390 -0
- package/dist/css/loading-bar.css +141 -0
- package/dist/css/log.css +306 -0
- package/dist/css/markdown-stream.css +149 -0
- package/dist/css/marquee.css +378 -0
- package/dist/css/masonry.css +70 -0
- package/dist/css/matrix-code.css +67 -0
- package/dist/css/mention.css +393 -0
- package/dist/css/menu.css +364 -0
- package/dist/css/menubar.css +456 -0
- package/dist/css/message-feed.css +318 -0
- package/dist/css/navigation-menu.css +513 -0
- package/dist/css/notification.css +782 -0
- package/dist/css/number-animation.css +44 -0
- package/dist/css/number-field.css +252 -0
- package/dist/css/overlay-arrow.css +56 -0
- package/dist/css/page-header.css +184 -0
- package/dist/css/pagination.css +450 -0
- package/dist/css/password-input.css +391 -0
- package/dist/css/pie-chart.css +247 -0
- package/dist/css/pin-input.css +199 -0
- package/dist/css/pointer.css +36 -0
- package/dist/css/popconfirm.css +320 -0
- package/dist/css/popover.css +279 -0
- package/dist/css/progress.css +501 -0
- package/dist/css/prompt-input.css +260 -0
- package/dist/css/question-flow.css +553 -0
- package/dist/css/radar-chart.css +233 -0
- package/dist/css/radio-group.css +598 -0
- package/dist/css/rating.css +294 -0
- package/dist/css/reasoning.css +343 -0
- package/dist/css/reset.css +117 -0
- package/dist/css/resizable.css +242 -0
- package/dist/css/sankey-chart.css +174 -0
- package/dist/css/scroll-area.css +240 -0
- package/dist/css/scrollbar.css +204 -0
- package/dist/css/select.css +612 -0
- package/dist/css/separator.css +122 -0
- package/dist/css/side-nav.css +476 -0
- package/dist/css/signature-pad.css +179 -0
- package/dist/css/skeleton.css +161 -0
- package/dist/css/slider.css +374 -0
- package/dist/css/sortable.css +228 -0
- package/dist/css/sparkline.css +164 -0
- package/dist/css/spinner.css +236 -0
- package/dist/css/splitter.css +159 -0
- package/dist/css/statistic.css +137 -0
- package/dist/css/steps.css +627 -0
- package/dist/css/switch.css +351 -0
- package/dist/css/table.css +1145 -0
- package/dist/css/tabs.css +944 -0
- package/dist/css/tag-group.css +247 -0
- package/dist/css/tag.css +310 -0
- package/dist/css/tags-input.css +322 -0
- package/dist/css/text-field.css +197 -0
- package/dist/css/time-field.css +277 -0
- package/dist/css/time-picker.css +707 -0
- package/dist/css/time-range-picker.css +746 -0
- package/dist/css/timeline.css +423 -0
- package/dist/css/timer.css +123 -0
- package/dist/css/timestamp.css +34 -0
- package/dist/css/toggle-group.css +424 -0
- package/dist/css/toggle.css +146 -0
- package/dist/css/tone.css +189 -0
- package/dist/css/tool-call.css +429 -0
- package/dist/css/toolbar.css +365 -0
- package/dist/css/tooltip.css +218 -0
- package/dist/css/tour.css +439 -0
- package/dist/css/transfer.css +638 -0
- package/dist/css/tree-select.css +878 -0
- package/dist/css/tree.css +733 -0
- package/dist/css/truncate.css +108 -0
- package/dist/css/typography.css +472 -0
- package/dist/css/undefined.css +58 -0
- package/dist/css/virtualizer.css +166 -0
- package/dist/css/visually-hidden.css +20 -0
- package/dist/css/watermark.css +82 -0
- package/dist/family/action-control.css +487 -0
- package/dist/family/chart.css +480 -0
- package/dist/family/check-mark.css +94 -0
- package/dist/family/choice-card.css +97 -0
- package/dist/family/collection-item.css +764 -0
- package/dist/family/field-chrome.css +287 -0
- package/dist/family/loading-ring.css +95 -0
- package/dist/family/material.css +72 -0
- package/dist/family/menu-choice.css +56 -0
- package/dist/family/motion.css +363 -0
- package/dist/family/swatch.css +59 -0
- package/dist/family/tag-list.css +59 -0
- package/family/action-control.css +3 -12
- package/index.css +7307 -6759
- package/index.unlayered.css +7309 -6761
- package/package.json +165 -164
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-Present XiHanFun and contributors.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* 定义 form 样式。 */
|
|
7
|
+
|
|
8
|
+
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立。 */
|
|
9
|
+
@import '../family/motion.css';
|
|
10
|
+
/* Form 独立皮肤同时传递引入提交 / 重置钮的动作控件配方;full bundle 递归去重。 */
|
|
11
|
+
@import '../family/action-control.css';
|
|
12
|
+
@import '../family/loading-ring.css';
|
|
13
|
+
|
|
14
|
+
@layer xihan.components {
|
|
15
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
16
|
+
.xh-scope-form {
|
|
17
|
+
--xh-form-skin: 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* 表单是一列字段:竖排、字段之间留一档间距。root 就是那个原生 <form> */
|
|
21
|
+
.xh-scope-form[data-part='root'] {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
gap: var(--xh-form-gap, var(--xh-stack-gap-md));
|
|
25
|
+
margin: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* 网格:字段排进等宽列,各列下限写 0,一段长文本不会把自己那列撑宽。
|
|
29
|
+
列数由 data-columns 逐档给,换档只改 --xh-_form-cols 这一个槽 */
|
|
30
|
+
.xh-scope-form[data-part='root'][data-layout='grid'] {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: repeat(var(--xh-_form-cols), minmax(0, 1fr));
|
|
33
|
+
|
|
34
|
+
--xh-_form-cols: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* 只要声明了 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去 */
|
|
38
|
+
.xh-scope-form[data-part='root'][hidden] {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* 横排一行流:字段并肩排,放不下自动折行 */
|
|
43
|
+
.xh-scope-form[data-part='root'][data-layout='inline'] {
|
|
44
|
+
flex-flow: row wrap;
|
|
45
|
+
align-items: start;
|
|
46
|
+
column-gap: var(--xh-form-inline-gap, var(--xh-space-4));
|
|
47
|
+
/* 一行流里字段按内容收,没有列宽可铺:在表单根上取下此处的字段缺省宽,交给下面的字段还原 */
|
|
48
|
+
--xh-_form-inline-control-w: var(--xh-control-w);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* 字段会把里面的控件铺满字段宽,而一行流的字段宽正是由控件撑出来的,两者互相指望就塌成内容宽;
|
|
52
|
+
这一档的字段还原成表单根上的缺省宽 */
|
|
53
|
+
.xh-scope-form[data-part='root'][data-layout='inline'] .xh-scope-field[data-part='root'] {
|
|
54
|
+
--xh-control-w: var(--xh-_form-inline-control-w);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* 一列是网格档的缺省,这里从两列起逐档写 */
|
|
58
|
+
.xh-scope-form[data-part='root'][data-columns='2'] {
|
|
59
|
+
--xh-_form-cols: 2;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.xh-scope-form[data-part='root'][data-columns='3'] {
|
|
63
|
+
--xh-_form-cols: 3;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.xh-scope-form[data-part='root'][data-columns='4'] {
|
|
67
|
+
--xh-_form-cols: 4;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* 逐档列数:移动优先,先按 data-columns 排定,视口每宽到一档就换成那一档的列数,
|
|
71
|
+
没写的档沿用比它窄的那一档。四档自窄到宽依次写,只用 min-width:媒体查询不改选择器权重,
|
|
72
|
+
宽视口上同时命中好几档时由源码序决定谁生效。
|
|
73
|
+
宽度写字面量:自定义属性在 @media 条件里不参与求值。
|
|
74
|
+
每档都从一列写起:base 分多列、某一档收回一列同样是合法的一档 */
|
|
75
|
+
@media (min-width: 640px) {
|
|
76
|
+
.xh-scope-form[data-part='root'][data-columns-sm='1'] {
|
|
77
|
+
--xh-_form-cols: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.xh-scope-form[data-part='root'][data-columns-sm='2'] {
|
|
81
|
+
--xh-_form-cols: 2;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.xh-scope-form[data-part='root'][data-columns-sm='3'] {
|
|
85
|
+
--xh-_form-cols: 3;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.xh-scope-form[data-part='root'][data-columns-sm='4'] {
|
|
89
|
+
--xh-_form-cols: 4;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@media (min-width: 768px) {
|
|
94
|
+
.xh-scope-form[data-part='root'][data-columns-md='1'] {
|
|
95
|
+
--xh-_form-cols: 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.xh-scope-form[data-part='root'][data-columns-md='2'] {
|
|
99
|
+
--xh-_form-cols: 2;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.xh-scope-form[data-part='root'][data-columns-md='3'] {
|
|
103
|
+
--xh-_form-cols: 3;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.xh-scope-form[data-part='root'][data-columns-md='4'] {
|
|
107
|
+
--xh-_form-cols: 4;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media (min-width: 1024px) {
|
|
112
|
+
.xh-scope-form[data-part='root'][data-columns-lg='1'] {
|
|
113
|
+
--xh-_form-cols: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.xh-scope-form[data-part='root'][data-columns-lg='2'] {
|
|
117
|
+
--xh-_form-cols: 2;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.xh-scope-form[data-part='root'][data-columns-lg='3'] {
|
|
121
|
+
--xh-_form-cols: 3;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.xh-scope-form[data-part='root'][data-columns-lg='4'] {
|
|
125
|
+
--xh-_form-cols: 4;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@media (min-width: 1280px) {
|
|
130
|
+
.xh-scope-form[data-part='root'][data-columns-xl='1'] {
|
|
131
|
+
--xh-_form-cols: 1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.xh-scope-form[data-part='root'][data-columns-xl='2'] {
|
|
135
|
+
--xh-_form-cols: 2;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.xh-scope-form[data-part='root'][data-columns-xl='3'] {
|
|
139
|
+
--xh-_form-cols: 3;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.xh-scope-form[data-part='root'][data-columns-xl='4'] {
|
|
143
|
+
--xh-_form-cols: 4;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* 字段容器只管排版与状态标记:标题、控件、描述、错误文案都是里面那个 Field 的活儿 */
|
|
148
|
+
.xh-scope-form[data-part='field-group'] {
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-direction: column;
|
|
151
|
+
gap: var(--xh-form-field-gap, var(--xh-space-1));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.xh-scope-form[data-part='field-group'][hidden] {
|
|
155
|
+
display: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* 网格排布下这一格占多宽,不写就占一列 */
|
|
159
|
+
.xh-scope-form[data-part='root'][data-layout='grid'] .xh-scope-form[data-part='field-group'] {
|
|
160
|
+
grid-column: var(--xh-_form-span, auto);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* 占一列是上面的缺省,这里从跨两列起逐档写 */
|
|
164
|
+
.xh-scope-form[data-part='field-group'][data-span='2'] {
|
|
165
|
+
--xh-_form-span: auto / span 2;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.xh-scope-form[data-part='field-group'][data-span='3'] {
|
|
169
|
+
--xh-_form-span: auto / span 3;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.xh-scope-form[data-part='field-group'][data-span='4'] {
|
|
173
|
+
--xh-_form-span: auto / span 4;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* 占满整行:从第一条列线排到最后一条,列数换档时不必跟着改跨度 */
|
|
177
|
+
.xh-scope-form[data-part='field-group'][data-span='full'] {
|
|
178
|
+
--xh-_form-span: 1 / -1;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* 出错的字段在起始缘竖一条色带:读屏之外还得有一眼看得见的定位标记。
|
|
182
|
+
用逻辑属性,RTL 下自动换到右侧 */
|
|
183
|
+
.xh-scope-form[data-part='field-group'][data-invalid] {
|
|
184
|
+
padding-inline-start: var(--xh-form-field-invalid-px, var(--xh-space-2));
|
|
185
|
+
border-inline-start: var(--xh-stroke-thick) solid var(--xh-form-field-invalid-border, var(--xh-border-invalid));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* 提交失败后的错误汇总。role=alert 常挂,靠 hidden 显隐 */
|
|
189
|
+
.xh-scope-form[data-part='error-summary'] {
|
|
190
|
+
display: flex;
|
|
191
|
+
flex-direction: column;
|
|
192
|
+
gap: var(--xh-form-summary-gap, var(--xh-space-1_5));
|
|
193
|
+
padding-block: var(--xh-form-summary-py, var(--xh-space-3));
|
|
194
|
+
padding-inline: var(--xh-form-summary-px, var(--xh-control-px-md));
|
|
195
|
+
border: var(--xh-stroke-thin) solid var(--xh-form-summary-border, var(--xh-border-invalid));
|
|
196
|
+
border-radius: var(--xh-form-summary-radius, var(--xh-shape-surface));
|
|
197
|
+
background: var(--xh-form-summary-bg, var(--xh-bg-surface));
|
|
198
|
+
color: var(--xh-form-summary-fg, var(--xh-fg-danger));
|
|
199
|
+
font-size: var(--xh-form-summary-font-size, var(--xh-text-body-size));
|
|
200
|
+
line-height: var(--xh-leading-normal);
|
|
201
|
+
/* 静态反馈面:边界由描边承担,不带落影(solid 无影) */
|
|
202
|
+
box-shadow: var(--xh-form-summary-shadow, none);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* 漏了这条,摘要一旦出现过就再也撤不下去(上面那条 display 盖掉了 UA 的 [hidden] 规则) */
|
|
206
|
+
.xh-scope-form[data-part='error-summary'][hidden] {
|
|
207
|
+
display: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* 摘要不承载焦点(焦点直接送去出错的字段),它只是一段播报,落焦时不画环 */
|
|
211
|
+
.xh-scope-form[data-part='error-summary']:focus-visible {
|
|
212
|
+
outline: none;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* 从收起翻成显出的那一下给一小段入场:读屏靠 role=alert 播报,
|
|
216
|
+
视觉这边也得有个"它是刚冒出来的"的交代,否则像一直杵在那儿 */
|
|
217
|
+
.xh-scope-form[data-part='error-summary'][data-state='invalid'] {
|
|
218
|
+
animation: xh-drop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* 错误全改完或重置时淡出,播完连接层才写 hidden。收起态常挂 hidden,这条只在退场途中命中 */
|
|
222
|
+
.xh-scope-form[data-part='error-summary'][data-state='idle'] {
|
|
223
|
+
animation: xh-fade-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* 摘要里的每一条是一个真链接,指向对应字段容器。铺满一行的集合行:悬停 / 按下只换面不缩放,
|
|
227
|
+
底面坐在摘要的 surface 白底上,走白底承载阶梯 100 → 200;换面按下走 press,其余走 micro */
|
|
228
|
+
.xh-scope-form[data-part='error-summary-item'] {
|
|
229
|
+
display: block;
|
|
230
|
+
padding-inline: var(--xh-form-summary-item-px, var(--xh-space-1));
|
|
231
|
+
border-radius: var(--xh-form-summary-item-radius, var(--xh-shape-control));
|
|
232
|
+
background: var(--xh-form-summary-item-bg, transparent);
|
|
233
|
+
color: inherit;
|
|
234
|
+
font-size: var(--xh-form-summary-item-font-size, var(--xh-text-secondary-size));
|
|
235
|
+
text-decoration: underline;
|
|
236
|
+
text-underline-offset: var(--xh-form-summary-item-underline-offset, var(--xh-space-0_5));
|
|
237
|
+
cursor: pointer;
|
|
238
|
+
transition:
|
|
239
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
240
|
+
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* 没有对应错误的条目由连接层给 hidden;上面那条 display 已把 UA 规则盖掉 */
|
|
244
|
+
.xh-scope-form[data-part='error-summary-item'][hidden] {
|
|
245
|
+
display: none;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* 摘要显出时条目逐条入场,越靠后起步越晚。
|
|
249
|
+
backwards 让还没轮到的条目停在首帧,不是先显出再重播 */
|
|
250
|
+
.xh-scope-form[data-part='error-summary'][data-state='invalid'] [data-part='error-summary-item']:where(.xh-scope-form) {
|
|
251
|
+
animation: xh-drop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong) backwards;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* 排序按"前面有几条露面的"数,不按 nth-child:作者一次把所有字段的条目都写上,
|
|
255
|
+
没出错的那些带着 hidden 留在 DOM 里,按位置数会把空号也算进去。
|
|
256
|
+
每多一节 ~ 就多要求前面多一条露面的条目,链越长的规则排得越后、赢过短链 */
|
|
257
|
+
.xh-scope-form[data-part='error-summary'][data-state='invalid']
|
|
258
|
+
[data-part='error-summary-item']:not([hidden])
|
|
259
|
+
~ [data-part='error-summary-item']:where(.xh-scope-form):not([hidden]) {
|
|
260
|
+
animation-delay: var(--xh-motion-stagger-step);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.xh-scope-form[data-part='error-summary'][data-state='invalid']
|
|
264
|
+
[data-part='error-summary-item']:not([hidden])
|
|
265
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
266
|
+
~ [data-part='error-summary-item']:where(.xh-scope-form):not([hidden]) {
|
|
267
|
+
animation-delay: calc(var(--xh-motion-stagger-step) * 2);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.xh-scope-form[data-part='error-summary'][data-state='invalid']
|
|
271
|
+
[data-part='error-summary-item']:not([hidden])
|
|
272
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
273
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
274
|
+
~ [data-part='error-summary-item']:where(.xh-scope-form):not([hidden]) {
|
|
275
|
+
animation-delay: calc(var(--xh-motion-stagger-step) * 3);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.xh-scope-form[data-part='error-summary'][data-state='invalid']
|
|
279
|
+
[data-part='error-summary-item']:not([hidden])
|
|
280
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
281
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
282
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
283
|
+
~ [data-part='error-summary-item']:where(.xh-scope-form):not([hidden]) {
|
|
284
|
+
animation-delay: calc(var(--xh-motion-stagger-step) * 4);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* 第 6 条起共用同一档延迟:这条要求前面有五条露面的,第七条往后同样命中,
|
|
288
|
+
错误多时整批的等待时间不再随条数增长 */
|
|
289
|
+
.xh-scope-form[data-part='error-summary'][data-state='invalid']
|
|
290
|
+
[data-part='error-summary-item']:not([hidden])
|
|
291
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
292
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
293
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
294
|
+
~ [data-part='error-summary-item']:not([hidden])
|
|
295
|
+
~ [data-part='error-summary-item']:where(.xh-scope-form):not([hidden]) {
|
|
296
|
+
animation-delay: calc(var(--xh-motion-stagger-step) * 5);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.xh-scope-form[data-part='error-summary-item']:hover {
|
|
300
|
+
background: var(--xh-form-summary-item-bg-hover, var(--xh-bg-subtle));
|
|
301
|
+
color: var(--xh-form-summary-item-fg-hover, var(--xh-fg-danger-hover));
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/* 指针 :active 与 Headless 投影的 data-pressed(Space / Enter 与触屏按住)看见同一副按压面 */
|
|
305
|
+
.xh-scope-form[data-part='error-summary-item']:is(:active, [data-pressed]) {
|
|
306
|
+
background: var(--xh-form-summary-item-bg-pressed, var(--xh-bg-subtle-hover));
|
|
307
|
+
color: var(--xh-form-summary-item-fg-hover, var(--xh-fg-danger-hover));
|
|
308
|
+
transition-duration: var(--xh-motion-duration-press);
|
|
309
|
+
transition-timing-function: var(--xh-motion-ease-press);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/* 高对比档里底色被系统换掉,按下那一档用系统高亮反色画回 */
|
|
313
|
+
@media (forced-colors: active) {
|
|
314
|
+
.xh-scope-form[data-part='error-summary-item']:is(:active, [data-pressed]) {
|
|
315
|
+
background: Highlight;
|
|
316
|
+
color: HighlightText;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* 两颗按钮是离散动作控件:盒几何、悬停 / 按下与 0.97 按压、焦点环、禁用面全由 Action Control 的 text 档给,
|
|
321
|
+
组件只映射既有使用者槽。提交走 solid 档:表单提交是这一组里的主要动作,与 Button 缺省同为品牌实心;
|
|
322
|
+
重置走 outline 档:非 Button 的触发器缺省中性描边。两颗共用的几何与字号写在一起 */
|
|
323
|
+
.xh-scope-form[data-part='submit-trigger'],
|
|
324
|
+
.xh-scope-form[data-part='reset-trigger'] {
|
|
325
|
+
--xh-action-visual-size: var(--xh-form-trigger-h, var(--xh-_action-profile-visual-size));
|
|
326
|
+
--xh-action-padding-inline: var(--xh-form-trigger-px, var(--xh-_action-profile-padding-inline));
|
|
327
|
+
--xh-action-radius: var(--xh-form-trigger-radius, var(--xh-shape-control));
|
|
328
|
+
--xh-action-font-size: var(--xh-form-trigger-font-size, var(--xh-text-body-size));
|
|
329
|
+
|
|
330
|
+
/* 按钮不参与弹性伸缩 */
|
|
331
|
+
flex: none;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/* 家族那条 display 会把 UA 的 [hidden]{display:none} 盖掉 */
|
|
335
|
+
.xh-scope-form[data-part='submit-trigger'][hidden],
|
|
336
|
+
.xh-scope-form[data-part='reset-trigger'][hidden] {
|
|
337
|
+
display: none;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* 重置钮:中性描边,底 / 边 / 字与禁用面映到 outline 档的桥接槽(透明底 → 100 → 200) */
|
|
341
|
+
.xh-scope-form[data-part='reset-trigger'] {
|
|
342
|
+
--xh-action-bg-rest: var(--xh-form-trigger-bg, var(--xh-_action-variant-bg-rest));
|
|
343
|
+
--xh-action-bg-hover: var(--xh-form-trigger-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
344
|
+
--xh-action-bg-pressed: var(--xh-form-trigger-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
345
|
+
--xh-action-bg-disabled: var(--xh-form-trigger-bg-disabled, var(--xh-_action-variant-bg-disabled));
|
|
346
|
+
--xh-action-fg-rest: var(--xh-form-trigger-fg, var(--xh-_action-variant-fg-rest));
|
|
347
|
+
--xh-action-fg-hover: var(--xh-form-trigger-fg, var(--xh-_action-variant-fg-hover));
|
|
348
|
+
--xh-action-fg-pressed: var(--xh-form-trigger-fg, var(--xh-_action-variant-fg-pressed));
|
|
349
|
+
--xh-action-border-rest: var(--xh-form-trigger-border, var(--xh-_action-variant-border-rest));
|
|
350
|
+
--xh-action-border-hover: var(--xh-form-trigger-border-hover, var(--xh-_action-variant-border-hover));
|
|
351
|
+
--xh-action-border-disabled: var(--xh-form-trigger-border-disabled, var(--xh-_action-variant-border-disabled));
|
|
352
|
+
--xh-action-highlight-rest: transparent;
|
|
353
|
+
--xh-action-shadow-rest: none;
|
|
354
|
+
--xh-action-shadow-hover: none;
|
|
355
|
+
--xh-action-shadow-pressed: none;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* 提交钮:品牌实心,顶边一条极浅的内高光把这块面衬出厚度(三态同一支,禁用面由家族收掉)。
|
|
359
|
+
面是实心的,环色与面同族,画在面里就看不出来;环改取面自己的前景色——
|
|
360
|
+
那一族色本来就要在这块面上把字读清楚,与面的对比是按可读性定的 */
|
|
361
|
+
.xh-scope-form[data-part='submit-trigger'] {
|
|
362
|
+
--xh-action-bg-rest: var(--xh-form-submit-bg, var(--xh-_action-variant-bg-rest));
|
|
363
|
+
--xh-action-bg-hover: var(--xh-form-submit-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
364
|
+
--xh-action-bg-pressed: var(--xh-form-submit-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
365
|
+
--xh-action-bg-disabled: var(--xh-form-trigger-bg-disabled, var(--xh-_action-variant-bg-disabled));
|
|
366
|
+
--xh-action-fg-rest: var(--xh-form-submit-fg, var(--xh-_action-variant-fg-rest));
|
|
367
|
+
--xh-action-fg-hover: var(--xh-form-submit-fg, var(--xh-_action-variant-fg-hover));
|
|
368
|
+
--xh-action-fg-pressed: var(--xh-form-submit-fg, var(--xh-_action-variant-fg-pressed));
|
|
369
|
+
--xh-action-border-rest: var(--xh-form-submit-border, var(--xh-_action-variant-border-rest));
|
|
370
|
+
--xh-action-border-hover: var(--xh-form-submit-border-hover, var(--xh-_action-variant-border-hover));
|
|
371
|
+
--xh-action-border-pressed: var(--xh-form-submit-border-active, var(--xh-_action-variant-border-pressed));
|
|
372
|
+
--xh-action-border-disabled: var(--xh-form-trigger-border-disabled, var(--xh-_action-variant-border-disabled));
|
|
373
|
+
--xh-action-highlight-rest: transparent;
|
|
374
|
+
--xh-action-shadow-rest: var(--xh-form-submit-shadow, var(--xh-_highlight-brand));
|
|
375
|
+
--xh-action-shadow-hover: var(--xh-form-submit-shadow, var(--xh-_highlight-brand));
|
|
376
|
+
--xh-action-shadow-pressed: var(--xh-form-submit-shadow, var(--xh-_highlight-brand));
|
|
377
|
+
--xh-action-ring-color-focus-visible: currentColor;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* 提交回调在途:环由加载环配方压在提交钮正中(连接层投影 data-xh-loading-ring="overlay"),直径取钮的图标档,
|
|
381
|
+
起始边取钮的真实前景、转速认使用者槽。不是禁用,焦点与对比度都保持,在途指针由家族 loading 面给。
|
|
382
|
+
提交文案随前景淡到透明留位:进入在途等一个 micro 才起淡(快速落定什么都不闪),落定时不等、按 micro 淡回 */
|
|
383
|
+
.xh-scope-form[data-part='submit-trigger'] {
|
|
384
|
+
--xh-_loading-ring-fg: var(--xh-form-submit-fg, var(--xh-_action-variant-fg-loading));
|
|
385
|
+
--xh-_loading-ring-duration: var(--xh-form-loading-duration, var(--xh-motion-loop-spin));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.xh-scope-form[data-part='submit-trigger'][data-loading] {
|
|
389
|
+
--xh-action-fg-loading: transparent;
|
|
390
|
+
|
|
391
|
+
transition-delay: var(--xh-motion-duration-micro);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-Present XiHanFun and contributors.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* 定义 funnel chart 样式。 */
|
|
7
|
+
|
|
8
|
+
/* 标题、视口、提示框、空态、焦点环与顺序色阶走 Chart 家族配方。本皮肤 @import 它,单独引入仍成立。 */
|
|
9
|
+
@import '../family/motion.css';
|
|
10
|
+
@import '../family/chart.css';
|
|
11
|
+
@import '../family/loading-ring.css';
|
|
12
|
+
|
|
13
|
+
@layer xihan.components {
|
|
14
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
15
|
+
.xh-scope-funnel-chart {
|
|
16
|
+
--xh-funnel-chart-skin: 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* 几何要用的像素值以这里的私有槽为真源:机器挂载后从计算样式读它们,作者覆盖组件槽即改变几何 */
|
|
20
|
+
.xh-scope-funnel-chart[data-part='root'] {
|
|
21
|
+
--xh-_chart-metric-bar-max: var(--xh-chart-bar-max);
|
|
22
|
+
--xh-_chart-metric-gap: var(--xh-funnel-chart-stage-gap, var(--xh-chart-gap));
|
|
23
|
+
--xh-_chart-metric-line-width: var(--xh-chart-line-width);
|
|
24
|
+
--xh-_chart-metric-point-size: var(--xh-chart-point-size);
|
|
25
|
+
--xh-_chart-metric-hit-min: var(--xh-chart-hit-min);
|
|
26
|
+
--xh-_chart-metric-tick-length: var(--xh-chart-tick-length);
|
|
27
|
+
--xh-_chart-metric-label-gap: var(--xh-chart-label-gap);
|
|
28
|
+
--xh-_chart-metric-radius: var(--xh-shape-inset);
|
|
29
|
+
--xh-_chart-metric-font-size: var(--xh-text-caption-size);
|
|
30
|
+
--xh-_chart-metric-leading: var(--xh-leading-tight);
|
|
31
|
+
--xh-_chart-gap: var(--xh-funnel-chart-gap, var(--xh-space-3));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* —— 家族配方的组件槽:标题、视口、提示框与空态由 family/chart.css 画,本图表的覆盖槽写在
|
|
35
|
+
对应部件上接进配方的私有槽,作者在部件或它的祖先上覆盖都生效 —— */
|
|
36
|
+
.xh-scope-funnel-chart[data-part='viewport'] {
|
|
37
|
+
--xh-_chart-height: var(--xh-funnel-chart-height, var(--xh-chart-height));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.xh-scope-funnel-chart[data-part='tooltip'] {
|
|
41
|
+
--xh-_chart-tooltip-gap: var(--xh-funnel-chart-tooltip-gap, var(--xh-space-1));
|
|
42
|
+
--xh-_chart-tooltip-py: var(--xh-funnel-chart-tooltip-py, var(--xh-surface-pad-sm));
|
|
43
|
+
--xh-_chart-tooltip-px: var(--xh-funnel-chart-tooltip-px, var(--xh-surface-pad-sm));
|
|
44
|
+
--xh-_chart-tooltip-radius: var(--xh-funnel-chart-tooltip-radius, var(--xh-shape-overlay));
|
|
45
|
+
--xh-_chart-tooltip-shadow: var(--xh-funnel-chart-tooltip-shadow, var(--xh-material-frosted-shadow));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.xh-scope-funnel-chart[data-part='tooltip-row'] {
|
|
49
|
+
--xh-_chart-tooltip-row-gap: var(--xh-funnel-chart-tooltip-row-gap, var(--xh-space-2));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.xh-scope-funnel-chart[data-part='tooltip-swatch'] {
|
|
53
|
+
--xh-_chart-tooltip-swatch-radius: var(--xh-funnel-chart-tooltip-swatch-radius, var(--xh-shape-inset));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.xh-scope-funnel-chart[data-part='empty'][data-state='loading'] {
|
|
57
|
+
--xh-_chart-empty-gap: var(--xh-funnel-chart-empty-gap, var(--xh-space-2));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* —— 阶段:顺序色阶由深入浅,颜色由 Chart 家族配方按段号与段内百分比兑好放在私有槽里;
|
|
61
|
+
相邻阶段之间的间隙由几何留出,不画描边;指着一个阶段时其余阶段淡出,被指着的不位移 —— */
|
|
62
|
+
.xh-scope-funnel-chart[data-part='stage'] {
|
|
63
|
+
fill: var(--xh-_chart-seq-fill);
|
|
64
|
+
stroke: none;
|
|
65
|
+
transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.xh-scope-funnel-chart[data-part='stage'][data-dimmed],
|
|
69
|
+
.xh-scope-funnel-chart[data-part='stage-label'][data-dimmed],
|
|
70
|
+
.xh-scope-funnel-chart[data-part='conversion'][data-dimmed] {
|
|
71
|
+
opacity: var(--xh-chart-dim-alpha);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* 阶段标签与转化率是标注:标注字色,不取色阶色 */
|
|
75
|
+
.xh-scope-funnel-chart[data-part='stage-label'],
|
|
76
|
+
.xh-scope-funnel-chart[data-part='conversion'] {
|
|
77
|
+
fill: var(--xh-chart-label);
|
|
78
|
+
font-variant-numeric: tabular-nums;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* 写在阶段里的标签压在色阶色上:深浅两端都要读得清,描一圈承载面色 */
|
|
82
|
+
.xh-scope-funnel-chart[data-part='stage-label'][data-placement='inside'] {
|
|
83
|
+
stroke: var(--xh-chart-surface);
|
|
84
|
+
stroke-width: var(--xh-stroke-thick);
|
|
85
|
+
paint-order: stroke;
|
|
86
|
+
font-weight: var(--xh-font-weight-medium);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* 强制色:阶段改成系统色的面与描边,标注取正文色;焦点环在配方里 */
|
|
90
|
+
@media (forced-colors: active) {
|
|
91
|
+
.xh-scope-funnel-chart[data-part='stage'] {
|
|
92
|
+
fill: Canvas;
|
|
93
|
+
stroke: CanvasText;
|
|
94
|
+
stroke-width: var(--xh-stroke-thin);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.xh-scope-funnel-chart[data-part='stage-label'],
|
|
98
|
+
.xh-scope-funnel-chart[data-part='conversion'] {
|
|
99
|
+
fill: CanvasText;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.xh-scope-funnel-chart[data-part='stage-label'][data-placement='inside'] {
|
|
103
|
+
stroke: Canvas;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|