@cyberpunk-vue/theme-chalk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,347 @@
1
+ // CpInput 组件样式
2
+ // 赛博朋克/机甲风格
3
+
4
+ @use '../common/var' as *;
5
+ @use '../mixins/mixins' as *;
6
+
7
+ @include b(input) {
8
+ // 基础样式
9
+ position: relative;
10
+ display: inline-flex;
11
+ align-items: center;
12
+ width: 100%;
13
+ padding: 0 var(--cp-spacing-md);
14
+ background: transparent;
15
+ border: 1px solid var(--cp-input-inactive-border-color, var(--cp-border));
16
+ color: var(--cp-input-text-color, var(--cp-text-primary));
17
+ font-family: 'Rajdhani', 'Inter', system-ui, sans-serif;
18
+ transition: all 0.2s ease;
19
+
20
+ // 机甲风切角 (Top-Left, Bottom-Right)
21
+ clip-path: polygon(8px 0,
22
+ 100% 0,
23
+ 100% calc(100% - 8px),
24
+ calc(100% - 8px) 100%,
25
+ 0 100%,
26
+ 0 8px);
27
+
28
+ // 装饰性小方块 (右上角)
29
+ &::after {
30
+ content: '';
31
+ position: absolute;
32
+ top: 0;
33
+ right: 0;
34
+ width: 6px;
35
+ height: 6px;
36
+ background: var(--cp-input-inactive-border-color, var(--cp-border));
37
+ opacity: 0.6;
38
+ z-index: 2;
39
+ transition: all 0.2s ease;
40
+ }
41
+
42
+ // ===== 尺寸 =====
43
+ @include m(sm) {
44
+ height: var(--cp-size-sm);
45
+ font-size: var(--cp-font-size-sm);
46
+ padding: 0 var(--cp-spacing-sm);
47
+ clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
48
+
49
+ &::after {
50
+ width: 5px;
51
+ height: 5px;
52
+ }
53
+ }
54
+
55
+ @include m(md) {
56
+ height: var(--cp-size-md);
57
+ font-size: var(--cp-font-size-md);
58
+ }
59
+
60
+ @include m(lg) {
61
+ height: var(--cp-size-lg);
62
+ font-size: var(--cp-font-size-lg);
63
+ padding: 0 var(--cp-spacing-lg);
64
+ clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
65
+
66
+ &::after {
67
+ width: 8px;
68
+ height: 8px;
69
+ }
70
+ }
71
+
72
+ // ===== Outline 变体 (默认) =====
73
+ @include m(outline) {
74
+ background: transparent;
75
+ border-color: var(--cp-input-inactive-border-color, var(--cp-border));
76
+
77
+ &::after {
78
+ background: var(--cp-input-inactive-border-color, var(--cp-border));
79
+ }
80
+
81
+ &:hover:not(.is-disabled):not(.is-readonly) {
82
+ border-color: var(--cp-color-primary);
83
+
84
+ &::after {
85
+ background: var(--cp-color-primary);
86
+ opacity: 0.8;
87
+ }
88
+ }
89
+
90
+ &.is-focused {
91
+ border-color: var(--cp-color-primary);
92
+ box-shadow: 0 0 10px var(--cp-color-primary-light), inset 0 0 5px var(--cp-color-primary-light);
93
+
94
+ &::after {
95
+ background: var(--cp-color-primary);
96
+ opacity: 1;
97
+ box-shadow: 0 0 5px var(--cp-color-primary);
98
+ }
99
+ }
100
+ }
101
+
102
+ // ===== Filled 变体 =====
103
+ @include m(filled) {
104
+ background: var(--cp-bg-elevated);
105
+ border-color: var(--cp-input-inactive-border-color, var(--cp-border));
106
+
107
+ &::after {
108
+ background: var(--cp-input-inactive-border-color, var(--cp-border));
109
+ }
110
+
111
+ &:hover:not(.is-disabled):not(.is-readonly) {
112
+ border-color: var(--cp-color-primary);
113
+ background: rgba(0, 240, 255, 0.05);
114
+
115
+ &::after {
116
+ background: var(--cp-color-primary);
117
+ opacity: 0.8;
118
+ }
119
+ }
120
+
121
+ &.is-focused {
122
+ border-color: var(--cp-color-primary);
123
+ background: rgba(0, 240, 255, 0.08);
124
+ box-shadow: 0 0 10px var(--cp-color-primary-light);
125
+
126
+ &::after {
127
+ background: var(--cp-color-primary);
128
+ opacity: 1;
129
+ }
130
+ }
131
+ }
132
+
133
+ // ===== Ghost 变体 =====
134
+ @include m(ghost) {
135
+ background: transparent;
136
+ border-color: transparent;
137
+ border-bottom-color: var(--cp-input-inactive-border-color, var(--cp-border));
138
+ clip-path: none;
139
+ border-radius: 0;
140
+
141
+ &::after {
142
+ display: none;
143
+ }
144
+
145
+ &:hover:not(.is-disabled):not(.is-readonly) {
146
+ border-bottom-color: var(--cp-color-primary);
147
+ }
148
+
149
+ &.is-focused {
150
+ border-bottom-color: var(--cp-color-primary);
151
+ box-shadow: 0 2px 0 0 var(--cp-color-primary);
152
+ }
153
+ }
154
+
155
+ // ===== 形状模式 =====
156
+ // no-clip (直角)
157
+ @include m(shape-no-clip) {
158
+ clip-path: none;
159
+ border-radius: 0;
160
+
161
+ &::after {
162
+ display: none;
163
+ }
164
+ }
165
+
166
+ // round (圆角)
167
+ @include m(shape-round) {
168
+ clip-path: none;
169
+ border-radius: var(--cp-radius-lg);
170
+
171
+ &::after {
172
+ display: none;
173
+ }
174
+ }
175
+
176
+ // ===== 状态 =====
177
+ @include when(disabled) {
178
+ cursor: not-allowed;
179
+ opacity: 0.5;
180
+ filter: grayscale(0.5);
181
+
182
+ .cp-input__inner {
183
+ cursor: not-allowed;
184
+ }
185
+ }
186
+
187
+ @include when(readonly) {
188
+ .cp-input__inner {
189
+ cursor: default;
190
+ }
191
+ }
192
+
193
+ // ===== 自定义颜色 =====
194
+ @include when(custom-color) {
195
+ &:hover:not(.is-disabled):not(.is-readonly) {
196
+ border-color: var(--cp-input-custom-color);
197
+
198
+ &::after {
199
+ background: var(--cp-input-custom-color);
200
+ }
201
+ }
202
+
203
+ &.is-focused {
204
+ border-color: var(--cp-input-custom-color);
205
+ box-shadow: 0 0 10px var(--cp-input-custom-color-light), inset 0 0 5px var(--cp-input-custom-color-light);
206
+
207
+ &::after {
208
+ background: var(--cp-input-custom-color);
209
+ box-shadow: 0 0 5px var(--cp-input-custom-color);
210
+ }
211
+ }
212
+
213
+ // Ghost 变体 - 确保只有底部边框显示颜色
214
+ &.cp-input--ghost {
215
+ // 基础状态:保持顶部/左右边框透明
216
+ border-color: transparent;
217
+ border-bottom-color: var(--cp-input-inactive-border-color, var(--cp-border));
218
+
219
+ &:hover:not(.is-disabled):not(.is-readonly) {
220
+ border-color: transparent;
221
+ border-bottom-color: var(--cp-input-custom-color);
222
+ }
223
+
224
+ &.is-focused {
225
+ border-color: transparent;
226
+ border-bottom-color: var(--cp-input-custom-color);
227
+ box-shadow: 0 2px 0 0 var(--cp-input-custom-color);
228
+ }
229
+ }
230
+ }
231
+
232
+ // ===== 内部元素 =====
233
+ @include e(inner) {
234
+ flex: 1;
235
+ width: 100%;
236
+ height: 100%;
237
+ padding: 0;
238
+ background: transparent;
239
+ border: none;
240
+ outline: none;
241
+ color: inherit;
242
+ font-family: inherit;
243
+ font-size: inherit;
244
+ transition: opacity 0.15s ease, transform 0.15s ease, letter-spacing 0.15s ease;
245
+
246
+ &::placeholder {
247
+ color: var(--cp-input-placeholder-color, var(--cp-text-muted));
248
+ }
249
+
250
+ // 移除 number 类型的箭头
251
+ &[type="number"] {
252
+ -moz-appearance: textfield;
253
+ appearance: textfield;
254
+
255
+ &::-webkit-outer-spin-button,
256
+ &::-webkit-inner-spin-button {
257
+ -webkit-appearance: none;
258
+ appearance: none;
259
+ margin: 0;
260
+ }
261
+ }
262
+ }
263
+
264
+ // 清除动画状态
265
+ @include when(clearing) {
266
+ .cp-input__inner {
267
+ opacity: 0;
268
+ transform: scaleX(0.8);
269
+ letter-spacing: -0.5em;
270
+ transform-origin: left center;
271
+ }
272
+ }
273
+
274
+ @include e(prefix) {
275
+ display: inline-flex;
276
+ align-items: center;
277
+ margin-right: var(--cp-spacing-sm);
278
+ color: var(--cp-text-secondary);
279
+ font-size: 1.1em;
280
+
281
+ .cp-icon {
282
+ --cp-icon-size: 1em;
283
+ }
284
+ }
285
+
286
+ @include e(suffix) {
287
+ display: inline-flex;
288
+ align-items: center;
289
+ margin-left: var(--cp-spacing-sm);
290
+ color: var(--cp-text-secondary);
291
+ font-size: 1.1em;
292
+
293
+ .cp-icon {
294
+ --cp-icon-size: 1em;
295
+ }
296
+ }
297
+
298
+ @include e(clear) {
299
+ display: inline-flex;
300
+ align-items: center;
301
+ margin-left: var(--cp-spacing-xs);
302
+ color: var(--cp-text-muted);
303
+ font-size: 1em;
304
+ cursor: pointer;
305
+ transition: color 0.2s ease;
306
+
307
+ &:hover {
308
+ color: var(--cp-text-secondary);
309
+ }
310
+
311
+ svg {
312
+ width: 1em;
313
+ height: 1em;
314
+ }
315
+ }
316
+
317
+ @include e(password) {
318
+ display: inline-flex;
319
+ align-items: center;
320
+ margin-left: var(--cp-spacing-xs);
321
+ color: var(--cp-text-muted);
322
+ font-size: 1em;
323
+ cursor: pointer;
324
+ transition: color 0.2s ease;
325
+
326
+ &:hover {
327
+ color: var(--cp-color-primary);
328
+ }
329
+
330
+ svg {
331
+ width: 1.1em;
332
+ height: 1.1em;
333
+ }
334
+ }
335
+
336
+ @include e(count) {
337
+ display: inline-flex;
338
+ align-items: center;
339
+ margin-left: var(--cp-spacing-sm);
340
+ padding-left: var(--cp-spacing-sm);
341
+ border-left: 1px solid var(--cp-border);
342
+ color: var(--cp-text-muted);
343
+ font-size: var(--cp-font-size-sm);
344
+ white-space: nowrap;
345
+ font-family: 'Rajdhani', monospace;
346
+ }
347
+ }
@@ -0,0 +1,106 @@
1
+ // CpLoading 组件样式
2
+ // Google Material Design 风格圆形加载器
3
+ // 弧线伸缩 + 旋转双重动画
4
+
5
+ @use '../common/var' as *;
6
+ @use '../mixins/mixins' as *;
7
+
8
+ // 尺寸映射
9
+ $loading-sizes: (
10
+ sm: 24px,
11
+ md: 40px,
12
+ lg: 56px,
13
+ );
14
+
15
+ @include b(loading) {
16
+ display: inline-flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+
20
+ // ===== 尺寸 =====
21
+ @each $name, $size in $loading-sizes {
22
+ @include m($name) {
23
+ width: $size;
24
+ height: $size;
25
+ }
26
+ }
27
+
28
+ // ===== SVG 容器 =====
29
+ @include e(svg) {
30
+ animation: cp-loading-rotate 2s linear infinite;
31
+ }
32
+
33
+ // ===== 轨道 (半透明背景圆) =====
34
+ @include e(track) {
35
+ stroke: currentColor;
36
+ opacity: 0.15;
37
+ }
38
+
39
+ // ===== 动态弧线 =====
40
+ @include e(circle) {
41
+ stroke: currentColor;
42
+ transform-origin: center;
43
+ animation: cp-loading-dash 1.5s ease-in-out infinite;
44
+ }
45
+
46
+ // ===== 颜色类型 =====
47
+ @include m(primary) {
48
+ color: var(--cp-color-primary);
49
+ }
50
+
51
+ @include m(success) {
52
+ color: var(--cp-color-success);
53
+ }
54
+
55
+ @include m(warning) {
56
+ color: var(--cp-color-warning);
57
+ }
58
+
59
+ @include m(error) {
60
+ color: var(--cp-color-error);
61
+ }
62
+
63
+ @include m(info) {
64
+ color: var(--cp-color-info);
65
+ }
66
+
67
+ @include m(default) {
68
+ color: inherit;
69
+ }
70
+
71
+
72
+ // ===== 自定义颜色 =====
73
+ @include when(custom-color) {
74
+ color: var(--cp-loading-color);
75
+ }
76
+ }
77
+
78
+ // ===== 动画 =====
79
+
80
+ // 旋转动画 - 容器整体旋转
81
+ @keyframes cp-loading-rotate {
82
+ 100% {
83
+ transform: rotate(360deg);
84
+ }
85
+ }
86
+
87
+ // 弧线伸缩动画 - Google Material Design 风格
88
+ // 配合 pathLength="100" 使用标准化数值
89
+ // 0% 和 100% 必须完全相同 (除了 offset 差一个周期 -100)
90
+ // 使用 1 作为最小值保持 Google 原版质感,用户提到的消失问题已由 Geometry 修复解决
91
+ @keyframes cp-loading-dash {
92
+ 0% {
93
+ stroke-dasharray: 1, 200;
94
+ stroke-dashoffset: 0;
95
+ }
96
+
97
+ 50% {
98
+ stroke-dasharray: 89, 200;
99
+ stroke-dashoffset: -35;
100
+ }
101
+
102
+ 100% {
103
+ stroke-dasharray: 1, 200;
104
+ stroke-dashoffset: -100;
105
+ }
106
+ }
@@ -0,0 +1,18 @@
1
+ @use '../common/var' as *;
2
+ @use '../mixins/mixins' as *;
3
+
4
+ @include b(pattern-background) {
5
+ position: relative;
6
+ width: 100%;
7
+ height: 100%;
8
+
9
+ @include when(cover) {
10
+ position: absolute;
11
+ inset: 0;
12
+ z-index: 0;
13
+ }
14
+
15
+ @include when(decorative) {
16
+ pointer-events: none;
17
+ }
18
+ }
@@ -0,0 +1,198 @@
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(content) {
41
+ position: absolute;
42
+ z-index: 2000;
43
+ padding: var(--cp-spacing-md);
44
+ background: var(--cp-bg-elevated);
45
+ border: 1px solid var(--cp-border);
46
+ box-shadow:
47
+ 0 4px 16px rgba(0, 0, 0, 0.4),
48
+ 0 0 1px var(--cp-color-primary),
49
+ inset 0 0 20px rgba(0, 240, 255, 0.03);
50
+ backdrop-filter: blur(8px);
51
+
52
+ // 切角样式
53
+ clip-path: polygon(
54
+ 8px 0, 100% 0,
55
+ 100% calc(100% - 8px), calc(100% - 8px) 100%,
56
+ 0 100%, 0 8px
57
+ );
58
+
59
+ // 入场动画
60
+ animation: cp-popover-fade-in 0.2s ease-out;
61
+
62
+ // 标记角
63
+ &::before {
64
+ content: '';
65
+ position: absolute;
66
+ top: 0;
67
+ left: 0;
68
+ width: 12px;
69
+ height: 12px;
70
+ border-left: 2px solid var(--cp-color-primary);
71
+ border-top: 2px solid var(--cp-color-primary);
72
+ opacity: 0.8;
73
+ }
74
+
75
+ &::after {
76
+ content: '';
77
+ position: absolute;
78
+ bottom: 0;
79
+ right: 0;
80
+ width: 12px;
81
+ height: 12px;
82
+ border-right: 2px solid var(--cp-color-primary);
83
+ border-bottom: 2px solid var(--cp-color-primary);
84
+ opacity: 0.8;
85
+ }
86
+
87
+ // Tooltip 模式 - 简化样式
88
+ &.is-tooltip {
89
+ padding: var(--cp-spacing-sm) var(--cp-spacing-md);
90
+ font-size: var(--cp-font-size-sm);
91
+ background: rgba(10, 10, 14, 0.95);
92
+ border-color: var(--cp-color-primary);
93
+ box-shadow:
94
+ 0 2px 8px rgba(0, 0, 0, 0.5),
95
+ 0 0 8px var(--cp-color-primary-light);
96
+
97
+ // 更小的切角
98
+ clip-path: polygon(
99
+ 4px 0, 100% 0,
100
+ 100% calc(100% - 4px), calc(100% - 4px) 100%,
101
+ 0 100%, 0 4px
102
+ );
103
+
104
+ &::before,
105
+ &::after {
106
+ display: none;
107
+ }
108
+ }
109
+
110
+ // 有标题时
111
+ &.is-has-title {
112
+ padding-top: 0;
113
+ }
114
+ }
115
+
116
+ // 标题
117
+ @include e(title) {
118
+ padding: var(--cp-spacing-md) 0 var(--cp-spacing-sm);
119
+ font-size: var(--cp-font-size-md);
120
+ font-weight: 600;
121
+ color: var(--cp-text-primary);
122
+ border-bottom: 1px solid var(--cp-border);
123
+ margin-bottom: var(--cp-spacing-sm);
124
+
125
+ // 标题装饰线
126
+ &::before {
127
+ content: '';
128
+ display: inline-block;
129
+ width: 3px;
130
+ height: 1em;
131
+ background: var(--cp-color-primary);
132
+ margin-right: var(--cp-spacing-sm);
133
+ vertical-align: middle;
134
+ }
135
+ }
136
+
137
+ // 内容区
138
+ @include e(body) {
139
+ font-size: var(--cp-font-size-sm);
140
+ color: var(--cp-text-secondary);
141
+ line-height: 1.6;
142
+ }
143
+
144
+ // 箭头
145
+ @include e(arrow) {
146
+ position: absolute;
147
+ width: 8px;
148
+ height: 8px;
149
+ background: var(--cp-bg-elevated);
150
+ border: 1px solid var(--cp-border);
151
+ transform: rotate(45deg);
152
+
153
+ // 朝上
154
+ @include m(top) {
155
+ bottom: -5px;
156
+ left: 50%;
157
+ margin-left: -4px;
158
+ border-top: none;
159
+ border-left: none;
160
+ }
161
+
162
+ // 朝下
163
+ @include m(bottom) {
164
+ top: -5px;
165
+ left: 50%;
166
+ margin-left: -4px;
167
+ border-bottom: none;
168
+ border-right: none;
169
+ }
170
+
171
+ // 朝左
172
+ @include m(left) {
173
+ right: -5px;
174
+ top: 50%;
175
+ margin-top: -4px;
176
+ border-bottom: none;
177
+ border-left: none;
178
+ }
179
+
180
+ // 朝右
181
+ @include m(right) {
182
+ left: -5px;
183
+ top: 50%;
184
+ margin-top: -4px;
185
+ border-top: none;
186
+ border-right: none;
187
+ }
188
+ }
189
+ }
190
+
191
+ // 过渡动画
192
+ .cp-popover-fade-enter-active {
193
+ animation: cp-popover-fade-in 0.2s ease-out;
194
+ }
195
+
196
+ .cp-popover-fade-leave-active {
197
+ animation: cp-popover-fade-out 0.15s ease-in;
198
+ }