"use strict";

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

require("core-js/modules/es6.object.assign");

require("core-js/modules/web.dom.iterable");

require("core-js/modules/es6.array.iterator");

require("core-js/modules/es6.object.keys");

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 _objectWithoutPropertiesLoose(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]; } return target; }

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

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

SearchInput.propTypes = {
  /** @prop Style of search input normal or pill | 'normal' */
  type: _propTypes.default.oneOf(['normal', 'pill'])
};
SearchInput.defaultProps = {
  type: 'normal'
};
SearchInput.displayName = 'SearchInput';
var _default = SearchInput;
/**
* @component input-search
* @section default
* @react
import { SearchInput } from '@collab-ui/react';

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

**/

/**
* @component input-search
* @section pill
* @react
import { SearchInput } from '@collab-ui/react';

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

**/

exports.default = _default;