"use client";
import { jsx as e } from "react/jsx-runtime";
import * as d from "react";
import { useContext as l } from "react";
import { c as s } from "./cn-ct4n7r74mh8y0f48.js";
import { i as m, I as p } from "./input-c8jmidy7gdqfiky1.js";
import { B as x } from "./button-j0hi0afn33w9lxgi.js";
const I = {
  focusMode: "container"
}, r = d.createContext(
  null
);
function v({
  size: n,
  children: i,
  className: o,
  focusMode: t = I.focusMode
}) {
  const u = d.useId(), c = d.useId(), f = d.useMemo(
    () => ({ size: n, inputId: u, descriptionId: c, focusMode: t }),
    [n, u, c, t]
  ), a = t === "individual";
  return /* @__PURE__ */ e(r.Provider, { value: f, children: /* @__PURE__ */ e(
    "div",
    {
      className: s(
        m({ size: n, parentFocusIndicator: !a }),
        "flex w-full gap-0 border-0 px-0",
        a ? "isolate overflow-visible" : "overflow-hidden shadow-xs ring ring-kumo-line focus-within:ring-kumo-ring",
        o
      ),
      children: i
    }
  ) });
}
function h({ children: n }) {
  const i = l(r), o = i?.focusMode === "individual";
  return /* @__PURE__ */ e(
    "label",
    {
      htmlFor: i?.inputId,
      className: s(
        "flex h-full items-center p-0 px-2 text-kumo-subtle",
        o && "first:rounded-l-[inherit] last:rounded-r-[inherit]"
      ),
      children: n
    }
  );
}
function b(n) {
  const i = l(r), o = i?.focusMode === "individual";
  return /* @__PURE__ */ e(
    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",
        o ? "relative ring ring-kumo-line first:rounded-l-[inherit] last:rounded-r-[inherit] focus:z-1 focus:outline" : "focus:border-kumo-fill",
        n.className
      )
    }
  );
}
function g({ children: n }) {
  const i = l(r), o = i?.focusMode === "individual";
  return /* @__PURE__ */ e(
    "span",
    {
      id: i?.descriptionId,
      className: s(
        "flex h-full items-center p-0 px-2 text-kumo-subtle",
        o && "first:rounded-l-[inherit] last:rounded-r-[inherit]"
      ),
      children: n
    }
  );
}
function k({
  children: n,
  className: i,
  ...o
}) {
  const t = l(r), u = t?.focusMode === "individual";
  return /* @__PURE__ */ e(
    x,
    {
      ...o,
      size: t?.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-1 focus:outline",
        i
      ),
      children: n
    }
  );
}
const U = Object.assign(v, {
  Label: h,
  Input: b,
  Button: k,
  Description: g
});
export {
  U as I
};
//# sourceMappingURL=input-group-cjsy8kh4vf9312xl.js.map
