@cyberpunk-vue/components 1.14.0 → 1.14.1

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.
@@ -17,13 +17,21 @@ export declare const CpText: import('../utils').SFCWithInstall<{
17
17
  readonly type: import('vue').PropType<import('.').TextType>;
18
18
  readonly default: "default";
19
19
  };
20
+ readonly level: {
21
+ readonly type: import('vue').PropType<import('.').TextLevel>;
22
+ readonly default: "body";
23
+ };
24
+ readonly tag: {
25
+ readonly type: import('vue').PropType<import('.').TextTag>;
26
+ readonly default: "span";
27
+ };
20
28
  readonly color: {
21
29
  readonly type: StringConstructor;
22
30
  readonly default: "";
23
31
  };
24
32
  readonly size: {
25
33
  readonly type: import('vue').PropType<import('.').TextSize>;
26
- readonly default: "md";
34
+ readonly default: undefined;
27
35
  };
28
36
  readonly align: {
29
37
  readonly type: import('vue').PropType<import('.').TextAlign>;
@@ -110,10 +118,12 @@ export declare const CpText: import('../utils').SFCWithInstall<{
110
118
  readonly bold: boolean;
111
119
  readonly type: import('.').TextType;
112
120
  readonly color: string;
121
+ readonly tag: import('.').TextTag;
113
122
  readonly dashed: boolean;
114
123
  readonly marker: boolean;
115
124
  readonly italic: boolean;
116
125
  readonly underline: boolean;
126
+ readonly level: import('.').TextLevel;
117
127
  readonly align: import('.').TextAlign;
118
128
  readonly boxed: boolean;
119
129
  readonly strikethrough: boolean;
@@ -129,7 +139,7 @@ export declare const CpText: import('../utils').SFCWithInstall<{
129
139
  readonly overlapOffsetY: number;
130
140
  readonly overlapColor: string;
131
141
  readonly unselectable: boolean;
132
- }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLSpanElement, import('vue').ComponentProvideOptions, {
142
+ }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
133
143
  P: {};
134
144
  B: {};
135
145
  D: {};
@@ -141,13 +151,21 @@ export declare const CpText: import('../utils').SFCWithInstall<{
141
151
  readonly type: import('vue').PropType<import('.').TextType>;
142
152
  readonly default: "default";
143
153
  };
154
+ readonly level: {
155
+ readonly type: import('vue').PropType<import('.').TextLevel>;
156
+ readonly default: "body";
157
+ };
158
+ readonly tag: {
159
+ readonly type: import('vue').PropType<import('.').TextTag>;
160
+ readonly default: "span";
161
+ };
144
162
  readonly color: {
145
163
  readonly type: StringConstructor;
146
164
  readonly default: "";
147
165
  };
148
166
  readonly size: {
149
167
  readonly type: import('vue').PropType<import('.').TextSize>;
150
- readonly default: "md";
168
+ readonly default: undefined;
151
169
  };
152
170
  readonly align: {
153
171
  readonly type: import('vue').PropType<import('.').TextAlign>;
@@ -234,10 +252,12 @@ export declare const CpText: import('../utils').SFCWithInstall<{
234
252
  readonly bold: boolean;
235
253
  readonly type: import('.').TextType;
236
254
  readonly color: string;
255
+ readonly tag: import('.').TextTag;
237
256
  readonly dashed: boolean;
238
257
  readonly marker: boolean;
239
258
  readonly italic: boolean;
240
259
  readonly underline: boolean;
260
+ readonly level: import('.').TextLevel;
241
261
  readonly align: import('.').TextAlign;
242
262
  readonly boxed: boolean;
243
263
  readonly strikethrough: boolean;
@@ -262,13 +282,21 @@ export declare const CpText: import('../utils').SFCWithInstall<{
262
282
  readonly type: import('vue').PropType<import('.').TextType>;
263
283
  readonly default: "default";
264
284
  };
285
+ readonly level: {
286
+ readonly type: import('vue').PropType<import('.').TextLevel>;
287
+ readonly default: "body";
288
+ };
289
+ readonly tag: {
290
+ readonly type: import('vue').PropType<import('.').TextTag>;
291
+ readonly default: "span";
292
+ };
265
293
  readonly color: {
266
294
  readonly type: StringConstructor;
267
295
  readonly default: "";
268
296
  };
269
297
  readonly size: {
270
298
  readonly type: import('vue').PropType<import('.').TextSize>;
271
- readonly default: "md";
299
+ readonly default: undefined;
272
300
  };
273
301
  readonly align: {
274
302
  readonly type: import('vue').PropType<import('.').TextAlign>;
@@ -355,10 +383,12 @@ export declare const CpText: import('../utils').SFCWithInstall<{
355
383
  readonly bold: boolean;
356
384
  readonly type: import('.').TextType;
357
385
  readonly color: string;
386
+ readonly tag: import('.').TextTag;
358
387
  readonly dashed: boolean;
359
388
  readonly marker: boolean;
360
389
  readonly italic: boolean;
361
390
  readonly underline: boolean;
391
+ readonly level: import('.').TextLevel;
362
392
  readonly align: import('.').TextAlign;
363
393
  readonly boxed: boolean;
364
394
  readonly strikethrough: boolean;
@@ -10,7 +10,7 @@ import { DurationValue } from '@cyberpunk-vue/hooks';
10
10
  export type TextSize = 'sm' | 'md' | 'lg' | number;
11
11
  /**
12
12
  * 文字类型(颜色预设)
13
- * - `default` - 默认 (继承父级颜色)
13
+ * - `default` - 默认主题文字色
14
14
  * - `primary` - 主色调 (赛博青)
15
15
  * - `success` - 成功 (霓虹绿)
16
16
  * - `warning` - 警告 (橙黄)
@@ -18,6 +18,16 @@ export type TextSize = 'sm' | 'md' | 'lg' | number;
18
18
  * - `info` - 信息 (紫罗兰)
19
19
  */
20
20
  export type TextType = 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
21
+ /**
22
+ * 文字层级
23
+ * - `heading` - 标题文字,适合模块标题或卡片标题
24
+ * - `subheading` - 副标题文字,适合标题下方说明
25
+ * - `body` - 正文文字,默认
26
+ * - `secondary` - 次级正文,适合描述、辅助信息
27
+ * - `caption` - 标签/注释文字,适合元信息
28
+ * - `muted` - 弱化文字,适合低优先级说明
29
+ */
30
+ export type TextLevel = 'heading' | 'subheading' | 'body' | 'secondary' | 'caption' | 'muted';
21
31
  /**
22
32
  * 垂直对齐方式
23
33
  * - `top` - 顶部对齐
@@ -25,15 +35,20 @@ export type TextType = 'default' | 'primary' | 'success' | 'warning' | 'error' |
25
35
  * - `bottom` - 底部对齐
26
36
  */
27
37
  export type TextAlign = 'top' | 'middle' | 'bottom';
38
+ /**
39
+ * 渲染标签
40
+ */
41
+ export type TextTag = 'span' | 'p' | 'div' | 'label' | 'strong' | 'em' | 'small' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
28
42
  /**
29
43
  * CpText 组件 Props 定义
30
44
  *
31
- * @description 赛博朋克风格特殊文字组件,可快速为文字添加多种视觉效果。
45
+ * @description 赛博朋克风格文字组件,可快速切换文字层级并添加多种视觉效果。
32
46
  *
33
47
  * @example
34
48
  * ```vue
35
49
  * <!-- 基础用法 -->
36
50
  * <CpText>普通文字</CpText>
51
+ * <CpText level="heading" tag="h2">标题文字</CpText>
37
52
  *
38
53
  * <!-- 带效果 -->
39
54
  * <CpText underline type="primary">下划线</CpText>
@@ -57,6 +72,26 @@ export declare const textProps: {
57
72
  readonly type: PropType<TextType>;
58
73
  readonly default: "default";
59
74
  };
75
+ /**
76
+ * 文字层级
77
+ * 控制默认字号、字重、行高和文本色,可被 size / type / color 显式覆盖
78
+ * @default 'body'
79
+ * @example `<CpText level="heading" tag="h2">标题</CpText>`
80
+ */
81
+ readonly level: {
82
+ readonly type: PropType<TextLevel>;
83
+ readonly default: "body";
84
+ };
85
+ /**
86
+ * 渲染标签
87
+ * 仅改变实际 HTML 标签,不改变视觉层级;需要视觉层级请使用 level
88
+ * @default 'span'
89
+ * @example `<CpText tag="p" level="body">段落</CpText>`
90
+ */
91
+ readonly tag: {
92
+ readonly type: PropType<TextTag>;
93
+ readonly default: "span";
94
+ };
60
95
  /**
61
96
  * 自定义颜色
62
97
  * 传入有效 CSS 颜色值,覆盖 type 的颜色
@@ -69,14 +104,14 @@ export declare const textProps: {
69
104
  };
70
105
  /**
71
106
  * 文字尺寸
72
- * 可以是预设值 (sm/md/lg) 或数字 (像素)
73
- * @default 'md'
107
+ * 可以是预设值 (sm/md/lg) 或数字 (像素),不传时使用 level 的默认字号
108
+ * @default undefined
74
109
  * @example `<CpText size="lg">大号</CpText>`
75
110
  * @example `<CpText :size="20">20像素</CpText>`
76
111
  */
77
112
  readonly size: {
78
113
  readonly type: PropType<TextSize>;
79
- readonly default: "md";
114
+ readonly default: undefined;
80
115
  };
81
116
  /**
82
117
  * 垂直对齐方式
@@ -6,7 +6,7 @@ declare function __VLS_template(): {
6
6
  suffix?(_: {}): any;
7
7
  };
8
8
  refs: {};
9
- rootEl: HTMLSpanElement;
9
+ rootEl: any;
10
10
  };
11
11
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
12
12
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
@@ -14,13 +14,21 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
14
14
  readonly type: import('vue').PropType<import('./text').TextType>;
15
15
  readonly default: "default";
16
16
  };
17
+ readonly level: {
18
+ readonly type: import('vue').PropType<import('./text').TextLevel>;
19
+ readonly default: "body";
20
+ };
21
+ readonly tag: {
22
+ readonly type: import('vue').PropType<import('./text').TextTag>;
23
+ readonly default: "span";
24
+ };
17
25
  readonly color: {
18
26
  readonly type: StringConstructor;
19
27
  readonly default: "";
20
28
  };
21
29
  readonly size: {
22
30
  readonly type: import('vue').PropType<import('./text').TextSize>;
23
- readonly default: "md";
31
+ readonly default: undefined;
24
32
  };
25
33
  readonly align: {
26
34
  readonly type: import('vue').PropType<import('./text').TextAlign>;
@@ -107,13 +115,21 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
107
115
  readonly type: import('vue').PropType<import('./text').TextType>;
108
116
  readonly default: "default";
109
117
  };
118
+ readonly level: {
119
+ readonly type: import('vue').PropType<import('./text').TextLevel>;
120
+ readonly default: "body";
121
+ };
122
+ readonly tag: {
123
+ readonly type: import('vue').PropType<import('./text').TextTag>;
124
+ readonly default: "span";
125
+ };
110
126
  readonly color: {
111
127
  readonly type: StringConstructor;
112
128
  readonly default: "";
113
129
  };
114
130
  readonly size: {
115
131
  readonly type: import('vue').PropType<import('./text').TextSize>;
116
- readonly default: "md";
132
+ readonly default: undefined;
117
133
  };
118
134
  readonly align: {
119
135
  readonly type: import('vue').PropType<import('./text').TextAlign>;
@@ -200,10 +216,12 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
200
216
  readonly bold: boolean;
201
217
  readonly type: import('./text').TextType;
202
218
  readonly color: string;
219
+ readonly tag: import('./text').TextTag;
203
220
  readonly dashed: boolean;
204
221
  readonly marker: boolean;
205
222
  readonly italic: boolean;
206
223
  readonly underline: boolean;
224
+ readonly level: import('./text').TextLevel;
207
225
  readonly align: import('./text').TextAlign;
208
226
  readonly boxed: boolean;
209
227
  readonly strikethrough: boolean;
@@ -219,7 +237,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
219
237
  readonly overlapOffsetY: number;
220
238
  readonly overlapColor: string;
221
239
  readonly unselectable: boolean;
222
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLSpanElement>;
240
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
223
241
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
224
242
  export default _default;
225
243
  type __VLS_WithTemplateSlots<T, S> = T & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyberpunk-vue/components",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "Cyberpunk Vue components - A futuristic Vue 3 component library",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -25,9 +25,9 @@
25
25
  "dependencies": {
26
26
  "@floating-ui/dom": "^1.7.6",
27
27
  "dayjs": "^1.11.20",
28
- "@cyberpunk-vue/hooks": "1.14.0",
29
- "@cyberpunk-vue/constants": "1.14.0",
30
- "@cyberpunk-vue/theme-chalk": "1.14.0"
28
+ "@cyberpunk-vue/constants": "1.14.1",
29
+ "@cyberpunk-vue/hooks": "1.14.1",
30
+ "@cyberpunk-vue/theme-chalk": "1.14.1"
31
31
  },
32
32
  "author": "Juxest",
33
33
  "license": "MIT",