@frontify/fondue
Version:
Design system of Frontify
17 lines (16 loc) • 746 B
JavaScript
import { jsxs as s, jsx as n } from "react/jsx-runtime";
import { TinyColor as p } from "@ctrl/tinycolor";
import { toShortRgb as i, getColorDisplayValue as m } from "../../utilities/colors.es.js";
import { ColorFormat as c } from "../../types/colors.es.js";
const d = ({ currentColor: o, format: t }) => {
const { name: a, alpha: l } = o, e = new p(i(o)), r = m(o, t, !1);
return /* @__PURE__ */ s("div", { className: "tw-text-black-100", children: [
a || r,
t === c.Hex && l && l < 1 && /* @__PURE__ */ n("span", { className: "tw-text-black-60", children: ` ${Math.trunc(e.getAlpha() * 100)} %` })
] });
};
d.displayName = "FondueColorInputTitle";
export {
d as ColorInputTitle
};
//# sourceMappingURL=ColorInputTitle.es.js.map