"use strict";

exports.__esModule = true;
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _ = require("./..");

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

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }

/**
 * @category controls
 * @component search-input
 * @variations collab-ui-react
*/
var SearchInput = function SearchInput(props) {
  var type = props.type,
      otherProps = _objectWithoutProperties(props, ["type"]);

  return _react.default.createElement(_.Input, _extends({
    className: "" + (type === 'pill' ? 'cui-search-input--pill' : 'cui-search-input')
  }, otherProps), _react.default.createElement(_.Icon, {
    name: "" + (type === 'pill' ? 'search_16' : 'search_20'),
    isAria: false
  }));
};

SearchInput.displayName = 'SearchInput';
SearchInput.defaultProps = {
  type: 'normal'
};
SearchInput.propTypes = {
  /** style of search input normal or pill */
  type: _propTypes.default.oneOf(['normal', 'pill'])
};
var _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>
    );
  }
}

**/

exports.default = _default;