'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 _themeGet = require('../../extensions/themeGet');

var _themeGet2 = _interopRequireDefault(_themeGet);

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

var HelpText = _styledComponents2.default.div.withConfig({ displayName: 'HelpText' }).withConfig({
  displayName: 'HelpText'
})(['color:', ';font-style:italic;font-weight:300;font-family:', ';'], function (props) {
  return props.error ? (0, _themeGet2.default)('colors.negative.default') : (0, _themeGet2.default)('colors.gray.medium');
}, (0, _themeGet2.default)('fonts.brand'));

HelpText.propTypes = {
  /**
   * Adds a class name to the element.
   */
  className: _propTypes2.default.string,
  /**
   * Adds an id to the element.
   */
  id: _propTypes2.default.string,
  /**
   * Whether this help text is in an error state
   */
  error: _propTypes2.default.bool
};

HelpText.defaultProps = {
  className: null,
  id: null
};

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