'use strict';

exports.__esModule = true;

var _extends2 = require('babel-runtime/helpers/extends');

var _extends3 = _interopRequireDefault(_extends2);

var _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');

var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

var _Input = require('../Input');

var _Input2 = _interopRequireDefault(_Input);

var _Icon = require('../Icon');

var _Icon2 = _interopRequireDefault(_Icon);

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

/**
 * @category controls
 * @component search-input
 * @variations collab-ui-react
*/

var SearchInput = function SearchInput(props) {
  var type = props.type,
      otherProps = (0, _objectWithoutProperties3.default)(props, ['type']);


  return _react2.default.createElement(
    _Input2.default,
    (0, _extends3.default)({
      className: '' + (type === 'pill' ? 'cui-search-input--pill' : 'cui-search-input')
    }, otherProps),
    _react2.default.createElement(_Icon2.default, { name: '' + (type === 'pill' ? 'search_16' : 'search_20'), isAria: false })
  );
};

SearchInput.displayName = 'SearchInput';

SearchInput.defaultProps = {
  type: 'normal'
};

exports.default = SearchInput;

/**
* @name Normal Search Input
* @description Search inputs allow the user to input search text.
*
* @category controls
* @component search-input
* @section default
*
* @js

export default class DefaultSearchInput extends React.PureComponent {
  render() {
    return (
      <div className='row'>
        <SearchInput
          name='defaultSearchInput'
          htmlId='defaultSearchInput'
          inputSize='small-5'
        />
      </div>
    );
  }
}

**/

/**
* @name Pill Search Input
* @description To use the pill style search input, set <code>type='pill'</code>.
*
* @category controls
* @component search-input
* @section pill
*
* @js

export default class PillSearchInput extends React.PureComponent {
  render() {
    return (
      <div className='row'>
        <SearchInput
          name='pillSearchInput'
          htmlId='pillSearchInput'
          type='pill'
          inputSize='small-5'
        />
      </div>
    );
  }
}

**/

module.exports = exports['default'];