@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
@@ -1,44 +1,44 @@
1
1
  ---
2
2
  /**
3
3
  * @component Button
4
- *
4
+ *
5
5
  * @description
6
6
  * Button 组件用于触发一个即时操作,如表单提交、打开对话框等。
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
  * 视觉特点:
17
17
  * - 悬停效果:轻微上浮和阴影增强
18
18
  * - 点击效果:轻微下沉
19
19
  * - 加载状态:显示加载动画
20
20
  * - 多种颜色变体:适应不同场景和语义
21
21
  * - 多种尺寸:适应不同布局需求
22
- *
22
+ *
23
23
  * @usage
24
24
  * 基本用法:
25
25
  * ```astro
26
26
  * <Button>默认按钮</Button>
27
27
  * <Button variant="primary">主要按钮</Button>
28
28
  * ```
29
- *
29
+ *
30
30
  * 不同尺寸:
31
31
  * ```astro
32
32
  * <Button size="sm">小型按钮</Button>
33
33
  * <Button size="lg">大型按钮</Button>
34
34
  * ```
35
- *
35
+ *
36
36
  * 状态变化:
37
37
  * ```astro
38
38
  * <Button disabled>禁用按钮</Button>
39
39
  * <Button loading>加载中</Button>
40
40
  * ```
41
- *
41
+ *
42
42
  * 带图标:
43
43
  * ```astro
44
44
  * <Button>
@@ -49,103 +49,114 @@
49
49
  */
50
50
 
51
51
  // 导入样式
52
- import '../../app.css';
52
+ import '../../style.ts';
53
53
 
54
54
  interface Props {
55
- variant?: 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'ghost' | 'link' | 'outline' | 'neutral';
56
- size?: 'lg' | 'md' | 'sm' | 'xs';
57
- shape?: 'circle' | 'square';
58
- wide?: boolean;
59
- block?: boolean;
60
- loading?: boolean;
61
- disabled?: boolean;
62
- type?: 'button' | 'submit' | 'reset';
63
- class?: string;
64
- onClick?: string;
65
- formmethod?: string;
55
+ variant?:
56
+ | 'primary'
57
+ | 'secondary'
58
+ | 'accent'
59
+ | 'info'
60
+ | 'success'
61
+ | 'warning'
62
+ | 'error'
63
+ | 'ghost'
64
+ | 'link'
65
+ | 'outline'
66
+ | 'neutral';
67
+ size?: 'lg' | 'md' | 'sm' | 'xs';
68
+ shape?: 'circle' | 'square';
69
+ wide?: boolean;
70
+ block?: boolean;
71
+ loading?: boolean;
72
+ disabled?: boolean;
73
+ type?: 'button' | 'submit' | 'reset';
74
+ class?: string;
75
+ onClick?: string;
76
+ formmethod?: string;
66
77
  }
67
78
 
68
79
  const {
69
- variant = 'primary',
70
- size = 'md',
71
- shape,
72
- wide = false,
73
- block = false,
74
- loading = false,
75
- disabled = false,
76
- type = 'button',
77
- class: className,
78
- onClick,
79
- formmethod,
80
+ variant = 'primary',
81
+ size = 'md',
82
+ shape,
83
+ wide = false,
84
+ block = false,
85
+ loading = false,
86
+ disabled = false,
87
+ type = 'button',
88
+ class: className,
89
+ onClick,
90
+ formmethod,
80
91
  } = Astro.props;
81
92
 
82
93
  // 计算按钮的类名
83
94
  const getButtonClasses = () => {
84
- const classes = ['cosy:btn'];
85
-
86
- // Variant classes
87
- const variantClasses = {
88
- primary: 'cosy:btn-primary',
89
- secondary: 'cosy:btn-secondary',
90
- accent: 'cosy:btn-accent',
91
- info: 'cosy:btn-info',
92
- success: 'cosy:btn-success',
93
- warning: 'cosy:btn-warning',
94
- error: 'cosy:btn-error',
95
- ghost: 'cosy:btn-ghost',
96
- link: 'cosy:btn-link',
97
- outline: 'cosy:btn-outline',
98
- neutral: 'cosy:btn-neutral'
99
- };
100
-
101
- // Size classes
102
- const sizeClasses = {
103
- lg: 'cosy:btn-lg',
104
- md: 'cosy:btn-md',
105
- sm: 'cosy:btn-sm',
106
- xs: 'cosy:btn-xs'
107
- };
108
-
109
- // Shape classes
110
- const shapeClasses = {
111
- circle: 'cosy:btn-circle',
112
- square: 'cosy:btn-square'
113
- };
95
+ const classes = ['cosy:btn'];
114
96
 
115
- if (variantClasses[variant]) {
116
- classes.push(variantClasses[variant]);
117
- }
118
-
119
- if (sizeClasses[size]) {
120
- classes.push(sizeClasses[size]);
121
- }
122
-
123
- if (shape && shapeClasses[shape]) {
124
- classes.push(shapeClasses[shape]);
125
- }
126
-
127
- if (wide) classes.push('cosy:btn-wide');
128
- if (block) classes.push('cosy:btn-block');
129
- if (loading) classes.push('cosy:loading');
130
- if (className) classes.push(className);
131
-
132
- return classes;
97
+ // Variant classes
98
+ const variantClasses = {
99
+ primary: 'cosy:btn-primary',
100
+ secondary: 'cosy:btn-secondary',
101
+ accent: 'cosy:btn-accent',
102
+ info: 'cosy:btn-info',
103
+ success: 'cosy:btn-success',
104
+ warning: 'cosy:btn-warning',
105
+ error: 'cosy:btn-error',
106
+ ghost: 'cosy:btn-ghost',
107
+ link: 'cosy:btn-link',
108
+ outline: 'cosy:btn-outline',
109
+ neutral: 'cosy:btn-neutral',
110
+ };
111
+
112
+ // Size classes
113
+ const sizeClasses = {
114
+ lg: 'cosy:btn-lg',
115
+ md: 'cosy:btn-md',
116
+ sm: 'cosy:btn-sm',
117
+ xs: 'cosy:btn-xs',
118
+ };
119
+
120
+ // Shape classes
121
+ const shapeClasses = {
122
+ circle: 'cosy:btn-circle',
123
+ square: 'cosy:btn-square',
124
+ };
125
+
126
+ if (variantClasses[variant]) {
127
+ classes.push(variantClasses[variant]);
128
+ }
129
+
130
+ if (sizeClasses[size]) {
131
+ classes.push(sizeClasses[size]);
132
+ }
133
+
134
+ if (shape && shapeClasses[shape]) {
135
+ classes.push(shapeClasses[shape]);
136
+ }
137
+
138
+ if (wide) classes.push('cosy:btn-wide');
139
+ if (block) classes.push('cosy:btn-block');
140
+ if (loading) classes.push('cosy:loading');
141
+ if (className) classes.push(className);
142
+
143
+ return classes;
133
144
  };
134
145
 
135
146
  const buttonClasses = getButtonClasses();
136
147
  ---
137
148
 
138
149
  <button
139
- type={formmethod === 'dialog' ? 'submit' : type}
140
- class:list={buttonClasses}
141
- disabled={disabled}
142
- onclick={onClick}
143
- formmethod={formmethod}
144
- data-variant={variant}
145
- >
146
- <span class="cosy:flex cosy:items-center cosy:gap-2">
147
- <slot name="icon-left" />
148
- <slot />
149
- <slot name="icon-right" />
150
- </span>
151
- </button>
150
+ type={formmethod === 'dialog' ? 'submit' : type}
151
+ class:list={buttonClasses}
152
+ disabled={disabled}
153
+ onclick={onClick}
154
+ formmethod={formmethod}
155
+ data-variant={variant}>
156
+ <span class="cosy:flex cosy:items-center cosy:gap-2">
157
+ <slot name="icon-left" />
158
+ <slot />
159
+ <slot name="icon-right" />
160
+ </span>
161
+ </button>
162
+
@@ -41,7 +41,7 @@
41
41
  * ```
42
42
  */
43
43
 
44
- import '../../app.css';
44
+ import '../../style.ts';
45
45
  import { AlertTriangle } from '../../index';
46
46
 
47
47
  // 自定义图片元数据接口
@@ -54,7 +54,7 @@
54
54
  * ```
55
55
  */
56
56
 
57
- import '../../app.css';
57
+ import '../../style.ts';
58
58
 
59
59
  import type { HTMLAttributes } from 'astro/types';
60
60
 
@@ -67,7 +67,7 @@
67
67
  */
68
68
 
69
69
  import type { HTMLAttributes } from 'astro/types';
70
- import '../../app.css';
70
+ import '../../style.ts';
71
71
 
72
72
  interface Props extends HTMLAttributes<'div'> {
73
73
  /**
@@ -47,7 +47,7 @@
47
47
  * </Main>
48
48
  * ```
49
49
  */
50
- import '../../app.css';
50
+ import '../../style.ts';
51
51
  import type { IMainContentProps } from '../../index';
52
52
  import Article from '../typography/Article.astro';
53
53
  import TableOfContents from '../navigation/TableOfContents.astro';
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  /**
3
3
  * Section组件
4
- *
4
+ *
5
5
  * 一个用于页面内容区块的组件,支持不同的内边距、背景和间距
6
- *
6
+ *
7
7
  * @example
8
8
  * ```astro
9
9
  * <Section>
10
10
  * <h2>默认区块</h2>
11
11
  * <p>内容将被包裹在一个合适的区块中</p>
12
12
  * </Section>
13
- *
13
+ *
14
14
  * <Section padding="lg" background="gray" centered={true} border={true}>
15
15
  * <h2>自定义区块</h2>
16
16
  * <p>大内边距,灰色背景,内容居中,带边框</p>
@@ -20,105 +20,105 @@
20
20
 
21
21
  import type { HTMLAttributes } from 'astro/types';
22
22
  import Container from './Container.astro';
23
- import "../../app.css"
23
+ import '../../style.ts';
24
24
 
25
25
  interface Props extends HTMLAttributes<'section'> {
26
- /**
27
- * 内边距大小
28
- * @default "md"
29
- */
30
- padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
31
-
32
- /**
33
- * 背景颜色
34
- * @default "transparent"
35
- */
36
- background?: 'transparent' | 'white' | 'gray' | 'primary' | 'secondary' | 'dark';
37
-
38
- /**
39
- * 是否使用容器包裹内容
40
- * @default true
41
- */
42
- container?: boolean;
43
-
44
- /**
45
- * 容器尺寸,仅当container为true时有效
46
- * @default "md"
47
- */
48
- containerSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
49
-
50
- /**
51
- * 内容是否居中
52
- * @default false
53
- */
54
- centered?: boolean;
55
-
56
- /**
57
- * 是否显示边框
58
- * @default false
59
- */
60
- border?: boolean;
61
-
62
- /**
63
- * 自定义类名
64
- */
65
- class?: string;
66
-
67
- /**
68
- * 类名列表
69
- */
70
- 'class:list'?: any;
71
-
72
- /**
73
- * 自定义ID
74
- */
75
- id?: string;
76
-
77
- /**
78
- * 自定义内联样式
79
- */
80
- style?: string;
26
+ /**
27
+ * 内边距大小
28
+ * @default "md"
29
+ */
30
+ padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
31
+
32
+ /**
33
+ * 背景颜色
34
+ * @default "transparent"
35
+ */
36
+ background?: 'transparent' | 'white' | 'gray' | 'primary' | 'secondary' | 'dark';
37
+
38
+ /**
39
+ * 是否使用容器包裹内容
40
+ * @default true
41
+ */
42
+ container?: boolean;
43
+
44
+ /**
45
+ * 容器尺寸,仅当container为true时有效
46
+ * @default "md"
47
+ */
48
+ containerSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
49
+
50
+ /**
51
+ * 内容是否居中
52
+ * @default false
53
+ */
54
+ centered?: boolean;
55
+
56
+ /**
57
+ * 是否显示边框
58
+ * @default false
59
+ */
60
+ border?: boolean;
61
+
62
+ /**
63
+ * 自定义类名
64
+ */
65
+ class?: string;
66
+
67
+ /**
68
+ * 类名列表
69
+ */
70
+ 'class:list'?: any;
71
+
72
+ /**
73
+ * 自定义ID
74
+ */
75
+ id?: string;
76
+
77
+ /**
78
+ * 自定义内联样式
79
+ */
80
+ style?: string;
81
81
  }
82
82
 
83
83
  const {
84
- padding = 'md',
85
- background = 'transparent',
86
- container = true,
87
- containerSize = 'md',
88
- centered = false,
89
- border = false,
90
- class: className = '',
91
- 'class:list': classList,
92
- id,
93
- style,
94
- ...rest
84
+ padding = 'md',
85
+ background = 'transparent',
86
+ container = true,
87
+ containerSize = 'md',
88
+ centered = false,
89
+ border = false,
90
+ class: className = '',
91
+ 'class:list': classList,
92
+ id,
93
+ style,
94
+ ...rest
95
95
  } = Astro.props;
96
96
 
97
97
  // 内边距映射
98
98
  const paddingClasses = {
99
- 'none': 'cosy:py-0',
100
- 'sm': 'cosy:py-6',
101
- 'md': 'cosy:py-12',
102
- 'lg': 'cosy:py-16',
103
- 'xl': 'cosy:py-24'
99
+ none: 'cosy:py-0',
100
+ sm: 'cosy:py-6',
101
+ md: 'cosy:py-12',
102
+ lg: 'cosy:py-16',
103
+ xl: 'cosy:py-24',
104
104
  };
105
105
 
106
106
  // 背景颜色映射
107
107
  const backgroundClasses = {
108
- 'transparent': 'cosy:bg-transparent',
109
- 'white': 'cosy:bg-base-100',
110
- 'gray': 'cosy:bg-base-200',
111
- 'primary': 'cosy:bg-primary/10',
112
- 'secondary': 'cosy:bg-secondary/10',
113
- 'dark': 'cosy:bg-neutral cosy:text-neutral-content'
108
+ transparent: 'cosy:bg-transparent',
109
+ white: 'cosy:bg-base-100',
110
+ gray: 'cosy:bg-base-200',
111
+ primary: 'cosy:bg-primary/10',
112
+ secondary: 'cosy:bg-secondary/10',
113
+ dark: 'cosy:bg-neutral cosy:text-neutral-content',
114
114
  };
115
115
 
116
116
  // 构建最终类名
117
117
  const sectionClasses = [
118
- paddingClasses[padding as keyof typeof paddingClasses],
119
- backgroundClasses[background as keyof typeof backgroundClasses],
120
- border ? 'cosy:border cosy:rounded-lg' : '',
121
- className
118
+ paddingClasses[padding as keyof typeof paddingClasses],
119
+ backgroundClasses[background as keyof typeof backgroundClasses],
120
+ border ? 'cosy:border cosy:rounded-lg' : '',
121
+ className,
122
122
  ].join(' ');
123
123
 
124
124
  // 内容类名
@@ -126,13 +126,15 @@ const contentClasses = centered ? 'cosy:text-center' : '';
126
126
  ---
127
127
 
128
128
  <section id={id} class:list={[sectionClasses, classList]} style={style} {...rest}>
129
- {container ? (
130
- <Container size={containerSize} class={contentClasses}>
131
- <slot />
132
- </Container>
133
- ) : (
134
- <div class={contentClasses}>
135
- <slot />
136
- </div>
137
- )}
129
+ {
130
+ container ? (
131
+ <Container size={containerSize} class={contentClasses}>
132
+ <slot />
133
+ </Container>
134
+ ) : (
135
+ <div class={contentClasses}>
136
+ <slot />
137
+ </div>
138
+ )
139
+ }
138
140
  </section>
@@ -39,7 +39,7 @@
39
39
  * ```
40
40
  */
41
41
 
42
- import '../../app.css';
42
+ import '../../style.ts';
43
43
  import { UserIcon, CalendarIcon } from '../../index';
44
44
 
45
45
  interface Props {
@@ -66,10 +66,8 @@
66
66
  * ```
67
67
  */
68
68
 
69
- import Link from '../base/Link.astro';
70
- import Image from '../base/Image.astro';
71
- import SocialIcon from '../icons/SocialIcon.astro';
72
- import '../../app.css';
69
+ import { SocialIcon, Image, Link } from '../../index';
70
+ import '../../style.ts';
73
71
 
74
72
  // 自定义图片元数据接口,替代 astro 的 ImageMetadata
75
73
  interface CustomImageMetadata {
@@ -62,8 +62,8 @@
62
62
  * ```
63
63
  */
64
64
 
65
- import ProductCard from './ProductCard.astro';
66
- import '../../app.css';
65
+ import { ProductCard } from '../../index';
66
+ import '../../style.ts';
67
67
  import type { Props as ProductCardProps } from './ProductCard.astro';
68
68
 
69
69
  // 定义产品项类型
@@ -40,10 +40,8 @@
40
40
  * ```
41
41
  */
42
42
 
43
- import Link from '../base/Link.astro';
44
- import SocialIcon from '../icons/SocialIcon.astro';
45
- import Image from '../base/Image.astro';
46
- import '../../app.css';
43
+ import { SocialIcon, Image, Link } from '../../index';
44
+ import '../../style.ts';
47
45
 
48
46
  interface SocialLink {
49
47
  /**
@@ -30,7 +30,7 @@
30
30
  */
31
31
 
32
32
  import TeamMember from './TeamMember.astro';
33
- import '../../app.css';
33
+ import '../../style.ts';
34
34
 
35
35
  // 自定义图片元数据接口
36
36
  interface ImageMetadata {
@@ -40,7 +40,7 @@
40
40
  * - 动画遵循 prefers-reduced-motion 媒体查询,尊重用户的动画偏好设置
41
41
  */
42
42
 
43
- import '../../app.css';
43
+ import '../../style.ts';
44
44
 
45
45
  interface Props {
46
46
  /**
@@ -68,7 +68,7 @@
68
68
  * - 动画遵循 prefers-reduced-motion 媒体查询,尊重用户的动画偏好设置
69
69
  */
70
70
 
71
- import '../../app.css';
71
+ import '../../style.ts';
72
72
 
73
73
  interface Props {
74
74
  title?: string;
@@ -47,7 +47,7 @@
47
47
  * - 代码使用等宽字体,确保对齐和可读性
48
48
  */
49
49
 
50
- import '../../app.css';
50
+ import '../../style.ts';
51
51
 
52
52
  interface Props {
53
53
  code: string;
@@ -28,7 +28,7 @@
28
28
  */
29
29
 
30
30
  import { ClipboardIcon, CheckIcon } from '../../index';
31
- import '../../app.css';
31
+ import '../../style.ts';
32
32
 
33
33
  interface Props {
34
34
  title?: string;
@@ -150,7 +150,7 @@
150
150
  * @prop {number} [overlayOpacity=0.7] - 遮罩的不透明度,可选值:0-1之间的数字
151
151
  */
152
152
 
153
- import '../../app.css';
153
+ import '../../style.ts';
154
154
  import Link from '../base/Link.astro';
155
155
 
156
156
  interface Link {
@@ -44,7 +44,7 @@
44
44
  * ```
45
45
  */
46
46
 
47
- import '../../app.css';
47
+ import '../../style.ts';
48
48
  import Button from '../base/Button.astro';
49
49
 
50
50
  interface Props {
@@ -165,15 +165,11 @@
165
165
  * ```
166
166
  */
167
167
 
168
- import '../../app.css';
169
- import BaseLayout from './BaseLayout.astro';
170
- import Footer from './Footer.astro';
168
+ import '../../style.ts';
169
+ import { BaseLayout, type IAppLayoutProps, Footer, Header, Container } from '../../index';
171
170
  import Main from '../containers/Main.astro';
172
- import Header from './Header.astro';
173
171
  import Sidebar from './Sidebar.astro';
174
172
  import { ClientRouter } from 'astro:transitions';
175
- import type { IAppLayoutProps } from '../../index';
176
- import Container from '../containers/Container.astro';
177
173
 
178
174
  interface Props extends IAppLayoutProps {}
179
175