@nutui/nutui-react 2.0.0-alpha.3 → 2.0.0-alpha.5

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 (45) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/Avatar.js +30 -25
  3. package/dist/esm/AvatarGroup.js +10 -15
  4. package/dist/esm/Badge.js +4 -66
  5. package/dist/esm/Checkbox.js +1 -2
  6. package/dist/esm/CheckboxGroup.js +18 -20
  7. package/dist/esm/CircleProgress.js +20 -25
  8. package/dist/esm/Ellipsis.js +13 -12
  9. package/dist/esm/Empty.js +18 -26
  10. package/dist/esm/Input.js +87 -193
  11. package/dist/esm/Skeleton.js +1 -1
  12. package/dist/esm/Swipe.js +4 -10
  13. package/dist/esm/Tabbar/style/index.js +1 -1
  14. package/dist/esm/Tabbar.js +29 -33
  15. package/dist/esm/TabbarItem.js +5 -75
  16. package/dist/esm/badge2.js +69 -0
  17. package/dist/esm/cellgroup2.js +5 -4
  18. package/dist/esm/checkbox2.js +34 -47
  19. package/dist/esm/tabbaritem2.js +61 -0
  20. package/dist/locales/base.js +1 -1
  21. package/dist/locales/en-US.js +1 -1
  22. package/dist/locales/id-ID.js +1 -1
  23. package/dist/locales/zh-CN.js +1 -1
  24. package/dist/locales/zh-TW.js +1 -1
  25. package/dist/locales/zh-UG.js +1 -1
  26. package/dist/nutui.react.mjs +846 -997
  27. package/dist/nutui.react.umd.js +846 -997
  28. package/dist/packages/badge/badge.scss +0 -1
  29. package/dist/packages/cellgroup/cellgroup.scss +20 -16
  30. package/dist/packages/checkbox/checkbox.scss +8 -11
  31. package/dist/packages/circleprogress/circleprogress.scss +0 -9
  32. package/dist/packages/empty/empty.scss +0 -9
  33. package/dist/packages/input/input.scss +13 -180
  34. package/dist/packages/tabbar/tabbar.scss +16 -22
  35. package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
  36. package/dist/style.css +1 -1
  37. package/dist/style.mjs +1 -1
  38. package/dist/styles/themes/default.scss +0 -1
  39. package/dist/styles/variables-jmapp.scss +12 -16
  40. package/dist/styles/variables.scss +12 -16
  41. package/dist/types/index.d.ts +80 -126
  42. package/package.json +1 -1
  43. package/dist/esm/Icon.js +0 -83
  44. package/dist/packages/icon/icon.scss +0 -0
  45. /package/dist/esm/{AvatarContext.js → context.js} +0 -0
@@ -1,7 +1,6 @@
1
1
  .nut-badge {
2
2
  position: relative;
3
3
  display: inline-block;
4
- margin-right: 40px;
5
4
 
6
5
  &__icon {
7
6
  display: flex;
@@ -27,25 +27,29 @@
27
27
  overflow: hidden;
28
28
  background-color: $cell-group-background-color;
29
29
  margin: 10px 0;
30
+ .nut-cell {
31
+ margin: 0;
32
+ box-shadow: none;
33
+ border-radius: 0;
34
+ }
30
35
  }
31
36
 
32
- .nut-cell {
33
- margin: 0;
34
- box-shadow: none;
35
- border-radius: 0;
36
- &__divider {
37
- position: absolute;
38
- box-sizing: border-box;
39
- pointer-events: none;
40
- right: $cell-divider-right;
41
- bottom: 0;
42
- left: $cell-divider-left;
43
- transform: scaleY(0.5);
44
- border-bottom: $cell-divider-border-bottom;
45
- }
46
- &:last-child {
37
+ &__wrap--divider {
38
+ .nut-cell {
47
39
  &__divider {
48
- border: 0 !important;
40
+ position: absolute;
41
+ box-sizing: border-box;
42
+ pointer-events: none;
43
+ right: $cell-divider-right;
44
+ bottom: 0;
45
+ left: $cell-divider-left;
46
+ transform: scaleY(0.5);
47
+ border-top: $cell-divider-border-bottom;
48
+ }
49
+ &:last-child {
50
+ .nut-cell__divider {
51
+ border-top: 0 !important;
52
+ }
49
53
  }
50
54
  }
51
55
  }
@@ -1,47 +1,44 @@
1
1
 
2
- .nut-theme-dark {
3
- .nut-checkbox {
4
- &__label {
5
- color: $dark1;
6
- &--disabled {
7
- color: $checkbox-label-disable-color;
8
- }
9
- }
10
- }
11
- }
12
-
13
2
  .nut-checkbox {
14
3
  display: flex;
15
4
  align-items: center;
5
+
16
6
  &--reverse {
17
7
  flex-direction: row-reverse;
8
+
18
9
  .nut-checkbox__label {
19
10
  margin-right: $checkbox-label-margin-left;
20
11
  margin-left: 0;
21
12
  }
22
13
  }
14
+
23
15
  &__label {
24
16
  margin-left: $checkbox-label-margin-left;
25
17
  font-size: $checkbox-label-font-size;
26
18
  color: $checkbox-label-color;
19
+
27
20
  &--disabled {
28
21
  color: $checkbox-label-disable-color;
29
22
  }
30
23
  }
24
+
31
25
  &__icon {
32
26
  color: $primary-color;
33
27
  font-size: $checkbox-icon-font-size;
34
28
  transition-duration: 0.3s;
35
29
  transition-property: color, border-color, background-color;
36
30
  }
31
+
37
32
  &__icon--unchecked {
38
33
  color: $checkbox-icon-disable-color;
39
34
  font-size: $checkbox-icon-font-size;
40
35
  }
36
+
41
37
  &__icon--indeterminate {
42
38
  color: $primary-color;
43
39
  font-size: $checkbox-icon-font-size;
44
40
  }
41
+
45
42
  &__icon--disable {
46
43
  color: $disable-color;
47
44
  font-size: $checkbox-icon-font-size;
@@ -1,12 +1,3 @@
1
- .nut-theme-dark {
2
- .nut-circleprogress-text {
3
- color: $dark1;
4
- }
5
- }
6
-
7
- .demo-circleprogress {
8
- min-height: 100vh;
9
- }
10
1
  .nut-circleprogress {
11
2
  position: relative;
12
3
 
@@ -1,12 +1,3 @@
1
- .nut-theme-dark {
2
- .nut-empty {
3
- background: $dark6;
4
- &__description {
5
- color: $dark1;
6
- }
7
- }
8
- }
9
-
10
1
  .nut-empty {
11
2
  box-sizing: border-box;
12
3
  display: flex;
@@ -1,196 +1,34 @@
1
- .nut-theme-dark {
2
- .nut-input {
3
- background: $dark4;
4
- &-label {
5
- color: $dark1;
6
- .label-string {
7
- color: $dark1;
8
- }
9
- }
10
- .input-text,
11
- &__text--readonly {
12
- color: $dark1;
13
- }
14
- &-left-icon,
15
- &-right-icon {
16
- i {
17
- color: $dark1;
18
- }
19
- }
20
- &-inner {
21
- .nut-input-clear {
22
- color: $dark1;
23
- }
24
- }
25
- }
26
- }
27
- input,
28
- textarea {
29
- font: inherit;
30
- }
31
-
32
1
  .nut-input {
33
2
  position: relative;
3
+ display: flex;
4
+ align-items: center;
5
+ flex: 1;
34
6
  width: 100%;
35
7
  padding: $input-padding;
36
- display: flex;
37
8
  line-height: 24px;
38
9
  background: $white;
39
10
  font-size: $input-font-size;
40
11
  box-sizing: border-box;
41
- &.center {
42
- align-items: center;
43
- }
44
- &.nut-input-border {
45
- border-bottom: 1px solid $input-border-bottom;
12
+ border-bottom: $input-border-bottom-width solid $input-border-bottom;
13
+
14
+ .nut-icon {
15
+ color: #c8c9cc;
46
16
  }
47
- input {
48
- width: 230px;
17
+
18
+ .nut-input-native {
19
+ width: 100%;
49
20
  color: $gray1;
50
21
  flex: 1;
51
- padding: 0 10px;
52
- padding-right: 35px;
53
- outline: 0 none;
54
- border: 0;
55
- text-decoration: none;
56
- }
57
- .label-string {
58
- color: $gray1;
59
- }
60
- &__clear {
61
- width: 16px;
62
- height: 16px;
63
- position: absolute;
64
- right: 15px;
65
- }
66
- &__disabled {
67
- color: $input-disabled-color !important;
68
- input:disabled {
69
- background: none;
70
- color: $input-disabled-color;
71
- cursor: not-allowed;
72
- opacity: 1;
73
- -webkit-text-fill-color: $input-disabled-color;
74
- }
75
- }
76
- &__require {
77
- color: $primary-color;
78
- display: inline-block;
79
- margin-right: 5px;
80
- }
81
-
82
- .input-text,
83
- &__text--readonly {
84
- width: 90%;
85
22
  padding: 0;
86
- line-height: inherit;
87
- text-align: left;
88
- outline: 0 none;
89
23
  border: 0;
24
+ outline: 0 none;
25
+ font: inherit;
90
26
  text-decoration: none;
91
- background: transparent;
92
- resize: none;
93
- color: $gray1;
94
- }
95
-
96
- &-label {
97
- width: 80px;
98
- overflow: hidden;
99
- margin-right: 6px;
100
- text-align: left;
101
- }
102
- &-value {
103
- flex: 1;
104
- vertical-align: middle;
105
27
  }
106
- &-right-mark {
107
- .nut-input-main-con {
108
- display: flex;
109
- align-items: center;
110
- justify-content: space-between;
111
- }
112
28
 
113
- .nut-input-inner {
114
- flex: 1;
115
- }
116
- .nut-input-button,
117
- .nut-input-right-icon {
118
- width: auto;
119
- }
120
- }
121
- &-inner {
122
- position: relative;
123
- display: flex;
124
- align-items: center;
125
- }
126
- &-box {
127
- position: relative;
128
- width: 100%;
129
- }
130
- &-disabled-mask {
131
- position: absolute;
132
- width: 100%;
133
- height: 100%;
134
- top: 0;
135
- left: 0;
136
- z-index: 2;
137
- }
138
- &-error-message {
139
- color: $input-required-color;
140
- font-size: 12px;
141
- }
142
- &-word-limit {
143
- display: flex;
144
- justify-content: flex-end;
145
- margin-top: 4px;
146
- color: #808080;
147
- font-size: 12px;
148
- }
149
- &-left-icon,
150
- &-right-icon {
151
- display: flex;
152
- align-items: center;
153
- font-size: 0;
154
- i {
155
- color: $gray1;
156
- }
157
- }
158
- &-clear,
159
- &-right-icon {
160
- margin-left: 4px;
161
- }
162
- &-left-icon {
163
- margin-right: 4px;
164
- }
165
- &-clear-box {
166
- height: 100%;
167
- .nut-input-clear {
168
- vertical-align: -2px;
169
- }
170
- }
171
- &-clear-wrap {
172
- width: 16px;
173
- height: 16px;
174
- }
175
- &-clear {
176
- width: 16px;
177
- height: 16px;
178
- color: #c8c9cc;
179
- cursor: pointer;
180
- }
181
- .nut-button {
182
- margin-left: 10px;
183
- }
184
- &.nut-input-required {
185
- &::before {
186
- position: absolute;
187
- left: 14px;
188
- color: $input-required-color;
189
- content: '*';
190
- }
191
- }
192
29
  &-disabled {
193
30
  color: $input-disabled-color !important;
31
+
194
32
  input:disabled {
195
33
  background: none;
196
34
  color: $input-disabled-color;
@@ -199,9 +37,4 @@ textarea {
199
37
  -webkit-text-fill-color: $input-disabled-color;
200
38
  }
201
39
  }
202
- &-error,
203
- &-error::placeholder {
204
- color: $input-required-color;
205
- -webkit-text-fill-color: $input-required-color;
206
- }
207
40
  }
@@ -1,46 +1,40 @@
1
- .nut-theme-dark {
2
- .nut-tabbar {
3
- background: $dark4;
4
- }
5
- }
6
1
 
7
2
  .nut-tabbar {
8
3
  border: 0px;
9
4
  box-shadow: $tabbar-box-shadow;
10
5
  border-bottom: $tabbar-border-bottom;
11
6
  border-top: $tabbar-border-top;
12
- height: $tabbar-height;
13
7
  width: 100%;
14
8
  display: flex;
9
+ flex-direction: column;
15
10
  justify-content: center;
16
11
  align-items: center;
17
12
  box-sizing: border-box;
18
13
  background: $white;
19
14
 
15
+ &__wrap {
16
+ width: 100%;
17
+ height: $tabbar-height;
18
+ display: flex;
19
+ flex-direction: row;
20
+ justify-content: center;
21
+ align-items: center;
22
+ }
23
+
20
24
  &:last-child {
21
25
  border-right: 0;
22
26
  }
23
27
 
24
- &__bottom {
28
+ &__fixed {
25
29
  position: fixed;
26
30
  bottom: 0px;
27
31
  left: 0px;
28
- z-index: 888;
29
32
  }
30
33
 
31
- &__safebottom {
32
- bottom: constant(safe-area-inset-bottom);
33
- bottom: env(safe-area-inset-bottom);
34
-
35
- &::after {
36
- content: '';
37
- z-index: 90;
38
- position: fixed;
39
- left: 0;
40
- bottom: 0;
41
- height: env(safe-area-inset-bottom);
42
- width: 100%;
43
- background-color: #fff;
44
- }
34
+ &__safe-area {
35
+ display: block;
36
+ width: 100%;
37
+ padding-bottom: constant(safe-area-inset-bottom);
38
+ padding-bottom: env(safe-area-inset-bottom);
45
39
  }
46
40
  }
@@ -1,13 +1,3 @@
1
- .nut-theme-dark {
2
- .nut-tabbar-item {
3
- color: $dark1;
4
-
5
- &--active {
6
- color: $primary-color;
7
- }
8
- }
9
- }
10
-
11
1
  .nut-tabbar-item {
12
2
  display: flex;
13
3
  flex-direction: column;
@@ -16,11 +6,11 @@
16
6
  flex: 1;
17
7
  text-align: center;
18
8
  text-decoration: none;
19
- color: $gray1;
9
+ color: $tabbar-inactive-color;
20
10
  height: 100%;
21
11
 
22
- &--active {
23
- color: $primary-color;
12
+ &-active {
13
+ color: $tabbar-active-color;
24
14
  }
25
15
 
26
16
  &__icon-box {
@@ -30,67 +20,16 @@
30
20
  align-items: center;
31
21
  position: relative;
32
22
 
33
- &__tips {
34
- position: absolute;
35
- background: $tabbar-active-color;
36
- border: 1px solid $white;
37
- border-radius: 7px;
38
- text-align: center;
39
- top: calc(50% - 6px);
40
- right: calc(50% - 16px);
41
- box-shadow: 0 0 0 1px $white;
42
- font-size: $font-size-1;
43
- color: $primary-text-color;
44
- z-index: 1;
45
- }
46
-
47
- &__dot {
48
- position: absolute;
49
- width: 7px;
50
- height: 7px;
51
- border: 0;
52
- border-radius: 7px;
53
- padding: 0px;
54
- background: $tabbar-active-color;
55
- top: $tabbar-dot-top;
56
- right: calc(50% - $tabbar-dot-right);
57
- transform: translate(50%, -50%);
58
- }
59
-
60
- &__num {
61
- line-height: 1;
62
- font-size: $tabbar-item-text-font-size;
63
- color: $primary-text-color;
64
- padding: 1px 2px 2px 3px;
65
- top: calc(-50% + 6px);
66
- right: calc(-50%);
67
- }
68
-
69
- &__nums {
70
- line-height: 1;
71
- font-size: $tabbar-item-text-font-size;
72
- color: $primary-text-color;
73
- padding: 2px 1px 2px 2px;
74
- top: calc(-50% + 6px);
75
- right: calc(-50% - 8px);
76
- }
77
-
78
- &__icon {
79
- display: block;
80
- background-size: 100% 100%;
81
- background-position: center center;
82
- }
83
-
84
- &--nav-word {
23
+ &-nav {
85
24
  display: block;
86
- font-size: $font-size-0;
87
- margin-top: $tabbar-word-margin-top;
25
+ font-size: $tabbar-text-font-size;
26
+ margin-top: $tabbar-text-margin-top;
88
27
  }
89
28
 
90
- &--big-word {
91
- font-size: $font-size-large;
29
+ &-large {
30
+ font-size: $tabbar-text-large-font-size;
92
31
  margin-top: 0;
93
- line-height: $tabbar-item-text-line-height;
32
+ line-height: $tabbar-text-line-height;
94
33
  }
95
34
  }
96
35
  }