adwaita-web
Version:
A GTK inspired toolkit designed to build awesome web apps
50 lines (49 loc) • 1.05 kB
JavaScript
import cx from "clsx";
import React from "react";
function Box({
children,
className,
inline,
compact,
fill,
border = false,
horizontal,
vertical,
align,
justify,
space,
padded,
expandChildren,
grow,
...rest
}) {
return /* @__PURE__ */ React.createElement("div", {
className: cx("Box", className, space ? `space-${space}` : void 0, typeof fill === "string" ? `fill-${fill}` : fill ? "fill" : void 0, typeof grow === "number" ? `grow-${grow}` : grow ? "grow" : void 0, alignClass(align), justifyClass(justify), {
inline,
compact,
vertical,
horizontal,
border,
padded,
"expand-children": expandChildren
}),
...rest
}, children);
}
function alignClass(align) {
if (align === true)
return "align";
if (typeof align === "string")
return `align-${align}`;
return void 0;
}
function justifyClass(justify) {
if (justify === true)
return "justify";
if (typeof justify === "string")
return `justify-${justify}`;
return void 0;
}
export {
Box
};