"use client";
import { jsxs as h, jsx as e } from "react/jsx-runtime";
import { c as a } from "./cn-ct4n7r74mh8y0f48.js";
import { L as m } from "./label-be8m7qzlakzig2sl.js";
import { O as f, P as p, aR as u, aS as x } from "./vendor-base-ui-ie71jahf0czyf58j.js";
const F = {
  // Field currently has no variant options but structure is ready for future additions
}, _ = {};
function d({
  controlFirst: s = !1
} = {}) {
  return a(
    // Base styles - vertical layout (default)
    "grid gap-2",
    // Horizontal layout for checkbox and switch
    // Default: Grid auto-reverses in RTL (desired)
    "has-[input[type=checkbox]]:grid-cols-[auto_1fr] has-[input[type=checkbox]]:items-center",
    "has-[[role=switch]]:grid-cols-[auto_1fr] has-[[role=switch]]:items-center",
    // Control first: use flexbox with row-reverse to flip visual order without affecting text direction
    // flex-row-reverse in LTR: Control→Label, in RTL: Label→Control (opposite of grid default)
    s && [
      "has-[input[type=checkbox]]:flex has-[input[type=checkbox]]:flex-row-reverse has-[input[type=checkbox]]:flex-wrap has-[input[type=checkbox]]:items-center",
      "has-[[role=switch]]:flex has-[[role=switch]]:flex-row-reverse has-[[role=switch]]:flex-wrap has-[[role=switch]]:items-center",
      "[&>label]:flex-1"
    ]
  );
}
function y({
  children: s,
  label: c,
  required: o,
  labelTooltip: i,
  error: t,
  description: l,
  controlFirst: r = !1
}) {
  const n = o === !1;
  return /* @__PURE__ */ h(f, { className: d({ controlFirst: r }), children: [
    /* @__PURE__ */ e(p, { className: "m-0 text-base font-medium text-kumo-default", children: /* @__PURE__ */ e(m, { showOptional: n, tooltip: i, asContent: !0, children: c }) }),
    s,
    t ? /* @__PURE__ */ e(
      u,
      {
        className: a(
          "text-sm leading-snug text-kumo-danger",
          // Span full width in horizontal layout
          "col-span-full"
        ),
        match: t.match,
        children: t.message
      }
    ) : l && /* @__PURE__ */ e(
      x,
      {
        className: a(
          "text-sm leading-snug text-kumo-subtle",
          // Span full width in horizontal layout
          "col-span-full"
        ),
        children: l
      }
    )
  ] });
}
export {
  y as F,
  F as K,
  _ as a,
  d as f
};
//# sourceMappingURL=field-lnj619xpe8zjd26r.js.map
