@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
88 lines • 1.9 kB
JavaScript
import { c as _c } from "react-compiler-runtime";
import { forwardRef } from "react";
import classnames from "classnames";
import SkeletonRect from "./Skeleton.Rect.js";
import { jsx as _jsx } from "react/jsx-runtime";
const SkeletonCardImage = /*#__PURE__*/forwardRef((t0, ref) => {
const $ = _c(20);
let aspectRatio;
let className;
let height;
let props;
let style;
if ($[0] !== t0) {
({
className,
style,
height,
aspectRatio,
...props
} = t0);
$[0] = t0;
$[1] = aspectRatio;
$[2] = className;
$[3] = height;
$[4] = props;
$[5] = style;
} else {
aspectRatio = $[1];
className = $[2];
height = $[3];
props = $[4];
style = $[5];
}
const anyHeightValue = height ?? style?.height ?? style?.minHeight;
let t1;
if ($[6] !== className) {
t1 = classnames(className, "bf-card-image");
$[6] = className;
$[7] = t1;
} else {
t1 = $[7];
}
let t2;
if ($[8] !== anyHeightValue) {
t2 = anyHeightValue !== undefined && {
aspectRatio: "auto"
};
$[8] = anyHeightValue;
$[9] = t2;
} else {
t2 = $[9];
}
let t3;
if ($[10] !== aspectRatio || $[11] !== style || $[12] !== t2) {
t3 = {
aspectRatio,
...t2,
...style
};
$[10] = aspectRatio;
$[11] = style;
$[12] = t2;
$[13] = t3;
} else {
t3 = $[13];
}
let t4;
if ($[14] !== anyHeightValue || $[15] !== props || $[16] !== ref || $[17] !== t1 || $[18] !== t3) {
t4 = /*#__PURE__*/_jsx(SkeletonRect, {
...props,
className: t1,
style: t3,
height: anyHeightValue,
ref: ref
});
$[14] = anyHeightValue;
$[15] = props;
$[16] = ref;
$[17] = t1;
$[18] = t3;
$[19] = t4;
} else {
t4 = $[19];
}
return t4;
});
SkeletonCardImage.displayName = "Skeleton.CardImage";
export default SkeletonCardImage;