@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
80 lines • 1.76 kB
JavaScript
import { c as _c } from "react-compiler-runtime";
import { forwardRef } from "react";
import classNames from "classnames";
import { jsx as _jsx } from "react/jsx-runtime";
const Inline = /*#__PURE__*/forwardRef((t0, ref) => {
const $ = _c(17);
let alignment;
let children;
let gap;
let props;
let t1;
let t2;
if ($[0] !== t0) {
const {
children: t3,
gap: t4,
align: t5,
...t6
} = t0;
children = t3;
props = t6;
gap = t4 === undefined ? 12 : t4;
const align = t5 === undefined ? "top" : t5;
alignment = align === "bottom" ? "flex-end" : align === "center" ? "center" : "flex-start";
t1 = props;
t2 = classNames("bf-inline", props?.className);
$[0] = t0;
$[1] = alignment;
$[2] = children;
$[3] = gap;
$[4] = props;
$[5] = t1;
$[6] = t2;
} else {
alignment = $[1];
children = $[2];
gap = $[3];
props = $[4];
t1 = $[5];
t2 = $[6];
}
const t3 = typeof gap === "number" ? gap + "px" : gap;
const t4 = props?.style;
let t5;
if ($[7] !== alignment || $[8] !== t3 || $[9] !== t4) {
t5 = {
alignItems: alignment,
"--bf-inline-gap": t3,
...t4
};
$[7] = alignment;
$[8] = t3;
$[9] = t4;
$[10] = t5;
} else {
t5 = $[10];
}
const t6 = t5;
let t7;
if ($[11] !== children || $[12] !== ref || $[13] !== t1 || $[14] !== t2 || $[15] !== t6) {
t7 = /*#__PURE__*/_jsx("div", {
...t1,
className: t2,
style: t6,
ref: ref,
children: children
});
$[11] = children;
$[12] = ref;
$[13] = t1;
$[14] = t2;
$[15] = t6;
$[16] = t7;
} else {
t7 = $[16];
}
return t7;
});
Inline.displayName = "Inline";
export default Inline;