@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,8 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <Button href="https://example.com" target="_blank" variant="primary">
6
+ 外部链接
7
+ <span slot="icon-right">↗</span>
8
+ </Button>
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <Button variant="neutral">中性按钮</Button>
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <Button variant="outline">描边按钮</Button>
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <Button shape="circle">圆</Button>
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <Button>默认</Button>
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <Button shape="square">方</Button>
@@ -0,0 +1,25 @@
1
+ ---
2
+ import { CodeContainer } from '../index';
3
+ import ButtonShapeCircle from './ButtonShapeCircle.astro';
4
+ import ButtonShapeSquare from './ButtonShapeSquare.astro';
5
+ import ButtonShapeDefault from './ButtonShapeDefault.astro';
6
+ import ButtonShapeCircleSourceCode from './ButtonShapeCircle.astro?raw';
7
+ import ButtonShapeSquareSourceCode from './ButtonShapeSquare.astro?raw';
8
+ import ButtonShapeDefaultSourceCode from './ButtonShapeDefault.astro?raw';
9
+ ---
10
+
11
+ <CodeContainer
12
+ titles={['圆形', '方形', '默认']}
13
+ codes={[ButtonShapeCircleSourceCode, ButtonShapeSquareSourceCode, ButtonShapeDefaultSourceCode]}>
14
+ <div id="tab-1">
15
+ <ButtonShapeCircle />
16
+ </div>
17
+
18
+ <div id="tab-2">
19
+ <ButtonShapeSquare />
20
+ </div>
21
+
22
+ <div id="tab-3">
23
+ <ButtonShapeDefault />
24
+ </div>
25
+ </CodeContainer>
@@ -9,7 +9,7 @@ import Button from './Button.astro';
9
9
  <Button size="lg">大型按钮</Button>
10
10
  </div>
11
11
 
12
- <div class="cosy:mt-4 cosy:flex cosy:items-center cosy:gap-2">
12
+ <div class="cosy:mt-4 cosy:flex cosy:flex-col cosy:items-center cosy:gap-2">
13
13
  <Button size="lg" wide>宽按钮</Button>
14
14
  <Button block>块级按钮</Button>
15
15
  </div>
@@ -0,0 +1,12 @@
1
+ <script setup lang="ts">
2
+ import VueButton from './Button.vue'
3
+ </script>
4
+
5
+ <template>
6
+ <div class="cosy:flex cosy:items-center cosy:gap-2">
7
+ <VueButton size="xs">超小按钮</VueButton>
8
+ <VueButton size="sm">小型按钮</VueButton>
9
+ <VueButton size="md">中等按钮</VueButton>
10
+ <VueButton size="lg">大型按钮</VueButton>
11
+ </div>
12
+ </template>
@@ -0,0 +1,17 @@
1
+ ---
2
+ import { CodeContainer } from '../index';
3
+ import ButtonSizes from './ButtonSizes.astro';
4
+ import VueButtonSizes from './ButtonSizes.vue';
5
+ import ButtonSizesSourceCode from './ButtonSizes.astro?raw';
6
+ import VueButtonSizesSourceCode from './ButtonSizes.vue?raw';
7
+ ---
8
+
9
+ <CodeContainer codes={[ButtonSizesSourceCode, VueButtonSizesSourceCode]} titles={['Astro', 'Vue']}>
10
+ <div id="tab-1">
11
+ <ButtonSizes />
12
+ </div>
13
+
14
+ <div id="tab-2">
15
+ <VueButtonSizes client:load />
16
+ </div>
17
+ </CodeContainer>
@@ -0,0 +1,11 @@
1
+ ---
2
+ import { CodeContainer } from '../index';
3
+ import ButtonStates from './ButtonStates.astro';
4
+ import ButtonStatesSourceCode from './ButtonStates.astro?raw';
5
+ ---
6
+
7
+ <CodeContainer codes={[ButtonStatesSourceCode]}>
8
+ <div id="tab-1">
9
+ <ButtonStates />
10
+ </div>
11
+ </CodeContainer>
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <Button variant="success">成功按钮</Button>
@@ -0,0 +1,14 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <div class="cosy:flex cosy:flex-wrap cosy:gap-2">
6
+ <Button variant="info">信息按钮</Button>
7
+ <Button variant="success">成功按钮</Button>
8
+ <Button variant="warning">警告按钮</Button>
9
+ <Button variant="error">错误按钮</Button>
10
+ <Button variant="ghost">幽灵按钮</Button>
11
+ <Button variant="link">链接按钮</Button>
12
+ <Button variant="outline">描边按钮</Button>
13
+ <Button variant="neutral">中性按钮</Button>
14
+ </div>
@@ -0,0 +1,16 @@
1
+ <script setup lang="ts">
2
+ import VueButton from './Button.vue'
3
+ </script>
4
+
5
+ <template>
6
+ <div class="cosy:flex cosy:flex-wrap cosy:gap-2">
7
+ <VueButton variant="info">信息按钮</VueButton>
8
+ <VueButton variant="success">成功按钮</VueButton>
9
+ <VueButton variant="warning">警告按钮</VueButton>
10
+ <VueButton variant="error">错误按钮</VueButton>
11
+ <VueButton variant="ghost">幽灵按钮</VueButton>
12
+ <VueButton variant="link">链接按钮</VueButton>
13
+ <VueButton variant="outline">描边按钮</VueButton>
14
+ <VueButton variant="neutral">中性按钮</VueButton>
15
+ </div>
16
+ </template>
@@ -0,0 +1,71 @@
1
+ ---
2
+ import { CodeContainer } from '../index';
3
+ import ButtonInfo from './ButtonInfo.astro';
4
+ import ButtonSuccess from './ButtonSuccess.astro';
5
+ import ButtonWarning from './ButtonWarning.astro';
6
+ import ButtonError from './ButtonError.astro';
7
+ import ButtonGhost from './ButtonGhost.astro';
8
+ import ButtonLink from './ButtonLink.astro';
9
+ import ButtonOutline from './ButtonOutline.astro';
10
+ import ButtonNeutral from './ButtonNeutral.astro';
11
+ import VueButtonVariants from './ButtonVariants.vue';
12
+ import ButtonInfoSourceCode from './ButtonInfo.astro?raw';
13
+ import ButtonSuccessSourceCode from './ButtonSuccess.astro?raw';
14
+ import ButtonWarningSourceCode from './ButtonWarning.astro?raw';
15
+ import ButtonErrorSourceCode from './ButtonError.astro?raw';
16
+ import ButtonGhostSourceCode from './ButtonGhost.astro?raw';
17
+ import ButtonLinkSourceCode from './ButtonLink.astro?raw';
18
+ import ButtonOutlineSourceCode from './ButtonOutline.astro?raw';
19
+ import ButtonNeutralSourceCode from './ButtonNeutral.astro?raw';
20
+ import VueButtonVariantsSourceCode from './ButtonVariants.vue?raw';
21
+ ---
22
+
23
+ <CodeContainer
24
+ titles={['Info', 'Success', 'Warning', 'Error', 'Ghost', 'Link', 'Outline', 'Neutral', 'Vue']}
25
+ codes={[
26
+ ButtonInfoSourceCode,
27
+ ButtonSuccessSourceCode,
28
+ ButtonWarningSourceCode,
29
+ ButtonErrorSourceCode,
30
+ ButtonGhostSourceCode,
31
+ ButtonLinkSourceCode,
32
+ ButtonOutlineSourceCode,
33
+ ButtonNeutralSourceCode,
34
+ VueButtonVariantsSourceCode,
35
+ ]}>
36
+ <div id="tab-1">
37
+ <ButtonInfo />
38
+ </div>
39
+
40
+ <div id="tab-2">
41
+ <ButtonSuccess />
42
+ </div>
43
+
44
+ <div id="tab-3">
45
+ <ButtonWarning />
46
+ </div>
47
+
48
+ <div id="tab-4">
49
+ <ButtonError />
50
+ </div>
51
+
52
+ <div id="tab-5">
53
+ <ButtonGhost />
54
+ </div>
55
+
56
+ <div id="tab-6">
57
+ <ButtonLink />
58
+ </div>
59
+
60
+ <div id="tab-7">
61
+ <ButtonOutline />
62
+ </div>
63
+
64
+ <div id="tab-8">
65
+ <ButtonNeutral />
66
+ </div>
67
+
68
+ <div id="tab-9">
69
+ <VueButtonVariants client:load />
70
+ </div>
71
+ </CodeContainer>
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <Button variant="warning">警告按钮</Button>
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <Button wide>宽按钮</Button>
@@ -0,0 +1,8 @@
1
+ ---
2
+ import Button from './Button.astro';
3
+ ---
4
+
5
+ <div class="cosy:flex cosy:flex-col cosy:gap-2">
6
+ <Button wide>宽按钮</Button>
7
+ <Button block>块级按钮</Button>
8
+ </div>
@@ -0,0 +1,19 @@
1
+ ---
2
+ import { CodeContainer } from '../index';
3
+ import ButtonWide from './ButtonWide.astro';
4
+ import ButtonBlock from './ButtonBlock.astro';
5
+ import ButtonWideSourceCode from './ButtonWide.astro?raw';
6
+ import ButtonBlockSourceCode from './ButtonBlock.astro?raw';
7
+ ---
8
+
9
+ <CodeContainer
10
+ titles={['宽按钮', '块级按钮']}
11
+ codes={[ButtonWideSourceCode, ButtonBlockSourceCode]}>
12
+ <div id="tab-1">
13
+ <ButtonWide />
14
+ </div>
15
+
16
+ <div id="tab-2">
17
+ <ButtonBlock />
18
+ </div>
19
+ </CodeContainer>
@@ -0,0 +1,21 @@
1
+ <script setup lang="ts">
2
+ import VueButton from './Button.vue'
3
+ </script>
4
+
5
+ <template>
6
+ <div class="cosy:flex cosy:gap-2">
7
+ <VueButton>
8
+ <template #icon-left>👈</template>
9
+ 左侧图标
10
+ </VueButton>
11
+ <VueButton>
12
+ 右侧图标
13
+ <template #icon-right>👉</template>
14
+ </VueButton>
15
+ <VueButton>
16
+ <template #icon-left>👈</template>
17
+ 两侧图标
18
+ <template #icon-right>👉</template>
19
+ </VueButton>
20
+ </div>
21
+ </template>
@@ -0,0 +1,36 @@
1
+ ---
2
+ import { CodeContainer } from '../index';
3
+ import ButtonIconLeft from './ButtonIconLeft.astro';
4
+ import ButtonIconRight from './ButtonIconRight.astro';
5
+ import ButtonIconBoth from './ButtonIconBoth.astro';
6
+ import VueButtonWithIcons from './ButtonWithIcons.vue';
7
+ import ButtonIconLeftSourceCode from './ButtonIconLeft.astro?raw';
8
+ import ButtonIconRightSourceCode from './ButtonIconRight.astro?raw';
9
+ import ButtonIconBothSourceCode from './ButtonIconBoth.astro?raw';
10
+ import VueButtonWithIconsSourceCode from './ButtonWithIcons.vue?raw';
11
+ ---
12
+
13
+ <CodeContainer
14
+ titles={['左侧图标', '右侧图标', '两侧图标', 'Vue']}
15
+ codes={[
16
+ ButtonIconLeftSourceCode,
17
+ ButtonIconRightSourceCode,
18
+ ButtonIconBothSourceCode,
19
+ VueButtonWithIconsSourceCode,
20
+ ]}>
21
+ <div id="tab-1">
22
+ <ButtonIconLeft />
23
+ </div>
24
+
25
+ <div id="tab-2">
26
+ <ButtonIconRight />
27
+ </div>
28
+
29
+ <div id="tab-3">
30
+ <ButtonIconBoth />
31
+ </div>
32
+
33
+ <div id="tab-4">
34
+ <VueButtonWithIcons client:load />
35
+ </div>
36
+ </CodeContainer>
@@ -0,0 +1,64 @@
1
+ import Button from './Button.astro';
2
+ import ButtonBasicContainer from './ButtonBasicContainer.astro';
3
+ import ButtonShapesContainer from './ButtonShapesContainer.astro';
4
+ import ButtonSizesContainer from './ButtonSizesContainer.astro';
5
+ import ButtonStatesContainer from './ButtonStatesContainer.astro';
6
+ import ButtonWithIconsContainer from './ButtonWithIconsContainer.astro';
7
+ import ButtonWidthContainer from './ButtonWidthContainer.astro';
8
+ import ButtonVariantsContainer from './ButtonVariantsContainer.astro';
9
+ import ButtonLinkContainer from './ButtonLinkContainer.astro';
10
+ import ButtonWide from './ButtonWide.astro';
11
+ import ButtonBlock from './ButtonBlock.astro';
12
+ import ButtonIconLeft from './ButtonIconLeft.astro';
13
+ import ButtonIconRight from './ButtonIconRight.astro';
14
+ import ButtonIconBoth from './ButtonIconBoth.astro';
15
+ import ButtonShapeCircle from './ButtonShapeCircle.astro';
16
+ import ButtonShapeSquare from './ButtonShapeSquare.astro';
17
+ import ButtonShapeDefault from './ButtonShapeDefault.astro';
18
+ import ButtonInfo from './ButtonInfo.astro';
19
+ import ButtonSuccess from './ButtonSuccess.astro';
20
+ import ButtonWarning from './ButtonWarning.astro';
21
+ import ButtonError from './ButtonError.astro';
22
+ import ButtonGhost from './ButtonGhost.astro';
23
+ import ButtonLink from './ButtonLink.astro';
24
+ import ButtonLinkExternal from './ButtonLinkExternal.astro';
25
+ import ButtonOutline from './ButtonOutline.astro';
26
+ import ButtonNeutral from './ButtonNeutral.astro';
27
+ import ButtonFeatureContainer from './ButtonFeatureContainer.astro';
28
+
29
+ export {
30
+ Button
31
+ };
32
+
33
+ export const ButtonPackage = {
34
+ Button,
35
+ ButtonWide,
36
+ ButtonBlock,
37
+ ButtonIconLeft,
38
+ ButtonIconRight,
39
+ ButtonIconBoth,
40
+ ButtonShapeCircle,
41
+ ButtonShapeSquare,
42
+ ButtonShapeDefault,
43
+ ButtonInfo,
44
+ ButtonSuccess,
45
+ ButtonWarning,
46
+ ButtonError,
47
+ ButtonGhost,
48
+ ButtonLink,
49
+ ButtonLinkExternal,
50
+ ButtonOutline,
51
+ ButtonNeutral,
52
+
53
+ ButtonContainers: {
54
+ Basic: ButtonBasicContainer,
55
+ Shapes: ButtonShapesContainer,
56
+ Sizes: ButtonSizesContainer,
57
+ States: ButtonStatesContainer,
58
+ WithIcons: ButtonWithIconsContainer,
59
+ Width: ButtonWidthContainer,
60
+ Variants: ButtonVariantsContainer,
61
+ Link: ButtonLinkContainer,
62
+ Feature: ButtonFeatureContainer,
63
+ }
64
+ };
@@ -0,0 +1,4 @@
1
+ import FeatureButton from './ButtonFeature.vue';
2
+ import Button from './Button.vue';
3
+
4
+ export { FeatureButton, Button };
@@ -0,0 +1,91 @@
1
+ ---
2
+ /**
3
+ * @component Card
4
+ *
5
+ * @description
6
+ * Card 组件用于在页面中展示相关内容的容器,通常包含标题、描述和可选的图片。
7
+ * 组件设计简洁大方,具有平滑的动画效果和交互反馈,适合展示产品、文章或功能介绍等内容。
8
+ *
9
+ * @design
10
+ * 设计理念:
11
+ * 1. 视觉层次感 - 通过阴影、悬停效果和微妙的动画创造深度感
12
+ * 2. 内容聚焦 - 简洁的布局让用户关注卡片内容
13
+ * 3. 交互反馈 - 悬停和点击时提供明确的视觉反馈
14
+ * 4. 适应性强 - 响应式设计,适应不同屏幕尺寸
15
+ *
16
+ * @usage
17
+ * 基本用法:
18
+ * ```astro
19
+ * <Card
20
+ * title="卡片标题"
21
+ * subtitle="卡片描述文本"
22
+ * >
23
+ * 卡片内容
24
+ * </Card>
25
+ * ```
26
+ *
27
+ * 带图片的卡片:
28
+ * ```astro
29
+ * <Card
30
+ * title="产品名称"
31
+ * subtitle="产品描述"
32
+ * imageUrl="/path/to/image.jpg"
33
+ * >
34
+ * 其他产品信息
35
+ * </Card>
36
+ * ```
37
+ *
38
+ * 可点击的卡片(链接):
39
+ * ```astro
40
+ * <Card
41
+ * title="文章标题"
42
+ * subtitle="文章摘要"
43
+ * imageUrl="/path/to/image.jpg"
44
+ * href="/articles/article-slug"
45
+ * />
46
+ * ```
47
+ *
48
+ * 紧凑模式:
49
+ * ```astro
50
+ * <Card
51
+ * title="紧凑卡片"
52
+ * subtitle="更小的内边距"
53
+ * compact
54
+ * >
55
+ * 适合在空间有限的情况下使用
56
+ * </Card>
57
+ * ```
58
+ *
59
+ * @props
60
+ * @prop {string} [title] - 卡片标题
61
+ * @prop {string} [subtitle] - 卡片副标题或描述
62
+ * @prop {string} [imageUrl] - 卡片顶部图片的URL
63
+ * @prop {string} [href] - 如果提供,卡片将变成可点击的链接
64
+ * @prop {boolean} [compact] - 是否使用紧凑模式
65
+ * @prop {string} [class] - 自定义CSS类,可用于覆盖默认样式
66
+ *
67
+ * @slots
68
+ * @slot default - 卡片的主要内容区域
69
+ */
70
+
71
+ import '../style.ts';
72
+
73
+ interface Props {
74
+ title: string;
75
+ subtitle?: string;
76
+ class?: string;
77
+ }
78
+
79
+ const { title, subtitle, class: className } = Astro.props;
80
+ ---
81
+
82
+ <article class={`cosy-card ${className || ''}`}>
83
+ <header class="cosy-card__header">
84
+ <h3 class="cosy-card__title">{title}</h3>
85
+ {subtitle && <p class="cosy-card__subtitle">{subtitle}</p>}
86
+ </header>
87
+
88
+ <div class="cosy-card__content">
89
+ <slot />
90
+ </div>
91
+ </article>
@@ -0,0 +1,5 @@
1
+ ---
2
+ import Card from './Card.astro';
3
+ ---
4
+
5
+ <Card title="卡片标题" subtitle="卡片描述文本" />
@@ -0,0 +1,77 @@
1
+ ---
2
+ /**
3
+ * CardCompact - 紧凑模式卡片组件
4
+ *
5
+ * @prop {string} [title] - 卡片标题
6
+ * @prop {string} [subtitle] - 卡片副标题或描述
7
+ * @prop {string} [class] - 自定义CSS类
8
+ */
9
+
10
+ import '../style.ts';
11
+
12
+ interface Props {
13
+ title?: string;
14
+ subtitle?: string;
15
+ class?: string;
16
+ }
17
+
18
+ const { title, subtitle, class: className = '' } = Astro.props;
19
+
20
+ const cardClasses = [
21
+ 'cosy-card',
22
+ 'cosy:bg-base-100',
23
+ 'cosy:bg-opacity-70',
24
+ 'cosy:backdrop-blur-sm',
25
+ 'cosy:rounded-xl',
26
+ 'cosy:shadow-md',
27
+ 'cosy:overflow-hidden',
28
+ 'cosy:transition-all',
29
+ 'cosy:duration-300',
30
+ 'cosy:ease-in-out',
31
+ 'cosy:hover:shadow-lg',
32
+ 'cosy:hover:scale-[1.02]',
33
+ 'cosy-card--compact',
34
+ className,
35
+ ].join(' ');
36
+ ---
37
+
38
+ <article class={cardClasses}>
39
+ <header class="cosy-card__header">
40
+ <h3 class="cosy-card__title">{title}</h3>
41
+ {subtitle && <p class="cosy-card__subtitle">{subtitle}</p>}
42
+ </header>
43
+
44
+ <div class="cosy-card__content">
45
+ <slot />
46
+ </div>
47
+ </article>
48
+
49
+ <style scoped>
50
+ .cosy-card--compact {
51
+ padding: 0.75rem;
52
+ }
53
+
54
+ .cosy-card__header {
55
+ margin-bottom: 0.5rem;
56
+ }
57
+
58
+ .cosy-card__title {
59
+ font-size: 0.95rem;
60
+ margin-bottom: 0.25rem;
61
+ }
62
+
63
+ .cosy-card__subtitle {
64
+ font-size: 0.85rem;
65
+ }
66
+
67
+ .cosy-card__content {
68
+ font-size: 0.85rem;
69
+ line-height: 1.4;
70
+ }
71
+
72
+ @media (prefers-reduced-motion: reduce) {
73
+ .cosy-card:hover {
74
+ transform: none !important;
75
+ }
76
+ }
77
+ </style>
@@ -0,0 +1,75 @@
1
+ ---
2
+ /**
3
+ * CardLink - 可点击的卡片组件
4
+ *
5
+ * @prop {string} [title] - 卡片标题
6
+ * @prop {string} [subtitle] - 卡片副标题或描述
7
+ * @prop {string} [imageUrl] - 卡片图片URL
8
+ * @prop {string} [href] - 卡片链接地址
9
+ * @prop {string} [class] - 自定义CSS类
10
+ */
11
+
12
+ import '../style.ts';
13
+
14
+ interface Props {
15
+ title?: string;
16
+ subtitle?: string;
17
+ imageUrl?: string;
18
+ href: string;
19
+ class?: string;
20
+ }
21
+
22
+ const { title, subtitle, imageUrl, href, class: className = '' } = Astro.props;
23
+
24
+ const cardClasses = [
25
+ 'cosy-card',
26
+ 'cosy:bg-base-100',
27
+ 'cosy:bg-opacity-70',
28
+ 'cosy:backdrop-blur-sm',
29
+ 'cosy:rounded-xl',
30
+ 'cosy:shadow-md',
31
+ 'cosy:overflow-hidden',
32
+ 'cosy:transition-all',
33
+ 'cosy:duration-300',
34
+ 'cosy:ease-in-out',
35
+ 'cosy:hover:shadow-lg',
36
+ 'cosy:hover:scale-[1.02]',
37
+ className,
38
+ ].join(' ');
39
+ ---
40
+
41
+ <a href={href} class={cardClasses} aria-label={`${title} ${subtitle || ''}`.trim()}>
42
+ {
43
+ imageUrl && (
44
+ <div
45
+ class="cosy-card__image"
46
+ style={`background-image: url(${imageUrl})`}
47
+ aria-hidden="true"
48
+ />
49
+ )
50
+ }
51
+
52
+ <header class="cosy-card__header">
53
+ <h3 class="cosy-card__title">{title}</h3>
54
+ {subtitle && <p class="cosy-card__subtitle">{subtitle}</p>}
55
+ </header>
56
+
57
+ <div class="cosy-card__content">
58
+ <slot />
59
+ </div>
60
+ </a>
61
+
62
+ <style scoped>
63
+ .cosy-card__image {
64
+ height: 180px;
65
+ background-size: cover;
66
+ background-position: center;
67
+ border-radius: 12px 12px 0 0;
68
+ }
69
+
70
+ @media (prefers-reduced-motion: reduce) {
71
+ .cosy-card:hover {
72
+ transform: none !important;
73
+ }
74
+ }
75
+ </style>