@cyberpunk-vue/theme-chalk 1.14.0 → 1.14.2
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/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
- package/src/common/var.scss +247 -247
- package/src/components/avatar-group.scss +113 -113
- package/src/components/avatar.scss +123 -123
- package/src/components/badge.scss +210 -210
- package/src/components/breadcrumb.scss +203 -203
- package/src/components/button.scss +975 -975
- package/src/components/card.scss +699 -696
- package/src/components/checkbox-group.scss +22 -22
- package/src/components/checkbox.scss +320 -320
- package/src/components/col.scss +43 -43
- package/src/components/dialog.scss +360 -360
- package/src/components/divider.scss +250 -250
- package/src/components/empty.scss +99 -99
- package/src/components/form-item.scss +189 -189
- package/src/components/form.scss +59 -59
- package/src/components/icon.scss +83 -83
- package/src/components/image-preview.scss +147 -147
- package/src/components/image.scss +351 -351
- package/src/components/input-number.scss +129 -129
- package/src/components/input.scss +362 -362
- package/src/components/loading.scss +64 -64
- package/src/components/notification.scss +348 -348
- package/src/components/pagination.scss +287 -280
- package/src/components/pattern-background.scss +18 -18
- package/src/components/popover.scss +438 -438
- package/src/components/progress.scss +438 -438
- package/src/components/radio-group.scss +22 -22
- package/src/components/radio.scss +286 -286
- package/src/components/row.scss +12 -12
- package/src/components/scrollbar.scss +40 -40
- package/src/components/segmented.scss +566 -566
- package/src/components/select.scss +15 -1
- package/src/components/slider.scss +421 -421
- package/src/components/status-indicator.scss +206 -206
- package/src/components/switch.scss +405 -405
- package/src/components/table.scss +474 -474
- package/src/components/tag.scss +416 -416
- package/src/components/text.scss +310 -271
- package/src/components/textarea.scss +106 -104
- package/src/components/timeline.scss +379 -379
- package/src/components/tree.scss +397 -397
- package/src/components/upload.scss +509 -509
- package/src/index.scss +60 -60
- package/src/mixins/mixins.scss +156 -156
|
@@ -1,438 +1,438 @@
|
|
|
1
|
-
// CpPopover 组件样式
|
|
2
|
-
// 赛博朋克/机甲风格弹出层
|
|
3
|
-
|
|
4
|
-
@use '../common/var' as *;
|
|
5
|
-
@use '../mixins/mixins' as *;
|
|
6
|
-
|
|
7
|
-
// 动画
|
|
8
|
-
@keyframes cp-popover-fade-in {
|
|
9
|
-
from {
|
|
10
|
-
opacity: 0;
|
|
11
|
-
transform: scale(0.9);
|
|
12
|
-
}
|
|
13
|
-
to {
|
|
14
|
-
opacity: 1;
|
|
15
|
-
transform: scale(1);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@keyframes cp-popover-fade-out {
|
|
20
|
-
from {
|
|
21
|
-
opacity: 1;
|
|
22
|
-
transform: scale(1);
|
|
23
|
-
}
|
|
24
|
-
to {
|
|
25
|
-
opacity: 0;
|
|
26
|
-
transform: scale(0.9);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@include b(popover) {
|
|
31
|
-
display: inline-block;
|
|
32
|
-
position: relative;
|
|
33
|
-
|
|
34
|
-
// 触发器
|
|
35
|
-
@include e(trigger) {
|
|
36
|
-
display: inline-block;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// 背景层 (承载形状、背景、边框)
|
|
40
|
-
@include e(background) {
|
|
41
|
-
position: absolute;
|
|
42
|
-
inset: 0;
|
|
43
|
-
z-index: -1;
|
|
44
|
-
background: var(--cp-bg-elevated);
|
|
45
|
-
border: 1px solid var(--cp-border);
|
|
46
|
-
backdrop-filter: blur(8px);
|
|
47
|
-
|
|
48
|
-
// 内阴影
|
|
49
|
-
box-shadow: inset 0 0 20px color-mix(in srgb, var(--cp-color-primary) 3%, transparent);
|
|
50
|
-
|
|
51
|
-
// 默认切角样式
|
|
52
|
-
clip-path: polygon(
|
|
53
|
-
8px 0, 100% 0,
|
|
54
|
-
100% calc(100% - 8px), calc(100% - 8px) 100%,
|
|
55
|
-
0 100%, 0 8px
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
transition: clip-path 0.3s ease, border-radius 0.3s ease;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// 弹层内容容器 (承载布局、外部阴影、事件)
|
|
62
|
-
@include e(content) {
|
|
63
|
-
--cp-popover-base-color: var(--cp-popover-color, var(--cp-color-primary));
|
|
64
|
-
--cp-popover-base-color-light: var(--cp-popover-color-light, var(--cp-color-primary-light));
|
|
65
|
-
|
|
66
|
-
// 发光控制变量 (用户可覆盖)
|
|
67
|
-
// --cp-popover-glow-spread: 外发光扩散半径
|
|
68
|
-
--cp-popover-glow-spread: 0;
|
|
69
|
-
// --cp-popover-glow-color: 外发光颜色 (默认为透明,避免 solid 模式下透过半透明背景显示)
|
|
70
|
-
--cp-popover-glow-color: transparent;
|
|
71
|
-
|
|
72
|
-
position: absolute;
|
|
73
|
-
z-index: 2000;
|
|
74
|
-
padding: var(--cp-spacing-md);
|
|
75
|
-
|
|
76
|
-
// 外部阴影使用 filter: drop-shadow 以适配不规则形状 (包括箭头和切角)
|
|
77
|
-
filter:
|
|
78
|
-
drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4))
|
|
79
|
-
drop-shadow(0 0 var(--cp-popover-glow-spread) var(--cp-popover-glow-color));
|
|
80
|
-
|
|
81
|
-
// 入场动画由 <Transition> 管理
|
|
82
|
-
|
|
83
|
-
// 无动画模式
|
|
84
|
-
&.is-no-transition {
|
|
85
|
-
animation: none !important;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// 标记角 (保留在 content 层,位于切角之外的尖角处)
|
|
89
|
-
&::before {
|
|
90
|
-
content: '';
|
|
91
|
-
position: absolute;
|
|
92
|
-
top: 0;
|
|
93
|
-
right: 0;
|
|
94
|
-
width: 12px;
|
|
95
|
-
height: 12px;
|
|
96
|
-
border-right: 2px solid var(--cp-popover-base-color);
|
|
97
|
-
border-top: 2px solid var(--cp-popover-base-color);
|
|
98
|
-
opacity: 0.8;
|
|
99
|
-
transition: border-color 0.3s ease;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
&::after {
|
|
103
|
-
content: '';
|
|
104
|
-
position: absolute;
|
|
105
|
-
bottom: 0;
|
|
106
|
-
left: 0;
|
|
107
|
-
width: 12px;
|
|
108
|
-
height: 12px;
|
|
109
|
-
border-left: 2px solid var(--cp-popover-base-color);
|
|
110
|
-
border-bottom: 2px solid var(--cp-popover-base-color);
|
|
111
|
-
opacity: 0.8;
|
|
112
|
-
transition: border-color 0.3s ease;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// ===== Variant Styles =====
|
|
116
|
-
|
|
117
|
-
// Solid (默认)
|
|
118
|
-
@include m(solid) {
|
|
119
|
-
// 默认样式
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Outline
|
|
123
|
-
@include m(outline) {
|
|
124
|
-
--cp-popover-glow-spread: 10px;
|
|
125
|
-
--cp-popover-glow-color: var(--cp-popover-base-color-light);
|
|
126
|
-
|
|
127
|
-
.cp-popover__background {
|
|
128
|
-
background: var(--cp-bg-elevated);
|
|
129
|
-
border-color: var(--cp-popover-base-color);
|
|
130
|
-
box-shadow:
|
|
131
|
-
inset 0 0 15px var(--cp-popover-base-color-light);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
filter:
|
|
135
|
-
drop-shadow(0 4px 20px rgba(0, 0, 0, 0.4))
|
|
136
|
-
drop-shadow(0 0 var(--cp-popover-glow-spread) var(--cp-popover-glow-color));
|
|
137
|
-
|
|
138
|
-
&::before, &::after {
|
|
139
|
-
opacity: 1;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Neon
|
|
144
|
-
@include m(neon) {
|
|
145
|
-
--cp-popover-glow-spread: 15px;
|
|
146
|
-
--cp-popover-glow-color: var(--cp-popover-base-color-light);
|
|
147
|
-
|
|
148
|
-
.cp-popover__background {
|
|
149
|
-
background: rgba(var(--cp-bg-elevated-rgb), 0.95);
|
|
150
|
-
border-color: var(--cp-popover-base-color);
|
|
151
|
-
box-shadow: inset 0 0 10px var(--cp-popover-base-color-light);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
filter:
|
|
155
|
-
drop-shadow(0 0 var(--cp-popover-glow-spread) var(--cp-popover-glow-color))
|
|
156
|
-
drop-shadow(0 0 calc(var(--cp-popover-glow-spread) * 2) var(--cp-popover-glow-color));
|
|
157
|
-
|
|
158
|
-
&::before, &::after {
|
|
159
|
-
border-width: 3px;
|
|
160
|
-
opacity: 1;
|
|
161
|
-
filter: drop-shadow(0 0 5px var(--cp-popover-base-color));
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Ghost
|
|
166
|
-
@include m(ghost) {
|
|
167
|
-
.cp-popover__background {
|
|
168
|
-
background: var(--cp-bg-elevated);
|
|
169
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
170
|
-
box-shadow: none;
|
|
171
|
-
clip-path: none;
|
|
172
|
-
border-radius: var(--cp-radius-sm);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
|
|
176
|
-
|
|
177
|
-
&::before, &::after {
|
|
178
|
-
display: none;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Tooltip 模式
|
|
183
|
-
&.is-tooltip {
|
|
184
|
-
padding: var(--cp-spacing-sm) var(--cp-spacing-md);
|
|
185
|
-
font-size: var(--cp-font-size-sm);
|
|
186
|
-
|
|
187
|
-
.cp-popover__background {
|
|
188
|
-
background: var(--cp-bg-elevated);
|
|
189
|
-
border-color: var(--cp-popover-base-color);
|
|
190
|
-
|
|
191
|
-
// 小切角
|
|
192
|
-
clip-path: polygon(
|
|
193
|
-
4px 0, 100% 0,
|
|
194
|
-
100% calc(100% - 4px), calc(100% - 4px) 100%,
|
|
195
|
-
0 100%, 0 4px
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
filter:
|
|
200
|
-
drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5))
|
|
201
|
-
drop-shadow(0 0 var(--cp-popover-glow-spread) var(--cp-popover-glow-color));
|
|
202
|
-
|
|
203
|
-
&::before,
|
|
204
|
-
&::after {
|
|
205
|
-
display: none;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
&.cp-popover__content--ghost {
|
|
209
|
-
.cp-popover__background {
|
|
210
|
-
border-color: rgba(255, 255, 255, 0.1);
|
|
211
|
-
box-shadow: none;
|
|
212
|
-
}
|
|
213
|
-
filter: none;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// 有标题时
|
|
218
|
-
&.is-has-title {
|
|
219
|
-
padding-top: 0;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// ===== Shape =====
|
|
223
|
-
|
|
224
|
-
// clip (默认)
|
|
225
|
-
@include m(shape-clip) {
|
|
226
|
-
// background 默认已有 clip-path
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
// no-clip
|
|
230
|
-
@include m(shape-no-clip) {
|
|
231
|
-
.cp-popover__background {
|
|
232
|
-
clip-path: none !important;
|
|
233
|
-
border-radius: 0;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
&::before, &::after {
|
|
237
|
-
display: none;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// round
|
|
242
|
-
@include m(shape-round) {
|
|
243
|
-
.cp-popover__background {
|
|
244
|
-
clip-path: none !important;
|
|
245
|
-
border-radius: var(--cp-radius-md);
|
|
246
|
-
overflow: hidden;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
&::before, &::after {
|
|
250
|
-
display: none;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// 标题
|
|
256
|
-
@include e(title) {
|
|
257
|
-
padding: var(--cp-spacing-md) 0 var(--cp-spacing-sm);
|
|
258
|
-
font-size: var(--cp-font-size-md);
|
|
259
|
-
font-weight: 600;
|
|
260
|
-
color: var(--cp-text-primary);
|
|
261
|
-
border-bottom: 1px solid var(--cp-border);
|
|
262
|
-
margin-bottom: var(--cp-spacing-sm);
|
|
263
|
-
|
|
264
|
-
// 标题装饰线
|
|
265
|
-
&::before {
|
|
266
|
-
content: '';
|
|
267
|
-
display: inline-block;
|
|
268
|
-
width: 3px;
|
|
269
|
-
height: 1em;
|
|
270
|
-
background: var(--cp-popover-color, var(--cp-color-primary));
|
|
271
|
-
margin-right: var(--cp-spacing-sm);
|
|
272
|
-
vertical-align: middle;
|
|
273
|
-
transition: background-color 0.3s ease;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
// 内容区
|
|
278
|
-
@include e(body) {
|
|
279
|
-
font-size: var(--cp-font-size-sm);
|
|
280
|
-
color: var(--cp-text-secondary);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// 箭头
|
|
284
|
-
// flipArrow=false: 外凸三角,指向触发器
|
|
285
|
-
// flipArrow=true (.is-flipped): 内嵌三角,呈缺角感
|
|
286
|
-
@include e(arrow) {
|
|
287
|
-
position: absolute;
|
|
288
|
-
z-index: 2;
|
|
289
|
-
transition: box-shadow 0.3s ease, background-color 0.3s ease;
|
|
290
|
-
|
|
291
|
-
// 默认:外凸箭头(指向 trigger)
|
|
292
|
-
background: var(--cp-popover-base-color, var(--cp-color-primary));
|
|
293
|
-
box-shadow: 0 0 8px var(--cp-popover-base-color, var(--cp-color-primary));
|
|
294
|
-
|
|
295
|
-
.cp-popover__content--outline:not(.is-flipped) &,
|
|
296
|
-
.cp-popover__content--ghost:not(.is-flipped) & {
|
|
297
|
-
background: var(--cp-bg-elevated);
|
|
298
|
-
box-shadow: 0 0 6px var(--cp-popover-base-color, var(--cp-color-primary));
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.cp-popover__content--neon:not(.is-flipped) & {
|
|
302
|
-
box-shadow: 0 0 10px var(--cp-popover-color-light, var(--cp-color-primary-light));
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// 翻转模式:内嵌缺角
|
|
306
|
-
.cp-popover__content.is-flipped & {
|
|
307
|
-
background: var(--cp-popover-base-color);
|
|
308
|
-
box-shadow: 0 0 6px var(--cp-popover-base-color-light, var(--cp-color-primary-light));
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// ===== 各方向定位 =====
|
|
312
|
-
|
|
313
|
-
// 弹层在目标上方 → 箭头在底部
|
|
314
|
-
@include m(top) {
|
|
315
|
-
width: 12px;
|
|
316
|
-
height: 6px;
|
|
317
|
-
bottom: -6px;
|
|
318
|
-
left: 50%;
|
|
319
|
-
margin-left: -6px;
|
|
320
|
-
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
321
|
-
|
|
322
|
-
// 翻转后仍在底部,但内嵌进本体
|
|
323
|
-
.cp-popover__content.is-flipped & {
|
|
324
|
-
bottom: 0;
|
|
325
|
-
clip-path: polygon(0 100%, 100% 100%, 50% 0);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
// 弹层在目标下方 → 箭头在顶部
|
|
330
|
-
@include m(bottom) {
|
|
331
|
-
width: 12px;
|
|
332
|
-
height: 6px;
|
|
333
|
-
top: -6px;
|
|
334
|
-
left: 50%;
|
|
335
|
-
margin-left: -6px;
|
|
336
|
-
clip-path: polygon(0 100%, 100% 100%, 50% 0);
|
|
337
|
-
|
|
338
|
-
// 翻转后仍在顶部,但内嵌进本体
|
|
339
|
-
.cp-popover__content.is-flipped & {
|
|
340
|
-
top: 0;
|
|
341
|
-
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
// 弹层在目标左侧 → 箭头在右侧
|
|
346
|
-
@include m(left) {
|
|
347
|
-
width: 6px;
|
|
348
|
-
height: 12px;
|
|
349
|
-
right: -6px;
|
|
350
|
-
top: 50%;
|
|
351
|
-
margin-top: -6px;
|
|
352
|
-
clip-path: polygon(0 0, 100% 50%, 0 100%);
|
|
353
|
-
|
|
354
|
-
// 翻转后仍在右侧,但内嵌进本体
|
|
355
|
-
.cp-popover__content.is-flipped & {
|
|
356
|
-
right: 0;
|
|
357
|
-
clip-path: polygon(100% 0, 0 50%, 100% 100%);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
// 弹层在目标右侧 → 箭头在左侧
|
|
362
|
-
@include m(right) {
|
|
363
|
-
width: 6px;
|
|
364
|
-
height: 12px;
|
|
365
|
-
left: -6px;
|
|
366
|
-
top: 50%;
|
|
367
|
-
margin-top: -6px;
|
|
368
|
-
clip-path: polygon(100% 0, 0 50%, 100% 100%);
|
|
369
|
-
|
|
370
|
-
// 翻转后仍在左侧,但内嵌进本体
|
|
371
|
-
.cp-popover__content.is-flipped & {
|
|
372
|
-
left: 0;
|
|
373
|
-
clip-path: polygon(0 0, 100% 50%, 0 100%);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// 过渡动画
|
|
380
|
-
.cp-popover-fade-enter-active {
|
|
381
|
-
animation: cp-popover-fade-in 0.2s ease-out;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
.cp-popover-fade-leave-active {
|
|
385
|
-
animation: cp-popover-fade-out 0.15s ease-in;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
// ===== Slide 过渡动画 =====
|
|
389
|
-
|
|
390
|
-
// Top: 弹层在上方,从上方滑入
|
|
391
|
-
@keyframes cp-popover-slide-top-in {
|
|
392
|
-
from { opacity: 0; transform: translateY(-8px); }
|
|
393
|
-
to { opacity: 1; transform: translateY(0); }
|
|
394
|
-
}
|
|
395
|
-
@keyframes cp-popover-slide-top-out {
|
|
396
|
-
from { opacity: 1; transform: translateY(0); }
|
|
397
|
-
to { opacity: 0; transform: translateY(-8px); }
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// Bottom: 弹层在下方,从下方滑入
|
|
401
|
-
@keyframes cp-popover-slide-bottom-in {
|
|
402
|
-
from { opacity: 0; transform: translateY(8px); }
|
|
403
|
-
to { opacity: 1; transform: translateY(0); }
|
|
404
|
-
}
|
|
405
|
-
@keyframes cp-popover-slide-bottom-out {
|
|
406
|
-
from { opacity: 1; transform: translateY(0); }
|
|
407
|
-
to { opacity: 0; transform: translateY(8px); }
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
// Left: 弹层在左侧,从左方滑入
|
|
411
|
-
@keyframes cp-popover-slide-left-in {
|
|
412
|
-
from { opacity: 0; transform: translateX(-8px); }
|
|
413
|
-
to { opacity: 1; transform: translateX(0); }
|
|
414
|
-
}
|
|
415
|
-
@keyframes cp-popover-slide-left-out {
|
|
416
|
-
from { opacity: 1; transform: translateX(0); }
|
|
417
|
-
to { opacity: 0; transform: translateX(-8px); }
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
// Right: 弹层在右侧,从右方滑入
|
|
421
|
-
@keyframes cp-popover-slide-right-in {
|
|
422
|
-
from { opacity: 0; transform: translateX(8px); }
|
|
423
|
-
to { opacity: 1; transform: translateX(0); }
|
|
424
|
-
}
|
|
425
|
-
@keyframes cp-popover-slide-right-out {
|
|
426
|
-
from { opacity: 1; transform: translateX(0); }
|
|
427
|
-
to { opacity: 0; transform: translateX(8px); }
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// Slide transition classes
|
|
431
|
-
@each $dir in top, bottom, left, right {
|
|
432
|
-
.cp-popover-slide-#{$dir}-enter-active {
|
|
433
|
-
animation: cp-popover-slide-#{$dir}-in 0.2s ease-out;
|
|
434
|
-
}
|
|
435
|
-
.cp-popover-slide-#{$dir}-leave-active {
|
|
436
|
-
animation: cp-popover-slide-#{$dir}-out 0.15s ease-in;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
1
|
+
// CpPopover 组件样式
|
|
2
|
+
// 赛博朋克/机甲风格弹出层
|
|
3
|
+
|
|
4
|
+
@use '../common/var' as *;
|
|
5
|
+
@use '../mixins/mixins' as *;
|
|
6
|
+
|
|
7
|
+
// 动画
|
|
8
|
+
@keyframes cp-popover-fade-in {
|
|
9
|
+
from {
|
|
10
|
+
opacity: 0;
|
|
11
|
+
transform: scale(0.9);
|
|
12
|
+
}
|
|
13
|
+
to {
|
|
14
|
+
opacity: 1;
|
|
15
|
+
transform: scale(1);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes cp-popover-fade-out {
|
|
20
|
+
from {
|
|
21
|
+
opacity: 1;
|
|
22
|
+
transform: scale(1);
|
|
23
|
+
}
|
|
24
|
+
to {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
transform: scale(0.9);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include b(popover) {
|
|
31
|
+
display: inline-block;
|
|
32
|
+
position: relative;
|
|
33
|
+
|
|
34
|
+
// 触发器
|
|
35
|
+
@include e(trigger) {
|
|
36
|
+
display: inline-block;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 背景层 (承载形状、背景、边框)
|
|
40
|
+
@include e(background) {
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: 0;
|
|
43
|
+
z-index: -1;
|
|
44
|
+
background: var(--cp-bg-elevated);
|
|
45
|
+
border: 1px solid var(--cp-border);
|
|
46
|
+
backdrop-filter: blur(8px);
|
|
47
|
+
|
|
48
|
+
// 内阴影
|
|
49
|
+
box-shadow: inset 0 0 20px color-mix(in srgb, var(--cp-color-primary) 3%, transparent);
|
|
50
|
+
|
|
51
|
+
// 默认切角样式
|
|
52
|
+
clip-path: polygon(
|
|
53
|
+
8px 0, 100% 0,
|
|
54
|
+
100% calc(100% - 8px), calc(100% - 8px) 100%,
|
|
55
|
+
0 100%, 0 8px
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
transition: clip-path 0.3s ease, border-radius 0.3s ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// 弹层内容容器 (承载布局、外部阴影、事件)
|
|
62
|
+
@include e(content) {
|
|
63
|
+
--cp-popover-base-color: var(--cp-popover-color, var(--cp-color-primary));
|
|
64
|
+
--cp-popover-base-color-light: var(--cp-popover-color-light, var(--cp-color-primary-light));
|
|
65
|
+
|
|
66
|
+
// 发光控制变量 (用户可覆盖)
|
|
67
|
+
// --cp-popover-glow-spread: 外发光扩散半径
|
|
68
|
+
--cp-popover-glow-spread: 0;
|
|
69
|
+
// --cp-popover-glow-color: 外发光颜色 (默认为透明,避免 solid 模式下透过半透明背景显示)
|
|
70
|
+
--cp-popover-glow-color: transparent;
|
|
71
|
+
|
|
72
|
+
position: absolute;
|
|
73
|
+
z-index: 2000;
|
|
74
|
+
padding: var(--cp-spacing-md);
|
|
75
|
+
|
|
76
|
+
// 外部阴影使用 filter: drop-shadow 以适配不规则形状 (包括箭头和切角)
|
|
77
|
+
filter:
|
|
78
|
+
drop-shadow(0 4px 16px rgba(0, 0, 0, 0.4))
|
|
79
|
+
drop-shadow(0 0 var(--cp-popover-glow-spread) var(--cp-popover-glow-color));
|
|
80
|
+
|
|
81
|
+
// 入场动画由 <Transition> 管理
|
|
82
|
+
|
|
83
|
+
// 无动画模式
|
|
84
|
+
&.is-no-transition {
|
|
85
|
+
animation: none !important;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// 标记角 (保留在 content 层,位于切角之外的尖角处)
|
|
89
|
+
&::before {
|
|
90
|
+
content: '';
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
right: 0;
|
|
94
|
+
width: 12px;
|
|
95
|
+
height: 12px;
|
|
96
|
+
border-right: 2px solid var(--cp-popover-base-color);
|
|
97
|
+
border-top: 2px solid var(--cp-popover-base-color);
|
|
98
|
+
opacity: 0.8;
|
|
99
|
+
transition: border-color 0.3s ease;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&::after {
|
|
103
|
+
content: '';
|
|
104
|
+
position: absolute;
|
|
105
|
+
bottom: 0;
|
|
106
|
+
left: 0;
|
|
107
|
+
width: 12px;
|
|
108
|
+
height: 12px;
|
|
109
|
+
border-left: 2px solid var(--cp-popover-base-color);
|
|
110
|
+
border-bottom: 2px solid var(--cp-popover-base-color);
|
|
111
|
+
opacity: 0.8;
|
|
112
|
+
transition: border-color 0.3s ease;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// ===== Variant Styles =====
|
|
116
|
+
|
|
117
|
+
// Solid (默认)
|
|
118
|
+
@include m(solid) {
|
|
119
|
+
// 默认样式
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Outline
|
|
123
|
+
@include m(outline) {
|
|
124
|
+
--cp-popover-glow-spread: 10px;
|
|
125
|
+
--cp-popover-glow-color: var(--cp-popover-base-color-light);
|
|
126
|
+
|
|
127
|
+
.cp-popover__background {
|
|
128
|
+
background: var(--cp-bg-elevated);
|
|
129
|
+
border-color: var(--cp-popover-base-color);
|
|
130
|
+
box-shadow:
|
|
131
|
+
inset 0 0 15px var(--cp-popover-base-color-light);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
filter:
|
|
135
|
+
drop-shadow(0 4px 20px rgba(0, 0, 0, 0.4))
|
|
136
|
+
drop-shadow(0 0 var(--cp-popover-glow-spread) var(--cp-popover-glow-color));
|
|
137
|
+
|
|
138
|
+
&::before, &::after {
|
|
139
|
+
opacity: 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Neon
|
|
144
|
+
@include m(neon) {
|
|
145
|
+
--cp-popover-glow-spread: 15px;
|
|
146
|
+
--cp-popover-glow-color: var(--cp-popover-base-color-light);
|
|
147
|
+
|
|
148
|
+
.cp-popover__background {
|
|
149
|
+
background: rgba(var(--cp-bg-elevated-rgb), 0.95);
|
|
150
|
+
border-color: var(--cp-popover-base-color);
|
|
151
|
+
box-shadow: inset 0 0 10px var(--cp-popover-base-color-light);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
filter:
|
|
155
|
+
drop-shadow(0 0 var(--cp-popover-glow-spread) var(--cp-popover-glow-color))
|
|
156
|
+
drop-shadow(0 0 calc(var(--cp-popover-glow-spread) * 2) var(--cp-popover-glow-color));
|
|
157
|
+
|
|
158
|
+
&::before, &::after {
|
|
159
|
+
border-width: 3px;
|
|
160
|
+
opacity: 1;
|
|
161
|
+
filter: drop-shadow(0 0 5px var(--cp-popover-base-color));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Ghost
|
|
166
|
+
@include m(ghost) {
|
|
167
|
+
.cp-popover__background {
|
|
168
|
+
background: var(--cp-bg-elevated);
|
|
169
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
170
|
+
box-shadow: none;
|
|
171
|
+
clip-path: none;
|
|
172
|
+
border-radius: var(--cp-radius-sm);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
|
|
176
|
+
|
|
177
|
+
&::before, &::after {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Tooltip 模式
|
|
183
|
+
&.is-tooltip {
|
|
184
|
+
padding: var(--cp-spacing-sm) var(--cp-spacing-md);
|
|
185
|
+
font-size: var(--cp-font-size-sm);
|
|
186
|
+
|
|
187
|
+
.cp-popover__background {
|
|
188
|
+
background: var(--cp-bg-elevated);
|
|
189
|
+
border-color: var(--cp-popover-base-color);
|
|
190
|
+
|
|
191
|
+
// 小切角
|
|
192
|
+
clip-path: polygon(
|
|
193
|
+
4px 0, 100% 0,
|
|
194
|
+
100% calc(100% - 4px), calc(100% - 4px) 100%,
|
|
195
|
+
0 100%, 0 4px
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
filter:
|
|
200
|
+
drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5))
|
|
201
|
+
drop-shadow(0 0 var(--cp-popover-glow-spread) var(--cp-popover-glow-color));
|
|
202
|
+
|
|
203
|
+
&::before,
|
|
204
|
+
&::after {
|
|
205
|
+
display: none;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&.cp-popover__content--ghost {
|
|
209
|
+
.cp-popover__background {
|
|
210
|
+
border-color: rgba(255, 255, 255, 0.1);
|
|
211
|
+
box-shadow: none;
|
|
212
|
+
}
|
|
213
|
+
filter: none;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// 有标题时
|
|
218
|
+
&.is-has-title {
|
|
219
|
+
padding-top: 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// ===== Shape =====
|
|
223
|
+
|
|
224
|
+
// clip (默认)
|
|
225
|
+
@include m(shape-clip) {
|
|
226
|
+
// background 默认已有 clip-path
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// no-clip
|
|
230
|
+
@include m(shape-no-clip) {
|
|
231
|
+
.cp-popover__background {
|
|
232
|
+
clip-path: none !important;
|
|
233
|
+
border-radius: 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&::before, &::after {
|
|
237
|
+
display: none;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// round
|
|
242
|
+
@include m(shape-round) {
|
|
243
|
+
.cp-popover__background {
|
|
244
|
+
clip-path: none !important;
|
|
245
|
+
border-radius: var(--cp-radius-md);
|
|
246
|
+
overflow: hidden;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
&::before, &::after {
|
|
250
|
+
display: none;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// 标题
|
|
256
|
+
@include e(title) {
|
|
257
|
+
padding: var(--cp-spacing-md) 0 var(--cp-spacing-sm);
|
|
258
|
+
font-size: var(--cp-font-size-md);
|
|
259
|
+
font-weight: 600;
|
|
260
|
+
color: var(--cp-text-primary);
|
|
261
|
+
border-bottom: 1px solid var(--cp-border);
|
|
262
|
+
margin-bottom: var(--cp-spacing-sm);
|
|
263
|
+
|
|
264
|
+
// 标题装饰线
|
|
265
|
+
&::before {
|
|
266
|
+
content: '';
|
|
267
|
+
display: inline-block;
|
|
268
|
+
width: 3px;
|
|
269
|
+
height: 1em;
|
|
270
|
+
background: var(--cp-popover-color, var(--cp-color-primary));
|
|
271
|
+
margin-right: var(--cp-spacing-sm);
|
|
272
|
+
vertical-align: middle;
|
|
273
|
+
transition: background-color 0.3s ease;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// 内容区
|
|
278
|
+
@include e(body) {
|
|
279
|
+
font-size: var(--cp-font-size-sm);
|
|
280
|
+
color: var(--cp-text-secondary);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// 箭头
|
|
284
|
+
// flipArrow=false: 外凸三角,指向触发器
|
|
285
|
+
// flipArrow=true (.is-flipped): 内嵌三角,呈缺角感
|
|
286
|
+
@include e(arrow) {
|
|
287
|
+
position: absolute;
|
|
288
|
+
z-index: 2;
|
|
289
|
+
transition: box-shadow 0.3s ease, background-color 0.3s ease;
|
|
290
|
+
|
|
291
|
+
// 默认:外凸箭头(指向 trigger)
|
|
292
|
+
background: var(--cp-popover-base-color, var(--cp-color-primary));
|
|
293
|
+
box-shadow: 0 0 8px var(--cp-popover-base-color, var(--cp-color-primary));
|
|
294
|
+
|
|
295
|
+
.cp-popover__content--outline:not(.is-flipped) &,
|
|
296
|
+
.cp-popover__content--ghost:not(.is-flipped) & {
|
|
297
|
+
background: var(--cp-bg-elevated);
|
|
298
|
+
box-shadow: 0 0 6px var(--cp-popover-base-color, var(--cp-color-primary));
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.cp-popover__content--neon:not(.is-flipped) & {
|
|
302
|
+
box-shadow: 0 0 10px var(--cp-popover-color-light, var(--cp-color-primary-light));
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
// 翻转模式:内嵌缺角
|
|
306
|
+
.cp-popover__content.is-flipped & {
|
|
307
|
+
background: var(--cp-popover-base-color);
|
|
308
|
+
box-shadow: 0 0 6px var(--cp-popover-base-color-light, var(--cp-color-primary-light));
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// ===== 各方向定位 =====
|
|
312
|
+
|
|
313
|
+
// 弹层在目标上方 → 箭头在底部
|
|
314
|
+
@include m(top) {
|
|
315
|
+
width: 12px;
|
|
316
|
+
height: 6px;
|
|
317
|
+
bottom: -6px;
|
|
318
|
+
left: 50%;
|
|
319
|
+
margin-left: -6px;
|
|
320
|
+
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
321
|
+
|
|
322
|
+
// 翻转后仍在底部,但内嵌进本体
|
|
323
|
+
.cp-popover__content.is-flipped & {
|
|
324
|
+
bottom: 0;
|
|
325
|
+
clip-path: polygon(0 100%, 100% 100%, 50% 0);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// 弹层在目标下方 → 箭头在顶部
|
|
330
|
+
@include m(bottom) {
|
|
331
|
+
width: 12px;
|
|
332
|
+
height: 6px;
|
|
333
|
+
top: -6px;
|
|
334
|
+
left: 50%;
|
|
335
|
+
margin-left: -6px;
|
|
336
|
+
clip-path: polygon(0 100%, 100% 100%, 50% 0);
|
|
337
|
+
|
|
338
|
+
// 翻转后仍在顶部,但内嵌进本体
|
|
339
|
+
.cp-popover__content.is-flipped & {
|
|
340
|
+
top: 0;
|
|
341
|
+
clip-path: polygon(0 0, 100% 0, 50% 100%);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// 弹层在目标左侧 → 箭头在右侧
|
|
346
|
+
@include m(left) {
|
|
347
|
+
width: 6px;
|
|
348
|
+
height: 12px;
|
|
349
|
+
right: -6px;
|
|
350
|
+
top: 50%;
|
|
351
|
+
margin-top: -6px;
|
|
352
|
+
clip-path: polygon(0 0, 100% 50%, 0 100%);
|
|
353
|
+
|
|
354
|
+
// 翻转后仍在右侧,但内嵌进本体
|
|
355
|
+
.cp-popover__content.is-flipped & {
|
|
356
|
+
right: 0;
|
|
357
|
+
clip-path: polygon(100% 0, 0 50%, 100% 100%);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// 弹层在目标右侧 → 箭头在左侧
|
|
362
|
+
@include m(right) {
|
|
363
|
+
width: 6px;
|
|
364
|
+
height: 12px;
|
|
365
|
+
left: -6px;
|
|
366
|
+
top: 50%;
|
|
367
|
+
margin-top: -6px;
|
|
368
|
+
clip-path: polygon(100% 0, 0 50%, 100% 100%);
|
|
369
|
+
|
|
370
|
+
// 翻转后仍在左侧,但内嵌进本体
|
|
371
|
+
.cp-popover__content.is-flipped & {
|
|
372
|
+
left: 0;
|
|
373
|
+
clip-path: polygon(0 0, 100% 50%, 0 100%);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// 过渡动画
|
|
380
|
+
.cp-popover-fade-enter-active {
|
|
381
|
+
animation: cp-popover-fade-in 0.2s ease-out;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.cp-popover-fade-leave-active {
|
|
385
|
+
animation: cp-popover-fade-out 0.15s ease-in;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// ===== Slide 过渡动画 =====
|
|
389
|
+
|
|
390
|
+
// Top: 弹层在上方,从上方滑入
|
|
391
|
+
@keyframes cp-popover-slide-top-in {
|
|
392
|
+
from { opacity: 0; transform: translateY(-8px); }
|
|
393
|
+
to { opacity: 1; transform: translateY(0); }
|
|
394
|
+
}
|
|
395
|
+
@keyframes cp-popover-slide-top-out {
|
|
396
|
+
from { opacity: 1; transform: translateY(0); }
|
|
397
|
+
to { opacity: 0; transform: translateY(-8px); }
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
// Bottom: 弹层在下方,从下方滑入
|
|
401
|
+
@keyframes cp-popover-slide-bottom-in {
|
|
402
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
403
|
+
to { opacity: 1; transform: translateY(0); }
|
|
404
|
+
}
|
|
405
|
+
@keyframes cp-popover-slide-bottom-out {
|
|
406
|
+
from { opacity: 1; transform: translateY(0); }
|
|
407
|
+
to { opacity: 0; transform: translateY(8px); }
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Left: 弹层在左侧,从左方滑入
|
|
411
|
+
@keyframes cp-popover-slide-left-in {
|
|
412
|
+
from { opacity: 0; transform: translateX(-8px); }
|
|
413
|
+
to { opacity: 1; transform: translateX(0); }
|
|
414
|
+
}
|
|
415
|
+
@keyframes cp-popover-slide-left-out {
|
|
416
|
+
from { opacity: 1; transform: translateX(0); }
|
|
417
|
+
to { opacity: 0; transform: translateX(-8px); }
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// Right: 弹层在右侧,从右方滑入
|
|
421
|
+
@keyframes cp-popover-slide-right-in {
|
|
422
|
+
from { opacity: 0; transform: translateX(8px); }
|
|
423
|
+
to { opacity: 1; transform: translateX(0); }
|
|
424
|
+
}
|
|
425
|
+
@keyframes cp-popover-slide-right-out {
|
|
426
|
+
from { opacity: 1; transform: translateX(0); }
|
|
427
|
+
to { opacity: 0; transform: translateX(8px); }
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Slide transition classes
|
|
431
|
+
@each $dir in top, bottom, left, right {
|
|
432
|
+
.cp-popover-slide-#{$dir}-enter-active {
|
|
433
|
+
animation: cp-popover-slide-#{$dir}-in 0.2s ease-out;
|
|
434
|
+
}
|
|
435
|
+
.cp-popover-slide-#{$dir}-leave-active {
|
|
436
|
+
animation: cp-popover-slide-#{$dir}-out 0.15s ease-in;
|
|
437
|
+
}
|
|
438
|
+
}
|