@janus-idp/shared-react
Version:
Shared code for utils, types, and React components for the Janus frontend plugins.
39 lines (36 loc) • 980 B
JavaScript
import React from 'react';
import cx from 'classnames';
import './HorizontalStackedBars.css.esm.js';
const HorizontalStackedBars = ({
id,
barGap,
height,
inline,
values,
width,
onClick
}) => /* @__PURE__ */ React.createElement(
"div",
{
id: `horizontal-stacked-bars-${id}`,
"data-testid": `horizontal-stacked-bars-${id}`,
className: cx("bs-shared-horizontal-stacked-bars", {
"is-inline": inline
}),
style: { height, width, ["--bar-gap"]: barGap && `${barGap}px` },
onClick
},
/* @__PURE__ */ React.createElement("div", { className: "bs-shared-horizontal-stacked-bars__bars" }, values.map(({ color, name, size }) => /* @__PURE__ */ React.createElement(
"div",
{
key: name,
className: "bs-shared-horizontal-stacked-bars__data-bar",
style: {
background: color,
flexGrow: size
}
}
)))
);
export { HorizontalStackedBars };
//# sourceMappingURL=HorizontalStackedBars.esm.js.map