@zuoyo/viteui 0.0.2 → 0.0.3

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 (2) hide show
  1. package/README_EN.md +227 -0
  2. package/package.json +26 -7
package/README_EN.md ADDED
@@ -0,0 +1,227 @@
1
+ # ViteUI Documentation
2
+
3
+ [简体中文](./README.md) | **English**
4
+
5
+ ---
6
+
7
+ ## Introduction
8
+
9
+ ViteUI is a modern UI component library based on Vue 3 and TypeScript, providing rich enterprise-level components to help you quickly build beautiful and efficient web applications.
10
+
11
+ ### Features
12
+
13
+ - 🚀 Built on Vue 3 Composition API
14
+ - 💪 Written in TypeScript with complete type definitions
15
+ - 📦 50+ high-quality components out of the box
16
+ - 🎨 Theme customization support
17
+ - 🌍 Internationalization support
18
+ - ⚡️ Built with Vite for excellent development experience
19
+
20
+ ## Getting Started
21
+
22
+ ### Requirements
23
+
24
+ - Node.js >= 14.0.0
25
+ - Vue >= 3.2.0
26
+
27
+ ### Installation
28
+
29
+ #### Using npm
30
+
31
+ ```bash
32
+ npm install viteui --save
33
+ ```
34
+
35
+ #### Using pnpm
36
+
37
+ ```bash
38
+ pnpm add viteui
39
+ ```
40
+
41
+ #### Using yarn
42
+
43
+ ```bash
44
+ yarn add viteui
45
+ ```
46
+
47
+ ### Full Import
48
+
49
+ Import in `main.ts`:
50
+
51
+ ```typescript
52
+ import { createApp } from 'vue';
53
+ import App from './App.vue';
54
+ import ViteUI from 'viteui';
55
+ import 'viteui/dist/themes/default/index.css';
56
+ import 'viteui/dist/themes/icon.css';
57
+
58
+ const app = createApp(App);
59
+ app.use(ViteUI);
60
+ app.mount('#app');
61
+ ```
62
+
63
+ ### On-demand Import
64
+
65
+ ```typescript
66
+ import { createApp } from 'vue';
67
+ import App from './App.vue';
68
+ import { VuLinkButton, VuPanel, VuDataGrid } from 'viteui';
69
+ import 'viteui/dist/themes/default/index.css';
70
+ import 'viteui/dist/themes/icon.css';
71
+
72
+ const app = createApp(App);
73
+ app.component(VuLinkButton.name, VuLinkButton);
74
+ app.component(VuPanel.name, VuPanel);
75
+ app.component(VuDataGrid.name, VuDataGrid);
76
+ app.mount('#app');
77
+ ```
78
+
79
+ ### Usage
80
+
81
+ Use in components:
82
+
83
+ ```vue
84
+ <template>
85
+ <vu-link-button @click="handleClick">Click Me</vu-link-button>
86
+ </template>
87
+
88
+ <script setup lang="ts">
89
+ const handleClick = () => {
90
+ console.log('Button clicked!');
91
+ };
92
+ </script>
93
+ ```
94
+
95
+ ## Theme Customization
96
+
97
+ ViteUI provides multiple built-in themes for you to choose from:
98
+
99
+ ### Available Themes
100
+
101
+ - `default` - Default theme
102
+ - `bootstrap` - Bootstrap style
103
+ - `black` - Black theme
104
+ - `gray` - Gray theme
105
+ - `metro` - Metro style
106
+ - `material` - Material Design style
107
+ - `material-blue` - Material Design Blue
108
+ - `material-teal` - Material Design Teal
109
+
110
+ ### Using Themes
111
+
112
+ ```typescript
113
+ // Import theme styles
114
+ import 'viteui/dist/themes/material/index.css';
115
+ import 'viteui/dist/themes/icon.css';
116
+ ```
117
+
118
+ ## Internationalization
119
+
120
+ ViteUI supports multiple languages with 30+ built-in language packs.
121
+
122
+ ### Usage
123
+
124
+ ```typescript
125
+ import { createApp } from 'vue';
126
+ import ViteUI from 'viteui';
127
+ import enUS from 'viteui/dist/locale/lang-en';
128
+
129
+ const app = createApp(App);
130
+ app.use(ViteUI, {
131
+ locale: enUS
132
+ });
133
+ ```
134
+
135
+ ### Supported Languages
136
+
137
+ - zh_CN - Simplified Chinese
138
+ - zh_TW - Traditional Chinese
139
+ - en - English
140
+ - ja - Japanese
141
+ - ko - Korean
142
+ - fr - French
143
+ - de - German
144
+ - es - Spanish
145
+ - And more...
146
+
147
+ ## Form Validation
148
+
149
+ ViteUI provides powerful form validation features.
150
+
151
+ ### Built-in Validation Rules
152
+
153
+ ```typescript
154
+ import { ValidateRules } from 'viteui';
155
+
156
+ // Add custom validation rule
157
+ ValidateRules.customRule = {
158
+ validator: (value: any) => {
159
+ return value.length >= 6;
160
+ },
161
+ message: 'Length must be greater than or equal to 6'
162
+ };
163
+ ```
164
+
165
+ ### Using in Forms
166
+
167
+ ```vue
168
+ <vu-form :model="formData" :rules="rules" ref="formRef">
169
+ <vu-form-field name="username" label="Username">
170
+ <vu-text-box v-model="formData.username"></vu-text-box>
171
+ </vu-form-field>
172
+ </vu-form>
173
+ ```
174
+
175
+ ## Global Configuration
176
+
177
+ ### Configuration Options
178
+
179
+ ```typescript
180
+ app.use(ViteUI, {
181
+ locale: enUS, // Locale configuration
182
+ rules: { // Custom validation rules
183
+ customRule: {
184
+ validator: (value) => value.length >= 6,
185
+ message: 'Length must be greater than or equal to 6'
186
+ }
187
+ }
188
+ });
189
+ ```
190
+
191
+ ## FAQ
192
+
193
+ ### 1. Styles not working?
194
+
195
+ Make sure you have imported the style files correctly:
196
+
197
+ ```typescript
198
+ import 'viteui/dist/themes/default/index.css';
199
+ import 'viteui/dist/themes/icon.css';
200
+ ```
201
+
202
+ ### 2. Incomplete TypeScript type hints?
203
+
204
+ Make sure you have configured the types correctly in `tsconfig.json`:
205
+
206
+ ```json
207
+ {
208
+ "compilerOptions": {
209
+ "types": ["viteui"]
210
+ }
211
+ }
212
+ ```
213
+
214
+ ## Browser Support
215
+
216
+ - Chrome >= 90
217
+ - Firefox >= 88
218
+ - Safari >= 14
219
+ - Edge >= 90
220
+
221
+ ## Contact Us
222
+
223
+ - Official Website: https://www.viteui.com
224
+
225
+ ---
226
+
227
+ **Thank you for using ViteUI!** 🎉
package/package.json CHANGED
@@ -1,19 +1,36 @@
1
1
  {
2
2
  "name": "@zuoyo/viteui",
3
3
  "private": false,
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
+ "description": "A modern UI component library for Vue 3",
6
+ "keywords": [
7
+ "vue",
8
+ "vue3",
9
+ "vite",
10
+ "ui",
11
+ "components",
12
+ "typescript"
13
+ ],
14
+ "author": "zuoyo",
15
+ "license": "MIT",
5
16
  "type": "module",
6
17
  "scripts": {
7
18
  "dev": "vite",
8
19
  "build": "vite build && tsc -p tsconfig.build.json",
9
- "preview": "vite preview"
20
+ "preview": "vite preview",
21
+ "prepublishOnly": "npm run build"
10
22
  },
11
- "dependencies": {
12
- "core-js": "^3.30.0",
13
- "vite-plugin-static-copy": "^3.1.4",
14
- "vue": "^3.2.47"
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "registry": "https://registry.npmjs.org/"
26
+ },
27
+ "peerDependencies": {
28
+ "vue": "^3.2.0"
15
29
  },
30
+ "dependencies": {},
16
31
  "devDependencies": {
32
+ "vue": "^3.2.47",
33
+ "vite-plugin-static-copy": "^3.1.4",
17
34
  "@types/node": "^20.0.0",
18
35
  "@vitejs/plugin-vue": "^4.1.0",
19
36
  "@vitejs/plugin-vue-jsx": "^3.0.0",
@@ -34,6 +51,8 @@
34
51
  "./dist/locale/*": "./dist/locale/*"
35
52
  },
36
53
  "files": [
37
- "dist"
54
+ "dist",
55
+ "README.md",
56
+ "README_EN.md"
38
57
  ]
39
58
  }