'use strict';

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

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

var _styledComponents = require('styled-components');

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _cleanTag = require('clean-tag');

var _cleanTag2 = _interopRequireDefault(_cleanTag);

var _themeGet = require('../../extensions/themeGet');

var _themeGet2 = _interopRequireDefault(_themeGet);

var _userTextSpacing = require('../../extensions/userTextSpacing');

var _userTextSpacing2 = _interopRequireDefault(_userTextSpacing);

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

var LINE_HEIGHT = 1.25;

var H3 = (0, _styledComponents2.default)(_cleanTag2.default.h3).withConfig({ displayName: 'H3' }).attrs({
  spacing: _userTextSpacing2.default.withLineHeight(LINE_HEIGHT)
}).withConfig({
  displayName: 'H3'
})(['color:', ';font-weight:300;font-family:', ';font-size:1.75em;line-height:', ';letter-spacing:0;margin:', ';padding:0;'], (0, _themeGet2.default)('colors.text.default'), (0, _themeGet2.default)('fonts.brand'), LINE_HEIGHT, function (props) {
  return props.spacing;
});

H3.propTypes = {
  /**
   * Specify a CSS value or an object { top, right, bottom, left } or { vertical, horizontal } to
   * control the spacing around the heading. Defaults to a large space below the element.
   */
  spacing: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
  /**
   * Adds a class name to the element.
   */
  className: _propTypes2.default.string,
  /**
   * Adds an id to the element.
   */
  id: _propTypes2.default.string
};

H3.defaultProps = {
  spacing: { bottom: 'lg' },
  className: null,
  id: null
};

H3.Primary = (0, _styledComponents2.default)(H3).withConfig({
  displayName: 'H3__Primary'
})(['color:', ';'], (0, _themeGet2.default)('colors.primary.default'));

/**
 * @component
 */
exports.default = H3;