bricks-ui-library 0.0.1

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.
package/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # Bricks UI Library
2
+
3
+ 一个基于 Vue 3 的组件库,用于开发纯展示类组件。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm install bricks-ui-library @iconify/vue
9
+ # 或
10
+ yarn add bricks-ui-library @iconify/vue
11
+ # 或
12
+ pnpm add bricks-ui-library @iconify/vue
13
+ ```
14
+
15
+ > 注意:如果您的项目使用图标功能,需要安装 `@iconify/vue` 依赖。
16
+
17
+ ## 使用
18
+
19
+ ### 全局注册
20
+
21
+ ```javascript
22
+ import { createApp } from 'vue'
23
+ import BricksUiLibrary from 'bricks-ui-library'
24
+ import 'bricks-ui-library/dist/style.css' // 如果有样式文件
25
+
26
+ const app = createApp(App)
27
+
28
+ // 全局注册所有组件
29
+ app.use(BricksUiLibrary)
30
+
31
+ app.mount('#app')
32
+ ```
33
+
34
+ ### 按需引入
35
+
36
+ ```javascript
37
+ import { HelloWorld, TheWelcome } from 'bricks-ui-library'
38
+
39
+ export default {
40
+ components: {
41
+ HelloWorld,
42
+ TheWelcome
43
+ }
44
+ }
45
+ ```
46
+
47
+ ## 组件列表
48
+
49
+ ### HelloWorld
50
+
51
+ 展示文本信息的组件。
52
+
53
+ #### Props
54
+
55
+ | 属性 | 类型 | 默认值 | 说明 |
56
+ |------|------|--------|------|
57
+ | title | string | 'Hello World!' | 展示的主标题文本 |
58
+ | subtitle | string | 'This is a sample component' | 展示的副标题文本 |
59
+ | titleColor | string | '#42b883' | 标题颜色 |
60
+ | subtitleColor | string | '#7f8c8d' | 副标题颜色 |
61
+ | showSubtitle | boolean | true | 是否显示副标题 |
62
+
63
+ #### 示例
64
+
65
+ ```vue
66
+ <template>
67
+ <HelloWorld
68
+ title="Welcome to Bricks UI"
69
+ subtitle="A component library for Vue 3"
70
+ :show-subtitle="true"
71
+ />
72
+ </template>
73
+ ```
74
+
75
+ ### TheWelcome
76
+
77
+ 展示欢迎信息列表的组件。
78
+
79
+ #### Props
80
+
81
+ | 属性 | 类型 | 默认值 | 说明 |
82
+ |------|------|--------|------|
83
+ | items | Array | 见源码 | 欢迎项数据 |
84
+ | title | string | 'Welcome to Your Component Library' | 组件标题 |
85
+
86
+ #### 示例
87
+
88
+ ```vue
89
+ <template>
90
+ <TheWelcome
91
+ title="Custom Welcome Content"
92
+ :items="[
93
+ {
94
+ icon: 'features',
95
+ heading: 'Feature Rich',
96
+ content: 'Our components are designed to be flexible and customizable.'
97
+ }
98
+ ]"
99
+ />
100
+ </template>
101
+ ```
102
+
103
+ ### WelcomeItem
104
+
105
+ 展示单个欢迎项的组件。
106
+
107
+ #### Props
108
+
109
+ | 属性 | 类型 | 默认值 | 说明 |
110
+ |------|------|--------|------|
111
+ | icon | string | '' | 图标名称 (支持 Iconify 图标,如 'mdi:home') |
112
+ | heading | string | 'Item Title' | 标题内容 |
113
+ | content | string | 'Item content description' | 内容文本 |
114
+ | vertical | boolean | false | 是否垂直布局 |
115
+ | iconSize | string | '1.5rem' | 图标大小 |
116
+
117
+ #### 图标支持
118
+
119
+ 组件支持使用 Iconify 图标库中的图标。您可以通过 `icon` 属性传入图标名称,格式为 `集合名称:图标名称`,例如:
120
+
121
+ - `mdi:home` - Material Design Icons 的 home 图标
122
+ - `fa:heart` - Font Awesome 的 heart 图标
123
+ - `carbon:logo-github` - Carbon 的 GitHub 图标
124
+
125
+ 您也可以通过插槽自定义图标内容。
126
+
127
+ #### 示例
128
+
129
+ ```vue
130
+ <template>
131
+ <WelcomeItem
132
+ icon="mdi:star"
133
+ heading="Featured Item"
134
+ content="This is a featured item with a star icon"
135
+ :vertical="true"
136
+ />
137
+ </template>
138
+ ```
139
+
140
+ 或者使用插槽自定义图标:
141
+
142
+ ```vue
143
+ <template>
144
+ <WelcomeItem
145
+ heading="Custom Icon Item"
146
+ content="This item has a custom icon"
147
+ >
148
+ <template #icon>
149
+ <div class="custom-icon">⭐</div>
150
+ </template>
151
+ </WelcomeItem>
152
+ </template>
153
+ ```
154
+
155
+ ## 开发
156
+
157
+ ```bash
158
+ # 安装依赖
159
+ pnpm install
160
+
161
+ # 启动开发服务器
162
+ pnpm dev
163
+
164
+ # 构建组件库
165
+ pnpm build-lib
166
+
167
+ # 构建开发应用
168
+ pnpm build
169
+ ```
170
+
171
+ ## 贡献
172
+
173
+ 欢迎提交 issue 和 pull request 来帮助改进这个组件库。
@@ -0,0 +1 @@
1
+ .hello-world[data-v-029130f9]{text-align:center}.title[data-v-029130f9]{font-weight:500;font-size:2.6rem;position:relative;top:-10px}.subtitle[data-v-029130f9]{font-size:1.2rem}@media(min-width:1024px){.hello-world[data-v-029130f9]{text-align:left}}.item[data-v-207e41b6]{margin-top:2rem;display:flex;position:relative;padding:1rem;border:1px solid #e0e0e0;border-radius:8px;background-color:#fff;box-shadow:0 2px 4px #0000000d}.item.vertical[data-v-207e41b6]{flex-direction:column;align-items:center;text-align:center}.icon-wrapper[data-v-207e41b6]{display:flex;align-items:center;justify-content:center;flex-shrink:0}.default-icon[data-v-207e41b6]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px;background-color:#f0f0f0;color:#666;font-weight:700}.details[data-v-207e41b6]{flex:1;margin-left:1rem}.vertical .details[data-v-207e41b6]{margin-left:0;margin-top:1rem}.heading[data-v-207e41b6]{font-size:1.2rem;font-weight:500;margin-bottom:.4rem;color:#2c3e50}.content[data-v-207e41b6]{color:#666;line-height:1.5}@media(min-width:1024px){.item[data-v-207e41b6]{margin-top:0;padding:1.2rem}.default-icon[data-v-207e41b6]{width:50px;height:50px;font-size:1.5rem}.item.vertical[data-v-207e41b6]{padding:1.5rem}}.welcome-container[data-v-95e350f3]{max-width:900px;margin:0 auto;padding:2rem 1rem}.welcome-title[data-v-95e350f3]{text-align:center;margin-bottom:2rem;font-size:1.8rem;color:#2c3e50}.icon-placeholder[data-v-95e350f3]{width:48px;height:48px;border-radius:8px;background:linear-gradient(135deg,#42b883,#35495e);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:1.2rem}