"use client";
import { jsxs as d, jsx as r } from "react/jsx-runtime";
import { c as a } from "./cn-Bhsu1vx2.js";
import { b2 as k, b3 as T, b4 as w, b5 as N } from "./vendor-base-ui-Bsg5ebHI.js";
const V = {
  variant: "segmented"
};
function z({
  tabs: u,
  value: n,
  selectedValue: m,
  onValueChange: c,
  activateOnFocus: b,
  className: f,
  listClassName: g,
  indicatorClassName: v,
  variant: i = V.variant
}) {
  const o = u ?? [];
  if (o.length === 0)
    return null;
  const h = o[0]?.value, l = n !== void 0, p = {
    value: l ? n : void 0,
    defaultValue: l ? void 0 : m ?? h
  }, t = i === "segmented", s = i === "underline";
  return /* @__PURE__ */ d(
    k,
    {
      ...p,
      className: a("relative min-w-0 font-medium", f),
      onValueChange: (e) => {
        const x = String(e);
        c?.(x);
      },
      children: [
        t && /* @__PURE__ */ r("div", { className: "absolute inset-x-0 top-1/2 -z-10 h-8.5 -translate-y-1/2 rounded-lg bg-kumo-tint" }),
        /* @__PURE__ */ d(
          T,
          {
            activateOnFocus: b,
            className: a(
              "scrollbar-hide relative flex min-w-0 shrink items-stretch",
              t && "h-8.5 rounded-lg bg-kumo-tint px-px",
              s && "h-7 gap-4 border-b border-kumo-line pb-2",
              g
            ),
            children: [
              o.map((e) => /* @__PURE__ */ r(
                w,
                {
                  value: e.value,
                  className: a(
                    "relative z-10 flex cursor-pointer items-center rounded bg-transparent text-base whitespace-nowrap hover:border-kumo-tint focus-visible:rounded-none focus-visible:ring-kumo-ring focus-visible:outline-offset-3",
                    t && "my-px rounded-lg px-2.5 text-kumo-strong aria-selected:text-kumo-default",
                    s && "mb-2 text-kumo-strong hover:text-kumo-subtle aria-selected:font-medium aria-selected:text-kumo-default",
                    e.className
                  ),
                  children: e.label
                },
                e.value
              )),
              /* @__PURE__ */ r(
                N,
                {
                  className: a(
                    "absolute z-0 transition-[left,width,transform] duration-200 ease-out",
                    "data-[rendered=false]:scale-90 data-[rendered=false]:opacity-0",
                    "left-(--active-tab-left) w-(--active-tab-width)",
                    t && "top-(--active-tab-top) h-(--active-tab-height) rounded-lg bg-kumo-overlay shadow-sm ring ring-kumo-fill-hover",
                    s && "bottom-0 h-0.5 bg-kumo-brand",
                    v
                  )
                }
              )
            ]
          }
        )
      ]
    }
  );
}
export {
  z as T
};
//# sourceMappingURL=tabs-B-Fxc6Zo.js.map
