@nutui/nutui-react-taro 3.0.0-beta.1 → 3.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 (40) hide show
  1. package/dist/cjs/packages/button/button.js +1 -1
  2. package/dist/cjs/packages/input/input.js +3 -5
  3. package/dist/cjs/packages/input/style/input.scss +4 -0
  4. package/dist/cjs/packages/input/style/style.css +4 -0
  5. package/dist/cjs/packages/overlay/style/style.harmony.css +5 -3
  6. package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +1 -1
  7. package/dist/cjs/packages/tag/tag.d.ts +1 -1
  8. package/dist/cjs/packages/tag/tag.js +5 -11
  9. package/dist/cjs/packages/toast/style/style.css +56 -30
  10. package/dist/cjs/packages/toast/style/style.harmony.css +51 -62
  11. package/dist/cjs/packages/toast/style/toast.scss +65 -49
  12. package/dist/cjs/packages/toast/toast.d.ts +7 -7
  13. package/dist/cjs/packages/toast/toast.js +24 -19
  14. package/dist/cjs/packages/trendarrow/style/style.css +2 -1
  15. package/dist/cjs/packages/trendarrow/style/style.harmony.css +3 -2
  16. package/dist/cjs/packages/trendarrow/style/trendarrow.scss +2 -1
  17. package/dist/cjs/packages/trendarrow/trendarrow.js +6 -4
  18. package/dist/es/packages/button/button.js +1 -1
  19. package/dist/es/packages/input/input.js +3 -5
  20. package/dist/es/packages/input/style/input.scss +4 -0
  21. package/dist/es/packages/input/style/style.css +4 -0
  22. package/dist/es/packages/overlay/style/style.harmony.css +5 -3
  23. package/dist/es/packages/pulltorefresh/pulltorefresh.js +2 -2
  24. package/dist/es/packages/tag/tag.d.ts +1 -1
  25. package/dist/es/packages/tag/tag.js +6 -14
  26. package/dist/es/packages/toast/style/style.css +56 -30
  27. package/dist/es/packages/toast/style/style.harmony.css +51 -62
  28. package/dist/es/packages/toast/style/toast.scss +65 -49
  29. package/dist/es/packages/toast/toast.d.ts +15 -71
  30. package/dist/es/packages/toast/toast.js +25 -20
  31. package/dist/es/packages/trendarrow/style/style.css +2 -1
  32. package/dist/es/packages/trendarrow/style/style.harmony.css +3 -2
  33. package/dist/es/packages/trendarrow/style/trendarrow.scss +2 -1
  34. package/dist/es/packages/trendarrow/trendarrow.d.ts +11 -55
  35. package/dist/es/packages/trendarrow/trendarrow.js +6 -4
  36. package/dist/nutui.react.umd.js +315 -276
  37. package/dist/style.css +1 -1
  38. package/dist/styles/themes/default.scss +21 -21
  39. package/dist/styles/variables-jrkf.scss +21 -27
  40. package/package.json +2 -2
@@ -113,7 +113,7 @@ var Button = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
113
113
  }
114
114
  }), /*#__PURE__*/ _react.default.createElement(_components.View, {
115
115
  className: "nut-button-wrap"
116
- }, loading && !(0, _platformtaro.harmonyAndRn)() && /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Loading, {
116
+ }, loading && /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Loading, {
117
117
  className: "nut-icon-loading"
118
118
  }), !loading && icon ? icon : null, children && /*#__PURE__*/ _react.default.createElement(_components.View, {
119
119
  className: "nut-button-children nut-button-".concat(size, "-children nut-button-").concat(type, "-children ").concat(!(props.fill || disabled || loading) ? '' : "nut-button-".concat(type).concat(props.fill ? "-".concat(fill) : '').concat(disabled || loading ? '-disabled' : '')).concat(icon || loading ? " nut-button-text" : '').concat(rightIcon ? " nut-button-text-right" : ''),
@@ -21,7 +21,6 @@ var _utils = require("./utils");
21
21
  var _index = require("../configprovider/index");
22
22
  var _typings = require("../../utils/typings");
23
23
  var _usepropsvalue = require("../../utils/use-props-value");
24
- var _platformtaro = require("../../utils/platform-taro");
25
24
  var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
26
25
  type: 'text',
27
26
  name: '',
@@ -180,8 +179,7 @@ var Input = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
180
179
  onBlur: handleBlur,
181
180
  onFocus: handleFocus,
182
181
  onInput: function onInput(e) {
183
- console.log('eeeeee', e.detail.value);
184
- handleInput((e.currentTarget || e.detail).value);
182
+ handleInput((e.detail || e.currentTarget).value);
185
183
  }
186
184
  })), /*#__PURE__*/ _react.default.createElement(_components.View, {
187
185
  style: {
@@ -196,8 +194,8 @@ var Input = /*#__PURE__*/ (0, _react.forwardRef)(function(props, ref) {
196
194
  onClear === null || onClear === void 0 ? void 0 : onClear('');
197
195
  }
198
196
  }
199
- }, clearIcon || (!(0, _platformtaro.harmonyAndRn)() ? /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.MaskClose, {
197
+ }, clearIcon || /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.MaskClose, {
200
198
  className: "nut-input-clear"
201
- }) : null)));
199
+ })));
202
200
  });
203
201
  Input.displayName = 'NutInput';
@@ -47,3 +47,7 @@
47
47
  -webkit-text-fill-color: $input-disabled-color;
48
48
  }
49
49
  }
50
+
51
+ .nut-input-clear {
52
+ flex: 0;
53
+ }
@@ -43,4 +43,8 @@
43
43
  background: none;
44
44
  opacity: 1;
45
45
  -webkit-text-fill-color: var(--nutui-input-disabled-color, var(--nutui-color-text-disabled, #c2c4cc));
46
+ }
47
+
48
+ .nut-input-clear {
49
+ flex: 0;
46
50
  }
@@ -1,5 +1,10 @@
1
1
  .nut-overlay {
2
+ /* #ifdef rn */
2
3
  position: absolute;
4
+ /* #endif */
5
+ /* #ifndef rn */
6
+ position: fixed;
7
+ /* #endif */
3
8
  top: 0;
4
9
  left: 0;
5
10
  bottom: 0;
@@ -19,9 +24,6 @@
19
24
  .nut-overflow-hidden {
20
25
  overflow: hidden !important;
21
26
  }
22
- .nut-overflow-hidden .taro_page {
23
- overflow: hidden !important;
24
- }
25
27
 
26
28
  @keyframes nut-fade-in {
27
29
  0% {
@@ -62,7 +62,7 @@ var PullToRefresh = function PullToRefresh(p) {
62
62
  var _useState1 = (0, _sliced_to_array._)((0, _react.useState)(0), 2), height = _useState1[0], setHeight = _useState1[1];
63
63
  var timer = (0, _react.useRef)();
64
64
  var renderIcons = function renderIcons(status) {
65
- return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (status === 'pulling' || status === 'complete') && (!(0, _platformtaro.harmonyAndRn)() ? /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Loading, null) : null), (status === 'canRelease' || status === 'refreshing') && (!(0, _platformtaro.harmonyAndRn)() ? /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.More, null) : null));
65
+ return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, (status === 'pulling' || status === 'complete') && /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Loading, null), (status === 'canRelease' || status === 'refreshing') && /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.More, null));
66
66
  };
67
67
  var renderStatusIcon = function renderStatusIcon() {
68
68
  if (props.renderIcon) {
@@ -1,5 +1,5 @@
1
- import React, { FunctionComponent, ReactNode } from 'react';
2
1
  import type { MouseEvent } from 'react';
2
+ import React, { FunctionComponent, ReactNode } from 'react';
3
3
  import { ITouchEvent } from '@tarojs/components';
4
4
  import { BasicComponent } from "../../utils/typings";
5
5
  export type TagType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
@@ -16,6 +16,7 @@ var _object_spread_props = require("@swc/helpers/_/_object_spread_props");
16
16
  var _sliced_to_array = require("@swc/helpers/_/_sliced_to_array");
17
17
  var _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
18
18
  var _components = require("@tarojs/components");
19
+ var _iconsreacttaro = require("@nutui/icons-react-taro");
19
20
  var _classnames = /*#__PURE__*/ _interop_require_default._(require("classnames"));
20
21
  var _typings = require("../../utils/typings");
21
22
  var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
@@ -76,20 +77,13 @@ var Tag = function Tag(props) {
76
77
  setVisible(false);
77
78
  onClose && onClose(e);
78
79
  }
79
- }, closeIcon) : // <Close
80
- // size={8}
81
- // onClick={(e) => {
82
- // setVisible(false)
83
- // onClose && onClose(e)
84
- // }}
85
- // />
86
- /*#__PURE__*/ _react.default.createElement(_components.Text, {
80
+ }, closeIcon) : /*#__PURE__*/ _react.default.createElement(_iconsreacttaro.Close, {
81
+ size: 8,
87
82
  onClick: function onClick(e) {
88
83
  setVisible(false);
89
84
  onClose && onClose(e);
90
- },
91
- className: "".concat(classPrefix, "-custom-icon")
92
- }, "X")) : /*#__PURE__*/ _react.default.createElement(_components.View, {
85
+ }
86
+ })) : /*#__PURE__*/ _react.default.createElement(_components.View, {
93
87
  className: classes,
94
88
  style: (0, _object_spread._)({}, style, getStyle()),
95
89
  onClick: function onClick(e) {
@@ -7,12 +7,20 @@
7
7
  }
8
8
  }
9
9
  .nut-toast {
10
+ /* #ifdef rn */
11
+ position: absolute;
12
+ /* #endif */
13
+ /* #ifndef rn */
10
14
  position: fixed;
15
+ /* #endif */
11
16
  left: 0;
12
17
  top: 0;
18
+ display: flex;
19
+ flex-direction: row;
20
+ justify-content: center;
21
+ align-items: center;
13
22
  width: 100%;
14
23
  height: 100%;
15
- text-align: center;
16
24
  pointer-events: none;
17
25
  z-index: 1300;
18
26
  }
@@ -20,18 +28,24 @@
20
28
  --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
21
29
  --nutui-overlay-zIndex: 1300;
22
30
  }
23
- .nut-toast-small .nut-toast-inner {
24
- font-size: var(--nutui-font-size-s, 12px);
25
- }
26
- .nut-toast-large .nut-toast-inner {
27
- font-size: var(--nutui-font-size-l, 16px);
31
+ .nut-toast-overlay-default-taro {
32
+ /* #ifdef harmony */
33
+ background-color: rgba(0, 0, 0, 0);
34
+ z-index: 1300;
35
+ /* #endif */
36
+ /* #ifndef harmony */
37
+ --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
38
+ --nutui-overlay-zIndex: 1300;
39
+ /* #endif */
28
40
  }
29
41
  .nut-toast-inner {
30
- display: flex;
31
- flex-direction: column;
32
42
  position: absolute;
33
- left: 50%;
34
43
  top: var(--nutui-toast-inner-top, 50%);
44
+ transform: translate(0, -50%);
45
+ display: flex;
46
+ flex-direction: column;
47
+ justify-content: center;
48
+ align-items: center;
35
49
  min-width: 30%;
36
50
  max-width: 95.7%;
37
51
  font-size: var(--nutui-toast-text-font-size, 14px);
@@ -41,18 +55,28 @@
41
55
  background: var(--nutui-toast-inner-bg-color, var(--nutui-color-mask, rgba(0, 0, 0, 0.7)));
42
56
  border-radius: var(--nutui-toast-inner-border-radius, 16px);
43
57
  color: var(--nutui-toast-font-color, #ffffff);
44
- transform: translate(-50%, -50%);
45
58
  }
46
- .nut-toast-inner.normal {
59
+ .nut-toast-inner-normal {
47
60
  word-break: normal;
48
61
  word-wrap: normal;
49
62
  }
50
- .nut-toast-inner.break-word {
63
+ .nut-toast-inner-break-word {
51
64
  word-break: normal;
52
65
  word-wrap: break-word;
53
66
  }
67
+ .nut-toast-inner-small {
68
+ font-size: var(--nutui-font-size-s, 12px);
69
+ }
70
+ .nut-toast-inner-large {
71
+ font-size: var(--nutui-font-size-l, 16px);
72
+ }
54
73
  .nut-toast-center {
55
- top: var(--nutui-toast-inner-top, 50%);
74
+ /* #ifdef rn */
75
+ top: var(--nutui-toast-inner-top, 38%);
76
+ /* #endif */
77
+ /* #ifndef rn */
78
+ top: var(--nutui-toast-inner-top, 48%);
79
+ /* #endif */
56
80
  }
57
81
  .nut-toast-bottom {
58
82
  top: var(--nutui-toast-inner-top, 80%);
@@ -60,40 +84,43 @@
60
84
  .nut-toast-top {
61
85
  top: var(--nutui-toast-inner-top, 20%);
62
86
  }
63
- .nut-toast-text:empty {
87
+ .nut-toast-text {
88
+ color: #ffffff;
89
+ text-align: var(--nutui-toast-inner-text-align, center);
90
+ }
91
+ .nut-toast-text-empty {
64
92
  margin-bottom: -8px;
65
93
  }
66
94
  .nut-toast-title {
67
95
  color: #ffffff;
68
96
  font-size: var(--nutui-toast-title-font-size, 16px);
69
97
  font-weight: 500;
98
+ text-align: var(--nutui-toast-inner-text-align, center);
70
99
  }
71
- .nut-toast-title:empty {
72
- margin-bottom: -8px;
100
+ .nut-toast-icon {
101
+ width: 24px;
102
+ height: 24px;
103
+ color: #ffffff;
73
104
  }
74
- .nut-toast-has-icon .nut-toast-icon-wrapper {
105
+ .nut-toast-icon-wrapper {
75
106
  width: 100%;
76
107
  display: flex;
77
108
  align-items: center;
78
109
  justify-content: center;
79
110
  margin-bottom: 8px;
111
+ color: #ffffff;
80
112
  }
81
- .nut-toast-has-icon .nut-toast-icon-wrapper .nut-icon {
113
+ .nut-toast-icon-wrapper-icon {
82
114
  width: 24px;
83
115
  height: 24px;
84
116
  }
85
- .nut-toast-loading .nut-toast-inner {
86
- display: inline-flex;
87
- flex-direction: column;
88
- justify-content: center;
89
- align-items: center;
90
- }
91
- .nut-toast-loading .nut-toast-icon-wrapper {
92
- animation: rotation 2s linear infinite;
117
+ .nut-toast-rtl {
118
+ left: auto;
119
+ right: 0;
93
120
  }
94
- .nut-toast-loading .nut-toast-icon-wrapper .nut-icon {
95
- width: 24px;
96
- height: 24px;
121
+ .nut-toast-rtl-inner {
122
+ left: auto;
123
+ right: 50%;
97
124
  }
98
125
 
99
126
  [dir=rtl] .nut-toast,
@@ -105,7 +132,6 @@
105
132
  .nut-rtl .nut-toast-inner {
106
133
  left: auto;
107
134
  right: 50%;
108
- transform: translate(50%, -50%);
109
135
  }
110
136
 
111
137
  .toast-fade-enter-active {
@@ -6,42 +6,40 @@
6
6
  -webkit-transform: rotate(360deg);
7
7
  }
8
8
  }
9
-
10
- .nut-toast-overlay-default {
11
- background: rgba(0, 0, 0, 0);
12
- z-index: 1300;
13
- }
14
-
15
9
  .nut-toast {
16
- display: flex;
17
- flex-direction: column;
10
+ /* #ifdef rn */
11
+ position: absolute;
12
+ /* #endif */
13
+ /* #ifndef rn */
18
14
  position: fixed;
19
- top: 0;
15
+ /* #endif */
20
16
  left: 0;
21
- height: 100%;
22
- width: 100%;
23
- align-items: center;
17
+ top: 0;
18
+ display: flex;
19
+ flex-direction: row;
24
20
  justify-content: center;
21
+ align-items: center;
22
+ width: 100%;
23
+ height: 100%;
24
+ pointer-events: none;
25
25
  z-index: 1300;
26
26
  }
27
-
28
-
29
- .nut-toast-small .nut-toast-inner {
30
- font-size: 12px;
31
- }
32
-
33
- .nut-toast-large .nut-toast-inner {
34
- font-size: 16px;
27
+ .nut-toast-overlay-default-taro {
28
+ /* #ifdef harmony */
29
+ background-color: rgba(0, 0, 0, 0);
30
+ z-index: 1300;
31
+ /* #endif */
32
+ /* #ifndef harmony */
33
+ /* #endif */
35
34
  }
36
-
37
35
  .nut-toast-inner {
36
+ position: absolute;
37
+ top: 50%;
38
+ transform: translate(0, -50%);
38
39
  display: flex;
39
40
  flex-direction: column;
40
41
  justify-content: center;
41
42
  align-items: center;
42
- position: absolute;
43
- left: 50%;
44
- top: 50%;
45
43
  min-width: 30%;
46
44
  max-width: 95.7%;
47
45
  font-size: 14px;
@@ -51,79 +49,72 @@
51
49
  background: rgba(0, 0, 0, 0.7);
52
50
  border-radius: 16px;
53
51
  color: #ffffff;
54
- transform: translate(-50%, -50%);
55
52
  }
56
-
57
- .nut-toast-inner.normal {
53
+ .nut-toast-inner-normal {
58
54
  word-break: normal;
59
55
  word-wrap: normal;
60
56
  }
61
-
62
- .nut-toast-inner.break-word {
57
+ .nut-toast-inner-break-word {
63
58
  word-break: normal;
64
59
  word-wrap: break-word;
65
60
  }
66
-
61
+ .nut-toast-inner-small {
62
+ font-size: 12px;
63
+ }
64
+ .nut-toast-inner-large {
65
+ font-size: 16px;
66
+ }
67
67
  .nut-toast-center {
68
- top: 50%;
68
+ /* #ifdef rn */
69
+ top: 38%;
70
+ /* #endif */
71
+ /* #ifndef rn */
72
+ top: 48%;
73
+ /* #endif */
69
74
  }
70
-
71
75
  .nut-toast-bottom {
72
76
  top: 80%;
73
77
  }
74
-
75
78
  .nut-toast-top {
76
79
  top: 20%;
77
80
  }
78
-
79
81
  .nut-toast-text {
80
- display: flex;
81
82
  color: #ffffff;
82
83
  text-align: center;
83
84
  }
84
-
85
- .nut-toast-text:empty {
85
+ .nut-toast-text-empty {
86
86
  margin-bottom: -8px;
87
87
  }
88
-
89
88
  .nut-toast-title {
90
- display: flex;
91
89
  color: #ffffff;
92
90
  font-size: 16px;
93
91
  font-weight: 500;
92
+ text-align: center;
94
93
  }
95
-
96
- .nut-toast-title:empty {
97
- margin-bottom: -8px;
94
+ .nut-toast-icon {
95
+ width: 24px;
96
+ height: 24px;
97
+ color: #ffffff;
98
98
  }
99
-
100
- .nut-toast-has-icon .nut-toast-icon-wrapper {
99
+ .nut-toast-icon-wrapper {
101
100
  width: 100%;
102
101
  display: flex;
103
102
  align-items: center;
104
103
  justify-content: center;
105
104
  margin-bottom: 8px;
105
+ color: #ffffff;
106
106
  }
107
-
108
- .nut-toast-has-icon .nut-toast-icon-wrapper .nut-icon {
107
+ .nut-toast-icon-wrapper-icon {
109
108
  width: 24px;
110
109
  height: 24px;
111
110
  }
112
-
113
- .nut-toast-loading .nut-toast-inner {
114
- display: inline-flex;
115
- flex-direction: column;
116
- justify-content: center;
117
- align-items: center;
118
- }
119
-
120
- .nut-toast-loading .nut-toast-icon-wrapper {
121
- animation: rotation 2s linear infinite;
111
+ .nut-toast-rtl {
112
+ left: auto;
113
+ right: 0;
122
114
  }
123
-
124
- .nut-toast-loading .nut-toast-icon-wrapper .nut-icon {
125
- width: 24px;
126
- height: 24px;
115
+ .nut-toast-rtl-inner {
116
+ left: auto;
117
+ right: 50%;
127
118
  }
128
119
 
129
120
  [dir=rtl] .nut-toast,
@@ -131,12 +122,10 @@
131
122
  left: auto;
132
123
  right: 0;
133
124
  }
134
-
135
125
  [dir=rtl] .nut-toast-inner,
136
126
  .nut-rtl .nut-toast-inner {
137
127
  left: auto;
138
128
  right: 50%;
139
- transform: translate(50%, -50%);
140
129
  }
141
130
 
142
131
  .toast-fade-enter-active {
@@ -9,12 +9,20 @@
9
9
  }
10
10
 
11
11
  .nut-toast {
12
+ /* #ifdef rn */
13
+ position: absolute;
14
+ /* #endif */
15
+ /* #ifndef rn */
12
16
  position: fixed;
17
+ /* #endif */
13
18
  left: 0;
14
19
  top: 0;
20
+ display: flex;
21
+ flex-direction: row;
22
+ justify-content: center;
23
+ align-items: center;
15
24
  width: 100%;
16
25
  height: 100%;
17
- text-align: center;
18
26
  pointer-events: none;
19
27
  z-index: 1300;
20
28
 
@@ -23,24 +31,25 @@
23
31
  --nutui-overlay-zIndex: 1300;
24
32
  }
25
33
 
26
- &-small {
27
- .nut-toast-inner {
28
- font-size: $font-size-s;
29
- }
30
- }
31
-
32
- &-large {
33
- .nut-toast-inner {
34
- font-size: $font-size-l;
35
- }
34
+ &-overlay-default-taro {
35
+ /* #ifdef harmony */
36
+ background-color: rgba(0, 0, 0, 0);
37
+ z-index: 1300;
38
+ /* #endif */
39
+ /* #ifndef harmony */
40
+ --nutui-overlay-bg-color: rgba(0, 0, 0, 0);
41
+ --nutui-overlay-zIndex: 1300;
42
+ /* #endif */
36
43
  }
37
44
 
38
45
  &-inner {
39
- display: flex;
40
- flex-direction: column;
41
46
  position: absolute;
42
- left: 50%;
43
47
  top: $toast-inner-top;
48
+ transform: translate(-0, -50%);
49
+ display: flex;
50
+ flex-direction: column;
51
+ justify-content: center;
52
+ align-items: center;
44
53
  min-width: 30%;
45
54
  max-width: 95.7%;
46
55
  font-size: $toast-text-font-size;
@@ -50,21 +59,33 @@
50
59
  background: $toast-inner-bg-color;
51
60
  border-radius: $toast-inner-border-radius;
52
61
  color: $toast-font-color;
53
- transform: translate(-50%, -50%);
54
62
 
55
- &.normal {
63
+ &-normal {
56
64
  word-break: normal;
57
65
  word-wrap: normal;
58
66
  }
59
67
 
60
- &.break-word {
68
+ &-break-word {
61
69
  word-break: normal;
62
70
  word-wrap: break-word;
63
71
  }
72
+
73
+ &-small {
74
+ font-size: $font-size-s;
75
+ }
76
+
77
+ &-large {
78
+ font-size: $font-size-l;
79
+ }
64
80
  }
65
81
 
66
82
  &-center {
67
- top: var(--nutui-toast-inner-top, 50%);
83
+ /* #ifdef rn */
84
+ top: var(--nutui-toast-inner-top, 38%);
85
+ /* #endif */
86
+ /* #ifndef rn */
87
+ top: var(--nutui-toast-inner-top, 48%);
88
+ /* #endif */
68
89
  }
69
90
 
70
91
  &-bottom {
@@ -76,7 +97,9 @@
76
97
  }
77
98
 
78
99
  &-text {
79
- &:empty {
100
+ color: #ffffff;
101
+ text-align: $toast-inner-text-align;
102
+ &-empty {
80
103
  margin-bottom: -8px;
81
104
  }
82
105
  }
@@ -85,42 +108,36 @@
85
108
  color: #ffffff;
86
109
  font-size: $toast-title-font-size;
87
110
  font-weight: 500;
88
-
89
- &:empty {
90
- margin-bottom: -8px;
91
- }
111
+ text-align: $toast-inner-text-align;
92
112
  }
93
113
 
94
- &-has-icon {
95
- .nut-toast-icon-wrapper {
96
- width: 100%;
97
- display: flex;
98
- align-items: center;
99
- justify-content: center;
100
- margin-bottom: 8px;
101
-
102
- .nut-icon {
103
- width: 24px;
104
- height: 24px;
105
- }
106
- }
114
+ &-icon {
115
+ width: 24px;
116
+ height: 24px;
117
+ color: #ffffff;
107
118
  }
108
119
 
109
- &-loading {
110
- .nut-toast-inner {
111
- display: inline-flex;
112
- flex-direction: column;
113
- justify-content: center;
114
- align-items: center;
120
+ &-icon-wrapper {
121
+ width: 100%;
122
+ display: flex;
123
+ align-items: center;
124
+ justify-content: center;
125
+ margin-bottom: 8px;
126
+ color: #ffffff;
127
+
128
+ &-icon {
129
+ width: 24px;
130
+ height: 24px;
115
131
  }
132
+ }
116
133
 
117
- .nut-toast-icon-wrapper {
118
- animation: rotation 2s linear infinite;
134
+ &-rtl {
135
+ left: auto;
136
+ right: 0;
119
137
 
120
- .nut-icon {
121
- width: 24px;
122
- height: 24px;
123
- }
138
+ &-inner {
139
+ left: auto;
140
+ right: 50%;
124
141
  }
125
142
  }
126
143
  }
@@ -133,7 +150,6 @@
133
150
  &-inner {
134
151
  left: auto;
135
152
  right: 50%;
136
- transform: translate(50%, -50%);
137
153
  }
138
154
  }
139
155
 
@@ -5,19 +5,19 @@ export type ToastSize = 'small' | 'base' | 'large';
5
5
  export type ToastWordBreak = 'normal' | 'break-all' | 'break-word';
6
6
  export interface ToastProps extends BasicComponent {
7
7
  id?: string;
8
- maskClassName?: string;
9
- contentClassName?: string;
10
- contentStyle?: React.CSSProperties;
11
- icon: React.ReactNode;
12
- iconSize: string;
13
- content: React.ReactNode;
14
8
  duration: number;
15
9
  position?: ToastPosition;
16
- type: string;
17
10
  title: string;
18
11
  closeOnOverlayClick: boolean;
19
12
  lockScroll: boolean;
20
13
  size: ToastSize;
14
+ icon: React.ReactNode;
15
+ iconSize: string;
16
+ maskClassName?: string;
17
+ content: React.ReactNode;
18
+ contentClassName?: string;
19
+ contentStyle?: React.CSSProperties;
20
+ type: string;
21
21
  visible: boolean;
22
22
  wordBreak?: ToastWordBreak;
23
23
  onClose: () => void;