"use client";
import { jsx as t } from "react/jsx-runtime";
import { forwardRef as l } from "react";
import { c as r } from "./cn-Bhsu1vx2.js";
import { C as m } from "./checkbox-CfFoTNFI.js";
const h = {
  layout: {
    auto: {
      classes: "",
      description: "Auto table layout - columns resize based on content"
    },
    fixed: {
      classes: "table-fixed",
      description: "Fixed table layout - columns have equal width, controlled via colgroup"
    }
  },
  variant: {
    default: {
      classes: "",
      description: "Default row variant"
    },
    selected: {
      classes: "bg-kumo-tint",
      description: "Selected row variant"
    }
  }
}, g = {
  layout: "auto",
  variant: "default"
}, f = l(({ layout: a = "auto", ...e }, s) => {
  const o = r(
    "w-full",
    h.layout[a].classes,
    "[&_tr_td]:border-b [&_tr_td]:border-kumo-fill [&_tr:last-child_td]:border-b-0",
    // Row border
    "[&_tr_td]:p-3",
    // Cell padding
    "[&_tr_th]:border-b [&_tr_th]:border-kumo-fill [&_tr_th]:p-3 [&_tr_th]:font-semibold",
    // Header styles
    "[&_tr_th]:bg-kumo-base",
    // Header background color
    "text-left text-kumo-default",
    e.className
  );
  return /* @__PURE__ */ t("table", { ref: s, ...e, className: o });
}), T = l((a, e) => /* @__PURE__ */ t("thead", { ref: e, ...a })), b = l((a, e) => {
  const s = r("group relative", a.className);
  return /* @__PURE__ */ t("th", { ref: e, ...a, className: s });
}), N = l(({ variant: a = g.variant, ...e }, s) => {
  const o = r(
    h.variant[a].classes,
    e.className
  );
  return /* @__PURE__ */ t("tr", { ref: s, ...e, className: o });
}), _ = l((a, e) => /* @__PURE__ */ t("tbody", { ref: e, ...a })), u = l((a, e) => /* @__PURE__ */ t("td", { ref: e, ...a })), y = l((a, e) => /* @__PURE__ */ t("tfoot", { ref: e, ...a })), p = l((a, e) => /* @__PURE__ */ t(
  "button",
  {
    ref: e,
    ...a,
    type: "button",
    "aria-label": "Resize column",
    className: r(
      "invisible h-full group-hover:visible",
      // Make the handle invisible by default
      "w-[10px]",
      // Hitting area
      "flex items-center justify-center",
      // Center the handle
      "cursor-col-resize touch-none select-none",
      // Prevent selection and touch events
      "absolute top-0 right-0",
      // Position the handle
      "m-0 bg-kumo-base p-0"
      // Override the stratus button styles
    ),
    children: /* @__PURE__ */ t("span", { className: "h-5 w-[2px] rounded bg-kumo-ring" })
  }
)), C = l(
  ({ checked: a, indeterminate: e, onValueChange: s, label: o, disabled: c, ...n }, i) => /* @__PURE__ */ t(
    u,
    {
      ref: i,
      ...n,
      className: r("w-10 leading-none", n.className),
      children: /* @__PURE__ */ t(
        m,
        {
          checked: a,
          indeterminate: e,
          onCheckedChange: (d) => {
            s?.(d);
          },
          "aria-label": o ?? "Select row",
          disabled: c,
          className: "relative before:absolute before:-inset-3 before:content-['']"
        }
      )
    }
  )
), k = l(
  ({ checked: a, indeterminate: e, onValueChange: s, label: o, disabled: c, ...n }, i) => /* @__PURE__ */ t(
    b,
    {
      ref: i,
      ...n,
      className: r("w-10 leading-none", n.className),
      children: /* @__PURE__ */ t(
        m,
        {
          checked: a,
          indeterminate: e,
          onCheckedChange: (d) => {
            s?.(d);
          },
          "aria-label": o ?? "Select all rows",
          disabled: c,
          className: "relative before:absolute before:-inset-3 before:content-['']"
        }
      )
    }
  )
);
f.displayName = "Table";
_.displayName = "Table.Body";
b.displayName = "Table.Head";
N.displayName = "Table.Row";
u.displayName = "Table.Cell";
y.displayName = "Table.Footer";
T.displayName = "Table.Header";
p.displayName = "Table.ResizeHandle";
C.displayName = "Table.CheckCell";
k.displayName = "Table.CheckHead";
const R = Object.assign(f, {
  Header: T,
  Head: b,
  Row: N,
  Body: _,
  Cell: u,
  CheckCell: C,
  CheckHead: k,
  Footer: y,
  ResizeHandle: p
});
export {
  g as K,
  R as T,
  h as a
};
//# sourceMappingURL=table-CH9KC36S.js.map
