@nutui/nutui-react-taro 4.0.0-beta.6 → 4.0.0-beta.7

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 (140) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/packages/actionsheet/style/style.harmony.css +12 -6
  3. package/dist/cjs/packages/address/style/style.harmony.css +12 -6
  4. package/dist/cjs/packages/animate/style/style.css +27 -9
  5. package/dist/cjs/packages/animate/style/style.harmony.css +27 -9
  6. package/dist/cjs/packages/animate/style-jmapp/style.css +27 -9
  7. package/dist/cjs/packages/animate/style-jrkf/style.css +27 -9
  8. package/dist/cjs/packages/audio/audio.js +14 -14
  9. package/dist/cjs/packages/audio/style/style.harmony.css +20 -8
  10. package/dist/cjs/packages/badge/badge.js +17 -17
  11. package/dist/cjs/packages/button/button.js +1 -2
  12. package/dist/cjs/packages/button/style/style.css +20 -8
  13. package/dist/cjs/packages/button/style/style.harmony.css +20 -8
  14. package/dist/cjs/packages/button/style-jmapp/style.css +20 -8
  15. package/dist/cjs/packages/button/style-jrkf/style.css +20 -8
  16. package/dist/cjs/packages/calendar/style/style.harmony.css +12 -6
  17. package/dist/cjs/packages/cascader/style/style.harmony.css +12 -6
  18. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  19. package/dist/cjs/packages/datepicker/style/style.harmony.css +12 -6
  20. package/dist/cjs/packages/dialog/style/style.harmony.css +20 -8
  21. package/dist/cjs/packages/empty/style/style.harmony.css +20 -8
  22. package/dist/cjs/packages/imagepreview/style/style.harmony.css +12 -6
  23. package/dist/cjs/packages/indicator/indicator.js +6 -6
  24. package/dist/cjs/packages/infiniteloading/infiniteloading.js +9 -9
  25. package/dist/cjs/packages/navbar/style/style.css +3 -1
  26. package/dist/cjs/packages/navbar/style/style.harmony.css +3 -1
  27. package/dist/cjs/packages/navbar/style-jmapp/style.css +3 -1
  28. package/dist/cjs/packages/navbar/style-jrkf/style.css +3 -1
  29. package/dist/cjs/packages/noticebar/noticebar.js +120 -60
  30. package/dist/cjs/packages/noticebar/style/noticebar.scss +130 -10
  31. package/dist/cjs/packages/noticebar/style/style.css +138 -35
  32. package/dist/cjs/packages/noticebar/style/style.harmony.css +138 -35
  33. package/dist/cjs/packages/noticebar/style-jmapp/noticebar.scss +130 -10
  34. package/dist/cjs/packages/noticebar/style-jmapp/style.css +113 -10
  35. package/dist/cjs/packages/noticebar/style-jrkf/noticebar.scss +130 -10
  36. package/dist/cjs/packages/noticebar/style-jrkf/style.css +113 -10
  37. package/dist/cjs/packages/numberkeyboard/style/style.css +6 -6
  38. package/dist/cjs/packages/numberkeyboard/style/style.harmony.css +18 -12
  39. package/dist/cjs/packages/numberkeyboard/style-jmapp/style.css +6 -6
  40. package/dist/cjs/packages/numberkeyboard/style-jrkf/style.css +6 -6
  41. package/dist/cjs/packages/picker/style/style.harmony.css +12 -6
  42. package/dist/cjs/packages/popover/popover.js +46 -37
  43. package/dist/cjs/packages/popover/style/popover.scss +79 -54
  44. package/dist/cjs/packages/popover/style/style.css +73 -61
  45. package/dist/cjs/packages/popover/style/style.harmony.css +85 -67
  46. package/dist/cjs/packages/popover/style-jmapp/popover.scss +79 -54
  47. package/dist/cjs/packages/popover/style-jmapp/style.css +73 -61
  48. package/dist/cjs/packages/popover/style-jrkf/popover.scss +79 -54
  49. package/dist/cjs/packages/popover/style-jrkf/style.css +73 -61
  50. package/dist/cjs/packages/popup/style/style.css +12 -6
  51. package/dist/cjs/packages/popup/style/style.harmony.css +12 -6
  52. package/dist/cjs/packages/popup/style-jmapp/style.css +12 -6
  53. package/dist/cjs/packages/popup/style-jrkf/style.css +12 -6
  54. package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +54 -54
  55. package/dist/cjs/packages/quickenter/style/style.harmony.css +12 -6
  56. package/dist/cjs/packages/resultpage/style/style.harmony.css +20 -8
  57. package/dist/cjs/packages/shortpassword/style/style.harmony.css +12 -6
  58. package/dist/cjs/packages/skeleton/skeleton.js +15 -15
  59. package/dist/cjs/packages/timeselect/style/style.harmony.css +12 -6
  60. package/dist/cjs/packages/tour/style/style.harmony.css +86 -68
  61. package/dist/cjs/packages/tour/tour.js +1 -1
  62. package/dist/cjs/types/spec/noticebar/base.d.ts +5 -1
  63. package/dist/cjs/types/spec/popover/base.d.ts +4 -0
  64. package/dist/cjs/utils/is-forward-ref-component.js +2 -2
  65. package/dist/cjs/utils/render.js +1 -1
  66. package/dist/es/packages/actionsheet/style/style.harmony.css +12 -6
  67. package/dist/es/packages/address/style/style.harmony.css +12 -6
  68. package/dist/es/packages/animate/style/style.css +27 -9
  69. package/dist/es/packages/animate/style/style.harmony.css +27 -9
  70. package/dist/es/packages/animate/style-jmapp/style.css +27 -9
  71. package/dist/es/packages/animate/style-jrkf/style.css +27 -9
  72. package/dist/es/packages/audio/audio.js +14 -14
  73. package/dist/es/packages/audio/style/style.harmony.css +20 -8
  74. package/dist/es/packages/badge/badge.js +17 -17
  75. package/dist/es/packages/button/button.js +1 -2
  76. package/dist/es/packages/button/style/style.css +20 -8
  77. package/dist/es/packages/button/style/style.harmony.css +20 -8
  78. package/dist/es/packages/button/style-jmapp/style.css +20 -8
  79. package/dist/es/packages/button/style-jrkf/style.css +20 -8
  80. package/dist/es/packages/calendar/style/style.harmony.css +12 -6
  81. package/dist/es/packages/cascader/style/style.harmony.css +12 -6
  82. package/dist/es/packages/configprovider/types.d.ts +1 -1
  83. package/dist/es/packages/datepicker/style/style.harmony.css +12 -6
  84. package/dist/es/packages/dialog/style/style.harmony.css +20 -8
  85. package/dist/es/packages/empty/style/style.harmony.css +20 -8
  86. package/dist/es/packages/imagepreview/style/style.harmony.css +12 -6
  87. package/dist/es/packages/indicator/indicator.js +6 -6
  88. package/dist/es/packages/infiniteloading/infiniteloading.js +9 -9
  89. package/dist/es/packages/navbar/style/style.css +3 -1
  90. package/dist/es/packages/navbar/style/style.harmony.css +3 -1
  91. package/dist/es/packages/navbar/style-jmapp/style.css +3 -1
  92. package/dist/es/packages/navbar/style-jrkf/style.css +3 -1
  93. package/dist/es/packages/noticebar/noticebar.js +120 -60
  94. package/dist/es/packages/noticebar/style/noticebar.scss +130 -10
  95. package/dist/es/packages/noticebar/style/style.css +138 -35
  96. package/dist/es/packages/noticebar/style/style.harmony.css +138 -35
  97. package/dist/es/packages/noticebar/style-jmapp/noticebar.scss +130 -10
  98. package/dist/es/packages/noticebar/style-jmapp/style.css +113 -10
  99. package/dist/es/packages/noticebar/style-jrkf/noticebar.scss +130 -10
  100. package/dist/es/packages/noticebar/style-jrkf/style.css +113 -10
  101. package/dist/es/packages/numberkeyboard/style/style.css +6 -6
  102. package/dist/es/packages/numberkeyboard/style/style.harmony.css +18 -12
  103. package/dist/es/packages/numberkeyboard/style-jmapp/style.css +6 -6
  104. package/dist/es/packages/numberkeyboard/style-jrkf/style.css +6 -6
  105. package/dist/es/packages/picker/style/style.harmony.css +12 -6
  106. package/dist/es/packages/popover/popover.js +46 -37
  107. package/dist/es/packages/popover/style/popover.scss +79 -54
  108. package/dist/es/packages/popover/style/style.css +73 -61
  109. package/dist/es/packages/popover/style/style.harmony.css +85 -67
  110. package/dist/es/packages/popover/style-jmapp/popover.scss +79 -54
  111. package/dist/es/packages/popover/style-jmapp/style.css +73 -61
  112. package/dist/es/packages/popover/style-jrkf/popover.scss +79 -54
  113. package/dist/es/packages/popover/style-jrkf/style.css +73 -61
  114. package/dist/es/packages/popup/style/style.css +12 -6
  115. package/dist/es/packages/popup/style/style.harmony.css +12 -6
  116. package/dist/es/packages/popup/style-jmapp/style.css +12 -6
  117. package/dist/es/packages/popup/style-jrkf/style.css +12 -6
  118. package/dist/es/packages/pulltorefresh/pulltorefresh.js +54 -54
  119. package/dist/es/packages/quickenter/style/style.harmony.css +12 -6
  120. package/dist/es/packages/resultpage/style/style.harmony.css +20 -8
  121. package/dist/es/packages/shortpassword/style/style.harmony.css +12 -6
  122. package/dist/es/packages/skeleton/skeleton.js +15 -15
  123. package/dist/es/packages/timeselect/style/style.harmony.css +12 -6
  124. package/dist/es/packages/tour/style/style.harmony.css +86 -68
  125. package/dist/es/packages/tour/tour.js +1 -1
  126. package/dist/es/types/spec/noticebar/base.d.ts +19 -3
  127. package/dist/es/types/spec/popover/base.d.ts +21 -2
  128. package/dist/es/utils/render.js +1 -1
  129. package/dist/nutui.react.umd.js +327 -1211
  130. package/dist/style-jmapp.css +1 -1
  131. package/dist/style-jmapp.scss +31 -31
  132. package/dist/style-jrkf.css +1 -1
  133. package/dist/style-jrkf.scss +25 -25
  134. package/dist/style.css +1 -1
  135. package/dist/style.scss +29 -29
  136. package/dist/styles/variables-daojia.scss +55 -9
  137. package/dist/styles/variables-jmapp.scss +52 -6
  138. package/dist/styles/variables-jrkf.scss +52 -6
  139. package/dist/styles/variables.scss +123 -15
  140. package/package.json +1 -1
@@ -19,20 +19,24 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
19
19
  direction: 'horizontal',
20
20
  list: [],
21
21
  duration: 1000,
22
- height: 40,
22
+ height: 36,
23
23
  content: '',
24
24
  closeable: false,
25
25
  wrap: false,
26
26
  leftIcon: /*#__PURE__*/ React.createElement(Notice, null),
27
27
  rightIcon: null,
28
28
  right: null,
29
+ description: null,
30
+ tag: null,
31
+ action: null,
32
+ autoClose: 0,
29
33
  delay: 1,
30
34
  scrollable: null,
31
35
  speed: 50
32
36
  });
33
37
  export var NoticeBar = function NoticeBar(props) {
34
38
  var rtl = useRtl();
35
- var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, className = _$_object_spread.className, style = _$_object_spread.style, align = _$_object_spread.align, direction = _$_object_spread.direction, list = _$_object_spread.list, duration = _$_object_spread.duration, height = _$_object_spread.height, content = _$_object_spread.content, closeable = _$_object_spread.closeable, wrap = _$_object_spread.wrap, leftIcon = _$_object_spread.leftIcon, rightIcon = _$_object_spread.rightIcon, right = _$_object_spread.right, delay = _$_object_spread.delay, scrollable = _$_object_spread.scrollable, speed = _$_object_spread.speed, close = _$_object_spread.close, click = _$_object_spread.click, onClose = _$_object_spread.onClose, onClick = _$_object_spread.onClick, onItemClick = _$_object_spread.onItemClick;
39
+ var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, className = _$_object_spread.className, style = _$_object_spread.style, align = _$_object_spread.align, direction = _$_object_spread.direction, list = _$_object_spread.list, duration = _$_object_spread.duration, height = _$_object_spread.height, content = _$_object_spread.content, closeable = _$_object_spread.closeable, wrap = _$_object_spread.wrap, leftIcon = _$_object_spread.leftIcon, rightIcon = _$_object_spread.rightIcon, right = _$_object_spread.right, description = _$_object_spread.description, tag = _$_object_spread.tag, action = _$_object_spread.action, autoClose = _$_object_spread.autoClose, delay = _$_object_spread.delay, scrollable = _$_object_spread.scrollable, speed = _$_object_spread.speed, close = _$_object_spread.close, click = _$_object_spread.click, onClose = _$_object_spread.onClose, onClick = _$_object_spread.onClick, onItemClick = _$_object_spread.onItemClick;
36
40
  var classPrefix = 'nut-noticebar';
37
41
  var wrapRef = useRef(null);
38
42
  var contentRef = useRef(null);
@@ -40,21 +44,22 @@ export var NoticeBar = function NoticeBar(props) {
40
44
  var wrapRefId = "wrap-ref-".concat(uid);
41
45
  var contentRefId = "content-ref-".concat(uid);
42
46
  var _useState = _sliced_to_array(useState(true), 2), showNoticeBar = _useState[0], setShowNoticeBar = _useState[1];
47
+ var _useState1 = _sliced_to_array(useState(100), 2), autoCloseProgress = _useState1[0], setAutoCloseProgress = _useState1[1];
43
48
  var scrollList = useRef([]);
44
- var _useState1 = _sliced_to_array(useState(0), 2), wrapWidth = _useState1[0], SetWrapWidth = _useState1[1];
45
- var _useState2 = _sliced_to_array(useState(true), 2), firstRound = _useState2[0], SetFirstRound = _useState2[1];
46
- var _useState3 = _sliced_to_array(useState(0), 2), animationDuration = _useState3[0], SetAnimationDuration = _useState3[1];
47
- var _useState4 = _sliced_to_array(useState(0), 2), offsetWidth = _useState4[0], SetOffsetW = _useState4[1];
48
- var _useState5 = _sliced_to_array(useState(''), 2), animationClass = _useState5[0], SetAnimationClass = _useState5[1];
49
- var _useState6 = _sliced_to_array(useState(false), 2), animate = _useState6[0], SetAnimate = _useState6[1];
50
- var _useState7 = _sliced_to_array(useState(0), 2), timer = _useState7[0], SetTimer = _useState7[1];
51
- var _useState8 = _sliced_to_array(useState(null), 2), isCanScroll = _useState8[0], SetIsCanScroll = _useState8[1];
49
+ var _useState2 = _sliced_to_array(useState(0), 2), wrapWidth = _useState2[0], SetWrapWidth = _useState2[1];
50
+ var _useState3 = _sliced_to_array(useState(true), 2), firstRound = _useState3[0], SetFirstRound = _useState3[1];
51
+ var _useState4 = _sliced_to_array(useState(0), 2), animationDuration = _useState4[0], SetAnimationDuration = _useState4[1];
52
+ var _useState5 = _sliced_to_array(useState(0), 2), offsetWidth = _useState5[0], SetOffsetW = _useState5[1];
53
+ var _useState6 = _sliced_to_array(useState(''), 2), animationClass = _useState6[0], SetAnimationClass = _useState6[1];
54
+ var _useState7 = _sliced_to_array(useState(false), 2), animate = _useState7[0], SetAnimate = _useState7[1];
55
+ var _useState8 = _sliced_to_array(useState(0), 2), timer = _useState8[0], SetTimer = _useState8[1];
56
+ var _useState9 = _sliced_to_array(useState(null), 2), isCanScroll = _useState9[0], SetIsCanScroll = _useState9[1];
52
57
  var isVertical = direction === 'vertical';
53
- var _useState9 = _sliced_to_array(useState(null), 2), rect = _useState9[0], setRect = _useState9[1];
58
+ var _useState10 = _sliced_to_array(useState(null), 2), rect = _useState10[0], setRect = _useState10[1];
54
59
  var activeRef = useRef(0);
55
- var _useState10 = _sliced_to_array(useState(false), 2), ready = _useState10[0], setReady = _useState10[1];
60
+ var _useState11 = _sliced_to_array(useState(false), 2), ready = _useState11[0], setReady = _useState11[1];
56
61
  var container = useRef(null);
57
- var _useState11 = _sliced_to_array(useState(false), 2), isContainerReady = _useState11[0], setIsContainerReady = _useState11[1];
62
+ var _useState12 = _sliced_to_array(useState(false), 2), isContainerReady = _useState12[0], setIsContainerReady = _useState12[1];
58
63
  var innerRef = useRef(null);
59
64
  var swiperRef = useRef({
60
65
  moving: false,
@@ -64,8 +69,8 @@ export var NoticeBar = function NoticeBar(props) {
64
69
  offset: 0,
65
70
  size: 0
66
71
  });
67
- var _useState12 = _sliced_to_array(useState([]), 2), childOffset = _useState12[0], setChildOffset = _useState12[1];
68
- var _useState13 = _sliced_to_array(useState(0), 2), offset = _useState13[0], setOffset = _useState13[1];
72
+ var _useState13 = _sliced_to_array(useState([]), 2), childOffset = _useState13[0], setChildOffset = _useState13[1];
73
+ var _useState14 = _sliced_to_array(useState(0), 2), offset = _useState14[0], setOffset = _useState14[1];
69
74
  var _useMemo = useMemo(function() {
70
75
  var childCount = 0;
71
76
  var childs = React.Children.map(children, function(child) {
@@ -90,6 +95,35 @@ export var NoticeBar = function NoticeBar(props) {
90
95
  }
91
96
  return 0;
92
97
  }();
98
+ var onCloseRef = useRef(onClose);
99
+ onCloseRef.current = onClose;
100
+ var autoCloseTimerRef = useRef(0);
101
+ var autoCloseIntervalRef = useRef(0);
102
+ // 自动关闭
103
+ useEffect(function() {
104
+ if (autoClose && autoClose > 0 && showNoticeBar) {
105
+ var startTime = Date.now();
106
+ autoCloseIntervalRef.current = setInterval(function() {
107
+ var elapsed = Date.now() - startTime;
108
+ var remaining = Math.max(0, 100 - elapsed / autoClose * 100);
109
+ setAutoCloseProgress(remaining);
110
+ if (remaining <= 0) clearInterval(autoCloseIntervalRef.current);
111
+ }, 50);
112
+ autoCloseTimerRef.current = setTimeout(function() {
113
+ var _onCloseRef_current;
114
+ setShowNoticeBar(false);
115
+ (_onCloseRef_current = onCloseRef.current) === null || _onCloseRef_current === void 0 ? void 0 : _onCloseRef_current.call(onCloseRef);
116
+ }, autoClose);
117
+ return function() {
118
+ clearInterval(autoCloseIntervalRef.current);
119
+ clearTimeout(autoCloseTimerRef.current);
120
+ };
121
+ }
122
+ setAutoCloseProgress(100);
123
+ }, [
124
+ autoClose,
125
+ showNoticeBar
126
+ ]);
93
127
  useEffect(function() {
94
128
  if (isVertical) {
95
129
  if (children) {
@@ -174,6 +208,17 @@ export var NoticeBar = function NoticeBar(props) {
174
208
  click && click(event);
175
209
  onClick && onClick(event);
176
210
  };
211
+ var onClickIcon = useCallback(function(event) {
212
+ event.stopPropagation();
213
+ setShowNoticeBar(false);
214
+ clearInterval(autoCloseIntervalRef.current);
215
+ clearTimeout(autoCloseTimerRef.current);
216
+ close && close(event);
217
+ onClose && onClose(event);
218
+ }, [
219
+ close,
220
+ onClose
221
+ ]);
177
222
  var onAnimationEnd = function onAnimationEnd() {
178
223
  SetFirstRound(false);
179
224
  setTimeout(function() {
@@ -196,16 +241,6 @@ export var NoticeBar = function NoticeBar(props) {
196
241
  SetAnimate(false);
197
242
  }, time);
198
243
  };
199
- var handleClickIcon = useCallback(function(event) {
200
- event.stopPropagation();
201
- setShowNoticeBar(!closeable);
202
- close && close(event);
203
- onClose && onClose(event);
204
- }, [
205
- close,
206
- onClose,
207
- closeable
208
- ]);
209
244
  var isEllipsis = function isEllipsis() {
210
245
  if (isCanScroll == null && align === 'left') {
211
246
  return wrap;
@@ -358,7 +393,6 @@ export var NoticeBar = function NoticeBar(props) {
358
393
  };
359
394
  if (height) {
360
395
  style.height = "".concat(height, "px");
361
- // style.lineHeight = `${height}px`
362
396
  }
363
397
  var offset = childOffset[index];
364
398
  if (offset) {
@@ -427,32 +461,52 @@ export var NoticeBar = function NoticeBar(props) {
427
461
  container.current = ref;
428
462
  setIsContainerReady(true);
429
463
  }, []);
430
- var renderLeftIcon = useCallback(function() {
431
- return /*#__PURE__*/ React.createElement(React.Fragment, null, leftIcon ? /*#__PURE__*/ React.createElement(View, {
432
- className: "nut-noticebar-box-left-icon"
433
- }, leftIcon) : null);
434
- }, [
435
- leftIcon
436
- ]);
437
- var renderRight = useCallback(function() {
438
- return /*#__PURE__*/ React.createElement(React.Fragment, null, right ? /*#__PURE__*/ React.createElement(View, {
439
- className: "nut-noticebar-box-right"
440
- }, right) : null);
441
- }, [
442
- right
443
- ]);
444
- var renderRightIcon = useCallback(function() {
445
- return /*#__PURE__*/ React.createElement(React.Fragment, null, rightIcon || closeable ? /*#__PURE__*/ React.createElement(View, {
446
- className: "nut-noticebar-box-right-icon",
447
- onClick: handleClickIcon
448
- }, rightIcon || /*#__PURE__*/ React.createElement(Close, {
449
- className: "nut-noticebar-box-right-icon-default"
450
- })) : null);
451
- }, [
452
- rightIcon,
453
- closeable,
454
- handleClickIcon
455
- ]);
464
+ var renderLeftIcon = function renderLeftIcon() {
465
+ if (!leftIcon) return null;
466
+ return /*#__PURE__*/ React.createElement(View, {
467
+ className: "".concat(classPrefix, "-box-left-icon")
468
+ }, leftIcon);
469
+ };
470
+ var renderTag = function renderTag() {
471
+ if (!tag) return null;
472
+ return /*#__PURE__*/ React.createElement(View, {
473
+ className: "".concat(classPrefix, "-box-tag")
474
+ }, tag);
475
+ };
476
+ var renderAction = function renderAction() {
477
+ if (!action) return null;
478
+ return /*#__PURE__*/ React.createElement(View, {
479
+ className: "".concat(classPrefix, "-box-action")
480
+ }, action);
481
+ };
482
+ var renderAutoCloseIcon = function renderAutoCloseIcon() {
483
+ return /*#__PURE__*/ React.createElement(View, {
484
+ className: "".concat(classPrefix, "-box-close-countdown"),
485
+ style: {
486
+ '--progress': "".concat(autoCloseProgress, "%")
487
+ }
488
+ }, /*#__PURE__*/ React.createElement(Close, {
489
+ className: "".concat(classPrefix, "-box-close-icon")
490
+ }));
491
+ };
492
+ var renderCloseIcon = function renderCloseIcon() {
493
+ if (!closeable && !rightIcon && !(autoClose && autoClose > 0)) return null;
494
+ return /*#__PURE__*/ React.createElement(View, {
495
+ className: "".concat(classPrefix, "-box-right-icon"),
496
+ onClick: onClickIcon
497
+ }, rightIcon || (autoClose && autoClose > 0 ? renderAutoCloseIcon() : /*#__PURE__*/ React.createElement(Close, {
498
+ className: "".concat(classPrefix, "-box-right-icon-default")
499
+ })));
500
+ };
501
+ var renderRight = function renderRight() {
502
+ if (!right) return null;
503
+ if (process.env.NODE_ENV !== 'production') {
504
+ console.warn('[NutUI] NoticeBar: `right` prop is deprecated, use `action` instead.');
505
+ }
506
+ return /*#__PURE__*/ React.createElement(View, {
507
+ className: "".concat(classPrefix, "-box-right")
508
+ }, right);
509
+ };
456
510
  return /*#__PURE__*/ React.createElement(View, {
457
511
  className: cls,
458
512
  style: style
@@ -461,22 +515,28 @@ export var NoticeBar = function NoticeBar(props) {
461
515
  style: barStyle,
462
516
  onClick: handleClick
463
517
  }, renderLeftIcon(), /*#__PURE__*/ React.createElement(View, {
518
+ className: "".concat(classPrefix, "-box-content-wrapper")
519
+ }, /*#__PURE__*/ React.createElement(View, {
520
+ className: "".concat(classPrefix, "-box-content-main")
521
+ }, /*#__PURE__*/ React.createElement(View, {
464
522
  ref: wrapRef,
465
- className: "nut-noticebar-box-wrap",
523
+ className: "".concat(classPrefix, "-box-wrap"),
466
524
  id: wrapRefId
467
525
  }, /*#__PURE__*/ React.createElement(View, {
468
526
  ref: contentRef,
469
527
  id: contentRefId,
470
- className: "nut-noticebar-box-wrap-content ".concat(animationClass, " ").concat(isEllipsis() ? 'nut-ellipsis' : ''),
528
+ className: "".concat(classPrefix, "-box-wrap-content ").concat(animationClass, " ").concat(isEllipsis() ? 'nut-ellipsis' : ''),
471
529
  style: contentStyle,
472
530
  onAnimationEnd: onAnimationEnd
473
- }, children, content)), renderRight(), renderRightIcon()) : null, showNoticeBar && hasVerticalContent && isVertical ? /*#__PURE__*/ React.createElement(View, {
474
- className: "nut-noticebar-vertical",
531
+ }, children, content)), renderTag()), description ? /*#__PURE__*/ React.createElement(View, {
532
+ className: "".concat(classPrefix, "-box-description")
533
+ }, description) : null), renderAction(), renderRight(), renderCloseIcon()) : null, showNoticeBar && hasVerticalContent && isVertical ? /*#__PURE__*/ React.createElement(View, {
534
+ className: "".concat(classPrefix, "-vertical"),
475
535
  style: barStyle,
476
536
  ref: containerRefCallback,
477
537
  onClick: handleClick
478
538
  }, renderLeftIcon(), children ? /*#__PURE__*/ React.createElement(View, {
479
- className: "nut-noticebar-box-wrap",
539
+ className: "".concat(classPrefix, "-box-wrap"),
480
540
  ref: innerRef
481
541
  }, scrollList.current.map(function(item, index) {
482
542
  return /*#__PURE__*/ React.createElement(View, {
@@ -487,11 +547,11 @@ export var NoticeBar = function NoticeBar(props) {
487
547
  }
488
548
  }, item);
489
549
  })) : /*#__PURE__*/ React.createElement(View, {
490
- className: "nut-noticebar-box-horseLamp-list",
550
+ className: "".concat(classPrefix, "-box-horseLamp-list"),
491
551
  style: horseLampStyle
492
552
  }, scrollList.current.map(function(item, index) {
493
553
  return /*#__PURE__*/ React.createElement(View, {
494
- className: "nut-noticebar-box-horseLamp-list-item",
554
+ className: "".concat(classPrefix, "-box-horseLamp-list-item"),
495
555
  style: {
496
556
  height: height
497
557
  },
@@ -500,6 +560,6 @@ export var NoticeBar = function NoticeBar(props) {
500
560
  handleItemClick(e, item);
501
561
  }
502
562
  }, item);
503
- })), renderRight(), renderRightIcon()) : null);
563
+ })), renderTag(), renderAction(), renderRight(), renderCloseIcon()) : null);
504
564
  };
505
565
  NoticeBar.displayName = 'NutNoticeBar';
@@ -20,10 +20,17 @@
20
20
  .nut-noticebar-box-wrap {
21
21
  height: auto;
22
22
  }
23
+
24
+ .nut-noticebar-box-left-icon {
25
+ height: $noticebar-left-icon-wrap-width;
26
+ min-width: $noticebar-left-icon-wrap-width;
27
+ }
23
28
  }
24
29
 
25
30
  &-wrapable {
26
31
  .nut-noticebar-box-wrap {
32
+ flex: initial;
33
+
27
34
  .nut-noticebar-box-wrap-content {
28
35
  position: relative;
29
36
  white-space: normal;
@@ -51,26 +58,75 @@
51
58
 
52
59
  &-left-icon {
53
60
  display: flex;
61
+ align-items: center;
62
+ justify-content: center;
54
63
  height: $noticebar-left-icon-width;
55
64
  min-width: $noticebar-left-icon-width;
56
65
  margin-right: $noticebar-icon-gap;
57
66
  background-size: 100% 100%;
67
+
58
68
  .nut-icon {
59
- color: $noticebar-color;
69
+ color: $noticebar-icon-color;
60
70
  }
71
+
72
+ img {
73
+ border-radius: $noticebar-left-icon-border-radius;
74
+ }
75
+ }
76
+
77
+ &-content-wrapper {
78
+ flex: 1;
79
+ overflow: hidden;
80
+ min-width: 0;
81
+ }
82
+
83
+ &-content-main {
84
+ display: flex;
85
+ align-items: center;
86
+ }
87
+
88
+ &-description {
89
+ font-size: $noticebar-description-font-size;
90
+ color: $noticebar-description-color;
91
+ line-height: $noticebar-description-line-height;
92
+ white-space: nowrap;
93
+ overflow: hidden;
94
+ text-overflow: ellipsis;
95
+ }
96
+
97
+ &-tag {
98
+ display: flex;
99
+ align-items: center;
100
+ width: $noticebar-tag-size;
101
+ height: $noticebar-tag-size;
102
+ margin-left: $noticebar-tag-gap;
103
+ flex-shrink: 0;
104
+ }
105
+
106
+ &-action {
107
+ display: flex;
108
+ align-items: center;
109
+ justify-content: center;
110
+ max-width: $noticebar-action-max-width;
111
+ margin-left: $noticebar-action-gap;
112
+ font-size: $noticebar-action-font-size;
113
+ color: $color-primary;
114
+ flex-shrink: 0;
115
+ white-space: nowrap;
61
116
  }
62
117
 
63
118
  &-right-icon {
64
119
  display: flex;
65
120
  align-items: center;
66
121
  justify-content: center;
67
- width: $noticebar-right-icon-width;
68
- margin-left: $noticebar-icon-gap;
122
+ width: $noticebar-close-size;
123
+ height: $noticebar-close-size;
124
+ margin-left: $noticebar-action-gap;
125
+ flex-shrink: 0;
126
+ cursor: pointer;
69
127
 
70
128
  .nut-icon {
71
- width: scale-px(12px);
72
- height: scale-px(12px);
73
- color: $noticebar-color;
129
+ color: $noticebar-close-color;
74
130
  }
75
131
  }
76
132
 
@@ -79,6 +135,49 @@
79
135
  height: $icon-size-12;
80
136
  }
81
137
 
138
+ &-close-countdown {
139
+ position: relative;
140
+ display: flex;
141
+ align-items: center;
142
+ justify-content: center;
143
+ width: $noticebar-close-size;
144
+ height: $noticebar-close-size;
145
+ background: conic-gradient(
146
+ $noticebar-close-ring-color 0% var(--progress),
147
+ $noticebar-close-ring-shadow-color var(--progress) 100%
148
+ );
149
+ border-radius: 50%;
150
+
151
+ &::before {
152
+ content: '';
153
+ position: absolute;
154
+ inset: scale-px(1px);
155
+ background: $noticebar-background;
156
+ border-radius: 50%;
157
+ }
158
+ }
159
+
160
+ &-close-icon {
161
+ position: relative;
162
+ width: $noticebar-close-icon-size;
163
+ height: $noticebar-close-icon-size;
164
+ color: $noticebar-close-color;
165
+ }
166
+
167
+ &-left-icon--product {
168
+ height: scale-px(32px);
169
+ min-width: scale-px(32px);
170
+
171
+ img {
172
+ background: $white;
173
+ border-radius: $noticebar-left-icon-border-radius;
174
+ }
175
+ }
176
+
177
+ &-right {
178
+ flex-shrink: 0;
179
+ }
180
+
82
181
  &-wrap {
83
182
  display: flex;
84
183
  flex: 1;
@@ -158,11 +257,12 @@
158
257
  flex-direction: column;
159
258
  }
160
259
 
260
+ .nut-noticebar-box-description {
261
+ white-space: normal;
262
+ }
263
+
161
264
  .nut-noticebar-box-right-icon {
162
265
  align-self: center;
163
- display: flex;
164
- justify-content: center;
165
- width: $noticebar-right-icon-width;
166
266
  margin-left: $noticebar-icon-gap;
167
267
  }
168
268
  }
@@ -196,7 +296,17 @@
196
296
 
197
297
  &-right-icon {
198
298
  margin-left: 0;
199
- margin-right: $noticebar-icon-gap;
299
+ margin-right: $noticebar-action-gap;
300
+ }
301
+
302
+ &-tag {
303
+ margin-left: 0;
304
+ margin-right: $noticebar-tag-gap;
305
+ }
306
+
307
+ &-action {
308
+ margin-left: 0;
309
+ margin-right: $noticebar-action-gap;
200
310
  }
201
311
 
202
312
  .play {
@@ -225,5 +335,15 @@
225
335
  margin-left: 0;
226
336
  margin-right: $noticebar-icon-gap;
227
337
  }
338
+
339
+ .nut-noticebar-box-tag {
340
+ margin-left: 0;
341
+ margin-right: $noticebar-tag-gap;
342
+ }
343
+
344
+ .nut-noticebar-box-action {
345
+ margin-left: 0;
346
+ margin-right: $noticebar-action-gap;
347
+ }
228
348
  }
229
349
  }