@xihan-ui/styles 3.1.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/CHANGELOG.md +470 -0
  2. package/component-tokens.d.ts +230 -60
  3. package/components.tokens.json +5156 -1557
  4. package/css/accordion.css +47 -20
  5. package/css/alert.css +16 -17
  6. package/css/anchor.css +2 -2
  7. package/css/approval.css +41 -17
  8. package/css/avatar-group.css +9 -12
  9. package/css/avatar.css +20 -18
  10. package/css/back-top.css +21 -7
  11. package/css/badge.css +5 -5
  12. package/css/breadcrumb.css +18 -16
  13. package/css/button-group.css +4 -6
  14. package/css/button.css +13 -12
  15. package/css/calendar-picker.css +178 -95
  16. package/css/calendar-range-picker.css +207 -122
  17. package/css/card.css +34 -6
  18. package/css/carousel.css +94 -46
  19. package/css/cartesian-chart.css +11 -11
  20. package/css/cascader.css +51 -39
  21. package/css/checkbox-group.css +9 -6
  22. package/css/checkbox.css +5 -4
  23. package/css/citation.css +9 -4
  24. package/css/clipboard.css +20 -4
  25. package/css/code-view.css +6 -6
  26. package/css/collapsible.css +29 -14
  27. package/css/color-field.css +4 -4
  28. package/css/color-picker.css +77 -23
  29. package/css/color-slider.css +10 -8
  30. package/css/color-swatch-picker.css +14 -9
  31. package/css/combobox.css +26 -14
  32. package/css/command.css +14 -9
  33. package/css/context-menu.css +10 -5
  34. package/css/date-field.css +12 -6
  35. package/css/date-picker.css +178 -109
  36. package/css/date-range-picker.css +199 -130
  37. package/css/description.css +10 -6
  38. package/css/descriptions.css +47 -19
  39. package/css/dialog.css +50 -35
  40. package/css/diff-view.css +8 -8
  41. package/css/drawer.css +75 -21
  42. package/css/editable.css +15 -41
  43. package/css/empty-state.css +21 -3
  44. package/css/field-array.css +5 -2
  45. package/css/field.css +17 -18
  46. package/css/fieldset.css +33 -13
  47. package/css/file-upload.css +66 -33
  48. package/css/float-button.css +60 -35
  49. package/css/floating-panel.css +1 -1
  50. package/css/form.css +30 -16
  51. package/css/graph-chart.css +2 -2
  52. package/css/grid-list.css +1 -1
  53. package/css/highlight.css +5 -5
  54. package/css/hover-card.css +19 -12
  55. package/css/image-viewer.css +77 -27
  56. package/css/image.css +13 -5
  57. package/css/infinite-scroll.css +8 -4
  58. package/css/input-group.css +74 -26
  59. package/css/kbd.css +1 -1
  60. package/css/label.css +27 -11
  61. package/css/layout.css +17 -10
  62. package/css/list.css +13 -9
  63. package/css/listbox.css +12 -7
  64. package/css/loading-bar.css +3 -0
  65. package/css/mention.css +11 -9
  66. package/css/menu.css +10 -5
  67. package/css/menubar.css +13 -8
  68. package/css/message-feed.css +1 -1
  69. package/css/navigation-menu.css +2 -2
  70. package/css/notification.css +132 -49
  71. package/css/number-animation.css +2 -2
  72. package/css/number-field.css +75 -52
  73. package/css/page-header.css +64 -27
  74. package/css/pagination.css +35 -38
  75. package/css/password-input.css +12 -68
  76. package/css/pin-input.css +18 -26
  77. package/css/popconfirm.css +23 -14
  78. package/css/popover.css +18 -12
  79. package/css/progress.css +14 -13
  80. package/css/prompt-input.css +3 -3
  81. package/css/question-flow.css +41 -15
  82. package/css/radar-chart.css +6 -6
  83. package/css/radio-group.css +120 -55
  84. package/css/rating.css +32 -15
  85. package/css/select.css +16 -12
  86. package/css/separator.css +24 -6
  87. package/css/side-nav.css +29 -24
  88. package/css/signature-pad.css +23 -9
  89. package/css/skeleton.css +12 -12
  90. package/css/slider.css +77 -48
  91. package/css/sortable.css +2 -2
  92. package/css/sparkline.css +8 -2
  93. package/css/spinner.css +40 -20
  94. package/css/statistic.css +14 -14
  95. package/css/steps.css +115 -84
  96. package/css/switch.css +9 -7
  97. package/css/table.css +29 -12
  98. package/css/tabs.css +35 -12
  99. package/css/tag-group.css +17 -6
  100. package/css/tag.css +54 -29
  101. package/css/tags-input.css +39 -20
  102. package/css/text-field.css +5 -5
  103. package/css/time-field.css +4 -4
  104. package/css/time-picker.css +150 -64
  105. package/css/time-range-picker.css +91 -62
  106. package/css/timeline.css +37 -20
  107. package/css/timer.css +3 -3
  108. package/css/toggle-group.css +4 -4
  109. package/css/tool-call.css +13 -11
  110. package/css/toolbar.css +6 -5
  111. package/css/tooltip.css +16 -17
  112. package/css/tour.css +14 -7
  113. package/css/transfer.css +22 -16
  114. package/css/tree-select.css +12 -12
  115. package/css/tree.css +26 -25
  116. package/css/typography.css +28 -25
  117. package/dist/css/accordion.css +296 -0
  118. package/dist/css/affix.css +47 -0
  119. package/dist/css/alert.css +246 -0
  120. package/dist/css/anchor.css +252 -0
  121. package/dist/css/approval.css +525 -0
  122. package/dist/css/avatar-group.css +96 -0
  123. package/dist/css/avatar.css +100 -0
  124. package/dist/css/back-top.css +175 -0
  125. package/dist/css/badge.css +205 -0
  126. package/dist/css/bar-code.css +62 -0
  127. package/dist/css/breadcrumb.css +232 -0
  128. package/dist/css/button-group.css +261 -0
  129. package/dist/css/button.css +216 -0
  130. package/dist/css/calendar-picker.css +550 -0
  131. package/dist/css/calendar-range-picker.css +639 -0
  132. package/dist/css/card.css +249 -0
  133. package/dist/css/carousel.css +726 -0
  134. package/dist/css/cartesian-chart.css +830 -0
  135. package/dist/css/cascader.css +973 -0
  136. package/dist/css/checkbox-group.css +361 -0
  137. package/dist/css/checkbox.css +258 -0
  138. package/dist/css/citation.css +475 -0
  139. package/dist/css/clipboard.css +331 -0
  140. package/dist/css/code-view.css +374 -0
  141. package/dist/css/collapsible.css +200 -0
  142. package/dist/css/color-field.css +176 -0
  143. package/dist/css/color-picker.css +649 -0
  144. package/dist/css/color-slider.css +283 -0
  145. package/dist/css/color-swatch-picker.css +250 -0
  146. package/dist/css/color-swatch.css +35 -0
  147. package/dist/css/combobox.css +578 -0
  148. package/dist/css/command.css +404 -0
  149. package/dist/css/context-menu.css +425 -0
  150. package/dist/css/date-field.css +317 -0
  151. package/dist/css/date-picker.css +931 -0
  152. package/dist/css/date-range-picker.css +949 -0
  153. package/dist/css/description.css +71 -0
  154. package/dist/css/descriptions.css +327 -0
  155. package/dist/css/dialog.css +470 -0
  156. package/dist/css/diff-view.css +513 -0
  157. package/dist/css/download-trigger.css +151 -0
  158. package/dist/css/drawer.css +606 -0
  159. package/dist/css/editable.css +269 -0
  160. package/dist/css/empty-state.css +181 -0
  161. package/dist/css/field-array.css +229 -0
  162. package/dist/css/field.css +165 -0
  163. package/dist/css/fieldset.css +122 -0
  164. package/dist/css/file-upload.css +462 -0
  165. package/dist/css/flex.css +441 -0
  166. package/dist/css/float-button.css +579 -0
  167. package/dist/css/floating-panel.css +429 -0
  168. package/dist/css/focus.css +46 -0
  169. package/dist/css/forced-colors.css +93 -0
  170. package/dist/css/form.css +407 -0
  171. package/dist/css/funnel-chart.css +106 -0
  172. package/dist/css/graph-chart.css +205 -0
  173. package/dist/css/grid-list.css +235 -0
  174. package/dist/css/grid.css +1201 -0
  175. package/dist/css/heatmap.css +552 -0
  176. package/dist/css/hierarchy-chart.css +298 -0
  177. package/dist/css/highlight.css +41 -0
  178. package/dist/css/hover-card.css +233 -0
  179. package/dist/css/icon.css +225 -0
  180. package/dist/css/image-cropper.css +373 -0
  181. package/dist/css/image-viewer.css +588 -0
  182. package/dist/css/image.css +106 -0
  183. package/dist/css/infinite-scroll.css +81 -0
  184. package/dist/css/input-group.css +323 -0
  185. package/dist/css/json-viewer.css +379 -0
  186. package/dist/css/kbd.css +72 -0
  187. package/dist/css/label.css +94 -0
  188. package/dist/css/layers.css +7 -0
  189. package/dist/css/layout.css +379 -0
  190. package/dist/css/liquid.css +106 -0
  191. package/dist/css/list.css +156 -0
  192. package/dist/css/listbox.css +395 -0
  193. package/dist/css/loading-bar.css +144 -0
  194. package/dist/css/log.css +306 -0
  195. package/dist/css/markdown-stream.css +149 -0
  196. package/dist/css/marquee.css +378 -0
  197. package/dist/css/masonry.css +70 -0
  198. package/dist/css/matrix-code.css +67 -0
  199. package/dist/css/mention.css +395 -0
  200. package/dist/css/menu.css +369 -0
  201. package/dist/css/menubar.css +461 -0
  202. package/dist/css/message-feed.css +318 -0
  203. package/dist/css/navigation-menu.css +513 -0
  204. package/dist/css/notification.css +865 -0
  205. package/dist/css/number-animation.css +44 -0
  206. package/dist/css/number-field.css +275 -0
  207. package/dist/css/overlay-arrow.css +56 -0
  208. package/dist/css/page-header.css +221 -0
  209. package/dist/css/pagination.css +447 -0
  210. package/dist/css/password-input.css +335 -0
  211. package/dist/css/pie-chart.css +247 -0
  212. package/dist/css/pin-input.css +191 -0
  213. package/dist/css/pointer.css +36 -0
  214. package/dist/css/popconfirm.css +329 -0
  215. package/dist/css/popover.css +285 -0
  216. package/dist/css/progress.css +502 -0
  217. package/dist/css/prompt-input.css +260 -0
  218. package/dist/css/question-flow.css +579 -0
  219. package/dist/css/radar-chart.css +233 -0
  220. package/dist/css/radio-group.css +663 -0
  221. package/dist/css/rating.css +311 -0
  222. package/dist/css/reasoning.css +343 -0
  223. package/dist/css/reset.css +117 -0
  224. package/dist/css/resizable.css +242 -0
  225. package/dist/css/sankey-chart.css +174 -0
  226. package/dist/css/scroll-area.css +240 -0
  227. package/dist/css/scrollbar.css +204 -0
  228. package/dist/css/select.css +616 -0
  229. package/dist/css/separator.css +140 -0
  230. package/dist/css/side-nav.css +481 -0
  231. package/dist/css/signature-pad.css +193 -0
  232. package/dist/css/skeleton.css +161 -0
  233. package/dist/css/slider.css +403 -0
  234. package/dist/css/sortable.css +228 -0
  235. package/dist/css/sparkline.css +170 -0
  236. package/dist/css/spinner.css +256 -0
  237. package/dist/css/splitter.css +159 -0
  238. package/dist/css/statistic.css +137 -0
  239. package/dist/css/steps.css +658 -0
  240. package/dist/css/switch.css +353 -0
  241. package/dist/css/table.css +1162 -0
  242. package/dist/css/tabs.css +967 -0
  243. package/dist/css/tag-group.css +258 -0
  244. package/dist/css/tag.css +335 -0
  245. package/dist/css/tags-input.css +341 -0
  246. package/dist/css/text-field.css +197 -0
  247. package/dist/css/time-field.css +277 -0
  248. package/dist/css/time-picker.css +793 -0
  249. package/dist/css/time-range-picker.css +775 -0
  250. package/dist/css/timeline.css +440 -0
  251. package/dist/css/timer.css +123 -0
  252. package/dist/css/timestamp.css +34 -0
  253. package/dist/css/toggle-group.css +424 -0
  254. package/dist/css/toggle.css +146 -0
  255. package/dist/css/tone.css +189 -0
  256. package/dist/css/tool-call.css +431 -0
  257. package/dist/css/toolbar.css +366 -0
  258. package/dist/css/tooltip.css +217 -0
  259. package/dist/css/tour.css +446 -0
  260. package/dist/css/transfer.css +644 -0
  261. package/dist/css/tree-select.css +878 -0
  262. package/dist/css/tree.css +734 -0
  263. package/dist/css/truncate.css +108 -0
  264. package/dist/css/typography.css +475 -0
  265. package/dist/css/undefined.css +58 -0
  266. package/dist/css/virtualizer.css +166 -0
  267. package/dist/css/visually-hidden.css +20 -0
  268. package/dist/css/watermark.css +82 -0
  269. package/dist/family/action-control.css +493 -0
  270. package/dist/family/chart.css +537 -0
  271. package/dist/family/check-mark.css +94 -0
  272. package/dist/family/choice-card.css +97 -0
  273. package/dist/family/collection-item.css +768 -0
  274. package/dist/family/field-chrome.css +296 -0
  275. package/dist/family/loading-ring.css +102 -0
  276. package/dist/family/material.css +72 -0
  277. package/dist/family/menu-choice.css +56 -0
  278. package/dist/family/motion.css +363 -0
  279. package/dist/family/swatch.css +59 -0
  280. package/dist/family/tag-list.css +65 -0
  281. package/family/action-control.css +33 -36
  282. package/family/chart.css +57 -0
  283. package/family/collection-item.css +12 -8
  284. package/family/field-chrome.css +28 -19
  285. package/family/loading-ring.css +20 -13
  286. package/family/swatch.css +4 -4
  287. package/family/tag-list.css +6 -0
  288. package/index.css +10349 -8756
  289. package/index.unlayered.css +10350 -8758
  290. package/package.json +165 -164
@@ -0,0 +1,205 @@
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
+ /* 定义 graph 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-graph-chart {
16
+ --xh-graph-chart-skin: 1;
17
+ }
18
+
19
+ /* 几何要用的像素值以这里的私有槽为真源:机器挂载后从计算样式读它们,作者覆盖组件槽即改变几何。
20
+ 节点的基准半径借点径那一格传进去 */
21
+ .xh-scope-graph-chart[data-part='root'] {
22
+ --xh-_chart-metric-bar-max: var(--xh-chart-bar-max);
23
+ --xh-_chart-metric-gap: var(--xh-chart-gap);
24
+ --xh-_chart-metric-line-width: var(--xh-chart-line-width);
25
+ --xh-_chart-metric-point-size: var(--xh-graph-chart-node-size, var(--xh-chart-point-size));
26
+ --xh-_chart-metric-hit-min: var(--xh-chart-hit-min);
27
+ --xh-_chart-metric-tick-length: var(--xh-chart-tick-length);
28
+ --xh-_chart-metric-label-gap: var(--xh-chart-label-gap);
29
+ --xh-_chart-metric-radius: var(--xh-shape-inset);
30
+ --xh-_chart-metric-font-size: var(--xh-text-caption-size);
31
+ --xh-_chart-metric-leading: var(--xh-leading-tight);
32
+ --xh-_chart-gap: var(--xh-graph-chart-gap, var(--xh-space-3));
33
+ }
34
+
35
+ /* —— 家族配方的组件槽:标题、视口、图例、提示框与空态由 family/chart.css 画,本图表的覆盖槽写在
36
+ 对应部件上接进配方的私有槽,作者在部件或它的祖先上覆盖都生效 —— */
37
+ .xh-scope-graph-chart[data-part='viewport'] {
38
+ --xh-_chart-height: var(--xh-graph-chart-height, var(--xh-chart-height));
39
+ }
40
+
41
+ .xh-scope-graph-chart[data-part='legend'] {
42
+ --xh-_chart-legend-gap: var(--xh-graph-chart-legend-gap, var(--xh-space-1));
43
+ }
44
+
45
+ .xh-scope-graph-chart[data-part='legend-swatch'] {
46
+ --xh-_chart-legend-swatch-radius: var(--xh-graph-chart-legend-swatch-radius, var(--xh-shape-inset));
47
+ }
48
+
49
+ .xh-scope-graph-chart[data-part='tooltip'] {
50
+ --xh-_chart-tooltip-gap: var(--xh-graph-chart-tooltip-gap, var(--xh-space-1));
51
+ --xh-_chart-tooltip-py: var(--xh-graph-chart-tooltip-py, var(--xh-surface-pad-sm));
52
+ --xh-_chart-tooltip-px: var(--xh-graph-chart-tooltip-px, var(--xh-surface-pad-sm));
53
+ --xh-_chart-tooltip-radius: var(--xh-graph-chart-tooltip-radius, var(--xh-shape-overlay));
54
+ --xh-_chart-tooltip-shadow: var(--xh-graph-chart-tooltip-shadow, var(--xh-material-frosted-shadow));
55
+ }
56
+
57
+ .xh-scope-graph-chart[data-part='tooltip-row'] {
58
+ --xh-_chart-tooltip-row-gap: var(--xh-graph-chart-tooltip-row-gap, var(--xh-space-2));
59
+ }
60
+
61
+ .xh-scope-graph-chart[data-part='empty'][data-state='loading'] {
62
+ --xh-_chart-empty-gap: var(--xh-graph-chart-empty-gap, var(--xh-space-2));
63
+ }
64
+
65
+ /* —— 色槽:分组由色槽承担,作者可以在节点上覆盖 --xh-graph-chart-series-color ——
66
+ 节点、被强调的连线、图例项都带着色槽,各自从这里取系列色 */
67
+ .xh-scope-graph-chart[data-xh-chart-slot='1'] {
68
+ --xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-1));
69
+ }
70
+
71
+ .xh-scope-graph-chart[data-xh-chart-slot='2'] {
72
+ --xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-2));
73
+ }
74
+
75
+ .xh-scope-graph-chart[data-xh-chart-slot='3'] {
76
+ --xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-3));
77
+ }
78
+
79
+ .xh-scope-graph-chart[data-xh-chart-slot='4'] {
80
+ --xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-4));
81
+ }
82
+
83
+ .xh-scope-graph-chart[data-xh-chart-slot='5'] {
84
+ --xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-5));
85
+ }
86
+
87
+ .xh-scope-graph-chart[data-xh-chart-slot='6'] {
88
+ --xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-6));
89
+ }
90
+
91
+ .xh-scope-graph-chart[data-xh-chart-slot='7'] {
92
+ --xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-7));
93
+ }
94
+
95
+ .xh-scope-graph-chart[data-xh-chart-slot='8'] {
96
+ --xh-_chart-series: var(--xh-graph-chart-series-color, var(--xh-chart-categorical-8));
97
+ }
98
+
99
+ /* —— 连线:次要的中性色细线,有权重时按权重加粗(宽度由连接层写进私有槽);箭头与线同色。
100
+ 指着一个节点时连着它的线换成它的颜色,其余淡出 —— */
101
+ .xh-scope-graph-chart[data-part='link'],
102
+ .xh-scope-graph-chart[data-part='arrow'] {
103
+ --xh-_graph-link: var(--xh-graph-chart-link-color, var(--xh-fg-subtle));
104
+
105
+ transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
106
+ }
107
+
108
+ .xh-scope-graph-chart[data-part='link'] {
109
+ fill: none;
110
+ stroke: var(--xh-_graph-link);
111
+ stroke-width: var(--xh-_graph-link-width, var(--xh-graph-chart-link-width, var(--xh-stroke-thin)));
112
+ stroke-linecap: round;
113
+ }
114
+
115
+ .xh-scope-graph-chart[data-part='arrow'] {
116
+ fill: var(--xh-_graph-link);
117
+ stroke: none;
118
+ }
119
+
120
+ .xh-scope-graph-chart[data-part='link'][data-highlighted],
121
+ .xh-scope-graph-chart[data-part='arrow'][data-highlighted] {
122
+ --xh-_graph-link: var(--xh-_chart-series);
123
+ }
124
+
125
+ /* —— 节点:取分组的系列色,外面描一圈承载面色,节点挨在一起、压在连线上时边界照样分明 —— */
126
+ .xh-scope-graph-chart[data-part='node'] {
127
+ fill: var(--xh-_chart-series);
128
+ stroke: var(--xh-chart-surface);
129
+ stroke-width: var(--xh-chart-gap);
130
+ transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
131
+ }
132
+
133
+ .xh-scope-graph-chart[data-part='link'][data-dimmed],
134
+ .xh-scope-graph-chart[data-part='arrow'][data-dimmed],
135
+ .xh-scope-graph-chart[data-part='node'][data-dimmed],
136
+ .xh-scope-graph-chart[data-part='node-label'][data-dimmed],
137
+ .xh-scope-graph-chart[data-part='link-label'][data-dimmed] {
138
+ opacity: var(--xh-chart-dim-alpha);
139
+ }
140
+
141
+ /* 节点名可能压在连线上:正文色,描一圈承载面色,交叠处也读得清。名字不接指针,命中归节点 */
142
+ .xh-scope-graph-chart[data-part='node-label'] {
143
+ fill: var(--xh-fg-default);
144
+ stroke: var(--xh-chart-surface);
145
+ stroke-width: var(--xh-stroke-thick);
146
+ stroke-linejoin: round;
147
+ paint-order: stroke;
148
+ pointer-events: none;
149
+ transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
150
+ }
151
+
152
+ /* 连线上的字就压在线上:次级文字色与节点名分出主次,同样描一圈承载面色把线从字底下断开 */
153
+ .xh-scope-graph-chart[data-part='link-label'] {
154
+ fill: var(--xh-fg-muted);
155
+ stroke: var(--xh-chart-surface);
156
+ stroke-width: var(--xh-stroke-thick);
157
+ stroke-linejoin: round;
158
+ paint-order: stroke;
159
+ pointer-events: none;
160
+ transition: opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
161
+ }
162
+
163
+ /* —— 直接操纵:能拖的节点给抓手,拖着时整张图是抓紧的手;放大后空白处也能拖着平移。
164
+ 触屏在节点上的拖动归图,其余地方照常滚动页面 —— */
165
+ .xh-scope-graph-chart[data-part='plot'][data-draggable] [data-part='node']:where(.xh-scope-graph-chart) {
166
+ cursor: grab;
167
+ touch-action: none;
168
+ }
169
+
170
+ .xh-scope-graph-chart[data-part='plot'][data-zoomed] {
171
+ cursor: grab;
172
+ touch-action: none;
173
+ }
174
+
175
+ .xh-scope-graph-chart[data-part='plot'][data-dragging],
176
+ .xh-scope-graph-chart[data-part='plot'][data-dragging] [data-part='node']:where(.xh-scope-graph-chart) {
177
+ cursor: grabbing;
178
+ }
179
+
180
+ /* 强制色:节点改成系统色的面与描边,连线取次级系统色、被强调的取高亮色,名字取正文色;
181
+ 焦点环、图例与色标在配方里 */
182
+ @media (forced-colors: active) {
183
+ .xh-scope-graph-chart[data-part='node'] {
184
+ fill: Canvas;
185
+ stroke: CanvasText;
186
+ stroke-width: var(--xh-stroke-thin);
187
+ }
188
+
189
+ .xh-scope-graph-chart[data-part='link'],
190
+ .xh-scope-graph-chart[data-part='arrow'] {
191
+ --xh-_graph-link: GrayText;
192
+ }
193
+
194
+ .xh-scope-graph-chart[data-part='link'][data-highlighted],
195
+ .xh-scope-graph-chart[data-part='arrow'][data-highlighted] {
196
+ --xh-_graph-link: Highlight;
197
+ }
198
+
199
+ .xh-scope-graph-chart[data-part='node-label'],
200
+ .xh-scope-graph-chart[data-part='link-label'] {
201
+ fill: CanvasText;
202
+ stroke: Canvas;
203
+ }
204
+ }
205
+ }
@@ -0,0 +1,235 @@
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
+ /* GridList 的行复用 Collection Item;拖动把手由组合进来的 Sortable 负责。 */
7
+ @import '../family/action-control.css';
8
+ @import '../family/check-mark.css';
9
+ @import '../family/collection-item.css';
10
+ @import '../family/loading-ring.css';
11
+ @import '../family/motion.css';
12
+
13
+ @layer xihan.components {
14
+ .xh-scope-grid-list {
15
+ --xh-grid-list-skin: 1;
16
+ }
17
+
18
+ .xh-scope-grid-list[data-part='root'] {
19
+ --xh-_grid-list-indicator: var(--xh-control-indicator-md);
20
+ --xh-_grid-list-indicator-glyph: calc(var(--xh-_grid-list-indicator) * 0.75);
21
+ --xh-_grid-list-indicator-accent: var(--xh-_tone-border-control, var(--xh-bg-brand));
22
+ --xh-_grid-list-indicator-on-accent: var(--xh-_tone-on, var(--xh-fg-on-brand));
23
+ --xh-icon-size: var(--xh-grid-list-icon-size, var(--xh-glyph-size-md));
24
+ /* 占位文案与条目同档:字号与行内内衬随尺寸档 */
25
+ --xh-_grid-list-state-font-size: var(--xh-control-font-md);
26
+ --xh-_grid-list-state-px: var(--xh-control-px-md);
27
+
28
+ display: flex;
29
+ flex-direction: column;
30
+ box-sizing: border-box;
31
+ gap: var(--xh-grid-list-gap, var(--xh-list-option-gap));
32
+ inline-size: 100%;
33
+ min-inline-size: 0;
34
+ padding: var(--xh-grid-list-p, var(--xh-space-1));
35
+ border: var(--xh-stroke-thin) solid transparent;
36
+ border-radius: var(--xh-grid-list-radius, var(--xh-shape-surface));
37
+ background: var(--xh-grid-list-bg, transparent);
38
+ }
39
+
40
+ .xh-scope-grid-list[data-part='root'][data-variant='outline'] {
41
+ border-color: var(--xh-grid-list-border, var(--xh-border-default));
42
+ background: var(--xh-grid-list-bg, var(--xh-bg-surface));
43
+ }
44
+
45
+ .xh-scope-grid-list[data-part='root'][data-variant='subtle'] {
46
+ background: var(--xh-grid-list-bg, var(--xh-bg-subtle));
47
+ }
48
+
49
+ .xh-scope-grid-list[data-part='root'][data-invalid] {
50
+ border-color: var(--xh-grid-list-border-invalid, var(--xh-border-invalid));
51
+ }
52
+
53
+ .xh-scope-grid-list[data-part='root']:focus-visible {
54
+ outline: var(--xh-ring-width) solid var(--xh-ring-focus);
55
+ outline-offset: var(--xh-ring-offset);
56
+ }
57
+
58
+ .xh-scope-grid-list[data-part='root'][data-size='sm'] {
59
+ --xh-_grid-list-indicator: var(--xh-control-indicator-sm);
60
+ --xh-_grid-list-state-font-size: var(--xh-control-font-sm);
61
+ --xh-_grid-list-state-px: var(--xh-control-px-sm);
62
+ --xh-icon-size: var(--xh-grid-list-icon-size, var(--xh-glyph-size-sm));
63
+ }
64
+
65
+ .xh-scope-grid-list[data-part='root'][data-size='lg'] {
66
+ --xh-_grid-list-indicator: var(--xh-control-indicator-lg);
67
+ --xh-_grid-list-state-font-size: var(--xh-control-font-lg);
68
+ --xh-_grid-list-state-px: var(--xh-control-px-lg);
69
+ --xh-icon-size: var(--xh-grid-list-icon-size, var(--xh-glyph-size-lg));
70
+ }
71
+
72
+ .xh-scope-grid-list[data-part='label'] {
73
+ padding-block: var(--xh-grid-list-label-py, var(--xh-space-1));
74
+ padding-inline: var(--xh-grid-list-label-px, var(--xh-control-px-md));
75
+ color: var(--xh-grid-list-label-fg, var(--xh-fg-default));
76
+ font-size: var(--xh-grid-list-label-font-size, var(--xh-text-label-size));
77
+ font-weight: var(--xh-grid-list-label-font-weight, var(--xh-font-weight-medium));
78
+ line-height: var(--xh-leading-normal);
79
+ }
80
+
81
+ /* 行走 Collection Item 的 page 语境(页内持久集合),与 Table、Transfer 同一种选中标记:品牌淡底行面 +
82
+ 淡底前景(selected+hover 20% / +pressed 28%),外加行首勾选框;两者都由家族与勾选标记配方给,
83
+ 这里只映射圆角与选中面的公开槽 */
84
+ .xh-scope-grid-list[data-part='row'] {
85
+ --xh-collection-radius: var(--xh-grid-list-row-radius, var(--xh-shape-control));
86
+ --xh-collection-bg-selected: var(--xh-grid-list-row-bg-selected, var(--xh-bg-brand-subtle));
87
+ --xh-collection-fg-selected: var(--xh-grid-list-row-fg-selected, var(--xh-fg-on-brand-subtle));
88
+ --xh-collection-fg-selected-hover: var(--xh-grid-list-row-fg-selected, var(--xh-fg-on-brand-subtle));
89
+ --xh-collection-fg-selected-highlight: var(--xh-grid-list-row-fg-selected, var(--xh-fg-on-brand-subtle));
90
+ --xh-collection-fg-selected-pressed: var(--xh-grid-list-row-fg-selected, var(--xh-fg-on-brand-subtle));
91
+
92
+ /* 家族只过渡换面的两支;重新取数时整列淡下同样走 micro,opacity 补进同一份列表 */
93
+ transition:
94
+ background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
95
+ color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
96
+ opacity var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
97
+ }
98
+
99
+ /* Headless 会预先保留下一次 roving focus 的 highlighted 行(指针点过的行也记着);容器尚未真正获得
100
+ 键盘焦点时,这只是内部导航位置,不能提前画成焦点态:面退回静息(选中行退回选中面),指针移入仍按
101
+ 悬停那一档回应 */
102
+ .xh-scope-grid-list[data-part='row'][data-highlighted]:not(:focus-visible) {
103
+ --xh-collection-bg-keyboard-highlight: transparent;
104
+ --xh-collection-outline-keyboard-highlight: transparent;
105
+ --xh-collection-bg-selected-highlight: var(--xh-grid-list-row-bg-selected, var(--xh-bg-brand-subtle));
106
+ --xh-collection-outline-selected-highlight: transparent;
107
+ }
108
+
109
+ .xh-scope-grid-list[data-part='row'][data-highlighted]:not(:focus-visible):hover {
110
+ --xh-collection-bg-keyboard-highlight: var(--xh-bg-subtle);
111
+ --xh-collection-bg-selected-highlight: var(--xh-bg-brand-subtle-hover);
112
+ }
113
+
114
+ .xh-scope-grid-list[data-part='root'][data-readonly]
115
+ .xh-scope-grid-list[data-part='row'] {
116
+ cursor: default;
117
+ }
118
+
119
+ /* 已有行时重新取数:不换成占位,行保留上一帧、按 micro 淡到禁用透明度,数据到了再淡回;
120
+ 这一段不接指针——取数在途时选中与行内动作都不生效。aria-busy 与这一副可见回执同源 */
121
+ .xh-scope-grid-list[data-part='root'][data-loading]
122
+ .xh-scope-grid-list[data-part='row'] {
123
+ opacity: var(--xh-grid-list-row-loading-opacity, var(--xh-state-disabled-opacity));
124
+ pointer-events: none;
125
+ }
126
+
127
+ /* content 保持真实 gridcell 盒;里面两行自己排,不依赖 Collection Item 的直接子项网格。 */
128
+ .xh-scope-grid-list[data-part='row-content'] {
129
+ display: flex;
130
+ grid-row: 1 / span 2;
131
+ grid-column: text;
132
+ flex-direction: column;
133
+ gap: var(--xh-grid-list-row-content-gap, var(--xh-space-1));
134
+ min-inline-size: 0;
135
+ }
136
+
137
+ .xh-scope-grid-list[data-part='row-text'],
138
+ .xh-scope-grid-list[data-part='row-description'] {
139
+ grid-row: auto;
140
+ grid-column: auto;
141
+ min-inline-size: 0;
142
+ overflow: hidden;
143
+ text-overflow: ellipsis;
144
+ }
145
+
146
+ .xh-scope-grid-list[data-part='row-text'] {
147
+ color: inherit;
148
+ white-space: nowrap;
149
+ }
150
+
151
+ .xh-scope-grid-list[data-part='row-description'] {
152
+ color: var(--xh-grid-list-row-description-fg, var(--xh-fg-muted));
153
+ font-size: var(--xh-grid-list-row-description-font-size, var(--xh-control-caption-md));
154
+ white-space: nowrap;
155
+ }
156
+
157
+ .xh-scope-grid-list[data-part='row-actions'] {
158
+ display: flex;
159
+ grid-row: 1 / span 2;
160
+ grid-column: suffix / span 2;
161
+ gap: var(--xh-grid-list-row-actions-gap, var(--xh-space-1));
162
+ align-items: center;
163
+ margin-inline-start: var(--xh-grid-list-row-actions-ms, var(--xh-control-gap-md));
164
+ }
165
+
166
+ .xh-scope-grid-list[data-part='row-action'] {
167
+ --xh-action-font-size: var(--xh-grid-list-row-action-font-size, var(--xh-control-font-sm));
168
+ }
169
+
170
+ /* 行首方框:静息透明底 + 控件盒描边,勾上换语气实心面。框里的勾由勾选标记配方画(常驻、按状态淡变并轻缩放),
171
+ 尺寸读这里改接的 --xh-icon-size:方框边长 × 0.75,与 Checkbox 同一比例 */
172
+ .xh-scope-grid-list[data-part='row-selection-indicator'] {
173
+ --xh-icon-size: var(--xh-grid-list-row-indicator-glyph-size, var(--xh-_grid-list-indicator-glyph));
174
+
175
+ display: grid;
176
+ grid-row: 1 / span 2;
177
+ grid-column: prefix;
178
+ place-items: center;
179
+ inline-size: var(--xh-grid-list-row-indicator-size, var(--xh-_grid-list-indicator));
180
+ block-size: var(--xh-grid-list-row-indicator-size, var(--xh-_grid-list-indicator));
181
+ margin-inline-end: var(--xh-grid-list-row-indicator-me, var(--xh-control-gap-md));
182
+ border: var(--xh-stroke-thin) solid var(--xh-grid-list-row-indicator-border, var(--xh-border-control));
183
+ border-radius: var(--xh-grid-list-row-indicator-radius, var(--xh-shape-inset));
184
+ background: var(--xh-grid-list-row-indicator-bg, transparent);
185
+ color: var(--xh-grid-list-row-indicator-fg-selected, var(--xh-_grid-list-indicator-on-accent));
186
+ transition:
187
+ background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
188
+ border-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
189
+ }
190
+
191
+ .xh-scope-grid-list[data-part='row-selection-indicator'][data-state='checked'] {
192
+ border-color: var(--xh-grid-list-row-indicator-border-selected, var(--xh-_grid-list-indicator-accent));
193
+ background: var(--xh-grid-list-row-indicator-bg-selected, var(--xh-_grid-list-indicator-accent));
194
+ }
195
+
196
+ /* 空态与加载态占同一个位置、同一副排版:一行文案居中,字号与行内内衬随尺寸档与条目同档,次要文字色,
197
+ 块向内距一档,不设最小高 */
198
+ .xh-scope-grid-list[data-part='empty'],
199
+ .xh-scope-grid-list[data-part='loading'] {
200
+ display: flex;
201
+ align-items: center;
202
+ justify-content: center;
203
+ gap: var(--xh-grid-list-state-gap, var(--xh-control-gap-md));
204
+ padding-block: var(--xh-grid-list-state-py, var(--xh-space-3));
205
+ padding-inline: var(--xh-grid-list-state-px, var(--xh-_grid-list-state-px));
206
+ color: var(--xh-grid-list-state-fg, var(--xh-fg-muted));
207
+ font-size: var(--xh-grid-list-state-font-size, var(--xh-_grid-list-state-font-size));
208
+ line-height: var(--xh-leading-normal);
209
+ text-align: center;
210
+ }
211
+
212
+ /* 还没有行、正在取:一枚加载环排在文案之前。环由加载环配方画成(轨道 + 起始边、随 data-loading 淡入并转),
213
+ 这里只给它盒子:直径取尺寸档的图标档 */
214
+ .xh-scope-grid-list[data-part='loading']::before {
215
+ content: '';
216
+ flex: none;
217
+ inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
218
+ block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
219
+ }
220
+
221
+ .xh-scope-grid-list[data-part='row-selection-indicator'][hidden],
222
+ .xh-scope-grid-list[data-part='row-content'][hidden],
223
+ .xh-scope-grid-list[data-part='row-actions'][hidden],
224
+ .xh-scope-grid-list[data-part='empty'][hidden],
225
+ .xh-scope-grid-list[data-part='loading'][hidden],
226
+ .xh-scope-grid-list[data-part='root'][hidden] {
227
+ display: none;
228
+ }
229
+
230
+ @media print {
231
+ .xh-scope-grid-list[data-part='row-actions'] {
232
+ display: none;
233
+ }
234
+ }
235
+ }