"use client";
import { jsx as o } from "react/jsx-runtime";
import * as d from "react";
import { useContext as c } from "react";
import { c as s } from "./cn-Bhsu1vx2.js";
import { i as m, I as p } from "./input-Dqvc2AB_.js";
import { B as x } from "./button-E2-hZMZE.js";
const I = {
  focusMode: "container"
}, r = d.createContext(
  null
);
function v({
  size: n,
  children: i,
  className: t,
  focusMode: e = I.focusMode
}) {
  const u = d.useId(), l = d.useId(), f = d.useMemo(
    () => ({ size: n, inputId: u, descriptionId: l, focusMode: e }),
    [n, u, l, e]
  ), a = e === "individual";
  return /* @__PURE__ */ o(r.Provider, { value: f, children: /* @__PURE__ */ o(
    "div",
    {
      className: s(
        m({ size: n, parentFocusIndicator: !a }),
        "flex w-full gap-0 border-0 px-0",
        a ? "overflow-visible" : "overflow-hidden shadow-xs ring ring-kumo-line focus-within:ring-kumo-ring",
        t
      ),
      children: i
    }
  ) });
}
function h({ children: n }) {
  const i = c(r), t = i?.focusMode === "individual";
  return /* @__PURE__ */ o(
    "label",
    {
      htmlFor: i?.inputId,
      className: s(
        "flex h-full items-center p-0 px-2 text-kumo-subtle",
        t && "first:rounded-l-[inherit] last:rounded-r-[inherit]"
      ),
      children: n
    }
  );
}
function b(n) {
  const i = c(r), t = i?.focusMode === "individual";
  return /* @__PURE__ */ o(
    p,
    {
      id: i?.inputId,
      "aria-describedby": i?.descriptionId,
      size: i?.size,
      ...n,
      className: s(
        "flex h-full items-center rounded-none border-0 bg-kumo-base font-sans",
        "grow px-2",
        t ? "relative ring ring-kumo-line first:rounded-l-[inherit] last:rounded-r-[inherit] focus:z-10 focus:outline" : "focus:border-kumo-fill",
        n.className
      )
    }
  );
}
function g({ children: n }) {
  const i = c(r), t = i?.focusMode === "individual";
  return /* @__PURE__ */ o(
    "span",
    {
      id: i?.descriptionId,
      className: s(
        "flex h-full items-center p-0 px-2 text-kumo-subtle",
        t && "first:rounded-l-[inherit] last:rounded-r-[inherit]"
      ),
      children: n
    }
  );
}
function k({
  children: n,
  className: i,
  ...t
}) {
  const e = c(r), u = e?.focusMode === "individual";
  return /* @__PURE__ */ o(
    x,
    {
      ...t,
      size: e?.size,
      className: s(
        "h-full! rounded-none disabled:bg-kumo-overlay disabled:text-kumo-inactive!",
        u && "relative ring ring-kumo-line first:rounded-l-[inherit] last:rounded-r-[inherit] focus:z-10 focus:outline",
        i
      ),
      children: n
    }
  );
}
const R = Object.assign(v, {
  Label: h,
  Input: b,
  Button: k,
  Description: g
});
export {
  R as I
};
//# sourceMappingURL=input-group-Bl6tgD5-.js.map
