@hitachivantara/uikit-react-icons
Version:
NEXT Design System icons packaged as a set of React components.
21 lines (20 loc) • 694 B
JavaScript
import { isSelector, isSort } from "./utils.js";
import { IconBase } from "./IconBase.js";
import { jsx } from "react/jsx-runtime";
//#region src/IconSprite.tsx
var getSecondaryColor = (iconName) => {
if (isSelector(iconName)) return "bgContainer";
if (isSort(iconName)) return "border";
return "bgPage";
};
/** The HvIconSprite component is used to display SVG icons from a sprite sheet. */
var HvIconSprite = ({ spriteUrl, iconName, ...others }) => {
return /* @__PURE__ */ jsx(IconBase, {
iconName,
palette: ["text", getSecondaryColor(iconName)],
...others,
children: /* @__PURE__ */ jsx("use", { href: `${spriteUrl}#${iconName}` })
});
};
//#endregion
export { HvIconSprite };