@coffic/cosy-ui 0.7.2 → 0.7.4

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 (112) hide show
  1. package/dist/alert-dialog-vue/AlertDialog.vue +120 -0
  2. package/dist/alert-dialog-vue/Basic.vue +38 -0
  3. package/dist/alert-dialog-vue/Multilang.vue +48 -0
  4. package/dist/alert-dialog-vue/index.ts +20 -0
  5. package/dist/app.css +1 -1
  6. package/dist/banner-box-vue/BannerBox.vue +296 -0
  7. package/dist/banner-box-vue/DownloadButton.vue +202 -0
  8. package/dist/banner-box-vue/ExampleBasic.vue +32 -0
  9. package/dist/banner-box-vue/ExampleCustomBg.vue +32 -0
  10. package/dist/banner-box-vue/ExampleDisplayModeAlways.vue +34 -0
  11. package/dist/banner-box-vue/ExampleDisplayModeHover.vue +34 -0
  12. package/dist/banner-box-vue/ExampleDisplayModeNever.vue +34 -0
  13. package/dist/banner-box-vue/ExampleImageExport.vue +37 -0
  14. package/dist/banner-box-vue/ExampleSizePreset.vue +35 -0
  15. package/dist/banner-box-vue/FeatureCard.vue +190 -0
  16. package/dist/banner-box-vue/SmartBanner.vue +44 -0
  17. package/dist/banner-box-vue/bgStyles.ts +55 -0
  18. package/dist/banner-box-vue/index.ts +48 -0
  19. package/dist/banner-box-vue/sizePresets.ts +23 -0
  20. package/dist/blog-vue/Basic.vue +30 -0
  21. package/dist/blog-vue/BlogList.vue +100 -0
  22. package/dist/blog-vue/Empty.vue +8 -0
  23. package/dist/blog-vue/EmptyEnglish.vue +8 -0
  24. package/dist/blog-vue/English.vue +24 -0
  25. package/dist/blog-vue/index.ts +29 -0
  26. package/dist/buttons-vue/Button.vue +105 -0
  27. package/dist/buttons-vue/ButtonBasic.vue +11 -0
  28. package/dist/buttons-vue/ButtonFeature.vue +91 -0
  29. package/dist/buttons-vue/ButtonFeatureBasic.vue +8 -0
  30. package/dist/buttons-vue/ButtonFeatureWithTips.vue +7 -0
  31. package/dist/buttons-vue/ButtonLink.vue +13 -0
  32. package/dist/buttons-vue/ButtonSizes.vue +12 -0
  33. package/dist/buttons-vue/ButtonWithIcons.vue +21 -0
  34. package/dist/buttons-vue/index.ts +1 -0
  35. package/dist/card/Card.astro +59 -10
  36. package/dist/card/ECardBasic.astro +11 -0
  37. package/dist/card/ECardBasicContainer.astro +11 -0
  38. package/dist/card/ECardClickable.astro +13 -0
  39. package/dist/card/ECardClickableContainer.astro +11 -0
  40. package/dist/card/ECardCompact.astro +13 -0
  41. package/dist/card/ECardCompactContainer.astro +11 -0
  42. package/dist/card/ECardCustomStyle.astro +17 -0
  43. package/dist/card/ECardCustomStyleContainer.astro +11 -0
  44. package/dist/card/ECardWithImage.astro +16 -0
  45. package/dist/card/ECardWithImageContainer.astro +11 -0
  46. package/dist/card/ECardWithSubtitle.astro +13 -0
  47. package/dist/card/ECardWithSubtitleContainer.astro +11 -0
  48. package/dist/card/index.ts +32 -6
  49. package/dist/confirm-dialog-vue/Basic.vue +57 -0
  50. package/dist/confirm-dialog-vue/ConfirmDialog.vue +134 -0
  51. package/dist/confirm-dialog-vue/CustomButtons.vue +69 -0
  52. package/dist/confirm-dialog-vue/index.ts +20 -0
  53. package/dist/contact/Contact.astro +279 -0
  54. package/dist/contact/EContactBasic.astro +15 -0
  55. package/dist/contact/EContactBasicContainer.astro +12 -0
  56. package/dist/contact/EContactCompact.astro +12 -0
  57. package/dist/contact/EContactCompactContainer.astro +12 -0
  58. package/dist/contact/EContactCustomStyle.astro +22 -0
  59. package/dist/contact/EContactCustomStyleContainer.astro +12 -0
  60. package/dist/contact/EContactSocial.astro +21 -0
  61. package/dist/contact/EContactSocialContainer.astro +12 -0
  62. package/dist/contact/EContactWithTitle.astro +18 -0
  63. package/dist/contact/EContactWithTitleContainer.astro +12 -0
  64. package/dist/contact/index.ts +21 -0
  65. package/dist/counter-vue/VueCounter.vue +29 -0
  66. package/dist/counter-vue/index.ts +1 -0
  67. package/dist/iPhone-vue/Basic.vue +33 -0
  68. package/dist/iPhone-vue/CustomBackground.vue +33 -0
  69. package/dist/iPhone-vue/NoFrame.vue +33 -0
  70. package/dist/iPhone-vue/WeatherApp.vue +97 -0
  71. package/dist/iPhone-vue/assets/iPhone 14 Pro - Deep Purple - Landscape.png +0 -0
  72. package/dist/iPhone-vue/assets/iPhone 14 Pro - Deep Purple - Portrait.png +0 -0
  73. package/dist/iPhone-vue/assets/iPhone 14 Pro - Gold - Landscape.png +0 -0
  74. package/dist/iPhone-vue/assets/iPhone 14 Pro - Gold - Portrait.png +0 -0
  75. package/dist/iPhone-vue/assets/iPhone 14 Pro - Silver - Landscape.png +0 -0
  76. package/dist/iPhone-vue/assets/iPhone 14 Pro - Silver - Portrait.png +0 -0
  77. package/dist/iPhone-vue/assets/iPhone 14 Pro - Space Black - Landscape.png +0 -0
  78. package/dist/iPhone-vue/assets/iPhone 14 Pro - Space Black - Portrait.png +0 -0
  79. package/dist/iPhone-vue/iPhoneWindow.vue +193 -0
  80. package/dist/iPhone-vue/index.ts +28 -0
  81. package/dist/icons-vue/AlertTriangleIcon.vue +30 -0
  82. package/dist/icons-vue/CalendarIcon.vue +30 -0
  83. package/dist/icons-vue/CheckCircleIcon.vue +30 -0
  84. package/dist/icons-vue/CheckIcon.vue +30 -0
  85. package/dist/icons-vue/ChevronDownIcon.vue +30 -0
  86. package/dist/icons-vue/ClipboardIcon.vue +30 -0
  87. package/dist/icons-vue/CloseIcon.vue +30 -0
  88. package/dist/icons-vue/InboxArchiveIcon.vue +30 -0
  89. package/dist/icons-vue/InfoCircleIcon.vue +30 -0
  90. package/dist/icons-vue/InfoIcon.vue +30 -0
  91. package/dist/icons-vue/LinkIcon.vue +30 -0
  92. package/dist/icons-vue/MenuIcon.vue +30 -0
  93. package/dist/icons-vue/SearchIcon.vue +30 -0
  94. package/dist/icons-vue/SettingsIcon.vue +30 -0
  95. package/dist/icons-vue/UserIcon.vue +30 -0
  96. package/dist/icons-vue/VueIcon.vue +76 -0
  97. package/dist/icons-vue/XCircleIcon.vue +30 -0
  98. package/dist/icons-vue/index.ts +1 -0
  99. package/dist/index_astro.ts +42 -33
  100. package/dist/index_vue.ts +12 -23
  101. package/dist/list-vue/ListItem.vue +5 -0
  102. package/dist/list-vue/index.ts +1 -0
  103. package/dist/mac-window-vue/Basic.vue +11 -0
  104. package/dist/mac-window-vue/CustomHeight.vue +13 -0
  105. package/dist/mac-window-vue/MacWindow.vue +262 -0
  106. package/dist/mac-window-vue/WithEvents.vue +34 -0
  107. package/dist/mac-window-vue/WithSidebar.vue +21 -0
  108. package/dist/mac-window-vue/WithTabs.vue +21 -0
  109. package/dist/mac-window-vue/WithToolbar.vue +43 -0
  110. package/dist/mac-window-vue/index.ts +36 -0
  111. package/package.json +2 -2
  112. /package/dist/{button → buttons-vue}/ButtonVariants.vue +0 -0
@@ -0,0 +1,120 @@
1
+ <!--
2
+ @component AlertDialog
3
+
4
+ @description
5
+ AlertDialog 组件用于显示简单的确认对话框,支持国际化,带有淡入淡出动画效果。
6
+
7
+ @usage
8
+ 基本用法:
9
+ ```vue
10
+ <AlertDialog v-model="showDialog" message="操作已完成" />
11
+ ```
12
+
13
+ 指定语言:
14
+ ```vue
15
+ <AlertDialog v-model="showDialog" message="Operation completed" lang="en" />
16
+ ```
17
+
18
+ 组合使用:
19
+ ```vue
20
+ <template>
21
+ <button @click="showDialog = true">显示对话框</button>
22
+ <AlertDialog v-model="showDialog" message="确认要继续吗?" />
23
+ </template>
24
+
25
+ <script setup lang="ts">
26
+ import { ref } from 'vue';
27
+ import { AlertDialog } from 'cosy-ui';
28
+
29
+ const showDialog = ref(false);
30
+ </script>
31
+ ```
32
+
33
+ @props
34
+ @prop {boolean} modelValue - 控制对话框显示状态,支持v-model双向绑定
35
+ @prop {string} message - 对话框显示的消息内容
36
+ @prop {('zh-cn'|'en')} [lang='zh-cn'] - 语言设置,影响按钮文本
37
+
38
+ @emits
39
+ @emit {update:modelValue} - 当对话框关闭时触发,用于更新v-model绑定值
40
+ -->
41
+
42
+ <script lang="ts">
43
+ import '../../style'
44
+ import { defineComponent } from 'vue'
45
+
46
+ type MessageKey = 'confirm';
47
+
48
+ interface Messages {
49
+ [key: string]: {
50
+ [key in MessageKey]: string;
51
+ };
52
+ }
53
+
54
+ export default defineComponent({
55
+ name: 'AlertDialog',
56
+ props: {
57
+ modelValue: {
58
+ type: Boolean,
59
+ required: true
60
+ },
61
+ message: {
62
+ type: String,
63
+ required: true
64
+ },
65
+ lang: {
66
+ type: String as () => 'zh-cn' | 'en',
67
+ default: 'zh-cn'
68
+ }
69
+ },
70
+ emits: ['update:modelValue'],
71
+ setup(props) {
72
+ // 多语言文本
73
+ const t = (key: MessageKey) => {
74
+ const messages: Messages = {
75
+ 'zh-cn': {
76
+ confirm: '确定'
77
+ },
78
+ 'en': {
79
+ confirm: 'OK'
80
+ }
81
+ };
82
+ return messages[props.lang][key];
83
+ };
84
+
85
+ return {
86
+ t
87
+ };
88
+ }
89
+ })
90
+ </script>
91
+
92
+ <template>
93
+ <Transition name="fade" class="cosy:transition-opacity cosy:duration-200 cosy:ease-in-out">
94
+ <div v-if="modelValue"
95
+ class="cosy:fixed cosy:inset-0 cosy:z-50 cosy:flex cosy:items-center cosy:justify-center cosy:opacity-100 cosy:enter:opacity-0 cosy:leave:opacity-0">
96
+ <!-- 背景遮罩 -->
97
+ <div class="cosy:absolute cosy:inset-0 cosy:bg-base-200/80 cosy:backdrop-blur-sm"
98
+ @click="$emit('update:modelValue', false)" />
99
+
100
+ <!-- 对话框 -->
101
+ <div
102
+ class="cosy:relative cosy:bg-base-100 cosy:rounded-xl cosy:shadow-lg cosy:w-[400px] cosy:transform cosy:transition-all">
103
+ <!-- 内容区域 -->
104
+ <div class="cosy:p-6">
105
+ <p class="cosy:text-base-content">
106
+ {{ message }}
107
+ </p>
108
+ </div>
109
+
110
+ <!-- 按钮区域 -->
111
+ <div class="cosy:flex cosy:border-t cosy:border-base-300">
112
+ <button class="cosy:btn cosy:btn-ghost cosy:flex-1 cosy:rounded-none cosy:rounded-b-xl"
113
+ @click="$emit('update:modelValue', false)">
114
+ {{ t('confirm') }}
115
+ </button>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </Transition>
120
+ </template>
@@ -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,20 @@
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
+ import { extractSimpleExample } from '../../utils/component';
6
+
7
+ // 导出主组件
8
+ export { default as AlertDialog } from './AlertDialog.vue';
9
+
10
+ // 导出示例组件
11
+ export const AlertDialogExamples = {
12
+ Basic,
13
+ Multilang,
14
+ };
15
+
16
+ // 导出示例源代码
17
+ export const AlertDialogExampleCodes = {
18
+ Basic: extractSimpleExample(BasicSource, 'Basic'),
19
+ Multilang: extractSimpleExample(MultilangSource, 'Multilang'),
20
+ };