UNPKG

@hakit/components

Version:
42 lines (41 loc) 2.84 kB
import { j as e, a as n } from "../../../../../emotion-react-jsx-runtime.browser.esm-BErL7L7Y.js"; import { c as p } from "../../../../../emotion-styled-base.browser.esm-Dyg8Y4aq.js"; import { formatNumber as c } from "@hakit/core"; function m() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } const h = /* @__PURE__ */ p("div", process.env.NODE_ENV === "production" ? { target: "eih3n4n0" } : { target: "eih3n4n0", label: "StyledBigNumber" })(process.env.NODE_ENV === "production" ? { name: "1nj368h", styles: "font-size:57px;line-height:1.12;letter-spacing:-0.25px;.value{display:flex;margin:0;direction:ltr;}.displayed-value{display:inline-flex;flex-direction:row;align-items:flex-end;}.addon{display:flex;flex-direction:column-reverse;padding:4px 0;height:100%;}.addon.bottom{flex-direction:column;align-items:baseline;}.addon.bottom .unit{margin-bottom:4px;margin-left:2px;}.value .decimal{font-size:0.42em;line-height:1.33;}.value .unit{font-size:0.33em;line-height:1.26;}.visually-hidden{position:absolute;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0;}" } : { name: "1nj368h", styles: "font-size:57px;line-height:1.12;letter-spacing:-0.25px;.value{display:flex;margin:0;direction:ltr;}.displayed-value{display:inline-flex;flex-direction:row;align-items:flex-end;}.addon{display:flex;flex-direction:column-reverse;padding:4px 0;height:100%;}.addon.bottom{flex-direction:column;align-items:baseline;}.addon.bottom .unit{margin-bottom:4px;margin-left:2px;}.value .decimal{font-size:0.42em;line-height:1.33;}.value .unit{font-size:0.33em;line-height:1.26;}.visually-hidden{position:absolute;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0;}", toString: m }); function b({ value: l, unit: t, unitPosition: o = "top", formatOptions: d = {} }) { const i = c(l, d), [a] = i.includes(".") ? i.split(".") : i.split(","), s = i.replace(a, ""), r = `${l}${t ? `${t}` : ""}`; return /* @__PURE__ */ e(h, { children: /* @__PURE__ */ n("p", { className: "value", children: [ /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "displayed-value", children: [ /* @__PURE__ */ e("span", { children: a }), /* @__PURE__ */ n("span", { className: `addon ${o === "bottom" ? "bottom" : ""}`, children: [ /* @__PURE__ */ e("span", { className: "decimal", children: s }), /* @__PURE__ */ e("span", { className: "unit", children: t }) ] }) ] }), /* @__PURE__ */ e("span", { className: "visually-hidden", children: r }) ] }) }); } export { b as BigNumber }; //# sourceMappingURL=BigNumber.js.map