@lanaco/lnc-react-ui
Version:
React component library
56 lines (55 loc) • 1.31 kB
JavaScript
import { jsx as t } from "react/jsx-runtime";
import { forwardRef as y } from "react";
import { s as z } from "./emotion-styled.browser.esm-DfbrHHed.js";
import { d as I, c as g } from "./utils-BUdHa0nB.js";
import { u as b } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
const $ = z.span`
box-sizing: border-box;
${(e) => e.sizeInUnits && e.sizeInUnits != "" ? `font-size: ${e.sizeInUnits}` : I(e.theme, "Icon", e.size, "enabled")};
${(e) => e.color && `color: ${g(
e.theme,
"Icon",
e.color,
"enabled",
"icon"
)}`};
display: inline-flex;
justify-content: center;
align-items: center;
`, R = y((e, o) => {
const {
icon: n = "",
iconStyle: s = "solid",
tooltip: a = "",
sizeInUnits: i = "",
size: l = "small",
color: r,
className: c = "",
style: m = {},
...f
} = e, d = { theme: b(), size: l, color: r, sizeInUnits: i }, h = () => {
var u = s === "solid" ? "fas" : "far";
return `${u} fa-${n} fa-fw`;
};
return /* @__PURE__ */ t(
$,
{
ref: o,
...d,
tooltip: a,
className: c,
style: m,
...f,
children: /* @__PURE__ */ t(
"i",
{
"data-control": !!e["data-control"],
className: h()
}
)
}
);
});
export {
R as default
};