'use strict';

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

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _dec, _class, _class2, _temp;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _Heading = require('@instructure/ui-elements/lib/components/Heading');

var _Heading2 = _interopRequireDefault(_Heading);

var _ScreenReaderContent = require('@instructure/ui-a11y/lib/components/ScreenReaderContent');

var _ScreenReaderContent2 = _interopRequireDefault(_ScreenReaderContent);

var _PresentationContent = require('@instructure/ui-a11y/lib/components/PresentationContent');

var _PresentationContent2 = _interopRequireDefault(_PresentationContent);

var _lib = require('@instructure/ui-themeable/lib');

var _lib2 = _interopRequireDefault(_lib);

var _theme = require('./theme');

var _theme2 = _interopRequireDefault(_theme);

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

var styles = {
  template: function template(theme) {
    return '/*  imported from styles.css  */\n\n.positionBox__styles__position {\n  height: ' + theme.positionDimension + ';\n  min-width: ' + theme.positionDimension + ';\n\n  margin-left: -1.2rem;\n  margin-right: ' + theme.positionMargin + ';\n\n  display: flex;\n  justify-content: center;\n  align-items: center;\n\n  background-color: ' + theme.positionBackgroundColor + ';\n  padding: 0 ' + theme.positionPadding + ';\n  z-index: ' + theme.positionZIndex + ';\n}\n\n.positionBox__styles__positionText {\n  font-size: ' + theme.positionTextFontSize + ';\n  color: ' + theme.positionTextColor + ';\n}\n';
  },
  'position': 'positionBox__styles__position',
  'positionText': 'positionBox__styles__positionText'
};
var PositionBox = (_dec = (0, _lib2.default)(_theme2.default, styles), _dec(_class = (_temp = _class2 = function (_Component) {
  (0, _inherits3.default)(PositionBox, _Component);

  function PositionBox() {
    (0, _classCallCheck3.default)(this, PositionBox);
    return (0, _possibleConstructorReturn3.default)(this, (PositionBox.__proto__ || Object.getPrototypeOf(PositionBox)).apply(this, arguments));
  }

  (0, _createClass3.default)(PositionBox, [{
    key: 'render',
    value: function render() {
      return _react2.default.createElement(
        'div',
        { className: styles.position },
        _react2.default.createElement(
          'div',
          { className: styles.positionText },
          _react2.default.createElement(
            _ScreenReaderContent2.default,
            { as: 'div' },
            _react2.default.createElement(
              _Heading2.default,
              { level: this.props.headingLevel },
              this.props.headingText
            )
          ),
          _react2.default.createElement(
            _PresentationContent2.default,
            null,
            this.props.position
          )
        )
      );
    }
  }]);
  PositionBox.displayName = 'PositionBox'
  ;
  return PositionBox;
}(_react.Component), _class2.propTypes = {
  headingText: _propTypes2.default.string.isRequired,
  headingLevel: _propTypes2.default.string,
  position: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]).isRequired
}, _class2.defaultProps = {
  headingLevel: 'h2'
}, _temp)) || _class);
exports.default = PositionBox;