@coffic/cosy-ui 0.8.7 → 0.8.11

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 (159) hide show
  1. package/dist/app.css +1 -1
  2. package/dist/src-astro/alert/index.ts +7 -15
  3. package/dist/src-astro/assets/iconData.ts +211 -106
  4. package/dist/src-astro/button/index_astro.ts +2 -56
  5. package/dist/src-astro/card/CardCourse.astro +31 -11
  6. package/dist/src-astro/card/index.ts +15 -25
  7. package/dist/src-astro/code-container/CodeContainer.astro +205 -5
  8. package/dist/src-astro/code-container/index.ts +9 -13
  9. package/dist/src-astro/contact/index.ts +16 -20
  10. package/dist/src-astro/errors/index.ts +0 -62
  11. package/dist/src-astro/footer/index.ts +1 -30
  12. package/dist/src-astro/header/Header.astro +1 -2
  13. package/dist/src-astro/header/index.ts +1 -40
  14. package/dist/src-astro/hero/Hero.astro +1 -1
  15. package/dist/src-astro/hero/index.ts +1 -39
  16. package/dist/src-astro/icons/ChartIcon.astro +28 -0
  17. package/dist/src-astro/icons/DashboardIcon.astro +28 -0
  18. package/dist/src-astro/icons/DeleteIcon.astro +28 -0
  19. package/dist/src-astro/icons/DocumentIcon.astro +28 -0
  20. package/dist/src-astro/icons/DownloadIcon.astro +28 -0
  21. package/dist/src-astro/icons/EditIcon.astro +28 -0
  22. package/dist/src-astro/icons/FolderIcon.astro +28 -0
  23. package/dist/src-astro/icons/HeartIcon.astro +28 -0
  24. package/dist/src-astro/icons/HomeIcon.astro +28 -0
  25. package/dist/src-astro/icons/MailIcon.astro +28 -0
  26. package/dist/src-astro/icons/MessageIcon.astro +28 -0
  27. package/dist/src-astro/icons/NotificationIcon.astro +28 -0
  28. package/dist/src-astro/icons/RefreshIcon.astro +28 -0
  29. package/dist/src-astro/icons/ReportIcon.astro +28 -0
  30. package/dist/src-astro/icons/SaveIcon.astro +28 -0
  31. package/dist/src-astro/icons/SecurityIcon.astro +28 -0
  32. package/dist/src-astro/icons/StarIcon.astro +28 -0
  33. package/dist/src-astro/icons/ToolsIcon.astro +28 -0
  34. package/dist/src-astro/icons/UploadIcon.astro +28 -0
  35. package/dist/src-astro/icons/UsersIcon.astro +28 -0
  36. package/dist/src-astro/icons/WalletIcon.astro +28 -0
  37. package/dist/src-astro/icons/index.ts +21 -0
  38. package/dist/src-astro/layout-app/index.ts +5 -9
  39. package/dist/src-astro/layout-dashboard/DashboardLayout.astro +101 -555
  40. package/dist/src-astro/layout-dashboard/DashboardSidebar.astro +206 -0
  41. package/dist/src-astro/layout-dashboard/DashboardTopNavbar.astro +132 -0
  42. package/dist/src-astro/layout-dashboard/index.ts +14 -8
  43. package/dist/src-astro/layout-dashboard/tools.ts +0 -0
  44. package/dist/src-astro/layout-dashboard/types.ts +313 -0
  45. package/package.json +4 -4
  46. package/dist/src-astro/alert/EAlertBasic.astro +0 -11
  47. package/dist/src-astro/alert/EAlertBasicContainer.astro +0 -11
  48. package/dist/src-astro/alert/EAlertCustomStyle.astro +0 -16
  49. package/dist/src-astro/alert/EAlertCustomStyleContainer.astro +0 -11
  50. package/dist/src-astro/alert/EAlertError.astro +0 -6
  51. package/dist/src-astro/alert/EAlertInfo.astro +0 -6
  52. package/dist/src-astro/alert/EAlertSuccess.astro +0 -6
  53. package/dist/src-astro/alert/EAlertTypesContainer.astro +0 -43
  54. package/dist/src-astro/alert/EAlertWarning.astro +0 -6
  55. package/dist/src-astro/alert/EAlertWithTitle.astro +0 -12
  56. package/dist/src-astro/alert/EAlertWithTitleContainer.astro +0 -11
  57. package/dist/src-astro/button/ButtonBasic.astro +0 -18
  58. package/dist/src-astro/button/ButtonBasicContainer.astro +0 -11
  59. package/dist/src-astro/button/ButtonBlock.astro +0 -5
  60. package/dist/src-astro/button/ButtonError.astro +0 -5
  61. package/dist/src-astro/button/ButtonGhost.astro +0 -5
  62. package/dist/src-astro/button/ButtonIconBoth.astro +0 -9
  63. package/dist/src-astro/button/ButtonIconLeft.astro +0 -8
  64. package/dist/src-astro/button/ButtonIconRight.astro +0 -8
  65. package/dist/src-astro/button/ButtonInfo.astro +0 -5
  66. package/dist/src-astro/button/ButtonLinkContainer.astro +0 -19
  67. package/dist/src-astro/button/ButtonNeutral.astro +0 -5
  68. package/dist/src-astro/button/ButtonOutline.astro +0 -5
  69. package/dist/src-astro/button/ButtonShapeCircle.astro +0 -5
  70. package/dist/src-astro/button/ButtonShapeDefault.astro +0 -5
  71. package/dist/src-astro/button/ButtonShapeSquare.astro +0 -5
  72. package/dist/src-astro/button/ButtonShapes.astro +0 -23
  73. package/dist/src-astro/button/ButtonShapesContainer.astro +0 -29
  74. package/dist/src-astro/button/ButtonSizes.astro +0 -15
  75. package/dist/src-astro/button/ButtonSizesContainer.astro +0 -11
  76. package/dist/src-astro/button/ButtonStates.astro +0 -12
  77. package/dist/src-astro/button/ButtonStatesContainer.astro +0 -11
  78. package/dist/src-astro/button/ButtonSuccess.astro +0 -5
  79. package/dist/src-astro/button/ButtonVariantsContainer.astro +0 -73
  80. package/dist/src-astro/button/ButtonWarning.astro +0 -5
  81. package/dist/src-astro/button/ButtonWide.astro +0 -5
  82. package/dist/src-astro/button/ButtonWidth.astro +0 -8
  83. package/dist/src-astro/button/ButtonWidthContainer.astro +0 -19
  84. package/dist/src-astro/button/ButtonWithIcons.astro +0 -25
  85. package/dist/src-astro/button/ButtonWithIconsContainer.astro +0 -29
  86. package/dist/src-astro/card/CardBasic.astro +0 -5
  87. package/dist/src-astro/card/ECardBasic.astro +0 -13
  88. package/dist/src-astro/card/ECardBasicContainer.astro +0 -11
  89. package/dist/src-astro/card/ECardClickable.astro +0 -16
  90. package/dist/src-astro/card/ECardClickableContainer.astro +0 -11
  91. package/dist/src-astro/card/ECardCompact.astro +0 -13
  92. package/dist/src-astro/card/ECardCompactContainer.astro +0 -11
  93. package/dist/src-astro/card/ECardCustomStyle.astro +0 -17
  94. package/dist/src-astro/card/ECardCustomStyleContainer.astro +0 -11
  95. package/dist/src-astro/card/ECardWithImage.astro +0 -16
  96. package/dist/src-astro/card/ECardWithImageContainer.astro +0 -11
  97. package/dist/src-astro/card/ECardWithSubtitle.astro +0 -13
  98. package/dist/src-astro/card/ECardWithSubtitleContainer.astro +0 -11
  99. package/dist/src-astro/code-container/ECodeContainerBasic.astro +0 -19
  100. package/dist/src-astro/code-container/ECodeContainerMultiple.astro +0 -49
  101. package/dist/src-astro/contact/EContactBasic.astro +0 -15
  102. package/dist/src-astro/contact/EContactBasicContainer.astro +0 -11
  103. package/dist/src-astro/contact/EContactCompact.astro +0 -11
  104. package/dist/src-astro/contact/EContactCompactContainer.astro +0 -11
  105. package/dist/src-astro/contact/EContactCustomStyle.astro +0 -21
  106. package/dist/src-astro/contact/EContactCustomStyleContainer.astro +0 -11
  107. package/dist/src-astro/contact/EContactSocial.astro +0 -20
  108. package/dist/src-astro/contact/EContactSocialContainer.astro +0 -11
  109. package/dist/src-astro/contact/EContactWithTitle.astro +0 -17
  110. package/dist/src-astro/contact/EContactWithTitleContainer.astro +0 -11
  111. package/dist/src-astro/errors/E403Basic.astro +0 -11
  112. package/dist/src-astro/errors/E403BasicContainer.astro +0 -20
  113. package/dist/src-astro/errors/E404Basic.astro +0 -11
  114. package/dist/src-astro/errors/E404BasicContainer.astro +0 -20
  115. package/dist/src-astro/errors/E404WithDebug.astro +0 -18
  116. package/dist/src-astro/errors/E500Basic.astro +0 -11
  117. package/dist/src-astro/errors/E500BasicContainer.astro +0 -20
  118. package/dist/src-astro/errors/E503Maintenance.astro +0 -20
  119. package/dist/src-astro/errors/E503MaintenanceContainer.astro +0 -21
  120. package/dist/src-astro/errors/EErrorPageCustomStyle.astro +0 -21
  121. package/dist/src-astro/errors/EErrorPageCustomStyleContainer.astro +0 -21
  122. package/dist/src-astro/errors/EErrorPageShowcase.astro +0 -68
  123. package/dist/src-astro/errors/EErrorPageShowcaseContainer.astro +0 -21
  124. package/dist/src-astro/footer/EFooterBasic.astro +0 -18
  125. package/dist/src-astro/footer/EFooterBasicContainer.astro +0 -11
  126. package/dist/src-astro/footer/EFooterComplete.astro +0 -50
  127. package/dist/src-astro/footer/EFooterCompleteContainer.astro +0 -11
  128. package/dist/src-astro/footer/EFooterFeaturesContainer.astro +0 -40
  129. package/dist/src-astro/footer/EFooterWithLogo.astro +0 -28
  130. package/dist/src-astro/footer/EFooterWithLogoContainer.astro +0 -11
  131. package/dist/src-astro/footer/EFooterWithNavigation.astro +0 -24
  132. package/dist/src-astro/footer/EFooterWithNavigationContainer.astro +0 -11
  133. package/dist/src-astro/footer/EFooterWithProducts.astro +0 -24
  134. package/dist/src-astro/footer/EFooterWithProductsContainer.astro +0 -11
  135. package/dist/src-astro/footer/EFooterWithSocial.astro +0 -24
  136. package/dist/src-astro/footer/EFooterWithSocialContainer.astro +0 -11
  137. package/dist/src-astro/header/HeaderBasic.astro +0 -19
  138. package/dist/src-astro/header/HeaderCustomNavbarCenter.astro +0 -28
  139. package/dist/src-astro/header/HeaderCustomNavbarEnd.astro +0 -25
  140. package/dist/src-astro/header/HeaderCustomNavbarStart.astro +0 -27
  141. package/dist/src-astro/header/HeaderCustomPosition.astro +0 -34
  142. package/dist/src-astro/header/HeaderWithNavigation.astro +0 -27
  143. package/dist/src-astro/hero/HeroAlignCenter.astro +0 -13
  144. package/dist/src-astro/hero/HeroAlignContainer.astro +0 -27
  145. package/dist/src-astro/hero/HeroAlignLeft.astro +0 -13
  146. package/dist/src-astro/hero/HeroAlignRight.astro +0 -13
  147. package/dist/src-astro/hero/HeroBackgroundContainer.astro +0 -18
  148. package/dist/src-astro/hero/HeroBackgroundImage.astro +0 -16
  149. package/dist/src-astro/hero/HeroBackgroundImageContainer.astro +0 -11
  150. package/dist/src-astro/hero/HeroBasic.astro +0 -12
  151. package/dist/src-astro/hero/HeroBasicContainer.astro +0 -11
  152. package/dist/src-astro/hero/HeroGradientBackground.astro +0 -10
  153. package/dist/src-astro/hero/HeroPlainBackground.astro +0 -10
  154. package/dist/src-astro/hero/HeroWithButton.astro +0 -15
  155. package/dist/src-astro/hero/HeroWithButtonContainer.astro +0 -11
  156. package/dist/src-astro/hero/HeroWithImage.astro +0 -16
  157. package/dist/src-astro/hero/HeroWithImageContainer.astro +0 -11
  158. package/dist/src-astro/layout-app/AppLayoutBasic.astro +0 -54
  159. package/dist/src-astro/layout-dashboard/DashboardLayoutBasic.astro +0 -51
@@ -3,12 +3,21 @@
3
3
  * @component CodeContainer
4
4
  *
5
5
  * @description
6
- * 用于展示代码示例的容器组件。使用时只需在默认slot中传入内容,
7
- * 并为每个示例设置对应的id (tab-1, tab-2等)
6
+ * 用于展示代码示例的容器组件,提供样式隔离功能防止内外样式相互影响。
7
+ * 支持两种隔离模式:样式重置模式和iframe完全隔离模式。
8
+ * 使用时只需在默认slot中传入内容,并为每个示例设置对应的id (tab-1, tab-2等)
9
+ *
10
+ * @features
11
+ * - 样式隔离:防止外部样式影响内部组件展示
12
+ * - 样式重置:重置内部样式,避免样式冲突
13
+ * - iframe模式:完全隔离的预览环境
14
+ * - 代码预览切换:支持预览和代码视图切换
15
+ * - 多标签页:支持多个示例的标签页展示
8
16
  *
9
17
  * @example
10
18
  * ```astro
11
- * <CodeContainer>
19
+ * <!-- 基础用法 -->
20
+ * <CodeContainer codes={[code1, code2]}>
12
21
  * <div id="tab-1">
13
22
  * <Alert type="info">这是第一个示例</Alert>
14
23
  * </div>
@@ -16,6 +25,20 @@
16
25
  * <Alert type="success">这是第二个示例</Alert>
17
26
  * </div>
18
27
  * </CodeContainer>
28
+ *
29
+ * <!-- 使用iframe完全隔离 -->
30
+ * <CodeContainer codes={[code]} useIframe={true}>
31
+ * <div id="tab-1">
32
+ * <SomeComponent />
33
+ * </div>
34
+ * </CodeContainer>
35
+ *
36
+ * <!-- 禁用样式重置 -->
37
+ * <CodeContainer codes={[code]} resetStyles={false}>
38
+ * <div id="tab-1">
39
+ * <CustomComponent />
40
+ * </div>
41
+ * </CodeContainer>
19
42
  * ```
20
43
  */
21
44
 
@@ -35,9 +58,25 @@ interface Props {
35
58
  * 每个示例对应的源代码
36
59
  */
37
60
  codes: string[];
61
+ /**
62
+ * 是否使用iframe隔离内容
63
+ * @default false
64
+ */
65
+ useIframe?: boolean;
66
+ /**
67
+ * 是否重置内部样式
68
+ * @default true
69
+ */
70
+ resetStyles?: boolean;
38
71
  }
39
72
 
40
- const { titles = [], descriptions = [], codes } = Astro.props;
73
+ const {
74
+ titles = [],
75
+ descriptions = [],
76
+ codes,
77
+ useIframe = false,
78
+ resetStyles = true,
79
+ } = Astro.props;
41
80
  ---
42
81
 
43
82
  <div data-role="code-container" class="cosy:mb-8 cosy:card" ignore-heading>
@@ -93,7 +132,22 @@ const { titles = [], descriptions = [], codes } = Astro.props;
93
132
 
94
133
  <div class="cosy:relative cosy:p-4 cosy:bg-gradient-to-br cosy:from-red-100 cosy:to-green-300 cosy:rounded-b">
95
134
  <div class="cosy:block cosy:code-example-panel" data-panel="preview">
96
- <slot />
135
+ {useIframe ? (
136
+ <div class="cosy:w-full cosy:min-h-64 cosy:bg-white cosy:rounded cosy:border">
137
+ <iframe
138
+ class="cosy:w-full cosy:min-h-64 cosy:border-none cosy:rounded"
139
+ data-preview-frame={`tab-${index + 1}`}
140
+ sandbox="allow-scripts allow-same-origin"
141
+ title={`示例预览 ${index + 1}`}
142
+ />
143
+ </div>
144
+ ) : (
145
+ <div
146
+ class={`cosy:code-preview-area ${resetStyles ? 'cosy:reset-styles' : ''}`}
147
+ data-preview-area={`tab-${index + 1}`}>
148
+ <slot />
149
+ </div>
150
+ )}
97
151
  </div>
98
152
 
99
153
  <div class="cosy:hidden cosy:code-example-panel" data-panel="code">
@@ -107,10 +161,156 @@ const { titles = [], descriptions = [], codes } = Astro.props;
107
161
  }
108
162
  </div>
109
163
 
164
+ <!-- 样式隔离和重置 -->
165
+ <style>
166
+ /* 预览区域样式重置,防止外部样式影响内部组件 */
167
+ [data-role='code-container'] .cosy\:reset-styles {
168
+ /* 重置所有可能影响布局的样式 */
169
+ all: initial;
170
+ font-family: inherit;
171
+ color: inherit;
172
+ line-height: 1.5;
173
+
174
+ /* 恢复必要的基础样式 */
175
+ display: block;
176
+ box-sizing: border-box;
177
+
178
+ /* 隔离样式作用域 */
179
+ isolation: isolate;
180
+ contain: layout style;
181
+ }
182
+
183
+ /* 重置内部所有元素的样式 */
184
+ [data-role='code-container'] .cosy\:reset-styles * {
185
+ all: unset;
186
+ display: revert;
187
+ box-sizing: border-box;
188
+ }
189
+
190
+ /* 恢复必要的文本样式 */
191
+ [data-role='code-container'] .cosy\:reset-styles {
192
+ font-family:
193
+ system-ui,
194
+ -apple-system,
195
+ BlinkMacSystemFont,
196
+ 'Segoe UI',
197
+ Roboto,
198
+ 'Helvetica Neue',
199
+ Arial,
200
+ sans-serif;
201
+ font-size: 14px;
202
+ line-height: 1.5;
203
+ color: #374151;
204
+ }
205
+
206
+ /* 恢复基本的HTML元素样式 */
207
+ [data-role='code-container'] .cosy\:reset-styles h1,
208
+ [data-role='code-container'] .cosy\:reset-styles h2,
209
+ [data-role='code-container'] .cosy\:reset-styles h3,
210
+ [data-role='code-container'] .cosy\:reset-styles h4,
211
+ [data-role='code-container'] .cosy\:reset-styles h5,
212
+ [data-role='code-container'] .cosy\:reset-styles h6 {
213
+ font-weight: bold;
214
+ margin-bottom: 0.5em;
215
+ }
216
+
217
+ [data-role='code-container'] .cosy\:reset-styles p {
218
+ margin-bottom: 1em;
219
+ }
220
+
221
+ [data-role='code-container'] .cosy\:reset-styles ul,
222
+ [data-role='code-container'] .cosy\:reset-styles ol {
223
+ padding-left: 1.5em;
224
+ margin-bottom: 1em;
225
+ }
226
+
227
+ [data-role='code-container'] .cosy\:reset-styles li {
228
+ margin-bottom: 0.25em;
229
+ }
230
+
231
+ /* iframe 隔离样式 */
232
+ [data-role='code-container'] iframe[data-preview-frame] {
233
+ background: white;
234
+ border: 1px solid #e5e7eb;
235
+ border-radius: 0.375rem;
236
+ }
237
+
238
+ /* 防止内部组件的样式泄漏到外部 */
239
+ [data-role='code-container'] .cosy\:code-preview-area {
240
+ position: relative;
241
+ z-index: 0;
242
+ }
243
+
244
+ /* 确保预览区域的样式隔离 */
245
+ [data-role='code-container'] .cosy\:code-preview-area::before {
246
+ content: '';
247
+ position: absolute;
248
+ top: -1px;
249
+ left: -1px;
250
+ right: -1px;
251
+ bottom: -1px;
252
+ pointer-events: none;
253
+ z-index: -1;
254
+ }
255
+ </style>
256
+
110
257
  <script>
258
+ function initializeIframePreviews() {
259
+ const iframes = document.querySelectorAll('[data-preview-frame]');
260
+
261
+ iframes.forEach((iframe) => {
262
+ const container = iframe.closest('[data-role="code-container"]');
263
+ if (!container) return;
264
+
265
+ const frameId = iframe.getAttribute('data-preview-frame');
266
+ const contentElement = container.querySelector(`#${frameId}`);
267
+
268
+ if (contentElement) {
269
+ // 创建独立的HTML文档内容
270
+ const iframeElement = iframe as HTMLIFrameElement;
271
+ const iframeDoc =
272
+ iframeElement.contentDocument ||
273
+ iframeElement.contentWindow?.document;
274
+ if (iframeDoc) {
275
+ const htmlContent = `
276
+ <!DOCTYPE html>
277
+ <html>
278
+ <head>
279
+ <meta charset="UTF-8">
280
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
281
+ <title>示例预览</title>
282
+ <style>
283
+ /* 基础样式重置 */
284
+ * { margin: 0; padding: 0; box-sizing: border-box; }
285
+ body {
286
+ font-family: system-ui, -apple-system, sans-serif;
287
+ padding: 1rem;
288
+ background: white;
289
+ color: #374151;
290
+ line-height: 1.5;
291
+ }
292
+ </style>
293
+ </head>
294
+ <body>
295
+ ${contentElement.innerHTML}
296
+ </body>
297
+ </html>
298
+ `;
299
+
300
+ iframeDoc.open();
301
+ iframeDoc.write(htmlContent);
302
+ iframeDoc.close();
303
+ }
304
+ }
305
+ });
306
+ }
307
+
111
308
  function initializeCodeContainer() {
112
309
  console.log('CodeContainer: 初始化代码容器');
113
310
 
311
+ // 初始化 iframe 预览
312
+ initializeIframePreviews();
313
+
114
314
  // 示例切换功能
115
315
  const exampleTabs = document.querySelectorAll(
116
316
  '[role="tab"][data-tab^="tab-"]'
@@ -1,14 +1,10 @@
1
- import { default as CodeContainer } from './CodeContainer.astro';
2
- import { default as CodeContainerBasic } from './ECodeContainerBasic.astro';
3
- import { default as CodeContainerMultiple } from './ECodeContainerMultiple.astro';
4
- import BasicSourceCode from './ECodeContainerBasic.astro?raw';
5
- import MultipleSourceCode from './ECodeContainerMultiple.astro?raw';
6
- import { extractSimpleExample } from '../utils/component';
1
+ export { default as CodeContainer } from './CodeContainer.astro';
7
2
 
8
- export { CodeContainer, CodeContainerBasic, CodeContainerMultiple };
9
-
10
- // 导出示例源代码
11
- export const CodeContainerExampleCodes = {
12
- Basic: extractSimpleExample(BasicSourceCode, 'CodeContainer'),
13
- Multiple: extractSimpleExample(MultipleSourceCode, 'CodeContainer'),
14
- };
3
+ // Export types
4
+ export interface CodeContainerProps {
5
+ titles?: string[];
6
+ descriptions?: string[];
7
+ codes: string[];
8
+ useIframe?: boolean;
9
+ resetStyles?: boolean;
10
+ }
@@ -1,21 +1,17 @@
1
- import Contact from './Contact.astro';
1
+ export { default as Contact } from './Contact.astro';
2
2
 
3
- // Container components
4
- import ContactBasicContainer from './EContactBasicContainer.astro';
5
- import ContactWithTitleContainer from './EContactWithTitleContainer.astro';
6
- import ContactSocialContainer from './EContactSocialContainer.astro';
7
- import ContactCompactContainer from './EContactCompactContainer.astro';
8
- import ContactCustomStyleContainer from './EContactCustomStyleContainer.astro';
9
-
10
- export { Contact };
11
-
12
- export const ContactPackage = {
13
- Contact,
14
- ContactContainers: {
15
- Basic: ContactBasicContainer,
16
- WithTitle: ContactWithTitleContainer,
17
- Social: ContactSocialContainer,
18
- Compact: ContactCompactContainer,
19
- CustomStyle: ContactCustomStyleContainer,
20
- },
21
- };
3
+ // Export types
4
+ export interface ContactProps {
5
+ title?: string;
6
+ description?: string;
7
+ email?: string;
8
+ phone?: string;
9
+ address?: string;
10
+ website?: string;
11
+ github?: string;
12
+ twitter?: string;
13
+ facebook?: string;
14
+ linkedin?: string;
15
+ compact?: boolean;
16
+ class?: string;
17
+ }
@@ -3,30 +3,7 @@ import Error403 from './403.astro';
3
3
  import Error500 from './500.astro';
4
4
  import Error503 from './503.astro';
5
5
  import ErrorPage from './ErrorPage.astro';
6
-
7
6
  import Error404Basic from './404Basic.astro';
8
- import E404Basic from './E404Basic.astro';
9
- import E404WithDebug from './E404WithDebug.astro';
10
- import E403Basic from './E403Basic.astro';
11
- import E500Basic from './E500Basic.astro';
12
- import E503Maintenance from './E503Maintenance.astro';
13
-
14
- import E404BasicContainer from './E404BasicContainer.astro';
15
- import E403BasicContainer from './E403BasicContainer.astro';
16
- import E500BasicContainer from './E500BasicContainer.astro';
17
- import E503MaintenanceContainer from './E503MaintenanceContainer.astro';
18
- import EErrorPageShowcase from './EErrorPageShowcase.astro';
19
- import EErrorPageShowcaseContainer from './EErrorPageShowcaseContainer.astro';
20
- import EErrorPageCustomStyle from './EErrorPageCustomStyle.astro';
21
- import EErrorPageCustomStyleContainer from './EErrorPageCustomStyleContainer.astro';
22
-
23
- import BasicSourceCode from './E404Basic.astro?raw';
24
- import WithDebugSourceCode from './E404WithDebug.astro?raw';
25
- import Error403SourceCode from './E403Basic.astro?raw';
26
- import Error500SourceCode from './E500Basic.astro?raw';
27
- import Error503SourceCode from './E503Maintenance.astro?raw';
28
-
29
- import { extractSimpleExample } from '../utils/component';
30
7
 
31
8
  export {
32
9
  Error404,
@@ -35,43 +12,4 @@ export {
35
12
  Error503,
36
13
  ErrorPage,
37
14
  Error404Basic,
38
- E404Basic,
39
- E404WithDebug,
40
- E403Basic,
41
- E500Basic,
42
- E503Maintenance,
43
- E404BasicContainer,
44
- E403BasicContainer,
45
- E500BasicContainer,
46
- E503MaintenanceContainer,
47
- EErrorPageShowcase,
48
- EErrorPageShowcaseContainer,
49
- EErrorPageCustomStyle,
50
- EErrorPageCustomStyleContainer,
51
- };
52
-
53
- // 错误页面组件包
54
- export const ErrorPackage = {
55
- ErrorPage,
56
- Error404,
57
- Error403,
58
- Error500,
59
- Error503,
60
- ErrorContainers: {
61
- Basic404: E404BasicContainer,
62
- Basic403: E403BasicContainer,
63
- Basic500: E500BasicContainer,
64
- Maintenance503: E503MaintenanceContainer,
65
- Showcase: EErrorPageShowcaseContainer,
66
- CustomStyle: EErrorPageCustomStyleContainer,
67
- },
68
- };
69
-
70
- // 导出示例源代码
71
- export const ErrorExampleCodes = {
72
- Basic404: extractSimpleExample(BasicSourceCode, 'Error404'),
73
- WithDebug404: extractSimpleExample(WithDebugSourceCode, 'Error404'),
74
- Basic403: extractSimpleExample(Error403SourceCode, 'Error403'),
75
- Basic500: extractSimpleExample(Error500SourceCode, 'Error500'),
76
- Maintenance503: extractSimpleExample(Error503SourceCode, 'Error503'),
77
15
  };
@@ -1,31 +1,2 @@
1
- import Footer from './Footer.astro';
2
- import FooterBasicContainer from './EFooterBasicContainer.astro';
3
- import FooterWithSocialContainer from './EFooterWithSocialContainer.astro';
4
- import FooterWithProductsContainer from './EFooterWithProductsContainer.astro';
5
- import FooterWithLogoContainer from './EFooterWithLogoContainer.astro';
6
- import FooterWithNavigationContainer from './EFooterWithNavigationContainer.astro';
7
- import FooterCompleteContainer from './EFooterCompleteContainer.astro';
8
- import FooterFeaturesContainer from './EFooterFeaturesContainer.astro';
9
- import EFooterBasicSourceCode from './EFooterBasic.astro?raw';
10
- import { extractSimpleExample } from '../utils/component';
11
-
12
1
  export { default as Footer } from './Footer.astro';
13
-
14
- // 导出示例源代码
15
- export const FooterExampleCodes = {
16
- Basic: extractSimpleExample(EFooterBasicSourceCode, 'Footer'),
17
- };
18
-
19
- // 导出页脚包
20
- export const FooterPackage = {
21
- Footer,
22
- FooterContainers: {
23
- Basic: FooterBasicContainer,
24
- WithSocial: FooterWithSocialContainer,
25
- WithProducts: FooterWithProductsContainer,
26
- WithLogo: FooterWithLogoContainer,
27
- WithNavigation: FooterWithNavigationContainer,
28
- Complete: FooterCompleteContainer,
29
- Features: FooterFeaturesContainer,
30
- },
31
- };
2
+ export { default as FooterSection } from './FooterSection.astro';
@@ -13,7 +13,6 @@
13
13
  * 3. 可定制性 - 支持多种配置选项,适应不同网站的风格和需求
14
14
  * 4. 多语言支持 - 内置语言切换功能,便于构建国际化网站
15
15
  */
16
- import '../../style.ts';
17
16
  import {
18
17
  LanguageSwitcher,
19
18
  LinkUtil,
@@ -23,7 +22,7 @@ import {
23
22
  Link,
24
23
  Image,
25
24
  ThemeSwitcher,
26
- } from '../../index-astro';
25
+ } from '@coffic/cosy-ui';
27
26
  import Logo from '../assets/logo-rounded.png';
28
27
 
29
28
  export interface Props extends IHeaderProps {
@@ -1,40 +1 @@
1
- import Header from './Header.astro';
2
- import HeaderBasic from './HeaderBasic.astro';
3
- import HeaderWithNavigation from './HeaderWithNavigation.astro';
4
- import HeaderCustomPosition from './HeaderCustomPosition.astro';
5
- import HeaderCustomNavbarEnd from './HeaderCustomNavbarEnd.astro';
6
- import HeaderCustomNavbarStart from './HeaderCustomNavbarStart.astro';
7
- import HeaderCustomNavbarCenter from './HeaderCustomNavbarCenter.astro';
8
- import BasicSourceCode from './HeaderBasic.astro?raw';
9
- import WithNavigationSourceCode from './HeaderWithNavigation.astro?raw';
10
- import CustomPositionSourceCode from './HeaderCustomPosition.astro?raw';
11
- import CustomNavbarEndSourceCode from './HeaderCustomNavbarEnd.astro?raw';
12
- import CustomNavbarStartSourceCode from './HeaderCustomNavbarStart.astro?raw';
13
- import CustomNavbarCenterSourceCode from './HeaderCustomNavbarCenter.astro?raw';
14
- import { extractSimpleExample } from '../utils/component';
15
-
16
- export {
17
- Header,
18
- HeaderBasic,
19
- HeaderWithNavigation,
20
- HeaderCustomPosition,
21
- HeaderCustomNavbarEnd,
22
- HeaderCustomNavbarStart,
23
- HeaderCustomNavbarCenter,
24
- };
25
-
26
- // 导出示例源代码
27
- export const HeaderExampleCodes = {
28
- Basic: extractSimpleExample(BasicSourceCode, 'Header'),
29
- WithNavigation: extractSimpleExample(WithNavigationSourceCode, 'Header'),
30
- CustomPosition: extractSimpleExample(CustomPositionSourceCode, 'Header'),
31
- CustomNavbarEnd: extractSimpleExample(CustomNavbarEndSourceCode, 'Header'),
32
- CustomNavbarStart: extractSimpleExample(
33
- CustomNavbarStartSourceCode,
34
- 'Header'
35
- ),
36
- CustomNavbarCenter: extractSimpleExample(
37
- CustomNavbarCenterSourceCode,
38
- 'Header'
39
- ),
40
- };
1
+ export { default as Header } from './Header.astro';
@@ -296,7 +296,7 @@ const linksContainerClasses = [
296
296
 
297
297
  const appContainerClasses = [
298
298
  'cosy:w-full',
299
- 'cosy:max-w-3xl',
299
+ 'cosy:max-w-full',
300
300
  'cosy:mx-auto',
301
301
  'cosy:my-8',
302
302
  ].join(' ');
@@ -1,39 +1 @@
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
- };
1
+ export { default as Hero } from './Hero.astro';
@@ -0,0 +1,28 @@
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 {
22
+ size = '24px',
23
+ color = 'currentColor',
24
+ class: className = '',
25
+ } = Astro.props;
26
+ ---
27
+
28
+ <AstroIcon name="chart" size={size} stroke={color} class={className} />
@@ -0,0 +1,28 @@
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 {
22
+ size = '24px',
23
+ color = 'currentColor',
24
+ class: className = '',
25
+ } = Astro.props;
26
+ ---
27
+
28
+ <AstroIcon name="dashboard" size={size} stroke={color} class={className} />
@@ -0,0 +1,28 @@
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 {
22
+ size = '24px',
23
+ color = 'currentColor',
24
+ class: className = '',
25
+ } = Astro.props;
26
+ ---
27
+
28
+ <AstroIcon name="delete" size={size} stroke={color} class={className} />
@@ -0,0 +1,28 @@
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 {
22
+ size = '24px',
23
+ color = 'currentColor',
24
+ class: className = '',
25
+ } = Astro.props;
26
+ ---
27
+
28
+ <AstroIcon name="document" size={size} stroke={color} class={className} />
@@ -0,0 +1,28 @@
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 {
22
+ size = '24px',
23
+ color = 'currentColor',
24
+ class: className = '',
25
+ } = Astro.props;
26
+ ---
27
+
28
+ <AstroIcon name="download" size={size} stroke={color} class={className} />