@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
60 lines • 1.37 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";
/**
* Banner component
*
* @deprecated since 5.0 - will be removed in next major. Maybe you're looking
* for `<Message statusBar />` instead?
*
* @see https://bifrost.intility.com/react/message#status-bar
*/
const Banner = /*#__PURE__*/forwardRef((t0, ref) => {
const $ = _c(9);
let T0;
let props;
let t1;
if ($[0] !== t0) {
const {
className,
align: t2,
...t3
} = t0;
props = t3;
const align = t2 === undefined ? "right" : t2;
const isButton = props?.hasOwnProperty("onClick");
const El = isButton ? "button" : "div";
T0 = El;
t1 = classnames("bf-banner", className, {
"bf-banner-button": isButton,
"bf-banner-left": align === "left"
});
$[0] = t0;
$[1] = T0;
$[2] = props;
$[3] = t1;
} else {
T0 = $[1];
props = $[2];
t1 = $[3];
}
let t2;
if ($[4] !== T0 || $[5] !== props || $[6] !== ref || $[7] !== t1) {
t2 = /*#__PURE__*/_jsx(T0, {
className: t1,
...props,
ref: ref
});
$[4] = T0;
$[5] = props;
$[6] = ref;
$[7] = t1;
$[8] = t2;
} else {
t2 = $[8];
}
return t2;
});
Banner.displayName = "Banner";
export default Banner;