import { jsx as e, jsxs as m } from "react/jsx-runtime";
import { Button as l } from "../components/Button/Button.es.js";
import { ButtonEmphasis as s, ButtonStyle as d, ButtonSize as w } from "../components/Button/ButtonTypes.es.js";
import { LoadingCircle as u, LoadingCircleSize as p } from "../components/LoadingCircle/LoadingCircle.es.js";
import b from "../foundation/Icon/Generated/IconCheckMark16.es.js";
import f from "../foundation/Icon/Generated/IconCross16.es.js";
import x from "../foundation/Icon/Generated/IconExclamationMarkTriangle16.es.js";
import h from "../foundation/Icon/Generated/IconEye16.es.js";
import y from "../foundation/Icon/Generated/IconEyeOff16.es.js";
import { generateRandomId as k } from "./generateRandomId.es.js";
import { Validation as n, validationTextClassMap as I } from "./validation.es.js";
const L = {
  base: "tw-flex tw-items-center tw-justify-between tw-gap-2 tw-px-3 tw-transition tw-text-sm tw-font-sans tw-relative tw-bg-base tw-border tw-rounded tw-line-mid",
  width: "tw-w-full",
  height: "tw-h-9 tw-min-h-[2.35rem]",
  element: "tw-bg-transparent tw-border-line-mid tw-text-text tw-placeholder-text-x-weak tw-outline-none tw-p-2",
  focus: "focus:tw-border-line-strong",
  hover: "hover:tw-border-line-strong",
  disabled: "disabled:tw-bg-box-disabled disabled:tw-border-line-weak disabled:tw-text-text-disabled disabled:hover:tw-cursor-not-allowed disabled:hover:tw-border-line-weak",
  readOnly: "read-only:tw-bg-box-disabled read-only:tw-border-none read-only:tw-text-text-weak read-only:hover:tw-cursor-not-allowed read-only:hover:tw-border-line-weak"
}, g = (o, r) => {
  let t;
  switch (o) {
    case n.Success:
      t = /* @__PURE__ */ e(b, {});
      break;
    case n.Error:
    case n.Warning:
      t = /* @__PURE__ */ e(x, {});
      break;
    case n.Loading:
      t = /* @__PURE__ */ e(u, { size: p.Small });
      break;
    default:
      t = null;
  }
  return t ? /* @__PURE__ */ e("span", { className: I[o], "data-test-id": `${r}-status-icon`, children: t }) : null;
};
g.displayName = "FondueGetStatusIcon";
const C = ({
  clearable: o,
  disabled: r,
  obfuscated: t,
  isObfuscated: a,
  callbacks: i,
  dataTestId: c = "fondue-input-actions"
}) => /* @__PURE__ */ m("span", { className: "tw-flex tw-items-center tw-justify-between tw-w-auto", children: [
  t && /* @__PURE__ */ e(
    l,
    {
      size: w.Small,
      style: d.Default,
      disabled: r,
      emphasis: s.Weak,
      onClick: i.password,
      title: `${a ? "show" : "hide"} text input`,
      "aria-label": `${a ? "show" : "hide"} text input`,
      icon: a ? /* @__PURE__ */ e(h, {}) : /* @__PURE__ */ e(y, {}),
      "data-test-id": `${c}-visibility-icon`
    }
  ),
  o && /* @__PURE__ */ e(
    l,
    {
      style: d.Default,
      onClick: i.clearable,
      disabled: r,
      emphasis: s.Weak,
      icon: /* @__PURE__ */ e(f, {}),
      title: "Clear Input",
      size: w.Small,
      "aria-label": "Clear value",
      "data-test-id": `${c}-clear`
    }
  )
] });
C.displayName = "FondueInputActionButtons";
const v = ({ actions: o, disabled: r, dataTestId: t }) => o.map((a) => {
  const i = k();
  return /* @__PURE__ */ e(
    l,
    {
      style: d.Default,
      onClick: a.callback,
      disabled: r,
      emphasis: s.Weak,
      icon: a.icon,
      size: w.Small,
      "aria-describedby": "Clear Input Value",
      "aria-label": "Clear value",
      title: a.title,
      "data-test-id": `${t}-extra-action`
    },
    `extra-action-${i}`
  );
});
v.displayName = "FondueInputExtraActions";
export {
  g as GetStatusIcon,
  C as InputActions,
  v as InputExtraActions,
  L as InputStyles
};
//# sourceMappingURL=input.es.js.map
