"use client";
import { jsx as e, jsxs as c } from "react/jsx-runtime";
import { forwardRef as h, createContext as N, useContext as b } from "react";
import { c as t } from "./cn-Bhsu1vx2.js";
import { R as k, N as I, O as w, bf as A, bg as y } from "./vendor-base-ui-DWIDNgE1.js";
const j = {
  variant: {
    default: {
      classes: "ring-kumo-line",
      description: "Default radio appearance"
    },
    error: {
      classes: "ring-destructive",
      description: "Error state for validation failures"
    }
  }
}, G = {
  variant: "default"
};
function V({
  variant: r = G.variant
} = {}) {
  return t(j.variant[r].classes);
}
const u = N({
  controlPosition: "start"
}), d = h(
  ({ className: r, disabled: a, variant: i = "default", label: o, value: s }, n) => {
    const { controlPosition: l } = b(u);
    return /* @__PURE__ */ c(
      "label",
      {
        className: t(
          "group relative inline-flex items-center gap-2",
          // "start" (default): radio before label
          // "end": label before radio using flex-row-reverse
          l === "end" && "flex-row-reverse justify-end",
          a ? "cursor-not-allowed opacity-50" : "cursor-pointer",
          r
        ),
        children: [
          /* @__PURE__ */ e(
            A,
            {
              ref: n,
              value: s,
              disabled: a,
              className: t(
                "flex h-4 w-4 items-center justify-center rounded-full border-0 bg-kumo-base ring",
                i === "error" ? "ring-kumo-danger" : "ring-kumo-line",
                !a && "group-hover:ring-kumo-ring focus-visible:ring-kumo-ring focus-visible:outline-offset-3",
                "data-checked:bg-kumo-contrast"
              ),
              children: /* @__PURE__ */ e(y, { className: "flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "h-2 w-2 rounded-full bg-kumo-base" }) })
            }
          ),
          /* @__PURE__ */ e("span", { className: "text-base font-medium text-kumo-default", children: o })
        ]
      }
    );
  }
);
d.displayName = "Radio.Item";
function m({
  legend: r,
  children: a,
  orientation: i = "vertical",
  error: o,
  description: s,
  defaultValue: n,
  value: l,
  onValueChange: f,
  disabled: p,
  controlPosition: g = "start",
  name: x,
  className: R
}) {
  return /* @__PURE__ */ e(u.Provider, { value: { controlPosition: g }, children: /* @__PURE__ */ e(
    k,
    {
      defaultValue: n,
      value: l,
      onValueChange: (v) => f?.(v),
      disabled: p,
      name: x,
      children: /* @__PURE__ */ c(
        I,
        {
          className: t(
            "flex flex-col gap-4 rounded-lg border border-kumo-line p-4",
            R
          ),
          children: [
            /* @__PURE__ */ e(w, { className: "text-lg font-medium text-kumo-default", children: r }),
            /* @__PURE__ */ e(
              "div",
              {
                className: t(
                  "flex gap-2",
                  i === "vertical" ? "flex-col" : "flex-row flex-wrap"
                ),
                children: a
              }
            ),
            o && /* @__PURE__ */ e("p", { className: "text-sm text-kumo-danger", children: o }),
            s && /* @__PURE__ */ e("p", { className: "text-sm text-kumo-subtle", children: s })
          ]
        }
      )
    }
  ) });
}
m.displayName = "Radio.Group";
const F = {
  Item: d,
  Group: m
};
export {
  j as K,
  F as R,
  m as a,
  G as b,
  V as r
};
//# sourceMappingURL=radio-BVAG7hNp.js.map
