"use client";
import { jsxs as d, jsx as r } from "react/jsx-runtime";
import { c as a } from "./cn-ct4n7r74mh8y0f48.js";
import { b4 as k, b5 as T, b6 as w, b7 as N } from "./vendor-base-ui-kxxocm122zr4pipe.js";
const y = {
  variant: "segmented"
};
function z({
  tabs: u,
  value: n,
  selectedValue: m,
  onValueChange: c,
  activateOnFocus: b,
  className: g,
  listClassName: v,
  indicatorClassName: f,
  variant: i = y.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 isolate min-w-0 font-medium", g),
      onValueChange: (e) => {
        const x = String(e);
        c?.(x);
      },
      children: [
        t && /* @__PURE__ */ r("div", { className: "absolute inset-x-0 top-1/2 z-0 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",
              v
            ),
            children: [
              o.map((e) => /* @__PURE__ */ r(
                w,
                {
                  value: e.value,
                  render: e.render,
                  className: a(
                    "relative z-2 flex cursor-pointer items-center rounded bg-transparent text-base whitespace-nowrap focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-kumo-ring",
                    t && "my-px rounded-lg px-2.5 text-kumo-strong hover:text-kumo-default aria-selected:text-kumo-default focus-visible:ring-inset",
                    s && "px-2 py-2.5 text-kumo-strong hover:bg-kumo-tint/50 hover:text-kumo-subtle aria-selected:hover:bg-transparent aria-selected:font-medium aria-selected:text-kumo-default",
                    e.className
                  ),
                  children: e.label
                },
                e.value
              )),
              /* @__PURE__ */ r(
                N,
                {
                  className: a(
                    "absolute z-1 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",
                    f
                  )
                }
              )
            ]
          }
        )
      ]
    }
  );
}
export {
  z as T
};
//# sourceMappingURL=tabs-n3rcvuzx0gbslyy6.js.map
