@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.
Files changed (221) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +1 -1
  3. package/component-tokens.d.ts +29 -0
  4. package/components.tokens.json +683 -27
  5. package/css/alert.css +2 -2
  6. package/css/approval.css +4 -4
  7. package/css/button.css +9 -5
  8. package/css/calendar-picker.css +3 -3
  9. package/css/calendar-range-picker.css +7 -7
  10. package/css/carousel.css +45 -13
  11. package/css/cartesian-chart.css +11 -11
  12. package/css/cascader.css +10 -10
  13. package/css/citation.css +2 -2
  14. package/css/code-view.css +6 -6
  15. package/css/color-picker.css +81 -0
  16. package/css/color-swatch-picker.css +9 -4
  17. package/css/combobox.css +12 -4
  18. package/css/command.css +1 -1
  19. package/css/date-field.css +39 -0
  20. package/css/date-picker.css +86 -9
  21. package/css/date-range-picker.css +47 -7
  22. package/css/diff-view.css +8 -8
  23. package/css/field-array.css +1 -1
  24. package/css/field.css +4 -0
  25. package/css/file-upload.css +1 -1
  26. package/css/float-button.css +140 -27
  27. package/css/form.css +14 -6
  28. package/css/graph-chart.css +2 -2
  29. package/css/highlight.css +1 -1
  30. package/css/image.css +1 -1
  31. package/css/mention.css +1 -1
  32. package/css/message-feed.css +1 -1
  33. package/css/notification.css +26 -20
  34. package/css/number-field.css +18 -18
  35. package/css/page-header.css +2 -2
  36. package/css/password-input.css +2 -2
  37. package/css/popconfirm.css +3 -3
  38. package/css/question-flow.css +8 -8
  39. package/css/radar-chart.css +6 -6
  40. package/css/rating.css +1 -1
  41. package/css/select.css +2 -2
  42. package/css/separator.css +2 -2
  43. package/css/side-nav.css +13 -13
  44. package/css/skeleton.css +5 -5
  45. package/css/slider.css +6 -6
  46. package/css/sortable.css +2 -2
  47. package/css/table.css +19 -2
  48. package/css/tags-input.css +1 -1
  49. package/css/time-picker.css +59 -2
  50. package/css/tool-call.css +7 -7
  51. package/css/tooltip.css +1 -1
  52. package/css/tree-select.css +2 -2
  53. package/css/tree.css +81 -11
  54. package/dist/css/accordion.css +269 -0
  55. package/dist/css/affix.css +47 -0
  56. package/dist/css/alert.css +247 -0
  57. package/dist/css/anchor.css +252 -0
  58. package/dist/css/approval.css +501 -0
  59. package/dist/css/avatar-group.css +99 -0
  60. package/dist/css/avatar.css +98 -0
  61. package/dist/css/back-top.css +161 -0
  62. package/dist/css/badge.css +205 -0
  63. package/dist/css/bar-code.css +62 -0
  64. package/dist/css/breadcrumb.css +230 -0
  65. package/dist/css/button-group.css +263 -0
  66. package/dist/css/button.css +219 -0
  67. package/dist/css/calendar-picker.css +467 -0
  68. package/dist/css/calendar-range-picker.css +554 -0
  69. package/dist/css/card.css +221 -0
  70. package/dist/css/carousel.css +710 -0
  71. package/dist/css/cartesian-chart.css +830 -0
  72. package/dist/css/cascader.css +961 -0
  73. package/dist/css/checkbox-group.css +358 -0
  74. package/dist/css/checkbox.css +257 -0
  75. package/dist/css/citation.css +470 -0
  76. package/dist/css/clipboard.css +315 -0
  77. package/dist/css/code-view.css +374 -0
  78. package/dist/css/collapsible.css +185 -0
  79. package/dist/css/color-field.css +176 -0
  80. package/dist/css/color-picker.css +595 -0
  81. package/dist/css/color-slider.css +281 -0
  82. package/dist/css/color-swatch-picker.css +250 -0
  83. package/dist/css/color-swatch.css +35 -0
  84. package/dist/css/combobox.css +574 -0
  85. package/dist/css/command.css +399 -0
  86. package/dist/css/context-menu.css +420 -0
  87. package/dist/css/date-field.css +317 -0
  88. package/dist/css/date-picker.css +868 -0
  89. package/dist/css/date-range-picker.css +886 -0
  90. package/dist/css/description.css +67 -0
  91. package/dist/css/descriptions.css +299 -0
  92. package/dist/css/dialog.css +455 -0
  93. package/dist/css/diff-view.css +513 -0
  94. package/dist/css/download-trigger.css +151 -0
  95. package/dist/css/drawer.css +552 -0
  96. package/dist/css/editable.css +295 -0
  97. package/dist/css/empty-state.css +163 -0
  98. package/dist/css/field-array.css +226 -0
  99. package/dist/css/field.css +166 -0
  100. package/dist/css/fieldset.css +102 -0
  101. package/dist/css/file-upload.css +429 -0
  102. package/dist/css/flex.css +441 -0
  103. package/dist/css/float-button.css +569 -0
  104. package/dist/css/floating-panel.css +429 -0
  105. package/dist/css/focus.css +46 -0
  106. package/dist/css/forced-colors.css +93 -0
  107. package/dist/css/form.css +393 -0
  108. package/dist/css/funnel-chart.css +106 -0
  109. package/dist/css/graph-chart.css +205 -0
  110. package/dist/css/grid-list.css +235 -0
  111. package/dist/css/grid.css +1201 -0
  112. package/dist/css/heatmap.css +552 -0
  113. package/dist/css/hierarchy-chart.css +298 -0
  114. package/dist/css/highlight.css +41 -0
  115. package/dist/css/hover-card.css +226 -0
  116. package/dist/css/icon.css +225 -0
  117. package/dist/css/image-cropper.css +373 -0
  118. package/dist/css/image-viewer.css +538 -0
  119. package/dist/css/image.css +98 -0
  120. package/dist/css/infinite-scroll.css +77 -0
  121. package/dist/css/input-group.css +275 -0
  122. package/dist/css/json-viewer.css +379 -0
  123. package/dist/css/kbd.css +72 -0
  124. package/dist/css/label.css +78 -0
  125. package/dist/css/layers.css +7 -0
  126. package/dist/css/layout.css +372 -0
  127. package/dist/css/liquid.css +106 -0
  128. package/dist/css/list.css +152 -0
  129. package/dist/css/listbox.css +390 -0
  130. package/dist/css/loading-bar.css +141 -0
  131. package/dist/css/log.css +306 -0
  132. package/dist/css/markdown-stream.css +149 -0
  133. package/dist/css/marquee.css +378 -0
  134. package/dist/css/masonry.css +70 -0
  135. package/dist/css/matrix-code.css +67 -0
  136. package/dist/css/mention.css +393 -0
  137. package/dist/css/menu.css +364 -0
  138. package/dist/css/menubar.css +456 -0
  139. package/dist/css/message-feed.css +318 -0
  140. package/dist/css/navigation-menu.css +513 -0
  141. package/dist/css/notification.css +782 -0
  142. package/dist/css/number-animation.css +44 -0
  143. package/dist/css/number-field.css +252 -0
  144. package/dist/css/overlay-arrow.css +56 -0
  145. package/dist/css/page-header.css +184 -0
  146. package/dist/css/pagination.css +450 -0
  147. package/dist/css/password-input.css +391 -0
  148. package/dist/css/pie-chart.css +247 -0
  149. package/dist/css/pin-input.css +199 -0
  150. package/dist/css/pointer.css +36 -0
  151. package/dist/css/popconfirm.css +320 -0
  152. package/dist/css/popover.css +279 -0
  153. package/dist/css/progress.css +501 -0
  154. package/dist/css/prompt-input.css +260 -0
  155. package/dist/css/question-flow.css +553 -0
  156. package/dist/css/radar-chart.css +233 -0
  157. package/dist/css/radio-group.css +598 -0
  158. package/dist/css/rating.css +294 -0
  159. package/dist/css/reasoning.css +343 -0
  160. package/dist/css/reset.css +117 -0
  161. package/dist/css/resizable.css +242 -0
  162. package/dist/css/sankey-chart.css +174 -0
  163. package/dist/css/scroll-area.css +240 -0
  164. package/dist/css/scrollbar.css +204 -0
  165. package/dist/css/select.css +612 -0
  166. package/dist/css/separator.css +122 -0
  167. package/dist/css/side-nav.css +476 -0
  168. package/dist/css/signature-pad.css +179 -0
  169. package/dist/css/skeleton.css +161 -0
  170. package/dist/css/slider.css +374 -0
  171. package/dist/css/sortable.css +228 -0
  172. package/dist/css/sparkline.css +164 -0
  173. package/dist/css/spinner.css +236 -0
  174. package/dist/css/splitter.css +159 -0
  175. package/dist/css/statistic.css +137 -0
  176. package/dist/css/steps.css +627 -0
  177. package/dist/css/switch.css +351 -0
  178. package/dist/css/table.css +1145 -0
  179. package/dist/css/tabs.css +944 -0
  180. package/dist/css/tag-group.css +247 -0
  181. package/dist/css/tag.css +310 -0
  182. package/dist/css/tags-input.css +322 -0
  183. package/dist/css/text-field.css +197 -0
  184. package/dist/css/time-field.css +277 -0
  185. package/dist/css/time-picker.css +707 -0
  186. package/dist/css/time-range-picker.css +746 -0
  187. package/dist/css/timeline.css +423 -0
  188. package/dist/css/timer.css +123 -0
  189. package/dist/css/timestamp.css +34 -0
  190. package/dist/css/toggle-group.css +424 -0
  191. package/dist/css/toggle.css +146 -0
  192. package/dist/css/tone.css +189 -0
  193. package/dist/css/tool-call.css +429 -0
  194. package/dist/css/toolbar.css +365 -0
  195. package/dist/css/tooltip.css +218 -0
  196. package/dist/css/tour.css +439 -0
  197. package/dist/css/transfer.css +638 -0
  198. package/dist/css/tree-select.css +878 -0
  199. package/dist/css/tree.css +733 -0
  200. package/dist/css/truncate.css +108 -0
  201. package/dist/css/typography.css +472 -0
  202. package/dist/css/undefined.css +58 -0
  203. package/dist/css/virtualizer.css +166 -0
  204. package/dist/css/visually-hidden.css +20 -0
  205. package/dist/css/watermark.css +82 -0
  206. package/dist/family/action-control.css +487 -0
  207. package/dist/family/chart.css +480 -0
  208. package/dist/family/check-mark.css +94 -0
  209. package/dist/family/choice-card.css +97 -0
  210. package/dist/family/collection-item.css +764 -0
  211. package/dist/family/field-chrome.css +287 -0
  212. package/dist/family/loading-ring.css +95 -0
  213. package/dist/family/material.css +72 -0
  214. package/dist/family/menu-choice.css +56 -0
  215. package/dist/family/motion.css +363 -0
  216. package/dist/family/swatch.css +59 -0
  217. package/dist/family/tag-list.css +59 -0
  218. package/family/action-control.css +3 -12
  219. package/index.css +7307 -6759
  220. package/index.unlayered.css +7309 -6761
  221. package/package.json +165 -164
@@ -0,0 +1,363 @@
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
+ /* 定义 motion 样式。 */
7
+
8
+ /* 共享关键帧的唯一真源。
9
+ *
10
+ * 动画名的查找只认「文档里有没有这个名字」:引用别处文件里的名字,那份文件不一定在场,
11
+ * 动画会静默地整个不跑。所以引用这里任一名字的皮肤都 @import 本文件,单独引入那份皮肤时
12
+ * 关键帧仍在场;全量入口由 emit-unlayered 按物理文件去重,有层入口靠打包器对同一 URL 的
13
+ * @import 去重,同名同帧体即使重复插入也无副作用。
14
+ *
15
+ * 本文件只放跨皮肤共用的关键帧,皮肤内不得重定义这些名字(check-keyframe-refs 判红);
16
+ * 组件专属关键帧仍住在各自皮肤。幅度只引 --xh-motion-distance-sm / -md 与 --xh-motion-scale-enter /
17
+ * -exit,整幅位移经私有槽取 --xh-motion-travel,减弱动效档由令牌层把它们归零。四个方向槽
18
+ * --xh-_overlay-enter-* 由浮层皮肤按 placement 写在 positioner 上,四个都没写时位移退回 0。
19
+ */
20
+ @layer xihan.motion {
21
+ /* ── 锚定列表 / 菜单:沿落位方向短位移,不缩放文字与选中标记 ──
22
+ Menu、Select、Combobox、Cascader、ContextMenu、Menubar、Mention、TreeSelect、
23
+ Date / Time picker、ColorPicker、Tooltip */
24
+ @keyframes xh-overlay-slide-in {
25
+ from {
26
+ opacity: var(--xh-_enter-from-opacity, 0);
27
+ translate:
28
+ calc((var(--xh-_overlay-enter-right, 0) - var(--xh-_overlay-enter-left, 0)) * var(--xh-motion-distance-sm))
29
+ calc((var(--xh-_overlay-enter-down, 0) - var(--xh-_overlay-enter-up, 0)) * var(--xh-motion-distance-sm));
30
+ }
31
+
32
+ to {
33
+ opacity: 1;
34
+ translate: 0 0;
35
+ }
36
+ }
37
+
38
+ @keyframes xh-overlay-slide-out {
39
+ from {
40
+ opacity: 1;
41
+ translate: 0 0;
42
+ }
43
+
44
+ to {
45
+ opacity: 0;
46
+ translate:
47
+ calc((var(--xh-_overlay-enter-right, 0) - var(--xh-_overlay-enter-left, 0)) * var(--xh-motion-distance-sm))
48
+ calc((var(--xh-_overlay-enter-down, 0) - var(--xh-_overlay-enter-up, 0)) * var(--xh-motion-distance-sm));
49
+ }
50
+ }
51
+
52
+ /* ── 锚定面板:从锚点那一侧冒出来,缩放叠短位移 ──
53
+ Popover、HoverCard、Popconfirm、Tour、Command。
54
+ 起点朝哪个方向退让由 placement 写进四个方向槽(那一侧写 1),四个都没写就退回原地缩放 */
55
+ @keyframes xh-overlay-pop-in {
56
+ from {
57
+ opacity: var(--xh-_enter-from-opacity, 0);
58
+ scale: var(--xh-motion-scale-enter);
59
+ translate:
60
+ calc((var(--xh-_overlay-enter-right, 0) - var(--xh-_overlay-enter-left, 0)) * var(--xh-motion-distance-sm))
61
+ calc((var(--xh-_overlay-enter-down, 0) - var(--xh-_overlay-enter-up, 0)) * var(--xh-motion-distance-sm));
62
+ }
63
+
64
+ to {
65
+ opacity: 1;
66
+ scale: 1;
67
+ translate: 0 0;
68
+ }
69
+ }
70
+
71
+ /* 退场只缩放淡出,不再沿方向退让;锚定面板与无锚定弹出共用 */
72
+ @keyframes xh-pop-out {
73
+ from {
74
+ opacity: 1;
75
+ scale: 1;
76
+ }
77
+
78
+ to {
79
+ opacity: 0;
80
+ scale: var(--xh-motion-scale-exit);
81
+ }
82
+ }
83
+
84
+ /* ── 无锚定弹出:原地缩放淡入,没有方向 ──
85
+ NavigationMenu、SideNav popout、FloatingPanel、FloatButton 列表、Pagination 弹层;
86
+ 页内浮现的小件也取它:Approval、QuestionFlow 的结果标记,MessageFeed、Log 的回底钮;
87
+ 行内横排的胶囊集合(TagsInput、TagGroup、Select 标签行)加入一枚也取它:竖向上浮与来源方向不符,还会探出字段外壳 */
88
+ @keyframes xh-pop-in {
89
+ from {
90
+ opacity: var(--xh-_enter-from-opacity, 0);
91
+ scale: var(--xh-motion-scale-enter);
92
+ }
93
+
94
+ to {
95
+ opacity: 1;
96
+ scale: 1;
97
+ }
98
+ }
99
+
100
+ /* ── 遮罩与全屏面:只动不透明度 ──
101
+ Dialog / Drawer / ImageViewer / Tour / Command 的遮罩,Avatar / Image 的载入揭示,
102
+ Cascader 列项的淡入 */
103
+ @keyframes xh-fade-in {
104
+ from {
105
+ opacity: var(--xh-_enter-from-opacity, 0);
106
+ }
107
+
108
+ to {
109
+ opacity: 1;
110
+ }
111
+ }
112
+
113
+ @keyframes xh-fade-out {
114
+ from {
115
+ opacity: 1;
116
+ }
117
+
118
+ to {
119
+ opacity: 0;
120
+ }
121
+ }
122
+
123
+ /* 页内内容的上浮进场:淡入叠一小段向上位移。Command 的分组、EmptyState、QuestionFlow */
124
+ @keyframes xh-rise-in {
125
+ from {
126
+ opacity: var(--xh-_enter-from-opacity, 0);
127
+ translate: 0 var(--xh-motion-distance-sm);
128
+ }
129
+
130
+ to {
131
+ opacity: 1;
132
+ translate: 0 0;
133
+ }
134
+ }
135
+
136
+ /* ── Surface 级 disclosure:行高 0fr → 1fr,内缩同帧动 ──
137
+ Accordion、Collapsible、Reasoning、ToolCall 的 content。
138
+ 内缩不归零的话,border-box 会把盒子钳在上下内缩之和上,收不干净。
139
+ 两端内缩由各皮肤在 content 上写进 --xh-_disclosure-pt / --xh-_disclosure-pb,
140
+ 没写的那一端按 0 动(与该端本来就没有内缩的皮肤一致) */
141
+ @keyframes xh-disclosure-expand {
142
+ from {
143
+ grid-template-rows: 0fr;
144
+ padding-block-start: 0;
145
+ padding-block-end: 0;
146
+ }
147
+
148
+ to {
149
+ grid-template-rows: 1fr;
150
+ padding-block-start: var(--xh-_disclosure-pt, 0);
151
+ padding-block-end: var(--xh-_disclosure-pb, 0);
152
+ }
153
+ }
154
+
155
+ @keyframes xh-disclosure-collapse {
156
+ from {
157
+ grid-template-rows: 1fr;
158
+ padding-block-start: var(--xh-_disclosure-pt, 0);
159
+ padding-block-end: var(--xh-_disclosure-pb, 0);
160
+ }
161
+
162
+ to {
163
+ grid-template-rows: 0fr;
164
+ padding-block-start: 0;
165
+ padding-block-end: 0;
166
+ }
167
+ }
168
+
169
+ /* ── 列表条目进场:淡入叠一段向上位移,比页内上浮大一档 ──
170
+ Approval、MessageFeed、QuestionFlow、ToolCall 的条目 */
171
+ @keyframes xh-item-in {
172
+ from {
173
+ opacity: var(--xh-_enter-from-opacity, 0);
174
+ translate: 0 var(--xh-motion-distance-md);
175
+ }
176
+
177
+ to {
178
+ opacity: 1;
179
+ translate: 0 0;
180
+ }
181
+ }
182
+
183
+ /* 自上而下的显现:新揭开的内容从上方落位。DiffView 展开的折叠块、Form 的错误汇总 */
184
+ @keyframes xh-drop-in {
185
+ from {
186
+ opacity: var(--xh-_enter-from-opacity, 0);
187
+ translate: 0 calc(-1 * var(--xh-motion-distance-sm));
188
+ }
189
+
190
+ to {
191
+ opacity: 1;
192
+ translate: 0 0;
193
+ }
194
+ }
195
+
196
+ /* ── 面板(sheet):模态与强反馈面,竖向一小段位移叠缩放 ──
197
+ 位移与缩放写独立属性,互不覆盖,手势期间写 translate 也不会把 scale 抹掉。Dialog、Notification */
198
+ @keyframes xh-sheet-in {
199
+ from {
200
+ opacity: var(--xh-_enter-from-opacity, 0);
201
+ translate: 0 var(--xh-motion-distance-md);
202
+ scale: var(--xh-motion-scale-enter);
203
+ }
204
+
205
+ to {
206
+ opacity: 1;
207
+ translate: 0 0;
208
+ scale: 1;
209
+ }
210
+ }
211
+
212
+ @keyframes xh-sheet-out {
213
+ from {
214
+ opacity: 1;
215
+ translate: 0 0;
216
+ scale: 1;
217
+ }
218
+
219
+ to {
220
+ opacity: 0;
221
+ translate: 0 var(--xh-motion-distance-md);
222
+ scale: var(--xh-motion-scale-exit);
223
+ }
224
+ }
225
+
226
+ /* ── 整幅滑入(slide):面板从所在边整条推入推出 ──
227
+ 方向由皮肤在元素上写进 --xh-_slide-from-x / --xh-_slide-from-y(取正负整幅位移令牌或 0),
228
+ 两个都没写时位移退回 0。整幅位移令牌在减弱动效下归零,进出场只剩时长。Drawer */
229
+ @keyframes xh-slide-in {
230
+ from {
231
+ translate: var(--xh-_slide-from-x, 0) var(--xh-_slide-from-y, 0);
232
+ }
233
+
234
+ to {
235
+ translate: 0 0;
236
+ }
237
+ }
238
+
239
+ @keyframes xh-slide-out {
240
+ from {
241
+ translate: 0 0;
242
+ }
243
+
244
+ to {
245
+ translate: var(--xh-_slide-from-x, 0) var(--xh-_slide-from-y, 0);
246
+ }
247
+ }
248
+
249
+ /* 整幅滑入配套的淡变:起止端取 --xh-motion-travel-opacity,缺省为 1 即不淡变,
250
+ 减弱动效下为 0,整幅位移归零后由它接住进出场。与 xh-slide-in / -out 并列播放,
251
+ 时长取淡变档(enter / exit),不随几何时长一起归零。Drawer */
252
+ @keyframes xh-slide-fade-in {
253
+ from {
254
+ opacity: var(--xh-_enter-from-opacity, var(--xh-motion-travel-opacity));
255
+ }
256
+
257
+ to {
258
+ opacity: 1;
259
+ }
260
+ }
261
+
262
+ @keyframes xh-slide-fade-out {
263
+ from {
264
+ opacity: 1;
265
+ }
266
+
267
+ to {
268
+ opacity: var(--xh-motion-travel-opacity);
269
+ }
270
+ }
271
+
272
+ /* ── 循环:匀速转圈与扫过的流光 ──
273
+ 时长取循环令牌,减弱动效下由各皮肤停掉并换成静态替代。
274
+ 转圈写独立的 rotate 属性,与元素自身的 transform 叠加而不互相覆盖。
275
+ 流光的亮带从右扫到左:消费方把渐变画成自身两倍宽(background-size: 200% 100%),
276
+ 只移动背景位置,不动布局也不动 transform。Reasoning、ToolCall 的在跑文字 */
277
+ @keyframes xh-spin {
278
+ to {
279
+ rotate: 1turn;
280
+ }
281
+ }
282
+
283
+ @keyframes xh-shimmer {
284
+ from {
285
+ background-position: 150% center;
286
+ }
287
+
288
+ to {
289
+ background-position: -50% center;
290
+ }
291
+ }
292
+
293
+ /* 呼吸:进行中、给不出进度、需要被察觉的状态点。明暗与缩放一起起伏,峰值落在 42%,
294
+ 周期 --xh-motion-loop-breathe、缓动 --xh-motion-ease-breathe。只动 opacity 与 scale。
295
+ 光环画在状态点的 ::after 上,同周期从点本身的大小外扩淡尽,只播 3 个周期,状态点本身持续到状态结束。
296
+ 减弱动效下两者都停,状态点停在满不透明度。Badge 的 pulse */
297
+ @keyframes xh-breathe {
298
+ 0%,
299
+ 100% {
300
+ opacity: 0.5;
301
+ scale: var(--xh-motion-scale-breathe);
302
+ }
303
+
304
+ 42% {
305
+ opacity: 1;
306
+ scale: 1;
307
+ }
308
+ }
309
+
310
+ @keyframes xh-breathe-halo {
311
+ from {
312
+ opacity: 0.32;
313
+ scale: 1;
314
+ }
315
+
316
+ 60%,
317
+ to {
318
+ opacity: 0;
319
+ scale: var(--xh-motion-scale-halo);
320
+ }
321
+ }
322
+
323
+ /* ── 交互光:一道光沿 1px 描边环扫过一次 ──
324
+ 光带画在三倍宽的背景里、居中,遮罩只留描边环;背景位置从 100% 走到 0%,光带从起始缘外扫到末缘外。
325
+ 只动背景位置,不动几何;只播一遍,不循环 */
326
+ @keyframes xh-glint {
327
+ from {
328
+ background-position: 100% 0;
329
+ }
330
+
331
+ to {
332
+ background-position: 0% 0;
333
+ }
334
+ }
335
+
336
+ /* ── 数值:倒计时条从占满一整条收到零 ──
337
+ 条子自己不改尺寸,靠裁切从行尾往行首收:只重绘、不重排。裁掉哪一侧随书写方向由
338
+ --xh-_countdown-cut-left / -right 给出,缺省按 LTR 收掉右侧;前端的圆角取
339
+ --xh-_countdown-radius。走一遍就到头,时长由连接层写进 Notification 的时长槽。 */
340
+ @keyframes xh-countdown {
341
+ from {
342
+ clip-path: inset(0 0 0 0 round var(--xh-_countdown-radius, 0));
343
+ }
344
+
345
+ to {
346
+ clip-path: inset(0 var(--xh-_countdown-cut-right, 100%) 0 var(--xh-_countdown-cut-left, 0) round var(--xh-_countdown-radius, 0));
347
+ }
348
+ }
349
+
350
+ /* ── 数据:新出现的折线从头描到尾 ──
351
+ 连接层给路径写 pathLength="1" 把长度归一,消费方把虚线设成一整段(stroke-dasharray: 1),
352
+ 虚线偏移从 1 走到 0。只动 stroke-dashoffset,不动几何。时长取 reveal、曲线取 continuous,
353
+ 与柱从基线长出同一档;减弱动效下时长降到 1ms,折线直接在场。CartesianChart */
354
+ @keyframes xh-draw {
355
+ from {
356
+ stroke-dashoffset: 1;
357
+ }
358
+
359
+ to {
360
+ stroke-dashoffset: 0;
361
+ }
362
+ }
363
+ }
@@ -0,0 +1,59 @@
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
+ /* AUTO-GENERATED by build/swatch-recipe.mjs — do not edit. */
7
+ @layer xihan.components {
8
+ [data-xh-swatch] {
9
+ --xh-_swatch-size: var(--xh-glyph-size-md);
10
+ --xh-_swatch-checker-tile: var(--xh-space-1);
11
+ --xh-_swatch-color: transparent;
12
+
13
+ display: inline-block;
14
+ flex: none;
15
+ box-sizing: border-box;
16
+ inline-size: var(--xh-swatch-size, var(--xh-_swatch-size));
17
+ block-size: var(--xh-swatch-size, var(--xh-_swatch-size));
18
+ border: var(--xh-stroke-thin) solid var(--xh-swatch-border, var(--xh-border-default));
19
+ border-radius: var(--xh-swatch-radius, var(--xh-shape-inset));
20
+ background-color: var(--xh-swatch-checker-base, var(--xh-bg-surface));
21
+ background-image:
22
+ linear-gradient(var(--xh-_swatch-color), var(--xh-_swatch-color)),
23
+ linear-gradient(45deg, var(--xh-swatch-checker, var(--xh-color-neutral-300)) 25%, transparent 25%),
24
+ linear-gradient(-45deg, var(--xh-swatch-checker, var(--xh-color-neutral-300)) 25%, transparent 25%),
25
+ linear-gradient(45deg, transparent 75%, var(--xh-swatch-checker, var(--xh-color-neutral-300)) 75%),
26
+ linear-gradient(-45deg, transparent 75%, var(--xh-swatch-checker, var(--xh-color-neutral-300)) 75%);
27
+ background-position:
28
+ 0 0,
29
+ 0 0,
30
+ 0 var(--xh-_swatch-checker-tile),
31
+ var(--xh-_swatch-checker-tile) calc(-1 * var(--xh-_swatch-checker-tile)),
32
+ calc(-1 * var(--xh-_swatch-checker-tile)) 0;
33
+ background-size:
34
+ 100% 100%,
35
+ calc(var(--xh-_swatch-checker-tile) * 2) calc(var(--xh-_swatch-checker-tile) * 2),
36
+ calc(var(--xh-_swatch-checker-tile) * 2) calc(var(--xh-_swatch-checker-tile) * 2),
37
+ calc(var(--xh-_swatch-checker-tile) * 2) calc(var(--xh-_swatch-checker-tile) * 2),
38
+ calc(var(--xh-_swatch-checker-tile) * 2) calc(var(--xh-_swatch-checker-tile) * 2);
39
+ background-clip: padding-box;
40
+ print-color-adjust: exact;
41
+ }
42
+
43
+ [data-xh-swatch][data-xh-swatch-size='sm'] {
44
+ --xh-_swatch-size: var(--xh-glyph-size-sm);
45
+ --xh-_swatch-checker-tile: var(--xh-space-1);
46
+ }
47
+
48
+ [data-xh-swatch][data-xh-swatch-size='lg'] {
49
+ --xh-_swatch-size: var(--xh-glyph-size-lg);
50
+ --xh-_swatch-checker-tile: var(--xh-space-1_5);
51
+ }
52
+
53
+ @media (forced-colors: active) {
54
+ [data-xh-swatch] {
55
+ forced-color-adjust: none;
56
+ border-color: CanvasText;
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,59 @@
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
+ /*
7
+ * 标签行家族配方:多选控件把已选值摆成一行标签,Select、Combobox、TreeSelect、Cascader 共用这一份排法。
8
+ *
9
+ * 连接层在标签行上投影 data-xh-tag-list。行里每一枚都是库里的 tag(data-scope="tag"),样子归 tag.css,
10
+ * 这里只管行怎么排、标签怎么进出:
11
+ * - 行是弹性子项,只缩不涨:允许被压缩并把溢出裁掉,标签不冲出字段盒、不把盒尾的钮挤出去;
12
+ * - 行装不下时各枚标签各自缩短,截断落在 tag 自己的 label 上;+N 那一枚(带 data-count)不缩,始终完整可见;
13
+ * - 新选中的标签原地弹出(横排胶囊不用竖向上浮,会探出字段外壳的底边),同一批按到达顺序错开,首帧就在的直接呈现;
14
+ * 取消选中的由列表动效在原处放一个替身淡出,其余标签沿 translate 滑到新位置。
15
+ * 行与标签之间的间距经桥接槽 --xh-tag-list-gap 交给皮肤,皮肤把自己的公开槽接进来。
16
+ *
17
+ * 进退场的关键帧走 motion.css:引入本配方的皮肤同时 @import 它;家族文件之间不互相引入,
18
+ * 全量入口里每份家族只内联一次。
19
+ */
20
+ @layer xihan.components {
21
+ [data-xh-tag-list] {
22
+ /* 取消选中的标签由列表动效在原处放一个绝对定位的替身:行自己作定位容器,替身才裁在行里 */
23
+ position: relative;
24
+ display: inline-flex;
25
+ flex: 0 1 auto;
26
+ align-items: center;
27
+ gap: var(--xh-tag-list-gap, var(--xh-space-1));
28
+ /* 弹性子项默认最小尺寸是内容尺寸,不归零则标签把行撑破、省略号永远轮不到 */
29
+ min-inline-size: 0;
30
+ overflow: hidden;
31
+ }
32
+
33
+ /* 无选中时连接层给 hidden:上面给了 display,UA 的 [hidden]{display:none} 已被盖掉,这里补回来 */
34
+ [data-xh-tag-list][hidden] {
35
+ display: none;
36
+ }
37
+
38
+ [data-xh-tag-list] > .xh-scope-tag[data-part='root'] {
39
+ flex: 0 1 auto;
40
+ min-inline-size: 0;
41
+ /* 选中、取消选中一枚时,其余标签由列表动效先反向补偿、再沿这条滑到新位置 */
42
+ transition: translate var(--xh-motion-duration-move) var(--xh-motion-ease-continuous);
43
+ }
44
+
45
+ /* 新选中的标签原地弹出,同一批按到达顺序错开;首帧就在的直接呈现(列表动效接上之前行带 data-instant)。+N 那一枚不是到达的条目,不播 */
46
+ [data-xh-tag-list]:not([data-instant]) > .xh-scope-tag[data-part='root'][data-value]:not([data-instant], [data-state='closed']) {
47
+ animation: xh-pop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong) backwards;
48
+ animation-delay: calc(var(--xh-_stagger-index, 0) * var(--xh-motion-stagger-step));
49
+ }
50
+
51
+ /* 取消选中的标签:替身留在原处淡出,播完即移除 */
52
+ [data-xh-tag-list] > .xh-scope-tag[data-part='root'][data-state='closed'] {
53
+ animation: xh-fade-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
54
+ }
55
+
56
+ [data-xh-tag-list] > .xh-scope-tag[data-part='root'][data-count] {
57
+ flex: none;
58
+ }
59
+ }
@@ -256,25 +256,16 @@
256
256
  inline-size: var(--xh-action-visual-size, var(--xh-_action-profile-visual-size));
257
257
  }
258
258
 
259
- [data-xh-action-control][data-xh-action-profile='floating'][data-xh-action-size='xs'] {
260
- --xh-_action-profile-visual-size: var(--xh-control-box-sm);
261
- }
262
-
263
259
  [data-xh-action-control][data-xh-action-profile='floating'][data-xh-action-size='sm'] {
264
- --xh-_action-profile-visual-size: var(--xh-control-box-md);
265
- --xh-_action-profile-glyph-size: var(--xh-glyph-size-md);
266
- --xh-_action-profile-font-size: var(--xh-control-font-md);
260
+ --xh-_action-profile-visual-size: var(--xh-control-box-sm);
267
261
  }
268
262
 
269
263
  [data-xh-action-control][data-xh-action-profile='floating'][data-xh-action-size='md'] {
270
- --xh-_action-profile-visual-size: var(--xh-control-box-lg);
271
- --xh-_action-profile-glyph-size: var(--xh-glyph-size-lg);
272
- --xh-_action-profile-font-size: var(--xh-control-font-lg);
264
+ --xh-_action-profile-visual-size: var(--xh-control-box-md);
273
265
  }
274
266
 
275
267
  [data-xh-action-control][data-xh-action-profile='floating'][data-xh-action-size='lg'] {
276
- --xh-_action-profile-visual-size: calc(var(--xh-control-box-lg) + var(--xh-space-2));
277
- --xh-_action-profile-glyph-size: var(--xh-glyph-size-xl);
268
+ --xh-_action-profile-visual-size: var(--xh-control-box-lg);
278
269
  }
279
270
 
280
271
  [data-xh-action-control][data-xh-action-profile='row'] {