'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);

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

function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

var BaseTextGroup = _styledComponents2.default.div.withConfig({
  displayName: 'TextGroup__BaseTextGroup'
})(['', ';', ';'], function (props) {
  return props.nowrap ? '& > * { white-space: nowrap }' : '& > * { white-space: normal }';
}, function (props) {
  return props.inline ? '& > * { display: inline; margin-right: 2px; }' : '& > * { display: block; margin-bottom: 10px; }';
});
var TextGroup = function TextGroup(props) {
  var children = props.children,
      rest = _objectWithoutProperties(props, ['children']);

  return _react2.default.createElement(
    BaseTextGroup,
    rest,
    children
  );
};

TextGroup.propTypes = {
  nowrap: _propTypes2.default.bool.isRequired,
  inline: _propTypes2.default.bool.isRequired
};

TextGroup.defaultProps = {
  nowrap: false,
  inline: false
};

exports.default = TextGroup;