import { jsxs as b, Fragment as w, jsx as e } from "react/jsx-runtime";
import { forwardRef as y } from "react";
import { cx as C } from "../../utils/classNames.js";
import { useArrowTheme as I } from "../../hooks/useArrowTheme.js";
import { IconButton as _ } from "../icon-button/IconButton.js";
function L() {
  return /* @__PURE__ */ e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M10.5 4a6.5 6.5 0 1 1 0 13 6.5 6.5 0 0 1 0-13Zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9Zm8.9 11.5L22 20.1 20.1 22l-2.6-2.5 1.9-2Z" }) });
}
function Z() {
  return /* @__PURE__ */ e("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ e("path", { d: "M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm-3.7 5.3L7.3 8.3 11 12l-3.7 3.7 1.4 1.4L12.4 13.4l3.7 3.7 1.4-1.4L13.8 12l3.7-3.7-1.4-1.4-3.7 3.7-3.7-3.7Z" }) });
}
const B = y(
  ({
    id: i,
    menuId: o,
    labelId: a,
    isExpanded: t,
    value: n,
    disabled: r,
    isInvalid: l,
    describedBy: d,
    inverse: c,
    focused: m,
    searchIcon: s,
    clearIcon: h,
    clearButtonLabel: u = "Clear",
    onClear: p,
    className: f,
    ...g
  }, v) => {
    const x = I();
    return c ?? x.inverse, /* @__PURE__ */ b(w, { children: [
      /* @__PURE__ */ e(
        "input",
        {
          ref: v,
          className: C(
            "tdds-field__select",
            "tdds-menu__trigger",
            {
              "force-focus": !!m
            },
            f
          ),
          id: i,
          type: "text",
          role: "combobox",
          "aria-autocomplete": "none",
          "aria-controls": o,
          "aria-describedby": d || void 0,
          "aria-disabled": r || void 0,
          "aria-expanded": t,
          "aria-invalid": l || void 0,
          "aria-labelledby": a,
          readOnly: r || void 0,
          ...g
        }
      ),
      /* @__PURE__ */ e("span", { className: "tdds-field__leading-decoration", children: s ?? /* @__PURE__ */ e(L, {}) }),
      n && /* @__PURE__ */ e(
        _,
        {
          a11yLabel: u,
          ariaHidden: !0,
          disabled: r,
          icon: h ?? /* @__PURE__ */ e(Z, {}),
          tabIndex: -1,
          onClick: p
        }
      )
    ] });
  }
);
B.displayName = "SearchingInput";
export {
  B as SearchingInput
};
//# sourceMappingURL=SearchingInput.js.map
