"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));

var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));

var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

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

var _propTypes = _interopRequireDefault(require("prop-types"));

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

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

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

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

var _theme = _interopRequireDefault(require("./theme"));

var _dec, _class, _class2, _temp;

var styles = {
  componentId: 'hgbnX',
  template: function template(theme) {
    return "\n\n.quiz-core__positionBox--position {\n  height: ".concat(theme.positionDimension || 'inherit', ";\n  min-width: ").concat(theme.positionDimension || 'inherit', ";\n\n  margin-left: -1.2rem;\n  margin-right: ").concat(theme.positionMargin || 'inherit', ";\n\n  display: flex;\n  justify-content: center;\n  align-items: center;\n\n  background-color: ").concat(theme.positionBackgroundColor || 'inherit', ";\n  padding: 0 ").concat(theme.positionPadding || 'inherit', ";\n  z-index: ").concat(theme.positionZIndex || 'inherit', ";\n}\n\n.quiz-core__positionBox--positionText {\n  font-size: ").concat(theme.positionTextFontSize || 'inherit', ";\n  color: ").concat(theme.positionTextColor || 'inherit', ";\n}\n");
  },
  'position': 'quiz-core__positionBox--position',
  'positionText': 'quiz-core__positionBox--positionText'
};
var PositionBox = (_dec = (0, _lib.default)(_theme.default, styles), _dec(_class = (_temp = _class2 =
/*#__PURE__*/
function (_Component) {
  (0, _inherits2.default)(PositionBox, _Component);

  function PositionBox() {
    (0, _classCallCheck2.default)(this, PositionBox);
    return (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(PositionBox).apply(this, arguments));
  }

  (0, _createClass2.default)(PositionBox, [{
    key: "render",
    value: function render() {
      return _react.default.createElement("div", {
        className: styles.position
      }, _react.default.createElement("div", {
        className: styles.positionText,
        "data-automation": "sdk-position-box-text"
      }, _react.default.createElement(_ScreenReaderContent.default, {
        as: "div"
      }, _react.default.createElement(_Heading.default, {
        level: this.props.headingLevel
      }, this.props.headingText)), _react.default.createElement(_PresentationContent.default, null, this.props.position)));
    }
  }]);
  PositionBox.displayName = "PositionBox";
  return PositionBox;
}(_react.Component), _class2.propTypes = {
  headingText: _propTypes.default.string.isRequired,
  headingLevel: _propTypes.default.string,
  position: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
}, _class2.defaultProps = {
  headingLevel: 'h2'
}, _temp)) || _class);
exports.default = PositionBox;