@coffic/cosy-ui 0.9.40 → 0.9.41

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.
Files changed (30) hide show
  1. package/dist/app.css +1 -1
  2. package/dist/index-astro.ts +18 -13
  3. package/dist/src-astro/avatar/Avatar.astro +118 -0
  4. package/dist/src-astro/avatar/index.ts +2 -0
  5. package/dist/src-astro/avatar/types.ts +29 -0
  6. package/dist/src-astro/contact/Contact.astro +155 -172
  7. package/dist/src-astro/container/Container.astro +16 -0
  8. package/dist/src-astro/features/FeatureCard.astro +63 -0
  9. package/dist/src-astro/features/FeatureShowcase.astro +164 -0
  10. package/dist/src-astro/features/index.ts +3 -0
  11. package/dist/src-astro/heading/Heading.astro +56 -8
  12. package/dist/src-astro/icons/AppStoreIcon.astro +1 -1
  13. package/dist/src-astro/mac-window/MacWindow.astro +9 -4
  14. package/dist/src-astro/products/ProductShowcase.astro +159 -0
  15. package/dist/src-astro/products/ProductShowcaseItem.astro +216 -0
  16. package/dist/src-astro/products/index.ts +4 -0
  17. package/dist/src-astro/review/Review.astro +159 -0
  18. package/dist/src-astro/review/Reviews.astro +162 -0
  19. package/dist/src-astro/review/index.ts +3 -0
  20. package/dist/src-astro/review/types.ts +127 -0
  21. package/dist/src-astro/stats-display/StatsDisplay.astro +201 -0
  22. package/dist/src-astro/stats-display/index.ts +10 -0
  23. package/dist/src-astro/stats-display/types.ts +79 -0
  24. package/dist/src-astro/text/Text.astro +4 -1
  25. package/dist/src-vue/container/Container.vue +64 -62
  26. package/dist/src-vue/container/types.ts +3 -3
  27. package/dist/src-vue/heading/Heading.vue +64 -10
  28. package/dist/src-vue/heading/types.ts +9 -0
  29. package/dist/src-vue/mac-window/MacWindow.vue +164 -212
  30. package/package.json +1 -1
@@ -3,8 +3,9 @@ export * from './src-astro/alert';
3
3
  export * from './src-astro/alert-dialog';
4
4
  export * from './src-astro/api-test';
5
5
  export * from './src-astro/article';
6
- export * from './src-astro/banner';
6
+ export * from './src-astro/avatar';
7
7
  export * from './src-astro/badge';
8
+ export * from './src-astro/banner';
8
9
  export * from './src-astro/button/index_astro';
9
10
  export * from './src-astro/card';
10
11
  export * from './src-astro/card-book';
@@ -14,11 +15,11 @@ export * from './src-astro/code-container';
14
15
  export * from './src-astro/code-example';
15
16
  export * from './src-astro/code-panel';
16
17
  export * from './src-astro/confirm-dialog';
17
- export * from './src-astro/install-tabs';
18
18
  export * from './src-astro/contact';
19
19
  export * from './src-astro/container';
20
20
  export * from './src-astro/empty-state';
21
21
  export * from './src-astro/errors';
22
+ export * from './src-astro/features';
22
23
  export * from './src-astro/flex';
23
24
  export * from './src-astro/footer';
24
25
  export * from './src-astro/grid';
@@ -27,30 +28,34 @@ export * from './src-astro/heading';
27
28
  export * from './src-astro/hero';
28
29
  export * from './src-astro/icons';
29
30
  export * from './src-astro/image';
30
- export * from './src-astro/smart-icon';
31
- export * from './src-astro/social-icon';
31
+ export * from './src-astro/install-tabs';
32
32
  export * from './src-astro/language-switcher';
33
33
  export * from './src-astro/layout-app';
34
34
  export * from './src-astro/layout-basic';
35
35
  export * from './src-astro/layout-basic/BaseLayout.astro';
36
36
  export * from './src-astro/layout-dashboard';
37
- export * from './src-astro/link'; export * from './src-astro/list';
37
+ export * from './src-astro/link';
38
+ export * from './src-astro/list';
38
39
  export * from './src-astro/loading-overlay';
39
40
  export * from './src-astro/login';
40
41
  export * from './src-astro/logout';
41
- export * from './src-astro/main';
42
42
  export * from './src-astro/mac-window';
43
+ export * from './src-astro/main';
43
44
  export * from './src-astro/modal';
44
45
  export * from './src-astro/module';
45
46
  export * from './src-astro/nav-section';
47
+ export * from './src-astro/picture-book';
46
48
  export * from './src-astro/placeholder';
47
49
  export * from './src-astro/products';
48
50
  export * from './src-astro/register';
51
+ export * from './src-astro/review';
49
52
  export * from './src-astro/sidebar';
50
53
  export * from './src-astro/smart-bg';
54
+ export * from './src-astro/smart-icon';
55
+ export * from './src-astro/social-icon';
51
56
  export * from './src-astro/speak';
52
57
  export * from './src-astro/stack';
53
- export * from './src-astro/picture-book';
58
+ export * from './src-astro/stats-display';
54
59
  export * from './src-astro/team-member';
55
60
  export * from './src-astro/text';
56
61
  export * from './src-astro/theme-switcher';
@@ -70,17 +75,17 @@ export * from './src-astro/types/product';
70
75
  export * from './src-astro/types/sidebar';
71
76
  export * from './src-astro/types/static-path';
72
77
 
73
- // 工具类型
78
+ // 工具类型 (按字母顺序)
74
79
  export type { ImageProvider, ImageOptions } from './src/utils/image';
75
- export * from './src/utils/image';
76
80
  export * from './src/utils/i18n';
77
- export * from './src/utils/path';
78
- export * from './src/utils/url';
79
- export * from './src/utils/language';
81
+ export * from './src/utils/image';
80
82
  export * from './src/utils/lang_package';
81
- export * from './src/utils/logger';
83
+ export * from './src/utils/language';
82
84
  export * from './src/utils/link';
85
+ export * from './src/utils/logger';
83
86
  export * from './src/utils/mac-window-bg';
87
+ export * from './src/utils/path';
88
+ export * from './src/utils/url';
84
89
 
85
90
  // 图标组件
86
91
  export * from './src-astro/icons';
@@ -0,0 +1,118 @@
1
+ ---
2
+ /**
3
+ * @component Avatar
4
+ *
5
+ * @description
6
+ * Avatar 组件用于显示用户头像,支持真实头像和默认头像生成。
7
+ * 当没有提供头像URL或头像加载失败时,自动生成带用户首字母的彩色圆形头像。
8
+ *
9
+ * @design
10
+ * 设计理念:
11
+ * 1. 优雅降级 - 真实头像优先,失败时自动切换到默认头像
12
+ * 2. 个性化 - 根据用户名生成不同的背景颜色
13
+ * 3. 一致性 - 统一的圆形样式和尺寸
14
+ * 4. 可定制性 - 支持不同尺寸和样式
15
+ *
16
+ * @usage
17
+ * 基本用法:
18
+ * ```astro
19
+ * <Avatar userName="张先生" />
20
+ * ```
21
+ *
22
+ * 带真实头像:
23
+ * ```astro
24
+ * <Avatar userName="李女士" avatar="https://example.com/avatar.jpg" />
25
+ * ```
26
+ *
27
+ * 不同尺寸:
28
+ * ```astro
29
+ * <Avatar userName="王先生" size="lg" />
30
+ * ```
31
+ *
32
+ * 自定义样式:
33
+ * ```astro
34
+ * <Avatar userName="赵先生" class="cosy:border-2 cosy:border-primary" />
35
+ * ```
36
+ *
37
+ * @props
38
+ * @prop {string} userName - 用户名称
39
+ * @prop {string} [avatar] - 用户头像URL
40
+ * @prop {'sm'|'md'|'lg'|'xl'} [size='md'] - 头像尺寸
41
+ * @prop {string} [class] - 自定义类名
42
+ * @prop {any} [class:list] - 类名列表
43
+ */
44
+
45
+ // 导入样式
46
+ import '../../style.ts';
47
+
48
+ import type { AvatarProps } from './types';
49
+
50
+ type Props = AvatarProps;
51
+
52
+ const {
53
+ userName,
54
+ avatar,
55
+ size = 'md',
56
+ class: className = '',
57
+ 'class:list': classList,
58
+ ...rest
59
+ } = Astro.props;
60
+
61
+ // 尺寸映射
62
+ const sizeClasses = {
63
+ sm: 'cosy:w-8 cosy:h-8 cosy:text-sm',
64
+ md: 'cosy:w-12 cosy:h-12 cosy:text-lg',
65
+ lg: 'cosy:w-16 cosy:h-16 cosy:text-xl',
66
+ xl: 'cosy:w-20 cosy:h-20 cosy:text-2xl',
67
+ };
68
+
69
+ // 生成头像背景色
70
+ const getAvatarColor = (userName: string) => {
71
+ const colors = [
72
+ 'cosy:bg-primary',
73
+ 'cosy:bg-secondary',
74
+ 'cosy:bg-accent',
75
+ 'cosy:bg-info',
76
+ 'cosy:bg-success',
77
+ 'cosy:bg-warning',
78
+ 'cosy:bg-error',
79
+ ];
80
+ const index = userName.charCodeAt(0) % colors.length;
81
+ return colors[index];
82
+ };
83
+
84
+ const sizeClass = sizeClasses[size as keyof typeof sizeClasses];
85
+ ---
86
+
87
+ <div
88
+ class:list={[
89
+ 'cosy:avatar',
90
+ 'cosy:rounded-full',
91
+ 'cosy:overflow-hidden',
92
+ 'cosy:flex-shrink-0',
93
+ 'cosy:bg-base-200',
94
+ 'cosy:flex',
95
+ 'cosy:items-center',
96
+ 'cosy:justify-center',
97
+ sizeClass,
98
+ className,
99
+ classList,
100
+ ]}
101
+ {...rest}>
102
+ {
103
+ avatar ? (
104
+ <img
105
+ src={avatar}
106
+ alt={userName}
107
+ class="cosy:w-full cosy:h-full cosy:object-cover"
108
+ onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';"
109
+ />
110
+ ) : null
111
+ }
112
+ <!-- 默认头像 -->
113
+ <div
114
+ class={`cosy:w-full cosy:h-full ${getAvatarColor(userName)} cosy:text-white cosy:flex cosy:items-center cosy:justify-center cosy:font-semibold`}
115
+ style={avatar ? 'display: none;' : 'display: flex;'}>
116
+ {userName ? userName.charAt(0).toUpperCase() : '?'}
117
+ </div>
118
+ </div>
@@ -0,0 +1,2 @@
1
+ export { default as Avatar } from './Avatar.astro';
2
+ export type { AvatarProps } from './types';
@@ -0,0 +1,29 @@
1
+ import type { HTMLAttributes } from 'astro/types';
2
+
3
+ export interface AvatarProps extends HTMLAttributes<'div'> {
4
+ /**
5
+ * 用户名称
6
+ */
7
+ userName: string;
8
+
9
+ /**
10
+ * 用户头像URL
11
+ */
12
+ avatar?: string;
13
+
14
+ /**
15
+ * 头像尺寸
16
+ * @default 'md'
17
+ */
18
+ size?: 'sm' | 'md' | 'lg' | 'xl';
19
+
20
+ /**
21
+ * 自定义类名
22
+ */
23
+ class?: string;
24
+
25
+ /**
26
+ * 类名列表
27
+ */
28
+ 'class:list'?: any;
29
+ }
@@ -5,6 +5,7 @@
5
5
  * @description
6
6
  * Contact 组件用于展示企业或个人的联系信息,支持多种联系方式(邮件、电话、地址)和社交媒体链接。
7
7
  * 组件设计简洁专业,适合在企业网站的联系页面、页脚或关于我们页面中使用。
8
+ * 现在基于 Card 组件重构,提供更好的动画效果和一致性。
8
9
  *
9
10
  * @usage
10
11
  * 基本用法:
@@ -66,6 +67,7 @@
66
67
  */
67
68
 
68
69
  import '../../style.ts';
70
+ import Card from '../card/Card.astro';
69
71
  import {
70
72
  FacebookIcon,
71
73
  GithubIcon,
@@ -107,25 +109,21 @@ const {
107
109
  website,
108
110
  } = Astro.props;
109
111
 
110
- // 构建联系信息容器样式
111
- const contactClasses = [
112
- 'cosy:card',
113
- 'cosy:w-full',
114
- 'cosy:bg-base-100',
112
+ // 构建自定义样式类(用于覆盖Card组件的默认样式)
113
+ const customClasses = [
115
114
  'cosy:shadow-lg',
116
- compact ? 'cosy:card-compact' : '',
115
+ 'hover:cosy:shadow-xl',
116
+ 'hover:cosy:bg-base-200',
117
117
  className,
118
118
  ]
119
119
  .filter(Boolean)
120
120
  .join(' ');
121
121
 
122
- // 内容区域的padding
123
- const contentPadding = compact ? 'cosy:p-4' : 'cosy:p-6';
124
-
125
122
  // 联系信息项的样式
126
123
  const contactItemClass =
127
- 'cosy:flex cosy:items-center cosy:gap-3 cosy:mb-4 last:cosy:mb-0';
128
- const iconClass = 'cosy:w-5 cosy:h-5 cosy:text-primary cosy:flex-shrink-0';
124
+ 'cosy:flex cosy:items-center cosy:gap-3 cosy:mb-4 last:cosy:mb-0 cosy:transition-all cosy:duration-200 cosy:ease-in-out hover:cosy:bg-base-200/50 hover:cosy:rounded-lg hover:cosy:p-2 hover:cosy:-mx-2';
125
+ const iconClass =
126
+ 'cosy:w-5 cosy:h-5 cosy:text-primary cosy:flex-shrink-0 cosy:transition-all cosy:duration-200 hover:cosy:scale-110 hover:cosy:text-primary/80';
129
127
  const linkClass =
130
128
  'cosy:link cosy:link-hover cosy:text-base-content cosy:no-underline hover:cosy:text-primary cosy:transition-colors';
131
129
 
@@ -136,186 +134,171 @@ const socialLinkClass =
136
134
  'cosy:btn cosy:btn-ghost cosy:btn-circle cosy:btn-sm cosy:text-base-content hover:cosy:text-primary hover:cosy:bg-primary/10';
137
135
  ---
138
136
 
139
- <div class={contactClasses}>
140
- <div class={`cosy:card-body ${contentPadding}`}>
137
+ <Card
138
+ title={title}
139
+ subtitle={description}
140
+ compact={compact}
141
+ class={customClasses}>
142
+ <div class="cosy:space-y-0">
141
143
  {
142
- title && (
143
- <h2 class="cosy:card-title cosy:text-2xl cosy:font-bold cosy:mb-2">
144
- {title}
145
- </h2>
144
+ address && (
145
+ <div class={contactItemClass}>
146
+ <MapPinIcon class={iconClass} />
147
+ <span class="cosy:text-base-content">{address}</span>
148
+ </div>
146
149
  )
147
150
  }
148
151
 
149
152
  {
150
- description && (
151
- <p class="cosy:text-base-content/70 cosy:mb-6">{description}</p>
153
+ email && (
154
+ <div class={contactItemClass}>
155
+ <MailIcon class={iconClass} />
156
+ <a href={`mailto:${email}`} class={linkClass}>
157
+ {email}
158
+ </a>
159
+ </div>
152
160
  )
153
161
  }
154
162
 
155
- <div class="cosy:space-y-0">
156
- {
157
- address && (
158
- <div class={contactItemClass}>
159
- <MapPinIcon class={iconClass} />
160
- <span class="cosy:text-base-content">{address}</span>
161
- </div>
162
- )
163
- }
164
-
165
- {
166
- email && (
167
- <div class={contactItemClass}>
168
- <MailIcon class={iconClass} />
169
- <a href={`mailto:${email}`} class={linkClass}>
170
- {email}
171
- </a>
172
- </div>
173
- )
174
- }
175
-
176
- {
177
- facebook && (
178
- <div class={contactItemClass}>
179
- <FacebookIcon class={iconClass} />
180
- <a
181
- href={facebook}
182
- target="_blank"
183
- rel="noopener noreferrer"
184
- class={linkClass}>
185
- Facebook
186
- </a>
187
- </div>
188
- )
189
- }
190
-
191
- {
192
- github && (
193
- <div class={contactItemClass}>
194
- <GithubIcon class={iconClass} />
195
- <a
196
- href={github}
197
- target="_blank"
198
- rel="noopener noreferrer"
199
- class={linkClass}>
200
- GitHub
201
- </a>
202
- </div>
203
- )
204
- }
205
-
206
- {
207
- linkedin && (
208
- <div class={contactItemClass}>
209
- <LinkedinIcon class={iconClass} />
210
- <a
211
- href={linkedin}
212
- target="_blank"
213
- rel="noopener noreferrer"
214
- class={linkClass}>
215
- LinkedIn
216
- </a>
217
- </div>
218
- )
219
- }
220
-
221
- {
222
- phone && (
223
- <div class={contactItemClass}>
224
- <PhoneIcon class={iconClass} />
225
- <a href={`tel:${phone}`} class={linkClass}>
226
- {phone}
227
- </a>
228
- </div>
229
- )
230
- }
231
-
232
- {
233
- twitter && (
234
- <div class={contactItemClass}>
235
- <TwitterIcon class={iconClass} />
236
- <a
237
- href={twitter}
238
- target="_blank"
239
- rel="noopener noreferrer"
240
- class={linkClass}>
241
- Twitter
242
- </a>
243
- </div>
244
- )
245
- }
246
-
247
- {
248
- website && (
249
- <div class={contactItemClass}>
250
- <WebsiteIcon class={iconClass} />
251
- <a
252
- href={website}
253
- target="_blank"
254
- rel="noopener noreferrer"
255
- class={linkClass}>
256
- {website.replace(/^https?:\/\//, '')}
257
- </a>
258
- </div>
259
- )
260
- }
261
- </div>
163
+ {
164
+ facebook && (
165
+ <div class={contactItemClass}>
166
+ <FacebookIcon class={iconClass} />
167
+ <a
168
+ href={facebook}
169
+ target="_blank"
170
+ rel="noopener noreferrer"
171
+ class={linkClass}>
172
+ Facebook
173
+ </a>
174
+ </div>
175
+ )
176
+ }
262
177
 
263
178
  {
264
- Astro.slots.has('default') && (
265
- <div class="cosy:mt-4">
266
- <slot />
179
+ github && (
180
+ <div class={contactItemClass}>
181
+ <GithubIcon class={iconClass} />
182
+ <a
183
+ href={github}
184
+ target="_blank"
185
+ rel="noopener noreferrer"
186
+ class={linkClass}>
187
+ GitHub
188
+ </a>
267
189
  </div>
268
190
  )
269
191
  }
270
192
 
271
193
  {
272
- (github || twitter || facebook || linkedin) && (
273
- <div class={socialLinksClass}>
274
- {github && (
275
- <a
276
- href={github}
277
- target="_blank"
278
- rel="noopener noreferrer"
279
- class={socialLinkClass}
280
- title="GitHub">
281
- <GithubIcon class="cosy:w-5 cosy:h-5" />
282
- </a>
283
- )}
194
+ linkedin && (
195
+ <div class={contactItemClass}>
196
+ <LinkedinIcon class={iconClass} />
197
+ <a
198
+ href={linkedin}
199
+ target="_blank"
200
+ rel="noopener noreferrer"
201
+ class={linkClass}>
202
+ LinkedIn
203
+ </a>
204
+ </div>
205
+ )
206
+ }
284
207
 
285
- {twitter && (
286
- <a
287
- href={twitter}
288
- target="_blank"
289
- rel="noopener noreferrer"
290
- class={socialLinkClass}
291
- title="Twitter">
292
- <TwitterIcon class="cosy:w-5 cosy:h-5" />
293
- </a>
294
- )}
208
+ {
209
+ phone && (
210
+ <div class={contactItemClass}>
211
+ <PhoneIcon class={iconClass} />
212
+ <a href={`tel:${phone}`} class={linkClass}>
213
+ {phone}
214
+ </a>
215
+ </div>
216
+ )
217
+ }
295
218
 
296
- {facebook && (
297
- <a
298
- href={facebook}
299
- target="_blank"
300
- rel="noopener noreferrer"
301
- class={socialLinkClass}
302
- title="Facebook">
303
- <FacebookIcon class="cosy:w-5 cosy:h-5" />
304
- </a>
305
- )}
219
+ {
220
+ twitter && (
221
+ <div class={contactItemClass}>
222
+ <TwitterIcon class={iconClass} />
223
+ <a
224
+ href={twitter}
225
+ target="_blank"
226
+ rel="noopener noreferrer"
227
+ class={linkClass}>
228
+ Twitter
229
+ </a>
230
+ </div>
231
+ )
232
+ }
306
233
 
307
- {linkedin && (
308
- <a
309
- href={linkedin}
310
- target="_blank"
311
- rel="noopener noreferrer"
312
- class={socialLinkClass}
313
- title="LinkedIn">
314
- <LinkedinIcon class="cosy:w-5 cosy:h-5" />
315
- </a>
316
- )}
234
+ {
235
+ website && (
236
+ <div class={contactItemClass}>
237
+ <WebsiteIcon class={iconClass} />
238
+ <a
239
+ href={website}
240
+ target="_blank"
241
+ rel="noopener noreferrer"
242
+ class={linkClass}>
243
+ {website.replace(/^https?:\/\//, '')}
244
+ </a>
317
245
  </div>
318
246
  )
319
247
  }
320
248
  </div>
321
- </div>
249
+
250
+ {
251
+ Astro.slots.has('default') && (
252
+ <div class="cosy:mt-4">
253
+ <slot />
254
+ </div>
255
+ )
256
+ }
257
+
258
+ {
259
+ (github || twitter || facebook || linkedin) && (
260
+ <div class={socialLinksClass}>
261
+ {github && (
262
+ <a
263
+ href={github}
264
+ target="_blank"
265
+ rel="noopener noreferrer"
266
+ class={socialLinkClass}
267
+ aria-label="GitHub">
268
+ <GithubIcon class="cosy:w-4 cosy:h-4" />
269
+ </a>
270
+ )}
271
+ {twitter && (
272
+ <a
273
+ href={twitter}
274
+ target="_blank"
275
+ rel="noopener noreferrer"
276
+ class={socialLinkClass}
277
+ aria-label="Twitter">
278
+ <TwitterIcon class="cosy:w-4 cosy:h-4" />
279
+ </a>
280
+ )}
281
+ {facebook && (
282
+ <a
283
+ href={facebook}
284
+ target="_blank"
285
+ rel="noopener noreferrer"
286
+ class={socialLinkClass}
287
+ aria-label="Facebook">
288
+ <FacebookIcon class="cosy:w-4 cosy:h-4" />
289
+ </a>
290
+ )}
291
+ {linkedin && (
292
+ <a
293
+ href={linkedin}
294
+ target="_blank"
295
+ rel="noopener noreferrer"
296
+ class={socialLinkClass}
297
+ aria-label="LinkedIn">
298
+ <LinkedinIcon class="cosy:w-4 cosy:h-4" />
299
+ </a>
300
+ )}
301
+ </div>
302
+ )
303
+ }
304
+ </Card>
@@ -44,6 +44,13 @@
44
44
  * </Container>
45
45
  * ```
46
46
  *
47
+ * 内容居中的容器:
48
+ * ```astro
49
+ * <Container contentCentered>
50
+ * <Button>居中显示的按钮</Button>
51
+ * </Container>
52
+ * ```
53
+ *
47
54
  * 带背景色的容器:
48
55
  * ```astro
49
56
  * <Container background="primary/10">
@@ -157,6 +164,7 @@
157
164
  * @prop {boolean} [border=false] - 是否显示边框,启用后会在容器周围添加边框
158
165
  * @prop {boolean|string} [contentBorder=false] - 是否给内容比例盒加边框(仅在 fit 模式下生效)。可设置为 true(使用默认黑色边框)或具体的颜色值(如 "primary/50"、"success"、"gray-300" 等)
159
166
  * @prop {boolean} [centered=true] - 是否居中显示,设置为false时容器将靠左对齐
167
+ * @prop {boolean} [contentCentered=false] - 是否让内部内容居中显示,启用后会在容器内使用flex布局居中内容
160
168
  * @prop {string} [class] - 自定义CSS类名,用于添加额外的样式
161
169
  * @prop {string} [fit='none'] - 内容适配模式:none(默认)、contain(保持比例,尽量占满且不溢出)、cover(保持比例,铺满并可能裁剪)
162
170
  * @prop {string} [flex] - flex布局方向,可选值:row、col、row-reverse、col-reverse,不设置则不启用flex布局
@@ -213,6 +221,12 @@ interface Props extends HTMLAttributes<'div'> {
213
221
  */
214
222
  centered?: boolean;
215
223
 
224
+ /**
225
+ * 是否让内部内容居中显示
226
+ * @default false
227
+ */
228
+ contentCentered?: boolean;
229
+
216
230
  /**
217
231
  * 自定义类名
218
232
  */
@@ -299,6 +313,7 @@ const {
299
313
  padding = 'md',
300
314
  margin = 'none',
301
315
  centered = true,
316
+ contentCentered = false,
302
317
  border = false,
303
318
  fit = 'none',
304
319
  contentBorder = false,
@@ -439,6 +454,7 @@ const containerClasses = [
439
454
  ? 'cosy:overflow-hidden cosy:min-w-0 cosy:max-w-full'
440
455
  : '',
441
456
  centered ? 'cosy:mx-auto' : '',
457
+ contentCentered ? 'cosy:flex cosy:justify-center cosy:items-center' : '',
442
458
  widthClasses[width],
443
459
  paddingClasses[padding],
444
460
  marginClasses[margin],