"use strict";

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

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

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

var _typography = require("../../typography");

var _primitives = require("../../../primitives");

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

var _typography2 = require("../../../mixins/typography");

var _branding = require("../../../mixins/branding");

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

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

var _nextButton = require("./next-button.css-rules");

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

// Needs to be a button for accessibility, form-next semantic reasons.
var StyledButton = _styledComponents["default"].button.withConfig({
  displayName: "StyledButton",
  componentId: "sc-60g69u-0"
})(["background:none;border:none;display:flex;align-items:center;color:inherit;font-size:inherit;", " svg > g > g{transition:", ";}", "{svg{box-shadow:", " ", ",", ";border-radius:50%;}}&[disabled]{cursor:default;}&:not([disabled]):hover{svg > g > g{fill:", ";transition:", ";}}&:not([disabled]):active{svg > g > g{fill:", ";transition:", ";}}"], (0, _focus.getBaseFocusState)({
  activeTransition: false
}), _focus.transitionFade, _focus.FOCUS_VISIBLE_SELECTOR, (0, _focus.focusedBorderShadow)({
  inset: false
}), _focus.focusedBorderColor, _focus.focusedBoxShadow, _nextButton.getHoverFillColor, _focus.transitionInstant, (0, _branding.getPaletteColor)('brand-primary-fg'), _focus.transitionInstant);

var StyledContainer = (0, _styledComponents["default"])(_primitives.Box).withConfig({
  displayName: "StyledContainer",
  componentId: "sc-60g69u-1"
})(["padding:6px;", ""], _spacing.getSpacingRules);
var OffsetSpan = (0, _styledComponents["default"])(_typography.Span).withConfig({
  displayName: "OffsetSpan",
  componentId: "sc-60g69u-2"
})(["font-family:", ";padding-right:22px;display:-webkit-inline-box;-webkit-box-align:center;"], _typography2.getFontFamily);

var NextButton = function NextButton(_ref) {
  var children = _ref.children,
      disabled = _ref.disabled,
      spacing = _ref.spacing,
      className = _ref.className,
      dataCy = _ref['data-cy'],
      dataQa = _ref['data-qa'],
      id = _ref.id;
  return /*#__PURE__*/_react["default"].createElement(StyledContainer, {
    spacing: spacing,
    className: className,
    "data-cy": dataCy,
    "data-qa": dataQa,
    id: id
  }, /*#__PURE__*/_react["default"].createElement(StyledButton, {
    type: "submit",
    disabled: disabled
  }, children != null ? /*#__PURE__*/_react["default"].createElement(OffsetSpan, {
    fontSize: "f2",
    bold: true,
    colorName: "greyscale-dark"
  }, children) : null, /*#__PURE__*/_react["default"].createElement(_icon.NextIcon, {
    disabled: disabled
  })));
};

exports.NextButton = NextButton;
NextButton.displayName = 'NextButton';