import { ArrowChevronDown16BoldTertiaryIcon, ArrowChevronDown16BoldBlueIcon, ArrowChevronUp16BoldBlueIcon, Search16BlueIcon, ArrowChevronDown16BoldSecondaryIcon, ArrowChevronUp16BoldSecondaryIcon, Search16SecondaryIcon } from '@cloudtower/icons-react';
import Icon from '../Icon/index.js';
import LegacySelect from '../LegacySelect/index.js';
import { Typo } from '../Typo/index.js';
import useParrotTranslation from '../../hooks/useParrotTranslation.js';
import cs from 'classnames';
import React__default from 'react';
import { SelectStyle, SelectIconStyle, SelectSizeStyle, PlaceholderTextStyle } from './select.style.js';

var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
  for (var prop in b || (b = {}))
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
const Select = (props) => {
  const { size = "middle", isLoadingValue } = props;
  const { t } = useParrotTranslation();
  const typo = {
    large: Typo.Label.l2_regular,
    middle: Typo.Label.l3_regular,
    small: Typo.Label.l4_regular
  }[size];
  return /* @__PURE__ */ React__default.createElement(
    LegacySelect,
    __spreadProps(__spreadValues({}, props), {
      className: cs(
        SelectStyle,
        SelectIconStyle,
        SelectSizeStyle,
        isLoadingValue ? "select-loading-value" : "",
        props.className
      ),
      placeholder: /* @__PURE__ */ React__default.createElement("span", { className: cs(typo, PlaceholderTextStyle) }, isLoadingValue ? t("components.loading") : props.placeholder),
      suffixIcon: props.suffixIcon || (props.loading ? void 0 : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-suffix",
          src: ArrowChevronDown16BoldTertiaryIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-hover-suffix",
          src: ArrowChevronDown16BoldBlueIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-active-suffix",
          src: ArrowChevronDown16BoldBlueIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-expanded-suffix",
          src: ArrowChevronUp16BoldBlueIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-expanded-search-suffix",
          src: Search16BlueIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-focus-suffix",
          src: ArrowChevronDown16BoldTertiaryIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-error-suffix",
          src: ArrowChevronDown16BoldTertiaryIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-error-hover-suffix",
          src: ArrowChevronDown16BoldSecondaryIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-error-active-suffix",
          src: ArrowChevronDown16BoldSecondaryIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-error-expanded-suffix",
          src: ArrowChevronUp16BoldSecondaryIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-error-expanded-search-suffix",
          src: Search16SecondaryIcon
        }
      ), /* @__PURE__ */ React__default.createElement(
        Icon,
        {
          className: "select-error-focus-suffix",
          src: ArrowChevronDown16BoldTertiaryIcon
        }
      )))
    })
  );
};
var Select$1 = Select;

export { Select$1 as default };
