"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

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

var React = _interopRequireWildcard(require("react"));

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _Icons = require("../../Atoms/Icons");

var _Inputs = require("../../Atoms/Inputs");

var _injectE2E = _interopRequireDefault(require("../../Tools/injectE2E"));

var _interpolation = require("../../Tools/interpolation");

//  strict
var Wrapper =
/*#__PURE__*/
_styledComponents.default.div.withConfig({
  componentId: "t29ya6-0"
})(["\n  display: flex;\n  flex-direction: row;\n  justify-content: flex-start;\n  align-items: center;\n  width: ", ";\n  border-bottom: 1px solid ", ";\n  background-color: ", ";\n"], (0, _interpolation.prop)('width'), (0, _interpolation.theme)('searchBarUnderlinedBorderColor'), (0, _interpolation.theme)('searchBarUnderlinedBackgroundColor'));

var SearchInput =
/*#__PURE__*/
(0, _styledComponents.default)(_Inputs.Input).withConfig({
  componentId: "t29ya6-1"
})(["\n  & > input {\n    background-color: inherit;\n    border-color: transparent;\n\n    &:focus,\n    &:active {\n      box-shadow: none !important;\n    }\n  }\n"]);

var IconContainer =
/*#__PURE__*/
_styledComponents.default.div.attrs(_injectE2E.default).withConfig({
  componentId: "t29ya6-2"
})(["\n  display: flex;\n  flex-direction: row;\n  justify-content: center;\n  align-items: center;\n  width: 60px;\n  height: 40px;\n"]);

var SearchBarUnderlined = function SearchBarUnderlined(_ref) {
  var children = _ref.children,
      e2e = _ref.e2e,
      onClick = _ref.onClick,
      width = _ref.width,
      rest = (0, _objectWithoutProperties2.default)(_ref, ["children", "e2e", "onClick", "width"]);
  return React.createElement(Wrapper, {
    width: width
  }, React.createElement(SearchInput, (0, _extends2.default)({
    e2e: "".concat(e2e || '', ".Input")
  }, rest)), React.createElement(IconContainer, {
    e2e: "".concat(e2e || '', ".Button"),
    onClick: onClick
  }, React.createElement(_Icons.FasSearch, {
    selectable: true,
    size: "20px"
  })));
};

SearchBarUnderlined.propTypes = process.env.NODE_ENV !== "production" ? {
  children: _propTypes.default.node,
  e2e: _propTypes.default.string,
  onChange: _propTypes.default.func,
  onClick: _propTypes.default.func,
  value: _propTypes.default.any,
  width: _propTypes.default.string
} : {};
SearchBarUnderlined.defaultProps = {
  e2e: 'defaultSearchBarUnderlined',
  width: '100%'
};
var _default = SearchBarUnderlined;
exports.default = _default;