@nutui/nutui-react 2.0.0-alpha.1 → 2.0.0-alpha.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 (49) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/esm/Address.js +1 -1
  3. package/dist/esm/Animate.js +6 -7
  4. package/dist/esm/Badge.js +15 -22
  5. package/dist/esm/CalendarItem.js +2 -12
  6. package/dist/esm/Cascader.js +4 -2
  7. package/dist/esm/Dialog.js +162 -171
  8. package/dist/esm/Divider.js +4 -3
  9. package/dist/esm/Drag.js +7 -9
  10. package/dist/esm/Elevator.js +38 -41
  11. package/dist/esm/Menu.js +75 -73
  12. package/dist/esm/MenuItem.js +29 -27
  13. package/dist/esm/NavBar.js +17 -48
  14. package/dist/esm/Popup.js +2 -4
  15. package/dist/esm/Progress.js +20 -68
  16. package/dist/esm/Switch.js +16 -30
  17. package/dist/esm/TabPane.js +0 -2
  18. package/dist/esm/Tabs.js +2 -2
  19. package/dist/esm/Uploader.js +2 -3
  20. package/dist/esm/nutui-react.es.js +170 -170
  21. package/dist/esm/overlay2.js +12 -14
  22. package/dist/esm/raf.js +16 -0
  23. package/dist/esm/tabpane2.js +7 -9
  24. package/dist/esm/tabs2.js +101 -93
  25. package/dist/locales/base.js +1 -1
  26. package/dist/locales/en-US.js +1 -1
  27. package/dist/locales/id-ID.js +1 -1
  28. package/dist/locales/zh-CN.js +1 -1
  29. package/dist/locales/zh-TW.js +1 -1
  30. package/dist/locales/zh-UG.js +1 -1
  31. package/dist/nutui.react.mjs +18642 -19336
  32. package/dist/nutui.react.umd.js +18640 -19334
  33. package/dist/packages/badge/badge.scss +8 -17
  34. package/dist/packages/dialog/dialog.scss +36 -65
  35. package/dist/packages/elevator/elevator.scss +2 -28
  36. package/dist/packages/menu/menu.scss +44 -55
  37. package/dist/packages/menuitem/menuitem.scss +16 -26
  38. package/dist/packages/navbar/navbar.scss +16 -115
  39. package/dist/packages/overlay/overlay.scss +11 -4
  40. package/dist/packages/progress/progress.scss +19 -58
  41. package/dist/packages/switch/switch.scss +13 -31
  42. package/dist/packages/tabs/tabs.scss +196 -225
  43. package/dist/style.css +1 -1
  44. package/dist/style.mjs +1 -1
  45. package/dist/styles/themes/default.scss +17 -17
  46. package/dist/styles/variables-jmapp.scss +35 -125
  47. package/dist/styles/variables.scss +53 -136
  48. package/dist/types/index.d.ts +343 -400
  49. package/package.json +2 -2
@@ -1,18 +1,9 @@
1
- .nut-theme-dark {
2
- .nut-badge {
3
- &.show {
4
- background: $dark4;
5
- color: $dark1;
6
- }
7
- }
8
- }
9
-
10
1
  .nut-badge {
11
2
  position: relative;
12
3
  display: inline-block;
13
4
  margin-right: 40px;
14
5
 
15
- .slot-icon {
6
+ &__icon {
16
7
  display: flex;
17
8
  position: absolute;
18
9
  background: $badge-background-color;
@@ -25,10 +16,10 @@
25
16
  z-index: $badge-z-index;
26
17
  }
27
18
 
28
- .sup {
19
+ &__sup {
29
20
  position: absolute;
30
21
  background: $badge-background-color;
31
- color: $badge-default-background-color;
22
+ color: $badge-color;
32
23
  padding: $badge-padding;
33
24
  font-size: $badge-font-size;
34
25
  font-weight: normal;
@@ -38,15 +29,15 @@
38
29
  border-radius: $badge-border-radius;
39
30
  }
40
31
 
41
- .nut-badge__content {
32
+ &__content {
42
33
  transform: $badge-content-transform;
43
34
  }
44
35
 
45
- .is-dot {
36
+ &__dot {
46
37
  width: $badge-dot-width;
47
- height: $badge-dot-height;
38
+ height: $badge-dot-width;
48
39
  border: $badge-border;
49
- border-radius: $badge-dot-border-radius;
50
- padding: $badge-dot-padding;
40
+ border-radius: $badge-dot-width;
41
+ padding: 0;
51
42
  }
52
43
  }
@@ -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,22 +1,3 @@
1
- .nut-theme-dark {
2
- .nut-elevator {
3
- background-color: $dark6;
4
- &__list {
5
- &__inner {
6
- background-color: $dark6;
7
- }
8
- &__item {
9
- color: $dark1;
10
- &__code {
11
- color: $dark1;
12
- }
13
- }
14
- &__fixed {
15
- background-color: $dark6;
16
- }
17
- }
18
- }
19
- }
20
1
  .nut-elevator {
21
2
  width: 100%;
22
3
  display: block;
@@ -48,15 +29,8 @@
48
29
  padding: $elevator-list-item-code-padding;
49
30
  font-weight: $elevator-list-item-code-font-weight;
50
31
  box-sizing: border-box;
51
- &::after {
52
- content: ' ';
53
- width: $elevator-list-item-code-after-width;
54
- height: $elevator-list-item-code-after-height;
55
- position: absolute;
56
- left: 0;
57
- bottom: 0;
58
- background-color: $elevator-list-item-code-after-bg-color;
59
- }
32
+ border-bottom: $elevator-list-item-code-border-bottom solid
33
+ $elevator-list-item-code-border-bottom-color;
60
34
  }
61
35
  &__name {
62
36
  display: flex;
@@ -1,16 +1,5 @@
1
1
  @import '../../styles/mixins/text-ellipsis.scss';
2
2
 
3
- .nut-theme-dark {
4
- .nut-menu {
5
- .nut-menu__bar {
6
- background-color: $dark6;
7
- .nut-menu__item {
8
- color: $gray6;
9
- }
10
- }
11
- }
12
- }
13
-
14
3
  .nut-menu {
15
4
  &.scroll-fixed {
16
5
  position: fixed;
@@ -18,58 +7,58 @@
18
7
  z-index: $menu-scroll-fixed-z-index;
19
8
  width: 100%;
20
9
  }
10
+ }
21
11
 
22
- .nut-menu-relative {
23
- position: relative;
24
- }
25
-
26
- .nut-menu__bar {
27
- position: relative;
28
- display: flex;
29
- line-height: $menu-bar-line-height;
30
- background-color: $white;
31
- box-shadow: $menu-bar-box-shadow;
12
+ .nut-menu-relative {
13
+ position: relative;
14
+ }
32
15
 
33
- &.opened {
34
- z-index: $menu-bar-opened-z-index;
35
- }
16
+ .nut-menu__bar {
17
+ position: relative;
18
+ display: flex;
19
+ line-height: $menu-bar-line-height;
20
+ background-color: $white;
21
+ box-shadow: $menu-bar-box-shadow;
36
22
 
37
- .nut-menu__item {
38
- flex: 1;
39
- text-align: center;
40
- font-size: $menu-item-font-size;
41
- color: $menu-item-text-color;
42
- min-width: 0;
23
+ &.opened {
24
+ z-index: $menu-bar-opened-z-index;
25
+ }
26
+ }
43
27
 
44
- &.active {
45
- color: $menu-item-active-text-color;
46
- }
28
+ .nut-menu__item {
29
+ flex: 1;
30
+ text-align: center;
31
+ font-size: $menu-item-font-size;
32
+ color: $menu-item-text-color;
33
+ min-width: 0;
47
34
 
48
- &.disabled {
49
- color: $menu-item-disabled-color;
50
- }
35
+ &.active {
36
+ color: $menu-item-active-text-color;
37
+ }
51
38
 
52
- .nut-menu__title-icon {
53
- transition: all 0.2s linear;
54
- }
39
+ &.disabled {
40
+ color: $menu-item-disabled-color;
41
+ }
42
+ }
55
43
 
56
- .nut-menu__title {
57
- display: flex;
58
- align-items: center;
59
- justify-content: center;
60
- max-width: 100%;
44
+ .nut-menu__title-icon {
45
+ transition: all 0.2s linear;
46
+ }
61
47
 
62
- .nut-menu__title-text {
63
- @include text-ellipsis;
64
- display: block;
65
- padding-left: $menu-title-text-padding-left;
66
- padding-right: $menu-title-text-padding-right;
67
- }
48
+ .nut-menu__title {
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ max-width: 100%;
68
53
 
69
- &.active .nut-menu__title-icon {
70
- transform: rotate(180deg);
71
- }
72
- }
73
- }
54
+ &.active .nut-menu__title-icon {
55
+ transform: rotate(180deg);
74
56
  }
75
57
  }
58
+
59
+ .nut-menu__title-text {
60
+ @include text-ellipsis;
61
+ display: block;
62
+ padding-left: $menu-title-text-padding-left;
63
+ padding-right: $menu-title-text-padding-right;
64
+ }
@@ -1,14 +1,4 @@
1
1
 
2
- .nut-theme-dark {
3
- .nut-menu-item__content {
4
- background: $dark6;
5
-
6
- .nut-menu-item__option {
7
- color: $dark1;
8
- }
9
- }
10
- }
11
-
12
2
  .nut-menu-item__content {
13
3
  padding: $menu-item-content-padding;
14
4
  max-height: $menu-item-content-max-height;
@@ -22,25 +12,25 @@
22
12
  opacity: 0;
23
13
  position: fixed;
24
14
  }
15
+ }
25
16
 
26
- .nut-menu-item__option {
27
- color: $title-color;
28
- font-size: $font-size-2;
29
- padding-top: $menu-item-option-padding-top;
30
- padding-bottom: $menu-item-option-padding-bottom;
31
- display: flex;
32
- align-items: center;
17
+ .nut-menu-item__option {
18
+ color: $title-color;
19
+ font-size: $font-size-2;
20
+ padding-top: $menu-item-option-padding-top;
21
+ padding-bottom: $menu-item-option-padding-bottom;
22
+ display: flex;
23
+ align-items: center;
33
24
 
34
- &.active {
35
- font-weight: 500;
36
- color: $menu-item-active-text-color;
37
- }
25
+ &.active {
26
+ font-weight: 500;
27
+ color: $menu-item-active-text-color;
28
+ }
38
29
 
39
- i {
40
- margin-right: $menu-item-option-i-margin-right;
41
- display: inline-flex;
42
- align-items: center;
43
- }
30
+ i {
31
+ margin-right: $menu-item-option-i-margin-right;
32
+ display: inline-flex;
33
+ align-items: center;
44
34
  }
45
35
  }
46
36
 
@@ -1,36 +1,3 @@
1
- .nut-theme-dark {
2
- .nut-navbar {
3
- background: $dark5;
4
- color: $dark1;
5
- box-shadow: none;
6
-
7
- .title {
8
- color: $dark1;
9
- }
10
-
11
- &__left {
12
- color: $dark2;
13
-
14
- i {
15
- color: $dark2 !important;
16
- }
17
- }
18
-
19
- &__right {
20
- color: $dark1;
21
- }
22
-
23
- &--border {
24
- border-bottom: none;
25
- }
26
- }
27
-
28
- .nut-tabs__titles-item__text {
29
- background: $dark5;
30
- color: $dark1;
31
- }
32
- }
33
-
34
1
  .nut-navbar {
35
2
  width: $navbar-width;
36
3
  position: relative;
@@ -41,19 +8,11 @@
41
8
  padding: $navbar-padding;
42
9
  background: $navbar-background;
43
10
  box-shadow: $navbar-box-shadow;
44
- font-size: $navbar-title-base-font;
11
+ font-size: $navbar-font-size;
45
12
  color: $navbar-color;
46
13
  margin-bottom: $navbar-margin-bottom;
47
14
  overflow: hidden;
48
15
 
49
- &:active::before {
50
- opacity: 0.1;
51
- }
52
-
53
- &--border {
54
- border-bottom: 1px solid #eee;
55
- }
56
-
57
16
  &--fixed {
58
17
  position: fixed;
59
18
  top: 0;
@@ -71,29 +30,6 @@
71
30
  padding-top: env(safe-area-inset-top);
72
31
  }
73
32
 
74
- &--clickable {
75
- &::before {
76
- position: absolute;
77
- content: ' ';
78
- top: 50%;
79
- left: 50%;
80
- width: 100%;
81
- height: 100%;
82
- background-color: $black;
83
- border: inherit;
84
- border-color: $black;
85
- border-radius: inherit;
86
- transform: translate(-50%, -50%);
87
- opacity: 0;
88
- }
89
- }
90
-
91
- .nutui-iconfont {
92
- .nut-icon-left {
93
- text-align: left;
94
- }
95
- }
96
-
97
33
  &__title {
98
34
  min-width: 53%;
99
35
  margin: 0 auto;
@@ -101,35 +37,9 @@
101
37
  display: flex;
102
38
  align-items: center;
103
39
  justify-content: center;
104
-
105
- .title {
106
- min-width: $navbar-title-width;
107
- font-size: $navbar-title-font;
108
- font-weight: $navbar-title-font-weight;
109
- color: $navbar-title-font-color;
110
- display: -webkit-box;
111
- -webkit-box-orient: vertical;
112
- -webkit-line-clamp: 1;
113
- overflow: hidden;
114
- }
115
-
116
- &.icon {
117
- .icon {
118
- margin: $navbar-title-icon-margin;
119
- }
120
- }
121
-
122
- .nut-icon {
123
- display: inline;
124
- }
125
-
126
- &-description {
127
- font-size: $cell-description-font-size;
128
- }
129
-
130
- .text__title {
131
- display: inline-block;
132
- }
40
+ font-size: $navbar-title-font-size;
41
+ font-weight: $navbar-title-font-weight;
42
+ color: $navbar-title-font-color;
133
43
 
134
44
  .nut-tabs__titles {
135
45
  background: $white;
@@ -148,11 +58,9 @@
148
58
  display: none;
149
59
  }
150
60
 
151
- &__left {
152
- font-size: $cell-extra-font-size;
153
- color: $gray2;
61
+ &__left,
62
+ &__right {
154
63
  position: absolute;
155
- left: 0;
156
64
  top: 0;
157
65
  bottom: 0;
158
66
  display: flex;
@@ -161,24 +69,17 @@
161
69
  padding: 0 16px;
162
70
  }
163
71
 
164
- &__right {
165
- font-size: $cell-extra-font-size;
166
- color: $gray2;
167
- position: absolute;
168
- right: 0;
169
- top: 0;
170
- bottom: 0;
171
- display: flex;
172
- align-items: center;
173
- padding: 0 16px;
174
- cursor: pointer;
175
-
176
- .rightIcon {
177
- margin-left: 16px;
72
+ &__left {
73
+ left: 0;
74
+ &__back {
75
+ display: flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ margin-right: 10px;
178
79
  }
80
+ }
179
81
 
180
- .leftIcon {
181
- margin-left: 16px;
182
- }
82
+ &__right {
83
+ right: 0;
183
84
  }
184
85
  }
@@ -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,30 +1,14 @@
1
- .nut-theme-dark {
2
- .nut-progress {
3
- &-text {
4
- .nut-icon-checked {
5
- color: rgba(38, 191, 38, 1) !important;
6
- }
7
- }
8
- }
9
- }
10
-
11
1
  .nut-progress {
12
2
  display: flex;
13
3
  align-items: center;
14
4
  position: relative;
15
5
  width: 100%;
16
6
 
17
- .nut-progress-text {
18
- color: $progress-text-color;
19
- }
20
-
21
7
  &-outer {
22
8
  flex: auto;
23
9
  border-radius: $progress-border-radius;
24
-
25
- .nut-progress-text {
26
- color: $progress-text-inner-color;
27
- }
10
+ height: $progress-height;
11
+ background: $progress-background;
28
12
 
29
13
  .nut-progress-active:before {
30
14
  content: '';
@@ -38,33 +22,6 @@
38
22
  }
39
23
  }
40
24
 
41
- &-small {
42
- height: $progress-small-height;
43
-
44
- .nut-progress-text {
45
- font-size: $progress-small-font-size;
46
- padding: $progress-small-padding;
47
- }
48
- }
49
-
50
- &-base {
51
- height: $progress-base-height;
52
-
53
- .nut-progress-text {
54
- font-size: $progress-base-font-size;
55
- padding: $progress-base-padding;
56
- }
57
- }
58
-
59
- &-large {
60
- height: $progress-large-height;
61
-
62
- .nut-progress-text {
63
- font-size: $progress-large-font-size;
64
- padding: $progress-large-padding;
65
- }
66
- }
67
-
68
25
  &-inner {
69
26
  height: 100%;
70
27
  display: flex;
@@ -72,26 +29,30 @@
72
29
  justify-content: center;
73
30
  transition: all 0.4s;
74
31
  border-radius: $progress-border-radius;
32
+ background: $progress-color;
75
33
  }
76
34
 
77
35
  &-text {
78
- display: flex;
79
- padding: $progress-text-padding;
80
- font-size: $progress-text-font-size;
81
- line-height: 1;
82
- min-width: 35px;
83
- }
84
-
85
- &-insidetext {
86
- position: absolute;
87
- top: $progress-insidetext-position-top;
88
- bottom: $progress-insidetext-position-bottom;
89
36
  display: flex;
90
37
  align-items: center;
91
- min-width: 0px;
38
+ position: absolute;
39
+ top: $progress-text-position-top;
40
+ bottom: $progress-text-position-bottom;
92
41
  transition: all 0.4s;
93
42
  transform: translate(-50%);
94
- border-radius: $progress-insidetext-border-radius;
43
+
44
+ &__inner {
45
+ display: flex;
46
+ align-items: center;
47
+ height: 100%;
48
+ width: 100%;
49
+ color: $progress-text-color;
50
+ padding: $progress-text-padding;
51
+ border-radius: $progress-text-border-radius;
52
+ font-size: $progress-text-font-size;
53
+ line-height: 1;
54
+ background: $progress-text-background;
55
+ }
95
56
  }
96
57
 
97
58
  @keyframes progressActive {