@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
22 lines (21 loc) • 943 B
JavaScript
/* eslint-disable @typescript-eslint/no-explicit-any */ import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from "react";
import classNames from "classnames";
/**
* Responsive CSS Grid layout container, renders its children as columns based on a column width (300px columns by default)
*/ const AutoCol = /*#__PURE__*/ forwardRef(({ children, className, style, gap, width, ...props }, ref)=>{
const styles = {
...style,
["--bf-autocol-gap"]: typeof gap === "number" ? gap + "px" : typeof gap === "string" ? gap : undefined,
["--bf-autocol-width"]: typeof width === "number" ? width + "px" : typeof width === "string" ? width : undefined
};
return /*#__PURE__*/ _jsx("div", {
...props,
ref: ref,
className: classNames("bf-autocol", className),
style: styles,
children: children
});
});
AutoCol.displayName = "AutoCol";
export default AutoCol;