"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BackButton = void 0;

var _react = _interopRequireDefault(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _icon = require("../../icon");

var _focus = require("../../../mixins/focus");

var _spacing = require("../../../mixins/spacing");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }

var StyledButton = _styledComponents["default"].button.withConfig({
  displayName: "StyledButton",
  componentId: "sc-1wqozc8-0"
})(["background:none;border:none;box-sizing:border-box;padding:8px;margin:0;border-radius:", ";", " &:not([disabled]){&:hover{background-color:", ";}&:active{background-color:", ";}}", "{box-shadow:", ",", " ", ";}", ""], _focus.focusedCircleRadius, (0, _focus.getBaseFocusState)({}), _focus.hoverBackgroundColor, _focus.activeBackgroundColor, _focus.FOCUS_VISIBLE_SELECTOR, _focus.focusedBoxShadow, _focus.focusedBorderShadow, _focus.focusedBorderColor, _spacing.getSpacingRules);

var BackButton = function BackButton(_ref) {
  var disabled = _ref.disabled,
      ariaLabel = _ref.ariaLabel,
      onClick = _ref.onClick,
      spacing = _ref.spacing,
      className = _ref.className,
      dataCy = _ref['data-cy'],
      dataQa = _ref['data-qa'],
      id = _ref.id,
      props = _objectWithoutProperties(_ref, ["disabled", "ariaLabel", "onClick", "spacing", "className", "data-cy", "data-qa", "id"]);

  return /*#__PURE__*/_react["default"].createElement(StyledButton, _extends({
    "data-qa": dataQa,
    type: "button",
    "aria-label": ariaLabel,
    onClick: onClick,
    disabled: disabled,
    spacing: spacing,
    className: className,
    "data-cy": dataCy,
    id: id
  }, props), /*#__PURE__*/_react["default"].createElement(_icon.ArrowBack, {
    disabled: disabled
  }));
};

exports.BackButton = BackButton;
BackButton.displayName = 'BackButton';