"use strict";

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

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

var _ = require("./");

var _examplesList = _interopRequireDefault(require("./examples-list"));

var _button = require("../button");

var _block = require("../block");

var _index = require("../styles/index");

var _examples$DEFAULT$exa;

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

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var SpacedButton = (0, _index.styled)(_button.Button, function (_ref) {
  var $theme = _ref.$theme;
  return {
    marginLeft: $theme.sizing.scale200,
    marginRight: $theme.sizing.scale200,
    marginTop: $theme.sizing.scale200
  };
});

var DefaultExampleComponent =
/*#__PURE__*/
function (_React$Component) {
  _inherits(DefaultExampleComponent, _React$Component);

  function DefaultExampleComponent() {
    var _getPrototypeOf2;

    var _this;

    _classCallCheck(this, DefaultExampleComponent);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DefaultExampleComponent)).call.apply(_getPrototypeOf2, [this].concat(args)));

    _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "state", {
      current: 0
    });

    return _this;
  }

  _createClass(DefaultExampleComponent, [{
    key: "render",
    value: function render() {
      var _this2 = this;

      var _this$props = this.props,
          isNumber = _this$props.isNumber,
          isOverriden = _this$props.isOverriden;
      var GenericStep = isNumber ? _.NumberedStep : _.Step;
      var overrideProps = isOverriden ? {
        overrides: {
          Icon: {
            style: {
              backgroundColor: 'red'
            }
          },
          InnerIcon: {
            style: {
              backgroundColor: 'red'
            }
          },
          Tail: {
            style: {
              ':after': {
                content: '""',
                display: 'inline-block',
                height: '100%',
                width: '100%',
                backgroundColor: 'red'
              }
            }
          }
        }
      } : {};
      return _react.default.createElement(_.ProgressSteps, {
        current: this.state.current
      }, _react.default.createElement(GenericStep, _extends({
        title: "Create Account"
      }, overrideProps), _react.default.createElement(_block.Block, {
        font: "font400"
      }, _react.default.createElement("div", null, "Here is some step content"), _react.default.createElement("div", null, _react.default.createElement(SpacedButton, {
        disabled: true
      }, "Previous"), _react.default.createElement(SpacedButton, {
        onClick: function onClick() {
          return _this2.setState({
            current: 1
          });
        }
      }, "Next")))), _react.default.createElement(GenericStep, _extends({
        title: "Verify Payment"
      }, overrideProps), _react.default.createElement(_block.Block, {
        font: "font400"
      }, _react.default.createElement("div", null, "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit..."), _react.default.createElement("div", null, _react.default.createElement(SpacedButton, {
        onClick: function onClick() {
          return _this2.setState({
            current: 0
          });
        }
      }, "Previous"), _react.default.createElement(SpacedButton, {
        onClick: function onClick() {
          return _this2.setState({
            current: 2
          });
        }
      }, "Next")))), _react.default.createElement(GenericStep, _extends({
        title: "Add Payment Method"
      }, overrideProps), _react.default.createElement(_block.Block, {
        font: "font400"
      }, _react.default.createElement("div", null, "Here is some step content"), _react.default.createElement("div", null, _react.default.createElement(SpacedButton, {
        onClick: function onClick() {
          return _this2.setState({
            current: 1
          });
        }
      }, "Previous"), _react.default.createElement(SpacedButton, {
        disabled: true
      }, "Next")))));
    }
  }]);

  return DefaultExampleComponent;
}(_react.default.Component);

_defineProperty(DefaultExampleComponent, "defaultProps", {
  isNumber: false,
  isOverriden: false
});

var _default = (_examples$DEFAULT$exa = {}, _defineProperty(_examples$DEFAULT$exa, _examplesList.default.DEFAULT, function Story1() {
  return _react.default.createElement(DefaultExampleComponent, null);
}), _defineProperty(_examples$DEFAULT$exa, _examplesList.default.NUMBERED, function Story2() {
  return _react.default.createElement(DefaultExampleComponent, {
    isNumber: true
  });
}), _defineProperty(_examples$DEFAULT$exa, _examplesList.default.OVERRIDES, function Story3() {
  return _react.default.createElement(DefaultExampleComponent, {
    isOverriden: true
  });
}), _examples$DEFAULT$exa);

exports.default = _default;