import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
import { forwardRef, createElement, Fragment } from 'react';
import _pt from 'prop-types';

var BaseButton = forwardRef(function (props, ref) {
  var children = props.children,
      _props$disabled = props.disabled,
      disabled = _props$disabled === void 0 ? false : _props$disabled,
      _props$loading = props.loading,
      loading = _props$loading === void 0 ? false : _props$loading,
      _props$loadingLabel = props.loadingLabel,
      loadingLabel = _props$loadingLabel === void 0 ? "Loading" : _props$loadingLabel,
      LoadingIcon = props.LoadingIcon,
      _props$type = props.type,
      type = _props$type === void 0 ? "button" : _props$type,
      _props$ButtonComponen = props.ButtonComponent,
      ButtonComponent = _props$ButtonComponen === void 0 ? "button" : _props$ButtonComponen,
      rest = _objectWithoutProperties(props, ["children", "disabled", "loading", "loadingLabel", "LoadingIcon", "type", "ButtonComponent"]);

  return /*#__PURE__*/createElement(ButtonComponent, _extends({
    disabled: loading ? true : disabled,
    type: type
  }, rest, {
    ref: ref
  }), loading ? /*#__PURE__*/createElement(Fragment, null, loadingLabel && /*#__PURE__*/createElement("span", null, loadingLabel), " ", LoadingIcon && /*#__PURE__*/createElement(LoadingIcon, null)) : children);
});
BaseButton.propTypes = {
  loading: _pt.bool,
  loadingLabel: _pt.node,
  LoadingIcon: _pt.elementType,
  ButtonComponent: _pt.elementType
};
BaseButton.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "BaseButton"
};

if (typeof STORYBOOK_REACT_CLASSES !== "undefined") {
  STORYBOOK_REACT_CLASSES["src/components/BaseButton/BaseButton.tsx"] = {
    name: "BaseButton",
    docgenInfo: BaseButton.__docgenInfo,
    path: "src/components/BaseButton/BaseButton.tsx"
  };
}

export { BaseButton };
//# sourceMappingURL=BaseButton.esm.js.map
