UNPKG

xtreme-ui

Version:

Collection of reusable components that can be used in web projects

34 lines (33 loc) 824 B
"use client"; import { jsx as l } from "react/jsx-runtime"; import { forwardRef as a } from "react"; import f from "clsx"; import "../../../utils/constants/theme.js"; import { unicodeToString as d } from "../../../utils/function/string.js"; import "color-namer"; /* empty css */ import { EIconSize as u } from "./types.js"; const x = a((i, e) => { const { className: r, style: n = {}, code: c, type: m = "light", size: o = "default", onClick: t } = i, s = `${typeof o == "number" ? o : u[o]}px`, p = f( "xtrIcon", "fa", m, t && "iconButton", r ); return /* @__PURE__ */ l( "i", { ref: e, className: p, style: { "--iconSize": s, ...n }, "data-content": d(c), role: "img", onClick: t } ); }); x.displayName = "Icon"; export { x as Icon };