import { jsx } from "react/jsx-runtime";
import * as React from "react";
import { cn } from "../../lib/utils.js";
const FieldControlGroup = React.forwardRef(
  ({ size: _size = "md", block = false, className, children, ...props }, ref) => {
    return /* @__PURE__ */ jsx(
      "div",
      {
        ref,
        className: cn(
          block ? "flex w-full" : "inline-flex",
          "items-stretch",
          // z-index baseline + active layer
          "[&>*]:relative [&>*]:z-[2]",
          "[&>*:hover]:z-[3] [&>*:focus]:z-[3] [&>*:focus-within]:z-[3]",
          "[&>*[disabled]]:z-0 [&>*:has([disabled])]:z-0",
          // border overlap
          "[&>*+*]:-ml-px",
          // border radius — 中間 0,首/尾保留外側 radii
          "[&>*:not(:first-child):not(:last-child)]:rounded-none",
          "[&>*:first-child:not(:last-child)]:rounded-r-none",
          "[&>*:last-child:not(:first-child)]:rounded-l-none",
          // K12 fix(2026-05-04 v7 — semantic token):FCG 內 disabled cell border 用 `--border-opaque`:
          //   ✓ 保留 global `bg-disabled`(neutral-2 灰底)— disabled state 視覺主要承載
          //   ✓ 用 SEMANTIC `--border-opaque`(視覺等同 --border 但不跟 bg compositing)
          //   v6 直接消費 primitive `--color-neutral-5-opaque` 違反 token 4 規則「禁 primitive 色名作 utility」,
          //   v7 升 semantic alias `--border-opaque` 在 semantic.css(其 primitive 後盾仍是 neutral-5-opaque)
          //   → 對齊 Ant Design colorBorderSecondary solid idiom(table 外框 / row divider 用 solid,跟 input alpha border 視覺層級分)
          //   → 解決 alpha border 在 grey bg 上 composite 略深 perception(physical 對比問題)
          '[&>*[data-field-mode="disabled"]]:border-[var(--border-opaque)]',
          className
        ),
        "data-field-control-group": "",
        ...props,
        children
      }
    );
  }
);
FieldControlGroup.displayName = "FieldControlGroup";
const fieldControlGroupMeta = {
  component: "FieldControlGroup",
  family: "self-contained",
  variants: {},
  sizes: {},
  // self-contained wrapper;size prop no-op(children 尺寸自管)
  states: ["default", "children-hover", "children-focus", "children-disabled"],
  tokens: {
    bg: [],
    // structural wrapper has no own bg
    fg: [],
    border: ["var(--border-opaque)"]
    // K12 disabled cell border
  },
  defaultVariant: void 0,
  defaultSize: void 0
};
export {
  FieldControlGroup,
  fieldControlGroupMeta
};
//# sourceMappingURL=field-control-group.js.map
