tang-ui-x 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 (98) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +141 -0
  3. package/components/TActionSheet/index.uvue +170 -0
  4. package/components/TActionSheet/type.uts +29 -0
  5. package/components/TAvatar/index.uvue +156 -0
  6. package/components/TAvatar/type.uts +54 -0
  7. package/components/TBadge/index.uvue +152 -0
  8. package/components/TBadge/type.uts +48 -0
  9. package/components/TButton/README.md +111 -0
  10. package/components/TButton/index.uvue +380 -0
  11. package/components/TButton/type.uts +95 -0
  12. package/components/TCard/index.uvue +174 -0
  13. package/components/TCard/type.uts +50 -0
  14. package/components/TCell/index.uvue +49 -0
  15. package/components/TCheckbox/index.uvue +187 -0
  16. package/components/TCheckboxGroup/index.uvue +139 -0
  17. package/components/TCheckboxGroup/type.uts +26 -0
  18. package/components/TCol/index.uvue +82 -0
  19. package/components/TCol/type.uts +30 -0
  20. package/components/TCollapse/index.uvue +93 -0
  21. package/components/TCollapse/type.uts +36 -0
  22. package/components/TCollapseItem/index.uvue +194 -0
  23. package/components/TCollapseItem/type.uts +25 -0
  24. package/components/TDialog/index.uvue +386 -0
  25. package/components/TDialog/type.uts +84 -0
  26. package/components/TDivider/index.uvue +235 -0
  27. package/components/TDivider/type.uts +91 -0
  28. package/components/TEmpty/index.uvue +128 -0
  29. package/components/TErrorState/index.uvue +57 -0
  30. package/components/TGrid/index.uvue +115 -0
  31. package/components/TGrid/type.uts +77 -0
  32. package/components/TGridItem/index.uvue +243 -0
  33. package/components/TGridItem/type.uts +64 -0
  34. package/components/TIcon/index.uvue +96 -0
  35. package/components/TImage/index.uvue +255 -0
  36. package/components/TImage/type.uts +146 -0
  37. package/components/TInput/README.md +119 -0
  38. package/components/TInput/index.uvue +376 -0
  39. package/components/TInput/type.uts +138 -0
  40. package/components/TList/index.uvue +82 -0
  41. package/components/TList/type.uts +68 -0
  42. package/components/TListItem/index.uvue +161 -0
  43. package/components/TListItem/type.uts +49 -0
  44. package/components/TLoading/index.uvue +153 -0
  45. package/components/TLoading/type.uts +43 -0
  46. package/components/TNavBar/index.uvue +120 -0
  47. package/components/TNavBar/type.uts +22 -0
  48. package/components/TNoticeBar/index.uvue +106 -0
  49. package/components/TNoticeBar/type.uts +21 -0
  50. package/components/TNumberInput/index.uvue +226 -0
  51. package/components/TPicker/index.uvue +276 -0
  52. package/components/TPicker/type.uts +105 -0
  53. package/components/TPopup/index.uvue +442 -0
  54. package/components/TProgress/index.uvue +103 -0
  55. package/components/TProgress/type.uts +64 -0
  56. package/components/TRadioButton/index.uvue +232 -0
  57. package/components/TRadioGroup/index.uvue +117 -0
  58. package/components/TRadioGroup/type.uts +25 -0
  59. package/components/TRate/index.uvue +182 -0
  60. package/components/TRow/index.uvue +105 -0
  61. package/components/TRow/type.uts +52 -0
  62. package/components/TSearchBar/index.uvue +255 -0
  63. package/components/TSearchBar/type.uts +140 -0
  64. package/components/TSelect/index.uvue +655 -0
  65. package/components/TSelect/type.uts +57 -0
  66. package/components/TSlider/index.uvue +72 -0
  67. package/components/TSlider/type.uts +21 -0
  68. package/components/TSwiper/index.uvue +222 -0
  69. package/components/TSwiper/type.uts +77 -0
  70. package/components/TSwitch/index.uvue +177 -0
  71. package/components/TSwitch/type.uts +52 -0
  72. package/components/TText/README.md +124 -0
  73. package/components/TText/index.uvue +257 -0
  74. package/components/TText/type.uts +114 -0
  75. package/components/TTextarea/index.uvue +239 -0
  76. package/components/TTextarea/type.uts +106 -0
  77. package/components/TToast/type.uts +14 -0
  78. package/components/Tabs/README.md +297 -0
  79. package/components/Tabs/index.uvue +383 -0
  80. package/components/Tabs/type.uts +10 -0
  81. package/components/Tags/README.md +297 -0
  82. package/components/Tags/index.uvue +383 -0
  83. package/components/Tags/type.uts +10 -0
  84. package/components/VbenFrom/index.uvue +392 -0
  85. package/composables/useModal.uts +294 -0
  86. package/composables/useTheme.uts +235 -0
  87. package/composables/useToast.uts +322 -0
  88. package/index.js +62 -0
  89. package/package.json +48 -0
  90. package/style/colors/index.scss +157 -0
  91. package/style/index.scss +399 -0
  92. package/types/index.uts +52 -0
  93. package/uni.scss +79 -0
  94. package/utils/color.uts +92 -0
  95. package/utils/common.uts +245 -0
  96. package/utils/dom.uts +275 -0
  97. package/utils/index.uts +10 -0
  98. package/utils/validator.uts +155 -0
@@ -0,0 +1,157 @@
1
+ /**
2
+ * 颜色变量定义
3
+ * @module style/colors
4
+ */
5
+
6
+ // 主题色
7
+ $primary-color: #007aff !default;
8
+ $success-color: #4cd964 !default;
9
+ $warning-color: #f0ad4e !default;
10
+ $danger-color: #dd524d !default;
11
+ $info-color: #909399 !default;
12
+
13
+ // 主题色浅色版本
14
+ $primary-light: mix(white, $primary-color, 80%) !default;
15
+ $success-light: mix(white, $success-color, 80%) !default;
16
+ $warning-light: mix(white, $warning-color, 80%) !default;
17
+ $danger-light: mix(white, $danger-color, 80%) !default;
18
+ $info-light: mix(white, $info-color, 80%) !default;
19
+
20
+ // 主题色深色版本
21
+ $primary-dark: mix(black, $primary-color, 20%) !default;
22
+ $success-dark: mix(black, $success-color, 20%) !default;
23
+ $warning-dark: mix(black, $warning-color, 20%) !default;
24
+ $danger-dark: mix(black, $danger-color, 20%) !default;
25
+ $info-dark: mix(black, $info-color, 20%) !default;
26
+
27
+ // 文本颜色
28
+ $text-color-primary: #303133 !default;
29
+ $text-color-regular: #606266 !default;
30
+ $text-color-secondary: #909399 !default;
31
+ $text-color-placeholder: #c0c4cc !default;
32
+ $text-color-disabled: #c0c4cc !default;
33
+
34
+ // 边框颜色
35
+ $border-color-base: #dcdfe6 !default;
36
+ $border-color-light: #e4e7ed !default;
37
+ $border-color-lighter: #ebeef5 !default;
38
+ $border-color-extra-light: #f2f6fc !default;
39
+
40
+ // 背景颜色
41
+ $bg-color: #f5f7fa !default;
42
+ $bg-color-page: #f2f3f5 !default;
43
+ $bg-color-white: #ffffff !default;
44
+ $bg-color-black: #000000 !default;
45
+ $bg-color-overlay: rgba(0, 0, 0, 0.4) !default;
46
+
47
+ // 阴影
48
+ $shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !default;
49
+ $shadow-base: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04) !default;
50
+ $shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !default;
51
+ $shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !default;
52
+ $shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !default;
53
+
54
+ // 渐变色
55
+ $gradient-primary: linear-gradient(135deg, $primary-color 0%, $primary-dark 100%) !default;
56
+ $gradient-success: linear-gradient(135deg, $success-color 0%, $success-dark 100%) !default;
57
+ $gradient-warning: linear-gradient(135deg, $warning-color 0%, $warning-dark 100%) !default;
58
+ $gradient-danger: linear-gradient(135deg, $danger-color 0%, $danger-dark 100%) !default;
59
+ $gradient-info: linear-gradient(135deg, $info-color 0%, $info-dark 100%) !default;
60
+
61
+ // 链接颜色
62
+ $link-color: $primary-color !default;
63
+ $link-hover-color: $primary-dark !default;
64
+ $link-active-color: $primary-dark !default;
65
+ $link-disabled-color: $text-color-placeholder !default;
66
+
67
+ // 状态颜色
68
+ $color-hover: $primary-light !default;
69
+ $color-active: $primary-color !default;
70
+ $color-focus: $primary-color !default;
71
+ $color-disabled: $text-color-disabled !default;
72
+
73
+ // CSS 变量导出
74
+ :root {
75
+ // 主题色
76
+ --primary-color: #{$primary-color};
77
+ --success-color: #{$success-color};
78
+ --warning-color: #{$warning-color};
79
+ --danger-color: #{$danger-color};
80
+ --info-color: #{$info-color};
81
+
82
+ // 主题色浅色
83
+ --primary-light: #{$primary-light};
84
+ --success-light: #{$success-light};
85
+ --warning-light: #{$warning-light};
86
+ --danger-light: #{$danger-light};
87
+ --info-light: #{$info-light};
88
+
89
+ // 主题色深色
90
+ --primary-dark: #{$primary-dark};
91
+ --success-dark: #{$success-dark};
92
+ --warning-dark: #{$warning-dark};
93
+ --danger-dark: #{$danger-dark};
94
+ --info-dark: #{$info-dark};
95
+
96
+ // 文本颜色
97
+ --text-color-primary: #{$text-color-primary};
98
+ --text-color-regular: #{$text-color-regular};
99
+ --text-color-secondary: #{$text-color-secondary};
100
+ --text-color-placeholder: #{$text-color-placeholder};
101
+ --text-color-disabled: #{$text-color-disabled};
102
+
103
+ // 边框颜色
104
+ --border-color-base: #{$border-color-base};
105
+ --border-color-light: #{$border-color-light};
106
+ --border-color-lighter: #{$border-color-lighter};
107
+ --border-color-extra-light: #{$border-color-extra-light};
108
+
109
+ // 背景颜色
110
+ --bg-color: #{$bg-color};
111
+ --bg-color-page: #{$bg-color-page};
112
+ --bg-color-white: #{$bg-color-white};
113
+ --bg-color-black: #{$bg-color-black};
114
+ --bg-color-overlay: #{$bg-color-overlay};
115
+ }
116
+
117
+ // 颜色工具类
118
+ @each $name, $color in (
119
+ 'primary': $primary-color,
120
+ 'success': $success-color,
121
+ 'warning': $warning-color,
122
+ 'danger': $danger-color,
123
+ 'info': $info-color
124
+ ) {
125
+ // 文字颜色
126
+ .text-#{$name} {
127
+ color: $color !important;
128
+ }
129
+
130
+ // 背景颜色
131
+ .bg-#{$name} {
132
+ background-color: $color !important;
133
+ }
134
+
135
+ // 边框颜色
136
+ .border-#{$name} {
137
+ border-color: $color !important;
138
+ }
139
+
140
+ // 浅色版本
141
+ .text-#{$name}-light {
142
+ color: mix(white, $color, 80%) !important;
143
+ }
144
+
145
+ .bg-#{$name}-light {
146
+ background-color: mix(white, $color, 80%) !important;
147
+ }
148
+
149
+ // 深色版本
150
+ .text-#{$name}-dark {
151
+ color: mix(black, $color, 20%) !important;
152
+ }
153
+
154
+ .bg-#{$name}-dark {
155
+ background-color: mix(black, $color, 20%) !important;
156
+ }
157
+ }
@@ -0,0 +1,399 @@
1
+ /**
2
+ * 样式系统入口
3
+ * @module style
4
+ */
5
+
6
+ // 导入颜色系统
7
+ @import './colors/index.scss';
8
+
9
+ // 尺寸变量
10
+ $size-mini: 24rpx !default;
11
+ $size-small: 28rpx !default;
12
+ $size-medium: 32rpx !default;
13
+ $size-large: 36rpx !default;
14
+
15
+ // 字体大小
16
+ $font-size-xs: 20rpx !default;
17
+ $font-size-sm: 24rpx !default;
18
+ $font-size-base: 28rpx !default;
19
+ $font-size-md: 32rpx !default;
20
+ $font-size-lg: 36rpx !default;
21
+ $font-size-xl: 40rpx !default;
22
+ $font-size-xxl: 48rpx !default;
23
+
24
+ // 字体粗细
25
+ $font-weight-light: 300 !default;
26
+ $font-weight-normal: 400 !default;
27
+ $font-weight-medium: 500 !default;
28
+ $font-weight-semibold: 600 !default;
29
+ $font-weight-bold: 700 !default;
30
+
31
+ // 行高
32
+ $line-height-none: 1 !default;
33
+ $line-height-tight: 1.25 !default;
34
+ $line-height-snug: 1.375 !default;
35
+ $line-height-normal: 1.5 !default;
36
+ $line-height-relaxed: 1.625 !default;
37
+ $line-height-loose: 2 !default;
38
+
39
+ // 圆角
40
+ $border-radius-none: 0 !default;
41
+ $border-radius-sm: 4rpx !default;
42
+ $border-radius-base: 8rpx !default;
43
+ $border-radius-md: 12rpx !default;
44
+ $border-radius-lg: 16rpx !default;
45
+ $border-radius-xl: 24rpx !default;
46
+ $border-radius-full: 9999rpx !default;
47
+
48
+ // 边框宽度
49
+ $border-width-none: 0 !default;
50
+ $border-width-thin: 1px !default;
51
+ $border-width-base: 2rpx !default;
52
+ $border-width-thick: 4rpx !default;
53
+
54
+ // 间距
55
+ $spacing-xs: 8rpx !default;
56
+ $spacing-sm: 12rpx !default;
57
+ $spacing-base: 16rpx !default;
58
+ $spacing-md: 20rpx !default;
59
+ $spacing-lg: 24rpx !default;
60
+ $spacing-xl: 32rpx !default;
61
+ $spacing-xxl: 40rpx !default;
62
+
63
+ // 动画时长
64
+ $duration-fast: 150ms !default;
65
+ $duration-base: 300ms !default;
66
+ $duration-slow: 500ms !default;
67
+
68
+ // 缓动函数
69
+ $ease-linear: linear !default;
70
+ $ease-in: cubic-bezier(0.4, 0, 1, 1) !default;
71
+ $ease-out: cubic-bezier(0, 0, 0.2, 1) !default;
72
+ $ease-in-out: cubic-bezier(0.4, 0, 0.2, 1) !default;
73
+
74
+ // z-index 层级
75
+ $z-index-dropdown: 1000 !default;
76
+ $z-index-sticky: 1020 !default;
77
+ $z-index-fixed: 1030 !default;
78
+ $z-index-modal-backdrop: 1040 !default;
79
+ $z-index-modal: 1050 !default;
80
+ $z-index-popover: 1060 !default;
81
+ $z-index-tooltip: 1070 !default;
82
+ $z-index-toast: 1080 !default;
83
+
84
+ // CSS 变量导出
85
+ :root {
86
+ // 尺寸
87
+ --size-mini: #{$size-mini};
88
+ --size-small: #{$size-small};
89
+ --size-medium: #{$size-medium};
90
+ --size-large: #{$size-large};
91
+
92
+ // 字体大小
93
+ --font-size-xs: #{$font-size-xs};
94
+ --font-size-sm: #{$font-size-sm};
95
+ --font-size-base: #{$font-size-base};
96
+ --font-size-md: #{$font-size-md};
97
+ --font-size-lg: #{$font-size-lg};
98
+ --font-size-xl: #{$font-size-xl};
99
+ --font-size-xxl: #{$font-size-xxl};
100
+
101
+ // 圆角
102
+ --border-radius-sm: #{$border-radius-sm};
103
+ --border-radius-base: #{$border-radius-base};
104
+ --border-radius-md: #{$border-radius-md};
105
+ --border-radius-lg: #{$border-radius-lg};
106
+ --border-radius-xl: #{$border-radius-xl};
107
+
108
+ // 间距
109
+ --spacing-xs: #{$spacing-xs};
110
+ --spacing-sm: #{$spacing-sm};
111
+ --spacing-base: #{$spacing-base};
112
+ --spacing-md: #{$spacing-md};
113
+ --spacing-lg: #{$spacing-lg};
114
+ --spacing-xl: #{$spacing-xl};
115
+ --spacing-xxl: #{$spacing-xxl};
116
+
117
+ // 动画
118
+ --duration-fast: #{$duration-fast};
119
+ --duration-base: #{$duration-base};
120
+ --duration-slow: #{$duration-slow};
121
+ }
122
+
123
+ // 全局样式重置
124
+ * {
125
+ box-sizing: border-box;
126
+ margin: 0;
127
+ padding: 0;
128
+ }
129
+
130
+ // 工具类
131
+ // 显示/隐藏
132
+ .hidden {
133
+ display: none !important;
134
+ }
135
+
136
+ .invisible {
137
+ visibility: hidden !important;
138
+ }
139
+
140
+ uni-view {
141
+ overflow: visible;
142
+ }
143
+
144
+ // Flex 布局
145
+ .flex {
146
+ display: flex !important;
147
+ }
148
+
149
+ .flex-row {
150
+ flex-direction: row !important;
151
+ }
152
+
153
+ .flex-col {
154
+ flex-direction: column !important;
155
+ }
156
+
157
+ .flex-wrap {
158
+ flex-wrap: wrap !important;
159
+ }
160
+
161
+ .flex-nowrap {
162
+ flex-wrap: nowrap !important;
163
+ }
164
+
165
+ .justify-start {
166
+ justify-content: flex-start !important;
167
+ }
168
+
169
+ .justify-center {
170
+ justify-content: center !important;
171
+ }
172
+
173
+ .justify-end {
174
+ justify-content: flex-end !important;
175
+ }
176
+
177
+ .justify-between {
178
+ justify-content: space-between !important;
179
+ }
180
+
181
+ .justify-around {
182
+ justify-content: space-around !important;
183
+ }
184
+
185
+ .justify-evenly {
186
+ justify-content: space-evenly !important;
187
+ }
188
+
189
+ .items-start {
190
+ align-items: flex-start !important;
191
+ }
192
+
193
+ .items-center {
194
+ align-items: center !important;
195
+ }
196
+
197
+ .items-end {
198
+ align-items: flex-end !important;
199
+ }
200
+
201
+ .items-stretch {
202
+ align-items: stretch !important;
203
+ }
204
+
205
+ .flex-1 {
206
+ flex: 1 !important;
207
+ }
208
+
209
+ .flex-auto {
210
+ flex: auto !important;
211
+ }
212
+
213
+ .flex-none {
214
+ flex: none !important;
215
+ }
216
+
217
+ // 文本对齐
218
+ .text-left {
219
+ text-align: left !important;
220
+ }
221
+
222
+ .text-center {
223
+ text-align: center !important;
224
+ }
225
+
226
+ .text-right {
227
+ text-align: right !important;
228
+ }
229
+
230
+ .text-justify {
231
+ text-align: justify !important;
232
+ }
233
+
234
+ // 字体大小
235
+ @each $name, $size in (
236
+ 'xs': $font-size-xs,
237
+ 'sm': $font-size-sm,
238
+ 'base': $font-size-base,
239
+ 'md': $font-size-md,
240
+ 'lg': $font-size-lg,
241
+ 'xl': $font-size-xl,
242
+ 'xxl': $font-size-xxl
243
+ ) {
244
+ .text-#{$name} {
245
+ font-size: $size !important;
246
+ }
247
+ }
248
+
249
+ // 字体粗细
250
+ @each $name, $weight in (
251
+ 'light': $font-weight-light,
252
+ 'normal': $font-weight-normal,
253
+ 'medium': $font-weight-medium,
254
+ 'semibold': $font-weight-semibold,
255
+ 'bold': $font-weight-bold
256
+ ) {
257
+ .font-#{$name} {
258
+ font-weight: $weight !important;
259
+ }
260
+ }
261
+
262
+ // 圆角
263
+ @each $name, $radius in (
264
+ 'none': $border-radius-none,
265
+ 'sm': $border-radius-sm,
266
+ 'base': $border-radius-base,
267
+ 'md': $border-radius-md,
268
+ 'lg': $border-radius-lg,
269
+ 'xl': $border-radius-xl,
270
+ 'full': $border-radius-full
271
+ ) {
272
+ .rounded-#{$name} {
273
+ border-radius: $radius !important;
274
+ }
275
+ }
276
+
277
+ // 间距(内边距和外边距)
278
+ @each $name, $space in (
279
+ 'xs': $spacing-xs,
280
+ 'sm': $spacing-sm,
281
+ 'base': $spacing-base,
282
+ 'md': $spacing-md,
283
+ 'lg': $spacing-lg,
284
+ 'xl': $spacing-xl,
285
+ 'xxl': $spacing-xxl
286
+ ) {
287
+ // 内边距
288
+ .p-#{$name} {
289
+ padding: $space !important;
290
+ }
291
+ .px-#{$name} {
292
+ padding-left: $space !important;
293
+ padding-right: $space !important;
294
+ }
295
+ .py-#{$name} {
296
+ padding-top: $space !important;
297
+ padding-bottom: $space !important;
298
+ }
299
+ .pt-#{$name} {
300
+ padding-top: $space !important;
301
+ }
302
+ .pr-#{$name} {
303
+ padding-right: $space !important;
304
+ }
305
+ .pb-#{$name} {
306
+ padding-bottom: $space !important;
307
+ }
308
+ .pl-#{$name} {
309
+ padding-left: $space !important;
310
+ }
311
+
312
+ // 外边距
313
+ .m-#{$name} {
314
+ margin: $space !important;
315
+ }
316
+ .mx-#{$name} {
317
+ margin-left: $space !important;
318
+ margin-right: $space !important;
319
+ }
320
+ .my-#{$name} {
321
+ margin-top: $space !important;
322
+ margin-bottom: $space !important;
323
+ }
324
+ .mt-#{$name} {
325
+ margin-top: $space !important;
326
+ }
327
+ .mr-#{$name} {
328
+ margin-right: $space !important;
329
+ }
330
+ .mb-#{$name} {
331
+ margin-bottom: $space !important;
332
+ }
333
+ .ml-#{$name} {
334
+ margin-left: $space !important;
335
+ }
336
+ }
337
+
338
+ // 宽高
339
+ .w-full {
340
+ width: 100% !important;
341
+ }
342
+
343
+ .h-full {
344
+ height: 100% !important;
345
+ }
346
+
347
+ .w-screen {
348
+ width: 100vw !important;
349
+ }
350
+
351
+ .h-screen {
352
+ height: 100vh !important;
353
+ }
354
+
355
+ // 溢出
356
+ .overflow-hidden {
357
+ overflow: hidden !important;
358
+ }
359
+
360
+ .overflow-auto {
361
+ overflow: auto !important;
362
+ }
363
+
364
+ .overflow-scroll {
365
+ overflow: scroll !important;
366
+ }
367
+
368
+ // 文本溢出
369
+ .truncate {
370
+ overflow: hidden !important;
371
+ text-overflow: ellipsis !important;
372
+ white-space: nowrap !important;
373
+ }
374
+
375
+ // 阴影
376
+ @each $name, $shadow in (
377
+ 'sm': $shadow-sm,
378
+ 'base': $shadow-base,
379
+ 'md': $shadow-md,
380
+ 'lg': $shadow-lg,
381
+ 'xl': $shadow-xl
382
+ ) {
383
+ .shadow-#{$name} {
384
+ box-shadow: $shadow !important;
385
+ }
386
+ }
387
+
388
+ // 过渡
389
+ .transition {
390
+ transition: all $duration-base $ease-in-out !important;
391
+ }
392
+
393
+ .transition-fast {
394
+ transition: all $duration-fast $ease-in-out !important;
395
+ }
396
+
397
+ .transition-slow {
398
+ transition: all $duration-slow $ease-in-out !important;
399
+ }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * 全局类型定义
3
+ */
4
+
5
+ /**
6
+ * 组件类型
7
+ */
8
+ export type ComponentType = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info'
9
+
10
+ /**
11
+ * 位置类型
12
+ */
13
+ export type PositionType = 'top' | 'center' | 'bottom'
14
+
15
+ /**
16
+ * Toast 选项类型
17
+ */
18
+ export type ToastOptions = {
19
+ /**
20
+ * 提示内容
21
+ */
22
+ message: string
23
+
24
+ /**
25
+ * 提示类型
26
+ * @default 'default'
27
+ */
28
+ type?: ComponentType
29
+
30
+ /**
31
+ * 显示时长(毫秒)
32
+ * @default 2000
33
+ */
34
+ duration?: number
35
+
36
+ /**
37
+ * 显示位置
38
+ * @default 'center'
39
+ */
40
+ position?: PositionType
41
+
42
+ /**
43
+ * 是否显示遮罩层
44
+ * @default false
45
+ */
46
+ mask?: boolean
47
+
48
+ /**
49
+ * 自定义图标路径
50
+ */
51
+ icon?: string
52
+ }
package/uni.scss ADDED
@@ -0,0 +1,79 @@
1
+ /**
2
+ * 这里是uni-app内置的常用样式变量
3
+ *
4
+ * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
5
+ * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
6
+ *
7
+ */
8
+
9
+ /**
10
+ * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
11
+ *
12
+ * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
13
+ */
14
+
15
+ // 导入自定义样式
16
+ @import '@/style/index.scss';
17
+
18
+ /* 颜色变量 */
19
+
20
+ /* 行为相关颜色 */
21
+ $uni-color-primary: #007aff;
22
+ $uni-color-success: #4cd964;
23
+ $uni-color-warning: #f0ad4e;
24
+ $uni-color-error: #dd524d;
25
+
26
+ /* 文字基本颜色 */
27
+ $uni-text-color:#333;//基本色
28
+ $uni-text-color-inverse:#fff;//反色
29
+ $uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
30
+ $uni-text-color-placeholder: #808080;
31
+ $uni-text-color-disable:#c0c0c0;
32
+
33
+ /* 背景颜色 */
34
+ $uni-bg-color:#ffffff;
35
+ $uni-bg-color-grey:#f8f8f8;
36
+ $uni-bg-color-hover:#f1f1f1;//点击状态颜色
37
+ $uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
38
+
39
+ /* 边框颜色 */
40
+ $uni-border-color:#c8c7cc;
41
+
42
+ /* 尺寸变量 */
43
+
44
+ /* 文字尺寸 */
45
+ $uni-font-size-sm:12px;
46
+ $uni-font-size-base:14px;
47
+ $uni-font-size-lg:16px;
48
+
49
+ /* 图片尺寸 */
50
+ $uni-img-size-sm:20px;
51
+ $uni-img-size-base:26px;
52
+ $uni-img-size-lg:40px;
53
+
54
+ /* Border Radius */
55
+ $uni-border-radius-sm: 2px;
56
+ $uni-border-radius-base: 3px;
57
+ $uni-border-radius-lg: 6px;
58
+ $uni-border-radius-circle: 50%;
59
+
60
+ /* 水平间距 */
61
+ $uni-spacing-row-sm: 5px;
62
+ $uni-spacing-row-base: 10px;
63
+ $uni-spacing-row-lg: 15px;
64
+
65
+ /* 垂直间距 */
66
+ $uni-spacing-col-sm: 4px;
67
+ $uni-spacing-col-base: 8px;
68
+ $uni-spacing-col-lg: 12px;
69
+
70
+ /* 透明度 */
71
+ $uni-opacity-disabled: 0.3; // 组件禁用态的透明度
72
+
73
+ /* 文章场景相关 */
74
+ $uni-color-title: #2C405A; // 文章标题颜色
75
+ $uni-font-size-title:20px;
76
+ $uni-color-subtitle: #555555; // 二级标题颜色
77
+ $uni-font-size-subtitle:26px;
78
+ $uni-color-paragraph: #3F536E; // 文章段落颜色
79
+ $uni-font-size-paragraph:15px;