@bigbinary/neetoui 5.2.44 → 5.2.45

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.
package/index.js CHANGED
@@ -15755,6 +15755,8 @@ var Tooltip = function Tooltip(_ref) {
15755
15755
  };
15756
15756
 
15757
15757
  var _excluded$G = ["icon", "iconPosition", "iconSize", "label", "loading", "onClick", "to", "type", "style", "fullWidth", "className", "disabled", "size", "href", "tooltipProps", "children"];
15758
+ function ownKeys$n(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15759
+ function _objectSpread$m(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15758
15760
  var BUTTON_STYLES = {
15759
15761
  primary: "primary",
15760
15762
  secondary: "secondary",
@@ -15829,9 +15831,8 @@ var Button = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
15829
15831
  }
15830
15832
  }
15831
15833
  var handleClick = function handleClick(e) {
15832
- if (!loading && !disabled) {
15833
- onClick(e);
15834
- }
15834
+ if (loading || disabled) return;
15835
+ onClick(e);
15835
15836
  };
15836
15837
  var Icon = typeof icon === "string" ? function () {
15837
15838
  return /*#__PURE__*/React__default.createElement("i", {
@@ -15842,8 +15843,6 @@ var Button = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
15842
15843
  return /*#__PURE__*/React__default.createElement(Tooltip, _extends$4({
15843
15844
  disabled: !tooltipProps
15844
15845
  }, tooltipProps), /*#__PURE__*/React__default.createElement(Parent, _extends$4({
15845
- disabled: disabled,
15846
- ref: ref,
15847
15846
  className: classnames$1("neeto-ui-btn", [className], {
15848
15847
  "neeto-ui-btn--style-primary": style === BUTTON_STYLES.primary,
15849
15848
  "neeto-ui-btn--style-secondary": style === BUTTON_STYLES.secondary,
@@ -15859,21 +15858,18 @@ var Button = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
15859
15858
  disabled: disabled
15860
15859
  }),
15861
15860
  onClick: handleClick
15862
- }, elementSpecificProps, otherProps), renderLabel && /*#__PURE__*/React__default.createElement("span", null, renderLabel), /*#__PURE__*/React__default.createElement(AnimatePresence, {
15863
- mode: "wait"
15864
- }, icon ? /* When Icon is present, animate between the icon and the spinner*/
15865
- loading ? /*#__PURE__*/React__default.createElement(Spinner$1, {
15861
+ }, _objectSpread$m(_objectSpread$m({
15862
+ disabled: disabled,
15863
+ ref: ref
15864
+ }, elementSpecificProps), otherProps)), renderLabel && /*#__PURE__*/React__default.createElement("span", null, renderLabel), icon ? loading ? /*#__PURE__*/React__default.createElement(Spinner$1, {
15866
15865
  "aria-hidden": "true",
15867
15866
  className: "neeto-ui-btn__spinner",
15868
- key: "1",
15869
15867
  size: 16
15870
15868
  }) : /*#__PURE__*/React__default.createElement(Icon, {
15871
15869
  "aria-hidden": "true",
15872
15870
  className: "neeto-ui-btn__icon",
15873
- key: "2",
15874
15871
  size: iconSize
15875
- }) : /* When Icon is not present, animate the margin from 0 to the needed value*/
15876
- loading && /*#__PURE__*/React__default.createElement(motion.div, {
15872
+ }) : /*#__PURE__*/React__default.createElement(AnimatePresence, null, loading && /*#__PURE__*/React__default.createElement(motion.div, {
15877
15873
  animate: {
15878
15874
  width: "auto",
15879
15875
  scale: 1