@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
66 lines • 1.78 kB
JavaScript
import { c as _c } from "react-compiler-runtime";
import { faArrowRight } from "@fortawesome/free-solid-svg-icons/faArrowRight";
import { faCheck } from "@fortawesome/free-solid-svg-icons/faCheck";
import classNames from "classnames";
import Icon from "../Icon/Icon.js";
import { jsx as _jsx } from "react/jsx-runtime";
const IconStep = t0 => {
const $ = _c(11);
const {
variant: t1,
marginRight: t2,
marginLeft: t3,
className: t4
} = t0;
const variant = t1 === undefined ? "default" : t1;
const marginRight = t2 === undefined ? false : t2;
const marginLeft = t3 === undefined ? false : t3;
const className = t4 === undefined ? "" : t4;
const t5 = "bf-step-icon bf-step-" + variant;
let t6;
if ($[0] !== className || $[1] !== marginLeft || $[2] !== marginRight || $[3] !== t5) {
t6 = classNames(t5, className, {
"bf-icon-margin-left": marginLeft,
"bf-icon-margin-right": marginRight
});
$[0] = className;
$[1] = marginLeft;
$[2] = marginRight;
$[3] = t5;
$[4] = t6;
} else {
t6 = $[4];
}
let t7;
if ($[5] !== variant) {
t7 = variant === "active" ? /*#__PURE__*/_jsx(Icon, {
icon: faArrowRight
}) : variant === "completed" ? /*#__PURE__*/_jsx(Icon, {
icon: faCheck
}) : /*#__PURE__*/_jsx("span", {
children: "\xA0"
});
$[5] = variant;
$[6] = t7;
} else {
t7 = $[6];
}
let t8;
if ($[7] !== t6 || $[8] !== t7 || $[9] !== variant) {
t8 = /*#__PURE__*/_jsx("span", {
role: "img",
"aria-label": variant,
className: t6,
children: t7
});
$[7] = t6;
$[8] = t7;
$[9] = variant;
$[10] = t8;
} else {
t8 = $[10];
}
return t8;
};
IconStep.displayName = "Icon.Step";
export default IconStep;