@nutui/nutui-react 2.0.0-alpha.2 → 2.0.0-alpha.4

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 (44) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/esm/Badge.js +4 -66
  3. package/dist/esm/CalendarItem.js +2 -12
  4. package/dist/esm/Cascader.js +4 -2
  5. package/dist/esm/CircleProgress.js +20 -25
  6. package/dist/esm/Dialog.js +162 -171
  7. package/dist/esm/Input.js +87 -193
  8. package/dist/esm/Popup.js +2 -4
  9. package/dist/esm/Switch.js +16 -30
  10. package/dist/esm/TabPane.js +0 -2
  11. package/dist/esm/Tabbar.js +29 -33
  12. package/dist/esm/TabbarItem.js +5 -75
  13. package/dist/esm/Tabs.js +2 -2
  14. package/dist/esm/badge2.js +69 -0
  15. package/dist/esm/nutui-react.es.js +170 -170
  16. package/dist/esm/overlay2.js +12 -14
  17. package/dist/esm/raf.js +16 -0
  18. package/dist/esm/tabbaritem2.js +61 -0
  19. package/dist/esm/tabpane2.js +7 -9
  20. package/dist/esm/tabs2.js +101 -93
  21. package/dist/locales/base.js +1 -1
  22. package/dist/locales/en-US.js +1 -1
  23. package/dist/locales/id-ID.js +1 -1
  24. package/dist/locales/zh-CN.js +1 -1
  25. package/dist/locales/zh-TW.js +1 -1
  26. package/dist/locales/zh-UG.js +1 -1
  27. package/dist/nutui.react.mjs +18569 -19365
  28. package/dist/nutui.react.umd.js +18567 -19363
  29. package/dist/packages/badge/badge.scss +0 -1
  30. package/dist/packages/circleprogress/circleprogress.scss +0 -9
  31. package/dist/packages/dialog/dialog.scss +36 -65
  32. package/dist/packages/input/input.scss +13 -180
  33. package/dist/packages/overlay/overlay.scss +11 -4
  34. package/dist/packages/switch/switch.scss +13 -31
  35. package/dist/packages/tabbar/tabbar.scss +16 -23
  36. package/dist/packages/tabbaritem/tabbaritem.scss +9 -70
  37. package/dist/packages/tabs/tabs.scss +196 -225
  38. package/dist/style.css +1 -1
  39. package/dist/style.mjs +1 -1
  40. package/dist/styles/themes/default.scss +17 -17
  41. package/dist/styles/variables-jmapp.scss +24 -27
  42. package/dist/styles/variables.scss +34 -30
  43. package/dist/types/index.d.ts +366 -423
  44. package/package.json +2 -2
@@ -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;
@@ -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
 
@@ -9,10 +9,25 @@
9
9
  padding: $dialog-padding;
10
10
  box-sizing: border-box;
11
11
 
12
+ &__outer {
13
+ position: fixed;
14
+ max-height: 100%;
15
+ overflow-y: auto;
16
+ background-color: $white;
17
+ transition: transform 0.2s, -webkit-transform 0.2s;
18
+ -webkit-overflow-scrolling: touch;
19
+ top: 50%;
20
+ left: 50%;
21
+ -webkit-transform: translate(-50%, -50%);
22
+ transform: translate(-50%, -50%);
23
+ border-radius: $dialog-outer-bordder-radius;
24
+ z-index: $dialog-outer-z-index;
25
+ animation-duration: 0.3s;
26
+ }
27
+
12
28
  &__header {
13
29
  display: block;
14
30
  text-align: center;
15
- // height: $dialog-header-height;
16
31
  font-size: $font-size-3;
17
32
  color: $title-color;
18
33
  @include oneline-ellipsis();
@@ -30,6 +45,7 @@
30
45
  word-wrap: break-word;
31
46
  word-break: break-all;
32
47
  white-space: pre-wrap;
48
+ text-align: $dialog-content-text-align;
33
49
  }
34
50
 
35
51
  &__footer {
@@ -69,67 +85,22 @@
69
85
  }
70
86
  }
71
87
 
72
- .nut-dialog__mask {
73
- position: fixed;
74
- top: 0;
75
- right: 0;
76
- left: 0;
77
- bottom: 0;
78
- background-color: $dialog-mask-background-color;
79
- z-index: $dialog-mask-z-index;
80
- }
81
-
82
- .nut-dialog__wrap {
83
- position: fixed;
84
- overflow: auto;
85
- top: 0;
86
- right: 0;
87
- bottom: 0;
88
- left: 0;
89
- z-index: $dialog-mask-z-index;
90
- -webkit-overflow-scrolling: touch;
91
- outline: 0;
92
- }
93
-
94
- .nut-dialog__outer {
95
- position: fixed;
96
- max-height: 100%;
97
- overflow-y: auto;
98
- background-color: $white;
99
- -webkit-transition: -webkit-transform 0.2s;
100
- transition: -webkit-transform 0.2s;
101
- transition: transform 0.2s;
102
- transition: transform 0.2s, -webkit-transform 0.2s;
103
- -webkit-overflow-scrolling: touch;
104
- top: 50%;
105
- left: 50%;
106
- -webkit-transform: translate(-50%, -50%);
107
- transform: translate(-50%, -50%);
108
- border-radius: $dialog-outer-bordder-radius;
109
- z-index: $dialog-outer-z-index;
110
- animation-duration: 0.3s;
111
- }
112
-
113
- .fadeDialog-enter,
114
- .fadeDialog-appear {
115
- opacity: 0;
116
- }
117
-
118
- .fadeDialog-enter-active,
119
- .fadeDialog-appear-active {
120
- opacity: 1;
121
- transition: opacity 1s cubic-bezier(0.3, 1.3, 0.3, 1);
122
- }
123
-
124
- .fadeDialog-exit {
125
- opacity: 1;
126
- }
127
-
128
- .fadeDialog-exit-active {
129
- opacity: 0;
130
- transition: opacity 1s cubic-bezier(0.3, 1.3, 0.3, 1);
131
- }
132
-
133
- .nut-overflow-hidden {
134
- overflow: hidden !important;
135
- }
88
+ // .fadeDialog-enter,
89
+ // .fadeDialog-appear {
90
+ // opacity: 0;
91
+ // }
92
+
93
+ // .fadeDialog-enter-active,
94
+ // .fadeDialog-appear-active {
95
+ // opacity: 1;
96
+ // transition: opacity 1s cubic-bezier(0.3, 1.3, 0.3, 1);
97
+ // }
98
+
99
+ // .fadeDialog-exit {
100
+ // opacity: 1;
101
+ // }
102
+
103
+ // .fadeDialog-exit-active {
104
+ // opacity: 0;
105
+ // transition: opacity 1s cubic-bezier(0.3, 1.3, 0.3, 1);
106
+ // }
@@ -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
  }
@@ -6,11 +6,14 @@
6
6
  height: 100%;
7
7
  background: $overlay-bg-color;
8
8
  }
9
+
9
10
  .nut-overflow-hidden {
10
11
  overflow: hidden !important;
11
12
  }
12
- .overlay-fade-enter-active {
13
+
14
+ .nut-overlay-fade-enter-active {
13
15
  animation: nut-fade-in;
16
+
14
17
  .wrapper {
15
18
  .content {
16
19
  background-color: $overlay-content-bg-color;
@@ -18,15 +21,19 @@
18
21
  }
19
22
  }
20
23
  }
21
- .overlay-fade-leave-active {
24
+
25
+ .nut-overlay-fade-leave-active {
22
26
  animation: nut-fade-out;
23
27
  }
24
- .first-render {
28
+
29
+ .nut-overlay-first-render {
25
30
  display: none;
26
31
  }
27
- .hidden-render {
32
+
33
+ .nut-overlay-hidden-render {
28
34
  display: none;
29
35
  }
36
+
30
37
  @keyframes nut-fade-in {
31
38
  0% {
32
39
  opacity: 0;
@@ -1,24 +1,8 @@
1
- .nut-theme-dark {
2
- .nut-switch {
3
- background-color: $dark4;
4
-
5
- &.switch-close {
6
- color: $dark1;
7
- }
8
-
9
- .switch-button {
10
- .close {
11
- color: $dark4;
12
- }
13
- }
14
- }
15
- }
16
-
17
1
  .nut-switch {
18
2
  cursor: pointer;
19
3
  display: flex;
20
4
  align-items: center;
21
- background-color: $primary-color;
5
+ background-color: $switch-active-background-color;
22
6
  border-radius: $switch-border-radius;
23
7
  background-size: 100% 100%;
24
8
  background-repeat: no-repeat;
@@ -26,10 +10,9 @@
26
10
  flex: 0 0 auto; // 防止被压缩
27
11
 
28
12
  &.switch-close {
29
- background-color: $switch-close-bg-color;
30
-
13
+ background-color: $switch-inactive-background-color;
31
14
  .close-line {
32
- background: $switch-close--line-bg-color;
15
+ background: $switch-close-line-background-color;
33
16
  border-radius: 2px;
34
17
  }
35
18
  }
@@ -41,22 +24,21 @@
41
24
  border-radius: 50%;
42
25
  background: $primary-text-color;
43
26
  transition: transform 0.3s;
27
+ }
44
28
 
45
- .nut-switch__label {
46
- color: $primary-text-color;
47
- font-size: $font-size-1;
48
-
49
- &.open {
50
- transform: translateX(-16px);
51
- }
29
+ &__label {
30
+ color: $primary-text-color;
31
+ font-size: $font-size-1;
32
+ &.open {
33
+ transform: translateX(-16px);
34
+ }
52
35
 
53
- &.close {
54
- transform: translateX(16px);
55
- }
36
+ &.close {
37
+ transform: translateX(16px);
56
38
  }
57
39
  }
58
40
 
59
- &-disable {
41
+ &-disabled {
60
42
  opacity: 0.6;
61
43
  }
62
44
 
@@ -1,46 +1,39 @@
1
- .nut-theme-dark {
2
- .nut-tabbar {
3
- background: $dark4;
4
- }
5
- }
6
-
7
1
  .nut-tabbar {
8
2
  border: 0px;
9
3
  box-shadow: $tabbar-box-shadow;
10
4
  border-bottom: $tabbar-border-bottom;
11
5
  border-top: $tabbar-border-top;
12
- height: $tabbar-height;
13
6
  width: 100%;
14
7
  display: flex;
8
+ flex-direction: column;
15
9
  justify-content: center;
16
10
  align-items: center;
17
11
  box-sizing: border-box;
18
12
  background: $white;
19
13
 
14
+ &__wrap {
15
+ width: 100%;
16
+ height: $tabbar-height;
17
+ display: flex;
18
+ flex-direction: row;
19
+ justify-content: center;
20
+ align-items: center;
21
+ }
22
+
20
23
  &:last-child {
21
24
  border-right: 0;
22
25
  }
23
26
 
24
- &__bottom {
27
+ &__fixed {
25
28
  position: fixed;
26
29
  bottom: 0px;
27
30
  left: 0px;
28
- z-index: 888;
29
31
  }
30
32
 
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
- }
33
+ &__safe-area {
34
+ display: block;
35
+ width: 100%;
36
+ padding-bottom: constant(safe-area-inset-bottom);
37
+ padding-bottom: env(safe-area-inset-bottom);
45
38
  }
46
39
  }
@@ -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
  }