"use client";
import { jsxs as d, jsx as a } from "react/jsx-runtime";
import { c as s } from "./cn-ct4n7r74mh8y0f48.js";
import { bd as x, be as T, bf as w, bg as N } from "./vendor-base-ui-ie71jahf0czyf58j.js";
const V = {
  variant: "segmented"
};
function z({
  tabs: u,
  value: n,
  selectedValue: m,
  onValueChange: c,
  activateOnFocus: b,
  className: g,
  listClassName: f,
  indicatorClassName: h,
  variant: i = V.variant
}) {
  const o = u ?? [];
  if (o.length === 0)
    return null;
  const v = o[0]?.value, l = n !== void 0, p = {
    value: l ? n : void 0,
    defaultValue: l ? void 0 : m ?? v
  }, t = i === "segmented", r = i === "underline";
  return /* @__PURE__ */ d(
    x,
    {
      ...p,
      className: s("relative isolate min-w-0 font-medium", g),
      onValueChange: (e) => {
        const k = String(e);
        c?.(k);
      },
      children: [
        t && /* @__PURE__ */ a("div", { className: "absolute inset-x-0 top-1/2 z-0 h-9 -translate-y-1/2 rounded-lg bg-kumo-recessed" }),
        /* @__PURE__ */ d(
          T,
          {
            activateOnFocus: b,
            className: s(
              "scrollbar-hide relative flex min-w-0 shrink items-stretch",
              t && "h-9 rounded-lg bg-kumo-recessed px-0.5 ring ring-kumo-hairline/70",
              r && "h-7 gap-4 border-b border-kumo-hairline pb-2",
              f
            ),
            children: [
              o.map((e) => /* @__PURE__ */ a(
                w,
                {
                  value: e.value,
                  render: e.render,
                  className: s(
                    "relative z-2 flex cursor-pointer items-center rounded bg-transparent text-base whitespace-nowrap focus:outline-none focus:ring-kumo-focus/50 focus-visible:ring-2 focus-visible:ring-kumo-brand",
                    t && "my-0.5 rounded-md px-2.5 text-kumo-strong hover:text-kumo-default aria-selected:text-kumo-default focus-visible:ring-inset",
                    r && "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__ */ a(
                N,
                {
                  render: (e) => /* @__PURE__ */ a(
                    "div",
                    {
                      ...e,
                      className: s(
                        "absolute z-1 left-0",
                        "w-(--active-tab-width) translate-x-(--active-tab-left) transition-all duration-200",
                        "data-[rendered=false]:scale-90 data-[rendered=false]:opacity-0",
                        t && "top-(--active-tab-top) h-(--active-tab-height) rounded-md bg-kumo-base shadow-sm ring ring-kumo-line",
                        r && "bottom-0 h-0.5 bg-kumo-brand",
                        h
                      )
                    }
                  )
                }
              )
            ]
          }
        )
      ]
    }
  );
}
export {
  z as T
};
//# sourceMappingURL=tabs-jywwt8ebjqjkux75.js.map
