'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 _AccessibleContent = require('@instructure/ui-a11y/lib/components/AccessibleContent');

var _AccessibleContent2 = _interopRequireDefault(_AccessibleContent);

var _Text = require('@instructure/ui-elements/lib/components/Text');

var _Text2 = _interopRequireDefault(_Text);

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._2fIYKHaU5lv-X63VHeGoab {\n  padding: ' + theme.infoBoxPadding + ';\n}\n';
  },
  'infoBox': '_2fIYKHaU5lv-X63VHeGoab'
};
var InfoBox = (_dec = (0, _lib2.default)(_theme2.default, styles), _dec(_class = (_temp = _class2 = function (_Component) {
  (0, _inherits3.default)(InfoBox, _Component);

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

  (0, _createClass3.default)(InfoBox, [{
    key: 'render',
    value: function render() {
      var content = _react2.default.createElement(
        'span',
        null,
        _react2.default.createElement(
          _Text2.default,
          { as: 'div', color: 'primary', size: 'xx-large', weight: 'bold' },
          this.props.mainText
        ),
        _react2.default.createElement(
          _Text2.default,
          { color: 'secondary' },
          this.props.subText
        )
      );

      if (this.props.accessibilityText) {
        content = _react2.default.createElement(
          _AccessibleContent2.default,
          { alt: this.props.accessibilityText },
          content
        );
      }

      return _react2.default.createElement(
        'div',
        { className: styles.infoBox },
        content
      );
    }
  }]);
  InfoBox.displayName = 'InfoBox'
  ;
  return InfoBox;
}(_react.Component), _class2.propTypes = {
  mainText: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
  subText: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
  accessibilityText: _propTypes2.default.string
}, _class2.defaultProps = {
  mainText: null,
  subText: null,
  accessibilityText: null
}, _temp)) || _class);
exports.default = InfoBox;