@coffic/cosy-ui 0.6.30 → 0.6.34

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 (142) hide show
  1. package/dist/alert/AlertBasicContainer.astro +11 -0
  2. package/dist/alert/AlertCustomStyleContainer.astro +11 -0
  3. package/dist/alert/AlertError.astro +6 -0
  4. package/dist/alert/AlertInfo.astro +6 -0
  5. package/dist/alert/AlertSuccess.astro +6 -0
  6. package/dist/alert/AlertTypesContainer.astro +43 -0
  7. package/dist/alert/AlertWarning.astro +6 -0
  8. package/dist/alert/AlertWithTitleContainer.astro +11 -0
  9. package/dist/alert/index.ts +14 -18
  10. package/dist/app.css +1 -1
  11. package/dist/assets/iconData.ts +4 -1
  12. package/dist/{components/display → banner}/Banner.astro +32 -11
  13. package/dist/banner/BannerAllAnimations.astro +10 -0
  14. package/dist/banner/BannerBasic.astro +5 -0
  15. package/dist/banner/BannerCustomStyle.astro +7 -0
  16. package/dist/banner/BannerDanger.astro +5 -0
  17. package/dist/banner/BannerFadeIn.astro +5 -0
  18. package/dist/banner/BannerInfo.astro +5 -0
  19. package/dist/banner/BannerPrimary.astro +5 -0
  20. package/dist/banner/BannerSecondary.astro +5 -0
  21. package/dist/banner/BannerSlideUp.astro +5 -0
  22. package/dist/banner/BannerSuccess.astro +5 -0
  23. package/dist/banner/BannerWarning.astro +5 -0
  24. package/dist/banner/index.ts +41 -0
  25. package/dist/{components/data-display → blog}/Blog.astro +2 -2
  26. package/dist/blog/index.ts +1 -0
  27. package/dist/button/Button.astro +44 -13
  28. package/dist/button/Button.vue +105 -0
  29. package/dist/button/ButtonBasic.vue +11 -0
  30. package/dist/button/ButtonBasicContainer.astro +17 -0
  31. package/dist/button/ButtonBlock.astro +5 -0
  32. package/dist/button/ButtonError.astro +5 -0
  33. package/dist/{vue/Buttons/FeatureButton.vue → button/ButtonFeature.vue} +23 -23
  34. package/dist/{vue/Buttons/FeatureBasic.vue → button/ButtonFeatureBasic.vue} +2 -2
  35. package/dist/button/ButtonFeatureContainer.astro +18 -0
  36. package/dist/{vue/Buttons/FeatureWithTips.vue → button/ButtonFeatureWithTips.vue} +1 -2
  37. package/dist/button/ButtonGhost.astro +5 -0
  38. package/dist/button/ButtonIconBoth.astro +9 -0
  39. package/dist/button/ButtonIconLeft.astro +8 -0
  40. package/dist/button/ButtonIconRight.astro +8 -0
  41. package/dist/button/ButtonInfo.astro +5 -0
  42. package/dist/button/ButtonLink.astro +5 -0
  43. package/dist/button/ButtonLink.vue +13 -0
  44. package/dist/button/ButtonLinkContainer.astro +25 -0
  45. package/dist/button/ButtonLinkExternal.astro +8 -0
  46. package/dist/button/ButtonNeutral.astro +5 -0
  47. package/dist/button/ButtonOutline.astro +5 -0
  48. package/dist/button/ButtonShapeCircle.astro +5 -0
  49. package/dist/button/ButtonShapeDefault.astro +5 -0
  50. package/dist/button/ButtonShapeSquare.astro +5 -0
  51. package/dist/button/ButtonShapesContainer.astro +25 -0
  52. package/dist/button/ButtonSizes.astro +1 -1
  53. package/dist/button/ButtonSizes.vue +12 -0
  54. package/dist/button/ButtonSizesContainer.astro +17 -0
  55. package/dist/button/ButtonStatesContainer.astro +11 -0
  56. package/dist/button/ButtonSuccess.astro +5 -0
  57. package/dist/button/ButtonVariants.astro +14 -0
  58. package/dist/button/ButtonVariants.vue +16 -0
  59. package/dist/button/ButtonVariantsContainer.astro +71 -0
  60. package/dist/button/ButtonWarning.astro +5 -0
  61. package/dist/button/ButtonWide.astro +5 -0
  62. package/dist/button/ButtonWidth.astro +8 -0
  63. package/dist/button/ButtonWidthContainer.astro +19 -0
  64. package/dist/button/ButtonWithIcons.vue +21 -0
  65. package/dist/button/ButtonWithIconsContainer.astro +36 -0
  66. package/dist/button/index_astro.ts +64 -0
  67. package/dist/button/index_vue.ts +4 -0
  68. package/dist/card/Card.astro +91 -0
  69. package/dist/card/CardBasic.astro +5 -0
  70. package/dist/card/CardCompact.astro +77 -0
  71. package/dist/card/CardLink.astro +75 -0
  72. package/dist/card/CardWithImage.astro +39 -0
  73. package/dist/card/index.ts +7 -0
  74. package/dist/{components/display → code-block}/CodeBlock.astro +1 -1
  75. package/dist/code-block/index.ts +1 -0
  76. package/dist/code-container/CodeContainer.astro +254 -0
  77. package/dist/code-container/CodeContainerBasic.astro +19 -0
  78. package/dist/code-container/CodeContainerMultiple.astro +49 -0
  79. package/dist/code-container/index.ts +14 -0
  80. package/dist/{components/display → code-example}/CodeExample.astro +10 -11
  81. package/dist/code-example/index.ts +1 -0
  82. package/dist/{components/containers → container}/Container.astro +1 -1
  83. package/dist/container/index.ts +1 -0
  84. package/dist/env.d.ts +0 -6
  85. package/dist/footer/Footer.astro +2 -6
  86. package/dist/header/Header.astro +6 -1
  87. package/dist/{components/display → hero}/Hero.astro +2 -2
  88. package/dist/hero/HeroAlignCenter.astro +13 -0
  89. package/dist/hero/HeroAlignContainer.astro +23 -0
  90. package/dist/hero/HeroAlignLeft.astro +13 -0
  91. package/dist/hero/HeroAlignRight.astro +13 -0
  92. package/dist/hero/HeroBackgroundContainer.astro +18 -0
  93. package/dist/hero/HeroBackgroundImage.astro +12 -0
  94. package/dist/hero/HeroBackgroundImageContainer.astro +11 -0
  95. package/dist/hero/HeroBasic.astro +12 -0
  96. package/dist/hero/HeroBasicContainer.astro +11 -0
  97. package/dist/hero/HeroGradientBackground.astro +10 -0
  98. package/dist/hero/HeroPlainBackground.astro +10 -0
  99. package/dist/hero/HeroWithButton.astro +11 -0
  100. package/dist/hero/HeroWithButtonContainer.astro +11 -0
  101. package/dist/hero/HeroWithImage.astro +16 -0
  102. package/dist/hero/HeroWithImageContainer.astro +11 -0
  103. package/dist/hero/index.ts +39 -0
  104. package/dist/index.ts +1 -1
  105. package/dist/index_astro.ts +16 -27
  106. package/dist/index_vue.ts +1 -4
  107. package/dist/language-switcher/LanguageSwitcher.astro +1 -2
  108. package/dist/{components/containers → main}/Main.astro +2 -3
  109. package/dist/main/index.ts +1 -0
  110. package/dist/{components/display → modal}/Modal.astro +2 -2
  111. package/dist/modal/index.ts +1 -0
  112. package/dist/{components/data-display → products}/ProductCard.astro +3 -3
  113. package/dist/{components/data-display → products}/Products.astro +2 -2
  114. package/dist/products/index.ts +2 -0
  115. package/dist/{components/containers → section}/Section.astro +2 -2
  116. package/dist/section/index.ts +1 -0
  117. package/dist/sidebar/Sidebar.astro +1 -2
  118. package/dist/{components/data-display → team-member}/TeamMember.astro +4 -4
  119. package/dist/team-member/TeamMemberBasic.astro +25 -0
  120. package/dist/team-member/TeamMemberCustomStyle.astro +26 -0
  121. package/dist/team-member/TeamMemberGroup.astro +60 -0
  122. package/dist/team-member/TeamMemberWithSocial.astro +30 -0
  123. package/dist/{components/data-display → team-member}/TeamMembers.astro +2 -2
  124. package/dist/team-member/index.ts +23 -0
  125. package/dist/{theme-item → theme-switcher}/ThemeItem.astro +2 -2
  126. package/dist/theme-switcher/ThemeSwitcher.astro +10 -20
  127. package/dist/types/header.ts +32 -9
  128. package/package.json +5 -1
  129. package/dist/alert/AlertTypes.astro +0 -17
  130. package/dist/button/index.ts +0 -23
  131. package/dist/components/display/Card.astro +0 -162
  132. package/dist/theme-item/ThemeItemBasic.astro +0 -10
  133. package/dist/theme-item/index.ts +0 -11
  134. package/dist/vue/Buttons/LinkBasic.vue +0 -8
  135. package/dist/vue/Buttons/LinkButton.vue +0 -65
  136. package/dist/vue/Buttons/Multiple.vue +0 -11
  137. package/dist/vue/Buttons/index.ts +0 -37
  138. package/dist/vue/SmartHero/Basic.vue +0 -14
  139. package/dist/vue/SmartHero/SmartHero.vue +0 -132
  140. package/dist/vue/SmartHero/WithCustomContent.vue +0 -36
  141. package/dist/vue/SmartHero/WithImage.vue +0 -19
  142. package/dist/vue/SmartHero/index.ts +0 -24
@@ -0,0 +1,11 @@
1
+ ---
2
+ import { CodeContainer } from '../index';
3
+ import HeroBasic from './HeroBasic.astro';
4
+ import HeroBasicSourceCode from './HeroBasic.astro?raw';
5
+ ---
6
+
7
+ <CodeContainer codes={[HeroBasicSourceCode]}>
8
+ <div id="tab-1">
9
+ <HeroBasic />
10
+ </div>
11
+ </CodeContainer>
@@ -0,0 +1,10 @@
1
+ ---
2
+ import Hero from './Hero.astro';
3
+ ---
4
+
5
+ <Hero
6
+ title="渐变色背景"
7
+ description="这个例子使用了渐变色背景样式。"
8
+ background="gradient"
9
+ links={[{ text: '了解更多', href: '/about' }]}
10
+ />
@@ -0,0 +1,10 @@
1
+ ---
2
+ import Hero from './Hero.astro';
3
+ ---
4
+
5
+ <Hero
6
+ title="纯色背景"
7
+ description="这个例子使用了纯色背景样式。"
8
+ background="plain"
9
+ links={[{ text: '了解更多', href: '/about' }]}
10
+ />
@@ -0,0 +1,11 @@
1
+ ---
2
+ import Hero from './Hero.astro';
3
+ import Button from '../button/Button.astro';
4
+ ---
5
+
6
+ <Hero title="带自定义按钮的Hero" description="这是一个带有自定义按钮的Hero组件示例。" links={[]}>
7
+ <div slot="actions" class="cosy:flex cosy:gap-4">
8
+ <Button variant="primary">主要操作</Button>
9
+ <Button variant="secondary">次要操作</Button>
10
+ </div>
11
+ </Hero>
@@ -0,0 +1,11 @@
1
+ ---
2
+ import { CodeContainer } from '../index';
3
+ import HeroWithButton from './HeroWithButton.astro';
4
+ import HeroWithButtonSourceCode from './HeroWithButton.astro?raw';
5
+ ---
6
+
7
+ <CodeContainer codes={[HeroWithButtonSourceCode]}>
8
+ <div id="tab-1">
9
+ <HeroWithButton />
10
+ </div>
11
+ </CodeContainer>
@@ -0,0 +1,16 @@
1
+ ---
2
+ import Hero from './Hero.astro';
3
+ import { getExampleImage } from '../index_utils';
4
+
5
+ const image = {
6
+ src: getExampleImage({ width: 400, height: 300, provider: 'picsum' }),
7
+ alt: '示例图片',
8
+ };
9
+ ---
10
+
11
+ <Hero
12
+ title="带图片的Hero"
13
+ description="这是一个带有图片的Hero组件示例。"
14
+ image={image}
15
+ links={[{ text: '查看详情', href: '#' }]}
16
+ />
@@ -0,0 +1,11 @@
1
+ ---
2
+ import { CodeContainer } from '../index';
3
+ import HeroWithImage from './HeroWithImage.astro';
4
+ import HeroWithImageSourceCode from './HeroWithImage.astro?raw';
5
+ ---
6
+
7
+ <CodeContainer codes={[HeroWithImageSourceCode]}>
8
+ <div id="tab-1">
9
+ <HeroWithImage />
10
+ </div>
11
+ </CodeContainer>
@@ -0,0 +1,39 @@
1
+ import Hero from './Hero.astro';
2
+ import HeroBasic from './HeroBasic.astro';
3
+ import HeroAlignCenter from './HeroAlignCenter.astro';
4
+ import HeroAlignLeft from './HeroAlignLeft.astro';
5
+ import HeroAlignRight from './HeroAlignRight.astro';
6
+ import HeroWithImage from './HeroWithImage.astro';
7
+ import HeroWithButton from './HeroWithButton.astro';
8
+ import HeroPlainBackground from './HeroPlainBackground.astro';
9
+ import HeroGradientBackground from './HeroGradientBackground.astro';
10
+ import HeroBackgroundImage from './HeroBackgroundImage.astro';
11
+ import HeroBasicContainer from './HeroBasicContainer.astro';
12
+ import HeroAlignContainer from './HeroAlignContainer.astro';
13
+ import HeroWithImageContainer from './HeroWithImageContainer.astro';
14
+ import HeroWithButtonContainer from './HeroWithButtonContainer.astro';
15
+ import HeroBackgroundContainer from './HeroBackgroundContainer.astro';
16
+ import HeroBackgroundImageContainer from './HeroBackgroundImageContainer.astro';
17
+
18
+ export { Hero };
19
+
20
+ export const HeroPackage = {
21
+ Hero,
22
+ HeroBasic,
23
+ HeroAlignCenter,
24
+ HeroAlignLeft,
25
+ HeroAlignRight,
26
+ HeroWithImage,
27
+ HeroWithButton,
28
+ HeroPlainBackground,
29
+ HeroGradientBackground,
30
+ HeroBackgroundImage,
31
+ HeroContainers: {
32
+ Basic: HeroBasicContainer,
33
+ Align: HeroAlignContainer,
34
+ WithImage: HeroWithImageContainer,
35
+ WithButton: HeroWithButtonContainer,
36
+ Background: HeroBackgroundContainer,
37
+ BackgroundImage: HeroBackgroundImageContainer
38
+ }
39
+ };
package/dist/index.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export * from './index_astro';
2
2
  export * from './index_utils';
3
- export * from './index_icons';
3
+ export * from './index_icons';
@@ -1,8 +1,11 @@
1
- export * from './button';
1
+ export * from './button/index_astro';
2
+ export * from './banner';
3
+ export * from './blog';
4
+ export * from './card';
5
+ export * from './code-container';
2
6
  export * from './article';
3
7
  export * from './link';
4
8
  export * from './image';
5
- export * from './theme-item';
6
9
  export * from './alert';
7
10
  export * from './footer';
8
11
  export * from './layout-app';
@@ -23,29 +26,19 @@ export * from './heading';
23
26
  export * from './stack';
24
27
  export * from './text';
25
28
  export * from './nav-section';
26
- export { default as CodeBlock } from './components/display/CodeBlock.astro';
27
- export { default as Modal } from './components/display/Modal.astro';
28
- export { default as Hero } from './components/display/Hero.astro';
29
- export { default as Banner } from './components/display/Banner.astro';
30
- export { default as Card } from './components/display/Card.astro';
31
- export { default as CodeExample } from './components/display/CodeExample.astro';
32
- export { default as TeamMembers } from './components/data-display/TeamMembers.astro';
33
- export { default as TeamMember } from './components/data-display/TeamMember.astro';
34
- export { default as ProductCard } from './components/data-display/ProductCard.astro';
35
- export { default as Products } from './components/data-display/Products.astro';
36
- export { default as Blog } from './components/data-display/Blog.astro';
29
+ export * from './team-member';
30
+ export * from './code-block';
31
+ export * from './modal';
32
+ export * from './hero';
33
+ export * from './code-example';
34
+ export * from './products';
35
+ export * from './blog';
37
36
  export * from './layout-basic/BaseLayout.astro';
38
- export { default as DashboardLayout } from './layout-dashboard/DashboardLayout.astro';
39
-
40
- // Icons
37
+ export * from './layout-dashboard';
41
38
  export * from './index_icons';
42
-
43
- // Containers
44
- export { default as Container } from './components/containers/Container.astro';
45
- export { default as Main } from './components/containers/Main.astro';
46
- export { default as Section } from './components/containers/Section.astro';
47
-
48
- // Types
39
+ export * from './container';
40
+ export * from './main';
41
+ export * from './section';
49
42
  export * from './types/sidebar';
50
43
  export * from './types/main';
51
44
  export * from './types/article';
@@ -58,8 +51,6 @@ export * from './types/product';
58
51
  export * from './types/footer';
59
52
  export * from './types/static-path';
60
53
  export type { ImageProvider, ImageOptions } from './utils/image';
61
-
62
- // Entities
63
54
  export * from './entities/BaseDoc';
64
55
  export * from './entities/BlogDoc';
65
56
  export * from './entities/CourseDoc';
@@ -68,8 +59,6 @@ export * from './entities/LessonDoc';
68
59
  export * from './entities/MetaDoc';
69
60
  export * from './entities/SidebarItem';
70
61
  export * from './entities/Tag';
71
-
72
- // Database
73
62
  export * from './database/BaseDB';
74
63
  export * from './database/BlogDB';
75
64
  export * from './database/CourseDB';
package/dist/index_vue.ts CHANGED
@@ -10,15 +10,12 @@ export * from './vue/BlogList';
10
10
  // Counter
11
11
  export { default as VueCounter } from './vue/VueCounter.vue';
12
12
 
13
- // SmartHero
14
- export { SmartHero, SmartHeroExamples, SmartHeroExampleCodes } from './vue/SmartHero';
15
-
16
13
  // ConfirmDialog
17
14
  export { default as ConfirmDialog } from './vue/ConfirmDialog/ConfirmDialog.vue';
18
15
  export { ConfirmDialogExamples, ConfirmDialogExampleCodes } from './vue/ConfirmDialog';
19
16
 
20
17
  // Buttons
21
- export * from './vue/Buttons';
18
+ export * from './button/index_vue';
22
19
 
23
20
  export { default as FeatureCard } from './vue/BannerBox/FeatureCard.vue';
24
21
 
@@ -27,9 +27,8 @@
27
27
  * ```
28
28
  */
29
29
 
30
- import { ChevronDownIcon } from '../index';
30
+ import { ChevronDownIcon, LanguageUtil } from '../index';
31
31
  import '../style.ts';
32
- import { LanguageUtil } from '../utils/language.ts';
33
32
 
34
33
  interface Props {
35
34
  languages: string[];
@@ -47,9 +47,8 @@
47
47
  * </Main>
48
48
  * ```
49
49
  */
50
- import '../../style.ts';
51
- import type { IMainContentProps } from '../../index';
52
- import { Article, TableOfContents } from '../../index';
50
+ import '../style.ts';
51
+ import { Article, TableOfContents, type IMainContentProps } from '../index';
53
52
 
54
53
  export interface Props extends IMainContentProps {}
55
54
 
@@ -0,0 +1 @@
1
+ export { default as Main } from './Main.astro';
@@ -44,8 +44,8 @@
44
44
  * ```
45
45
  */
46
46
 
47
- import '../../style.ts';
48
- import { Button } from '../../index';
47
+ import '../style.ts';
48
+ import { Button } from '../index';
49
49
 
50
50
  interface Props {
51
51
  /**
@@ -0,0 +1 @@
1
+ export { default as Modal } from './Modal.astro';
@@ -66,9 +66,9 @@
66
66
  * ```
67
67
  */
68
68
 
69
- import { SocialIcon, Image, Link } from '../../index';
70
- import '../../style.ts';
71
- import type { ImageSource } from '../../types/image';
69
+ import { SocialIcon, Image, Link } from '../index';
70
+ import '../style.ts';
71
+ import type { ImageSource } from '../types/image';
72
72
 
73
73
  // 自定义图片元数据接口,替代 astro 的 ImageMetadata
74
74
  interface CustomImageMetadata {
@@ -62,8 +62,8 @@
62
62
  * ```
63
63
  */
64
64
 
65
- import { ProductCard } from '../../index';
66
- import '../../style.ts';
65
+ import { ProductCard } from '../index';
66
+ import '../style.ts';
67
67
  import type { Props as ProductCardProps } from './ProductCard.astro';
68
68
 
69
69
  // 定义产品项类型
@@ -0,0 +1,2 @@
1
+ export { default as Products } from './Products.astro';
2
+ export { default as ProductCard } from './ProductCard.astro';
@@ -19,8 +19,8 @@
19
19
  */
20
20
 
21
21
  import type { HTMLAttributes } from 'astro/types';
22
- import Container from './Container.astro';
23
- import '../../style.ts';
22
+ import Container from '../container/Container.astro';
23
+ import '../style.ts';
24
24
 
25
25
  interface Props extends HTMLAttributes<'section'> {
26
26
  /**
@@ -0,0 +1 @@
1
+ export { default as Section } from './Section.astro';
@@ -23,8 +23,7 @@
23
23
 
24
24
  import '../style.ts';
25
25
  import { isPathMatch } from '../utils/path';
26
- import Modal from '../components/display/Modal.astro';
27
- import { MenuIcon, SidebarNav } from '../index';
26
+ import { MenuIcon, SidebarNav, Modal } from '../index';
28
27
  import type { ISidebarProps } from '../index';
29
28
 
30
29
  export interface Props extends ISidebarProps {}
@@ -40,9 +40,9 @@
40
40
  * ```
41
41
  */
42
42
 
43
- import { SocialIcon, Image, Link } from '../../index';
44
- import '../../style.ts';
45
- import type { ImageSource } from '../../types/image';
43
+ import '../style.ts';
44
+ import { SocialIcon, Image, Link } from '../index';
45
+ import type { ImageSource } from '../types/image';
46
46
 
47
47
  interface SocialLink {
48
48
  /**
@@ -110,7 +110,7 @@ const { name, role, avatar, bio, socialLinks, class: className = '' } = Astro.pr
110
110
  class="cosy:object-cover cosy:aspect-square"
111
111
  />
112
112
  </figure>
113
- <div class="cosy:px-6 cosy:py-4 cosy:card-body">
113
+ <div class="cosy:px-6 cosy:py-4 cosy:card-body cosy:flex cosy:flex-col cosy:items-center">
114
114
  <h2 class="cosy:mb-1 cosy:font-semibold cosy:text-xl cosy:card-title">{name}</h2>
115
115
  <p class="cosy:mb-3 cosy:text-sm cosy:text-base-content/70">{role}</p>
116
116
  <p class="cosy:mb-4 cosy:text-base">{bio}</p>
@@ -0,0 +1,25 @@
1
+ ---
2
+ /**
3
+ * @component TeamMember.Basic
4
+ *
5
+ * @description
6
+ * 基础的团队成员展示组件示例,展示最简单的成员信息展示方式。
7
+ */
8
+ import '../style.ts';
9
+ import TeamMember from './TeamMember.astro';
10
+ import { getExampleImage } from '../utils/image';
11
+
12
+ const avatar = getExampleImage({
13
+ width: 200,
14
+ height: 200,
15
+ provider: 'robohash',
16
+ randomSeed: 'member1',
17
+ });
18
+ ---
19
+
20
+ <TeamMember
21
+ name="张三"
22
+ role="产品设计师"
23
+ avatar={avatar}
24
+ bio="专注于用户体验设计,拥有5年产品设计经验"
25
+ />
@@ -0,0 +1,26 @@
1
+ ---
2
+ /**
3
+ * @component TeamMember.CustomStyle
4
+ *
5
+ * @description
6
+ * 自定义样式的团队成员展示组件示例,展示如何使用class属性自定义样式。
7
+ */
8
+ import '../style.ts';
9
+ import TeamMember from './TeamMember.astro';
10
+ import { getExampleImage } from '../utils/image';
11
+
12
+ const avatar = getExampleImage({
13
+ width: 200,
14
+ height: 200,
15
+ provider: 'robohash',
16
+ randomSeed: 'member3',
17
+ });
18
+ ---
19
+
20
+ <TeamMember
21
+ name="王五"
22
+ role="市场总监"
23
+ avatar={avatar}
24
+ bio="负责产品市场策略和品牌推广,拥有丰富的市场营销经验"
25
+ class="cosy:bg-gradient-to-r cosy:from-purple-100 cosy:to-pink-100 cosy:shadow-lg cosy:w-72"
26
+ />
@@ -0,0 +1,60 @@
1
+ ---
2
+ /**
3
+ * @component TeamMember.Group
4
+ *
5
+ * @description
6
+ * 团队成员组展示组件示例,展示如何组合多个团队成员。
7
+ */
8
+ import '../style.ts';
9
+ import TeamMember from './TeamMember.astro';
10
+ import { getExampleImage } from '../utils/image';
11
+
12
+ const members = [
13
+ {
14
+ name: '张三',
15
+ title: '产品设计师',
16
+ avatar: getExampleImage({
17
+ width: 200,
18
+ height: 200,
19
+ provider: 'robohash',
20
+ randomSeed: 'member1',
21
+ }),
22
+ description: '专注于用户体验设计,拥有5年产品设计经验',
23
+ },
24
+ {
25
+ name: '李四',
26
+ title: '高级开发工程师',
27
+ avatar: getExampleImage({
28
+ width: 200,
29
+ height: 200,
30
+ provider: 'robohash',
31
+ randomSeed: 'member2',
32
+ }),
33
+ description: '全栈开发专家,热爱开源项目,专注于前端框架和性能优化',
34
+ },
35
+ {
36
+ name: '王五',
37
+ title: '市场总监',
38
+ avatar: getExampleImage({
39
+ width: 200,
40
+ height: 200,
41
+ provider: 'robohash',
42
+ randomSeed: 'member3',
43
+ }),
44
+ description: '负责产品市场策略和品牌推广,拥有丰富的市场营销经验',
45
+ },
46
+ ];
47
+ ---
48
+
49
+ <div class="cosy:grid cosy:grid-cols-3 md:cosy:grid-cols-3 cosy:gap-8">
50
+ {
51
+ members.map((member) => (
52
+ <TeamMember
53
+ name={member.name}
54
+ role={member.title}
55
+ avatar={member.avatar}
56
+ bio={member.description}
57
+ />
58
+ ))
59
+ }
60
+ </div>
@@ -0,0 +1,30 @@
1
+ ---
2
+ /**
3
+ * @component TeamMember.WithSocial
4
+ *
5
+ * @description
6
+ * 带社交媒体链接的团队成员展示组件示例,展示如何添加社交媒体链接。
7
+ */
8
+ import '../style.ts';
9
+ import TeamMember from './TeamMember.astro';
10
+ import { getExampleImage } from '../utils/image';
11
+
12
+ const avatar = getExampleImage({
13
+ width: 200,
14
+ height: 200,
15
+ provider: 'robohash',
16
+ randomSeed: 'member2',
17
+ });
18
+ ---
19
+
20
+ <TeamMember
21
+ name="李四"
22
+ role="高级开发工程师"
23
+ avatar={avatar}
24
+ bio="全栈开发专家,热爱开源项目,专注于前端框架和性能优化"
25
+ socialLinks={[
26
+ { platform: 'github', url: 'https://github.com' },
27
+ { platform: 'twitter', url: 'https://twitter.com' },
28
+ { platform: 'linkedin', url: 'https://linkedin.com' },
29
+ ]}
30
+ />
@@ -30,8 +30,8 @@
30
30
  */
31
31
 
32
32
  import TeamMember from './TeamMember.astro';
33
- import '../../style.ts';
34
- import type { ImageSource } from '../../types/image';
33
+ import '../style.ts';
34
+ import type { ImageSource } from '../types/image';
35
35
 
36
36
  // 自定义图片元数据接口
37
37
  interface ImageMetadata {
@@ -0,0 +1,23 @@
1
+ import TeamMember from './TeamMember.astro';
2
+ import TeamMemberBasic from './TeamMemberBasic.astro';
3
+ import TeamMemberWithSocial from './TeamMemberWithSocial.astro';
4
+ import TeamMemberCustomStyle from './TeamMemberCustomStyle.astro';
5
+ import TeamMemberGroup from './TeamMemberGroup.astro';
6
+ import TeamMemebrs from './TeamMembers.astro';
7
+
8
+ import BasicSourceCode from './TeamMemberBasic.astro?raw';
9
+ import WithSocialSourceCode from './TeamMemberWithSocial.astro?raw';
10
+ import CustomStyleSourceCode from './TeamMemberCustomStyle.astro?raw';
11
+ import GroupSourceCode from './TeamMemberGroup.astro?raw';
12
+
13
+ import { extractSimpleExample } from '../utils/component';
14
+
15
+ export { TeamMember, TeamMemberBasic, TeamMemberWithSocial, TeamMemberCustomStyle, TeamMemberGroup, TeamMemebrs };
16
+
17
+ // Export example codes
18
+ export const TeamMemberExampleCodes = {
19
+ Basic: extractSimpleExample(BasicSourceCode, 'TeamMember'),
20
+ WithSocial: extractSimpleExample(WithSocialSourceCode, 'TeamMember'),
21
+ CustomStyle: extractSimpleExample(CustomStyleSourceCode, 'TeamMember'),
22
+ Group: extractSimpleExample(GroupSourceCode, 'TeamMember'),
23
+ };
@@ -39,7 +39,7 @@ const { theme, label, class: className = '' } = Astro.props;
39
39
  variant="ghost"
40
40
  size="sm"
41
41
  block
42
- class={`cosy:text-left cosy:justify-start ${className}`}
43
- data-set-theme={theme}>
42
+ class={`cosy:text-left cosy:justify-start ${className} cosy:theme-item`}
43
+ data-theme={theme}>
44
44
  {label}
45
45
  </Button>
@@ -25,8 +25,8 @@
25
25
  * ```
26
26
  */
27
27
 
28
- import Button from '../button/Button.astro';
29
- import SunCloudyIcon from '../icons/SunCloudyIcon.astro';
28
+ import { SunCloudyIcon } from '../index';
29
+ import ThemeItem from './ThemeItem.astro';
30
30
  import '../style.ts';
31
31
 
32
32
  interface Props {
@@ -51,26 +51,15 @@ const themes = [
51
51
  ];
52
52
  ---
53
53
 
54
+ <!-- 主题切换按钮 -->
54
55
  <div class:list={['cosy:dropdown-end cosy:dropdown', className]}>
55
- <Button variant="ghost" size="sm" class="cosy:p-1">
56
- <SunCloudyIcon class="cosy:w-5 cosy:h-5" slot="icon-left" />
57
- </Button>
56
+ <div tabindex="0" role="button" class:list={['cosy:btn cosy:btn-ghost']}>
57
+ <SunCloudyIcon size="16px" class="cosy:w-4 cosy:h-4" />
58
+ </div>
58
59
  <ul
59
- tabindex="0"
60
- class="cosy:bg-slate-900 cosy:dark:bg-slate-800 cosy:shadow-lg cosy:p-2 cosy:rounded-box cosy:w-56 cosy:dropdown-content cosy:menu">
61
- {
62
- themes.map((theme) => (
63
- <li>
64
- <button
65
- class="cosy:flex cosy:justify-between cosy:items-center cosy:w-full cosy:transition-colors cosy:theme-item"
66
- data-theme={theme.id}
67
- data-active={false}>
68
- <span>{theme.name}</span>
69
- <span class="cosy:hidden cosy:text-primary cosy:theme-check">✓</span>
70
- </button>
71
- </li>
72
- ))
73
- }
60
+ tabindex={0}
61
+ class="cosy:dropdown-content cosy:menu cosy:bg-base-100 cosy:dark:bg-neutral-800 cosy:rounded-box cosy:z-[1] cosy:w-56 cosy:p-2 cosy:shadow-lg">
62
+ {themes.map((theme) => <ThemeItem theme={theme.id} label={theme.name} />)}
74
63
  </ul>
75
64
  </div>
76
65
 
@@ -103,6 +92,7 @@ const themes = [
103
92
  function initThemeSwitcher() {
104
93
  document.querySelectorAll('.cosy\\:theme-item').forEach((item) => {
105
94
  item.addEventListener('click', () => {
95
+ console.log('Theme item clicked:', item);
106
96
  const theme = item.getAttribute('data-theme');
107
97
  if (theme) {
108
98
  themeManager.setTheme(theme);
@@ -34,6 +34,30 @@ export interface IHeaderProps {
34
34
  */
35
35
  navItems?: INavItem[];
36
36
 
37
+ /**
38
+ * 导航栏位置
39
+ * @default "start"
40
+ */
41
+ navPosition?: 'start' | 'center' | 'end';
42
+
43
+ /**
44
+ * 水平内边距
45
+ * @default "md"
46
+ */
47
+ paddingHorizontal?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
48
+
49
+ /**
50
+ * 垂直内边距
51
+ * @default "md"
52
+ */
53
+ paddingVertical?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
54
+
55
+ /**
56
+ * 圆角大小
57
+ * @default "md"
58
+ */
59
+ rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
60
+
37
61
  /**
38
62
  * 是否显示侧边栏切换按钮
39
63
  * @default false
@@ -41,7 +65,13 @@ export interface IHeaderProps {
41
65
  showSidebarToggle?: boolean;
42
66
 
43
67
  /**
44
- * 社交链接
68
+ * 是否显示主题切换按钮
69
+ * @default false
70
+ */
71
+ showThemeSwitcher?: boolean;
72
+
73
+ /**
74
+ * 社交媒体链接列表
45
75
  */
46
76
  socialLinks?: Array<{
47
77
  name: string;
@@ -54,11 +84,4 @@ export interface IHeaderProps {
54
84
  * @default true
55
85
  */
56
86
  sticky?: boolean;
57
-
58
- rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
59
-
60
- paddingHorizontal?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
61
- paddingVertical?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
62
-
63
- navPosition?: 'start' | 'center' | 'end';
64
- }
87
+ }