alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
43 lines (40 loc) • 951 B
JavaScript
import "../chunks/chunk-U5RRZUYZ.js";
// src/ui/Badge.module.scss
var Badge_module_default = {
"root": "alinea-Badge",
"root-number": "alinea-Badge-number",
"rootNumber": "alinea-Badge-number"
};
// src/ui/Badge.tsx
import { fromModule } from "./util/Styler.js";
import { px } from "./util/Units.js";
import { jsx, jsxs } from "react/jsx-runtime";
var styles = fromModule(Badge_module_default);
function Badge({
children,
amount,
top,
right,
bottom,
left
}) {
return /* @__PURE__ */ jsxs("div", { className: styles.root(), children: [
/* @__PURE__ */ jsx("div", { children }),
Number(amount) > 0 && /* @__PURE__ */ jsx(
"span",
{
className: styles.root.number(),
style: {
top: top && px(top),
right: right && px(right),
bottom: bottom && px(bottom),
left: left && px(left)
},
children: amount
}
)
] });
}
export {
Badge
};