@nutui/nutui-react 3.0.0-beta.1 → 3.0.0-beta.3

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 (101) hide show
  1. package/dist/cjs/packages/avatar/style/avatar.scss +7 -60
  2. package/dist/cjs/packages/avatar/style/style.css +5 -43
  3. package/dist/cjs/packages/badge/badge.js +5 -3
  4. package/dist/cjs/packages/badge/style/badge.scss +18 -24
  5. package/dist/cjs/packages/badge/style/style.css +17 -15
  6. package/dist/cjs/packages/calendarcard/calendarcard.js +8 -3
  7. package/dist/cjs/packages/calendarcard/style/calendarcard.scss +25 -4
  8. package/dist/cjs/packages/calendarcard/style/style.css +27 -2
  9. package/dist/cjs/packages/input/style/input.scss +4 -0
  10. package/dist/cjs/packages/input/style/style.css +4 -0
  11. package/dist/cjs/packages/navbar/navbar.js +10 -5
  12. package/dist/cjs/packages/navbar/style/navbar.scss +46 -101
  13. package/dist/cjs/packages/navbar/style/style.css +44 -89
  14. package/dist/cjs/packages/pagination/pagination.js +2 -0
  15. package/dist/cjs/packages/pagination/style/pagination.scss +6 -12
  16. package/dist/cjs/packages/pagination/style/style.css +8 -14
  17. package/dist/cjs/packages/radio/index.d.ts +8 -2
  18. package/dist/cjs/packages/radio/index.js +6 -1
  19. package/dist/cjs/packages/radio/radio.d.ts +1 -4
  20. package/dist/cjs/packages/radio/radio.js +0 -2
  21. package/dist/cjs/packages/radio/style/radio.scss +1 -0
  22. package/dist/cjs/packages/radiogroup/radiogroup.js +1 -1
  23. package/dist/cjs/packages/safearea/style/safearea.scss +1 -1
  24. package/dist/cjs/packages/safearea/style/style.css +1 -1
  25. package/dist/cjs/packages/searchbar/style/searchbar.scss +10 -7
  26. package/dist/cjs/packages/searchbar/style/style.css +11 -8
  27. package/dist/cjs/packages/skeleton/style/style.css +5 -43
  28. package/dist/cjs/packages/tabbar/style/style.css +17 -15
  29. package/dist/cjs/packages/tabbaritem/style/style.css +17 -15
  30. package/dist/cjs/packages/toast/Notification.js +13 -24
  31. package/dist/cjs/packages/toast/style/style.css +56 -30
  32. package/dist/cjs/packages/toast/style/toast.scss +65 -49
  33. package/dist/cjs/packages/toast/toast.js +2 -2
  34. package/dist/cjs/packages/trendarrow/style/style.css +2 -1
  35. package/dist/cjs/packages/trendarrow/style/trendarrow.scss +2 -1
  36. package/dist/es/packages/avatar/style/avatar.scss +7 -60
  37. package/dist/es/packages/avatar/style/style.css +5 -43
  38. package/dist/es/packages/badge/badge.d.ts +7 -35
  39. package/dist/es/packages/badge/badge.js +5 -3
  40. package/dist/es/packages/badge/style/badge.scss +18 -24
  41. package/dist/es/packages/badge/style/style.css +17 -15
  42. package/dist/es/packages/calendarcard/calendarcard.d.ts +13 -65
  43. package/dist/es/packages/calendarcard/calendarcard.js +9 -4
  44. package/dist/es/packages/calendarcard/style/calendarcard.scss +25 -4
  45. package/dist/es/packages/calendarcard/style/style.css +27 -2
  46. package/dist/es/packages/input/style/input.scss +4 -0
  47. package/dist/es/packages/input/style/style.css +4 -0
  48. package/dist/es/packages/loading/loading.d.ts +3 -15
  49. package/dist/es/packages/navbar/navbar.js +10 -5
  50. package/dist/es/packages/navbar/style/navbar.scss +46 -101
  51. package/dist/es/packages/navbar/style/style.css +44 -89
  52. package/dist/es/packages/pagination/pagination.js +2 -0
  53. package/dist/es/packages/pagination/style/pagination.scss +6 -12
  54. package/dist/es/packages/pagination/style/style.css +8 -14
  55. package/dist/es/packages/radio/index.d.ts +8 -2
  56. package/dist/es/packages/radio/index.js +5 -1
  57. package/dist/es/packages/radio/radio.d.ts +10 -49
  58. package/dist/es/packages/radio/radio.js +0 -2
  59. package/dist/es/packages/radio/style/radio.scss +1 -0
  60. package/dist/es/packages/radiogroup/radiogroup.d.ts +7 -35
  61. package/dist/es/packages/radiogroup/radiogroup.js +1 -1
  62. package/dist/es/packages/safearea/safearea.d.ts +1 -5
  63. package/dist/es/packages/safearea/style/safearea.scss +1 -1
  64. package/dist/es/packages/safearea/style/style.css +1 -1
  65. package/dist/es/packages/searchbar/searchbar.d.ts +19 -95
  66. package/dist/es/packages/searchbar/style/searchbar.scss +10 -7
  67. package/dist/es/packages/searchbar/style/style.css +11 -8
  68. package/dist/es/packages/skeleton/style/style.css +5 -43
  69. package/dist/es/packages/tabbar/style/style.css +17 -15
  70. package/dist/es/packages/tabbaritem/style/style.css +17 -15
  71. package/dist/es/packages/toast/Notification.js +14 -25
  72. package/dist/es/packages/toast/style/style.css +56 -30
  73. package/dist/es/packages/toast/style/toast.scss +65 -49
  74. package/dist/es/packages/toast/toast.d.ts +12 -60
  75. package/dist/es/packages/toast/toast.js +2 -2
  76. package/dist/es/packages/trendarrow/style/style.css +2 -1
  77. package/dist/es/packages/trendarrow/style/trendarrow.scss +2 -1
  78. package/dist/es/packages/trendarrow/trendarrow.d.ts +11 -55
  79. package/dist/es/packages/video/video.d.ts +5 -25
  80. package/dist/nutui.react.umd.js +150 -125
  81. package/dist/style.css +1 -1
  82. package/dist/styles/themes/default.scss +35 -35
  83. package/dist/styles/variables-jrkf.scss +21 -27
  84. package/dist/styles/variables.scss +7 -4
  85. package/package.json +1 -1
  86. package/dist/cjs/packages/nutui.react.build.rn.d.ts +0 -203
  87. package/dist/cjs/packages/nutui.react.build.rn.js +0 -418
  88. package/dist/cjs/packages/nutui.react.rn.d.ts +0 -304
  89. package/dist/cjs/packages/nutui.react.rn.js +0 -519
  90. package/dist/cjs/packages/popup/index.rn.d.ts +0 -3
  91. package/dist/cjs/packages/popup/index.rn.js +0 -12
  92. package/dist/cjs/packages/popup/popup.rn.d.ts +0 -26
  93. package/dist/cjs/packages/popup/popup.rn.js +0 -186
  94. package/dist/es/packages/nutui.react.build.rn.d.ts +0 -203
  95. package/dist/es/packages/nutui.react.build.rn.js +0 -203
  96. package/dist/es/packages/nutui.react.rn.d.ts +0 -304
  97. package/dist/es/packages/nutui.react.rn.js +0 -304
  98. package/dist/es/packages/popup/index.rn.d.ts +0 -3
  99. package/dist/es/packages/popup/index.rn.js +0 -2
  100. package/dist/es/packages/popup/popup.rn.d.ts +0 -26
  101. package/dist/es/packages/popup/popup.rn.js +0 -174
@@ -1,41 +1,13 @@
1
1
  import React from 'react';
2
2
  import { RadioGroupDirection, RadioGroupOption, RadioGroupPosition, RadioGroupShape } from './types';
3
3
  export interface RadioGroupProps {
4
- /**
5
- * 当前选中项的标识符
6
- * @default -
7
- */
8
- value?: string | number
4
+ value?: string | number;
9
5
  defaultValue?: string | number;
10
- /**
11
- * 文本所在的位置
12
- * @default right
13
- */
14
- labelPosition: RadioGroupPosition
15
- /**
16
- * 使用横纵方向
17
- * @default vertical
18
- */
19
- direction: RadioGroupDirection
20
- /**
21
- * 形状
22
- * @default -
23
- */
24
- shape?: RadioGroupShape
25
- /**
26
- * 是否禁用
27
- * @default false
28
- */
29
- disabled?: boolean
30
- /**
31
- * 配置 options 渲染单选按钮
32
- * @default -
33
- */
34
- options: RadioGroupOption[]
35
- /**
36
- * 值变化时触发
37
- * @default -
38
- */
39
- onChange: (value: string | number) => void
6
+ labelPosition: RadioGroupPosition;
7
+ direction: RadioGroupDirection;
8
+ shape?: RadioGroupShape;
9
+ disabled?: boolean;
10
+ options: RadioGroupOption[];
11
+ onChange: (value: string | number) => void;
40
12
  }
41
13
  export declare const RadioGroup: React.ForwardRefExoticComponent<Partial<RadioGroupProps> & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & React.RefAttributes<unknown>>;
@@ -28,7 +28,7 @@ export var RadioGroup = /*#__PURE__*/ React.forwardRef(function(props, ref) {
28
28
  "options",
29
29
  "disabled"
30
30
  ]);
31
- var cls = classNames(classPrefix, _define_property({}, "".concat(classPrefix, "-").concat(props.direction), props.direction), className);
31
+ var cls = classNames(classPrefix, _define_property({}, "".concat(classPrefix, "-").concat(direction), direction), className);
32
32
  var _usePropsValue = _sliced_to_array(usePropsValue({
33
33
  defaultValue: props.defaultValue,
34
34
  value: props.value,
@@ -1,10 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  import { BasicComponent } from "../../utils/typings";
3
3
  export interface SafeAreaProps extends BasicComponent {
4
- /**
5
- * 安全区的位置
6
- * @default -
7
- */
8
- position: 'top' | 'bottom'
4
+ position: 'top' | 'bottom';
9
5
  }
10
6
  export declare const SafeArea: FC<SafeAreaProps>;
@@ -1,5 +1,5 @@
1
1
  .nut-safe-area {
2
- display: block;
2
+ display: flex;
3
3
  width: 100%;
4
4
 
5
5
  &-position-top {
@@ -1,5 +1,5 @@
1
1
  .nut-safe-area {
2
- display: block;
2
+ display: flex;
3
3
  width: 100%;
4
4
  }
5
5
  .nut-safe-area-position-top {
@@ -2,100 +2,24 @@ import React, { FunctionComponent } from 'react';
2
2
  import type { ChangeEvent, FocusEvent, MouseEvent } from 'react';
3
3
  import { BasicComponent } from "../../utils/typings";
4
4
  export interface SearchBarProps extends BasicComponent {
5
- /**
6
- * 当前输入的值
7
- * @default -
8
- */
9
- value?: number | string
10
- /**
11
- * 输入框默认暗纹
12
- * @default 请输入
13
- */
14
- placeholder?: string
15
- /**
16
- * 搜索框形状,可选值为 round
17
- * @default square
18
- */
19
- shape?: 'square' | 'round'
20
- /**
21
- * 是否禁用输入框
22
- * @default false
23
- */
24
- disabled?: boolean
25
- /**
26
- * 最大输入长度
27
- * @default 9999
28
- */
29
- maxLength?: number
30
- /**
31
- * 是否展示清除按钮
32
- * @default true
33
- */
34
- clearable?: boolean
35
- /**
36
- * 输入框只读
37
- * @default false
38
- */
39
- readOnly?: boolean
40
- /**
41
- * 是否自动聚焦
42
- * @default false
43
- */
44
- autoFocus?: boolean
45
- /**
46
- * 是否展示返回按钮
47
- * @default false
48
- */
49
- backable: boolean
50
- /**
51
- * 搜索框左侧区域
52
- * @default -
53
- */
54
- left: React.ReactNode
55
- /**
56
- * 搜搜框右侧区域
57
- * @default -
58
- */
59
- right: React.ReactNode
60
- /**
61
- * 输入框内左侧区域
62
- * @default <Search width="12" height="12" />
63
- */
64
- leftIn: React.ReactNode
65
- /**
66
- * 输入框内右侧区域
67
- * @default -
68
- */
69
- rightIn: React.ReactNode
70
- /**
71
- * 确定搜索时触发
72
- * @default -
73
- */
74
- onSearch?: (val: string) => void
75
- /**
76
- * 输入内容时触发
77
- * @default -
78
- */
79
- onChange?: (value: string, event?: ChangeEvent<HTMLInputElement>) => void
80
- /**
81
- * 聚焦时触发
82
- * @default -
83
- */
84
- onFocus?: (value: string, event: FocusEvent<HTMLInputElement>) => void
85
- /**
86
- * 失焦时触发
87
- * @default -
88
- */
89
- onBlur?: (value: string, event: FocusEvent<HTMLInputElement>) => void
90
- /**
91
- * 点击清空时触发
92
- * @default -
93
- */
94
- onClear?: (event: MouseEvent<HTMLDivElement>) => void
95
- /**
96
- * 点击输入区域时触发
97
- * @default -
98
- */
99
- onInputClick?: (event: MouseEvent<HTMLInputElement>) => void
5
+ value?: number | string;
6
+ placeholder?: string;
7
+ shape?: 'square' | 'round';
8
+ disabled?: boolean;
9
+ maxLength?: number;
10
+ clearable?: boolean;
11
+ readOnly?: boolean;
12
+ autoFocus?: boolean;
13
+ backable: boolean;
14
+ left: React.ReactNode;
15
+ right: React.ReactNode;
16
+ leftIn: React.ReactNode;
17
+ rightIn: React.ReactNode;
18
+ onSearch?: (val: string) => void;
19
+ onChange?: (value: string, event?: ChangeEvent<HTMLInputElement>) => void;
20
+ onFocus?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
21
+ onBlur?: (value: string, event: FocusEvent<HTMLInputElement>) => void;
22
+ onClear?: (event: MouseEvent<HTMLDivElement>) => void;
23
+ onInputClick?: (event: MouseEvent<HTMLInputElement>) => void;
100
24
  }
101
25
  export declare const SearchBar: FunctionComponent<Partial<SearchBarProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onFocus' | 'onBlur'>>;
@@ -35,7 +35,8 @@
35
35
 
36
36
  &-left,
37
37
  &-right {
38
- display: flex;
38
+ display: inline-flex;
39
+ align-items: center;
39
40
 
40
41
  &.nut-icon {
41
42
  width: 20px;
@@ -48,7 +49,9 @@
48
49
 
49
50
  & > div,
50
51
  & > span,
51
- & > svg {
52
+ & > i,
53
+ & > svg,
54
+ .nut-icon {
52
55
  margin-right: $searchbar-gap;
53
56
 
54
57
  &:last-child {
@@ -59,10 +62,11 @@
59
62
 
60
63
  &-right {
61
64
  margin-left: $searchbar-gap;
62
-
63
65
  & > div,
64
66
  & > span,
65
- & > svg {
67
+ & > i,
68
+ & > svg,
69
+ .nut-icon {
66
70
  margin-left: $searchbar-gap;
67
71
 
68
72
  &:first-child {
@@ -89,7 +93,8 @@
89
93
  }
90
94
  }
91
95
 
92
- &-input-box {
96
+ &-input-box,
97
+ &-input {
93
98
  display: flex;
94
99
  align-items: center;
95
100
  flex: 1;
@@ -100,8 +105,6 @@
100
105
  outline: 0;
101
106
  box-sizing: border-box;
102
107
  width: 100%;
103
- height: $searchbar-input-height;
104
- line-height: $searchbar-input-height;
105
108
  padding: $searchbar-input-padding;
106
109
  font-size: $searchbar-font-size;
107
110
  color: $searchbar-input-text-color;
@@ -30,7 +30,8 @@
30
30
  color: var(--nutui-black-5);
31
31
  }
32
32
  .nut-searchbar-left, .nut-searchbar-right {
33
- display: flex;
33
+ display: inline-flex;
34
+ align-items: center;
34
35
  }
35
36
  .nut-searchbar-left.nut-icon, .nut-searchbar-right.nut-icon {
36
37
  width: 20px;
@@ -39,19 +40,23 @@
39
40
  .nut-searchbar-left {
40
41
  margin-right: var(--nutui-searchbar-gap, 16px);
41
42
  }
42
- .nut-searchbar-left > div, .nut-searchbar-left > span, .nut-searchbar-left > svg {
43
+ .nut-searchbar-left > div, .nut-searchbar-left > span, .nut-searchbar-left > i, .nut-searchbar-left > svg,
44
+ .nut-searchbar-left .nut-icon {
43
45
  margin-right: var(--nutui-searchbar-gap, 16px);
44
46
  }
45
- .nut-searchbar-left > div:last-child, .nut-searchbar-left > span:last-child, .nut-searchbar-left > svg:last-child {
47
+ .nut-searchbar-left > div:last-child, .nut-searchbar-left > span:last-child, .nut-searchbar-left > i:last-child, .nut-searchbar-left > svg:last-child,
48
+ .nut-searchbar-left .nut-icon:last-child {
46
49
  margin-right: 0;
47
50
  }
48
51
  .nut-searchbar-right {
49
52
  margin-left: var(--nutui-searchbar-gap, 16px);
50
53
  }
51
- .nut-searchbar-right > div, .nut-searchbar-right > span, .nut-searchbar-right > svg {
54
+ .nut-searchbar-right > div, .nut-searchbar-right > span, .nut-searchbar-right > i, .nut-searchbar-right > svg,
55
+ .nut-searchbar-right .nut-icon {
52
56
  margin-left: var(--nutui-searchbar-gap, 16px);
53
57
  }
54
- .nut-searchbar-right > div:first-child, .nut-searchbar-right > span:first-child, .nut-searchbar-right > svg:first-child {
58
+ .nut-searchbar-right > div:first-child, .nut-searchbar-right > span:first-child, .nut-searchbar-right > i:first-child, .nut-searchbar-right > svg:first-child,
59
+ .nut-searchbar-right .nut-icon:first-child {
55
60
  margin-left: 0;
56
61
  }
57
62
  .nut-searchbar-left > text, .nut-searchbar-left > view {
@@ -66,7 +71,7 @@
66
71
  .nut-searchbar-right > text:first-child, .nut-searchbar-right > view:first-child {
67
72
  margin-left: 0;
68
73
  }
69
- .nut-searchbar-input-box {
74
+ .nut-searchbar-input-box, .nut-searchbar-input {
70
75
  display: flex;
71
76
  align-items: center;
72
77
  flex: 1;
@@ -76,8 +81,6 @@
76
81
  outline: 0;
77
82
  box-sizing: border-box;
78
83
  width: 100%;
79
- height: var(--nutui-searchbar-input-height, 32px);
80
- line-height: var(--nutui-searchbar-input-height, 32px);
81
84
  padding: var(--nutui-searchbar-input-padding, 0 4px);
82
85
  font-size: var(--nutui-searchbar-font-size, var(--nutui-font-size-base, 14px));
83
86
  color: var(--nutui-searchbar-input-text-color, var(--nutui-color-title, #1a1a1a));
@@ -73,6 +73,11 @@
73
73
  .nut-avatar {
74
74
  position: relative;
75
75
  flex: 0 0 auto;
76
+ display: flex;
77
+ justify-content: center;
78
+ align-items: center;
79
+ width: var(--nutui-avatar-normal-width, 40px);
80
+ height: var(--nutui-avatar-normal-height, 40px);
76
81
  }
77
82
  .nut-avatar-round {
78
83
  border-radius: 999px;
@@ -96,21 +101,12 @@
96
101
  .nut-avatar-icon {
97
102
  background-size: 100% 100%;
98
103
  }
99
- .nut-avatar .nut-icon-img {
100
- width: 100%;
101
- height: 100%;
102
- }
103
104
  .nut-avatar-text {
104
105
  display: flex;
105
106
  justify-content: center;
106
107
  align-items: center;
107
- width: 100%;
108
- height: 100%;
109
108
  }
110
109
  .nut-avatar-large {
111
- display: flex;
112
- justify-content: center;
113
- align-items: center;
114
110
  width: var(--nutui-avatar-large-width, 60px);
115
111
  height: var(--nutui-avatar-large-height, 60px);
116
112
  }
@@ -118,30 +114,15 @@
118
114
  width: var(--nutui-avatar-large-width, 60px);
119
115
  height: var(--nutui-avatar-large-height, 60px);
120
116
  }
121
- .nut-avatar-large-img-image {
122
- width: var(--nutui-avatar-large-width, 60px);
123
- height: var(--nutui-avatar-large-height, 60px);
124
- }
125
117
  .nut-avatar-large-icon {
126
118
  width: var(--nutui-avatar-large-width, 60px);
127
119
  height: var(--nutui-avatar-large-height, 60px);
128
120
  }
129
- .nut-avatar-large .nut-icon-img {
130
- width: 100%;
131
- height: 100%;
132
- }
133
121
  .nut-avatar-large-text {
134
122
  width: var(--nutui-avatar-large-width, 60px);
135
123
  height: var(--nutui-avatar-large-height, 60px);
136
124
  }
137
125
  .nut-avatar-small {
138
- display: flex;
139
- justify-content: center;
140
- align-items: center;
141
- width: var(--nutui-avatar-small-width, 32px);
142
- height: var(--nutui-avatar-small-height, 32px);
143
- }
144
- .nut-avatar-small-img-image {
145
126
  width: var(--nutui-avatar-small-width, 32px);
146
127
  height: var(--nutui-avatar-small-height, 32px);
147
128
  }
@@ -149,25 +130,6 @@
149
130
  width: var(--nutui-avatar-small-width, 32px);
150
131
  height: var(--nutui-avatar-small-height, 32px);
151
132
  }
152
- .nut-avatar-normal {
153
- display: flex;
154
- justify-content: center;
155
- align-items: center;
156
- width: var(--nutui-avatar-normal-width, 40px);
157
- height: var(--nutui-avatar-normal-height, 40px);
158
- }
159
- .nut-avatar-normal-img-image {
160
- width: var(--nutui-avatar-normal-width, 40px);
161
- height: var(--nutui-avatar-normal-height, 40px);
162
- }
163
- .nut-avatar-normal .nut-icon-img {
164
- width: 100%;
165
- height: 100%;
166
- }
167
- .nut-avatar-normal-text {
168
- width: var(--nutui-avatar-normal-width, 40px);
169
- height: var(--nutui-avatar-normal-height, 40px);
170
- }
171
133
 
172
134
  .nut-skeleton {
173
135
  display: inline-block;
@@ -1,6 +1,13 @@
1
1
  .nut-badge {
2
2
  position: relative;
3
- display: inline-block;
3
+ display: inline-flex;
4
+ width: auto;
5
+ /* #ifdef harmony */
6
+ min-width: 1px;
7
+ /* #endif */
8
+ /* #ifndef harmony */
9
+ min-width: auto;
10
+ /* #endif */
4
11
  }
5
12
  .nut-badge-icon {
6
13
  position: absolute;
@@ -8,8 +15,6 @@
8
15
  justify-content: center;
9
16
  align-items: center;
10
17
  background: var(--nutui-badge-background-color, linear-gradient(135deg, var(--nutui-color-primary-stop-1, #ff475d) 0%, var(--nutui-color-primary-stop-2, #ff0f23) 100%));
11
- top: -10%;
12
- right: -15%;
13
18
  padding: var(--nutui-badge-icon-padding, 3px);
14
19
  text-align: center;
15
20
  border: var(--nutui-badge-border, 0px solid var(--nutui-color-primary-text, #ffffff));
@@ -27,7 +32,12 @@
27
32
  display: flex;
28
33
  justify-content: center;
29
34
  align-items: center;
35
+ /* #ifdef harmony */
36
+ background: var(--nutui-color-primary, #ff0f23);
37
+ /* #endif */
38
+ /* #ifndef harmony */
30
39
  background: var(--nutui-badge-background-color, linear-gradient(135deg, var(--nutui-color-primary-stop-1, #ff475d) 0%, var(--nutui-color-primary-stop-2, #ff0f23) 100%));
40
+ /* #endif */
31
41
  color: var(--nutui-badge-color, #fff);
32
42
  padding: var(--nutui-badge-padding, 0 4px);
33
43
  font-size: var(--nutui-badge-font-size, var(--nutui-font-size-xxs, 10px));
@@ -45,7 +55,9 @@
45
55
  padding: 0;
46
56
  }
47
57
  .nut-badge-content {
48
- transform: var(--nutui-badge-content-transform, translateY(-50%) translateX(100%));
58
+ /* #ifndef rn */
59
+ transform: var(--nutui-badge-content-transform, translateX(100%));
60
+ /* #endif */
49
61
  }
50
62
  .nut-badge-dot {
51
63
  width: var(--nutui-badge-dot-width, 7px);
@@ -54,22 +66,12 @@
54
66
  border-radius: var(--nutui-badge-dot-width, 7px);
55
67
  padding: 0;
56
68
  }
57
- .nut-badge-outline .nut-badge-content {
69
+ .nut-badge-outline {
58
70
  background: var(--nutui-color-primary-text, #ffffff);
59
71
  border: 1px solid var(--nutui-color-primary, #ff0f23);
60
72
  color: var(--nutui-color-primary, #ff0f23);
61
73
  }
62
74
 
63
- [dir=rtl] .nut-badge-icon,
64
- .nut-rtl .nut-badge-icon {
65
- right: auto;
66
- left: -15%;
67
- }
68
- [dir=rtl] .nut-badge-content,
69
- .nut-rtl .nut-badge-content {
70
- transform: var(--nutui-badge-content-transform, translateY(-50%) translateX(-100%));
71
- }
72
-
73
75
  .nut-tabbar-item {
74
76
  display: flex;
75
77
  flex-direction: column;
@@ -1,6 +1,13 @@
1
1
  .nut-badge {
2
2
  position: relative;
3
- display: inline-block;
3
+ display: inline-flex;
4
+ width: auto;
5
+ /* #ifdef harmony */
6
+ min-width: 1px;
7
+ /* #endif */
8
+ /* #ifndef harmony */
9
+ min-width: auto;
10
+ /* #endif */
4
11
  }
5
12
  .nut-badge-icon {
6
13
  position: absolute;
@@ -8,8 +15,6 @@
8
15
  justify-content: center;
9
16
  align-items: center;
10
17
  background: var(--nutui-badge-background-color, linear-gradient(135deg, var(--nutui-color-primary-stop-1, #ff475d) 0%, var(--nutui-color-primary-stop-2, #ff0f23) 100%));
11
- top: -10%;
12
- right: -15%;
13
18
  padding: var(--nutui-badge-icon-padding, 3px);
14
19
  text-align: center;
15
20
  border: var(--nutui-badge-border, 0px solid var(--nutui-color-primary-text, #ffffff));
@@ -27,7 +32,12 @@
27
32
  display: flex;
28
33
  justify-content: center;
29
34
  align-items: center;
35
+ /* #ifdef harmony */
36
+ background: var(--nutui-color-primary, #ff0f23);
37
+ /* #endif */
38
+ /* #ifndef harmony */
30
39
  background: var(--nutui-badge-background-color, linear-gradient(135deg, var(--nutui-color-primary-stop-1, #ff475d) 0%, var(--nutui-color-primary-stop-2, #ff0f23) 100%));
40
+ /* #endif */
31
41
  color: var(--nutui-badge-color, #fff);
32
42
  padding: var(--nutui-badge-padding, 0 4px);
33
43
  font-size: var(--nutui-badge-font-size, var(--nutui-font-size-xxs, 10px));
@@ -45,7 +55,9 @@
45
55
  padding: 0;
46
56
  }
47
57
  .nut-badge-content {
48
- transform: var(--nutui-badge-content-transform, translateY(-50%) translateX(100%));
58
+ /* #ifndef rn */
59
+ transform: var(--nutui-badge-content-transform, translateX(100%));
60
+ /* #endif */
49
61
  }
50
62
  .nut-badge-dot {
51
63
  width: var(--nutui-badge-dot-width, 7px);
@@ -54,22 +66,12 @@
54
66
  border-radius: var(--nutui-badge-dot-width, 7px);
55
67
  padding: 0;
56
68
  }
57
- .nut-badge-outline .nut-badge-content {
69
+ .nut-badge-outline {
58
70
  background: var(--nutui-color-primary-text, #ffffff);
59
71
  border: 1px solid var(--nutui-color-primary, #ff0f23);
60
72
  color: var(--nutui-color-primary, #ff0f23);
61
73
  }
62
74
 
63
- [dir=rtl] .nut-badge-icon,
64
- .nut-rtl .nut-badge-icon {
65
- right: auto;
66
- left: -15%;
67
- }
68
- [dir=rtl] .nut-badge-content,
69
- .nut-rtl .nut-badge-content {
70
- transform: var(--nutui-badge-content-transform, translateY(-50%) translateX(-100%));
71
- }
72
-
73
75
  .nut-tabbar-item {
74
76
  display: flex;
75
77
  flex-direction: column;
@@ -7,7 +7,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
7
7
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
8
8
  import * as React from "react";
9
9
  import classNames from "classnames";
10
- import { Check, Loading, Failure, Tips } from "@nutui/icons-react";
10
+ import { Success, Loading, Failure, Tips } from "@nutui/icons-react";
11
11
  import { render, unmount } from "../../utils/render";
12
12
  import Overlay from "../overlay/index";
13
13
  var classPrefix = 'nut-toast';
@@ -80,25 +80,14 @@ var Notification = /*#__PURE__*/ function(_superClass) {
80
80
  value: function renderIcon() {
81
81
  var icon = this.props.icon;
82
82
  if (typeof icon === 'string') {
83
- var iconNode = null;
84
- switch(icon){
85
- case 'success':
86
- iconNode = /*#__PURE__*/ React.createElement(Check, null);
87
- break;
88
- case 'loading':
89
- iconNode = /*#__PURE__*/ React.createElement(Loading, {
90
- className: "nut-icon-loading"
91
- });
92
- break;
93
- case 'fail':
94
- iconNode = /*#__PURE__*/ React.createElement(Failure, null);
95
- break;
96
- case 'warn':
97
- iconNode = /*#__PURE__*/ React.createElement(Tips, null);
98
- break;
99
- default:
100
- break;
101
- }
83
+ var iconNode = {
84
+ success: /*#__PURE__*/ React.createElement(Success, null),
85
+ fail: /*#__PURE__*/ React.createElement(Failure, null),
86
+ warn: /*#__PURE__*/ React.createElement(Tips, null),
87
+ loading: /*#__PURE__*/ React.createElement(Loading, {
88
+ className: "nut-icon-loading"
89
+ })
90
+ }[icon];
102
91
  return /*#__PURE__*/ React.createElement("p", {
103
92
  className: "".concat(classPrefix, "-icon-wrapper")
104
93
  }, iconNode);
@@ -124,9 +113,9 @@ var Notification = /*#__PURE__*/ function(_superClass) {
124
113
  var _this = this;
125
114
  var _this_props = this.props, id = _this_props.id, icon = _this_props.icon, title = _this_props.title, content = _this_props.content, position = _this_props.position, size = _this_props.size, closeOnOverlayClick = _this_props.closeOnOverlayClick, lockScroll = _this_props.lockScroll, style = _this_props.style, className = _this_props.className, contentClassName = _this_props.contentClassName, contentStyle = _this_props.contentStyle, wordBreak = _this_props.wordBreak;
126
115
  var show = this.state.show;
127
- var classes = classNames(_define_property({
116
+ var classes = classNames({
128
117
  'nut-toast-has-icon': icon
129
- }, "nut-toast-".concat(size), true));
118
+ });
130
119
  return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Overlay, {
131
120
  visible: show,
132
121
  style: style,
@@ -140,12 +129,12 @@ var Notification = /*#__PURE__*/ function(_superClass) {
140
129
  className: "".concat(classPrefix, " ").concat(classes),
141
130
  id: "toast-".concat(id)
142
131
  }, /*#__PURE__*/ React.createElement("div", {
143
- className: "".concat(classPrefix, "-inner ").concat(classPrefix, "-").concat(position, " ").concat(contentClassName, " ").concat(wordBreak),
144
- style: contentStyle
132
+ className: "".concat(classPrefix, "-inner ").concat(classPrefix, "-").concat(position, " ").concat(contentClassName, " ").concat(classPrefix, "-inner-").concat(size, " ").concat(classPrefix, "-inner-").concat(wordBreak),
133
+ style: _object_spread({}, contentStyle)
145
134
  }, this.renderIcon(), title ? /*#__PURE__*/ React.createElement("div", {
146
135
  className: "".concat(classPrefix, "-title")
147
136
  }, title) : null, /*#__PURE__*/ React.createElement("span", {
148
- className: "".concat(classPrefix, "-text")
137
+ className: "".concat(classPrefix, "-text ").concat(content ? '' : "".concat(classPrefix, "-text-empty"))
149
138
  }, content)))));
150
139
  }
151
140
  }