@bedrock-layout/stack
Version:
bedrock-layout stack layout primitive
19 lines (18 loc) • 583 B
JavaScript
import { createAttributeString as m, getSafeGutter as u, getPaddingAttributes as d } from "@bedrock-layout/spacing-constants";
import { forwardRefWithAs as l } from "@bedrock-layout/type-utils";
import p from "react";
const y = l(function({ as: t = "div", gap: e, align: r, padding: a, style: o = {}, ...i }, n) {
const c = m("align", r), s = u(e), f = d(a), g = [c, ...f].filter(Boolean).join(" ");
return /* @__PURE__ */ p.createElement(
t,
{
ref: n,
"data-br-stack": g,
style: { "--gap": s, ...o },
...i
}
);
});
export {
y as Stack
};