'use strict';

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

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

var _styledComponents2 = _interopRequireDefault(_styledComponents);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

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

var _cleanTag2 = _interopRequireDefault(_cleanTag);

var _userSpacing = require('../../extensions/userSpacing');

var _userSpacing2 = _interopRequireDefault(_userSpacing);

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

var P = (0, _styledComponents2.default)(_cleanTag2.default.p).attrs({
  spacing: _userSpacing2.default.text
}).withConfig({
  displayName: 'P'
})(['margin:', ';font-size:1em;'], function (props) {
  return props.spacing;
});

P.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
};

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

exports.default = P;