import './Textfield.styles_uqu15l.css';
import { styled } from '@linaria/react';
import { IconDisclosureDownCentered } from '../../../../../_Icon/Icons/IconDisclosureDownCentered.js';
import { tokens } from '../../../../Select.tokens.js';
import { component, mergeConfig } from '../../../../../../engines/common.js';
import { textFieldConfig } from '../../../../../TextField/TextField.js';

var mergedConfig = /*#__PURE__*/mergeConfig(textFieldConfig);
var TextField = /*#__PURE__*/component(mergedConfig);
var _exp = function _exp() {
  return TextField;
};
var _exp5 = function _exp5() {
  return function (_ref) {
    var opened = _ref.opened;
    return opened ? "var(".concat(tokens.textFieldBackgroundColorFocus, ")") : "var(".concat(tokens.textFieldBackgroundColor, ")");
  };
};
var _exp7 = function _exp7() {
  return function (_ref2) {
    var opened = _ref2.opened;
    return opened ? "var(".concat(tokens.textFieldBorderColorFocus, ")") : "var(".concat(tokens.textFieldBorderColor, ")");
  };
};
var _exp27 = function _exp27() {
  return function (_ref3) {
    var opened = _ref3.opened;
    return opened ? "var(".concat(tokens.textFieldPlaceholderColorFocus, ")") : "var(".concat(tokens.textFieldPlaceholderColor, ")");
  };
};
var _exp29 = function _exp29() {
  return function (_ref4) {
    var opened = _ref4.opened;
    return opened ? "var(".concat(tokens.textFieldBackgroundColorFocus, ")") : "var(".concat(tokens.textFieldBackgroundColorHover, ")");
  };
};
var _exp31 = function _exp31() {
  return function (_ref5) {
    var opened = _ref5.opened;
    return opened ? "var(".concat(tokens.textFieldBorderColorFocus, ")") : "var(".concat(tokens.textFieldBorderColorHover, ")");
  };
};
var StyledTextField = /*#__PURE__*/styled(_exp())({
  name: "StyledTextField",
  "class": "sdt199r",
  propsAsIs: true,
  vars: {
    "sdt199r-0": [/*#__PURE__*/_exp5()],
    "sdt199r-1": [/*#__PURE__*/_exp7()],
    "sdt199r-2": [/*#__PURE__*/_exp27()],
    "sdt199r-3": [/*#__PURE__*/_exp29()],
    "sdt199r-4": [/*#__PURE__*/_exp31()]
  }
});
var _exp297 = function _exp297() {
  return function (_ref6) {
    var disabled = _ref6.disabled,
      readOnly = _ref6.readOnly;
    return disabled || readOnly ? 'inherit' : 'pointer';
  };
};
var _exp299 = function _exp299() {
  return function (_ref7) {
    var disabled = _ref7.disabled,
      readOnly = _ref7.readOnly;
    return disabled || readOnly ? "var(".concat(tokens.disclosureIconColor, ")") : "var(".concat(tokens.disclosureIconColorHover, ")");
  };
};
var _exp300 = function _exp300() {
  return function (_ref8) {
    var readOnly = _ref8.readOnly;
    return readOnly ? "var(".concat(tokens.disclosureIconOpacityReadOnly, ")") : '';
  };
};
var IconArrowWrapper = /*#__PURE__*/styled('div')({
  name: "IconArrowWrapper",
  "class": "i1i9xdpm",
  propsAsIs: false,
  vars: {
    "i1i9xdpm-0": [/*#__PURE__*/_exp297()],
    "i1i9xdpm-1": [/*#__PURE__*/_exp299()],
    "i1i9xdpm-2": [/*#__PURE__*/_exp300()]
  }
});

// TODO: Удалить после поддержки JS переменных в конфиге компонент
var sizeMap = {
  xs: '1rem',
  s: '1.5rem'
};
var _exp301 = function _exp301() {
  return IconDisclosureDownCentered;
};
var _exp303 = function _exp303() {
  return function (_ref9) {
    var _ref9$size = _ref9.size,
      size = _ref9$size === void 0 ? 'xs' : _ref9$size;
    return "var(".concat(tokens.disclosureIconSize, ", ").concat(sizeMap[size], ")");
  };
};
var StyledArrow = /*#__PURE__*/styled(_exp301())({
  name: "StyledArrow",
  "class": "s4ocf4f",
  propsAsIs: true,
  vars: {
    "s4ocf4f-0": [/*#__PURE__*/_exp303()]
  }
});
var StyledLeftHelper = /*#__PURE__*/styled('span')({
  name: "StyledLeftHelper",
  "class": "s20b3o9",
  propsAsIs: false
});

export { IconArrowWrapper, StyledArrow, StyledLeftHelper, StyledTextField, sizeMap };
