"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.InputLayout = void 0;var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));var _react = _interopRequireDefault(require("react"));

var _forwardRefAndName = require("../../../lib/forwardRefAndName");

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

var _CommonWrapper = require("../../../internal/CommonWrapper");

var _InputLayoutAside = require("./InputLayoutAside");

var _InputLayoutContext = require("./InputLayoutContext");
var _InputLayout = require("./InputLayout.styles");









var InputLayout = exports.InputLayout = (0, _forwardRefAndName.forwardRefAndName)('InputLayout', function (props, ref) {
  var leftIcon = props.leftIcon,rightIcon = props.rightIcon,prefix = props.prefix,suffix = props.suffix,labelProps = props.labelProps,context = props.context,children = props.children,_props$tag = props.tag,tag = _props$tag === void 0 ? 'label' : _props$tag;
  var _context = (0, _extends2.default)({}, _InputLayoutContext.InputLayoutContextDefault, context);
  var Tag = tag;

  return /*#__PURE__*/(
    _react.default.createElement(_InputLayoutContext.InputLayoutContext.Provider, { value: _context }, /*#__PURE__*/
    _react.default.createElement(_CommonWrapper.CommonWrapper, props, /*#__PURE__*/
    _react.default.createElement(Tag, (0, _extends2.default)({ ref: ref, "data-tid": _Input.InputDataTids.root }, labelProps), /*#__PURE__*/
    _react.default.createElement(_InputLayoutAside.InputLayoutAside, { icon: leftIcon, text: prefix, side: "left" }), /*#__PURE__*/
    _react.default.createElement("span", { className: _InputLayout.stylesLayout.input() }, children), /*#__PURE__*/
    _react.default.createElement(_InputLayoutAside.InputLayoutAside, { icon: rightIcon, text: suffix, side: "right" })
    )
    )
    ));

});