@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
93 lines • 1.9 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 CardImage = /*#__PURE__*/forwardRef((t0, ref) => {
const $ = _c(21);
let aspectRatio;
let className;
let height;
let props;
let style;
let url;
if ($[0] !== t0) {
({
url,
className,
style,
height,
aspectRatio,
...props
} = t0);
$[0] = t0;
$[1] = aspectRatio;
$[2] = className;
$[3] = height;
$[4] = props;
$[5] = style;
$[6] = url;
} else {
aspectRatio = $[1];
className = $[2];
height = $[3];
props = $[4];
style = $[5];
url = $[6];
}
const anyHeightValue = height ?? style?.height ?? style?.minHeight;
let t1;
if ($[7] !== className) {
t1 = classnames("bf-card-image", className);
$[7] = className;
$[8] = t1;
} else {
t1 = $[8];
}
const t2 = `url(${url})`;
let t3;
if ($[9] !== anyHeightValue) {
t3 = anyHeightValue !== undefined && {
aspectRatio: "auto",
height: anyHeightValue
};
$[9] = anyHeightValue;
$[10] = t3;
} else {
t3 = $[10];
}
let t4;
if ($[11] !== aspectRatio || $[12] !== style || $[13] !== t2 || $[14] !== t3) {
t4 = {
backgroundImage: t2,
aspectRatio,
...t3,
...style
};
$[11] = aspectRatio;
$[12] = style;
$[13] = t2;
$[14] = t3;
$[15] = t4;
} else {
t4 = $[15];
}
let t5;
if ($[16] !== props || $[17] !== ref || $[18] !== t1 || $[19] !== t4) {
t5 = /*#__PURE__*/_jsx("div", {
...props,
className: t1,
ref: ref,
style: t4
});
$[16] = props;
$[17] = ref;
$[18] = t1;
$[19] = t4;
$[20] = t5;
} else {
t5 = $[20];
}
return t5;
});
CardImage.displayName = "Card.Image";
export default CardImage;