@cyberpunk-vue/components 1.14.2 → 1.14.4

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.
@@ -12,6 +12,10 @@
12
12
  */
13
13
  export declare const CpAvatar: import('../utils').SFCWithInstall<{
14
14
  new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
15
+ readonly type: {
16
+ readonly type: import('vue').PropType<import('.').AvatarType>;
17
+ readonly default: "default";
18
+ };
15
19
  readonly src: {
16
20
  readonly type: StringConstructor;
17
21
  readonly default: "";
@@ -62,6 +66,7 @@ export declare const CpAvatar: import('../utils').SFCWithInstall<{
62
66
  readonly size: import('.').AvatarSize;
63
67
  readonly fit: "fill" | "contain" | "cover";
64
68
  readonly icon: import('..').IconValue;
69
+ readonly type: import('.').AvatarType;
65
70
  readonly shape: import('.').AvatarShape;
66
71
  readonly src: string;
67
72
  readonly alt: string;
@@ -77,6 +82,10 @@ export declare const CpAvatar: import('../utils').SFCWithInstall<{
77
82
  M: {};
78
83
  Defaults: {};
79
84
  }, Readonly<import('vue').ExtractPropTypes<{
85
+ readonly type: {
86
+ readonly type: import('vue').PropType<import('.').AvatarType>;
87
+ readonly default: "default";
88
+ };
80
89
  readonly src: {
81
90
  readonly type: StringConstructor;
82
91
  readonly default: "";
@@ -124,6 +133,7 @@ export declare const CpAvatar: import('../utils').SFCWithInstall<{
124
133
  readonly size: import('.').AvatarSize;
125
134
  readonly fit: "fill" | "contain" | "cover";
126
135
  readonly icon: import('..').IconValue;
136
+ readonly type: import('.').AvatarType;
127
137
  readonly shape: import('.').AvatarShape;
128
138
  readonly src: string;
129
139
  readonly alt: string;
@@ -136,6 +146,10 @@ export declare const CpAvatar: import('../utils').SFCWithInstall<{
136
146
  __isTeleport?: never;
137
147
  __isSuspense?: never;
138
148
  } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
149
+ readonly type: {
150
+ readonly type: import('vue').PropType<import('.').AvatarType>;
151
+ readonly default: "default";
152
+ };
139
153
  readonly src: {
140
154
  readonly type: StringConstructor;
141
155
  readonly default: "";
@@ -186,6 +200,7 @@ export declare const CpAvatar: import('../utils').SFCWithInstall<{
186
200
  readonly size: import('.').AvatarSize;
187
201
  readonly fit: "fill" | "contain" | "cover";
188
202
  readonly icon: import('..').IconValue;
203
+ readonly type: import('.').AvatarType;
189
204
  readonly shape: import('.').AvatarShape;
190
205
  readonly src: string;
191
206
  readonly alt: string;
@@ -224,6 +239,10 @@ export declare const CpAvatarGroup: import('../utils').SFCWithInstall<{
224
239
  readonly type: import('vue').PropType<import('.').AvatarSize>;
225
240
  readonly default: "md";
226
241
  };
242
+ readonly type: {
243
+ readonly type: import('vue').PropType<import('.').AvatarType>;
244
+ readonly default: undefined;
245
+ };
227
246
  readonly shape: {
228
247
  readonly type: import('vue').PropType<import('.').AvatarShape>;
229
248
  readonly default: "circle";
@@ -255,6 +274,7 @@ export declare const CpAvatarGroup: import('../utils').SFCWithInstall<{
255
274
  }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
256
275
  readonly size: import('.').AvatarSize;
257
276
  readonly total: number;
277
+ readonly type: import('.').AvatarType;
258
278
  readonly shape: import('.').AvatarShape;
259
279
  readonly max: number;
260
280
  readonly spacing: string | number;
@@ -283,6 +303,10 @@ export declare const CpAvatarGroup: import('../utils').SFCWithInstall<{
283
303
  readonly type: import('vue').PropType<import('.').AvatarSize>;
284
304
  readonly default: "md";
285
305
  };
306
+ readonly type: {
307
+ readonly type: import('vue').PropType<import('.').AvatarType>;
308
+ readonly default: undefined;
309
+ };
286
310
  readonly shape: {
287
311
  readonly type: import('vue').PropType<import('.').AvatarShape>;
288
312
  readonly default: "circle";
@@ -314,6 +338,7 @@ export declare const CpAvatarGroup: import('../utils').SFCWithInstall<{
314
338
  }>> & Readonly<{}>, {}, {}, {}, {}, {
315
339
  readonly size: import('.').AvatarSize;
316
340
  readonly total: number;
341
+ readonly type: import('.').AvatarType;
317
342
  readonly shape: import('.').AvatarShape;
318
343
  readonly max: number;
319
344
  readonly spacing: string | number;
@@ -339,6 +364,10 @@ export declare const CpAvatarGroup: import('../utils').SFCWithInstall<{
339
364
  readonly type: import('vue').PropType<import('.').AvatarSize>;
340
365
  readonly default: "md";
341
366
  };
367
+ readonly type: {
368
+ readonly type: import('vue').PropType<import('.').AvatarType>;
369
+ readonly default: undefined;
370
+ };
342
371
  readonly shape: {
343
372
  readonly type: import('vue').PropType<import('.').AvatarShape>;
344
373
  readonly default: "circle";
@@ -370,6 +399,7 @@ export declare const CpAvatarGroup: import('../utils').SFCWithInstall<{
370
399
  }>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
371
400
  readonly size: import('.').AvatarSize;
372
401
  readonly total: number;
402
+ readonly type: import('.').AvatarType;
373
403
  readonly shape: import('.').AvatarShape;
374
404
  readonly max: number;
375
405
  readonly spacing: string | number;
@@ -1,5 +1,5 @@
1
1
  import { ExtractPropTypes, PropType, CSSProperties } from 'vue';
2
- import { AvatarSize, AvatarShape } from './avatar';
2
+ import { AvatarSize, AvatarShape, AvatarType } from './avatar';
3
3
  /**
4
4
  * CpAvatarGroup 组件 Props 定义
5
5
  *
@@ -51,6 +51,15 @@ export declare const avatarGroupProps: {
51
51
  readonly type: PropType<AvatarSize>;
52
52
  readonly default: "md";
53
53
  };
54
+ /**
55
+ * 统一颜色类型
56
+ * 会通过 provide 注入到子 Avatar;未配置时子 Avatar 使用自身默认值
57
+ * @default undefined
58
+ */
59
+ readonly type: {
60
+ readonly type: PropType<AvatarType>;
61
+ readonly default: undefined;
62
+ };
54
63
  /**
55
64
  * 统一形状
56
65
  * 会通过 provide 注入到子 Avatar
@@ -118,6 +127,7 @@ export type AvatarGroupProps = ExtractPropTypes<typeof avatarGroupProps>;
118
127
  export interface AvatarGroupContext {
119
128
  size: AvatarSize;
120
129
  shape: AvatarShape;
130
+ type?: AvatarType;
121
131
  }
122
132
  /**
123
133
  * AvatarGroup 注入 key
@@ -22,6 +22,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
22
22
  readonly type: import('vue').PropType<import('./avatar').AvatarSize>;
23
23
  readonly default: "md";
24
24
  };
25
+ readonly type: {
26
+ readonly type: import('vue').PropType<import('./avatar').AvatarType>;
27
+ readonly default: undefined;
28
+ };
25
29
  readonly shape: {
26
30
  readonly type: import('vue').PropType<import('./avatar').AvatarShape>;
27
31
  readonly default: "circle";
@@ -63,6 +67,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
63
67
  readonly type: import('vue').PropType<import('./avatar').AvatarSize>;
64
68
  readonly default: "md";
65
69
  };
70
+ readonly type: {
71
+ readonly type: import('vue').PropType<import('./avatar').AvatarType>;
72
+ readonly default: undefined;
73
+ };
66
74
  readonly shape: {
67
75
  readonly type: import('vue').PropType<import('./avatar').AvatarShape>;
68
76
  readonly default: "circle";
@@ -94,6 +102,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
94
102
  }>> & Readonly<{}>, {
95
103
  readonly size: import('./avatar').AvatarSize;
96
104
  readonly total: number;
105
+ readonly type: import('./avatar').AvatarType;
97
106
  readonly shape: import('./avatar').AvatarShape;
98
107
  readonly max: number;
99
108
  readonly spacing: string | number;
@@ -13,11 +13,29 @@ import { Size } from '@cyberpunk-vue/hooks';
13
13
  export type AvatarSize = Size | 'xs' | 'xl';
14
14
  /**
15
15
  * 头像形状模式
16
- * - `circle` - 圆形(默认)
17
- * - `square` - 圆角方形
16
+ * - `circle` / `round` - 圆形(默认)
17
+ * - `square` / `no-clip` - 圆角方形
18
18
  * - `clip` - 机甲切角
19
19
  */
20
- export type AvatarShape = 'circle' | 'square' | 'clip';
20
+ export type AvatarShape = 'circle' | 'square' | 'clip' | 'round' | 'no-clip';
21
+ /**
22
+ * 头像解析后的形状类名
23
+ */
24
+ export type AvatarResolvedShape = 'circle' | 'square' | 'clip';
25
+ /**
26
+ * 头像颜色类型
27
+ * - `default` - 默认中性色
28
+ * - `primary` - 主色调
29
+ * - `success` - 成功
30
+ * - `warning` - 警告
31
+ * - `error` - 错误/危险
32
+ * - `info` - 信息
33
+ */
34
+ export type AvatarType = 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
35
+ /**
36
+ * 将组件库通用 shape 映射到 Avatar 内部形状
37
+ */
38
+ export declare const normalizeAvatarShape: (shape: AvatarShape | undefined) => AvatarResolvedShape;
21
39
  /**
22
40
  * CpAvatar 组件 Props 定义
23
41
  *
@@ -41,6 +59,14 @@ export type AvatarShape = 'circle' | 'square' | 'clip';
41
59
  * @displayName CpAvatar 头像
42
60
  */
43
61
  export declare const avatarProps: {
62
+ /**
63
+ * 头像颜色类型
64
+ * @default 'default'
65
+ */
66
+ readonly type: {
67
+ readonly type: PropType<AvatarType>;
68
+ readonly default: "default";
69
+ };
44
70
  /**
45
71
  * 头像图片地址
46
72
  * @default ''
@@ -69,8 +95,8 @@ export declare const avatarProps: {
69
95
  };
70
96
  /**
71
97
  * 头像形状
72
- * - `circle`: 圆形(默认)
73
- * - `square`: 圆角方形
98
+ * - `circle` / `round`: 圆形(默认)
99
+ * - `square` / `no-clip`: 圆角方形
74
100
  * - `clip`: 机甲切角
75
101
  * @default 'circle'
76
102
  */
@@ -8,6 +8,10 @@ declare function __VLS_template(): {
8
8
  };
9
9
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
10
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
11
+ readonly type: {
12
+ readonly type: import('vue').PropType<import('./avatar').AvatarType>;
13
+ readonly default: "default";
14
+ };
11
15
  readonly src: {
12
16
  readonly type: StringConstructor;
13
17
  readonly default: "";
@@ -57,6 +61,10 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
57
61
  error: (event: Event) => void;
58
62
  load: (event: Event) => void;
59
63
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
64
+ readonly type: {
65
+ readonly type: import('vue').PropType<import('./avatar').AvatarType>;
66
+ readonly default: "default";
67
+ };
60
68
  readonly src: {
61
69
  readonly type: StringConstructor;
62
70
  readonly default: "";
@@ -109,6 +117,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
109
117
  readonly size: import('./avatar').AvatarSize;
110
118
  readonly fit: "fill" | "contain" | "cover";
111
119
  readonly icon: import('../../icon').IconValue;
120
+ readonly type: import('./avatar').AvatarType;
112
121
  readonly shape: import('./avatar').AvatarShape;
113
122
  readonly src: string;
114
123
  readonly alt: string;