@coffic/cosy-ui 0.6.10 → 0.6.14

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 (149) hide show
  1. package/dist/app.css +1 -1
  2. package/dist/assets/iconData.ts +93 -0
  3. package/dist/components/base/Alert.astro +1 -1
  4. package/dist/components/base/Button.astro +102 -91
  5. package/dist/components/base/Image.astro +1 -1
  6. package/dist/components/base/Link.astro +1 -1
  7. package/dist/components/containers/Container.astro +1 -1
  8. package/dist/components/containers/Main.astro +1 -1
  9. package/dist/components/containers/Section.astro +96 -94
  10. package/dist/components/data-display/Blog.astro +1 -1
  11. package/dist/components/data-display/ProductCard.astro +2 -4
  12. package/dist/components/data-display/Products.astro +2 -2
  13. package/dist/components/data-display/TeamMember.astro +2 -4
  14. package/dist/components/data-display/TeamMembers.astro +1 -1
  15. package/dist/components/display/Banner.astro +1 -1
  16. package/dist/components/display/Card.astro +1 -1
  17. package/dist/components/display/CodeBlock.astro +1 -1
  18. package/dist/components/display/CodeExample.astro +1 -1
  19. package/dist/components/display/Hero.astro +1 -1
  20. package/dist/components/display/Modal.astro +1 -1
  21. package/dist/components/layouts/AppLayout.astro +2 -6
  22. package/dist/components/layouts/BaseLayout.astro +1 -1
  23. package/dist/components/layouts/DashboardLayout.astro +1 -1
  24. package/dist/components/layouts/Footer.astro +2 -5
  25. package/dist/components/layouts/Grid.astro +1 -1
  26. package/dist/components/layouts/Header.astro +1 -1
  27. package/dist/components/layouts/NavItems.astro +1 -1
  28. package/dist/components/layouts/Sidebar.astro +2 -2
  29. package/dist/components/layouts/SidebarNav.astro +1 -1
  30. package/dist/components/layouts/Stack.astro +72 -70
  31. package/dist/components/navigation/LanguageSwitcher.astro +2 -2
  32. package/dist/components/navigation/TableOfContents.astro +1 -1
  33. package/dist/components/navigation/ThemeSwitcher.astro +2 -2
  34. package/dist/components/typography/Article.astro +2 -2
  35. package/dist/components/typography/Heading.astro +2 -2
  36. package/dist/components/typography/Text.astro +1 -1
  37. package/dist/icons/AlertTriangle.astro +24 -0
  38. package/dist/icons/AstroIcon.astro +46 -0
  39. package/dist/icons/CalendarIcon.astro +24 -0
  40. package/dist/icons/CheckCircle.astro +23 -0
  41. package/dist/icons/CheckIcon.astro +27 -0
  42. package/dist/{components/icons → icons}/ChevronDownIcon.astro +3 -13
  43. package/dist/icons/ClipboardIcon.astro +27 -0
  44. package/dist/icons/CloseIcon.astro +27 -0
  45. package/dist/icons/ErrorIcon.astro +24 -0
  46. package/dist/icons/GithubIcon.astro +24 -0
  47. package/dist/icons/InfoCircle.astro +24 -0
  48. package/dist/icons/InfoIcon.astro +26 -0
  49. package/dist/icons/LinkIcon.astro +27 -0
  50. package/dist/icons/LinkedinIcon.astro +23 -0
  51. package/dist/icons/MenuIcon.astro +27 -0
  52. package/dist/icons/SearchIcon.astro +23 -0
  53. package/dist/icons/SettingsIcon.astro +18 -0
  54. package/dist/{components/icons → icons}/SocialIcon.astro +14 -14
  55. package/dist/icons/SuccessIcon.astro +24 -0
  56. package/dist/icons/SunCloudyIcon.astro +23 -0
  57. package/dist/icons/TwitterIcon.astro +24 -0
  58. package/dist/icons/UserIcon.astro +24 -0
  59. package/dist/icons/WarningIcon.astro +27 -0
  60. package/dist/icons/XCircle.astro +24 -0
  61. package/dist/index.ts +1 -1
  62. package/dist/index_icons.ts +23 -0
  63. package/dist/index_vue.ts +41 -0
  64. package/dist/vue/{AlertDialog.vue → AlertDialog/AlertDialog.vue} +1 -1
  65. package/dist/vue/AlertDialog/Basic.vue +38 -0
  66. package/dist/vue/AlertDialog/Multilang.vue +48 -0
  67. package/dist/vue/AlertDialog/index.ts +58 -0
  68. package/dist/vue/BannerBox/BannerBox.vue +435 -0
  69. package/dist/vue/BannerBox/Basic.vue +32 -0
  70. package/dist/vue/BannerBox/CustomBg.vue +32 -0
  71. package/dist/vue/BannerBox/CustomComponent.vue +60 -0
  72. package/dist/vue/BannerBox/DisplayMode.vue +49 -0
  73. package/dist/vue/{FeatureCard.vue → BannerBox/FeatureCard.vue} +23 -42
  74. package/dist/vue/BannerBox/ImageExport.vue +37 -0
  75. package/dist/vue/BannerBox/SizePreset.vue +35 -0
  76. package/dist/vue/BannerBox/SmartBanner.vue +44 -0
  77. package/dist/vue/BannerBox/index.ts +76 -0
  78. package/dist/vue/FeatureButton.vue +25 -26
  79. package/dist/vue/Icons/AlertTriangleIcon.vue +30 -0
  80. package/dist/vue/Icons/CalendarIcon.vue +30 -0
  81. package/dist/vue/Icons/CheckCircleIcon.vue +30 -0
  82. package/dist/vue/Icons/CheckIcon.vue +30 -0
  83. package/dist/vue/Icons/ChevronDownIcon.vue +30 -0
  84. package/dist/vue/Icons/ClipboardIcon.vue +30 -0
  85. package/dist/vue/Icons/CloseIcon.vue +30 -0
  86. package/dist/vue/Icons/InfoCircleIcon.vue +30 -0
  87. package/dist/vue/Icons/InfoIcon.vue +30 -0
  88. package/dist/vue/Icons/LinkIcon.vue +30 -0
  89. package/dist/vue/Icons/MenuIcon.vue +30 -0
  90. package/dist/vue/Icons/SearchIcon.vue +30 -0
  91. package/dist/vue/Icons/SettingsIcon.vue +30 -0
  92. package/dist/vue/Icons/UserIcon.vue +30 -0
  93. package/dist/vue/Icons/VueIcon.vue +76 -0
  94. package/dist/vue/Icons/XCircleIcon.vue +30 -0
  95. package/dist/vue/MacWindow/Basic.vue +11 -0
  96. package/dist/vue/MacWindow/CustomHeight.vue +13 -0
  97. package/dist/vue/{MacWindow.vue → MacWindow/MacWindow.vue} +73 -38
  98. package/dist/vue/MacWindow/WithEvents.vue +34 -0
  99. package/dist/vue/MacWindow/WithSidebar.vue +21 -0
  100. package/dist/vue/MacWindow/WithTabs.vue +21 -0
  101. package/dist/vue/MacWindow/WithToolbar.vue +43 -0
  102. package/dist/vue/MacWindow/index.ts +50 -0
  103. package/dist/vue/SmartHero.vue +28 -34
  104. package/dist/vue/VueCounter.vue +29 -0
  105. package/dist/vue/iPhone/Basic.vue +33 -0
  106. package/dist/vue/iPhone/CustomBackground.vue +33 -0
  107. package/dist/vue/iPhone/NoFrame.vue +33 -0
  108. package/dist/vue/iPhone/WeatherApp.vue +97 -0
  109. package/dist/vue/iPhone/assets/iPhone 14 Pro - Deep Purple - Landscape.png +0 -0
  110. package/dist/vue/iPhone/assets/iPhone 14 Pro - Deep Purple - Portrait.png +0 -0
  111. package/dist/vue/iPhone/assets/iPhone 14 Pro - Gold - Landscape.png +0 -0
  112. package/dist/vue/iPhone/assets/iPhone 14 Pro - Gold - Portrait.png +0 -0
  113. package/dist/vue/iPhone/assets/iPhone 14 Pro - Silver - Landscape.png +0 -0
  114. package/dist/vue/iPhone/assets/iPhone 14 Pro - Silver - Portrait.png +0 -0
  115. package/dist/vue/iPhone/assets/iPhone 14 Pro - Space Black - Landscape.png +0 -0
  116. package/dist/vue/iPhone/assets/iPhone 14 Pro - Space Black - Portrait.png +0 -0
  117. package/dist/vue/{iPhoneWindow.vue → iPhone/iPhoneWindow.vue} +14 -7
  118. package/dist/vue/iPhone/index.ts +41 -0
  119. package/dist/vue/shims-vue.d.ts +5 -0
  120. package/package.json +13 -12
  121. package/dist/components/icons/AlertTriangle.astro +0 -35
  122. package/dist/components/icons/CalendarIcon.astro +0 -38
  123. package/dist/components/icons/CheckCircle.astro +0 -36
  124. package/dist/components/icons/CheckIcon.astro +0 -38
  125. package/dist/components/icons/ClipboardIcon.astro +0 -39
  126. package/dist/components/icons/CloseIcon.astro +0 -38
  127. package/dist/components/icons/ErrorIcon.astro +0 -35
  128. package/dist/components/icons/GithubIcon.astro +0 -31
  129. package/dist/components/icons/InfoCircle.astro +0 -37
  130. package/dist/components/icons/InfoIcon.astro +0 -38
  131. package/dist/components/icons/LinkIcon.astro +0 -39
  132. package/dist/components/icons/LinkedinIcon.astro +0 -31
  133. package/dist/components/icons/MenuIcon.astro +0 -38
  134. package/dist/components/icons/SearchIcon.astro +0 -36
  135. package/dist/components/icons/SettingsIcon.astro +0 -36
  136. package/dist/components/icons/SuccessIcon.astro +0 -35
  137. package/dist/components/icons/SunCloudyIcon.astro +0 -41
  138. package/dist/components/icons/TwitterIcon.astro +0 -31
  139. package/dist/components/icons/UserIcon.astro +0 -35
  140. package/dist/components/icons/WarningIcon.astro +0 -38
  141. package/dist/components/icons/XCircle.astro +0 -37
  142. package/dist/entities/Banner.ts +0 -105
  143. package/dist/icons.ts +0 -22
  144. package/dist/vue/BannerBox.vue +0 -267
  145. package/dist/vue/FeatureGroup.vue +0 -22
  146. package/dist/vue/SmartBanner.vue +0 -45
  147. package/dist/vue/WildBanner.vue +0 -15
  148. package/dist/vue.ts +0 -14
  149. /package/dist/{collection.ts → index_collection.ts} +0 -0
@@ -49,7 +49,7 @@
49
49
  * ```
50
50
  */
51
51
 
52
- import '../../app.css';
52
+ import '../../style.ts';
53
53
  import { LinkUtil, type IMetaProps } from '../../index';
54
54
 
55
55
  export interface Props extends IMetaProps {
@@ -37,7 +37,7 @@
37
37
  */
38
38
 
39
39
  import BaseLayout from './BaseLayout.astro';
40
- import '../../app.css';
40
+ import '../../style.ts';
41
41
 
42
42
  export interface NavItem {
43
43
  href: string;
@@ -146,12 +146,9 @@
146
146
  */
147
147
 
148
148
  import { processSocialLink } from '../../utils/social';
149
- import SocialIcon from '../icons/SocialIcon.astro';
150
- import type { IFooterProps } from '../../types/footer';
151
- import { createTextGetter } from '../../utils/i18n';
149
+ import { SocialIcon, LanguageUtil, type IFooterProps, createTextGetter } from '../../index';
152
150
  import NavSection from './NavSection.astro';
153
- import { LanguageUtil } from '../../utils/language';
154
- import '../../app.css';
151
+ import '../../style.ts';
155
152
 
156
153
  const {
157
154
  siteName,
@@ -52,7 +52,7 @@
52
52
  */
53
53
 
54
54
  // 导入样式
55
- import '../../app.css';
55
+ import '../../style.ts';
56
56
 
57
57
  import type { HTMLAttributes } from 'astro/types';
58
58
 
@@ -57,7 +57,7 @@
57
57
  * height="lg"
58
58
  * />
59
59
  */
60
- import '../../app.css';
60
+ import '../../style.ts';
61
61
  import Link from '../base/Link.astro';
62
62
  import Image from '../base/Image.astro';
63
63
  import NavItems from './NavItems.astro';
@@ -14,7 +14,7 @@
14
14
  * />
15
15
  * ```
16
16
  */
17
- import '../../app.css';
17
+ import '../../style.ts';
18
18
  import Link from '../base/Link.astro';
19
19
  import type { INavItem } from '../../index';
20
20
 
@@ -21,11 +21,11 @@
21
21
  * ```
22
22
  */
23
23
 
24
- import '../../app.css';
24
+ import '../../style.ts';
25
25
  import { isPathMatch } from '../../utils/path';
26
26
  import Modal from '../display/Modal.astro';
27
27
  import SidebarNav from './SidebarNav.astro';
28
- import MenuIcon from '../icons/MenuIcon.astro';
28
+ import { MenuIcon } from '../../index';
29
29
  import type { ISidebarProps } from '../../index';
30
30
 
31
31
  export interface Props extends ISidebarProps {}
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { isPathMatch } from '../../utils/path';
9
- import '../../app.css';
9
+ import '../../style.ts';
10
10
  import type { ISidebarItem } from '../../types/sidebar';
11
11
 
12
12
  interface Props {
@@ -1,18 +1,18 @@
1
1
  ---
2
2
  /**
3
3
  * @component Stack
4
- *
4
+ *
5
5
  * @description
6
6
  * Stack 组件是一个垂直堆叠布局组件,用于垂直排列元素并控制它们之间的间距。
7
7
  * 它提供了灵活的间距控制、对齐方式和分隔线选项,使垂直布局更加简单。
8
- *
8
+ *
9
9
  * @design
10
10
  * 设计理念:
11
11
  * 1. 简化布局 - 提供简单直观的方式创建垂直堆叠布局
12
12
  * 2. 一致性 - 通过预设的间距选项确保布局一致性
13
13
  * 3. 灵活性 - 支持多种对齐方式和分隔线选项
14
14
  * 4. 可组合性 - 可以与其他布局组件组合使用
15
- *
15
+ *
16
16
  * @usage
17
17
  * 基本用法:
18
18
  * ```astro
@@ -22,7 +22,7 @@
22
22
  * <div>第三个元素</div>
23
23
  * </Stack>
24
24
  * ```
25
- *
25
+ *
26
26
  * 自定义间距:
27
27
  * ```astro
28
28
  * <Stack gap="lg">
@@ -30,7 +30,7 @@
30
30
  * <div>垂直排列</div>
31
31
  * </Stack>
32
32
  * ```
33
- *
33
+ *
34
34
  * 带分隔线:
35
35
  * ```astro
36
36
  * <Stack dividers={true} dividerColor="primary">
@@ -38,7 +38,7 @@
38
38
  * <div>使用主题色</div>
39
39
  * </Stack>
40
40
  * ```
41
- *
41
+ *
42
42
  * 自定义对齐:
43
43
  * ```astro
44
44
  * <Stack align="center">
@@ -49,7 +49,7 @@
49
49
  */
50
50
 
51
51
  // 导入样式
52
- import '../../app.css';
52
+ import '../../style.ts';
53
53
 
54
54
  // 定义间距类型
55
55
  type GapSize = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
@@ -61,89 +61,91 @@ type AlignType = 'start' | 'center' | 'end' | 'stretch';
61
61
  type DividerColor = 'gray' | 'light' | 'dark' | 'primary';
62
62
 
63
63
  interface Props {
64
- /**
65
- * 元素间距
66
- * @default "md"
67
- */
68
- gap?: GapSize;
69
-
70
- /**
71
- * 是否显示分隔线
72
- * @default false
73
- */
74
- dividers?: boolean;
75
-
76
- /**
77
- * 分隔线颜色
78
- * @default "gray"
79
- */
80
- dividerColor?: DividerColor;
81
-
82
- /**
83
- * 对齐方式
84
- * @default "stretch"
85
- */
86
- align?: AlignType;
87
-
88
- /**
89
- * 自定义类名
90
- */
91
- class?: string;
92
-
93
- /**
94
- * 类名列表
95
- */
96
- 'class:list'?: any;
97
-
98
- [key: string]: any;
64
+ /**
65
+ * 元素间距
66
+ * @default "md"
67
+ */
68
+ gap?: GapSize;
69
+
70
+ /**
71
+ * 是否显示分隔线
72
+ * @default false
73
+ */
74
+ dividers?: boolean;
75
+
76
+ /**
77
+ * 分隔线颜色
78
+ * @default "gray"
79
+ */
80
+ dividerColor?: DividerColor;
81
+
82
+ /**
83
+ * 对齐方式
84
+ * @default "stretch"
85
+ */
86
+ align?: AlignType;
87
+
88
+ /**
89
+ * 自定义类名
90
+ */
91
+ class?: string;
92
+
93
+ /**
94
+ * 类名列表
95
+ */
96
+ 'class:list'?: any;
97
+
98
+ [key: string]: any;
99
99
  }
100
100
 
101
101
  const {
102
- gap = 'md',
103
- dividers = false,
104
- dividerColor = 'gray',
105
- align = 'stretch',
106
- class: className = '',
107
- 'class:list': classList,
108
- ...rest
102
+ gap = 'md',
103
+ dividers = false,
104
+ dividerColor = 'gray',
105
+ align = 'stretch',
106
+ class: className = '',
107
+ 'class:list': classList,
108
+ ...rest
109
109
  } = Astro.props;
110
110
 
111
111
  // 间距映射
112
112
  const gapClasses: Record<GapSize, string> = {
113
- 'none': 'stack-gap-none',
114
- 'xs': 'stack-gap-xs',
115
- 'sm': 'stack-gap-sm',
116
- 'md': 'stack-gap-md',
117
- 'lg': 'stack-gap-lg',
118
- 'xl': 'stack-gap-xl'
113
+ none: 'stack-gap-none',
114
+ xs: 'stack-gap-xs',
115
+ sm: 'stack-gap-sm',
116
+ md: 'stack-gap-md',
117
+ lg: 'stack-gap-lg',
118
+ xl: 'stack-gap-xl',
119
119
  };
120
120
 
121
121
  // 对齐方式映射
122
122
  const alignClasses: Record<AlignType, string> = {
123
- 'start': 'stack-align-start',
124
- 'center': 'stack-align-center',
125
- 'end': 'stack-align-end',
126
- 'stretch': 'stack-align-stretch'
123
+ start: 'stack-align-start',
124
+ center: 'stack-align-center',
125
+ end: 'stack-align-end',
126
+ stretch: 'stack-align-stretch',
127
127
  };
128
128
 
129
129
  // 分隔线颜色映射
130
130
  const dividerColorClasses: Record<DividerColor, string> = {
131
- 'gray': 'stack-divider-gray',
132
- 'light': 'stack-divider-light',
133
- 'dark': 'stack-divider-dark',
134
- 'primary': 'stack-divider-primary'
131
+ gray: 'stack-divider-gray',
132
+ light: 'stack-divider-light',
133
+ dark: 'stack-divider-dark',
134
+ primary: 'stack-divider-primary',
135
135
  };
136
136
 
137
137
  // 构建最终类名
138
138
  const stackClasses = [
139
- 'stack',
140
- alignClasses[align as AlignType],
141
- gapClasses[gap as GapSize],
142
- dividers ? `stack-divider ${dividerColorClasses[dividerColor as DividerColor]}` : '',
143
- className
144
- ].filter(Boolean).join(' ');
139
+ 'stack',
140
+ alignClasses[align as AlignType],
141
+ gapClasses[gap as GapSize],
142
+ dividers ? `stack-divider ${dividerColorClasses[dividerColor as DividerColor]}` : '',
143
+ className,
144
+ ]
145
+ .filter(Boolean)
146
+ .join(' ');
145
147
  ---
146
148
 
147
149
  <div class:list={[stackClasses, classList]} {...rest}>
148
- <slot />
150
+ <slot />
149
151
  </div>
@@ -27,8 +27,8 @@
27
27
  * ```
28
28
  */
29
29
 
30
- import ChevronDownIcon from '../icons/ChevronDownIcon.astro';
31
- import '../../app.css';
30
+ import { ChevronDownIcon } from '../../index';
31
+ import '../../style.ts';
32
32
  import { LanguageUtil } from '../../utils/language';
33
33
 
34
34
  interface Props {
@@ -53,7 +53,7 @@
53
53
  */
54
54
 
55
55
  // 导入样式
56
- import '../../app.css';
56
+ import '../../style.ts';
57
57
  import { createTextGetter } from '../../utils/i18n';
58
58
  import { LanguageUtil } from '../../utils/language';
59
59
 
@@ -26,8 +26,8 @@
26
26
  */
27
27
 
28
28
  import Button from '../base/Button.astro';
29
- import SunCloudyIcon from '../icons/SunCloudyIcon.astro';
30
- import '../../app.css';
29
+ import SunCloudyIcon from '../../icons/SunCloudyIcon.astro';
30
+ import '../../style.ts';
31
31
 
32
32
  interface Props {
33
33
  /**
@@ -104,8 +104,8 @@
104
104
  */
105
105
 
106
106
  // 导入样式
107
- import '../../app.css';
108
- import type { IArticleProps } from '@/types/article';
107
+ import '../../style.ts';
108
+ import type { IArticleProps } from '../../types/article';
109
109
 
110
110
  export interface Props extends IArticleProps {}
111
111
 
@@ -63,8 +63,8 @@
63
63
  * - LinkIcon (用于锚点链接)
64
64
  */
65
65
 
66
- import LinkIcon from '../icons/LinkIcon.astro';
67
- import '../../app.css';
66
+ import { LinkIcon } from '../../index';
67
+ import '../../style.ts';
68
68
 
69
69
  interface Props {
70
70
  level?: 1 | 2 | 3 | 4 | 5 | 6;
@@ -95,7 +95,7 @@
95
95
  * - 确保文本颜色与背景色的对比度符合WCAG标准
96
96
  */
97
97
 
98
- import '../../app.css';
98
+ import '../../style.ts';
99
99
 
100
100
  export interface Props {
101
101
  as?: string;
@@ -0,0 +1,24 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
4
+ interface Props {
5
+ /**
6
+ * 图标的大小
7
+ * @default "24px"
8
+ */
9
+ size?: string;
10
+ /**
11
+ * 图标的颜色
12
+ * @default "currentColor"
13
+ */
14
+ color?: string;
15
+ /**
16
+ * 自定义类名
17
+ */
18
+ class?: string;
19
+ }
20
+
21
+ const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
22
+ ---
23
+
24
+ <AstroIcon name="alertTriangle" size={size} color={color} class={className} />
@@ -0,0 +1,46 @@
1
+ ---
2
+ import { iconData } from '../assets/iconData';
3
+
4
+ interface Props {
5
+ /**
6
+ * 图标名称,必须在iconData中存在
7
+ */
8
+ name: string;
9
+ /**
10
+ * 图标的大小
11
+ * @default "24px"
12
+ */
13
+ size?: string;
14
+ /**
15
+ * 图标的颜色
16
+ * @default "currentColor"
17
+ */
18
+ color?: string;
19
+ /**
20
+ * 自定义类名
21
+ */
22
+ class?: string;
23
+ }
24
+
25
+ const { name, size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
26
+ const icon = iconData[name];
27
+ const viewBox = icon?.viewBox || '0 0 24 24';
28
+ ---
29
+
30
+ {
31
+ icon && (
32
+ <svg
33
+ xmlns="http://www.w3.org/2000/svg"
34
+ width={size}
35
+ height={size}
36
+ viewBox={viewBox}
37
+ fill="none"
38
+ stroke={color}
39
+ stroke-width="2"
40
+ stroke-linecap="round"
41
+ stroke-linejoin="round"
42
+ class={className}>
43
+ <path d={icon.path} />
44
+ </svg>
45
+ )
46
+ }
@@ -0,0 +1,24 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
4
+ interface Props {
5
+ /**
6
+ * 图标的大小
7
+ * @default "24px"
8
+ */
9
+ size?: string;
10
+ /**
11
+ * 图标的颜色
12
+ * @default "currentColor"
13
+ */
14
+ color?: string;
15
+ /**
16
+ * 自定义类名
17
+ */
18
+ class?: string;
19
+ }
20
+
21
+ const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
22
+ ---
23
+
24
+ <AstroIcon name="calendar" size={size} color={color} class={className} />
@@ -0,0 +1,23 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+ interface Props {
4
+ /**
5
+ * 图标的大小
6
+ * @default "24px"
7
+ */
8
+ size?: string;
9
+ /**
10
+ * 图标的颜色
11
+ * @default "currentColor"
12
+ */
13
+ color?: string;
14
+ /**
15
+ * 自定义类名
16
+ */
17
+ class?: string;
18
+ }
19
+
20
+ const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
21
+ ---
22
+
23
+ <AstroIcon name="checkCircle" size={size} color={color} class={className} />
@@ -0,0 +1,27 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
4
+ /**
5
+ * 检查图标组件
6
+ */
7
+ interface Props {
8
+ /**
9
+ * 图标的大小
10
+ * @default "24px"
11
+ */
12
+ size?: string;
13
+ /**
14
+ * 图标的颜色
15
+ * @default "currentColor"
16
+ */
17
+ color?: string;
18
+ /**
19
+ * 自定义类名
20
+ */
21
+ class?: string;
22
+ }
23
+
24
+ const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
25
+ ---
26
+
27
+ <AstroIcon name="check" size={size} color={color} class={className} />
@@ -1,4 +1,6 @@
1
1
  ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
2
4
  interface Props {
3
5
  /**
4
6
  * 图标的大小
@@ -19,16 +21,4 @@ interface Props {
19
21
  const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
20
22
  ---
21
23
 
22
- <svg
23
- xmlns="http://www.w3.org/2000/svg"
24
- width={size}
25
- height={size}
26
- viewBox="0 0 24 24"
27
- fill="none"
28
- stroke={color}
29
- stroke-width="2"
30
- stroke-linecap="round"
31
- stroke-linejoin="round"
32
- class={className}>
33
- <path d="M19 9l-7 7-7-7"></path>
34
- </svg>
24
+ <AstroIcon name="chevronDown" size={size} color={color} class={className} />
@@ -0,0 +1,27 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
4
+ /**
5
+ * 剪贴板图标组件
6
+ */
7
+ interface Props {
8
+ /**
9
+ * 图标的大小
10
+ * @default "24px"
11
+ */
12
+ size?: string;
13
+ /**
14
+ * 图标的颜色
15
+ * @default "currentColor"
16
+ */
17
+ color?: string;
18
+ /**
19
+ * 自定义类名
20
+ */
21
+ class?: string;
22
+ }
23
+
24
+ const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
25
+ ---
26
+
27
+ <AstroIcon name="clipboard" size={size} color={color} class={className} />
@@ -0,0 +1,27 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
4
+ /**
5
+ * 关闭图标组件
6
+ */
7
+ interface Props {
8
+ /**
9
+ * 图标的大小
10
+ * @default "16px"
11
+ */
12
+ size?: string;
13
+ /**
14
+ * 图标的颜色
15
+ * @default "currentColor"
16
+ */
17
+ color?: string;
18
+ /**
19
+ * 自定义类名
20
+ */
21
+ class?: string;
22
+ }
23
+
24
+ const { size = '16px', color = 'currentColor', class: className = '' } = Astro.props;
25
+ ---
26
+
27
+ <AstroIcon name="close" size={size} color={color} class={className} />
@@ -0,0 +1,24 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
4
+ interface Props {
5
+ /**
6
+ * 图标的大小
7
+ * @default "24px"
8
+ */
9
+ size?: string;
10
+ /**
11
+ * 图标的颜色
12
+ * @default "currentColor"
13
+ */
14
+ color?: string;
15
+ /**
16
+ * 自定义类名
17
+ */
18
+ class?: string;
19
+ }
20
+
21
+ const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
22
+ ---
23
+
24
+ <AstroIcon name="error" size={size} color={color} class={className} />
@@ -0,0 +1,24 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
4
+ interface Props {
5
+ /**
6
+ * 图标的大小
7
+ * @default "24px"
8
+ */
9
+ size?: string;
10
+ /**
11
+ * 图标的颜色
12
+ * @default "currentColor"
13
+ */
14
+ color?: string;
15
+ /**
16
+ * 自定义类名
17
+ */
18
+ class?: string;
19
+ }
20
+
21
+ const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
22
+ ---
23
+
24
+ <AstroIcon name="github" size={size} color={color} class={className} />
@@ -0,0 +1,24 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
4
+ interface Props {
5
+ /**
6
+ * 图标的大小
7
+ * @default "24px"
8
+ */
9
+ size?: string;
10
+ /**
11
+ * 图标的颜色
12
+ * @default "currentColor"
13
+ */
14
+ color?: string;
15
+ /**
16
+ * 自定义类名
17
+ */
18
+ class?: string;
19
+ }
20
+
21
+ const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
22
+ ---
23
+
24
+ <AstroIcon name="infoCircle" size={size} color={color} class={className} />