@coffic/cosy-ui 0.6.14 → 0.6.16

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.
@@ -0,0 +1,55 @@
1
+ /**
2
+ * BannerBox组件的背景样式类列表
3
+ * 包含多种渐变和纯色背景
4
+ */
5
+ export const bgClasses = [
6
+ // 半透明渐变背景
7
+ 'cosy:bg-gradient-to-b cosy:from-blue-100/50 cosy:to-blue-200/50 dark:cosy:from-blue-500/10 dark:cosy:to-blue-200/10',
8
+ 'cosy:bg-gradient-to-b cosy:from-blue-200/50 cosy:to-purple-200/50 dark:cosy:from-blue-500/10 dark:cosy:to-purple-200/10',
9
+ 'cosy:bg-gradient-to-b cosy:from-yellow-200/50 cosy:to-green-200/50 dark:cosy:from-yellow-500/10 dark:cosy:to-green-200/10',
10
+ 'cosy:bg-gradient-to-b cosy:from-teal-200/50 cosy:to-blue-200/50 dark:cosy:from-teal-500/10 dark:cosy:to-blue-200/10',
11
+ 'cosy:bg-gradient-to-b cosy:from-pink-200/50 cosy:to-indigo-200/20 dark:cosy:from-pink-500/10 dark:cosy:to-indigo-200/10',
12
+ 'cosy:bg-gradient-to-b cosy:from-red-200/50 cosy:to-orange-200/50 dark:cosy:from-red-500/10 dark:cosy:to-orange-200/10',
13
+ 'cosy:bg-gradient-to-b cosy:from-orange-200/50 cosy:to-yellow-200/50 dark:cosy:from-orange-500/10 dark:cosy:to-yellow-200/10',
14
+ 'cosy:bg-gradient-to-b cosy:from-green-200/50 cosy:to-teal-200/50 dark:cosy:from-green-500/10 dark:cosy:to-teal-200/10',
15
+
16
+ // 不透明的背景
17
+ 'cosy:bg-gradient-to-b cosy:from-blue-100 cosy:to-blue-200 dark:cosy:from-blue-500 dark:cosy:to-blue-200',
18
+ 'cosy:bg-gradient-to-b cosy:from-blue-200 cosy:to-purple-200 dark:cosy:from-blue-500 dark:cosy:to-purple-200',
19
+ 'cosy:bg-gradient-to-b cosy:from-yellow-200 cosy:to-green-200 dark:cosy:from-yellow-500 dark:cosy:to-green-200',
20
+ 'cosy:bg-gradient-to-b cosy:from-teal-200 cosy:to-blue-200 dark:cosy:from-teal-500 dark:cosy:to-blue-200',
21
+ 'cosy:bg-gradient-to-b cosy:from-pink-200 cosy:to-red-200 dark:cosy:from-pink-500 dark:cosy:to-red-200',
22
+ 'cosy:bg-gradient-to-b cosy:from-red-200 cosy:to-orange-200 dark:cosy:from-red-500 dark:cosy:to-orange-200',
23
+ 'cosy:bg-gradient-to-b cosy:from-orange-200 cosy:to-yellow-200 dark:cosy:from-orange-500 dark:cosy:to-yellow-200',
24
+ 'cosy:bg-gradient-to-b cosy:from-green-200 cosy:to-teal-200 dark:cosy:from-green-500 dark:cosy:to-teal-200',
25
+
26
+ // 不透明的深色背景
27
+ 'cosy:bg-gradient-to-b cosy:from-blue-900 cosy:to-blue-200 dark:cosy:from-blue-900 dark:cosy:to-blue-200',
28
+ 'cosy:bg-gradient-to-b cosy:from-blue-900 cosy:to-purple-200 dark:cosy:from-blue-900 dark:cosy:to-purple-200',
29
+ 'cosy:bg-gradient-to-b cosy:from-yellow-900 cosy:to-green-200 dark:cosy:from-yellow-900 dark:cosy:to-green-200',
30
+ 'cosy:bg-gradient-to-b cosy:from-teal-900 cosy:to-blue-200 dark:cosy:from-teal-900 dark:cosy:to-blue-200',
31
+ 'cosy:bg-gradient-to-b cosy:from-pink-900 cosy:to-red-200 dark:cosy:from-pink-900 dark:cosy:to-red-200',
32
+ 'cosy:bg-gradient-to-b cosy:from-red-900 cosy:to-orange-200 dark:cosy:from-red-900 dark:cosy:to-orange-200',
33
+ 'cosy:bg-gradient-to-b cosy:from-orange-900 cosy:to-yellow-200 dark:cosy:from-orange-900 dark:cosy:to-yellow-200',
34
+ 'cosy:bg-gradient-to-b cosy:from-green-900 cosy:to-teal-900 dark:cosy:from-green-900 dark:cosy:to-teal-900',
35
+
36
+ // 不透明的渐变背景
37
+ 'cosy:bg-gradient-to-br cosy:from-emerald-400 cosy:to-cyan-400 dark:cosy:from-emerald-600 dark:cosy:to-cyan-600',
38
+ 'cosy:bg-gradient-to-br cosy:from-violet-400 cosy:to-fuchsia-400 dark:cosy:from-violet-600 dark:cosy:to-fuchsia-600',
39
+ 'cosy:bg-gradient-to-br cosy:from-amber-400 cosy:to-orange-400 dark:cosy:from-amber-600 dark:cosy:to-orange-600',
40
+ 'cosy:bg-gradient-to-br cosy:from-rose-400 cosy:to-pink-400 dark:cosy:from-rose-600 dark:cosy:to-pink-600',
41
+ 'cosy:bg-gradient-to-br cosy:from-sky-400 cosy:to-indigo-400 dark:cosy:from-sky-600 dark:cosy:to-indigo-600',
42
+ 'cosy:bg-gradient-to-br cosy:from-lime-400 cosy:to-emerald-400 dark:cosy:from-lime-600 dark:cosy:to-emerald-600',
43
+ 'cosy:bg-gradient-to-br cosy:from-purple-400 cosy:to-indigo-400 dark:cosy:from-purple-600 dark:cosy:to-indigo-600',
44
+ 'cosy:bg-gradient-to-br cosy:from-blue-400 cosy:to-violet-400 dark:cosy:from-blue-600 dark:cosy:to-violet-600',
45
+
46
+ // 纯色背景
47
+ 'cosy:bg-emerald-400 dark:cosy:bg-emerald-600',
48
+ 'cosy:bg-violet-400 dark:cosy:bg-violet-600',
49
+ 'cosy:bg-amber-400 dark:cosy:bg-amber-600',
50
+ 'cosy:bg-rose-400 dark:cosy:bg-rose-600',
51
+ 'cosy:bg-sky-400 dark:cosy:bg-sky-600',
52
+ 'cosy:bg-lime-400 dark:cosy:bg-lime-600',
53
+ 'cosy:bg-purple-400 dark:cosy:bg-purple-600',
54
+ 'cosy:bg-blue-400 dark:cosy:bg-blue-600',
55
+ ];
@@ -1,17 +1,19 @@
1
- import Basic from './Basic.vue';
2
- import CustomBg from './CustomBg.vue';
3
- import DisplayMode from './DisplayMode.vue';
1
+ import Basic from './ExampleBasic.vue';
2
+ import CustomBg from './ExampleCustomBg.vue';
3
+ import DisplayModeAlways from './ExampleDisplayModeAlways.vue';
4
+ import DisplayModeHover from './ExampleDisplayModeHover.vue';
5
+ import DisplayModeNever from './ExampleDisplayModeNever.vue';
4
6
  import SmartBanner from './SmartBanner.vue';
5
- import SizePreset from './SizePreset.vue';
6
- import ImageExport from './ImageExport.vue';
7
- import CustomComponent from './CustomComponent.vue';
8
- import BasicSource from './Basic.vue?raw';
9
- import CustomBgSource from './CustomBg.vue?raw';
10
- import DisplayModeSource from './DisplayMode.vue?raw';
7
+ import SizePreset from './ExampleSizePreset.vue';
8
+ import ImageExport from './ExampleImageExport.vue';
9
+ import BasicSource from './ExampleBasic.vue?raw';
10
+ import CustomBgSource from './ExampleCustomBg.vue?raw';
11
+ import DisplayModeAlwaysSource from './ExampleDisplayModeAlways.vue?raw';
12
+ import DisplayModeHoverSource from './ExampleDisplayModeHover.vue?raw';
13
+ import DisplayModeNeverSource from './ExampleDisplayModeNever.vue?raw';
11
14
  import SmartBannerSource from './SmartBanner.vue?raw';
12
- import SizePresetSource from './SizePreset.vue?raw';
13
- import ImageExportSource from './ImageExport.vue?raw';
14
- import CustomComponentSource from './CustomComponent.vue?raw';
15
+ import SizePresetSource from './ExampleSizePreset.vue?raw';
16
+ import ImageExportSource from './ExampleImageExport.vue?raw';
15
17
 
16
18
  // 提取简单示例源代码函数
17
19
  function extractSimpleExample(source: string): string {
@@ -52,25 +54,30 @@ import { BannerBox } from 'cosy-ui'
52
54
  // 获取 BannerBox 和 FeatureCard 组件
53
55
  export { default as BannerBox } from './BannerBox.vue';
54
56
  export { default as FeatureCard } from './FeatureCard.vue';
57
+ export { default as DownloadButton } from './DownloadButton.vue';
58
+ export { bgClasses } from './bgStyles';
59
+ export { sizePresets, type SizePreset } from './sizePresets';
55
60
 
56
61
  // 导出示例组件
57
62
  export const BannerBoxExamples = {
58
63
  Basic,
59
64
  CustomBg,
60
- DisplayMode,
65
+ DisplayModeAlways,
66
+ DisplayModeHover,
67
+ DisplayModeNever,
61
68
  SmartBanner,
62
69
  SizePreset,
63
70
  ImageExport,
64
- CustomComponent,
65
71
  };
66
72
 
67
73
  // 导出示例源代码
68
74
  export const BannerBoxExampleCodes = {
69
75
  Basic: extractSimpleExample(BasicSource),
70
76
  CustomBg: extractSimpleExample(CustomBgSource),
71
- DisplayMode: extractSimpleExample(DisplayModeSource),
77
+ DisplayModeAlways: extractSimpleExample(DisplayModeAlwaysSource),
78
+ DisplayModeHover: extractSimpleExample(DisplayModeHoverSource),
79
+ DisplayModeNever: extractSimpleExample(DisplayModeNeverSource),
72
80
  SmartBanner: extractSimpleExample(SmartBannerSource),
73
81
  SizePreset: extractSimpleExample(SizePresetSource),
74
82
  ImageExport: extractSimpleExample(ImageExportSource),
75
- CustomComponent: extractSimpleExample(CustomComponentSource),
76
83
  };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * BannerBox组件的尺寸预设列表
3
+ * 包含各种常用尺寸和比例
4
+ */
5
+
6
+ export interface SizePreset {
7
+ name: string;
8
+ width: string;
9
+ height: string;
10
+ }
11
+
12
+ export const sizePresets: SizePreset[] = [
13
+ { name: 'Default', width: 'cosy:w-full', height: 'cosy:h-full' },
14
+ { name: 'Square', width: 'cosy:w-[600px]', height: 'cosy:h-[600px]' },
15
+ { name: 'Landscape', width: 'cosy:w-[800px]', height: 'cosy:h-[450px]' },
16
+ { name: 'Portrait', width: 'cosy:w-[450px]', height: 'cosy:h-[800px]' },
17
+ { name: 'Wide', width: 'cosy:w-[1200px]', height: 'cosy:h-[675px]' },
18
+ { name: 'Banner', width: 'cosy:w-[1200px]', height: 'cosy:h-[300px]' },
19
+ { name: '1280 × 800', width: 'cosy:w-[1280px]', height: 'cosy:h-[800px]' },
20
+ { name: '1440 × 900', width: 'cosy:w-[1440px]', height: 'cosy:h-[900px]' },
21
+ { name: '2560 × 1600', width: 'cosy:w-[2560px]', height: 'cosy:h-[1600px]' },
22
+ { name: '2880 × 1800', width: 'cosy:w-[2880px]', height: 'cosy:h-[1800px]' },
23
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffic/cosy-ui",
3
- "version": "0.6.14",
3
+ "version": "0.6.16",
4
4
  "description": "An astro component library",
5
5
  "author": {
6
6
  "name": "nookery",
@@ -1,60 +0,0 @@
1
- <!--
2
- @component BannerBox.CustomComponent
3
-
4
- @description
5
- BannerBox 组件的自定义组件集成示例,展示如何在横幅中插入其他UI组件。
6
-
7
- @usage
8
- ```vue
9
- <BannerBoxExamples.CustomComponent />
10
- ```
11
- -->
12
-
13
- <script lang="ts">
14
- import '../../app.css'
15
- import { defineComponent } from 'vue'
16
- import BannerBox from './BannerBox.vue'
17
-
18
- export default defineComponent({
19
- name: 'BannerBoxCustomComponentExample',
20
- components: {
21
- BannerBox
22
- },
23
- setup() {
24
- // 模拟按钮组件
25
- const Button = {
26
- props: ['text', 'variant', 'size'],
27
- template: `
28
- <button
29
- class="cosy:btn"
30
- :class="[
31
- variant ? 'cosy:btn-' + variant : '',
32
- size ? 'cosy:btn-' + size : ''
33
- ]"
34
- @click="$emit('click')"
35
- >
36
- {{ text }}
37
- </button>
38
- `
39
- };
40
-
41
- return {
42
- Button
43
- };
44
- }
45
- })
46
- </script>
47
-
48
- <template>
49
- <BannerBox title="带自定义组件的横幅" description="在横幅中集成其他UI组件" :features="[
50
- {
51
- emoji: '🎨',
52
- title: '可定制UI',
53
- link: '#customize'
54
- }
55
- ]" :customComponent="Button" :customComponentProps="{
56
- text: '立即注册',
57
- variant: 'primary',
58
- size: 'lg'
59
- }" />
60
- </template>
@@ -1,49 +0,0 @@
1
- <!--
2
- @component BannerBox.DisplayMode
3
-
4
- @description
5
- BannerBox 组件的显示模式示例,展示如何通过 displayMode 属性控制下载按钮的显示方式。
6
-
7
- @usage
8
- ```vue
9
- <BannerBoxExamples.DisplayMode />
10
- ```
11
- -->
12
-
13
- <script lang="ts">
14
- import '../../app.css'
15
- import { defineComponent } from 'vue'
16
- import BannerBox from './BannerBox.vue'
17
-
18
- export default defineComponent({
19
- name: 'BannerBoxDisplayModeExample',
20
- components: {
21
- BannerBox
22
- }
23
- })
24
- </script>
25
-
26
- <template>
27
- <div class="cosy:space-y-4">
28
- <h3 class="cosy:text-lg cosy:font-medium">总是显示下载按钮</h3>
29
- <BannerBox displayMode="always">
30
- <div class="cosy:flex cosy:items-center cosy:justify-center cosy:min-h-[100px]">
31
- <p>下载按钮始终可见</p>
32
- </div>
33
- </BannerBox>
34
-
35
- <h3 class="cosy:text-lg cosy:font-medium">悬停时显示下载按钮(默认)</h3>
36
- <BannerBox displayMode="hover">
37
- <div class="cosy:flex cosy:items-center cosy:justify-center cosy:min-h-[100px]">
38
- <p>鼠标悬停时显示下载按钮</p>
39
- </div>
40
- </BannerBox>
41
-
42
- <h3 class="cosy:text-lg cosy:font-medium">隐藏下载按钮</h3>
43
- <BannerBox displayMode="never">
44
- <div class="cosy:flex cosy:items-center cosy:justify-center cosy:min-h-[100px]">
45
- <p>不显示下载按钮</p>
46
- </div>
47
- </BannerBox>
48
- </div>
49
- </template>
@@ -1,5 +0,0 @@
1
- declare module '*.vue' {
2
- import { DefineComponent } from 'vue';
3
- const component: DefineComponent<{}, {}, any>;
4
- export default component;
5
- }