import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
//  strict
import PropTypes from 'prop-types';
import * as React from 'react';
import styled from 'styled-components';
import injectE2E from '../../Tools/injectE2E';
import { fontSize, theme } from '../../Tools/interpolation';
var Wrapper =
/*#__PURE__*/
styled.button.attrs(injectE2E).withConfig({
  componentId: "sc-1t2k7dn-0"
})(["\n  display: flex;\n  flex-direction: row;\n  justify-content: center;\n  align-items: center;\n  height: 2.5rem;\n  line-height: 2.5rem;\n  width: 100%;\n  padding: 0 1rem;\n  box-sizing: border-box;\n  color: ", ";\n  background-color: ", ";\n  border: none;\n  border-radius: ", ";\n  cursor: ", ";\n  outline: none;\n  transition: all 0.3s ease 0s;\n  opacity: ", ";\n  font-family: ", ";\n  font-size: ", ";\n  font-weight: 600;\n\n  &:hover {\n    background-color: ", ";\n    transform: ", ";\n  }\n"], theme('buttonColor'), theme('buttonBackgroundColor'), theme('buttonBorderRadius'), function (props) {
  return props.disabled === true ? 'not-allowed' : 'pointer';
}, function (props) {
  return props.disabled === true ? 0.5 : 1;
}, theme('fontPrimary'), fontSize('md'), function (props) {
  return props.disabled === true ? theme('buttonBackgroundColor')(props) : theme('buttonHoverColor')(props);
}, function (props) {
  return props.bounced === true ? 'scale(0.95)' : 'none';
});

var Button = function Button(_ref) {
  var children = _ref.children,
      rest = _objectWithoutProperties(_ref, ["children"]);

  return React.createElement(Wrapper, rest, children);
};

Button.propTypes = process.env.NODE_ENV !== "production" ? {
  bounced: PropTypes.bool,
  children: PropTypes.node,
  disabled: PropTypes.bool,
  e2e: PropTypes.string,
  type: PropTypes.oneOf(['button', 'reset', 'submit'])
} : {};
Button.defaultProps = {
  bounced: false,
  disabled: false,
  e2e: 'defaultButton',
  type: 'button'
};
export default Button;