@xihan-ui/styles 2.1.0 → 3.1.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 (152) hide show
  1. package/CHANGELOG.md +1261 -0
  2. package/README.md +6 -1
  3. package/component-tokens.d.ts +533 -96
  4. package/components.tokens.json +35461 -26045
  5. package/css/accordion.css +34 -8
  6. package/css/alert.css +59 -1
  7. package/css/anchor.css +46 -8
  8. package/css/approval.css +116 -76
  9. package/css/avatar-group.css +1 -1
  10. package/css/avatar.css +13 -5
  11. package/css/back-top.css +61 -42
  12. package/css/badge.css +62 -12
  13. package/css/bar-code.css +1 -1
  14. package/css/breadcrumb.css +62 -3
  15. package/css/button-group.css +4 -4
  16. package/css/button.css +67 -19
  17. package/css/calendar-picker.css +19 -0
  18. package/css/calendar-range-picker.css +39 -2
  19. package/css/card.css +115 -1
  20. package/css/carousel.css +148 -43
  21. package/css/cartesian-chart.css +830 -0
  22. package/css/cascader.css +181 -65
  23. package/css/checkbox-group.css +59 -89
  24. package/css/checkbox.css +16 -49
  25. package/css/citation.css +470 -0
  26. package/css/clipboard.css +20 -63
  27. package/css/code-view.css +101 -6
  28. package/css/collapsible.css +34 -8
  29. package/css/color-field.css +18 -0
  30. package/css/color-picker.css +128 -50
  31. package/css/color-slider.css +22 -15
  32. package/css/color-swatch-picker.css +3 -1
  33. package/css/combobox.css +80 -33
  34. package/css/command.css +45 -43
  35. package/css/context-menu.css +39 -22
  36. package/css/date-field.css +56 -0
  37. package/css/date-picker.css +132 -26
  38. package/css/date-range-picker.css +337 -14
  39. package/css/description.css +17 -1
  40. package/css/descriptions.css +42 -0
  41. package/css/dialog.css +94 -36
  42. package/css/diff-view.css +97 -12
  43. package/css/download-trigger.css +44 -78
  44. package/css/drawer.css +160 -119
  45. package/css/editable.css +19 -0
  46. package/css/empty-state.css +7 -6
  47. package/css/field-array.css +36 -0
  48. package/css/field.css +20 -18
  49. package/css/file-upload.css +125 -135
  50. package/css/flex.css +324 -8
  51. package/css/float-button.css +263 -38
  52. package/css/floating-panel.css +53 -19
  53. package/css/form.css +31 -17
  54. package/css/funnel-chart.css +106 -0
  55. package/css/graph-chart.css +205 -0
  56. package/css/grid-list.css +235 -0
  57. package/css/grid.css +252 -1
  58. package/css/heatmap.css +119 -36
  59. package/css/hierarchy-chart.css +298 -0
  60. package/css/hover-card.css +31 -14
  61. package/css/icon.css +100 -0
  62. package/css/image-cropper.css +33 -7
  63. package/css/image-viewer.css +167 -22
  64. package/css/image.css +23 -4
  65. package/css/input-group.css +11 -13
  66. package/css/json-viewer.css +50 -2
  67. package/css/layout.css +68 -18
  68. package/css/liquid.css +106 -0
  69. package/css/list.css +1 -1
  70. package/css/listbox.css +46 -6
  71. package/css/loading-bar.css +27 -13
  72. package/css/log.css +129 -33
  73. package/css/markdown-stream.css +1 -1
  74. package/css/marquee.css +163 -7
  75. package/css/matrix-code.css +1 -1
  76. package/css/mention.css +35 -19
  77. package/css/menu.css +35 -21
  78. package/css/menubar.css +36 -20
  79. package/css/message-feed.css +172 -51
  80. package/css/navigation-menu.css +172 -11
  81. package/css/notification.css +435 -108
  82. package/css/number-field.css +22 -0
  83. package/css/page-header.css +3 -1
  84. package/css/pagination.css +126 -24
  85. package/css/password-input.css +40 -8
  86. package/css/pie-chart.css +247 -0
  87. package/css/popconfirm.css +44 -50
  88. package/css/popover.css +50 -14
  89. package/css/progress.css +308 -10
  90. package/css/prompt-input.css +36 -0
  91. package/css/question-flow.css +97 -57
  92. package/css/radar-chart.css +233 -0
  93. package/css/radio-group.css +363 -5
  94. package/css/rating.css +21 -23
  95. package/css/reasoning.css +61 -54
  96. package/css/resizable.css +6 -1
  97. package/css/sankey-chart.css +174 -0
  98. package/css/scroll-area.css +32 -0
  99. package/css/scrollbar.css +1 -1
  100. package/css/select.css +74 -55
  101. package/css/side-nav.css +173 -24
  102. package/css/signature-pad.css +16 -1
  103. package/css/skeleton.css +13 -14
  104. package/css/slider.css +35 -13
  105. package/css/sortable.css +37 -7
  106. package/css/sparkline.css +164 -0
  107. package/css/spinner.css +50 -22
  108. package/css/splitter.css +7 -1
  109. package/css/statistic.css +10 -0
  110. package/css/steps.css +248 -29
  111. package/css/switch.css +23 -48
  112. package/css/table.css +175 -118
  113. package/css/tabs.css +231 -19
  114. package/css/tag-group.css +27 -3
  115. package/css/tag.css +53 -12
  116. package/css/tags-input.css +40 -3
  117. package/css/text-field.css +19 -0
  118. package/css/time-field.css +20 -1
  119. package/css/time-picker.css +103 -17
  120. package/css/time-range-picker.css +45 -16
  121. package/css/timeline.css +1 -1
  122. package/css/toggle-group.css +4 -4
  123. package/css/toggle.css +4 -3
  124. package/css/tool-call.css +59 -51
  125. package/css/toolbar.css +101 -3
  126. package/css/tooltip.css +15 -2
  127. package/css/tour.css +42 -12
  128. package/css/transfer.css +98 -75
  129. package/css/tree-select.css +232 -53
  130. package/css/tree.css +271 -55
  131. package/css/truncate.css +55 -12
  132. package/css/typography.css +93 -0
  133. package/css/virtualizer.css +56 -0
  134. package/css/watermark.css +23 -0
  135. package/family/action-control.css +14 -5
  136. package/family/chart.css +480 -0
  137. package/family/check-mark.css +94 -0
  138. package/family/choice-card.css +97 -0
  139. package/family/collection-item.css +9 -15
  140. package/family/field-chrome.css +1 -12
  141. package/family/loading-ring.css +95 -0
  142. package/family/material.css +72 -0
  143. package/family/menu-choice.css +56 -0
  144. package/family/motion.css +207 -10
  145. package/family/tag-list.css +59 -0
  146. package/index.css +13824 -4030
  147. package/index.unlayered.css +13403 -3605
  148. package/package.json +20 -8
  149. package/css/gradient-text.css +0 -91
  150. package/css/icon-wrapper.css +0 -81
  151. package/css/segmented.css +0 -280
  152. package/css/toast.css +0 -499
package/css/grid.css CHANGED
@@ -460,10 +460,12 @@
460
460
  [data-scope='grid'][data-part='item'] {
461
461
  grid-column-start: var(--xh-_grid-start);
462
462
  grid-column-end: span var(--xh-_grid-span);
463
+ grid-row-end: span var(--xh-_grid-row-span);
463
464
 
464
- /* 两个槽位在每一格上都声明一遍,嵌套时内层的格子不吃外层那一格的值 */
465
+ /* 三个槽位在每一格上都声明一遍,嵌套时内层的格子不吃外层那一格的值 */
465
466
  --xh-_grid-span: 1;
466
467
  --xh-_grid-start: auto;
468
+ --xh-_grid-row-span: 1;
467
469
  }
468
470
 
469
471
  /* —— 跨列 —— */
@@ -942,6 +944,255 @@
942
944
  }
943
945
  }
944
946
 
947
+ /* —— 跨行 —— */
948
+ /* 占一行是格子上的缺省,这里从跨两行起逐值写。行高由内容撑出时跨几行就占几条行轨道,
949
+ 同一行里其余的格子按各自内容排,不被拉成同高 */
950
+ [data-scope='grid'][data-part='item'][data-row-span='2'] {
951
+ --xh-_grid-row-span: 2;
952
+ }
953
+
954
+ [data-scope='grid'][data-part='item'][data-row-span='3'] {
955
+ --xh-_grid-row-span: 3;
956
+ }
957
+
958
+ [data-scope='grid'][data-part='item'][data-row-span='4'] {
959
+ --xh-_grid-row-span: 4;
960
+ }
961
+
962
+ [data-scope='grid'][data-part='item'][data-row-span='5'] {
963
+ --xh-_grid-row-span: 5;
964
+ }
965
+
966
+ [data-scope='grid'][data-part='item'][data-row-span='6'] {
967
+ --xh-_grid-row-span: 6;
968
+ }
969
+
970
+ [data-scope='grid'][data-part='item'][data-row-span='7'] {
971
+ --xh-_grid-row-span: 7;
972
+ }
973
+
974
+ [data-scope='grid'][data-part='item'][data-row-span='8'] {
975
+ --xh-_grid-row-span: 8;
976
+ }
977
+
978
+ [data-scope='grid'][data-part='item'][data-row-span='9'] {
979
+ --xh-_grid-row-span: 9;
980
+ }
981
+
982
+ [data-scope='grid'][data-part='item'][data-row-span='10'] {
983
+ --xh-_grid-row-span: 10;
984
+ }
985
+
986
+ [data-scope='grid'][data-part='item'][data-row-span='11'] {
987
+ --xh-_grid-row-span: 11;
988
+ }
989
+
990
+ [data-scope='grid'][data-part='item'][data-row-span='12'] {
991
+ --xh-_grid-row-span: 12;
992
+ }
993
+
994
+ /* —— 逐档跨行 —— */
995
+ /* 与逐档跨列逐字同构:移动优先,没写的档沿用比它窄的那一档;每档都从 1 写起,某一档收回一行同样合法 */
996
+ @media (min-width: 640px) {
997
+ [data-scope='grid'][data-part='item'][data-row-span-sm='1'] {
998
+ --xh-_grid-row-span: 1;
999
+ }
1000
+
1001
+ [data-scope='grid'][data-part='item'][data-row-span-sm='2'] {
1002
+ --xh-_grid-row-span: 2;
1003
+ }
1004
+
1005
+ [data-scope='grid'][data-part='item'][data-row-span-sm='3'] {
1006
+ --xh-_grid-row-span: 3;
1007
+ }
1008
+
1009
+ [data-scope='grid'][data-part='item'][data-row-span-sm='4'] {
1010
+ --xh-_grid-row-span: 4;
1011
+ }
1012
+
1013
+ [data-scope='grid'][data-part='item'][data-row-span-sm='5'] {
1014
+ --xh-_grid-row-span: 5;
1015
+ }
1016
+
1017
+ [data-scope='grid'][data-part='item'][data-row-span-sm='6'] {
1018
+ --xh-_grid-row-span: 6;
1019
+ }
1020
+
1021
+ [data-scope='grid'][data-part='item'][data-row-span-sm='7'] {
1022
+ --xh-_grid-row-span: 7;
1023
+ }
1024
+
1025
+ [data-scope='grid'][data-part='item'][data-row-span-sm='8'] {
1026
+ --xh-_grid-row-span: 8;
1027
+ }
1028
+
1029
+ [data-scope='grid'][data-part='item'][data-row-span-sm='9'] {
1030
+ --xh-_grid-row-span: 9;
1031
+ }
1032
+
1033
+ [data-scope='grid'][data-part='item'][data-row-span-sm='10'] {
1034
+ --xh-_grid-row-span: 10;
1035
+ }
1036
+
1037
+ [data-scope='grid'][data-part='item'][data-row-span-sm='11'] {
1038
+ --xh-_grid-row-span: 11;
1039
+ }
1040
+
1041
+ [data-scope='grid'][data-part='item'][data-row-span-sm='12'] {
1042
+ --xh-_grid-row-span: 12;
1043
+ }
1044
+ }
1045
+
1046
+ @media (min-width: 768px) {
1047
+ [data-scope='grid'][data-part='item'][data-row-span-md='1'] {
1048
+ --xh-_grid-row-span: 1;
1049
+ }
1050
+
1051
+ [data-scope='grid'][data-part='item'][data-row-span-md='2'] {
1052
+ --xh-_grid-row-span: 2;
1053
+ }
1054
+
1055
+ [data-scope='grid'][data-part='item'][data-row-span-md='3'] {
1056
+ --xh-_grid-row-span: 3;
1057
+ }
1058
+
1059
+ [data-scope='grid'][data-part='item'][data-row-span-md='4'] {
1060
+ --xh-_grid-row-span: 4;
1061
+ }
1062
+
1063
+ [data-scope='grid'][data-part='item'][data-row-span-md='5'] {
1064
+ --xh-_grid-row-span: 5;
1065
+ }
1066
+
1067
+ [data-scope='grid'][data-part='item'][data-row-span-md='6'] {
1068
+ --xh-_grid-row-span: 6;
1069
+ }
1070
+
1071
+ [data-scope='grid'][data-part='item'][data-row-span-md='7'] {
1072
+ --xh-_grid-row-span: 7;
1073
+ }
1074
+
1075
+ [data-scope='grid'][data-part='item'][data-row-span-md='8'] {
1076
+ --xh-_grid-row-span: 8;
1077
+ }
1078
+
1079
+ [data-scope='grid'][data-part='item'][data-row-span-md='9'] {
1080
+ --xh-_grid-row-span: 9;
1081
+ }
1082
+
1083
+ [data-scope='grid'][data-part='item'][data-row-span-md='10'] {
1084
+ --xh-_grid-row-span: 10;
1085
+ }
1086
+
1087
+ [data-scope='grid'][data-part='item'][data-row-span-md='11'] {
1088
+ --xh-_grid-row-span: 11;
1089
+ }
1090
+
1091
+ [data-scope='grid'][data-part='item'][data-row-span-md='12'] {
1092
+ --xh-_grid-row-span: 12;
1093
+ }
1094
+ }
1095
+
1096
+ @media (min-width: 1024px) {
1097
+ [data-scope='grid'][data-part='item'][data-row-span-lg='1'] {
1098
+ --xh-_grid-row-span: 1;
1099
+ }
1100
+
1101
+ [data-scope='grid'][data-part='item'][data-row-span-lg='2'] {
1102
+ --xh-_grid-row-span: 2;
1103
+ }
1104
+
1105
+ [data-scope='grid'][data-part='item'][data-row-span-lg='3'] {
1106
+ --xh-_grid-row-span: 3;
1107
+ }
1108
+
1109
+ [data-scope='grid'][data-part='item'][data-row-span-lg='4'] {
1110
+ --xh-_grid-row-span: 4;
1111
+ }
1112
+
1113
+ [data-scope='grid'][data-part='item'][data-row-span-lg='5'] {
1114
+ --xh-_grid-row-span: 5;
1115
+ }
1116
+
1117
+ [data-scope='grid'][data-part='item'][data-row-span-lg='6'] {
1118
+ --xh-_grid-row-span: 6;
1119
+ }
1120
+
1121
+ [data-scope='grid'][data-part='item'][data-row-span-lg='7'] {
1122
+ --xh-_grid-row-span: 7;
1123
+ }
1124
+
1125
+ [data-scope='grid'][data-part='item'][data-row-span-lg='8'] {
1126
+ --xh-_grid-row-span: 8;
1127
+ }
1128
+
1129
+ [data-scope='grid'][data-part='item'][data-row-span-lg='9'] {
1130
+ --xh-_grid-row-span: 9;
1131
+ }
1132
+
1133
+ [data-scope='grid'][data-part='item'][data-row-span-lg='10'] {
1134
+ --xh-_grid-row-span: 10;
1135
+ }
1136
+
1137
+ [data-scope='grid'][data-part='item'][data-row-span-lg='11'] {
1138
+ --xh-_grid-row-span: 11;
1139
+ }
1140
+
1141
+ [data-scope='grid'][data-part='item'][data-row-span-lg='12'] {
1142
+ --xh-_grid-row-span: 12;
1143
+ }
1144
+ }
1145
+
1146
+ @media (min-width: 1280px) {
1147
+ [data-scope='grid'][data-part='item'][data-row-span-xl='1'] {
1148
+ --xh-_grid-row-span: 1;
1149
+ }
1150
+
1151
+ [data-scope='grid'][data-part='item'][data-row-span-xl='2'] {
1152
+ --xh-_grid-row-span: 2;
1153
+ }
1154
+
1155
+ [data-scope='grid'][data-part='item'][data-row-span-xl='3'] {
1156
+ --xh-_grid-row-span: 3;
1157
+ }
1158
+
1159
+ [data-scope='grid'][data-part='item'][data-row-span-xl='4'] {
1160
+ --xh-_grid-row-span: 4;
1161
+ }
1162
+
1163
+ [data-scope='grid'][data-part='item'][data-row-span-xl='5'] {
1164
+ --xh-_grid-row-span: 5;
1165
+ }
1166
+
1167
+ [data-scope='grid'][data-part='item'][data-row-span-xl='6'] {
1168
+ --xh-_grid-row-span: 6;
1169
+ }
1170
+
1171
+ [data-scope='grid'][data-part='item'][data-row-span-xl='7'] {
1172
+ --xh-_grid-row-span: 7;
1173
+ }
1174
+
1175
+ [data-scope='grid'][data-part='item'][data-row-span-xl='8'] {
1176
+ --xh-_grid-row-span: 8;
1177
+ }
1178
+
1179
+ [data-scope='grid'][data-part='item'][data-row-span-xl='9'] {
1180
+ --xh-_grid-row-span: 9;
1181
+ }
1182
+
1183
+ [data-scope='grid'][data-part='item'][data-row-span-xl='10'] {
1184
+ --xh-_grid-row-span: 10;
1185
+ }
1186
+
1187
+ [data-scope='grid'][data-part='item'][data-row-span-xl='11'] {
1188
+ --xh-_grid-row-span: 11;
1189
+ }
1190
+
1191
+ [data-scope='grid'][data-part='item'][data-row-span-xl='12'] {
1192
+ --xh-_grid-row-span: 12;
1193
+ }
1194
+ }
1195
+
945
1196
  /* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
946
1197
  写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
947
1198
  [data-scope='grid'][data-part='root'][hidden] {
package/css/heatmap.css CHANGED
@@ -5,6 +5,9 @@
5
5
 
6
6
  /* 定义 heatmap 样式。 */
7
7
 
8
+ /* 详情条与对照条走 Chart 家族配方:与其余图表的提示框、图例同一副外观。本皮肤 @import 它,单独引入仍成立。 */
9
+ @import '../family/chart.css';
10
+
8
11
  @layer xihan.components {
9
12
  /* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
10
13
  [data-scope='heatmap'] {
@@ -34,8 +37,9 @@
34
37
  改写这个槽为一个看得见的颜色(`var(--xh-heatmap-label-fg, var(--xh-fg-subtle))`)即七行全画。
35
38
  周首日是星期一时留下的是二 / 四 / 六,是星期日时留下的是一 / 三 / 五 */
36
39
  --xh-_heatmap-week-day-skip: var(--xh-heatmap-week-day-skip, transparent);
37
- /* 色阶的两端:0 档的空格底与满档的实心底。没写 data-tone 也没写 data-palette 时就是这里的取值 */
38
- --xh-_heatmap-empty: var(--xh-heatmap-empty, var(--xh-bg-subtle));
40
+ /* 色阶的两端:0 档的空格底与满档的实心底。没写 data-tone 也没写 data-palette 时就是这里的取值。
41
+ 空格底取淡底的不透明档:中间各档由两端按比例兑出,一端半透明,整条色阶都会跟着半透明、偏色 */
42
+ --xh-_heatmap-empty: var(--xh-heatmap-empty, var(--xh-bg-subtle-opaque));
39
43
  --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-bg-brand));
40
44
  /* 钉住的行首那一列自带的底色:格子从它下面滚过去时不能透出来。
41
45
  整块摆在别的底色上(卡片、分区)时改写 --xh-heatmap-bg,否则那一列会是一块补丁 */
@@ -68,36 +72,65 @@
68
72
  }
69
73
 
70
74
  /* —— 色板 —— */
71
- /* 直接按颜色点名,定的是满档那一端的实心底;0 档的空格底与中间各档的兑法一概不动。
72
- 六条规则与上面那条语气规则同特指度,排在它之后:两个都写时色板赢——
75
+ /* 直接按颜色点名,定的是满档那一端的实心底:取基础色板里同名色相的 600 档;0 档的空格底与中间各档的兑法一概不动。
76
+ 基础色板同一档跨色相同一明度,十二个色相摊出来的五档深浅一致,换色板不换可读性。
77
+ 这几条规则与上面那条语气规则同特指度,排在它之后:两个都写时色板赢——
73
78
  色板指名了一个具体颜色,语气只是推得出一个颜色,指名的那个更具体。
74
79
  取值一律逐值写死原语、不经 --xh-_tone:那一族槽位是语气层的派生结果,
75
80
  色板借道它就会连带把语气的悬停 / 淡底 / 前景一起绑进来,也会被祖先的 data-tone 染色。
76
- 色板拼错取值时六条都不命中,落回上面两条,与没写一样 */
81
+ 色板拼错取值时一条都不命中,落回上面两条,与没写一样 */
82
+ [data-scope='heatmap'][data-part='root'][data-palette='red'] {
83
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-red-600));
84
+ }
85
+
86
+ [data-scope='heatmap'][data-part='root'][data-palette='orange'] {
87
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-orange-600));
88
+ }
89
+
90
+ [data-scope='heatmap'][data-part='root'][data-palette='amber'] {
91
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-amber-600));
92
+ }
93
+
94
+ [data-scope='heatmap'][data-part='root'][data-palette='yellow'] {
95
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-yellow-600));
96
+ }
97
+
98
+ [data-scope='heatmap'][data-part='root'][data-palette='lime'] {
99
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-lime-600));
100
+ }
101
+
77
102
  [data-scope='heatmap'][data-part='root'][data-palette='green'] {
78
- --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-success-600));
103
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-green-600));
104
+ }
105
+
106
+ [data-scope='heatmap'][data-part='root'][data-palette='teal'] {
107
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-teal-600));
108
+ }
109
+
110
+ [data-scope='heatmap'][data-part='root'][data-palette='cyan'] {
111
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-cyan-600));
79
112
  }
80
113
 
81
114
  [data-scope='heatmap'][data-part='root'][data-palette='blue'] {
82
- --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-info-600));
115
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-blue-600));
83
116
  }
84
117
 
85
- [data-scope='heatmap'][data-part='root'][data-palette='orange'] {
86
- --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-warning-600));
118
+ [data-scope='heatmap'][data-part='root'][data-palette='indigo'] {
119
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-indigo-600));
87
120
  }
88
121
 
89
122
  [data-scope='heatmap'][data-part='root'][data-palette='purple'] {
90
123
  --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-purple-600));
91
124
  }
92
125
 
93
- [data-scope='heatmap'][data-part='root'][data-palette='red'] {
94
- --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-danger-600));
126
+ [data-scope='heatmap'][data-part='root'][data-palette='pink'] {
127
+ --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-pink-600));
95
128
  }
96
129
 
97
- /* 灰是唯一按主题换档的一族:五个彩色族的 600 档明度在 0.577–0.705,
130
+ /* 灰是唯一按主题换档的一族:十二个色相的 600 档明度都是 0.546,
98
131
  深色态的空格底(neutral-800,明度 0.269)离得够远;中性 600 档只有 0.439,
99
132
  五档摊下来每档只差 0.0425、相邻两档对比度 1.16–1.20,等于看不出分档。
100
- 深色态改取 neutral-450(明度 0.65),步长回到 0.095、相邻两档 1.42–1.50,与彩色族齐平。
133
+ 深色态改取 neutral-450(明度 0.65),步长回到 0.095、相邻两档 1.42–1.50,不输彩色族。
101
134
  不取更亮的 neutral-400:高对比档的 border-default 正是那一档,满档格子的描边会与底色同色。
102
135
  data-theme 写在自己身上还是写在祖先上都算,两种用法都成立 */
103
136
  [data-scope='heatmap'][data-part='root'][data-palette='gray'] {
@@ -108,6 +141,23 @@
108
141
  --xh-_heatmap-ink: var(--xh-heatmap-ink, var(--xh-color-neutral-450));
109
142
  }
110
143
 
144
+ /* —— 发散色阶 ——
145
+ 以中点为界两侧各自加深:中点那一格是数据色的中性中点,低于中点兑向负向色、高于中点兑向正向色。
146
+ 三色都取数据色的发散三色,语气与色板在这一档不生效。中点是没有色相的中性色,兑色走 oklab
147
+ (格子的基础规则已是 in oklab),oklch 会绕着色相环走出一段杂色 */
148
+ [data-scope='heatmap'][data-part='root'][data-scale='diverging'] {
149
+ --xh-_heatmap-empty: var(--xh-heatmap-diverging-center, var(--xh-chart-diverging-center));
150
+ }
151
+
152
+ /* 两侧的墨色写在格子上而不是根上:根上的语气与色板规则(含暗色的中性色板)不论权重多高都盖不到这里 */
153
+ [data-scope='heatmap'][data-part='root'][data-scale='diverging'] :is([data-scope='heatmap'][data-part='cell'], [data-scope='heatmap'][data-part='legend-item'])[data-polarity='negative'] {
154
+ --xh-_heatmap-ink: var(--xh-heatmap-diverging-negative, var(--xh-chart-diverging-negative));
155
+ }
156
+
157
+ [data-scope='heatmap'][data-part='root'][data-scale='diverging'] :is([data-scope='heatmap'][data-part='cell'], [data-scope='heatmap'][data-part='legend-item'])[data-polarity='positive'] {
158
+ --xh-_heatmap-ink: var(--xh-heatmap-diverging-positive, var(--xh-chart-diverging-positive));
159
+ }
160
+
111
161
  /* —— 尺寸 —— */
112
162
  /* 缺省的 md 档写在上面的基础规则里 */
113
163
  [data-scope='heatmap'][data-part='root'][data-size='sm'] {
@@ -209,7 +259,28 @@
209
259
  /* 空格与浅档在浅色底上几乎没有边界,描一圈极淡的线把方格勾出来。
210
260
  这一档不能取 border-subtle:它与空格底色 bg-subtle 是同一个原色,描了等于没描 */
211
261
  box-shadow: inset 0 0 0 var(--xh-stroke-thin) var(--xh-heatmap-cell-border, var(--xh-border-default));
212
- transition: background var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
262
+ transition: box-shadow var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
263
+ }
264
+
265
+ /* 详情条正在说的那一格(指针停着或焦点落着)描一圈正文色的粗线:扫过一片格子时看得出条说的是哪一格 */
266
+ [data-scope='heatmap'][data-part='cell'][data-highlighted] {
267
+ box-shadow: inset 0 0 0 var(--xh-stroke-thick) var(--xh-heatmap-cell-border-highlighted, var(--xh-fg-default));
268
+ }
269
+
270
+ /* 首次出现:有颜色的格子从空格底色填到自己的档位色,按日期(矩阵按列)的先后扫过去。
271
+ 连接层写入这一格在扫描里的位置,乘上扫描时长就是它开始填色的延迟;
272
+ 减弱动效下扫描时长归零,各格一起淡变填色 */
273
+ [data-scope='heatmap'][data-part='cell'][data-drawing] {
274
+ animation: xh-heatmap-fill var(--xh-motion-duration-enter) var(--xh-motion-ease-enter) both;
275
+ animation-delay: calc(var(--xh-motion-duration-reveal) * var(--xh-_chart-reveal-at));
276
+ }
277
+
278
+ /* 数据变化后的换色:各格从旧档的颜色过渡到新档。只在连接层标出的这一段过渡,
279
+ 主题与语气的换色照常一步到位,不被数据的时长拖慢 */
280
+ [data-scope='heatmap'][data-part='root'][data-animating] [data-scope='heatmap'][data-part='cell'] {
281
+ transition:
282
+ background-color var(--xh-motion-duration-morph) var(--xh-motion-ease-continuous),
283
+ box-shadow var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
213
284
  }
214
285
 
215
286
  /* 错列打在本行第一个格子上:打在行上会连行首的星期名一起往后推,
@@ -320,22 +391,21 @@
320
391
  /* 至少与格子同宽,一两个字的详情也不会瘦成一条 */
321
392
  min-inline-size: var(--xh-_heatmap-tip-w);
322
393
  max-inline-size: var(--xh-heatmap-tooltip-max-w, var(--xh-overlay-max-w));
323
- padding-block: var(--xh-heatmap-tooltip-py, var(--xh-space-1));
324
- padding-inline: var(--xh-heatmap-tooltip-px, var(--xh-space-2));
325
- border-radius: var(--xh-heatmap-tooltip-radius, var(--xh-shape-control));
326
- /* 与 Tooltip 同一副反白气泡:任何浮层都得有一圈非透明描边,描边从字色里兑两成,
327
- 深浅主题与语气换色时跟着字色走;影走 frosted 紧凑档,与 Tooltip 的 content 同深 */
328
- border: var(--xh-stroke-thin) solid var(--xh-heatmap-tooltip-border, color-mix(in oklab, var(--xh-heatmap-tooltip-fg, var(--xh-bg-surface)) 20%, transparent));
329
- background: var(--xh-heatmap-tooltip-bg, var(--xh-fg-default));
330
- color: var(--xh-heatmap-tooltip-fg, var(--xh-bg-surface));
331
- /* 字号与 Tooltip 缺省档同一把尺(次级标注档 13px) */
332
- font-size: var(--xh-heatmap-tooltip-font-size, var(--xh-control-caption-md));
394
+ /* 配方按物理左缘与平移落位,详情条自己按格子的逻辑缘落位:把配方那两处让开 */
395
+ translate: none;
396
+ /* 材质、圆角、内边距与影走配方:frosted、overlay 圆角、正文排版,不反白 */
397
+ --xh-_chart-tip-x: auto;
398
+ --xh-_chart-tooltip-gap: var(--xh-space-1);
399
+ --xh-_chart-tooltip-py: var(--xh-heatmap-tooltip-py, var(--xh-surface-pad-sm));
400
+ --xh-_chart-tooltip-px: var(--xh-heatmap-tooltip-px, var(--xh-surface-pad-sm));
401
+ --xh-_chart-tooltip-radius: var(--xh-heatmap-tooltip-radius, var(--xh-shape-overlay));
402
+ --xh-_chart-tooltip-shadow: var(--xh-heatmap-tooltip-shadow, var(--xh-material-frosted-shadow));
403
+ /* 作者覆盖的底、字与描边压在配方的材质上:只换颜色那一层,顶部的边界光与模糊照旧 */
404
+ border-color: var(--xh-heatmap-tooltip-border, var(--xh-material-frosted-border));
405
+ background-color: var(--xh-heatmap-tooltip-bg, var(--xh-material-frosted-bg));
406
+ color: var(--xh-heatmap-tooltip-fg, var(--xh-material-frosted-fg));
407
+ font-size: var(--xh-heatmap-tooltip-font-size, var(--xh-text-body-size));
333
408
  line-height: var(--xh-leading-normal);
334
- white-space: nowrap;
335
- box-shadow: var(--xh-heatmap-tooltip-shadow, var(--xh-material-frosted-compact-shadow));
336
- /* 详情条不接指针:压在格子上时指针要能穿过去,否则一进条里就算离开了格子,
337
- 详情自己把自己收起来,来回闪 */
338
- pointer-events: none;
339
409
  }
340
410
 
341
411
  /* 从格子的末缘往回长:条比一格宽得多,格子后面的地方比前面少时往后长会伸出滚动容器被裁掉,
@@ -360,10 +430,13 @@
360
430
  inset-block-end: calc(100% - var(--xh-_heatmap-tip-y) + var(--xh-_heatmap-gap));
361
431
  }
362
432
 
433
+ /* 对照条的排布走配方,间距由配方的私有槽给出;色阶是一条连续的尺,不折行:
434
+ 「少」、一排色块、「多」断开就读不出哪端表示多 */
363
435
  [data-scope='heatmap'][data-part='legend'] {
364
- display: flex;
436
+ --xh-_chart-legend-gap: var(--xh-heatmap-legend-gap, var(--xh-_heatmap-gap));
437
+
438
+ flex-wrap: nowrap;
365
439
  align-items: center;
366
- gap: var(--xh-heatmap-legend-gap, var(--xh-_heatmap-gap));
367
440
  color: var(--xh-heatmap-label-fg, var(--xh-fg-subtle));
368
441
  }
369
442
 
@@ -390,11 +463,6 @@
390
463
  box-shadow: inset 0 0 0 var(--xh-stroke-thin) var(--xh-heatmap-cell-border, var(--xh-border-default));
391
464
  }
392
465
 
393
- /* 详情条的收起态:没有哪一格是活的时候整条藏起来 */
394
- [data-scope='heatmap'][data-part='tooltip'][data-state='hidden'] {
395
- display: none;
396
- }
397
-
398
466
  /* 给了 display 的角色节点必须补这条:display 声明会盖掉 UA 的 [hidden]{display:none},
399
467
  不补的话作者给节点加 hidden 后它照样显示。
400
468
  格子没有声明 display,UA 那条兜得住,不必列在这里 */
@@ -451,6 +519,12 @@
451
519
  [data-scope='heatmap'][data-part='legend-item'][data-level='3'] {
452
520
  --xh-_heatmap-ink-ring: calc(var(--xh-_heatmap-cell-size) * 0.4);
453
521
  }
522
+
523
+ /* 发散色阶两侧同档的环一样粗,纸上分不出正负:负向一侧改用点线,点线在任何粗细下都认得出 */
524
+ [data-scope='heatmap'][data-part='cell'][data-polarity='negative'],
525
+ [data-scope='heatmap'][data-part='legend-item'][data-polarity='negative'] {
526
+ border-style: dotted;
527
+ }
454
528
  }
455
529
 
456
530
  /*
@@ -467,3 +541,12 @@
467
541
  }
468
542
  }
469
543
  }
544
+
545
+ @layer xihan.motion {
546
+ /* 只写起点:终点是格子自己的档位色,作者改写 --xh-heatmap-cell-bg 时同样成立 */
547
+ @keyframes xh-heatmap-fill {
548
+ from {
549
+ background-color: var(--xh-_heatmap-empty);
550
+ }
551
+ }
552
+ }