@nutui/nutui-react 3.0.0-beta.3 → 3.0.0-beta.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 (123) hide show
  1. package/dist/cjs/packages/address/style/style.css +1 -1
  2. package/dist/cjs/packages/animatingnumbers/countup.js +7 -6
  3. package/dist/cjs/packages/animatingnumbers/style/style.css +10 -4
  4. package/dist/cjs/packages/audio/style/style.css +49 -34
  5. package/dist/cjs/packages/button/style/button.scss +36 -19
  6. package/dist/cjs/packages/button/style/style.css +49 -34
  7. package/dist/cjs/packages/calendar/style/style.css +1 -1
  8. package/dist/cjs/packages/card/style/card.scss +3 -18
  9. package/dist/cjs/packages/card/style/style.css +4 -13
  10. package/dist/cjs/packages/checkbox/checkbox.d.ts +1 -4
  11. package/dist/cjs/packages/checkbox/checkbox.js +0 -2
  12. package/dist/cjs/packages/checkbox/index.d.ts +7 -2
  13. package/dist/cjs/packages/checkbox/index.js +4 -1
  14. package/dist/cjs/packages/checkbox/style/style.css +10 -0
  15. package/dist/cjs/packages/checkboxgroup/style/checkboxgroup.scss +8 -0
  16. package/dist/cjs/packages/checkboxgroup/style/style.css +10 -0
  17. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  18. package/dist/cjs/packages/countdown/countdown.d.ts +2 -20
  19. package/dist/cjs/packages/countdown/countdown.js +3 -2
  20. package/dist/cjs/packages/countdown/index.d.ts +1 -1
  21. package/dist/cjs/packages/countdown/style/countdown.scss +8 -2
  22. package/dist/cjs/packages/countdown/style/style.css +18 -13
  23. package/dist/cjs/packages/countdown/types.d.ts +26 -0
  24. package/dist/cjs/packages/countdown/types.js +4 -0
  25. package/dist/cjs/packages/countup/style/countup.scss +10 -4
  26. package/dist/cjs/packages/countup/style/style.css +10 -4
  27. package/dist/cjs/packages/dialog/style/dialog.scss +10 -7
  28. package/dist/cjs/packages/dialog/style/style.css +58 -41
  29. package/dist/cjs/packages/grid/grid.js +2 -6
  30. package/dist/cjs/packages/grid/style/grid.scss +2 -2
  31. package/dist/cjs/packages/grid/style/style.css +8 -6
  32. package/dist/cjs/packages/griditem/griditem.js +12 -6
  33. package/dist/cjs/packages/griditem/style/griditem.scss +6 -4
  34. package/dist/cjs/packages/griditem/style/style.css +6 -4
  35. package/dist/cjs/packages/imagepreview/style/imagepreview.scss +4 -0
  36. package/dist/cjs/packages/imagepreview/style/style.css +3 -0
  37. package/dist/cjs/packages/progress/progress.js +1 -1
  38. package/dist/cjs/packages/progress/style/progress.scss +2 -2
  39. package/dist/cjs/packages/progress/style/style.css +3 -2
  40. package/dist/cjs/packages/rate/style/rate.scss +10 -5
  41. package/dist/cjs/packages/rate/style/style.css +7 -5
  42. package/dist/cjs/packages/resultpage/resultpage.js +23 -17
  43. package/dist/cjs/packages/resultpage/style/resultpage.scss +5 -3
  44. package/dist/cjs/packages/resultpage/style/style.css +10 -8
  45. package/dist/cjs/packages/resultpage/types.d.ts +1 -1
  46. package/dist/cjs/packages/tabbar/style/style.css +10 -0
  47. package/dist/cjs/packages/tabbaritem/style/style.css +10 -0
  48. package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +10 -0
  49. package/dist/cjs/packages/tag/style/style.css +1 -0
  50. package/dist/cjs/packages/tag/style/tag.scss +1 -0
  51. package/dist/cjs/packages/toast/style/index.js +1 -0
  52. package/dist/cjs/packages/toast/style/style.css +60 -0
  53. package/dist/cjs/packages/uploader/style/style.css +3 -2
  54. package/dist/cjs/utils/add-color-for-harmony.d.ts +9 -0
  55. package/dist/cjs/utils/add-color-for-harmony.js +27 -0
  56. package/dist/es/packages/address/style/style.css +1 -1
  57. package/dist/es/packages/animatingnumbers/countup.js +7 -6
  58. package/dist/es/packages/animatingnumbers/style/style.css +10 -4
  59. package/dist/es/packages/audio/style/style.css +49 -34
  60. package/dist/es/packages/button/style/button.scss +36 -19
  61. package/dist/es/packages/button/style/style.css +49 -34
  62. package/dist/es/packages/calendar/style/style.css +1 -1
  63. package/dist/es/packages/card/card.d.ts +11 -55
  64. package/dist/es/packages/card/style/card.scss +3 -18
  65. package/dist/es/packages/card/style/style.css +4 -13
  66. package/dist/es/packages/checkbox/checkbox.d.ts +1 -4
  67. package/dist/es/packages/checkbox/checkbox.js +1 -3
  68. package/dist/es/packages/checkbox/index.d.ts +7 -2
  69. package/dist/es/packages/checkbox/index.js +4 -1
  70. package/dist/es/packages/checkbox/style/style.css +10 -0
  71. package/dist/es/packages/checkboxgroup/checkboxgroup.d.ts +10 -50
  72. package/dist/es/packages/checkboxgroup/style/checkboxgroup.scss +8 -0
  73. package/dist/es/packages/checkboxgroup/style/style.css +10 -0
  74. package/dist/es/packages/configprovider/types.d.ts +1 -1
  75. package/dist/es/packages/countdown/countdown.d.ts +2 -20
  76. package/dist/es/packages/countdown/countdown.js +3 -2
  77. package/dist/es/packages/countdown/index.d.ts +1 -1
  78. package/dist/es/packages/countdown/style/countdown.scss +8 -2
  79. package/dist/es/packages/countdown/style/style.css +18 -13
  80. package/dist/es/packages/countdown/types.d.ts +26 -0
  81. package/dist/es/packages/countdown/types.js +1 -0
  82. package/dist/es/packages/countup/style/countup.scss +10 -4
  83. package/dist/es/packages/countup/style/style.css +10 -4
  84. package/dist/es/packages/dialog/style/dialog.scss +10 -7
  85. package/dist/es/packages/dialog/style/style.css +58 -41
  86. package/dist/es/packages/ellipsis/ellipsis.d.ts +1 -1
  87. package/dist/es/packages/grid/grid.js +2 -6
  88. package/dist/es/packages/grid/style/grid.scss +2 -2
  89. package/dist/es/packages/grid/style/style.css +8 -6
  90. package/dist/es/packages/griditem/griditem.js +12 -6
  91. package/dist/es/packages/griditem/style/griditem.scss +6 -4
  92. package/dist/es/packages/griditem/style/style.css +6 -4
  93. package/dist/es/packages/imagepreview/imagepreview.d.ts +14 -70
  94. package/dist/es/packages/imagepreview/style/imagepreview.scss +4 -0
  95. package/dist/es/packages/imagepreview/style/style.css +3 -0
  96. package/dist/es/packages/progress/progress.js +1 -1
  97. package/dist/es/packages/progress/style/progress.scss +2 -2
  98. package/dist/es/packages/progress/style/style.css +3 -2
  99. package/dist/es/packages/rate/rate.d.ts +12 -60
  100. package/dist/es/packages/rate/style/rate.scss +10 -5
  101. package/dist/es/packages/rate/style/style.css +7 -5
  102. package/dist/es/packages/resultpage/resultpage.js +23 -16
  103. package/dist/es/packages/resultpage/style/resultpage.scss +5 -3
  104. package/dist/es/packages/resultpage/style/style.css +10 -8
  105. package/dist/es/packages/resultpage/types.d.ts +1 -1
  106. package/dist/es/packages/tabbar/style/style.css +10 -0
  107. package/dist/es/packages/tabbar/tabbar.d.ts +7 -35
  108. package/dist/es/packages/tabbaritem/style/style.css +10 -0
  109. package/dist/es/packages/tabbaritem/style/tabbaritem.scss +10 -0
  110. package/dist/es/packages/tabbaritem/tabbaritem.d.ts +7 -35
  111. package/dist/es/packages/tag/style/style.css +1 -0
  112. package/dist/es/packages/tag/style/tag.scss +1 -0
  113. package/dist/es/packages/toast/style/index.js +1 -0
  114. package/dist/es/packages/toast/style/style.css +60 -0
  115. package/dist/es/packages/uploader/style/style.css +3 -2
  116. package/dist/es/utils/add-color-for-harmony.d.ts +9 -0
  117. package/dist/es/utils/add-color-for-harmony.js +16 -0
  118. package/dist/nutui.react.umd.js +244 -187
  119. package/dist/style.css +1 -1
  120. package/dist/styles/jd-font.scss +8 -0
  121. package/dist/styles/themes/default.scss +2 -105
  122. package/dist/styles/variables.scss +46 -35
  123. package/package.json +1 -1
@@ -2,41 +2,13 @@ import { FunctionComponent } from 'react';
2
2
  import { BasicComponent } from "../../utils/typings";
3
3
  import TabbarItem from '../tabbaritem';
4
4
  export interface TabbarProps extends BasicComponent {
5
- /**
6
- * 默认选中的标签的索引值
7
- * @default 0
8
- */
9
- defaultValue: number
10
- /**
11
- * 选中的标签的索引值
12
- * @default -
13
- */
14
- value?: number
15
- /**
16
- * 是否固定在页面底部,为 true 时默认开启 safeArea
17
- * @default false
18
- */
19
- fixed: boolean
20
- /**
21
- * icon未激活的颜色
22
- * @default #7d7e80
23
- */
24
- inactiveColor: string
25
- /**
26
- * icon激活的颜色
27
- * @default #0073ff
28
- */
29
- activeColor: string
30
- /**
31
- * 是否开启iphone系列全面屏底部安全区适配
32
- * @default false
33
- */
34
- safeArea: boolean
35
- /**
36
- * 切换页签时触发事件
37
- * @default -
38
- */
39
- onSwitch: (value: number) => void
5
+ defaultValue: number;
6
+ value?: number;
7
+ fixed: boolean;
8
+ inactiveColor: string;
9
+ activeColor: string;
10
+ safeArea: boolean;
11
+ onSwitch: (value: number) => void;
40
12
  }
41
13
  export declare const Tabbar: FunctionComponent<Partial<TabbarProps>> & {
42
14
  Item: typeof TabbarItem;
@@ -110,8 +110,18 @@
110
110
  color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
111
111
  }
112
112
  .nut-tabbar-item-active .nut-tabbar-item-icon-box {
113
+ /* #ifdef harmony*/
114
+ color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
115
+ /* #endif*/
116
+ /* #ifndef harmony*/
113
117
  color: inherit;
118
+ /* #endif*/
114
119
  }
115
120
  .nut-tabbar-item-active .nut-tabbar-item-icon-box .nut-icon {
121
+ /* #ifdef harmony*/
122
+ color: var(--nutui-tabbar-active-color, var(--nutui-color-primary, #ff0f23));
123
+ /* #endif*/
124
+ /* #ifndef harmony*/
116
125
  color: inherit;
126
+ /* #endif*/
117
127
  }
@@ -40,10 +40,20 @@
40
40
  color: $tabbar-active-color;
41
41
 
42
42
  .nut-tabbar-item-icon-box {
43
+ /* #ifdef harmony*/
44
+ color: $tabbar-active-color;
45
+ /* #endif*/
46
+ /* #ifndef harmony*/
43
47
  color: inherit;
48
+ /* #endif*/
44
49
 
45
50
  .nut-icon {
51
+ /* #ifdef harmony*/
52
+ color: $tabbar-active-color;
53
+ /* #endif*/
54
+ /* #ifndef harmony*/
46
55
  color: inherit;
56
+ /* #endif*/
47
57
  }
48
58
  }
49
59
  }
@@ -1,40 +1,12 @@
1
1
  import { FunctionComponent, ReactNode } from 'react';
2
2
  import { BasicComponent } from "../../utils/typings";
3
3
  export interface TabbarItemProps extends BasicComponent {
4
- /**
5
- * 标签页的标题
6
- * @default -
7
- */
8
- title: ReactNode
9
- /**
10
- * 自定义图标
11
- * @default -
12
- */
13
- icon: ReactNode
14
- /**
15
- * 徽标中显示的内容,支持数字、字符和自定义内容
16
- * @default -
17
- */
18
- value: ReactNode
19
- /**
20
- * 徽标是否为小点
21
- * @default false
22
- */
23
- dot: boolean
24
- /**
25
- * value 为数值时,最大值
26
- * @default 99
27
- */
28
- max: number
29
- /**
30
- * 徽标的上下偏移量,支持单位设置,可设置为:5 等
31
- * @default 0
32
- */
33
- top: string
34
- /**
35
- * 徽标的左右偏移量,支持单位设置,可设置为:5 等
36
- * @default 0
37
- */
38
- right: string
4
+ title: ReactNode;
5
+ icon: ReactNode;
6
+ value: ReactNode;
7
+ dot: boolean;
8
+ max: number;
9
+ top: string;
10
+ right: string;
39
11
  }
40
12
  export declare const TabbarItem: FunctionComponent<Partial<TabbarItemProps>>;
@@ -13,6 +13,7 @@
13
13
  .nut-tag .nut-icon {
14
14
  vertical-align: middle;
15
15
  margin-left: 4px;
16
+ color: var(--nutui-tag-color, #ffffff);
16
17
  }
17
18
  .nut-tag-text {
18
19
  font-size: var(--nutui-tag-font-size, var(--nutui-font-size-xxs, 10px));
@@ -13,6 +13,7 @@
13
13
  .nut-icon {
14
14
  vertical-align: middle;
15
15
  margin-left: 4px;
16
+ color: $tag-color;
16
17
  }
17
18
 
18
19
  &-text {
@@ -1 +1,2 @@
1
+ import '../../overlay/style';
1
2
  import './toast.scss';
@@ -1,3 +1,63 @@
1
+ .nut-overlay {
2
+ /* #ifdef rn */
3
+ position: absolute;
4
+ /* #endif */
5
+ /* #ifndef rn */
6
+ position: fixed;
7
+ /* #endif */
8
+ top: 0;
9
+ left: 0;
10
+ bottom: 0;
11
+ right: 0;
12
+ width: 100%;
13
+ height: 100%;
14
+ background-color: var(--nutui-overlay-bg-color, var(--nutui-color-mask, rgba(0, 0, 0, 0.7)));
15
+ z-index: var(--nutui-overlay-zIndex, 1000);
16
+ }
17
+
18
+ [dir=rtl] .nut-overlay,
19
+ .nut-rtl .nut-overlay {
20
+ left: auto;
21
+ right: 0;
22
+ }
23
+
24
+ .nut-overflow-hidden {
25
+ overflow: hidden !important;
26
+ }
27
+
28
+ @keyframes nut-fade-in {
29
+ 0% {
30
+ opacity: 0;
31
+ }
32
+ 1% {
33
+ opacity: 0;
34
+ }
35
+ 100% {
36
+ opacity: 1;
37
+ }
38
+ }
39
+ @keyframes nut-fade-out {
40
+ 0% {
41
+ opacity: 1;
42
+ }
43
+ 1% {
44
+ opacity: 1;
45
+ }
46
+ 100% {
47
+ opacity: 0;
48
+ }
49
+ }
50
+ .nut-overlay-slide-enter-active, .nut-overlay-slide-appear-active {
51
+ animation-fill-mode: both;
52
+ animation-name: nut-fade-in;
53
+ animation-duration: var(--nutui-overlay-animation-duration, 0.3s);
54
+ }
55
+ .nut-overlay-slide-exit-active {
56
+ animation-fill-mode: both;
57
+ animation-name: nut-fade-out;
58
+ animation-duration: var(--nutui-overlay-animation-duration, 0.3s);
59
+ }
60
+
1
61
  @keyframes rotation {
2
62
  0% {
3
63
  -webkit-transform: rotate(0deg);
@@ -27,7 +27,7 @@
27
27
  justify-content: center;
28
28
  transition: all 0.4s;
29
29
  border-radius: var(--nutui-progress-border-radius, 12px);
30
- background-color: var(--nutui-progress-color, #ff0f23);
30
+ background: var(--nutui-progress-color, linear-gradient(135deg, var(--nutui-color-primary-stop-1, #ff475d) 0%, var(--nutui-color-primary-stop-2, #ff0f23) 100%));
31
31
  }
32
32
  .nut-progress-text {
33
33
  display: flex;
@@ -36,6 +36,7 @@
36
36
  top: var(--nutui-progress-text-position-top, -4px);
37
37
  bottom: var(--nutui-progress-text-position-bottom, -4px);
38
38
  transition: all 0.4s;
39
+ transform: translate(-50%);
39
40
  }
40
41
  .nut-progress-text-inner {
41
42
  display: flex;
@@ -49,7 +50,7 @@
49
50
  border-radius: var(--nutui-progress-text-border-radius, 5px);
50
51
  font-size: var(--nutui-progress-text-font-size, 9px);
51
52
  line-height: 1;
52
- background: var(--nutui-progress-text-background, #ff0f23);
53
+ background: var(--nutui-progress-text-background, linear-gradient(135deg, var(--nutui-color-primary-stop-1, #ff475d) 0%, var(--nutui-color-primary-stop-2, #ff0f23) 100%));
53
54
  }
54
55
  @keyframes progressActive {
55
56
  0% {
@@ -0,0 +1,9 @@
1
+ import React, { ReactNode } from 'react';
2
+ /**
3
+ * 为支持 Harmony 的 React 元素添加颜色属性
4
+ * @param maybeElement - 要处理的 React 节点
5
+ * @param color - 要添加的颜色值(如:'#ff0000')
6
+ * @returns 处理后的 React 节点
7
+ */
8
+ declare function addColorForHarmony(maybeElement: ReactNode, color?: string): string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined;
9
+ export default addColorForHarmony;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { harmony } from "./platform-taro";
3
+ /**
4
+ * 为支持 Harmony 的 React 元素添加颜色属性
5
+ * @param maybeElement - 要处理的 React 节点
6
+ * @param color - 要添加的颜色值(如:'#ff0000')
7
+ * @returns 处理后的 React 节点
8
+ */ function addColorForHarmony(maybeElement, color) {
9
+ if (React.isValidElement(maybeElement) && harmony()) {
10
+ return React.cloneElement(maybeElement, {
11
+ color: color
12
+ });
13
+ }
14
+ return maybeElement;
15
+ }
16
+ export default addColorForHarmony;