tang-ui-x 1.2.6 → 1.2.8

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.
@@ -159,7 +159,7 @@ const handleCancel = (): void => {
159
159
  <view class="t-search-bar__content" :style="inputStyle">
160
160
  <!-- 左侧搜索图标 -->
161
161
  <view v-if="showLeftIcon" class="t-search-bar__icon-wrapper">
162
- <TIcon name="sousuo" :size="32" color="#969799" />
162
+ <TIcon name="icon-sousuo" :size="32" color="#969799" />
163
163
  </view>
164
164
 
165
165
  <!-- 输入框 -->
@@ -183,7 +183,7 @@ const handleCancel = (): void => {
183
183
  class="t-search-bar__clear"
184
184
  @click="handleClear"
185
185
  >
186
- <TIcon name="shanchu" color="#ffffff" />
186
+ <TIcon name="icon-shanchu" color="#ffffff" />
187
187
  </view>
188
188
  </view>
189
189
 
@@ -432,12 +432,12 @@
432
432
  <view class="select-icons">
433
433
  <!-- 清空按钮 -->
434
434
  <view v-if="showClearIcon" class="clear-icon" @click.stop="clearValue">
435
- <Icon name="icon-close-circle" :size="14" color="#c0c4cc" />
435
+ <Icon name="icon-shanchu" color="#c0c4cc" />
436
436
  </view>
437
437
 
438
438
  <!-- 下拉箭头 -->
439
439
  <view class="select-arrow" :class="{ 'arrow-up': showPopup }">
440
- <Icon name="icon-xiajiantou-copy" :size="12" color="#999" />
440
+ <Icon name="icon-xiajiantou" :size="20" color="#999" />
441
441
  </view>
442
442
  </view>
443
443
  </view>
@@ -486,7 +486,7 @@
486
486
 
487
487
  <!-- 有子级时显示右箭头 -->
488
488
  <view v-if="option.children != null && option.children.length > 0" class="cascade-arrow">
489
- <Icon name="icon-xiajiantou-copy" :size="12" color="#999" />
489
+ <Icon name="icon-xiajiantou" :size="12" color="#999" />
490
490
  </view>
491
491
 
492
492
  <!-- 叶子节点被选中时显示 ✓ -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tang-ui-x",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "UniApp X UI 组件库 - 基于 uni-app x 的移动端 UI 组件库",
5
5
  "main": "index.uts",
6
6
  "module": "index.uts",
@@ -1,23 +1,31 @@
1
- @font-face {
2
- font-family: "iconfont"; /* Project id 5118443 */
3
- src: url('iconfont.woff2?t=1769506917347') format('woff2'),
4
- url('iconfont.woff?t=1769506917347') format('woff'),
5
- url('iconfont.ttf?t=1769506917347') format('truetype');
6
- }
7
-
8
- .iconfont {
9
- font-family: "iconfont" !important;
10
- font-size: 16px;
11
- font-style: normal;
12
- -webkit-font-smoothing: antialiased;
13
- -moz-osx-font-smoothing: grayscale;
14
- }
15
-
16
- .icon-shanchu:before {
17
- content: "\e61a";
18
- }
19
-
20
- .icon-sousuo:before {
21
- content: "\e602";
22
- }
23
-
1
+ @font-face {
2
+ font-family: "iconfont"; /* Project id 5118443 */
3
+ src: url('iconfont.woff2?t=1772268917050') format('woff2'),
4
+ url('iconfont.woff?t=1772268917050') format('woff'),
5
+ url('iconfont.ttf?t=1772268917050') format('truetype');
6
+ }
7
+
8
+ .iconfont {
9
+ font-family: "iconfont" !important;
10
+ font-size: 16px;
11
+ font-style: normal;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ .icon-xiajiantou:before {
17
+ content: "\e656";
18
+ }
19
+
20
+ .icon-tianjia:before {
21
+ content: "\e62d";
22
+ }
23
+
24
+ .icon-shanchu:before {
25
+ content: "\e61a";
26
+ }
27
+
28
+ .icon-sousuo:before {
29
+ content: "\e602";
30
+ }
31
+
@@ -1,23 +1,37 @@
1
- {
2
- "id": "5118443",
3
- "name": "tang-ui",
4
- "font_family": "iconfont",
5
- "css_prefix_text": "icon-",
6
- "description": "",
7
- "glyphs": [
8
- {
9
- "icon_id": "4942655",
10
- "name": "删除",
11
- "font_class": "shanchu",
12
- "unicode": "e61a",
13
- "unicode_decimal": 58906
14
- },
15
- {
16
- "icon_id": "17830630",
17
- "name": "搜索",
18
- "font_class": "sousuo",
19
- "unicode": "e602",
20
- "unicode_decimal": 58882
21
- }
22
- ]
23
- }
1
+ {
2
+ "id": "5118443",
3
+ "name": "tang-ui",
4
+ "font_family": "iconfont",
5
+ "css_prefix_text": "icon-",
6
+ "description": "",
7
+ "glyphs": [
8
+ {
9
+ "icon_id": "10515591",
10
+ "name": "下箭头",
11
+ "font_class": "xiajiantou",
12
+ "unicode": "e656",
13
+ "unicode_decimal": 58966
14
+ },
15
+ {
16
+ "icon_id": "9234825",
17
+ "name": "添 加",
18
+ "font_class": "tianjia",
19
+ "unicode": "e62d",
20
+ "unicode_decimal": 58925
21
+ },
22
+ {
23
+ "icon_id": "4942655",
24
+ "name": "删除",
25
+ "font_class": "shanchu",
26
+ "unicode": "e61a",
27
+ "unicode_decimal": 58906
28
+ },
29
+ {
30
+ "icon_id": "17830630",
31
+ "name": "搜索",
32
+ "font_class": "sousuo",
33
+ "unicode": "e602",
34
+ "unicode_decimal": 58882
35
+ }
36
+ ]
37
+ }
Binary file
Binary file
Binary file
@@ -0,0 +1,209 @@
1
+ # 样式系统目录结构
2
+
3
+ 模块化的 Tailwind-like 原子类样式系统,便于维护和扩展。
4
+
5
+ ## 📁 目录结构
6
+
7
+ ```
8
+ style/
9
+ ├── index.scss # 主入口文件(导入所有模块)
10
+ ├── _variables.scss # 设计变量(间距、字体、颜色等)
11
+ ├── layout/ # 布局相关
12
+ │ ├── _flexbox.scss # Flex 布局
13
+ │ └── _sizing.scss # 尺寸、定位、溢出
14
+ ├── spacing/ # 间距相关
15
+ │ ├── _margin.scss # 外边距
16
+ │ └── _padding.scss # 内边距、间隙
17
+ ├── typography/ # 排版相关
18
+ │ ├── _font.scss # 字体大小、粗细、行高
19
+ │ └── _text.scss # 文本对齐、装饰、溢出
20
+ ├── colors/ # 颜色相关
21
+ │ └── _colors.scss # 文本色、背景色、边框色、圆角
22
+ ├── effects/ # 效果相关
23
+ │ ├── _shadow.scss # 阴影效果
24
+ │ ├── _opacity.scss # 透明度、过渡、变换
25
+ │ ├── _touch.scss # 触点反馈(重要✨)
26
+ │ └── TOUCH_GUIDE.md # 触点样式使用指南
27
+ ├── grid/ # 网格布局
28
+ │ └── _grid.scss # Grid 布局系统
29
+ ├── utilities/ # 工具类
30
+ │ └── _common.scss # 通用工具(z-index、指针、安全区等)
31
+ └── pages/ # 页面专属样式
32
+ └── auth.scss # 认证页面样式(登录、注册、忘记密码)
33
+ ```
34
+
35
+ ## 🎨 模块说明
36
+
37
+ ### 1. **变量定义** (`_variables.scss`)
38
+
39
+ - 间距变量:0-96 的间距值
40
+ - 字体大小:xs 到 9xl
41
+ - 颜色系统:gray、red、blue、green、yellow、purple
42
+ - 圆角值:none 到 full
43
+
44
+ ### 2. **布局模块** (`layout/`)
45
+
46
+ - **Flexbox** (`_flexbox.scss`)
47
+ - 容器:`.flex`、`.inline-flex`
48
+ - 方向:`.flex-row`、`.flex-col`
49
+ - 对齐:`.justify-center`、`.items-center`
50
+ - 顺序:`.order-1`
51
+
52
+ - **尺寸** (`_sizing.scss`)
53
+ - 宽高:`.w-full`、`.h-screen`
54
+ - 定位:`.absolute`、`.fixed`
55
+ - 溢出:`.overflow-hidden`
56
+
57
+ ### 3. **间距模块** (`spacing/`)
58
+
59
+ - **Margin** (`_margin.scss`)
60
+ - 全方向:`.m-4`
61
+ - 单方向:`.mt-4`、`.mr-4`
62
+ - 负值:`.-mt-4`
63
+ - Auto:`.mx-auto`
64
+
65
+ - **Padding** (`_padding.scss`)
66
+ - 全方向:`.p-4`
67
+ - 单方向:`.pt-4`、`.px-4`
68
+ - 间隙:`.gap-4`
69
+
70
+ ### 4. **排版模块** (`typography/`)
71
+
72
+ - **字体** (`_font.scss`)
73
+ - 大小:`.text-xs` 到 `.text-9xl`
74
+ - 粗细:`.font-normal`、`.font-bold`
75
+ - 行高:`.leading-normal`
76
+
77
+ - **文本** (`_text.scss`)
78
+ - 对齐:`.text-center`
79
+ - 装饰:`.underline`
80
+ - 溢出:`.truncate`、`.line-clamp-2`
81
+
82
+ ### 5. **颜色模块** (`colors/`)
83
+
84
+ - 文本颜色:`.text-gray-500`、`.text-primary`
85
+ - 背景颜色:`.bg-white`、`.bg-primary`
86
+ - 边框:`.border`、`.border-gray-200`
87
+ - 圆角:`.rounded`、`.rounded-full`
88
+
89
+ ### 6. **效果模块** (`effects/`)
90
+
91
+ - **阴影** (`_shadow.scss`)
92
+ - `.shadow-sm`、`.shadow`、`.shadow-lg`
93
+
94
+ - **透明度与动画** (`_opacity.scss`)
95
+ - 透明度:`.opacity-50`
96
+ - 过渡:`.transition`、`.transition-all`
97
+ - 变换:`.scale-110`、`.rotate-45`
98
+
99
+ - **触点反馈** (`_touch.scss`) ⭐ 新增
100
+ - 通用:`.tap-active`、`.tap-scale`、`.tap-opacity`
101
+ - 按钮:`.tap-button`、`.tap-3d`
102
+ - 卡片:`.tap-card`、`.tap-list-item`
103
+ - 图标:`.tap-icon`、`.tap-bounce`
104
+ - 特效:`.tap-ripple`、`.tap-pulse`
105
+ - 查看详细指南:`effects/TOUCH_GUIDE.md`
106
+
107
+ ### 7. **网格布局** (`grid/`)
108
+
109
+ - 网格容器:`.grid`
110
+ - 列数:`.grid-cols-3`
111
+ - 跨度:`.col-span-2`
112
+ - 对齐:`.place-items-center`
113
+
114
+ ### 8. **工具类** (`utilities/`)
115
+
116
+ - Z-index:`.z-10`、`.z-50`
117
+ - 指针:`.pointer-events-none`
118
+ - 安全区域:`.safe-area-top`、`.safe-area-bottom`
119
+ - 页面容器:`.page`
120
+
121
+ ### 9. **页面专属样式** (`pages/`)
122
+
123
+ - **认证页面** (`auth.scss`)
124
+ - 登录、注册、忘记密码页面的专属样式
125
+ - 包含:`.auth-container`、`.logo-bg`、`.form-card`
126
+ - 按钮样式:`.submit-btn`、`.code-btn`、`.deleted-btn`
127
+ - 支持深色模式和响应式设计
128
+
129
+ ## 🚀 使用方式
130
+
131
+ ### 在页面中使用
132
+
133
+ ```vue
134
+ <template>
135
+ <view class="page">
136
+ <!-- 带触点反馈的按钮 -->
137
+ <view class="tap-button bg-primary text-white rounded-lg py-3 px-6">
138
+ <text class="text-white">点击我</text>
139
+ </view>
140
+
141
+ <!-- 可点击的卡片 -->
142
+ <view class="tap-card bg-white rounded-xl shadow-md p-6 m-4">
143
+ <text class="text-2xl font-bold mb-2">卡片标题</text>
144
+ <text class="text-gray-600 line-clamp-2">卡片内容...</text>
145
+ </view>
146
+
147
+ <!-- 宫格菜单 -->
148
+ <view class="grid grid-cols-4 gap-4 p-4">
149
+ <view class="tap-scale flex flex-col items-center">
150
+ <view
151
+ class="w-16 h-16 bg-blue-50 rounded-xl flex items-center justify-center mb-2"
152
+ >
153
+ <text>📱</text>
154
+ </view>
155
+ <text class="text-xs">菜单</text>
156
+ </view>
157
+ </view>
158
+
159
+ <!-- 列表项 -->
160
+ <view class="tap-list-item flex items-center justify-between p-4 bg-white">
161
+ <text>设置</text>
162
+ <text class="text-gray-400">›</text>
163
+ </view>
164
+ </view>
165
+ </template>
166
+ ```
167
+
168
+ ## 🔧 修改和扩展
169
+
170
+ ### 添加新样式
171
+
172
+ 1. 确定样式类别(布局、间距、颜色等)
173
+ 2. 在对应模块文件中添加样式
174
+ 3. 不需要修改 `index.scss`(已自动导入)
175
+
176
+ ### 修改变量
177
+
178
+ 在 `_variables.scss` 中修改设计变量:
179
+
180
+ ```scss
181
+ $spacings: (
182
+ // 添加新的间距值
183
+ 128: 512rpx
184
+ );
185
+
186
+ $colors: (
187
+ // 添加新的颜色
188
+ custom-blue: #1e90ff
189
+ );
190
+ ```
191
+
192
+ ### 创建新模块
193
+
194
+ 1. 在对应目录创建新的 `.scss` 文件
195
+ 2. 在 `index.scss` 中添加 `@import` 语句
196
+
197
+ ## 📝 命名规范
198
+
199
+ - 使用小写字母和连字符(kebab-case)
200
+ - 遵循 Tailwind 命名约定
201
+ - 保持语义化和一致性
202
+
203
+ ## 💡 最佳实践
204
+
205
+ 1. **优先使用原子类**,避免自定义样式
206
+ 2. **组合使用**多个原子类实现复杂效果
207
+ 3. **保持一致性**,使用预定义的间距和颜色值
208
+ 4. **响应式设计**,使用百分比和 flex 布局
209
+ 5. **性能优化**,避免过度嵌套
@@ -0,0 +1,216 @@
1
+ // ========== 颜色样式 ==========
2
+
3
+ @import '../../uni.scss';
4
+ @import '../variables';
5
+
6
+ // ==================================================
7
+ // 🎯 全局取色函数
8
+ // ==================================================
9
+ @function color($name) {
10
+ @return map-get($colors, $name);
11
+ }
12
+
13
+ // 文本颜色
14
+ @each $key, $value in $colors {
15
+ .text-#{'' + $key} {
16
+ color: $value;
17
+ }
18
+ }
19
+
20
+ // uni-app 主题色
21
+ .text-primary {
22
+ color: $uni-color-primary;
23
+ }
24
+ .text-success {
25
+ color: $uni-color-success;
26
+ }
27
+ .text-warning {
28
+ color: $uni-color-warning;
29
+ }
30
+ .text-error {
31
+ color: $uni-color-error;
32
+ }
33
+
34
+ // 背景颜色 (支持 bg-opacity 透明度控制)
35
+ @each $key, $value in $colors {
36
+ .bg-#{'' + $key} {
37
+ background-color: $value;
38
+ // 支持通过 CSS 自定义属性控制透明度
39
+ &[style*='--bg-opacity'] {
40
+ background-color: rgba($value, var(--bg-opacity, 1));
41
+ }
42
+ }
43
+ }
44
+
45
+ // uni-app 主题背景色 (支持 bg-opacity 透明度控制)
46
+ .bg-primary {
47
+ background-color: $uni-color-primary;
48
+ &[style*='--bg-opacity'] {
49
+ background-color: rgba($uni-color-primary, var(--bg-opacity, 1));
50
+ }
51
+ }
52
+ .bg-success {
53
+ background-color: $uni-color-success;
54
+ &[style*='--bg-opacity'] {
55
+ background-color: rgba($uni-color-success, var(--bg-opacity, 1));
56
+ }
57
+ }
58
+ .bg-warning {
59
+ background-color: $uni-color-warning;
60
+ &[style*='--bg-opacity'] {
61
+ background-color: rgba($uni-color-warning, var(--bg-opacity, 1));
62
+ }
63
+ }
64
+ .bg-error {
65
+ background-color: $uni-color-error;
66
+ &[style*='--bg-opacity'] {
67
+ background-color: rgba($uni-color-error, var(--bg-opacity, 1));
68
+ }
69
+ }
70
+
71
+ // 特殊背景色 (支持 bg-opacity 透明度控制)
72
+ .bg-page {
73
+ background-color: $uni-bg-color;
74
+ &[style*='--bg-opacity'] {
75
+ background-color: rgba($uni-bg-color, var(--bg-opacity, 1));
76
+ }
77
+ }
78
+ .bg-grey {
79
+ background-color: $uni-bg-color-grey;
80
+ &[style*='--bg-opacity'] {
81
+ background-color: rgba($uni-bg-color-grey, var(--bg-opacity, 1));
82
+ }
83
+ }
84
+ .bg-hover {
85
+ background-color: $uni-bg-color-hover;
86
+ &[style*='--bg-opacity'] {
87
+ background-color: rgba($uni-bg-color-hover, var(--bg-opacity, 1));
88
+ }
89
+ }
90
+ .bg-mask {
91
+ background-color: $uni-bg-color-mask;
92
+ &[style*='--bg-opacity'] {
93
+ background-color: rgba($uni-bg-color-mask, var(--bg-opacity, 1));
94
+ }
95
+ }
96
+
97
+ // 边框颜色
98
+ @each $key, $value in $colors {
99
+ .border-#{'' + $key} {
100
+ border-color: $value;
101
+ }
102
+ }
103
+
104
+ // uni-app 边框色
105
+ .border-primary {
106
+ border-color: $uni-color-primary;
107
+ }
108
+ .border-base {
109
+ border-color: $uni-border-color;
110
+ }
111
+
112
+ // 边框宽度
113
+ .border-0 {
114
+ border-width: 0;
115
+ }
116
+ .border {
117
+ border-width: 1rpx;
118
+ }
119
+ .border-2 {
120
+ border-width: 2rpx;
121
+ }
122
+ .border-4 {
123
+ border-width: 4rpx;
124
+ }
125
+ .border-8 {
126
+ border-width: 8rpx;
127
+ }
128
+
129
+ // 单边框
130
+ .border-t {
131
+ border-top-width: 1rpx;
132
+ }
133
+ .border-r {
134
+ border-right-width: 1rpx;
135
+ }
136
+ .border-b {
137
+ border-bottom-width: 1rpx;
138
+ }
139
+ .border-l {
140
+ border-left-width: 1rpx;
141
+ }
142
+
143
+ .border-t-0 {
144
+ border-top-width: 0;
145
+ }
146
+ .border-r-0 {
147
+ border-right-width: 0;
148
+ }
149
+ .border-b-0 {
150
+ border-bottom-width: 0;
151
+ }
152
+ .border-l-0 {
153
+ border-left-width: 0;
154
+ }
155
+
156
+ // 边框样式
157
+ .border-solid {
158
+ border-style: solid;
159
+ }
160
+ .border-dashed {
161
+ border-style: dashed;
162
+ }
163
+ .border-dotted {
164
+ border-style: dotted;
165
+ }
166
+ .border-none {
167
+ border-style: none;
168
+ }
169
+
170
+ // 圆角
171
+ @each $key, $value in $border-radius {
172
+ .rounded-#{$key} {
173
+ border-radius: $value;
174
+ }
175
+ }
176
+
177
+ .rounded {
178
+ border-radius: 4rpx;
179
+ }
180
+
181
+ // 单角圆角
182
+
183
+ .rounded-t-none {
184
+ border-top-left-radius: 0;
185
+ border-top-right-radius: 0;
186
+ }
187
+ // 单角圆角
188
+ .rounded-t-none {
189
+ border-top-left-radius: 0;
190
+ border-top-right-radius: 0;
191
+ }
192
+ .rounded-r-none {
193
+ border-top-right-radius: 0;
194
+ border-bottom-right-radius: 0;
195
+ }
196
+ .rounded-b-none {
197
+ border-bottom-right-radius: 0;
198
+ border-bottom-left-radius: 0;
199
+ }
200
+ .rounded-l-none {
201
+ border-top-left-radius: 0;
202
+ border-bottom-left-radius: 0;
203
+ }
204
+
205
+ .rounded-tl {
206
+ border-top-left-radius: 8rpx;
207
+ }
208
+ .rounded-tr {
209
+ border-top-right-radius: 8rpx;
210
+ }
211
+ .rounded-br {
212
+ border-bottom-right-radius: 8rpx;
213
+ }
214
+ .rounded-bl {
215
+ border-bottom-left-radius: 8rpx;
216
+ }