@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.
- package/CHANGELOG.md +470 -0
- package/component-tokens.d.ts +230 -60
- package/components.tokens.json +5156 -1557
- package/css/accordion.css +47 -20
- package/css/alert.css +16 -17
- package/css/anchor.css +2 -2
- package/css/approval.css +41 -17
- package/css/avatar-group.css +9 -12
- package/css/avatar.css +20 -18
- package/css/back-top.css +21 -7
- package/css/badge.css +5 -5
- package/css/breadcrumb.css +18 -16
- package/css/button-group.css +4 -6
- package/css/button.css +13 -12
- package/css/calendar-picker.css +178 -95
- package/css/calendar-range-picker.css +207 -122
- package/css/card.css +34 -6
- package/css/carousel.css +94 -46
- package/css/cartesian-chart.css +11 -11
- package/css/cascader.css +51 -39
- package/css/checkbox-group.css +9 -6
- package/css/checkbox.css +5 -4
- package/css/citation.css +9 -4
- package/css/clipboard.css +20 -4
- package/css/code-view.css +6 -6
- package/css/collapsible.css +29 -14
- package/css/color-field.css +4 -4
- package/css/color-picker.css +77 -23
- package/css/color-slider.css +10 -8
- package/css/color-swatch-picker.css +14 -9
- package/css/combobox.css +26 -14
- package/css/command.css +14 -9
- package/css/context-menu.css +10 -5
- package/css/date-field.css +12 -6
- package/css/date-picker.css +178 -109
- package/css/date-range-picker.css +199 -130
- package/css/description.css +10 -6
- package/css/descriptions.css +47 -19
- package/css/dialog.css +50 -35
- package/css/diff-view.css +8 -8
- package/css/drawer.css +75 -21
- package/css/editable.css +15 -41
- package/css/empty-state.css +21 -3
- package/css/field-array.css +5 -2
- package/css/field.css +17 -18
- package/css/fieldset.css +33 -13
- package/css/file-upload.css +66 -33
- package/css/float-button.css +60 -35
- package/css/floating-panel.css +1 -1
- package/css/form.css +30 -16
- package/css/graph-chart.css +2 -2
- package/css/grid-list.css +1 -1
- package/css/highlight.css +5 -5
- package/css/hover-card.css +19 -12
- package/css/image-viewer.css +77 -27
- package/css/image.css +13 -5
- package/css/infinite-scroll.css +8 -4
- package/css/input-group.css +74 -26
- package/css/kbd.css +1 -1
- package/css/label.css +27 -11
- package/css/layout.css +17 -10
- package/css/list.css +13 -9
- package/css/listbox.css +12 -7
- package/css/loading-bar.css +3 -0
- package/css/mention.css +11 -9
- package/css/menu.css +10 -5
- package/css/menubar.css +13 -8
- package/css/message-feed.css +1 -1
- package/css/navigation-menu.css +2 -2
- package/css/notification.css +132 -49
- package/css/number-animation.css +2 -2
- package/css/number-field.css +75 -52
- package/css/page-header.css +64 -27
- package/css/pagination.css +35 -38
- package/css/password-input.css +12 -68
- package/css/pin-input.css +18 -26
- package/css/popconfirm.css +23 -14
- package/css/popover.css +18 -12
- package/css/progress.css +14 -13
- package/css/prompt-input.css +3 -3
- package/css/question-flow.css +41 -15
- package/css/radar-chart.css +6 -6
- package/css/radio-group.css +120 -55
- package/css/rating.css +32 -15
- package/css/select.css +16 -12
- package/css/separator.css +24 -6
- package/css/side-nav.css +29 -24
- package/css/signature-pad.css +23 -9
- package/css/skeleton.css +12 -12
- package/css/slider.css +77 -48
- package/css/sortable.css +2 -2
- package/css/sparkline.css +8 -2
- package/css/spinner.css +40 -20
- package/css/statistic.css +14 -14
- package/css/steps.css +115 -84
- package/css/switch.css +9 -7
- package/css/table.css +29 -12
- package/css/tabs.css +35 -12
- package/css/tag-group.css +17 -6
- package/css/tag.css +54 -29
- package/css/tags-input.css +39 -20
- package/css/text-field.css +5 -5
- package/css/time-field.css +4 -4
- package/css/time-picker.css +150 -64
- package/css/time-range-picker.css +91 -62
- package/css/timeline.css +37 -20
- package/css/timer.css +3 -3
- package/css/toggle-group.css +4 -4
- package/css/tool-call.css +13 -11
- package/css/toolbar.css +6 -5
- package/css/tooltip.css +16 -17
- package/css/tour.css +14 -7
- package/css/transfer.css +22 -16
- package/css/tree-select.css +12 -12
- package/css/tree.css +26 -25
- package/css/typography.css +28 -25
- package/dist/css/accordion.css +296 -0
- package/dist/css/affix.css +47 -0
- package/dist/css/alert.css +246 -0
- package/dist/css/anchor.css +252 -0
- package/dist/css/approval.css +525 -0
- package/dist/css/avatar-group.css +96 -0
- package/dist/css/avatar.css +100 -0
- package/dist/css/back-top.css +175 -0
- package/dist/css/badge.css +205 -0
- package/dist/css/bar-code.css +62 -0
- package/dist/css/breadcrumb.css +232 -0
- package/dist/css/button-group.css +261 -0
- package/dist/css/button.css +216 -0
- package/dist/css/calendar-picker.css +550 -0
- package/dist/css/calendar-range-picker.css +639 -0
- package/dist/css/card.css +249 -0
- package/dist/css/carousel.css +726 -0
- package/dist/css/cartesian-chart.css +830 -0
- package/dist/css/cascader.css +973 -0
- package/dist/css/checkbox-group.css +361 -0
- package/dist/css/checkbox.css +258 -0
- package/dist/css/citation.css +475 -0
- package/dist/css/clipboard.css +331 -0
- package/dist/css/code-view.css +374 -0
- package/dist/css/collapsible.css +200 -0
- package/dist/css/color-field.css +176 -0
- package/dist/css/color-picker.css +649 -0
- package/dist/css/color-slider.css +283 -0
- package/dist/css/color-swatch-picker.css +250 -0
- package/dist/css/color-swatch.css +35 -0
- package/dist/css/combobox.css +578 -0
- package/dist/css/command.css +404 -0
- package/dist/css/context-menu.css +425 -0
- package/dist/css/date-field.css +317 -0
- package/dist/css/date-picker.css +931 -0
- package/dist/css/date-range-picker.css +949 -0
- package/dist/css/description.css +71 -0
- package/dist/css/descriptions.css +327 -0
- package/dist/css/dialog.css +470 -0
- package/dist/css/diff-view.css +513 -0
- package/dist/css/download-trigger.css +151 -0
- package/dist/css/drawer.css +606 -0
- package/dist/css/editable.css +269 -0
- package/dist/css/empty-state.css +181 -0
- package/dist/css/field-array.css +229 -0
- package/dist/css/field.css +165 -0
- package/dist/css/fieldset.css +122 -0
- package/dist/css/file-upload.css +462 -0
- package/dist/css/flex.css +441 -0
- package/dist/css/float-button.css +579 -0
- package/dist/css/floating-panel.css +429 -0
- package/dist/css/focus.css +46 -0
- package/dist/css/forced-colors.css +93 -0
- package/dist/css/form.css +407 -0
- package/dist/css/funnel-chart.css +106 -0
- package/dist/css/graph-chart.css +205 -0
- package/dist/css/grid-list.css +235 -0
- package/dist/css/grid.css +1201 -0
- package/dist/css/heatmap.css +552 -0
- package/dist/css/hierarchy-chart.css +298 -0
- package/dist/css/highlight.css +41 -0
- package/dist/css/hover-card.css +233 -0
- package/dist/css/icon.css +225 -0
- package/dist/css/image-cropper.css +373 -0
- package/dist/css/image-viewer.css +588 -0
- package/dist/css/image.css +106 -0
- package/dist/css/infinite-scroll.css +81 -0
- package/dist/css/input-group.css +323 -0
- package/dist/css/json-viewer.css +379 -0
- package/dist/css/kbd.css +72 -0
- package/dist/css/label.css +94 -0
- package/dist/css/layers.css +7 -0
- package/dist/css/layout.css +379 -0
- package/dist/css/liquid.css +106 -0
- package/dist/css/list.css +156 -0
- package/dist/css/listbox.css +395 -0
- package/dist/css/loading-bar.css +144 -0
- package/dist/css/log.css +306 -0
- package/dist/css/markdown-stream.css +149 -0
- package/dist/css/marquee.css +378 -0
- package/dist/css/masonry.css +70 -0
- package/dist/css/matrix-code.css +67 -0
- package/dist/css/mention.css +395 -0
- package/dist/css/menu.css +369 -0
- package/dist/css/menubar.css +461 -0
- package/dist/css/message-feed.css +318 -0
- package/dist/css/navigation-menu.css +513 -0
- package/dist/css/notification.css +865 -0
- package/dist/css/number-animation.css +44 -0
- package/dist/css/number-field.css +275 -0
- package/dist/css/overlay-arrow.css +56 -0
- package/dist/css/page-header.css +221 -0
- package/dist/css/pagination.css +447 -0
- package/dist/css/password-input.css +335 -0
- package/dist/css/pie-chart.css +247 -0
- package/dist/css/pin-input.css +191 -0
- package/dist/css/pointer.css +36 -0
- package/dist/css/popconfirm.css +329 -0
- package/dist/css/popover.css +285 -0
- package/dist/css/progress.css +502 -0
- package/dist/css/prompt-input.css +260 -0
- package/dist/css/question-flow.css +579 -0
- package/dist/css/radar-chart.css +233 -0
- package/dist/css/radio-group.css +663 -0
- package/dist/css/rating.css +311 -0
- package/dist/css/reasoning.css +343 -0
- package/dist/css/reset.css +117 -0
- package/dist/css/resizable.css +242 -0
- package/dist/css/sankey-chart.css +174 -0
- package/dist/css/scroll-area.css +240 -0
- package/dist/css/scrollbar.css +204 -0
- package/dist/css/select.css +616 -0
- package/dist/css/separator.css +140 -0
- package/dist/css/side-nav.css +481 -0
- package/dist/css/signature-pad.css +193 -0
- package/dist/css/skeleton.css +161 -0
- package/dist/css/slider.css +403 -0
- package/dist/css/sortable.css +228 -0
- package/dist/css/sparkline.css +170 -0
- package/dist/css/spinner.css +256 -0
- package/dist/css/splitter.css +159 -0
- package/dist/css/statistic.css +137 -0
- package/dist/css/steps.css +658 -0
- package/dist/css/switch.css +353 -0
- package/dist/css/table.css +1162 -0
- package/dist/css/tabs.css +967 -0
- package/dist/css/tag-group.css +258 -0
- package/dist/css/tag.css +335 -0
- package/dist/css/tags-input.css +341 -0
- package/dist/css/text-field.css +197 -0
- package/dist/css/time-field.css +277 -0
- package/dist/css/time-picker.css +793 -0
- package/dist/css/time-range-picker.css +775 -0
- package/dist/css/timeline.css +440 -0
- package/dist/css/timer.css +123 -0
- package/dist/css/timestamp.css +34 -0
- package/dist/css/toggle-group.css +424 -0
- package/dist/css/toggle.css +146 -0
- package/dist/css/tone.css +189 -0
- package/dist/css/tool-call.css +431 -0
- package/dist/css/toolbar.css +366 -0
- package/dist/css/tooltip.css +217 -0
- package/dist/css/tour.css +446 -0
- package/dist/css/transfer.css +644 -0
- package/dist/css/tree-select.css +878 -0
- package/dist/css/tree.css +734 -0
- package/dist/css/truncate.css +108 -0
- package/dist/css/typography.css +475 -0
- package/dist/css/undefined.css +58 -0
- package/dist/css/virtualizer.css +166 -0
- package/dist/css/visually-hidden.css +20 -0
- package/dist/css/watermark.css +82 -0
- package/dist/family/action-control.css +493 -0
- package/dist/family/chart.css +537 -0
- package/dist/family/check-mark.css +94 -0
- package/dist/family/choice-card.css +97 -0
- package/dist/family/collection-item.css +768 -0
- package/dist/family/field-chrome.css +296 -0
- package/dist/family/loading-ring.css +102 -0
- package/dist/family/material.css +72 -0
- package/dist/family/menu-choice.css +56 -0
- package/dist/family/motion.css +363 -0
- package/dist/family/swatch.css +59 -0
- package/dist/family/tag-list.css +65 -0
- package/family/action-control.css +33 -36
- package/family/chart.css +57 -0
- package/family/collection-item.css +12 -8
- package/family/field-chrome.css +28 -19
- package/family/loading-ring.css +20 -13
- package/family/swatch.css +4 -4
- package/family/tag-list.css +6 -0
- package/index.css +10349 -8756
- package/index.unlayered.css +10350 -8758
- package/package.json +165 -164
|
@@ -0,0 +1,446 @@
|
|
|
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-_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
|
+
/* 压暗时暗幕本身已把目标框出来,高亮框不再描一圈环;不压暗时那圈环是唯一的指示 */
|
|
117
|
+
.xh-scope-tour[data-part='spotlight'][data-dimmed] {
|
|
118
|
+
--xh-_tour-spotlight-shroud: var(--xh-tour-spotlight-shroud, var(--xh-bg-overlay));
|
|
119
|
+
--xh-_tour-spotlight-ring: transparent;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.xh-scope-tour[data-part='spotlight'][hidden] {
|
|
123
|
+
display: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.xh-scope-tour[data-part='spotlight'][data-state='open']:not([data-instant]) {
|
|
127
|
+
animation: xh-tour-spotlight-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* 退场与气泡并行播,同一段时长;收起那一帧 hidden 由宿主押后到气泡的退场结束 */
|
|
131
|
+
.xh-scope-tour[data-part='spotlight'][data-state='closed'] {
|
|
132
|
+
animation: xh-tour-spotlight-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* 锚定步的暗幕由 Spotlight 自己挖洞,Backdrop 只负责拦截背景交互。状态直接由连接层给,
|
|
136
|
+
不依赖两个 Portal shell 在落点里的相对顺序。 */
|
|
137
|
+
.xh-scope-tour[data-part='backdrop'][data-position='anchored'] {
|
|
138
|
+
background: transparent;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* 空壳不吃指针,交互只发生在 content 上。
|
|
142
|
+
锚定步的坐标由定位引擎写进内联 style,这里不碰那两条轴 */
|
|
143
|
+
.xh-scope-tour[data-part='positioner'] {
|
|
144
|
+
/* 落定那一侧的可用高度,由定位引擎经内联自定义属性写进来,气泡继承它限高;
|
|
145
|
+
居中步与尚未落位时不额外限高 */
|
|
146
|
+
--xh-_tour-available-h: 100vh;
|
|
147
|
+
/* 落定那一侧的可用宽度,同样由定位引擎经内联自定义属性写进来,行内轴据此夹取;
|
|
148
|
+
引擎没算(尚未落位 / 无引擎 / 贴边归零)时退到视口宽 */
|
|
149
|
+
--xh-_tour-available-w: 100vw;
|
|
150
|
+
|
|
151
|
+
z-index: var(--xh-tour-positioner-layer, var(--xh-_layer, var(--xh-layer-popover)));
|
|
152
|
+
pointer-events: none;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* 居中步:没有锚点,铺满视口把气泡摆中间 */
|
|
156
|
+
.xh-scope-tour[data-part='positioner'][data-position='center'] {
|
|
157
|
+
inset: 0;
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
padding: var(--xh-tour-positioner-padding, var(--xh-space-4));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* 必须排在 data-position='center' 之后:两条选择器的特指度相同(都是三个属性),
|
|
165
|
+
写在前面会被那条 display:flex 盖掉,收起态的居中步就一直摊在屏幕上 */
|
|
166
|
+
.xh-scope-tour[data-part='positioner'][hidden] {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* 缩放原点与进场位移按落定的那一侧给:气泡从贴着锚点的那条边涨开、沿主轴退让一小段。
|
|
171
|
+
两个槽由 content 继承。只认锚定步:居中步没有锚点,data-placement 仍带着缺省值。
|
|
172
|
+
placement 是物理方向(引擎按 top / right / bottom / left 出值),origin 与 translate
|
|
173
|
+
也是物理量,两边同轴,不随书写方向翻 */
|
|
174
|
+
.xh-scope-tour[data-part='positioner'][data-position='anchored'][data-placement^='top'] {
|
|
175
|
+
--xh-_overlay-origin-y: 100%;
|
|
176
|
+
--xh-_overlay-enter-down: 1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.xh-scope-tour[data-part='positioner'][data-position='anchored'][data-placement^='bottom'] {
|
|
180
|
+
--xh-_overlay-origin-y: 0;
|
|
181
|
+
--xh-_overlay-enter-up: 1;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.xh-scope-tour[data-part='positioner'][data-position='anchored'][data-placement^='left'] {
|
|
185
|
+
--xh-_overlay-origin-x: 100%;
|
|
186
|
+
--xh-_overlay-enter-right: 1;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.xh-scope-tour[data-part='positioner'][data-position='anchored'][data-placement^='right'] {
|
|
190
|
+
--xh-_overlay-origin-x: 0;
|
|
191
|
+
--xh-_overlay-enter-left: 1;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.xh-scope-tour[data-part='content'] {
|
|
195
|
+
position: relative;
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-direction: column;
|
|
198
|
+
gap: var(--xh-tour-gap, var(--xh-space-2));
|
|
199
|
+
inline-size: max-content;
|
|
200
|
+
/* 静态档与落位后的可用宽度取小:窄视口下面板伸出去,最右侧的内容就点不到了 */
|
|
201
|
+
max-inline-size: min(var(--xh-tour-max-w, var(--xh-overlay-max-w-lg)), var(--xh-_tour-available-w));
|
|
202
|
+
padding-block: var(--xh-tour-py, var(--xh-surface-py-sm));
|
|
203
|
+
padding-inline: var(--xh-tour-px, var(--xh-surface-px-md));
|
|
204
|
+
/* 引导步骤的正文长度由作者定,矮视口下不限高气泡会整块伸出视口 */
|
|
205
|
+
max-block-size: min(var(--xh-tour-max-h, var(--xh-overlay-max-h)), var(--xh-_tour-available-h));
|
|
206
|
+
/* M4 sheet 三件套,与 dialog 同源:1px 描边是它的边界,不透明底,影只是加成 */
|
|
207
|
+
border: var(--xh-stroke-thin) solid var(--xh-tour-border, var(--xh-material-elevated-border));
|
|
208
|
+
border-radius: var(--xh-tour-radius, var(--xh-shape-overlay));
|
|
209
|
+
background: var(--xh-tour-bg, var(--xh-material-elevated-bg));
|
|
210
|
+
color: var(--xh-tour-fg, var(--xh-material-elevated-fg));
|
|
211
|
+
box-shadow: var(--xh-tour-shadow, var(--xh-material-elevated-shadow));
|
|
212
|
+
pointer-events: auto;
|
|
213
|
+
/* 进退场的缩放锚在贴着锚点的那条边上;两个分量由 positioner 按 placement 写进私有槽 */
|
|
214
|
+
transform-origin: var(--xh-_overlay-origin-x, 50%) var(--xh-_overlay-origin-y, 50%);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* 这里刻意没有 [data-part='content'][hidden] { display: none },与 popover 一致:
|
|
218
|
+
收起态连接层会给 content 打 hidden,补上这条退场动画就一帧都播不出来。
|
|
219
|
+
真正的收起由退场闸门落成内联 display,节点始终留在原地。 */
|
|
220
|
+
|
|
221
|
+
/* 焦点落在气泡本身,Enter / Space 落在它身上推进下一步:它是可操作目标,
|
|
222
|
+
环由 focus.css 的默认内收环画,这里不另写 */
|
|
223
|
+
|
|
224
|
+
/* 挂载时就开着的那一段(data-instant)属于首帧,直接呈现 */
|
|
225
|
+
.xh-scope-tour[data-part='content'][data-state='open']:not([data-instant]) {
|
|
226
|
+
animation: xh-overlay-pop-in var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* 退场:收起那一帧 hidden 由退场闸门押后,这里才播得出来。forwards 把末态钉住,
|
|
230
|
+
免得动画结束到收起落下来之间闪一下原样 */
|
|
231
|
+
.xh-scope-tour[data-part='content'][data-state='closed'] {
|
|
232
|
+
animation: xh-pop-out var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.xh-scope-tour[data-part='title'] {
|
|
236
|
+
margin: 0;
|
|
237
|
+
font-size: var(--xh-tour-title-font-size, var(--xh-text-heading-3-size));
|
|
238
|
+
font-weight: var(--xh-tour-title-font-weight, var(--xh-text-heading-3-weight));
|
|
239
|
+
color: var(--xh-tour-title-fg, var(--xh-fg-default));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* 标题与说明是一组:两者之间只留 4px,其余部件之间才是整档间距 */
|
|
243
|
+
.xh-scope-tour[data-part='title'] + .xh-scope-tour[data-part='description'] {
|
|
244
|
+
margin-block-start: calc(var(--xh-space-1) - var(--xh-tour-gap, var(--xh-space-2)));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* 关闭按钮是绝对定位的,不占流内宽度:标题得自己让出右上角那块,
|
|
248
|
+
否则长标题会直接钻到按钮底下。只在真有关闭按钮时让位。 */
|
|
249
|
+
.xh-scope-tour[data-part='content']:has(.xh-scope-tour[data-part='close-trigger'])
|
|
250
|
+
.xh-scope-tour[data-part='title'] {
|
|
251
|
+
padding-inline-end: calc(var(--xh-tour-close-size, var(--xh-control-h-sm)) + var(--xh-surface-action-inset));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* 说明文字走说明档:13px + fg-muted */
|
|
255
|
+
.xh-scope-tour[data-part='description'] {
|
|
256
|
+
margin: 0;
|
|
257
|
+
font-size: var(--xh-tour-description-font-size, var(--xh-text-secondary-size));
|
|
258
|
+
line-height: var(--xh-leading-normal);
|
|
259
|
+
color: var(--xh-tour-description-fg, var(--xh-fg-muted));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* "第 m 步,共 n 步":辅助信息,字号压一档,与按钮排在同一行的两端 */
|
|
263
|
+
.xh-scope-tour[data-part='progress-text'] {
|
|
264
|
+
font-size: var(--xh-tour-progress-font-size, var(--xh-text-caption-size));
|
|
265
|
+
color: var(--xh-tour-progress-fg, var(--xh-fg-subtle));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/* 圆点组:一步一颗,横排;点距与走马灯的分页点同为 8px */
|
|
269
|
+
.xh-scope-tour[data-part='progress-indicator'] {
|
|
270
|
+
display: inline-flex;
|
|
271
|
+
align-items: center;
|
|
272
|
+
gap: var(--xh-tour-progress-indicator-gap, var(--xh-space-2));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.xh-scope-tour[data-part='progress-indicator'][hidden] {
|
|
276
|
+
display: none;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* 圆点:6px 正圆取 circle(与走马灯分页点同一种语言),未走到的一档取中性描边色。
|
|
280
|
+
宽度与底色都随状态换,换步那一下能看出进度在推进 */
|
|
281
|
+
.xh-scope-tour[data-part='progress-dot'] {
|
|
282
|
+
inline-size: var(--xh-space-1_5);
|
|
283
|
+
block-size: var(--xh-space-1_5);
|
|
284
|
+
border-radius: var(--xh-shape-circle);
|
|
285
|
+
background: var(--xh-tour-progress-dot-bg, var(--xh-border-default));
|
|
286
|
+
transition:
|
|
287
|
+
inline-size var(--xh-motion-duration-nudge) var(--xh-motion-ease-continuous),
|
|
288
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* 走过的步:中性色加重一档 */
|
|
292
|
+
.xh-scope-tour[data-part='progress-dot'][data-complete] {
|
|
293
|
+
background: var(--xh-tour-progress-dot-bg-complete, var(--xh-border-strong));
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* 当前步:拉成 20px 胶囊并换品牌色;一维对象取 pill */
|
|
297
|
+
.xh-scope-tour[data-part='progress-dot'][data-current] {
|
|
298
|
+
inline-size: var(--xh-space-5);
|
|
299
|
+
border-radius: var(--xh-shape-pill);
|
|
300
|
+
background: var(--xh-tour-progress-dot-bg-current, var(--xh-bg-brand));
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/*
|
|
304
|
+
* —— 末行三颗按钮 ——
|
|
305
|
+
* 上一步 / 下一步 / 跳过都是气泡末行的文字按钮:盒型、sm 档几何、四态面、0.97 按压并换底、粗指针命中区与
|
|
306
|
+
* 强制色由家族配方按连接层投影的 data-xh-action-variant / -size 给出。这里只把公开槽桥接到矩阵之前
|
|
307
|
+
* (使用者槽 → 形态矩阵 → 家族缺省)与几何映射;内衬与圆角槽三颗共用。
|
|
308
|
+
*/
|
|
309
|
+
.xh-scope-tour[data-part='prev-trigger'],
|
|
310
|
+
.xh-scope-tour[data-part='next-trigger'],
|
|
311
|
+
.xh-scope-tour[data-part='skip-trigger'] {
|
|
312
|
+
--xh-action-padding-inline: var(--xh-tour-skip-trigger-px, var(--xh-_action-profile-padding-inline));
|
|
313
|
+
--xh-action-radius: var(--xh-tour-action-radius, var(--xh-shape-control));
|
|
314
|
+
/* 作者塞进按钮的图标随档取字形尺(sm = 16px) */
|
|
315
|
+
--xh-icon-size: var(--xh-tour-icon-size, var(--xh-_action-profile-glyph-size));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.xh-scope-tour[data-part='prev-trigger'][hidden],
|
|
319
|
+
.xh-scope-tour[data-part='next-trigger'][hidden],
|
|
320
|
+
.xh-scope-tour[data-part='skip-trigger'][hidden] {
|
|
321
|
+
display: none;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/* 下一步是整条引导的主线动作,显式 solid:底、字与影三组使用者槽桥到配方 solid 列之前 */
|
|
325
|
+
.xh-scope-tour[data-part='next-trigger'] {
|
|
326
|
+
--xh-action-bg-rest: var(--xh-tour-next-bg, var(--xh-_action-variant-bg-rest));
|
|
327
|
+
--xh-action-bg-hover: var(--xh-tour-next-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
328
|
+
--xh-action-bg-focus-visible: var(--xh-tour-next-bg, var(--xh-_action-variant-bg-focus-visible));
|
|
329
|
+
--xh-action-fg-rest: var(--xh-tour-next-fg, var(--xh-_action-variant-fg-rest));
|
|
330
|
+
--xh-action-fg-hover: var(--xh-tour-next-fg, var(--xh-_action-variant-fg-hover));
|
|
331
|
+
--xh-action-fg-pressed: var(--xh-tour-next-fg, var(--xh-_action-variant-fg-pressed));
|
|
332
|
+
--xh-action-fg-focus-visible: var(--xh-tour-next-fg, var(--xh-_action-variant-fg-focus-visible));
|
|
333
|
+
--xh-action-shadow-rest: var(--xh-tour-next-shadow, none);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/* 面是实心的,环色与面同族,画在面里就看不出来;环改取面自己的前景色——
|
|
337
|
+
那一族色本来就要在这块面上把字读清楚,与面的对比是按可读性定的 */
|
|
338
|
+
.xh-scope-tour[data-part='next-trigger'][data-xh-action-variant='solid']:focus-visible {
|
|
339
|
+
--xh-action-ring-color-focus-visible: currentColor;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/*
|
|
343
|
+
* 关闭钮是气泡角落的单图标钮:正方盒、sm 档几何、ghost 四态面、0.97 按压并换底与粗指针命中区
|
|
344
|
+
* 由家族配方给出——白面上走画布承载阶梯悬停 --xh-bg-subtle(100)→ 按下 --xh-bg-subtle-hover(200),
|
|
345
|
+
* 焦点面透明吃库环。这里只把公开槽桥接到矩阵之前(使用者槽 → 形态矩阵 → 家族缺省)与摆放;
|
|
346
|
+
* 静息前景取 muted 字色,悬停 / 按下 / 聚焦回到 fg-default。
|
|
347
|
+
*/
|
|
348
|
+
.xh-scope-tour[data-part='close-trigger'] {
|
|
349
|
+
--xh-action-visual-size: var(--xh-tour-close-size, var(--xh-_action-profile-visual-size));
|
|
350
|
+
--xh-action-radius: var(--xh-tour-close-radius, var(--xh-shape-control));
|
|
351
|
+
--xh-action-bg-hover: var(--xh-tour-close-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
352
|
+
--xh-action-bg-pressed: var(--xh-tour-close-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
353
|
+
--xh-action-fg-rest: var(--xh-tour-close-fg, var(--xh-fg-muted));
|
|
354
|
+
--xh-action-fg-hover: var(--xh-tour-close-fg-hover, var(--xh-_action-variant-fg-hover));
|
|
355
|
+
--xh-action-fg-pressed: var(--xh-tour-close-fg-hover, var(--xh-_action-variant-fg-pressed));
|
|
356
|
+
--xh-action-fg-focus-visible: var(--xh-tour-close-fg-hover, var(--xh-_action-variant-fg-focus-visible));
|
|
357
|
+
/* 作者塞进按钮的图标随档取字形尺(sm = 16px),与皮肤画的兜底字形同一把尺 */
|
|
358
|
+
--xh-icon-size: var(--xh-tour-icon-size, var(--xh-_action-profile-glyph-size));
|
|
359
|
+
|
|
360
|
+
position: absolute;
|
|
361
|
+
inset-block-start: var(--xh-surface-action-inset);
|
|
362
|
+
inset-inline-end: var(--xh-surface-action-inset);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.xh-scope-tour[data-part='close-trigger'][hidden] {
|
|
366
|
+
display: none;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/* 箭头的底色与描边色,几何在 overlay-arrow.css。
|
|
370
|
+
交叉轴落点由定位引擎经内联自定义属性写进来,没给时退回居中 */
|
|
371
|
+
.xh-scope-tour[data-part='arrow'] {
|
|
372
|
+
--xh-_tour-arrow-x: 50%;
|
|
373
|
+
--xh-_tour-arrow-y: 50%;
|
|
374
|
+
--xh-_overlay-arrow-size: var(--xh-tour-arrow-size, var(--xh-overlay-arrow-size));
|
|
375
|
+
--xh-_overlay-arrow-x: var(--xh-_tour-arrow-x);
|
|
376
|
+
--xh-_overlay-arrow-y: var(--xh-_tour-arrow-y);
|
|
377
|
+
|
|
378
|
+
background: var(--xh-tour-bg, var(--xh-material-elevated-bg));
|
|
379
|
+
border: var(--xh-stroke-thin) solid var(--xh-tour-border, var(--xh-material-elevated-border));
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/* 居中步没有锚点,连接层会给箭头发 hidden */
|
|
383
|
+
.xh-scope-tour[data-part='arrow'][hidden] {
|
|
384
|
+
display: none;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/* 没写内容就由皮肤画兜底字形;作者往部件里塞了自己的图形,这几条即不命中 */
|
|
388
|
+
.xh-scope-tour[data-part='close-trigger']:empty::before {
|
|
389
|
+
content: '';
|
|
390
|
+
display: inline-block;
|
|
391
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
392
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
393
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
394
|
+
background-color: currentColor;
|
|
395
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
396
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
@layer xihan.components {
|
|
401
|
+
/* 气泡限高之后只让正文让步:标题与上下步按钮滚出视线就点不到了。
|
|
402
|
+
模态气泡里的原生细条滚动面:细条由 reset 层统一给,滚到头不把页面一起带走;内容高度不动态变化,不写 gutter */
|
|
403
|
+
.xh-scope-tour[data-part='description'] {
|
|
404
|
+
flex: 1 1 auto;
|
|
405
|
+
min-block-size: 0;
|
|
406
|
+
overflow-y: auto;
|
|
407
|
+
overscroll-behavior: contain;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
@media (forced-colors: active) {
|
|
411
|
+
/* 这一档丢掉底色:走过的那几颗改由一圈描边表出,当前那颗仍靠宽度分辨 */
|
|
412
|
+
.xh-scope-tour[data-part='progress-dot'][data-complete] {
|
|
413
|
+
outline: var(--xh-stroke-thin) solid CanvasText;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
@media print {
|
|
418
|
+
/* 打印:定位层与遮罩是交互期才存在的东西,落到纸上只会盖住底下的正文。
|
|
419
|
+
收起写在这份皮肤里而不是 reset:reset 层排在组件层之前,组件层里任何一条 display 都压得住它。
|
|
420
|
+
居中那一档的选择器多带一个属性、权重高一级,所以把它一并列出来,靠同权重下的书写顺序压回去。 */
|
|
421
|
+
.xh-scope-tour[data-part='backdrop'],
|
|
422
|
+
.xh-scope-tour[data-part='positioner'],
|
|
423
|
+
.xh-scope-tour[data-part='positioner'][data-position='center'] {
|
|
424
|
+
display: none;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
@media (forced-colors: active) {
|
|
429
|
+
/* 兜底字形是 mask 挖出来的一块底色,这一档里底色被系统换成 Canvas,字形跟着消失。
|
|
430
|
+
字形退出强制换色、直接写系统色(不能取 currentColor:退出强制换色的伪元素读到的是被系统换掉之前的作者色):
|
|
431
|
+
按钮面上取 ButtonText,悬停与按下时家族把按钮涂成 Highlight、字形换 HighlightText;
|
|
432
|
+
禁用取 GrayText */
|
|
433
|
+
.xh-scope-tour[data-part='close-trigger']:empty::before {
|
|
434
|
+
forced-color-adjust: none;
|
|
435
|
+
background-color: ButtonText;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.xh-scope-tour[data-part='close-trigger']:not([data-disabled]):not([data-loading]):is(:hover, :active, [data-pressed]):empty::before {
|
|
439
|
+
background-color: HighlightText;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.xh-scope-tour[data-part='close-trigger'][data-disabled]:empty::before {
|
|
443
|
+
background-color: GrayText;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|