@nutui/nutui-react 3.1.0-beta.1 → 4.0.0-beta.2

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 (196) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cjs/locales/base.d.ts +6 -0
  3. package/dist/cjs/locales/en-US.js +17 -1
  4. package/dist/cjs/locales/id-ID.js +17 -1
  5. package/dist/cjs/locales/ja-JP.js +16 -2
  6. package/dist/cjs/locales/tr-TR.js +17 -1
  7. package/dist/cjs/locales/vi-VN.js +17 -1
  8. package/dist/cjs/locales/zh-CN.js +15 -1
  9. package/dist/cjs/locales/zh-TW.js +15 -1
  10. package/dist/cjs/locales/zh-UG.js +17 -1
  11. package/dist/cjs/packages/address/style/style.css +2 -2
  12. package/dist/cjs/packages/audio/audio.js +2 -2
  13. package/dist/cjs/packages/button/button.js +30 -6
  14. package/dist/cjs/packages/button/style/button.scss +327 -227
  15. package/dist/cjs/packages/button/style/style.css +292 -47
  16. package/dist/cjs/packages/button/style-jmapp/button.scss +327 -227
  17. package/dist/cjs/packages/button/style-jmapp/style.css +268 -23
  18. package/dist/cjs/packages/button/style-jrkf/button.scss +327 -227
  19. package/dist/cjs/packages/button/style-jrkf/style.css +268 -23
  20. package/dist/cjs/packages/calendar/style/style.css +2 -2
  21. package/dist/cjs/packages/calendarcard/style/style.css +1 -1
  22. package/dist/cjs/packages/checkbox/checkbox.js +4 -3
  23. package/dist/cjs/packages/checkbox/style/checkbox.scss +19 -3
  24. package/dist/cjs/packages/checkbox/style/style.css +21 -6
  25. package/dist/cjs/packages/checkbox/style-jmapp/checkbox.scss +19 -3
  26. package/dist/cjs/packages/checkbox/style-jmapp/style.css +18 -3
  27. package/dist/cjs/packages/checkbox/style-jrkf/checkbox.scss +19 -3
  28. package/dist/cjs/packages/checkbox/style-jrkf/style.css +18 -3
  29. package/dist/cjs/packages/checkboxgroup/style/style.css +2 -2
  30. package/dist/cjs/packages/circleprogress/circleprogress.js +1 -1
  31. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  32. package/dist/cjs/packages/countdown/style/style.css +1 -1
  33. package/dist/cjs/packages/datepicker/datepicker.js +3 -5
  34. package/dist/cjs/packages/datepicker/utils.js +7 -0
  35. package/dist/cjs/packages/elevator/style/elevator.scss +6 -2
  36. package/dist/cjs/packages/elevator/style/style.css +2 -2
  37. package/dist/cjs/packages/elevator/style-jmapp/elevator.scss +6 -2
  38. package/dist/cjs/packages/elevator/style-jmapp/style.css +2 -2
  39. package/dist/cjs/packages/elevator/style-jrkf/elevator.scss +6 -2
  40. package/dist/cjs/packages/elevator/style-jrkf/style.css +2 -2
  41. package/dist/cjs/packages/ellipsis/style/style.css +1 -1
  42. package/dist/cjs/packages/inputnumber/inputnumber.js +5 -1
  43. package/dist/cjs/packages/inputnumber/style/inputnumber.scss +11 -5
  44. package/dist/cjs/packages/inputnumber/style/style.css +16 -11
  45. package/dist/cjs/packages/inputnumber/style-jmapp/inputnumber.scss +11 -5
  46. package/dist/cjs/packages/inputnumber/style-jmapp/style.css +10 -5
  47. package/dist/cjs/packages/inputnumber/style-jrkf/inputnumber.scss +11 -5
  48. package/dist/cjs/packages/inputnumber/style-jrkf/style.css +10 -5
  49. package/dist/cjs/packages/progress/progress.js +1 -1
  50. package/dist/cjs/packages/radio/radio.js +3 -2
  51. package/dist/cjs/packages/radio/style/radio.scss +9 -3
  52. package/dist/cjs/packages/radio/style/style.css +10 -5
  53. package/dist/cjs/packages/radio/style-jmapp/radio.scss +9 -3
  54. package/dist/cjs/packages/radio/style-jmapp/style.css +8 -3
  55. package/dist/cjs/packages/radio/style-jrkf/radio.scss +9 -3
  56. package/dist/cjs/packages/radio/style-jrkf/style.css +8 -3
  57. package/dist/cjs/packages/radiogroup/style/style.css +2 -2
  58. package/dist/cjs/packages/range/style/style.css +3 -3
  59. package/dist/cjs/packages/resultpage/resultpage.js +5 -5
  60. package/dist/cjs/packages/searchbar/style/searchbar.scss +5 -5
  61. package/dist/cjs/packages/searchbar/style/style.css +5 -5
  62. package/dist/cjs/packages/searchbar/style-jmapp/searchbar.scss +5 -5
  63. package/dist/cjs/packages/searchbar/style-jmapp/style.css +5 -5
  64. package/dist/cjs/packages/searchbar/style-jrkf/searchbar.scss +5 -5
  65. package/dist/cjs/packages/searchbar/style-jrkf/style.css +5 -5
  66. package/dist/cjs/packages/signature/signature.js +1 -1
  67. package/dist/cjs/packages/steps/style/style.css +2 -2
  68. package/dist/cjs/packages/swipe/swipe.js +20 -16
  69. package/dist/cjs/packages/switch/style/style.css +2 -2
  70. package/dist/cjs/packages/tabs/style/style.css +2 -2
  71. package/dist/cjs/packages/tag/style/style.css +2 -2
  72. package/dist/cjs/packages/timedetail/style/style.css +1 -1
  73. package/dist/cjs/packages/toast/Notification.js +1 -1
  74. package/dist/cjs/packages/toast/style/style.css +18 -15
  75. package/dist/cjs/packages/toast/style/toast.scss +23 -16
  76. package/dist/cjs/packages/toast/style-jmapp/style.css +17 -14
  77. package/dist/cjs/packages/toast/style-jmapp/toast.scss +23 -16
  78. package/dist/cjs/packages/toast/style-jrkf/style.css +17 -14
  79. package/dist/cjs/packages/toast/style-jrkf/toast.scss +23 -16
  80. package/dist/cjs/packages/toast/toast.js +1 -1
  81. package/dist/cjs/types/base/atoms.d.ts +3 -3
  82. package/dist/cjs/types/spec/button/base.d.ts +1 -0
  83. package/dist/cjs/utils/scale-f.d.ts +0 -17
  84. package/dist/cjs/utils/scale-f.js +14 -105
  85. package/dist/cjs/utils/taro/get-system-info.d.ts +0 -5
  86. package/dist/cjs/utils/taro/get-system-info.js +2 -7
  87. package/dist/es/hooks/taro/use-custom-event.js +1 -0
  88. package/dist/es/locales/base.d.ts +6 -0
  89. package/dist/es/locales/en-US.js +17 -1
  90. package/dist/es/locales/id-ID.js +17 -1
  91. package/dist/es/locales/ja-JP.js +16 -2
  92. package/dist/es/locales/tr-TR.js +17 -1
  93. package/dist/es/locales/vi-VN.js +17 -1
  94. package/dist/es/locales/zh-CN.js +15 -1
  95. package/dist/es/locales/zh-TW.js +15 -1
  96. package/dist/es/locales/zh-UG.js +17 -1
  97. package/dist/es/packages/address/style/style.css +2 -2
  98. package/dist/es/packages/audio/audio.js +2 -2
  99. package/dist/es/packages/button/button.js +30 -6
  100. package/dist/es/packages/button/style/button.scss +327 -227
  101. package/dist/es/packages/button/style/style.css +292 -47
  102. package/dist/es/packages/button/style-jmapp/button.scss +327 -227
  103. package/dist/es/packages/button/style-jmapp/style.css +268 -23
  104. package/dist/es/packages/button/style-jrkf/button.scss +327 -227
  105. package/dist/es/packages/button/style-jrkf/style.css +268 -23
  106. package/dist/es/packages/calendar/style/style.css +2 -2
  107. package/dist/es/packages/calendarcard/style/style.css +1 -1
  108. package/dist/es/packages/checkbox/checkbox.js +4 -3
  109. package/dist/es/packages/checkbox/style/checkbox.scss +19 -3
  110. package/dist/es/packages/checkbox/style/style.css +21 -6
  111. package/dist/es/packages/checkbox/style-jmapp/checkbox.scss +19 -3
  112. package/dist/es/packages/checkbox/style-jmapp/style.css +18 -3
  113. package/dist/es/packages/checkbox/style-jrkf/checkbox.scss +19 -3
  114. package/dist/es/packages/checkbox/style-jrkf/style.css +18 -3
  115. package/dist/es/packages/checkboxgroup/style/style.css +2 -2
  116. package/dist/es/packages/circleprogress/circleprogress.js +1 -1
  117. package/dist/es/packages/configprovider/types.d.ts +1 -1
  118. package/dist/es/packages/countdown/style/style.css +1 -1
  119. package/dist/es/packages/datepicker/datepicker.js +3 -5
  120. package/dist/es/packages/datepicker/utils.js +7 -0
  121. package/dist/es/packages/elevator/style/elevator.scss +6 -2
  122. package/dist/es/packages/elevator/style/style.css +2 -2
  123. package/dist/es/packages/elevator/style-jmapp/elevator.scss +6 -2
  124. package/dist/es/packages/elevator/style-jmapp/style.css +2 -2
  125. package/dist/es/packages/elevator/style-jrkf/elevator.scss +6 -2
  126. package/dist/es/packages/elevator/style-jrkf/style.css +2 -2
  127. package/dist/es/packages/ellipsis/style/style.css +1 -1
  128. package/dist/es/packages/inputnumber/inputnumber.js +5 -1
  129. package/dist/es/packages/inputnumber/style/inputnumber.scss +11 -5
  130. package/dist/es/packages/inputnumber/style/style.css +16 -11
  131. package/dist/es/packages/inputnumber/style-jmapp/inputnumber.scss +11 -5
  132. package/dist/es/packages/inputnumber/style-jmapp/style.css +10 -5
  133. package/dist/es/packages/inputnumber/style-jrkf/inputnumber.scss +11 -5
  134. package/dist/es/packages/inputnumber/style-jrkf/style.css +10 -5
  135. package/dist/es/packages/progress/progress.js +1 -1
  136. package/dist/es/packages/radio/radio.js +3 -2
  137. package/dist/es/packages/radio/style/radio.scss +9 -3
  138. package/dist/es/packages/radio/style/style.css +10 -5
  139. package/dist/es/packages/radio/style-jmapp/radio.scss +9 -3
  140. package/dist/es/packages/radio/style-jmapp/style.css +8 -3
  141. package/dist/es/packages/radio/style-jrkf/radio.scss +9 -3
  142. package/dist/es/packages/radio/style-jrkf/style.css +8 -3
  143. package/dist/es/packages/radiogroup/style/style.css +2 -2
  144. package/dist/es/packages/range/style/style.css +3 -3
  145. package/dist/es/packages/resultpage/resultpage.js +5 -5
  146. package/dist/es/packages/searchbar/style/searchbar.scss +5 -5
  147. package/dist/es/packages/searchbar/style/style.css +5 -5
  148. package/dist/es/packages/searchbar/style-jmapp/searchbar.scss +5 -5
  149. package/dist/es/packages/searchbar/style-jmapp/style.css +5 -5
  150. package/dist/es/packages/searchbar/style-jrkf/searchbar.scss +5 -5
  151. package/dist/es/packages/searchbar/style-jrkf/style.css +5 -5
  152. package/dist/es/packages/signature/signature.js +1 -1
  153. package/dist/es/packages/steps/style/style.css +2 -2
  154. package/dist/es/packages/swipe/swipe.js +20 -16
  155. package/dist/es/packages/switch/style/style.css +2 -2
  156. package/dist/es/packages/tabs/style/style.css +2 -2
  157. package/dist/es/packages/tag/style/style.css +2 -2
  158. package/dist/es/packages/timedetail/style/style.css +1 -1
  159. package/dist/es/packages/toast/Notification.js +1 -1
  160. package/dist/es/packages/toast/style/style.css +18 -15
  161. package/dist/es/packages/toast/style/toast.scss +23 -16
  162. package/dist/es/packages/toast/style-jmapp/style.css +17 -14
  163. package/dist/es/packages/toast/style-jmapp/toast.scss +23 -16
  164. package/dist/es/packages/toast/style-jrkf/style.css +17 -14
  165. package/dist/es/packages/toast/style-jrkf/toast.scss +23 -16
  166. package/dist/es/packages/toast/toast.js +1 -1
  167. package/dist/es/types/base/atoms.d.ts +3 -3
  168. package/dist/es/types/spec/button/base.d.ts +1 -0
  169. package/dist/es/utils/scale-f.d.ts +0 -17
  170. package/dist/es/utils/scale-f.js +15 -106
  171. package/dist/es/utils/taro/get-system-info.d.ts +0 -5
  172. package/dist/es/utils/taro/get-system-info.js +8 -7
  173. package/dist/nutui.react.umd.js +109 -145
  174. package/dist/style-jmapp.css +1 -1
  175. package/dist/style-jmapp.scss +30 -30
  176. package/dist/style-jrkf.css +1 -1
  177. package/dist/style-jrkf.scss +38 -38
  178. package/dist/style.css +1 -1
  179. package/dist/style.scss +31 -31
  180. package/dist/styles/theme-daojia.scss +55 -48
  181. package/dist/styles/theme-dark-daojia.scss +55 -47
  182. package/dist/styles/theme-dark.scss +108 -109
  183. package/dist/styles/theme-default.scss +110 -111
  184. package/dist/styles/theme-jmapp.scss +1 -1
  185. package/dist/styles/theme-jrkf.scss +1 -1
  186. package/dist/styles/themes/daojia.css +1 -1
  187. package/dist/styles/themes/dark-daojia.css +1 -1
  188. package/dist/styles/themes/dark.css +1 -1
  189. package/dist/styles/themes/default.css +1 -1
  190. package/dist/styles/themes/jmapp.css +1 -1
  191. package/dist/styles/themes/jrkf.css +1 -1
  192. package/dist/styles/variables-daojia.scss +1055 -1976
  193. package/dist/styles/variables-jmapp.scss +96 -5
  194. package/dist/styles/variables-jrkf.scss +96 -5
  195. package/dist/styles/variables.scss +141 -37
  196. package/package.json +1 -1
@@ -1,3 +1,34 @@
1
+ @mixin button-size(
2
+ $height,
3
+ $padding,
4
+ $font-size,
5
+ $radius,
6
+ $text-icon-margin: null
7
+ ) {
8
+ height: $height;
9
+ padding: $padding;
10
+ font-size: $font-size;
11
+ border-radius: $radius;
12
+
13
+ @if $text-icon-margin {
14
+ .nut-button-text {
15
+ margin-left: $text-icon-margin;
16
+ &-right {
17
+ margin-right: $text-icon-margin;
18
+ }
19
+ }
20
+ }
21
+
22
+ .nut-icon {
23
+ font-size: $font-size;
24
+ width: $font-size;
25
+ height: $font-size;
26
+ }
27
+ &-children {
28
+ font-size: $font-size;
29
+ }
30
+ }
31
+
1
32
  .nut-button {
2
33
  position: relative;
3
34
  display: flex;
@@ -95,9 +126,20 @@
95
126
  }
96
127
  }
97
128
 
98
- &-disabled {
129
+ &.nut-button-disabled {
99
130
  cursor: not-allowed;
100
- color: #ffffff;
131
+
132
+ // 不带色彩的纯灰禁用 (配合 className 使用)
133
+ &.nut-button-disabled-gray {
134
+ background: var(--nutui-button-disabled-background-color, #ccc);
135
+ color: #fff;
136
+ border-color: var(--nutui-button-disabled-background-color, #ccc);
137
+ opacity: 1;
138
+
139
+ .nut-button-desc {
140
+ color: rgba(255, 255, 255, 0.8);
141
+ }
142
+ }
101
143
  }
102
144
 
103
145
  &.nut-button-icononly {
@@ -135,290 +177,341 @@
135
177
  border-color: $button-default-disabled;
136
178
  }
137
179
  }
180
+
181
+ &:active:not(.nut-button-disabled):not(.nut-button-loading) {
182
+ background: $button-default-pressed;
183
+ }
138
184
  }
139
185
 
140
186
  &-normal {
141
187
  padding: $button-normal-padding;
188
+ min-width: scale-px(60px);
142
189
  }
143
190
 
144
- &-xlarge {
145
- height: $button-xlarge-height;
146
- padding: $button-xlarge-padding;
147
- font-size: $button-xlarge-font-size;
148
- border-radius: $button-xlarge-border-radius;
149
-
150
- .nut-button-text {
151
- margin-left: $button-xlarge-text-icon-margin;
152
- &-right {
153
- margin-right: $button-xlarge-text-icon-margin;
154
- }
155
- }
156
-
157
- .nut-icon {
158
- font-size: $button-xlarge-font-size;
159
- width: $button-xlarge-font-size;
160
- height: $button-xlarge-font-size;
191
+ &-has-desc {
192
+ .nut-button-text,
193
+ .nut-button-children {
194
+ display: flex;
195
+ flex-direction: column;
196
+ align-items: center;
197
+ justify-content: center;
198
+ line-height: 1.2;
199
+ }
200
+ .nut-button-title {
201
+ font-size: scale-font-px(14px);
202
+ font-weight: $font-weight-bold;
161
203
  }
162
- &-children {
163
- font-size: $button-xlarge-font-size;
204
+ .nut-button-desc {
205
+ font-size: scale-font-px(12px);
206
+ font-weight: $font-weight;
207
+ opacity: 0.8;
208
+ margin-top: scale-px(2px);
164
209
  }
165
210
  }
166
211
 
167
- &-large {
168
- height: $button-large-height;
169
- padding: $button-large-padding;
170
- font-size: $button-large-font-size;
171
- border-radius: $button-large-border-radius;
212
+ &-xlarge {
213
+ @include button-size(
214
+ $button-xlarge-height,
215
+ $button-xlarge-padding,
216
+ $button-xlarge-font-size,
217
+ $button-xlarge-border-radius,
218
+ $button-xlarge-text-icon-margin
219
+ );
220
+ font-weight: $font-weight-bold;
221
+ }
172
222
 
173
- .nut-button-text {
174
- margin-left: $button-xlarge-text-icon-margin;
175
- &-right {
176
- margin-right: $button-xlarge-text-icon-margin;
177
- }
178
- }
223
+ &-44 {
224
+ @include button-size(
225
+ $button-44-height,
226
+ $button-44-padding,
227
+ $button-44-font-size,
228
+ $button-44-border-radius,
229
+ $button-xlarge-text-icon-margin
230
+ );
231
+ font-weight: $font-weight-bold;
232
+ }
179
233
 
180
- .nut-icon {
181
- font-size: $button-large-font-size;
182
- width: $button-large-font-size;
183
- height: $button-large-font-size;
184
- }
234
+ &-large {
235
+ @include button-size(
236
+ $button-large-height,
237
+ $button-large-padding,
238
+ $button-large-font-size,
239
+ $button-large-border-radius,
240
+ $button-xlarge-text-icon-margin
241
+ );
242
+ min-width: scale-px(84px);
243
+ }
185
244
 
186
- &-children {
187
- font-size: $button-large-font-size;
188
- }
245
+ &-36 {
246
+ @include button-size(
247
+ $button-36-height,
248
+ $button-36-padding,
249
+ $button-36-font-size,
250
+ $button-36-border-radius,
251
+ $button-xlarge-text-icon-margin
252
+ );
253
+ min-width: scale-px(66px);
189
254
  }
190
255
 
191
256
  &-small {
192
- height: $button-small-height;
193
- padding: $button-small-padding;
194
- font-size: $button-small-font-size;
195
- border-radius: $button-small-border-radius;
196
-
197
- .nut-icon {
198
- font-size: $button-small-font-size;
199
- width: $button-small-font-size;
200
- height: $button-small-font-size;
201
- }
202
-
203
- &-children {
204
- font-size: $button-small-font-size;
205
- }
257
+ @include button-size(
258
+ $button-small-height,
259
+ $button-small-padding,
260
+ $button-small-font-size,
261
+ $button-small-border-radius
262
+ );
263
+ min-width: scale-px(52px);
264
+ font-weight: $font-weight;
206
265
  }
207
266
 
208
267
  &-mini {
209
- height: $button-mini-height;
210
- padding: $button-mini-padding;
211
- font-size: $button-mini-font-size;
212
- border-radius: $button-mini-border-radius;
213
-
214
- .nut-icon {
215
- font-size: $button-mini-font-size;
216
- width: $button-mini-font-size;
217
- height: $button-mini-font-size;
218
- }
219
-
220
- &-children {
221
- font-size: $button-mini-font-size;
222
- }
268
+ @include button-size(
269
+ $button-mini-height,
270
+ $button-mini-padding,
271
+ $button-mini-font-size,
272
+ $button-mini-border-radius
273
+ );
274
+ min-width: scale-px(48px);
275
+ font-weight: $font-weight;
223
276
  }
224
277
 
225
- &-primary {
226
- color: $button-primary-color;
227
- background-origin: border-box;
228
- border-color: transparent;
229
-
230
- &-children {
231
- color: $button-primary-color;
232
- }
233
-
234
- &-solid {
235
- background: $button-primary-background-color;
236
- color: $button-primary-color;
278
+ $button-colors: (
279
+ 'primary': (
280
+ $button-primary-color,
281
+ $button-primary-background-color,
282
+ $button-primary-border-color,
283
+ $button-primary-border-color,
284
+ $button-primary-disabled,
285
+ $button-primary-color,
286
+ $button-primary-disabled,
287
+ $button-primary-disabled,
288
+ $button-primary-disabled,
289
+ null,
290
+ $button-primary-pressed,
291
+ ),
292
+ 'success': (
293
+ $button-success-color,
294
+ $button-success-background-color,
295
+ $button-success-border-color,
296
+ $button-success-border-color,
297
+ $button-success-disabled,
298
+ $button-success-color,
299
+ $button-primary-disabled,
300
+ $button-primary-disabled,
301
+ $button-success-disabled,
302
+ null,
303
+ $button-success-pressed,
304
+ ),
305
+ 'info': (
306
+ $button-info-color,
307
+ $button-info-background-color,
308
+ $button-info-border-color,
309
+ $button-info-border-color,
310
+ $button-info-disabled,
311
+ $button-info-color,
312
+ $button-info-disabled,
313
+ $button-info-disabled,
314
+ $button-info-disabled,
315
+ null,
316
+ $button-info-pressed,
317
+ ),
318
+ 'danger': (
319
+ $button-danger-color,
320
+ $button-danger-background-color,
321
+ $button-danger-border-color,
322
+ $button-danger-border-color,
323
+ $button-danger-disabled,
324
+ $button-danger-color,
325
+ $button-danger-disabled,
326
+ $button-danger-disabled,
327
+ $button-danger-disabled,
328
+ null,
329
+ $button-danger-pressed,
330
+ ),
331
+ 'warning': (
332
+ $button-warning-color,
333
+ $button-warning-background-color,
334
+ $button-warning-border-color,
335
+ $button-warning-border-color,
336
+ $button-warning-disabled,
337
+ $button-warning-color,
338
+ $button-warning-disabled,
339
+ $button-warning-disabled,
340
+ $button-warning-disabled,
341
+ null,
342
+ $button-warning-pressed,
343
+ ),
344
+ 'service': (
345
+ $button-service-color,
346
+ $button-service-background-color,
347
+ $button-service-color,
348
+ $button-service-border-color,
349
+ $button-service-disabled,
350
+ $button-service-color,
351
+ $button-service-color,
352
+ $button-service-disabled,
353
+ $button-service-color,
354
+ 0.5,
355
+ $button-service-pressed,
356
+ ),
357
+ );
358
+
359
+ @each $type, $colors in $button-colors {
360
+ $text-color: nth($colors, 1);
361
+ $bg-color: nth($colors, 2);
362
+ $outline-text-color: nth($colors, 3);
363
+ $outline-border-color: nth($colors, 4);
364
+ $disabled-bg: nth($colors, 5);
365
+ $disabled-text-color: nth($colors, 6);
366
+ $outline-disabled-text-color: nth($colors, 7);
367
+ $outline-disabled-border-color: nth($colors, 8);
368
+ $none-disabled-text-color: nth($colors, 9);
369
+ $opacity-disabled: nth($colors, 10);
370
+ $pressed-bg: nth($colors, 11);
371
+
372
+ &-#{$type} {
373
+ color: $text-color;
374
+ background: $bg-color;
375
+ background-origin: border-box;
237
376
  border-color: transparent;
238
- font-weight: $font-weight-bold;
239
- &.nut-button-small,
240
- &.nut-button-mini {
241
- font-weight: $font-weight;
242
- }
243
- }
244
-
245
- &-disabled,
246
- &-disabled.nut-button-icononly,
247
- &-solid-disabled {
248
- color: $button-primary-color;
249
- background: $button-primary-disabled;
250
- border-color: $button-primary-disabled;
251
- }
252
-
253
- &-none {
254
- color: $button-primary-border-color;
255
377
 
256
- &-disabled {
257
- color: $button-primary-disabled;
378
+ &-children {
379
+ color: $text-color;
258
380
  }
259
- }
260
381
 
261
- &-outline {
262
- color: $button-primary-border-color;
263
- border-color: $button-primary-border-color;
264
-
265
- &-disabled {
266
- color: $button-primary-disabled;
267
- border-color: $button-primary-disabled;
382
+ &-disabled,
383
+ &-solid-disabled {
384
+ @if $opacity-disabled {
385
+ opacity: $opacity-disabled;
386
+ }
387
+ color: $disabled-text-color;
388
+ background: $disabled-bg;
389
+ border-color: $disabled-bg;
268
390
  }
269
- }
270
-
271
- &-dashed {
272
- color: $button-primary-border-color;
273
- border-color: $button-primary-border-color;
274
391
 
275
- &-disabled {
276
- color: $button-primary-disabled;
277
- border-color: $button-primary-disabled;
392
+ &-outline,
393
+ &-dashed {
394
+ color: $outline-text-color;
395
+ border-color: $outline-border-color;
396
+
397
+ .nut-button-#{$type}-children {
398
+ color: $outline-text-color;
399
+ }
400
+
401
+ &-disabled {
402
+ @if $opacity-disabled {
403
+ opacity: $opacity-disabled;
404
+ }
405
+ color: $outline-disabled-text-color;
406
+ border-color: $outline-disabled-border-color;
407
+
408
+ .nut-button-#{$type}-children {
409
+ color: $outline-disabled-text-color;
410
+ }
411
+ }
278
412
  }
279
- }
280
- }
281
- &-primary.nut-button-solid.nut-button-normal {
282
- font-weight: $font-weight-bold;
283
- }
284
413
 
285
- &-success {
286
- color: $button-success-color;
287
- background: $button-success-background-color;
288
- background-origin: border-box;
289
- border-color: transparent;
414
+ &-none {
415
+ color: $outline-text-color;
290
416
 
291
- &-children {
292
- color: $button-success-color;
293
- }
417
+ .nut-button-#{$type}-children {
418
+ color: $outline-text-color;
419
+ }
294
420
 
295
- &-disabled,
296
- &-solid-disabled {
297
- background: $button-success-disabled;
298
- border-color: $button-success-disabled;
299
- }
421
+ &-disabled {
422
+ @if $opacity-disabled {
423
+ opacity: $opacity-disabled;
424
+ }
425
+ color: $none-disabled-text-color;
300
426
 
301
- &-outline,
302
- &-dashed {
303
- color: $button-success-border-color;
304
- border-color: $button-success-border-color;
305
-
306
- &-disabled {
307
- color: $button-primary-disabled;
308
- border-color: $button-primary-disabled;
427
+ .nut-button-#{$type}-children {
428
+ color: $none-disabled-text-color;
429
+ }
430
+ }
309
431
  }
310
- }
311
432
 
312
- &-none {
313
- color: $button-success-border-color;
314
- &-disabled {
315
- color: $button-success-disabled;
433
+ // pressed / active states
434
+ &:active:not(.nut-button-disabled):not(.nut-button-loading):not(
435
+ .nut-button-outline
436
+ ):not(.nut-button-dashed) {
437
+ background: $pressed-bg;
316
438
  }
317
- }
318
- }
319
439
 
320
- &-info {
321
- color: $button-info-color;
322
- background: $button-info-background-color;
323
- background-origin: border-box;
324
- border-color: transparent;
325
-
326
- &-children {
327
- color: $button-info-color;
328
- }
329
-
330
- &-disabled,
331
- &-solid-disabled {
332
- background: $button-info-disabled;
333
- border-color: $button-info-disabled;
334
- }
335
-
336
- &-outline,
337
- &-dashed {
338
- color: $button-info-border-color;
339
- border-color: $button-info-border-color;
340
-
341
- &-disabled {
342
- color: $button-info-disabled;
343
- border-color: $button-info-disabled;
344
- }
345
- }
346
-
347
- &-none {
348
- color: $button-info-border-color;
349
- &-disabled {
350
- color: $button-info-disabled;
351
- }
352
- }
353
- }
354
-
355
- &-danger {
356
- color: $button-danger-color;
357
- background: $button-danger-background-color;
358
- background-origin: border-box;
359
- border-color: transparent;
360
-
361
- &-children {
362
- color: $button-danger-color;
363
- }
364
-
365
- &-disabled,
366
- &-solid-disabled {
367
- background: $button-danger-disabled;
368
- border-color: $button-danger-disabled;
369
- }
370
-
371
- &-outline,
372
- &-dashed {
373
- color: $button-danger-border-color;
374
- border-color: $button-danger-border-color;
375
-
376
- &-disabled {
377
- color: $button-danger-disabled;
378
- border-color: $button-danger-disabled;
379
- }
380
- }
381
-
382
- &-none {
383
- color: $button-danger-border-color;
384
- &-disabled {
385
- color: $button-danger-disabled;
440
+ @if $type == 'primary' {
441
+ &-solid {
442
+ font-weight: $font-weight-bold;
443
+ &.nut-button-small,
444
+ &.nut-button-mini {
445
+ font-weight: $font-weight;
446
+ }
447
+ }
448
+
449
+ &.nut-button-solid.nut-button-normal {
450
+ font-weight: $font-weight-bold;
451
+ }
452
+
453
+ &-light {
454
+ color: $button-primary-light-color;
455
+ background: $button-primary-light-background-color;
456
+ border-color: $button-primary-light-border-color;
457
+
458
+ .nut-button-primary-children {
459
+ color: $button-primary-light-color;
460
+ }
461
+
462
+ &-disabled {
463
+ opacity: 0.5;
464
+
465
+ .nut-button-primary-children {
466
+ color: $button-primary-light-color;
467
+ }
468
+ }
469
+
470
+ // press state for primary-light
471
+ &:active:not(.nut-button-disabled):not(.nut-button-loading):not(
472
+ .nut-button-outline
473
+ ):not(.nut-button-dashed) {
474
+ background: $color-primary-light-pressed;
475
+ }
476
+ }
386
477
  }
387
478
  }
388
479
  }
389
480
 
390
- &-warning {
391
- color: $button-warning-color;
392
- background: $button-warning-background-color;
481
+ &-golden {
482
+ color: $color-service-text;
483
+ background: $color-service-btn-bg;
393
484
  background-origin: border-box;
394
485
  border-color: transparent;
395
486
 
396
487
  &-children {
397
- color: $button-warning-color;
488
+ color: $color-service-text;
398
489
  }
399
490
 
400
491
  &-disabled,
401
492
  &-solid-disabled {
402
- color: $button-warning-color;
403
- background: $button-warning-disabled;
404
- border-color: $button-warning-disabled;
493
+ opacity: 0.5;
494
+ color: $color-service-text;
495
+ background: $color-service-btn-bg-disabled;
496
+ border-color: $color-service-btn-bg-disabled;
405
497
  }
406
498
 
407
499
  &-outline,
408
500
  &-dashed {
409
- color: $button-warning-border-color;
410
- border-color: $button-warning-border-color;
501
+ color: $color-service-text;
502
+ border-color: $color-service-border;
411
503
 
412
504
  &-disabled {
413
- color: $button-warning-disabled;
414
- border-color: $button-warning-disabled;
505
+ opacity: 0.5;
506
+ color: $color-service-text;
507
+ border-color: $color-service-btn-bg-disabled;
415
508
  }
416
509
  }
417
510
 
418
511
  &-none {
419
- color: $button-warning-border-color;
512
+ color: $color-service-text;
420
513
  &-disabled {
421
- color: $button-warning-disabled;
514
+ color: $color-service;
422
515
  }
423
516
  }
424
517
  }
@@ -470,3 +563,10 @@
470
563
  transform: translate(50%, -50%);
471
564
  }
472
565
  }
566
+
567
+ .nut-theme-dark {
568
+ // button primary-light
569
+ --nutui-button-primary-light-color: var(--nutui-color-primary);
570
+ --nutui-button-primary-light-background-color: rgba(250, 44, 25, 0.15);
571
+ --nutui-button-primary-light-border-color: transparent;
572
+ }