@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,439 @@
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
+ /* 定义 tour 样式。 */
7
+
8
+ /* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立。 */
9
+ @import '../family/motion.css';
10
+ @import '../family/action-control.css';
11
+
12
+ @layer xihan.motion {
13
+ /* 高亮框落定时那一下呼吸:换步时视线要跟着它走,纯位移太容易被漏看 */
14
+ @keyframes xh-tour-spotlight-in {
15
+ from {
16
+ opacity: var(--xh-_enter-from-opacity, 0);
17
+ scale: calc(2 - var(--xh-motion-scale-enter));
18
+ }
19
+
20
+ to {
21
+ opacity: 1;
22
+ scale: 1;
23
+ }
24
+ }
25
+
26
+ /* 退场反向放大淡出,幅度比进场浅一档 */
27
+ @keyframes xh-tour-spotlight-out {
28
+ from {
29
+ opacity: 1;
30
+ scale: 1;
31
+ }
32
+
33
+ to {
34
+ opacity: 0;
35
+ scale: calc(2 - var(--xh-motion-scale-exit));
36
+ }
37
+ }
38
+ }
39
+
40
+ @layer xihan.components {
41
+ /* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
42
+ .xh-scope-tour {
43
+ --xh-tour-skin: 1;
44
+ }
45
+
46
+ /* 根节点只是几个浮层的归属容器,不参与排版。
47
+ 这里不给 display,UA 的 [hidden]{display:none} 就仍然压得住 */
48
+ .xh-scope-tour[data-part='root'] {
49
+ /* 作者塞进部件里的图标按控件档取字形尺(md = 20px);四颗按钮各自再按 sm 档收一档 */
50
+ --xh-icon-size: var(--xh-tour-icon-size, var(--xh-glyph-size-md));
51
+
52
+ color: var(--xh-tour-fg, var(--xh-fg-default));
53
+ }
54
+
55
+ /* 浮层被搬到 portal 落点,继承不到 root 上的槽:这把尺在被搬走的那一侧再声明一次,
56
+ 关闭钮与条目里作者塞的图标才和皮肤画的兜底字形一样大 */
57
+ .xh-scope-tour[data-part='content'] {
58
+ --xh-icon-size: var(--xh-tour-icon-size, var(--xh-glyph-size-md));
59
+ }
60
+
61
+ /* 遮罩:整页压暗,把注意力逼到高亮框那一块上 */
62
+ .xh-scope-tour[data-part='backdrop'] {
63
+ position: fixed;
64
+ inset: 0;
65
+ z-index: var(--xh-tour-backdrop-layer, var(--xh-_layer, var(--xh-layer-modal)));
66
+ background: var(--xh-tour-backdrop-bg, var(--xh-bg-overlay));
67
+ }
68
+
69
+ .xh-scope-tour[data-part='backdrop'][hidden] {
70
+ display: none;
71
+ }
72
+
73
+ .xh-scope-tour[data-part='backdrop'][data-state='open']:not([data-instant]) {
74
+ animation: xh-fade-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter);
75
+ }
76
+
77
+ .xh-scope-tour[data-part='backdrop'][data-state='closed'] {
78
+ animation: xh-fade-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
79
+ }
80
+
81
+ /* 挖洞的高亮框。位置与尺寸由连接层量出来写进内联 style(position/inset/尺寸那几条轴归它),
82
+ 这里只管长相:一圈描边 + 一片铺满视口的投影当暗幕,中间那块因此是亮的——
83
+ 这就是"洞"。不吃指针:它盖在目标上面,吃了的话目标就再也点不动了 */
84
+ .xh-scope-tour[data-part='spotlight'] {
85
+ --xh-_tour-spotlight-shroud: transparent;
86
+ --xh-_tour-spotlight-radius: var(--xh-shape-surface);
87
+
88
+ z-index: var(--xh-tour-spotlight-layer, var(--xh-_layer, var(--xh-layer-modal)));
89
+ pointer-events: none;
90
+ border-radius: var(
91
+ --xh-tour-spotlight-radius,
92
+ var(--xh-_tour-spotlight-radius, var(--xh-shape-surface))
93
+ );
94
+ box-shadow:
95
+ 0 0 0 var(--xh-stroke-thick) var(--xh-tour-spotlight-ring, var(--xh-ring-focus)),
96
+ 0 0 0 100vmax var(--xh-_tour-spotlight-shroud);
97
+ }
98
+
99
+ /* 换步那一段(data-animating):聚光框与气泡同一段时长、同一条曲线一起滑到下一个目标,视线跟得上;
100
+ 页面滚动与视口缩放时不挂,两者跟手、不拖尾。坐标由连接层按物理 left / top 写进内联,过渡跟着写物理轴 */
101
+ .xh-scope-tour[data-part='spotlight'][data-animating] {
102
+ transition:
103
+ left var(--xh-motion-duration-move) var(--xh-motion-ease-continuous),
104
+ top var(--xh-motion-duration-move) var(--xh-motion-ease-continuous),
105
+ inline-size var(--xh-motion-duration-move) var(--xh-motion-ease-continuous),
106
+ block-size var(--xh-motion-duration-move) var(--xh-motion-ease-continuous),
107
+ border-radius var(--xh-motion-duration-move) var(--xh-motion-ease-continuous);
108
+ }
109
+
110
+ .xh-scope-tour[data-part='positioner'][data-animating] {
111
+ transition:
112
+ left var(--xh-motion-duration-move) var(--xh-motion-ease-continuous),
113
+ top var(--xh-motion-duration-move) var(--xh-motion-ease-continuous);
114
+ }
115
+
116
+ .xh-scope-tour[data-part='spotlight'][data-dimmed] {
117
+ --xh-_tour-spotlight-shroud: var(--xh-tour-spotlight-shroud, var(--xh-bg-overlay));
118
+ }
119
+
120
+ .xh-scope-tour[data-part='spotlight'][hidden] {
121
+ display: none;
122
+ }
123
+
124
+ .xh-scope-tour[data-part='spotlight'][data-state='open']:not([data-instant]) {
125
+ animation: xh-tour-spotlight-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
126
+ }
127
+
128
+ /* 退场与气泡并行播,同一段时长;收起那一帧 hidden 由宿主押后到气泡的退场结束 */
129
+ .xh-scope-tour[data-part='spotlight'][data-state='closed'] {
130
+ animation: xh-tour-spotlight-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
131
+ }
132
+
133
+ /* 锚定步的暗幕由 Spotlight 自己挖洞,Backdrop 只负责拦截背景交互。状态直接由连接层给,
134
+ 不依赖两个 Portal shell 在落点里的相对顺序。 */
135
+ .xh-scope-tour[data-part='backdrop'][data-position='anchored'] {
136
+ background: transparent;
137
+ }
138
+
139
+ /* 空壳不吃指针,交互只发生在 content 上。
140
+ 锚定步的坐标由定位引擎写进内联 style,这里不碰那两条轴 */
141
+ .xh-scope-tour[data-part='positioner'] {
142
+ /* 落定那一侧的可用高度,由定位引擎经内联自定义属性写进来,气泡继承它限高;
143
+ 居中步与尚未落位时不额外限高 */
144
+ --xh-_tour-available-h: 100vh;
145
+ /* 落定那一侧的可用宽度,同样由定位引擎经内联自定义属性写进来,行内轴据此夹取;
146
+ 引擎没算(尚未落位 / 无引擎 / 贴边归零)时退到视口宽 */
147
+ --xh-_tour-available-w: 100vw;
148
+
149
+ z-index: var(--xh-tour-positioner-layer, var(--xh-_layer, var(--xh-layer-popover)));
150
+ pointer-events: none;
151
+ }
152
+
153
+ /* 居中步:没有锚点,铺满视口把气泡摆中间 */
154
+ .xh-scope-tour[data-part='positioner'][data-position='center'] {
155
+ inset: 0;
156
+ display: flex;
157
+ align-items: center;
158
+ justify-content: center;
159
+ padding: var(--xh-tour-positioner-padding, var(--xh-space-4));
160
+ }
161
+
162
+ /* 必须排在 data-position='center' 之后:两条选择器的特指度相同(都是三个属性),
163
+ 写在前面会被那条 display:flex 盖掉,收起态的居中步就一直摊在屏幕上 */
164
+ .xh-scope-tour[data-part='positioner'][hidden] {
165
+ display: none;
166
+ }
167
+
168
+ /* 缩放原点与进场位移按落定的那一侧给:气泡从贴着锚点的那条边涨开、沿主轴退让一小段。
169
+ 两个槽由 content 继承。只认锚定步:居中步没有锚点,data-placement 仍带着缺省值。
170
+ placement 是物理方向(引擎按 top / right / bottom / left 出值),origin 与 translate
171
+ 也是物理量,两边同轴,不随书写方向翻 */
172
+ .xh-scope-tour[data-part='positioner'][data-position='anchored'][data-placement^='top'] {
173
+ --xh-_overlay-origin-y: 100%;
174
+ --xh-_overlay-enter-down: 1;
175
+ }
176
+
177
+ .xh-scope-tour[data-part='positioner'][data-position='anchored'][data-placement^='bottom'] {
178
+ --xh-_overlay-origin-y: 0;
179
+ --xh-_overlay-enter-up: 1;
180
+ }
181
+
182
+ .xh-scope-tour[data-part='positioner'][data-position='anchored'][data-placement^='left'] {
183
+ --xh-_overlay-origin-x: 100%;
184
+ --xh-_overlay-enter-right: 1;
185
+ }
186
+
187
+ .xh-scope-tour[data-part='positioner'][data-position='anchored'][data-placement^='right'] {
188
+ --xh-_overlay-origin-x: 0;
189
+ --xh-_overlay-enter-left: 1;
190
+ }
191
+
192
+ .xh-scope-tour[data-part='content'] {
193
+ position: relative;
194
+ display: flex;
195
+ flex-direction: column;
196
+ gap: var(--xh-tour-gap, var(--xh-space-2));
197
+ inline-size: max-content;
198
+ /* 静态档与落位后的可用宽度取小:窄视口下面板伸出去,最右侧的内容就点不到了 */
199
+ max-inline-size: min(var(--xh-tour-max-w, var(--xh-overlay-max-w-lg)), var(--xh-_tour-available-w));
200
+ padding-block: var(--xh-tour-py, var(--xh-surface-py-md));
201
+ padding-inline: var(--xh-tour-px, var(--xh-surface-px-md));
202
+ /* 引导步骤的正文长度由作者定,矮视口下不限高气泡会整块伸出视口 */
203
+ max-block-size: min(var(--xh-tour-max-h, var(--xh-overlay-max-h)), var(--xh-_tour-available-h));
204
+ /* M4 sheet 三件套,与 dialog 同源:1px 描边是它的边界,不透明底,影只是加成 */
205
+ border: var(--xh-stroke-thin) solid var(--xh-tour-border, var(--xh-material-elevated-border));
206
+ border-radius: var(--xh-tour-radius, var(--xh-shape-overlay));
207
+ background: var(--xh-tour-bg, var(--xh-material-elevated-bg));
208
+ color: var(--xh-tour-fg, var(--xh-material-elevated-fg));
209
+ box-shadow: var(--xh-tour-shadow, var(--xh-material-elevated-shadow));
210
+ pointer-events: auto;
211
+ /* 进退场的缩放锚在贴着锚点的那条边上;两个分量由 positioner 按 placement 写进私有槽 */
212
+ transform-origin: var(--xh-_overlay-origin-x, 50%) var(--xh-_overlay-origin-y, 50%);
213
+ }
214
+
215
+ /* 这里刻意没有 [data-part='content'][hidden] { display: none },与 popover 一致:
216
+ 收起态连接层会给 content 打 hidden,补上这条退场动画就一帧都播不出来。
217
+ 真正的收起由退场闸门落成内联 display,节点始终留在原地。 */
218
+
219
+ /* 焦点落在气泡本身,Enter / Space 落在它身上推进下一步:它是可操作目标,
220
+ 环由 focus.css 的默认内收环画,这里不另写 */
221
+
222
+ /* 挂载时就开着的那一段(data-instant)属于首帧,直接呈现 */
223
+ .xh-scope-tour[data-part='content'][data-state='open']:not([data-instant]) {
224
+ animation: xh-overlay-pop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
225
+ }
226
+
227
+ /* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
228
+ 免得动画结束到收起落下来之间闪一下原样 */
229
+ .xh-scope-tour[data-part='content'][data-state='closed'] {
230
+ animation: xh-pop-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
231
+ }
232
+
233
+ .xh-scope-tour[data-part='title'] {
234
+ margin: 0;
235
+ font-size: var(--xh-tour-title-font-size, var(--xh-text-heading-3-size));
236
+ font-weight: var(--xh-tour-title-font-weight, var(--xh-text-heading-3-weight));
237
+ color: var(--xh-tour-title-fg, var(--xh-fg-default));
238
+ }
239
+
240
+ /* 关闭按钮是绝对定位的,不占流内宽度:标题得自己让出右上角那块,
241
+ 否则长标题会直接钻到按钮底下。只在真有关闭按钮时让位。 */
242
+ .xh-scope-tour[data-part='content']:has(.xh-scope-tour[data-part='close-trigger'])
243
+ .xh-scope-tour[data-part='title'] {
244
+ padding-inline-end: calc(var(--xh-tour-close-size, var(--xh-control-h-sm)) + var(--xh-surface-action-inset));
245
+ }
246
+
247
+ /* 说明文字走说明档:13px + fg-muted */
248
+ .xh-scope-tour[data-part='description'] {
249
+ margin: 0;
250
+ font-size: var(--xh-tour-description-font-size, var(--xh-text-secondary-size));
251
+ line-height: var(--xh-leading-normal);
252
+ color: var(--xh-tour-description-fg, var(--xh-fg-muted));
253
+ }
254
+
255
+ /* "第 m 步,共 n 步":辅助信息,字号压一档,与按钮排在同一行的两端 */
256
+ .xh-scope-tour[data-part='progress-text'] {
257
+ font-size: var(--xh-tour-progress-font-size, var(--xh-text-caption-size));
258
+ color: var(--xh-tour-progress-fg, var(--xh-fg-subtle));
259
+ }
260
+
261
+ /* 圆点组:一步一颗,横排 */
262
+ .xh-scope-tour[data-part='progress-indicator'] {
263
+ display: inline-flex;
264
+ align-items: center;
265
+ gap: var(--xh-tour-progress-indicator-gap, var(--xh-space-1));
266
+ }
267
+
268
+ .xh-scope-tour[data-part='progress-indicator'][hidden] {
269
+ display: none;
270
+ }
271
+
272
+ /* 圆点:8px 正圆取 circle(分页点统一款),未走到的一档取中性描边色。
273
+ 宽度与底色都随状态换,换步那一下能看出进度在推进 */
274
+ .xh-scope-tour[data-part='progress-dot'] {
275
+ inline-size: var(--xh-space-2);
276
+ block-size: var(--xh-space-2);
277
+ border-radius: var(--xh-shape-circle);
278
+ background: var(--xh-tour-progress-dot-bg, var(--xh-border-default));
279
+ transition:
280
+ inline-size var(--xh-motion-duration-nudge) var(--xh-motion-ease-continuous),
281
+ background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
282
+ }
283
+
284
+ /* 走过的步:中性色加重一档 */
285
+ .xh-scope-tour[data-part='progress-dot'][data-complete] {
286
+ background: var(--xh-tour-progress-dot-bg-complete, var(--xh-border-strong));
287
+ }
288
+
289
+ /* 当前步:拉成 20px 胶囊并换品牌色;一维对象取 pill */
290
+ .xh-scope-tour[data-part='progress-dot'][data-current] {
291
+ inline-size: var(--xh-space-5);
292
+ border-radius: var(--xh-shape-pill);
293
+ background: var(--xh-tour-progress-dot-bg-current, var(--xh-bg-brand));
294
+ }
295
+
296
+ /*
297
+ * —— 末行三颗按钮 ——
298
+ * 上一步 / 下一步 / 跳过都是气泡末行的文字按钮:盒型、sm 档几何、四态面、0.97 按压并换底、粗指针命中区与
299
+ * 强制色由家族配方按连接层投影的 data-xh-action-variant / -size 给出。这里只把公开槽桥接到矩阵之前
300
+ * (使用者槽 → 形态矩阵 → 家族缺省)与几何映射;内衬与圆角槽三颗共用。
301
+ */
302
+ .xh-scope-tour[data-part='prev-trigger'],
303
+ .xh-scope-tour[data-part='next-trigger'],
304
+ .xh-scope-tour[data-part='skip-trigger'] {
305
+ --xh-action-padding-inline: var(--xh-tour-skip-trigger-px, var(--xh-_action-profile-padding-inline));
306
+ --xh-action-radius: var(--xh-tour-action-radius, var(--xh-shape-control));
307
+ /* 作者塞进按钮的图标随档取字形尺(sm = 16px) */
308
+ --xh-icon-size: var(--xh-tour-icon-size, var(--xh-_action-profile-glyph-size));
309
+ }
310
+
311
+ .xh-scope-tour[data-part='prev-trigger'][hidden],
312
+ .xh-scope-tour[data-part='next-trigger'][hidden],
313
+ .xh-scope-tour[data-part='skip-trigger'][hidden] {
314
+ display: none;
315
+ }
316
+
317
+ /* 下一步是整条引导的主线动作,显式 solid:底、字与影三组使用者槽桥到配方 solid 列之前 */
318
+ .xh-scope-tour[data-part='next-trigger'] {
319
+ --xh-action-bg-rest: var(--xh-tour-next-bg, var(--xh-_action-variant-bg-rest));
320
+ --xh-action-bg-hover: var(--xh-tour-next-bg-hover, var(--xh-_action-variant-bg-hover));
321
+ --xh-action-bg-focus-visible: var(--xh-tour-next-bg, var(--xh-_action-variant-bg-focus-visible));
322
+ --xh-action-fg-rest: var(--xh-tour-next-fg, var(--xh-_action-variant-fg-rest));
323
+ --xh-action-fg-hover: var(--xh-tour-next-fg, var(--xh-_action-variant-fg-hover));
324
+ --xh-action-fg-pressed: var(--xh-tour-next-fg, var(--xh-_action-variant-fg-pressed));
325
+ --xh-action-fg-focus-visible: var(--xh-tour-next-fg, var(--xh-_action-variant-fg-focus-visible));
326
+ --xh-action-shadow-rest: var(--xh-tour-next-shadow, none);
327
+ }
328
+
329
+ /* 面是实心的,环色与面同族,画在面里就看不出来;环改取面自己的前景色——
330
+ 那一族色本来就要在这块面上把字读清楚,与面的对比是按可读性定的 */
331
+ .xh-scope-tour[data-part='next-trigger'][data-xh-action-variant='solid']:focus-visible {
332
+ --xh-action-ring-color-focus-visible: currentColor;
333
+ }
334
+
335
+ /*
336
+ * 关闭钮是气泡角落的单图标钮:正方盒、sm 档几何、ghost 四态面、0.97 按压并换底与粗指针命中区
337
+ * 由家族配方给出——白面上走画布承载阶梯悬停 --xh-bg-subtle(100)→ 按下 --xh-bg-subtle-hover(200),
338
+ * 焦点面透明吃库环。这里只把公开槽桥接到矩阵之前(使用者槽 → 形态矩阵 → 家族缺省)与摆放;
339
+ * 静息前景取 muted 字色,悬停 / 按下 / 聚焦回到 fg-default。
340
+ */
341
+ .xh-scope-tour[data-part='close-trigger'] {
342
+ --xh-action-visual-size: var(--xh-tour-close-size, var(--xh-_action-profile-visual-size));
343
+ --xh-action-radius: var(--xh-tour-close-radius, var(--xh-shape-control));
344
+ --xh-action-bg-hover: var(--xh-tour-close-bg-hover, var(--xh-_action-variant-bg-hover));
345
+ --xh-action-bg-pressed: var(--xh-tour-close-bg-active, var(--xh-_action-variant-bg-pressed));
346
+ --xh-action-fg-rest: var(--xh-tour-close-fg, var(--xh-fg-muted));
347
+ --xh-action-fg-hover: var(--xh-tour-close-fg-hover, var(--xh-_action-variant-fg-hover));
348
+ --xh-action-fg-pressed: var(--xh-tour-close-fg-hover, var(--xh-_action-variant-fg-pressed));
349
+ --xh-action-fg-focus-visible: var(--xh-tour-close-fg-hover, var(--xh-_action-variant-fg-focus-visible));
350
+ /* 作者塞进按钮的图标随档取字形尺(sm = 16px),与皮肤画的兜底字形同一把尺 */
351
+ --xh-icon-size: var(--xh-tour-icon-size, var(--xh-_action-profile-glyph-size));
352
+
353
+ position: absolute;
354
+ inset-block-start: var(--xh-surface-action-inset);
355
+ inset-inline-end: var(--xh-surface-action-inset);
356
+ }
357
+
358
+ .xh-scope-tour[data-part='close-trigger'][hidden] {
359
+ display: none;
360
+ }
361
+
362
+ /* 箭头的底色与描边色,几何在 overlay-arrow.css。
363
+ 交叉轴落点由定位引擎经内联自定义属性写进来,没给时退回居中 */
364
+ .xh-scope-tour[data-part='arrow'] {
365
+ --xh-_tour-arrow-x: 50%;
366
+ --xh-_tour-arrow-y: 50%;
367
+ --xh-_overlay-arrow-size: var(--xh-tour-arrow-size, var(--xh-overlay-arrow-size));
368
+ --xh-_overlay-arrow-x: var(--xh-_tour-arrow-x);
369
+ --xh-_overlay-arrow-y: var(--xh-_tour-arrow-y);
370
+
371
+ background: var(--xh-tour-bg, var(--xh-material-elevated-bg));
372
+ border: var(--xh-stroke-thin) solid var(--xh-tour-border, var(--xh-material-elevated-border));
373
+ }
374
+
375
+ /* 居中步没有锚点,连接层会给箭头发 hidden */
376
+ .xh-scope-tour[data-part='arrow'][hidden] {
377
+ display: none;
378
+ }
379
+
380
+ /* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
381
+ .xh-scope-tour[data-part='close-trigger']:empty::before {
382
+ content: '';
383
+ display: inline-block;
384
+ inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
385
+ block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
386
+ vertical-align: var(--xh-glyph-baseline-shift);
387
+ background-color: currentColor;
388
+ -webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
389
+ mask: var(--xh-glyph-mark-close) center / contain no-repeat;
390
+ }
391
+ }
392
+
393
+ @layer xihan.components {
394
+ /* 气泡限高之后只让正文让步:标题与上下步按钮滚出视线就点不到了。
395
+ 模态气泡里的原生细条滚动面:细条由 reset 层统一给,滚到头不把页面一起带走;内容高度不动态变化,不写 gutter */
396
+ .xh-scope-tour[data-part='description'] {
397
+ flex: 1 1 auto;
398
+ min-block-size: 0;
399
+ overflow-y: auto;
400
+ overscroll-behavior: contain;
401
+ }
402
+
403
+ @media (forced-colors: active) {
404
+ /* 这一档丢掉底色:走过的那几颗改由一圈描边表出,当前那颗仍靠宽度分辨 */
405
+ .xh-scope-tour[data-part='progress-dot'][data-complete] {
406
+ outline: var(--xh-stroke-thin) solid CanvasText;
407
+ }
408
+ }
409
+
410
+ @media print {
411
+ /* 打印:定位层与遮罩是交互期才存在的东西,落到纸上只会盖住底下的正文。
412
+ 收起写在这份皮肤里而不是 reset:reset 层排在组件层之前,组件层里任何一条 display 都压得住它。
413
+ 居中那一档的选择器多带一个属性、权重高一级,所以把它一并列出来,靠同权重下的书写顺序压回去。 */
414
+ .xh-scope-tour[data-part='backdrop'],
415
+ .xh-scope-tour[data-part='positioner'],
416
+ .xh-scope-tour[data-part='positioner'][data-position='center'] {
417
+ display: none;
418
+ }
419
+ }
420
+
421
+ @media (forced-colors: active) {
422
+ /* 兜底字形是 mask 挖出来的一块底色,这一档里底色被系统换成 Canvas,字形跟着消失。
423
+ 字形退出强制换色、直接写系统色(不能取 currentColor:退出强制换色的伪元素读到的是被系统换掉之前的作者色):
424
+ 按钮面上取 ButtonText,悬停与按下时家族把按钮涂成 Highlight、字形换 HighlightText;
425
+ 禁用取 GrayText */
426
+ .xh-scope-tour[data-part='close-trigger']:empty::before {
427
+ forced-color-adjust: none;
428
+ background-color: ButtonText;
429
+ }
430
+
431
+ .xh-scope-tour[data-part='close-trigger']:not([data-disabled]):not([data-loading]):is(:hover, :active, [data-pressed]):empty::before {
432
+ background-color: HighlightText;
433
+ }
434
+
435
+ .xh-scope-tour[data-part='close-trigger'][data-disabled]:empty::before {
436
+ background-color: GrayText;
437
+ }
438
+ }
439
+ }