@w-run/wdesign-ui 0.0.0-stage → 1.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/README.md +174 -2
- package/dist/index.d.ts +83 -0
- package/dist/style/ai-msg.css +187 -0
- package/dist/style/alert.css +64 -0
- package/dist/style/audio.css +1363 -0
- package/dist/style/avatar.css +88 -0
- package/dist/style/badge.css +48 -0
- package/dist/style/breadcrumb.css +54 -0
- package/dist/style/button.css +234 -0
- package/dist/style/card.css +71 -0
- package/dist/style/carousel.css +101 -0
- package/dist/style/checkbox.css +129 -0
- package/dist/style/chevron.css +33 -0
- package/dist/style/collapse.css +69 -0
- package/dist/style/command.css +201 -0
- package/dist/style/container.css +7 -0
- package/dist/style/datepicker.css +205 -0
- package/dist/style/descriptions.css +119 -0
- package/dist/style/divider.css +62 -0
- package/dist/style/dot.css +30 -0
- package/dist/style/drawer.css +145 -0
- package/dist/style/dropdown.css +83 -0
- package/dist/style/empty.css +36 -0
- package/dist/style/explorer.css +336 -0
- package/dist/style/file-list.css +92 -0
- package/dist/style/form.css +96 -0
- package/dist/style/grid.css +4 -0
- package/dist/style/group.css +478 -0
- package/dist/style/icon-btn.css +75 -0
- package/dist/style/image-preview.css +81 -0
- package/dist/style/input.css +119 -0
- package/dist/style/list.css +81 -0
- package/dist/style/markdown.css +312 -0
- package/dist/style/modal.css +164 -0
- package/dist/style/notification.css +52 -0
- package/dist/style/otp.css +139 -0
- package/dist/style/pagination.css +120 -0
- package/dist/style/popconfirm.css +87 -0
- package/dist/style/popover.css +110 -0
- package/dist/style/post-item.css +134 -0
- package/dist/style/progress.css +34 -0
- package/dist/style/radio.css +126 -0
- package/dist/style/rate.css +44 -0
- package/dist/style/result.css +54 -0
- package/dist/style/segmented-picker.css +120 -0
- package/dist/style/segmented.css +190 -0
- package/dist/style/select.css +281 -0
- package/dist/style/skeleton.css +31 -0
- package/dist/style/slider.css +81 -0
- package/dist/style/sortable.css +128 -0
- package/dist/style/space.css +25 -0
- package/dist/style/spinner.css +27 -0
- package/dist/style/statistic.css +44 -0
- package/dist/style/steps.css +100 -0
- package/dist/style/switch.css +95 -0
- package/dist/style/table.css +379 -0
- package/dist/style/tabs.css +167 -0
- package/dist/style/tag.css +97 -0
- package/dist/style/timeline.css +521 -0
- package/dist/style/toast.css +37 -0
- package/dist/style/tooltip.css +45 -0
- package/dist/style/tree.css +189 -0
- package/dist/style/typography.css +66 -0
- package/dist/style/upload.css +169 -0
- package/dist/style/vlist.css +49 -0
- package/dist/style/vplayer.css +846 -0
- package/dist/wdesign-ui.css +10300 -0
- package/dist/wdesign-ui.esm.js +16333 -0
- package/package.json +47 -3
- package/tokens.json +385 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.wd-tag {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
height: 28px;
|
|
7
|
+
padding: 0 14px;
|
|
8
|
+
border-radius: var(--wd-radius-pill);
|
|
9
|
+
font-size: 13.5px;
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
line-height: 1.2;
|
|
12
|
+
white-space: nowrap;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.wd-tag--lg {
|
|
16
|
+
height: 36px;
|
|
17
|
+
padding: 0 20px;
|
|
18
|
+
font-size: var(--wd-font-size-md);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.wd-tag--sm {
|
|
22
|
+
height: 22px;
|
|
23
|
+
padding: 0 10px;
|
|
24
|
+
font-size: var(--wd-font-size-sm);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.wd-tag--tint {
|
|
28
|
+
background: var(--wd-tint-2);
|
|
29
|
+
color: var(--wd-red-text);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.wd-tag--gray {
|
|
33
|
+
background: var(--wd-field);
|
|
34
|
+
color: var(--wd-ink-2);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.wd-tag--dark {
|
|
38
|
+
background: var(--wd-dark);
|
|
39
|
+
color: var(--wd-dark-text);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.wd-tag:active {
|
|
43
|
+
transform: scale(0.96);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.wd-tag__dot {
|
|
47
|
+
width: 7px;
|
|
48
|
+
height: 7px;
|
|
49
|
+
flex: none;
|
|
50
|
+
border-radius: 50%;
|
|
51
|
+
background: var(--wd-red);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.wd-tag__dot--success {
|
|
55
|
+
background: var(--wd-success);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.wd-tag__dot--warning {
|
|
59
|
+
background: var(--wd-warning);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.wd-tag__dot--gray {
|
|
63
|
+
background: var(--wd-ink-3);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ---- 微交互(精致版)---- */
|
|
67
|
+
.wd-tag {
|
|
68
|
+
transition: background var(--wd-dur-fast) var(--wd-ease-out), color var(--wd-dur-fast) var(--wd-ease-out);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (hover: hover) {
|
|
72
|
+
.wd-tag--tint:hover {
|
|
73
|
+
background: var(--wd-tint-3);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/* JS 增强(addHover):同一份声明,由 .is-hover 驱动,不受 hover 媒体查询限制 */
|
|
77
|
+
.wd-tag--tint.is-hover {
|
|
78
|
+
background: var(--wd-tint-3);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (hover: hover) {
|
|
82
|
+
.wd-tag--gray:hover {
|
|
83
|
+
background: var(--wd-field-hover);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
.wd-tag--gray.is-hover {
|
|
87
|
+
background: var(--wd-field-hover);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media (hover: hover) {
|
|
91
|
+
.wd-tag--dark:hover {
|
|
92
|
+
background: var(--wd-dark-2);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
.wd-tag--dark.is-hover {
|
|
96
|
+
background: var(--wd-dark-2);
|
|
97
|
+
}
|
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.wd-timeline {
|
|
3
|
+
display: flex;
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
list-style: none;
|
|
7
|
+
--tl-dot: 10px;
|
|
8
|
+
--tl-gap: 18px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.wd-timeline--sm {
|
|
12
|
+
--tl-dot: 8px;
|
|
13
|
+
--tl-gap: 13px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* ---------------- 纵向(默认) ---------------- */
|
|
17
|
+
.wd-timeline--vertical {
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.wd-timeline--vertical .wd-timeline__item {
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 12px;
|
|
25
|
+
padding-bottom: var(--tl-gap);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wd-timeline--vertical .wd-timeline__item.is-last {
|
|
29
|
+
padding-bottom: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/*
|
|
33
|
+
* ===== 节点与竖线的对齐 =====
|
|
34
|
+
*
|
|
35
|
+
* 核心问题:节点宽度会变(无图标 10px / 有图标 22px),
|
|
36
|
+
* 竖线必须**永远穿过节点圆心**。
|
|
37
|
+
*
|
|
38
|
+
* 前两次的做法都失败:
|
|
39
|
+
* a) 写死 `left: --tl-dot / 2`(5px)→ 有图标时节点 22px,线偏出 6px
|
|
40
|
+
* b) 给节点加 margin 居中 + 线按列宽算 → 有图标的对了,
|
|
41
|
+
* 无图标的节点只有 10px,圆心仍在列宽的一半之前 → 又偏 6px
|
|
42
|
+
*
|
|
43
|
+
* 根因:竖线挂在 item 上,而 item 不知道节点实际多宽。
|
|
44
|
+
*
|
|
45
|
+
* 最终方案:**竖线挂在节点自己身上**。
|
|
46
|
+
* 节点是 --tl-node-col 宽的列里的内容,但线用 `left: 50%` 相对节点自身定位,
|
|
47
|
+
* 于是无论节点 10px 还是 22px,线永远在它的水平正中。
|
|
48
|
+
*
|
|
49
|
+
* 用 ::after 而不是 ::before:::before 已被"节点底色/描边"占用。
|
|
50
|
+
* 线从上往下延伸到 item 底部 —— 节点自身高度不含整条 item,
|
|
51
|
+
* 所以仍然需要 item 提供高度参照:用 `bottom: calc(-100% - ...)` 不行,
|
|
52
|
+
* 改成给 item 加一个从节点垂直位置到 item 底部的伪元素段。
|
|
53
|
+
*
|
|
54
|
+
* 实际实现:节点画"线下段"(从自身底部到 item 底),
|
|
55
|
+
* item 不再画线。
|
|
56
|
+
*/
|
|
57
|
+
.wd-timeline--vertical .wd-timeline__item {
|
|
58
|
+
--tl-node-col: calc(var(--tl-dot) + 12px);
|
|
59
|
+
position: relative;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/*
|
|
63
|
+
* ===== 节点:必须是正方形 =====
|
|
64
|
+
*
|
|
65
|
+
* ⚠️ 这轮踩的坑:为了让竖线穿过圆心,我把节点宽度强行设成了
|
|
66
|
+
* `width: var(--tl-node-col)`(22px),但高度仍是 `--tl-dot`(10px)——
|
|
67
|
+
* 结果节点变成 **22×10 的扁椭圆**。
|
|
68
|
+
*
|
|
69
|
+
* 列宽 ≠ 节点宽。列宽是布局占位,节点是视觉图形,
|
|
70
|
+
* 两者绑在一起必然出问题(节点被拉成椭圆)。
|
|
71
|
+
*
|
|
72
|
+
* 正解:节点保持自身尺寸(正方形),用 **margin 在列内居中**,
|
|
73
|
+
* 圆心 = 列宽/2,线也按列宽/2 定位,两者自然对齐。
|
|
74
|
+
*/
|
|
75
|
+
.wd-timeline--vertical .wd-timeline__node {
|
|
76
|
+
/* 不参与 flex 拉伸/收缩 */
|
|
77
|
+
flex: none;
|
|
78
|
+
/* 正方形:宽高都跟 --tl-dot */
|
|
79
|
+
width: var(--tl-dot);
|
|
80
|
+
height: var(--tl-dot);
|
|
81
|
+
/* 在 --tl-node-col 宽的列里水平居中 */
|
|
82
|
+
margin-left: calc((var(--tl-node-col) - var(--tl-dot)) / 2);
|
|
83
|
+
margin-right: 0;
|
|
84
|
+
margin-top: 3px;
|
|
85
|
+
/* 内圈内容居中 */
|
|
86
|
+
justify-content: center;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.wd-timeline--vertical .wd-timeline__node:not(:has(> .wd-icon)) .wd-timeline__dot {
|
|
90
|
+
width: var(--tl-dot);
|
|
91
|
+
height: var(--tl-dot);
|
|
92
|
+
border-radius: 50%;
|
|
93
|
+
background: var(--wd-ink-4);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/*
|
|
97
|
+
* 有图标时:节点放大为圆形徽章。
|
|
98
|
+
*
|
|
99
|
+
* ⚠️ 关键:图标本身必须是**正方形**且不参与收缩。
|
|
100
|
+
* 之前只给了容器尺寸,内部的 .wd-icon 是 flex 子项,
|
|
101
|
+
* 在列宽约束下会被横向压缩 —— 表现为"图标都扁了"。
|
|
102
|
+
* 这里显式锁死图标的宽高比,并禁止 shrink。
|
|
103
|
+
*/
|
|
104
|
+
/*
|
|
105
|
+
* 有图标时:徽章放大到 26px(比 --tl-node-col 的 22px 更宽松)。
|
|
106
|
+
* 22px 里塞 15px 图标只剩 3.5px 边距,看起来发挤。
|
|
107
|
+
*/
|
|
108
|
+
/* 有图标:正方形 26px,margin 跟着重算(列宽也是 26,所以居中 = 0) */
|
|
109
|
+
.wd-timeline--vertical .wd-timeline__node:has(> .wd-icon) {
|
|
110
|
+
width: 26px;
|
|
111
|
+
height: 26px;
|
|
112
|
+
margin-left: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* 列宽同步放大,保证圆心不变 */
|
|
116
|
+
.wd-timeline--vertical .wd-timeline__item:has(.wd-timeline__node > .wd-icon) {
|
|
117
|
+
--tl-node-col: 26px;
|
|
118
|
+
--tl-node-h: 26px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/*
|
|
122
|
+
* 节点内的图标。
|
|
123
|
+
*
|
|
124
|
+
* ⚠️ 两个都要管:
|
|
125
|
+
* 1. **不能被压扁** —— 之前只给了容器尺寸,图标作为 flex 子项
|
|
126
|
+
* 在固定列宽下被横向压缩(表现为"图标都扁了")。
|
|
127
|
+
* 用 aspect-ratio + flex: none 锁死比例。
|
|
128
|
+
* 2. **不能太小** —— 原来按 :size 传入 13~15px,
|
|
129
|
+
* 在 22px 的圆形徽章里只占 60%,看起来空。
|
|
130
|
+
* 放大到约 68%(15px),视觉重量才和徽章匹配。
|
|
131
|
+
*
|
|
132
|
+
* 尺寸用 em 相对节点,这样改 --tl-dot 时图标自动跟随。
|
|
133
|
+
*/
|
|
134
|
+
.wd-timeline--vertical .wd-timeline__node > .wd-icon {
|
|
135
|
+
flex: none;
|
|
136
|
+
width: auto;
|
|
137
|
+
height: auto;
|
|
138
|
+
aspect-ratio: 1;
|
|
139
|
+
/* 撑到徽章内径的 ~68%:再大就贴边,再小显得空 */
|
|
140
|
+
min-width: 15px;
|
|
141
|
+
min-height: 15px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/*
|
|
145
|
+
* 竖线:从**节点底边**延伸到下一条。
|
|
146
|
+
*
|
|
147
|
+
* ⚠️ 关键:起点不能写死 `--tl-dot + 12px`。
|
|
148
|
+
* 那个表达式假设节点恒为 22px(带图标的尺寸),
|
|
149
|
+
* 但无图标时节点只有 10px 高 / 有图标时 22px ——
|
|
150
|
+
* 于是无图标那条线会在节点下方留 12px 空隙,
|
|
151
|
+
* 带图标那条则刚好贴边,两行看起来对不齐。
|
|
152
|
+
*
|
|
153
|
+
* 正确做法:让 item 用一个 CSS 变量记录"节点占位高度",
|
|
154
|
+
* 线从该高度开始。
|
|
155
|
+
*/
|
|
156
|
+
.wd-timeline--vertical .wd-timeline__item {
|
|
157
|
+
/* 节点占位高度:默认圆点高,带图标时由 :has 覆盖 */
|
|
158
|
+
--tl-node-h: var(--tl-dot);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.wd-timeline--vertical .wd-timeline__item:has(.wd-timeline__node > .wd-icon) {
|
|
162
|
+
--tl-node-h: calc(var(--tl-dot) + 12px);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.wd-timeline--vertical .wd-timeline__item::before {
|
|
166
|
+
content: "";
|
|
167
|
+
position: absolute;
|
|
168
|
+
/* 与节点圆心同一个表达式 —— 两者都基于 --tl-node-col */
|
|
169
|
+
left: calc(var(--tl-node-col) / 2 - 0.5px);
|
|
170
|
+
/* 从节点底边稍下一点开始,避免线和圆点描边粘连 */
|
|
171
|
+
top: calc(var(--tl-node-h) + 3px + 4px);
|
|
172
|
+
bottom: 0;
|
|
173
|
+
width: 1px;
|
|
174
|
+
background: var(--wd-ink-5);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.wd-timeline--vertical.wd-timeline--line-none .wd-timeline__item::before {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.wd-timeline--vertical.wd-timeline--line-dashed .wd-timeline__item::before {
|
|
182
|
+
background: repeating-linear-gradient(to bottom, var(--wd-tint-3) 0, var(--wd-tint-3) 3px, transparent 3px, transparent 7px);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* ---------------- 节点 ---------------- */
|
|
186
|
+
/*
|
|
187
|
+
* 节点尺寸:默认 = --tl-dot(10px 小圆点);
|
|
188
|
+
* 带图标时自动放大到能容下图标 —— 否则图标会溢出节点边框,
|
|
189
|
+
* 视觉上像是"图标浮在外面"(实测 10px 节点塞 13-15px 图标)。
|
|
190
|
+
*
|
|
191
|
+
* ⚠️ 用 min-width/min-height 而不是 width/height:
|
|
192
|
+
* 有图标时让它自然长大,无图标时保持小巧。
|
|
193
|
+
*/
|
|
194
|
+
.wd-timeline__node {
|
|
195
|
+
position: relative;
|
|
196
|
+
z-index: 1;
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
flex: none;
|
|
201
|
+
/*
|
|
202
|
+
* ⚠️ 必须显式 align-self: flex-start。
|
|
203
|
+
* 父级 .wd-timeline__item 是 flex 容器且未设 align-items,
|
|
204
|
+
* 默认 stretch 会把节点在交叉轴拉满 —— 实测 22x65(应为 22x22)。
|
|
205
|
+
* 节点是"点",不该被拉伸成"条"。
|
|
206
|
+
*/
|
|
207
|
+
align-self: flex-start;
|
|
208
|
+
min-width: var(--tl-dot);
|
|
209
|
+
min-height: var(--tl-dot);
|
|
210
|
+
border-radius: 50%;
|
|
211
|
+
/* 默认节点:空心描边,比实心更轻,不会把时间线压成一条黑点链 */
|
|
212
|
+
background: var(--wd-card);
|
|
213
|
+
box-shadow: inset 0 0 0 2px var(--wd-ink-4);
|
|
214
|
+
color: var(--wd-ink-2);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* 带图标时:节点扩大为圆形徽章,图标完整居中 */
|
|
218
|
+
.wd-timeline__node:has(> .wd-icon) {
|
|
219
|
+
min-width: calc(var(--tl-dot) + 12px);
|
|
220
|
+
min-height: calc(var(--tl-dot) + 12px);
|
|
221
|
+
box-shadow: inset 0 0 0 1.5px var(--wd-ink-4);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.wd-timeline__dot {
|
|
225
|
+
width: calc(var(--tl-dot) - 4px);
|
|
226
|
+
height: calc(var(--tl-dot) - 4px);
|
|
227
|
+
border-radius: 50%;
|
|
228
|
+
background: var(--wd-ink-4);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* 高亮节点:主色实心 */
|
|
232
|
+
.wd-timeline__item.is-active .wd-timeline__node {
|
|
233
|
+
background: var(--tl-color, var(--wd-red));
|
|
234
|
+
box-shadow: 0 0 0 3px var(--wd-ink-5);
|
|
235
|
+
color: #fff;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.wd-timeline__item.is-active .wd-timeline__dot {
|
|
239
|
+
background: #fff;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* 自定义颜色:覆盖节点与圆点 */
|
|
243
|
+
.wd-timeline__item {
|
|
244
|
+
--tl-color: var(--wd-red);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.wd-timeline__item.is-disabled .wd-timeline__node {
|
|
248
|
+
box-shadow: inset 0 0 0 2px var(--wd-tint-3);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.wd-timeline__item.is-disabled .wd-timeline__dot {
|
|
252
|
+
background: var(--wd-tint-3);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.wd-timeline__item.is-disabled .wd-timeline__title,
|
|
256
|
+
.wd-timeline__item.is-disabled .wd-timeline__desc {
|
|
257
|
+
color: var(--wd-ink-3);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* ---------------- 内容 ---------------- */
|
|
261
|
+
.wd-timeline__body {
|
|
262
|
+
flex: 1;
|
|
263
|
+
min-width: 0;
|
|
264
|
+
padding-top: 1px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.wd-timeline__period {
|
|
268
|
+
display: block;
|
|
269
|
+
margin-bottom: 3px;
|
|
270
|
+
/*
|
|
271
|
+
* ⚠️ 不要给 period 设 `flex: 0 0 4.5em`(老纵向双栏布局的约束)。
|
|
272
|
+
* 在 alternate/horizontal 的 grid/flex 里,固定 basis 会把标签压成竖排。
|
|
273
|
+
*/
|
|
274
|
+
flex: none;
|
|
275
|
+
font-size: 11.5px;
|
|
276
|
+
font-weight: 800;
|
|
277
|
+
letter-spacing: 0.02em;
|
|
278
|
+
/* 时间标签用中灰:只提供上下文,不抢视线 */
|
|
279
|
+
color: var(--wd-ink-2);
|
|
280
|
+
font-variant-numeric: tabular-nums;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* 只有 active 节点的时间标签才用主色 —— 这是"点睛"的位置 */
|
|
284
|
+
.wd-timeline__item.is-active .wd-timeline__period {
|
|
285
|
+
color: var(--tl-color, var(--wd-red));
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.wd-timeline__title {
|
|
289
|
+
display: flex;
|
|
290
|
+
align-items: center;
|
|
291
|
+
gap: 5px;
|
|
292
|
+
margin: 0 0 4px;
|
|
293
|
+
font-size: 14.5px;
|
|
294
|
+
font-weight: 700;
|
|
295
|
+
color: var(--wd-ink);
|
|
296
|
+
line-height: 1.4;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.wd-timeline--sm .wd-timeline__title {
|
|
300
|
+
font-size: 13.5px;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.wd-timeline__desc {
|
|
304
|
+
margin: 0;
|
|
305
|
+
font-size: 13px;
|
|
306
|
+
line-height: 1.7;
|
|
307
|
+
color: var(--wd-ink-2);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.wd-timeline--sm .wd-timeline__desc {
|
|
311
|
+
font-size: 12.5px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* ---------------- 可折叠 ---------------- */
|
|
315
|
+
.wd-timeline__item.is-clickable {
|
|
316
|
+
cursor: pointer;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.wd-timeline__caret {
|
|
320
|
+
flex: none;
|
|
321
|
+
color: var(--wd-ink-3);
|
|
322
|
+
transition: transform var(--wd-dur-fast) var(--wd-ease-out);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.wd-timeline__caret.is-open {
|
|
326
|
+
transform: rotate(180deg);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.wd-timeline__detail {
|
|
330
|
+
margin-top: 8px;
|
|
331
|
+
padding: 10px 12px;
|
|
332
|
+
border-radius: var(--wd-radius-sm);
|
|
333
|
+
background: var(--wd-field);
|
|
334
|
+
font-size: 12.5px;
|
|
335
|
+
line-height: 1.7;
|
|
336
|
+
color: var(--wd-ink-2);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/* ---------------- 横向 ---------------- */
|
|
340
|
+
.wd-timeline--horizontal {
|
|
341
|
+
flex-direction: row;
|
|
342
|
+
align-items: flex-start;
|
|
343
|
+
overflow-x: auto;
|
|
344
|
+
padding-bottom: 4px;
|
|
345
|
+
scrollbar-width: thin;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/*
|
|
349
|
+
* 横向时每个 item 等分。
|
|
350
|
+
* ⚠️ 不能用 flex:1 —— 内容长的项会被压缩到读不出;
|
|
351
|
+
* 用 min-width 保证可读,超出时容器横向滚动。
|
|
352
|
+
*/
|
|
353
|
+
.wd-timeline--horizontal .wd-timeline__item {
|
|
354
|
+
position: relative;
|
|
355
|
+
flex: 1 1 0;
|
|
356
|
+
min-width: 132px;
|
|
357
|
+
display: flex;
|
|
358
|
+
flex-direction: column;
|
|
359
|
+
align-items: flex-start;
|
|
360
|
+
gap: 8px;
|
|
361
|
+
padding-right: var(--tl-gap);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/* 横向连接线:从节点右侧连到下一个节点 */
|
|
365
|
+
.wd-timeline--horizontal .wd-timeline__item::before {
|
|
366
|
+
content: "";
|
|
367
|
+
position: absolute;
|
|
368
|
+
top: calc(var(--tl-dot) / 2 - 0.5px);
|
|
369
|
+
left: var(--tl-dot);
|
|
370
|
+
right: var(--tl-gap);
|
|
371
|
+
height: 1px;
|
|
372
|
+
background: var(--wd-tint-3);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.wd-timeline--horizontal.wd-timeline--line-none .wd-timeline__item::before {
|
|
376
|
+
display: none;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.wd-timeline--horizontal.wd-timeline--line-dashed .wd-timeline__item::before {
|
|
380
|
+
background: repeating-linear-gradient(to right, var(--wd-tint-3) 0, var(--wd-tint-3) 3px, transparent 3px, transparent 7px);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/* 最后一项不画线(否则线会伸到空白处) */
|
|
384
|
+
.wd-timeline--horizontal .wd-timeline__item.is-last::before {
|
|
385
|
+
display: none;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.wd-timeline--horizontal .wd-timeline__body {
|
|
389
|
+
padding-top: 0;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/* ---------------- 交替 ---------------- */
|
|
393
|
+
/*
|
|
394
|
+
* 节点居中,内容左右交替。
|
|
395
|
+
* 实现方式:item 用 grid 三列(1fr auto 1fr),
|
|
396
|
+
* 奇数项内容放左、偶数项放右,节点始终在中间列。
|
|
397
|
+
*/
|
|
398
|
+
/*
|
|
399
|
+
* ⚠️ 必须显式写 column。
|
|
400
|
+
* `.wd-timeline` 基类没有设 flex-direction(默认 row),
|
|
401
|
+
* 之前 --vertical 和 --horizontal 各自覆盖了,唯独漏了 --alternate →
|
|
402
|
+
* 三个 item 横向排开,每个只有 255px,内容全被挤成竖排单字。
|
|
403
|
+
* 症状很像"grid 轨道算错了",实际是外层 flex 方向错了。
|
|
404
|
+
*/
|
|
405
|
+
.wd-timeline--alternate {
|
|
406
|
+
flex-direction: column;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.wd-timeline--alternate .wd-timeline__item {
|
|
410
|
+
position: relative;
|
|
411
|
+
display: grid;
|
|
412
|
+
/*
|
|
413
|
+
* ⚠️ 三个轨道都要能收缩:`1fr auto 1fr` 里的 1fr 默认 min-width 是 auto,
|
|
414
|
+
* 内容一长就把另一侧挤到极窄(实测把"2026 Q4"挤成了竖排单字)。
|
|
415
|
+
* 用 `minmax(0, 1fr)` 明确允许收缩,再配合 body 的 min-width:0。
|
|
416
|
+
*/
|
|
417
|
+
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
418
|
+
gap: 0 18px;
|
|
419
|
+
align-items: start;
|
|
420
|
+
padding-bottom: var(--tl-gap);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.wd-timeline--alternate .wd-timeline__node {
|
|
424
|
+
grid-column: 2;
|
|
425
|
+
justify-self: center;
|
|
426
|
+
margin-top: 2px;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/* 奇数项(0,2,4...):内容在左,第二列占位 */
|
|
430
|
+
.wd-timeline--alternate .wd-timeline__item:nth-child(odd) .wd-timeline__body {
|
|
431
|
+
grid-column: 1;
|
|
432
|
+
text-align: right;
|
|
433
|
+
/* 允许收缩(与 minmax(0,1fr) 配合),否则长词仍会把列撑开 */
|
|
434
|
+
min-width: 0;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.wd-timeline--alternate .wd-timeline__item:nth-child(odd) .wd-timeline__period,
|
|
438
|
+
.wd-timeline--alternate .wd-timeline__item:nth-child(odd) .wd-timeline__title {
|
|
439
|
+
justify-content: flex-end;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/*
|
|
443
|
+
* 偶数项(1,3,5...):内容在右。
|
|
444
|
+
* 第一列要放一个空占位,否则内容会挤到节点左边。
|
|
445
|
+
*/
|
|
446
|
+
.wd-timeline--alternate .wd-timeline__item:nth-child(even) .wd-timeline__body {
|
|
447
|
+
grid-column: 3;
|
|
448
|
+
min-width: 0;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.wd-timeline--alternate .wd-timeline__item:nth-child(even) .wd-timeline__node {
|
|
452
|
+
grid-row: 1;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/* 居中贯穿线 */
|
|
456
|
+
.wd-timeline--alternate .wd-timeline__item::before {
|
|
457
|
+
content: "";
|
|
458
|
+
position: absolute;
|
|
459
|
+
left: 50%;
|
|
460
|
+
transform: translateX(-0.5px);
|
|
461
|
+
top: calc(var(--tl-dot) + 4px);
|
|
462
|
+
bottom: 0;
|
|
463
|
+
width: 1px;
|
|
464
|
+
background: var(--wd-tint-3);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.wd-timeline--alternate.wd-timeline--line-none .wd-timeline__item::before {
|
|
468
|
+
display: none;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.wd-timeline--alternate.wd-timeline--line-dashed .wd-timeline__item::before {
|
|
472
|
+
background: repeating-linear-gradient(to bottom, var(--wd-tint-3) 0, var(--wd-tint-3) 3px, transparent 3px, transparent 7px);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.wd-timeline--alternate .wd-timeline__item.is-last::before {
|
|
476
|
+
display: none;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* ---------------- 窄屏降级 ---------------- */
|
|
480
|
+
/*
|
|
481
|
+
* 交替布局在窄屏上左右空间不够,强行保留会让文字挤成一条。
|
|
482
|
+
* 直接退回纵向单列 —— 这是移动端时间线的通行做法。
|
|
483
|
+
*/
|
|
484
|
+
@media (max-width: 640px) {
|
|
485
|
+
/*
|
|
486
|
+
* ⚠️ 必须显式写 column。
|
|
487
|
+
* `.wd-timeline` 基类没有设 flex-direction(默认 row),
|
|
488
|
+
* 之前 --vertical 和 --horizontal 各自覆盖了,唯独漏了 --alternate →
|
|
489
|
+
* 三个 item 横向排开,每个只有 255px,内容全被挤成竖排单字。
|
|
490
|
+
* 症状很像"grid 轨道算错了",实际是外层 flex 方向错了。
|
|
491
|
+
*/
|
|
492
|
+
.wd-timeline--alternate {
|
|
493
|
+
flex-direction: column;
|
|
494
|
+
}
|
|
495
|
+
.wd-timeline--alternate .wd-timeline__item {
|
|
496
|
+
display: flex;
|
|
497
|
+
gap: 12px;
|
|
498
|
+
padding-bottom: var(--tl-gap);
|
|
499
|
+
}
|
|
500
|
+
.wd-timeline--alternate .wd-timeline__node {
|
|
501
|
+
margin-top: 3px;
|
|
502
|
+
}
|
|
503
|
+
.wd-timeline--alternate .wd-timeline__item:nth-child(odd) .wd-timeline__body,
|
|
504
|
+
.wd-timeline--alternate .wd-timeline__item:nth-child(even) .wd-timeline__body {
|
|
505
|
+
grid-column: auto;
|
|
506
|
+
text-align: left;
|
|
507
|
+
}
|
|
508
|
+
.wd-timeline--alternate .wd-timeline__item:nth-child(odd) .wd-timeline__period,
|
|
509
|
+
.wd-timeline--alternate .wd-timeline__item:nth-child(odd) .wd-timeline__title {
|
|
510
|
+
justify-content: flex-start;
|
|
511
|
+
}
|
|
512
|
+
.wd-timeline--alternate .wd-timeline__item::before {
|
|
513
|
+
left: calc(var(--tl-dot) / 2 - 0.5px);
|
|
514
|
+
transform: none;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
@media (prefers-reduced-motion: reduce) {
|
|
518
|
+
.wd-timeline__caret {
|
|
519
|
+
transition: none;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.wd-toasts {
|
|
2
|
+
position: fixed;
|
|
3
|
+
top: 24px;
|
|
4
|
+
left: 50%;
|
|
5
|
+
transform: translateX(-50%);
|
|
6
|
+
z-index: 1200;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 10px;
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.wd-toast {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 9px;
|
|
18
|
+
padding: 12px 20px;
|
|
19
|
+
border-radius: var(--wd-radius-pill);
|
|
20
|
+
background: var(--wd-toast-bg);
|
|
21
|
+
color: var(--wd-ink);
|
|
22
|
+
font-size: 14px;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
line-height: 1.4;
|
|
25
|
+
box-shadow: var(--wd-shadow-pop);
|
|
26
|
+
backdrop-filter: blur(14px) saturate(1.4);
|
|
27
|
+
-webkit-backdrop-filter: blur(14px) saturate(1.4);
|
|
28
|
+
pointer-events: auto;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
transition: opacity var(--wd-dur-slow) ease, transform var(--wd-dur-slow) ease;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.wd-toast--enter,
|
|
34
|
+
.wd-toast--leave {
|
|
35
|
+
opacity: 0;
|
|
36
|
+
transform: translateY(-8px);
|
|
37
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
.wd-tooltip {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.wd-tooltip__bubble {
|
|
7
|
+
position: absolute; /* 文档坐标:JS 已加上 scrollX/scrollY */
|
|
8
|
+
z-index: 1200;
|
|
9
|
+
background: var(--wd-dark);
|
|
10
|
+
color: var(--wd-dark-text);
|
|
11
|
+
font-size: 12.5px;
|
|
12
|
+
font-weight: 600;
|
|
13
|
+
line-height: 1.5;
|
|
14
|
+
padding: 8px 12px;
|
|
15
|
+
border-radius: var(--wd-radius-sm);
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
box-shadow: var(--wd-shadow-pop);
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
/*
|
|
20
|
+
可见性交给 display,动画只负责淡入。
|
|
21
|
+
⚠️ 不要在 .is-open 上写 transform —— 定位已由 JS 的 top/left 决定,
|
|
22
|
+
transform 会覆盖它导致错位(历史上就踩过:animation 的 transform
|
|
23
|
+
把 translateX(-50%) 的居中顶掉)。
|
|
24
|
+
*/
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.wd-tooltip__bubble.is-open {
|
|
29
|
+
display: block;
|
|
30
|
+
animation: wd-tooltip-in 140ms var(--wd-ease-out) both;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@keyframes wd-tooltip-in {
|
|
34
|
+
from {
|
|
35
|
+
opacity: 0;
|
|
36
|
+
}
|
|
37
|
+
to {
|
|
38
|
+
opacity: 1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
@media (prefers-reduced-motion: reduce) {
|
|
42
|
+
.wd-tooltip__bubble.is-open {
|
|
43
|
+
animation: none;
|
|
44
|
+
}
|
|
45
|
+
}
|