"use client";
import { jsxs as u, 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-ccr5l0ynrievzzv3.js";
const V = {
  variant: "segmented"
};
function z({
  tabs: d,
  value: n,
  selectedValue: c,
  onValueChange: m,
  activateOnFocus: b,
  className: g,
  listClassName: f,
  indicatorClassName: v,
  variant: i = V.variant
}) {
  const s = d ?? [];
  if (s.length === 0)
    return null;
  const h = s[0]?.value, l = n !== void 0, p = {
    value: l ? n : void 0,
    defaultValue: l ? void 0 : c ?? h
  }, t = i === "segmented", o = i === "underline";
  return /* @__PURE__ */ u(
    k,
    {
      ...p,
      className: a("relative isolate min-w-0 font-medium", g),
      onValueChange: (e) => {
        const x = String(e);
        m?.(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-surface" }),
        /* @__PURE__ */ u(
          T,
          {
            activateOnFocus: b,
            className: a(
              "scrollbar-hide relative flex min-w-0 shrink items-stretch",
              t && "h-8.5 rounded-lg bg-kumo-recessed px-px",
              o && "h-7 gap-4 border-b border-kumo-ring pb-2",
              f
            ),
            children: [
              s.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",
                    o && "px-2 py-2.5 text-kumo-strong hover:bg-kumo-tint hover:text-kumo-subtle aria-selected:hover:bg-kumo-tint 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-base shadow-sm ring ring-kumo-ring",
                    o && "bottom-0 h-0.5 bg-kumo-brand",
                    v
                  )
                }
              )
            ]
          }
        )
      ]
    }
  );
}
export {
  z as T
};
//# sourceMappingURL=tabs-n0t7iro7wr0pzgk2.js.map
