"use client";
import { j as m } from "./index.esm38.js";
import { forwardRef as y } from "react";
import v from "./index.esm40.js";
import { getSpacingVar as n } from "./index.esm3.js";
import b from "./index.esm61.js";
const j = y(
  ({
    columns: r = 12,
    gap: g = 4,
    minColumnWidth: e,
    as: s = "div",
    children: f,
    className: o,
    testId: d,
    ...a
  }, p) => {
    const x = n(g), l = (() => {
      const t = {
        gap: x
      };
      if (e)
        return t.gridTemplateColumns = `repeat(auto-fit, minmax(${e}, 1fr))`, t;
      if (typeof r == "number")
        return t.gridTemplateColumns = `repeat(${r}, 1fr)`, t;
      if (typeof r == "object") {
        const i = {};
        r.xs !== void 0 && (i["--grid-cols-xs"] = String(r.xs)), r.sm !== void 0 && (i["--grid-cols-sm"] = String(r.sm)), r.md !== void 0 && (i["--grid-cols-md"] = String(r.md)), r.lg !== void 0 && (i["--grid-cols-lg"] = String(r.lg)), r.xl !== void 0 && (i["--grid-cols-xl"] = String(r.xl)), r["2xl"] !== void 0 && (i["--grid-cols-2xl"] = String(r["2xl"]));
        const S = r.xs || r.sm || r.md || r.lg || r.xl || r["2xl"] || 1;
        return t.gridTemplateColumns = `repeat(${S}, 1fr)`, { ...t, ...i };
      }
      return t;
    })();
    return /* @__PURE__ */ m.jsx(
      s,
      {
        ref: p,
        "data-atme-ui": !0,
        className: v(b.grid, o),
        style: {
          ...l,
          ...a.style
        },
        ...d && { "data-testid": d },
        ...a,
        children: f
      }
    );
  }
);
j.displayName = "Grid";
export {
  j as Grid
};
//# sourceMappingURL=index.esm28.js.map
