@atooyu/uxto-ui 1.0.0

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 (141) hide show
  1. package/README.md +259 -0
  2. package/dist/index.js +5055 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/index.mjs +5055 -0
  5. package/dist/index.mjs.map +1 -0
  6. package/dist/style.css +2528 -0
  7. package/package.json +93 -0
  8. package/src/components/index.ts +51 -0
  9. package/src/components/u-avatar/u-avatar.vue +205 -0
  10. package/src/components/u-badge/u-badge.vue +145 -0
  11. package/src/components/u-button/u-button.vue +239 -0
  12. package/src/components/u-cell/u-cell.vue +179 -0
  13. package/src/components/u-cell-group/u-cell-group.vue +46 -0
  14. package/src/components/u-checkbox/u-checkbox.vue +174 -0
  15. package/src/components/u-checkbox-group/u-checkbox-group.vue +72 -0
  16. package/src/components/u-code-input/u-code-input.vue +248 -0
  17. package/src/components/u-count-down/u-count-down.vue +182 -0
  18. package/src/components/u-datetime-picker/u-datetime-picker.vue +377 -0
  19. package/src/components/u-divider/u-divider.vue +71 -0
  20. package/src/components/u-empty/u-empty.vue +98 -0
  21. package/src/components/u-grid/u-grid.vue +63 -0
  22. package/src/components/u-grid-item/u-grid-item.vue +170 -0
  23. package/src/components/u-icon/icons/account.svg +3 -0
  24. package/src/components/u-icon/icons/arrow-down.svg +3 -0
  25. package/src/components/u-icon/icons/arrow-left.svg +3 -0
  26. package/src/components/u-icon/icons/arrow-right.svg +3 -0
  27. package/src/components/u-icon/icons/arrow-up.svg +3 -0
  28. package/src/components/u-icon/icons/bell.svg +3 -0
  29. package/src/components/u-icon/icons/bookmark-o.svg +3 -0
  30. package/src/components/u-icon/icons/bookmark.svg +3 -0
  31. package/src/components/u-icon/icons/chat.svg +3 -0
  32. package/src/components/u-icon/icons/check-circle.svg +3 -0
  33. package/src/components/u-icon/icons/check.svg +3 -0
  34. package/src/components/u-icon/icons/chevron-left.svg +3 -0
  35. package/src/components/u-icon/icons/chevron-right.svg +3 -0
  36. package/src/components/u-icon/icons/clear-o.svg +3 -0
  37. package/src/components/u-icon/icons/clear.svg +3 -0
  38. package/src/components/u-icon/icons/clipboard.svg +3 -0
  39. package/src/components/u-icon/icons/clock.svg +3 -0
  40. package/src/components/u-icon/icons/close.svg +3 -0
  41. package/src/components/u-icon/icons/code.svg +3 -0
  42. package/src/components/u-icon/icons/copy.svg +3 -0
  43. package/src/components/u-icon/icons/delete.svg +3 -0
  44. package/src/components/u-icon/icons/download.svg +3 -0
  45. package/src/components/u-icon/icons/edit.svg +3 -0
  46. package/src/components/u-icon/icons/email.svg +3 -0
  47. package/src/components/u-icon/icons/error-o.svg +3 -0
  48. package/src/components/u-icon/icons/error.svg +3 -0
  49. package/src/components/u-icon/icons/exit-fullscreen.svg +3 -0
  50. package/src/components/u-icon/icons/expand-less.svg +3 -0
  51. package/src/components/u-icon/icons/expand-more.svg +3 -0
  52. package/src/components/u-icon/icons/eye-off.svg +3 -0
  53. package/src/components/u-icon/icons/eye.svg +3 -0
  54. package/src/components/u-icon/icons/flag-o.svg +3 -0
  55. package/src/components/u-icon/icons/flag.svg +3 -0
  56. package/src/components/u-icon/icons/fullscreen.svg +3 -0
  57. package/src/components/u-icon/icons/grid.svg +3 -0
  58. package/src/components/u-icon/icons/group.svg +3 -0
  59. package/src/components/u-icon/icons/heart-o.svg +3 -0
  60. package/src/components/u-icon/icons/heart.svg +3 -0
  61. package/src/components/u-icon/icons/info-o.svg +3 -0
  62. package/src/components/u-icon/icons/info.svg +3 -0
  63. package/src/components/u-icon/icons/keyboard-arrow-down.svg +3 -0
  64. package/src/components/u-icon/icons/keyboard-arrow-left.svg +3 -0
  65. package/src/components/u-icon/icons/keyboard-arrow-right.svg +3 -0
  66. package/src/components/u-icon/icons/keyboard-arrow-up.svg +3 -0
  67. package/src/components/u-icon/icons/like-o.svg +3 -0
  68. package/src/components/u-icon/icons/like.svg +3 -0
  69. package/src/components/u-icon/icons/link.svg +3 -0
  70. package/src/components/u-icon/icons/list.svg +3 -0
  71. package/src/components/u-icon/icons/loading.svg +3 -0
  72. package/src/components/u-icon/icons/lock.svg +3 -0
  73. package/src/components/u-icon/icons/menu-o.svg +3 -0
  74. package/src/components/u-icon/icons/menu.svg +3 -0
  75. package/src/components/u-icon/icons/message.svg +3 -0
  76. package/src/components/u-icon/icons/minus.svg +3 -0
  77. package/src/components/u-icon/icons/notification.svg +3 -0
  78. package/src/components/u-icon/icons/phone.svg +3 -0
  79. package/src/components/u-icon/icons/plus.svg +3 -0
  80. package/src/components/u-icon/icons/question.svg +3 -0
  81. package/src/components/u-icon/icons/redo.svg +3 -0
  82. package/src/components/u-icon/icons/refresh-o.svg +3 -0
  83. package/src/components/u-icon/icons/refresh.svg +3 -0
  84. package/src/components/u-icon/icons/reload.svg +3 -0
  85. package/src/components/u-icon/icons/search-o.svg +3 -0
  86. package/src/components/u-icon/icons/search.svg +3 -0
  87. package/src/components/u-icon/icons/setting.svg +3 -0
  88. package/src/components/u-icon/icons/share.svg +3 -0
  89. package/src/components/u-icon/icons/smile-o.svg +3 -0
  90. package/src/components/u-icon/icons/smile.svg +3 -0
  91. package/src/components/u-icon/icons/star-o.svg +3 -0
  92. package/src/components/u-icon/icons/star.svg +3 -0
  93. package/src/components/u-icon/icons/success-o.svg +3 -0
  94. package/src/components/u-icon/icons/success.svg +3 -0
  95. package/src/components/u-icon/icons/sync.svg +3 -0
  96. package/src/components/u-icon/icons/tick.svg +3 -0
  97. package/src/components/u-icon/icons/undo.svg +3 -0
  98. package/src/components/u-icon/icons/unlock.svg +3 -0
  99. package/src/components/u-icon/icons/upload.svg +3 -0
  100. package/src/components/u-icon/icons/user.svg +3 -0
  101. package/src/components/u-icon/icons/warning-o.svg +3 -0
  102. package/src/components/u-icon/icons/warning.svg +3 -0
  103. package/src/components/u-icon/icons/zoom-in.svg +3 -0
  104. package/src/components/u-icon/icons/zoom-out.svg +3 -0
  105. package/src/components/u-icon/index.ts +219 -0
  106. package/src/components/u-icon/u-icon.vue +117 -0
  107. package/src/components/u-image/u-image.vue +106 -0
  108. package/src/components/u-input/u-input.vue +208 -0
  109. package/src/components/u-keyboard/u-keyboard.vue +213 -0
  110. package/src/components/u-layout/u-layout.vue +58 -0
  111. package/src/components/u-line-progress/u-line-progress.vue +156 -0
  112. package/src/components/u-link/u-link.vue +113 -0
  113. package/src/components/u-list/u-list.vue +148 -0
  114. package/src/components/u-list-item/u-list-item.vue +180 -0
  115. package/src/components/u-loading/u-loading.vue +80 -0
  116. package/src/components/u-loading-page/u-loading-page.vue +94 -0
  117. package/src/components/u-modal/u-modal.vue +159 -0
  118. package/src/components/u-notice-bar/u-notice-bar.vue +113 -0
  119. package/src/components/u-number-box/u-number-box.vue +262 -0
  120. package/src/components/u-parse/u-parse.vue +197 -0
  121. package/src/components/u-picker/u-picker.vue +219 -0
  122. package/src/components/u-popup/u-popup.vue +257 -0
  123. package/src/components/u-radio/u-radio.vue +159 -0
  124. package/src/components/u-radio-group/u-radio-group.vue +61 -0
  125. package/src/components/u-rate/u-rate.vue +187 -0
  126. package/src/components/u-read-more/u-read-more.vue +117 -0
  127. package/src/components/u-search/u-search.vue +238 -0
  128. package/src/components/u-skeleton/u-skeleton.vue +192 -0
  129. package/src/components/u-slider/u-slider.vue +453 -0
  130. package/src/components/u-swiper/u-swiper.vue +301 -0
  131. package/src/components/u-swiper-item/u-swiper-item.vue +82 -0
  132. package/src/components/u-switch/u-switch.vue +105 -0
  133. package/src/components/u-tabbar/u-tabbar.vue +221 -0
  134. package/src/components/u-tag/u-tag.vue +144 -0
  135. package/src/components/u-textarea/u-textarea.vue +189 -0
  136. package/src/components/u-toast/u-toast.vue +186 -0
  137. package/src/components/u-tooltip/u-tooltip.vue +364 -0
  138. package/src/components/u-transition/u-transition.vue +216 -0
  139. package/src/components/u-upload/u-upload.vue +403 -0
  140. package/src/styles/index.scss +59 -0
  141. package/src/styles/variables.scss +68 -0
package/README.md ADDED
@@ -0,0 +1,259 @@
1
+ # @atooyu/uxto-ui
2
+
3
+ 跨平台 UI 组件库,支持 **Android**、**iOS**、**鸿蒙** 三端打包。
4
+
5
+ [文档网站](./docs/index.md) | [快速开始](#快速开始) | [组件列表](#组件列表)
6
+
7
+ ## 安装
8
+
9
+ ```bash
10
+ npm install @atooyu/uxto-ui
11
+ # 或
12
+ pnpm add @atooyu/uxto-ui
13
+ ```
14
+
15
+ ## 技术栈
16
+
17
+ - **框架**: uni-app + Vue 3 + TypeScript
18
+ - **构建**: Vite
19
+ - **样式**: SCSS
20
+
21
+ ## 快速开始
22
+
23
+ ### 安装依赖
24
+
25
+ ```bash
26
+ npm install
27
+ ```
28
+
29
+ ### 开发模式
30
+
31
+ ```bash
32
+ # H5
33
+ npm run dev:h5
34
+
35
+ # App (Android/iOS)
36
+ npm run dev
37
+
38
+ # 微信小程序
39
+ npm run dev:mp-weixin
40
+ ```
41
+
42
+ ### 构建打包
43
+
44
+ ```bash
45
+ # App
46
+ npm run build:app
47
+
48
+ # 鸿蒙
49
+ npm run build:harmony
50
+
51
+ # H5
52
+ npm run build:h5
53
+
54
+ # 微信小程序
55
+ npm run build:mp-weixin
56
+ ```
57
+
58
+ ## 组件列表
59
+
60
+ ### 基础组件
61
+ | 组件 | 说明 |
62
+ |------|------|
63
+ | u-button | 按钮 |
64
+ | u-cell | 单元格 |
65
+ | u-cell-group | 单元格组 |
66
+ | u-icon | 图标 |
67
+ | u-image | 图片 |
68
+ | u-divider | 分割线 |
69
+ | u-loading | 加载 |
70
+ | u-badge | 徽标 |
71
+ | u-tag | 标签 |
72
+ | u-avatar | 头像 |
73
+ | u-empty | 空状态 |
74
+ | u-skeleton | 骨架屏 |
75
+
76
+ ### 表单组件
77
+ | 组件 | 说明 |
78
+ |------|------|
79
+ | u-input | 输入框 |
80
+ | u-textarea | 文本域 |
81
+ | u-switch | 开关 |
82
+ | u-slider | 滑块 |
83
+ | u-rate | 评分 |
84
+ | u-checkbox | 复选框 |
85
+ | u-radio | 单选框 |
86
+ | u-picker | 选择器 |
87
+ | u-datetime-picker | 时间选择器 |
88
+ | u-number-box | 数字输入框 |
89
+ | u-code-input | 验证码输入 |
90
+ | u-search | 搜索框 |
91
+ | u-upload | 上传 |
92
+
93
+ ### 反馈组件
94
+ | 组件 | 说明 |
95
+ |------|------|
96
+ | u-modal | 弹窗 |
97
+ | u-popup | 弹出层 |
98
+ | u-toast | 轻提示 |
99
+ | u-loading-page | 加载页 |
100
+ | u-keyboard | 键盘 |
101
+ | u-tooltip | 文字提示 |
102
+ | u-notice-bar | 通知栏 |
103
+
104
+ ### 导航组件
105
+ | 组件 | 说明 |
106
+ |------|------|
107
+ | u-tabbar | 底部导航 |
108
+ | u-swiper | 轮播图 |
109
+ | u-grid | 宫格 |
110
+ | u-list | 列表 |
111
+
112
+ ### 展示组件
113
+ | 组件 | 说明 |
114
+ |------|------|
115
+ | u-line-progress | 进度条 |
116
+ | u-count-down | 倒计时 |
117
+ | u-parse | 富文本解析 |
118
+
119
+ ### 其他组件
120
+ | 组件 | 说明 |
121
+ |------|------|
122
+ | u-layout | 布局 |
123
+ | u-link | 链接 |
124
+ | u-read-more | 展开阅读更多 |
125
+ | u-transition | 过渡动画 |
126
+
127
+ ## 使用方式
128
+
129
+ 组件支持 easycom 自动导入,无需手动引入:
130
+
131
+ ```vue
132
+ <template>
133
+ <u-button type="primary">按钮</u-button>
134
+ <u-input v-model="value" placeholder="请输入" />
135
+ <u-tabbar v-model="active" />
136
+ </template>
137
+ ```
138
+
139
+ ## 目录结构
140
+
141
+ ```
142
+ uxto-ui/
143
+ ├── src/
144
+ │ ├── components/ # 组件目录
145
+ │ │ ├── u-button/
146
+ │ │ ├── u-input/
147
+ │ │ └── ...
148
+ │ ├── pages/ # 页面目录
149
+ │ ├── styles/ # 样式文件
150
+ │ ├── App.vue
151
+ │ ├── main.ts
152
+ │ ├── manifest.json # 应用配置
153
+ │ └── pages.json # 页面配置
154
+ ├── docs/ # 文档目录
155
+ ├── ecosystem/ # 生态工具
156
+ │ ├── cli/ # 命令行工具
157
+ │ ├── build/ # 构建配置
158
+ │ └── style/ # 样式系统
159
+ ├── package.json
160
+ ├── vite.config.ts
161
+ └── tsconfig.json
162
+ ```
163
+
164
+ ## Ecosystem 生态
165
+
166
+ ### @uxto-ui/cli
167
+
168
+ 命令行脚手架工具
169
+
170
+ ```bash
171
+ # 安装
172
+ npm install -g @uxto-ui/cli
173
+
174
+ # 创建项目
175
+ uxto create my-app
176
+
177
+ # 添加组件
178
+ uxto add button
179
+ ```
180
+
181
+ ### @uxto-ui/style
182
+
183
+ 样式系统和设计令牌
184
+
185
+ ```scss
186
+ @use '@uxto-ui/style' as *;
187
+
188
+ .container {
189
+ color: $uxto-primary;
190
+ padding: $uxto-spacing-4;
191
+ }
192
+ ```
193
+
194
+ ### @uxto-ui/build
195
+
196
+ 构建配置工具
197
+
198
+ ```typescript
199
+ import { createUniBuildConfig } from '@uxto-ui/build'
200
+ ```
201
+
202
+ ## 发布到 NPM
203
+
204
+ ### 构建组件库
205
+
206
+ ```bash
207
+ npm run build:lib
208
+ ```
209
+
210
+ ### 发布
211
+
212
+ ```bash
213
+ # 登录 npm
214
+ npm login
215
+
216
+ # 发布
217
+ npm publish
218
+ ```
219
+
220
+ ### 发布作用域包
221
+
222
+ ```bash
223
+ npm publish --access public
224
+ ```
225
+
226
+ ## 打包说明
227
+
228
+ ### Android 打包
229
+ 1. 运行 `npm run build:app`
230
+ 2. 使用 HBuilderX 云打包或离线打包
231
+
232
+ ### iOS 打包
233
+ 1. 运行 `npm run build:app`
234
+ 2. 使用 HBuilderX 云打包或离线打包
235
+
236
+ ### 鸿蒙打包
237
+ 1. 运行 `npm run build:harmony`
238
+ 2. 使用 DevEco Studio 打开项目打包
239
+
240
+ ## 跨平台兼容性
241
+
242
+ 所有组件都已适配以下平台:
243
+
244
+ - ✅ Android
245
+ - ✅ iOS
246
+ - ✅ 鸿蒙 (HarmonyOS)
247
+ - ✅ H5
248
+ - ✅ 微信小程序
249
+
250
+ ### 兼容性处理
251
+
252
+ 1. **安全区域**: 使用 `env(safe-area-inset-*)` 并添加鸿蒙兼容变量
253
+ 2. **触摸事件**: 统一使用 `@click` 和 `@touchstart` 等事件
254
+ 3. **API调用**: 使用 `uni.*` API 而非平台特定 API
255
+ 4. **CSS属性**: 移除 `cursor` 等 Web-only 属性
256
+
257
+ ## License
258
+
259
+ MIT