@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
@@ -0,0 +1,26 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+ /**
4
+ * 信息图标组件
5
+ */
6
+ interface Props {
7
+ /**
8
+ * 图标的大小
9
+ * @default "24px"
10
+ */
11
+ size?: string;
12
+ /**
13
+ * 图标的颜色
14
+ * @default "currentColor"
15
+ */
16
+ color?: string;
17
+ /**
18
+ * 自定义类名
19
+ */
20
+ class?: string;
21
+ }
22
+
23
+ const { size = '24px', color = 'currentColor', class: className = '' } = Astro.props;
24
+ ---
25
+
26
+ <AstroIcon name="info" 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="link" 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="linkedin" 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="menu" 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="search" size={size} color={color} class={className} />
@@ -0,0 +1,18 @@
1
+ ---
2
+ import AstroIcon from './AstroIcon.astro';
3
+
4
+ interface Props {
5
+ class?: string;
6
+ width?: string;
7
+ height?: string;
8
+ stroke?: string;
9
+ fill?: string;
10
+ size?: string;
11
+ color?: string;
12
+ strokeWidth?: string;
13
+ }
14
+
15
+ const { class: className, size = '24', color = 'currentColor' } = Astro.props;
16
+ ---
17
+
18
+ <AstroIcon name="settings" size={size} color={color} class={className} />
@@ -1,18 +1,18 @@
1
1
  ---
2
2
  /**
3
3
  * @component SocialIcon
4
- *
4
+ *
5
5
  * @description
6
6
  * SocialIcon 组件用于显示社交媒体平台的图标,支持多种常见的社交媒体平台。
7
7
  * 它提供了一致的样式和交互效果,同时支持自定义大小和颜色。
8
- *
8
+ *
9
9
  * @design
10
10
  * 设计理念:
11
11
  * 1. 简洁明了 - 使用清晰易识别的图标表示社交媒体平台
12
12
  * 2. 一致性 - 保持统一的样式和交互效果
13
13
  * 3. 可定制性 - 支持自定义大小、颜色和样式
14
14
  * 4. 可访问性 - 提供适当的 aria 标签,确保屏幕阅读器可以识别
15
- *
15
+ *
16
16
  * @usage
17
17
  * 基本用法:
18
18
  * ```astro
@@ -20,12 +20,12 @@
20
20
  * <SocialIcon platform="twitter" />
21
21
  * <SocialIcon platform="linkedin" />
22
22
  * ```
23
- *
23
+ *
24
24
  * 自定义大小和颜色:
25
25
  * ```astro
26
26
  * <SocialIcon platform="github" size="32px" color="#333" />
27
27
  * ```
28
- *
28
+ *
29
29
  * 使用自定义类名:
30
30
  * ```astro
31
31
  * <SocialIcon platform="twitter" class="my-custom-class" />
@@ -33,7 +33,7 @@
33
33
  */
34
34
 
35
35
  // 导入样式
36
- import '../../app.css';
36
+ import '../app.css';
37
37
 
38
38
  import GithubIcon from './GithubIcon.astro';
39
39
  import TwitterIcon from './TwitterIcon.astro';
@@ -45,30 +45,30 @@ interface Props {
45
45
  * @default "default"
46
46
  */
47
47
  platform: string;
48
-
48
+
49
49
  /**
50
50
  * 图标的大小
51
51
  * @default "24px"
52
52
  */
53
53
  size?: string;
54
-
54
+
55
55
  /**
56
56
  * 图标的颜色
57
57
  * @default "currentColor"
58
58
  */
59
59
  color?: string;
60
-
60
+
61
61
  /**
62
62
  * 自定义类名
63
63
  */
64
64
  class?: string;
65
65
  }
66
66
 
67
- const {
68
- platform = 'default',
69
- size = '24px',
70
- color = 'currentColor',
71
- class: className = ''
67
+ const {
68
+ platform = 'default',
69
+ size = '24px',
70
+ color = 'currentColor',
71
+ class: className = '',
72
72
  } = Astro.props;
73
73
 
74
74
  // 获取平台名称的首字母大写版本,用于显示
@@ -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="success" 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="sunCloudy" 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="twitter" 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="user" 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="warning" 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="xCircle" size={size} color={color} class={className} />
package/dist/index.ts CHANGED
@@ -46,7 +46,7 @@ export { default as Heading } from './components/typography/Heading.astro';
46
46
  export { default as ErrorPage404 } from './components/errors/404.astro';
47
47
 
48
48
  // Icons
49
- export * from './icons';
49
+ export * from './index_icons';
50
50
 
51
51
  // Containers
52
52
  export { default as Container } from './components/containers/Container.astro';
@@ -0,0 +1,23 @@
1
+ export { default as SocialIcon } from './icons/SocialIcon.astro';
2
+ export { default as TwitterIcon } from './icons/TwitterIcon.astro';
3
+ export { default as UserIcon } from './icons/UserIcon.astro';
4
+ export { default as WarningIcon } from './icons/WarningIcon.astro';
5
+ export { default as XCircle } from './icons/XCircle.astro';
6
+ export { default as InfoIcon } from './icons/InfoIcon.astro';
7
+ export { default as LinkIcon } from './icons/LinkIcon.astro';
8
+ export { default as LinkedinIcon } from './icons/LinkedinIcon.astro';
9
+ export { default as MenuIcon } from './icons/MenuIcon.astro';
10
+ export { default as SearchIcon } from './icons/SearchIcon.astro';
11
+ export { default as SuccessIcon } from './icons/SuccessIcon.astro';
12
+ export { default as SunCloudyIcon } from './icons/SunCloudyIcon.astro';
13
+ export { default as AlertTriangle } from './icons/AlertTriangle.astro';
14
+ export { default as CalendarIcon } from './icons/CalendarIcon.astro';
15
+ export { default as CheckCircle } from './icons/CheckCircle.astro';
16
+ export { default as CheckIcon } from './icons/CheckIcon.astro';
17
+ export { default as ClipboardIcon } from './icons/ClipboardIcon.astro';
18
+ export { default as CloseIcon } from './icons/CloseIcon.astro';
19
+ export { default as ErrorIcon } from './icons/ErrorIcon.astro';
20
+ export { default as GithubIcon } from './icons/GithubIcon.astro';
21
+ export { default as InfoCircle } from './icons/InfoCircle.astro';
22
+ export { default as SettingsIcon } from './icons/SettingsIcon.astro';
23
+ export { default as ChevronDownIcon } from './icons/ChevronDownIcon.astro';
@@ -0,0 +1,41 @@
1
+ // AlertDialog
2
+ export { AlertDialogExamples, AlertDialogExampleCodes, AlertDialog } from './vue/AlertDialog';
3
+
4
+ // Banner
5
+ export { BannerBoxExamples, BannerBoxExampleCodes, BannerBox } from './vue/BannerBox';
6
+
7
+ // Counter
8
+ export { default as VueCounter } from './vue/VueCounter.vue';
9
+
10
+ // SmartHero
11
+ export { default as SmartHero } from './vue/SmartHero.vue';
12
+
13
+ // ConfirmDialog
14
+ export { default as ConfirmDialog } from './vue/ConfirmDialog.vue';
15
+
16
+ // FeatureButton
17
+ export { default as FeatureButton } from './vue/FeatureButton.vue';
18
+ export { default as FeatureCard } from './vue/BannerBox/FeatureCard.vue';
19
+
20
+ // Icons
21
+ export { default as SearchIcon } from './vue/Icons/SearchIcon.vue';
22
+ export { default as SettingsIcon } from './vue/Icons/SettingsIcon.vue';
23
+ export { default as InfoIcon } from './vue/Icons/InfoIcon.vue';
24
+ export { default as InfoCircleIcon } from './vue/Icons/InfoCircleIcon.vue';
25
+ export { default as LinkIcon } from './vue/Icons/LinkIcon.vue';
26
+ export { default as MenuIcon } from './vue/Icons/MenuIcon.vue';
27
+ export { default as UserIcon } from './vue/Icons/UserIcon.vue';
28
+ export { default as XCircleIcon } from './vue/Icons/XCircleIcon.vue';
29
+
30
+ // List
31
+ export { default as ListItem } from './vue/ListItem.vue';
32
+
33
+ // Windows
34
+ export { MacWindowExamples, MacWindowExampleCodes, MacWindow } from './vue/MacWindow';
35
+ export { iPhoneWindowExamples, iPhoneWindowExampleCodes, iPhoneWindow } from './vue/iPhone';
36
+
37
+ // SmartLink
38
+ export { default as SmartLink } from './vue/SmartLink.vue';
39
+
40
+ // TagList
41
+ export { default as TagList } from './vue/TagList.vue';
@@ -40,7 +40,7 @@ const showDialog = ref(false);
40
40
  -->
41
41
 
42
42
  <script lang="ts">
43
- import '../app.css'
43
+ import '../../style'
44
44
  import { defineComponent } from 'vue'
45
45
 
46
46
  type MessageKey = 'confirm';
@@ -0,0 +1,38 @@
1
+ <!--
2
+ @component AlertDialog.Basic
3
+
4
+ @description
5
+ AlertDialog 组件的基础示例,展示最基本的对话框用法。
6
+
7
+ @usage
8
+ ```vue
9
+ <AlertDialogExamples.Basic />
10
+ ```
11
+ -->
12
+
13
+ <script lang="ts">
14
+ import '../../app.css'
15
+ import { ref, defineComponent } from 'vue'
16
+ import AlertDialog from './AlertDialog.vue'
17
+
18
+ export default defineComponent({
19
+ name: 'AlertDialogBasicExample',
20
+ components: {
21
+ AlertDialog
22
+ },
23
+ setup() {
24
+ const isShow = ref(false)
25
+
26
+ return {
27
+ isShow
28
+ }
29
+ }
30
+ })
31
+ </script>
32
+
33
+ <template>
34
+ <button @click="isShow = true" class="cosy:btn cosy:btn-primary">
35
+ 显示对话框
36
+ </button>
37
+ <AlertDialog v-model="isShow" message="这是一条重要信息" />
38
+ </template>
@@ -0,0 +1,48 @@
1
+ <!--
2
+ @component AlertDialog.Multilang
3
+
4
+ @description
5
+ AlertDialog 组件的多语言示例,展示如何使用不同语言的对话框。
6
+
7
+ @usage
8
+ ```vue
9
+ <AlertDialogExamples.Multilang />
10
+ ```
11
+ -->
12
+
13
+ <script lang="ts">
14
+ import '../../app.css'
15
+ import { ref, defineComponent } from 'vue'
16
+ import AlertDialog from './AlertDialog.vue'
17
+
18
+ export default defineComponent({
19
+ name: 'AlertDialogMultilangExample',
20
+ components: {
21
+ AlertDialog
22
+ },
23
+ setup() {
24
+ const isShowEn = ref(false)
25
+ const isShowJa = ref(false)
26
+
27
+ return {
28
+ isShowEn,
29
+ isShowJa
30
+ }
31
+ }
32
+ })
33
+ </script>
34
+
35
+ <template>
36
+ <div class="flex gap-2">
37
+ <button @click="isShowEn = true" class="cosy:btn cosy:btn-primary">
38
+ English
39
+ </button>
40
+ <button @click="isShowJa = true" class="cosy:btn cosy:btn-primary">
41
+ 日本語
42
+ </button>
43
+ </div>
44
+
45
+ <AlertDialog v-model="isShowEn" message="Important information" ok-text="OK" cancel-text="Cancel" />
46
+
47
+ <AlertDialog v-model="isShowJa" message="重要なお知らせ" ok-text="確認" cancel-text="キャンセル" />
48
+ </template>
@@ -0,0 +1,58 @@
1
+ import Basic from './Basic.vue';
2
+ import Multilang from './Multilang.vue';
3
+ import BasicSource from './Basic.vue?raw';
4
+ import MultilangSource from './Multilang.vue?raw';
5
+
6
+ // 提取简单示例源代码函数
7
+ function extractSimpleExample(source: string): string {
8
+ // 提取模板部分
9
+ const templateMatch = source.match(/<template>([\s\S]*)<\/template>/m);
10
+ const scriptMatch = source.match(/<script[\s\S]*?>([\s\S]*)<\/script>/m);
11
+
12
+ if (!templateMatch) {
13
+ return source;
14
+ }
15
+
16
+ let importSection = `<script setup lang="ts">
17
+ import { ref } from 'vue'
18
+ import { AlertDialog } from '@cosy/index_vue'
19
+ `;
20
+
21
+ // 从源码中提取导入语句(除了组件的导入和app.css)
22
+ if (scriptMatch && scriptMatch[1]) {
23
+ const importLines = scriptMatch[1]
24
+ .split('\n')
25
+ .filter(
26
+ (line) =>
27
+ line.includes('import') &&
28
+ !line.includes('../../app.css') &&
29
+ !line.includes('AlertDialog')
30
+ );
31
+
32
+ if (importLines.length > 0) {
33
+ importSection += importLines.join('\n') + '\n';
34
+ }
35
+ }
36
+
37
+ importSection += '</script>\n\n';
38
+
39
+ // 提取模板内容,并替换组件路径
40
+ const templateContent = templateMatch[1].replace('../AlertDialog.vue', 'AlertDialog');
41
+
42
+ return importSection + '<template>' + templateContent + '</template>';
43
+ }
44
+
45
+ // 导出主组件
46
+ export { default as AlertDialog } from './AlertDialog.vue';
47
+
48
+ // 导出示例组件
49
+ export const AlertDialogExamples = {
50
+ Basic,
51
+ Multilang,
52
+ };
53
+
54
+ // 导出示例源代码
55
+ export const AlertDialogExampleCodes = {
56
+ Basic: extractSimpleExample(BasicSource),
57
+ Multilang: extractSimpleExample(MultilangSource),
58
+ };