@nutui/nutui-react-taro 3.0.0-beta.7 → 3.0.0-beta.8

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 (43) hide show
  1. package/dist/cjs/packages/animatingnumbers/style/style.css +1 -1
  2. package/dist/cjs/packages/backtop/backtop.d.ts +3 -4
  3. package/dist/cjs/packages/backtop/backtop.js +16 -34
  4. package/dist/cjs/packages/backtop/style/backtop.scss +8 -17
  5. package/dist/cjs/packages/backtop/style/style.css +8 -14
  6. package/dist/cjs/packages/badge/badge.d.ts +2 -12
  7. package/dist/cjs/packages/badge/badge.js +16 -54
  8. package/dist/cjs/packages/badge/index.d.ts +1 -1
  9. package/dist/cjs/packages/badge/style/badge.scss +61 -34
  10. package/dist/cjs/packages/badge/style/style.css +63 -40
  11. package/dist/cjs/packages/badge/types.d.ts +12 -0
  12. package/dist/cjs/packages/badge/types.js +4 -0
  13. package/dist/cjs/packages/configprovider/types.d.ts +1 -1
  14. package/dist/cjs/packages/countup/style/countup.scss +1 -1
  15. package/dist/cjs/packages/countup/style/style.css +1 -1
  16. package/dist/cjs/packages/hoverbutton/style/style.css +3 -3
  17. package/dist/cjs/packages/hoverbuttonitem/style/hoverbuttonitem.scss +3 -3
  18. package/dist/cjs/packages/hoverbuttonitem/style/style.css +3 -3
  19. package/dist/cjs/packages/tabbar/style/style.css +63 -40
  20. package/dist/cjs/packages/tabbaritem/style/style.css +63 -40
  21. package/dist/es/packages/animatingnumbers/style/style.css +1 -1
  22. package/dist/es/packages/backtop/backtop.d.ts +3 -4
  23. package/dist/es/packages/backtop/backtop.js +18 -36
  24. package/dist/es/packages/backtop/style/backtop.scss +8 -17
  25. package/dist/es/packages/backtop/style/style.css +8 -14
  26. package/dist/es/packages/badge/badge.d.ts +2 -12
  27. package/dist/es/packages/badge/badge.js +17 -55
  28. package/dist/es/packages/badge/index.d.ts +1 -1
  29. package/dist/es/packages/badge/style/badge.scss +61 -34
  30. package/dist/es/packages/badge/style/style.css +63 -40
  31. package/dist/es/packages/badge/types.d.ts +12 -0
  32. package/dist/es/packages/badge/types.js +1 -0
  33. package/dist/es/packages/configprovider/types.d.ts +1 -1
  34. package/dist/es/packages/countup/style/countup.scss +1 -1
  35. package/dist/es/packages/countup/style/style.css +1 -1
  36. package/dist/es/packages/hoverbutton/style/style.css +3 -3
  37. package/dist/es/packages/hoverbuttonitem/style/hoverbuttonitem.scss +3 -3
  38. package/dist/es/packages/hoverbuttonitem/style/style.css +3 -3
  39. package/dist/es/packages/tabbar/style/style.css +63 -40
  40. package/dist/es/packages/tabbaritem/style/style.css +63 -40
  41. package/dist/nutui.react.umd.js +124 -178
  42. package/dist/styles/variables.scss +22 -16
  43. package/package.json +1 -1
@@ -4581,32 +4581,113 @@
4581
4581
  });
4582
4582
  };
4583
4583
  SafeArea.displayName = "NutSafeArea";
4584
+ var getIcon = function(icon) {
4585
+ return React.isValidElement(icon) ? React.cloneElement(icon, {
4586
+ // @ts-ignore
4587
+ className: "nut-icon"
4588
+ }) : icon;
4589
+ };
4584
4590
  var defaultProps$1n = _object_spread_props(_object_spread({}, ComponentDefaults), {
4591
+ icon: null,
4592
+ onClick: function(value) {
4593
+ }
4594
+ });
4595
+ var classPrefix$n = "nut-hoverbutton-item";
4596
+ var isHarmony = harmony();
4597
+ var isNative$1 = harmonyAndRn();
4598
+ var HoverButtonItem = function(props) {
4599
+ var _$_object_spread = _object_spread({}, defaultProps$1n, props), className = _$_object_spread.className, style = _$_object_spread.style, icon = _$_object_spread.icon, onClick = _$_object_spread.onClick, children = _$_object_spread.children;
4600
+ var _useState = _sliced_to_array(React.useState(false), 2), isTouchStart = _useState[0], setTouchStart = _useState[1];
4601
+ React.useMemo(function() {
4602
+ return isNative$1 ? {
4603
+ color: isTouchStart ? "#595959" : "#1A1A1A"
4604
+ } : {};
4605
+ }, [
4606
+ isTouchStart
4607
+ ]);
4608
+ var handleClick = function(event) {
4609
+ onClick && onClick(event);
4610
+ };
4611
+ var handleActiveStart = function(event) {
4612
+ isNative$1 && setTouchStart(true);
4613
+ };
4614
+ var handleActiveEnd = function(event) {
4615
+ isNative$1 && setTouchStart(false);
4616
+ };
4617
+ var renderBody = function() {
4618
+ if (icon && !children) return /* @__PURE__ */ React.createElement(components.View, {
4619
+ className: "".concat(classPrefix$n, "-icon")
4620
+ }, getIcon(icon));
4621
+ if (icon && children) {
4622
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(components.View, {
4623
+ className: classNames(_define_property({}, "".concat(classPrefix$n, "-text-icon"), true))
4624
+ }), getIcon(icon), /* @__PURE__ */ React.createElement(components.View, {
4625
+ className: classNames(_define_property({}, "".concat(classPrefix$n, "-text"), true))
4626
+ }, children));
4627
+ }
4628
+ };
4629
+ var _obj;
4630
+ return /* @__PURE__ */ React.createElement(components.View, {
4631
+ className: classNames([
4632
+ "".concat(classPrefix$n, "-container"),
4633
+ className
4634
+ ], (_obj = {}, _define_property(_obj, "".concat(classPrefix$n, "-container-active"), isNative$1 && isTouchStart), _define_property(_obj, "".concat(classPrefix$n, "-container-harmony"), isHarmony), _define_property(_obj, "".concat(classPrefix$n, "-container-icontext"), icon && children), _obj)),
4635
+ style,
4636
+ onTouchStart: handleActiveStart,
4637
+ onTouchEnd: handleActiveEnd,
4638
+ onTouchCancel: handleActiveEnd,
4639
+ onClick: handleClick
4640
+ }, renderBody());
4641
+ };
4642
+ HoverButtonItem.displayName = "NutHoverButtonItem";
4643
+ var UI_BOTTOM_DISTANCE = 60;
4644
+ var defaultProps$1m = _object_spread({}, ComponentDefaults);
4645
+ var classPrefix$m = "nut-hoverbutton";
4646
+ var HoverButton = function(props) {
4647
+ var _$_object_spread = _object_spread({}, defaultProps$1m, props), children = _$_object_spread.children, zIndex = _$_object_spread.zIndex, tabbarHeight = _$_object_spread.tabbarHeight, className = _$_object_spread.className, style = _$_object_spread.style, icon = _$_object_spread.icon, onClick = _$_object_spread.onClick;
4648
+ var rtl = useRtl();
4649
+ var baseStyle = _object_spread({}, style);
4650
+ if (tabbarHeight) {
4651
+ baseStyle.bottom = pxTransform(tabbarHeight + UI_BOTTOM_DISTANCE);
4652
+ }
4653
+ if (typeof zIndex !== "undefined") {
4654
+ baseStyle.zIndex = zIndex;
4655
+ }
4656
+ var _obj;
4657
+ return /* @__PURE__ */ React.createElement(components.View, {
4658
+ className: classNames([
4659
+ "".concat(classPrefix$m, "-container"),
4660
+ className
4661
+ ], (_obj = {}, _define_property(_obj, "".concat(classPrefix$m, "-container-rtl"), rtl), _define_property(_obj, "".concat(classPrefix$m, "-container-rn"), Taro.getEnv() === "RN"), _obj)),
4662
+ style: baseStyle
4663
+ }, /* @__PURE__ */ React.createElement(components.View, {
4664
+ className: classPrefix$m
4665
+ }, children || icon && /* @__PURE__ */ React.createElement(HoverButtonItem, {
4666
+ icon,
4667
+ onClick
4668
+ })), /* @__PURE__ */ React.createElement(SafeArea, {
4669
+ position: "bottom"
4670
+ }));
4671
+ };
4672
+ HoverButton.displayName = "NutHoverButton";
4673
+ HoverButton.Item = HoverButtonItem;
4674
+ var defaultProps$1l = _object_spread_props(_object_spread({}, ComponentDefaults), {
4585
4675
  threshold: 200,
4586
4676
  zIndex: 900,
4587
4677
  duration: 1e3
4588
4678
  });
4589
- var isNative$2 = harmonyAndRn();
4590
4679
  var BackTop = function(props) {
4591
- var rtl = useRtl();
4592
- var _$_object_spread = _object_spread({}, defaultProps$1n, props), children = _$_object_spread.children, threshold = _$_object_spread.threshold, zIndex = _$_object_spread.zIndex, className = _$_object_spread.className, duration = _$_object_spread.duration, style = _$_object_spread.style, scrollRes = _$_object_spread.scrollRes, onClick = _$_object_spread.onClick;
4680
+ var _$_object_spread = _object_spread({}, defaultProps$1l, props), children = _$_object_spread.children, threshold = _$_object_spread.threshold, zIndex = _$_object_spread.zIndex, className = _$_object_spread.className, duration = _$_object_spread.duration, icon = _$_object_spread.icon, style = _$_object_spread.style, scrollRes = _$_object_spread.scrollRes, onClick = _$_object_spread.onClick;
4593
4681
  var classPrefix2 = "nut-backtop";
4594
4682
  var _useState = _sliced_to_array(React.useState(false), 2), backTop = _useState[0], setBackTop = _useState[1];
4595
- var _useState1 = _sliced_to_array(React.useState(false), 2), isTouchStart = _useState1[0], setTouchStart = _useState1[1];
4596
4683
  var _obj;
4597
- var cls = classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-show"), backTop), _define_property(_obj, "".concat(classPrefix2, "-show-active"), isNative$2 && isTouchStart), _define_property(_obj, "".concat(classPrefix2, "-rn"), rn()), _obj), className);
4684
+ var cls = classNames(classPrefix2, (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-show"), backTop), _define_property(_obj, "".concat(classPrefix2, "-rn"), rn()), _obj), className);
4598
4685
  var systemInfo = React.useRef({});
4599
4686
  React.useEffect(function() {
4600
4687
  Taro.getSystemInfo().then(function(res) {
4601
4688
  systemInfo.current = res;
4602
4689
  });
4603
4690
  }, []);
4604
- var handleActiveStart = React.useCallback(function() {
4605
- isNative$2 && setTouchStart(true);
4606
- }, []);
4607
- var handleActiveEnd = React.useCallback(function() {
4608
- isNative$2 && setTouchStart(false);
4609
- }, []);
4610
4691
  var onScroll = React.useCallback(function(res) {
4611
4692
  var scrollTop = res.scrollTop;
4612
4693
  setBackTop(scrollTop >= threshold);
@@ -4631,29 +4712,21 @@
4631
4712
  duration,
4632
4713
  onClick
4633
4714
  ]);
4634
- var styles = React.useMemo(function() {
4635
- var _obj2;
4636
- return Object.keys(style || {}).length !== 0 ? _object_spread({
4637
- zIndex
4638
- }, style) : (_obj2 = {}, _define_property(_obj2, rtl ? "left" : "right", pxTransform(10)), _define_property(_obj2, "bottom", pxTransform(20)), _define_property(_obj2, "zIndex", zIndex), _obj2);
4639
- }, [
4640
- rtl,
4641
- style,
4642
- zIndex
4643
- ]);
4644
- return /* @__PURE__ */ React.createElement(components.View, {
4715
+ return /* @__PURE__ */ React.createElement(HoverButton, {
4645
4716
  className: cls,
4646
- style: styles,
4717
+ style: _object_spread({
4718
+ zIndex
4719
+ }, style),
4720
+ icon: !children && (icon || /* @__PURE__ */ React.createElement(c, null)),
4647
4721
  onClick: function(e2) {
4648
4722
  goTop(e2);
4649
- },
4650
- onTouchStart: handleActiveStart,
4651
- onTouchEnd: handleActiveEnd,
4652
- onTouchCancel: handleActiveEnd
4653
- }, children || /* @__PURE__ */ React.createElement(c, {
4654
- size: 19,
4655
- className: "nut-backtop-main"
4656
- }));
4723
+ }
4724
+ }, children && /* @__PURE__ */ React.createElement(components.View, {
4725
+ className: "nut-hoverbutton-item-container",
4726
+ onClick: function(e2) {
4727
+ goTop(e2);
4728
+ }
4729
+ }, children));
4657
4730
  };
4658
4731
  BackTop.displayName = "NutBackTop";
4659
4732
  function _array_without_holes(arr) {
@@ -4687,7 +4760,7 @@
4687
4760
  return idRef.current;
4688
4761
  }
4689
4762
  var elevatorContext = /* @__PURE__ */ React.createContext({});
4690
- var defaultProps$1m = _object_spread_props(_object_spread({}, ComponentDefaults), {
4763
+ var defaultProps$1k = _object_spread_props(_object_spread({}, ComponentDefaults), {
4691
4764
  height: "200px",
4692
4765
  floorKey: "title",
4693
4766
  list: [],
@@ -4698,7 +4771,7 @@
4698
4771
  className: "weapp-elevator"
4699
4772
  });
4700
4773
  var Elevator = function(props) {
4701
- var _ref = _object_spread({}, defaultProps$1m, props), height = _ref.height, floorKey = _ref.floorKey, list = _ref.list, sticky = _ref.sticky, spaceHeight = _ref.spaceHeight;
4774
+ var _ref = _object_spread({}, defaultProps$1k, props), height = _ref.height, floorKey = _ref.floorKey, list = _ref.list, sticky = _ref.sticky, spaceHeight = _ref.spaceHeight;
4702
4775
  _ref.titleHeight;
4703
4776
  var showKeys = _ref.showKeys, className = _ref.className, style = _ref.style, onItemClick = _ref.onItemClick, onIndexClick = _ref.onIndexClick, children = _ref.children, rest = _object_without_properties(_ref, [
4704
4777
  "height",
@@ -4923,7 +4996,7 @@
4923
4996
  };
4924
4997
  Elevator.displayName = "NutElevator";
4925
4998
  Elevator.Context = elevatorContext;
4926
- var defaultProps$1l = _object_spread_props(_object_spread({}, ComponentDefaults), {
4999
+ var defaultProps$1j = _object_spread_props(_object_spread({}, ComponentDefaults), {
4927
5000
  activeText: "",
4928
5001
  inactiveText: "",
4929
5002
  type: "right",
@@ -4934,7 +5007,7 @@
4934
5007
  });
4935
5008
  var FixedNav = function(props) {
4936
5009
  var locale = useConfig().locale;
4937
- var _ref = _object_spread({}, defaultProps$1l, props), className = _ref.className, overlay = _ref.overlay, visible = _ref.visible, list = _ref.list, activeText = _ref.activeText, inactiveText = _ref.inactiveText, position = _ref.position, onChange = _ref.onChange, onSelect = _ref.onSelect, type2 = _ref.type, children = _ref.children, style = _ref.style, content = _ref.content, rest = _object_without_properties(_ref, [
5010
+ var _ref = _object_spread({}, defaultProps$1j, props), className = _ref.className, overlay = _ref.overlay, visible = _ref.visible, list = _ref.list, activeText = _ref.activeText, inactiveText = _ref.inactiveText, position = _ref.position, onChange = _ref.onChange, onSelect = _ref.onSelect, type2 = _ref.type, children = _ref.children, style = _ref.style, content = _ref.content, rest = _object_without_properties(_ref, [
4938
5011
  "className",
4939
5012
  "overlay",
4940
5013
  "visible",
@@ -5002,96 +5075,6 @@
5002
5075
  }, visible ? activeText || locale.fixednav.activeText : inactiveText || locale.fixednav.inactiveText))));
5003
5076
  };
5004
5077
  FixedNav.displayName = "NutFixedNav";
5005
- var getIcon = function(icon) {
5006
- return React.isValidElement(icon) ? React.cloneElement(icon, {
5007
- // @ts-ignore
5008
- className: "nut-icon"
5009
- }) : icon;
5010
- };
5011
- var defaultProps$1k = _object_spread_props(_object_spread({}, ComponentDefaults), {
5012
- icon: null,
5013
- onClick: function(value) {
5014
- }
5015
- });
5016
- var classPrefix$n = "nut-hoverbutton-item";
5017
- var isHarmony = harmony();
5018
- var isNative$1 = harmonyAndRn();
5019
- var HoverButtonItem = function(props) {
5020
- var _$_object_spread = _object_spread({}, defaultProps$1k, props), className = _$_object_spread.className, style = _$_object_spread.style, icon = _$_object_spread.icon, onClick = _$_object_spread.onClick, children = _$_object_spread.children;
5021
- var _useState = _sliced_to_array(React.useState(false), 2), isTouchStart = _useState[0], setTouchStart = _useState[1];
5022
- React.useMemo(function() {
5023
- return isNative$1 ? {
5024
- color: isTouchStart ? "#595959" : "#1A1A1A"
5025
- } : {};
5026
- }, [
5027
- isTouchStart
5028
- ]);
5029
- var handleClick = function(event) {
5030
- onClick && onClick(event);
5031
- };
5032
- var handleActiveStart = function(event) {
5033
- isNative$1 && setTouchStart(true);
5034
- };
5035
- var handleActiveEnd = function(event) {
5036
- isNative$1 && setTouchStart(false);
5037
- };
5038
- var renderBody = function() {
5039
- if (icon && !children) return /* @__PURE__ */ React.createElement(components.View, {
5040
- className: "".concat(classPrefix$n, "-icon")
5041
- }, getIcon(icon));
5042
- if (icon && children) {
5043
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(components.View, {
5044
- className: classNames(_define_property({}, "".concat(classPrefix$n, "-text-icon"), true))
5045
- }), getIcon(icon), /* @__PURE__ */ React.createElement(components.View, {
5046
- className: classNames(_define_property({}, "".concat(classPrefix$n, "-text"), true))
5047
- }, children));
5048
- }
5049
- };
5050
- var _obj;
5051
- return /* @__PURE__ */ React.createElement(components.View, {
5052
- className: classNames([
5053
- "".concat(classPrefix$n, "-container"),
5054
- className
5055
- ], (_obj = {}, _define_property(_obj, "".concat(classPrefix$n, "-container-active"), isNative$1 && isTouchStart), _define_property(_obj, "".concat(classPrefix$n, "-container-harmony"), isHarmony), _define_property(_obj, "".concat(classPrefix$n, "-container-icontext"), icon && children), _obj)),
5056
- style,
5057
- onTouchStart: handleActiveStart,
5058
- onTouchEnd: handleActiveEnd,
5059
- onTouchCancel: handleActiveEnd,
5060
- onClick: handleClick
5061
- }, renderBody());
5062
- };
5063
- HoverButtonItem.displayName = "NutHoverButtonItem";
5064
- var UI_BOTTOM_DISTANCE = 60;
5065
- var defaultProps$1j = _object_spread({}, ComponentDefaults);
5066
- var classPrefix$m = "nut-hoverbutton";
5067
- var HoverButton = function(props) {
5068
- var _$_object_spread = _object_spread({}, defaultProps$1j, props), children = _$_object_spread.children, zIndex = _$_object_spread.zIndex, tabbarHeight = _$_object_spread.tabbarHeight, className = _$_object_spread.className, style = _$_object_spread.style, icon = _$_object_spread.icon, onClick = _$_object_spread.onClick;
5069
- var rtl = useRtl();
5070
- var baseStyle = _object_spread({}, style);
5071
- if (tabbarHeight) {
5072
- baseStyle.bottom = pxTransform(tabbarHeight + UI_BOTTOM_DISTANCE);
5073
- }
5074
- if (typeof zIndex !== "undefined") {
5075
- baseStyle.zIndex = zIndex;
5076
- }
5077
- var _obj;
5078
- return /* @__PURE__ */ React.createElement(components.View, {
5079
- className: classNames([
5080
- "".concat(classPrefix$m, "-container"),
5081
- className
5082
- ], (_obj = {}, _define_property(_obj, "".concat(classPrefix$m, "-container-rtl"), rtl), _define_property(_obj, "".concat(classPrefix$m, "-container-rn"), Taro.getEnv() === "RN"), _obj)),
5083
- style: baseStyle
5084
- }, /* @__PURE__ */ React.createElement(components.View, {
5085
- className: classPrefix$m
5086
- }, children || icon && /* @__PURE__ */ React.createElement(HoverButtonItem, {
5087
- icon,
5088
- onClick
5089
- })), /* @__PURE__ */ React.createElement(SafeArea, {
5090
- position: "bottom"
5091
- }));
5092
- };
5093
- HoverButton.displayName = "NutHoverButton";
5094
- HoverButton.Item = HoverButtonItem;
5095
5078
  var defaultProps$1i = _object_spread_props(_object_spread({}, ComponentDefaults), {
5096
5079
  left: "",
5097
5080
  right: "",
@@ -5605,10 +5588,10 @@
5605
5588
  value: "",
5606
5589
  dot: false,
5607
5590
  max: 99,
5608
- top: "4",
5609
- right: "8",
5610
- color: "",
5611
- fill: "solid"
5591
+ top: 0,
5592
+ right: 0,
5593
+ fill: "solid",
5594
+ size: "large"
5612
5595
  });
5613
5596
  var Badge = function(props) {
5614
5597
  var content = function content2() {
@@ -5629,14 +5612,14 @@
5629
5612
  };
5630
5613
  var _this;
5631
5614
  var rtl = useRtl();
5632
- var _$_object_spread = _object_spread({}, defaultProps$1e, props), className = _$_object_spread.className, style = _$_object_spread.style, value = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right2 = _$_object_spread.right, color = _$_object_spread.color, fill = _$_object_spread.fill;
5615
+ var _$_object_spread = _object_spread({}, defaultProps$1e, props), className = _$_object_spread.className, style = _$_object_spread.style, value = _$_object_spread.value, max = _$_object_spread.max, children = _$_object_spread.children, dot = _$_object_spread.dot, top = _$_object_spread.top, right2 = _$_object_spread.right, fill = _$_object_spread.fill, size = _$_object_spread.size;
5633
5616
  var classPrefix2 = "nut-badge";
5634
5617
  var isHarmony2 = harmony();
5635
5618
  var classes = classNames(classPrefix2, className);
5636
5619
  var badgeRef = React.useRef(null);
5637
5620
  var _useState = _sliced_to_array(React.useState({}), 2), contentStyle = _useState[0], setContentStyle = _useState[1];
5638
5621
  var _obj;
5639
- var contentClasses = classNames("".concat(classPrefix2, "-content"), (_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix2, "-one"), typeof content() === "string" && ((_this = "".concat(content())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix2, "-dot"), dot), _define_property(_obj, "".concat(classPrefix2, "-").concat(fill), fill === "outline"), _obj));
5622
+ var contentClasses = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix2, "-sup"), isNumber() || isString() || dot), _define_property(_obj, "".concat(classPrefix2, "-number"), isNumber()), _define_property(_obj, "".concat(classPrefix2, "-one"), typeof content() === "string" && ((_this = "".concat(content())) === null || _this === void 0 ? void 0 : _this.length) === 1), _define_property(_obj, "".concat(classPrefix2, "-dot"), dot), _define_property(_obj, "".concat(classPrefix2, "-dot-").concat(size), dot), _define_property(_obj, "".concat(classPrefix2, "-").concat(fill), fill === "outline"), _define_property(_obj, "".concat(classPrefix2, "-content"), children), _obj));
5640
5623
  React.useEffect(function() {
5641
5624
  if (badgeRef.current) {
5642
5625
  getPositionStyle();
@@ -5644,59 +5627,22 @@
5644
5627
  }, []);
5645
5628
  var getPositionStyle = /* @__PURE__ */ function() {
5646
5629
  var _ref = _async_to_generator(function() {
5647
- var style2, reacts, dir;
5630
+ var style2, dir;
5648
5631
  return __generator(this, function(_state) {
5649
- switch (_state.label) {
5650
- case 0:
5651
- style2 = {};
5652
- style2.top = pxTransform(-Number(top) || 0);
5653
- if (!rn()) return [
5654
- 3,
5655
- 2
5656
- ];
5657
- return [
5658
- 4,
5659
- getRectByTaro(badgeRef.current)
5660
- ];
5661
- case 1:
5662
- reacts = _state.sent();
5663
- style2.left = (reacts === null || reacts === void 0 ? void 0 : reacts.width) && (reacts === null || reacts === void 0 ? void 0 : reacts.width) > Number(right2) ? pxTransform(reacts.width - Number(right2)) : 0;
5664
- return [
5665
- 3,
5666
- 3
5667
- ];
5668
- case 2:
5669
- dir = rtl ? "left" : "right";
5670
- style2[dir] = isHarmony2 ? pxTransform(Number(right2)) : "".concat(Number(right2) || parseFloat(String(right2)) || 0, "px");
5671
- _state.label = 3;
5672
- case 3:
5673
- setContentStyle(style2);
5674
- return [
5675
- 2
5676
- ];
5677
- }
5632
+ style2 = {};
5633
+ style2.top = pxTransform(Number(top) || 0);
5634
+ dir = rtl ? "left" : "right";
5635
+ style2[dir] = isHarmony2 ? pxTransform(Number(right2)) : "".concat(Number(right2) || 0, "px");
5636
+ setContentStyle(style2);
5637
+ return [
5638
+ 2
5639
+ ];
5678
5640
  });
5679
5641
  });
5680
5642
  return function getPositionStyle2() {
5681
5643
  return _ref.apply(this, arguments);
5682
5644
  };
5683
5645
  }();
5684
- var getStyle = function() {
5685
- var style2 = {};
5686
- if (color) {
5687
- if (fill === "outline") {
5688
- style2.color = color;
5689
- isHarmony2 ? style2.backgroundColor = "#fff" : style2.background = "#fff";
5690
- if (!(color === null || color === void 0 ? void 0 : color.includes("gradient"))) {
5691
- style2.borderColor = color;
5692
- }
5693
- } else {
5694
- style2.color = "#fff";
5695
- isHarmony2 ? style2.backgroundColor = color : style2.background = color;
5696
- }
5697
- }
5698
- return style2;
5699
- };
5700
5646
  var _obj1;
5701
5647
  return /* @__PURE__ */ React.createElement(components.View, {
5702
5648
  className: classes,
@@ -5707,7 +5653,7 @@
5707
5653
  style: contentStyle
5708
5654
  }, value), children, !isIcon() && /* @__PURE__ */ React.createElement(components.View, {
5709
5655
  className: contentClasses,
5710
- style: _object_spread({}, contentStyle, getStyle())
5656
+ style: contentStyle
5711
5657
  }, content()));
5712
5658
  };
5713
5659
  Badge.displayName = "NutBadge";
@@ -960,12 +960,6 @@ $tour-content-bottom-btn-border-radius: var(
960
960
  4px
961
961
  ) !default;
962
962
 
963
- //backtop(✅)
964
- $backtop-border-color: var(
965
- --nutui-backtop-border-color,
966
- $color-border
967
- ) !default;
968
-
969
963
  // calendar(✅)
970
964
  $calendar-active-background-color: var(
971
965
  --nutui-calendar-active-background-color,
@@ -1025,6 +1019,7 @@ $hoverbutton-position-right: var(
1025
1019
  --nutui-hoverbutton-position-right,
1026
1020
  $spacing-base
1027
1021
  ) !default;
1022
+ $hoverbutton-item-size: var(--nutui-hoverbutton-item-size, 40px) !default;
1028
1023
  $hoverbutton-item-border-color: var(
1029
1024
  --nutui-hoverbutton-item-border-color,
1030
1025
  rgba(0, 0, 0, 0.12)
@@ -1602,26 +1597,33 @@ $tag-mark-border-radius: var(
1602
1597
  $badge-height: var(--nutui-badge-height, 14px) !default;
1603
1598
  $badge-background-color: var(
1604
1599
  --nutui-badge-background-color,
1605
- $color-primary-gradient-1
1600
+ $color-primary
1606
1601
  ) !default;
1607
- $badge-color: var(--nutui-badge-color, #fff) !default;
1602
+ $badge-color: var(--nutui-badge-color, $color-primary-text) !default;
1608
1603
  $badge-font-size: var(--nutui-badge-font-size, $font-size-xxs) !default;
1609
1604
  $badge-border: var(
1610
1605
  --nutui-badge-border,
1611
- 0px solid $color-primary-text
1606
+ 1px solid $color-primary-text
1612
1607
  ) !default;
1613
1608
  $badge-border-radius: var(--nutui-badge-border-radius, $badge-height) !default;
1614
- $badge-min-width: var(--nutui-badge-min-width, 5px) !default;
1615
- $badge-padding: var(--nutui-badge-padding, 0 4px) !default;
1616
- $badge-icon-padding: var(--nutui-badge-icon-padding, 3px) !default;
1617
- $badge-icon-size: var(--nutui-badge-icon-size, 12px) !default;
1609
+ $badge-min-width: var(--nutui-badge-min-width, 6px) !default;
1610
+ $badge-padding: var(--nutui-badge-padding, 1px 4px) !default;
1611
+ $badge-icon-padding: var(--nutui-badge-icon-padding, 2px) !default;
1612
+ $badge-icon-size: var(--nutui-badge-icon-size, 10px) !default;
1618
1613
  $badge-content-transform: var(
1619
1614
  --nutui-badge-content-transform,
1620
- translateX(100%)
1615
+ translate(50%, -50%)
1621
1616
  ) !default;
1622
1617
  $badge-z-index: var(--nutui-badge-z-index, 1) !default;
1623
- $badge-dot-width: var(--nutui-badge-dot-width, 7px) !default;
1624
- $badge-dot-border: var(--nutui-badge-dot-border, 0px solid $color-primary-text);
1618
+ $badge-dot-width: var(--nutui-badge-dot-width, 6px) !default;
1619
+ $badge-dot-small-width: var(--nutui-badge-dot-width, 4px) !default;
1620
+ $badge-dot-large-width: var(--nutui-badge-dot-width, 8px) !default;
1621
+ $badge-dot-border: var(--nutui-badge-dot-border, 1px solid $color-primary-text);
1622
+ $badge-outline-color: var(--nutui-badge-outline-color, $color-primary) !default;
1623
+ $badge-outline-border: var(
1624
+ --nutui-badge-outline-border,
1625
+ 1px solid $color-primary
1626
+ );
1625
1627
 
1626
1628
  //popover(✅)
1627
1629
  $popover-border-radius: var(--nutui-popover-border-radius, 8px) !default;
@@ -2423,6 +2425,10 @@ $countup-border-radius: var(--nutui-countup-border-radius, 4px) !default;
2423
2425
  $countup-lr-margin: var(--nutui-countup-lr-margin, 0) !default;
2424
2426
  $countup-bg-color: var(--nutui-countup-bg-color, inherit) !default;
2425
2427
  $countup-color: var(--nutui-countup-color, $color-title) !default;
2428
+ $countup-separator-color: var(
2429
+ --nutui-countup-separator-color,
2430
+ $color-title
2431
+ ) !default;
2426
2432
 
2427
2433
  // layout(✅)
2428
2434
  $row-content-color: var(--nutui-row-content-color, #fff) !default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react-taro",
3
- "version": "3.0.0-beta.7",
3
+ "version": "3.0.0-beta.8",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/es/packages/nutui.react.build.js",