"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 _lib = _interopRequireDefault(require("@instructure/ui-themeable/lib"));

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

var _dec, _class, _class2, _temp;

var styles = {
  componentId: 'bEEaV',
  template: function template(theme) {
    return "\n\n.quiz-core__Caption--content {\n  margin: ".concat(theme.contentMargin || 'inherit', ";\n}\n\n.quiz-core__Caption--children {\n  padding-top: ").concat(theme.childrenPadding || 'inherit', ";\n}\n");
  },
  'content': 'quiz-core__Caption--content',
  'children': 'quiz-core__Caption--children'
};
var Caption = (_dec = (0, _lib.default)(_theme.default, styles), _dec(_class = (_temp = _class2 =
/*#__PURE__*/
function (_Component) {
  (0, _inherits2.default)(Caption, _Component);

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

  (0, _createClass2.default)(Caption, [{
    key: "render",
    value: function render() {
      return _react.default.createElement("div", {
        className: styles.content
      }, _react.default.createElement(_Heading.default, {
        level: "reset",
        as: "h2",
        border: "bottom"
      }, this.props.text), _react.default.createElement("div", {
        className: styles.children
      }, this.props.children));
    }
  }]);
  Caption.displayName = "Caption";
  return Caption;
}(_react.Component), _class2.propTypes = {
  text: _propTypes.default.string,
  children: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.arrayOf(_propTypes.default.object)])
}, _temp)) || _class);
exports.default = Caption;